功能系统维护对接

This commit is contained in:
zyx.net
2023-03-29 10:51:49 +08:00
parent 1b24757bc3
commit 658141010d
3 changed files with 90 additions and 22 deletions
+1
View File
@@ -1734,4 +1734,5 @@ module.exports = {
gnxtwh:'Functional system maintenance',
gnxt:'Functional system',
dykzq:'Corresponding controller',
nomorethan:'No more than 10',
}
+1
View File
@@ -1836,4 +1836,5 @@ module.exports = {
gnxtwh:'功能系统维护',
gnxt:'功能系统',
dykzq:'对应控制器',
nomorethan:'不能超过10个',
}
@@ -28,7 +28,7 @@
>
<span slot="detailText" slot-scope="text,record">
<span class="text" :title="text">
{{text && text.length > 10?text.slice(0,9)+'...':text}}
{{text && text.length > 100?text.slice(0,99)+'...':text}}
</span>
</span>
<span slot="operation" slot-scope="text,record">
@@ -58,7 +58,7 @@
</div>
</a-drawer>
<a-modal
:title="$t('newlyAdded')"
:title="title"
:width="600"
:visible="visibleadd"
:confirm-loading="confirmLoading"
@@ -66,7 +66,7 @@
@ok="handleaddOk"
@cancel="handleaddCancel"
>
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm" style='margin-left: -40px'>
<a-row :gutter="24">
<a-col :span="24">
<div class="box-title-text">
@@ -75,32 +75,37 @@
<span class="title-text-text" :title="$t('gnxt')">
{{$t('gnxt')}}</span>
</div>
<a-form-model-item class="itemModel" prop="bazt">
<a-form-model-item class="itemModel" prop="gnxt">
<a-input class="box-input" :placeholder="$t('PleaseEnter')+$t('gnxt')"
style='width: 80%;'
v-model="formInline.gnxt"></a-input>
</a-form-model-item>
</div>
</a-col>
<div v-for="(item,index) in formInline.dataList" :key="index">
<div class="header-text">
{{$t('dykzq')}}
<a-icon class="icon-text" @click="addClick(index)" type="plus-circle"/>
<a-icon class="icon-text" v-if="formInline.dataList.length > 1" @click="deleteClick(index)"
type="minus-circle" :disabled="disabled"/>
</div>
<div style='margin-left: 25px'>
<a-row :gutter="24">
<div style='margin-left: 26px'>
<a-row :gutter="24" style='height:0px'>
<a-col :span="24">
<div class="box-title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('dykzq') + (index+1)">{{$t('dykzq') + (index+1)}}</span>
</div>
<a-form-model-item class="itemModel">
<a-form-model-item class="itemModel"
:prop="'dataList.'+index+'.dykzq'"
:rules="[{ required: true, message: $t('dykzq') + $t('cannotEmpty'), trigger: 'blur'},
{max: 50,message: $t('relevantSections') + $t('cannotExceed') + 50 + $t('Characters'),trigger: 'blur'
}]">
<a-input class="box-input"
:disabled="disabled"
v-model="item.dykzq"
style='width: 87%;'
:placeholder="$t('PleaseEnter')+$t('dykzq')"/>
</a-form-model-item>
<div class="header-text">
<a-icon class="icon-text" @click="addClick(index)" type="plus-circle"/>
<a-icon class="icon-text" v-if="formInline.dataList.length > 1" @click="deleteClick(index)"
type="minus-circle" :disabled="disabled"/>
</div>
</div>
</a-col>
</a-row>
@@ -115,7 +120,7 @@
</template>
<script>
import { getAction, postAction ,deleteAction } from '@/api/manage'
import { getAction, postAction ,deleteAction, putAction } from '@/api/manage'
import uploadFile from '@/components/uploadFile/file'
import { mapGetters } from 'vuex'
@@ -128,6 +133,7 @@ export default {
return {
loading: false,
dataSourcehistory:[],
title:'',
columnshistory: [
{
title: this.$t('gnxt'),
@@ -142,18 +148,34 @@ export default {
dataIndex: 'dykzq',
align: 'left',
ellipsis: true,
width: 100,
scopedSlots: { customRender: 'detailText' }
},
{
title: this.$t('operation'),
align: 'left',
fixed: 'right',
width: 220,
width: 100,
scopedSlots: { customRender: 'operation' }
}
],
rules:[],
rules: {
gnxt: [
{
required: true,
message: this.$t('gnxt') + this.$t('cannotEmpty'),
trigger: 'blur'
},
{max: 50,message: this.$t('relevantSections') + this.$t('cannotExceed') + 50 + this.$t('Characters'),trigger: 'blur'
}
],
// dykzq: [
// {
// required: true,
// message: this.$t('dykzq') + this.$t('cannotEmpty'),
// trigger: 'blur'
// }
// ],
},
pageSizehistory: 10,
total: 0,
pageNohistory: 1,
@@ -161,7 +183,14 @@ export default {
visibleadd: false,
disabled: false,
showButton:false,
formInline: {},
formInline: {
dataList:[
{
dykzq:'',
}
],
gnxt:''
},
confirmLoading: false,
acceptcode:'',
projectNameList: [],
@@ -169,7 +198,8 @@ export default {
url:{
addModel:''
},
record:{}
record:{},
type:''
}
},
mounted() {
@@ -182,13 +212,35 @@ export default {
this.bussLogList()
},
addHandleClick(){
this.title = this.$t('add')
this.type = 'add'
this.visibleadd = true
this.formInline.gnxt = ''
this.formInline.dataList = [{}]
this.$nextTick(() => {
this.$refs.ruleForm.clearValidate()
})
},
editClick(){
editClick(item){
this.title = this.$t('edit')
this.type = 'edit'
this.formInline.gnxt = item.gnxt
let List = item.dykzq.split(',')
let arr = []
List.forEach((item,index)=>{
arr.push({dykzq:List[index]})
})
this.formInline.dataList = arr
this.visibleadd = true
this.$nextTick(() => {
this.$refs.ruleForm.clearValidate()
})
},
addClick(index){
if(this.formInline.dataList.length + 1 > 10){
this.$message.warning(this.$t('nomorethan'))
return
}
this.formInline.dataList.splice(index + 1, 0, {})
this.formInline = { ...this.formInline }
},
@@ -209,13 +261,22 @@ export default {
dykzqList.push(item.dykzq)
})
this.formInline.dykzq = dykzqList.join(',')
let url = ''
let action = ''
if(this.type == 'add'){
url = 'ota/otaBaSjGnxtwh/add'
action = postAction
}else{
url = 'ota/otaBaSjGnxtwh/edit'
action = putAction
}
this.$refs.ruleForm.validate(valid => {
if (valid) {
let query = {
...this.formInline
}
this.confirmLoading = true
postAction('ota/otaBaSjGnxtwh/add', query).then((res) => {
action(url, query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.visibleadd = false
@@ -231,6 +292,7 @@ export default {
},
handleaddCancel() {
this.visibleadd = false
this.formInline = {}
},
onChangehistory(page, pageSize) {
this.pageNohistory = page
@@ -320,6 +382,10 @@ export default {
}
.header-text {
position: relative;
top: 11px;
left: -70px;
width: 55px;
font-size: 16px;
font-weight: 500;
}