|
@@ -57,7 +57,7 @@
|
|
|
<div class="person-box" @click="showPersonalInformation(item)">
|
|
|
<div class="circle">
|
|
|
<img
|
|
|
- :src="item.state === false ? offlineUser : onlineUser"
|
|
|
+ :src="item.state === false ? onlineUser : offlineUser"
|
|
|
alt=""
|
|
|
/>
|
|
|
</div>
|
|
@@ -65,13 +65,13 @@
|
|
|
<div class="one">
|
|
|
<div>{{ item.name }}</div>
|
|
|
<div class="notOnline" :class="{ isOnline: item.state }">
|
|
|
- {{ item.state === false ? "离线" : "在线" }}
|
|
|
+ {{ item.state === false ? "在线" : "离线" }}
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="text-ellipsis">{{ item.position }}</div>
|
|
|
<div style="margin-top: 5px">
|
|
|
- <span v-for="i in item.type" :key="i" class="type-name">
|
|
|
- {{ i }}
|
|
|
+ <span v-for="i in item.type_parent_list" :key="i" class="type-name">
|
|
|
+ {{ i.type_parent }}
|
|
|
</span>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -84,7 +84,6 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import profile from "@/assets/images/tempImage/用户.png";
|
|
|
import offlineUser from "@/assets/images/threePreventionResponsiblePerson/offlineUsers.png";
|
|
|
import onlineUser from "@/assets/images/threePreventionResponsiblePerson/onlineUsers.png";
|
|
|
import { getDicts } from "@/api/system/dict/data";
|
|
@@ -92,6 +91,7 @@ import { getEventList } from "@/api/event";
|
|
|
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";
|
|
|
|
|
|
const router = useRouter();
|
|
|
const keywords = ref("");
|
|
@@ -100,8 +100,9 @@ const fieldValue = ref("三防指挥部");
|
|
|
const showPicker = ref(false);
|
|
|
const onConfirm = ({ selectedValues, selectedOptions }) => {
|
|
|
showPicker.value = false; //用于控制 van-picker 组件的显示状态,将其设置为 false 表示隐藏选择器。
|
|
|
- requestParameters.value.type_content = selectedValues.toString(); //将用户选择的值(selectedValues)保存到 requestParameters 对象的 type_content 属性中
|
|
|
+ requestParameters.value.type_parent_id = selectedValues.toString(); //将用户选择的值(selectedValues)保存到 requestParameters 对象的 type_content 属性中
|
|
|
fieldValue.value = selectedOptions[0].dictLabel; //将用户选择的第一个选项的 dictLabel 属性值保存到 fieldValue 中
|
|
|
+ requestParameters.value.page = 1;
|
|
|
onLoad();
|
|
|
};
|
|
|
const loading = ref(false);
|
|
@@ -113,137 +114,42 @@ const customFieldName = {
|
|
|
const requestParameters = ref({
|
|
|
name: "",
|
|
|
type: [],
|
|
|
- type_content: "",
|
|
|
+ type_parent_id: "",
|
|
|
page: 1,
|
|
|
- page_size: 10,
|
|
|
- keyword: keywords,
|
|
|
+ pageSize: 10,
|
|
|
+ Name: keywords,
|
|
|
checkedId: ""
|
|
|
});
|
|
|
const persons = ref([]);
|
|
|
const onLoad = () => {
|
|
|
- getEventList(requestParameters.value)
|
|
|
- .then(res => {
|
|
|
- res.data = [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- name: "张嘉佳",
|
|
|
- unit: "茂名市委员会",
|
|
|
- position: "茂名市市委常委 市人民政府副市长 党组副书记",
|
|
|
- type: ["三防指挥部", "应急部门"],
|
|
|
- profile_picture: profile,
|
|
|
- state: true
|
|
|
- },
|
|
|
- {
|
|
|
- id: 2,
|
|
|
- name: "王长青",
|
|
|
- unit: "茂名市委员会",
|
|
|
- position: "茂名市委员会 茂名市委常委 茂名市委常委",
|
|
|
- type: ["党委政府"],
|
|
|
- profile_picture: profile,
|
|
|
- state: false
|
|
|
- },
|
|
|
- {
|
|
|
- id: 3,
|
|
|
- name: "王长青",
|
|
|
- unit: "茂名市委员会",
|
|
|
- position: "茂名市委员会 茂名市委常委",
|
|
|
- type: ["重点部门"],
|
|
|
- profile_picture: profile,
|
|
|
- state: true
|
|
|
- },
|
|
|
- {
|
|
|
- id: 4,
|
|
|
- name: "王长青",
|
|
|
- unit: "茂名市委员会",
|
|
|
- position: "茂名市委员会 茂名市委常委",
|
|
|
- type: ["重点部门"],
|
|
|
- profile_picture: profile,
|
|
|
- state: false
|
|
|
- },
|
|
|
- {
|
|
|
- id: 5,
|
|
|
- name: "王长青",
|
|
|
- unit: "茂名市委员会",
|
|
|
- position: "茂名市委员会 茂名市委常委",
|
|
|
- type: ["重点部门"],
|
|
|
- profile_picture: profile,
|
|
|
- state: true
|
|
|
- },
|
|
|
- {
|
|
|
- id: 6,
|
|
|
- name: "王长青",
|
|
|
- unit: "茂名市委员会",
|
|
|
- position: "茂名市委员会 茂名市委常委",
|
|
|
- type: ["重点部门", "成员单位"],
|
|
|
- profile_picture: profile,
|
|
|
- state: true
|
|
|
- },
|
|
|
- {
|
|
|
- id: 7,
|
|
|
- name: "王长青",
|
|
|
- unit: "茂名市委员会",
|
|
|
- position: "茂名市委员会 茂名市委常委",
|
|
|
- type: ["重点部门"],
|
|
|
- profile_picture: profile,
|
|
|
- state: true
|
|
|
- },
|
|
|
- {
|
|
|
- id: 8,
|
|
|
- name: "王长青",
|
|
|
- unit: "茂名市委员会",
|
|
|
- position: "茂名市委员会 茂名市委常委",
|
|
|
- type: ["重点部门"],
|
|
|
- profile_picture: profile,
|
|
|
- state: true
|
|
|
- },
|
|
|
- {
|
|
|
- id: 9,
|
|
|
- name: "王长青",
|
|
|
- unit: "茂名市委员会",
|
|
|
- position: "茂名市委员会 茂名市委常委",
|
|
|
- type: ["重点部门"],
|
|
|
- profile_picture: profile,
|
|
|
- state: true
|
|
|
- },
|
|
|
- {
|
|
|
- id: 10,
|
|
|
- name: "王长青",
|
|
|
- unit: "茂名市委员会",
|
|
|
- position: "茂名市委员会 茂名市委常委",
|
|
|
- type: ["重点部门"],
|
|
|
- profile_picture: profile,
|
|
|
- state: true
|
|
|
- }
|
|
|
- ];
|
|
|
- var item = res.data || [];
|
|
|
- // 重置 persons 数组(如果是第一页)
|
|
|
- if (requestParameters.value.page == 1) {
|
|
|
- persons.value = [];
|
|
|
- }
|
|
|
- // 将新数据添加到 persons 数组中
|
|
|
- item.forEach(temp => {
|
|
|
- persons.value.push(temp);
|
|
|
- });
|
|
|
- // 检查是否加载了所有数据
|
|
|
- if (persons.value.length >= res.total) {
|
|
|
- finished.value = true;
|
|
|
- } else {
|
|
|
- finished.value = false;
|
|
|
- }
|
|
|
- requestParameters.value.page++;
|
|
|
- loading.value = false;
|
|
|
- })
|
|
|
- .catch(error => {
|
|
|
- // 处理错误(例如,显示错误消息或重置加载状态)
|
|
|
- console.error("加载事件列表时出错:", error);
|
|
|
- loading.value = false;
|
|
|
+ getPersonalData(requestParameters.value).then(res => {
|
|
|
+ var item = res.data || [];
|
|
|
+ // 重置 persons 数组(如果是第一页)
|
|
|
+ if (requestParameters.value.page == 1) {
|
|
|
+ persons.value = [];
|
|
|
+ }
|
|
|
+ // 将新数据添加到 persons 数组中
|
|
|
+ item.forEach(temp => {
|
|
|
+ persons.value.push(temp);
|
|
|
});
|
|
|
+ // 检查是否加载了所有数据
|
|
|
+ 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 || [];
|
|
|
+ });
|
|
|
});
|
|
|
const onSearch = keywords => {
|
|
|
requestParameters.value.page = 1;
|
|
@@ -273,8 +179,6 @@ const handleSelect = (data) => {
|
|
|
upOneLevel.value = data.value;
|
|
|
requestParameters.value.checkedId = data.id;
|
|
|
};
|
|
|
-
|
|
|
-
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|