From 14a8be1d8d625553d10d7ea9a107fe70e9bd3248 Mon Sep 17 00:00:00 2001 From: wangpeng Date: Thu, 11 Apr 2024 10:38:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E8=AF=95=E5=AE=89=E5=85=A8=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E9=80=89=E6=8B=A9=E4=BA=BA=E5=91=98=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/configure.vue | 2 +- .../components/select_person.vue | 38 ++++++++++--------- .../security_notice/details.vue | 5 +-- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/src/views/notification_announcement/notification_template_configuration/components/configure.vue b/src/views/notification_announcement/notification_template_configuration/components/configure.vue index 64f51f6..f6f3c7a 100644 --- a/src/views/notification_announcement/notification_template_configuration/components/configure.vue +++ b/src/views/notification_announcement/notification_template_configuration/components/configure.vue @@ -103,7 +103,7 @@ const fnSubmit = debounce( const ADDRESSEE = selectionData.map((item) => item.USER_ID).join(","); const USERNAME = selectionData.map((item) => item.NAME).join(","); await ElMessageBox.confirm( - `确定要发送短信给${USERNAME.split(",").join( + `确定要发送提醒信息给${USERNAME.split(",").join( "、" )}吗?`, { diff --git a/src/views/safety_production_related/security_notice/components/select_person.vue b/src/views/safety_production_related/security_notice/components/select_person.vue index 7c58458..4f5f8e2 100644 --- a/src/views/safety_production_related/security_notice/components/select_person.vue +++ b/src/views/safety_production_related/security_notice/components/select_person.vue @@ -67,11 +67,10 @@ import { useVModel } from "@vueuse/core"; import { debounce } from "throttle-debounce"; import useListData from "@/assets/js/useListData.js"; -import { reactive, watch } from "vue"; +import { nextTick, reactive, watch } from "vue"; import { serialNumber } from "@/assets/js/utils.js"; import { getUserSelectListAll } from "@/request/user_practitioner.js"; import { layoutFnGetPersonnelTypeTraffic } from "@/assets/js/data_dictionary.js"; -import { differenceWith } from "lodash-es"; const props = defineProps({ visible: { @@ -87,12 +86,6 @@ const props = defineProps({ }); const emits = defineEmits(["update:visible", "submit", "submitall"]); const visible = useVModel(props, "visible", emits); - -const { list, searchForm, pagination, fnGetData, fnResetPagination, tableRef } = - useListData(getUserSelectListAll, { - key: "userList", - immediate: false, - }); const data = reactive({ personnelTypeList: [], }); @@ -102,12 +95,28 @@ const { value: personnelTypeList } = await layoutFnGetPersonnelTypeTraffic({ BIANMA: "TRAFFIC_EMPLOYMENT", }); data.personnelTypeList = personnelTypeList; -const stop = watch( + +const { list, searchForm, pagination, fnGetData, fnResetPagination, tableRef } = + useListData(getUserSelectListAll, { + immediate: false, + clearSelection: false, + key: "userList", + }); + +const fnInit = async () => { + await fnResetPagination(); + await nextTick(); + const checkUserList = props.listData.map((item) => ({ USER_ID: item })); + checkUserList.forEach((item) => { + tableRef.value.toggleRowSelection(item); + }); + fnResetPagination(); +}; +watch( () => props.visible, (value) => { if (value) { - fnGetData(); - stop && stop(); + fnInit(); } } ); @@ -119,12 +128,7 @@ const fnSubmit = debounce( 1000, () => { const selectionData = tableRef.value.getSelectionRows(); - const listData = differenceWith( - selectionData, - props.listData, - (a, b) => a.USER_ID === b.USER_ID - ); - emits("submit", listData); + emits("submit", selectionData); fnClose(); }, { atBegin: true } diff --git a/src/views/safety_production_related/security_notice/details.vue b/src/views/safety_production_related/security_notice/details.vue index 7269be8..214a010 100644 --- a/src/views/safety_production_related/security_notice/details.vue +++ b/src/views/safety_production_related/security_notice/details.vue @@ -98,7 +98,7 @@ @@ -146,7 +146,7 @@ const data = reactive({ TITLE: "", CORPINFO_ID: "", LEVEL: "", - PERSON_ID: [], + PERSON_ID: '', PERSON: [], fileList: [], videoList: [], @@ -167,7 +167,6 @@ const fnGetData = async () => { if (!NOTIFICATION_ID) return; const resData = await getSecurityNoticeInfo({ NOTIFICATION_ID }); data.form = resData.pd; - data.form.PERSON_ID = data.form.PERSON_ID.split(","); data.form.fileList = addingPrefixToFile([ { FILEPATH: data.form.ATTACHMENT_ROUTE,