|
@@ -1,5 +1,51 @@
|
|
<template>
|
|
<template>
|
|
<div class="personList">
|
|
<div class="personList">
|
|
|
|
+ <div class="nav-left">
|
|
|
|
+ <p style="font-size: 16px; color: #00bfff">请选择左侧部门机构!</p>
|
|
|
|
+ <ul>
|
|
|
|
+ <li v-for="item in items" v-bind:key="item.id">
|
|
|
|
+ <a @click="clickonlod(item.id)">{{ item.name }}</a>
|
|
|
|
+ <ul v-if="item.children">
|
|
|
|
+ <li
|
|
|
|
+ style="padding-left: 5px"
|
|
|
|
+ v-for="subitem in item.children"
|
|
|
|
+ v-bind:key="subitem.id"
|
|
|
|
+ >
|
|
|
|
+ <a @click="clickonlod(subitem.id)">{{ subitem.name }}</a>
|
|
|
|
+ <ul v-if="subitem.children">
|
|
|
|
+ <li
|
|
|
|
+ style="padding-left: 5px"
|
|
|
|
+ v-for="subitem2 in subitem.children"
|
|
|
|
+ v-bind:key="subitem2.id"
|
|
|
|
+ >
|
|
|
|
+ <a @click="clickonlod(subitem2.id)">{{ subitem2.name }}</a>
|
|
|
|
+ <ul v-if="subitem2.children">
|
|
|
|
+ <li
|
|
|
|
+ style="padding-left: 5px"
|
|
|
|
+ v-for="subitem3 in subitem2.children"
|
|
|
|
+ v-bind:key="subitem3.id"
|
|
|
|
+ >
|
|
|
|
+ <a @click="clickonlod(subitem3.id)">{{ subitem3.name }}</a>
|
|
|
|
+ <ul v-if="subitem3.children">
|
|
|
|
+ <li
|
|
|
|
+ style="padding-left: 5px"
|
|
|
|
+ v-for="subitem4 in subitem3.children"
|
|
|
|
+ v-bind:key="subitem4.id"
|
|
|
|
+ >
|
|
|
|
+ <a @click="clickonlod(subitem4.id)">{{
|
|
|
|
+ subitem4.name
|
|
|
|
+ }}</a>
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
|
|
+ </div>
|
|
<van-list
|
|
<van-list
|
|
v-model:loading="loading"
|
|
v-model:loading="loading"
|
|
:finished="finished"
|
|
:finished="finished"
|
|
@@ -22,148 +68,90 @@
|
|
</van-cell-group>
|
|
</van-cell-group>
|
|
</van-radio-group>
|
|
</van-radio-group>
|
|
</van-list>
|
|
</van-list>
|
|
|
|
+ <!-- <van-list
|
|
|
|
+ v-model:loading="loading2"
|
|
|
|
+ :finished="finished2"
|
|
|
|
+ finished-text="没有更多了"
|
|
|
|
+ @load="onLoad2"
|
|
|
|
+ >
|
|
|
|
+ <van-radio-group v-model="checked">
|
|
|
|
+ <van-cell-group inset>
|
|
|
|
+ <van-cell
|
|
|
|
+ v-for="item in list4"
|
|
|
|
+ clickable
|
|
|
|
+ :key="item"
|
|
|
|
+ :title="item.name"
|
|
|
|
+ @click="selectes(item)"
|
|
|
|
+ >
|
|
|
|
+ <template #right-icon>
|
|
|
|
+ <van-radio :name="item" />
|
|
|
|
+ </template>
|
|
|
|
+ </van-cell>
|
|
|
|
+ </van-cell-group>
|
|
|
|
+ </van-radio-group>
|
|
|
|
+ </van-list> -->
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { ref, watch } from "vue";
|
|
|
|
|
|
+import { ref } from "vue";
|
|
import placeRegister from "@/api/placeRegister/placeRegister";
|
|
import placeRegister from "@/api/placeRegister/placeRegister";
|
|
export default {
|
|
export default {
|
|
name: "personList",
|
|
name: "personList",
|
|
emits: ["selected"],
|
|
emits: ["selected"],
|
|
- props: [ "placeAddress"],
|
|
|
|
- setup(props, { emit }) {
|
|
|
|
- const list = ref([]);
|
|
|
|
|
|
+ setup(props,{ emit }) {
|
|
const list3 = ref([]);
|
|
const list3 = ref([]);
|
|
|
|
+ const list4 = ref([]);
|
|
const loading = ref(false);
|
|
const loading = ref(false);
|
|
const finished = ref(false);
|
|
const finished = ref(false);
|
|
let index = 0;
|
|
let index = 0;
|
|
- let zjList = ref([]);
|
|
|
|
- let mechanism1 = ref([]); //宗教
|
|
|
|
|
|
+ let items = ref([]);
|
|
new placeRegister().treeDate2().then((res) => {
|
|
new placeRegister().treeDate2().then((res) => {
|
|
- mechanism1.value.push(res[0]);
|
|
|
|
- Getzj(mechanism1.value);
|
|
|
|
|
|
+ items.value.push(res[0]);
|
|
});
|
|
});
|
|
-
|
|
|
|
- const onLoad = () => {
|
|
|
|
- // 异步更新数据
|
|
|
|
|
|
+ const clickonlod = (id)=>{
|
|
|
|
+ list3.value = [];
|
|
|
|
+ onLoad(id)
|
|
|
|
+ }
|
|
|
|
+ const onLoad = (id) => {
|
|
|
|
+ if(id!=undefined){
|
|
|
|
+ // 异步更新数据
|
|
new placeRegister()
|
|
new placeRegister()
|
|
.list({
|
|
.list({
|
|
current: index + 1,
|
|
current: index + 1,
|
|
size: 10,
|
|
size: 10,
|
|
|
|
+ "officeDTO.id": id,
|
|
})
|
|
})
|
|
- .then(({ records }) => {
|
|
|
|
- list.value.push(...records);
|
|
|
|
|
|
+ .then(({ records, pages }) => {
|
|
|
|
+ list3.value = list3.value.concat(records);
|
|
// 加载状态结束
|
|
// 加载状态结束
|
|
loading.value = false;
|
|
loading.value = false;
|
|
- index++;
|
|
|
|
// 数据全部加载完成
|
|
// 数据全部加载完成
|
|
- if (records.length < 10) {
|
|
|
|
|
|
+ if (index + 1 >= pages) {
|
|
finished.value = true;
|
|
finished.value = true;
|
|
}
|
|
}
|
|
|
|
+ index++;
|
|
});
|
|
});
|
|
- let placeAddress = "";
|
|
|
|
- placeAddress = props.placeAddress.split("/");
|
|
|
|
- let itemId = [];
|
|
|
|
- let listTwo = [];
|
|
|
|
- zjList.value.forEach((item1) => {
|
|
|
|
- if (item1.regionLevel5 == placeAddress[2]) {
|
|
|
|
- itemId.push(item1.id);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- itemId.forEach((N1) => {
|
|
|
|
- if (!listTwo.includes(N1)) {
|
|
|
|
- listTwo.push(N1);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- list.value.forEach((item2) => {
|
|
|
|
- listTwo.forEach((ID) => {
|
|
|
|
- if (ID == item2.officeDTO.id) {
|
|
|
|
- list3.value.push(item2);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- let listOne = [];
|
|
|
|
- list3.value.forEach((N2)=>{
|
|
|
|
- if(!listOne.includes(N2)){
|
|
|
|
- listOne.push(N2)
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- list3.value = listOne
|
|
|
|
|
|
+ }
|
|
};
|
|
};
|
|
- //获取宗教部门数组
|
|
|
|
- function Getzj(list) {
|
|
|
|
- list.forEach((item) => {
|
|
|
|
- zjList.value.push(item);
|
|
|
|
- if (item.children) {
|
|
|
|
- Getzj(item.children);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- const close = ()=>{
|
|
|
|
- list3.value.splice(0,list3.value.length);
|
|
|
|
- }
|
|
|
|
- //获取公安部门数组
|
|
|
|
- // function Getga(list) {
|
|
|
|
- // list.forEach((item) => {
|
|
|
|
- // gaList.value.push(item);
|
|
|
|
- // if (item.children) {
|
|
|
|
- // Getga(item.children);
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // }
|
|
|
|
// 选择人员
|
|
// 选择人员
|
|
const checked = ref([]);
|
|
const checked = ref([]);
|
|
const checkboxRefs = ref([]);
|
|
const checkboxRefs = ref([]);
|
|
const checkboxGroup = ref(null);
|
|
const checkboxGroup = ref(null);
|
|
const toggle = (index) => {
|
|
const toggle = (index) => {
|
|
checkboxRefs.value[index].toggle();
|
|
checkboxRefs.value[index].toggle();
|
|
- emit("selected",checked.value);
|
|
|
|
|
|
+ emit("selected", checked.value);
|
|
};
|
|
};
|
|
// 全选
|
|
// 全选
|
|
const checkAll = () => {
|
|
const checkAll = () => {
|
|
checkboxGroup.value.toggleAll(true);
|
|
checkboxGroup.value.toggleAll(true);
|
|
- emit("selected",checked.value);
|
|
|
|
|
|
+ emit("selected", checked.value);
|
|
};
|
|
};
|
|
const selectes = (val) => {
|
|
const selectes = (val) => {
|
|
checked.value = val;
|
|
checked.value = val;
|
|
- emit("selected",checked.value);
|
|
|
|
|
|
+ emit("selected", checked.value);
|
|
};
|
|
};
|
|
|
|
|
|
- // let placeAddress = "";
|
|
|
|
- // watch(
|
|
|
|
- // () => props.placeAddress,
|
|
|
|
- // (val) => {
|
|
|
|
- // placeAddress = val.split("/");
|
|
|
|
- // let mechanism1 = ref([]); //宗教
|
|
|
|
- // new placeRegister().treeDate2().then((res) => {
|
|
|
|
- // mechanism1.value.push(res[0]);
|
|
|
|
- // Getzj(mechanism1.value);
|
|
|
|
- // let listone = [];
|
|
|
|
- // zjList.value.forEach((item1) => {
|
|
|
|
- // let itemId = '';
|
|
|
|
- // if (item1.regionLevel5 == placeAddress[2]) {
|
|
|
|
- // itemId = item1.id;
|
|
|
|
- // list.value.forEach((item2) => {
|
|
|
|
- // if (itemId == item2.officeDTO.id) {
|
|
|
|
- // listone.push(item2);
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // list3.value = listone;
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // });
|
|
|
|
- // },
|
|
|
|
- // {
|
|
|
|
- // //如果加了这个参数,值为true的话,就消除了惰性,watch会在创建后立即执行一次
|
|
|
|
- // //那么首次执行,val为默认值,preVal为undefined
|
|
|
|
- // immediate: true,
|
|
|
|
- // //这个参数代表监听对象时,可以监听深度嵌套的对象属性
|
|
|
|
- // //比如message是一个对象的话,可以监听到message.a.b.c,也就是message下的所有属性
|
|
|
|
- // deep: true,
|
|
|
|
- // }
|
|
|
|
- // );
|
|
|
|
-
|
|
|
|
return {
|
|
return {
|
|
// 人员
|
|
// 人员
|
|
onLoad,
|
|
onLoad,
|
|
@@ -178,17 +166,34 @@ export default {
|
|
// 单选
|
|
// 单选
|
|
selectes,
|
|
selectes,
|
|
list3,
|
|
list3,
|
|
- close
|
|
|
|
|
|
+ list4,
|
|
|
|
+ items,
|
|
|
|
+ clickonlod,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
-<style scoped>
|
|
|
|
|
|
+<style lang="less" scoped>
|
|
.personList {
|
|
.personList {
|
|
height: 65vh;
|
|
height: 65vh;
|
|
overflow: auto;
|
|
overflow: auto;
|
|
margin: 10px;
|
|
margin: 10px;
|
|
|
|
+ .nav-left {
|
|
|
|
+ float: left;
|
|
|
|
+ width: 50%;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ border-right: 1px solid #a3a3a3;
|
|
|
|
+ li {
|
|
|
|
+ width: 100%;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ padding: 5px 0;
|
|
|
|
+ a {
|
|
|
|
+ width: 100%;
|
|
|
|
+ border-bottom: 1px solid #a3a3a3;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
.van-button {
|
|
.van-button {
|
|
top: -5px;
|
|
top: -5px;
|