|
@@ -34,7 +34,7 @@
|
|
|
finished-text="没有更多了"
|
|
|
@load="onLoad"
|
|
|
>
|
|
|
- <div v-for="(item, index) in list" :key="item.id">
|
|
|
+ <div v-for="(item, index) in persons" :key="item.id">
|
|
|
<div class="person-box2" @click="personInform(item)">
|
|
|
<div class="circle">
|
|
|
<img :src="onlineUser" alt="" />
|
|
@@ -74,7 +74,9 @@ import searchImg from "@/assets/images/search.png";
|
|
|
import closeImg from "@/assets/images/close.png";
|
|
|
import OrganizationalStructure from "@/views/threePreventionResponsiblePerson/organizationalStructure.vue";
|
|
|
import { getPersonalData, getPersonalType } from "@/api/persons";
|
|
|
+import { listContact } from "@/api/duty/eventing";
|
|
|
|
|
|
+/*
|
|
|
const list = ref([
|
|
|
{
|
|
|
id: "1",
|
|
@@ -157,6 +159,7 @@ const list = ref([
|
|
|
expertType: "其它突发事件"
|
|
|
}
|
|
|
]);
|
|
|
+*/
|
|
|
const router = useRouter();
|
|
|
const keywords = ref("");
|
|
|
let responsibility_type = ref([]);
|
|
@@ -181,7 +184,7 @@ const requestParameters = ref({
|
|
|
type_parent_id: "",
|
|
|
page: 1,
|
|
|
pageSize: 10,
|
|
|
- Name: keywords,
|
|
|
+ contactName: keywords,
|
|
|
checkedId: ""
|
|
|
});
|
|
|
const personInform = item => {
|
|
@@ -189,6 +192,7 @@ const personInform = item => {
|
|
|
};
|
|
|
const persons = ref([]);
|
|
|
const onLoad = () => {
|
|
|
+ /*
|
|
|
getPersonalData(requestParameters.value).then(res => {
|
|
|
var item = res.data || [];
|
|
|
// 重置 persons 数组(如果是第一页)
|
|
@@ -208,15 +212,44 @@ const onLoad = () => {
|
|
|
requestParameters.value.page++;
|
|
|
loading.value = false;
|
|
|
});
|
|
|
+ */
|
|
|
+ listContact(requestParameters.value).then(res => {
|
|
|
+ var item = res.data || [];
|
|
|
+ // 重置 persons 数组(如果是第一页)
|
|
|
+ if (requestParameters.value.page == 1) {
|
|
|
+ persons.value = [];
|
|
|
+ }
|
|
|
+
|
|
|
+ // 将新数据添加到 persons 数组中
|
|
|
+ item.forEach((i)=>{
|
|
|
+ persons.value.push({
|
|
|
+ id: i.id,
|
|
|
+ name: i.contactName,
|
|
|
+ unit: i.unitName,
|
|
|
+ position: i.position,
|
|
|
+ phone:i.phone
|
|
|
+ })
|
|
|
+ });
|
|
|
+
|
|
|
+ // 检查是否加载了所有数据
|
|
|
+ if (persons.value.length >= res.total) {
|
|
|
+ finished.value = true;
|
|
|
+ } else {
|
|
|
+ finished.value = false;
|
|
|
+ }
|
|
|
+ requestParameters.value.page++;
|
|
|
+ loading.value = false;
|
|
|
+ });
|
|
|
};
|
|
|
onMounted(() => {
|
|
|
- getDicts("responsibility_type").then(res => {
|
|
|
- res.data.unshift({ dictLabel: "所有类型", dictValue: "" });
|
|
|
- responsibility_type.value = res.data;
|
|
|
- });
|
|
|
- getPersonalType(requestParameters.value).then(res => {
|
|
|
- responsibility_type = res.data || [];
|
|
|
- });
|
|
|
+ // getDicts("responsibility_type").then(res => {
|
|
|
+ // res.data.unshift({ dictLabel: "所有类型", dictValue: "" });
|
|
|
+ // responsibility_type.value = res.data;
|
|
|
+ // });
|
|
|
+ //getPersonalType(requestParameters.value).then(res => {
|
|
|
+ // responsibility_type = res.data || [];
|
|
|
+ //});
|
|
|
+ onLoad();
|
|
|
});
|
|
|
const onSearch = keywords => {
|
|
|
requestParameters.value.page = 1;
|