Browse Source

init

master
nicky 5 months ago
parent
commit
1ff913dea6
  1. 2
      src/layouts/BasicLayout.vue
  2. 24
      src/views/thrombolysis/components/throm-before3.vue

2
src/layouts/BasicLayout.vue

@ -173,6 +173,7 @@
});
},
methods: {
...mapMutations('patient', ['setPatientData', 'setPatientDataCur']),
handleClickMenu(item, index) {
if (index != this.current) {
this.current_ = this.current
@ -206,6 +207,7 @@
if(this.$route.name != 'Thrombolysis') this.$router.push('/firstaid/thrombolysis')
}else{
this.setPatientData({});
this.setPatientDataCur({});
if(this.$route.name != 'PatientList') this.$router.replace('/firstaid/patientList')
}

24
src/views/thrombolysis/components/throm-before3.vue

@ -22,6 +22,7 @@
</div>
</a-card>
<div class="btns" v-if="!outside">
<input type="file" ref="fileInput" @change="onFileChange" accept="image/*" style="display: none;" />
<a-button :disabled="writeAble" class="common-button" block size="large" v-if="fileList.length < 5"
@click="openCamera">上传院前CT图片</a-button>
<a-button :disabled="writeAble" class="common-button" block type="primary" size="large"
@ -139,19 +140,19 @@
this.$message.success('患者已审核,内容不可更改')
return
}
if (!window.plus) {
// H5 使 `plus` API
this.$message.success('当前环境不支持 plus API')
return
// console.log(' plus API');
}
// if (!window.plus) {
// // H5 使 `plus` API
// this.$message.success(' plus API')
// return
// // console.log(' plus API');
// }
const cmr = plus.camera.getCamera();
if (!cmr) {
this.$message.success('没有可用的摄像头');
return;
}
const res = cmr.supportedImageResolutions.length > 0 ? cmr.supportedImageResolutions[0] : null;
const fmt = cmr.supportedImageFormats.length > 0 ? cmr.supportedImageFormats[0] : null;
const res = cmr.supportedImageResolutions.length > 0 ? cmr.supportedImageResolutions[0] : { width: 640, height: 480 }; // ;
const fmt = cmr.supportedImageFormats.length > 0 ? cmr.supportedImageFormats[0] : 'jpeg';
if (!res || !fmt) {
plus.nativeUI.toast('摄像头不支持该格式或分辨率');
return;
@ -202,6 +203,13 @@
}
);
},
onFileChange(event) {
const file = event.target.files[0];
if (file) {
//
this.compressImage(file);
}
},
//
showPics(url, name) {
let _this = this;

Loading…
Cancel
Save