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

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

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

Loading…
Cancel
Save