From 0203aa2b6e86e58e5e66a1b9d0278d186aa92554 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Fri, 7 Nov 2025 00:44:13 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=85=8D=E7=BD=AE=E7=95=8C=E9=9D=A2=E5=9C=A8?= =?UTF-8?q?=E6=89=8B=E6=9C=BA=E7=89=88=E4=B8=8B=E7=9A=84=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/vip-button/directive.ts | 15 +++++------ .../src/locales/langs/en-US/vip.ts | 1 + .../src/locales/langs/zh-CN/vip.ts | 1 + .../src/plugin/fast-crud/index.tsx | 10 ++++---- .../certd-client/src/store/settings/index.ts | 23 +++++++++-------- .../ui/certd-client/src/style/common.less | 2 +- .../src/views/certd/history/crud.tsx | 6 +++++ .../pipeline/components/change-group.vue | 6 +++-- .../components/change-notification.vue | 9 ++++--- .../pipeline/components/change-trigger.vue | 9 ++++--- .../src/views/certd/pipeline/index.vue | 12 ++++++--- .../pipeline/component/step-form/index.vue | 7 ++---- .../pipeline/component/task-form/index.vue | 25 +++++++++++++------ pnpm-lock.yaml | 24 +++++++++--------- 14 files changed, 86 insertions(+), 64 deletions(-) diff --git a/packages/ui/certd-client/src/components/vip-button/directive.ts b/packages/ui/certd-client/src/components/vip-button/directive.ts index 29d23304..ce6abfe6 100644 --- a/packages/ui/certd-client/src/components/vip-button/directive.ts +++ b/packages/ui/certd-client/src/components/vip-button/directive.ts @@ -1,4 +1,3 @@ -import { notification } from "ant-design-vue"; import { useSettingStore } from "/@/store/settings"; export default { @@ -7,17 +6,15 @@ export default { const settingStore = useSettingStore(); el.className = el.className + " need-plus"; if (!settingStore.isPlus) { - function checkPlus() { - // 事件处理代码 - notification.warn({ - message: "此为专业版功能,请升级到专业版", - }); - } el.addEventListener("click", function (event: any) { - checkPlus(); + event.stopPropagation(); + event.preventDefault(); + settingStore.checkPlus(); }); el.addEventListener("move", function (event: any) { - checkPlus(); + event.stopPropagation(); + event.preventDefault(); + settingStore.checkPlus(); }); } }, diff --git a/packages/ui/certd-client/src/locales/langs/en-US/vip.ts b/packages/ui/certd-client/src/locales/langs/en-US/vip.ts index b32f5583..48c50cb9 100644 --- a/packages/ui/certd-client/src/locales/langs/en-US/vip.ts +++ b/packages/ui/certd-client/src/locales/langs/en-US/vip.ts @@ -88,4 +88,5 @@ export default { activation_code_one_use: "Activation code can only be used once. To change site, please ", bind_account: "bind account", transfer_vip: ' then "Transfer VIP"', + needVipTip: "This feature requires a professional version, please upgrade to a professional version first.", }; diff --git a/packages/ui/certd-client/src/locales/langs/zh-CN/vip.ts b/packages/ui/certd-client/src/locales/langs/zh-CN/vip.ts index 9f1e5bd2..1319a571 100644 --- a/packages/ui/certd-client/src/locales/langs/zh-CN/vip.ts +++ b/packages/ui/certd-client/src/locales/langs/zh-CN/vip.ts @@ -88,4 +88,5 @@ export default { activation_code_one_use: "激活码使用过一次之后,不可再次使用,如果要更换站点,请", bind_account: "绑定账号", transfer_vip: ',然后"转移VIP"即可', + needVipTip: "此为专业版功能,请先开通专业版", }; diff --git a/packages/ui/certd-client/src/plugin/fast-crud/index.tsx b/packages/ui/certd-client/src/plugin/fast-crud/index.tsx index 2672f17f..49bc9637 100644 --- a/packages/ui/certd-client/src/plugin/fast-crud/index.tsx +++ b/packages/ui/certd-client/src/plugin/fast-crud/index.tsx @@ -232,15 +232,15 @@ function install(app: App, options: any = {}) { }, wrapperCol: { span: null, - buttons: { - copy: { show: false }, - paste: { show: false }, - }, }, wrapper: { saveRemind: true, // inner: true, - // innerContainerSelector: "main.fs-framework-content" + // innerContainerSelector: "main.fs-framework-content", + buttons: { + copy: { show: false }, + paste: { show: false }, + }, }, }, columns: { diff --git a/packages/ui/certd-client/src/store/settings/index.ts b/packages/ui/certd-client/src/store/settings/index.ts index fcfd98c7..c2222dd4 100644 --- a/packages/ui/certd-client/src/store/settings/index.ts +++ b/packages/ui/certd-client/src/store/settings/index.ts @@ -1,6 +1,5 @@ import { defineStore } from "pinia"; import { Modal, notification } from "ant-design-vue"; -import * as _ from "lodash-es"; import * as basicApi from "./api.basic"; import { AppInfo, HeaderMenus, PlusInfo, SiteEnv, SiteInfo, SuiteSetting, SysInstallInfo, SysPublicSetting } from "./api.basic"; import { useUserStore } from "../user"; @@ -11,6 +10,7 @@ import { useTitle } from "@vueuse/core"; import { utils } from "/@/utils"; import { cloneDeep, merge } from "lodash-es"; import { useI18n } from "/src/locales"; +import { $t } from "/src/locales"; export interface SettingState { skipReset?: boolean; // 注销登录时,不清空此store的状态 sysPublic?: SysPublicSetting; @@ -127,7 +127,8 @@ export const useSettingStore = defineStore({ return this.installInfo; }, isPlus(): boolean { - return this.plusInfo?.isPlus && this.plusInfo?.expireTime > new Date().getTime(); + // return this.plusInfo?.isPlus && this.plusInfo?.expireTime > new Date().getTime(); + return false; }, isComm(): boolean { return this.plusInfo?.isComm && this.plusInfo?.expireTime > new Date().getTime(); @@ -174,19 +175,19 @@ export const useSettingStore = defineStore({ checkPlus() { if (!this.isPlus) { notification.warn({ - message: "此为专业版功能,请先升级到专业版", + message: $t("vip.needVipTip"), }); - throw new Error("此为专业版功能,请升级到专业版"); + throw new Error($t("vip.needVipTip")); } }, async loadSysSettings() { const allSettings = await basicApi.loadAllSettings(); - _.merge(this.sysPublic, allSettings.sysPublic || {}); - _.merge(this.installInfo, allSettings.installInfo || {}); - _.merge(this.siteEnv, allSettings.siteEnv || {}); - _.merge(this.plusInfo, allSettings.plusInfo || {}); - _.merge(this.headerMenus, allSettings.headerMenus || {}); - _.merge(this.suiteSetting, allSettings.suiteSetting || {}); + merge(this.sysPublic, allSettings.sysPublic || {}); + merge(this.installInfo, allSettings.installInfo || {}); + merge(this.siteEnv, allSettings.siteEnv || {}); + merge(this.plusInfo, allSettings.plusInfo || {}); + merge(this.headerMenus, allSettings.headerMenus || {}); + merge(this.suiteSetting, allSettings.suiteSetting || {}); //@ts-ignore this.initSiteInfo(allSettings.siteInfo || {}); this.initAppInfo(allSettings.app || {}); @@ -206,7 +207,7 @@ export const useSettingStore = defineStore({ siteInfo.loginLogo = `api/basic/file/download?key=${siteInfo.loginLogo}`; } } - this.siteInfo = _.merge({}, defaultSiteInfo, siteInfo); + this.siteInfo = merge({}, defaultSiteInfo, siteInfo); if (this.siteInfo.logo) { updatePreferences({ diff --git a/packages/ui/certd-client/src/style/common.less b/packages/ui/certd-client/src/style/common.less index 5b3c3a2e..59f0463c 100644 --- a/packages/ui/certd-client/src/style/common.less +++ b/packages/ui/certd-client/src/style/common.less @@ -300,7 +300,7 @@ h6 { } .ant-drawer-content-wrapper { - max-width: 90vw; + max-width: 95vw; } .block-title { diff --git a/packages/ui/certd-client/src/views/certd/history/crud.tsx b/packages/ui/certd-client/src/views/certd/history/crud.tsx index ff5a2349..e1b7b760 100644 --- a/packages/ui/certd-client/src/views/certd/history/crud.tsx +++ b/packages/ui/certd-client/src/views/certd/history/crud.tsx @@ -84,6 +84,12 @@ export default function ({ crudExpose, context }: CreateCrudOptionsProps): Creat edit: { show: false, }, + copy: { show: false }, + view: { + async click({ row }) { + await router.push({ path: "/certd/pipeline/detail", query: { id: row.pipelineId, historyId: row.id, editMode: "false" } }); + }, + }, }, }, columns: { diff --git a/packages/ui/certd-client/src/views/certd/pipeline/components/change-group.vue b/packages/ui/certd-client/src/views/certd/pipeline/components/change-group.vue index 01c2489e..d69680b5 100644 --- a/packages/ui/certd-client/src/views/certd/pipeline/components/change-group.vue +++ b/packages/ui/certd-client/src/views/certd/pipeline/components/change-group.vue @@ -1,10 +1,11 @@