461 lines
12 KiB
Java
461 lines
12 KiB
Java
<template>
|
|
<div class='diolag-area'>
|
|
<a-spin :spinning='spinLoading'>
|
|
<a-form layout="inline" @keyup.enter.native="searchQuery">
|
|
<a-row :gutter="24">
|
|
<a-col :md="12" :sm="8">
|
|
<div class="box-title-text">
|
|
<div class="title-text">
|
|
<!-- <span class="Required">*</span>-->
|
|
<span class="title-text-text" :title="$t('NiONumber')">{{$t('NiONumber')}}</span>
|
|
</div>
|
|
<a-form-model-item class="itemModel">
|
|
<a-input class="box-input" :title="$t('pleaseEnter')+$t('ParameterName')"
|
|
v-model='form.nioNumber' :placeholder="$t('pleaseEnter')+$t('NiONumber')"/>
|
|
</a-form-model-item>
|
|
</div>
|
|
</a-col>
|
|
<a-col :md="12" :sm="8">
|
|
<div class="box-title-text">
|
|
<div class="title-text">
|
|
<!-- <span class="Required">*</span>-->
|
|
<span class="title-text-text" :title="$t('ParameterName')">{{$t('ParameterName')}}</span>
|
|
</div>
|
|
<a-form-model-item class="itemModel">
|
|
<a-input class="box-input"
|
|
v-model='form.paramsName' :title="$t('pleaseEnter')+$t('ParameterName')"
|
|
:placeholder="$t('pleaseEnter')+$t('ParameterName')"/>
|
|
</a-form-model-item>
|
|
</div>
|
|
</a-col>
|
|
<a-col :md="12" :sm="8">
|
|
<div class="box-title-text">
|
|
<div class="title-text">
|
|
<!-- <span class="Required">*</span>-->
|
|
<span class="title-text-text" :title="$t('areaOfResponsibility')">{{$t('areaOfResponsibility')}}</span>
|
|
</div>
|
|
<a-form-model-item class="itemModel">
|
|
<j-dict-select-tag class="box-input" v-model='form.dutyTerritory'
|
|
:placeholder="$t('PleaseSelect')+$t('areaOfResponsibility')"
|
|
:type="'select'"
|
|
:title="$t('PleaseSelect')+$t('areaOfResponsibility')"
|
|
:triggerChange='false' :dictCode="'duty_territory'"/>
|
|
</a-form-model-item>
|
|
</div>
|
|
</a-col>
|
|
<a-col :md="12" :sm="8">
|
|
<span style="float: right;overflow: hidden;margin-right: 16px;margin-bottom: 20px"
|
|
class="table-page-search-submitButtons">
|
|
<a-button class='box-button' @click='searchReset'>{{ $t('reset') }}</a-button>
|
|
<a-button class='box-button' style='margin-left: 8px' type='primary' @click='searchQuery'>{{ $t('query') }}</a-button>
|
|
</span>
|
|
|
|
</a-col>
|
|
</a-row>
|
|
</a-form>
|
|
</a-spin>
|
|
<a-table
|
|
class='table-area'
|
|
ref='table'
|
|
size='middle'
|
|
rowKey='id'
|
|
:columns='columns'
|
|
:dataSource='areaTable'
|
|
:pagination='false'
|
|
:loading='loading'
|
|
:scroll='{x: 760,y:400}'
|
|
: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'
|
|
|
|
export default {
|
|
name: 'diolagArea',
|
|
components: {},
|
|
data() {
|
|
return {
|
|
title: this.$t('add'),
|
|
total: 0,
|
|
selectedRowKeysDate: {},
|
|
loading: false,
|
|
editId: '',
|
|
columns: [
|
|
{
|
|
title: this.$t('NiONumber'),
|
|
dataIndex: 'nioNumber',
|
|
align: 'left',
|
|
width: 200,
|
|
ellipsis: true
|
|
},
|
|
{
|
|
title: this.$t('ParameterName'),
|
|
align: 'left',
|
|
dataIndex: 'paramsName',
|
|
width: 200,
|
|
ellipsis: true
|
|
},
|
|
{
|
|
title: this.$t('areaOfResponsibility'),
|
|
dataIndex: 'dutyTerritory_dictText',
|
|
align: 'left',
|
|
width: 200,
|
|
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: {
|
|
paramsManifest: {
|
|
type: Object,
|
|
default: {},
|
|
require: true
|
|
}
|
|
},
|
|
mounted() {
|
|
this.loadData()
|
|
},
|
|
methods: {
|
|
loadData() {
|
|
this.loading = true
|
|
let _tt = {
|
|
paramsManifestId: this.paramsManifest.id,
|
|
paramsTemplateId: this.paramsManifest.paramsTemplateId,
|
|
paramsTemplatePublishVersion: this.paramsManifest.paramsTemplatePublishVersion
|
|
}
|
|
let params = {
|
|
...this.form,
|
|
..._tt
|
|
}
|
|
getAction(`params/collectManifest/paramsInfoList`, params).then(res => {
|
|
if (res.success) {
|
|
this.areaTable = [...res.result]
|
|
}
|
|
}).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
|
|
this.$emit('addselectedRowKeys', this.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 {
|
|
// this.$refs.ruleForm.validate(valid => {
|
|
// if (valid) {
|
|
this.flag = true
|
|
this.spinLoading = true
|
|
this.confirmLoading = true
|
|
//新增
|
|
let postDate = {
|
|
paramsInfoPublishEOList: this.selectedRowKeysDate,
|
|
paramsManifestId: this.paramsManifest.id,
|
|
projectId: this.$route.query.projectId
|
|
}
|
|
postAction(`params/collectManifest/add`, postDate).then(res => {
|
|
if (res.success) {
|
|
this.newVisible = false
|
|
this.$message.success(this.$t('OperationSuccessful'))
|
|
} else {
|
|
this.$message.warning(res.message)
|
|
}
|
|
}
|
|
).finally(() => {
|
|
this.flag = false
|
|
this.confirmLoading = false
|
|
this.$emit('areaVisible')
|
|
this.$emit('GetgetTableList')
|
|
this.spinLoading = false
|
|
this.newVisible = 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: {
|
|
paramsManifest(val) {
|
|
this.loadData()
|
|
}
|
|
}
|
|
|
|
}
|
|
</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;
|
|
}
|
|
|
|
.box-title-text {
|
|
line-height: 1.4;
|
|
display: flex;
|
|
/*align-items: center;*/
|
|
}
|
|
|
|
.title-text {
|
|
width: 114px;
|
|
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% - 130px);
|
|
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;
|
|
}
|
|
</style>
|
|
<style lang='less'>
|
|
.area-module {
|
|
.ant-modal-wrap {
|
|
.ant-modal {
|
|
.ant-modal-content {
|
|
.ant-modal-footer {
|
|
text-align: center;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</style>
|
|
<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%;
|
|
}
|
|
|
|
.itemModel-text .ant-form-item-control-wrapper {
|
|
width: 100% !important;
|
|
}
|
|
|
|
.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;
|
|
}
|
|
</style> |