修改禅道已知bug

This commit is contained in:
qq787203167
2022-06-30 17:30:59 +08:00
parent 7e9d744e00
commit 312c47fc90
2 changed files with 248 additions and 229 deletions
@@ -1,7 +1,7 @@
<template> <template>
<a-card :bordered="false"> <a-card :bordered="false">
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery" > <a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24" class='add-padding'> <a-row :gutter="24" class='add-padding'>
<a-col :md="7" :sm="8"> <a-col :md="7" :sm="8">
<div class="box-title-text"> <div class="box-title-text">
@@ -57,6 +57,9 @@
{{ text && text.length > 50 ? text.slice(0, 49) + '...' : text }} {{ text && text.length > 50 ? text.slice(0, 49) + '...' : text }}
</a> </a>
</span> </span>
<span slot="collectionCompletionTime" slot-scope="text,record">
{{record.finishTime ? record.finishTime : '-'}}
</span>
<span slot="operation" slot-scope="text,record"> <span slot="operation" slot-scope="text,record">
<a class="text-operation" @click="configure(record)">{{$t('configure')}}</a> <a class="text-operation" @click="configure(record)">{{$t('configure')}}</a>
<a class="text-operation" @click="edit(record)">{{$t('edit')}}</a> <a class="text-operation" @click="edit(record)">{{$t('edit')}}</a>
@@ -77,8 +80,9 @@
/> />
</div> </div>
<!-- 参数模板--> <!-- 参数模板-->
<a-modal v-model="areaVisible" :title="$t('parameterTemplate')" width='750px' :footer="null"> <a-modal v-model="areaVisible" :maskClosable="false" :title="$t('parameterTemplate')" width='750px' :footer="null">
<parameter-template-add :url='url' ref='templateRef' v-if='areaVisible' @areaVisible='handleCancel' :version='version' <parameter-template-add :url='url' ref='templateRef' v-if='areaVisible' @areaVisible='handleCancel'
:version='version'
:projectId='this.$route.query.id'></parameter-template-add> :projectId='this.$route.query.id'></parameter-template-add>
</a-modal> </a-modal>
<!-- 配置--> <!-- 配置-->
@@ -87,11 +91,12 @@
<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 class="show-drawer" :title="$t('Copyparameterlist')" width="700px" v-model="drawerVisible" :footer="null"> <a-modal class="show-drawer" :title="$t('Copyparameterlist')" width="700px" v-model="drawerVisible" :footer="null">
<project-collection-parameters v-if='drawerVisible' @areaVisible='drawerhandleCancel' :templateTitle='templatetitle' @copysubmit='copysubmit' <project-collection-parameters v-if='drawerVisible' @areaVisible='drawerhandleCancel'
:selectedRowKeyS='selectedRowKeys' :rowId='rowId' :version='version' :url='url' :templateTitle='templatetitle' @copysubmit='copysubmit'
:projectId='this.$route.query.id'></project-collection-parameters> :selectedRowKeyS='selectedRowKeys' :rowId='rowId' :version='version' :url='url'
:projectId='this.$route.query.id'></project-collection-parameters>
</a-modal> </a-modal>
</a-card> </a-card>
</template> </template>
@@ -139,7 +144,8 @@
{ {
title: this.$t('collectionCompletionTime'), title: this.$t('collectionCompletionTime'),
align: 'center', align: 'center',
dataIndex: 'finishTime' dataIndex: 'finishTime',
scopedSlots: { customRender: 'collectionCompletionTime' }
}, },
{ {
title: this.$t('Version'), title: this.$t('Version'),
@@ -177,7 +183,7 @@
deleteAll: 'params/manifest/deleteBatch', deleteAll: 'params/manifest/deleteBatch',
conAdd: 'params/config/addBatch', conAdd: 'params/config/addBatch',
conList: 'params/config/list', conList: 'params/config/list',
changeExtension:'params/manifest/changeExtension', changeExtension: 'params/manifest/changeExtension',
verifyConfig: 'params/manifest/verifyConfig' verifyConfig: 'params/manifest/verifyConfig'
}, },
loading: false, loading: false,
@@ -199,7 +205,7 @@
drawerVisible: false, drawerVisible: false,
drawerVisibleitem: false, drawerVisibleitem: false,
titleTag: '', titleTag: '',
selectedRowKeysvalArray: [], selectedRowKeysvalArray: []
} }
}, },
mounted() { mounted() {
@@ -214,7 +220,7 @@
localStorage.setItem('paramsManifest', JSON.stringify(item)) localStorage.setItem('paramsManifest', JSON.stringify(item))
let newUrl = _this.$router.resolve({ let newUrl = _this.$router.resolve({
path: '/ParameterItemCollection', path: '/ParameterItemCollection',
query: item, query: item
}) })
window.open(newUrl.href, '_blank') window.open(newUrl.href, '_blank')
} else { } else {
@@ -223,7 +229,7 @@
}) })
}, },
deleteLib(val) { deleteLib(val) {
if(val.state === '已完成' || val.state === 'Finished' ) { if (val.state === '已完成' || val.state === 'Finished') {
let _this = this let _this = this
this.$confirm({ this.$confirm({
content: _this.$t('ConfirmDelete'), content: _this.$t('ConfirmDelete'),
@@ -252,9 +258,9 @@
}, },
// 配置 // 配置
configure(item) { configure(item) {
this.itemId = item.id this.itemId = item.id
this.itemRow = item this.itemRow = item
this.$refs.configureRef.addModel(item.id) this.$refs.configureRef.addModel(item.id)
}, },
handleCancel(val) { handleCancel(val) {
this.areaVisible = val this.areaVisible = val
@@ -277,7 +283,7 @@
this.pageNo = 1 this.pageNo = 1
this.getlist() this.getlist()
}, },
onSelectChange(val,valArray) { onSelectChange(val, valArray) {
this.selectedRowKeys = val this.selectedRowKeys = val
this.selectedRowKeysArray = val.join(',') this.selectedRowKeysArray = val.join(',')
this.selectedRowKeysvalArray = valArray this.selectedRowKeysvalArray = valArray
@@ -286,7 +292,7 @@
this.areaVisible = true this.areaVisible = true
setTimeout(() => { setTimeout(() => {
this.$refs.templateRef.editData(edit) this.$refs.templateRef.editData(edit)
},50) }, 50)
}, },
handleAdd() { handleAdd() {
this.areaVisible = true this.areaVisible = true
@@ -294,11 +300,11 @@
// 变更扩展 // 变更扩展
handleModule() { handleModule() {
let _this = this 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) {
this.$message.warning(_this.$t('OnlyOneSelected')) this.$message.warning(_this.$t('OnlyOneSelected'))
} else if(this.selectedRowKeysvalArray[0].state === '已完成'|| this.selectedRowKeysvalArray[0].state ==='Finished'){ } else if (this.selectedRowKeysvalArray[0].state === '已完成' || this.selectedRowKeysvalArray[0].state === 'Finished') {
getAction(_this.url.changeExtension, { id: this.selectedRowKeys[0] }).then((res) => { getAction(_this.url.changeExtension, { id: this.selectedRowKeys[0] }).then((res) => {
if (res.success) { if (res.success) {
_this.$message.success(_this.$t('OperationSuccessful')) _this.$message.success(_this.$t('OperationSuccessful'))
@@ -316,11 +322,11 @@
// 默认为0 可全部删除 // 默认为0 可全部删除
let flag = 1 let flag = 1
this.selectedRowKeysvalArray.forEach((item) => { this.selectedRowKeysvalArray.forEach((item) => {
if(item.state !== '已完成' && val.state !== 'Finished' ){ if (item.state !== '已完成' && val.state !== 'Finished') {
flag = 0 flag = 0
} }
}) })
if(flag) { if (flag) {
let param = { let param = {
ids: this.selectedRowKeysArray ids: this.selectedRowKeysArray
} }
@@ -501,8 +507,9 @@
cursor: pointer; cursor: pointer;
border-radius: 4px; border-radius: 4px;
} }
/deep/.add-padding{
margin-left: -89px!important; /deep/ .add-padding {
margin-left: -89px !important;
} }
</style> </style>
<style> <style>
@@ -11,16 +11,16 @@
> >
<a-row :gutter='24'> <a-row :gutter='24'>
<a-col :span='9'> <a-col :span='9'>
<a-form-model-item :label="$t('title')" prop='title'> <a-form-model-item class="itemAddAdmin" :label="$t('title')" prop='title'>
<a-input style='width: 420px' <a-input style='width: 420px'
:placeholder="$t('PleaseEnter')+$t('title')" :placeholder="$t('PleaseEnter')+$t('title')"
v-model='formData.title' /> v-model='formData.title'/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span='9'> <!-- <a-col :span='9'>-->
</a-col> <!-- </a-col>-->
<a-col :span='6'> <!-- <a-col :span='6'>-->
</a-col> <!-- </a-col>-->
</a-row> </a-row>
<a-row :gutter='24'> <a-row :gutter='24'>
<a-col :span='9'> <a-col :span='9'>
@@ -29,7 +29,7 @@
<j-dict-select-tag class='box-input' v-model='form.region' <j-dict-select-tag class='box-input' v-model='form.region'
:placeholder="$t('PleaseSelect')+$t('zoneOfApplication')" :placeholder="$t('PleaseSelect')+$t('zoneOfApplication')"
:type="'select'" :type="'select'"
:triggerChange='false' :dictCode="'region'" /> :triggerChange='false' :dictCode="'region'"/>
</a-form-model-item> </a-form-model-item>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
@@ -37,7 +37,7 @@
<a-form-model-item ref='paramsTemplateName' :label="$t('parameterTemplate')" prop='paramsTemplateName'> <a-form-model-item ref='paramsTemplateName' :label="$t('parameterTemplate')" prop='paramsTemplateName'>
<a-input <a-input
:placeholder="$t('PleaseEnter')+$t('parameterTemplate')" :placeholder="$t('PleaseEnter')+$t('parameterTemplate')"
v-model='form.paramsTemplateName' /> v-model='form.paramsTemplateName'/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :span='6' style='margin-top: 5px'> <a-col :span='6' style='margin-top: 5px'>
@@ -79,148 +79,153 @@
</template> </template>
<script> <script>
import { putAction, postAction, getAction, deleteAction } from '@/api/manage' import { putAction, postAction, getAction, deleteAction } from '@/api/manage'
export default { export default {
name: 'diolagArea', name: 'diolagArea',
components: {}, components: {},
data() { data() {
return { return {
title: this.$t('add'), title: this.$t('add'),
total: 0, total: 0,
selectedRowKeysDate: {}, selectedRowKeysDate: {},
loading: false, loading: false,
editId: '', editId: '',
columns: [ columns: [
{ {
title: this.$t('zoneOfApplication'), title: this.$t('zoneOfApplication'),
dataIndex: 'region_dictText', dataIndex: 'region_dictText',
key: 'showArea', key: 'showArea',
align: 'center', align: 'center',
ellipsis: true ellipsis: true
},
{
title: this.$t('parameterTemplate'),
align: 'center',
dataIndex: 'paramsTemplateName',
ellipsis: true
}
],
newVisible: false,
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
}, },
{ wrapperCol: {
title: this.$t('parameterTemplate'), xs: { span: 24 },
align: 'center', sm: { span: 14 }
dataIndex: 'paramsTemplateName', },
ellipsis: true form: {},
} formData: {},
], rules: {
newVisible: false, title: [
labelCol: { { required: true, message: this.$t('enterTitle'), trigger: 'blur' },
xs: { span: 24 }, {
sm: { span: 7 } max: 200,
}, message: this.$t('title') + this.$t('cannotExceed') + 200 + this.$t('Characters'),
wrapperCol: { trigger: 'blur'
xs: { span: 24 }, }
sm: { span: 14 } ]
}, },
form: {}, areaTable: [],
formData: {}, flag: false, //表单提交标识
rules: { spinLoading: false,
title: [ confirmLoading: false,
{ required: true, message: this.$t('enterTitle'), trigger: 'blur' } selectedRowKeys: [],
] pageNo: 1,
}, pageSize: 10,
areaTable: [], row: {}
flag: false, //表单提交标识
spinLoading: false,
confirmLoading: false,
selectedRowKeys: [],
pageNo: 1,
pageSize: 10,
row: {}
}
},
props: {
version: {
type: Number,
default: '',
required: false
},
projectId: {
type: String,
default: '',
require: true
},
url: {
type: Object,
default: '',
require: true
}
},
mounted() {
this.loadData()
},
methods: {
pageOnChange(page, pageSize) {
this.pageNo = page
this.loadData()
},
SizeChange(page, pageSize) {
this.pageNo = 1
this.pageSize = pageSize
this.loadData()
},
loadData() {
this.loading = true
let params = {
pageNo: this.pageNo,
pageSize: this.pageSize,
...this.form
} }
getAction(`params/manifest/getParamsTemplatePage`, params).then(res => {
if (res.success) {
this.areaTable = [...res.result.records]
this.total = res.result.total
}
}).finally(() => {
this.loading = false
})
}, },
searchQuery() { props: {
version: {
type: Number,
default: '',
required: false
},
projectId: {
type: String,
default: '',
require: true
},
url: {
type: Object,
default: '',
require: true
}
},
mounted() {
this.loadData() this.loadData()
}, },
searchReset() { methods: {
this.form = {} pageOnChange(page, pageSize) {
this.loadData() this.pageNo = page
}, this.loadData()
handleCancel() { },
this.$emit('areaVisible', false) SizeChange(page, pageSize) {
}, this.pageNo = 1
onSelectChange(selectedRowKeys, selectedRowKeysDate) { this.pageSize = pageSize
this.selectedRowKeysDate = selectedRowKeysDate this.loadData()
this.selectedRowKeys = selectedRowKeys },
}, loadData() {
handleTableChange(val) { this.loading = true
console.log(',,,') let params = {
}, pageNo: this.pageNo,
showModal() { pageSize: this.pageSize,
this.title = this.$t('add') ...this.form
this.newVisible = true
this.form = {}
},
editData(edit) {
// 编辑一行的数据
this.row = edit
this.formData = {...edit}
this.selectedRowKeys = edit.paramsTemplateId.split(',')
},
//新增
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 {
if(this.formData.title !== undefined) {
this.formData.title = this.formData.title.trim()
} }
this.$refs.ruleForm.validate(valid => { getAction(`params/manifest/getParamsTemplatePage`, params).then(res => {
if (valid) { if (res.success) {
this.flag = true this.areaTable = [...res.result.records]
this.spinLoading = true this.total = res.result.total
this.confirmLoading = true }
}).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) {
console.log(',,,')
},
showModal() {
this.title = this.$t('add')
this.newVisible = true
this.form = {}
},
editData(edit) {
// 编辑一行的数据
this.row = edit
this.formData = { ...edit }
this.selectedRowKeys = edit.paramsTemplateId.split(',')
},
//新增
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 {
if (this.formData.title !== undefined) {
this.formData.title = this.formData.title.trim()
}
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.flag = true
this.spinLoading = true
this.confirmLoading = true
let postDate = { let postDate = {
title: this.formData.title, title: this.formData.title,
paramsTemplateId: this.paramsTemplateId || this.selectedRowKeys[0], paramsTemplateId: this.paramsTemplateId || this.selectedRowKeys[0],
@@ -230,7 +235,7 @@ export default {
if (this.formData.id) { if (this.formData.id) {
//编辑 //编辑
postDate = { postDate = {
id : this.formData.id, id: this.formData.id,
...postDate ...postDate
} }
postAction(`params/manifest/edit`, postDate).then(res => { postAction(`params/manifest/edit`, postDate).then(res => {
@@ -271,85 +276,92 @@ export default {
this.spinLoading = false this.spinLoading = false
this.confirmLoading = false this.confirmLoading = 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'))
}
}
})
}
}) })
} }
// 编辑
}, },
cancelModel() { watch: {
this.newVisible = false selectedRowKeyS(val) {
this.$refs.ruleForm.resetFields() this.selectedRowKeys = val
}, }
//删除按钮
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'))
}
}
})
}
})
},
// 编辑
},
watch: {
selectedRowKeyS(val) {
this.selectedRowKeys = val
} }
}
} }
</script> </script>
<style lang='less' scoped> <style lang='less' scoped>
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
.diolag-area { .diolag-area {
.table-area { .table-area {
margin: 20px 0; margin: 20px 0;
.action-edit { .action-edit {
margin-right: 10px; margin-right: 10px;
}
}
.table-del {
color: red;
} }
} }
.table-del { .drawer-bootom-button {
display: flex;
justify-content: center;
}
.Required {
color: red; color: red;
margin-right: 4px;
} }
}
.drawer-bootom-button{
display: flex;
justify-content: center;
}
.Required {
color: red;
margin-right: 4px;
}
</style> </style>
<style lang='less'> <style lang='less'>
.area-module { .area-module {
.ant-modal-wrap { .ant-modal-wrap {
.ant-modal { .ant-modal {
.ant-modal-content { .ant-modal-content {
.ant-modal-footer { .ant-modal-footer {
text-align: center; text-align: center;
}
} }
} }
} }
} }
} </style>
<style>
.itemAddAdmin .ant-form-item-control-wrapper .has-error .ant-form-explain {
white-space: nowrap!important;
}
</style> </style>