参数项清单添加引用参数列功能

This commit is contained in:
zyx.net
2022-12-06 14:45:38 +08:00
parent 9b18444411
commit a87fea4114
4 changed files with 564 additions and 0 deletions
+2
View File
@@ -1363,4 +1363,6 @@ module.exports = {
CuiBan:'CuiBan',
certificationCategoryNumber: 'certification Category Number',
historicalrecord:'historical Record',
Referenceparametercolumn:'Reference Parameter Column',
Updateparametercolumn:'Update The Parameter Column',
}
+2
View File
@@ -1464,4 +1464,6 @@ module.exports = {
CuiBan:'催办',
certificationCategoryNumber: '认证类别编号',
historicalrecord:'历史记录',
Referenceparametercolumn:'引用参数列',
Updateparametercolumn:'更新参数列',
}
@@ -144,6 +144,16 @@
<a-icon type="solution"/>
{{$t('FreezeConfiguration')}}
</div>
<!-- 引用参数列-->
<div @click="Referenceparametercolumn" class="operator-text-title" v-if='currentPersonRole == "homo" '>
<a-icon type="plus"/>
{{$t('Referenceparametercolumn')}}
</div>
<!-- 更新参数列-->
<div @click="Updateparametercolumn" class="operator-text-title" v-if='currentPersonRole == "homo" '>
<a-icon type="check-circle"/>
{{$t('Updateparametercolumn')}}
</div>
<!-- 同步上报库 -->
<div @click="handleSynchronousReportLibraryJurisdiction" class="operator-text-title" v-if='currentPersonRole == "homo"'>
<a-icon type="setting"/>
@@ -331,6 +341,24 @@
:selectedRowKeysArray='selectedRowKeysArray'
@areaVisibsynchronous='areaVisibsynchronous = false'/>
</a-modal>
<!-- 引用参数列-->
<a-drawer
class="show-drawer"
:maskClosable="false"
:visible="parametercolumn"
style="height: 100%;overflow: auto;padding-bottom: 53px;"
placement="right"
@close="drawerhandleCancel"
:title="$t('Referenceparametercolumn')"
width="850px"
:footer="null">
<parameter-column v-if='parametercolumn' @areaVisible='drawerhandleCancel'
:templateTitle='templatetitle'
:selectedRowKeyS='selectedRowKeys' :rowId='rowId' :version='version' :url='url'
:projectId='this.$route.query.parentId ? this.$route.query.parentId : this.$route.query.id'>
</parameter-column>
</a-drawer>
<!-- 切换角色-->
<a-modal
:title="$t('roleSwitching')"
@@ -453,6 +481,7 @@
<script>
import TableCollection from '@/components/tableCollection/index'
import parameterColumn from '../dialog/parametercolumn'
import { getAction, postAction, downloadFile } from '../../../api/manage'
import eventBUs from '../../../common/event'
import ParameterLibraryAdd from '@/components/ParameterLibraryAdd/index'
@@ -474,6 +503,7 @@
components: {
TableCollection,
ParameterLibraryAdd,
parameterColumn,
AssignedBy,
AdjustareaSofrespon,
ImportFileOnlyList,
@@ -658,6 +688,7 @@
areaVisibleAssignedby: false, // 分配填写人弹框
areaVisibleTaskCutOffTime: false, // 截至时间弹框
OneclickCollection:false,
parametercolumn:false,
Adjustareasofrespon:false,
areaVisiblereferenceparameter: false, // 引用参数弹框
areaVisibsynchronous: false, // 同步上报库弹框
@@ -1300,6 +1331,14 @@
defOneclickCollection() {
this.$refs.OneclickCollection.searchData()
// this.OneclickCollection = true
},
// 引用参数列
Referenceparametercolumn() {
console.log(1111)
this.parametercolumn = true
},
Updateparametercolumn() {
},
// // 下发收集---请求接口
// distributionAndCollection() {
@@ -1559,6 +1598,9 @@
this.visibleoperationFailed = true
}
},
drawerhandleCancel(val) {
this.parametercolumn = false
},
// 强制撤回
compulsoryWithdrawal() {
let _array = []
@@ -0,0 +1,518 @@
<template>
<div class='diolag-area'>
<a-spin :spinning='spinLoading'>
<a-form-model
class='tag-module'
ref='ruleForm'
:model='formData'
:rules="rules"
:label-col='labelCol'
:wrapper-col='wrapperCol'
>
<a-row :gutter='24'>
<a-col :span='9'>
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('entryName')">{{$t('entryName')}}</span>
</div>
<a-form-model-item class="itemModel">
<!-- <j-dict-select-tag class='box-input' v-model='form.region'-->
<!-- :placeholder="$t('PleaseSelect')+$t('entryName')"-->
<!-- :type="'select'"-->
<!-- :title="$t('PleaseSelect')+$t('zoneOfApplication')"-->
<!-- :triggerChange='false' :dictCode="'region'"/>-->
<a-input
class='box-input'
:placeholder="$t('PleaseEnter')+$t('entryName')"
:title="$t('PleaseSelect')+$t('entryName')"
v-model='form.projectName'/>
</a-form-model-item>
</div>
</a-col>
<a-col :span='9'>
<div class="box-title-text">
<div class="title-text">
<!-- <span class="Required">*</span>-->
<span class="title-text-text" :title="$t('parameterTemplate')">{{$t('ListTitle')}}</span>
</div>
<a-form-model-item class="itemModel">
<a-input
class='box-input'
:placeholder="$t('PleaseEnter')+$t('ListTitle')"
:title="$t('PleaseSelect')+$t('ListTitle')"
v-model='form.title'/>
</a-form-model-item>
</div>
</a-col>
<a-col :span='6' style='margin-top: 5px'>
<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,y:400}'
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
@change='handleTableChange'>
<span slot="configDescription" slot-scope="text,record">
<a-select class="box-input" v-model="record.configure"
:getPopupContainer="triggerNode=> triggerNode.parentNode"
allowClear
:placeholder="$t('pleaseSelect')">
<a-select-option v-for="(item,index) in record.configList" :value="item.value" :key="index">
{{item.label}}
</a-select-option>
</a-select>
</span>
</a-table>
<div class="page" style='display: flex;justify-content: flex-end; margin-bottom: 42px'>
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSize"
:total="total"
:current="pageNo"
@change="pageOnChange"
@showSizeChange="SizeChange"
/>
</div>
<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'
export default {
name: 'diolagArea',
components: {},
data() {
return {
title: this.$t('add'),
total: 0,
selectedRowKeysDate: {},
loading: false,
editId: '',
columns: [
{
title: this.$t('entryName'),
dataIndex: 'projectName',
key: 'showArea',
align: 'center',
ellipsis: true
},
{
title: this.$t('ListTitle'),
align: 'center',
dataIndex: 'title',
ellipsis: true
},
{
title: this.$t('Version'),
align: 'center',
dataIndex: 'version',
ellipsis: true
},
{
title: this.$t('configure'),
align: 'center',
dataIndex: 'configure',
scopedSlots: { customRender: 'configDescription' },
ellipsis: true
},
],
projectVersionList: [],
newVisible: false,
labelCol: {
xs: { span: 24 },
sm: { span: 7 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 14 }
},
form: {},
formData: {},
rules: {
title: [
{ required: true, message: this.$t('enterTitle'), trigger: 'blur' },
{
max: 200,
message: this.$t('title') + this.$t('cannotExceed') + 200 + this.$t('Characters'),
trigger: 'blur'
}
],
projectVersion: [
{ required: true, message: this.$t('PleaseSelect')+this.$t('relatedProjectVersion'), trigger: 'change' },
],
// explanation: [
// {
// max: 500,
// message: this.$t('explain') + this.$t('cannotExceed') + 500 + this.$t('Characters'),
// trigger: 'blur'
// }
// ]
},
areaTable: [],
flag: false, //表单提交标识
spinLoading: false,
confirmLoading: false,
paramsReportId:'',
paramsReportConfigId:'',
selectedRowKeys: [],
projectName:'',
num:'',
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() {
let str =this.$route.query.projectName
let index = str.lastIndexOf("-");
this.projectName = str.substr(index+1,str.length);
this.formData.projectVersion = this.projectName
this.loadData()
this.getProjectVersion()
},
methods: {
getProjectVersion() {
let query = {
id: this.projectId
}
getAction('/project/projectLibraryBase/getVersionsInfo', query).then((res) => {
if (res.success) {
this.projectVersionList = res.result || []
} else {
this.projectVersionList = []
}
})
},
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/report/pageForManifest`, params).then(res => {
if (res.success) {
this.areaTable = [...res.result.records]
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) {
console.log(',,,')
},
showModal() {
this.title = this.$t('add')
this.newVisible = true
this.form = {}
},
editData(edit,num) {
// 编辑一行的数据
this.num = num
let query = JSON.parse(JSON.stringify(edit))
// if (query.projectVersion) {
// query.projectVersion = query.projectVersion.split(',')
// }else{
// query.projectVersion = []
// }
this.row = query
this.formData = { ...query }
this.selectedRowKeys = query.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.selectedRowKeysDate[0].configure){
this.$message.warning(this.$t('pleaseSelect') + this.$t('configure'))
this.confirmLoading = false
return;
}
this.$refs.ruleForm.validate(valid => {
if (valid) {
this.flag = true
this.confirmLoading = true
let postDate = {
paramsReportId: this.selectedRowKeys[0],
paramsReportConfigId: this.selectedRowKeysDate[0].configure,
}
//新增
getAction(`params/collectManifest/addReferencesCol`, 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.confirmLoading = false
this.newVisible = false
})
} else {
// this.$message.warning(this.$t('changeTheTitle'))
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'))
}
}
})
}
})
}
// 编辑
},
watch: {
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;
}
}
/deep/.propbox .ant-form-explain{
margin-top: -17px !important;
}
/deep/.ant-table-body{
max-height: 600px !important;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
z-index: 100;
background: #fff;
border-radius: 0 0 2px 2px;
}
.Required {
color: red;
margin-right: 4px;
}
.box-title-text {
line-height: 1.4;
display: flex;
/*align-items: center;*/
}
.title-text {
width: 84px;
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: 42px;
}
.box-input {
display: inline-block;
height: 38px;
width: 100%;
}
.itemModel {
width: calc(100% - 100px);
display: inline-block;
margin-top: 2px;
/*height: 40px;*/
margin-bottom: 24px;
}
.itemModel-text {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
}
.Required {
color: red;
margin-right: 4px;
}
.title-text-text {
margin-top: 9px;
}
.header-text {
font-size: 16px;
font-weight: bold;
margin-left: 15px;
/*border-bottom: 1px #d9d9d9 dashed;*/
height: 30px;
margin-bottom: 30px;
}
.formAdd {
margin-bottom: 40px;
}
.button-text {
height: 38px;
width: calc(100% - 100px);
line-height: 38px;
background: #fff;
border: 1px #00B3BE solid;
color: #00B3BE;
}
.button-text-text {
position: absolute;
right: -10px;
top: -21px;
display: inline-block;
padding: 6px;
border-radius: 50%;
background: red;
text-align: center;
line-height: 6px;
color: #fff;
}
.box-button {
height: 38px;
}
.itemOption {
display: inline-block;
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
}
</style>
<style lang='less'>
.area-module {
.ant-modal-wrap {
.ant-modal {
.ant-modal-content {
.ant-modal-footer {
text-align: center;
}
}
}
}
}
</style>
<style>
.itemAddAdmin .ant-form-item-control-wrapper .has-error .ant-form-explain {
white-space: nowrap !important;
}
</style>