Commit fda940ccc5c15cbbd8bbc823123e524cc6cceb93
Merge branch 'f-dev' into 'main'
fix:修改意见反馈编辑回显问题 See merge request huang/yun-teng-iot-front!204
Showing
2 changed files
with
13 additions
and
11 deletions
| ... | ... | @@ -7,7 +7,12 @@ |
| 7 | 7 | <span style="display: none">{{ index }}</span> |
| 8 | 8 | <div> |
| 9 | 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 | 16 | </Upload> |
| 12 | 17 | </div> |
| 13 | 18 | </template> |
| ... | ... | @@ -52,17 +57,17 @@ |
| 52 | 57 | feedBackImgUrl.value = []; |
| 53 | 58 | setDrawerProps({ confirmLoading: false }); |
| 54 | 59 | await setFieldsValue(data.record); |
| 55 | - try { | |
| 56 | - const contactFormJson = JSON.parse(data.record.contact); | |
| 60 | + if (data.record.images) { | |
| 57 | 61 | const imageFormJson = JSON.parse(data.record.images); |
| 58 | 62 | feedBackImgUrl.value = imageFormJson; |
| 63 | + } | |
| 64 | + if (data.record.contact) { | |
| 65 | + const contactFormJson = JSON.parse(data.record.contact); | |
| 59 | 66 | await setFieldsValue({ |
| 60 | - qq: contactFormJson.qq, | |
| 61 | 67 | email: contactFormJson.email, |
| 62 | 68 | phone: contactFormJson.phone, |
| 69 | + qq: contactFormJson.qq, | |
| 63 | 70 | }); |
| 64 | - } catch (e) { | |
| 65 | - console.log('意见反馈', e); | |
| 66 | 71 | } |
| 67 | 72 | }); |
| 68 | 73 | const handlePreview = async (item) => { | ... | ... |
| ... | ... | @@ -144,17 +144,14 @@ |
| 144 | 144 | }); |
| 145 | 145 | }; |
| 146 | 146 | function showData(record: Recordable) { |
| 147 | - try { | |
| 148 | - const jsonContact = JSON.parse(record.contact); | |
| 147 | + if (record.contact) { | |
| 149 | 148 | Modal.info({ |
| 150 | 149 | title: '当前反馈方式', |
| 151 | 150 | width: 600, |
| 152 | 151 | centered: true, |
| 153 | 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 | 157 | return { | ... | ... |