From ebe7df84d556667a2e42ffa7701fbe0055fc0f05 Mon Sep 17 00:00:00 2001 From: zyn Date: Tue, 30 Jan 2024 13:38:54 +0800 Subject: [PATCH] =?UTF-8?q?feature:=20=E6=A0=87=E5=87=86=E8=B7=9F=E8=B8=AA?= =?UTF-8?q?=E6=B8=85=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hzwlComponents/UploadFormItem.vue | 8 ++ .../standardTrackingList/Inventory.vue | 13 +- .../standardTrackingList/addModel.vue | 29 ++++- .../standardTrackingList/index.vue | 111 +++++++++++++++++- 4 files changed, 145 insertions(+), 16 deletions(-) diff --git a/src/components/hzwlComponents/UploadFormItem.vue b/src/components/hzwlComponents/UploadFormItem.vue index 7515ca3c9..3c5371ae9 100644 --- a/src/components/hzwlComponents/UploadFormItem.vue +++ b/src/components/hzwlComponents/UploadFormItem.vue @@ -123,6 +123,11 @@ export default { FileList: [], // 用于回显 } }, + watch: { + ids (val) { + this.initFileList() + }, + }, created () { this.initFileList() }, @@ -143,6 +148,9 @@ export default { } this.fileList = fileList this.FileList = fileList + } else { + this.fileList = [] + this.FileList = [] } }, beforeUpload (file) { diff --git a/src/pages/policyRegulation/standardTrackingList/Inventory.vue b/src/pages/policyRegulation/standardTrackingList/Inventory.vue index c03872c65..ecf58e33b 100644 --- a/src/pages/policyRegulation/standardTrackingList/Inventory.vue +++ b/src/pages/policyRegulation/standardTrackingList/Inventory.vue @@ -19,7 +19,7 @@ [] } @@ -151,7 +151,7 @@ export default { this.selectedList = selection }, dragIn ({ list, type }) { - if (list.some(item => this.data.some(i => i.id === item.id))) { + if (list.some(item => this.value.some(i => i.lawId === item.id))) { this.$message.warning('请勿重复添加数据') return } @@ -171,7 +171,7 @@ export default { break } return { - id: item.id, + lawId: item.id, dataSource: type, lawCode, lawName, @@ -180,7 +180,7 @@ export default { implRequire: '' } }) - this.data.push(...newList) + this.$emit('input', [ ...this.value, ...newList ]) }, handleDeleteStandard () { if (this.selectedList.length === 0) { @@ -194,7 +194,8 @@ export default { confirmButtonClass: 'common-button-primary', roundButton: true }).then(() => { - this.data = this.data.filter(item => !this.selectedList.some(i => i.id === item.id)) + const list = this.value.filter(item => !this.selectedList.some(i => i.id === item.id)) + this.$emit('input', list) }) }, getDicTypeListCode () { diff --git a/src/pages/policyRegulation/standardTrackingList/addModel.vue b/src/pages/policyRegulation/standardTrackingList/addModel.vue index c72df084f..21f598b40 100644 --- a/src/pages/policyRegulation/standardTrackingList/addModel.vue +++ b/src/pages/policyRegulation/standardTrackingList/addModel.vue @@ -30,8 +30,9 @@ - + + 数据获取中... - + + + + + + +
+ 取消 + 确定 +
+