[update] 复制
This commit is contained in:
@@ -46,9 +46,6 @@
|
|||||||
:scroll='{x: 600}'
|
:scroll='{x: 600}'
|
||||||
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
|
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
|
||||||
@change='handleTableChange'>
|
@change='handleTableChange'>
|
||||||
<span slot='click' slot-scope='text, record'>
|
|
||||||
<a class='action-edit' @click='editArea(record.id)' v-has="'area:edit'">{{ text }}</a>
|
|
||||||
</span>
|
|
||||||
</a-table>
|
</a-table>
|
||||||
<div class="page" style='display: flex;justify-content: flex-end;'>
|
<div class="page" style='display: flex;justify-content: flex-end;'>
|
||||||
<a-pagination
|
<a-pagination
|
||||||
@@ -90,24 +87,16 @@ export default {
|
|||||||
editId: '',
|
editId: '',
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
title: this.$t('entryName'),
|
title: this.$t('zoneOfApplication'),
|
||||||
dataIndex: 'projectName',
|
dataIndex: 'region_dictText',
|
||||||
key: 'showArea',
|
|
||||||
align: 'center',
|
align: 'center',
|
||||||
ellipsis: true
|
ellipsis: true
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: this.$t('ListTitle'),
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'title',
|
|
||||||
ellipsis: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: this.$t('parameterTemplate'),
|
title: this.$t('parameterTemplate'),
|
||||||
align: 'center',
|
align: 'center',
|
||||||
dataIndex: 'paramsTemplateName',
|
dataIndex: 'paramsTemplateName',
|
||||||
ellipsis: true,
|
ellipsis: true
|
||||||
scopedSlots: { customRender: 'click' }
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
newVisible: false,
|
newVisible: false,
|
||||||
@@ -161,41 +150,20 @@ export default {
|
|||||||
...this.form
|
...this.form
|
||||||
}
|
}
|
||||||
this.loading = true
|
this.loading = true
|
||||||
axios({
|
getAction(`params/manifest/getParamsTemplatePageOfCopy`, params).then(res => {
|
||||||
url: `/jero-boot/params/manifest/getParamsTemplatePageOfCopy`,
|
if (res.success) {
|
||||||
method: 'post',
|
this.areaTable = [...res.result.records]
|
||||||
data: params,
|
this.total = res.result.total
|
||||||
transformRequest: [function (data) {
|
|
||||||
let ret = ''
|
|
||||||
for (let it in data) {
|
|
||||||
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
|
|
||||||
}
|
|
||||||
return ret
|
|
||||||
}],
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
|
||||||
'X-Access-Token':_this.token
|
|
||||||
}
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false
|
||||||
})
|
})
|
||||||
.then( (res) =>{
|
|
||||||
if (res.data.success) {
|
|
||||||
console.log(res.data)
|
|
||||||
this.loading = false
|
|
||||||
this.areaTable = res.data.result.records || []
|
|
||||||
this.total = res.data.result.total
|
|
||||||
}else{
|
|
||||||
this.loading = false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch( (error) =>{
|
|
||||||
console.log(error);
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
searchQuery() {
|
searchQuery() {
|
||||||
this.loadData()
|
this.loadData()
|
||||||
},
|
},
|
||||||
searchReset() {
|
searchReset() {
|
||||||
this.formData = {}
|
this.form = {}
|
||||||
this.loadData()
|
this.loadData()
|
||||||
},
|
},
|
||||||
handleCancel() {
|
handleCancel() {
|
||||||
@@ -222,63 +190,7 @@ export default {
|
|||||||
} else {
|
} else {
|
||||||
this.$refs.ruleForm.validate(valid => {
|
this.$refs.ruleForm.validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.flag = true
|
this.$emit('listVisibleRow', this.selectedRowKeysDate)
|
||||||
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
|
|
||||||
}
|
|
||||||
}).finally(() => {
|
|
||||||
this.loading = false
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 清单弹框 -->
|
<!-- 清单弹框 -->
|
||||||
<a-modal v-model="listVisible" :title="$t('parameterTemplate')" width='700px' :footer="null">
|
<a-modal v-model="listVisible" :title="$t('parameterTemplate')" width='700px' :footer="null">
|
||||||
<parameter-template v-if='listVisible'></parameter-template>
|
<parameter-template v-if='listVisible' @listVisibleRow='listVisibleRow'></parameter-template>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -142,7 +142,8 @@ export default {
|
|||||||
selectedRowKeys: [],
|
selectedRowKeys: [],
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
listVisible: false
|
listVisible: false,
|
||||||
|
listVisibleRowDate: {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
@@ -166,6 +167,11 @@ export default {
|
|||||||
this.loadData()
|
this.loadData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 清单列表传出数据
|
||||||
|
listVisibleRow(val) {
|
||||||
|
this.listVisibleRowDate = val
|
||||||
|
this.listVisible = false
|
||||||
|
},
|
||||||
editArea() {
|
editArea() {
|
||||||
this.listVisible = true
|
this.listVisible = true
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user