|
@@ -21,7 +21,7 @@
|
|
|
</a-form-model-item>
|
|
|
<template v-if="model.interlockType !== '0'">
|
|
|
<a-form-model-item label="父级节点" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="pid">
|
|
|
- <j-tree-select
|
|
|
+ <!-- <j-tree-select
|
|
|
ref="treeSelect"
|
|
|
placeholder="请选择父级节点"
|
|
|
v-model="model.pid"
|
|
@@ -31,14 +31,20 @@
|
|
|
pidValue="0"
|
|
|
hasChildField="has_child"
|
|
|
>
|
|
|
- </j-tree-select>
|
|
|
- <!-- <a-tree-select
|
|
|
+ </j-tree-select> -->
|
|
|
+ <a-tree-select
|
|
|
v-model="model.pid"
|
|
|
style="width: 100%"
|
|
|
:tree-data="interlockTwoTree"
|
|
|
placeholder="请选择"
|
|
|
tree-default-expand-all
|
|
|
- ></a-tree-select> -->
|
|
|
+ :replaceFields="{
|
|
|
+ children: 'children',
|
|
|
+ key: 'id',
|
|
|
+ value: 'id',
|
|
|
+ title: 'interlockName',
|
|
|
+ }"
|
|
|
+ ></a-tree-select>
|
|
|
<!-- :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" -->
|
|
|
</a-form-model-item>
|
|
|
</template>
|
|
@@ -50,7 +56,7 @@
|
|
|
|
|
|
<script>
|
|
|
|
|
|
- import { httpAction } from '@/api/manage'
|
|
|
+ import { httpAction, getAction } from '@/api/manage'
|
|
|
import { validateDuplicateValue } from '@/utils/util'
|
|
|
export default {
|
|
|
name: "InterlockBaseModal",
|
|
@@ -82,6 +88,7 @@
|
|
|
url: {
|
|
|
add: "/base/interlockBase/add",
|
|
|
edit: "/base/interlockBase/edit",
|
|
|
+ lever12: '/base/interlockBase/lever12',
|
|
|
},
|
|
|
expandedRowKeys:[],
|
|
|
pidField:"pid",
|
|
@@ -94,11 +101,19 @@
|
|
|
this.modelDefault = JSON.parse(JSON.stringify(this.model));
|
|
|
},
|
|
|
methods: {
|
|
|
+ getInterlockTwoTree(){
|
|
|
+ getAction(this.url.lever12).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ this.interlockTwoTree = res
|
|
|
+ })
|
|
|
+ },
|
|
|
add (obj) {
|
|
|
+ this.getInterlockTwoTree()
|
|
|
this.modelDefault.pid=''
|
|
|
this.edit(Object.assign(this.modelDefault , obj));
|
|
|
},
|
|
|
edit (record) {
|
|
|
+ this.getInterlockTwoTree()
|
|
|
this.model = Object.assign({}, record);
|
|
|
this.visible = true;
|
|
|
},
|