修改参数模板管理

This commit is contained in:
范强强
2024-01-05 14:03:09 +08:00
parent d977961d1c
commit ffd90f0ffa
4 changed files with 772 additions and 462 deletions
+3
View File
@@ -2038,4 +2038,7 @@ module.exports = {
experienceReference:'Experience reference', experienceReference:'Experience reference',
onlyTheDataFilledUrged:'Only the data whose status is to be filled in or To be processed by eng. interface can be urged', onlyTheDataFilledUrged:'Only the data whose status is to be filled in or To be processed by eng. interface can be urged',
onlyTheDataWhoseStatusUrged:'Only the data whose status is to be filled in can be urged', onlyTheDataWhoseStatusUrged:'Only the data whose status is to be filled in can be urged',
maintainer:'Maintainer',
setupMaintainer:'Setup maintainer',
maximumOfBeSelected:'A maximum of 30 personnel can be selected',
} }
+3
View File
@@ -3772,4 +3772,7 @@ module.exports = {
experienceReference:'经验参考', experienceReference:'经验参考',
onlyTheDataFilledUrged:'只能催办状态为待填写或待工程接口人处理的数据', onlyTheDataFilledUrged:'只能催办状态为待填写或待工程接口人处理的数据',
onlyTheDataWhoseStatusUrged:'只能催办状态为待填写的数据', onlyTheDataWhoseStatusUrged:'只能催办状态为待填写的数据',
maintainer:'维护人',
setupMaintainer:'设置维护人',
maximumOfBeSelected:'最多只能选择30个人员',
} }
@@ -0,0 +1,253 @@
<template>
<a-drawer
:title="title"
:maskClosable="false"
:width="500"
placement="right"
:closable="true"
@close="handleCancel"
:visible="visible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-spin :spinning="confirmLoading">
<a-form>
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span class="title-text-text" :title="$t('maintainer')">{{$t('maintainer')}}</span>
</div>
<a-form-model-item class="itemModel" prop="maintainerName">
<PersonnelSelection :query="{db_field_name:'maintainer',db_field_txt:$t('maintainer')}"
:personneQuery="formInline"
v-if="visible"
class="maintainerClass"
@change="PersonnelSelectionChange"
v-model="formInline.maintainerName"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-form>
</a-spin>
<div class="drawer-bootom-button">
<a-button style="margin-right: 8px" @click="handleCancel">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</template>
<script>
import PersonnelSelection from '@/components/PersonnelSelection/index'
import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
export default {
name: 'setupMaintainerModel',
components: {
PersonnelSelection
},
props: ['url'],
data() {
return {
formInline: {},
confirmLoading: false,
visible: false,
rules: {
maintainerName: [
{ required: true, message: this.$t('PleaseSelect') + this.$t('maintainer'), trigger: 'change' }
]
},
disabled: false,
projectNameList: [],
title: ''
}
},
mounted() {
},
methods: {
editModel(value) {
this.visible = true
this.title = this.$t('setupMaintainer')
this.$nextTick(() => {
this.formInline = JSON.parse(JSON.stringify(value))
this.$refs['ruleForm'].clearValidate()
})
},
handleCancel() {
this.visible = false
},
handleSubmit() {
this.$refs.ruleForm.validate(valid => {
if (valid) {
let query = JSON.parse(JSON.stringify(this.formInline))
let maintainerName = query.maintainerName.split(',')
if (maintainerName.length > 30) {
this.$message.warning(this.$t('maximumOfBeSelected'))
return
}
Object.keys(query).forEach(res => {
if (query[res] && query[res] instanceof Array) {
query[res] = query[res].join(',')
}
})
this.confirmLoading = true
putAction('params/template/edit', query).then((res) => {
if (res.success) {
this.confirmLoading = false
this.$message.success(this.$t('OperationSuccessful'))
this.visible = false
this.$emit('setupMaintainerModelForm')
} else {
this.$message.warning(this.$t('operationFailed'))
this.confirmLoading = false
}
})
}
})
},
handleInput(value) {
this.$nextTick(() => {
this.formInline = { ...this.formInline }
this.$refs.ruleForm.validateField([value])
})
},
PersonnelSelectionChange(value, id) {
this.formInline[value] = id
this.formInline = { ...this.formInline }
},
projectNameChange(value) {
console.log(value)
}
}
}
</script>
<style>
.formAdd .ant-form-item-label {
width: 130px;
}
.formAdd .ant-form-item-control-wrapper {
display: inline-block;
width: 100%;
}
/*.formAdd .ant-form-item {*/
/* margin-bottom: 20px;*/
/*}*/
.itemModel .ant-form-item-control-wrapper {
width: 100%;
}
.box-input .ant-select-selection--single {
height: 38px;
}
.box-input .ant-select-selection--multiple {
height: 38px;
}
.box-input .ant-select-selection__rendered {
line-height: 38px;
height: 38px;
}
.box-input .ant-select-selection--multiple .ant-select-selection__rendered > ul > li {
margin-top: 6px;
}
.box-input .ant-calendar-picker {
line-height: 38px;
height: 38px;
}
.box-input .ant-calendar-picker-input {
height: 38px;
}
.box-input .ant-input-number-input-wrap {
line-height: 38px;
height: 38px;
}
.ant-input-disabled {
color: rgba(0, 0, 0, 0.65) !important;
}
</style>
<style scoped>
.box-title-text {
line-height: 1.4;
display: flex;
/*align-items: center;*/
}
.title-text {
width: 74px;
text-align: right;
display: inline-block;
font-weight: 500;
font-size: 14px;
margin-right: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
height: 42px;
line-height: 48px;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: calc(100% - 90px);
display: inline-block;
margin-top: 2px;
}
.Required {
color: red;
margin-right: 4px;
}
.title-text-text {
margin-top: 9px;
}
.formAdd {
margin-bottom: 40px;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
z-index: 100;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
/deep/ .add-input {
min-height: 135px !important;
}
::v-deep .maintainerClass .itemModelStand-input{
height: 120px;
}
::v-deep .maintainerClass .itemModelStand-input .ant-select-selection--multiple{
min-height: 120px;
}
</style>
@@ -69,13 +69,28 @@
{{ text && text.length > 50 ? text.slice(0, 49) + '...' : text }} {{ text && text.length > 50 ? text.slice(0, 49) + '...' : text }}
</span> </span>
<span slot="operation" slot-scope="text,record"> <span slot="operation" slot-scope="text,record">
<a class="text-operation" :disabled="record.status == '1' ? true : false" v-has="'params:template:edit'" @click="edit(record)">{{$t('edit')}}</a> <a class="text-operation" v-has="'params:template:setupMaintainer'"
@click="setupMaintainerClick(record)">{{$t('setupMaintainer')}}</a>
<a class="text-operation"
:disabled="record.status == '1' || record.authorityFlag == '1'? true : false"
v-has="'params:template:edit'"
@click="edit(record)">{{$t('edit')}}</a>
<a class="text-operation" <a class="text-operation"
v-has="'params:template:publish'" v-has="'params:template:publish'"
@click="withdrawOrRelease(record)">{{record.status && record.status == '1'? $t('withdraw') : $t('release')}}</a> :disabled="record.authorityFlag == '1'? true : false"
<a class="text-operation" :disabled="record.status == '1' ? true : false" v-has="'params:template:maintenanceTemplate'" @click="withdrawOrRelease(record)">
{{record.status && record.status == '1'? $t('withdraw') : $t('release')}}
</a>
<a class="text-operation"
:disabled="record.status == '1' || record.authorityFlag == '1'? true : false"
v-has="'params:template:maintenanceTemplate'"
@click="maintenanceTemplateClick(record)">{{$t('maintenanceTemplate')}}</a> @click="maintenanceTemplateClick(record)">{{$t('maintenanceTemplate')}}</a>
<a class="text-operation" :disabled="record.status == '1' ? true : false"
<a class="text-operation"
:disabled="record.status == '1' || record.authorityFlag == '1'? true : false"
v-has="'params:template:delete'" @click="deleteLib(record)">{{$t('deleteLib')}}</a> v-has="'params:template:delete'" @click="deleteLib(record)">{{$t('deleteLib')}}</a>
</span> </span>
</a-table> </a-table>
@@ -94,6 +109,7 @@
</div> </div>
<JLoading :loading="JLoading">{{ $t('pleaseWaitWhileRunning') }}</JLoading> <JLoading :loading="JLoading">{{ $t('pleaseWaitWhileRunning') }}</JLoading>
<addModel :url="url" ref="addModelRef" @addModelList="addModelList"/> <addModel :url="url" ref="addModelRef" @addModelList="addModelList"/>
<setupMaintainerModel ref="setupMaintainerModelRef" @setupMaintainerModelForm="setupMaintainerModelForm"/>
<a-modal class="show-copy" v-model="areaVisible" :title="$t('templateCopy')" :footer="null" @cancel="hideModal"> <a-modal class="show-copy" v-model="areaVisible" :title="$t('templateCopy')" :footer="null" @cancel="hideModal">
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm"> <a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24"> <a-row :gutter="24">
@@ -118,12 +134,15 @@
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button> <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div> </div>
</a-modal> </a-modal>
</a-card> </a-card>
</template> </template>
<script> <script>
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage' import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import addModel from './components/addModel' import addModel from './components/addModel'
import setupMaintainerModel from './components/setupMaintainerModel'
import axios from 'axios' import axios from 'axios'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import eventBUs from '../../../common/event' import eventBUs from '../../../common/event'
@@ -134,6 +153,7 @@ export default {
name: 'index', name: 'index',
components: { components: {
addModel, addModel,
setupMaintainerModel
}, },
mixins: [ResizeHeader, ResizeColumnProvide], mixins: [ResizeHeader, ResizeColumnProvide],
data() { data() {
@@ -150,8 +170,8 @@ export default {
rules: { rules: {
paramsTemplateName: [ paramsTemplateName: [
{ required: true, message: this.$t('PleaseEnter') + this.$t('templateName'), trigger: 'change' }, { required: true, message: this.$t('PleaseEnter') + this.$t('templateName'), trigger: 'change' },
{ min:1, max: 50, message: this.$t('cantExeed')+'50'+this.$t('characters'), trigger: 'blur' }, { min: 1, max: 50, message: this.$t('cantExeed') + '50' + this.$t('characters'), trigger: 'blur' }
], ]
}, },
visible: false, visible: false,
dataSource: [], dataSource: [],
@@ -175,7 +195,7 @@ export default {
width: 125, width: 125,
ellipsis: true, ellipsis: true,
sorter: true, sorter: true,
dataIndex: 'region_dictText', dataIndex: 'region_dictText'
}, },
{ {
title: this.$t('parameterTemplate'), title: this.$t('parameterTemplate'),
@@ -215,13 +235,20 @@ export default {
ellipsis: true, ellipsis: true,
dataIndex: 'createBy' dataIndex: 'createBy'
}, },
{
title: this.$t('maintainer'),
align: 'left',
width: 120,
ellipsis: true,
dataIndex: 'maintainerName'
},
{ {
title: this.$t('created'), title: this.$t('created'),
align: 'left', align: 'left',
dataIndex: 'createTime', dataIndex: 'createTime',
width: 200, width: 200,
sorter: true, sorter: true,
ellipsis: true, ellipsis: true
}, },
{ {
title: this.$t('updated'), title: this.$t('updated'),
@@ -235,13 +262,13 @@ export default {
title: this.$t('operation'), title: this.$t('operation'),
align: 'left', align: 'left',
fixed: 'right', fixed: 'right',
width: 200, width: 280,
scopedSlots: { customRender: 'operation' } scopedSlots: { customRender: 'operation' }
} }
], ],
queryParam: {}, queryParam: {},
areaVisible: false, areaVisible: false,
paramsTemplateName: '', paramsTemplateName: ''
} }
}, },
mounted() { mounted() {
@@ -294,7 +321,7 @@ export default {
} }
}, },
hideModal() { hideModal() {
this.visible = false; this.visible = false
this.$refs['ruleForm'].resetFields() this.$refs['ruleForm'].resetFields()
}, },
withdrawOrRelease(item) { withdrawOrRelease(item) {
@@ -343,6 +370,20 @@ export default {
} }
if (this.selectedRowKeys.length > 0) { if (this.selectedRowKeys.length > 0) {
let _this = this let _this = this
let dataSource = []
for (let i = 0; i < this.dataSource.length; i++) {
for (let j = 0; j < this.selectedRowKeys.length; j++) {
if (this.dataSource[i].id == this.selectedRowKeys[j]) {
dataSource.push(this.dataSource[i])
}
}
}
for (let i = 0; i < dataSource.length; i++) {
if (dataSource[i].authorityFlag == '1') {
this.$message.warning(this.$t('doNotHavePermissionDeleteData'))
return
}
}
this.$confirm({ this.$confirm({
content: _this.$t('ConfirmBatchDeletion'), content: _this.$t('ConfirmBatchDeletion'),
onOk() { onOk() {
@@ -372,14 +413,20 @@ export default {
} }
}) })
.catch((error) => { .catch((error) => {
console.log(error); console.log(error)
}); })
} }
}) })
} else { } else {
this.$message.warning(this.$t('selectLeastOne')) this.$message.warning(this.$t('selectLeastOne'))
} }
}, },
setupMaintainerModelForm() {
this.getList()
},
setupMaintainerClick(item) {
this.$refs.setupMaintainerModelRef.editModel(item)
},
//编辑 //编辑
edit(item) { edit(item) {
this.$refs.addModelRef.editModel(JSON.parse(JSON.stringify(item))) this.$refs.addModelRef.editModel(JSON.parse(JSON.stringify(item)))
@@ -510,9 +557,11 @@ export default {
height: 38px; height: 38px;
margin-top: 2px; margin-top: 2px;
} }
.add-input { .add-input {
width: 82%; width: 82%;
} }
.box-button { .box-button {
height: 38px; height: 38px;
/*margin-top: 2px;*/ /*margin-top: 2px;*/
@@ -584,9 +633,11 @@ export default {
background: #fff; background: #fff;
border-radius: 0 0 2px 2px; border-radius: 0 0 2px 2px;
} }
.add-text-text { .add-text-text {
margin-top: -14px; margin-top: -14px;
} }
::v-deep .ant-table-row:first-child { ::v-deep .ant-table-row:first-child {
background: #fff !important; background: #fff !important;
opacity: 0.9; opacity: 0.9;