Commit 75014f5b6adcc215af64bf8cdc4b95972b402ae0

Authored by fengtao
1 parent b3e18f19

fix:修改意见反馈编辑回显问题

@@ -7,7 +7,12 @@ @@ -7,7 +7,12 @@
7 <span style="display: none">{{ index }}</span> 7 <span style="display: none">{{ index }}</span>
8 <div> 8 <div>
9 <Upload list-type="picture-card" :openFileDialogOnClick="false"> 9 <Upload list-type="picture-card" :openFileDialogOnClick="false">
10 - <img @click="handlePreview(item)" :src="item" alt="avatar" /> 10 + <img
  11 + style="width: 100%; height: 11vh"
  12 + @click="handlePreview(item)"
  13 + :src="item"
  14 + alt="avatar"
  15 + />
11 </Upload> 16 </Upload>
12 </div> 17 </div>
13 </template> 18 </template>
@@ -52,17 +57,17 @@ @@ -52,17 +57,17 @@
52 feedBackImgUrl.value = []; 57 feedBackImgUrl.value = [];
53 setDrawerProps({ confirmLoading: false }); 58 setDrawerProps({ confirmLoading: false });
54 await setFieldsValue(data.record); 59 await setFieldsValue(data.record);
55 - try {  
56 - const contactFormJson = JSON.parse(data.record.contact); 60 + if (data.record.images) {
57 const imageFormJson = JSON.parse(data.record.images); 61 const imageFormJson = JSON.parse(data.record.images);
58 feedBackImgUrl.value = imageFormJson; 62 feedBackImgUrl.value = imageFormJson;
  63 + }
  64 + if (data.record.contact) {
  65 + const contactFormJson = JSON.parse(data.record.contact);
59 await setFieldsValue({ 66 await setFieldsValue({
60 - qq: contactFormJson.qq,  
61 email: contactFormJson.email, 67 email: contactFormJson.email,
62 phone: contactFormJson.phone, 68 phone: contactFormJson.phone,
  69 + qq: contactFormJson.qq,
63 }); 70 });
64 - } catch (e) {  
65 - console.log('意见反馈', e);  
66 } 71 }
67 }); 72 });
68 const handlePreview = async (item) => { 73 const handlePreview = async (item) => {
@@ -144,17 +144,14 @@ @@ -144,17 +144,14 @@
144 }); 144 });
145 }; 145 };
146 function showData(record: Recordable) { 146 function showData(record: Recordable) {
147 - try {  
148 - const jsonContact = JSON.parse(record.contact); 147 + if (record.contact) {
149 Modal.info({ 148 Modal.info({
150 title: '当前反馈方式', 149 title: '当前反馈方式',
151 width: 600, 150 width: 600,
152 centered: true, 151 centered: true,
153 maskClosable: true, 152 maskClosable: true,
154 - content: h(JsonPreview, { data: jsonContact }), 153 + content: h(JsonPreview, { data: JSON.parse(record.contact) }),
155 }); 154 });
156 - } catch (e) {  
157 - console.log('意见反馈', e);  
158 } 155 }
159 } 156 }
160 return { 157 return {