feat: 标准库 统一组织结构树组件

This commit is contained in:
super_liu
2021-07-21 19:12:54 +08:00
parent 9230484aa9
commit c1c23c001c
8 changed files with 768 additions and 218 deletions
@@ -510,12 +510,7 @@
class="add-form-item"
>
<template slot="label">乘用车VPPS编码</template>
<tree-select
:disabled="false"
width = "340"
:data="busVppsOptions"
:defaultProps="defaultCodeProps" :checkedKeys="defaultCheckedKeys1"
:nodeKey="nodeKeyCode" @popoverHide="popoverHideBusVs"></tree-select>
<el-input v-model="sarStandardsInfoEO.CYCVPPSBM" placeholder="选择乘用车VPPS编码" @click.native="choiceZRR2('cycvppsbm', '乘用车VPPS', sarStandardsInfoEO.cycvppsbm)"></el-input>
</el-form-item>
</template>
<template v-else-if="field.attrField === 'KCCVPPSBM'">
@@ -525,12 +520,7 @@
class="add-form-item"
>
<template slot="label">卡车VPPS编码</template>
<tree-select
:disabled="false"
width = "340"
:data="busVppsOptions"
:defaultProps="defaultCodeProps" :checkedKeys="defaultCheckedKeys2"
:nodeKey="nodeKeyCode" @popoverHide="popoverHideCarVs"></tree-select>
<el-input v-model="sarStandardsInfoEO.KCCVPPSBM" placeholder="选择卡车VPPS编码" @click.native="choiceZRR3('kccvppsbm', '卡车VPPS', sarStandardsInfoEO.kccvppsbm)"></el-input>
</el-form-item>
</template>
<template v-else-if="field.attrField === 'DYBXH'">
@@ -540,12 +530,7 @@
class="add-form-item"
>
<template slot="label">模块结构单元变型号</template>
<tree-select
width = "340"
:disabled="false"
:data="modelOptions"
:defaultProps="defaultModelProps" :checkedKeys="defaultCheckedKeys3"
:nodeKey="nodeKeyModel" @popoverHide="popoverHideModel"></tree-select>
<el-input v-model="sarStandardsInfoEO.DYBXH" placeholder="选择模块结构单元变型号" @click.native="choiceZRR4('dybxh', '模块结构单元', sarStandardsInfoEO.dybxh)"></el-input>
</el-form-item>
</template>
<template v-else-if="field.attrField === 'CYCVPPSCN'">
@@ -1031,6 +1016,37 @@
@click="closeModal">取消</el-button>
</div>
</el-drawer>
<!-- 组件树-->
<tree-select-new
width = "500"
:lazy=true
:multiple=false
:modalShowFlag="modalShowFlag2"
:drawerTitle="drawerTitle"
:url="url"
:urlChild="urlChild"
:defaultProps="defaultCodeProps" :checkedKeys="defaultCheckedKeys1"
:nodeKey="nodeKeyCode" @popoverHide="popoverHideBusVs"></tree-select-new>
<tree-select-new
width = "500"
:lazy=true
:multiple=false
:modalShowFlag="modalShowFlag3"
:drawerTitle="drawerTitle"
:url="url"
:urlChild="urlChild"
:defaultProps="defaultCodeProps" :checkedKeys="defaultCheckedKeys2"
:nodeKey="nodeKeyCode" @popoverHide="popoverHideCarVs"></tree-select-new>
<tree-select-new
width = "500"
:lazy=true
:multiple=false
:modalShowFlag="modalShowFlag4"
:drawerTitle="drawerTitle"
:url="url"
:urlChild="urlChild"
:defaultProps="defaultModelProps" :checkedKeys="defaultCheckedKeys3"
:nodeKey="nodeKeyModel" @popoverHide="popoverHideModel"></tree-select-new>
<!-- 导入失败 -->
<el-dialog :visible.sync="importFailed" :close-on-click-modal="false" width="400px">
<p slot="title" style="color:#f60">
@@ -1078,6 +1094,7 @@ import CustomRoleTree from '@/components/CustomFormComponents/roleTree'
import CustomDatePickWithText2 from '@/components/CustomFormComponents/DatePickerWithText2'
import { interfaceUrl } from "@/sysConfig";
import TreeSelect from '@/components/treeSelect/treeSelect.vue';
import TreeSelectNew from '@/components/treeSelect/treeSelectNew.vue';
export default {
name: 'foreignStandardsAndRegulations',
@@ -1098,7 +1115,8 @@ export default {
CustomSVPPS,
CustomRoleTree,
CustomDatePickWithText2,
TreeSelect
TreeSelect,
TreeSelectNew
},
data () {
return {
@@ -1114,6 +1132,13 @@ export default {
},
nodeKeyCode: 'code',
nodeKeyModel: 'model',
modalShowFlag1: false, // drawer开关
modalShowFlag2: false, // drawer开关
modalShowFlag3: false, // drawer开关
modalShowFlag4: false, // drawer开关
url:'',
urlChild:'',
drawerTitle: '', //drawer标题
nodeKey: 'id',
defaultCheckedKeys1: [],
defaultCheckedKeys2: [],
@@ -1722,6 +1747,71 @@ export default {
watch: {
},
methods: {
choiceZRR2 (type, title, id) {
this.drawerTitle = title
this.modalShowFlag2 = true
this.url = ''
this.urlChild = ''
this.url="sarVppsTree/list"
this.urlChild="sarVppsTree/childByList"
},
choiceZRR3 (type, title, id) {
this.drawerTitle = title
this.modalShowFlag3 = true
this.url = ''
this.urlChild = ''
this.url="sarVppsTree/list"
this.urlChild="sarVppsTree/childByList"
},
choiceZRR4 (type, title, id) {
this.drawerTitle = title
this.modalShowFlag4 = true
this.url = ''
this.urlChild = ''
this.url="sarModelTree/list"
this.urlChild="sarModelTree/childByList"
},
popoverHideBusVs (checkedIds, checkedData,isShow,isLoadChild,topId) {
console.log(checkedData)
debugger
if(checkedData) {
if(checkedData.length > 0){
this.sarStandardsInfoEO.CYCVPPSBM = checkedData.map(item => item.code).join(",")
this.sarStandardsInfoEO.CYCVPPSCN = checkedData.map(item => item.chineseName).join(",")
}else {
this.sarStandardsInfoEO.CYCVPPSBM = checkedData.code
this.sarStandardsInfoEO.CYCVPPSCN = checkedData.chineseName
}
}
this.modalShowFlag2 = false
this.$forceUpdate()
},
popoverHideCarVs (checkedIds, checkedData,isShow,isLoadChild,topId) {
if(checkedData) {
if(checkedData.length > 0){
this.sarStandardsInfoEO.KCCVPPSBM = checkedData.map(item => item.code).join(",")
this.sarStandardsInfoEO.KCCVPPSCN = checkedData.map(item => item.chineseName).join(",")
}else {
this.sarStandardsInfoEO.KCCVPPSBM = checkedData.code
this.sarStandardsInfoEO.KCCVPPSCN = checkedData.chineseName
}
}
this.modalShowFlag3 = false
this.$forceUpdate()
},
popoverHideModel (checkedIds, checkedData,isShow,isLoadChild,topId) {
if(checkedData) {
if(checkedData.length > 0){
this.sarStandardsInfoEO.DYBXH = checkedData.map(item => item.model).join(",")
this.sarStandardsInfoEO.DYMC = checkedData.map(item => item.name).join(",")
}else {
this.sarStandardsInfoEO.DYBXH = checkedData.model
this.sarStandardsInfoEO.DYMC = checkedData.name
}
}
this.modalShowFlag4 = false
this.$forceUpdate()
},
// 将文本状态的id与name对应
setMap(data){
data.forEach(item => {
@@ -1729,28 +1819,6 @@ export default {
})
console.log(this.textStatusMap, '文本状态的值')
},
popoverHideBusVs (checkedIds, checkedData) {
if(checkedData){
this.sarStandardsInfoEO.CYCVPPSBM = checkedData.code
this.sarStandardsInfoEO.CYCVPPSCN = checkedData.chineseName
this.$forceUpdate()
}
},
popoverHideCarVs (checkedIds, checkedData) {
if(checkedData){
this.sarStandardsInfoEO.KCCVPPSBM = checkedData.code
this.sarStandardsInfoEO.KCCVPPSCN = checkedData.chineseName
this.$forceUpdate()
}
},
popoverHideModel (checkedIds, checkedData) {
if(checkedData){
this.sarStandardsInfoEO.DYBXH = checkedData.model
this.sarStandardsInfoEO.DYMC = checkedData.name
this.$forceUpdate()
}
},
busVsFunc(){
this.$http.get('sarVppsTree/list', '', {
_this: this