From db8956148083bc4f988226ccf719940d08158a27 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Mon, 1 Sep 2025 15:52:14 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=95=86=E4=B8=9A=E7=89=88=E9=9A=90?= =?UTF-8?q?=E8=97=8F=E6=96=87=E6=A1=A3=E7=9B=B8=E5=85=B3=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugin/directive/comm-show.ts | 12 ++++++++++++ .../ui/certd-client/src/plugin/directive/index.ts | 8 ++++++++ packages/ui/certd-client/src/plugin/index.ts | 3 +++ .../src/views/certd/cname/record/index.vue | 2 +- .../src/views/framework/forgot-password/index.vue | 15 +++++---------- 5 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 packages/ui/certd-client/src/plugin/directive/comm-show.ts create mode 100644 packages/ui/certd-client/src/plugin/directive/index.ts diff --git a/packages/ui/certd-client/src/plugin/directive/comm-show.ts b/packages/ui/certd-client/src/plugin/directive/comm-show.ts new file mode 100644 index 00000000..ce4938aa --- /dev/null +++ b/packages/ui/certd-client/src/plugin/directive/comm-show.ts @@ -0,0 +1,12 @@ +import { useSettingStore } from "/@/store/settings"; + +export default { + mounted(el: any, binding: any, vnode: any) { + const settingStore = useSettingStore(); + const isComm = settingStore.isComm; + const { value } = binding; + if ((value === false && isComm) || (value === true && !isComm)) { + el.parentNode && el.parentNode.removeChild(el); + } + }, +}; diff --git a/packages/ui/certd-client/src/plugin/directive/index.ts b/packages/ui/certd-client/src/plugin/directive/index.ts new file mode 100644 index 00000000..e23116b0 --- /dev/null +++ b/packages/ui/certd-client/src/plugin/directive/index.ts @@ -0,0 +1,8 @@ +import comm from "./comm-show.js"; +const install = function (app: any) { + app.directive("comm", comm); +}; + +export default { + install, +}; diff --git a/packages/ui/certd-client/src/plugin/index.ts b/packages/ui/certd-client/src/plugin/index.ts index 11c6a6aa..8f87fe4a 100644 --- a/packages/ui/certd-client/src/plugin/index.ts +++ b/packages/ui/certd-client/src/plugin/index.ts @@ -4,9 +4,12 @@ import FastCrud from "./fast-crud"; import permission from "./permission"; import { App } from "vue"; import "./validator/index.js"; +import directives from "./directive/index"; + function install(app: App, options: any = {}) { app.use(FastCrud, options); app.use(permission); + app.use(directives); } export default { diff --git a/packages/ui/certd-client/src/views/certd/cname/record/index.vue b/packages/ui/certd-client/src/views/certd/cname/record/index.vue index 4ed382d3..833ba547 100644 --- a/packages/ui/certd-client/src/views/certd/cname/record/index.vue +++ b/packages/ui/certd-client/src/views/certd/cname/record/index.vue @@ -4,7 +4,7 @@
{{ t("certd.cnameRecord") }} - + {{ t("certd.cname_feature_guide") }} diff --git a/packages/ui/certd-client/src/views/framework/forgot-password/index.vue b/packages/ui/certd-client/src/views/framework/forgot-password/index.vue index 7923de31..32b01d29 100644 --- a/packages/ui/certd-client/src/views/framework/forgot-password/index.vue +++ b/packages/ui/certd-client/src/views/framework/forgot-password/index.vue @@ -11,7 +11,7 @@ @finish="handleFinish" @finish-failed="handleFinishFailed" > - + @@ -21,13 +21,7 @@ - + @@ -72,7 +66,7 @@ 找回密码 -
+ @@ -87,7 +81,7 @@ import EmailCode from "/@/views/framework/register/email-code.vue"; import SmsCode from "/@/views/framework/login/sms-code.vue"; import { utils } from "@fast-crud/fast-crud"; import { useUserStore } from "/@/store/user"; - +import { useSettingStore } from "/@/store/settings"; defineOptions({ name: "ForgotPasswordPage", }); @@ -123,6 +117,7 @@ const layout = { const forgotPasswordType = ref(); const userStore = useUserStore(); +const settingStore = useSettingStore(); const formRef = ref(); const imageCodeRef = ref();