From deeea7c3d498a8d7601501a486ba00bf3c591963 Mon Sep 17 00:00:00 2001 From: "1378012178@qq.com" <1378012178@qq.com> Date: Wed, 18 Dec 2024 17:24:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=BB=E6=95=99=E8=AF=BE=E7=A8=8B-=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E5=AD=A6=E6=9C=9F/=E5=8E=86=E5=8F=B2=E5=AD=A6?= =?UTF-8?q?=E6=9C=9F=E5=90=84=E5=8A=9F=E8=83=BD=E7=95=8C=E9=9D=A2=E9=80=82?= =?UTF-8?q?=E9=85=8D=E6=89=8B=E6=9C=BA=E7=AB=AF=E6=A0=B7=E5=BC=8F=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 + src/components/Modal/src/hooks/useModal.ts | 11 +- src/components/Tinymce/src/Editor.vue | 14 +- src/utils/screenSize/useScreenSize.ts | 33 ++ src/views/kc/wjxCswj/WjxCywjV2Dtjg.vue | 131 ++++- src/views/kc/wjxCswj/WjxCywjV2Dtjghis.vue | 133 ++++- src/views/kc/wjxCswj/WjxCywjV2List.vue | 419 ++++++++++--- src/views/kc/wjxCswj/WjxCywjV2Listhis.vue | 253 +++++++- .../components/WjxWjxxTmlbAllDjjgsList.vue | 27 +- .../components/WjxWjxxTmlbDjjgsModal.vue | 5 +- .../components/WjxWjxxTmlbDjjgsModalhis.vue | 4 +- .../kc/wjxWjxx/components/YycyxqForm.vue | 38 +- src/views/kc/wjxWjxxTmlb/TikuList.vue | 552 +++++++++--------- src/views/kc/wjxWjxxTmlb/TikuListModal.vue | 125 ++-- .../components/WjxWjxxTmlbForm.vue | 27 +- .../checkKecheng/dqxqkcMenu.vue | 4 +- .../checkKecheng/dqxqkcMenuHistory.vue | 4 +- src/views/zy/zyInfo/ZyInfoQimoV2List.vue | 95 ++- src/views/zy/zyInfo/ZyInfoQimoV2Listhis.vue | 49 +- src/views/zy/zyInfo/ZyInfoV2List.vue | 407 ++++++------- src/views/zy/zyInfo/ZyInfoV2Listhis.vue | 8 +- .../components/ZyInfoStudentPiyueForm.vue | 6 +- 22 files changed, 1607 insertions(+), 742 deletions(-) create mode 100644 src/utils/screenSize/useScreenSize.ts diff --git a/README.md b/README.md index f618863..cbf72a2 100644 --- a/README.md +++ b/README.md @@ -379,3 +379,7 @@ Online表单&Online报表&代码生成 + +## 判断是否小尺寸屏幕 +import { useScreenSize } from '/src/utils/screenSize/useScreenSize' +const { isSmallScreen } = useScreenSize(); \ No newline at end of file diff --git a/src/components/Modal/src/hooks/useModal.ts b/src/components/Modal/src/hooks/useModal.ts index 1c88323..0982da3 100644 --- a/src/components/Modal/src/hooks/useModal.ts +++ b/src/components/Modal/src/hooks/useModal.ts @@ -60,22 +60,29 @@ export function useModal(): UseModalReturnType { getInstance()?.redoModalHeight?.(); }, - openModal: (visible = true, data?: T, openOnSet = true): void => { + openModal: (visible = true, data?: T, openOnSet = true, options?: { onOpen?: () => void; onClose?: () => void }): void => { getInstance()?.setModalProps({ visible: visible, }); - + if (!data) return; + const id = unref(uid); if (openOnSet) { dataTransfer[id] = null; dataTransfer[id] = toRaw(data); + options?.onOpen?.(); // 打开时调用 onOpen 回调 return; } + const equal = isEqual(toRaw(dataTransfer[id]), toRaw(data)); if (!equal) { dataTransfer[id] = toRaw(data); } + + if (!visible && options?.onClose) { + options.onClose(); // 关闭时调用 onClose 回调 + } }, closeModal: () => { diff --git a/src/components/Tinymce/src/Editor.vue b/src/components/Tinymce/src/Editor.vue index 06a5892..e74e140 100644 --- a/src/components/Tinymce/src/Editor.vue +++ b/src/components/Tinymce/src/Editor.vue @@ -1,4 +1,4 @@ -