From 9d58ff175b211a570fd78b7d909747166175fce3 Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Wed, 6 Jul 2022 14:59:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9bug=20=E5=85=9A=E5=BB=BA=E5=A3=B0?= =?UTF-8?q?=E9=9F=B3=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modules/communityParty/article/drafts.vue | 4 +- .../modules/communityParty/article/index.vue | 6 ++- src/views/modules/cpts/base/cpts/edit.vue | 39 +++++++++++++++---- src/views/modules/cpts/base/index.vue | 20 +++++++++- 4 files changed, 58 insertions(+), 11 deletions(-) diff --git a/src/views/modules/communityParty/article/drafts.vue b/src/views/modules/communityParty/article/drafts.vue index 8a882997..1451da54 100644 --- a/src/views/modules/communityParty/article/drafts.vue +++ b/src/views/modules/communityParty/article/drafts.vue @@ -56,7 +56,7 @@ export default { field: "创建时间", keyName: "createdTime", type: "date-range", - supKeys: ["startTime", "endTime"], + supKeys: ["startDate", "endDate"], supValues: ["", ""], }, ], @@ -102,9 +102,11 @@ export default { keyName: "imgArr", type: "upload", limit: 1, + listType: 'picture-card', editDisabled: true, rules: [], value: () => [], + uploadUrl: window.SITE_CONFIG["apiURL"] + "/oss/file/article/upload", supKeys: ["imgUrlArr", "imgUrl"], supValues: [() => [], ""], beforeImgUpload(file, item, that) { diff --git a/src/views/modules/communityParty/article/index.vue b/src/views/modules/communityParty/article/index.vue index 18c6f8db..333d13e9 100644 --- a/src/views/modules/communityParty/article/index.vue +++ b/src/views/modules/communityParty/article/index.vue @@ -151,6 +151,8 @@ export default { "agencyId", "subAgencyList" )[vals.length - 1]["level"]; + item["supValues"][1] = + item["supValues"][1] == "grid" ? "grid" : "agency"; } else { item["supValues"][0] = ""; item["supValues"][1] = ""; @@ -161,7 +163,7 @@ export default { field: "发布时间", keyName: "publishTime", type: "date-range", - supKeys: ["startTime", "endTime"], + supKeys: ["startDate", "endDate"], supValues: ["", ""], }, ], @@ -221,9 +223,11 @@ export default { keyName: "imgArr", type: "upload", limit: 1, + listType: "picture-card", editDisabled: true, rules: [], value: () => [], + uploadUrl: window.SITE_CONFIG["apiURL"] + "/oss/file/article/upload", supKeys: ["imgUrlArr", "imgUrl"], supValues: [() => [], ""], beforeImgUpload(file, item, that) { diff --git a/src/views/modules/cpts/base/cpts/edit.vue b/src/views/modules/cpts/base/cpts/edit.vue index 9a2226ef..73cd539c 100644 --- a/src/views/modules/cpts/base/cpts/edit.vue +++ b/src/views/modules/cpts/base/cpts/edit.vue @@ -198,24 +198,24 @@ " ref="upload" class="avatar-uploader" - :action="uploadUrl" + :class="{ 'z-full': fmData[item.keyName].length >= item.limit }" + :action="item.uploadUrl || uploadUrl" :data="{ customerId: customerId }" :show-file-list="true" :list-type="item.listType || 'picture'" :limit="item.limit || 100" :file-list="fmData[item.keyName]" :on-success="(res, file) => handleImgSuccess(res, file, item)" + :on-error="(res, file) => handleImgError(res, file, item)" :on-remove="(res) => handleImgRemove(res, item)" :on-exceed="(res) => handleImgExceed(res, item)" :before-upload="(file) => beforeImgUpload(file, item)" > - 点击上传 + 点击上传 { - item.value = ""; + if (typeof item.value == "string") { + item.value = ""; + } else if (Array.isArray(item.value)) { + item.value = []; + } + if (item.supValues) { + item.supValues = item.supValues.map((value, index) => { + if (typeof value == "string") { + return ""; + } else if (Array.isArray(value)) { + return []; + } + return value; + }); + } }); }, },