修改选人组件
This commit is contained in:
@@ -1,16 +1,33 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div class="box-title-text" v-if="!isInput">
|
<div class="itemModelStand-select" v-if="!isInput">
|
||||||
<a-input class="box-input" :value="value" @input="indexclick($event)"
|
<a-select
|
||||||
:disabled="true"
|
class="itemModelStand-input"
|
||||||
:title="value"
|
:value="valueSelect"
|
||||||
:placeholder="$t('PleaseSelect')+query.db_field_txt"/>
|
@change="onChange"
|
||||||
|
mode="multiple"
|
||||||
|
:disabled="disabled"
|
||||||
|
:placeholder="$t('PleaseSelect')+query.db_field_txt"
|
||||||
|
:getPopupContainer="triggerNode=> triggerNode.parentNode">
|
||||||
|
<a-select-option
|
||||||
|
v-for="(item,index) in dictOptions"
|
||||||
|
:key="index"
|
||||||
|
:value="item.value">
|
||||||
|
<span class="itemOption" :title="item.title">
|
||||||
|
{{ item.title }}
|
||||||
|
</span>
|
||||||
|
</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
<!-- <a-input class="box-input" :value="value" @input="indexclick($event)"-->
|
||||||
|
<!-- :disabled="true"-->
|
||||||
|
<!-- :title="value"-->
|
||||||
|
<!-- :placeholder="$t('PleaseSelect')+query.db_field_txt"/>-->
|
||||||
<a-button type="primary" class="button-box" :disabled="disabled" @click="standardClick">
|
<a-button type="primary" class="button-box" :disabled="disabled" @click="standardClick">
|
||||||
{{this.$t('PersonnelSelection')}}
|
{{this.$t('PersonnelSelection')}}
|
||||||
</a-button>
|
</a-button>
|
||||||
<a-button type="primary" v-if='isDelete' class="button-box" @click="standardDelete">
|
<!-- <a-button type="primary" v-if='isDelete' class="button-box" @click="standardDelete">-->
|
||||||
{{this.$t('delete')}}
|
<!-- {{this.$t('delete')}}-->
|
||||||
</a-button>
|
<!-- </a-button>-->
|
||||||
</div>
|
</div>
|
||||||
<div class="box-title-text" v-if="isInput">
|
<div class="box-title-text" v-if="isInput">
|
||||||
<a-input :class="{'box-input':!isClass}" :value="value"
|
<a-input :class="{'box-input':!isClass}" :value="value"
|
||||||
@@ -71,7 +88,6 @@
|
|||||||
<a-button @click="handleSubmit" type="primary">{{$t('submit')}}</a-button>
|
<a-button @click="handleSubmit" type="primary">{{$t('submit')}}</a-button>
|
||||||
</div>
|
</div>
|
||||||
</a-drawer>
|
</a-drawer>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -91,6 +107,8 @@
|
|||||||
return {
|
return {
|
||||||
loading: false,
|
loading: false,
|
||||||
gData: [],
|
gData: [],
|
||||||
|
valueSelect: [],
|
||||||
|
dictOptions: [],
|
||||||
autoExpandParent: false,
|
autoExpandParent: false,
|
||||||
checkboxList: [],
|
checkboxList: [],
|
||||||
expandedKeys: [],
|
expandedKeys: [],
|
||||||
@@ -111,7 +129,35 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
this.valueSelect = []
|
||||||
|
this.dictOptions = []
|
||||||
|
setTimeout(() => {
|
||||||
|
if (this.value) {
|
||||||
|
let contentName = []
|
||||||
|
let contentId = []
|
||||||
|
if (this.personneQuery[this.query.db_field_name + 'Name']) {
|
||||||
|
contentName = this.personneQuery[this.query.db_field_name + 'Name'].split(',')
|
||||||
|
} else if (this.personneQuery[this.query.db_field_name]) {
|
||||||
|
contentName = this.personneQuery[this.query.db_field_name].split(',')
|
||||||
|
} else {
|
||||||
|
contentName = []
|
||||||
|
}
|
||||||
|
if (this.personneQuery[this.query.db_field_name + '_id']) {
|
||||||
|
contentId = this.personneQuery[this.query.db_field_name + '_id'].split(',')
|
||||||
|
} else if (this.personneQuery[this.query.db_field_name]) {
|
||||||
|
contentId = this.personneQuery[this.query.db_field_name].split(',')
|
||||||
|
} else {
|
||||||
|
contentId = []
|
||||||
|
}
|
||||||
|
contentId.forEach((res, index) => {
|
||||||
|
this.dictOptions.push({
|
||||||
|
value: res,
|
||||||
|
title: contentName[index]
|
||||||
|
})
|
||||||
|
this.valueSelect.push(res)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}, 600)
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// checkChange(val, checked, indeterminate) {
|
// checkChange(val, checked, indeterminate) {
|
||||||
@@ -314,6 +360,28 @@
|
|||||||
this.visible = false
|
this.visible = false
|
||||||
this.treeVisible = false
|
this.treeVisible = false
|
||||||
},
|
},
|
||||||
|
onChange(value) {
|
||||||
|
this.valueSelect = value
|
||||||
|
console.log(this.valueSelect)
|
||||||
|
console.log(this.dictOptions)
|
||||||
|
this.userIds = []
|
||||||
|
this.userName = []
|
||||||
|
if (this.valueSelect && this.valueSelect.length > 0) {
|
||||||
|
value.forEach(res => {
|
||||||
|
this.dictOptions.forEach(val => {
|
||||||
|
if (res == val.value) {
|
||||||
|
this.userIds.push(val.value)
|
||||||
|
this.userName.push(val.title)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
let userIds = JSON.parse(JSON.stringify(this.userIds))
|
||||||
|
let userName = JSON.parse(JSON.stringify(this.userName))
|
||||||
|
console.log(userIds)
|
||||||
|
this.$emit('input', userName.join(','))
|
||||||
|
this.$emit('change', this.query.db_field_name, userIds.join(','), this.query.subscript)
|
||||||
|
},
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
// if (this.userIds && this.userIds.length > 0) {
|
// if (this.userIds && this.userIds.length > 0) {
|
||||||
if (this.isSingleChoice) {
|
if (this.isSingleChoice) {
|
||||||
@@ -330,6 +398,19 @@
|
|||||||
// userIds = userIds.filter(function(item, index) {
|
// userIds = userIds.filter(function(item, index) {
|
||||||
// return userIds.indexOf(item) === index // 因为indexOf 只能查找到第一个
|
// return userIds.indexOf(item) === index // 因为indexOf 只能查找到第一个
|
||||||
// })
|
// })
|
||||||
|
if (!this.isInput) {
|
||||||
|
this.dictOptions = []
|
||||||
|
this.valueSelect = []
|
||||||
|
if (userIds && userIds.length > 0) {
|
||||||
|
userIds.forEach((res, index) => {
|
||||||
|
this.dictOptions.push({
|
||||||
|
title: userName[index],
|
||||||
|
value: res
|
||||||
|
})
|
||||||
|
this.valueSelect.push(res)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
this.$emit('input', userName.join(','))
|
this.$emit('input', userName.join(','))
|
||||||
this.$emit('change', this.query.db_field_name, userIds.join(','), this.query.subscript)
|
this.$emit('change', this.query.db_field_name, userIds.join(','), this.query.subscript)
|
||||||
this.visible = false
|
this.visible = false
|
||||||
@@ -514,11 +595,18 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.itemModelStand-input {
|
||||||
|
width: calc(100% - 100px);
|
||||||
|
display: inline-block;
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
.button-box {
|
.button-box {
|
||||||
|
width: 90px;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
height: 38px;
|
height: 38px;
|
||||||
line-height: 38px;
|
line-height: 38px;
|
||||||
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.drawer-bootom-button {
|
.drawer-bootom-button {
|
||||||
@@ -590,4 +678,18 @@
|
|||||||
color: #21c9cc;
|
color: #21c9cc;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.itemOption {
|
||||||
|
display: inline-block;
|
||||||
|
width: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
-o-text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<style>
|
||||||
|
.itemModelStand-select .ant-select-dropdown--multiple {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -150,6 +150,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||||
<PersonnelSelection :query="item"
|
<PersonnelSelection :query="item"
|
||||||
|
v-if="isFormInline"
|
||||||
:personneQuery="formInline"
|
:personneQuery="formInline"
|
||||||
@change="PersonnelSelectionChange"
|
@change="PersonnelSelectionChange"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
|
|||||||
+1
@@ -34,6 +34,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<a-form-model-item class="itemModel" prop="chargePersonIdName">
|
<a-form-model-item class="itemModel" prop="chargePersonIdName">
|
||||||
<PersonnelSelection
|
<PersonnelSelection
|
||||||
|
v-if="visible"
|
||||||
:isSingleChoice="true"
|
:isSingleChoice="true"
|
||||||
:query="{db_field_name:'chargePersonId',db_field_txt:$t('personCharge')}"
|
:query="{db_field_name:'chargePersonId',db_field_txt:$t('personCharge')}"
|
||||||
:personneQuery="formInline"
|
:personneQuery="formInline"
|
||||||
|
|||||||
+1
-1
@@ -94,7 +94,7 @@
|
|||||||
<span class="Required">*</span>
|
<span class="Required">*</span>
|
||||||
<span class="title-text-text" :title="$t('authorizedUser')">{{$t('authorizedUser')}}</span>
|
<span class="title-text-text" :title="$t('authorizedUser')">{{$t('authorizedUser')}}</span>
|
||||||
</div>
|
</div>
|
||||||
<a-form-model-item class="itemModel" prop="studioEngineerName">
|
<a-form-model-item class="itemModel-multi" prop="studioEngineerName">
|
||||||
<PersonnelSelection :query="{db_field_name:'studioEngineer',db_field_txt:$t('authorizedUser')}"
|
<PersonnelSelection :query="{db_field_name:'studioEngineer',db_field_txt:$t('authorizedUser')}"
|
||||||
:personneQuery="formInline"
|
:personneQuery="formInline"
|
||||||
@change="PersonnelSelectionChange"
|
@change="PersonnelSelectionChange"
|
||||||
|
|||||||
+1
-1
@@ -255,7 +255,7 @@
|
|||||||
<span class="Required" v-if="!disabled">*</span>
|
<span class="Required" v-if="!disabled">*</span>
|
||||||
<span class="title-text-text" :title="$t('regulatoryContact')">{{$t('regulatoryContact')}}</span>
|
<span class="title-text-text" :title="$t('regulatoryContact')">{{$t('regulatoryContact')}}</span>
|
||||||
</div>
|
</div>
|
||||||
<a-form-model-item class="itemModel" prop="lawsContactName">
|
<a-form-model-item class="itemModel-multi" prop="lawsContactName">
|
||||||
<PersonnelSelection
|
<PersonnelSelection
|
||||||
:query="{db_field_name:'lawsContact',db_field_txt:$t('regulatoryContact')}"
|
:query="{db_field_name:'lawsContact',db_field_txt:$t('regulatoryContact')}"
|
||||||
:personneQuery="formInline"
|
:personneQuery="formInline"
|
||||||
|
|||||||
@@ -155,6 +155,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
<a-form-model-item class="itemModel" :prop="item.db_field_name">
|
||||||
<PersonnelSelection :query="item"
|
<PersonnelSelection :query="item"
|
||||||
|
v-if="visible"
|
||||||
:personneQuery="formInline"
|
:personneQuery="formInline"
|
||||||
@change="PersonnelSelectionChange"
|
@change="PersonnelSelectionChange"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
|
|||||||
@@ -205,9 +205,10 @@
|
|||||||
<span class="title-text-text"
|
<span class="title-text-text"
|
||||||
:title="$t('Administrativeprivileges')">{{$t('Administrativeprivileges')}}</span>
|
:title="$t('Administrativeprivileges')">{{$t('Administrativeprivileges')}}</span>
|
||||||
</div>
|
</div>
|
||||||
<a-form-model-item class="itemModel" prop="authManageIdsName">
|
<a-form-model-item class="itemModel-multi" prop="authManageIdsName">
|
||||||
<PersonnelSelection class="box-input add-input"
|
<PersonnelSelection class="box-input add-input"
|
||||||
:personneQuery="form"
|
:personneQuery="form"
|
||||||
|
v-if="menuRightVisible"
|
||||||
:selectDepartment="true"
|
:selectDepartment="true"
|
||||||
:query="{db_field_name:'authManageIds',db_field_txt:$t('Administrativeprivileges')}"
|
:query="{db_field_name:'authManageIds',db_field_txt:$t('Administrativeprivileges')}"
|
||||||
@change="PersonnelSelectionChange"
|
@change="PersonnelSelectionChange"
|
||||||
@@ -223,9 +224,10 @@
|
|||||||
<span class="title-text-text"
|
<span class="title-text-text"
|
||||||
:title="$t('Checkthepermissions')">{{$t('Checkthepermissions')}}</span>
|
:title="$t('Checkthepermissions')">{{$t('Checkthepermissions')}}</span>
|
||||||
</div>
|
</div>
|
||||||
<a-form-model-item class="itemModel" prop="authViewIdsName">
|
<a-form-model-item class="itemModel-multi" prop="authViewIdsName">
|
||||||
<PersonnelSelection
|
<PersonnelSelection
|
||||||
class="box-input add-input"
|
class="box-input add-input"
|
||||||
|
v-if="menuRightVisible"
|
||||||
:selectDepartment="true"
|
:selectDepartment="true"
|
||||||
:personneQuery="form"
|
:personneQuery="form"
|
||||||
:query="{db_field_name:'authViewIds',db_field_txt:$t('Checkthepermissions')}"
|
:query="{db_field_name:'authViewIds',db_field_txt:$t('Checkthepermissions')}"
|
||||||
|
|||||||
@@ -99,6 +99,7 @@
|
|||||||
<PersonnelSelection
|
<PersonnelSelection
|
||||||
:query="{db_field_name:'userId',db_field_txt:$t('engineer')}"
|
:query="{db_field_name:'userId',db_field_txt:$t('engineer')}"
|
||||||
:personneQuery="formInline"
|
:personneQuery="formInline"
|
||||||
|
v-if="visible"
|
||||||
:distributionEngineerList="distributionEngineerList"
|
:distributionEngineerList="distributionEngineerList"
|
||||||
@change="PersonnelSelectionChange"
|
@change="PersonnelSelectionChange"
|
||||||
v-model="formInline.userIdName"/>
|
v-model="formInline.userIdName"/>
|
||||||
|
|||||||
@@ -93,10 +93,11 @@
|
|||||||
<span class="Required">*</span>
|
<span class="Required">*</span>
|
||||||
<span class="title-text-text" :title="$t('StudioEngineer')">{{$t('StudioEngineer')}}</span>
|
<span class="title-text-text" :title="$t('StudioEngineer')">{{$t('StudioEngineer')}}</span>
|
||||||
</div>
|
</div>
|
||||||
<a-form-model-item class="itemModel" :prop="'studioEngineerName'">
|
<a-form-model-item class="itemModel-multi" :prop="'studioEngineerName'">
|
||||||
<PersonnelSelection :query="{db_field_name:'studioEngineer',db_field_txt:$t('StudioEngineer')}"
|
<PersonnelSelection :query="{db_field_name:'studioEngineer',db_field_txt:$t('StudioEngineer')}"
|
||||||
:isSingleChoice="true"
|
:isSingleChoice="true"
|
||||||
:personneQuery="formInline"
|
:personneQuery="formInline"
|
||||||
|
v-if="visible"
|
||||||
@change="PersonnelSelectionChange"
|
@change="PersonnelSelectionChange"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
v-model="formInline.studioEngineerName"/>
|
v-model="formInline.studioEngineerName"/>
|
||||||
@@ -108,10 +109,11 @@
|
|||||||
<div class="title-text">
|
<div class="title-text">
|
||||||
<span class="title-text-text" :title="$t('certifiedEngineer')">{{$t('certifiedEngineer')}}</span>
|
<span class="title-text-text" :title="$t('certifiedEngineer')">{{$t('certifiedEngineer')}}</span>
|
||||||
</div>
|
</div>
|
||||||
<a-form-model-item class="itemModel" :prop="'certificationEngineerName'">
|
<a-form-model-item class="itemModel-multi" :prop="'certificationEngineerName'">
|
||||||
<PersonnelSelection
|
<PersonnelSelection
|
||||||
:query="{db_field_name:'certificationEngineer',db_field_txt:$t('certifiedEngineer')}"
|
:query="{db_field_name:'certificationEngineer',db_field_txt:$t('certifiedEngineer')}"
|
||||||
:personneQuery="formInline"
|
:personneQuery="formInline"
|
||||||
|
v-if="visible"
|
||||||
@change="PersonnelSelectionChange"
|
@change="PersonnelSelectionChange"
|
||||||
:disabled="disabled"
|
:disabled="disabled"
|
||||||
v-model="formInline.certificationEngineerName"/>
|
v-model="formInline.certificationEngineerName"/>
|
||||||
|
|||||||
@@ -176,8 +176,9 @@
|
|||||||
<span class="title-text-text" :title="$t('regulatoryEngineer')">{{$t('regulatoryEngineer')}}</span>
|
<span class="title-text-text" :title="$t('regulatoryEngineer')">{{$t('regulatoryEngineer')}}</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- :prop="'lawEngineerName'"-->
|
<!-- :prop="'lawEngineerName'"-->
|
||||||
<a-form-model-item class="itemModel">
|
<a-form-model-item class="itemModel-multi">
|
||||||
<PersonnelSelection
|
<PersonnelSelection
|
||||||
|
v-if="editVisible"
|
||||||
:query="{db_field_name:'lawEngineer',db_field_txt:$t('regulatoryEngineer')}"
|
:query="{db_field_name:'lawEngineer',db_field_txt:$t('regulatoryEngineer')}"
|
||||||
:personneQuery="formInline"
|
:personneQuery="formInline"
|
||||||
:isDelete='true'
|
:isDelete='true'
|
||||||
@@ -196,8 +197,9 @@
|
|||||||
<span class="title-text-text" :title="$t('engineeringInterfacePerson')">{{$t('engineeringInterfacePerson')}}</span>
|
<span class="title-text-text" :title="$t('engineeringInterfacePerson')">{{$t('engineeringInterfacePerson')}}</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- :prop="'engineeringInterfacePersonName'"-->
|
<!-- :prop="'engineeringInterfacePersonName'"-->
|
||||||
<a-form-model-item class="itemModel">
|
<a-form-model-item class="itemModel-multi">
|
||||||
<PersonnelSelection
|
<PersonnelSelection
|
||||||
|
v-if="editVisible"
|
||||||
:query="{db_field_name:'engineeringInterfacePerson',db_field_txt:$t('engineeringInterfacePerson')}"
|
:query="{db_field_name:'engineeringInterfacePerson',db_field_txt:$t('engineeringInterfacePerson')}"
|
||||||
:personneQuery="formInline"
|
:personneQuery="formInline"
|
||||||
:isDelete='true'
|
:isDelete='true'
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
<PersonnelSelection
|
<PersonnelSelection
|
||||||
:query="{db_field_name:'lawEngineer',db_field_txt:$t('regulatoryEngineer')}"
|
:query="{db_field_name:'lawEngineer',db_field_txt:$t('regulatoryEngineer')}"
|
||||||
:personneQuery="formInline"
|
:personneQuery="formInline"
|
||||||
|
v-if="visible"
|
||||||
@change="PersonnelSelectionChange"
|
@change="PersonnelSelectionChange"
|
||||||
v-model="formInline.lawEngineerName"/>
|
v-model="formInline.lawEngineerName"/>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
@@ -36,6 +37,7 @@
|
|||||||
<PersonnelSelection
|
<PersonnelSelection
|
||||||
:query="{db_field_name:'engineeringInterfacePerson',db_field_txt:$t('engineeringInterfacePerson')}"
|
:query="{db_field_name:'engineeringInterfacePerson',db_field_txt:$t('engineeringInterfacePerson')}"
|
||||||
:personneQuery="formInline"
|
:personneQuery="formInline"
|
||||||
|
v-if="visible"
|
||||||
@change="PersonnelSelectionChange"
|
@change="PersonnelSelectionChange"
|
||||||
v-model="formInline.engineeringInterfacePersonName"/>
|
v-model="formInline.engineeringInterfacePersonName"/>
|
||||||
</a-form-model-item>
|
</a-form-model-item>
|
||||||
|
|||||||
Reference in New Issue
Block a user