[update] 复制
This commit is contained in:
@@ -85,13 +85,7 @@
|
|||||||
<a-modal v-model="historicalVisible" :title="$t('historicalVersion')" width='750px' :footer="null">
|
<a-modal v-model="historicalVisible" :title="$t('historicalVersion')" width='750px' :footer="null">
|
||||||
<historical-version v-if='historicalVisible' :historicalRow='historicalRow'></historical-version>
|
<historical-version v-if='historicalVisible' :historicalRow='historicalRow'></historical-version>
|
||||||
</a-modal>
|
</a-modal>
|
||||||
<!-- 复制参数模板-->
|
<!-- 复制参数模板-->
|
||||||
<a-modal v-model="areaVisibleCody" :title="$t('CopyProjectCollectionparameters')" width='750px' :footer="null">
|
|
||||||
<parameter-template-cody v-if='areaVisibleCody' @areaVisible='handleCancel' :templateTitle='templatetitle'
|
|
||||||
:selectedRowKeyS='selectedRowKeys' :rowId='rowId' :version='version'
|
|
||||||
:projectId='this.$route.query.id'></parameter-template-cody>
|
|
||||||
</a-modal>
|
|
||||||
<!-- 项目收集参数-->
|
|
||||||
<a-modal class="show-drawer" :title="titleTag" placement="right" width="700px" @close="drawerVisible = false"
|
<a-modal class="show-drawer" :title="titleTag" placement="right" width="700px" @close="drawerVisible = false"
|
||||||
:visible="drawerVisible" :footer="null">
|
:visible="drawerVisible" :footer="null">
|
||||||
<project-collection-parameters v-if='drawerVisible' @areaVisible='drawerhandleCancel' :templateTitle='templatetitle'
|
<project-collection-parameters v-if='drawerVisible' @areaVisible='drawerhandleCancel' :templateTitle='templatetitle'
|
||||||
@@ -105,7 +99,6 @@
|
|||||||
<script>
|
<script>
|
||||||
import ImportFile from '@/components/ImportFile/index'
|
import ImportFile from '@/components/ImportFile/index'
|
||||||
import ParameterTemplateAdd from '../dialog/ParameterTemplateAdd'
|
import ParameterTemplateAdd from '../dialog/ParameterTemplateAdd'
|
||||||
import ParameterTemplateCody from '../dialog/ParameterTemplateCody'
|
|
||||||
import ProjectCollectionParameters from '../dialog/ProjectCollectionParameters'
|
import ProjectCollectionParameters from '../dialog/ProjectCollectionParameters'
|
||||||
import HistoricalVersion from '../dialog/historicalVersion'
|
import HistoricalVersion from '../dialog/historicalVersion'
|
||||||
import { getAction, postAction } from '../../../api/manage'
|
import { getAction, postAction } from '../../../api/manage'
|
||||||
@@ -121,7 +114,6 @@
|
|||||||
ParameterTemplateAdd,
|
ParameterTemplateAdd,
|
||||||
Configure,
|
Configure,
|
||||||
HistoricalVersion,
|
HistoricalVersion,
|
||||||
ParameterTemplateCody,
|
|
||||||
ProjectCollectionParameters
|
ProjectCollectionParameters
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -199,7 +191,6 @@
|
|||||||
itemId: '',
|
itemId: '',
|
||||||
historicalVisible: false,
|
historicalVisible: false,
|
||||||
historicalRow: {}, // 历史版本得数据
|
historicalRow: {}, // 历史版本得数据
|
||||||
areaVisibleCody: false, // 复制参数清单得弹框
|
|
||||||
drawerVisible: false,
|
drawerVisible: false,
|
||||||
drawerVisibleitem: false,
|
drawerVisibleitem: false,
|
||||||
titleTag: ''
|
titleTag: ''
|
||||||
|
|||||||
@@ -1,344 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class='diolag-area'>
|
|
||||||
<a-spin :spinning='spinLoading'>
|
|
||||||
<a-form-model
|
|
||||||
class='tag-module'
|
|
||||||
ref='ruleForm'
|
|
||||||
:model='form'
|
|
||||||
:rules='rules'
|
|
||||||
:label-col='labelCol'
|
|
||||||
:wrapper-col='wrapperCol'
|
|
||||||
>
|
|
||||||
<a-row :gutter='24'>
|
|
||||||
<a-col :span='9'>
|
|
||||||
<a-form-model-item :label="$t('title')" prop='templatetitle' :rules='rules'>
|
|
||||||
<a-input style='width: 420px'
|
|
||||||
v-model='templatetitle' />
|
|
||||||
</a-form-model-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span='9'>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<a-row :gutter='24'>
|
|
||||||
<a-col :span='9'>
|
|
||||||
<a-form-model-item ref='paramsTemplateName' :label="$t('entryName')" prop='paramsTemplateName'>
|
|
||||||
<a-input
|
|
||||||
v-model='form.paramsTemplateName' />
|
|
||||||
</a-form-model-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span='9'>
|
|
||||||
</a-col>
|
|
||||||
<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-row>
|
|
||||||
</a-form-model>
|
|
||||||
</a-spin>
|
|
||||||
<a-table
|
|
||||||
class='table-area'
|
|
||||||
ref='table'
|
|
||||||
size='middle'
|
|
||||||
rowKey='id'
|
|
||||||
:columns='columns'
|
|
||||||
:dataSource='areaTable'
|
|
||||||
:pagination='false'
|
|
||||||
:loading='loading'
|
|
||||||
: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='drawer-bootom-button'>
|
|
||||||
<a-button style='margin-right: .8rem' @click='handleCancel'>{{ $t('cancel') }}</a-button>
|
|
||||||
<a-button @click='handleSubmit' type='primary' :loading='confirmLoading'>{{ $t('submit') }}</a-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { putAction, postAction, getAction, deleteAction } from '@/api/manage'
|
|
||||||
import axios from 'axios'
|
|
||||||
import Vue from 'vue'
|
|
||||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'parametertemplatecopy',
|
|
||||||
components: {},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
token:Vue.ls.get(ACCESS_TOKEN),
|
|
||||||
title: this.$t('add'),
|
|
||||||
total: 0,
|
|
||||||
selectedRowKeysDate: {},
|
|
||||||
loading: false,
|
|
||||||
editId: '',
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
title: this.$t('entryName'),
|
|
||||||
dataIndex: 'region_dictText',
|
|
||||||
key: 'showArea',
|
|
||||||
align: 'center',
|
|
||||||
ellipsis: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: this.$t('ListTitle'),
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'paramsTemplateName',
|
|
||||||
ellipsis: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: this.$t('parameterTemplate'),
|
|
||||||
align: 'center',
|
|
||||||
dataIndex: 'paramsTemplateName',
|
|
||||||
ellipsis: true
|
|
||||||
}
|
|
||||||
],
|
|
||||||
newVisible: false,
|
|
||||||
labelCol: {
|
|
||||||
xs: { span: 24 },
|
|
||||||
sm: { span: 7 }
|
|
||||||
},
|
|
||||||
wrapperCol: {
|
|
||||||
xs: { span: 24 },
|
|
||||||
sm: { span: 14 }
|
|
||||||
},
|
|
||||||
form: {},
|
|
||||||
rules: {
|
|
||||||
// templatetitle: [
|
|
||||||
// { required: true, message: this.$t('enterTitle'), trigger: 'blur' }
|
|
||||||
// ]
|
|
||||||
},
|
|
||||||
areaTable: [],
|
|
||||||
flag: false, //表单提交标识
|
|
||||||
spinLoading: false,
|
|
||||||
confirmLoading: false,
|
|
||||||
templatetitle: '',
|
|
||||||
selectedRowKeys: []
|
|
||||||
}
|
|
||||||
},
|
|
||||||
props: {
|
|
||||||
templateTitle: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
required: false
|
|
||||||
},
|
|
||||||
selectedRowKeyS: {
|
|
||||||
type: Array,
|
|
||||||
default: '',
|
|
||||||
required: false
|
|
||||||
},
|
|
||||||
rowId: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
required: false
|
|
||||||
},
|
|
||||||
version: {
|
|
||||||
type: Number,
|
|
||||||
default: '',
|
|
||||||
required: false
|
|
||||||
},
|
|
||||||
projectId: {
|
|
||||||
type: String,
|
|
||||||
default: '',
|
|
||||||
require: true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted() {
|
|
||||||
this.loadData()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
loadData() {
|
|
||||||
console.log('复制')
|
|
||||||
// this.loading = true
|
|
||||||
// let params = {
|
|
||||||
// ...this.form
|
|
||||||
// }
|
|
||||||
// getAction(`params/manifest/getParamsTemplateList`, params).then(res => {
|
|
||||||
// if (res.success) {
|
|
||||||
// this.areaTable = [...res.result]
|
|
||||||
// this.total = res.result.total
|
|
||||||
// }
|
|
||||||
// }).finally(() => {
|
|
||||||
// this.loading = false
|
|
||||||
// })
|
|
||||||
},
|
|
||||||
searchQuery() {
|
|
||||||
this.loadData()
|
|
||||||
},
|
|
||||||
searchReset() {
|
|
||||||
this.form = {}
|
|
||||||
this.loadData()
|
|
||||||
},
|
|
||||||
handleCancel() {
|
|
||||||
this.$emit('areaVisible', false)
|
|
||||||
},
|
|
||||||
onSelectChange(selectedRowKeys, selectedRowKeysDate) {
|
|
||||||
this.selectedRowKeysDate = selectedRowKeysDate
|
|
||||||
this.selectedRowKeys = selectedRowKeys
|
|
||||||
},
|
|
||||||
handleTableChange(val) {
|
|
||||||
},
|
|
||||||
showModal() {
|
|
||||||
this.title = this.$t('add')
|
|
||||||
this.newVisible = true
|
|
||||||
this.form = {}
|
|
||||||
},
|
|
||||||
// 复制 - 确定
|
|
||||||
handleSubmit() {
|
|
||||||
// if (this.selectedRowKeys.length == 0) {
|
|
||||||
// this.$message.warning(this.$t('pleaseSelectData'))
|
|
||||||
// } else if (this.selectedRowKeys.length > 1) {
|
|
||||||
// this.$message.warning(this.$t('OnlyOneSelected'))
|
|
||||||
// } 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.templatetitle}`, {})
|
|
||||||
// .then(res => {
|
|
||||||
// if (res.success) {
|
|
||||||
// let postDate = {
|
|
||||||
// // sourceManifestId:
|
|
||||||
// paramsTemplateId: this.rowId || this.selectedRowKeysDate[0].id,
|
|
||||||
// paramsTemplatePublishVersion: this.version || this.selectedRowKeysDate[0].version,
|
|
||||||
// projectId: this.projectId
|
|
||||||
// }
|
|
||||||
// let _this = this
|
|
||||||
// axios({
|
|
||||||
// url: `/jero-boot/params/manifest/copy`,
|
|
||||||
// method: 'post',
|
|
||||||
// data: postDate,
|
|
||||||
// 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
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// .then( (res) =>{
|
|
||||||
// if (res.data.success) {
|
|
||||||
// _this.$message.success(res.data.result)
|
|
||||||
// }else{
|
|
||||||
// _this.$message.warning(res.data.result)
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// .catch( (error) =>{
|
|
||||||
// console.log(error);
|
|
||||||
// });
|
|
||||||
// } else {
|
|
||||||
// this.$message.warning(res.message)
|
|
||||||
// }
|
|
||||||
// }).finally(() => {
|
|
||||||
// this.loading = false
|
|
||||||
// })
|
|
||||||
// } else {
|
|
||||||
// return false
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
},
|
|
||||||
cancelModel() {
|
|
||||||
this.newVisible = false
|
|
||||||
this.$refs.ruleForm.resetFields()
|
|
||||||
},
|
|
||||||
//删除按钮
|
|
||||||
deleteArea(val) {
|
|
||||||
this.$confirm({
|
|
||||||
title: this.$t('confirmDeletion'),
|
|
||||||
content: '',
|
|
||||||
onOk:
|
|
||||||
async () => {
|
|
||||||
getAction(`tag/onlCgformArea/delete`, { id: val }).then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
this.$message.success(this.$t('OperationSuccessful'))
|
|
||||||
if (this.areaTable.length == 1 && this.queryParams.pageNo != 1) {
|
|
||||||
this.queryParams.pageNo = this.queryParams.pageNo - 1
|
|
||||||
}
|
|
||||||
this.loadData()
|
|
||||||
} else {
|
|
||||||
// this.$message.warning(res.message)
|
|
||||||
if (res.message == '该展示区域有关联数据,无法删除!') {
|
|
||||||
this.$message.warning(this.$t('noDelete'))
|
|
||||||
} else {
|
|
||||||
this.$message.warning(this.$t('operationFailed'))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
//编辑按钮
|
|
||||||
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
|
|
||||||
},
|
|
||||||
selectedRowKeyS(val) {
|
|
||||||
this.selectedRowKeys = val
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang='less' scoped>
|
|
||||||
@import '~@assets/less/common.less';
|
|
||||||
|
|
||||||
.diolag-area {
|
|
||||||
.table-area {
|
|
||||||
margin: 20px 0;
|
|
||||||
|
|
||||||
.action-edit {
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-del {
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.drawer-bootom-button{
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<style lang='less'>
|
|
||||||
.area-module {
|
|
||||||
.ant-modal-wrap {
|
|
||||||
.ant-modal {
|
|
||||||
.ant-modal-content {
|
|
||||||
.ant-modal-footer {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -258,6 +258,7 @@ export default {
|
|||||||
},
|
},
|
||||||
//新增
|
//新增
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
|
let _this = this
|
||||||
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) {
|
||||||
@@ -271,10 +272,9 @@ export default {
|
|||||||
paramsTemplateId: this.selectedRowKeysDate[0].paramsTemplateId,
|
paramsTemplateId: this.selectedRowKeysDate[0].paramsTemplateId,
|
||||||
projectId: this.selectedRowKeysDate[0].projectId,
|
projectId: this.selectedRowKeysDate[0].projectId,
|
||||||
title: this.selectedRowKeysDate[0].title,
|
title: this.selectedRowKeysDate[0].title,
|
||||||
// paramsTemplatePublishVersion:
|
paramsTemplatePublishVersion: this.selectedRowKeysDate[0].paramsTemplatePublishVersion,
|
||||||
sourceManifestId: this.selectedRowKeysDate[0].id,
|
sourceManifestId: this.selectedRowKeysDate[0].id,
|
||||||
}
|
}
|
||||||
console.log(this.selectedRowKeysDate,'this.selectedRowKeysDate')
|
|
||||||
axios({
|
axios({
|
||||||
url: `/jero-boot/params/manifest/copy`,
|
url: `/jero-boot/params/manifest/copy`,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
|
|||||||
Reference in New Issue
Block a user