[update] 清单编辑
This commit is contained in:
@@ -708,6 +708,7 @@ module.exports = {
|
||||
uploadTime: 'Upload time',
|
||||
enclosure: 'Enclosure',
|
||||
// 认证
|
||||
changeTheTitle: 'Title already exists, please change the title',
|
||||
resetPassword: 'reset Password',
|
||||
departmentAllocation: 'department Allocation',
|
||||
ListTitle: 'List Title',
|
||||
|
||||
@@ -718,6 +718,7 @@ module.exports = {
|
||||
uploadTime: '上传时间',
|
||||
enclosure: '附件',
|
||||
// 认证
|
||||
changeTheTitle: '标题已存在,请更换标题',
|
||||
resetPassword: '重置密码',
|
||||
departmentAllocation: '部门配置',
|
||||
ListTitle: '清单标题',
|
||||
|
||||
@@ -76,8 +76,7 @@
|
||||
</div>
|
||||
<!-- 参数模板-->
|
||||
<a-modal v-model="areaVisible" :title="$t('parameterTemplate')" width='750px' :footer="null">
|
||||
<parameter-template-add :url='url' ref='templateRef' v-if='areaVisible' @areaVisible='handleCancel' :templateTitle='templatetitle'
|
||||
:selectedRowKeyS='selectedRowKeys' :rowId='rowId' :version='version'
|
||||
<parameter-template-add :url='url' ref='templateRef' v-if='areaVisible' @areaVisible='handleCancel' :version='version'
|
||||
:projectId='this.$route.query.id'></parameter-template-add>
|
||||
</a-modal>
|
||||
<!-- 配置-->
|
||||
@@ -357,6 +356,7 @@
|
||||
pageNo: this.pageNo,
|
||||
...this.queryParam
|
||||
}
|
||||
console.log(query,'projectIdprojectIdbainji ')
|
||||
getAction(this.url.list, query).then((res) => {
|
||||
if (res.success) {
|
||||
if (res.result.current > 1 && res.result.records.length == 0) {
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
>
|
||||
<a-row :gutter='24'>
|
||||
<a-col :span='9'>
|
||||
<a-form-model-item :label="$t('title')" prop='templatetitle'>
|
||||
<a-form-model-item :label="$t('title')" prop='title'>
|
||||
<a-input style='width: 420px'
|
||||
:placeholder="$t('PleaseEnter')+$t('title')"
|
||||
v-model='formData.templatetitle' />
|
||||
v-model='formData.title' />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
<a-col :span='9'>
|
||||
@@ -55,7 +55,7 @@
|
||||
:pagination='false'
|
||||
:loading='loading'
|
||||
:scroll='{x: 600}'
|
||||
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
|
||||
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, getCheckboxProps: onGetCheckboxProps}'
|
||||
@change='handleTableChange'>
|
||||
</a-table>
|
||||
<div class="page" style='display: flex;justify-content: flex-end;'>
|
||||
@@ -116,7 +116,7 @@ export default {
|
||||
form: {},
|
||||
formData: {},
|
||||
rules: {
|
||||
templatetitle: [
|
||||
title: [
|
||||
{ required: true, message: this.$t('enterTitle'), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
@@ -124,28 +124,12 @@ export default {
|
||||
flag: false, //表单提交标识
|
||||
spinLoading: false,
|
||||
confirmLoading: false,
|
||||
templatetitle: '',
|
||||
selectedRowKeys: [],
|
||||
pageNo: 1,
|
||||
pageSize: 10
|
||||
}
|
||||
},
|
||||
props: {
|
||||
templateTitle: {
|
||||
type: String,
|
||||
default: '',
|
||||
required: false
|
||||
},
|
||||
selectedRowKeyS: {
|
||||
type: Array,
|
||||
default: '',
|
||||
required: false
|
||||
},
|
||||
rowId: {
|
||||
type: String,
|
||||
default: '',
|
||||
required: false
|
||||
},
|
||||
version: {
|
||||
type: Number,
|
||||
default: '',
|
||||
@@ -201,11 +185,27 @@ export default {
|
||||
handleCancel() {
|
||||
this.$emit('areaVisible', false)
|
||||
},
|
||||
onGetCheckboxProps(val,value) {
|
||||
console.log(val)
|
||||
return({
|
||||
props: {
|
||||
|
||||
// console.log(value,'value')
|
||||
// // 全部默认禁止选中
|
||||
// // disabled: true,
|
||||
// // 某几项默认禁止选中(R: 当state等于1时)
|
||||
disabled: val.id === 'ce879dab56a243fd99119553d3899e62'
|
||||
// // 某几项默认选中(R: 当state等于1时)
|
||||
// // defaultChecked: record.state == 1,
|
||||
}
|
||||
})
|
||||
},
|
||||
onSelectChange(selectedRowKeys, selectedRowKeysDate) {
|
||||
this.selectedRowKeysDate = selectedRowKeysDate
|
||||
this.selectedRowKeys = selectedRowKeys
|
||||
},
|
||||
handleTableChange(val) {
|
||||
console.log(',,,')
|
||||
},
|
||||
showModal() {
|
||||
this.title = this.$t('add')
|
||||
@@ -213,18 +213,9 @@ export default {
|
||||
this.form = {}
|
||||
},
|
||||
editData(edit) {
|
||||
let query = {
|
||||
id: edit.id
|
||||
}
|
||||
getAction(this.url.queryById, query).then((res) => {
|
||||
if (res.success) {
|
||||
this.formData.templatetitle = res.result.title
|
||||
this.selectedRowKeys = res.result.paramsTemplateId.split(',')
|
||||
// this.rowId = res.result.id
|
||||
// this.version = res.result.paramsTemplatePublishVersion
|
||||
} else {
|
||||
}
|
||||
})
|
||||
|
||||
this.formData = {...edit}
|
||||
this.selectedRowKeys = edit.paramsTemplateId.split(',')
|
||||
},
|
||||
//新增
|
||||
handleSubmit() {
|
||||
@@ -239,18 +230,21 @@ export default {
|
||||
this.spinLoading = true
|
||||
// 新增編輯之前 判断 标题唯一
|
||||
getAction(`params/manifest/verifyTitle?projectId=${this.$route.query.id}
|
||||
&title=${this.formData.templatetitle}`, {})
|
||||
&title=${this.formData.title}`, {})
|
||||
.then(res => {
|
||||
if (res.success) {
|
||||
if (res.result) {
|
||||
let postDate = {
|
||||
title: this.formData.templatetitle,
|
||||
paramsTemplateId: this.rowId || this.selectedRowKeysDate[0].id,
|
||||
paramsTemplatePublishVersion: this.version || this.selectedRowKeysDate[0].version,
|
||||
title: this.formData.title,
|
||||
paramsTemplateId: this.paramsTemplateId || this.selectedRowKeys[0],
|
||||
paramsTemplatePublishVersion: this.version,
|
||||
projectId: this.projectId
|
||||
}
|
||||
if (this.rowId) {
|
||||
console.log('编辑')
|
||||
if (this.formData.id) {
|
||||
//编辑
|
||||
postDate = {
|
||||
id : this.formData.id,
|
||||
...postDate
|
||||
}
|
||||
postAction(`params/manifest/edit`, postDate).then(res => {
|
||||
if (res.success) {
|
||||
this.newVisible = false
|
||||
@@ -266,7 +260,6 @@ export default {
|
||||
this.newVisible = false
|
||||
})
|
||||
} else {
|
||||
console.log('新增')
|
||||
//新增
|
||||
postAction(`params/manifest/add`, postDate).then(res => {
|
||||
if (res.success) {
|
||||
@@ -284,7 +277,8 @@ export default {
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
this.$message.warning(this.$t('changeTheTitle'))
|
||||
this.spinLoading = false
|
||||
}
|
||||
}).finally(() => {
|
||||
this.loading = false
|
||||
@@ -328,9 +322,6 @@ export default {
|
||||
// 编辑
|
||||
},
|
||||
watch: {
|
||||
templateTitle(val) {
|
||||
this.formData.templatetitle = val
|
||||
},
|
||||
selectedRowKeyS(val) {
|
||||
this.selectedRowKeys = val
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user