Merge branch 'dev' into build

This commit is contained in:
aixianling
2022-08-24 16:35:06 +08:00

View File

@@ -25,9 +25,9 @@
<el-form-item label="网格员姓名" prop="name"> <el-form-item label="网格员姓名" prop="name">
<el-input v-model="forms.name" placeholder="请选择网格员" disabled> <el-input v-model="forms.name" placeholder="请选择网格员" disabled>
<template #append> <template #append>
<ai-wechat-selecter :isMultiple="false" refs="addTags" :instance="instance" v-model="users" @change="getSelectPerson"> <ai-user-selecter :isMultiple="false" refs="addTags" :instance="instance" v-model="users" @change="getSelectPerson">
<el-button size="small" type="primary"><span style="color: #fff">选择成员</span></el-button> <el-button size="small" type="primary"><span style="color: #fff">选择成员</span></el-button>
</ai-wechat-selecter> </ai-user-selecter>
</template> </template>
</el-input> </el-input>
</el-form-item> </el-form-item>
@@ -197,17 +197,17 @@
</template> </template>
</ai-card> </ai-card>
</el-form> </el-form>
<ai-dialog title="选择网格" :visible.sync="showGrid" :customFooter="true" :destroyOnClose="true" border width="720px"> <ai-dialog title="选择网格" :visible.sync="showGrid" :customFooter="true" border width="720px">
<div class="grid"> <div class="grid">
<el-tree <el-tree
:data="treeObj.treeList" :data="treeList"
:props="treeObj.defaultProps" :props="defaultProps"
node-key="id" node-key="id"
ref="tree" ref="tree"
:check-strictly="true" :check-strictly="true"
show-checkbox show-checkbox
:default-expanded-keys="currCheckedKeys"
:default-checked-keys="currCheckedKeys" :default-checked-keys="currCheckedKeys"
default-expand-all
@check="onCheckChange"> @check="onCheckChange">
</el-tree> </el-tree>
</div> </div>
@@ -266,13 +266,14 @@ export default {
}], }],
showGrid: false, showGrid: false,
treeObj: { treeObj: {
treeList: [],
defaultProps: {
children: "girdList",
label: "girdName",
},
checkedKeys: [], checkedKeys: [],
}, },
treeList: [],
defaultProps: {
children: "children",
label: "girdName",
},
defaultExpandedKeys: [],
girdInfoStr: '', girdInfoStr: '',
photoList: [], photoList: [],
title: "添加网格员", title: "添加网格员",
@@ -391,12 +392,26 @@ export default {
}, },
beforeSelectTree() { beforeSelectTree() {
this.treeObj.checkedKeys = []; this.treeObj.checkedKeys = [];
this.instance.post(`/app/appgirdinfo/listAll`, null, null).then((res) => { this.instance.post(`/app/appgirdinfo/listAll3`, null, null).then((res) => {
if (res.code == 0) { if (res.code == 0) {
this.treeObj.treeList = res.data;
this.forms.girdInfoList.map((e) => { this.forms.girdInfoList.map((e) => {
this.treeObj.checkedKeys.push(e.id); this.treeObj.checkedKeys.push(e.id);
}); });
this.treeList = res.data.filter(e => !e.parentGirdId)
const parentGirdId = this.treeList[0].id
this.treeList.map(p => this.addChild(p, res.data.map(v => {
if (v.id === parentGirdId) {
this.defaultExpandedKeys.push(v.id)
}
return {
...v
}
}), {
parent: 'parentGirdId'
}))
} }
}); });
}, },