From 9f7389a8625d05e4caa0e6579c6564db4f4ca025 Mon Sep 17 00:00:00 2001 From: zhaomeijing Date: Tue, 31 May 2022 14:58:32 +0800 Subject: [PATCH] =?UTF-8?q?[update]=20=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dialog/ProjectCollectionParameters.vue | 103 ++++++++---------- 1 file changed, 47 insertions(+), 56 deletions(-) diff --git a/jero-web/src/views/projectManagement/dialog/ProjectCollectionParameters.vue b/jero-web/src/views/projectManagement/dialog/ProjectCollectionParameters.vue index bd7f9aa2e..a8bfd9dbe 100644 --- a/jero-web/src/views/projectManagement/dialog/ProjectCollectionParameters.vue +++ b/jero-web/src/views/projectManagement/dialog/ProjectCollectionParameters.vue @@ -52,7 +52,7 @@ :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}' @change='handleTableChange'> - {{ text }} + {{ text }}
@@ -169,10 +169,22 @@ export default { methods: { // 清单列表传出数据 listVisibleRow(val) { - this.listVisibleRowDate = val + this.selectedRowKeys = [] + let newAreaTable=JSON.parse(JSON.stringify(this.areaTable)) + newAreaTable.forEach((item, index) => { + if( item.id == this.listVisibleRowDate.id ) { + let _obj = {...item} + _obj.paramsTemplateId = val[0].id + _obj.paramsTemplateName = val[0].paramsTemplateName + this.areaTable.splice(index, 1,_obj) + } + }) + console.log(this.areaTable,'this.areaTable') this.listVisible = false }, - editArea() { + editArea(val) { + this.listVisibleRowDate = val + console.log(val) this.listVisible = true }, pageOnChange(page, pageSize) { @@ -255,61 +267,40 @@ export default { if (valid) { this.flag = true this.spinLoading = true - // 新增編輯之前 判断 标题唯一 - getAction(`params/manifest/verifyTitle?projectId=${this.$route.query.id} - &title=${this.formData.title}`, {}) - .then(res => { - if (res.result) { - let postDate = { - title: this.formData.title, - paramsTemplateId: this.paramsTemplateId || this.selectedRowKeys[0], - paramsTemplatePublishVersion: this.version, - projectId: this.projectId - } - if (this.formData.id) { - //编辑 - postDate = { - id : this.formData.id, - ...postDate - } - postAction(`params/manifest/edit`, postDate).then(res => { - if (res.success) { - this.newVisible = false - this.$emit('areaVisible', false) - this.$message.success(this.$t('OperationSuccessful')) - } else { - this.$message.warning(res.message) - } - } - ).finally(() => { - this.flag = false - this.spinLoading = false - this.newVisible = false - }) - } else { - //新增 - postAction(`params/manifest/add`, postDate).then(res => { - if (res.success) { - this.newVisible = false - this.$emit('areaVisible', false) - this.$message.success(this.$t('OperationSuccessful')) - } else { - this.$message.warning(res.message) - } - } - ).finally(() => { - this.flag = false - this.spinLoading = false - this.newVisible = false - }) - } - } else { - this.$message.warning(this.$t('changeTheTitle')) - this.spinLoading = false + let _tt = { + paramsTemplateId: this.selectedRowKeysDate[0].paramsTemplateId, + projectId: this.selectedRowKeysDate[0].projectId, + title: this.selectedRowKeysDate[0].title, + // paramsTemplatePublishVersion: + sourceManifestId: this.selectedRowKeysDate[0].id, + } + console.log(this.selectedRowKeysDate,'this.selectedRowKeysDate') + axios({ + url: `/jero-boot/params/manifest/copy`, + method: 'post', + data: _tt, + transformRequest: [function (data) { + let ret = '' + for (let it in data) { + ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&' } - }).finally(() => { - this.loading = false + return ret + }], + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + 'X-Access-Token':_this.token + } }) + .then( (res) =>{ + if (res.data.success) { + _this.$message.success(res.data.result) + }else{ + _this.$message.warning(res.data.result) + } + }) + .catch( (error) =>{ + console.log(error); + }); } else { return false }