[update] tianjia
This commit is contained in:
@@ -76,7 +76,7 @@
|
||||
</div>
|
||||
<!-- 参数模板-->
|
||||
<a-modal v-model="areaVisible" :title="$t('parameterTemplate')" width='750px' :footer="null">
|
||||
<parameter-template-add v-if='areaVisible' @areaVisible='handleCancel' :templateTitle='templatetitle'
|
||||
<parameter-template-add :url='url' ref='templateRef' v-if='areaVisible' @areaVisible='handleCancel' :templateTitle='templatetitle'
|
||||
:selectedRowKeyS='selectedRowKeys' :rowId='rowId' :version='version'
|
||||
:projectId='this.$route.query.id'></parameter-template-add>
|
||||
</a-modal>
|
||||
@@ -253,19 +253,9 @@
|
||||
},
|
||||
edit(edit) {
|
||||
this.areaVisible = true
|
||||
let _this = this
|
||||
let query = {
|
||||
id: edit.id
|
||||
}
|
||||
getAction(_this.url.queryById, query).then((res) => {
|
||||
if (res.success) {
|
||||
this.templatetitle = res.result.title
|
||||
this.selectedRowKeys = res.result.paramsTemplateId.split(',')
|
||||
this.rowId = res.result.id
|
||||
this.version = res.result.paramsTemplatePublishVersion
|
||||
} else {
|
||||
}
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.$refs.templateRef.editData(edit)
|
||||
},50)
|
||||
},
|
||||
handleAdd() {
|
||||
this.areaVisible = true
|
||||
|
||||
@@ -57,12 +57,6 @@
|
||||
:scroll='{x: 600}'
|
||||
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
|
||||
@change='handleTableChange'>
|
||||
<a slot='name' slot-scope='text'>{{ text }}</a>
|
||||
<span slot='action' slot-scope='text, record'>
|
||||
<a class='action-edit' @click='editArea(record.id)' v-has="'area:edit'">{{ $t('edit') }}</a>
|
||||
<a style='color:red' href='javascript:;' @click=' deleteArea(record.id)'
|
||||
v-has="'area:delete'">{{ $t('delete') }}</a>
|
||||
</span>
|
||||
</a-table>
|
||||
<div class="page" style='display: flex;justify-content: flex-end;'>
|
||||
<a-pagination
|
||||
@@ -161,6 +155,11 @@ export default {
|
||||
type: String,
|
||||
default: '',
|
||||
require: true
|
||||
},
|
||||
url: {
|
||||
type: Object,
|
||||
default: '',
|
||||
require: true
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -213,6 +212,20 @@ export default {
|
||||
this.newVisible = true
|
||||
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 {
|
||||
}
|
||||
})
|
||||
},
|
||||
//新增
|
||||
handleSubmit() {
|
||||
if (this.selectedRowKeys.length == 0) {
|
||||
@@ -236,6 +249,7 @@ export default {
|
||||
projectId: this.projectId
|
||||
}
|
||||
if (this.rowId) {
|
||||
console.log('编辑')
|
||||
//编辑
|
||||
postAction(`params/manifest/edit`, postDate).then(res => {
|
||||
if (res.success) {
|
||||
@@ -252,6 +266,7 @@ export default {
|
||||
this.newVisible = false
|
||||
})
|
||||
} else {
|
||||
console.log('新增')
|
||||
//新增
|
||||
postAction(`params/manifest/add`, postDate).then(res => {
|
||||
if (res.success) {
|
||||
@@ -310,25 +325,11 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
//编辑按钮
|
||||
editArea(val) {
|
||||
this.title = this.$t('edit')
|
||||
this.newVisible = true
|
||||
let params = {
|
||||
id: val
|
||||
}
|
||||
getAction(`tag/onlCgformArea/queryById`, params).then((res) => {
|
||||
if (res.success) {
|
||||
this.form = { ...res.result }
|
||||
// this.$emit('updateOk',res.result)
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
// 编辑
|
||||
},
|
||||
watch: {
|
||||
templateTitle(val) {
|
||||
this.templatetitle = val
|
||||
this.formData.templatetitle = val
|
||||
},
|
||||
selectedRowKeyS(val) {
|
||||
this.selectedRowKeys = val
|
||||
|
||||
Reference in New Issue
Block a user