[update] 复制

This commit is contained in:
zhaomeijing
2022-05-31 11:22:04 +08:00
parent 761ad0a0a2
commit 6a509f36a5
2 changed files with 19 additions and 101 deletions
@@ -46,9 +46,6 @@
:scroll='{x: 600}'
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
@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>
<div class="page" style='display: flex;justify-content: flex-end;'>
<a-pagination
@@ -90,24 +87,16 @@ export default {
editId: '',
columns: [
{
title: this.$t('entryName'),
dataIndex: 'projectName',
key: 'showArea',
title: this.$t('zoneOfApplication'),
dataIndex: 'region_dictText',
align: 'center',
ellipsis: true
},
{
title: this.$t('ListTitle'),
align: 'center',
dataIndex: 'title',
ellipsis: true
},
{
title: this.$t('parameterTemplate'),
align: 'center',
dataIndex: 'paramsTemplateName',
ellipsis: true,
scopedSlots: { customRender: 'click' }
ellipsis: true
}
],
newVisible: false,
@@ -161,41 +150,20 @@ export default {
...this.form
}
this.loading = true
axios({
url: `/jero-boot/params/manifest/getParamsTemplatePageOfCopy`,
method: 'post',
data: params,
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
getAction(`params/manifest/getParamsTemplatePageOfCopy`, params).then(res => {
if (res.success) {
this.areaTable = [...res.result.records]
this.total = res.result.total
}
}).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() {
this.loadData()
},
searchReset() {
this.formData = {}
this.form = {}
this.loadData()
},
handleCancel() {
@@ -222,63 +190,7 @@ export default {
} else {
this.$refs.ruleForm.validate(valid => {
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
}
}).finally(() => {
this.loading = false
})
this.$emit('listVisibleRow', this.selectedRowKeysDate)
} else {
return false
}
@@ -72,7 +72,7 @@
</div>
<!-- 清单弹框 -->
<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>
</div>
</template>
@@ -142,7 +142,8 @@ export default {
selectedRowKeys: [],
pageNo: 1,
pageSize: 10,
listVisible: false
listVisible: false,
listVisibleRowDate: {}
}
},
props: {
@@ -166,6 +167,11 @@ export default {
this.loadData()
},
methods: {
// 清单列表传出数据
listVisibleRow(val) {
this.listVisibleRowDate = val
this.listVisible = false
},
editArea() {
this.listVisible = true
},