|
@@ -6,33 +6,7 @@
|
|
|
finished-text="没有更多了"
|
|
|
@load="onLoad"
|
|
|
>
|
|
|
- <!-- <van-checkbox-group
|
|
|
- v-if="type == 1"
|
|
|
- v-model="checked"
|
|
|
- ref="checkboxGroup"
|
|
|
- >
|
|
|
- <van-button type="primary" size="mini" @click="checkAll"
|
|
|
- >全选</van-button
|
|
|
- >
|
|
|
- <van-cell-group inset>
|
|
|
- <van-cell
|
|
|
- v-for="(item, index) in list3"
|
|
|
- clickable
|
|
|
- :key="item"
|
|
|
- :title="item.name"
|
|
|
- @click="toggle(index)"
|
|
|
- >
|
|
|
- <template #right-icon>
|
|
|
- <van-checkbox
|
|
|
- shape="square"
|
|
|
- :name="item"
|
|
|
- :ref="(el) => (checkboxRefs[index] = el)"
|
|
|
- />
|
|
|
- </template>
|
|
|
- </van-cell>
|
|
|
- </van-cell-group>
|
|
|
- </van-checkbox-group> -->
|
|
|
- <van-radio-group v-if="type == 0 && stateType == 0" v-model="checked">
|
|
|
+ <van-radio-group v-if="type == 0" v-model="checked">
|
|
|
<van-cell-group inset>
|
|
|
<van-cell
|
|
|
v-for="item in list3"
|
|
@@ -47,21 +21,6 @@
|
|
|
</van-cell>
|
|
|
</van-cell-group>
|
|
|
</van-radio-group>
|
|
|
- <van-radio-group v-if="type == 0 && stateType == 1" 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>
|
|
|
</template>
|
|
@@ -72,16 +31,14 @@ import placeRegister from "@/api/placeRegister/placeRegister";
|
|
|
export default {
|
|
|
name: "personList",
|
|
|
emits: ["selected"],
|
|
|
- props: ["type", "stateType", "placeAddress"],
|
|
|
+ props: ["type", "placeAddress"],
|
|
|
setup(props, { emit }) {
|
|
|
const list = ref([]);
|
|
|
const list3 = ref([]);
|
|
|
- const list4 = ref([]);
|
|
|
const loading = ref(false);
|
|
|
const finished = ref(false);
|
|
|
let index = 0;
|
|
|
let zjList = ref([]);
|
|
|
- let gaList = ref([]);
|
|
|
const onLoad = () => {
|
|
|
// 异步更新数据
|
|
|
new placeRegister()
|
|
@@ -94,12 +51,33 @@ export default {
|
|
|
// 加载状态结束
|
|
|
loading.value = false;
|
|
|
index++;
|
|
|
- // console.log(list.value);
|
|
|
// 数据全部加载完成
|
|
|
if (records.length < 10) {
|
|
|
finished.value = true;
|
|
|
}
|
|
|
});
|
|
|
+ let placeAddress = "";
|
|
|
+ placeAddress = props.placeAddress.split("/");
|
|
|
+ let mechanism1 = ref([]); //宗教
|
|
|
+ new placeRegister().treeDate2().then((res) => {
|
|
|
+ mechanism1.value.push(res[0]);
|
|
|
+ Getzj(mechanism1.value);
|
|
|
+ let listone = [];
|
|
|
+ let itemId = [];
|
|
|
+ zjList.value.forEach((item1) => {
|
|
|
+ if (item1.regionLevel5 == placeAddress[2]) {
|
|
|
+ itemId.push(item1.id);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ itemId.forEach((ID) => {
|
|
|
+ list.value.forEach((item2) => {
|
|
|
+ if (ID == item2.officeDTO.id) {
|
|
|
+ listone.push(item2);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ list3.value = listone;
|
|
|
+ });
|
|
|
};
|
|
|
//获取宗教部门数组
|
|
|
function Getzj(list) {
|
|
@@ -111,18 +89,14 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
//获取公安部门数组
|
|
|
- function Getga(list) {
|
|
|
- list.forEach((item) => {
|
|
|
- gaList.value.push(item);
|
|
|
- if (item.children) {
|
|
|
- Getga(item.children);
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- // 搜索
|
|
|
- const value = ref("");
|
|
|
- const onSearch = (val) => showToast(val);
|
|
|
- const onCancel = () => showToast("取消");
|
|
|
+ // function Getga(list) {
|
|
|
+ // list.forEach((item) => {
|
|
|
+ // gaList.value.push(item);
|
|
|
+ // if (item.children) {
|
|
|
+ // Getga(item.children);
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
// 选择人员
|
|
|
const checked = ref([]);
|
|
|
const checkboxRefs = ref([]);
|
|
@@ -140,105 +114,40 @@ export default {
|
|
|
checked.value = val;
|
|
|
emit("selected", checked.value, 0);
|
|
|
};
|
|
|
- let placeAddress = "";
|
|
|
- watch(
|
|
|
- () => props.placeAddress,
|
|
|
- (val) => {
|
|
|
- placeAddress = props.placeAddress.split("/");
|
|
|
- let mechanism1 = ref([]); //宗教
|
|
|
- let mechanism2 = ref([]); //公安
|
|
|
- new placeRegister().treeDate2().then((res) => {
|
|
|
- mechanism1.value.push(res[0]);
|
|
|
- mechanism2.value.push(res[1]);
|
|
|
- Getzj(mechanism1.value);
|
|
|
- Getga(mechanism2.value);
|
|
|
- console.log(zjList);
|
|
|
- console.log(gaList);
|
|
|
- if (props.stateType == 0) {
|
|
|
- let listone = [];
|
|
|
- console.log('0')
|
|
|
- zjList.value.forEach((item1) => {
|
|
|
- console.log('00')
|
|
|
- if (
|
|
|
- item1.regionLevel5 == placeAddress[2]
|
|
|
- ) {
|
|
|
- let itemId = item1.id;
|
|
|
- list.value.forEach((item2) => {
|
|
|
- if (itemId == item2.officeDTO.id) {
|
|
|
- listone.push(item2);
|
|
|
- }
|
|
|
- });
|
|
|
- list3.value = listone;
|
|
|
- }if (
|
|
|
- item1.regionLevel4 == placeAddress[1]
|
|
|
- ) {
|
|
|
- let itemId = item1.id;
|
|
|
- list.value.forEach((item2) => {
|
|
|
- if (itemId == item2.officeDTO.id) {
|
|
|
- listone.push(item2);
|
|
|
- }
|
|
|
- });
|
|
|
- list3.value = listone;
|
|
|
- }
|
|
|
- if (
|
|
|
- item1.regionLevel4 == placeAddress[0]
|
|
|
- ) {
|
|
|
- let itemId = item1.id;
|
|
|
- list.value.forEach((item2) => {
|
|
|
- if (itemId == item2.officeDTO.id) {
|
|
|
- listone.push(item2);
|
|
|
- }
|
|
|
- });
|
|
|
- list3.value = listone;
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- if (props.stateType == 1) {
|
|
|
- let listtwo = [];
|
|
|
- gaList.value.forEach((item3) => {
|
|
|
- if (
|
|
|
- item3.regionLevel5 == placeAddress[2]
|
|
|
- ) {
|
|
|
- let itemId = item3.id;
|
|
|
- list.value.forEach((item2) => {
|
|
|
- if (itemId == item2.officeDTO.id) {
|
|
|
- listtwo.push(item2);
|
|
|
- }
|
|
|
- });
|
|
|
- list4.value = listtwo;
|
|
|
- }
|
|
|
- if (item3.regionLevel4 == placeAddress[1]) {
|
|
|
- let itemId = item3.id;
|
|
|
- list.value.forEach((item2) => {
|
|
|
- if (itemId == item2.officeDTO.id) {
|
|
|
- listtwo.push(item2);
|
|
|
- }
|
|
|
- });
|
|
|
- list4.value = listtwo;
|
|
|
- }
|
|
|
- if (item3.regionLevel3 == placeAddress[0]) {
|
|
|
- let itemId = item3.id;
|
|
|
- list.value.forEach((item2) => {
|
|
|
- if (itemId == item2.officeDTO.id) {
|
|
|
- listtwo.push(item2);
|
|
|
- }
|
|
|
- });
|
|
|
- list4.value = listtwo;
|
|
|
- }
|
|
|
- console.log(listtwo)
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- {
|
|
|
- //如果加了这个参数,值为true的话,就消除了惰性,watch会在创建后立即执行一次
|
|
|
- //那么首次执行,val为默认值,preVal为undefined
|
|
|
- immediate: true,
|
|
|
- //这个参数代表监听对象时,可以监听深度嵌套的对象属性
|
|
|
- //比如message是一个对象的话,可以监听到message.a.b.c,也就是message下的所有属性
|
|
|
- deep: true,
|
|
|
- }
|
|
|
- );
|
|
|
+
|
|
|
+ // 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 {
|
|
|
// 人员
|
|
@@ -254,7 +163,6 @@ export default {
|
|
|
// 单选
|
|
|
selectes,
|
|
|
list3,
|
|
|
- list4,
|
|
|
};
|
|
|
},
|
|
|
};
|