From f163558c0c20e41131613b8680beb6036d6e0b32 Mon Sep 17 00:00:00 2001 From: qq787203167 <787203167@qq.com> Date: Sat, 2 Jul 2022 14:19:03 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A6=85=E9=81=93=E5=B7=B2?= =?UTF-8?q?=E7=9F=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/tableCollection/index.vue | 1 + .../ParameterItemCollectionList.vue | 66 ++++++++++++++++++- 2 files changed, 65 insertions(+), 2 deletions(-) diff --git a/jero-web/src/components/tableCollection/index.vue b/jero-web/src/components/tableCollection/index.vue index cc7ae0aa4..ffb6d6052 100644 --- a/jero-web/src/components/tableCollection/index.vue +++ b/jero-web/src/components/tableCollection/index.vue @@ -621,6 +621,7 @@ this.selectedRowrowValue = [] this.$emit('value', this.selectedRowKeys) this.$emit('rowValue', this.selectedRowrowValue) + this.$emit('getDataSource', this.dataSource) setTimeout(() => { this.loading = false }, 500) diff --git a/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue b/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue index ca847d402..2d1e8886f 100644 --- a/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue +++ b/jero-web/src/views/projectManagement/components/ParameterItemCollectionList.vue @@ -130,6 +130,11 @@ {{$t('referenceparameter')}} + +
+ + {{$t('preservation')}} +
@@ -157,7 +162,9 @@
@@ -503,9 +510,15 @@ }, mounted() { this.GetgetLoginUserType() + this.time = setInterval(() => { + this.handlePreservation() + }, 10000) this.paramsManifest = JSON.parse(localStorage.getItem('paramsManifest')) document.title = `${this.paramsManifest.title}-` + this.$t('ParameteItemCollectionList') }, + beforeDestroy() { + clearInterval(this.time); + }, methods: { ...mapGetters(['userInfo']), handleCancelRoleSwitching() { @@ -814,7 +827,7 @@ } return flag }, - LoginUserType(val, currentPersonRole,userType) { + LoginUserType(val, currentPersonRole, userType) { this.RoleType = [] if (this.currentPersonRole == '') { this.currentPersonRole = currentPersonRole || userType || val[0].value @@ -1001,6 +1014,55 @@ this.NoEngineer = 1 } }, + getDataSource(data) { + this.dataSource = data + }, + handlePreservation(num) { + let _this = this + let postDate = [] + let data = JSON.parse(JSON.stringify(this.dataSource)) + let selectedRowKeysValue = [] + data.forEach(res => { + if (res.state == 'Wait Fill' || res.state == '待填写') { + selectedRowKeysValue.push(res) + } + }) + for (let i = 0; i < selectedRowKeysValue.length; i++) { + let postDateobj = {} + let itemIn = Object.keys(selectedRowKeysValue[i]) + for (let j = 0; j < itemIn.length; j++) { + if (itemIn[j] !== 'sdt') { + if (selectedRowKeysValue[i][itemIn[j]] instanceof Object && !(selectedRowKeysValue[i][itemIn[j]] instanceof Array)) { + postDateobj[itemIn[j]] = selectedRowKeysValue[i][itemIn[j]] + for (let k = 0; k < selectedRowKeysValue[i][itemIn[j]].list.length; k++) { + if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'pull_more') { + selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.join(',') + } + if (selectedRowKeysValue[i][itemIn[j]].list[k].type == 'text' && selectedRowKeysValue[i][itemIn[j]].list[k].dataValue !== null) { + selectedRowKeysValue[i][itemIn[j]].list[k].dataValue = selectedRowKeysValue[i][itemIn[j]].list[k].dataValue.toString() + } + } + } + } + } + postDateobj.id = selectedRowKeysValue[i].id + postDate.push(postDateobj) + } + let configDataList = { configDataList: postDate } + if (selectedRowKeysValue && selectedRowKeysValue.length > 0) { + postAction('/params/collectManifest/save', configDataList).then((res) => { + if (res.success) { + if (num && num == 1) { + _this.$message.success(_this.$t('OperationSuccessful')) + } + } else { + if (num && num == 1) { + _this.$message.warning(_this.$t('operationFailed')) + } + } + }) + } + }, // 提交数据 ishandleSubmit() { let _this = this