Browse Source

图片上传+现实问题

master
aBin 4 years ago
parent
commit
083507e70c
  1. 12
      src/App.vue
  2. 41
      src/views/PatientInfo/PatientInfo.vue

12
src/App.vue

@ -3,7 +3,7 @@
* @email: 18603454788@163.com
* @Date: 2021-04-19 10:23:19
* @LastEditors: wally
* @LastEditTime: 2021-05-12 17:22:33
* @LastEditTime: 2021-05-13 18:05:36
-->
<template>
<a-config-provider :locale="zh_CN">
@ -39,11 +39,11 @@ export default {
},
},
created() {
// async created() {
// const userId = '1210049212671201280';
// const params = { userId };
// await this.getUserId(params);
// await this.getToken();
// async created() {
// const userId = '1390209035248209925';
// const params = { userId };
// await this.getUserId(params);
// await this.getToken();
if (localStorage.getItem('patientId')) {
this.setPatientId(localStorage.getItem('patientId'));
}

41
src/views/PatientInfo/PatientInfo.vue

@ -39,7 +39,6 @@
<div v-else-if="a.type === 7">
<a-upload
:action="action"
:default-file-list="fileList"
:headers="headers"
@change="fileChange($event, a.id)"
:before-upload="beforeUpload1"
@ -164,8 +163,8 @@
<div v-else-if="h.type === 7">
<a-upload
:action="action"
:default-file-list="fileList"
:headers="headers"
:default-file-list="getDefultList(h.answer, h.domList)"
@change="fileChange($event, h.id)"
list-type="picture"
:before-upload="beforeUpload1"
@ -427,8 +426,8 @@
<div v-else-if="h.type === 7">
<a-upload
:action="action"
:default-file-list="fileList"
:headers="headers"
:default-file-list="getDefultList(h.answer, h.domList)"
@change="fileChange($event, h.id)"
:before-upload="beforeUpload1"
list-type="picture"
@ -701,8 +700,8 @@
<div v-else-if="e.type === 7">
<a-upload
:action="action"
:default-file-list="fileList"
:headers="headers"
:default-file-list="getDefultList(e.answer, e.domList)"
@change="fileChange($event, e.id, e.recordId)"
:before-upload="beforeUpload1"
list-type="picture"
@ -829,8 +828,8 @@
<div v-else-if="h.type === 7">
<a-upload
:action="action"
:default-file-list="fileList"
:headers="headers"
:default-file-list="getDefultList(h.answer, h.domList)"
@change="fileChange($event, h.id)"
:before-upload="beforeUpload1"
list-type="picture"
@ -1096,7 +1095,7 @@
<div v-else-if="h.type === 7">
<a-upload
:action="action"
:default-file-list="fileList"
:default-file-list="getDefultList(h.answer, h.domList)"
:headers="headers"
@change="fileChange($event, h.id)"
:before-upload="beforeUpload1"
@ -1504,6 +1503,36 @@ export default {
},
methods: {
...mapMutations('home', ['setCallback']),
/**
* 获取默认的图片数组
*/
getDefultList(answer, list) {
let arr = [];
if (list.length) {
for (let i = 0; i < list.length; i++) {
let obj = {
uid: i,
url: list[i],
status: 'done',
name: `${i}`,
};
arr.push(obj);
}
}
if (answer) {
let obj = {
uid: 0,
url: answer,
status: 'done',
name: `${0}`,
};
console.log([{ ...obj }, ...arr]);
return [{ ...obj }, ...arr];
} else {
console.log(arr);
return [...arr];
}
},
/**
* 重新选择病例
*/

Loading…
Cancel
Save