[update] 参数模板 复制
This commit is contained in:
@@ -20,8 +20,6 @@
|
|||||||
<a-col :span='9'>
|
<a-col :span='9'>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span='6'>
|
<a-col :span='6'>
|
||||||
<!-- <a-button class='box-button' type='primary' @click='searchQuery'>{{ $t('query') }}</a-button>-->
|
|
||||||
<!-- <a-button class='box-button' style='margin-left: 8px' @click='searchReset'>{{ $t('reset') }}</a-button>-->
|
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row :gutter='24'>
|
<a-row :gutter='24'>
|
||||||
@@ -130,7 +128,8 @@ export default {
|
|||||||
confirmLoading: false,
|
confirmLoading: false,
|
||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10
|
pageSize: 10,
|
||||||
|
row: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@@ -189,34 +188,6 @@ export default {
|
|||||||
handleCancel() {
|
handleCancel() {
|
||||||
this.$emit('areaVisible', false)
|
this.$emit('areaVisible', false)
|
||||||
},
|
},
|
||||||
// onGetCheckboxProps(val,value) {
|
|
||||||
// let _val = {}
|
|
||||||
// // 新增时没有
|
|
||||||
// if(this.formData.id === undefined) {
|
|
||||||
// props : {}
|
|
||||||
// } else {
|
|
||||||
// // 编辑
|
|
||||||
// props : {
|
|
||||||
// disabled: val.id === 'ce879dab56a243fd99119553d3899e62'
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// console.log(this.formData.id,'this.formData.id')
|
|
||||||
// console.log(val)
|
|
||||||
// return(_val
|
|
||||||
// // {
|
|
||||||
// // props: {
|
|
||||||
// //
|
|
||||||
// // // console.log(value,'value')
|
|
||||||
// // // // 全部默认禁止选中
|
|
||||||
// // // // disabled: true,
|
|
||||||
// // // // 某几项默认禁止选中(R: 当state等于1时)
|
|
||||||
// // disabled: val.id === 'ce879dab56a243fd99119553d3899e62'
|
|
||||||
// // // // 某几项默认选中(R: 当state等于1时)
|
|
||||||
// // // // defaultChecked: record.state == 1,
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// )
|
|
||||||
// },
|
|
||||||
onSelectChange(selectedRowKeys, selectedRowKeysDate) {
|
onSelectChange(selectedRowKeys, selectedRowKeysDate) {
|
||||||
this.selectedRowKeysDate = selectedRowKeysDate
|
this.selectedRowKeysDate = selectedRowKeysDate
|
||||||
this.selectedRowKeys = selectedRowKeys
|
this.selectedRowKeys = selectedRowKeys
|
||||||
@@ -230,12 +201,14 @@ export default {
|
|||||||
this.form = {}
|
this.form = {}
|
||||||
},
|
},
|
||||||
editData(edit) {
|
editData(edit) {
|
||||||
|
// 编辑一行的数据
|
||||||
|
this.row = edit
|
||||||
this.formData = {...edit}
|
this.formData = {...edit}
|
||||||
this.selectedRowKeys = edit.paramsTemplateId.split(',')
|
this.selectedRowKeys = edit.paramsTemplateId.split(',')
|
||||||
},
|
},
|
||||||
//新增
|
//新增
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
|
console.log(this.row.version,'this.row.versionthis.row.version')
|
||||||
if (this.selectedRowKeys.length == 0) {
|
if (this.selectedRowKeys.length == 0) {
|
||||||
this.$message.warning(this.$t('pleaseSelectData'))
|
this.$message.warning(this.$t('pleaseSelectData'))
|
||||||
} else if (this.selectedRowKeys.length > 1) {
|
} else if (this.selectedRowKeys.length > 1) {
|
||||||
@@ -245,64 +218,53 @@ export default {
|
|||||||
if (valid) {
|
if (valid) {
|
||||||
this.flag = true
|
this.flag = true
|
||||||
this.spinLoading = true
|
this.spinLoading = true
|
||||||
// 新增編輯之前 判断 标题唯一
|
let postDate = {
|
||||||
getAction(`params/manifest/verifyTitle?projectId=${this.$route.query.id}
|
title: this.formData.title,
|
||||||
&title=${this.formData.title}`, {})
|
paramsTemplateId: this.paramsTemplateId || this.selectedRowKeys[0],
|
||||||
.then(res => {
|
paramsTemplatePublishVersion: this.row.version,
|
||||||
if (res.result) {
|
projectId: this.projectId
|
||||||
let postDate = {
|
}
|
||||||
title: this.formData.title,
|
if (this.formData.id) {
|
||||||
paramsTemplateId: this.paramsTemplateId || this.selectedRowKeys[0],
|
//编辑
|
||||||
paramsTemplatePublishVersion: this.selectedRowKeysDate[0].version,
|
postDate = {
|
||||||
projectId: this.projectId
|
id : this.formData.id,
|
||||||
}
|
...postDate
|
||||||
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
|
|
||||||
}
|
}
|
||||||
}).finally(() => {
|
postAction(`params/manifest/edit`, postDate).then(res => {
|
||||||
this.loading = false
|
if (res.success) {
|
||||||
})
|
this.newVisible = false
|
||||||
} else {
|
this.$emit('areaVisible', false)
|
||||||
return 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
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user