From 4b2614e026041bcd5f357e64c23d723aea28e5a8 Mon Sep 17 00:00:00 2001 From: bunny <1319900154@qq.com> Date: Mon, 27 May 2024 16:59:21 +0800 Subject: [PATCH 1/3] =?UTF-8?q?refactor:=20=E2=99=BB=EF=B8=8F=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9i18=E7=9B=B8=E5=85=B3=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 2 - .gitpod.yml | 5 - .prettierrc.js | 37 +- locales/en.yaml | 240 ------- locales/zh-CN.yaml | 240 ------- mock/i18n.ts | 16 + mock/modules/en.ts | 250 +++++++ mock/modules/zh_cn.ts | 251 +++++++ package.json | 1 + pnpm-lock.yaml | 1575 ++++++++++++++++++++--------------------- src/App.vue | 94 +-- src/api/mock/i18n.ts | 5 + src/i18n/index.ts | 16 + src/main.ts | 24 +- src/store/i18n.ts | 20 + src/store/index.ts | 5 +- 16 files changed, 1444 insertions(+), 1337 deletions(-) delete mode 100644 .gitattributes delete mode 100644 .gitpod.yml delete mode 100644 locales/en.yaml delete mode 100644 locales/zh-CN.yaml create mode 100644 mock/i18n.ts create mode 100644 mock/modules/en.ts create mode 100644 mock/modules/zh_cn.ts create mode 100644 src/api/mock/i18n.ts create mode 100644 src/i18n/index.ts create mode 100644 src/store/i18n.ts diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 00ff609..0000000 --- a/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -public/wasm/capture.worker.js linguist-language=Vue -public/wasm/index.js linguist-language=Vue \ No newline at end of file diff --git a/.gitpod.yml b/.gitpod.yml deleted file mode 100644 index 57324a3..0000000 --- a/.gitpod.yml +++ /dev/null @@ -1,5 +0,0 @@ -ports: - - port: 3344 - onOpen: open-preview -tasks: - - init: pnpm install && pnpm serve diff --git a/.prettierrc.js b/.prettierrc.js index 613f0cb..ff6d01d 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,10 +1,39 @@ -// @ts-check +// @see: https://www.prettier.cn -/** @type {import("prettier").Config} */ export default { + // 超过最大值换行 printWidth: 200, + // 缩进字节数 + tabWidth: 1, + // 使用制表符而不是空格缩进行 + useTabs: true, + // 结尾不用分号(true有,false没有) + semi: true, + // 使用单引号(true单引号,false双引号) + singleQuote: true, + // 更改引用对象属性的时间 可选值"" + quoteProps: "as-needed", + // 在对象,数组括号与文字之间加空格 "{ foo: bar }" bracketSpacing: true, - singleQuote: false, + // 多行时尽可能打印尾随逗号。(例如,单行数组永远不会出现逗号结尾。) 可选值"",默认none + trailingComma: "all", + // 在JSX中使用单引号而不是双引号 + jsxSingleQuote: true, + // (x) => {} 箭头函数参数只有一个时是否要有小括号。avoid:省略括号 ,always:不省略括号 arrowParens: "avoid", - trailingComma: "none" + // 如果文件顶部已经有一个 doclock,这个选项将新建一行注释,并打上@format标记。 + insertPragma: false, + // 指定要使用的解析器,不需要写文件开头的 @prettier + requirePragma: false, + // 默认值。因为使用了一些折行敏感型的渲染器(如GitHub comment)而按照markdown文本样式进行折行 + proseWrap: "preserve", + // 在html中空格是否是敏感的 "css" - 遵守CSS显示属性的默认值, "strict" - 空格被认为是敏感的 ,"ignore" - 空格被认为是不敏感的 + htmlWhitespaceSensitivity: "css", + // 换行符使用 lf 结尾是 可选值"" + endOfLine: "auto", + // 这两个选项可用于格式化以给定字符偏移量(分别包括和不包括)开始和结束的代码 + rangeStart: 0, + rangeEnd: Infinity, + + vueIndentScriptAndStyle: false // Vue文件脚本和样式标签缩进 }; diff --git a/locales/en.yaml b/locales/en.yaml deleted file mode 100644 index ae34fd4..0000000 --- a/locales/en.yaml +++ /dev/null @@ -1,240 +0,0 @@ -buttons: - pureAccountSettings: Account - pureLoginOut: LoginOut - pureLogin: Login - pureOpenSystemSet: Open System Configs - pureReload: Reload - pureCloseCurrentTab: Close CurrentTab - pureCloseLeftTabs: Close LeftTabs - pureCloseRightTabs: Close RightTabs - pureCloseOtherTabs: Close OtherTabs - pureCloseAllTabs: Close AllTabs - pureContentFullScreen: Content FullScreen - pureContentExitFullScreen: Content ExitFullScreen - pureClickCollapse: Collapse - pureClickExpand: Expand - pureConfirm: Confirm - pureSwitch: Switch - pureClose: Close - pureBackTop: BackTop - pureOpenText: Open - pureCloseText: Close - rest: Rest -search: - pureTotal: Total - pureHistory: History - pureCollect: Collect - pureDragSort: (Drag Sort) - pureEmpty: Empty - purePlaceholder: Search Menu -panel: - pureSystemSet: System Configs - pureCloseSystemSet: Close System Configs - pureClearCacheAndToLogin: Clear cache and return to login page - pureClearCache: Clear Cache - pureOverallStyle: Overall Style - pureOverallStyleLight: Light - pureOverallStyleLightTip: Set sail freshly and light up the comfortable work interface - pureOverallStyleDark: Dark - pureOverallStyleDarkTip: Moonlight Overture, indulge in the tranquility and elegance of the night - pureOverallStyleSystem: Auto - pureOverallStyleSystemTip: Synchronize time, the interface naturally responds to morning and dusk - pureThemeColor: Theme Color - pureLayoutModel: Layout Model - pureVerticalTip: The menu on the left is familiar and friendly - pureHorizontalTip: Top menu, concise overview - pureMixTip: Mixed menu, flexible - pureStretch: Stretch Page - pureStretchFixed: Fixed - pureStretchFixedTip: Compact pages make it easy to find the information you need - pureStretchCustom: Custom - pureStretchCustomTip: Minimum 1280, maximum 1600 - pureTagsStyle: Tags Style - pureTagsStyleSmart: Smart - pureTagsStyleSmartTip: Smart tags add fun and brilliance - pureTagsStyleCard: Card - pureTagsStyleCardTip: Card tags for efficient browsing - pureInterfaceDisplay: Interface Display - pureGreyModel: Grey Model - pureWeakModel: Weak Model - pureHiddenTags: Hidden Tags - pureHiddenFooter: Hidden Footer - pureMultiTagsCache: MultiTags Cache -menus: - pureHome: Home - pureLogin: Login - pureEmpty: Empty Page - pureTable: Table - pureSysManagement: System Manage - pureUser: User Manage - pureRole: Role Manage - pureSystemMenu: Menu Manage - pureDept: Dept Manage - pureSysMonitor: System Monitor - pureOnlineUser: Online User - pureLoginLog: Login Log - pureOperationLog: Operation Log - pureSystemLog: System Log - pureEditor: Editor - pureAbnormal: Abnormal Page - pureFourZeroFour: "404" - pureFourZeroOne: "403" - pureFive: "500" - pureComponents: Components - pureDialog: Dialog - pureMessage: Message Tips - pureVideo: Video - pureSegmented: Segmented - pureWaterfall: Waterfall - pureMap: Map - pureDraggable: Draggable - pureSplitPane: Split Pane - pureText: Text Ellipsis - pureElButton: Button - pureButton: Button Animation - pureCheckButton: Check Button - pureCropping: Picture Cropping - pureAnimatecss: AnimateCss Selector - pureCountTo: Digital Animation - pureSelector: Scope Selector - pureFlowChart: Flow Chart - pureSeamless: Seamless Scroll - pureContextmenu: Context Menu - pureTypeit: Typeit - pureJsonEditor: JSON Editor - pureColorPicker: Color Picker - pureDatePicker: Date Picker - pureDateTimePicker: DateTimePicker - pureTimePicker: TimePicker - pureTag: Tag - pureStatistic: Statistic - pureCollapse: Collapse - pureGanttastic: Gantt Chart - pureProgress: Progress - pureUpload: File Upload - pureCheckCard: CheckCard - pureMenus: MultiLevel Menu - pureMenu1: Menu1 - pureMenu1-1: Menu1-1 - pureMenu1-2: Menu1-2 - pureMenu1-2-1: Menu1-2-1 - pureMenu1-2-2: Menu1-2-2 - pureMenu1-3: Menu1-3 - pureMenu2: Menu2 - purePermission: Permission Manage - purePermissionPage: Page Permission - purePermissionButton: Button Permission - pureTabs: Tabs Operate - pureGuide: Guide - pureAble: Able - pureMenuTree: Menu Tree - pureVideoFrame: Video Frame Capture - pureWavesurfer: Audio Visualization - pureRipple: Ripple - pureMqtt: Mqtt Client - pureOptimize: Debounce、Throttle、Copy、Longpress Directives - pureVerify: Captcha - pureWatermark: Water Mark - purePrint: Print - pureDownload: Download - pureExternalPage: External Page - pureExternalDoc: Docs External - pureEmbeddedDoc: Docs Embedded - pureExternalLink: Vue-Pure-Admin - pureUtilsLink: Pure-Admin-Utils - pureColorHuntDoc: ColorHunt - pureUiGradients: UiGradients - pureEpDoc: Element-Plus - pureTailwindcssDoc: Tailwindcss - pureVueDoc: Vue3 - pureViteDoc: Vite - purePiniaDoc: Pinia - pureRouterDoc: Vue-Router - pureAbout: About - pureResult: Result Page - pureSuccess: Success Page - pureFail: Fail Page - pureIconSelect: Icon Select - pureTimeline: Time Line - pureLineTree: LineTree - pureList: List Page - pureCardList: Card List Page - pureDebounce: Debounce & Throttle - pureFormDesign: Form Design - pureBarcode: Barcode - pureQrcode: Qrcode - pureCascader: Area Cascader - pureSwiper: Swiper Plugin - pureVirtualList: Virtual List - purePdf: PDF Preview - pureExcel: Export Excel - pureInfiniteScroll: Table Infinite Scroll - pureSensitive: Sensitive Filter - purePinyin: PinYin - pureDanmaku: Danmaku - pureSchemaForm: Form - pureTableBase: Base Usage - pureTableHigh: High Usage - pureTableEdit: Edit Usage - pureVxeTable: Virtual Usage - pureBoard: Paint Board - pureMindMap: Mind Map - pureMenuOverflow: Menu Overflow Show Tooltip Text - pureChildMenuOverflow: Child Menu Overflow Show Tooltip Text - systemctlTest: Systemctl lTest -status: - pureLoad: Loading... - pureMessage: Message - pureNotify: Notify - pureTodo: Todo - pureNoMessage: No Message - pureNoNotify: No Notify - pureNoTodo: No Todo -login: - pureUsername: Username - purePassword: Password - pureVerifyCode: VerifyCode - pureRemember: days no need to login - pureRememberInfo: After checking and logging in, will automatically log in to the system without entering your username and password within the specified number of days. - pureSure: Sure Password - pureForget: Forget Password? - pureLogin: Login - pureThirdLogin: Third Login - purePhoneLogin: Phone Login - pureQRCodeLogin: QRCode Login - pureRegister: Register - pureWeChatLogin: WeChat Login - pureAlipayLogin: Alipay Login - pureQQLogin: QQ Login - pureWeiBoLogin: Weibo Login - purePhone: Phone - pureSmsVerifyCode: SMS VerifyCode - pureBack: Back - pureTest: Mock Test - pureTip: After scanning the code, click "Confirm" to complete the login - pureDefinite: Definite - pureLoginSuccess: Login Success - pureLoginFail: Login Fail - pureRegisterSuccess: Regist Success - pureTickPrivacy: Please tick Privacy Policy - pureReadAccept: I have read it carefully and accept - purePrivacyPolicy: Privacy Policy - pureGetVerifyCode: Get VerifyCode - pureInfo: Seconds - pureUsernameReg: Please enter username - purePassWordReg: Please enter password - pureVerifyCodeReg: Please enter verify code - pureVerifyCodeCorrectReg: Please enter correct verify code - pureVerifyCodeSixReg: Please enter a 6-digit verify code - purePhoneReg: Please enter the phone - purePhoneCorrectReg: Please enter the correct phone number format - purePassWordRuleReg: The password format should be any combination of 8-18 digits - purePassWordSureReg: Please enter confirm password - purePassWordDifferentReg: The two passwords do not match! - purePassWordUpdateReg: Password has been updated -table: - tableNumber: Table Number -style: - larger: Larger - default: Default - small: Small diff --git a/locales/zh-CN.yaml b/locales/zh-CN.yaml deleted file mode 100644 index 05478f9..0000000 --- a/locales/zh-CN.yaml +++ /dev/null @@ -1,240 +0,0 @@ -buttons: - pureAccountSettings: 账户设置 - pureLoginOut: 退出系统 - pureLogin: 登录 - pureOpenSystemSet: 打开系统配置 - pureReload: 重新加载 - pureCloseCurrentTab: 关闭当前标签页 - pureCloseLeftTabs: 关闭左侧标签页 - pureCloseRightTabs: 关闭右侧标签页 - pureCloseOtherTabs: 关闭其他标签页 - pureCloseAllTabs: 关闭全部标签页 - pureContentFullScreen: 内容区全屏 - pureContentExitFullScreen: 内容区退出全屏 - pureClickCollapse: 点击折叠 - pureClickExpand: 点击展开 - pureConfirm: 确认 - pureSwitch: 切换 - pureClose: 关闭 - pureBackTop: 回到顶部 - pureOpenText: 开 - pureCloseText: 关 - rest: 重置 -search: - pureTotal: 共 - pureHistory: 搜索历史 - pureCollect: 收藏 - pureDragSort: (可拖拽排序) - pureEmpty: 暂无搜索结果 - purePlaceholder: 搜索菜单(支持拼音搜索) -panel: - pureSystemSet: 系统配置 - pureCloseSystemSet: 关闭配置 - pureClearCacheAndToLogin: 清空缓存并返回登录页 - pureClearCache: 清空缓存 - pureOverallStyle: 整体风格 - pureOverallStyleLight: 浅色 - pureOverallStyleLightTip: 清新启航,点亮舒适的工作界面 - pureOverallStyleDark: 深色 - pureOverallStyleDarkTip: 月光序曲,沉醉于夜的静谧雅致 - pureOverallStyleSystem: 自动 - pureOverallStyleSystemTip: 同步时光,界面随晨昏自然呼应 - pureThemeColor: 主题色 - pureLayoutModel: 导航模式 - pureVerticalTip: 左侧菜单,亲切熟悉 - pureHorizontalTip: 顶部菜单,简洁概览 - pureMixTip: 混合菜单,灵活多变 - pureStretch: 页宽 - pureStretchFixed: 固定 - pureStretchFixedTip: 紧凑页面,轻松找到所需信息 - pureStretchCustom: 自定义 - pureStretchCustomTip: 最小1280、最大1600 - pureTagsStyle: 页签风格 - pureTagsStyleSmart: 灵动 - pureTagsStyleSmartTip: 灵动标签,添趣生辉 - pureTagsStyleCard: 卡片 - pureTagsStyleCardTip: 卡片标签,高效浏览 - pureInterfaceDisplay: 界面显示 - pureGreyModel: 灰色模式 - pureWeakModel: 色弱模式 - pureHiddenTags: 隐藏标签页 - pureHiddenFooter: 隐藏页脚 - pureMultiTagsCache: 页签持久化 -menus: - pureHome: 首页 - pureLogin: 登录 - pureEmpty: 无Layout页 - pureTable: 表格 - pureSysManagement: 系统管理 - pureUser: 用户管理 - pureRole: 角色管理 - pureSystemMenu: 菜单管理 - pureDept: 部门管理 - pureSysMonitor: 系统监控 - pureOnlineUser: 在线用户 - pureLoginLog: 登录日志 - pureOperationLog: 操作日志 - pureSystemLog: 系统日志 - pureEditor: 编辑器 - pureAbnormal: 异常页面 - pureFourZeroFour: "404" - pureFourZeroOne: "403" - pureFive: "500" - pureComponents: 组件 - pureDialog: 函数式弹框 - pureMessage: 消息提示 - pureVideo: 视频 - pureSegmented: 分段控制器 - pureWaterfall: 瀑布流无限滚动 - pureMap: 地图 - pureDraggable: 拖拽 - pureSplitPane: 切割面板 - pureText: 文本省略 - pureElButton: 按钮 - pureCheckButton: 可选按钮 - pureButton: 按钮动效 - pureCropping: 图片裁剪 - pureAnimatecss: animate.css选择器 - pureCountTo: 数字动画 - pureSelector: 范围选择器 - pureFlowChart: 流程图 - pureSeamless: 无缝滚动 - pureContextmenu: 右键菜单 - pureTypeit: 打字机 - pureJsonEditor: JSON编辑器 - pureColorPicker: 颜色选择器 - pureDatePicker: 日期选择器 - pureDateTimePicker: 日期时间选择器 - pureTimePicker: 时间选择器 - pureTag: 标签 - pureStatistic: 统计组件 - pureCollapse: 折叠面板 - pureGanttastic: 甘特图 - pureProgress: 进度条 - pureUpload: 文件上传 - pureCheckCard: 多选卡片 - pureMenus: 多级菜单 - pureMenu1: 菜单1 - pureMenu1-1: 菜单1-1 - pureMenu1-2: 菜单1-2 - pureMenu1-2-1: 菜单1-2-1 - pureMenu1-2-2: 菜单1-2-2 - pureMenu1-3: 菜单1-3 - pureMenu2: 菜单2 - purePermission: 权限管理 - purePermissionPage: 页面权限 - purePermissionButton: 按钮权限 - pureTabs: 标签页操作 - pureGuide: 引导页 - pureAble: 功能 - pureMenuTree: 菜单树结构 - pureVideoFrame: 视频帧截取-wasm版 - pureWavesurfer: 音频可视化 - pureRipple: 波纹(Ripple) - pureMqtt: MQTT客户端(mqtt) - pureOptimize: 防抖、截流、复制、长按指令 - pureVerify: 图形验证码 - pureWatermark: 水印 - purePrint: 打印 - pureDownload: 下载 - pureExternalPage: 外部页面 - pureExternalDoc: 文档外链 - pureEmbeddedDoc: 文档内嵌 - pureExternalLink: vue-pure-admin - pureUtilsLink: pure-admin-utils - pureColorHuntDoc: 调色板 - pureUiGradients: 渐变色 - pureEpDoc: element-plus - pureTailwindcssDoc: tailwindcss - pureVueDoc: vue3 - pureViteDoc: vite - purePiniaDoc: pinia - pureRouterDoc: vue-router - pureAbout: 关于 - pureResult: 结果页面 - pureSuccess: 成功页面 - pureFail: 失败页面 - pureIconSelect: 图标选择器 - pureTimeline: 时间线 - pureLineTree: 树形连接线 - pureList: 列表页面 - pureCardList: 卡片列表页 - pureDebounce: 防抖节流 - pureFormDesign: 表单设计器 - pureBarcode: 条形码 - pureQrcode: 二维码 - pureCascader: 区域级联选择器 - pureSwiper: Swiper插件 - pureVirtualList: 虚拟列表 - purePdf: PDF预览 - pureExcel: 导出Excel - pureInfiniteScroll: 表格无限滚动 - pureSensitive: 敏感词过滤 - purePinyin: 汉语拼音 - pureDanmaku: 弹幕 - pureSchemaForm: 表单 - pureTableBase: 基础用法 - pureTableHigh: 高级用法 - pureTableEdit: 可编辑用法 - pureVxeTable: 虚拟滚动 - pureBoard: 艺术画板 - pureMindMap: 思维导图 - pureMenuOverflow: 目录超出显示 Tooltip 文字提示 - pureChildMenuOverflow: 菜单超出显示 Tooltip 文字提示 - systemctlTest: 系统测试 -status: - pureLoad: 加载中... - pureMessage: 消息 - pureNotify: 通知 - pureTodo: 待办 - pureNoMessage: 暂无消息 - pureNoNotify: 暂无通知 - pureNoTodo: 暂无待办 -login: - pureUsername: 账号 - purePassword: 密码 - pureVerifyCode: 验证码 - pureRemember: 天内免登录 - pureRememberInfo: 勾选并登录后,规定天数内无需输入用户名和密码会自动登入系统 - pureSure: 确认密码 - pureForget: 忘记密码? - pureLogin: 登录 - pureThirdLogin: 第三方登录 - purePhoneLogin: 手机登录 - pureQRCodeLogin: 二维码登录 - pureRegister: 注册 - pureWeChatLogin: 微信登录 - pureAlipayLogin: 支付宝登录 - pureQQLogin: QQ登录 - pureWeiBoLogin: 微博登录 - purePhone: 手机号码 - pureSmsVerifyCode: 短信验证码 - pureBack: 返回 - pureTest: 模拟测试 - pureTip: 扫码后点击"确认",即可完成登录 - pureDefinite: 确定 - pureLoginSuccess: 登录成功 - pureLoginFail: 登录失败 - pureRegisterSuccess: 注册成功 - pureTickPrivacy: 请勾选隐私政策 - pureReadAccept: 我已仔细阅读并接受 - purePrivacyPolicy: 《隐私政策》 - pureGetVerifyCode: 获取验证码 - pureInfo: 秒后重新获取 - pureUsernameReg: 请输入账号 - purePassWordReg: 请输入密码 - pureVerifyCodeReg: 请输入验证码 - pureVerifyCodeCorrectReg: 请输入正确的验证码 - pureVerifyCodeSixReg: 请输入6位数字验证码 - purePhoneReg: 请输入手机号码 - purePhoneCorrectReg: 请输入正确的手机号码格式 - purePassWordRuleReg: 密码格式应为8-18位数字、字母、符号的任意两种组合 - purePassWordSureReg: 请输入确认密码 - purePassWordDifferentReg: 两次密码不一致! - purePassWordUpdateReg: 修改密码成功 -table: - tableNumber: 序号 -style: - larger: 宽松 - default: 默认 - small: 紧凑 diff --git a/mock/i18n.ts b/mock/i18n.ts new file mode 100644 index 0000000..be883e6 --- /dev/null +++ b/mock/i18n.ts @@ -0,0 +1,16 @@ +import { defineFakeRoute } from "vite-plugin-fake-server/client"; +import en from "./modules/en"; +import zh_cn from "./modules/zh_cn"; + +export default defineFakeRoute([ + { + url: "/mock/getI18n", + method: "get", + response: () => { + return { + success: true, + data: { zh_cn, en, local: "zh_cn" } + }; + } + } +]); diff --git a/mock/modules/en.ts b/mock/modules/en.ts new file mode 100644 index 0000000..5db5f1f --- /dev/null +++ b/mock/modules/en.ts @@ -0,0 +1,250 @@ +export default { + buttons: { + pureAccountSettings: "Account", + pureLoginOut: "LoginOut", + pureLogin: "Login", + pureOpenSystemSet: "Open System Configs", + pureReload: "Reload", + pureCloseCurrentTab: "Close CurrentTab", + pureCloseLeftTabs: "Close LeftTabs", + pureCloseRightTabs: "Close RightTabs", + pureCloseOtherTabs: "Close OtherTabs", + pureCloseAllTabs: "Close AllTabs", + pureContentFullScreen: "Content FullScreen", + pureContentExitFullScreen: "Content ExitFullScreen", + pureClickCollapse: "Collapse", + pureClickExpand: "Expand", + pureConfirm: "Confirm", + pureSwitch: "Switch", + pureClose: "Close", + pureBackTop: "BackTop", + pureOpenText: "Open", + pureCloseText: "Close", + rest: "Rest" + }, + search: { + pureTotal: "Total", + pureHistory: "History", + pureCollect: "Collect", + pureDragSort: "(Drag Sort)", + pureEmpty: "Empty", + purePlaceholder: "Search Menu" + }, + panel: { + pureSystemSet: "System Configs", + pureCloseSystemSet: "Close System Configs", + pureClearCacheAndToLogin: "Clear cache and return to login page", + pureClearCache: "Clear Cache", + pureOverallStyle: "Overall Style", + pureOverallStyleLight: "Light", + pureOverallStyleLightTip: "Set sail freshly and light up the comfortable work interface", + pureOverallStyleDark: "Dark", + pureOverallStyleDarkTip: "Moonlight Overture, indulge in the tranquility and elegance of the night", + pureOverallStyleSystem: "Auto", + pureOverallStyleSystemTip: "Synchronize time, the interface naturally responds to morning and dusk", + pureThemeColor: "Theme Color", + pureLayoutModel: "Layout Model", + pureVerticalTip: "The menu on the left is familiar and friendly", + pureHorizontalTip: "Top menu, concise overview", + pureMixTip: "Mixed menu, flexible", + pureStretch: "Stretch Page", + pureStretchFixed: "Fixed", + pureStretchFixedTip: "Compact pages make it easy to find the information you need", + pureStretchCustom: "Custom", + pureStretchCustomTip: "Minimum 1280, maximum 1600", + pureTagsStyle: "Tags Style", + pureTagsStyleSmart: "Smart", + pureTagsStyleSmartTip: "Smart tags add fun and brilliance", + pureTagsStyleCard: "Card", + pureTagsStyleCardTip: "Card tags for efficient browsing", + pureInterfaceDisplay: "Interface Display", + pureGreyModel: "Grey Model", + pureWeakModel: "Weak Model", + pureHiddenTags: "Hidden Tags", + pureHiddenFooter: "Hidden Footer", + pureMultiTagsCache: "MultiTags Cache" + }, + menus: { + pureHome: "Home", + pureLogin: "Login", + pureEmpty: "Empty Page", + pureTable: "Table", + pureSysManagement: "System Manage", + pureUser: "User Manage", + pureRole: "Role Manage", + pureSystemMenu: "Menu Manage", + pureDept: "Dept Manage", + pureSysMonitor: "System Monitor", + pureOnlineUser: "Online User", + pureLoginLog: "Login Log", + pureOperationLog: "Operation Log", + pureSystemLog: "System Log", + pureEditor: "Editor", + pureAbnormal: "Abnormal Page", + pureFourZeroFour: "404", + pureFourZeroOne: "403", + pureFive: "500", + pureComponents: "Components", + pureDialog: "Dialog", + pureMessage: "Message Tips", + pureVideo: "Video", + pureSegmented: "Segmented", + pureWaterfall: "Waterfall", + pureMap: "Map", + pureDraggable: "Draggable", + pureSplitPane: "Split Pane", + pureText: "Text Ellipsis", + pureElButton: "Button", + pureButton: "Button Animation", + pureCheckButton: "Check Button", + pureCropping: "Picture Cropping", + pureAnimatecss: "AnimateCss Selector", + pureCountTo: "Digital Animation", + pureSelector: "Scope Selector", + pureFlowChart: "Flow Chart", + pureSeamless: "Seamless Scroll", + pureContextmenu: "Context Menu", + pureTypeit: "Typeit", + pureJsonEditor: "JSON Editor", + pureColorPicker: "Color Picker", + pureDatePicker: "Date Picker", + pureDateTimePicker: "DateTimePicker", + pureTimePicker: "TimePicker", + pureTag: "Tag", + pureStatistic: "Statistic", + pureCollapse: "Collapse", + pureGanttastic: "Gantt Chart", + pureProgress: "Progress", + pureUpload: "File Upload", + pureCheckCard: "CheckCard", + pureMenus: "MultiLevel Menu", + pureMenu1: "Menu1", + "pureMenu1-1": "Menu1-1", + "pureMenu1-2": "Menu1-2", + "pureMenu1-2-1": "Menu1-2-1", + "pureMenu1-2-2": "Menu1-2-2", + "pureMenu1-3": "Menu1-3", + pureMenu2: "Menu2", + purePermission: "Permission Manage", + purePermissionPage: "Page Permission", + purePermissionButton: "Button Permission", + pureTabs: "Tabs Operate", + pureGuide: "Guide", + pureAble: "Able", + pureMenuTree: "Menu Tree", + pureVideoFrame: "Video Frame Capture", + pureWavesurfer: "Audio Visualization", + pureRipple: "Ripple", + pureMqtt: "Mqtt Client", + pureOptimize: "Debounce、Throttle、Copy、Longpress Directives", + pureVerify: "Captcha", + pureWatermark: "Water Mark", + purePrint: "Print", + pureDownload: "Download", + pureExternalPage: "External Page", + pureExternalDoc: "Docs External", + pureEmbeddedDoc: "Docs Embedded", + pureExternalLink: "Vue-Pure-Admin", + pureUtilsLink: "Pure-Admin-Utils", + pureColorHuntDoc: "ColorHunt", + pureUiGradients: "UiGradients", + pureEpDoc: "Element-Plus", + pureTailwindcssDoc: "Tailwindcss", + pureVueDoc: "Vue3", + pureViteDoc: "Vite", + purePiniaDoc: "Pinia", + pureRouterDoc: "Vue-Router", + pureAbout: "About", + pureResult: "Result Page", + pureSuccess: "Success Page", + pureFail: "Fail Page", + pureIconSelect: "Icon Select", + pureTimeline: "Time Line", + pureLineTree: "LineTree", + pureList: "List Page", + pureCardList: "Card List Page", + pureDebounce: "Debounce & Throttle", + pureFormDesign: "Form Design", + pureBarcode: "Barcode", + pureQrcode: "Qrcode", + pureCascader: "Area Cascader", + pureSwiper: "Swiper Plugin", + pureVirtualList: "Virtual List", + purePdf: "PDF Preview", + pureExcel: "Export Excel", + pureInfiniteScroll: "Table Infinite Scroll", + pureSensitive: "Sensitive Filter", + purePinyin: "PinYin", + pureDanmaku: "Danmaku", + pureSchemaForm: "Form", + pureTableBase: "Base Usage", + pureTableHigh: "High Usage", + pureTableEdit: "Edit Usage", + pureVxeTable: "Virtual Usage", + pureBoard: "Paint Board", + pureMindMap: "Mind Map", + pureMenuOverflow: "Menu Overflow Show Tooltip Text", + pureChildMenuOverflow: "Child Menu Overflow Show Tooltip Text", + systemctlTest: "Systemctl lTest" + }, + status: { + pureLoad: "Loading...", + pureMessage: "Message", + pureNotify: "Notify", + pureTodo: "Todo", + pureNoMessage: "No Message", + pureNoNotify: "No Notify", + pureNoTodo: "No Todo" + }, + login: { + pureUsername: "Username", + purePassword: "Password", + pureVerifyCode: "VerifyCode", + pureRemember: "days no need to login", + pureRememberInfo: "After checking and logging in, will automatically log in to the system without entering your username and password within the specified number of days.", + pureSure: "Sure Password", + pureForget: "Forget Password?", + pureLogin: "Login", + pureThirdLogin: "Third Login", + purePhoneLogin: "Phone Login", + pureQRCodeLogin: "QRCode Login", + pureRegister: "Register", + pureWeChatLogin: "WeChat Login", + pureAlipayLogin: "Alipay Login", + pureQQLogin: "QQ Login", + pureWeiBoLogin: "Weibo Login", + purePhone: "Phone", + pureSmsVerifyCode: "SMS VerifyCode", + pureBack: "Back", + pureTest: "Mock Test", + pureTip: 'After scanning the code, click "Confirm" to complete the login', + pureDefinite: "Definite", + pureLoginSuccess: "Login Success", + pureLoginFail: "Login Fail", + pureRegisterSuccess: "Regist Success", + pureTickPrivacy: "Please tick Privacy Policy", + pureReadAccept: "I have read it carefully and accept", + purePrivacyPolicy: "Privacy Policy", + pureGetVerifyCode: "Get VerifyCode", + pureInfo: "Seconds", + pureUsernameReg: "Please enter username", + purePassWordReg: "Please enter password", + pureVerifyCodeReg: "Please enter verify code", + pureVerifyCodeCorrectReg: "Please enter correct verify code", + pureVerifyCodeSixReg: "Please enter a 6-digit verify code", + purePhoneReg: "Please enter the phone", + purePhoneCorrectReg: "Please enter the correct phone number format", + purePassWordRuleReg: "The password format should be any combination of 8-18 digits", + purePassWordSureReg: "Please enter confirm password", + purePassWordDifferentReg: "The two passwords do not match!", + purePassWordUpdateReg: "Password has been updated" + }, + table: { + tableNumber: "Table Number" + }, + style: { + larger: "Larger", + default: "Default", + small: "Small" + } +}; diff --git a/mock/modules/zh_cn.ts b/mock/modules/zh_cn.ts new file mode 100644 index 0000000..8b7fe72 --- /dev/null +++ b/mock/modules/zh_cn.ts @@ -0,0 +1,251 @@ +export default { + buttons: { + pureAccountSettings: "账户设置", + pureLoginOut: "退出系统", + pureLogin: "登录", + pureOpenSystemSet: "打开系统配置", + pureReload: "重新加载", + pureCloseCurrentTab: "关闭当前标签页", + pureCloseLeftTabs: "关闭左侧标签页", + pureCloseRightTabs: "关闭右侧标签页", + pureCloseOtherTabs: "关闭其他标签页", + + pureCloseAllTabs: "关闭全部标签页", + pureContentFullScreen: "内容区全屏", + pureContentExitFullScreen: "内容区退出全屏", + pureClickCollapse: "点击折叠", + pureClickExpand: "点击展开", + pureConfirm: "确认", + pureSwitch: "切换", + pureClose: "关闭", + pureBackTop: "回到顶部", + pureOpenText: "开", + pureCloseText: "关", + rest: "重置" + }, + search: { + pureTotal: "共", + pureHistory: "搜索历史", + pureCollect: "收藏", + pureDragSort: "(可拖拽排序)", + pureEmpty: "暂无搜索结果", + purePlaceholder: "搜索菜单(支持拼音搜索)" + }, + panel: { + pureSystemSet: "系统配置", + pureCloseSystemSet: "关闭配置", + pureClearCacheAndToLogin: "清空缓存并返回登录页", + pureClearCache: "清空缓存", + pureOverallStyle: "整体风格", + pureOverallStyleLight: "浅色", + pureOverallStyleLightTip: "清新启航,点亮舒适的工作界面", + pureOverallStyleDark: "深色", + pureOverallStyleDarkTip: "月光序曲,沉醉于夜的静谧雅致", + pureOverallStyleSystem: "自动", + pureOverallStyleSystemTip: "同步时光,界面随晨昏自然呼应", + pureThemeColor: "主题色", + pureLayoutModel: "导航模式", + pureVerticalTip: "左侧菜单,亲切熟悉", + pureHorizontalTip: "顶部菜单,简洁概览", + pureMixTip: "混合菜单,灵活多变", + pureStretch: "页宽", + pureStretchFixed: "固定", + pureStretchFixedTip: "紧凑页面,轻松找到所需信息", + pureStretchCustom: "自定义", + pureStretchCustomTip: "最小1280、最大1600", + pureTagsStyle: "页签风格", + pureTagsStyleSmart: "灵动", + pureTagsStyleSmartTip: "灵动标签,添趣生辉", + pureTagsStyleCard: "卡片", + pureTagsStyleCardTip: "卡片标签,高效浏览", + pureInterfaceDisplay: "界面显示", + pureGreyModel: "灰色模式", + pureWeakModel: "色弱模式", + pureHiddenTags: "隐藏标签页", + pureHiddenFooter: "隐藏页脚", + pureMultiTagsCache: "页签持久化" + }, + menus: { + pureHome: "首页", + pureLogin: "登录", + pureEmpty: "无Layout页", + pureTable: "表格", + pureSysManagement: "系统管理", + pureUser: "用户管理", + pureRole: "角色管理", + pureSystemMenu: "菜单管理", + pureDept: "部门管理", + pureSysMonitor: "系统监控", + pureOnlineUser: "在线用户", + pureLoginLog: "登录日志", + pureOperationLog: "操作日志", + pureSystemLog: "系统日志", + pureEditor: "编辑器", + pureAbnormal: "异常页面", + pureFourZeroFour: "404", + pureFourZeroOne: "403", + pureFive: "500", + pureComponents: "组件", + pureDialog: "函数式弹框", + pureMessage: "消息提示", + pureVideo: "视频", + pureSegmented: "分段控制器", + pureWaterfall: "瀑布流无限滚动", + pureMap: "地图", + pureDraggable: "拖拽", + pureSplitPane: "切割面板", + pureText: "文本省略", + pureElButton: "按钮", + pureCheckButton: "可选按钮", + pureButton: "按钮动效", + pureCropping: "图片裁剪", + pureAnimatecss: "animate.css选择器", + pureCountTo: "数字动画", + pureSelector: "范围选择器", + pureFlowChart: "流程图", + pureSeamless: "无缝滚动", + pureContextmenu: "右键菜单", + pureTypeit: "打字机", + pureJsonEditor: "JSON编辑器", + pureColorPicker: "颜色选择器", + pureDatePicker: "日期选择器", + pureDateTimePicker: "日期时间选择器", + pureTimePicker: "时间选择器", + pureTag: "标签", + pureStatistic: "统计组件", + pureCollapse: "折叠面板", + pureGanttastic: "甘特图", + pureProgress: "进度条", + pureUpload: "文件上传", + pureCheckCard: "多选卡片", + pureMenus: "多级菜单", + pureMenu1: "菜单1", + "pureMenu1-1": "菜单1-1", + "pureMenu1-2": "菜单1-2", + "pureMenu1-2-1": "菜单1-2-1", + "pureMenu1-2-2": "菜单1-2-2", + "pureMenu1-3": "菜单1-3", + pureMenu2: "菜单2", + purePermission: "权限管理", + purePermissionPage: "页面权限", + purePermissionButton: "按钮权限", + pureTabs: "标签页操作", + pureGuide: "引导页", + pureAble: "功能", + pureMenuTree: "菜单树结构", + pureVideoFrame: "视频帧截取-wasm版", + pureWavesurfer: "音频可视化", + pureRipple: "波纹(Ripple)", + pureMqtt: "MQTT客户端(mqtt)", + pureOptimize: "防抖、截流、复制、长按指令", + pureVerify: "图形验证码", + pureWatermark: "水印", + purePrint: "打印", + pureDownload: "下载", + pureExternalPage: "外部页面", + pureExternalDoc: "文档外链", + pureEmbeddedDoc: "文档内嵌", + pureExternalLink: "vue-pure-admin", + pureUtilsLink: "pure-admin-utils", + pureColorHuntDoc: "调色板", + pureUiGradients: "渐变色", + pureEpDoc: "element-plus", + pureTailwindcssDoc: "tailwindcss", + pureVueDoc: "vue3", + pureViteDoc: "vite", + purePiniaDoc: "pinia", + pureRouterDoc: "vue-router", + pureAbout: "关于", + pureResult: "结果页面", + pureSuccess: "成功页面", + pureFail: "失败页面", + pureIconSelect: "图标选择器", + pureTimeline: "时间线", + pureLineTree: "树形连接线", + pureList: "列表页面", + pureCardList: "卡片列表页", + pureDebounce: "防抖节流", + pureFormDesign: "表单设计器", + pureBarcode: "条形码", + pureQrcode: "二维码", + pureCascader: "区域级联选择器", + pureSwiper: "Swiper插件", + pureVirtualList: "虚拟列表", + purePdf: "PDF预览", + pureExcel: "导出Excel", + pureInfiniteScroll: "表格无限滚动", + pureSensitive: "敏感词过滤", + purePinyin: "汉语拼音", + pureDanmaku: "弹幕", + pureSchemaForm: "表单", + pureTableBase: "基础用法", + pureTableHigh: "高级用法", + pureTableEdit: "可编辑用法", + pureVxeTable: "虚拟滚动", + pureBoard: "艺术画板", + pureMindMap: "思维导图", + pureMenuOverflow: "目录超出显示 Tooltip 文字提示", + pureChildMenuOverflow: "菜单超出显示 Tooltip 文字提示", + systemctlTest: "系统测试" + }, + status: { + pureLoad: "加载中...", + pureMessage: "消息", + pureNotify: "通知", + pureTodo: "待办", + pureNoMessage: "暂无消息", + pureNoNotify: "暂无通知", + pureNoTodo: "暂无待办" + }, + login: { + pureUsername: "账号", + purePassword: "密码", + pureVerifyCode: "验证码", + pureRemember: "天内免登录", + pureRememberInfo: "勾选并登录后,规定天数内无需输入用户名和密码会自动登入系统", + pureSure: "确认密码", + pureForget: "忘记密码?", + pureLogin: "登录", + pureThirdLogin: "第三方登录", + purePhoneLogin: "手机登录", + pureQRCodeLogin: "二维码登录", + pureRegister: "注册", + pureWeChatLogin: "微信登录", + pureAlipayLogin: "支付宝登录", + pureQQLogin: "QQ登录", + pureWeiBoLogin: "微博登录", + purePhone: "手机号码", + pureSmsVerifyCode: "短信验证码", + pureBack: "返回", + pureTest: "模拟测试", + pureTip: '扫码后点击"确认",即可完成登录', + pureDefinite: "确定", + pureLoginSuccess: "登录成功", + pureLoginFail: "登录失败", + pureRegisterSuccess: "注册成功", + pureTickPrivacy: "请勾选隐私政策", + pureReadAccept: "我已仔细阅读并接受", + purePrivacyPolicy: "《隐私政策》", + pureGetVerifyCode: "获取验证码", + pureInfo: "秒后重新获取", + pureUsernameReg: "请输入账号", + purePassWordReg: "请输入密码", + pureVerifyCodeReg: "请输入验证码", + pureVerifyCodeCorrectReg: "请输入正确的验证码", + pureVerifyCodeSixReg: "请输入6位数字验证码", + purePhoneReg: "请输入手机号码", + purePhoneCorrectReg: "请输入正确的手机号码格式", + purePassWordRuleReg: "密码格式应为8-18位数字、字母、符号的任意两种组合", + purePassWordSureReg: "请输入确认密码", + purePassWordDifferentReg: "两次密码不一致!", + purePassWordUpdateReg: "修改密码成功" + }, + table: { + tableNumber: "序号" + }, + style: { + larger: "宽松", + default: "默认", + small: "紧凑" + } +}; diff --git a/package.json b/package.json index 674d12d..3d81530 100644 --- a/package.json +++ b/package.json @@ -82,6 +82,7 @@ "nprogress": "^0.2.0", "path": "^0.12.7", "pinia": "^2.1.7", + "pinia-plugin-persistedstate": "^3.2.1", "pinyin-pro": "^3.20.4", "plus-pro-components": "^0.1.1", "qrcode": "^1.5.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 96a4db4..30975bb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -34,16 +34,16 @@ importers: version: 2.4.7(echarts@5.5.0)(vue@3.4.27(typescript@5.4.5)) '@vue-flow/background': specifier: ^1.3.0 - version: 1.3.0(@vue-flow/core@1.33.6(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) + version: 1.3.0(@vue-flow/core@1.33.8(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) '@vue-flow/core': specifier: ^1.33.6 - version: 1.33.6(vue@3.4.27(typescript@5.4.5)) + version: 1.33.8(vue@3.4.27(typescript@5.4.5)) '@vueuse/core': specifier: ^10.9.0 version: 10.9.0(vue@3.4.27(typescript@5.4.5)) '@vueuse/motion': specifier: ^2.1.0 - version: 2.1.0(rollup@4.17.2)(vue@3.4.27(typescript@5.4.5)) + version: 2.1.0(rollup@4.18.0)(vue@3.4.27(typescript@5.4.5)) '@wangeditor/editor': specifier: ^5.1.23 version: 5.1.23 @@ -58,7 +58,7 @@ importers: version: 4.1.1 axios: specifier: ^1.6.8 - version: 1.6.8 + version: 1.7.2 china-area-data: specifier: ^5.0.1 version: 5.0.1 @@ -107,12 +107,15 @@ importers: pinia: specifier: ^2.1.7 version: 2.1.7(typescript@5.4.5)(vue@3.4.27(typescript@5.4.5)) + pinia-plugin-persistedstate: + specifier: ^3.2.1 + version: 3.2.1(pinia@2.1.7(typescript@5.4.5)(vue@3.4.27(typescript@5.4.5))) pinyin-pro: specifier: ^3.20.4 - version: 3.20.4 + version: 3.21.0 plus-pro-components: specifier: ^0.1.1 - version: 0.1.3(element-plus@2.7.1(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) + version: 0.1.6(element-plus@2.7.1(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)) qrcode: specifier: ^1.5.3 version: 1.5.3 @@ -127,7 +130,7 @@ importers: version: 1.15.2 swiper: specifier: ^11.1.1 - version: 11.1.1 + version: 11.1.3 typeit: specifier: ^8.8.3 version: 8.8.3 @@ -178,20 +181,20 @@ importers: version: 4.1.0(vue@3.4.27(typescript@5.4.5)) vxe-table: specifier: ^4.6.9 - version: 4.6.12(vue@3.4.27(typescript@5.4.5)) + version: 4.6.17(vue@3.4.27(typescript@5.4.5)) wavesurfer.js: specifier: ^7.7.13 - version: 7.7.14 + version: 7.7.15 xgplayer: specifier: ^3.0.17 - version: 3.0.17(core-js@3.37.0) + version: 3.0.18(core-js@3.37.1) xlsx: specifier: ^0.18.5 version: 0.18.5 devDependencies: '@commitlint/cli': specifier: ^19.3.0 - version: 19.3.0(@types/node@20.12.11)(typescript@5.4.5) + version: 19.3.0(@types/node@20.12.12)(typescript@5.4.5) '@commitlint/config-conventional': specifier: ^19.2.2 version: 19.2.2 @@ -200,7 +203,7 @@ importers: version: 19.0.3 '@eslint/js': specifier: ^9.2.0 - version: 9.2.0 + version: 9.3.0 '@faker-js/faker': specifier: ^8.4.1 version: 8.4.1 @@ -215,7 +218,7 @@ importers: version: 4.1.2(vue@3.4.27(typescript@5.4.5)) '@intlify/unplugin-vue-i18n': specifier: ^4.0.0 - version: 4.0.0(rollup@4.17.2)(vue-i18n@9.13.1(vue@3.4.27(typescript@5.4.5))) + version: 4.0.0(rollup@4.18.0)(vue-i18n@9.13.1(vue@3.4.27(typescript@5.4.5))) '@pureadmin/theme': specifier: ^3.2.0 version: 3.2.0 @@ -233,7 +236,7 @@ importers: version: 3.0.6 '@types/node': specifier: ^20.12.11 - version: 20.12.11 + version: 20.12.12 '@types/nprogress': specifier: ^0.2.3 version: 0.2.3 @@ -248,16 +251,16 @@ importers: version: 1.15.8 '@typescript-eslint/eslint-plugin': specifier: ^7.8.0 - version: 7.8.0(@typescript-eslint/parser@7.8.0(eslint@9.2.0)(typescript@5.4.5))(eslint@9.2.0)(typescript@5.4.5) + version: 7.10.0(@typescript-eslint/parser@7.10.0(eslint@9.3.0)(typescript@5.4.5))(eslint@9.3.0)(typescript@5.4.5) '@typescript-eslint/parser': specifier: ^7.8.0 - version: 7.8.0(eslint@9.2.0)(typescript@5.4.5) + version: 7.10.0(eslint@9.3.0)(typescript@5.4.5) '@vitejs/plugin-vue': specifier: ^5.0.4 - version: 5.0.4(vite@5.2.11(@types/node@20.12.11)(sass@1.77.1))(vue@3.4.27(typescript@5.4.5)) + version: 5.0.4(vite@5.2.11(@types/node@20.12.12)(sass@1.77.2))(vue@3.4.27(typescript@5.4.5)) '@vitejs/plugin-vue-jsx': specifier: ^3.1.0 - version: 3.1.0(vite@5.2.11(@types/node@20.12.11)(sass@1.77.1))(vue@3.4.27(typescript@5.4.5)) + version: 3.1.0(vite@5.2.11(@types/node@20.12.12)(sass@1.77.2))(vue@3.4.27(typescript@5.4.5)) autoprefixer: specifier: ^10.4.19 version: 10.4.19(postcss@8.4.38) @@ -266,7 +269,7 @@ importers: version: 7.1.1 commitizen: specifier: ^4.2.4 - version: 4.3.0(@types/node@20.12.11)(typescript@5.4.5) + version: 4.3.0(@types/node@20.12.12)(typescript@5.4.5) commitlint: specifier: ^17.0.1 version: 17.8.1 @@ -275,25 +278,25 @@ importers: version: 7.0.1(postcss@8.4.38) cz-git: specifier: ^1.3.2 - version: 1.9.1 + version: 1.9.2 dagre: specifier: ^0.8.5 version: 0.8.5 eslint: specifier: ^9.2.0 - version: 9.2.0 + version: 9.3.0 eslint-config-prettier: specifier: ^9.1.0 - version: 9.1.0(eslint@9.2.0) + version: 9.1.0(eslint@9.3.0) eslint-define-config: specifier: ^2.1.0 version: 2.1.0 eslint-plugin-prettier: specifier: ^5.1.3 - version: 5.1.3(eslint-config-prettier@9.1.0(eslint@9.2.0))(eslint@9.2.0)(prettier@3.2.5) + version: 5.1.3(eslint-config-prettier@9.1.0(eslint@9.3.0))(eslint@9.3.0)(prettier@3.2.5) eslint-plugin-vue: specifier: ^9.25.0 - version: 9.26.0(eslint@9.2.0) + version: 9.26.0(eslint@9.3.0) gradient-string: specifier: ^2.0.2 version: 2.0.2 @@ -302,7 +305,7 @@ importers: version: 8.0.3 lint-staged: specifier: ^15.2.2 - version: 15.2.2 + version: 15.2.5 postcss: specifier: ^8.4.38 version: 8.4.38 @@ -320,28 +323,28 @@ importers: version: 3.2.5 rimraf: specifier: ^5.0.5 - version: 5.0.6 + version: 5.0.7 rollup-plugin-visualizer: specifier: ^5.12.0 - version: 5.12.0(rollup@4.17.2) + version: 5.12.0(rollup@4.18.0) sass: specifier: ^1.77.0 - version: 1.77.1 + version: 1.77.2 stylelint: specifier: ^16.5.0 - version: 16.5.0(typescript@5.4.5) + version: 16.6.0(typescript@5.4.5) stylelint-config-recess-order: specifier: ^5.0.1 - version: 5.0.1(stylelint@16.5.0(typescript@5.4.5)) + version: 5.0.1(stylelint@16.6.0(typescript@5.4.5)) stylelint-config-recommended-vue: specifier: ^1.5.0 - version: 1.5.0(postcss-html@1.7.0)(stylelint@16.5.0(typescript@5.4.5)) + version: 1.5.0(postcss-html@1.7.0)(stylelint@16.6.0(typescript@5.4.5)) stylelint-config-standard-scss: specifier: ^13.1.0 - version: 13.1.0(postcss@8.4.38)(stylelint@16.5.0(typescript@5.4.5)) + version: 13.1.0(postcss@8.4.38)(stylelint@16.6.0(typescript@5.4.5)) stylelint-prettier: specifier: ^5.0.0 - version: 5.0.0(prettier@3.2.5)(stylelint@16.5.0(typescript@5.4.5)) + version: 5.0.0(prettier@3.2.5)(stylelint@16.6.0(typescript@5.4.5)) svgo: specifier: ^3.3.0 version: 3.3.2 @@ -353,13 +356,13 @@ importers: version: 5.4.5 vite: specifier: ^5.2.11 - version: 5.2.11(@types/node@20.12.11)(sass@1.77.1) + version: 5.2.11(@types/node@20.12.12)(sass@1.77.2) vite-plugin-cdn-import: specifier: ^0.3.5 - version: 0.3.5(rollup@4.17.2) + version: 0.3.5(rollup@4.18.0) vite-plugin-compression: specifier: ^0.5.1 - version: 0.5.1(vite@5.2.11(@types/node@20.12.11)(sass@1.77.1)) + version: 0.5.1(vite@5.2.11(@types/node@20.12.12)(sass@1.77.2)) vite-plugin-fake-server: specifier: ^2.1.1 version: 2.1.1 @@ -374,7 +377,7 @@ importers: version: 5.1.0(vue@3.4.27(typescript@5.4.5)) vue-eslint-parser: specifier: ^9.4.2 - version: 9.4.2(eslint@9.2.0) + version: 9.4.2(eslint@9.3.0) vue-tsc: specifier: ^1.8.27 version: 1.8.27(typescript@5.4.5) @@ -392,114 +395,114 @@ packages: resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} engines: {node: '>=6.0.0'} - '@babel/code-frame@7.24.2': - resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} + '@babel/code-frame@7.24.6': + resolution: {integrity: sha512-ZJhac6FkEd1yhG2AHOmfcXG4ceoLltoCVJjN5XsWN9BifBQr+cHJbWi0h68HZuSORq+3WtJ2z0hwF2NG1b5kcA==} engines: {node: '>=6.9.0'} - '@babel/compat-data@7.24.4': - resolution: {integrity: sha512-vg8Gih2MLK+kOkHJp4gBEIkyaIi00jgWot2D9QOmmfLC8jINSOzmCLta6Bvz/JSBCqnegV0L80jhxkol5GWNfQ==} + '@babel/compat-data@7.24.6': + resolution: {integrity: sha512-aC2DGhBq5eEdyXWqrDInSqQjO0k8xtPRf5YylULqx8MCd6jBtzqfta/3ETMRpuKIc5hyswfO80ObyA1MvkCcUQ==} engines: {node: '>=6.9.0'} - '@babel/core@7.24.5': - resolution: {integrity: sha512-tVQRucExLQ02Boi4vdPp49svNGcfL2GhdTCT9aldhXgCJVAI21EtRfBettiuLUwce/7r6bFdgs6JFkcdTiFttA==} + '@babel/core@7.24.6': + resolution: {integrity: sha512-qAHSfAdVyFmIvl0VHELib8xar7ONuSHrE2hLnsaWkYNTI68dmi1x8GYDhJjMI/e7XWal9QBlZkwbOnkcw7Z8gQ==} engines: {node: '>=6.9.0'} - '@babel/generator@7.24.5': - resolution: {integrity: sha512-x32i4hEXvr+iI0NEoEfDKzlemF8AmtOP8CcrRaEcpzysWuoEb1KknpcvMsHKPONoKZiDuItklgWhB18xEhr9PA==} + '@babel/generator@7.24.6': + resolution: {integrity: sha512-S7m4eNa6YAPJRHmKsLHIDJhNAGNKoWNiWefz1MBbpnt8g9lvMDl1hir4P9bo/57bQEmuwEhnRU/AMWsD0G/Fbg==} engines: {node: '>=6.9.0'} - '@babel/helper-annotate-as-pure@7.22.5': - resolution: {integrity: sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==} + '@babel/helper-annotate-as-pure@7.24.6': + resolution: {integrity: sha512-DitEzDfOMnd13kZnDqns1ccmftwJTS9DMkyn9pYTxulS7bZxUxpMly3Nf23QQ6NwA4UB8lAqjbqWtyvElEMAkg==} engines: {node: '>=6.9.0'} - '@babel/helper-compilation-targets@7.23.6': - resolution: {integrity: sha512-9JB548GZoQVmzrFgp8o7KxdgkTGm6xs9DW0o/Pim72UDjzr5ObUQ6ZzYPqA+g9OTS2bBQoctLJrky0RDCAWRgQ==} + '@babel/helper-compilation-targets@7.24.6': + resolution: {integrity: sha512-VZQ57UsDGlX/5fFA7GkVPplZhHsVc+vuErWgdOiysI9Ksnw0Pbbd6pnPiR/mmJyKHgyIW0c7KT32gmhiF+cirg==} engines: {node: '>=6.9.0'} - '@babel/helper-create-class-features-plugin@7.24.5': - resolution: {integrity: sha512-uRc4Cv8UQWnE4NXlYTIIdM7wfFkOqlFztcC/gVXDKohKoVB3OyonfelUBaJzSwpBntZ2KYGF/9S7asCHsXwW6g==} + '@babel/helper-create-class-features-plugin@7.24.6': + resolution: {integrity: sha512-djsosdPJVZE6Vsw3kk7IPRWethP94WHGOhQTc67SNXE0ZzMhHgALw8iGmYS0TD1bbMM0VDROy43od7/hN6WYcA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-environment-visitor@7.22.20': - resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} + '@babel/helper-environment-visitor@7.24.6': + resolution: {integrity: sha512-Y50Cg3k0LKLMjxdPjIl40SdJgMB85iXn27Vk/qbHZCFx/o5XO3PSnpi675h1KEmmDb6OFArfd5SCQEQ5Q4H88g==} engines: {node: '>=6.9.0'} - '@babel/helper-function-name@7.23.0': - resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} + '@babel/helper-function-name@7.24.6': + resolution: {integrity: sha512-xpeLqeeRkbxhnYimfr2PC+iA0Q7ljX/d1eZ9/inYbmfG2jpl8Lu3DyXvpOAnrS5kxkfOWJjioIMQsaMBXFI05w==} engines: {node: '>=6.9.0'} - '@babel/helper-hoist-variables@7.22.5': - resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} + '@babel/helper-hoist-variables@7.24.6': + resolution: {integrity: sha512-SF/EMrC3OD7dSta1bLJIlrsVxwtd0UpjRJqLno6125epQMJ/kyFmpTT4pbvPbdQHzCHg+biQ7Syo8lnDtbR+uA==} engines: {node: '>=6.9.0'} - '@babel/helper-member-expression-to-functions@7.24.5': - resolution: {integrity: sha512-4owRteeihKWKamtqg4JmWSsEZU445xpFRXPEwp44HbgbxdWlUV1b4Agg4lkA806Lil5XM/e+FJyS0vj5T6vmcA==} + '@babel/helper-member-expression-to-functions@7.24.6': + resolution: {integrity: sha512-OTsCufZTxDUsv2/eDXanw/mUZHWOxSbEmC3pP8cgjcy5rgeVPWWMStnv274DV60JtHxTk0adT0QrCzC4M9NWGg==} engines: {node: '>=6.9.0'} '@babel/helper-module-imports@7.22.15': resolution: {integrity: sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==} engines: {node: '>=6.9.0'} - '@babel/helper-module-imports@7.24.3': - resolution: {integrity: sha512-viKb0F9f2s0BCS22QSF308z/+1YWKV/76mwt61NBzS5izMzDPwdq1pTrzf+Li3npBWX9KdQbkeCt1jSAM7lZqg==} + '@babel/helper-module-imports@7.24.6': + resolution: {integrity: sha512-a26dmxFJBF62rRO9mmpgrfTLsAuyHk4e1hKTUkD/fcMfynt8gvEKwQPQDVxWhca8dHoDck+55DFt42zV0QMw5g==} engines: {node: '>=6.9.0'} - '@babel/helper-module-transforms@7.24.5': - resolution: {integrity: sha512-9GxeY8c2d2mdQUP1Dye0ks3VDyIMS98kt/llQ2nUId8IsWqTF0l1LkSX0/uP7l7MCDrzXS009Hyhe2gzTiGW8A==} + '@babel/helper-module-transforms@7.24.6': + resolution: {integrity: sha512-Y/YMPm83mV2HJTbX1Qh2sjgjqcacvOlhbzdCCsSlblOKjSYmQqEbO6rUniWQyRo9ncyfjT8hnUjlG06RXDEmcA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-optimise-call-expression@7.22.5': - resolution: {integrity: sha512-HBwaojN0xFRx4yIvpwGqxiV2tUfl7401jlok564NgB9EHS1y6QT17FmKWm4ztqjeVdXLuC4fSvHc5ePpQjoTbw==} + '@babel/helper-optimise-call-expression@7.24.6': + resolution: {integrity: sha512-3SFDJRbx7KuPRl8XDUr8O7GAEB8iGyWPjLKJh/ywP/Iy9WOmEfMrsWbaZpvBu2HSYn4KQygIsz0O7m8y10ncMA==} engines: {node: '>=6.9.0'} - '@babel/helper-plugin-utils@7.24.5': - resolution: {integrity: sha512-xjNLDopRzW2o6ba0gKbkZq5YWEBaK3PCyTOY1K2P/O07LGMhMqlMXPxwN4S5/RhWuCobT8z0jrlKGlYmeR1OhQ==} + '@babel/helper-plugin-utils@7.24.6': + resolution: {integrity: sha512-MZG/JcWfxybKwsA9N9PmtF2lOSFSEMVCpIRrbxccZFLJPrJciJdG/UhSh5W96GEteJI2ARqm5UAHxISwRDLSNg==} engines: {node: '>=6.9.0'} - '@babel/helper-replace-supers@7.24.1': - resolution: {integrity: sha512-QCR1UqC9BzG5vZl8BMicmZ28RuUBnHhAMddD8yHFHDRH9lLTZ9uUPehX8ctVPT8l0TKblJidqcgUUKGVrePleQ==} + '@babel/helper-replace-supers@7.24.6': + resolution: {integrity: sha512-mRhfPwDqDpba8o1F8ESxsEkJMQkUF8ZIWrAc0FtWhxnjfextxMWxr22RtFizxxSYLjVHDeMgVsRq8BBZR2ikJQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-simple-access@7.24.5': - resolution: {integrity: sha512-uH3Hmf5q5n7n8mz7arjUlDOCbttY/DW4DYhE6FUsjKJ/oYC1kQQUvwEQWxRwUpX9qQKRXeqLwWxrqilMrf32sQ==} + '@babel/helper-simple-access@7.24.6': + resolution: {integrity: sha512-nZzcMMD4ZhmB35MOOzQuiGO5RzL6tJbsT37Zx8M5L/i9KSrukGXWTjLe1knIbb/RmxoJE9GON9soq0c0VEMM5g==} engines: {node: '>=6.9.0'} - '@babel/helper-skip-transparent-expression-wrappers@7.22.5': - resolution: {integrity: sha512-tK14r66JZKiC43p8Ki33yLBVJKlQDFoA8GYN67lWCDCqoL6EMMSuM9b+Iff2jHaM/RRFYl7K+iiru7hbRqNx8Q==} + '@babel/helper-skip-transparent-expression-wrappers@7.24.6': + resolution: {integrity: sha512-jhbbkK3IUKc4T43WadP96a27oYti9gEf1LdyGSP2rHGH77kwLwfhO7TgwnWvxxQVmke0ImmCSS47vcuxEMGD3Q==} engines: {node: '>=6.9.0'} - '@babel/helper-split-export-declaration@7.24.5': - resolution: {integrity: sha512-5CHncttXohrHk8GWOFCcCl4oRD9fKosWlIRgWm4ql9VYioKm52Mk2xsmoohvm7f3JoiLSM5ZgJuRaf5QZZYd3Q==} + '@babel/helper-split-export-declaration@7.24.6': + resolution: {integrity: sha512-CvLSkwXGWnYlF9+J3iZUvwgAxKiYzK3BWuo+mLzD/MDGOZDj7Gq8+hqaOkMxmJwmlv0iu86uH5fdADd9Hxkymw==} engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@7.24.1': - resolution: {integrity: sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==} + '@babel/helper-string-parser@7.24.6': + resolution: {integrity: sha512-WdJjwMEkmBicq5T9fm/cHND3+UlFa2Yj8ALLgmoSQAJZysYbBjw+azChSGPN4DSPLXOcooGRvDwZWMcF/mLO2Q==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-identifier@7.24.5': - resolution: {integrity: sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA==} + '@babel/helper-validator-identifier@7.24.6': + resolution: {integrity: sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==} engines: {node: '>=6.9.0'} - '@babel/helper-validator-option@7.23.5': - resolution: {integrity: sha512-85ttAOMLsr53VgXkTbkx8oA6YTfT4q7/HzXSLEYmjcSTJPMPQtvq1BD79Byep5xMUYbGRzEpDsjUf3dyp54IKw==} + '@babel/helper-validator-option@7.24.6': + resolution: {integrity: sha512-Jktc8KkF3zIkePb48QO+IapbXlSapOW9S+ogZZkcO6bABgYAxtZcjZ/O005111YLf+j4M84uEgwYoidDkXbCkQ==} engines: {node: '>=6.9.0'} - '@babel/helpers@7.24.5': - resolution: {integrity: sha512-CiQmBMMpMQHwM5m01YnrM6imUG1ebgYJ+fAIW4FZe6m4qHTPaRHti+R8cggAwkdz4oXhtO4/K9JWlh+8hIfR2Q==} + '@babel/helpers@7.24.6': + resolution: {integrity: sha512-V2PI+NqnyFu1i0GyTd/O/cTpxzQCYioSkUIRmgo7gFEHKKCg5w46+r/A6WeUR1+P3TeQ49dspGPNd/E3n9AnnA==} engines: {node: '>=6.9.0'} - '@babel/highlight@7.24.5': - resolution: {integrity: sha512-8lLmua6AVh/8SLJRRVD6V8p73Hir9w5mJrhE+IPpILG31KKlI9iz5zmBYKcWPS59qSfgP9RaSBQSHHE81WKuEw==} + '@babel/highlight@7.24.6': + resolution: {integrity: sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ==} engines: {node: '>=6.9.0'} - '@babel/parser@7.24.5': - resolution: {integrity: sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg==} + '@babel/parser@7.24.6': + resolution: {integrity: sha512-eNZXdfU35nJC2h24RznROuOpO94h6x8sg9ju0tT9biNtLZ2vuP8SduLqqV+/8+cebSLV9SJEAN5Z3zQbJG/M+Q==} engines: {node: '>=6.0.0'} hasBin: true @@ -528,8 +531,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-jsx@7.24.1': - resolution: {integrity: sha512-2eCtxZXf+kbkMIsXS4poTvT4Yu5rXiRa+9xGVT56raghjmBTKMpFNc9R4IDiB4emao9eO22Ox7CxuJG7BgExqA==} + '@babel/plugin-syntax-jsx@7.24.6': + resolution: {integrity: sha512-lWfvAIFNWMlCsU0DRUun2GpFwZdGTukLaHJqRh1JRb80NdAP5Sb1HDHB5X9P9OtgZHQl089UzQkpYlBq2VTPRw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 @@ -570,36 +573,36 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-syntax-typescript@7.24.1': - resolution: {integrity: sha512-Yhnmvy5HZEnHUty6i++gcfH1/l68AHnItFHnaCv6hn9dNh0hQvvQJsxpi4BMBFN5DLeHBuucT/0DgzXif/OyRw==} + '@babel/plugin-syntax-typescript@7.24.6': + resolution: {integrity: sha512-TzCtxGgVTEJWWwcYwQhCIQ6WaKlo80/B+Onsk4RRCcYqpYGFcG9etPW94VToGte5AAcxRrhjPUFvUS3Y2qKi4A==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-typescript@7.24.5': - resolution: {integrity: sha512-E0VWu/hk83BIFUWnsKZ4D81KXjN5L3MobvevOHErASk9IPwKHOkTgvqzvNo1yP/ePJWqqK2SpUR5z+KQbl6NVw==} + '@babel/plugin-transform-typescript@7.24.6': + resolution: {integrity: sha512-H0i+hDLmaYYSt6KU9cZE0gb3Cbssa/oxWis7PX4ofQzbvsfix9Lbh8SRk7LCPDlLWJHUiFeHU0qRRpF/4Zv7mQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/runtime@7.24.5': - resolution: {integrity: sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==} + '@babel/runtime@7.24.6': + resolution: {integrity: sha512-Ja18XcETdEl5mzzACGd+DKgaGJzPTCow7EglgwTmHdwokzDFYh/MHua6lU6DV/hjF2IaOJ4oX2nqnjG7RElKOw==} engines: {node: '>=6.9.0'} - '@babel/standalone@7.24.5': - resolution: {integrity: sha512-Sl8oN9bGfRlNUA2jzfzoHEZxFBDliBlwi5mPVCAWKSlBNkXXJOHpu7SDOqjF6mRoTa6GNX/1kAWG3Tr+YQ3N7A==} + '@babel/standalone@7.24.6': + resolution: {integrity: sha512-ch8nbtobUPLvSLKdG2s8pVAqS1zUc+mt7UE9k8/xpupvETbAFOaoqo0QcpgVD/f0xkMkbUnqedVY5eeVWOqtjw==} engines: {node: '>=6.9.0'} - '@babel/template@7.24.0': - resolution: {integrity: sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==} + '@babel/template@7.24.6': + resolution: {integrity: sha512-3vgazJlLwNXi9jhrR1ef8qiB65L1RK90+lEQwv4OxveHnqC3BfmnHdgySwRLzf6akhlOYenT+b7AfWq+a//AHw==} engines: {node: '>=6.9.0'} - '@babel/traverse@7.24.5': - resolution: {integrity: sha512-7aaBLeDQ4zYcUFDUD41lJc1fG8+5IU9DaNSJAgal866FGvmD5EbWQgnEC6kO1gGLsX0esNkfnJSndbTXA3r7UA==} + '@babel/traverse@7.24.6': + resolution: {integrity: sha512-OsNjaJwT9Zn8ozxcfoBc+RaHdj3gFmCmYoQLUII1o6ZrUwku0BMg80FoOTPx+Gi6XhcQxAYE4xyjPTo4SxEQqw==} engines: {node: '>=6.9.0'} - '@babel/types@7.24.5': - resolution: {integrity: sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ==} + '@babel/types@7.24.6': + resolution: {integrity: sha512-WaMsgi6Q8zMgMth93GvWPXkhAIEobfsIkLTacoVZoK1J0CevIPGYY2Vo5YvJGqyHqXM6P4ppOYGsIRU8MM9pFQ==} engines: {node: '>=6.9.0'} '@bcoe/v8-coverage@0.2.3': @@ -760,8 +763,8 @@ packages: '@csstools/css-parser-algorithms': ^2.6.3 '@csstools/css-tokenizer': ^2.3.1 - '@csstools/selector-specificity@3.1.0': - resolution: {integrity: sha512-tGDFEHZ4XJeIt5NF7/nAfLGqPckmDZSnYne5gl67p4agQolE5s4rofdQ3e+VkeukfR91lVtSQ/Jt9DqM1ICiIQ==} + '@csstools/selector-specificity@3.1.1': + resolution: {integrity: sha512-a7cxGcJ2wIlMFLlh8z2ONm+715QkPHiyJcxwQlKOz/03GPw1COpfhcmC9wm4xlZfp//jWHNNMwzjtqHXVWU9KA==} engines: {node: ^14 || ^16 || >=18} peerDependencies: postcss-selector-parser: ^6.0.13 @@ -1069,20 +1072,20 @@ packages: resolution: {integrity: sha512-Cu96Sd2By9mCNTx2iyKOmq10v22jUVQv0lQnlGNy16oE9589yE+QADPbrMGCkA51cKZSg3Pu/aTJVTGfL/qjUA==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/eslintrc@3.0.2': - resolution: {integrity: sha512-wV19ZEGEMAC1eHgrS7UQPqsdEiCIbTKTasEfcXAigzoXICcqZSjBZEHlZwNVvKg6UBCjSlos84XiLqsRJnIcIg==} + '@eslint/eslintrc@3.1.0': + resolution: {integrity: sha512-4Bfj15dVJdoy3RfZmmo86RK1Fwzn6SstsvK9JS+BaVKqC6QQQQyXekNaC+g+LKNgkQ+2VhGAzm6hO40AhMR3zQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.2.0': - resolution: {integrity: sha512-ESiIudvhoYni+MdsI8oD7skpprZ89qKocwRM2KEvhhBJ9nl5MRh7BXU5GTod7Mdygq+AUl+QzId6iWJKR/wABA==} + '@eslint/js@9.3.0': + resolution: {integrity: sha512-niBqk8iwv96+yuTwjM6bWg8ovzAPF9qkICsGtcoa5/dmqcEMfdwNAX7+/OHcJHc7wj7XqPxH98oAHytFYlw6Sw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@faker-js/faker@8.4.1': resolution: {integrity: sha512-XQ3cU+Q8Uqmrbf2e0cIC/QN43sTBSC8KF12u29Mb47tWrt2hAgBXSgpZMj4Ao8Uk0iJcU99QsOCaIL8934obCg==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0, npm: '>=6.14.13'} - '@floating-ui/core@1.6.1': - resolution: {integrity: sha512-42UH54oPZHPdRHdw6BgoBD6cg/eVTmVrFcgeRDM3jbO7uxSoipVcmcIGFcA5jmOHO5apcyvBhkSKES3fQJnu7A==} + '@floating-ui/core@1.6.2': + resolution: {integrity: sha512-+2XpQV9LLZeanU4ZevzRnGFg2neDeKHgFLjP6YLW+tly0IvrhqT4u8enLGjLH3qeh85g19xY5rsAusfwTdn5lg==} '@floating-ui/dom@1.6.5': resolution: {integrity: sha512-Nsdud2X65Dz+1RHjAIP0t8z5e2ff/IRbei6BqFrl1urT8sDVzM1HMQ+R0XcU5ceRfyO3I6ayeqIfh+6Wb8LGTw==} @@ -1106,8 +1109,8 @@ packages: '@humanwhocodes/object-schema@2.0.3': resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} - '@humanwhocodes/retry@0.2.4': - resolution: {integrity: sha512-Ttl/jHpxfS3st5sxwICYfk4pOH0WrLI1SpW283GgQL7sCWU7EHIOhX4b4fkIxr3tkfzwg8+FNojtzsIEE7Ecgg==} + '@humanwhocodes/retry@0.3.0': + resolution: {integrity: sha512-d2CGZR2o7fS6sWB7DG/3a95bGKQyHMACZ5aW8qGkkqQpUoZV6C0X7Pc7l4ZNMZkfNBf4VWNe9E1jRsf0G146Ew==} engines: {node: '>=18.18'} '@iconify-icons/ep@1.2.12': @@ -1286,8 +1289,8 @@ packages: resolution: {integrity: sha512-Z0bx7N08itD5edtpkstImLctWMNvxTArsKXzS35ZuqyAyKBPcRjO1CU01slH0ahO30Gg9kbck3/RKNZPwfOjJg==} engines: {node: ^14.18.0 || >=16.10.0} - '@nuxt/ui-templates@1.3.3': - resolution: {integrity: sha512-3BG5doAREcD50dbKyXgmjD4b1GzY8CUy3T41jMhHZXNDdaNwOd31IBq+D6dV00OSrDVhzrTVj0IxsUsnMyHvIQ==} + '@nuxt/ui-templates@1.3.4': + resolution: {integrity: sha512-zjuslnkj5zboZGis5QpmR5gvRTx5N8Ha/Rll+RRT8YZhXVNBincifhZ9apUQ9f6T0xJE8IHPyVyPx6WokomdYw==} '@pkgjs/parseargs@0.11.0': resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} @@ -1337,92 +1340,92 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.17.2': - resolution: {integrity: sha512-NM0jFxY8bB8QLkoKxIQeObCaDlJKewVlIEkuyYKm5An1tdVZ966w2+MPQ2l8LBZLjR+SgyV+nRkTIunzOYBMLQ==} + '@rollup/rollup-android-arm-eabi@4.18.0': + resolution: {integrity: sha512-Tya6xypR10giZV1XzxmH5wr25VcZSncG0pZIjfePT0OVBvqNEurzValetGNarVrGiq66EBVAFn15iYX4w6FKgQ==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.17.2': - resolution: {integrity: sha512-yeX/Usk7daNIVwkq2uGoq2BYJKZY1JfyLTaHO/jaiSwi/lsf8fTFoQW/n6IdAsx5tx+iotu2zCJwz8MxI6D/Bw==} + '@rollup/rollup-android-arm64@4.18.0': + resolution: {integrity: sha512-avCea0RAP03lTsDhEyfy+hpfr85KfyTctMADqHVhLAF3MlIkq83CP8UfAHUssgXTYd+6er6PaAhx/QGv4L1EiA==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.17.2': - resolution: {integrity: sha512-kcMLpE6uCwls023+kknm71ug7MZOrtXo+y5p/tsg6jltpDtgQY1Eq5sGfHcQfb+lfuKwhBmEURDga9N0ol4YPw==} + '@rollup/rollup-darwin-arm64@4.18.0': + resolution: {integrity: sha512-IWfdwU7KDSm07Ty0PuA/W2JYoZ4iTj3TUQjkVsO/6U+4I1jN5lcR71ZEvRh52sDOERdnNhhHU57UITXz5jC1/w==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.17.2': - resolution: {integrity: sha512-AtKwD0VEx0zWkL0ZjixEkp5tbNLzX+FCqGG1SvOu993HnSz4qDI6S4kGzubrEJAljpVkhRSlg5bzpV//E6ysTQ==} + '@rollup/rollup-darwin-x64@4.18.0': + resolution: {integrity: sha512-n2LMsUz7Ynu7DoQrSQkBf8iNrjOGyPLrdSg802vk6XT3FtsgX6JbE8IHRvposskFm9SNxzkLYGSq9QdpLYpRNA==} cpu: [x64] os: [darwin] - '@rollup/rollup-linux-arm-gnueabihf@4.17.2': - resolution: {integrity: sha512-3reX2fUHqN7sffBNqmEyMQVj/CKhIHZd4y631duy0hZqI8Qoqf6lTtmAKvJFYa6bhU95B1D0WgzHkmTg33In0A==} + '@rollup/rollup-linux-arm-gnueabihf@4.18.0': + resolution: {integrity: sha512-C/zbRYRXFjWvz9Z4haRxcTdnkPt1BtCkz+7RtBSuNmKzMzp3ZxdM28Mpccn6pt28/UWUCTXa+b0Mx1k3g6NOMA==} cpu: [arm] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm-musleabihf@4.17.2': - resolution: {integrity: sha512-uSqpsp91mheRgw96xtyAGP9FW5ChctTFEoXP0r5FAzj/3ZRv3Uxjtc7taRQSaQM/q85KEKjKsZuiZM3GyUivRg==} + '@rollup/rollup-linux-arm-musleabihf@4.18.0': + resolution: {integrity: sha512-l3m9ewPgjQSXrUMHg93vt0hYCGnrMOcUpTz6FLtbwljo2HluS4zTXFy2571YQbisTnfTKPZ01u/ukJdQTLGh9A==} cpu: [arm] os: [linux] libc: [musl] - '@rollup/rollup-linux-arm64-gnu@4.17.2': - resolution: {integrity: sha512-EMMPHkiCRtE8Wdk3Qhtciq6BndLtstqZIroHiiGzB3C5LDJmIZcSzVtLRbwuXuUft1Cnv+9fxuDtDxz3k3EW2A==} + '@rollup/rollup-linux-arm64-gnu@4.18.0': + resolution: {integrity: sha512-rJ5D47d8WD7J+7STKdCUAgmQk49xuFrRi9pZkWoRD1UeSMakbcepWXPF8ycChBoAqs1pb2wzvbY6Q33WmN2ftw==} cpu: [arm64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm64-musl@4.17.2': - resolution: {integrity: sha512-NMPylUUZ1i0z/xJUIx6VUhISZDRT+uTWpBcjdv0/zkp7b/bQDF+NfnfdzuTiB1G6HTodgoFa93hp0O1xl+/UbA==} + '@rollup/rollup-linux-arm64-musl@4.18.0': + resolution: {integrity: sha512-be6Yx37b24ZwxQ+wOQXXLZqpq4jTckJhtGlWGZs68TgdKXJgw54lUUoFYrg6Zs/kjzAQwEwYbp8JxZVzZLRepQ==} cpu: [arm64] os: [linux] libc: [musl] - '@rollup/rollup-linux-powerpc64le-gnu@4.17.2': - resolution: {integrity: sha512-T19My13y8uYXPw/L/k0JYaX1fJKFT/PWdXiHr8mTbXWxjVF1t+8Xl31DgBBvEKclw+1b00Chg0hxE2O7bTG7GQ==} + '@rollup/rollup-linux-powerpc64le-gnu@4.18.0': + resolution: {integrity: sha512-hNVMQK+qrA9Todu9+wqrXOHxFiD5YmdEi3paj6vP02Kx1hjd2LLYR2eaN7DsEshg09+9uzWi2W18MJDlG0cxJA==} cpu: [ppc64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-riscv64-gnu@4.17.2': - resolution: {integrity: sha512-BOaNfthf3X3fOWAB+IJ9kxTgPmMqPPH5f5k2DcCsRrBIbWnaJCgX2ll77dV1TdSy9SaXTR5iDXRL8n7AnoP5cg==} + '@rollup/rollup-linux-riscv64-gnu@4.18.0': + resolution: {integrity: sha512-ROCM7i+m1NfdrsmvwSzoxp9HFtmKGHEqu5NNDiZWQtXLA8S5HBCkVvKAxJ8U+CVctHwV2Gb5VUaK7UAkzhDjlg==} cpu: [riscv64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-s390x-gnu@4.17.2': - resolution: {integrity: sha512-W0UP/x7bnn3xN2eYMql2T/+wpASLE5SjObXILTMPUBDB/Fg/FxC+gX4nvCfPBCbNhz51C+HcqQp2qQ4u25ok6g==} + '@rollup/rollup-linux-s390x-gnu@4.18.0': + resolution: {integrity: sha512-0UyyRHyDN42QL+NbqevXIIUnKA47A+45WyasO+y2bGJ1mhQrfrtXUpTxCOrfxCR4esV3/RLYyucGVPiUsO8xjg==} cpu: [s390x] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.17.2': - resolution: {integrity: sha512-Hy7pLwByUOuyaFC6mAr7m+oMC+V7qyifzs/nW2OJfC8H4hbCzOX07Ov0VFk/zP3kBsELWNFi7rJtgbKYsav9QQ==} + '@rollup/rollup-linux-x64-gnu@4.18.0': + resolution: {integrity: sha512-xuglR2rBVHA5UsI8h8UbX4VJ470PtGCf5Vpswh7p2ukaqBGFTnsfzxUBetoWBWymHMxbIG0Cmx7Y9qDZzr648w==} cpu: [x64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-musl@4.17.2': - resolution: {integrity: sha512-h1+yTWeYbRdAyJ/jMiVw0l6fOOm/0D1vNLui9iPuqgRGnXA0u21gAqOyB5iHjlM9MMfNOm9RHCQ7zLIzT0x11Q==} + '@rollup/rollup-linux-x64-musl@4.18.0': + resolution: {integrity: sha512-LKaqQL9osY/ir2geuLVvRRs+utWUNilzdE90TpyoX0eNqPzWjRm14oMEE+YLve4k/NAqCdPkGYDaDF5Sw+xBfg==} cpu: [x64] os: [linux] libc: [musl] - '@rollup/rollup-win32-arm64-msvc@4.17.2': - resolution: {integrity: sha512-tmdtXMfKAjy5+IQsVtDiCfqbynAQE/TQRpWdVataHmhMb9DCoJxp9vLcCBjEQWMiUYxO1QprH/HbY9ragCEFLA==} + '@rollup/rollup-win32-arm64-msvc@4.18.0': + resolution: {integrity: sha512-7J6TkZQFGo9qBKH0pk2cEVSRhJbL6MtfWxth7Y5YmZs57Pi+4x6c2dStAUvaQkHQLnEQv1jzBUW43GvZW8OFqA==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.17.2': - resolution: {integrity: sha512-7II/QCSTAHuE5vdZaQEwJq2ZACkBpQDOmQsE6D6XUbnBHW8IAhm4eTufL6msLJorzrHDFv3CF8oCA/hSIRuZeQ==} + '@rollup/rollup-win32-ia32-msvc@4.18.0': + resolution: {integrity: sha512-Txjh+IxBPbkUB9+SXZMpv+b/vnTEtFyfWZgJ6iyCmt2tdx0OF5WhFowLmnh8ENGNpfUlUZkdI//4IEmhwPieNg==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.17.2': - resolution: {integrity: sha512-TGGO7v7qOq4CYmSBVEYpI1Y5xDuCEnbVC5Vth8mOsW0gDSzxNrVERPc790IGHsrT2dQSimgMr9Ub3Y1Jci5/8w==} + '@rollup/rollup-win32-x64-msvc@4.18.0': + resolution: {integrity: sha512-UOo5FdvOL0+eIVTgS4tIdbW+TtnBLWg1YBCcU2KWM7nuNwRz9bksDX1bekJJCpu25N1DVWaCwnT39dVQxzqS8g==} cpu: [x64] os: [win32] @@ -1471,8 +1474,8 @@ packages: '@types/babel__template@7.4.4': resolution: {integrity: sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==} - '@types/babel__traverse@7.20.5': - resolution: {integrity: sha512-WXCyOcRtH37HAUkpXhUduaxdm82b4GSlyTqajXviN4EfiuPgNYR109xMCKvpl6zPIpua0DGlMEDCq+g8EdoheQ==} + '@types/babel__traverse@7.20.6': + resolution: {integrity: sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==} '@types/conventional-commits-parser@5.0.0': resolution: {integrity: sha512-loB369iXNmAZglwWATL+WRe+CRMmmBPtpolYzIebFaX4YA3x+BEfLqhUAV9WanycKI3TG1IMr5bMJDajDKLlUQ==} @@ -1507,14 +1510,11 @@ packages: '@types/js-cookie@3.0.6': resolution: {integrity: sha512-wkw9yd1kEXOPnvEeEV1Go1MmxtBJL0RR79aOTAApecWFVu7w0NNXNqhcWgvw2YgZDYadliXkl14pa3WXw5jlCQ==} - '@types/json-schema@7.0.15': - resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - '@types/lodash-es@4.17.12': resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} - '@types/lodash@4.17.1': - resolution: {integrity: sha512-X+2qazGS3jxLAIz5JDXDzglAF3KpijdhFxlf/V1+hEsOUc+HnWi81L/uv/EvGuV90WY+7mPGFCUDGfQC3Gj95Q==} + '@types/lodash@4.17.4': + resolution: {integrity: sha512-wYCP26ZLxaT3R39kiN2+HcJ4kTd3U1waI/cY7ivWYqFP6pW3ZNpvi6Wd6PHZx7T/t8z0vlkXMg3QYLa7DZ/IJQ==} '@types/minimist@1.2.5': resolution: {integrity: sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag==} @@ -1522,8 +1522,8 @@ packages: '@types/mousetrap@1.6.15': resolution: {integrity: sha512-qL0hyIMNPow317QWW/63RvL1x5MVMV+Ru3NaY9f/CuEpCqrmb7WeuK2071ZY5hczOnm38qExWM2i2WtkXLSqFw==} - '@types/node@20.12.11': - resolution: {integrity: sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==} + '@types/node@20.12.12': + resolution: {integrity: sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==} '@types/node@20.5.1': resolution: {integrity: sha512-4tT2UrL5LBqDwoed9wZ6N3umC4Yhz3W3FloMmiiG4JwmUJWpie0c7lcnUNd4gtMKuDEO4wRVS8B6Xa0uMRsMKg==} @@ -1543,9 +1543,6 @@ packages: '@types/qs@6.9.15': resolution: {integrity: sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==} - '@types/semver@7.5.8': - resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} - '@types/sortablejs@1.15.8': resolution: {integrity: sha512-b79830lW+RZfwaztgs1aVPgbasJ8e7AXtZYHTELNXZPsERt4ymJdjV4OccDbHQAvHrCcFpbF78jkm0R6h/pZVg==} @@ -1573,8 +1570,8 @@ packages: '@types/yargs@16.0.9': resolution: {integrity: sha512-tHhzvkFXZQeTECenFoRljLBYPZJ7jAVxqqtEI0qTLOmuultnFp4I9yKE17vTuhf7BkhCu7I4XuemPgikDVuYqA==} - '@typescript-eslint/eslint-plugin@7.8.0': - resolution: {integrity: sha512-gFTT+ezJmkwutUPmB0skOj3GZJtlEGnlssems4AjkVweUPGj7jRwwqg0Hhg7++kPGJqKtTYx+R05Ftww372aIg==} + '@typescript-eslint/eslint-plugin@7.10.0': + resolution: {integrity: sha512-PzCr+a/KAef5ZawX7nbyNwBDtM1HdLIT53aSA2DDlxmxMngZ43O8SIePOeX8H5S+FHXeI6t97mTt/dDdzY4Fyw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: '@typescript-eslint/parser': ^7.0.0 @@ -1584,8 +1581,8 @@ packages: typescript: optional: true - '@typescript-eslint/parser@7.8.0': - resolution: {integrity: sha512-KgKQly1pv0l4ltcftP59uQZCi4HUYswCLbTqVZEJu7uLX8CTLyswqMLqLN+2QFz4jCptqWVV4SB7vdxcH2+0kQ==} + '@typescript-eslint/parser@7.10.0': + resolution: {integrity: sha512-2EjZMA0LUW5V5tGQiaa2Gys+nKdfrn2xiTIBLR4fxmPmVSvgPcKNW+AE/ln9k0A4zDUti0J/GZXMDupQoI+e1w==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -1594,12 +1591,12 @@ packages: typescript: optional: true - '@typescript-eslint/scope-manager@7.8.0': - resolution: {integrity: sha512-viEmZ1LmwsGcnr85gIq+FCYI7nO90DVbE37/ll51hjv9aG+YZMb4WDE2fyWpUR4O/UrhGRpYXK/XajcGTk2B8g==} + '@typescript-eslint/scope-manager@7.10.0': + resolution: {integrity: sha512-7L01/K8W/VGl7noe2mgH0K7BE29Sq6KAbVmxurj8GGaPDZXPr8EEQ2seOeAS+mEV9DnzxBQB6ax6qQQ5C6P4xg==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/type-utils@7.8.0': - resolution: {integrity: sha512-H70R3AefQDQpz9mGv13Uhi121FNMh+WEaRqcXTX09YEDky21km4dV1ZXJIp8QjXc4ZaVkXVdohvWDzbnbHDS+A==} + '@typescript-eslint/type-utils@7.10.0': + resolution: {integrity: sha512-D7tS4WDkJWrVkuzgm90qYw9RdgBcrWmbbRkrLA4d7Pg3w0ttVGDsvYGV19SH8gPR5L7OtcN5J1hTtyenO9xE9g==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -1608,12 +1605,12 @@ packages: typescript: optional: true - '@typescript-eslint/types@7.8.0': - resolution: {integrity: sha512-wf0peJ+ZGlcH+2ZS23aJbOv+ztjeeP8uQ9GgwMJGVLx/Nj9CJt17GWgWWoSmoRVKAX2X+7fzEnAjxdvK2gqCLw==} + '@typescript-eslint/types@7.10.0': + resolution: {integrity: sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==} engines: {node: ^18.18.0 || >=20.0.0} - '@typescript-eslint/typescript-estree@7.8.0': - resolution: {integrity: sha512-5pfUCOwK5yjPaJQNy44prjCwtr981dO8Qo9J9PwYXZ0MosgAbfEMB008dJ5sNo3+/BN6ytBPuSvXUg9SAqB0dg==} + '@typescript-eslint/typescript-estree@7.10.0': + resolution: {integrity: sha512-LXFnQJjL9XIcxeVfqmNj60YhatpRLt6UhdlFwAkjNc6jSUlK8zQOl1oktAP8PlWFzPQC1jny/8Bai3/HPuvN5g==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: typescript: '*' @@ -1621,14 +1618,14 @@ packages: typescript: optional: true - '@typescript-eslint/utils@7.8.0': - resolution: {integrity: sha512-L0yFqOCflVqXxiZyXrDr80lnahQfSOfc9ELAAZ75sqicqp2i36kEZZGuUymHNFoYOqxRT05up760b4iGsl02nQ==} + '@typescript-eslint/utils@7.10.0': + resolution: {integrity: sha512-olzif1Fuo8R8m/qKkzJqT7qwy16CzPRWBvERS0uvyc+DHd8AKbO4Jb7kpAvVzMmZm8TrHnI7hvjN4I05zow+tg==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 - '@typescript-eslint/visitor-keys@7.8.0': - resolution: {integrity: sha512-q4/gibTNBQNA0lGyYQCmWRS5D15n8rXh4QjK3KV+MBPlTYHpfBUT3D3PaPR/HeNiI9W6R7FvlkcGhNyAoP+caA==} + '@typescript-eslint/visitor-keys@7.10.0': + resolution: {integrity: sha512-9ntIVgsi6gg6FIq9xjEO4VQJvwOqA3jaBFQJ/6TK5AvEup2+cECI6Fh7QiBxmfMHXU0V0J4RyPeOU1VDNzl9cg==} engines: {node: ^18.18.0 || >=20.0.0} '@uppy/companion-client@2.2.2': @@ -1677,8 +1674,8 @@ packages: '@vue-flow/core': ^1.23.0 vue: ^3.3.0 - '@vue-flow/core@1.33.6': - resolution: {integrity: sha512-AfDXA5aTKxNjTeSP2zn1uox5vUCTOO8ZMllWMsPE7T7FJD7iHwLoLyxhjNMDRTaRAOPu4MohZaNr4wuEm6c6Qg==} + '@vue-flow/core@1.33.8': + resolution: {integrity: sha512-dwHRtMrp9Wje4b0mmZiU00VSWcPFnOAn+g/x6WBHpVhW4KCv3ckHsfZF3p1ApjKJYv/w4lntsN+cJmkIz7dJqw==} peerDependencies: vue: ^3.3.0 @@ -1929,8 +1926,8 @@ packages: ajv@6.12.6: resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} - ajv@8.13.0: - resolution: {integrity: sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==} + ajv@8.14.0: + resolution: {integrity: sha512-oYs1UUtO97ZO2lJ4bwnWeQW8/zvOIQLGKcvPTsWmvc2SYgBb+upuNS5NxoLaMU4h8Ju3Nbj6Cq8mD2LQoqVKFA==} animate.css@4.1.1: resolution: {integrity: sha512-+mRmCTv6SbCmtYJCN4faJMNFVNN5EuCTTprDTAo7YzIGji2KADmakjVA3+8mVDkZ2Bf09vayB35lSQIex2+QaQ==} @@ -2031,8 +2028,8 @@ packages: axios@0.27.2: resolution: {integrity: sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==} - axios@1.6.8: - resolution: {integrity: sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==} + axios@1.7.2: + resolution: {integrity: sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==} babel-jest@27.5.1: resolution: {integrity: sha512-cdQ5dXjGRd0IBRATiQ4mZGlGlRE8kJpjPOixdNRdT+m3UcNqmYWN6rK6nvtXYfY3D76cb8s/O1Ss8ea24PIwcg==} @@ -2088,8 +2085,8 @@ packages: brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} - braces@3.0.2: - resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} engines: {node: '>=8'} browser-process-hrtime@1.0.0: @@ -2154,8 +2151,8 @@ packages: caniuse-api@3.0.0: resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} - caniuse-lite@1.0.30001617: - resolution: {integrity: sha512-mLyjzNI9I+Pix8zwcrpxEbGlfqOkF9kM3ptzmKNw5tizSyYwMe+nGLTqMK9cO+0E+Bh6TsBxNAaHWEM8xwSsmA==} + caniuse-lite@1.0.30001623: + resolution: {integrity: sha512-X/XhAVKlpIxWPpgRTnlgZssJrF0m6YtRA0QDWgsBNT12uZM6LPRydR7ip405Y3t1LamD8cP2TZFEDZFBf5ApcA==} canvas@2.11.2: resolution: {integrity: sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==} @@ -2288,9 +2285,9 @@ packages: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} - commander@11.1.0: - resolution: {integrity: sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==} - engines: {node: '>=16'} + commander@12.1.0: + resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} + engines: {node: '>=18'} commander@4.1.1: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} @@ -2370,8 +2367,8 @@ packages: convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} - core-js@3.37.0: - resolution: {integrity: sha512-fu5vHevQ8ZG4og+LXug8ulUtVxjOcEYvifJr7L5Bfq9GOztVqsKd9/59hUk2ZSbCrS3BqUr3EpaYGIYzq7g3Ug==} + core-js@3.37.1: + resolution: {integrity: sha512-Xn6qmxrQZyB0FFY8E3bgRXei3lWDJHhvI+u0q9TKIYM49G8pAr0FgnnrFRAmsbptZL1yxRADVXn+x5AGsbBfyw==} cosmiconfig-typescript-loader@4.4.0: resolution: {integrity: sha512-BabizFdC3wBHhbI4kJh0VkQP9GkBfoHPydD0COMce1nJ1kJAB3F2TmJ/I7diULBKtmEWSwEbuN/KDtgnmUUVmw==} @@ -2533,8 +2530,8 @@ packages: resolution: {integrity: sha512-U466fIzU5U22eES5lTNiNbZ+d8dfcHcssH4o7QsdWaCcRs/feIPCxKYSWkYBNs5mny7MvEfwpTLWjvbm94hecw==} engines: {node: '>= 10'} - cz-git@1.9.1: - resolution: {integrity: sha512-GK3EI5R7GApS8u+g9QPvy/50z0NiG7ijc1NASxZaDnQn0ARzr73MjZb3Lt4cZQvKJBd8GrfvOWqHgwMQQ/OlaA==} + cz-git@1.9.2: + resolution: {integrity: sha512-HqwSIZBl/Vtlq56wsHuQHhQ0CF7rABEvhvbSAaGViLeM5YucLu5o+U2XLow1Y2bwIAfAIKZHfgg9fxP7P3XU3Q==} engines: {node: '>=v12.20.0'} d3-color@3.1.0: @@ -2707,8 +2704,8 @@ packages: dom-serializer@2.0.0: resolution: {integrity: sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==} - dom-zindex@1.0.2: - resolution: {integrity: sha512-QceDZxPlvzhpg6e8szxNiKPUt5Y9SfFTe3nZy8og3JoPQPlAlzBzHa/lhDkhgeG3cjbKyQcuoic+wymF0o0d1Q==} + dom-zindex@1.0.4: + resolution: {integrity: sha512-PNk7u71TJ1C9Lwjjp5nNuQcVWuECFMmr9kZAwi2UbgWUM7jXdTCe4O4x5bhLUa07jpcZUVA5Du3ho7/FXzS9Ng==} dom7@3.0.0: resolution: {integrity: sha512-oNlcUdHsC4zb7Msx7JN3K0Nro1dzJ48knvBOnDPKJ2GV9wl1i5vydJZUSyOfrkKFDZEud/jBsTk92S/VGSAe/g==} @@ -2758,8 +2755,8 @@ packages: el-table-infinite-scroll@3.0.3: resolution: {integrity: sha512-cmMHg4MxrNOV2dFziV3ISRo+rM/3tAH8TE3wWMGKd4ucjvk21Bfb6MJfPuNAicLOkq4fYZm+J+mr0NmDPnvolQ==} - electron-to-chromium@1.4.763: - resolution: {integrity: sha512-k4J8NrtJ9QrvHLRo8Q18OncqBCB7tIUyqxRcJnlonQ0ioHKYB988GcDFF3ZePmnb8eHEopDs/wPHR/iGAFgoUQ==} + electron-to-chromium@1.4.783: + resolution: {integrity: sha512-bT0jEz/Xz1fahQpbZ1D7LgmPYZ3iHVY39NcWWro1+hA2IvjiPeaXtfSqrQ+nXjApMvQRE2ASt1itSLRrebHMRQ==} element-plus@2.1.4: resolution: {integrity: sha512-pcwgDbKUrzyWbixYB/zIbLPLBQ/NPGPJnGXJ+jYozUSthPW4SuriaUGJKgbAE6PDBAtw3IodiT2E2GbiaZLxww==} @@ -2907,8 +2904,8 @@ packages: resolution: {integrity: sha512-OtIRv/2GyiF6o/d8K7MYKKbXrOUBIK6SfkIRM4Z0dY3w+LiQ0vy3F57m0Z71bjbyeiWFiHJ8brqnmE6H6/jEuw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.2.0: - resolution: {integrity: sha512-0n/I88vZpCOzO+PQpt0lbsqmn9AsnsJAQseIqhZFI8ibQT0U1AkEKRxA3EVMos0BoHSXDQvCXY25TUjB5tr8Og==} + eslint@9.3.0: + resolution: {integrity: sha512-5Iv4CsZW030lpUqHBapdPo3MJetAPtejVW8B84GIcIIv8+ohFaddXsrn1Gn8uD9ijDb+kcYKFUVmC8qG8B2ORQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true @@ -3021,8 +3018,8 @@ packages: resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} engines: {node: '>=16.0.0'} - fill-range@7.0.1: - resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} engines: {node: '>=8'} find-node-modules@2.1.3: @@ -3169,13 +3166,14 @@ packages: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} - glob@10.3.14: - resolution: {integrity: sha512-4fkAqu93xe9Mk7le9v0y3VrPDqLKHarNi2s4Pv7f2yOvfhWfhc7hRPHC/JyqMqb8B/Dt/eGS4n7ykwf3fOsl8g==} - engines: {node: '>=16 || 14 >=14.17'} + glob@10.4.1: + resolution: {integrity: sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==} + engines: {node: '>=16 || 14 >=14.18'} hasBin: true glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported global-directory@4.0.1: resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==} @@ -3355,8 +3353,8 @@ packages: immer@9.0.21: resolution: {integrity: sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==} - immutable@4.3.5: - resolution: {integrity: sha512-8eabxkth9gZatlwl5TBuJnCsoTADlL6ftEr7A4qgdaTsPyreilDSnUk57SO+jfKcNtxPa22U5KK6DSeAYhpBJw==} + immutable@4.3.6: + resolution: {integrity: sha512-Ju0+lEMyzMVZarkTn/gqRpdqd5dOPaz1mCZ0SH3JV6iFw81PldE/PEB1hWVEA288HPt4WXW8O7AWxB10M+03QQ==} import-fresh@3.3.0: resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} @@ -3386,6 +3384,7 @@ packages: inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. inherits@2.0.3: resolution: {integrity: sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==} @@ -3542,8 +3541,8 @@ packages: resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} engines: {node: '>=8'} - jackspeak@2.3.6: - resolution: {integrity: sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ==} + jackspeak@3.1.2: + resolution: {integrity: sha512-kWmLKn2tRtfYMF/BakihVVRzBKOxz4gJMiL2Rj91WnAB5TPZumSH99R/Yf1qE1u4uRimvCSJfm6hnxohXeEXjQ==} engines: {node: '>=14'} jest-changed-files@27.5.1: @@ -3774,6 +3773,9 @@ packages: known-css-properties@0.30.0: resolution: {integrity: sha512-VSWXYUnsPu9+WYKkfmJyLKtIvaRJi1kXUqVmBACORXZQxT5oZDsoZ2vQP+bQFDnWtpI/4eq3MLoRMjI2fnLzTQ==} + known-css-properties@0.31.0: + resolution: {integrity: sha512-sBPIUGTNF0czz0mwGGUoKKJC8Q7On1GPbCSFPfyEsfHb2DyBG0Y4QtV+EVWpINSaiGKZblDNuF5AezxSgOhesQ==} + leven@2.1.0: resolution: {integrity: sha512-nvVPLpIHUxCUoRLrFqTgSxXJ614d8AgQoWl7zPe/2VadE8+1dpU3LBhowRuBAcuwruWtOdD8oYC9jDNJjXDPyA==} engines: {node: '>=0.10.0'} @@ -3793,10 +3795,6 @@ packages: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} - lilconfig@3.0.0: - resolution: {integrity: sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==} - engines: {node: '>=14'} - lilconfig@3.1.1: resolution: {integrity: sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==} engines: {node: '>=14'} @@ -3804,13 +3802,13 @@ packages: lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - lint-staged@15.2.2: - resolution: {integrity: sha512-TiTt93OPh1OZOsb5B7k96A/ATl2AjIZo+vnzFZ6oHK5FuTk63ByDtxGQpHm+kFETjEWqgkF95M8FRXKR/LEBcw==} + lint-staged@15.2.5: + resolution: {integrity: sha512-j+DfX7W9YUvdzEZl3Rk47FhDF6xwDBV5wwsCPw6BwWZVPYJemusQmvb9bRsW23Sqsaa+vRloAWogbK4BUuU2zA==} engines: {node: '>=18.12.0'} hasBin: true - listr2@8.0.1: - resolution: {integrity: sha512-ovJXBXkKGfq+CwmKTjluEqFi3p4h8xvkxGQQAQan22YCgef4KZ1mKGjzfGh6PL6AW5Csw0QiQPNuQyH+6Xk3hA==} + listr2@8.2.1: + resolution: {integrity: sha512-irTfvpib/rNiD637xeevjO2l3Z5loZmuaRi0L0YE5LfijwVY96oyVn0DFD3o/teAok7nfobMG1THvvcHh/BP6g==} engines: {node: '>=18.0.0'} local-pkg@0.5.0: @@ -3990,8 +3988,8 @@ packages: merge@2.1.1: resolution: {integrity: sha512-jz+Cfrg9GWOZbQAnDQ4hlVnQky+341Yk5ru8bZSe6sIDTCIg8n9i/u7hSQGSVOF3C7lH6mGtqjkiT9G4wFLL0w==} - micromatch@4.0.5: - resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + micromatch@4.0.7: + resolution: {integrity: sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q==} engines: {node: '>=8.6'} mime-db@1.52.0: @@ -4046,8 +4044,8 @@ packages: resolution: {integrity: sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==} engines: {node: '>=8'} - minipass@7.1.1: - resolution: {integrity: sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==} + minipass@7.1.2: + resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} minizlib@2.1.2: @@ -4170,6 +4168,7 @@ packages: npmlog@5.0.1: resolution: {integrity: sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==} + deprecated: This package is no longer supported. nprogress@0.2.0: resolution: {integrity: sha512-I19aIingLgR1fmhftnbWWO3dXc0hSxqHQHQb3H8m+K3TnEn/iSeTZZOyvKXWqQESMwuUVnatlCnZdLBZZt2VSA==} @@ -4180,8 +4179,8 @@ packages: number-allocator@1.0.14: resolution: {integrity: sha512-OrL44UTVAvkKdOdRQZIJpLkAdjXGTRda052sN4sO77bKEzYYqWKMBjQvrJFzqygI99gL6Z4u2xctPW1tB8ErvA==} - nwsapi@2.2.9: - resolution: {integrity: sha512-2f3F0SEEer8bBu0dsNCFF50N0cTThV1nWFYcEYFZttdW0lDAoybv9cQoK7X7/68Z89S7FoRrVjP1LPX4XRf9vg==} + nwsapi@2.2.10: + resolution: {integrity: sha512-QK0sRs7MKv0tKe1+5uZIQk/C8XGza4DAnztJG8iD+TpJIORARrCxczA738awHrZoHeTjSSoHqao2teO0dC/gFQ==} nypm@0.3.8: resolution: {integrity: sha512-IGWlC6So2xv6V4cIDmoV0SwwWx7zLG086gyqkyumteH2fIgCAM4nDVFB2iDRszDvmdSVW9xb1N+2KjQ6C7d4og==} @@ -4298,9 +4297,9 @@ packages: path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - path-scurry@1.11.0: - resolution: {integrity: sha512-LNHTaVkzaYaLGlO+0u3rQTz7QrHTFOuKyba9JMTQutkmtNew8dw8wOD7mTU/5fCPZzCWpfW0XnQKzY61P0aTaw==} - engines: {node: '>=16 || 14 >=14.17'} + path-scurry@1.11.1: + resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} + engines: {node: '>=16 || 14 >=14.18'} path-to-regexp@6.2.2: resolution: {integrity: sha512-GQX3SSMokngb36+whdpRXE+3f9V8UzyAorlYvOGx87ufGHehNTn5lCxrKtLyZ4Yl/wEKnNnr98ZzOwwDZV5ogw==} @@ -4330,8 +4329,8 @@ packages: perfect-debounce@1.0.0: resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} - picocolors@1.0.0: - resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + picocolors@1.0.1: + resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} @@ -4346,6 +4345,11 @@ packages: resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} engines: {node: '>=0.10.0'} + pinia-plugin-persistedstate@3.2.1: + resolution: {integrity: sha512-MK++8LRUsGF7r45PjBFES82ISnPzyO6IZx3CH5vyPseFLZCk1g2kgx6l/nW8pEBKxxd4do0P6bJw+mUSZIEZUQ==} + peerDependencies: + pinia: ^2.0.0 + pinia@2.1.7: resolution: {integrity: sha512-+C2AHFtcFqjPih0zpYuvof37SFxMQ7OEG2zV9jRI12i9BOy3YQVAHwdKtyyc8pDcDyIc33WCIsZaCFWU7WWxGQ==} peerDependencies: @@ -4358,8 +4362,8 @@ packages: typescript: optional: true - pinyin-pro@3.20.4: - resolution: {integrity: sha512-R4/TG7jgr2UTLqrhiirZf5Gg5RpCsYZlbde7hJs8vF7JUHPuozIyCwDw1WJthielgy8jxuBk1TDvWBPh6TYvFw==} + pinyin-pro@3.21.0: + resolution: {integrity: sha512-3vhDqWbfjLcJAdLQGECtu8nsKI3bJva1AuqaG+c7Lgvs93Dvuqg8OhvanarrQ7QDGcg/k+aLnoSIf3VWIyjiUw==} pirates@4.0.6: resolution: {integrity: sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==} @@ -4372,8 +4376,8 @@ packages: pkg-types@1.1.1: resolution: {integrity: sha512-ko14TjmDuQJ14zsotODv7dBlwxKhUKQEhuhmbqo1uCi9BB0Z2alo/wAXg6q1dTR5TyuqYyWhjtfe/Tsh+X28jQ==} - plus-pro-components@0.1.3: - resolution: {integrity: sha512-lYzyplbkWSxeWSS3yEnqPQRjh3ENhFb1DgWxkqvLVAfbz21JME9JkIK2SCl9LB6/eCOr1/v0Lz6vlfvgvETZVw==} + plus-pro-components@0.1.6: + resolution: {integrity: sha512-JHN3cOKqZFBV0Gtt/9tsPNx2QPGhFe8rrwKhXZSRYBWWSJvZjtTJNvmItZ2ALFY0pdsuI5hJmsnzPj2CIrqnag==} peerDependencies: element-plus: ^2.3.4 vue: ^3.2.0 @@ -4748,8 +4752,8 @@ packages: peerDependencies: postcss: ^8.4.29 - postcss-selector-parser@6.0.16: - resolution: {integrity: sha512-A0RVJrX+IUkVZbW3ClroRWurercFhieevHB38sr2+l9eUClMqome3LmEmnhlNy+5Mr2EYN6B2Kaw9wYdd+VHiw==} + postcss-selector-parser@6.1.0: + resolution: {integrity: sha512-UMz42UD0UY0EApS0ZL9o1XnLhSTtvvvLe5Dc2H2O56fvRZi+KulDyf5ctDhhtYJBGKStV2FL1fy6253cmLgqVQ==} engines: {node: '>=4'} postcss-sorting@8.0.2: @@ -4788,8 +4792,8 @@ packages: resolution: {integrity: sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==} engines: {node: ^10 || ^12 || >=14} - preact@10.21.0: - resolution: {integrity: sha512-aQAIxtzWEwH8ou+OovWVSVNlFImL7xUCwJX3YMqA3U8iKCNC34999fFOnWjYNsylgfPgMexpbk7WYOLtKr/mxg==} + preact@10.22.0: + resolution: {integrity: sha512-RRurnSjJPj4rp5K6XoP45Ui33ncb7e4H7WiOHVpjbkvqvA3U+N8Z6Qbo0AE6leGYBV66n8EhEaFixvIu3SkxFw==} prelude-ls@1.2.1: resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} @@ -4960,11 +4964,12 @@ packages: rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true - rimraf@5.0.6: - resolution: {integrity: sha512-X72SgyOf+1lFnGM6gYcmZ4+jMOwuT4E4SajKQzUIlI7EoR5eFHMhS/wf8Ll0mN+w2bxcIVldrJQ6xT7HFQywjg==} - engines: {node: '>=14'} + rimraf@5.0.7: + resolution: {integrity: sha512-nV6YcJo5wbLW77m+8KjH8aB/7/rxQy9SZ0HY5shnwULfS+9nmTtVXAJET5NdZmCzA4fPI/Hm1wo/Po/4mopOdg==} + engines: {node: '>=14.18'} hasBin: true rollup-plugin-external-globals@0.6.1: @@ -4982,8 +4987,8 @@ packages: rollup: optional: true - rollup@4.17.2: - resolution: {integrity: sha512-/9ClTJPByC0U4zNLowV1tMBe8yMEAxewtR3cUNX5BoEpGH3dQEWpJLr6CLp0fPdYRF/fzVOgvDb1zXuakwF5kQ==} + rollup@4.18.0: + resolution: {integrity: sha512-QmJz14PX3rzbJCN1SG4Xe/bAAX2a6NpCP8ab2vfu2GiUr8AQcr2nCV/oEO3yneFarB67zk8ShlIyWb2LGTb3Sg==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -5003,8 +5008,8 @@ packages: safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - sass@1.77.1: - resolution: {integrity: sha512-OMEyfirt9XEfyvocduUIOlUSkWOXS/LAt6oblR/ISXCTukyavjex+zQNm51pPCOiFKY1QpWvEH1EeCkgyV3I6w==} + sass@1.77.2: + resolution: {integrity: sha512-eb4GZt1C3avsX3heBNlrc7I09nyT00IUuo4eFhAbeXWU2fvA7oXI53SxODVAA+zgZCk9aunAZgO+losjR3fAwA==} engines: {node: '>=14.0.0'} hasBin: true @@ -5140,8 +5145,8 @@ packages: spdx-expression-parse@3.0.1: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} - spdx-license-ids@3.0.17: - resolution: {integrity: sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==} + spdx-license-ids@3.0.18: + resolution: {integrity: sha512-xxRs31BqRYHwiMzudOrpSiHtZ8i/GeionCBDSilhYRj+9gIcI8wCZTlXZKu9vZIVqViP3dcp9qE5G6AlIaD+TQ==} split2@3.2.2: resolution: {integrity: sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==} @@ -5228,8 +5233,8 @@ packages: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} - strip-literal@1.3.0: - resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==} + strip-literal@2.1.0: + resolution: {integrity: sha512-Op+UycaUt/8FbN/Z2TWPBLge3jWrP3xj10f3fnYxf052bKuS3EKs1ZQcVGjnEMdsNVAM+plXRdmjrZ/KgG3Skw==} style-value-types@5.1.2: resolution: {integrity: sha512-Vs9fNreYF9j6W2VvuDTP7kepALi7sk0xtk2Tu8Yxi9UoajJdEVpNpCov0HsLTqXvNGKX+Uv09pkozVITi1jf3Q==} @@ -5315,8 +5320,8 @@ packages: peerDependencies: stylelint: ^16.0.2 - stylelint@16.5.0: - resolution: {integrity: sha512-IlCBtVrG+qTy3v+tZTk50W8BIomjY/RUuzdrDqdnlCYwVuzXtPbiGfxYqtyYAyOMcb+195zRsuHn6tgfPmFfbw==} + stylelint@16.6.0: + resolution: {integrity: sha512-vjWYlDEgOS3Z/IcXagQwi8PFJyPro1DxBYOnTML1PAqnrYUHs8owleGStv20sgt0OhW8r9zZm6MK7IT2+l2B6A==} engines: {node: '>=18.12.0'} hasBin: true @@ -5362,8 +5367,8 @@ packages: engines: {node: '>=14.0.0'} hasBin: true - swiper@11.1.1: - resolution: {integrity: sha512-jGmEA/fNz1lACIcY4/40ggm1Gcyv+EUivmgV/Jd2WFPsEJhbWXnRAwzZR8OPjkBLtDxmzcoYG/iiAMWfRs0YKQ==} + swiper@11.1.3: + resolution: {integrity: sha512-80MSxonyTxrGcaWj9YgvvhD8OG0B9/9IVZP33vhIEvyWvmKjnQDBieO+29wKvMx285sAtvZyrWBdkxaw6+D3aw==} engines: {node: '>= 4.7.0'} symbol-tree@3.2.4: @@ -5557,8 +5562,8 @@ packages: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} engines: {node: '>=18'} - unimport@3.7.1: - resolution: {integrity: sha512-V9HpXYfsZye5bPPYUgs0Otn3ODS1mDUciaBlXljI4C2fTwfFpvFZRywmlOu943puN9sncxROMZhsZCjNXEpzEQ==} + unimport@3.7.2: + resolution: {integrity: sha512-91mxcZTadgXyj3lFWmrGT8GyoRHWuE5fqPOjg5RVtF6vj+OfM5G6WCzXjuYtSgELE5ggB34RY4oiCSEP8I3AHw==} universalify@0.2.0: resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} @@ -5576,8 +5581,8 @@ packages: resolution: {integrity: sha512-nC5q0DnPEPVURPhfPQLahhSTnemVtPzdx7ofiRxXpOB2SYnb3MfdU3DVGyJdS8Lx+tBWeAePO8BfU/3EgksM7Q==} hasBin: true - update-browserslist-db@1.0.15: - resolution: {integrity: sha512-K9HWH62x3/EalU1U6sjSZiylm9C8tgq2mSvshZpqc7QE69RaA2qjhkW2HlNA0tFpEbtyFz7HTqbSdN4MSwUodA==} + update-browserslist-db@1.0.16: + resolution: {integrity: sha512-KVbTxlBYlckhF5wgfyZXTWnMn7MMZjMu9XG8bPlliUOP9ThaF4QnhP8qrjrH7DRzHfSk0oQv1wToW+iA5GajEQ==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' @@ -5772,8 +5777,8 @@ packages: peerDependencies: vue: ^3.0.1 - vxe-table@4.6.12: - resolution: {integrity: sha512-CJr+LHY5La00ur3bV4i+pUBvfqVlo2WdE9ELnEpf7/8wBdOrwe1niPoGovsAagfCdfA0Esw7F5pCN+1RjV40Ww==} + vxe-table@4.6.17: + resolution: {integrity: sha512-K9A0qJuV33Xh2NK6L1tXXEXueGyOoRVz7eFvFFpTbLVtm3oCoYl6+BOqD6YTw70R8NKdZZNH+ylmEJug+Qjrrg==} peerDependencies: vue: ^3.2.28 @@ -5788,8 +5793,8 @@ packages: walker@1.0.8: resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} - wavesurfer.js@7.7.14: - resolution: {integrity: sha512-sbd48yHnOVDEbZwsnD3dWzBj4SF2q2rsPysmPE8spoR2XwKVkU/POtZg/L0wPi6ypqXb7brQLftSeOovJNToPQ==} + wavesurfer.js@7.7.15: + resolution: {integrity: sha512-qJE7sZ5qnFG9wBtU9+jBpYn7faWXZHEz1I25Xnf4EhGqqS2rFj/hxTtbIaETynalPajxC1xXd/9TnDHWO+mARA==} wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} @@ -5900,13 +5905,13 @@ packages: xe-utils@3.5.26: resolution: {integrity: sha512-u9R7RqWDumamToEelrCv2nVA2PBJSPPUubvmiMcuHeFxwbYeBsouoi/opejmr7AdPlSj92FifF7IKFzFrczU7w==} - xgplayer-subtitles@3.0.17: - resolution: {integrity: sha512-gNJ/Gwj6UNBUXiOPG9yiGwg0g7Zbn6SOPz1NOuQvsdU0r5Z2KDz8dco0dkAXdxVZ2oqKi440qNFSu9+mQW30Cg==} + xgplayer-subtitles@3.0.18: + resolution: {integrity: sha512-8xGt3RB1FIu7393Qmfejd9f2JMogEzHjjxv+mzskWHmfT7N9X1xm6JmwCVnfMQXhKZSTtZsinEGCl1VqRjkE1g==} peerDependencies: core-js: '>=3.12.1' - xgplayer@3.0.17: - resolution: {integrity: sha512-kaWGDlTunYFBJw0wIXqhF6A7KcDIqZzRvkqPOlpLiRFmE1vfnXB0Q6CUu8/AY8R8McIPCqpVUippGYV/1SzHVQ==} + xgplayer@3.0.18: + resolution: {integrity: sha512-6GXcA8r9c1ANfOch0bsGO9y74YFGO0b2aLRPhhSA7BY8BCWBF1YzF6wQjssCUzVHfBtlS8p73RldL2Mpnggfiw==} peerDependencies: core-js: '>=3.12.1' @@ -5942,18 +5947,14 @@ packages: yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - yaml-eslint-parser@1.2.2: - resolution: {integrity: sha512-pEwzfsKbTrB8G3xc/sN7aw1v6A6c/pKxLAkjclnAyo5g5qOh6eL9WGu0o3cSDQZKrTNk4KL4lQSwZW+nBkANEg==} + yaml-eslint-parser@1.2.3: + resolution: {integrity: sha512-4wZWvE398hCP7O8n3nXKu/vdq1HcH01ixYlCREaJL5NUMwQ0g3MaGFUBNSlmBtKmhbtVG/Cm6lyYmSVTEVil8A==} engines: {node: ^14.17.0 || >=16.0.0} yaml@1.10.2: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} - yaml@2.3.4: - resolution: {integrity: sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==} - engines: {node: '>= 14'} - yaml@2.4.2: resolution: {integrity: sha512-B3VqDZ+JAg1nZpaEmWtTXUlBneoGx6CPM9b0TENK6aoSu5t73dItudwdgmi6tHlIZZId4dZ9skcAQ2UbcyAeVA==} engines: {node: '>= 14'} @@ -6009,25 +6010,25 @@ snapshots: '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 - '@babel/code-frame@7.24.2': + '@babel/code-frame@7.24.6': dependencies: - '@babel/highlight': 7.24.5 - picocolors: 1.0.0 + '@babel/highlight': 7.24.6 + picocolors: 1.0.1 - '@babel/compat-data@7.24.4': {} + '@babel/compat-data@7.24.6': {} - '@babel/core@7.24.5': + '@babel/core@7.24.6': dependencies: '@ampproject/remapping': 2.3.0 - '@babel/code-frame': 7.24.2 - '@babel/generator': 7.24.5 - '@babel/helper-compilation-targets': 7.23.6 - '@babel/helper-module-transforms': 7.24.5(@babel/core@7.24.5) - '@babel/helpers': 7.24.5 - '@babel/parser': 7.24.5 - '@babel/template': 7.24.0 - '@babel/traverse': 7.24.5 - '@babel/types': 7.24.5 + '@babel/code-frame': 7.24.6 + '@babel/generator': 7.24.6 + '@babel/helper-compilation-targets': 7.24.6 + '@babel/helper-module-transforms': 7.24.6(@babel/core@7.24.6) + '@babel/helpers': 7.24.6 + '@babel/parser': 7.24.6 + '@babel/template': 7.24.6 + '@babel/traverse': 7.24.6 + '@babel/types': 7.24.6 convert-source-map: 2.0.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -6036,230 +6037,227 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/generator@7.24.5': + '@babel/generator@7.24.6': dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.6 '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 - '@babel/helper-annotate-as-pure@7.22.5': + '@babel/helper-annotate-as-pure@7.24.6': dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.6 - '@babel/helper-compilation-targets@7.23.6': + '@babel/helper-compilation-targets@7.24.6': dependencies: - '@babel/compat-data': 7.24.4 - '@babel/helper-validator-option': 7.23.5 + '@babel/compat-data': 7.24.6 + '@babel/helper-validator-option': 7.24.6 browserslist: 4.23.0 lru-cache: 5.1.1 semver: 6.3.1 - '@babel/helper-create-class-features-plugin@7.24.5(@babel/core@7.24.5)': + '@babel/helper-create-class-features-plugin@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-member-expression-to-functions': 7.24.5 - '@babel/helper-optimise-call-expression': 7.22.5 - '@babel/helper-replace-supers': 7.24.1(@babel/core@7.24.5) - '@babel/helper-skip-transparent-expression-wrappers': 7.22.5 - '@babel/helper-split-export-declaration': 7.24.5 + '@babel/core': 7.24.6 + '@babel/helper-annotate-as-pure': 7.24.6 + '@babel/helper-environment-visitor': 7.24.6 + '@babel/helper-function-name': 7.24.6 + '@babel/helper-member-expression-to-functions': 7.24.6 + '@babel/helper-optimise-call-expression': 7.24.6 + '@babel/helper-replace-supers': 7.24.6(@babel/core@7.24.6) + '@babel/helper-skip-transparent-expression-wrappers': 7.24.6 + '@babel/helper-split-export-declaration': 7.24.6 semver: 6.3.1 - '@babel/helper-environment-visitor@7.22.20': {} + '@babel/helper-environment-visitor@7.24.6': {} - '@babel/helper-function-name@7.23.0': + '@babel/helper-function-name@7.24.6': dependencies: - '@babel/template': 7.24.0 - '@babel/types': 7.24.5 + '@babel/template': 7.24.6 + '@babel/types': 7.24.6 - '@babel/helper-hoist-variables@7.22.5': + '@babel/helper-hoist-variables@7.24.6': dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.6 - '@babel/helper-member-expression-to-functions@7.24.5': + '@babel/helper-member-expression-to-functions@7.24.6': dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.6 '@babel/helper-module-imports@7.22.15': dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.6 - '@babel/helper-module-imports@7.24.3': + '@babel/helper-module-imports@7.24.6': dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.6 - '@babel/helper-module-transforms@7.24.5(@babel/core@7.24.5)': + '@babel/helper-module-transforms@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-module-imports': 7.24.3 - '@babel/helper-simple-access': 7.24.5 - '@babel/helper-split-export-declaration': 7.24.5 - '@babel/helper-validator-identifier': 7.24.5 + '@babel/core': 7.24.6 + '@babel/helper-environment-visitor': 7.24.6 + '@babel/helper-module-imports': 7.24.6 + '@babel/helper-simple-access': 7.24.6 + '@babel/helper-split-export-declaration': 7.24.6 + '@babel/helper-validator-identifier': 7.24.6 - '@babel/helper-optimise-call-expression@7.22.5': + '@babel/helper-optimise-call-expression@7.24.6': dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.6 - '@babel/helper-plugin-utils@7.24.5': {} + '@babel/helper-plugin-utils@7.24.6': {} - '@babel/helper-replace-supers@7.24.1(@babel/core@7.24.5)': + '@babel/helper-replace-supers@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-member-expression-to-functions': 7.24.5 - '@babel/helper-optimise-call-expression': 7.22.5 + '@babel/core': 7.24.6 + '@babel/helper-environment-visitor': 7.24.6 + '@babel/helper-member-expression-to-functions': 7.24.6 + '@babel/helper-optimise-call-expression': 7.24.6 - '@babel/helper-simple-access@7.24.5': + '@babel/helper-simple-access@7.24.6': dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.6 - '@babel/helper-skip-transparent-expression-wrappers@7.22.5': + '@babel/helper-skip-transparent-expression-wrappers@7.24.6': dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.6 - '@babel/helper-split-export-declaration@7.24.5': + '@babel/helper-split-export-declaration@7.24.6': dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.6 - '@babel/helper-string-parser@7.24.1': {} + '@babel/helper-string-parser@7.24.6': {} - '@babel/helper-validator-identifier@7.24.5': {} + '@babel/helper-validator-identifier@7.24.6': {} - '@babel/helper-validator-option@7.23.5': {} + '@babel/helper-validator-option@7.24.6': {} - '@babel/helpers@7.24.5': + '@babel/helpers@7.24.6': dependencies: - '@babel/template': 7.24.0 - '@babel/traverse': 7.24.5 - '@babel/types': 7.24.5 - transitivePeerDependencies: - - supports-color + '@babel/template': 7.24.6 + '@babel/types': 7.24.6 - '@babel/highlight@7.24.5': + '@babel/highlight@7.24.6': dependencies: - '@babel/helper-validator-identifier': 7.24.5 + '@babel/helper-validator-identifier': 7.24.6 chalk: 2.4.2 js-tokens: 4.0.0 - picocolors: 1.0.0 + picocolors: 1.0.1 - '@babel/parser@7.24.5': + '@babel/parser@7.24.6': dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.6 - '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.24.5)': + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-plugin-utils': 7.24.5 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.24.5)': + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-plugin-utils': 7.24.5 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.24.5)': + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-plugin-utils': 7.24.5 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.24.5)': + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-plugin-utils': 7.24.5 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.24.5)': + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-plugin-utils': 7.24.5 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-jsx@7.24.1(@babel/core@7.24.5)': + '@babel/plugin-syntax-jsx@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-plugin-utils': 7.24.5 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.24.5)': + '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-plugin-utils': 7.24.5 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.5)': + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-plugin-utils': 7.24.5 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.24.5)': + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-plugin-utils': 7.24.5 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.24.5)': + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-plugin-utils': 7.24.5 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.24.5)': + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-plugin-utils': 7.24.5 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.5)': + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-plugin-utils': 7.24.5 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.24.5)': + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-plugin-utils': 7.24.5 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-syntax-typescript@7.24.1(@babel/core@7.24.5)': + '@babel/plugin-syntax-typescript@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-plugin-utils': 7.24.5 + '@babel/core': 7.24.6 + '@babel/helper-plugin-utils': 7.24.6 - '@babel/plugin-transform-typescript@7.24.5(@babel/core@7.24.5)': + '@babel/plugin-transform-typescript@7.24.6(@babel/core@7.24.6)': dependencies: - '@babel/core': 7.24.5 - '@babel/helper-annotate-as-pure': 7.22.5 - '@babel/helper-create-class-features-plugin': 7.24.5(@babel/core@7.24.5) - '@babel/helper-plugin-utils': 7.24.5 - '@babel/plugin-syntax-typescript': 7.24.1(@babel/core@7.24.5) + '@babel/core': 7.24.6 + '@babel/helper-annotate-as-pure': 7.24.6 + '@babel/helper-create-class-features-plugin': 7.24.6(@babel/core@7.24.6) + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-typescript': 7.24.6(@babel/core@7.24.6) - '@babel/runtime@7.24.5': + '@babel/runtime@7.24.6': dependencies: regenerator-runtime: 0.14.1 - '@babel/standalone@7.24.5': + '@babel/standalone@7.24.6': optional: true - '@babel/template@7.24.0': + '@babel/template@7.24.6': dependencies: - '@babel/code-frame': 7.24.2 - '@babel/parser': 7.24.5 - '@babel/types': 7.24.5 + '@babel/code-frame': 7.24.6 + '@babel/parser': 7.24.6 + '@babel/types': 7.24.6 - '@babel/traverse@7.24.5': + '@babel/traverse@7.24.6': dependencies: - '@babel/code-frame': 7.24.2 - '@babel/generator': 7.24.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-split-export-declaration': 7.24.5 - '@babel/parser': 7.24.5 - '@babel/types': 7.24.5 + '@babel/code-frame': 7.24.6 + '@babel/generator': 7.24.6 + '@babel/helper-environment-visitor': 7.24.6 + '@babel/helper-function-name': 7.24.6 + '@babel/helper-hoist-variables': 7.24.6 + '@babel/helper-split-export-declaration': 7.24.6 + '@babel/parser': 7.24.6 + '@babel/types': 7.24.6 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color - '@babel/types@7.24.5': + '@babel/types@7.24.6': dependencies: - '@babel/helper-string-parser': 7.24.1 - '@babel/helper-validator-identifier': 7.24.5 + '@babel/helper-string-parser': 7.24.6 + '@babel/helper-validator-identifier': 7.24.6 to-fast-properties: 2.0.0 '@bcoe/v8-coverage@0.2.3': {} @@ -6280,11 +6278,11 @@ snapshots: - '@swc/core' - '@swc/wasm' - '@commitlint/cli@19.3.0(@types/node@20.12.11)(typescript@5.4.5)': + '@commitlint/cli@19.3.0(@types/node@20.12.12)(typescript@5.4.5)': dependencies: '@commitlint/format': 19.3.0 '@commitlint/lint': 19.2.2 - '@commitlint/load': 19.2.0(@types/node@20.12.11)(typescript@5.4.5) + '@commitlint/load': 19.2.0(@types/node@20.12.12)(typescript@5.4.5) '@commitlint/read': 19.2.1 '@commitlint/types': 19.0.3 execa: 8.0.1 @@ -6301,12 +6299,12 @@ snapshots: '@commitlint/config-validator@17.8.1': dependencies: '@commitlint/types': 17.8.1 - ajv: 8.13.0 + ajv: 8.14.0 '@commitlint/config-validator@19.0.3': dependencies: '@commitlint/types': 19.0.3 - ajv: 8.13.0 + ajv: 8.14.0 '@commitlint/ensure@17.8.1': dependencies: @@ -6378,13 +6376,13 @@ snapshots: lodash.merge: 4.6.2 lodash.uniq: 4.5.0 resolve-from: 5.0.0 - ts-node: 10.9.2(@types/node@20.12.11)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@20.12.12)(typescript@5.4.5) typescript: 5.4.5 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' - '@commitlint/load@19.2.0(@types/node@20.12.11)(typescript@5.4.5)': + '@commitlint/load@19.2.0(@types/node@20.12.12)(typescript@5.4.5)': dependencies: '@commitlint/config-validator': 19.0.3 '@commitlint/execute-rule': 19.0.0 @@ -6392,7 +6390,7 @@ snapshots: '@commitlint/types': 19.0.3 chalk: 5.3.0 cosmiconfig: 9.0.0(typescript@5.4.5) - cosmiconfig-typescript-loader: 5.0.0(@types/node@20.12.11)(cosmiconfig@9.0.0(typescript@5.4.5))(typescript@5.4.5) + cosmiconfig-typescript-loader: 5.0.0(@types/node@20.12.12)(cosmiconfig@9.0.0(typescript@5.4.5))(typescript@5.4.5) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 @@ -6502,9 +6500,9 @@ snapshots: '@csstools/css-parser-algorithms': 2.6.3(@csstools/css-tokenizer@2.3.1) '@csstools/css-tokenizer': 2.3.1 - '@csstools/selector-specificity@3.1.0(postcss-selector-parser@6.0.16)': + '@csstools/selector-specificity@3.1.1(postcss-selector-parser@6.1.0)': dependencies: - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.0 '@ctrl/tinycolor@3.6.1': {} @@ -6656,14 +6654,14 @@ snapshots: '@esbuild/win32-x64@0.20.2': optional: true - '@eslint-community/eslint-utils@4.4.0(eslint@9.2.0)': + '@eslint-community/eslint-utils@4.4.0(eslint@9.3.0)': dependencies: - eslint: 9.2.0 + eslint: 9.3.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.10.0': {} - '@eslint/eslintrc@3.0.2': + '@eslint/eslintrc@3.1.0': dependencies: ajv: 6.12.6 debug: 4.3.4 @@ -6677,17 +6675,17 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.2.0': {} + '@eslint/js@9.3.0': {} '@faker-js/faker@8.4.1': {} - '@floating-ui/core@1.6.1': + '@floating-ui/core@1.6.2': dependencies: '@floating-ui/utils': 0.2.2 '@floating-ui/dom@1.6.5': dependencies: - '@floating-ui/core': 1.6.1 + '@floating-ui/core': 1.6.2 '@floating-ui/utils': 0.2.2 '@floating-ui/utils@0.2.2': {} @@ -6708,7 +6706,7 @@ snapshots: '@humanwhocodes/object-schema@2.0.3': {} - '@humanwhocodes/retry@0.2.4': {} + '@humanwhocodes/retry@0.3.0': {} '@iconify-icons/ep@1.2.12': dependencies: @@ -6743,7 +6741,7 @@ snapshots: jsonc-eslint-parser: 2.4.0 mlly: 1.7.0 source-map-js: 1.2.0 - yaml-eslint-parser: 1.2.2 + yaml-eslint-parser: 1.2.3 optionalDependencies: vue-i18n: 9.13.1(vue@3.4.27(typescript@5.4.5)) @@ -6759,18 +6757,18 @@ snapshots: '@intlify/shared@9.13.1': {} - '@intlify/unplugin-vue-i18n@4.0.0(rollup@4.17.2)(vue-i18n@9.13.1(vue@3.4.27(typescript@5.4.5)))': + '@intlify/unplugin-vue-i18n@4.0.0(rollup@4.18.0)(vue-i18n@9.13.1(vue@3.4.27(typescript@5.4.5)))': dependencies: '@intlify/bundle-utils': 8.0.0(vue-i18n@9.13.1(vue@3.4.27(typescript@5.4.5))) '@intlify/shared': 9.13.1 - '@rollup/pluginutils': 5.1.0(rollup@4.17.2) + '@rollup/pluginutils': 5.1.0(rollup@4.18.0) '@vue/compiler-sfc': 3.4.27 debug: 4.3.4 fast-glob: 3.3.2 js-yaml: 4.1.0 json5: 2.2.3 pathe: 1.1.2 - picocolors: 1.0.0 + picocolors: 1.0.1 source-map-js: 1.2.0 unplugin: 1.10.1 optionalDependencies: @@ -6801,7 +6799,7 @@ snapshots: '@jest/console@27.5.1': dependencies: '@jest/types': 27.5.1 - '@types/node': 20.12.11 + '@types/node': 20.12.12 chalk: 4.1.2 jest-message-util: 27.5.1 jest-util: 27.5.1 @@ -6814,7 +6812,7 @@ snapshots: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.12.11 + '@types/node': 20.12.12 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.8.1 @@ -6833,7 +6831,7 @@ snapshots: jest-util: 27.5.1 jest-validate: 27.5.1 jest-watcher: 27.5.1 - micromatch: 4.0.5 + micromatch: 4.0.7 rimraf: 3.0.2 slash: 3.0.0 strip-ansi: 6.0.1 @@ -6848,14 +6846,14 @@ snapshots: dependencies: '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.12.11 + '@types/node': 20.12.12 jest-mock: 27.5.1 '@jest/fake-timers@27.5.1': dependencies: '@jest/types': 27.5.1 '@sinonjs/fake-timers': 8.1.0 - '@types/node': 20.12.11 + '@types/node': 20.12.12 jest-message-util: 27.5.1 jest-mock: 27.5.1 jest-util: 27.5.1 @@ -6873,7 +6871,7 @@ snapshots: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.12.11 + '@types/node': 20.12.12 chalk: 4.1.2 collect-v8-coverage: 1.0.2 exit: 0.1.2 @@ -6920,7 +6918,7 @@ snapshots: '@jest/transform@27.5.1': dependencies: - '@babel/core': 7.24.5 + '@babel/core': 7.24.6 '@jest/types': 27.5.1 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 @@ -6930,7 +6928,7 @@ snapshots: jest-haste-map: 27.5.1 jest-regex-util: 27.5.1 jest-util: 27.5.1 - micromatch: 4.0.5 + micromatch: 4.0.7 pirates: 4.0.6 slash: 3.0.0 source-map: 0.6.1 @@ -6942,7 +6940,7 @@ snapshots: dependencies: '@types/istanbul-lib-coverage': 2.0.6 '@types/istanbul-reports': 3.0.4 - '@types/node': 20.12.11 + '@types/node': 20.12.12 '@types/yargs': 16.0.9 chalk: 4.1.2 @@ -6972,14 +6970,14 @@ snapshots: dependencies: '@types/mousetrap': 1.6.15 mousetrap: 1.6.5 - preact: 10.21.0 + preact: 10.22.0 '@logicflow/extension@1.2.27(canvas@2.11.2)(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.4.5))': dependencies: '@logicflow/core': 1.2.27 jest: 27.5.1(canvas@2.11.2)(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.4.5)) lodash-es: 4.17.21 - preact: 10.21.0 + preact: 10.22.0 transitivePeerDependencies: - bufferutil - canvas @@ -7016,9 +7014,9 @@ snapshots: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - '@nuxt/kit@3.11.2(rollup@4.17.2)': + '@nuxt/kit@3.11.2(rollup@4.18.0)': dependencies: - '@nuxt/schema': 3.11.2(rollup@4.17.2) + '@nuxt/schema': 3.11.2(rollup@4.18.0) c12: 1.10.0 consola: 3.2.3 defu: 6.1.4 @@ -7034,16 +7032,16 @@ snapshots: semver: 7.6.2 ufo: 1.5.3 unctx: 2.3.1 - unimport: 3.7.1(rollup@4.17.2) + unimport: 3.7.2(rollup@4.18.0) untyped: 1.4.2 transitivePeerDependencies: - rollup - supports-color optional: true - '@nuxt/schema@3.11.2(rollup@4.17.2)': + '@nuxt/schema@3.11.2(rollup@4.18.0)': dependencies: - '@nuxt/ui-templates': 1.3.3 + '@nuxt/ui-templates': 1.3.4 consola: 3.2.3 defu: 6.1.4 hookable: 5.5.3 @@ -7052,14 +7050,14 @@ snapshots: scule: 1.3.0 std-env: 3.7.0 ufo: 1.5.3 - unimport: 3.7.1(rollup@4.17.2) + unimport: 3.7.2(rollup@4.18.0) untyped: 1.4.2 transitivePeerDependencies: - rollup - supports-color optional: true - '@nuxt/ui-templates@1.3.3': + '@nuxt/ui-templates@1.3.4': optional: true '@pkgjs/parseargs@0.11.0': @@ -7102,60 +7100,60 @@ snapshots: estree-walker: 2.0.2 picomatch: 2.3.1 - '@rollup/pluginutils@5.1.0(rollup@4.17.2)': + '@rollup/pluginutils@5.1.0(rollup@4.18.0)': dependencies: '@types/estree': 1.0.5 estree-walker: 2.0.2 picomatch: 2.3.1 optionalDependencies: - rollup: 4.17.2 + rollup: 4.18.0 - '@rollup/rollup-android-arm-eabi@4.17.2': + '@rollup/rollup-android-arm-eabi@4.18.0': optional: true - '@rollup/rollup-android-arm64@4.17.2': + '@rollup/rollup-android-arm64@4.18.0': optional: true - '@rollup/rollup-darwin-arm64@4.17.2': + '@rollup/rollup-darwin-arm64@4.18.0': optional: true - '@rollup/rollup-darwin-x64@4.17.2': + '@rollup/rollup-darwin-x64@4.18.0': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.17.2': + '@rollup/rollup-linux-arm-gnueabihf@4.18.0': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.17.2': + '@rollup/rollup-linux-arm-musleabihf@4.18.0': optional: true - '@rollup/rollup-linux-arm64-gnu@4.17.2': + '@rollup/rollup-linux-arm64-gnu@4.18.0': optional: true - '@rollup/rollup-linux-arm64-musl@4.17.2': + '@rollup/rollup-linux-arm64-musl@4.18.0': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.17.2': + '@rollup/rollup-linux-powerpc64le-gnu@4.18.0': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.17.2': + '@rollup/rollup-linux-riscv64-gnu@4.18.0': optional: true - '@rollup/rollup-linux-s390x-gnu@4.17.2': + '@rollup/rollup-linux-s390x-gnu@4.18.0': optional: true - '@rollup/rollup-linux-x64-gnu@4.17.2': + '@rollup/rollup-linux-x64-gnu@4.18.0': optional: true - '@rollup/rollup-linux-x64-musl@4.17.2': + '@rollup/rollup-linux-x64-musl@4.18.0': optional: true - '@rollup/rollup-win32-arm64-msvc@4.17.2': + '@rollup/rollup-win32-arm64-msvc@4.18.0': optional: true - '@rollup/rollup-win32-ia32-msvc@4.17.2': + '@rollup/rollup-win32-ia32-msvc@4.18.0': optional: true - '@rollup/rollup-win32-x64-msvc@4.17.2': + '@rollup/rollup-win32-x64-msvc@4.18.0': optional: true '@sindresorhus/merge-streams@2.3.0': @@ -7187,28 +7185,28 @@ snapshots: '@types/babel__core@7.20.5': dependencies: - '@babel/parser': 7.24.5 - '@babel/types': 7.24.5 + '@babel/parser': 7.24.6 + '@babel/types': 7.24.6 '@types/babel__generator': 7.6.8 '@types/babel__template': 7.4.4 - '@types/babel__traverse': 7.20.5 + '@types/babel__traverse': 7.20.6 '@types/babel__generator@7.6.8': dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.6 '@types/babel__template@7.4.4': dependencies: - '@babel/parser': 7.24.5 - '@babel/types': 7.24.5 + '@babel/parser': 7.24.6 + '@babel/types': 7.24.6 - '@types/babel__traverse@7.20.5': + '@types/babel__traverse@7.20.6': dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.6 '@types/conventional-commits-parser@5.0.0': dependencies: - '@types/node': 20.12.11 + '@types/node': 20.12.12 '@types/dagre@0.7.52': {} @@ -7218,7 +7216,7 @@ snapshots: '@types/graceful-fs@4.1.9': dependencies: - '@types/node': 20.12.11 + '@types/node': 20.12.12 '@types/gradient-string@1.1.6': dependencies: @@ -7238,19 +7236,17 @@ snapshots: '@types/js-cookie@3.0.6': {} - '@types/json-schema@7.0.15': {} - '@types/lodash-es@4.17.12': dependencies: - '@types/lodash': 4.17.1 + '@types/lodash': 4.17.4 - '@types/lodash@4.17.1': {} + '@types/lodash@4.17.4': {} '@types/minimist@1.2.5': {} '@types/mousetrap@1.6.15': {} - '@types/node@20.12.11': + '@types/node@20.12.12': dependencies: undici-types: 5.26.5 @@ -7264,12 +7260,10 @@ snapshots: '@types/qrcode@1.5.5': dependencies: - '@types/node': 20.12.11 + '@types/node': 20.12.12 '@types/qs@6.9.15': {} - '@types/semver@7.5.8': {} - '@types/sortablejs@1.15.8': {} '@types/stack-utils@2.0.3': {} @@ -7290,62 +7284,60 @@ snapshots: dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@7.8.0(@typescript-eslint/parser@7.8.0(eslint@9.2.0)(typescript@5.4.5))(eslint@9.2.0)(typescript@5.4.5)': + '@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0(eslint@9.3.0)(typescript@5.4.5))(eslint@9.3.0)(typescript@5.4.5)': dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.8.0(eslint@9.2.0)(typescript@5.4.5) - '@typescript-eslint/scope-manager': 7.8.0 - '@typescript-eslint/type-utils': 7.8.0(eslint@9.2.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.8.0(eslint@9.2.0)(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.8.0 - debug: 4.3.4 - eslint: 9.2.0 + '@typescript-eslint/parser': 7.10.0(eslint@9.3.0)(typescript@5.4.5) + '@typescript-eslint/scope-manager': 7.10.0 + '@typescript-eslint/type-utils': 7.10.0(eslint@9.3.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.10.0(eslint@9.3.0)(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.10.0 + eslint: 9.3.0 graphemer: 1.4.0 ignore: 5.3.1 natural-compare: 1.4.0 - semver: 7.6.2 ts-api-utils: 1.3.0(typescript@5.4.5) optionalDependencies: typescript: 5.4.5 transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@7.8.0(eslint@9.2.0)(typescript@5.4.5)': + '@typescript-eslint/parser@7.10.0(eslint@9.3.0)(typescript@5.4.5)': dependencies: - '@typescript-eslint/scope-manager': 7.8.0 - '@typescript-eslint/types': 7.8.0 - '@typescript-eslint/typescript-estree': 7.8.0(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.8.0 + '@typescript-eslint/scope-manager': 7.10.0 + '@typescript-eslint/types': 7.10.0 + '@typescript-eslint/typescript-estree': 7.10.0(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.10.0 debug: 4.3.4 - eslint: 9.2.0 + eslint: 9.3.0 optionalDependencies: typescript: 5.4.5 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@7.8.0': + '@typescript-eslint/scope-manager@7.10.0': dependencies: - '@typescript-eslint/types': 7.8.0 - '@typescript-eslint/visitor-keys': 7.8.0 + '@typescript-eslint/types': 7.10.0 + '@typescript-eslint/visitor-keys': 7.10.0 - '@typescript-eslint/type-utils@7.8.0(eslint@9.2.0)(typescript@5.4.5)': + '@typescript-eslint/type-utils@7.10.0(eslint@9.3.0)(typescript@5.4.5)': dependencies: - '@typescript-eslint/typescript-estree': 7.8.0(typescript@5.4.5) - '@typescript-eslint/utils': 7.8.0(eslint@9.2.0)(typescript@5.4.5) + '@typescript-eslint/typescript-estree': 7.10.0(typescript@5.4.5) + '@typescript-eslint/utils': 7.10.0(eslint@9.3.0)(typescript@5.4.5) debug: 4.3.4 - eslint: 9.2.0 + eslint: 9.3.0 ts-api-utils: 1.3.0(typescript@5.4.5) optionalDependencies: typescript: 5.4.5 transitivePeerDependencies: - supports-color - '@typescript-eslint/types@7.8.0': {} + '@typescript-eslint/types@7.10.0': {} - '@typescript-eslint/typescript-estree@7.8.0(typescript@5.4.5)': + '@typescript-eslint/typescript-estree@7.10.0(typescript@5.4.5)': dependencies: - '@typescript-eslint/types': 7.8.0 - '@typescript-eslint/visitor-keys': 7.8.0 + '@typescript-eslint/types': 7.10.0 + '@typescript-eslint/visitor-keys': 7.10.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -7357,23 +7349,20 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@7.8.0(eslint@9.2.0)(typescript@5.4.5)': + '@typescript-eslint/utils@7.10.0(eslint@9.3.0)(typescript@5.4.5)': dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.2.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.5.8 - '@typescript-eslint/scope-manager': 7.8.0 - '@typescript-eslint/types': 7.8.0 - '@typescript-eslint/typescript-estree': 7.8.0(typescript@5.4.5) - eslint: 9.2.0 - semver: 7.6.2 + '@eslint-community/eslint-utils': 4.4.0(eslint@9.3.0) + '@typescript-eslint/scope-manager': 7.10.0 + '@typescript-eslint/types': 7.10.0 + '@typescript-eslint/typescript-estree': 7.10.0(typescript@5.4.5) + eslint: 9.3.0 transitivePeerDependencies: - supports-color - typescript - '@typescript-eslint/visitor-keys@7.8.0': + '@typescript-eslint/visitor-keys@7.10.0': dependencies: - '@typescript-eslint/types': 7.8.0 + '@typescript-eslint/types': 7.10.0 eslint-visitor-keys: 3.4.3 '@uppy/companion-client@2.2.2': @@ -7390,7 +7379,7 @@ snapshots: mime-match: 1.0.2 namespace-emitter: 2.0.1 nanoid: 3.3.7 - preact: 10.21.0 + preact: 10.22.0 '@uppy/store-default@2.1.1': {} @@ -7405,19 +7394,19 @@ snapshots: '@uppy/utils': 4.1.3 nanoid: 3.3.7 - '@vitejs/plugin-vue-jsx@3.1.0(vite@5.2.11(@types/node@20.12.11)(sass@1.77.1))(vue@3.4.27(typescript@5.4.5))': + '@vitejs/plugin-vue-jsx@3.1.0(vite@5.2.11(@types/node@20.12.12)(sass@1.77.2))(vue@3.4.27(typescript@5.4.5))': dependencies: - '@babel/core': 7.24.5 - '@babel/plugin-transform-typescript': 7.24.5(@babel/core@7.24.5) - '@vue/babel-plugin-jsx': 1.2.2(@babel/core@7.24.5) - vite: 5.2.11(@types/node@20.12.11)(sass@1.77.1) + '@babel/core': 7.24.6 + '@babel/plugin-transform-typescript': 7.24.6(@babel/core@7.24.6) + '@vue/babel-plugin-jsx': 1.2.2(@babel/core@7.24.6) + vite: 5.2.11(@types/node@20.12.12)(sass@1.77.2) vue: 3.4.27(typescript@5.4.5) transitivePeerDependencies: - supports-color - '@vitejs/plugin-vue@5.0.4(vite@5.2.11(@types/node@20.12.11)(sass@1.77.1))(vue@3.4.27(typescript@5.4.5))': + '@vitejs/plugin-vue@5.0.4(vite@5.2.11(@types/node@20.12.12)(sass@1.77.2))(vue@3.4.27(typescript@5.4.5))': dependencies: - vite: 5.2.11(@types/node@20.12.11)(sass@1.77.1) + vite: 5.2.11(@types/node@20.12.12)(sass@1.77.2) vue: 3.4.27(typescript@5.4.5) '@volar/language-core@1.11.1': @@ -7433,12 +7422,12 @@ snapshots: '@volar/language-core': 1.11.1 path-browserify: 1.0.1 - '@vue-flow/background@1.3.0(@vue-flow/core@1.33.6(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5))': + '@vue-flow/background@1.3.0(@vue-flow/core@1.33.8(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5))': dependencies: - '@vue-flow/core': 1.33.6(vue@3.4.27(typescript@5.4.5)) + '@vue-flow/core': 1.33.8(vue@3.4.27(typescript@5.4.5)) vue: 3.4.27(typescript@5.4.5) - '@vue-flow/core@1.33.6(vue@3.4.27(typescript@5.4.5))': + '@vue-flow/core@1.33.8(vue@3.4.27(typescript@5.4.5))': dependencies: '@vueuse/core': 10.9.0(vue@3.4.27(typescript@5.4.5)) d3-drag: 3.0.0 @@ -7450,36 +7439,36 @@ snapshots: '@vue/babel-helper-vue-transform-on@1.2.2': {} - '@vue/babel-plugin-jsx@1.2.2(@babel/core@7.24.5)': + '@vue/babel-plugin-jsx@1.2.2(@babel/core@7.24.6)': dependencies: '@babel/helper-module-imports': 7.22.15 - '@babel/helper-plugin-utils': 7.24.5 - '@babel/plugin-syntax-jsx': 7.24.1(@babel/core@7.24.5) - '@babel/template': 7.24.0 - '@babel/traverse': 7.24.5 - '@babel/types': 7.24.5 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/plugin-syntax-jsx': 7.24.6(@babel/core@7.24.6) + '@babel/template': 7.24.6 + '@babel/traverse': 7.24.6 + '@babel/types': 7.24.6 '@vue/babel-helper-vue-transform-on': 1.2.2 - '@vue/babel-plugin-resolve-type': 1.2.2(@babel/core@7.24.5) + '@vue/babel-plugin-resolve-type': 1.2.2(@babel/core@7.24.6) camelcase: 6.3.0 html-tags: 3.3.1 svg-tags: 1.0.0 optionalDependencies: - '@babel/core': 7.24.5 + '@babel/core': 7.24.6 transitivePeerDependencies: - supports-color - '@vue/babel-plugin-resolve-type@1.2.2(@babel/core@7.24.5)': + '@vue/babel-plugin-resolve-type@1.2.2(@babel/core@7.24.6)': dependencies: - '@babel/code-frame': 7.24.2 - '@babel/core': 7.24.5 + '@babel/code-frame': 7.24.6 + '@babel/core': 7.24.6 '@babel/helper-module-imports': 7.22.15 - '@babel/helper-plugin-utils': 7.24.5 - '@babel/parser': 7.24.5 + '@babel/helper-plugin-utils': 7.24.6 + '@babel/parser': 7.24.6 '@vue/compiler-sfc': 3.4.27 '@vue/compiler-core@3.4.27': dependencies: - '@babel/parser': 7.24.5 + '@babel/parser': 7.24.6 '@vue/shared': 3.4.27 entities: 4.5.0 estree-walker: 2.0.2 @@ -7492,7 +7481,7 @@ snapshots: '@vue/compiler-sfc@3.4.27': dependencies: - '@babel/parser': 7.24.5 + '@babel/parser': 7.24.6 '@vue/compiler-core': 3.4.27 '@vue/compiler-dom': 3.4.27 '@vue/compiler-ssr': 3.4.27 @@ -7581,7 +7570,7 @@ snapshots: '@vueuse/metadata@9.13.0': {} - '@vueuse/motion@2.1.0(rollup@4.17.2)(vue@3.4.27(typescript@5.4.5))': + '@vueuse/motion@2.1.0(rollup@4.18.0)(vue@3.4.27(typescript@5.4.5))': dependencies: '@vueuse/core': 10.9.0(vue@3.4.27(typescript@5.4.5)) '@vueuse/shared': 10.9.0(vue@3.4.27(typescript@5.4.5)) @@ -7591,7 +7580,7 @@ snapshots: style-value-types: 5.1.2 vue: 3.4.27(typescript@5.4.5) optionalDependencies: - '@nuxt/kit': 3.11.2(rollup@4.17.2) + '@nuxt/kit': 3.11.2(rollup@4.18.0) transitivePeerDependencies: - '@vue/composition-api' - rollup @@ -7782,7 +7771,7 @@ snapshots: json-schema-traverse: 0.4.1 uri-js: 4.4.1 - ajv@8.13.0: + ajv@8.14.0: dependencies: fast-deep-equal: 3.1.3 json-schema-traverse: 1.0.0 @@ -7860,10 +7849,10 @@ snapshots: autoprefixer@10.4.19(postcss@8.4.38): dependencies: browserslist: 4.23.0 - caniuse-lite: 1.0.30001617 + caniuse-lite: 1.0.30001623 fraction.js: 4.3.7 normalize-range: 0.1.2 - picocolors: 1.0.0 + picocolors: 1.0.1 postcss: 8.4.38 postcss-value-parser: 4.2.0 @@ -7874,7 +7863,7 @@ snapshots: transitivePeerDependencies: - debug - axios@1.6.8: + axios@1.7.2: dependencies: follow-redirects: 1.15.6 form-data: 4.0.0 @@ -7882,14 +7871,14 @@ snapshots: transitivePeerDependencies: - debug - babel-jest@27.5.1(@babel/core@7.24.5): + babel-jest@27.5.1(@babel/core@7.24.6): dependencies: - '@babel/core': 7.24.5 + '@babel/core': 7.24.6 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 '@types/babel__core': 7.20.5 babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 27.5.1(@babel/core@7.24.5) + babel-preset-jest: 27.5.1(@babel/core@7.24.6) chalk: 4.1.2 graceful-fs: 4.2.11 slash: 3.0.0 @@ -7898,7 +7887,7 @@ snapshots: babel-plugin-istanbul@6.1.1: dependencies: - '@babel/helper-plugin-utils': 7.24.5 + '@babel/helper-plugin-utils': 7.24.6 '@istanbuljs/load-nyc-config': 1.1.0 '@istanbuljs/schema': 0.1.3 istanbul-lib-instrument: 5.2.1 @@ -7908,32 +7897,32 @@ snapshots: babel-plugin-jest-hoist@27.5.1: dependencies: - '@babel/template': 7.24.0 - '@babel/types': 7.24.5 + '@babel/template': 7.24.6 + '@babel/types': 7.24.6 '@types/babel__core': 7.20.5 - '@types/babel__traverse': 7.20.5 + '@types/babel__traverse': 7.20.6 - babel-preset-current-node-syntax@1.0.1(@babel/core@7.24.5): + babel-preset-current-node-syntax@1.0.1(@babel/core@7.24.6): dependencies: - '@babel/core': 7.24.5 - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.5) - '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.24.5) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.5) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.24.5) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.5) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.5) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.5) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.5) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.5) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.5) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.5) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.5) + '@babel/core': 7.24.6 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.24.6) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.24.6) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.24.6) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.24.6) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.24.6) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.24.6) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.24.6) - babel-preset-jest@27.5.1(@babel/core@7.24.5): + babel-preset-jest@27.5.1(@babel/core@7.24.6): dependencies: - '@babel/core': 7.24.5 + '@babel/core': 7.24.6 babel-plugin-jest-hoist: 27.5.1 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.5) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.6) balanced-match@1.0.2: {} @@ -7971,18 +7960,18 @@ snapshots: dependencies: balanced-match: 1.0.2 - braces@3.0.2: + braces@3.0.3: dependencies: - fill-range: 7.0.1 + fill-range: 7.1.1 browser-process-hrtime@1.0.0: {} browserslist@4.23.0: dependencies: - caniuse-lite: 1.0.30001617 - electron-to-chromium: 1.4.763 + caniuse-lite: 1.0.30001623 + electron-to-chromium: 1.4.783 node-releases: 2.0.14 - update-browserslist-db: 1.0.15(browserslist@4.23.0) + update-browserslist-db: 1.0.16(browserslist@4.23.0) bser@2.1.1: dependencies: @@ -8047,11 +8036,11 @@ snapshots: caniuse-api@3.0.0: dependencies: browserslist: 4.23.0 - caniuse-lite: 1.0.30001617 + caniuse-lite: 1.0.30001623 lodash.memoize: 4.1.2 lodash.uniq: 4.5.0 - caniuse-lite@1.0.30001617: {} + caniuse-lite@1.0.30001623: {} canvas@2.11.2: dependencies: @@ -8090,7 +8079,7 @@ snapshots: chokidar@3.6.0: dependencies: anymatch: 3.1.3 - braces: 3.0.2 + braces: 3.0.3 glob-parent: 5.1.2 is-binary-path: 2.1.0 is-glob: 4.0.3 @@ -8189,7 +8178,7 @@ snapshots: dependencies: delayed-stream: 1.0.0 - commander@11.1.0: {} + commander@12.1.0: {} commander@4.1.1: {} @@ -8200,10 +8189,10 @@ snapshots: leven: 2.1.0 minimist: 1.2.8 - commitizen@4.3.0(@types/node@20.12.11)(typescript@5.4.5): + commitizen@4.3.0(@types/node@20.12.12)(typescript@5.4.5): dependencies: cachedir: 2.3.0 - cz-conventional-changelog: 3.3.0(@types/node@20.12.11)(typescript@5.4.5) + cz-conventional-changelog: 3.3.0(@types/node@20.12.12)(typescript@5.4.5) dedent: 0.7.0 detect-indent: 6.1.0 find-node-modules: 2.1.3 @@ -8286,18 +8275,18 @@ snapshots: convert-source-map@2.0.0: {} - core-js@3.37.0: {} + core-js@3.37.1: {} cosmiconfig-typescript-loader@4.4.0(@types/node@20.5.1)(cosmiconfig@8.3.6(typescript@5.4.5))(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.4.5))(typescript@5.4.5): dependencies: '@types/node': 20.5.1 cosmiconfig: 8.3.6(typescript@5.4.5) - ts-node: 10.9.2(@types/node@20.12.11)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@20.12.12)(typescript@5.4.5) typescript: 5.4.5 - cosmiconfig-typescript-loader@5.0.0(@types/node@20.12.11)(cosmiconfig@9.0.0(typescript@5.4.5))(typescript@5.4.5): + cosmiconfig-typescript-loader@5.0.0(@types/node@20.12.12)(cosmiconfig@9.0.0(typescript@5.4.5))(typescript@5.4.5): dependencies: - '@types/node': 20.12.11 + '@types/node': 20.12.12 cosmiconfig: 9.0.0(typescript@5.4.5) jiti: 1.21.0 typescript: 5.4.5 @@ -8491,21 +8480,21 @@ snapshots: csstype@3.1.3: {} - cz-conventional-changelog@3.3.0(@types/node@20.12.11)(typescript@5.4.5): + cz-conventional-changelog@3.3.0(@types/node@20.12.12)(typescript@5.4.5): dependencies: chalk: 2.4.2 - commitizen: 4.3.0(@types/node@20.12.11)(typescript@5.4.5) + commitizen: 4.3.0(@types/node@20.12.12)(typescript@5.4.5) conventional-commit-types: 3.0.0 lodash.map: 4.6.0 longest: 2.0.1 word-wrap: 1.2.5 optionalDependencies: - '@commitlint/load': 19.2.0(@types/node@20.12.11)(typescript@5.4.5) + '@commitlint/load': 19.2.0(@types/node@20.12.12)(typescript@5.4.5) transitivePeerDependencies: - '@types/node' - typescript - cz-git@1.9.1: {} + cz-git@1.9.2: {} d3-color@3.1.0: {} @@ -8655,7 +8644,7 @@ snapshots: domhandler: 5.0.3 entities: 4.5.0 - dom-zindex@1.0.2: {} + dom-zindex@1.0.4: {} dom7@3.0.0: dependencies: @@ -8712,14 +8701,14 @@ snapshots: el-table-infinite-scroll@3.0.3(typescript@5.4.5): dependencies: - core-js: 3.37.0 + core-js: 3.37.1 element-plus: 2.7.1(vue@3.4.27(typescript@5.4.5)) vue: 3.4.27(typescript@5.4.5) transitivePeerDependencies: - '@vue/composition-api' - typescript - electron-to-chromium@1.4.763: {} + electron-to-chromium@1.4.783: {} element-plus@2.1.4(@types/lodash-es@4.17.12)(vue@3.4.27(typescript@5.4.5)): dependencies: @@ -8746,7 +8735,7 @@ snapshots: '@element-plus/icons-vue': 2.3.1(vue@3.4.27(typescript@5.4.5)) '@floating-ui/dom': 1.6.5 '@popperjs/core': '@sxzz/popperjs-es@2.11.7' - '@types/lodash': 4.17.1 + '@types/lodash': 4.17.4 '@types/lodash-es': 4.17.12 '@vueuse/core': 9.13.0(vue@3.4.27(typescript@5.4.5)) async-validator: 4.2.5 @@ -8882,31 +8871,31 @@ snapshots: optionalDependencies: source-map: 0.6.1 - eslint-config-prettier@9.1.0(eslint@9.2.0): + eslint-config-prettier@9.1.0(eslint@9.3.0): dependencies: - eslint: 9.2.0 + eslint: 9.3.0 eslint-define-config@2.1.0: {} - eslint-plugin-prettier@5.1.3(eslint-config-prettier@9.1.0(eslint@9.2.0))(eslint@9.2.0)(prettier@3.2.5): + eslint-plugin-prettier@5.1.3(eslint-config-prettier@9.1.0(eslint@9.3.0))(eslint@9.3.0)(prettier@3.2.5): dependencies: - eslint: 9.2.0 + eslint: 9.3.0 prettier: 3.2.5 prettier-linter-helpers: 1.0.0 synckit: 0.8.8 optionalDependencies: - eslint-config-prettier: 9.1.0(eslint@9.2.0) + eslint-config-prettier: 9.1.0(eslint@9.3.0) - eslint-plugin-vue@9.26.0(eslint@9.2.0): + eslint-plugin-vue@9.26.0(eslint@9.3.0): dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.2.0) - eslint: 9.2.0 + '@eslint-community/eslint-utils': 4.4.0(eslint@9.3.0) + eslint: 9.3.0 globals: 13.24.0 natural-compare: 1.4.0 nth-check: 2.1.1 - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.0 semver: 7.6.2 - vue-eslint-parser: 9.4.2(eslint@9.2.0) + vue-eslint-parser: 9.4.2(eslint@9.3.0) xml-name-validator: 4.0.0 transitivePeerDependencies: - supports-color @@ -8925,15 +8914,15 @@ snapshots: eslint-visitor-keys@4.0.0: {} - eslint@9.2.0: + eslint@9.3.0: dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@9.2.0) + '@eslint-community/eslint-utils': 4.4.0(eslint@9.3.0) '@eslint-community/regexpp': 4.10.0 - '@eslint/eslintrc': 3.0.2 - '@eslint/js': 9.2.0 + '@eslint/eslintrc': 3.1.0 + '@eslint/js': 9.3.0 '@humanwhocodes/config-array': 0.13.0 '@humanwhocodes/module-importer': 1.0.1 - '@humanwhocodes/retry': 0.2.4 + '@humanwhocodes/retry': 0.3.0 '@nodelib/fs.walk': 1.2.8 ajv: 6.12.6 chalk: 4.1.2 @@ -9070,7 +9059,7 @@ snapshots: '@nodelib/fs.walk': 1.2.8 glob-parent: 5.1.2 merge2: 1.4.1 - micromatch: 4.0.5 + micromatch: 4.0.7 fast-json-stable-stringify@2.1.0: {} @@ -9094,7 +9083,7 @@ snapshots: dependencies: flat-cache: 4.0.1 - fill-range@7.0.1: + fill-range@7.1.1: dependencies: to-regex-range: 5.0.1 @@ -9125,7 +9114,7 @@ snapshots: dependencies: detect-file: 1.0.0 is-glob: 4.0.3 - micromatch: 4.0.5 + micromatch: 4.0.7 resolve-dir: 1.0.1 flat-cache@4.0.1: @@ -9264,13 +9253,13 @@ snapshots: dependencies: is-glob: 4.0.3 - glob@10.3.14: + glob@10.4.1: dependencies: foreground-child: 3.1.1 - jackspeak: 2.3.6 + jackspeak: 3.1.2 minimatch: 9.0.4 - minipass: 7.1.1 - path-scurry: 1.11.0 + minipass: 7.1.2 + path-scurry: 1.11.1 glob@7.2.3: dependencies: @@ -9445,7 +9434,7 @@ snapshots: i18next@20.6.1: dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.6 iconv-lite@0.4.24: dependencies: @@ -9459,7 +9448,7 @@ snapshots: immer@9.0.21: {} - immutable@4.3.5: {} + immutable@4.3.6: {} import-fresh@3.3.0: dependencies: @@ -9599,8 +9588,8 @@ snapshots: istanbul-lib-instrument@5.2.1: dependencies: - '@babel/core': 7.24.5 - '@babel/parser': 7.24.5 + '@babel/core': 7.24.6 + '@babel/parser': 7.24.6 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 semver: 6.3.1 @@ -9626,7 +9615,7 @@ snapshots: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 - jackspeak@2.3.6: + jackspeak@3.1.2: dependencies: '@isaacs/cliui': 8.0.2 optionalDependencies: @@ -9643,7 +9632,7 @@ snapshots: '@jest/environment': 27.5.1 '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.12.11 + '@types/node': 20.12.12 chalk: 4.1.2 co: 4.6.0 dedent: 0.7.0 @@ -9685,10 +9674,10 @@ snapshots: jest-config@27.5.1(canvas@2.11.2)(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.4.5)): dependencies: - '@babel/core': 7.24.5 + '@babel/core': 7.24.6 '@jest/test-sequencer': 27.5.1 '@jest/types': 27.5.1 - babel-jest: 27.5.1(@babel/core@7.24.5) + babel-jest: 27.5.1(@babel/core@7.24.6) chalk: 4.1.2 ci-info: 3.9.0 deepmerge: 4.3.1 @@ -9704,13 +9693,13 @@ snapshots: jest-runner: 27.5.1(canvas@2.11.2) jest-util: 27.5.1 jest-validate: 27.5.1 - micromatch: 4.0.5 + micromatch: 4.0.7 parse-json: 5.2.0 pretty-format: 27.5.1 slash: 3.0.0 strip-json-comments: 3.1.1 optionalDependencies: - ts-node: 10.9.2(@types/node@20.12.11)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@20.12.12)(typescript@5.4.5) transitivePeerDependencies: - bufferutil - canvas @@ -9741,7 +9730,7 @@ snapshots: '@jest/environment': 27.5.1 '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.12.11 + '@types/node': 20.12.12 jest-mock: 27.5.1 jest-util: 27.5.1 jsdom: 16.7.0(canvas@2.11.2) @@ -9756,7 +9745,7 @@ snapshots: '@jest/environment': 27.5.1 '@jest/fake-timers': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.12.11 + '@types/node': 20.12.12 jest-mock: 27.5.1 jest-util: 27.5.1 @@ -9766,7 +9755,7 @@ snapshots: dependencies: '@jest/types': 27.5.1 '@types/graceful-fs': 4.1.9 - '@types/node': 20.12.11 + '@types/node': 20.12.12 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -9774,7 +9763,7 @@ snapshots: jest-serializer: 27.5.1 jest-util: 27.5.1 jest-worker: 27.5.1 - micromatch: 4.0.5 + micromatch: 4.0.7 walker: 1.0.8 optionalDependencies: fsevents: 2.3.3 @@ -9785,7 +9774,7 @@ snapshots: '@jest/source-map': 27.5.1 '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.12.11 + '@types/node': 20.12.12 chalk: 4.1.2 co: 4.6.0 expect: 27.5.1 @@ -9815,12 +9804,12 @@ snapshots: jest-message-util@27.5.1: dependencies: - '@babel/code-frame': 7.24.2 + '@babel/code-frame': 7.24.6 '@jest/types': 27.5.1 '@types/stack-utils': 2.0.3 chalk: 4.1.2 graceful-fs: 4.2.11 - micromatch: 4.0.5 + micromatch: 4.0.7 pretty-format: 27.5.1 slash: 3.0.0 stack-utils: 2.0.6 @@ -9828,7 +9817,7 @@ snapshots: jest-mock@27.5.1: dependencies: '@jest/types': 27.5.1 - '@types/node': 20.12.11 + '@types/node': 20.12.12 jest-pnp-resolver@1.2.3(jest-resolve@27.5.1): optionalDependencies: @@ -9864,7 +9853,7 @@ snapshots: '@jest/test-result': 27.5.1 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.12.11 + '@types/node': 20.12.12 chalk: 4.1.2 emittery: 0.8.1 graceful-fs: 4.2.11 @@ -9915,21 +9904,21 @@ snapshots: jest-serializer@27.5.1: dependencies: - '@types/node': 20.12.11 + '@types/node': 20.12.12 graceful-fs: 4.2.11 jest-snapshot@27.5.1: dependencies: - '@babel/core': 7.24.5 - '@babel/generator': 7.24.5 - '@babel/plugin-syntax-typescript': 7.24.1(@babel/core@7.24.5) - '@babel/traverse': 7.24.5 - '@babel/types': 7.24.5 + '@babel/core': 7.24.6 + '@babel/generator': 7.24.6 + '@babel/plugin-syntax-typescript': 7.24.6(@babel/core@7.24.6) + '@babel/traverse': 7.24.6 + '@babel/types': 7.24.6 '@jest/transform': 27.5.1 '@jest/types': 27.5.1 - '@types/babel__traverse': 7.20.5 + '@types/babel__traverse': 7.20.6 '@types/prettier': 2.7.3 - babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.5) + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.24.6) chalk: 4.1.2 expect: 27.5.1 graceful-fs: 4.2.11 @@ -9948,7 +9937,7 @@ snapshots: jest-util@27.5.1: dependencies: '@jest/types': 27.5.1 - '@types/node': 20.12.11 + '@types/node': 20.12.12 chalk: 4.1.2 ci-info: 3.9.0 graceful-fs: 4.2.11 @@ -9967,7 +9956,7 @@ snapshots: dependencies: '@jest/test-result': 27.5.1 '@jest/types': 27.5.1 - '@types/node': 20.12.11 + '@types/node': 20.12.12 ansi-escapes: 4.3.2 chalk: 4.1.2 jest-util: 27.5.1 @@ -9975,7 +9964,7 @@ snapshots: jest-worker@27.5.1: dependencies: - '@types/node': 20.12.11 + '@types/node': 20.12.12 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -10028,7 +10017,7 @@ snapshots: http-proxy-agent: 4.0.1 https-proxy-agent: 5.0.1 is-potential-custom-element-name: 1.0.1 - nwsapi: 2.2.9 + nwsapi: 2.2.10 parse5: 6.0.1 saxes: 5.0.1 symbol-tree: 3.2.4 @@ -10090,6 +10079,8 @@ snapshots: known-css-properties@0.30.0: {} + known-css-properties@0.31.0: {} + leven@2.1.0: {} leven@3.1.0: {} @@ -10105,28 +10096,26 @@ snapshots: lilconfig@2.1.0: {} - lilconfig@3.0.0: {} - lilconfig@3.1.1: {} lines-and-columns@1.2.4: {} - lint-staged@15.2.2: + lint-staged@15.2.5: dependencies: chalk: 5.3.0 - commander: 11.1.0 + commander: 12.1.0 debug: 4.3.4 execa: 8.0.1 - lilconfig: 3.0.0 - listr2: 8.0.1 - micromatch: 4.0.5 + lilconfig: 3.1.1 + listr2: 8.2.1 + micromatch: 4.0.7 pidtree: 0.6.0 string-argv: 0.3.2 - yaml: 2.3.4 + yaml: 2.4.2 transitivePeerDependencies: - supports-color - listr2@8.0.1: + listr2@8.2.1: dependencies: cli-truncate: 4.0.0 colorette: 2.0.20 @@ -10291,9 +10280,9 @@ snapshots: merge@2.1.1: {} - micromatch@4.0.5: + micromatch@4.0.7: dependencies: - braces: 3.0.2 + braces: 3.0.3 picomatch: 2.3.1 mime-db@1.52.0: {} @@ -10341,7 +10330,7 @@ snapshots: minipass@5.0.0: optional: true - minipass@7.1.1: {} + minipass@7.1.2: {} minizlib@2.1.2: dependencies: @@ -10493,7 +10482,7 @@ snapshots: transitivePeerDependencies: - supports-color - nwsapi@2.2.9: {} + nwsapi@2.2.10: {} nypm@0.3.8: dependencies: @@ -10586,7 +10575,7 @@ snapshots: parse-json@5.2.0: dependencies: - '@babel/code-frame': 7.24.2 + '@babel/code-frame': 7.24.6 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -10609,10 +10598,10 @@ snapshots: path-parse@1.0.7: {} - path-scurry@1.11.0: + path-scurry@1.11.1: dependencies: lru-cache: 10.2.2 - minipass: 7.1.1 + minipass: 7.1.2 path-to-regexp@6.2.2: {} @@ -10642,7 +10631,7 @@ snapshots: perfect-debounce@1.0.0: optional: true - picocolors@1.0.0: {} + picocolors@1.0.1: {} picomatch@2.3.1: {} @@ -10650,6 +10639,10 @@ snapshots: pify@2.3.0: {} + pinia-plugin-persistedstate@3.2.1(pinia@2.1.7(typescript@5.4.5)(vue@3.4.27(typescript@5.4.5))): + dependencies: + pinia: 2.1.7(typescript@5.4.5)(vue@3.4.27(typescript@5.4.5)) + pinia@2.1.7(typescript@5.4.5)(vue@3.4.27(typescript@5.4.5)): dependencies: '@vue/devtools-api': 6.6.1 @@ -10658,7 +10651,7 @@ snapshots: optionalDependencies: typescript: 5.4.5 - pinyin-pro@3.20.4: {} + pinyin-pro@3.21.0: {} pirates@4.0.6: {} @@ -10672,7 +10665,7 @@ snapshots: mlly: 1.7.0 pathe: 1.1.2 - plus-pro-components@0.1.3(element-plus@2.7.1(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)): + plus-pro-components@0.1.6(element-plus@2.7.1(vue@3.4.27(typescript@5.4.5)))(vue@3.4.27(typescript@5.4.5)): dependencies: '@element-plus/icons-vue': 2.3.1(vue@3.4.27(typescript@5.4.5)) element-plus: 2.7.1(vue@3.4.27(typescript@5.4.5)) @@ -10692,13 +10685,13 @@ snapshots: postcss-calc@10.0.0(postcss@8.4.38): dependencies: postcss: 8.4.38 - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.0 postcss-value-parser: 4.2.0 postcss-calc@8.2.4(postcss@8.4.38): dependencies: postcss: 8.4.38 - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.0 postcss-value-parser: 4.2.0 postcss-colormin@5.3.1(postcss@8.4.38): @@ -10793,7 +10786,7 @@ snapshots: yaml: 2.4.2 optionalDependencies: postcss: 8.4.38 - ts-node: 10.9.2(@types/node@20.12.11)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@20.12.12)(typescript@5.4.5) postcss-media-query-parser@0.2.3: {} @@ -10815,7 +10808,7 @@ snapshots: caniuse-api: 3.0.0 cssnano-utils: 3.1.0(postcss@8.4.38) postcss: 8.4.38 - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.0 postcss-merge-rules@7.0.0(postcss@8.4.38): dependencies: @@ -10823,7 +10816,7 @@ snapshots: caniuse-api: 3.0.0 cssnano-utils: 5.0.0(postcss@8.4.38) postcss: 8.4.38 - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.0 postcss-minify-font-values@5.1.0(postcss@8.4.38): dependencies: @@ -10866,17 +10859,17 @@ snapshots: postcss-minify-selectors@5.2.1(postcss@8.4.38): dependencies: postcss: 8.4.38 - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.0 postcss-minify-selectors@7.0.0(postcss@8.4.38): dependencies: postcss: 8.4.38 - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.0 postcss-nested@6.0.1(postcss@8.4.38): dependencies: postcss: 8.4.38 - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.0 postcss-normalize-charset@5.1.0(postcss@8.4.38): dependencies: @@ -11017,7 +11010,7 @@ snapshots: dependencies: postcss: 8.4.38 - postcss-selector-parser@6.0.16: + postcss-selector-parser@6.1.0: dependencies: cssesc: 3.0.0 util-deprecate: 1.0.2 @@ -11041,22 +11034,22 @@ snapshots: postcss-unique-selectors@5.1.1(postcss@8.4.38): dependencies: postcss: 8.4.38 - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.0 postcss-unique-selectors@7.0.0(postcss@8.4.38): dependencies: postcss: 8.4.38 - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.0 postcss-value-parser@4.2.0: {} postcss@8.4.38: dependencies: nanoid: 3.3.7 - picocolors: 1.0.0 + picocolors: 1.0.1 source-map-js: 1.2.0 - preact@10.21.0: {} + preact@10.22.0: {} prelude-ls@1.2.1: {} @@ -11212,47 +11205,47 @@ snapshots: dependencies: glob: 7.2.3 - rimraf@5.0.6: + rimraf@5.0.7: dependencies: - glob: 10.3.14 + glob: 10.4.1 - rollup-plugin-external-globals@0.6.1(rollup@4.17.2): + rollup-plugin-external-globals@0.6.1(rollup@4.18.0): dependencies: '@rollup/pluginutils': 4.2.1 estree-walker: 2.0.2 is-reference: 1.2.1 magic-string: 0.25.9 - rollup: 4.17.2 + rollup: 4.18.0 - rollup-plugin-visualizer@5.12.0(rollup@4.17.2): + rollup-plugin-visualizer@5.12.0(rollup@4.18.0): dependencies: open: 8.4.2 picomatch: 2.3.1 source-map: 0.7.4 yargs: 17.7.2 optionalDependencies: - rollup: 4.17.2 + rollup: 4.18.0 - rollup@4.17.2: + rollup@4.18.0: dependencies: '@types/estree': 1.0.5 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.17.2 - '@rollup/rollup-android-arm64': 4.17.2 - '@rollup/rollup-darwin-arm64': 4.17.2 - '@rollup/rollup-darwin-x64': 4.17.2 - '@rollup/rollup-linux-arm-gnueabihf': 4.17.2 - '@rollup/rollup-linux-arm-musleabihf': 4.17.2 - '@rollup/rollup-linux-arm64-gnu': 4.17.2 - '@rollup/rollup-linux-arm64-musl': 4.17.2 - '@rollup/rollup-linux-powerpc64le-gnu': 4.17.2 - '@rollup/rollup-linux-riscv64-gnu': 4.17.2 - '@rollup/rollup-linux-s390x-gnu': 4.17.2 - '@rollup/rollup-linux-x64-gnu': 4.17.2 - '@rollup/rollup-linux-x64-musl': 4.17.2 - '@rollup/rollup-win32-arm64-msvc': 4.17.2 - '@rollup/rollup-win32-ia32-msvc': 4.17.2 - '@rollup/rollup-win32-x64-msvc': 4.17.2 + '@rollup/rollup-android-arm-eabi': 4.18.0 + '@rollup/rollup-android-arm64': 4.18.0 + '@rollup/rollup-darwin-arm64': 4.18.0 + '@rollup/rollup-darwin-x64': 4.18.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.18.0 + '@rollup/rollup-linux-arm-musleabihf': 4.18.0 + '@rollup/rollup-linux-arm64-gnu': 4.18.0 + '@rollup/rollup-linux-arm64-musl': 4.18.0 + '@rollup/rollup-linux-powerpc64le-gnu': 4.18.0 + '@rollup/rollup-linux-riscv64-gnu': 4.18.0 + '@rollup/rollup-linux-s390x-gnu': 4.18.0 + '@rollup/rollup-linux-x64-gnu': 4.18.0 + '@rollup/rollup-linux-x64-musl': 4.18.0 + '@rollup/rollup-win32-arm64-msvc': 4.18.0 + '@rollup/rollup-win32-ia32-msvc': 4.18.0 + '@rollup/rollup-win32-x64-msvc': 4.18.0 fsevents: 2.3.3 run-async@2.4.1: {} @@ -11269,10 +11262,10 @@ snapshots: safer-buffer@2.1.2: {} - sass@1.77.1: + sass@1.77.2: dependencies: chokidar: 3.6.0 - immutable: 4.3.5 + immutable: 4.3.6 source-map-js: 1.2.0 saxes@5.0.1: @@ -11394,16 +11387,16 @@ snapshots: spdx-correct@3.2.0: dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.17 + spdx-license-ids: 3.0.18 spdx-exceptions@2.5.0: {} spdx-expression-parse@3.0.1: dependencies: spdx-exceptions: 2.5.0 - spdx-license-ids: 3.0.17 + spdx-license-ids: 3.0.18 - spdx-license-ids@3.0.17: {} + spdx-license-ids@3.0.18: {} split2@3.2.2: dependencies: @@ -11481,9 +11474,9 @@ snapshots: strip-json-comments@3.1.1: {} - strip-literal@1.3.0: + strip-literal@2.1.0: dependencies: - acorn: 8.11.3 + js-tokens: 9.0.0 optional: true style-value-types@5.1.2: @@ -11495,85 +11488,85 @@ snapshots: dependencies: browserslist: 4.23.0 postcss: 8.4.38 - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.0 stylehacks@7.0.0(postcss@8.4.38): dependencies: browserslist: 4.23.0 postcss: 8.4.38 - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.0 - stylelint-config-html@1.1.0(postcss-html@1.7.0)(stylelint@16.5.0(typescript@5.4.5)): + stylelint-config-html@1.1.0(postcss-html@1.7.0)(stylelint@16.6.0(typescript@5.4.5)): dependencies: postcss-html: 1.7.0 - stylelint: 16.5.0(typescript@5.4.5) + stylelint: 16.6.0(typescript@5.4.5) - stylelint-config-recess-order@5.0.1(stylelint@16.5.0(typescript@5.4.5)): + stylelint-config-recess-order@5.0.1(stylelint@16.6.0(typescript@5.4.5)): dependencies: - stylelint: 16.5.0(typescript@5.4.5) - stylelint-order: 6.0.4(stylelint@16.5.0(typescript@5.4.5)) + stylelint: 16.6.0(typescript@5.4.5) + stylelint-order: 6.0.4(stylelint@16.6.0(typescript@5.4.5)) - stylelint-config-recommended-scss@14.0.0(postcss@8.4.38)(stylelint@16.5.0(typescript@5.4.5)): + stylelint-config-recommended-scss@14.0.0(postcss@8.4.38)(stylelint@16.6.0(typescript@5.4.5)): dependencies: postcss-scss: 4.0.9(postcss@8.4.38) - stylelint: 16.5.0(typescript@5.4.5) - stylelint-config-recommended: 14.0.0(stylelint@16.5.0(typescript@5.4.5)) - stylelint-scss: 6.3.0(stylelint@16.5.0(typescript@5.4.5)) + stylelint: 16.6.0(typescript@5.4.5) + stylelint-config-recommended: 14.0.0(stylelint@16.6.0(typescript@5.4.5)) + stylelint-scss: 6.3.0(stylelint@16.6.0(typescript@5.4.5)) optionalDependencies: postcss: 8.4.38 - stylelint-config-recommended-vue@1.5.0(postcss-html@1.7.0)(stylelint@16.5.0(typescript@5.4.5)): + stylelint-config-recommended-vue@1.5.0(postcss-html@1.7.0)(stylelint@16.6.0(typescript@5.4.5)): dependencies: postcss-html: 1.7.0 semver: 7.6.2 - stylelint: 16.5.0(typescript@5.4.5) - stylelint-config-html: 1.1.0(postcss-html@1.7.0)(stylelint@16.5.0(typescript@5.4.5)) - stylelint-config-recommended: 14.0.0(stylelint@16.5.0(typescript@5.4.5)) + stylelint: 16.6.0(typescript@5.4.5) + stylelint-config-html: 1.1.0(postcss-html@1.7.0)(stylelint@16.6.0(typescript@5.4.5)) + stylelint-config-recommended: 14.0.0(stylelint@16.6.0(typescript@5.4.5)) - stylelint-config-recommended@14.0.0(stylelint@16.5.0(typescript@5.4.5)): + stylelint-config-recommended@14.0.0(stylelint@16.6.0(typescript@5.4.5)): dependencies: - stylelint: 16.5.0(typescript@5.4.5) + stylelint: 16.6.0(typescript@5.4.5) - stylelint-config-standard-scss@13.1.0(postcss@8.4.38)(stylelint@16.5.0(typescript@5.4.5)): + stylelint-config-standard-scss@13.1.0(postcss@8.4.38)(stylelint@16.6.0(typescript@5.4.5)): dependencies: - stylelint: 16.5.0(typescript@5.4.5) - stylelint-config-recommended-scss: 14.0.0(postcss@8.4.38)(stylelint@16.5.0(typescript@5.4.5)) - stylelint-config-standard: 36.0.0(stylelint@16.5.0(typescript@5.4.5)) + stylelint: 16.6.0(typescript@5.4.5) + stylelint-config-recommended-scss: 14.0.0(postcss@8.4.38)(stylelint@16.6.0(typescript@5.4.5)) + stylelint-config-standard: 36.0.0(stylelint@16.6.0(typescript@5.4.5)) optionalDependencies: postcss: 8.4.38 - stylelint-config-standard@36.0.0(stylelint@16.5.0(typescript@5.4.5)): + stylelint-config-standard@36.0.0(stylelint@16.6.0(typescript@5.4.5)): dependencies: - stylelint: 16.5.0(typescript@5.4.5) - stylelint-config-recommended: 14.0.0(stylelint@16.5.0(typescript@5.4.5)) + stylelint: 16.6.0(typescript@5.4.5) + stylelint-config-recommended: 14.0.0(stylelint@16.6.0(typescript@5.4.5)) - stylelint-order@6.0.4(stylelint@16.5.0(typescript@5.4.5)): + stylelint-order@6.0.4(stylelint@16.6.0(typescript@5.4.5)): dependencies: postcss: 8.4.38 postcss-sorting: 8.0.2(postcss@8.4.38) - stylelint: 16.5.0(typescript@5.4.5) + stylelint: 16.6.0(typescript@5.4.5) - stylelint-prettier@5.0.0(prettier@3.2.5)(stylelint@16.5.0(typescript@5.4.5)): + stylelint-prettier@5.0.0(prettier@3.2.5)(stylelint@16.6.0(typescript@5.4.5)): dependencies: prettier: 3.2.5 prettier-linter-helpers: 1.0.0 - stylelint: 16.5.0(typescript@5.4.5) + stylelint: 16.6.0(typescript@5.4.5) - stylelint-scss@6.3.0(stylelint@16.5.0(typescript@5.4.5)): + stylelint-scss@6.3.0(stylelint@16.6.0(typescript@5.4.5)): dependencies: known-css-properties: 0.30.0 postcss-media-query-parser: 0.2.3 postcss-resolve-nested-selector: 0.1.1 - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.0 postcss-value-parser: 4.2.0 - stylelint: 16.5.0(typescript@5.4.5) + stylelint: 16.6.0(typescript@5.4.5) - stylelint@16.5.0(typescript@5.4.5): + stylelint@16.6.0(typescript@5.4.5): dependencies: '@csstools/css-parser-algorithms': 2.6.3(@csstools/css-tokenizer@2.3.1) '@csstools/css-tokenizer': 2.3.1 '@csstools/media-query-list-parser': 2.1.11(@csstools/css-parser-algorithms@2.6.3(@csstools/css-tokenizer@2.3.1))(@csstools/css-tokenizer@2.3.1) - '@csstools/selector-specificity': 3.1.0(postcss-selector-parser@6.0.16) + '@csstools/selector-specificity': 3.1.1(postcss-selector-parser@6.1.0) '@dual-bundle/import-meta-resolve': 4.1.0 balanced-match: 2.0.0 colord: 2.9.3 @@ -11591,16 +11584,16 @@ snapshots: ignore: 5.3.1 imurmurhash: 0.1.4 is-plain-object: 5.0.0 - known-css-properties: 0.30.0 + known-css-properties: 0.31.0 mathml-tag-names: 2.1.3 meow: 13.2.0 - micromatch: 4.0.5 + micromatch: 4.0.7 normalize-path: 3.0.0 - picocolors: 1.0.0 + picocolors: 1.0.1 postcss: 8.4.38 postcss-resolve-nested-selector: 0.1.1 postcss-safe-parser: 7.0.0(postcss@8.4.38) - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.0 postcss-value-parser: 4.2.0 resolve-from: 5.0.0 string-width: 4.2.3 @@ -11617,7 +11610,7 @@ snapshots: dependencies: '@jridgewell/gen-mapping': 0.3.5 commander: 4.1.1 - glob: 10.3.14 + glob: 10.4.1 lines-and-columns: 1.2.4 mz: 2.7.0 pirates: 4.0.6 @@ -11656,7 +11649,7 @@ snapshots: css-select: 4.3.0 css-tree: 1.1.3 csso: 4.2.0 - picocolors: 1.0.0 + picocolors: 1.0.1 stable: 0.1.8 svgo@3.3.2: @@ -11667,9 +11660,9 @@ snapshots: css-tree: 2.3.1 css-what: 6.1.0 csso: 5.0.5 - picocolors: 1.0.0 + picocolors: 1.0.1 - swiper@11.1.1: {} + swiper@11.1.3: {} symbol-tree@3.2.4: {} @@ -11680,7 +11673,7 @@ snapshots: table@6.8.2: dependencies: - ajv: 8.13.0 + ajv: 8.14.0 lodash.truncate: 4.4.2 slice-ansi: 4.0.0 string-width: 4.2.3 @@ -11698,16 +11691,16 @@ snapshots: is-glob: 4.0.3 jiti: 1.21.0 lilconfig: 2.1.0 - micromatch: 4.0.5 + micromatch: 4.0.7 normalize-path: 3.0.0 object-hash: 3.0.0 - picocolors: 1.0.0 + picocolors: 1.0.1 postcss: 8.4.38 postcss-import: 15.1.0(postcss@8.4.38) postcss-js: 4.0.1(postcss@8.4.38) postcss-load-config: 4.0.2(postcss@8.4.38)(ts-node@10.9.2(@types/node@20.5.1)(typescript@5.4.5)) postcss-nested: 6.0.1(postcss@8.4.38) - postcss-selector-parser: 6.0.16 + postcss-selector-parser: 6.1.0 resolve: 1.22.8 sucrase: 3.35.0 transitivePeerDependencies: @@ -11803,14 +11796,14 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-node@10.9.2(@types/node@20.12.11)(typescript@5.4.5): + ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.12.11 + '@types/node': 20.12.12 acorn: 8.11.3 acorn-walk: 8.3.2 arg: 4.1.3 @@ -11873,9 +11866,9 @@ snapshots: unicorn-magic@0.1.0: {} - unimport@3.7.1(rollup@4.17.2): + unimport@3.7.2(rollup@4.18.0): dependencies: - '@rollup/pluginutils': 5.1.0(rollup@4.17.2) + '@rollup/pluginutils': 5.1.0(rollup@4.18.0) acorn: 8.11.3 escape-string-regexp: 5.0.0 estree-walker: 3.0.3 @@ -11886,7 +11879,7 @@ snapshots: pathe: 1.1.2 pkg-types: 1.1.1 scule: 1.3.0 - strip-literal: 1.3.0 + strip-literal: 2.1.0 unplugin: 1.10.1 transitivePeerDependencies: - rollup @@ -11905,9 +11898,9 @@ snapshots: untyped@1.4.2: dependencies: - '@babel/core': 7.24.5 - '@babel/standalone': 7.24.5 - '@babel/types': 7.24.5 + '@babel/core': 7.24.6 + '@babel/standalone': 7.24.6 + '@babel/types': 7.24.6 defu: 6.1.4 jiti: 1.21.0 mri: 1.2.0 @@ -11916,11 +11909,11 @@ snapshots: - supports-color optional: true - update-browserslist-db@1.0.15(browserslist@4.23.0): + update-browserslist-db@1.0.16(browserslist@4.23.0): dependencies: browserslist: 4.23.0 escalade: 3.1.2 - picocolors: 1.0.0 + picocolors: 1.0.1 uri-js@4.4.1: dependencies: @@ -11965,18 +11958,18 @@ snapshots: transitivePeerDependencies: - debug - vite-plugin-cdn-import@0.3.5(rollup@4.17.2): + vite-plugin-cdn-import@0.3.5(rollup@4.18.0): dependencies: - rollup-plugin-external-globals: 0.6.1(rollup@4.17.2) + rollup-plugin-external-globals: 0.6.1(rollup@4.18.0) transitivePeerDependencies: - rollup - vite-plugin-compression@0.5.1(vite@5.2.11(@types/node@20.12.11)(sass@1.77.1)): + vite-plugin-compression@0.5.1(vite@5.2.11(@types/node@20.12.12)(sass@1.77.2)): dependencies: chalk: 4.1.2 debug: 4.3.4 fs-extra: 10.1.0 - vite: 5.2.11(@types/node@20.12.11)(sass@1.77.1) + vite: 5.2.11(@types/node@20.12.12)(sass@1.77.2) transitivePeerDependencies: - supports-color @@ -11986,7 +11979,7 @@ snapshots: chokidar: 3.6.0 fast-glob: 3.3.2 path-to-regexp: 6.2.2 - picocolors: 1.0.0 + picocolors: 1.0.1 vite-plugin-remove-console@2.2.0: {} @@ -11997,24 +11990,24 @@ snapshots: svgo: 3.3.2 vue: 3.4.27(typescript@5.4.5) - vite@5.2.11(@types/node@20.12.11)(sass@1.77.1): + vite@5.2.11(@types/node@20.12.12)(sass@1.77.2): dependencies: esbuild: 0.20.2 postcss: 8.4.38 - rollup: 4.17.2 + rollup: 4.18.0 optionalDependencies: - '@types/node': 20.12.11 + '@types/node': 20.12.12 fsevents: 2.3.3 - sass: 1.77.1 + sass: 1.77.2 vue-demi@0.14.7(vue@3.4.27(typescript@5.4.5)): dependencies: vue: 3.4.27(typescript@5.4.5) - vue-eslint-parser@9.4.2(eslint@9.2.0): + vue-eslint-parser@9.4.2(eslint@9.3.0): dependencies: debug: 4.3.4 - eslint: 9.2.0 + eslint: 9.3.0 eslint-scope: 7.2.2 eslint-visitor-keys: 3.4.3 espree: 9.6.1 @@ -12117,9 +12110,9 @@ snapshots: sortablejs: 1.14.0 vue: 3.4.27(typescript@5.4.5) - vxe-table@4.6.12(vue@3.4.27(typescript@5.4.5)): + vxe-table@4.6.17(vue@3.4.27(typescript@5.4.5)): dependencies: - dom-zindex: 1.0.2 + dom-zindex: 1.0.4 vue: 3.4.27(typescript@5.4.5) xe-utils: 3.5.26 @@ -12135,7 +12128,7 @@ snapshots: dependencies: makeerror: 1.0.12 - wavesurfer.js@7.7.14: {} + wavesurfer.js@7.7.15: {} wcwidth@1.0.1: dependencies: @@ -12239,19 +12232,19 @@ snapshots: xe-utils@3.5.26: {} - xgplayer-subtitles@3.0.17(core-js@3.37.0): + xgplayer-subtitles@3.0.18(core-js@3.37.1): dependencies: - core-js: 3.37.0 + core-js: 3.37.1 eventemitter3: 4.0.7 - xgplayer@3.0.17(core-js@3.37.0): + xgplayer@3.0.18(core-js@3.37.1): dependencies: - core-js: 3.37.0 + core-js: 3.37.1 danmu.js: 1.1.13 delegate: 3.2.0 downloadjs: 1.4.7 eventemitter3: 4.0.7 - xgplayer-subtitles: 3.0.17(core-js@3.37.0) + xgplayer-subtitles: 3.0.18(core-js@3.37.1) xlsx@0.18.5: dependencies: @@ -12279,7 +12272,7 @@ snapshots: yallist@4.0.0: {} - yaml-eslint-parser@1.2.2: + yaml-eslint-parser@1.2.3: dependencies: eslint-visitor-keys: 3.4.3 lodash: 4.17.21 @@ -12287,8 +12280,6 @@ snapshots: yaml@1.10.2: {} - yaml@2.3.4: {} - yaml@2.4.2: {} yargs-parser@18.1.3: diff --git a/src/App.vue b/src/App.vue index 1a8766c..dbd06e8 100644 --- a/src/App.vue +++ b/src/App.vue @@ -5,51 +5,63 @@ - diff --git a/src/api/mock/i18n.ts b/src/api/mock/i18n.ts new file mode 100644 index 0000000..e6dd062 --- /dev/null +++ b/src/api/mock/i18n.ts @@ -0,0 +1,5 @@ +import { http } from "@/utils/http"; + +export const fetchGetI18n = () => { + return http.get("/mock/getI18n"); +}; diff --git a/src/i18n/index.ts b/src/i18n/index.ts new file mode 100644 index 0000000..7b91edc --- /dev/null +++ b/src/i18n/index.ts @@ -0,0 +1,16 @@ +import { createI18n } from "vue-i18n"; + +// ? 从本地存储中获取数据 +const languageData = localStorage.getItem("i18nStore"); + +// 配置多语言 +const i18n = createI18n({ + // 如果要支持 compositionAPI,此项必须设置为 false + legacy: false, + // ? 全局注册$t方法 + globalInjection: true, + // 本地内容存在时,首次加载如果本地存储没有多语言需要再刷新 + messages: languageData ? JSON.parse(languageData).i18n : {} +}); + +export default i18n; diff --git a/src/main.ts b/src/main.ts index 4361243..bd8b4fa 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,28 +1,28 @@ -import App from "./App.vue"; -import router from "./router"; -import { setupStore } from "@/store"; -import { useI18n } from "@/plugins/i18n"; -import { getPlatformConfig } from "./config"; -import { MotionPlugin } from "@vueuse/motion"; import { useEcharts } from "@/plugins/echarts"; -import { createApp, type Directive } from "vue"; -import { useVxeTable } from "@/plugins/vxeTable"; import { useElementPlus } from "@/plugins/elementPlus"; +import { useI18n } from "@/plugins/i18n"; +import { useVxeTable } from "@/plugins/vxeTable"; +import { setupStore } from "@/store"; import { injectResponsiveStorage } from "@/utils/responsive"; +import { MotionPlugin } from "@vueuse/motion"; +import { createApp, type Directive } from "vue"; +import App from "./App.vue"; +import { getPlatformConfig } from "./config"; +import router from "./router"; // 全局注册@iconify/vue图标库 -import { FontIcon, IconifyIconOffline, IconifyIconOnline } from "./components/ReIcon"; -import Table from "@pureadmin/table"; import PureDescriptions from "@pureadmin/descriptions"; +import Table from "@pureadmin/table"; +import { FontIcon, IconifyIconOffline, IconifyIconOnline } from "./components/ReIcon"; // 引入重置样式 import "./style/reset.scss"; // 导入公共样式 import "./style/index.scss"; // 一定要在main.ts中导入tailwind.css,防止vite每次hmr都会请求src/style/index.scss整体css文件导致热更新慢的问题 -import "./style/tailwind.css"; import "element-plus/dist/index.css"; +import "./style/tailwind.css"; // 导入字体图标 -import "./assets/iconfont/iconfont.js"; import "./assets/iconfont/iconfont.css"; +import "./assets/iconfont/iconfont.js"; // 自定义指令 import * as directives from "@/directives"; // 全局注册按钮级别权限组件 diff --git a/src/store/i18n.ts b/src/store/i18n.ts new file mode 100644 index 0000000..41ff3e1 --- /dev/null +++ b/src/store/i18n.ts @@ -0,0 +1,20 @@ +import { fetchGetI18n } from "@/api/mock/i18n"; +import { defineStore } from "pinia"; + +export const userI18nStore = defineStore("i18nStore", { + persist: true, + state() { + return { + // ? 多语言内容 + i18n: {} as any + }; + }, + getters: {}, + actions: { + async fetchI18n() { + // this.i18n = await fetchGetI18n().data; + const result: any = await fetchGetI18n(); + this.i18n = result.data; + } + } +}); diff --git a/src/store/index.ts b/src/store/index.ts index a8dc752..e48baee 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -1,8 +1,11 @@ -import type { App } from "vue"; import { createPinia } from "pinia"; +import piniaPluginPersistedstate from "pinia-plugin-persistedstate"; +import type { App } from "vue"; + const store = createPinia(); export function setupStore(app: App) { + store.use(piniaPluginPersistedstate); app.use(store); } -- 2.43.0 From 9525cdd1a64b1d4c6625b4a430292c07cd16dd5e Mon Sep 17 00:00:00 2001 From: Bunny <1319900154@qq.com> Date: Mon, 27 May 2024 20:01:23 +0800 Subject: [PATCH 2/3] =?UTF-8?q?optimize:=20=E2=99=BB=EF=B8=8F=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E4=B8=8D=E9=9C=80=E8=A6=81=E5=86=85=E5=AE=B9=EF=BC=8C?= =?UTF-8?q?=E7=AE=80=E5=8C=96=E9=A1=B9=E7=9B=AE=E7=BB=93=E6=9E=84=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=9B=B8=E5=BA=94=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mock/asyncRoutes.ts | 448 +++---- mock/i18n.ts | 26 +- mock/modules/en.ts | 501 ++++---- mock/modules/zh.ts | 256 ++++ mock/modules/zh_cn.ts | 251 ---- other-views/able/line-tree.vue | 146 +-- other-views/able/menu-tree.vue | 102 +- other-views/tabs/index.vue | 227 ++-- public/platform-config.json | 2 +- src/App.vue | 90 +- src/components/TableBar/src/TablePlusBar.vue | 429 ++++--- src/components/TableBar/src/bar.tsx | 278 ----- src/i18n/index.ts | 16 - .../lay-notice/components/NoticeList.vue | 33 +- src/layout/components/lay-notice/data.ts | 178 ++- src/layout/components/lay-notice/index.vue | 108 +- .../components/SearchHistoryItem.vue | 49 +- .../lay-search/components/SearchModal.vue | 408 +++---- .../lay-search/components/SearchResult.vue | 135 ++- src/layout/components/lay-sidebar/NavMix.vue | 284 ++--- .../components/SidebarBreadCrumb.vue | 175 ++- .../lay-sidebar/components/SidebarItem.vue | 309 ++--- src/layout/components/lay-tag/index.vue | 1027 ++++++++--------- src/layout/hooks/useNav.ts | 302 ++--- src/layout/hooks/useTag.ts | 416 ++++--- src/layout/index.vue | 324 +++--- src/layout/types.ts | 131 +-- src/main.ts | 72 +- src/plugins/i18n.ts | 127 +- src/plugins/vxeTable.ts | 145 +-- src/router/index.ts | 253 ++-- src/router/modules/home.ts | 46 +- src/router/modules/remaining.ts | 98 +- src/router/utils.ts | 508 ++++---- src/store/modules/record.ts | 24 + src/store/modules/user.ts | 204 ++-- src/utils/auth.ts | 158 +-- src/views/about/columns.tsx | 108 -- src/views/about/index.vue | 174 --- src/views/bill/count/index.vue | 7 + src/views/bill/history/index.vue | 7 + src/views/bill/record/index.vue | 46 + src/views/login/components/LoginPhone.vue | 147 +-- src/views/login/components/LoginRegist.vue | 287 ++--- src/views/login/components/LoginUpdate.vue | 216 ++-- src/views/login/index.vue | 447 ++++--- src/views/login/utils/enums.ts | 52 +- src/views/login/utils/rule.ts | 205 ++-- src/views/monitor/logs/login/index.vue | 103 -- src/views/monitor/logs/operation/index.vue | 103 -- src/views/monitor/logs/system/detail.vue | 95 -- src/views/monitor/logs/system/hook.tsx | 239 ---- src/views/monitor/logs/system/index.vue | 119 -- src/views/monitor/online/index.vue | 79 -- src/views/monitor/test/index.vue | 150 --- src/views/monitor/utils.ts | 129 --- src/views/permission/button/index.vue | 106 -- src/views/permission/page/index.vue | 73 -- src/views/system/dept/form.vue | 100 -- src/views/system/dept/index.vue | 92 -- src/views/system/dept/utils/hook.tsx | 179 --- src/views/system/dept/utils/rule.ts | 37 - src/views/system/dept/utils/types.ts | 16 - src/views/system/menu/README.md | 26 - src/views/system/menu/form.vue | 238 ---- src/views/system/menu/index.vue | 91 -- src/views/system/menu/utils/enums.ts | 108 -- src/views/system/menu/utils/hook.tsx | 225 ---- src/views/system/menu/utils/rule.ts | 10 - src/views/system/menu/utils/types.ts | 30 - src/views/system/role/form.vue | 55 - src/views/system/role/index.vue | 254 ---- src/views/system/role/utils/hook.tsx | 288 ----- src/views/system/role/utils/rule.ts | 8 - src/views/system/role/utils/types.ts | 15 - src/views/system/user/form/index.vue | 119 -- src/views/system/user/form/role.vue | 53 - src/views/system/user/index.vue | 162 --- src/views/system/user/svg/expand.svg | 1 - src/views/system/user/svg/unexpand.svg | 1 - src/views/system/user/tree.vue | 213 ---- src/views/system/user/utils/hook.tsx | 454 -------- src/views/system/user/utils/reset.css | 5 - src/views/system/user/utils/rule.ts | 39 - src/views/system/user/utils/types.ts | 36 - src/views/tabs/index.vue | 88 -- src/views/tabs/params-detail.vue | 17 - src/views/tabs/query-detail.vue | 17 - src/views/welcome/index.vue | 240 ++-- 89 files changed, 4438 insertions(+), 9957 deletions(-) create mode 100644 mock/modules/zh.ts delete mode 100644 mock/modules/zh_cn.ts delete mode 100644 src/components/TableBar/src/bar.tsx delete mode 100644 src/i18n/index.ts create mode 100644 src/store/modules/record.ts delete mode 100644 src/views/about/columns.tsx delete mode 100644 src/views/about/index.vue create mode 100644 src/views/bill/count/index.vue create mode 100644 src/views/bill/history/index.vue create mode 100644 src/views/bill/record/index.vue delete mode 100644 src/views/monitor/logs/login/index.vue delete mode 100644 src/views/monitor/logs/operation/index.vue delete mode 100644 src/views/monitor/logs/system/detail.vue delete mode 100644 src/views/monitor/logs/system/hook.tsx delete mode 100644 src/views/monitor/logs/system/index.vue delete mode 100644 src/views/monitor/online/index.vue delete mode 100644 src/views/monitor/test/index.vue delete mode 100644 src/views/monitor/utils.ts delete mode 100644 src/views/permission/button/index.vue delete mode 100644 src/views/permission/page/index.vue delete mode 100644 src/views/system/dept/form.vue delete mode 100644 src/views/system/dept/index.vue delete mode 100644 src/views/system/dept/utils/hook.tsx delete mode 100644 src/views/system/dept/utils/rule.ts delete mode 100644 src/views/system/dept/utils/types.ts delete mode 100644 src/views/system/menu/README.md delete mode 100644 src/views/system/menu/form.vue delete mode 100644 src/views/system/menu/index.vue delete mode 100644 src/views/system/menu/utils/enums.ts delete mode 100644 src/views/system/menu/utils/hook.tsx delete mode 100644 src/views/system/menu/utils/rule.ts delete mode 100644 src/views/system/menu/utils/types.ts delete mode 100644 src/views/system/role/form.vue delete mode 100644 src/views/system/role/index.vue delete mode 100644 src/views/system/role/utils/hook.tsx delete mode 100644 src/views/system/role/utils/rule.ts delete mode 100644 src/views/system/role/utils/types.ts delete mode 100644 src/views/system/user/form/index.vue delete mode 100644 src/views/system/user/form/role.vue delete mode 100644 src/views/system/user/index.vue delete mode 100644 src/views/system/user/svg/expand.svg delete mode 100644 src/views/system/user/svg/unexpand.svg delete mode 100644 src/views/system/user/tree.vue delete mode 100644 src/views/system/user/utils/hook.tsx delete mode 100644 src/views/system/user/utils/reset.css delete mode 100644 src/views/system/user/utils/rule.ts delete mode 100644 src/views/system/user/utils/types.ts delete mode 100644 src/views/tabs/index.vue delete mode 100644 src/views/tabs/params-detail.vue delete mode 100644 src/views/tabs/query-detail.vue diff --git a/mock/asyncRoutes.ts b/mock/asyncRoutes.ts index 3e0ee67..cafe2f3 100644 --- a/mock/asyncRoutes.ts +++ b/mock/asyncRoutes.ts @@ -1,6 +1,6 @@ // 模拟后端动态生成路由 -import { defineFakeRoute } from "vite-plugin-fake-server/client"; -import { frame, monitor, permission, system } from "@/router/enums"; +import { defineFakeRoute } from 'vite-plugin-fake-server/client'; +import { bills, frame } from '@/router/enums'; /** * roles:页面级别权限,这里模拟二种 "admin"、"common" @@ -8,292 +8,172 @@ import { frame, monitor, permission, system } from "@/router/enums"; * common:普通角色 */ -const systemManagementRouter = { - path: "/system", - meta: { - icon: "ri:settings-3-line", - title: "menus.pureSysManagement", - rank: system - }, - children: [ - { - path: "/system/user/index", - name: "SystemUser", - meta: { - icon: "ri:admin-line", - title: "menus.pureUser", - roles: ["admin"] - } - }, - { - path: "/system/role/index", - name: "SystemRole", - meta: { - icon: "ri:admin-fill", - title: "menus.pureRole", - roles: ["admin"] - } - }, - { - path: "/system/menu/index", - name: "SystemMenu", - meta: { - icon: "ep:menu", - title: "menus.pureSystemMenu", - roles: ["admin"] - } - }, - { - path: "/system/dept/index", - name: "SystemDept", - meta: { - icon: "ri:git-branch-line", - title: "menus.pureDept", - roles: ["admin"] - } - } - ] -}; - -const systemMonitorRouter = { - path: "/monitor", - meta: { - icon: "ep:monitor", - title: "menus.pureSysMonitor", - rank: monitor - }, - children: [ - { - path: "/monitor/online-user", - component: "monitor/online/index", - name: "OnlineUser", - meta: { - icon: "ri:user-voice-line", - title: "menus.pureOnlineUser", - roles: ["admin"] - } - }, - { - path: "/monitor/login-logs", - component: "monitor/logs/login/index", - name: "LoginLog", - meta: { - icon: "ri:window-line", - title: "menus.pureLoginLog", - roles: ["admin"] - } - }, - { - path: "/monitor/operation-logs", - component: "monitor/logs/operation/index", - name: "OperationLog", - meta: { - icon: "ri:history-fill", - title: "menus.pureOperationLog", - roles: ["admin"] - } - }, - { - path: "/monitor/system-logs", - component: "monitor/logs/system/index", - name: "SystemLog", - meta: { - icon: "ri:file-search-line", - title: "menus.pureSystemLog", - roles: ["admin"] - } - }, - { - path: "/monitor/system-test", - component: "monitor/test/index", - name: "SystemTest", - meta: { - icon: "ri:file-search-line", - title: "menus.systemctlTest", - roles: ["admin"] - } - } - ] -}; - -const permissionRouter = { - path: "/permission", - meta: { - title: "menus.purePermission", - icon: "ep:lollipop", - rank: permission - }, - children: [ - { - path: "/permission/page/index", - name: "PermissionPage", - meta: { - title: "menus.purePermissionPage", - roles: ["admin", "common"] - } - }, - { - path: "/permission/button/index", - name: "PermissionButton", - meta: { - title: "menus.purePermissionButton", - roles: ["admin", "common"], - auths: ["permission:btn:add", "permission:btn:edit", "permission:btn:delete"] - } - } - ] -}; - const frameRouter = { - path: "/iframe", - meta: { - icon: "ri:links-fill", - title: "menus.pureExternalPage", - rank: frame - }, - children: [ - { - path: "/iframe/embedded", - meta: { - title: "menus.pureEmbeddedDoc" - }, - children: [ - { - path: "/iframe/colorhunt", - name: "FrameColorHunt", - meta: { - title: "menus.pureColorHuntDoc", - frameSrc: "https://colorhunt.co/", - keepAlive: true, - roles: ["admin", "common"] - } - }, - { - path: "/iframe/uigradients", - name: "FrameUiGradients", - meta: { - title: "menus.pureUiGradients", - frameSrc: "https://uigradients.com/", - keepAlive: true, - roles: ["admin", "common"] - } - }, - { - path: "/iframe/ep", - name: "FrameEp", - meta: { - title: "menus.pureEpDoc", - frameSrc: "https://element-plus.org/zh-CN/", - keepAlive: true, - roles: ["admin", "common"] - } - }, - { - path: "/iframe/tailwindcss", - name: "FrameTailwindcss", - meta: { - title: "menus.pureTailwindcssDoc", - frameSrc: "https://tailwindcss.com/docs/installation", - keepAlive: true, - roles: ["admin", "common"] - } - }, - { - path: "/iframe/vue3", - name: "FrameVue", - meta: { - title: "menus.pureVueDoc", - frameSrc: "https://cn.vuejs.org/", - keepAlive: true, - roles: ["admin", "common"] - } - }, - { - path: "/iframe/vite", - name: "FrameVite", - meta: { - title: "menus.pureViteDoc", - frameSrc: "https://cn.vitejs.dev/", - keepAlive: true, - roles: ["admin", "common"] - } - }, - { - path: "/iframe/pinia", - name: "FramePinia", - meta: { - title: "menus.purePiniaDoc", - frameSrc: "https://pinia.vuejs.org/zh/index.html", - keepAlive: true, - roles: ["admin", "common"] - } - }, - { - path: "/iframe/vue-router", - name: "FrameRouter", - meta: { - title: "menus.pureRouterDoc", - frameSrc: "https://router.vuejs.org/zh/", - keepAlive: true, - roles: ["admin", "common"] - } - } - ] - }, - { - path: "/iframe/external", - meta: { - title: "menus.pureExternalDoc" - }, - children: [ - { - path: "/external", - name: "https://pure-admin.github.io/pure-admin-doc", - meta: { - title: "menus.pureExternalLink", - roles: ["admin", "common"] - } - }, - { - path: "/pureUtilsLink", - name: "https://pure-admin-utils.netlify.app/", - meta: { - title: "menus.pureUtilsLink", - roles: ["admin", "common"] - } - } - ] - } - ] + path: '/iframe', + meta: { + icon: 'ri:links-fill', + title: 'menus.pureExternalPage', + rank: frame, + }, + children: [ + { + path: '/iframe/embedded', + meta: { + title: 'menus.pureEmbeddedDoc', + }, + children: [ + { + path: '/iframe/colorhunt', + name: 'FrameColorHunt', + meta: { + title: 'menus.pureColorHuntDoc', + frameSrc: 'https://colorhunt.co/', + keepAlive: true, + roles: ['admin', 'common'], + }, + }, + { + path: '/iframe/uigradients', + name: 'FrameUiGradients', + meta: { + title: 'menus.pureUiGradients', + frameSrc: 'https://uigradients.com/', + keepAlive: true, + roles: ['admin', 'common'], + }, + }, + { + path: '/iframe/ep', + name: 'FrameEp', + meta: { + title: 'menus.pureEpDoc', + frameSrc: 'https://element-plus.org/zh-CN/', + keepAlive: true, + roles: ['admin', 'common'], + }, + }, + { + path: '/iframe/tailwindcss', + name: 'FrameTailwindcss', + meta: { + title: 'menus.pureTailwindcssDoc', + frameSrc: 'https://tailwindcss.com/docs/installation', + keepAlive: true, + roles: ['admin', 'common'], + }, + }, + { + path: '/iframe/vue3', + name: 'FrameVue', + meta: { + title: 'menus.pureVueDoc', + frameSrc: 'https://cn.vuejs.org/', + keepAlive: true, + roles: ['admin', 'common'], + }, + }, + { + path: '/iframe/vite', + name: 'FrameVite', + meta: { + title: 'menus.pureViteDoc', + frameSrc: 'https://cn.vitejs.dev/', + keepAlive: true, + roles: ['admin', 'common'], + }, + }, + { + path: '/iframe/pinia', + name: 'FramePinia', + meta: { + title: 'menus.purePiniaDoc', + frameSrc: 'https://pinia.vuejs.org/zh/index.html', + keepAlive: true, + roles: ['admin', 'common'], + }, + }, + { + path: '/iframe/vue-router', + name: 'FrameRouter', + meta: { + title: 'menus.pureRouterDoc', + frameSrc: 'https://router.vuejs.org/zh/', + keepAlive: true, + roles: ['admin', 'common'], + }, + }, + ], + }, + { + path: '/iframe/external', + meta: { + title: 'menus.pureExternalDoc', + }, + children: [ + { + path: '/external', + name: 'https://pure-admin.github.io/pure-admin-doc', + meta: { + title: 'menus.pureExternalLink', + roles: ['admin', 'common'], + }, + }, + { + path: '/pureUtilsLink', + name: 'https://pure-admin-utils.netlify.app/', + meta: { + title: 'menus.pureUtilsLink', + roles: ['admin', 'common'], + }, + }, + ], + }, + ], }; -const about = { - path: "/about", - meta: { - icon: "ri:bookmark-2-line", - title: "menus.pureAbout" - }, - children: [ - { - path: "/about/index", - name: "About", - meta: { - icon: "ri:bookmark-2-line", - title: "menus.pureAbout" - } - } - ] +const bill = { + path: '/bill', + meta: { icon: 'ri:bookmark-2-line', title: 'menus.bills', rank: bills }, + children: [ + { + path: '/bill/record/index', + name: 'billRecord', + meta: { + title: 'menus.billRecord', + roles: ['admin', 'common'], + auths: ['permission:btn:add', 'permission:btn:edit', 'permission:btn:delete'], + }, + }, + { + path: '/bill/history/index', + name: 'billHistory', + meta: { + title: 'menus.billHistory', + roles: ['admin', 'common'], + auths: ['permission:btn:add', 'permission:btn:edit', 'permission:btn:delete'], + }, + }, + { + path: '/bill/count/index', + name: 'billCount', + meta: { + title: 'menus.billCount', + roles: ['admin', 'common'], + auths: ['permission:btn:add', 'permission:btn:edit', 'permission:btn:delete'], + }, + }, + ], }; export default defineFakeRoute([ - { - url: "/get-async-routes", - method: "get", - response: () => { - return { - success: true, - data: [systemManagementRouter, systemMonitorRouter, permissionRouter, frameRouter, about] - }; - } - } + { + url: '/get-async-routes', + method: 'get', + response: () => { + return { + success: true, + data: [frameRouter, bill], + }; + }, + }, ]); diff --git a/mock/i18n.ts b/mock/i18n.ts index be883e6..02fb880 100644 --- a/mock/i18n.ts +++ b/mock/i18n.ts @@ -1,16 +1,16 @@ -import { defineFakeRoute } from "vite-plugin-fake-server/client"; -import en from "./modules/en"; -import zh_cn from "./modules/zh_cn"; +import { defineFakeRoute } from 'vite-plugin-fake-server/client'; +import en from './modules/en'; +import zh from './modules/zh'; export default defineFakeRoute([ - { - url: "/mock/getI18n", - method: "get", - response: () => { - return { - success: true, - data: { zh_cn, en, local: "zh_cn" } - }; - } - } + { + url: '/mock/getI18n', + method: 'get', + response: () => { + return { + success: true, + data: { zh, en, local: 'zh' }, + }; + }, + }, ]); diff --git a/mock/modules/en.ts b/mock/modules/en.ts index 5db5f1f..58e7b86 100644 --- a/mock/modules/en.ts +++ b/mock/modules/en.ts @@ -1,250 +1,255 @@ export default { - buttons: { - pureAccountSettings: "Account", - pureLoginOut: "LoginOut", - pureLogin: "Login", - pureOpenSystemSet: "Open System Configs", - pureReload: "Reload", - pureCloseCurrentTab: "Close CurrentTab", - pureCloseLeftTabs: "Close LeftTabs", - pureCloseRightTabs: "Close RightTabs", - pureCloseOtherTabs: "Close OtherTabs", - pureCloseAllTabs: "Close AllTabs", - pureContentFullScreen: "Content FullScreen", - pureContentExitFullScreen: "Content ExitFullScreen", - pureClickCollapse: "Collapse", - pureClickExpand: "Expand", - pureConfirm: "Confirm", - pureSwitch: "Switch", - pureClose: "Close", - pureBackTop: "BackTop", - pureOpenText: "Open", - pureCloseText: "Close", - rest: "Rest" - }, - search: { - pureTotal: "Total", - pureHistory: "History", - pureCollect: "Collect", - pureDragSort: "(Drag Sort)", - pureEmpty: "Empty", - purePlaceholder: "Search Menu" - }, - panel: { - pureSystemSet: "System Configs", - pureCloseSystemSet: "Close System Configs", - pureClearCacheAndToLogin: "Clear cache and return to login page", - pureClearCache: "Clear Cache", - pureOverallStyle: "Overall Style", - pureOverallStyleLight: "Light", - pureOverallStyleLightTip: "Set sail freshly and light up the comfortable work interface", - pureOverallStyleDark: "Dark", - pureOverallStyleDarkTip: "Moonlight Overture, indulge in the tranquility and elegance of the night", - pureOverallStyleSystem: "Auto", - pureOverallStyleSystemTip: "Synchronize time, the interface naturally responds to morning and dusk", - pureThemeColor: "Theme Color", - pureLayoutModel: "Layout Model", - pureVerticalTip: "The menu on the left is familiar and friendly", - pureHorizontalTip: "Top menu, concise overview", - pureMixTip: "Mixed menu, flexible", - pureStretch: "Stretch Page", - pureStretchFixed: "Fixed", - pureStretchFixedTip: "Compact pages make it easy to find the information you need", - pureStretchCustom: "Custom", - pureStretchCustomTip: "Minimum 1280, maximum 1600", - pureTagsStyle: "Tags Style", - pureTagsStyleSmart: "Smart", - pureTagsStyleSmartTip: "Smart tags add fun and brilliance", - pureTagsStyleCard: "Card", - pureTagsStyleCardTip: "Card tags for efficient browsing", - pureInterfaceDisplay: "Interface Display", - pureGreyModel: "Grey Model", - pureWeakModel: "Weak Model", - pureHiddenTags: "Hidden Tags", - pureHiddenFooter: "Hidden Footer", - pureMultiTagsCache: "MultiTags Cache" - }, - menus: { - pureHome: "Home", - pureLogin: "Login", - pureEmpty: "Empty Page", - pureTable: "Table", - pureSysManagement: "System Manage", - pureUser: "User Manage", - pureRole: "Role Manage", - pureSystemMenu: "Menu Manage", - pureDept: "Dept Manage", - pureSysMonitor: "System Monitor", - pureOnlineUser: "Online User", - pureLoginLog: "Login Log", - pureOperationLog: "Operation Log", - pureSystemLog: "System Log", - pureEditor: "Editor", - pureAbnormal: "Abnormal Page", - pureFourZeroFour: "404", - pureFourZeroOne: "403", - pureFive: "500", - pureComponents: "Components", - pureDialog: "Dialog", - pureMessage: "Message Tips", - pureVideo: "Video", - pureSegmented: "Segmented", - pureWaterfall: "Waterfall", - pureMap: "Map", - pureDraggable: "Draggable", - pureSplitPane: "Split Pane", - pureText: "Text Ellipsis", - pureElButton: "Button", - pureButton: "Button Animation", - pureCheckButton: "Check Button", - pureCropping: "Picture Cropping", - pureAnimatecss: "AnimateCss Selector", - pureCountTo: "Digital Animation", - pureSelector: "Scope Selector", - pureFlowChart: "Flow Chart", - pureSeamless: "Seamless Scroll", - pureContextmenu: "Context Menu", - pureTypeit: "Typeit", - pureJsonEditor: "JSON Editor", - pureColorPicker: "Color Picker", - pureDatePicker: "Date Picker", - pureDateTimePicker: "DateTimePicker", - pureTimePicker: "TimePicker", - pureTag: "Tag", - pureStatistic: "Statistic", - pureCollapse: "Collapse", - pureGanttastic: "Gantt Chart", - pureProgress: "Progress", - pureUpload: "File Upload", - pureCheckCard: "CheckCard", - pureMenus: "MultiLevel Menu", - pureMenu1: "Menu1", - "pureMenu1-1": "Menu1-1", - "pureMenu1-2": "Menu1-2", - "pureMenu1-2-1": "Menu1-2-1", - "pureMenu1-2-2": "Menu1-2-2", - "pureMenu1-3": "Menu1-3", - pureMenu2: "Menu2", - purePermission: "Permission Manage", - purePermissionPage: "Page Permission", - purePermissionButton: "Button Permission", - pureTabs: "Tabs Operate", - pureGuide: "Guide", - pureAble: "Able", - pureMenuTree: "Menu Tree", - pureVideoFrame: "Video Frame Capture", - pureWavesurfer: "Audio Visualization", - pureRipple: "Ripple", - pureMqtt: "Mqtt Client", - pureOptimize: "Debounce、Throttle、Copy、Longpress Directives", - pureVerify: "Captcha", - pureWatermark: "Water Mark", - purePrint: "Print", - pureDownload: "Download", - pureExternalPage: "External Page", - pureExternalDoc: "Docs External", - pureEmbeddedDoc: "Docs Embedded", - pureExternalLink: "Vue-Pure-Admin", - pureUtilsLink: "Pure-Admin-Utils", - pureColorHuntDoc: "ColorHunt", - pureUiGradients: "UiGradients", - pureEpDoc: "Element-Plus", - pureTailwindcssDoc: "Tailwindcss", - pureVueDoc: "Vue3", - pureViteDoc: "Vite", - purePiniaDoc: "Pinia", - pureRouterDoc: "Vue-Router", - pureAbout: "About", - pureResult: "Result Page", - pureSuccess: "Success Page", - pureFail: "Fail Page", - pureIconSelect: "Icon Select", - pureTimeline: "Time Line", - pureLineTree: "LineTree", - pureList: "List Page", - pureCardList: "Card List Page", - pureDebounce: "Debounce & Throttle", - pureFormDesign: "Form Design", - pureBarcode: "Barcode", - pureQrcode: "Qrcode", - pureCascader: "Area Cascader", - pureSwiper: "Swiper Plugin", - pureVirtualList: "Virtual List", - purePdf: "PDF Preview", - pureExcel: "Export Excel", - pureInfiniteScroll: "Table Infinite Scroll", - pureSensitive: "Sensitive Filter", - purePinyin: "PinYin", - pureDanmaku: "Danmaku", - pureSchemaForm: "Form", - pureTableBase: "Base Usage", - pureTableHigh: "High Usage", - pureTableEdit: "Edit Usage", - pureVxeTable: "Virtual Usage", - pureBoard: "Paint Board", - pureMindMap: "Mind Map", - pureMenuOverflow: "Menu Overflow Show Tooltip Text", - pureChildMenuOverflow: "Child Menu Overflow Show Tooltip Text", - systemctlTest: "Systemctl lTest" - }, - status: { - pureLoad: "Loading...", - pureMessage: "Message", - pureNotify: "Notify", - pureTodo: "Todo", - pureNoMessage: "No Message", - pureNoNotify: "No Notify", - pureNoTodo: "No Todo" - }, - login: { - pureUsername: "Username", - purePassword: "Password", - pureVerifyCode: "VerifyCode", - pureRemember: "days no need to login", - pureRememberInfo: "After checking and logging in, will automatically log in to the system without entering your username and password within the specified number of days.", - pureSure: "Sure Password", - pureForget: "Forget Password?", - pureLogin: "Login", - pureThirdLogin: "Third Login", - purePhoneLogin: "Phone Login", - pureQRCodeLogin: "QRCode Login", - pureRegister: "Register", - pureWeChatLogin: "WeChat Login", - pureAlipayLogin: "Alipay Login", - pureQQLogin: "QQ Login", - pureWeiBoLogin: "Weibo Login", - purePhone: "Phone", - pureSmsVerifyCode: "SMS VerifyCode", - pureBack: "Back", - pureTest: "Mock Test", - pureTip: 'After scanning the code, click "Confirm" to complete the login', - pureDefinite: "Definite", - pureLoginSuccess: "Login Success", - pureLoginFail: "Login Fail", - pureRegisterSuccess: "Regist Success", - pureTickPrivacy: "Please tick Privacy Policy", - pureReadAccept: "I have read it carefully and accept", - purePrivacyPolicy: "Privacy Policy", - pureGetVerifyCode: "Get VerifyCode", - pureInfo: "Seconds", - pureUsernameReg: "Please enter username", - purePassWordReg: "Please enter password", - pureVerifyCodeReg: "Please enter verify code", - pureVerifyCodeCorrectReg: "Please enter correct verify code", - pureVerifyCodeSixReg: "Please enter a 6-digit verify code", - purePhoneReg: "Please enter the phone", - purePhoneCorrectReg: "Please enter the correct phone number format", - purePassWordRuleReg: "The password format should be any combination of 8-18 digits", - purePassWordSureReg: "Please enter confirm password", - purePassWordDifferentReg: "The two passwords do not match!", - purePassWordUpdateReg: "Password has been updated" - }, - table: { - tableNumber: "Table Number" - }, - style: { - larger: "Larger", - default: "Default", - small: "Small" - } + name: 'en', + buttons: { + pureAccountSettings: 'Account', + pureLoginOut: 'LoginOut', + pureLogin: 'Login', + pureOpenSystemSet: 'Open System Configs', + pureReload: 'Reload', + pureCloseCurrentTab: 'Close CurrentTab', + pureCloseLeftTabs: 'Close LeftTabs', + pureCloseRightTabs: 'Close RightTabs', + pureCloseOtherTabs: 'Close OtherTabs', + pureCloseAllTabs: 'Close AllTabs', + pureContentFullScreen: 'Content FullScreen', + pureContentExitFullScreen: 'Content ExitFullScreen', + pureClickCollapse: 'Collapse', + pureClickExpand: 'Expand', + pureConfirm: 'Confirm', + pureSwitch: 'Switch', + pureClose: 'Close', + pureBackTop: 'BackTop', + pureOpenText: 'Open', + pureCloseText: 'Close', + rest: 'Rest', + }, + search: { + pureTotal: 'Total', + pureHistory: 'History', + pureCollect: 'Collect', + pureDragSort: '(Drag Sort)', + pureEmpty: 'Empty', + purePlaceholder: 'Search Menu', + }, + panel: { + pureSystemSet: 'System Configs', + pureCloseSystemSet: 'Close System Configs', + pureClearCacheAndToLogin: 'Clear cache and return to login page', + pureClearCache: 'Clear Cache', + pureOverallStyle: 'Overall Style', + pureOverallStyleLight: 'Light', + pureOverallStyleLightTip: 'Set sail freshly and light up the comfortable work interface', + pureOverallStyleDark: 'Dark', + pureOverallStyleDarkTip: 'Moonlight Overture, indulge in the tranquility and elegance of the night', + pureOverallStyleSystem: 'Auto', + pureOverallStyleSystemTip: 'Synchronize time, the interface naturally responds to morning and dusk', + pureThemeColor: 'Theme Color', + pureLayoutModel: 'Layout Model', + pureVerticalTip: 'The menu on the left is familiar and friendly', + pureHorizontalTip: 'Top menu, concise overview', + pureMixTip: 'Mixed menu, flexible', + pureStretch: 'Stretch Page', + pureStretchFixed: 'Fixed', + pureStretchFixedTip: 'Compact pages make it easy to find the information you need', + pureStretchCustom: 'Custom', + pureStretchCustomTip: 'Minimum 1280, maximum 1600', + pureTagsStyle: 'Tags Style', + pureTagsStyleSmart: 'Smart', + pureTagsStyleSmartTip: 'Smart tags add fun and brilliance', + pureTagsStyleCard: 'Card', + pureTagsStyleCardTip: 'Card tags for efficient browsing', + pureInterfaceDisplay: 'Interface Display', + pureGreyModel: 'Grey Model', + pureWeakModel: 'Weak Model', + pureHiddenTags: 'Hidden Tags', + pureHiddenFooter: 'Hidden Footer', + pureMultiTagsCache: 'MultiTags Cache', + }, + menus: { + pureHome: 'Home', + pureLogin: 'Login', + pureEmpty: 'Empty Page', + pureTable: 'Table', + pureSysManagement: 'System Manage', + pureUser: 'User Manage', + pureRole: 'Role Manage', + pureSystemMenu: 'Menu Manage', + pureDept: 'Dept Manage', + pureSysMonitor: 'System Monitor', + pureOnlineUser: 'Online User', + pureLoginLog: 'Login Log', + pureOperationLog: 'Operation Log', + pureSystemLog: 'System Log', + pureEditor: 'Editor', + pureAbnormal: 'Abnormal Page', + pureFourZeroFour: '404', + pureFourZeroOne: '403', + pureFive: '500', + pureComponents: 'Components', + pureDialog: 'Dialog', + pureMessage: 'Message Tips', + pureVideo: 'Video', + pureSegmented: 'Segmented', + pureWaterfall: 'Waterfall', + pureMap: 'Map', + pureDraggable: 'Draggable', + pureSplitPane: 'Split Pane', + pureText: 'Text Ellipsis', + pureElButton: 'Button', + pureButton: 'Button Animation', + pureCheckButton: 'Check Button', + pureCropping: 'Picture Cropping', + pureAnimatecss: 'AnimateCss Selector', + pureCountTo: 'Digital Animation', + pureSelector: 'Scope Selector', + pureFlowChart: 'Flow Chart', + pureSeamless: 'Seamless Scroll', + pureContextmenu: 'Context Menu', + pureTypeit: 'Typeit', + pureJsonEditor: 'JSON Editor', + pureColorPicker: 'Color Picker', + pureDatePicker: 'Date Picker', + pureDateTimePicker: 'DateTimePicker', + pureTimePicker: 'TimePicker', + pureTag: 'Tag', + pureStatistic: 'Statistic', + pureCollapse: 'Collapse', + pureGanttastic: 'Gantt Chart', + pureProgress: 'Progress', + pureUpload: 'File Upload', + pureCheckCard: 'CheckCard', + pureMenus: 'MultiLevel Menu', + pureMenu1: 'Menu1', + 'pureMenu1-1': 'Menu1-1', + 'pureMenu1-2': 'Menu1-2', + 'pureMenu1-2-1': 'Menu1-2-1', + 'pureMenu1-2-2': 'Menu1-2-2', + 'pureMenu1-3': 'Menu1-3', + pureMenu2: 'Menu2', + purePermission: 'Permission Manage', + purePermissionPage: 'Page Permission', + purePermissionButton: 'Button Permission', + pureTabs: 'Tabs Operate', + pureGuide: 'Guide', + pureAble: 'Able', + pureMenuTree: 'Menu Tree', + pureVideoFrame: 'Video Frame Capture', + pureWavesurfer: 'Audio Visualization', + pureRipple: 'Ripple', + pureMqtt: 'Mqtt Client', + pureOptimize: 'Debounce、Throttle、Copy、Longpress Directives', + pureVerify: 'Captcha', + pureWatermark: 'Water Mark', + purePrint: 'Print', + pureDownload: 'Download', + pureExternalPage: 'External Page', + pureExternalDoc: 'Docs External', + pureEmbeddedDoc: 'Docs Embedded', + pureExternalLink: 'Vue-Pure-Admin', + pureUtilsLink: 'Pure-Admin-Utils', + pureColorHuntDoc: 'ColorHunt', + pureUiGradients: 'UiGradients', + pureEpDoc: 'Element-Plus', + pureTailwindcssDoc: 'Tailwindcss', + pureVueDoc: 'Vue3', + pureViteDoc: 'Vite', + purePiniaDoc: 'Pinia', + pureRouterDoc: 'Vue-Router', + pureAbout: 'About', + pureResult: 'Result Page', + pureSuccess: 'Success Page', + pureFail: 'Fail Page', + pureIconSelect: 'Icon Select', + pureTimeline: 'Time Line', + pureLineTree: 'LineTree', + pureList: 'List Page', + pureCardList: 'Card List Page', + pureDebounce: 'Debounce & Throttle', + pureFormDesign: 'Form Design', + pureBarcode: 'Barcode', + pureQrcode: 'Qrcode', + pureCascader: 'Area Cascader', + pureSwiper: 'Swiper Plugin', + pureVirtualList: 'Virtual List', + purePdf: 'PDF Preview', + pureExcel: 'Export Excel', + pureInfiniteScroll: 'Table Infinite Scroll', + pureSensitive: 'Sensitive Filter', + purePinyin: 'PinYin', + pureDanmaku: 'Danmaku', + pureSchemaForm: 'Form', + pureTableBase: 'Base Usage', + pureTableHigh: 'High Usage', + pureTableEdit: 'Edit Usage', + pureVxeTable: 'Virtual Usage', + pureBoard: 'Paint Board', + pureMindMap: 'Mind Map', + pureMenuOverflow: 'Menu Overflow Show Tooltip Text', + pureChildMenuOverflow: 'Child Menu Overflow Show Tooltip Text', + systemctlTest: 'Systemctl lTest', + bills: 'Ledger management', + billRecord: 'Billing record', + billHistory: 'Billing History', + billCount: 'Billing Count', + }, + status: { + pureLoad: 'Loading...', + pureMessage: 'Message', + pureNotify: 'Notify', + pureTodo: 'Todo', + pureNoMessage: 'No Message', + pureNoNotify: 'No Notify', + pureNoTodo: 'No Todo', + }, + login: { + pureUsername: 'Username', + purePassword: 'Password', + pureVerifyCode: 'VerifyCode', + pureRemember: 'days no need to login', + pureRememberInfo: 'After checking and logging in, will automatically log in to the system without entering your username and password within the specified number of days.', + pureSure: 'Sure Password', + pureForget: 'Forget Password?', + pureLogin: 'Login', + pureThirdLogin: 'Third Login', + purePhoneLogin: 'Phone Login', + pureQRCodeLogin: 'QRCode Login', + pureRegister: 'Register', + pureWeChatLogin: 'WeChat Login', + pureAlipayLogin: 'Alipay Login', + pureQQLogin: 'QQ Login', + pureWeiBoLogin: 'Weibo Login', + purePhone: 'Phone', + pureSmsVerifyCode: 'SMS VerifyCode', + pureBack: 'Back', + pureTest: 'Mock Test', + pureTip: 'After scanning the code, click "Confirm" to complete the login', + pureDefinite: 'Definite', + pureLoginSuccess: 'Login Success', + pureLoginFail: 'Login Fail', + pureRegisterSuccess: 'Regist Success', + pureTickPrivacy: 'Please tick Privacy Policy', + pureReadAccept: 'I have read it carefully and accept', + purePrivacyPolicy: 'Privacy Policy', + pureGetVerifyCode: 'Get VerifyCode', + pureInfo: 'Seconds', + pureUsernameReg: 'Please enter username', + purePassWordReg: 'Please enter password', + pureVerifyCodeReg: 'Please enter verify code', + pureVerifyCodeCorrectReg: 'Please enter correct verify code', + pureVerifyCodeSixReg: 'Please enter a 6-digit verify code', + purePhoneReg: 'Please enter the phone', + purePhoneCorrectReg: 'Please enter the correct phone number format', + purePassWordRuleReg: 'The password format should be any combination of 8-18 digits', + purePassWordSureReg: 'Please enter confirm password', + purePassWordDifferentReg: 'The two passwords do not match!', + purePassWordUpdateReg: 'Password has been updated', + }, + table: { + tableNumber: 'Table Number', + }, + style: { + larger: 'Larger', + default: 'Default', + small: 'Small', + }, }; diff --git a/mock/modules/zh.ts b/mock/modules/zh.ts new file mode 100644 index 0000000..6e7c4ed --- /dev/null +++ b/mock/modules/zh.ts @@ -0,0 +1,256 @@ +export default { + buttons: { + pureAccountSettings: '账户设置', + pureLoginOut: '退出系统', + pureLogin: '登录', + pureOpenSystemSet: '打开系统配置', + pureReload: '重新加载', + pureCloseCurrentTab: '关闭当前标签页', + pureCloseLeftTabs: '关闭左侧标签页', + pureCloseRightTabs: '关闭右侧标签页', + pureCloseOtherTabs: '关闭其他标签页', + + pureCloseAllTabs: '关闭全部标签页', + pureContentFullScreen: '内容区全屏', + pureContentExitFullScreen: '内容区退出全屏', + pureClickCollapse: '点击折叠', + pureClickExpand: '点击展开', + pureConfirm: '确认', + pureSwitch: '切换', + pureClose: '关闭', + pureBackTop: '回到顶部', + pureOpenText: '开', + pureCloseText: '关', + rest: '重置', + }, + search: { + pureTotal: '共', + pureHistory: '搜索历史', + pureCollect: '收藏', + pureDragSort: '(可拖拽排序)', + pureEmpty: '暂无搜索结果', + purePlaceholder: '搜索菜单(支持拼音搜索)', + }, + panel: { + pureSystemSet: '系统配置', + pureCloseSystemSet: '关闭配置', + pureClearCacheAndToLogin: '清空缓存并返回登录页', + pureClearCache: '清空缓存', + pureOverallStyle: '整体风格', + pureOverallStyleLight: '浅色', + pureOverallStyleLightTip: '清新启航,点亮舒适的工作界面', + pureOverallStyleDark: '深色', + pureOverallStyleDarkTip: '月光序曲,沉醉于夜的静谧雅致', + pureOverallStyleSystem: '自动', + pureOverallStyleSystemTip: '同步时光,界面随晨昏自然呼应', + pureThemeColor: '主题色', + pureLayoutModel: '导航模式', + pureVerticalTip: '左侧菜单,亲切熟悉', + pureHorizontalTip: '顶部菜单,简洁概览', + pureMixTip: '混合菜单,灵活多变', + pureStretch: '页宽', + pureStretchFixed: '固定', + pureStretchFixedTip: '紧凑页面,轻松找到所需信息', + pureStretchCustom: '自定义', + pureStretchCustomTip: '最小1280、最大1600', + pureTagsStyle: '页签风格', + pureTagsStyleSmart: '灵动', + pureTagsStyleSmartTip: '灵动标签,添趣生辉', + pureTagsStyleCard: '卡片', + pureTagsStyleCardTip: '卡片标签,高效浏览', + pureInterfaceDisplay: '界面显示', + pureGreyModel: '灰色模式', + pureWeakModel: '色弱模式', + pureHiddenTags: '隐藏标签页', + pureHiddenFooter: '隐藏页脚', + pureMultiTagsCache: '页签持久化', + }, + menus: { + pureHome: '首页', + pureLogin: '登录', + pureEmpty: '无Layout页', + pureTable: '表格', + pureSysManagement: '系统管理', + pureUser: '用户管理', + pureRole: '角色管理', + pureSystemMenu: '菜单管理', + pureDept: '部门管理', + pureSysMonitor: '系统监控', + pureOnlineUser: '在线用户', + pureLoginLog: '登录日志', + pureOperationLog: '操作日志', + pureSystemLog: '系统日志', + pureEditor: '编辑器', + pureAbnormal: '异常页面', + pureFourZeroFour: '404', + pureFourZeroOne: '403', + pureFive: '500', + pureComponents: '组件', + pureDialog: '函数式弹框', + pureMessage: '消息提示', + pureVideo: '视频', + pureSegmented: '分段控制器', + pureWaterfall: '瀑布流无限滚动', + pureMap: '地图', + pureDraggable: '拖拽', + pureSplitPane: '切割面板', + pureText: '文本省略', + pureElButton: '按钮', + pureCheckButton: '可选按钮', + pureButton: '按钮动效', + pureCropping: '图片裁剪', + pureAnimatecss: 'animate.css选择器', + pureCountTo: '数字动画', + pureSelector: '范围选择器', + pureFlowChart: '流程图', + pureSeamless: '无缝滚动', + pureContextmenu: '右键菜单', + pureTypeit: '打字机', + pureJsonEditor: 'JSON编辑器', + pureColorPicker: '颜色选择器', + pureDatePicker: '日期选择器', + pureDateTimePicker: '日期时间选择器', + pureTimePicker: '时间选择器', + pureTag: '标签', + pureStatistic: '统计组件', + pureCollapse: '折叠面板', + pureGanttastic: '甘特图', + pureProgress: '进度条', + pureUpload: '文件上传', + pureCheckCard: '多选卡片', + pureMenus: '多级菜单', + pureMenu1: '菜单1', + 'pureMenu1-1': '菜单1-1', + 'pureMenu1-2': '菜单1-2', + 'pureMenu1-2-1': '菜单1-2-1', + 'pureMenu1-2-2': '菜单1-2-2', + 'pureMenu1-3': '菜单1-3', + pureMenu2: '菜单2', + purePermission: '权限管理', + purePermissionPage: '页面权限', + purePermissionButton: '按钮权限', + pureTabs: '标签页操作', + pureGuide: '引导页', + pureAble: '功能', + pureMenuTree: '菜单树结构', + pureVideoFrame: '视频帧截取-wasm版', + pureWavesurfer: '音频可视化', + pureRipple: '波纹(Ripple)', + pureMqtt: 'MQTT客户端(mqtt)', + pureOptimize: '防抖、截流、复制、长按指令', + pureVerify: '图形验证码', + pureWatermark: '水印', + purePrint: '打印', + pureDownload: '下载', + pureExternalPage: '外部页面', + pureExternalDoc: '文档外链', + pureEmbeddedDoc: '文档内嵌', + pureExternalLink: 'vue-pure-admin', + pureUtilsLink: 'pure-admin-utils', + pureColorHuntDoc: '调色板', + pureUiGradients: '渐变色', + pureEpDoc: 'element-plus', + pureTailwindcssDoc: 'tailwindcss', + pureVueDoc: 'vue3', + pureViteDoc: 'vite', + purePiniaDoc: 'pinia', + pureRouterDoc: 'vue-router', + pureAbout: '关于', + pureResult: '结果页面', + pureSuccess: '成功页面', + pureFail: '失败页面', + pureIconSelect: '图标选择器', + pureTimeline: '时间线', + pureLineTree: '树形连接线', + pureList: '列表页面', + pureCardList: '卡片列表页', + pureDebounce: '防抖节流', + pureFormDesign: '表单设计器', + pureBarcode: '条形码', + pureQrcode: '二维码', + pureCascader: '区域级联选择器', + pureSwiper: 'Swiper插件', + pureVirtualList: '虚拟列表', + purePdf: 'PDF预览', + pureExcel: '导出Excel', + pureInfiniteScroll: '表格无限滚动', + pureSensitive: '敏感词过滤', + purePinyin: '汉语拼音', + pureDanmaku: '弹幕', + pureSchemaForm: '表单', + pureTableBase: '基础用法', + pureTableHigh: '高级用法', + pureTableEdit: '可编辑用法', + pureVxeTable: '虚拟滚动', + pureBoard: '艺术画板', + pureMindMap: '思维导图', + pureMenuOverflow: '目录超出显示 Tooltip 文字提示', + pureChildMenuOverflow: '菜单超出显示 Tooltip 文字提示', + systemctlTest: '系统测试', + bills: '台账管理', + billRecord: '账单记录', + billHistory: '历史账单', + billCount: '账单统计', + }, + status: { + pureLoad: '加载中...', + pureMessage: '消息', + pureNotify: '通知', + pureTodo: '待办', + pureNoMessage: '暂无消息', + pureNoNotify: '暂无通知', + pureNoTodo: '暂无待办', + }, + login: { + pureUsername: '账号', + purePassword: '密码', + pureVerifyCode: '验证码', + pureRemember: '天内免登录', + pureRememberInfo: '勾选并登录后,规定天数内无需输入用户名和密码会自动登入系统', + pureSure: '确认密码', + pureForget: '忘记密码?', + pureLogin: '登录', + pureThirdLogin: '第三方登录', + purePhoneLogin: '手机登录', + pureQRCodeLogin: '二维码登录', + pureRegister: '注册', + pureWeChatLogin: '微信登录', + pureAlipayLogin: '支付宝登录', + pureQQLogin: 'QQ登录', + pureWeiBoLogin: '微博登录', + purePhone: '手机号码', + pureSmsVerifyCode: '短信验证码', + pureBack: '返回', + pureTest: '模拟测试', + pureTip: '扫码后点击"确认",即可完成登录', + pureDefinite: '确定', + pureLoginSuccess: '登录成功', + pureLoginFail: '登录失败', + pureRegisterSuccess: '注册成功', + pureTickPrivacy: '请勾选隐私政策', + pureReadAccept: '我已仔细阅读并接受', + purePrivacyPolicy: '《隐私政策》', + pureGetVerifyCode: '获取验证码', + pureInfo: '秒后重新获取', + pureUsernameReg: '请输入账号', + purePassWordReg: '请输入密码', + pureVerifyCodeReg: '请输入验证码', + pureVerifyCodeCorrectReg: '请输入正确的验证码', + pureVerifyCodeSixReg: '请输入6位数字验证码', + purePhoneReg: '请输入手机号码', + purePhoneCorrectReg: '请输入正确的手机号码格式', + purePassWordRuleReg: '密码格式应为8-18位数字、字母、符号的任意两种组合', + purePassWordSureReg: '请输入确认密码', + purePassWordDifferentReg: '两次密码不一致!', + purePassWordUpdateReg: '修改密码成功', + }, + table: { + tableNumber: '序号', + }, + style: { + larger: '宽松', + default: '默认', + small: '紧凑', + }, + name: 'zh', +}; diff --git a/mock/modules/zh_cn.ts b/mock/modules/zh_cn.ts deleted file mode 100644 index 8b7fe72..0000000 --- a/mock/modules/zh_cn.ts +++ /dev/null @@ -1,251 +0,0 @@ -export default { - buttons: { - pureAccountSettings: "账户设置", - pureLoginOut: "退出系统", - pureLogin: "登录", - pureOpenSystemSet: "打开系统配置", - pureReload: "重新加载", - pureCloseCurrentTab: "关闭当前标签页", - pureCloseLeftTabs: "关闭左侧标签页", - pureCloseRightTabs: "关闭右侧标签页", - pureCloseOtherTabs: "关闭其他标签页", - - pureCloseAllTabs: "关闭全部标签页", - pureContentFullScreen: "内容区全屏", - pureContentExitFullScreen: "内容区退出全屏", - pureClickCollapse: "点击折叠", - pureClickExpand: "点击展开", - pureConfirm: "确认", - pureSwitch: "切换", - pureClose: "关闭", - pureBackTop: "回到顶部", - pureOpenText: "开", - pureCloseText: "关", - rest: "重置" - }, - search: { - pureTotal: "共", - pureHistory: "搜索历史", - pureCollect: "收藏", - pureDragSort: "(可拖拽排序)", - pureEmpty: "暂无搜索结果", - purePlaceholder: "搜索菜单(支持拼音搜索)" - }, - panel: { - pureSystemSet: "系统配置", - pureCloseSystemSet: "关闭配置", - pureClearCacheAndToLogin: "清空缓存并返回登录页", - pureClearCache: "清空缓存", - pureOverallStyle: "整体风格", - pureOverallStyleLight: "浅色", - pureOverallStyleLightTip: "清新启航,点亮舒适的工作界面", - pureOverallStyleDark: "深色", - pureOverallStyleDarkTip: "月光序曲,沉醉于夜的静谧雅致", - pureOverallStyleSystem: "自动", - pureOverallStyleSystemTip: "同步时光,界面随晨昏自然呼应", - pureThemeColor: "主题色", - pureLayoutModel: "导航模式", - pureVerticalTip: "左侧菜单,亲切熟悉", - pureHorizontalTip: "顶部菜单,简洁概览", - pureMixTip: "混合菜单,灵活多变", - pureStretch: "页宽", - pureStretchFixed: "固定", - pureStretchFixedTip: "紧凑页面,轻松找到所需信息", - pureStretchCustom: "自定义", - pureStretchCustomTip: "最小1280、最大1600", - pureTagsStyle: "页签风格", - pureTagsStyleSmart: "灵动", - pureTagsStyleSmartTip: "灵动标签,添趣生辉", - pureTagsStyleCard: "卡片", - pureTagsStyleCardTip: "卡片标签,高效浏览", - pureInterfaceDisplay: "界面显示", - pureGreyModel: "灰色模式", - pureWeakModel: "色弱模式", - pureHiddenTags: "隐藏标签页", - pureHiddenFooter: "隐藏页脚", - pureMultiTagsCache: "页签持久化" - }, - menus: { - pureHome: "首页", - pureLogin: "登录", - pureEmpty: "无Layout页", - pureTable: "表格", - pureSysManagement: "系统管理", - pureUser: "用户管理", - pureRole: "角色管理", - pureSystemMenu: "菜单管理", - pureDept: "部门管理", - pureSysMonitor: "系统监控", - pureOnlineUser: "在线用户", - pureLoginLog: "登录日志", - pureOperationLog: "操作日志", - pureSystemLog: "系统日志", - pureEditor: "编辑器", - pureAbnormal: "异常页面", - pureFourZeroFour: "404", - pureFourZeroOne: "403", - pureFive: "500", - pureComponents: "组件", - pureDialog: "函数式弹框", - pureMessage: "消息提示", - pureVideo: "视频", - pureSegmented: "分段控制器", - pureWaterfall: "瀑布流无限滚动", - pureMap: "地图", - pureDraggable: "拖拽", - pureSplitPane: "切割面板", - pureText: "文本省略", - pureElButton: "按钮", - pureCheckButton: "可选按钮", - pureButton: "按钮动效", - pureCropping: "图片裁剪", - pureAnimatecss: "animate.css选择器", - pureCountTo: "数字动画", - pureSelector: "范围选择器", - pureFlowChart: "流程图", - pureSeamless: "无缝滚动", - pureContextmenu: "右键菜单", - pureTypeit: "打字机", - pureJsonEditor: "JSON编辑器", - pureColorPicker: "颜色选择器", - pureDatePicker: "日期选择器", - pureDateTimePicker: "日期时间选择器", - pureTimePicker: "时间选择器", - pureTag: "标签", - pureStatistic: "统计组件", - pureCollapse: "折叠面板", - pureGanttastic: "甘特图", - pureProgress: "进度条", - pureUpload: "文件上传", - pureCheckCard: "多选卡片", - pureMenus: "多级菜单", - pureMenu1: "菜单1", - "pureMenu1-1": "菜单1-1", - "pureMenu1-2": "菜单1-2", - "pureMenu1-2-1": "菜单1-2-1", - "pureMenu1-2-2": "菜单1-2-2", - "pureMenu1-3": "菜单1-3", - pureMenu2: "菜单2", - purePermission: "权限管理", - purePermissionPage: "页面权限", - purePermissionButton: "按钮权限", - pureTabs: "标签页操作", - pureGuide: "引导页", - pureAble: "功能", - pureMenuTree: "菜单树结构", - pureVideoFrame: "视频帧截取-wasm版", - pureWavesurfer: "音频可视化", - pureRipple: "波纹(Ripple)", - pureMqtt: "MQTT客户端(mqtt)", - pureOptimize: "防抖、截流、复制、长按指令", - pureVerify: "图形验证码", - pureWatermark: "水印", - purePrint: "打印", - pureDownload: "下载", - pureExternalPage: "外部页面", - pureExternalDoc: "文档外链", - pureEmbeddedDoc: "文档内嵌", - pureExternalLink: "vue-pure-admin", - pureUtilsLink: "pure-admin-utils", - pureColorHuntDoc: "调色板", - pureUiGradients: "渐变色", - pureEpDoc: "element-plus", - pureTailwindcssDoc: "tailwindcss", - pureVueDoc: "vue3", - pureViteDoc: "vite", - purePiniaDoc: "pinia", - pureRouterDoc: "vue-router", - pureAbout: "关于", - pureResult: "结果页面", - pureSuccess: "成功页面", - pureFail: "失败页面", - pureIconSelect: "图标选择器", - pureTimeline: "时间线", - pureLineTree: "树形连接线", - pureList: "列表页面", - pureCardList: "卡片列表页", - pureDebounce: "防抖节流", - pureFormDesign: "表单设计器", - pureBarcode: "条形码", - pureQrcode: "二维码", - pureCascader: "区域级联选择器", - pureSwiper: "Swiper插件", - pureVirtualList: "虚拟列表", - purePdf: "PDF预览", - pureExcel: "导出Excel", - pureInfiniteScroll: "表格无限滚动", - pureSensitive: "敏感词过滤", - purePinyin: "汉语拼音", - pureDanmaku: "弹幕", - pureSchemaForm: "表单", - pureTableBase: "基础用法", - pureTableHigh: "高级用法", - pureTableEdit: "可编辑用法", - pureVxeTable: "虚拟滚动", - pureBoard: "艺术画板", - pureMindMap: "思维导图", - pureMenuOverflow: "目录超出显示 Tooltip 文字提示", - pureChildMenuOverflow: "菜单超出显示 Tooltip 文字提示", - systemctlTest: "系统测试" - }, - status: { - pureLoad: "加载中...", - pureMessage: "消息", - pureNotify: "通知", - pureTodo: "待办", - pureNoMessage: "暂无消息", - pureNoNotify: "暂无通知", - pureNoTodo: "暂无待办" - }, - login: { - pureUsername: "账号", - purePassword: "密码", - pureVerifyCode: "验证码", - pureRemember: "天内免登录", - pureRememberInfo: "勾选并登录后,规定天数内无需输入用户名和密码会自动登入系统", - pureSure: "确认密码", - pureForget: "忘记密码?", - pureLogin: "登录", - pureThirdLogin: "第三方登录", - purePhoneLogin: "手机登录", - pureQRCodeLogin: "二维码登录", - pureRegister: "注册", - pureWeChatLogin: "微信登录", - pureAlipayLogin: "支付宝登录", - pureQQLogin: "QQ登录", - pureWeiBoLogin: "微博登录", - purePhone: "手机号码", - pureSmsVerifyCode: "短信验证码", - pureBack: "返回", - pureTest: "模拟测试", - pureTip: '扫码后点击"确认",即可完成登录', - pureDefinite: "确定", - pureLoginSuccess: "登录成功", - pureLoginFail: "登录失败", - pureRegisterSuccess: "注册成功", - pureTickPrivacy: "请勾选隐私政策", - pureReadAccept: "我已仔细阅读并接受", - purePrivacyPolicy: "《隐私政策》", - pureGetVerifyCode: "获取验证码", - pureInfo: "秒后重新获取", - pureUsernameReg: "请输入账号", - purePassWordReg: "请输入密码", - pureVerifyCodeReg: "请输入验证码", - pureVerifyCodeCorrectReg: "请输入正确的验证码", - pureVerifyCodeSixReg: "请输入6位数字验证码", - purePhoneReg: "请输入手机号码", - purePhoneCorrectReg: "请输入正确的手机号码格式", - purePassWordRuleReg: "密码格式应为8-18位数字、字母、符号的任意两种组合", - purePassWordSureReg: "请输入确认密码", - purePassWordDifferentReg: "两次密码不一致!", - purePassWordUpdateReg: "修改密码成功" - }, - table: { - tableNumber: "序号" - }, - style: { - larger: "宽松", - default: "默认", - small: "紧凑" - } -}; diff --git a/other-views/able/line-tree.vue b/other-views/able/line-tree.vue index c7ca3d9..cc2f691 100644 --- a/other-views/able/line-tree.vue +++ b/other-views/able/line-tree.vue @@ -1,102 +1,76 @@ - diff --git a/other-views/able/menu-tree.vue b/other-views/able/menu-tree.vue index 5dfde79..e31982c 100644 --- a/other-views/able/menu-tree.vue +++ b/other-views/able/menu-tree.vue @@ -1,91 +1,63 @@ - diff --git a/other-views/tabs/index.vue b/other-views/tabs/index.vue index cc32ddf..8280a87 100644 --- a/other-views/tabs/index.vue +++ b/other-views/tabs/index.vue @@ -1,164 +1,117 @@ - diff --git a/public/platform-config.json b/public/platform-config.json index e85a35e..105e5e2 100644 --- a/public/platform-config.json +++ b/public/platform-config.json @@ -1,6 +1,6 @@ { "Version": "5.5.0", - "Title": "Bill-admin", + "Title": "Bunny-admin", "Copyright": "Copyright © 2024-present", "FixedHeader": true, "HiddenSideBar": false, diff --git a/src/App.vue b/src/App.vue index dbd06e8..44a3406 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,17 +1,21 @@ diff --git a/src/components/TableBar/src/TablePlusBar.vue b/src/components/TableBar/src/TablePlusBar.vue index 322a644..64b721e 100644 --- a/src/components/TableBar/src/TablePlusBar.vue +++ b/src/components/TableBar/src/TablePlusBar.vue @@ -1,166 +1,165 @@ diff --git a/src/components/TableBar/src/bar.tsx b/src/components/TableBar/src/bar.tsx deleted file mode 100644 index b9fd0f8..0000000 --- a/src/components/TableBar/src/bar.tsx +++ /dev/null @@ -1,278 +0,0 @@ -import Sortable from "sortablejs"; -import { transformI18n } from "@/plugins/i18n"; -import { useEpThemeStoreHook } from "@/store/modules/epTheme"; -import { computed, defineComponent, getCurrentInstance, nextTick, type PropType, ref, unref } from "vue"; -import { cloneDeep, delay, getKeyList, isBoolean, isFunction } from "@pureadmin/utils"; -import DragIcon from "@/assets/table-bar/drag.svg?component"; -import ExpandIcon from "@/assets/table-bar/expand.svg?component"; -import RefreshIcon from "@/assets/table-bar/refresh.svg?component"; -import SettingIcon from "@/assets/table-bar/settings.svg?component"; -import CollapseIcon from "@/assets/table-bar/collapse.svg?component"; - -const props = { - /** 头部最左边的标题 */ - title: { - type: String, - default: "列表" - }, - /** 对于树形表格,如果想启用展开和折叠功能,传入当前表格的ref即可 */ - tableRef: { - type: Object as PropType - }, - /** 需要展示的列 */ - columns: { - type: Array as PropType, - default: () => [] - }, - isExpandAll: { - type: Boolean, - default: true - }, - tableKey: { - type: [String, Number] as PropType, - default: "0" - }, - dataList: { - type: Array, - default: [] - }, - loading: { - type: Boolean, - default: false - }, - pagination: { - type: Object, - default: {} - }, - size: { - type: String as PropType, - default: "default" - }, - handleSelectionChange: { - type: String as PropType, - default: () => {} - }, - handleSizeChange: { - type: String as PropType, - default: () => {} - }, - handleCurrentChange: { - type: String as PropType, - default: () => {} - } -}; - -export default defineComponent({ - name: "PureTableBar", - props, - emits: ["refresh"], - setup(props, { emit, slots, attrs }) { - const size = ref("default"); - const loading = ref(false); - const checkAll = ref(true); - const isIndeterminate = ref(false); - const instance = getCurrentInstance()!; - const isExpandAll = ref(props.isExpandAll); - const filterColumns = cloneDeep(props?.columns).filter(column => (isBoolean(column?.hide) ? !column.hide : !(isFunction(column?.hide) && column?.hide()))); - let checkColumnList = getKeyList(cloneDeep(props?.columns), "label"); - const checkedColumns = ref(getKeyList(cloneDeep(filterColumns), "label")); - const dynamicColumns = ref(cloneDeep(props?.columns)); - - const getDropdownItemStyle = computed(() => { - return (s: string) => { - return { - background: s === size.value ? useEpThemeStoreHook().epThemeColor : "", - color: s === size.value ? "#fff" : "var(--el-text-color-primary)" - }; - }; - }); - - const iconClass = computed(() => { - return ["text-black", "dark:text-white", "duration-100", "hover:!text-primary", "cursor-pointer", "outline-none"]; - }); - - const topClass = computed(() => { - return ["flex", "justify-between", "pt-[3px]", "px-[11px]", "border-b-[1px]", "border-solid", "border-[#dcdfe6]", "dark:border-[#303030]"]; - }); - - function onReFresh() { - loading.value = true; - emit("refresh"); - delay(500).then(() => (loading.value = false)); - } - - function onExpand() { - isExpandAll.value = !isExpandAll.value; - toggleRowExpansionAll(props.tableRef.data, isExpandAll.value); - } - - function toggleRowExpansionAll(data, isExpansion) { - data.forEach(item => { - props.tableRef.toggleRowExpansion(item, isExpansion); - if (item.children !== undefined && item.children !== null) { - toggleRowExpansionAll(item.children, isExpansion); - } - }); - } - - function handleCheckAllChange(val: boolean) { - checkedColumns.value = val ? checkColumnList : []; - isIndeterminate.value = false; - dynamicColumns.value.map(column => (val ? (column.hide = false) : (column.hide = true))); - } - - function handleCheckedColumnsChange(value: string[]) { - checkedColumns.value = value; - const checkedCount = value.length; - checkAll.value = checkedCount === checkColumnList.length; - isIndeterminate.value = checkedCount > 0 && checkedCount < checkColumnList.length; - } - - function handleCheckColumnListChange(val: boolean, label: string) { - dynamicColumns.value.filter(item => transformI18n(item.label) === transformI18n(label))[0].hide = !val; - } - - async function onReset() { - checkAll.value = true; - isIndeterminate.value = false; - dynamicColumns.value = cloneDeep(props?.columns); - checkColumnList = []; - checkColumnList = getKeyList(cloneDeep(props?.columns), "label"); - checkedColumns.value = getKeyList(cloneDeep(filterColumns), "label"); - } - - const dropdown = { - dropdown: () => ( - - (size.value = "large")}> - 宽松 - - (size.value = "default")}> - 默认 - - (size.value = "small")}> - 紧凑 - - - ) - }; - - /** 列展示拖拽排序 */ - const rowDrop = (event: { preventDefault: () => void }) => { - event.preventDefault(); - nextTick(() => { - const wrapper: HTMLElement = (instance?.proxy?.$refs[`GroupRef${unref(props.tableKey)}`] as any).$el.firstElementChild; - Sortable.create(wrapper, { - animation: 300, - handle: ".drag-btn", - onEnd: ({ newIndex, oldIndex, item }) => { - const targetThElem = item; - const wrapperElem = targetThElem.parentNode as HTMLElement; - const oldColumn = dynamicColumns.value[oldIndex]; - const newColumn = dynamicColumns.value[newIndex]; - if (oldColumn?.fixed || newColumn?.fixed) { - // 当前列存在fixed属性 则不可拖拽 - const oldThElem = wrapperElem.children[oldIndex] as HTMLElement; - if (newIndex > oldIndex) { - wrapperElem.insertBefore(targetThElem, oldThElem); - } else { - wrapperElem.insertBefore(targetThElem, oldThElem ? oldThElem.nextElementSibling : oldThElem); - } - return; - } - const currentRow = dynamicColumns.value.splice(oldIndex, 1)[0]; - dynamicColumns.value.splice(newIndex, 0, currentRow); - } - }); - }).then(); - }; - - const isFixedColumn = (label: string) => { - return dynamicColumns.value.filter(item => transformI18n(item.label) === transformI18n(label))[0].fixed; - }; - - const rendTippyProps = (content: string) => { - // https://vue-tippy.netlify.app/props - return { - content, - offset: [0, 18], - duration: [300, 0], - followCursor: true, - hideOnClick: "toggle" - }; - }; - - const reference = { - reference: () => - }; - - return () => ( - <> -
-
- {slots?.title ? slots.title() :

{props.title}

} -
- {slots?.buttons ?
{slots.buttons()}
: null} - {props.tableRef?.size ? ( - <> - onExpand()} - /> - - - ) : null} - onReFresh()} /> - - - - - - - -
- handleCheckAllChange(value)} /> - onReset()}> - 重置 - -
- -
- - handleCheckedColumnsChange(value)}> - - {checkColumnList.map((item, index) => { - return ( -
- void }) => rowDrop(event)} - /> - handleCheckColumnListChange(value, item)}> - - {transformI18n(item)} - - -
- ); - })} -
-
-
-
-
-
-
- {slots.default({ - size: size.value, - dynamicColumns: dynamicColumns.value - })} -
- - ); - } -}); diff --git a/src/i18n/index.ts b/src/i18n/index.ts deleted file mode 100644 index 7b91edc..0000000 --- a/src/i18n/index.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { createI18n } from "vue-i18n"; - -// ? 从本地存储中获取数据 -const languageData = localStorage.getItem("i18nStore"); - -// 配置多语言 -const i18n = createI18n({ - // 如果要支持 compositionAPI,此项必须设置为 false - legacy: false, - // ? 全局注册$t方法 - globalInjection: true, - // 本地内容存在时,首次加载如果本地存储没有多语言需要再刷新 - messages: languageData ? JSON.parse(languageData).i18n : {} -}); - -export default i18n; diff --git a/src/layout/components/lay-notice/components/NoticeList.vue b/src/layout/components/lay-notice/components/NoticeList.vue index 7bc9922..346e805 100644 --- a/src/layout/components/lay-notice/components/NoticeList.vue +++ b/src/layout/components/lay-notice/components/NoticeList.vue @@ -1,24 +1,23 @@ - diff --git a/src/layout/components/lay-notice/data.ts b/src/layout/components/lay-notice/data.ts index bd49f5e..5d05243 100644 --- a/src/layout/components/lay-notice/data.ts +++ b/src/layout/components/lay-notice/data.ts @@ -1,99 +1,97 @@ -import { $t } from "@/plugins/i18n"; +import { $t } from '@/plugins/i18n'; export interface ListItem { - avatar: string; - title: string; - datetime: string; - type: string; - description: string; - status?: "primary" | "success" | "warning" | "info" | "danger"; - extra?: string; + avatar: string; + title: string; + datetime: string; + type: string; + description: string; + status?: 'primary' | 'success' | 'warning' | 'info' | 'danger'; + extra?: string; } export interface TabItem { - key: string; - name: string; - list: ListItem[]; - emptyText: string; + key: string; + name: string; + list: ListItem[]; + emptyText: string; } export const noticesData: TabItem[] = [ - { - key: "1", - name: $t("status.pureNotify"), - list: [], - emptyText: $t("status.pureNoNotify") - }, - { - key: "2", - name: $t("status.pureMessage"), - list: [ - { - avatar: "https://xiaoxian521.github.io/hyperlink/svg/smile1.svg", - title: "小铭 评论了你", - description: "诚在于心,信在于行,诚信在于心行合一。", - datetime: "今天", - type: "2" - }, - { - avatar: "https://xiaoxian521.github.io/hyperlink/svg/smile2.svg", - title: "李白 回复了你", - description: "长风破浪会有时,直挂云帆济沧海。", - datetime: "昨天", - type: "2" - }, - { - avatar: "https://xiaoxian521.github.io/hyperlink/svg/smile5.svg", - title: "标题", - description: - "请将鼠标移动到此处,以便测试超长的消息在此处将如何处理。本例中设置的描述最大行数为2,超过2行的描述内容将被省略并且可以通过tooltip查看完整内容", - datetime: "时间", - type: "2" - } - ], - emptyText: $t("status.pureNoMessage") - }, - { - key: "3", - name: $t("status.pureTodo"), - list: [ - { - avatar: "", - title: "第三方紧急代码变更", - description: - "小林提交于 2024-05-10,需在 2024-05-11 前完成代码变更任务", - datetime: "", - extra: "马上到期", - status: "danger", - type: "3" - }, - { - avatar: "", - title: "版本发布", - description: "指派小铭于 2024-06-18 前完成更新并发布", - datetime: "", - extra: "已耗时 8 天", - status: "warning", - type: "3" - }, - { - avatar: "", - title: "新功能开发", - description: "开发多租户管理", - datetime: "", - extra: "进行中", - type: "3" - }, - { - avatar: "", - title: "任务名称", - description: "任务需要在 2030-10-30 10:00 前启动", - datetime: "", - extra: "未开始", - status: "info", - type: "3" - } - ], - emptyText: $t("status.pureNoTodo") - } + { + key: '1', + name: $t('status.pureNotify'), + list: [], + emptyText: $t('status.pureNoNotify'), + }, + { + key: '2', + name: $t('status.pureMessage'), + list: [ + { + avatar: 'https://xiaoxian521.github.io/hyperlink/svg/smile1.svg', + title: '小铭 评论了你', + description: '诚在于心,信在于行,诚信在于心行合一。', + datetime: '今天', + type: '2', + }, + { + avatar: 'https://xiaoxian521.github.io/hyperlink/svg/smile2.svg', + title: '李白 回复了你', + description: '长风破浪会有时,直挂云帆济沧海。', + datetime: '昨天', + type: '2', + }, + { + avatar: 'https://xiaoxian521.github.io/hyperlink/svg/smile5.svg', + title: '标题', + description: '请将鼠标移动到此处,以便测试超长的消息在此处将如何处理。本例中设置的描述最大行数为2,超过2行的描述内容将被省略并且可以通过tooltip查看完整内容', + datetime: '时间', + type: '2', + }, + ], + emptyText: $t('status.pureNoMessage'), + }, + { + key: '3', + name: $t('status.pureTodo'), + list: [ + { + avatar: '', + title: '第三方紧急代码变更', + description: '小林提交于 2024-05-10,需在 2024-05-11 前完成代码变更任务', + datetime: '', + extra: '马上到期', + status: 'danger', + type: '3', + }, + { + avatar: '', + title: '版本发布', + description: '指派小铭于 2024-06-18 前完成更新并发布', + datetime: '', + extra: '已耗时 8 天', + status: 'warning', + type: '3', + }, + { + avatar: '', + title: '新功能开发', + description: '开发多租户管理', + datetime: '', + extra: '进行中', + type: '3', + }, + { + avatar: '', + title: '任务名称', + description: '任务需要在 2030-10-30 10:00 前启动', + datetime: '', + extra: '未开始', + status: 'info', + type: '3', + }, + ], + emptyText: $t('status.pureNoTodo'), + }, ]; diff --git a/src/layout/components/lay-notice/index.vue b/src/layout/components/lay-notice/index.vue index 4bee108..bc48a79 100644 --- a/src/layout/components/lay-notice/index.vue +++ b/src/layout/components/lay-notice/index.vue @@ -1,9 +1,9 @@ diff --git a/src/layout/components/lay-search/components/SearchHistoryItem.vue b/src/layout/components/lay-search/components/SearchHistoryItem.vue index 0ee9f19..487ce94 100644 --- a/src/layout/components/lay-search/components/SearchHistoryItem.vue +++ b/src/layout/components/lay-search/components/SearchHistoryItem.vue @@ -1,53 +1,44 @@ - diff --git a/src/layout/components/lay-search/components/SearchModal.vue b/src/layout/components/lay-search/components/SearchModal.vue index f6993f6..d4857b4 100644 --- a/src/layout/components/lay-search/components/SearchModal.vue +++ b/src/layout/components/lay-search/components/SearchModal.vue @@ -1,27 +1,26 @@ - diff --git a/src/layout/components/lay-search/components/SearchResult.vue b/src/layout/components/lay-search/components/SearchResult.vue index 12507b1..b30d1f3 100644 --- a/src/layout/components/lay-search/components/SearchResult.vue +++ b/src/layout/components/lay-search/components/SearchResult.vue @@ -1,15 +1,15 @@ - diff --git a/src/layout/components/lay-sidebar/NavMix.vue b/src/layout/components/lay-sidebar/NavMix.vue index c1562f2..ad83d83 100644 --- a/src/layout/components/lay-sidebar/NavMix.vue +++ b/src/layout/components/lay-sidebar/NavMix.vue @@ -1,205 +1,149 @@ - diff --git a/src/layout/components/lay-sidebar/components/SidebarBreadCrumb.vue b/src/layout/components/lay-sidebar/components/SidebarBreadCrumb.vue index 417b839..f195dc9 100644 --- a/src/layout/components/lay-sidebar/components/SidebarBreadCrumb.vue +++ b/src/layout/components/lay-sidebar/components/SidebarBreadCrumb.vue @@ -1,10 +1,9 @@ - diff --git a/src/layout/components/lay-sidebar/components/SidebarItem.vue b/src/layout/components/lay-sidebar/components/SidebarItem.vue index e664ce0..f9327f8 100644 --- a/src/layout/components/lay-sidebar/components/SidebarItem.vue +++ b/src/layout/components/lay-sidebar/components/SidebarItem.vue @@ -1,223 +1,142 @@ - - - diff --git a/src/layout/components/lay-tag/index.vue b/src/layout/components/lay-tag/index.vue index fa74ee9..8b01b21 100644 --- a/src/layout/components/lay-tag/index.vue +++ b/src/layout/components/lay-tag/index.vue @@ -1,56 +1,49 @@ - diff --git a/src/layout/hooks/useNav.ts b/src/layout/hooks/useNav.ts index 7bcc657..1664801 100644 --- a/src/layout/hooks/useNav.ts +++ b/src/layout/hooks/useNav.ts @@ -1,178 +1,178 @@ -import { storeToRefs } from "pinia"; -import { getConfig } from "@/config"; -import { useRouter } from "vue-router"; -import { emitter } from "@/utils/mitt"; -import Avatar from "@/assets/user.jpg"; -import { getTopMenu } from "@/router/utils"; -import { useFullscreen } from "@vueuse/core"; -import type { routeMetaType } from "../types"; -import { transformI18n } from "@/plugins/i18n"; -import { remainingPaths, router } from "@/router"; -import { computed, type CSSProperties } from "vue"; -import { useAppStoreHook } from "@/store/modules/app"; -import { useUserStoreHook } from "@/store/modules/user"; -import { isAllEmpty, useGlobal } from "@pureadmin/utils"; -import { useEpThemeStoreHook } from "@/store/modules/epTheme"; -import { usePermissionStoreHook } from "@/store/modules/permission"; -import ExitFullscreen from "@iconify-icons/ri/fullscreen-exit-fill"; -import Fullscreen from "@iconify-icons/ri/fullscreen-fill"; +import { storeToRefs } from 'pinia'; +import { getConfig } from '@/config'; +import { useRouter } from 'vue-router'; +import { emitter } from '@/utils/mitt'; +import Avatar from '@/assets/user.jpg'; +import { getTopMenu } from '@/router/utils'; +import { useFullscreen } from '@vueuse/core'; +import type { routeMetaType } from '../types'; +import { remainingPaths, router } from '@/router'; +import { computed, type CSSProperties } from 'vue'; +import { useAppStoreHook } from '@/store/modules/app'; +import { useUserStoreHook } from '@/store/modules/user'; +import { isAllEmpty, useGlobal } from '@pureadmin/utils'; +import { useEpThemeStoreHook } from '@/store/modules/epTheme'; +import { usePermissionStoreHook } from '@/store/modules/permission'; +import ExitFullscreen from '@iconify-icons/ri/fullscreen-exit-fill'; +import Fullscreen from '@iconify-icons/ri/fullscreen-fill'; +import { $t } from '@/plugins/i18n'; -const errorInfo = "The current routing configuration is incorrect, please check the configuration"; +const errorInfo = 'The current routing configuration is incorrect, please check the configuration'; export function useNav() { - const pureApp = useAppStoreHook(); - const routers = useRouter().options.routes; - const { isFullscreen, toggle } = useFullscreen(); - const { wholeMenus } = storeToRefs(usePermissionStoreHook()); - /** 平台`layout`中所有`el-tooltip`的`effect`配置,默认`light` */ - const tooltipEffect = getConfig()?.TooltipEffect ?? "light"; + const pureApp = useAppStoreHook(); + const routers = useRouter().options.routes; + const { isFullscreen, toggle } = useFullscreen(); + const { wholeMenus } = storeToRefs(usePermissionStoreHook()); + /** 平台`layout`中所有`el-tooltip`的`effect`配置,默认`light` */ + const tooltipEffect = getConfig()?.TooltipEffect ?? 'light'; - const getDivStyle = computed((): CSSProperties => { - return { - width: "100%", - display: "flex", - alignItems: "center", - justifyContent: "space-between", - overflow: "hidden" - }; - }); + const getDivStyle = computed((): CSSProperties => { + return { + width: '100%', + display: 'flex', + alignItems: 'center', + justifyContent: 'space-between', + overflow: 'hidden', + }; + }); - /** 头像(如果头像为空则使用 src/assets/user.jpg ) */ - const userAvatar = computed(() => { - return isAllEmpty(useUserStoreHook()?.avatar) ? Avatar : useUserStoreHook()?.avatar; - }); + /** 头像(如果头像为空则使用 src/assets/user.jpg ) */ + const userAvatar = computed(() => { + return isAllEmpty(useUserStoreHook()?.avatar) ? Avatar : useUserStoreHook()?.avatar; + }); - /** 昵称(如果昵称为空则显示用户名) */ - const username = computed(() => { - return isAllEmpty(useUserStoreHook()?.nickname) ? useUserStoreHook()?.username : useUserStoreHook()?.nickname; - }); + /** 昵称(如果昵称为空则显示用户名) */ + const username = computed(() => { + return isAllEmpty(useUserStoreHook()?.nickname) ? useUserStoreHook()?.username : useUserStoreHook()?.nickname; + }); - /** 设置国际化选中后的样式 */ - const getDropdownItemStyle = computed(() => { - return (locale, t) => { - return { - background: locale === t ? useEpThemeStoreHook().epThemeColor : "", - color: locale === t ? "#f4f4f5" : "#000" - }; - }; - }); + /** 设置国际化选中后的样式 */ + const getDropdownItemStyle = computed(() => { + return (locale, t) => { + return { + background: locale === t ? useEpThemeStoreHook().epThemeColor : '', + color: locale === t ? '#f4f4f5' : '#000', + }; + }; + }); - const getDropdownItemClass = computed(() => { - return (locale, t) => { - return locale === t ? "" : "dark:hover:!text-primary"; - }; - }); + const getDropdownItemClass = computed(() => { + return (locale, t) => { + return locale === t ? '' : 'dark:hover:!text-primary'; + }; + }); - const avatarsStyle = computed(() => { - return username.value ? { marginRight: "10px" } : ""; - }); + const avatarsStyle = computed(() => { + return username.value ? { marginRight: '10px' } : ''; + }); - const isCollapse = computed(() => { - return !pureApp.getSidebarStatus; - }); + const isCollapse = computed(() => { + return !pureApp.getSidebarStatus; + }); - const device = computed(() => { - return pureApp.getDevice; - }); + const device = computed(() => { + return pureApp.getDevice; + }); - const { $storage, $config } = useGlobal(); - const layout = computed(() => { - return $storage?.layout?.layout; - }); + const { $storage, $config } = useGlobal(); + const layout = computed(() => { + return $storage?.layout?.layout; + }); - const title = computed(() => { - return $config.Title; - }); + const title = computed(() => { + return $config.Title; + }); - const copyright = computed(() => $config.Copyright); + const copyright = computed(() => $config.Copyright); - /** 动态title */ - function changeTitle(meta: routeMetaType) { - const Title = getConfig().Title; - if (Title) document.title = `${transformI18n(meta.title)} | ${Title}`; - else document.title = transformI18n(meta.title); - } + /** 动态title */ + function changeTitle(meta: routeMetaType) { + const Title = getConfig().Title; + if (Title) document.title = `${$t(meta.title)} | ${Title}`; + else document.title = $t(meta.title); + } - /** 退出登录 */ - function logout() { - useUserStoreHook().logOut(); - } + /** 退出登录 */ + function logout() { + useUserStoreHook().logOut(); + } - function backTopMenu() { - router.push(getTopMenu()?.path); - } + function backTopMenu() { + router.push(getTopMenu()?.path); + } - function onPanel() { - emitter.emit("openPanel"); - } + function onPanel() { + emitter.emit('openPanel'); + } - function toAccountSettings() { - router.push({ name: "AccountSettings" }); - } + function toAccountSettings() { + router.push({ name: 'AccountSettings' }); + } - function toggleSideBar() { - pureApp.toggleSideBar(); - } + function toggleSideBar() { + pureApp.toggleSideBar(); + } - function handleResize(menuRef) { - menuRef?.handleResize(); - } + function handleResize(menuRef) { + menuRef?.handleResize(); + } - function resolvePath(route) { - if (!route.children) return console.error(errorInfo); - const httpReg = /^http(s?):\/\//; - const routeChildPath = route.children[0]?.path; - if (httpReg.test(routeChildPath)) { - return route.path + "/" + routeChildPath; - } else { - return routeChildPath; - } - } + function resolvePath(route) { + if (!route.children) return console.error(errorInfo); + const httpReg = /^http(s?):\/\//; + const routeChildPath = route.children[0]?.path; + if (httpReg.test(routeChildPath)) { + return route.path + '/' + routeChildPath; + } else { + return routeChildPath; + } + } - function menuSelect(indexPath: string) { - if (wholeMenus.value.length === 0 || isRemaining(indexPath)) return; - emitter.emit("changLayoutRoute", indexPath); - } + function menuSelect(indexPath: string) { + if (wholeMenus.value.length === 0 || isRemaining(indexPath)) return; + emitter.emit('changLayoutRoute', indexPath); + } - /** 判断路径是否参与菜单 */ - function isRemaining(path: string) { - return remainingPaths.includes(path); - } + /** 判断路径是否参与菜单 */ + function isRemaining(path: string) { + return remainingPaths.includes(path); + } - /** 获取`logo` */ - function getLogo() { - return new URL("/logo.svg", import.meta.url).href; - } + /** 获取`logo` */ + function getLogo() { + return new URL('/logo.svg', import.meta.url).href; + } - return { - title, - copyright, - device, - layout, - logout, - routers, - $storage, - isFullscreen, - Fullscreen, - ExitFullscreen, - toggle, - backTopMenu, - onPanel, - getDivStyle, - changeTitle, - toggleSideBar, - menuSelect, - handleResize, - resolvePath, - getLogo, - isCollapse, - pureApp, - username, - userAvatar, - avatarsStyle, - tooltipEffect, - toAccountSettings, - getDropdownItemStyle, - getDropdownItemClass - }; + return { + title, + copyright, + device, + layout, + logout, + routers, + $storage, + isFullscreen, + Fullscreen, + ExitFullscreen, + toggle, + backTopMenu, + onPanel, + getDivStyle, + changeTitle, + toggleSideBar, + menuSelect, + handleResize, + resolvePath, + getLogo, + isCollapse, + pureApp, + username, + userAvatar, + avatarsStyle, + tooltipEffect, + toAccountSettings, + getDropdownItemStyle, + getDropdownItemClass, + }; } diff --git a/src/layout/hooks/useTag.ts b/src/layout/hooks/useTag.ts index e82e36f..3330e99 100644 --- a/src/layout/hooks/useTag.ts +++ b/src/layout/hooks/useTag.ts @@ -1,241 +1,213 @@ -import { - ref, - unref, - computed, - reactive, - onMounted, - type CSSProperties, - getCurrentInstance -} from "vue"; -import type { tagsViewsType } from "../types"; -import { useRoute, useRouter } from "vue-router"; -import { transformI18n, $t } from "@/plugins/i18n"; -import { responsiveStorageNameSpace } from "@/config"; -import { useSettingStoreHook } from "@/store/modules/settings"; -import { useMultiTagsStoreHook } from "@/store/modules/multiTags"; -import { - isEqual, - isBoolean, - storageLocal, - toggleClass, - hasClass -} from "@pureadmin/utils"; +import { computed, type CSSProperties, getCurrentInstance, onMounted, reactive, ref, unref } from 'vue'; +import type { tagsViewsType } from '../types'; +import { useRoute, useRouter } from 'vue-router'; +import { responsiveStorageNameSpace } from '@/config'; +import { useSettingStoreHook } from '@/store/modules/settings'; +import { useMultiTagsStoreHook } from '@/store/modules/multiTags'; +import { hasClass, isBoolean, isEqual, storageLocal, toggleClass } from '@pureadmin/utils'; -import Fullscreen from "@iconify-icons/ri/fullscreen-fill"; -import CloseAllTags from "@iconify-icons/ri/subtract-line"; -import CloseOtherTags from "@iconify-icons/ri/text-spacing"; -import CloseRightTags from "@iconify-icons/ri/text-direction-l"; -import CloseLeftTags from "@iconify-icons/ri/text-direction-r"; -import RefreshRight from "@iconify-icons/ep/refresh-right"; -import Close from "@iconify-icons/ep/close"; +import Fullscreen from '@iconify-icons/ri/fullscreen-fill'; +import CloseAllTags from '@iconify-icons/ri/subtract-line'; +import CloseOtherTags from '@iconify-icons/ri/text-spacing'; +import CloseRightTags from '@iconify-icons/ri/text-direction-l'; +import CloseLeftTags from '@iconify-icons/ri/text-direction-r'; +import RefreshRight from '@iconify-icons/ep/refresh-right'; +import Close from '@iconify-icons/ep/close'; +import { $t } from '@/plugins/i18n'; export function useTags() { - const route = useRoute(); - const router = useRouter(); - const instance = getCurrentInstance(); - const pureSetting = useSettingStoreHook(); + const route = useRoute(); + const router = useRouter(); + const instance = getCurrentInstance(); + const pureSetting = useSettingStoreHook(); - const buttonTop = ref(0); - const buttonLeft = ref(0); - const translateX = ref(0); - const visible = ref(false); - const activeIndex = ref(-1); - // 当前右键选中的路由信息 - const currentSelect = ref({}); - const isScrolling = ref(false); + const buttonTop = ref(0); + const buttonLeft = ref(0); + const translateX = ref(0); + const visible = ref(false); + const activeIndex = ref(-1); + // 当前右键选中的路由信息 + const currentSelect = ref({}); + const isScrolling = ref(false); - /** 显示模式,默认灵动模式 */ - const showModel = ref( - storageLocal().getItem( - `${responsiveStorageNameSpace()}configure` - )?.showModel || "smart" - ); - /** 是否隐藏标签页,默认显示 */ - const showTags = - ref( - storageLocal().getItem( - `${responsiveStorageNameSpace()}configure` - ).hideTabs - ) ?? ref("false"); - const multiTags: any = computed(() => { - return useMultiTagsStoreHook().multiTags; - }); + /** 显示模式,默认灵动模式 */ + const showModel = ref(storageLocal().getItem(`${responsiveStorageNameSpace()}configure`)?.showModel || 'smart'); + /** 是否隐藏标签页,默认显示 */ + const showTags = ref(storageLocal().getItem(`${responsiveStorageNameSpace()}configure`).hideTabs) ?? ref('false'); + const multiTags: any = computed(() => { + return useMultiTagsStoreHook().multiTags; + }); - const tagsViews = reactive>([ - { - icon: RefreshRight, - text: $t("buttons.pureReload"), - divided: false, - disabled: false, - show: true - }, - { - icon: Close, - text: $t("buttons.pureCloseCurrentTab"), - divided: false, - disabled: multiTags.value.length > 1 ? false : true, - show: true - }, - { - icon: CloseLeftTags, - text: $t("buttons.pureCloseLeftTabs"), - divided: true, - disabled: multiTags.value.length > 1 ? false : true, - show: true - }, - { - icon: CloseRightTags, - text: $t("buttons.pureCloseRightTabs"), - divided: false, - disabled: multiTags.value.length > 1 ? false : true, - show: true - }, - { - icon: CloseOtherTags, - text: $t("buttons.pureCloseOtherTabs"), - divided: true, - disabled: multiTags.value.length > 2 ? false : true, - show: true - }, - { - icon: CloseAllTags, - text: $t("buttons.pureCloseAllTabs"), - divided: false, - disabled: multiTags.value.length > 1 ? false : true, - show: true - }, - { - icon: Fullscreen, - text: $t("buttons.pureContentFullScreen"), - divided: true, - disabled: false, - show: true - } - ]); + const tagsViews = reactive>([ + { + icon: RefreshRight, + text: $t('buttons.pureReload'), + divided: false, + disabled: false, + show: true, + }, + { + icon: Close, + text: $t('buttons.pureCloseCurrentTab'), + divided: false, + disabled: multiTags.value.length > 1 ? false : true, + show: true, + }, + { + icon: CloseLeftTags, + text: $t('buttons.pureCloseLeftTabs'), + divided: true, + disabled: multiTags.value.length > 1 ? false : true, + show: true, + }, + { + icon: CloseRightTags, + text: $t('buttons.pureCloseRightTabs'), + divided: false, + disabled: multiTags.value.length > 1 ? false : true, + show: true, + }, + { + icon: CloseOtherTags, + text: $t('buttons.pureCloseOtherTabs'), + divided: true, + disabled: multiTags.value.length > 2 ? false : true, + show: true, + }, + { + icon: CloseAllTags, + text: $t('buttons.pureCloseAllTabs'), + divided: false, + disabled: multiTags.value.length > 1 ? false : true, + show: true, + }, + { + icon: Fullscreen, + text: $t('buttons.pureContentFullScreen'), + divided: true, + disabled: false, + show: true, + }, + ]); - function conditionHandle(item, previous, next) { - if (isBoolean(route?.meta?.showLink) && route?.meta?.showLink === false) { - if (Object.keys(route.query).length > 0) { - return isEqual(route.query, item.query) ? previous : next; - } else { - return isEqual(route.params, item.params) ? previous : next; - } - } else { - return route.path === item.path ? previous : next; - } - } + function conditionHandle(item, previous, next) { + if (isBoolean(route?.meta?.showLink) && route?.meta?.showLink === false) { + if (Object.keys(route.query).length > 0) { + return isEqual(route.query, item.query) ? previous : next; + } else { + return isEqual(route.params, item.params) ? previous : next; + } + } else { + return route.path === item.path ? previous : next; + } + } - const iconIsActive = computed(() => { - return (item, index) => { - if (index === 0) return; - return conditionHandle(item, true, false); - }; - }); + const iconIsActive = computed(() => { + return (item, index) => { + if (index === 0) return; + return conditionHandle(item, true, false); + }; + }); - const linkIsActive = computed(() => { - return item => { - return conditionHandle(item, "is-active", ""); - }; - }); + const linkIsActive = computed(() => { + return item => { + return conditionHandle(item, 'is-active', ''); + }; + }); - const scheduleIsActive = computed(() => { - return item => { - return conditionHandle(item, "schedule-active", ""); - }; - }); + const scheduleIsActive = computed(() => { + return item => { + return conditionHandle(item, 'schedule-active', ''); + }; + }); - const getTabStyle = computed((): CSSProperties => { - return { - transform: `translateX(${translateX.value}px)`, - transition: isScrolling.value ? "none" : "transform 0.5s ease-in-out" - }; - }); + const getTabStyle = computed((): CSSProperties => { + return { + transform: `translateX(${translateX.value}px)`, + transition: isScrolling.value ? 'none' : 'transform 0.5s ease-in-out', + }; + }); - const getContextMenuStyle = computed((): CSSProperties => { - return { left: buttonLeft.value + "px", top: buttonTop.value + "px" }; - }); + const getContextMenuStyle = computed((): CSSProperties => { + return { left: buttonLeft.value + 'px', top: buttonTop.value + 'px' }; + }); - const closeMenu = () => { - visible.value = false; - }; + const closeMenu = () => { + visible.value = false; + }; - /** 鼠标移入添加激活样式 */ - function onMouseenter(index) { - if (index) activeIndex.value = index; - if (unref(showModel) === "smart") { - if (hasClass(instance.refs["schedule" + index][0], "schedule-active")) - return; - toggleClass(true, "schedule-in", instance.refs["schedule" + index][0]); - toggleClass(false, "schedule-out", instance.refs["schedule" + index][0]); - } else { - if (hasClass(instance.refs["dynamic" + index][0], "is-active")) return; - toggleClass(true, "card-in", instance.refs["dynamic" + index][0]); - toggleClass(false, "card-out", instance.refs["dynamic" + index][0]); - } - } + /** 鼠标移入添加激活样式 */ + function onMouseenter(index) { + if (index) activeIndex.value = index; + if (unref(showModel) === 'smart') { + if (hasClass(instance.refs['schedule' + index][0], 'schedule-active')) return; + toggleClass(true, 'schedule-in', instance.refs['schedule' + index][0]); + toggleClass(false, 'schedule-out', instance.refs['schedule' + index][0]); + } else { + if (hasClass(instance.refs['dynamic' + index][0], 'is-active')) return; + toggleClass(true, 'card-in', instance.refs['dynamic' + index][0]); + toggleClass(false, 'card-out', instance.refs['dynamic' + index][0]); + } + } - /** 鼠标移出恢复默认样式 */ - function onMouseleave(index) { - activeIndex.value = -1; - if (unref(showModel) === "smart") { - if (hasClass(instance.refs["schedule" + index][0], "schedule-active")) - return; - toggleClass(false, "schedule-in", instance.refs["schedule" + index][0]); - toggleClass(true, "schedule-out", instance.refs["schedule" + index][0]); - } else { - if (hasClass(instance.refs["dynamic" + index][0], "is-active")) return; - toggleClass(false, "card-in", instance.refs["dynamic" + index][0]); - toggleClass(true, "card-out", instance.refs["dynamic" + index][0]); - } - } + /** 鼠标移出恢复默认样式 */ + function onMouseleave(index) { + activeIndex.value = -1; + if (unref(showModel) === 'smart') { + if (hasClass(instance.refs['schedule' + index][0], 'schedule-active')) return; + toggleClass(false, 'schedule-in', instance.refs['schedule' + index][0]); + toggleClass(true, 'schedule-out', instance.refs['schedule' + index][0]); + } else { + if (hasClass(instance.refs['dynamic' + index][0], 'is-active')) return; + toggleClass(false, 'card-in', instance.refs['dynamic' + index][0]); + toggleClass(true, 'card-out', instance.refs['dynamic' + index][0]); + } + } - function onContentFullScreen() { - pureSetting.hiddenSideBar - ? pureSetting.changeSetting({ key: "hiddenSideBar", value: false }) - : pureSetting.changeSetting({ key: "hiddenSideBar", value: true }); - } + function onContentFullScreen() { + pureSetting.hiddenSideBar + ? pureSetting.changeSetting({ + key: 'hiddenSideBar', + value: false, + }) + : pureSetting.changeSetting({ key: 'hiddenSideBar', value: true }); + } - onMounted(() => { - if (!showModel.value) { - const configure = storageLocal().getItem( - `${responsiveStorageNameSpace()}configure` - ); - configure.showModel = "card"; - storageLocal().setItem( - `${responsiveStorageNameSpace()}configure`, - configure - ); - } - }); + onMounted(() => { + if (!showModel.value) { + const configure = storageLocal().getItem(`${responsiveStorageNameSpace()}configure`); + configure.showModel = 'card'; + storageLocal().setItem(`${responsiveStorageNameSpace()}configure`, configure); + } + }); - return { - Close, - route, - router, - visible, - showTags, - instance, - multiTags, - showModel, - tagsViews, - buttonTop, - buttonLeft, - translateX, - pureSetting, - activeIndex, - getTabStyle, - isScrolling, - iconIsActive, - linkIsActive, - currentSelect, - scheduleIsActive, - getContextMenuStyle, - $t, - closeMenu, - onMounted, - onMouseenter, - onMouseleave, - transformI18n, - onContentFullScreen - }; + return { + Close, + route, + router, + visible, + showTags, + instance, + multiTags, + showModel, + tagsViews, + buttonTop, + buttonLeft, + translateX, + pureSetting, + activeIndex, + getTabStyle, + isScrolling, + iconIsActive, + linkIsActive, + currentSelect, + scheduleIsActive, + getContextMenuStyle, + $t, + closeMenu, + onMounted, + onMouseenter, + onMouseleave, + onContentFullScreen, + }; } diff --git a/src/layout/index.vue b/src/layout/index.vue index 7baea67..a4e693f 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -1,36 +1,46 @@ - - - diff --git a/src/layout/types.ts b/src/layout/types.ts index 1d25a0d..9c25be7 100644 --- a/src/layout/types.ts +++ b/src/layout/types.ts @@ -1,92 +1,93 @@ -import type { IconifyIcon } from "@iconify/vue"; +import type { IconifyIcon } from '@iconify/vue'; + const { VITE_HIDE_HOME } = import.meta.env; export const routerArrays: Array = - VITE_HIDE_HOME === "false" - ? [ - { - path: "/welcome", - meta: { - title: "menus.pureHome", - icon: "ep:home-filled" - } - } - ] - : []; + VITE_HIDE_HOME === 'false' + ? [ + { + path: '/welcome', + meta: { + title: 'menus.pureHome', + icon: 'ep:home-filled', + }, + }, + ] + : []; export type routeMetaType = { - title?: string; - icon?: string | IconifyIcon; - showLink?: boolean; - savedPosition?: boolean; - auths?: Array; + title?: string; + icon?: string | IconifyIcon; + showLink?: boolean; + savedPosition?: boolean; + auths?: Array; }; export type RouteConfigs = { - path?: string; - query?: object; - params?: object; - meta?: routeMetaType; - children?: RouteConfigs[]; - name?: string; + path?: string; + query?: object; + params?: object; + meta?: routeMetaType; + children?: RouteConfigs[]; + name?: string; }; export type multiTagsType = { - tags: Array; + tags: Array; }; export type tagsViewsType = { - icon: string | IconifyIcon; - text: string; - divided: boolean; - disabled: boolean; - show: boolean; + icon: string | IconifyIcon; + text: string; + divided: boolean; + disabled: boolean; + show: boolean; }; export interface setType { - sidebar: { - opened: boolean; - withoutAnimation: boolean; - isClickCollapse: boolean; - }; - device: string; - fixedHeader: boolean; - classes: { - hideSidebar: boolean; - openSidebar: boolean; - withoutAnimation: boolean; - mobile: boolean; - }; - hideTabs: boolean; + sidebar: { + opened: boolean; + withoutAnimation: boolean; + isClickCollapse: boolean; + }; + device: string; + fixedHeader: boolean; + classes: { + hideSidebar: boolean; + openSidebar: boolean; + withoutAnimation: boolean; + mobile: boolean; + }; + hideTabs: boolean; } export type menuType = { - id?: number; - name?: string; - path?: string; - noShowingChildren?: boolean; - children?: menuType[]; - value: unknown; - meta?: { - icon?: string; - title?: string; - rank?: number; - showParent?: boolean; - extraIcon?: string; - }; - showTooltip?: boolean; - parentId?: number; - pathList?: number[]; - redirect?: string; + id?: number; + name?: string; + path?: string; + noShowingChildren?: boolean; + children?: menuType[]; + value: unknown; + meta?: { + icon?: string; + title?: string; + rank?: number; + showParent?: boolean; + extraIcon?: string; + }; + showTooltip?: boolean; + parentId?: number; + pathList?: number[]; + redirect?: string; }; export type themeColorsType = { - color: string; - themeColor: string; + color: string; + themeColor: string; }; export interface scrollbarDomType extends HTMLElement { - wrap?: { - offsetWidth: number; - }; + wrap?: { + offsetWidth: number; + }; } diff --git a/src/main.ts b/src/main.ts index bd8b4fa..4aa6b4e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,55 +1,55 @@ -import { useEcharts } from "@/plugins/echarts"; -import { useElementPlus } from "@/plugins/elementPlus"; -import { useI18n } from "@/plugins/i18n"; -import { useVxeTable } from "@/plugins/vxeTable"; -import { setupStore } from "@/store"; -import { injectResponsiveStorage } from "@/utils/responsive"; -import { MotionPlugin } from "@vueuse/motion"; -import { createApp, type Directive } from "vue"; -import App from "./App.vue"; -import { getPlatformConfig } from "./config"; -import router from "./router"; +import { useEcharts } from '@/plugins/echarts'; +import { useElementPlus } from '@/plugins/elementPlus'; +import i18n from '@/plugins/i18n'; +import { useVxeTable } from '@/plugins/vxeTable'; +import { setupStore } from '@/store'; +import { injectResponsiveStorage } from '@/utils/responsive'; +import { MotionPlugin } from '@vueuse/motion'; +import { createApp, type Directive } from 'vue'; +import App from './App.vue'; +import { getPlatformConfig } from './config'; +import router from './router'; // 全局注册@iconify/vue图标库 -import PureDescriptions from "@pureadmin/descriptions"; -import Table from "@pureadmin/table"; -import { FontIcon, IconifyIconOffline, IconifyIconOnline } from "./components/ReIcon"; +import PureDescriptions from '@pureadmin/descriptions'; +import Table from '@pureadmin/table'; +import { FontIcon, IconifyIconOffline, IconifyIconOnline } from './components/ReIcon'; // 引入重置样式 -import "./style/reset.scss"; +import './style/reset.scss'; // 导入公共样式 -import "./style/index.scss"; +import './style/index.scss'; // 一定要在main.ts中导入tailwind.css,防止vite每次hmr都会请求src/style/index.scss整体css文件导致热更新慢的问题 -import "element-plus/dist/index.css"; -import "./style/tailwind.css"; +import 'element-plus/dist/index.css'; +import './style/tailwind.css'; // 导入字体图标 -import "./assets/iconfont/iconfont.css"; -import "./assets/iconfont/iconfont.js"; +import './assets/iconfont/iconfont.css'; +import './assets/iconfont/iconfont.js'; // 自定义指令 -import * as directives from "@/directives"; +import * as directives from '@/directives'; // 全局注册按钮级别权限组件 -import { Auth } from "@/components/ReAuth"; +import { Auth } from '@/components/ReAuth'; // 全局注册vue-tippy -import "tippy.js/dist/tippy.css"; -import "tippy.js/themes/light.css"; -import VueTippy from "vue-tippy"; +import 'tippy.js/dist/tippy.css'; +import 'tippy.js/themes/light.css'; +import VueTippy from 'vue-tippy'; const app = createApp(App); Object.keys(directives).forEach(key => { - app.directive(key, (directives as { [key: string]: Directive })[key]); + app.directive(key, (directives as { [key: string]: Directive })[key]); }); -app.component("IconifyIconOffline", IconifyIconOffline); -app.component("IconifyIconOnline", IconifyIconOnline); -app.component("FontIcon", FontIcon); -app.component("Auth", Auth); +app.component('IconifyIconOffline', IconifyIconOffline); +app.component('IconifyIconOnline', IconifyIconOnline); +app.component('FontIcon', FontIcon); +app.component('Auth', Auth); app.use(VueTippy); getPlatformConfig(app).then(async config => { - setupStore(app); - app.use(router); - await router.isReady(); - injectResponsiveStorage(app, config); - app.use(MotionPlugin).use(useI18n).use(useElementPlus).use(Table).use(useVxeTable).use(PureDescriptions).use(useEcharts); - app.mount("#app"); + setupStore(app); + app.use(router).use(i18n); + await router.isReady(); + injectResponsiveStorage(app, config); + app.use(MotionPlugin).use(useElementPlus).use(Table).use(useVxeTable).use(PureDescriptions).use(useEcharts); + app.mount('#app'); }); diff --git a/src/plugins/i18n.ts b/src/plugins/i18n.ts index 0e0ae1e..3b73d5b 100644 --- a/src/plugins/i18n.ts +++ b/src/plugins/i18n.ts @@ -1,116 +1,21 @@ // 多组件库的国际化和本地项目国际化兼容 -import { type I18n, createI18n } from "vue-i18n"; -import type { App, WritableComputedRef } from "vue"; -import { responsiveStorageNameSpace } from "@/config"; -import { storageLocal, isObject } from "@pureadmin/utils"; +import { createI18n } from 'vue-i18n'; -// element-plus国际化 -import enLocale from "element-plus/es/locale/lang/en"; -import zhLocale from "element-plus/es/locale/lang/zh-cn"; +// ? 从本地存储中获取数据 +const languageData = localStorage.getItem('i18nStore'); -const siphonI18n = (function () { - // 仅初始化一次国际化配置 - let cache = Object.fromEntries( - Object.entries( - import.meta.glob("../../locales/*.y(a)?ml", { eager: true }) - ).map(([key, value]: any) => { - const matched = key.match(/([A-Za-z0-9-_]+)\./i)[1]; - return [matched, value.default]; - }) - ); - return (prefix = "zh-CN") => { - return cache[prefix]; - }; -})(); - -export const localesConfigs = { - zh: { - ...siphonI18n("zh-CN"), - ...zhLocale - }, - en: { - ...siphonI18n("en"), - ...enLocale - } -}; - -/** 获取对象中所有嵌套对象的key键,并将它们用点号分割组成字符串 */ -function getObjectKeys(obj) { - const stack = []; - const keys: Set = new Set(); - - stack.push({ obj, key: "" }); - - while (stack.length > 0) { - const { obj, key } = stack.pop(); - - for (const k in obj) { - const newKey = key ? `${key}.${k}` : k; - - if (obj[k] && isObject(obj[k])) { - stack.push({ obj: obj[k], key: newKey }); - } else { - keys.add(newKey); - } - } - } - - return keys; -} - -/** 将展开的key缓存 */ -const keysCache: Map> = new Map(); -const flatI18n = (prefix = "zh-CN") => { - let cache = keysCache.get(prefix); - if (!cache) { - cache = getObjectKeys(siphonI18n(prefix)); - keysCache.set(prefix, cache); - } - return cache; -}; - -/** - * 国际化转换工具函数(自动读取根目录locales文件夹下文件进行国际化匹配) - * @param message message - * @returns 转化后的message - */ -export function transformI18n(message: any = "") { - if (!message) { - return ""; - } - - // 处理存储动态路由的title,格式 {zh:"",en:""} - if (typeof message === "object") { - const locale: string | WritableComputedRef | any = - i18n.global.locale; - return message[locale?.value]; - } - - const key = message.match(/(\S*)\./)?.input; - - if (key && flatI18n("zh-CN").has(key)) { - return i18n.global.t.call(i18n.global.locale, message); - } else if (!key && Object.hasOwn(siphonI18n("zh-CN"), message)) { - // 兼容非嵌套形式的国际化写法 - return i18n.global.t.call(i18n.global.locale, message); - } else { - return message; - } -} - -/** 此函数只是配合i18n Ally插件来进行国际化智能提示,并无实际意义(只对提示起作用),如果不需要国际化可删除 */ -export const $t = (key: string) => key; - -export const i18n: I18n = createI18n({ - legacy: false, - locale: - storageLocal().getItem( - `${responsiveStorageNameSpace()}locale` - )?.locale ?? "zh", - fallbackLocale: "en", - messages: localesConfigs +// 配置多语言 +const i18n = createI18n({ + // 如果要支持 compositionAPI,此项必须设置为 false + legacy: false, + locale: 'zh', + fallbackLocale: 'en', + // ? 全局注册$t方法 + globalInjection: true, + // 本地内容存在时,首次加载如果本地存储没有多语言需要再刷新 + messages: languageData ? JSON.parse(languageData).i18n : {}, }); -export function useI18n(app: App) { - app.use(i18n); -} +export const $t: any = i18n.global.t as any; + +export default i18n; diff --git a/src/plugins/vxeTable.ts b/src/plugins/vxeTable.ts index 4bd58d1..f09a728 100644 --- a/src/plugins/vxeTable.ts +++ b/src/plugins/vxeTable.ts @@ -1,104 +1,63 @@ -import "vxe-table/lib/style.css"; +import 'vxe-table/lib/style.css'; // import "xe-utils"; // import XEUtils from "xe-utils"; -import type { App } from "vue"; -// import { i18n } from "@/plugins/i18n"; +import type { App } from 'vue'; // import zh from "vxe-table/lib/locale/lang/zh-CN"; // import en from "vxe-table/lib/locale/lang/en-US"; - -import { - // 全局对象 - VXETable, - // 表格功能 - // Filter, - // Edit, - // Menu, - // Export, - // Keyboard, - // Validator, - Custom, - // 可选组件 - Icon, - Column, - Grid, - Pager, - Select, - // Colgroup, - // Tooltip, - // Toolbar, - // Form, - // FormItem, - // FormGather, - // Checkbox, - // CheckboxGroup, - // Radio, - // RadioGroup, - // RadioButton, - // Switch, - // Input, - // Optgroup, - // Option, - // Textarea, - // Button, - // Modal, - // List, - // Pulldown, - // 表格 - Table -} from "vxe-table"; +import { Column, Custom, Grid, Icon, Pager, Select, Table, VXETable } from 'vxe-table'; // 全局默认参数 VXETable.config({ - // i18n: (key, args) => { - // return unref(i18n.global.locale) === "zh" - // ? XEUtils.toFormatString(XEUtils.get(zh, key), args) - // : XEUtils.toFormatString(XEUtils.get(en, key), args); - // }, - // translate(key) { - // const NAMESPACED = ["el.", "buttons."]; - // if (key && NAMESPACED.findIndex(v => key.includes(v)) !== -1) { - // return i18n.global.t.call(i18n.global.locale, key); - // } - // return key; - // } + // i18n: (key, args) => { + // return unref(i18n.global.locale) === "zh" + // ? XEUtils.toFormatString(XEUtils.get(zh, key), args) + // : XEUtils.toFormatString(XEUtils.get(en, key), args); + // }, + // translate(key) { + // const NAMESPACED = ["el.", "buttons."]; + // if (key && NAMESPACED.findIndex(v => key.includes(v)) !== -1) { + // return i18n.global.t.call(i18n.global.locale, key); + // } + // return key; + // } }); export function useVxeTable(app: App) { - // 表格功能 - app - // .use(Filter) - // .use(Edit) - // .use(Menu) - // .use(Export) - // .use(Keyboard) - // .use(Validator) - .use(Custom) - // 可选组件 - .use(Icon) - .use(Column) - .use(Grid) - .use(Pager) - .use(Select) - // .use(Colgroup) - // .use(Tooltip) - // .use(Toolbar) - // .use(Form) - // .use(FormItem) - // .use(FormGather) - // .use(Checkbox) - // .use(CheckboxGroup) - // .use(Radio) - // .use(RadioGroup) - // .use(RadioButton) - // .use(Switch) - // .use(Input) - // .use(Optgroup) - // .use(Option) - // .use(Textarea) - // .use(Button) - // .use(Modal) - // .use(List) - // .use(Pulldown) - // 安装表格 - .use(Table); + // 表格功能 + app + // .use(Filter) + // .use(Edit) + // .use(Menu) + // .use(Export) + // .use(Keyboard) + // .use(Validator) + .use(Custom) + // 可选组件 + .use(Icon) + .use(Column) + .use(Grid) + .use(Pager) + .use(Select) + // .use(Colgroup) + // .use(Tooltip) + // .use(Toolbar) + // .use(Form) + // .use(FormItem) + // .use(FormGather) + // .use(Checkbox) + // .use(CheckboxGroup) + // .use(Radio) + // .use(RadioGroup) + // .use(RadioButton) + // .use(Switch) + // .use(Input) + // .use(Optgroup) + // .use(Option) + // .use(Textarea) + // .use(Button) + // .use(Modal) + // .use(List) + // .use(Pulldown) + // 安装表格 + .use(Table); } diff --git a/src/router/index.ts b/src/router/index.ts index d188a87..2081df2 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -1,30 +1,29 @@ -import "@/utils/sso"; -import Cookies from "js-cookie"; -import { getConfig } from "@/config"; -import NProgress from "@/utils/progress"; -import { transformI18n } from "@/plugins/i18n"; -import { buildHierarchyTree } from "@/utils/tree"; -import remainingRouter from "./modules/remaining"; -import { useMultiTagsStoreHook } from "@/store/modules/multiTags"; -import { usePermissionStoreHook } from "@/store/modules/permission"; -import { isAllEmpty, isUrl, openLink, storageLocal } from "@pureadmin/utils"; -import { ascending, findRouteByPath, formatFlatteningRoutes, formatTwoStageRoutes, getHistoryMode, getTopMenu, handleAliveRoute, initRouter, isOneOfArray } from "./utils"; -import { createRouter, type RouteComponent, type Router, type RouteRecordRaw } from "vue-router"; -import { type DataInfo, multipleTabsKey, removeToken, userKey } from "@/utils/auth"; +import '@/utils/sso'; +import Cookies from 'js-cookie'; +import { getConfig } from '@/config'; +import NProgress from '@/utils/progress'; +import { buildHierarchyTree } from '@/utils/tree'; +import remainingRouter from './modules/remaining'; +import { useMultiTagsStoreHook } from '@/store/modules/multiTags'; +import { usePermissionStoreHook } from '@/store/modules/permission'; +import { isAllEmpty, isUrl, openLink, storageLocal } from '@pureadmin/utils'; +import { ascending, findRouteByPath, formatFlatteningRoutes, formatTwoStageRoutes, getHistoryMode, getTopMenu, handleAliveRoute, initRouter, isOneOfArray } from './utils'; +import { createRouter, type RouteComponent, type Router, type RouteRecordRaw } from 'vue-router'; +import { type DataInfo, multipleTabsKey, removeToken, userKey } from '@/utils/auth'; /** 自动导入全部静态路由,无需再手动引入!匹配 src/router/modules 目录(任何嵌套级别)中具有 .ts 扩展名的所有文件,除了 remaining.ts 文件 * 如何匹配所有文件请看:https://github.com/mrmlnc/fast-glob#basic-syntax * 如何排除文件请看:https://cn.vitejs.dev/guide/features.html#negative-patterns */ -const modules: Record = import.meta.glob(["./modules/**/*.ts", "!./modules/**/remaining.ts"], { - eager: true +const modules: Record = import.meta.glob(['./modules/**/*.ts', '!./modules/**/remaining.ts'], { + eager: true, }); /** 原始静态路由(未做任何处理) */ const routes = []; Object.keys(modules).forEach(key => { - routes.push(modules[key].default); + routes.push(modules[key].default); }); /** 导出处理后的静态路由(三级及以上的路由全部拍成二级) */ @@ -35,137 +34,137 @@ export const constantMenus: Array = ascending(routes.flat(Infini /** 不参与菜单的路由 */ export const remainingPaths = Object.keys(remainingRouter).map(v => { - return remainingRouter[v].path; + return remainingRouter[v].path; }); /** 创建路由实例 */ export const router: Router = createRouter({ - history: getHistoryMode(import.meta.env.VITE_ROUTER_HISTORY), - routes: constantRoutes.concat(...(remainingRouter as any)), - strict: true, - scrollBehavior(to, from, savedPosition) { - return new Promise(resolve => { - if (savedPosition) { - return savedPosition; - } else { - if (from.meta.saveSrollTop) { - const top: number = document.documentElement.scrollTop || document.body.scrollTop; - resolve({ left: 0, top }); - } - } - }); - } + history: getHistoryMode(import.meta.env.VITE_ROUTER_HISTORY), + routes: constantRoutes.concat(...(remainingRouter as any)), + strict: true, + scrollBehavior(to, from, savedPosition) { + return new Promise(resolve => { + if (savedPosition) { + return savedPosition; + } else { + if (from.meta.saveSrollTop) { + const top: number = document.documentElement.scrollTop || document.body.scrollTop; + resolve({ left: 0, top }); + } + } + }); + }, }); /** 重置路由 */ export function resetRouter() { - router.getRoutes().forEach(route => { - const { name, meta } = route; - if (name && router.hasRoute(name) && meta?.backstage) { - router.removeRoute(name); - router.options.routes = formatTwoStageRoutes(formatFlatteningRoutes(buildHierarchyTree(ascending(routes.flat(Infinity))))); - } - }); - usePermissionStoreHook().clearAllCachePage(); + router.getRoutes().forEach(route => { + const { name, meta } = route; + if (name && router.hasRoute(name) && meta?.backstage) { + router.removeRoute(name); + router.options.routes = formatTwoStageRoutes(formatFlatteningRoutes(buildHierarchyTree(ascending(routes.flat(Infinity))))); + } + }); + usePermissionStoreHook().clearAllCachePage(); } /** 路由白名单 */ -const whiteList = ["/login"]; +const whiteList = ['/login']; const { VITE_HIDE_HOME } = import.meta.env; router.beforeEach((to: ToRouteType, _from, next) => { - if (to.meta?.keepAlive) { - handleAliveRoute(to, "add"); - // 页面整体刷新和点击标签页刷新 - if (_from.name === undefined || _from.name === "Redirect") { - handleAliveRoute(to); - } - } - const userInfo = storageLocal().getItem>(userKey); - NProgress.start(); - const externalLink = isUrl(to?.name as string); - if (!externalLink) { - to.matched.some(item => { - if (!item.meta.title) return ""; - const Title = getConfig().Title; - if (Title) document.title = `${transformI18n(item.meta.title)} | ${Title}`; - else document.title = transformI18n(item.meta.title); - }); - } + if (to.meta?.keepAlive) { + handleAliveRoute(to, 'add'); + // 页面整体刷新和点击标签页刷新 + if (_from.name === undefined || _from.name === 'Redirect') { + handleAliveRoute(to); + } + } + const userInfo = storageLocal().getItem>(userKey); + NProgress.start(); + const externalLink = isUrl(to?.name as string); + if (!externalLink) { + to.matched.some(item => { + if (!item.meta.title) return ''; + const Title = getConfig().Title; + if (Title) document.title = `${item.meta.title} | ${Title}`; + else document.title = item.meta.title; + }); + } - /** 如果已经登录并存在登录信息后不能跳转到路由白名单,而是继续保持在当前页面 */ - function toCorrectRoute() { - whiteList.includes(to.fullPath) ? next(_from.fullPath) : next(); - } + /** 如果已经登录并存在登录信息后不能跳转到路由白名单,而是继续保持在当前页面 */ + function toCorrectRoute() { + whiteList.includes(to.fullPath) ? next(_from.fullPath) : next(); + } - if (Cookies.get(multipleTabsKey) && userInfo) { - // 无权限跳转403页面 - if (to.meta?.roles && !isOneOfArray(to.meta?.roles, userInfo?.roles)) { - next({ path: "/error/403" }); - } - // 开启隐藏首页后在浏览器地址栏手动输入首页welcome路由则跳转到404页面 - if (VITE_HIDE_HOME === "true" && to.fullPath === "/welcome") { - next({ path: "/error/404" }); - } - if (_from?.name) { - // name为超链接 - if (externalLink) { - openLink(to?.name as string); - NProgress.done(); - } else { - toCorrectRoute(); - } - } else { - // 刷新 - if (usePermissionStoreHook().wholeMenus.length === 0 && to.path !== "/login") { - initRouter().then((router: Router) => { - if (!useMultiTagsStoreHook().getMultiTagsCache) { - const { path } = to; - const route = findRouteByPath(path, router.options.routes[0].children); - getTopMenu(true); - // query、params模式路由传参数的标签页不在此处处理 - if (route && route.meta?.title) { - if (isAllEmpty(route.parentId) && route.meta?.backstage) { - // 此处为动态顶级路由(目录) - const { path, name, meta } = route.children[0]; - useMultiTagsStoreHook().handleTags("push", { - path, - name, - meta - }); - } else { - const { path, name, meta } = route; - useMultiTagsStoreHook().handleTags("push", { - path, - name, - meta - }); - } - } - } - // 确保动态路由完全加入路由列表并且不影响静态路由(注意:动态路由刷新时router.beforeEach可能会触发两次,第一次触发动态路由还未完全添加,第二次动态路由才完全添加到路由列表,如果需要在router.beforeEach做一些判断可以在to.name存在的条件下去判断,这样就只会触发一次) - if (isAllEmpty(to.name)) router.push(to.fullPath); - }); - } - toCorrectRoute(); - } - } else { - if (to.path !== "/login") { - if (whiteList.indexOf(to.path) !== -1) { - next(); - } else { - removeToken(); - next({ path: "/login" }); - } - } else { - next(); - } - } + if (Cookies.get(multipleTabsKey) && userInfo) { + // 无权限跳转403页面 + if (to.meta?.roles && !isOneOfArray(to.meta?.roles, userInfo?.roles)) { + next({ path: '/error/403' }); + } + // 开启隐藏首页后在浏览器地址栏手动输入首页welcome路由则跳转到404页面 + if (VITE_HIDE_HOME === 'true' && to.fullPath === '/welcome') { + next({ path: '/error/404' }); + } + if (_from?.name) { + // name为超链接 + if (externalLink) { + openLink(to?.name as string); + NProgress.done(); + } else { + toCorrectRoute(); + } + } else { + // 刷新 + if (usePermissionStoreHook().wholeMenus.length === 0 && to.path !== '/login') { + initRouter().then((router: Router) => { + if (!useMultiTagsStoreHook().getMultiTagsCache) { + const { path } = to; + const route = findRouteByPath(path, router.options.routes[0].children); + getTopMenu(true); + // query、params模式路由传参数的标签页不在此处处理 + if (route && route.meta?.title) { + if (isAllEmpty(route.parentId) && route.meta?.backstage) { + // 此处为动态顶级路由(目录) + const { path, name, meta } = route.children[0]; + useMultiTagsStoreHook().handleTags('push', { + path, + name, + meta, + }); + } else { + const { path, name, meta } = route; + useMultiTagsStoreHook().handleTags('push', { + path, + name, + meta, + }); + } + } + } + // 确保动态路由完全加入路由列表并且不影响静态路由(注意:动态路由刷新时router.beforeEach可能会触发两次,第一次触发动态路由还未完全添加,第二次动态路由才完全添加到路由列表,如果需要在router.beforeEach做一些判断可以在to.name存在的条件下去判断,这样就只会触发一次) + if (isAllEmpty(to.name)) router.push(to.fullPath); + }); + } + toCorrectRoute(); + } + } else { + if (to.path !== '/login') { + if (whiteList.indexOf(to.path) !== -1) { + next(); + } else { + removeToken(); + next({ path: '/login' }); + } + } else { + next(); + } + } }); router.afterEach(() => { - NProgress.done(); + NProgress.done(); }); export default router; diff --git a/src/router/modules/home.ts b/src/router/modules/home.ts index 57cb444..3d53c63 100644 --- a/src/router/modules/home.ts +++ b/src/router/modules/home.ts @@ -1,28 +1,28 @@ -import { $t } from "@/plugins/i18n"; -import { home } from "@/router/enums"; +import { home } from '@/router/enums'; +import { $t } from '@/plugins/i18n'; const { VITE_HIDE_HOME } = import.meta.env; -const Layout = () => import("@/layout/index.vue"); +const Layout = () => import('@/layout/index.vue'); export default { - path: "/", - name: "Home", - component: Layout, - redirect: "/welcome", - meta: { - icon: "ep:home-filled", - title: $t("menus.pureHome"), - rank: home - }, - children: [ - { - path: "/welcome", - name: "Welcome", - component: () => import("@/views/welcome/index.vue"), - meta: { - title: $t("menus.pureHome"), - showLink: VITE_HIDE_HOME !== "true" - } - } - ] + path: '/', + name: 'Home', + component: Layout, + redirect: '/welcome', + meta: { + icon: 'ep:home-filled', + title: $t('menus.pureHome'), + rank: home, + }, + children: [ + { + path: '/welcome', + name: 'Welcome', + component: () => import('@/views/welcome/index.vue'), + meta: { + title: 'menus.pureHome', + showLink: VITE_HIDE_HOME !== 'true', + }, + }, + ], } satisfies RouteConfigsTable; diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index 7b3f6d3..1c3d1f7 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -1,53 +1,53 @@ -import { $t } from "@/plugins/i18n"; +import { $t } from '@/plugins/i18n'; -const Layout = () => import("@/layout/index.vue"); +const Layout = () => import('@/layout/index.vue'); export default [ - { - path: "/login", - name: "Login", - component: () => import("@/views/login/index.vue"), - meta: { - title: $t("menus.pureLogin"), - showLink: false, - rank: 101 - } - }, - { - path: "/redirect", - component: Layout, - meta: { - title: $t("status.pureLoad"), - showLink: false, - rank: 102 - }, - children: [ - { - path: "/redirect/:path(.*)", - name: "Redirect", - component: () => import("@/layout/redirect.vue") - } - ] - }, - // 下面是一个无layout菜单的例子(一个全屏空白页面),因为这种情况极少发生,所以只需要在前端配置即可(配置路径:src/router/modules/remaining.ts) - { - path: "/empty", - name: "Empty", - component: () => import("@/components/Empty/index.vue"), - meta: { - title: $t("menus.pureEmpty"), - showLink: false, - rank: 103 - } - }, - { - path: "/account-settings", - name: "AccountSettings", - component: () => import("@/views/account-settings/index.vue"), - meta: { - title: $t("buttons.pureAccountSettings"), - showLink: false, - rank: 104 - } - } + { + path: '/login', + name: 'Login', + component: () => import('@/views/login/index.vue'), + meta: { + title: $t('menus.pureLogin'), + showLink: false, + rank: 101, + }, + }, + { + path: '/redirect', + component: Layout, + meta: { + title: $t('status.pureLoad'), + showLink: false, + rank: 102, + }, + children: [ + { + path: '/redirect/:path(.*)', + name: 'Redirect', + component: () => import('@/layout/redirect.vue'), + }, + ], + }, + // 下面是一个无layout菜单的例子(一个全屏空白页面),因为这种情况极少发生,所以只需要在前端配置即可(配置路径:src/router/modules/remaining.ts) + { + path: '/empty', + name: 'Empty', + component: () => import('@/components/Empty/index.vue'), + meta: { + title: $t('menus.pureEmpty'), + showLink: false, + rank: 103, + }, + }, + { + path: '/account-settings', + name: 'AccountSettings', + component: () => import('@/views/account-settings/index.vue'), + meta: { + title: $t('buttons.pureAccountSettings'), + showLink: false, + rank: 104, + }, + }, ] satisfies Array; diff --git a/src/router/utils.ts b/src/router/utils.ts index 7bbcc45..7d38081 100644 --- a/src/router/utils.ts +++ b/src/router/utils.ts @@ -1,171 +1,171 @@ -import { createWebHashHistory, createWebHistory, type RouteComponent, type RouteRecordRaw, type RouterHistory } from "vue-router"; -import { router } from "./index"; -import { isProxy, toRaw } from "vue"; -import { useTimeoutFn } from "@vueuse/core"; -import { cloneDeep, intersection, isAllEmpty, isIncludeAllChildren, isString, storageLocal } from "@pureadmin/utils"; -import { getConfig } from "@/config"; -import { buildHierarchyTree } from "@/utils/tree"; -import { type DataInfo, userKey } from "@/utils/auth"; -import { type menuType, routerArrays } from "@/layout/types"; -import { useMultiTagsStoreHook } from "@/store/modules/multiTags"; -import { usePermissionStoreHook } from "@/store/modules/permission"; +import { createWebHashHistory, createWebHistory, type RouteComponent, type RouteRecordRaw, type RouterHistory } from 'vue-router'; +import { router } from './index'; +import { isProxy, toRaw } from 'vue'; +import { useTimeoutFn } from '@vueuse/core'; +import { cloneDeep, intersection, isAllEmpty, isIncludeAllChildren, isString, storageLocal } from '@pureadmin/utils'; +import { getConfig } from '@/config'; +import { buildHierarchyTree } from '@/utils/tree'; +import { type DataInfo, userKey } from '@/utils/auth'; +import { type menuType, routerArrays } from '@/layout/types'; +import { useMultiTagsStoreHook } from '@/store/modules/multiTags'; +import { usePermissionStoreHook } from '@/store/modules/permission'; // 动态路由 -import { getAsyncRoutes } from "@/api/routes"; +import { getAsyncRoutes } from '@/api/routes'; -const IFrame = () => import("@/layout/frame.vue"); +const IFrame = () => import('@/layout/frame.vue'); // https://cn.vitejs.dev/guide/features.html#glob-import -const modulesRoutes = import.meta.glob("/src/views/**/*.{vue,tsx}"); +const modulesRoutes = import.meta.glob('/src/views/**/*.{vue,tsx}'); function handRank(routeInfo: any) { - const { name, path, parentId, meta } = routeInfo; - return isAllEmpty(parentId) ? (isAllEmpty(meta?.rank) || (meta?.rank === 0 && name !== "Home" && path !== "/") ? true : false) : false; + const { name, path, parentId, meta } = routeInfo; + return isAllEmpty(parentId) ? isAllEmpty(meta?.rank) || (meta?.rank === 0 && name !== 'Home' && path !== '/') : false; } /** 按照路由中meta下的rank等级升序来排序路由 */ function ascending(arr: any[]) { - arr.forEach((v, index) => { - // 当rank不存在时,根据顺序自动创建,首页路由永远在第一位 - if (handRank(v)) v.meta.rank = index + 2; - }); - return arr.sort((a: { meta: { rank: number } }, b: { meta: { rank: number } }) => { - return a?.meta.rank - b?.meta.rank; - }); + arr.forEach((v, index) => { + // 当rank不存在时,根据顺序自动创建,首页路由永远在第一位 + if (handRank(v)) v.meta.rank = index + 2; + }); + return arr.sort((a: { meta: { rank: number } }, b: { meta: { rank: number } }) => { + return a?.meta.rank - b?.meta.rank; + }); } /** 过滤meta中showLink为false的菜单 */ function filterTree(data: RouteComponent[]) { - const newTree = cloneDeep(data).filter((v: { meta: { showLink: boolean } }) => v.meta?.showLink !== false); - newTree.forEach((v: { children }) => v.children && (v.children = filterTree(v.children))); - return newTree; + const newTree = cloneDeep(data).filter((v: { meta: { showLink: boolean } }) => v.meta?.showLink !== false); + newTree.forEach((v: { children }) => v.children && (v.children = filterTree(v.children))); + return newTree; } /** 过滤children长度为0的的目录,当目录下没有菜单时,会过滤此目录,目录没有赋予roles权限,当目录下只要有一个菜单有显示权限,那么此目录就会显示 */ function filterChildrenTree(data: RouteComponent[]) { - const newTree = cloneDeep(data).filter((v: any) => v?.children?.length !== 0); - newTree.forEach((v: { children }) => v.children && (v.children = filterTree(v.children))); - return newTree; + const newTree = cloneDeep(data).filter((v: any) => v?.children?.length !== 0); + newTree.forEach((v: { children }) => v.children && (v.children = filterTree(v.children))); + return newTree; } /** 判断两个数组彼此是否存在相同值 */ function isOneOfArray(a: Array, b: Array) { - return Array.isArray(a) && Array.isArray(b) ? (intersection(a, b).length > 0 ? true : false) : true; + return Array.isArray(a) && Array.isArray(b) ? (intersection(a, b).length > 0 ? true : false) : true; } /** 从localStorage里取出当前登录用户的角色roles,过滤无权限的菜单 */ function filterNoPermissionTree(data: RouteComponent[]) { - const currentRoles = storageLocal().getItem>(userKey)?.roles ?? []; - const newTree = cloneDeep(data).filter((v: any) => isOneOfArray(v.meta?.roles, currentRoles)); - newTree.forEach((v: any) => v.children && (v.children = filterNoPermissionTree(v.children))); - return filterChildrenTree(newTree); + const currentRoles = storageLocal().getItem>(userKey)?.roles ?? []; + const newTree = cloneDeep(data).filter((v: any) => isOneOfArray(v.meta?.roles, currentRoles)); + newTree.forEach((v: any) => v.children && (v.children = filterNoPermissionTree(v.children))); + return filterChildrenTree(newTree); } /** 通过指定 `key` 获取父级路径集合,默认 `key` 为 `path` */ -function getParentPaths(value: string, routes: RouteRecordRaw[], key = "path") { - // 深度遍历查找 - function dfs(routes: RouteRecordRaw[], value: string, parents: string[]) { - for (let i = 0; i < routes.length; i++) { - const item = routes[i]; - // 返回父级path - if (item[key] === value) return parents; - // children不存在或为空则不递归 - if (!item.children || !item.children.length) continue; - // 往下查找时将当前path入栈 - parents.push(item.path); +function getParentPaths(value: string, routes: RouteRecordRaw[], key = 'path') { + // 深度遍历查找 + function dfs(routes: RouteRecordRaw[], value: string, parents: string[]) { + for (let i = 0; i < routes.length; i++) { + const item = routes[i]; + // 返回父级path + if (item[key] === value) return parents; + // children不存在或为空则不递归 + if (!item.children || !item.children.length) continue; + // 往下查找时将当前path入栈 + parents.push(item.path); - if (dfs(item.children, value, parents).length) return parents; - // 深度遍历查找未找到时当前path 出栈 - parents.pop(); - } - // 未找到时返回空数组 - return []; - } + if (dfs(item.children, value, parents).length) return parents; + // 深度遍历查找未找到时当前path 出栈 + parents.pop(); + } + // 未找到时返回空数组 + return []; + } - return dfs(routes, value, []); + return dfs(routes, value, []); } /** 查找对应 `path` 的路由信息 */ function findRouteByPath(path: string, routes: RouteRecordRaw[]) { - let res = routes.find((item: { path: string }) => item.path == path); - if (res) { - return isProxy(res) ? toRaw(res) : res; - } else { - for (let i = 0; i < routes.length; i++) { - if (routes[i].children instanceof Array && routes[i].children.length > 0) { - res = findRouteByPath(path, routes[i].children); - if (res) { - return isProxy(res) ? toRaw(res) : res; - } - } - } - return null; - } + let res = routes.find((item: { path: string }) => item.path == path); + if (res) { + return isProxy(res) ? toRaw(res) : res; + } else { + for (let i = 0; i < routes.length; i++) { + if (routes[i].children instanceof Array && routes[i].children.length > 0) { + res = findRouteByPath(path, routes[i].children); + if (res) { + return isProxy(res) ? toRaw(res) : res; + } + } + } + return null; + } } function addPathMatch() { - if (!router.hasRoute("pathMatch")) { - router.addRoute({ - path: "/:pathMatch(.*)", - name: "pathMatch", - redirect: "/error/404" - }); - } + if (!router.hasRoute('pathMatch')) { + router.addRoute({ + path: '/:pathMatch(.*)', + name: 'pathMatch', + redirect: '/error/404', + }); + } } /** 处理动态路由(后端返回的路由) */ function handleAsyncRoutes(routeList) { - if (routeList.length === 0) { - usePermissionStoreHook().handleWholeMenus(routeList); - } else { - formatFlatteningRoutes(addAsyncRoutes(routeList)).map((v: RouteRecordRaw) => { - // 防止重复添加路由 - if (router.options.routes[0].children.findIndex(value => value.path === v.path) !== -1) { - return; - } else { - // 切记将路由push到routes后还需要使用addRoute,这样路由才能正常跳转 - router.options.routes[0].children.push(v); - // 最终路由进行升序 - ascending(router.options.routes[0].children); - if (!router.hasRoute(v?.name)) router.addRoute(v); - const flattenRouters: any = router.getRoutes().find(n => n.path === "/"); - router.addRoute(flattenRouters); - } - }); - usePermissionStoreHook().handleWholeMenus(routeList); - } - if (!useMultiTagsStoreHook().getMultiTagsCache) { - useMultiTagsStoreHook().handleTags("equal", [...routerArrays, ...usePermissionStoreHook().flatteningRoutes.filter(v => v?.meta?.fixedTag)]); - } - addPathMatch(); + if (routeList.length === 0) { + usePermissionStoreHook().handleWholeMenus(routeList); + } else { + formatFlatteningRoutes(addAsyncRoutes(routeList)).map((v: RouteRecordRaw) => { + // 防止重复添加路由 + if (router.options.routes[0].children.findIndex(value => value.path === v.path) !== -1) { + return; + } else { + // 切记将路由push到routes后还需要使用addRoute,这样路由才能正常跳转 + router.options.routes[0].children.push(v); + // 最终路由进行升序 + ascending(router.options.routes[0].children); + if (!router.hasRoute(v?.name)) router.addRoute(v); + const flattenRouters: any = router.getRoutes().find(n => n.path === '/'); + router.addRoute(flattenRouters); + } + }); + usePermissionStoreHook().handleWholeMenus(routeList); + } + if (!useMultiTagsStoreHook().getMultiTagsCache) { + useMultiTagsStoreHook().handleTags('equal', [...routerArrays, ...usePermissionStoreHook().flatteningRoutes.filter(v => v?.meta?.fixedTag)]); + } + addPathMatch(); } /** 初始化路由(`new Promise` 写法防止在异步请求中造成无限循环)*/ function initRouter() { - if (getConfig()?.CachingAsyncRoutes) { - // 开启动态路由缓存本地localStorage - const key = "async-routes"; - const asyncRouteList = storageLocal().getItem(key) as any; - if (asyncRouteList && asyncRouteList?.length > 0) { - return new Promise(resolve => { - handleAsyncRoutes(asyncRouteList); - resolve(router); - }); - } else { - return new Promise(resolve => { - getAsyncRoutes().then(({ data }) => { - handleAsyncRoutes(cloneDeep(data)); - storageLocal().setItem(key, data); - resolve(router); - }); - }); - } - } else { - return new Promise(resolve => { - getAsyncRoutes().then(({ data }) => { - handleAsyncRoutes(cloneDeep(data)); - resolve(router); - }); - }); - } + if (getConfig()?.CachingAsyncRoutes) { + // 开启动态路由缓存本地localStorage + const key = 'async-routes'; + const asyncRouteList = storageLocal().getItem(key) as any; + if (asyncRouteList && asyncRouteList?.length > 0) { + return new Promise(resolve => { + handleAsyncRoutes(asyncRouteList); + resolve(router); + }); + } else { + return new Promise(resolve => { + getAsyncRoutes().then(({ data }) => { + handleAsyncRoutes(cloneDeep(data)); + storageLocal().setItem(key, data); + resolve(router); + }); + }); + } + } else { + return new Promise(resolve => { + getAsyncRoutes().then(({ data }) => { + handleAsyncRoutes(cloneDeep(data)); + resolve(router); + }); + }); + } } /** @@ -174,14 +174,14 @@ function initRouter() { * @returns 返回处理后的一维路由 */ function formatFlatteningRoutes(routesList: RouteRecordRaw[]) { - if (routesList.length === 0) return routesList; - let hierarchyList = buildHierarchyTree(routesList); - for (let i = 0; i < hierarchyList.length; i++) { - if (hierarchyList[i].children) { - hierarchyList = hierarchyList.slice(0, i + 1).concat(hierarchyList[i].children, hierarchyList.slice(i + 1)); - } - } - return hierarchyList; + if (routesList.length === 0) return routesList; + let hierarchyList = buildHierarchyTree(routesList); + for (let i = 0; i < hierarchyList.length; i++) { + if (hierarchyList[i].children) { + hierarchyList = hierarchyList.slice(0, i + 1).concat(hierarchyList[i].children, hierarchyList.slice(i + 1)); + } + } + return hierarchyList; } /** @@ -191,157 +191,157 @@ function formatFlatteningRoutes(routesList: RouteRecordRaw[]) { * @returns 返回将一维数组重新处理成规定路由的格式 */ function formatTwoStageRoutes(routesList: RouteRecordRaw[]) { - if (routesList.length === 0) return routesList; - const newRoutesList: RouteRecordRaw[] = []; - routesList.forEach((v: RouteRecordRaw) => { - if (v.path === "/") { - newRoutesList.push({ - component: v.component, - name: v.name, - path: v.path, - redirect: v.redirect, - meta: v.meta, - children: [] - }); - } else { - newRoutesList[0]?.children.push({ ...v }); - } - }); - return newRoutesList; + if (routesList.length === 0) return routesList; + const newRoutesList: RouteRecordRaw[] = []; + routesList.forEach((v: RouteRecordRaw) => { + if (v.path === '/') { + newRoutesList.push({ + component: v.component, + name: v.name, + path: v.path, + redirect: v.redirect, + meta: v.meta, + children: [], + }); + } else { + newRoutesList[0]?.children.push({ ...v }); + } + }); + return newRoutesList; } /** 处理缓存路由(添加、删除、刷新) */ function handleAliveRoute({ name }: ToRouteType, mode?: string) { - switch (mode) { - case "add": - usePermissionStoreHook().cacheOperate({ - mode: "add", - name - }); - break; - case "delete": - usePermissionStoreHook().cacheOperate({ - mode: "delete", - name - }); - break; - case "refresh": - usePermissionStoreHook().cacheOperate({ - mode: "refresh", - name - }); - break; - default: - usePermissionStoreHook().cacheOperate({ - mode: "delete", - name - }); - useTimeoutFn(() => { - usePermissionStoreHook().cacheOperate({ - mode: "add", - name - }); - }, 100); - } + switch (mode) { + case 'add': + usePermissionStoreHook().cacheOperate({ + mode: 'add', + name, + }); + break; + case 'delete': + usePermissionStoreHook().cacheOperate({ + mode: 'delete', + name, + }); + break; + case 'refresh': + usePermissionStoreHook().cacheOperate({ + mode: 'refresh', + name, + }); + break; + default: + usePermissionStoreHook().cacheOperate({ + mode: 'delete', + name, + }); + useTimeoutFn(() => { + usePermissionStoreHook().cacheOperate({ + mode: 'add', + name, + }); + }, 100); + } } /** 过滤后端传来的动态路由 重新生成规范路由 */ function addAsyncRoutes(arrRoutes: Array) { - if (!arrRoutes || !arrRoutes.length) return; - const modulesRoutesKeys = Object.keys(modulesRoutes); - arrRoutes.forEach((v: RouteRecordRaw) => { - // 将backstage属性加入meta,标识此路由为后端返回路由 - v.meta.backstage = true; - // 父级的redirect属性取值:如果子级存在且父级的redirect属性不存在,默认取第一个子级的path;如果子级存在且父级的redirect属性存在,取存在的redirect属性,会覆盖默认值 - if (v?.children && v.children.length && !v.redirect) v.redirect = v.children[0].path; - // 父级的name属性取值:如果子级存在且父级的name属性不存在,默认取第一个子级的name;如果子级存在且父级的name属性存在,取存在的name属性,会覆盖默认值(注意:测试中发现父级的name不能和子级name重复,如果重复会造成重定向无效(跳转404),所以这里给父级的name起名的时候后面会自动加上`Parent`,避免重复) - if (v?.children && v.children.length && !v.name) v.name = (v.children[0].name as string) + "Parent"; - if (v.meta?.frameSrc) { - v.component = IFrame; - } else { - // 对后端传component组件路径和不传做兼容(如果后端传component组件路径,那么path可以随便写,如果不传,component组件路径会跟path保持一致) - const index = v?.component ? modulesRoutesKeys.findIndex(ev => ev.includes(v.component as any)) : modulesRoutesKeys.findIndex(ev => ev.includes(v.path)); - v.component = modulesRoutes[modulesRoutesKeys[index]]; - } - if (v?.children && v.children.length) { - addAsyncRoutes(v.children); - } - }); - return arrRoutes; + if (!arrRoutes || !arrRoutes.length) return; + const modulesRoutesKeys = Object.keys(modulesRoutes); + arrRoutes.forEach((v: RouteRecordRaw) => { + // 将backstage属性加入meta,标识此路由为后端返回路由 + v.meta.backstage = true; + // 父级的redirect属性取值:如果子级存在且父级的redirect属性不存在,默认取第一个子级的path;如果子级存在且父级的redirect属性存在,取存在的redirect属性,会覆盖默认值 + if (v?.children && v.children.length && !v.redirect) v.redirect = v.children[0].path; + // 父级的name属性取值:如果子级存在且父级的name属性不存在,默认取第一个子级的name;如果子级存在且父级的name属性存在,取存在的name属性,会覆盖默认值(注意:测试中发现父级的name不能和子级name重复,如果重复会造成重定向无效(跳转404),所以这里给父级的name起名的时候后面会自动加上`Parent`,避免重复) + if (v?.children && v.children.length && !v.name) v.name = (v.children[0].name as string) + 'Parent'; + if (v.meta?.frameSrc) { + v.component = IFrame; + } else { + // 对后端传component组件路径和不传做兼容(如果后端传component组件路径,那么path可以随便写,如果不传,component组件路径会跟path保持一致) + const index = v?.component ? modulesRoutesKeys.findIndex(ev => ev.includes(v.component as any)) : modulesRoutesKeys.findIndex(ev => ev.includes(v.path)); + v.component = modulesRoutes[modulesRoutesKeys[index]]; + } + if (v?.children && v.children.length) { + addAsyncRoutes(v.children); + } + }); + return arrRoutes; } /** 获取路由历史模式 https://next.router.vuejs.org/zh/guide/essentials/history-mode.html */ function getHistoryMode(routerHistory): RouterHistory { - // len为1 代表只有历史模式 为2 代表历史模式中存在base参数 https://next.router.vuejs.org/zh/api/#%E5%8F%82%E6%95%B0-1 - const historyMode = routerHistory.split(","); - const leftMode = historyMode[0]; - const rightMode = historyMode[1]; - // no param - if (historyMode.length === 1) { - if (leftMode === "hash") { - return createWebHashHistory(""); - } else if (leftMode === "h5") { - return createWebHistory(""); - } - } //has param - else if (historyMode.length === 2) { - if (leftMode === "hash") { - return createWebHashHistory(rightMode); - } else if (leftMode === "h5") { - return createWebHistory(rightMode); - } - } + // len为1 代表只有历史模式 为2 代表历史模式中存在base参数 https://next.router.vuejs.org/zh/api/#%E5%8F%82%E6%95%B0-1 + const historyMode = routerHistory.split(','); + const leftMode = historyMode[0]; + const rightMode = historyMode[1]; + // no param + if (historyMode.length === 1) { + if (leftMode === 'hash') { + return createWebHashHistory(''); + } else if (leftMode === 'h5') { + return createWebHistory(''); + } + } //has param + else if (historyMode.length === 2) { + if (leftMode === 'hash') { + return createWebHashHistory(rightMode); + } else if (leftMode === 'h5') { + return createWebHistory(rightMode); + } + } } /** 获取当前页面按钮级别的权限 */ function getAuths(): Array { - return router.currentRoute.value.meta.auths as Array; + return router.currentRoute.value.meta.auths as Array; } /** 是否有按钮级别的权限 */ function hasAuth(value: string | Array): boolean { - if (!value) return false; - /** 从当前路由的`meta`字段里获取按钮级别的所有自定义`code`值 */ - const metaAuths = getAuths(); - if (!metaAuths) return false; - const isAuths = isString(value) ? metaAuths.includes(value) : isIncludeAllChildren(value, metaAuths); - return isAuths ? true : false; + if (!value) return false; + /** 从当前路由的`meta`字段里获取按钮级别的所有自定义`code`值 */ + const metaAuths = getAuths(); + if (!metaAuths) return false; + const isAuths = isString(value) ? metaAuths.includes(value) : isIncludeAllChildren(value, metaAuths); + return isAuths ? true : false; } function handleTopMenu(route) { - if (route?.children && route.children.length > 1) { - if (route.redirect) { - return route.children.filter(cur => cur.path === route.redirect)[0]; - } else { - return route.children[0]; - } - } else { - return route; - } + if (route?.children && route.children.length > 1) { + if (route.redirect) { + return route.children.filter(cur => cur.path === route.redirect)[0]; + } else { + return route.children[0]; + } + } else { + return route; + } } /** 获取所有菜单中的第一个菜单(顶级菜单)*/ function getTopMenu(tag = false): menuType { - const topMenu = handleTopMenu(usePermissionStoreHook().wholeMenus[0]?.children[0]); - tag && useMultiTagsStoreHook().handleTags("push", topMenu); - return topMenu; + const topMenu = handleTopMenu(usePermissionStoreHook().wholeMenus[0]?.children[0]); + tag && useMultiTagsStoreHook().handleTags('push', topMenu); + return topMenu; } export { - hasAuth, - getAuths, - ascending, - filterTree, - initRouter, - getTopMenu, - addPathMatch, - isOneOfArray, - getHistoryMode, - addAsyncRoutes, - getParentPaths, - findRouteByPath, - handleAliveRoute, - formatTwoStageRoutes, - formatFlatteningRoutes, - filterNoPermissionTree + hasAuth, + getAuths, + ascending, + filterTree, + initRouter, + getTopMenu, + addPathMatch, + isOneOfArray, + getHistoryMode, + addAsyncRoutes, + getParentPaths, + findRouteByPath, + handleAliveRoute, + formatTwoStageRoutes, + formatFlatteningRoutes, + filterNoPermissionTree, }; diff --git a/src/store/modules/record.ts b/src/store/modules/record.ts new file mode 100644 index 0000000..49c2008 --- /dev/null +++ b/src/store/modules/record.ts @@ -0,0 +1,24 @@ +import { defineStore } from 'pinia'; +import { store } from '@/store'; + +export const useRecord = defineStore({ + id: 'bill-app', + state: () => ({ + dataList: [], + loading: false, + form: { + username: '', + }, + pagination: { + currentPage: 1, + pageSize: 20, + total: 100, + }, + }), + getters: {}, + actions: {}, +}); + +export function useRecordStoreHook() { + return useRecord(store); +} diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index df92595..74a7502 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,114 +1,102 @@ -import { defineStore } from "pinia"; -import { - type userType, - store, - router, - resetRouter, - routerArrays, - storageLocal -} from "../utils"; -import { - type UserResult, - type RefreshTokenResult, - getLogin, - refreshTokenApi -} from "@/api/user"; -import { useMultiTagsStoreHook } from "./multiTags"; -import { type DataInfo, setToken, removeToken, userKey } from "@/utils/auth"; +import { defineStore } from 'pinia'; +import { resetRouter, router, routerArrays, storageLocal, store, type userType } from '../utils'; +import { getLogin, refreshTokenApi, type RefreshTokenResult, type UserResult } from '@/api/user'; +import { useMultiTagsStoreHook } from './multiTags'; +import { type DataInfo, removeToken, setToken, userKey } from '@/utils/auth'; export const useUserStore = defineStore({ - id: "pure-user", - state: (): userType => ({ - // 头像 - avatar: storageLocal().getItem>(userKey)?.avatar ?? "", - // 用户名 - username: storageLocal().getItem>(userKey)?.username ?? "", - // 昵称 - nickname: storageLocal().getItem>(userKey)?.nickname ?? "", - // 页面级别权限 - roles: storageLocal().getItem>(userKey)?.roles ?? [], - // 前端生成的验证码(按实际需求替换) - verifyCode: "", - // 判断登录页面显示哪个组件(0:登录(默认)、1:手机登录、2:二维码登录、3:注册、4:忘记密码) - currentPage: 0, - // 是否勾选了登录页的免登录 - isRemembered: false, - // 登录页的免登录存储几天,默认7天 - loginDay: 7 - }), - actions: { - /** 存储头像 */ - SET_AVATAR(avatar: string) { - this.avatar = avatar; - }, - /** 存储用户名 */ - SET_USERNAME(username: string) { - this.username = username; - }, - /** 存储昵称 */ - SET_NICKNAME(nickname: string) { - this.nickname = nickname; - }, - /** 存储角色 */ - SET_ROLES(roles: Array) { - this.roles = roles; - }, - /** 存储前端生成的验证码 */ - SET_VERIFYCODE(verifyCode: string) { - this.verifyCode = verifyCode; - }, - /** 存储登录页面显示哪个组件 */ - SET_CURRENTPAGE(value: number) { - this.currentPage = value; - }, - /** 存储是否勾选了登录页的免登录 */ - SET_ISREMEMBERED(bool: boolean) { - this.isRemembered = bool; - }, - /** 设置登录页的免登录存储几天 */ - SET_LOGINDAY(value: number) { - this.loginDay = Number(value); - }, - /** 登入 */ - async loginByUsername(data) { - return new Promise((resolve, reject) => { - getLogin(data) - .then(data => { - if (data?.success) setToken(data.data); - resolve(data); - }) - .catch(error => { - reject(error); - }); - }); - }, - /** 前端登出(不调用接口) */ - logOut() { - this.username = ""; - this.roles = []; - removeToken(); - useMultiTagsStoreHook().handleTags("equal", [...routerArrays]); - resetRouter(); - router.push("/login"); - }, - /** 刷新`token` */ - async handRefreshToken(data) { - return new Promise((resolve, reject) => { - refreshTokenApi(data) - .then(data => { - if (data) { - setToken(data.data); - resolve(data); - } - }) - .catch(error => { - reject(error); - }); - }); - } - } + id: 'pure-user', + state: (): userType => ({ + // 头像 + avatar: storageLocal().getItem>(userKey)?.avatar ?? '', + // 用户名 + username: storageLocal().getItem>(userKey)?.username ?? '', + // 昵称 + nickname: storageLocal().getItem>(userKey)?.nickname ?? '', + // 页面级别权限 + roles: storageLocal().getItem>(userKey)?.roles ?? [], + // 前端生成的验证码(按实际需求替换) + verifyCode: '', + // 判断登录页面显示哪个组件(0:登录(默认)、1:手机登录、2:二维码登录、3:注册、4:忘记密码) + currentPage: 0, + // 是否勾选了登录页的免登录 + isRemembered: false, + // 登录页的免登录存储几天,默认7天 + loginDay: 7, + }), + actions: { + /** 存储头像 */ + SET_AVATAR(avatar: string) { + this.avatar = avatar; + }, + /** 存储用户名 */ + SET_USERNAME(username: string) { + this.username = username; + }, + /** 存储昵称 */ + SET_NICKNAME(nickname: string) { + this.nickname = nickname; + }, + /** 存储角色 */ + SET_ROLES(roles: Array) { + this.roles = roles; + }, + /** 存储前端生成的验证码 */ + SET_VERIFYCODE(verifyCode: string) { + this.verifyCode = verifyCode; + }, + /** 存储登录页面显示哪个组件 */ + SET_CURRENTPAGE(value: number) { + this.currentPage = value; + }, + /** 存储是否勾选了登录页的免登录 */ + SET_ISREMEMBERED(bool: boolean) { + this.isRemembered = bool; + }, + /** 设置登录页的免登录存储几天 */ + SET_LOGINDAY(value: number) { + this.loginDay = Number(value); + }, + /** 登入 */ + async loginByUsername(data) { + return new Promise((resolve, reject) => { + getLogin(data) + .then(data => { + if (data?.success) setToken(data.data); + resolve(data); + }) + .catch(error => { + reject(error); + }); + }); + }, + /** 前端登出(不调用接口) */ + logOut() { + this.username = ''; + this.roles = []; + removeToken(); + useMultiTagsStoreHook().handleTags('equal', [...routerArrays]); + resetRouter(); + router.push('/login'); + }, + /** 刷新`token` */ + async handRefreshToken(data) { + return new Promise((resolve, reject) => { + refreshTokenApi(data) + .then(data => { + if (data) { + setToken(data.data); + resolve(data); + } + }) + .catch(error => { + reject(error); + }); + }); + }, + }, }); export function useUserStoreHook() { - return useUserStore(store); + return useUserStore(store); } diff --git a/src/utils/auth.ts b/src/utils/auth.ts index c2e8e16..ad39299 100644 --- a/src/utils/auth.ts +++ b/src/utils/auth.ts @@ -1,38 +1,38 @@ -import Cookies from "js-cookie"; -import { storageLocal } from "@pureadmin/utils"; -import { useUserStoreHook } from "@/store/modules/user"; +import Cookies from 'js-cookie'; +import { storageLocal } from '@pureadmin/utils'; +import { useUserStoreHook } from '@/store/modules/user'; export interface DataInfo { - /** token */ - accessToken: string; - /** `accessToken`的过期时间(时间戳) */ - expires: T; - /** 用于调用刷新accessToken的接口时所需的token */ - refreshToken: string; - /** 头像 */ - avatar?: string; - /** 用户名 */ - username?: string; - /** 昵称 */ - nickname?: string; - /** 当前登录用户的角色 */ - roles?: Array; + /** token */ + accessToken: string; + /** `accessToken`的过期时间(时间戳) */ + expires: T; + /** 用于调用刷新accessToken的接口时所需的token */ + refreshToken: string; + /** 头像 */ + avatar?: string; + /** 用户名 */ + username?: string; + /** 昵称 */ + nickname?: string; + /** 当前登录用户的角色 */ + roles?: Array; } -export const userKey = "user-info"; -export const TokenKey = "authorized-token"; +export const userKey = 'user-info'; +export const TokenKey = 'authorized-token'; /** * 通过`multiple-tabs`是否在`cookie`中,判断用户是否已经登录系统, * 从而支持多标签页打开已经登录的系统后无需再登录。 * 浏览器完全关闭后`multiple-tabs`将自动从`cookie`中销毁, * 再次打开浏览器需要重新登录系统 * */ -export const multipleTabsKey = "multiple-tabs"; +export const multipleTabsKey = 'multiple-tabs'; /** 获取`token` */ export function getToken(): DataInfo { - // 此处与`TokenKey`相同,此写法解决初始化时`Cookies`中不存在`TokenKey`报错 - return Cookies.get(TokenKey) ? JSON.parse(Cookies.get(TokenKey)) : storageLocal().getItem(userKey); + // 此处与`TokenKey`相同,此写法解决初始化时`Cookies`中不存在`TokenKey`报错 + return Cookies.get(TokenKey) ? JSON.parse(Cookies.get(TokenKey)) : storageLocal().getItem(userKey); } /** @@ -42,73 +42,73 @@ export function getToken(): DataInfo { * 将`avatar`、`username`、`nickname`、`roles`、`refreshToken`、`expires`这六条信息放在key值为`user-info`的localStorage里(利用`multipleTabsKey`当浏览器完全关闭后自动销毁) */ export function setToken(data: DataInfo) { - let expires = 0; - const { accessToken, refreshToken } = data; - const { isRemembered, loginDay } = useUserStoreHook(); - expires = new Date(data.expires).getTime(); // 如果后端直接设置时间戳,将此处代码改为expires = data.expires,然后把上面的DataInfo改成DataInfo即可 - const cookieString = JSON.stringify({ accessToken, expires, refreshToken }); + let expires = 0; + const { accessToken, refreshToken } = data; + const { isRemembered, loginDay } = useUserStoreHook(); + expires = new Date(data.expires).getTime(); // 如果后端直接设置时间戳,将此处代码改为expires = data.expires,然后把上面的DataInfo改成DataInfo即可 + const cookieString = JSON.stringify({ accessToken, expires, refreshToken }); - expires > 0 - ? Cookies.set(TokenKey, cookieString, { - expires: (expires - Date.now()) / 86400000 - }) - : Cookies.set(TokenKey, cookieString); + expires > 0 + ? Cookies.set(TokenKey, cookieString, { + expires: (expires - Date.now()) / 86400000, + }) + : Cookies.set(TokenKey, cookieString); - Cookies.set( - multipleTabsKey, - "true", - isRemembered - ? { - expires: loginDay - } - : {} - ); + Cookies.set( + multipleTabsKey, + 'true', + isRemembered + ? { + expires: loginDay, + } + : {}, + ); - function setUserKey({ avatar, username, nickname, roles }) { - useUserStoreHook().SET_AVATAR(avatar); - useUserStoreHook().SET_USERNAME(username); - useUserStoreHook().SET_NICKNAME(nickname); - useUserStoreHook().SET_ROLES(roles); - storageLocal().setItem(userKey, { - refreshToken, - expires, - avatar, - username, - nickname, - roles - }); - } + function setUserKey({ avatar, username, nickname, roles }) { + useUserStoreHook().SET_AVATAR(avatar); + useUserStoreHook().SET_USERNAME(username); + useUserStoreHook().SET_NICKNAME(nickname); + useUserStoreHook().SET_ROLES(roles); + storageLocal().setItem(userKey, { + refreshToken, + expires, + avatar, + username, + nickname, + roles, + }); + } - if (data.username && data.roles) { - const { username, roles } = data; - setUserKey({ - avatar: data?.avatar ?? "", - username, - nickname: data?.nickname ?? "", - roles - }); - } else { - const avatar = storageLocal().getItem>(userKey)?.avatar ?? ""; - const username = storageLocal().getItem>(userKey)?.username ?? ""; - const nickname = storageLocal().getItem>(userKey)?.nickname ?? ""; - const roles = storageLocal().getItem>(userKey)?.roles ?? []; - setUserKey({ - avatar, - username, - nickname, - roles - }); - } + if (data.username && data.roles) { + const { username, roles } = data; + setUserKey({ + avatar: data?.avatar ?? '', + username, + nickname: data?.nickname ?? '', + roles, + }); + } else { + const avatar = storageLocal().getItem>(userKey)?.avatar ?? ''; + const username = storageLocal().getItem>(userKey)?.username ?? ''; + const nickname = storageLocal().getItem>(userKey)?.nickname ?? ''; + const roles = storageLocal().getItem>(userKey)?.roles ?? []; + setUserKey({ + avatar, + username, + nickname, + roles, + }); + } } /** 删除`token`以及key值为`user-info`的localStorage信息 */ export function removeToken() { - Cookies.remove(TokenKey); - Cookies.remove(multipleTabsKey); - storageLocal().removeItem(userKey); + Cookies.remove(TokenKey); + Cookies.remove(multipleTabsKey); + storageLocal().removeItem(userKey); } /** 格式化token(jwt格式) */ export const formatToken = (token: string): string => { - return "Bearer " + token; + return 'Bearer ' + token; }; diff --git a/src/views/about/columns.tsx b/src/views/about/columns.tsx deleted file mode 100644 index ebd94b3..0000000 --- a/src/views/about/columns.tsx +++ /dev/null @@ -1,108 +0,0 @@ -export function useColumns() { - const { pkg, lastBuildTime } = __APP_INFO__; - const { version, engines } = pkg; - const columns = [ - { - label: "当前版本", - minWidth: 100, - cellRenderer: () => { - return ( - - {version} - - ); - } - }, - { - label: "最后编译时间", - minWidth: 120, - cellRenderer: () => { - return ( - - {lastBuildTime} - - ); - } - }, - { - label: "推荐 node 版本", - minWidth: 140, - cellRenderer: () => { - return ( - - {engines.node} - - ); - } - }, - { - label: "推荐 pnpm 版本", - minWidth: 140, - cellRenderer: () => { - return ( - - {engines.pnpm} - - ); - } - }, - { - label: "完整版代码地址", - minWidth: 140, - className: "pure-version", - cellRenderer: () => { - return ( - - 完整版代码链接 - - ); - } - }, - { - label: "精简版代码地址", - minWidth: 140, - className: "pure-version", - cellRenderer: () => { - return ( - - 精简版代码链接 - - ); - } - }, - { - label: "文档地址", - minWidth: 100, - className: "pure-version", - cellRenderer: () => { - return ( - - 文档链接 - - ); - } - }, - { - label: "预览地址", - minWidth: 100, - className: "pure-version", - cellRenderer: () => { - return ( - - 预览链接 - - ); - } - } - ]; - - return { - columns - }; -} diff --git a/src/views/about/index.vue b/src/views/about/index.vue deleted file mode 100644 index 0fab0fc..0000000 --- a/src/views/about/index.vue +++ /dev/null @@ -1,174 +0,0 @@ - - - - - diff --git a/src/views/bill/count/index.vue b/src/views/bill/count/index.vue new file mode 100644 index 0000000..08b1b86 --- /dev/null +++ b/src/views/bill/count/index.vue @@ -0,0 +1,7 @@ + + + + + diff --git a/src/views/bill/history/index.vue b/src/views/bill/history/index.vue new file mode 100644 index 0000000..c9ac886 --- /dev/null +++ b/src/views/bill/history/index.vue @@ -0,0 +1,7 @@ + + + + + diff --git a/src/views/bill/record/index.vue b/src/views/bill/record/index.vue new file mode 100644 index 0000000..7e02d5a --- /dev/null +++ b/src/views/bill/record/index.vue @@ -0,0 +1,46 @@ + + + + diff --git a/src/views/login/components/LoginPhone.vue b/src/views/login/components/LoginPhone.vue index 0a94370..cdd2ada 100644 --- a/src/views/login/components/LoginPhone.vue +++ b/src/views/login/components/LoginPhone.vue @@ -1,106 +1,81 @@ - diff --git a/src/views/login/components/LoginRegist.vue b/src/views/login/components/LoginRegist.vue index 4437995..a01e1dd 100644 --- a/src/views/login/components/LoginRegist.vue +++ b/src/views/login/components/LoginRegist.vue @@ -1,195 +1,146 @@ - diff --git a/src/views/login/components/LoginUpdate.vue b/src/views/login/components/LoginUpdate.vue index 469a455..4dbdf7b 100644 --- a/src/views/login/components/LoginUpdate.vue +++ b/src/views/login/components/LoginUpdate.vue @@ -1,154 +1,110 @@ - diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 6e5fac9..ef6abf2 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -1,40 +1,39 @@ diff --git a/src/views/login/utils/enums.ts b/src/views/login/utils/enums.ts index 060c048..4d8b62f 100644 --- a/src/views/login/utils/enums.ts +++ b/src/views/login/utils/enums.ts @@ -1,34 +1,34 @@ -import { $t } from "@/plugins/i18n"; +import { $t } from '@/plugins/i18n'; const operates = [ - { - title: $t("login.purePhoneLogin") - }, - { - title: $t("login.pureQRCodeLogin") - }, - { - title: $t("login.pureRegister") - } + { + title: $t('login.purePhoneLogin'), + }, + { + title: $t('login.pureQRCodeLogin'), + }, + { + title: $t('login.pureRegister'), + }, ]; const thirdParty = [ - { - title: $t("login.pureWeChatLogin"), - icon: "wechat" - }, - { - title: $t("login.pureAlipayLogin"), - icon: "alipay" - }, - { - title: $t("login.pureQQLogin"), - icon: "qq" - }, - { - title: $t("login.pureWeiBoLogin"), - icon: "weibo" - } + { + title: $t('login.pureWeChatLogin'), + icon: 'wechat', + }, + { + title: $t('login.pureAlipayLogin'), + icon: 'alipay', + }, + { + title: $t('login.pureQQLogin'), + icon: 'qq', + }, + { + title: $t('login.pureWeiBoLogin'), + icon: 'weibo', + }, ]; export { operates, thirdParty }; diff --git a/src/views/login/utils/rule.ts b/src/views/login/utils/rule.ts index ff30ee5..7fc8fc1 100644 --- a/src/views/login/utils/rule.ts +++ b/src/views/login/utils/rule.ts @@ -1,8 +1,7 @@ -import { reactive } from "vue"; -import { isPhone } from "@pureadmin/utils"; -import type { FormRules } from "element-plus"; -import { $t, transformI18n } from "@/plugins/i18n"; -import { useUserStoreHook } from "@/store/modules/user"; +import { reactive } from 'vue'; +import { isPhone } from '@pureadmin/utils'; +import type { FormRules } from 'element-plus'; +import { useUserStoreHook } from '@/store/modules/user'; /** 6位数字验证码正则 */ export const REGEXP_SIX = /^\d{6}$/; @@ -12,110 +11,110 @@ export const REGEXP_PWD = /^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?!([^(0-9a-zA-Z)]| /** 登录校验 */ export const loginRules = reactive({ - password: [ - { - validator: (rule, value, callback) => { - if (value === "") { - callback(new Error(transformI18n($t("login.purePassWordReg")))); - } else if (!REGEXP_PWD.test(value)) { - callback(new Error(transformI18n($t("login.purePassWordRuleReg")))); - } else { - callback(); - } - }, - trigger: "blur" - } - ], - verifyCode: [ - { - validator: (rule, value, callback) => { - if (value === "") { - callback(new Error(transformI18n($t("login.pureVerifyCodeReg")))); - } else if (useUserStoreHook().verifyCode !== value) { - callback(new Error(transformI18n($t("login.pureVerifyCodeCorrectReg")))); - } else { - callback(); - } - }, - trigger: "blur" - } - ] + password: [ + { + validator: (rule, value, callback) => { + if (value === '') { + callback(new Error($t('login.purePassWordReg'))); + } else if (!REGEXP_PWD.test(value)) { + callback(new Error($t('login.purePassWordRuleReg'))); + } else { + callback(); + } + }, + trigger: 'blur', + }, + ], + verifyCode: [ + { + validator: (rule, value, callback) => { + if (value === '') { + callback(new Error($t('login.pureVerifyCodeReg'))); + } else if (useUserStoreHook().verifyCode !== value) { + callback(new Error($t('login.pureVerifyCodeCorrectReg'))); + } else { + callback(); + } + }, + trigger: 'blur', + }, + ], }); /** 手机登录校验 */ export const phoneRules = reactive({ - phone: [ - { - validator: (rule, value, callback) => { - if (value === "") { - callback(new Error(transformI18n($t("login.purePhoneReg")))); - } else if (!isPhone(value)) { - callback(new Error(transformI18n($t("login.purePhoneCorrectReg")))); - } else { - callback(); - } - }, - trigger: "blur" - } - ], - verifyCode: [ - { - validator: (rule, value, callback) => { - if (value === "") { - callback(new Error(transformI18n($t("login.pureVerifyCodeReg")))); - } else if (!REGEXP_SIX.test(value)) { - callback(new Error(transformI18n($t("login.pureVerifyCodeSixReg")))); - } else { - callback(); - } - }, - trigger: "blur" - } - ] + phone: [ + { + validator: (rule, value, callback) => { + if (value === '') { + callback(new Error($t('login.purePhoneReg'))); + } else if (!isPhone(value)) { + callback(new Error($t('login.purePhoneCorrectReg'))); + } else { + callback(); + } + }, + trigger: 'blur', + }, + ], + verifyCode: [ + { + validator: (rule, value, callback) => { + if (value === '') { + callback(new Error($t('login.pureVerifyCodeReg'))); + } else if (!REGEXP_SIX.test(value)) { + callback(new Error($t('login.pureVerifyCodeSixReg'))); + } else { + callback(); + } + }, + trigger: 'blur', + }, + ], }); /** 忘记密码校验 */ export const updateRules = reactive({ - phone: [ - { - validator: (rule, value, callback) => { - if (value === "") { - callback(new Error(transformI18n($t("login.purePhoneReg")))); - } else if (!isPhone(value)) { - callback(new Error(transformI18n($t("login.purePhoneCorrectReg")))); - } else { - callback(); - } - }, - trigger: "blur" - } - ], - verifyCode: [ - { - validator: (rule, value, callback) => { - if (value === "") { - callback(new Error(transformI18n($t("login.pureVerifyCodeReg")))); - } else if (!REGEXP_SIX.test(value)) { - callback(new Error(transformI18n($t("login.pureVerifyCodeSixReg")))); - } else { - callback(); - } - }, - trigger: "blur" - } - ], - password: [ - { - validator: (rule, value, callback) => { - if (value === "") { - callback(new Error(transformI18n($t("login.purePassWordReg")))); - } else if (!REGEXP_PWD.test(value)) { - callback(new Error(transformI18n($t("login.purePassWordRuleReg")))); - } else { - callback(); - } - }, - trigger: "blur" - } - ] + phone: [ + { + validator: (rule, value, callback) => { + if (value === '') { + callback(new Error($t('login.purePhoneReg'))); + } else if (!isPhone(value)) { + callback(new Error($t('login.purePhoneCorrectReg'))); + } else { + callback(); + } + }, + trigger: 'blur', + }, + ], + verifyCode: [ + { + validator: (rule, value, callback) => { + if (value === '') { + callback(new Error($t('login.pureVerifyCodeReg'))); + } else if (!REGEXP_SIX.test(value)) { + callback(new Error($t('login.pureVerifyCodeSixReg'))); + } else { + callback(); + } + }, + trigger: 'blur', + }, + ], + password: [ + { + validator: (rule, value, callback) => { + if (value === '') { + callback(new Error($t('login.purePassWordReg'))); + } else if (!REGEXP_PWD.test(value)) { + callback(new Error($t('login.purePassWordRuleReg'))); + } else { + callback(); + } + }, + trigger: 'blur', + }, + ], }); diff --git a/src/views/monitor/logs/login/index.vue b/src/views/monitor/logs/login/index.vue deleted file mode 100644 index ab6e339..0000000 --- a/src/views/monitor/logs/login/index.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - - - diff --git a/src/views/monitor/logs/operation/index.vue b/src/views/monitor/logs/operation/index.vue deleted file mode 100644 index 9474538..0000000 --- a/src/views/monitor/logs/operation/index.vue +++ /dev/null @@ -1,103 +0,0 @@ - - - - - diff --git a/src/views/monitor/logs/system/detail.vue b/src/views/monitor/logs/system/detail.vue deleted file mode 100644 index f29e2f8..0000000 --- a/src/views/monitor/logs/system/detail.vue +++ /dev/null @@ -1,95 +0,0 @@ - - - diff --git a/src/views/monitor/logs/system/hook.tsx b/src/views/monitor/logs/system/hook.tsx deleted file mode 100644 index 79bda03..0000000 --- a/src/views/monitor/logs/system/hook.tsx +++ /dev/null @@ -1,239 +0,0 @@ -import dayjs from "dayjs"; -import Detail from "./detail.vue"; -import { message } from "@/utils/message"; -import { addDialog } from "@/components/ReDialog"; -import type { PaginationProps } from "@pureadmin/table"; -import { onMounted, reactive, ref, type Ref, toRaw } from "vue"; -import { getKeyList, useCopyToClipboard } from "@pureadmin/utils"; -import { getSystemLogsDetail, getSystemLogsList } from "@/api/system"; -import Info from "@iconify-icons/ri/question-line"; - -export function useRole(tableRef: Ref) { - const form = reactive({ - module: "", - requestTime: "" - }); - const dataList = ref([]); - const loading = ref(true); - const selectedNum = ref(0); - const { copied, update } = useCopyToClipboard(); - - const pagination = reactive({ - total: 0, - pageSize: 10, - currentPage: 1, - background: true - }); - - const getLevelType = (type, text = false) => { - switch (type) { - case 0: - return text ? "debug" : "primary"; - case 1: - return text ? "info" : "success"; - case 2: - return text ? "warn" : "info"; - case 3: - return text ? "error" : "warning"; - case 4: - return text ? "fatal" : "danger"; - } - }; - - const columns: TableColumnList = [ - { - label: "勾选列", // 如果需要表格多选,此处label必须设置 - type: "selection", - fixed: "left", - reserveSelection: true // 数据刷新后保留选项 - }, - { - label: "ID", - prop: "id", - minWidth: 90 - }, - { - label: "所属模块", - prop: "module", - minWidth: 100 - }, - { - headerRenderer: () => ( - - 请求接口 - - - ), - prop: "url", - minWidth: 140 - }, - { - label: "请求方法", - prop: "method", - minWidth: 140 - }, - { - label: "IP 地址", - prop: "ip", - minWidth: 100 - }, - { - label: "地点", - prop: "address", - minWidth: 140 - }, - { - label: "操作系统", - prop: "system", - minWidth: 100 - }, - { - label: "浏览器类型", - prop: "browser", - minWidth: 100 - }, - { - label: "级别", - prop: "level", - minWidth: 90, - cellRenderer: ({ row, props }) => ( - - {getLevelType(row.level, true)} - - ) - }, - { - label: "请求耗时", - prop: "takesTime", - minWidth: 100, - cellRenderer: ({ row, props }) => ( - - {row.takesTime} ms - - ) - }, - { - label: "请求时间", - prop: "requestTime", - minWidth: 180, - formatter: ({ requestTime }) => dayjs(requestTime).format("YYYY-MM-DD HH:mm:ss") - }, - { - label: "操作", - fixed: "right", - slot: "operation" - } - ]; - - function handleSizeChange(val: number) { - console.log(`${val} items per page`); - } - - function handleCurrentChange(val: number) { - console.log(`current page: ${val}`); - } - - /** 当CheckBox选择项发生变化时会触发该事件 */ - function handleSelectionChange(val) { - selectedNum.value = val.length; - // 重置表格高度 - tableRef.value.setAdaptive(); - } - - /** 取消选择 */ - function onSelectionCancel() { - selectedNum.value = 0; - // 用于多选表格,清空用户的选择 - tableRef.value.getTableRef().clearSelection(); - } - - /** 拷贝请求接口,表格单元格被双击时触发 */ - function handleCellDblclick({ url }, { property }) { - if (property !== "url") return; - update(url); - copied.value ? message(`${url} 已拷贝`, { type: "success" }) : message("拷贝失败", { type: "warning" }); - } - - /** 批量删除 */ - function onbatchDel() { - // 返回当前选中的行 - const curSelected = tableRef.value.getTableRef().getSelectionRows(); - // 接下来根据实际业务,通过选中行的某项数据,比如下面的id,调用接口进行批量删除 - message(`已删除序号为 ${getKeyList(curSelected, "id")} 的数据`, { - type: "success" - }); - tableRef.value.getTableRef().clearSelection(); - onSearch(); - } - - /** 清空日志 */ - function clearAll() { - // 根据实际业务,调用接口删除所有日志数据 - message("已删除所有日志数据", { - type: "success" - }); - onSearch(); - } - - function onDetail(row) { - getSystemLogsDetail({ id: row.id }).then(res => { - addDialog({ - title: "系统日志详情", - fullscreen: true, - hideFooter: true, - contentRenderer: () => Detail, - props: { - data: [res] - } - }); - }); - } - - async function onSearch() { - loading.value = true; - const { data } = await getSystemLogsList(toRaw(form)); - dataList.value = data.list; - pagination.total = data.total; - pagination.pageSize = data.pageSize; - pagination.currentPage = data.currentPage; - - setTimeout(() => { - loading.value = false; - }, 500); - } - - const resetForm = formEl => { - if (!formEl) return; - formEl.resetFields(); - onSearch(); - }; - - onMounted(() => { - onSearch(); - }); - - return { - form, - loading, - columns, - dataList, - pagination, - selectedNum, - onSearch, - onDetail, - clearAll, - resetForm, - onbatchDel, - handleSizeChange, - onSelectionCancel, - handleCellDblclick, - handleCurrentChange, - handleSelectionChange - }; -} diff --git a/src/views/monitor/logs/system/index.vue b/src/views/monitor/logs/system/index.vue deleted file mode 100644 index 154c05f..0000000 --- a/src/views/monitor/logs/system/index.vue +++ /dev/null @@ -1,119 +0,0 @@ - - - - - diff --git a/src/views/monitor/online/index.vue b/src/views/monitor/online/index.vue deleted file mode 100644 index 92ad3b3..0000000 --- a/src/views/monitor/online/index.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - - - diff --git a/src/views/monitor/test/index.vue b/src/views/monitor/test/index.vue deleted file mode 100644 index 601d04c..0000000 --- a/src/views/monitor/test/index.vue +++ /dev/null @@ -1,150 +0,0 @@ - - diff --git a/src/views/monitor/utils.ts b/src/views/monitor/utils.ts deleted file mode 100644 index 1350606..0000000 --- a/src/views/monitor/utils.ts +++ /dev/null @@ -1,129 +0,0 @@ -/** 日期、时间选择器快捷选项,常搭配 [DatePicker](https://element-plus.org/zh-CN/component/date-picker.html) 和 [DateTimePicker](https://element-plus.org/zh-CN/component/datetime-picker.html) 的`shortcuts`属性使用 */ -export const getPickerShortcuts = (): Array<{ - text: string; - value: Date | Function; -}> => { - return [ - { - text: "今天", - value: () => { - const today = new Date(); - today.setHours(0, 0, 0, 0); - const todayEnd = new Date(); - todayEnd.setHours(23, 59, 59, 999); - return [today, todayEnd]; - } - }, - { - text: "昨天", - value: () => { - const yesterday = new Date(); - yesterday.setDate(yesterday.getDate() - 1); - yesterday.setHours(0, 0, 0, 0); - const yesterdayEnd = new Date(); - yesterdayEnd.setDate(yesterdayEnd.getDate() - 1); - yesterdayEnd.setHours(23, 59, 59, 999); - return [yesterday, yesterdayEnd]; - } - }, - { - text: "前天", - value: () => { - const beforeYesterday = new Date(); - beforeYesterday.setDate(beforeYesterday.getDate() - 2); - beforeYesterday.setHours(0, 0, 0, 0); - const beforeYesterdayEnd = new Date(); - beforeYesterdayEnd.setDate(beforeYesterdayEnd.getDate() - 2); - beforeYesterdayEnd.setHours(23, 59, 59, 999); - return [beforeYesterday, beforeYesterdayEnd]; - } - }, - { - text: "本周", - value: () => { - const today = new Date(); - const startOfWeek = new Date( - today.getFullYear(), - today.getMonth(), - today.getDate() - today.getDay() + (today.getDay() === 0 ? -6 : 1) - ); - startOfWeek.setHours(0, 0, 0, 0); - const endOfWeek = new Date( - startOfWeek.getTime() + - 6 * 24 * 60 * 60 * 1000 + - 23 * 60 * 60 * 1000 + - 59 * 60 * 1000 + - 59 * 1000 + - 999 - ); - return [startOfWeek, endOfWeek]; - } - }, - { - text: "上周", - value: () => { - const today = new Date(); - const startOfLastWeek = new Date( - today.getFullYear(), - today.getMonth(), - today.getDate() - today.getDay() - 7 + (today.getDay() === 0 ? -6 : 1) - ); - startOfLastWeek.setHours(0, 0, 0, 0); - const endOfLastWeek = new Date( - startOfLastWeek.getTime() + - 6 * 24 * 60 * 60 * 1000 + - 23 * 60 * 60 * 1000 + - 59 * 60 * 1000 + - 59 * 1000 + - 999 - ); - return [startOfLastWeek, endOfLastWeek]; - } - }, - { - text: "本月", - value: () => { - const today = new Date(); - const startOfMonth = new Date(today.getFullYear(), today.getMonth(), 1); - startOfMonth.setHours(0, 0, 0, 0); - const endOfMonth = new Date( - today.getFullYear(), - today.getMonth() + 1, - 0 - ); - endOfMonth.setHours(23, 59, 59, 999); - return [startOfMonth, endOfMonth]; - } - }, - { - text: "上个月", - value: () => { - const today = new Date(); - const startOfLastMonth = new Date( - today.getFullYear(), - today.getMonth() - 1, - 1 - ); - startOfLastMonth.setHours(0, 0, 0, 0); - const endOfLastMonth = new Date( - today.getFullYear(), - today.getMonth(), - 0 - ); - endOfLastMonth.setHours(23, 59, 59, 999); - return [startOfLastMonth, endOfLastMonth]; - } - }, - { - text: "本年", - value: () => { - const today = new Date(); - const startOfYear = new Date(today.getFullYear(), 0, 1); - startOfYear.setHours(0, 0, 0, 0); - const endOfYear = new Date(today.getFullYear(), 11, 31); - endOfYear.setHours(23, 59, 59, 999); - return [startOfYear, endOfYear]; - } - } - ]; -}; diff --git a/src/views/permission/button/index.vue b/src/views/permission/button/index.vue deleted file mode 100644 index 20fc799..0000000 --- a/src/views/permission/button/index.vue +++ /dev/null @@ -1,106 +0,0 @@ - - - diff --git a/src/views/permission/page/index.vue b/src/views/permission/page/index.vue deleted file mode 100644 index cd602c6..0000000 --- a/src/views/permission/page/index.vue +++ /dev/null @@ -1,73 +0,0 @@ - - - diff --git a/src/views/system/dept/form.vue b/src/views/system/dept/form.vue deleted file mode 100644 index 9cedab7..0000000 --- a/src/views/system/dept/form.vue +++ /dev/null @@ -1,100 +0,0 @@ - - - diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue deleted file mode 100644 index 128b2ec..0000000 --- a/src/views/system/dept/index.vue +++ /dev/null @@ -1,92 +0,0 @@ - - - - - diff --git a/src/views/system/dept/utils/hook.tsx b/src/views/system/dept/utils/hook.tsx deleted file mode 100644 index cb7e8ea..0000000 --- a/src/views/system/dept/utils/hook.tsx +++ /dev/null @@ -1,179 +0,0 @@ -import dayjs from "dayjs"; -import editForm from "../form.vue"; -import { handleTree } from "@/utils/tree"; -import { message } from "@/utils/message"; -import { getDeptList } from "@/api/system"; -import { usePublicHooks } from "@/hooks/system/usePublicHooks"; -import { addDialog } from "@/components/ReDialog"; -import { h, onMounted, reactive, ref } from "vue"; -import type { FormItemProps } from "../utils/types"; -import { cloneDeep, deviceDetection, isAllEmpty } from "@pureadmin/utils"; - -export function useDept() { - const form = reactive({ - name: "", - status: null - }); - - const formRef = ref(); - const dataList = ref([]); - const loading = ref(true); - const { tagStyle } = usePublicHooks(); - - const columns: TableColumnList = [ - { - label: "部门名称", - prop: "name", - width: 180, - align: "left" - }, - { - label: "排序", - prop: "sort", - minWidth: 70 - }, - { - label: "状态", - prop: "status", - minWidth: 100, - cellRenderer: ({ row, props }) => ( - - {row.status === 1 ? "启用" : "停用"} - - ) - }, - { - label: "创建时间", - minWidth: 200, - prop: "createTime", - formatter: ({ createTime }) => dayjs(createTime).format("YYYY-MM-DD HH:mm:ss") - }, - { - label: "备注", - prop: "remark", - minWidth: 320 - }, - { - label: "操作", - fixed: "right", - width: 210, - slot: "operation" - } - ]; - - function handleSelectionChange(val) { - console.log("handleSelectionChange", val); - } - - function resetForm(formEl) { - if (!formEl) return; - formEl.resetFields(); - onSearch(); - } - - async function onSearch() { - loading.value = true; - const { data } = await getDeptList(); // 这里是返回一维数组结构,前端自行处理成树结构,返回格式要求:唯一id加父节点parentId,parentId取父节点id - let newData = data; - if (!isAllEmpty(form.name)) { - // 前端搜索部门名称 - newData = newData.filter(item => item.name.includes(form.name)); - } - if (!isAllEmpty(form.status)) { - // 前端搜索状态 - newData = newData.filter(item => item.status === form.status); - } - dataList.value = handleTree(newData); // 处理成树结构 - setTimeout(() => { - loading.value = false; - }, 500); - } - - function formatHigherDeptOptions(treeList) { - // 根据返回数据的status字段值判断追加是否禁用disabled字段,返回处理后的树结构,用于上级部门级联选择器的展示(实际开发中也是如此,不可能前端需要的每个字段后端都会返回,这时需要前端自行根据后端返回的某些字段做逻辑处理) - if (!treeList || !treeList.length) return; - const newTreeList = []; - for (let i = 0; i < treeList.length; i++) { - treeList[i].disabled = treeList[i].status === 0 ? true : false; - formatHigherDeptOptions(treeList[i].children); - newTreeList.push(treeList[i]); - } - return newTreeList; - } - - function openDialog(title = "新增", row?: FormItemProps) { - addDialog({ - title: `${title}部门`, - props: { - formInline: { - higherDeptOptions: formatHigherDeptOptions(cloneDeep(dataList.value)), - parentId: row?.parentId ?? 0, - name: row?.name ?? "", - principal: row?.principal ?? "", - phone: row?.phone ?? "", - email: row?.email ?? "", - sort: row?.sort ?? 0, - status: row?.status ?? 1, - remark: row?.remark ?? "" - } - }, - width: "40%", - draggable: true, - fullscreen: deviceDetection(), - fullscreenIcon: true, - closeOnClickModal: false, - contentRenderer: () => h(editForm, { ref: formRef }), - beforeSure: (done, { options }) => { - const FormRef = formRef.value.getRef(); - const curData = options.props.formInline as FormItemProps; - - function chores() { - message(`您${title}了部门名称为${curData.name}的这条数据`, { - type: "success" - }); - done(); // 关闭弹框 - onSearch(); // 刷新表格数据 - } - - FormRef.validate(valid => { - if (valid) { - console.log("curData", curData); - // 表单规则校验通过 - if (title === "新增") { - // 实际开发先调用新增接口,再进行下面操作 - chores(); - } else { - // 实际开发先调用修改接口,再进行下面操作 - chores(); - } - } - }); - } - }); - } - - function handleDelete(row) { - message(`您删除了部门名称为${row.name}的这条数据`, { type: "success" }); - onSearch(); - } - - onMounted(() => { - onSearch(); - }); - - return { - form, - loading, - columns, - dataList, - /** 搜索 */ - onSearch, - /** 重置 */ - resetForm, - /** 新增、修改部门 */ - openDialog, - /** 删除部门 */ - handleDelete, - handleSelectionChange - }; -} diff --git a/src/views/system/dept/utils/rule.ts b/src/views/system/dept/utils/rule.ts deleted file mode 100644 index b20bf67..0000000 --- a/src/views/system/dept/utils/rule.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { reactive } from "vue"; -import type { FormRules } from "element-plus"; -import { isPhone, isEmail } from "@pureadmin/utils"; - -/** 自定义表单规则校验 */ -export const formRules = reactive({ - name: [{ required: true, message: "部门名称为必填项", trigger: "blur" }], - phone: [ - { - validator: (rule, value, callback) => { - if (value === "") { - callback(); - } else if (!isPhone(value)) { - callback(new Error("请输入正确的手机号码格式")); - } else { - callback(); - } - }, - trigger: "blur" - // trigger: "click" // 如果想在点击确定按钮时触发这个校验,trigger 设置成 click 即可 - } - ], - email: [ - { - validator: (rule, value, callback) => { - if (value === "") { - callback(); - } else if (!isEmail(value)) { - callback(new Error("请输入正确的邮箱格式")); - } else { - callback(); - } - }, - trigger: "blur" - } - ] -}); diff --git a/src/views/system/dept/utils/types.ts b/src/views/system/dept/utils/types.ts deleted file mode 100644 index 7547d6b..0000000 --- a/src/views/system/dept/utils/types.ts +++ /dev/null @@ -1,16 +0,0 @@ -interface FormItemProps { - higherDeptOptions: Record[]; - parentId: number; - name: string; - principal: string; - phone: string | number; - email: string; - sort: number; - status: number; - remark: string; -} -interface FormProps { - formInline: FormItemProps; -} - -export type { FormItemProps, FormProps }; diff --git a/src/views/system/menu/README.md b/src/views/system/menu/README.md deleted file mode 100644 index cd1b1d6..0000000 --- a/src/views/system/menu/README.md +++ /dev/null @@ -1,26 +0,0 @@ -## 字段含义 - -| 字段 | 说明 | -|:------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `menuType` | 菜单类型(`0`代表菜单、`1`代表`iframe`、`2`代表外链、`3`代表按钮) | -| `parentId` | | -| `title` | 菜单名称(兼容国际化、非国际化,如果用国际化的写法就必须在根目录的`locales`文件夹下对应添加) | -| `name` | 路由名称(必须唯一并且和当前路由`component`字段对应的页面里用`defineOptions`包起来的`name`保持一致) | -| `path` | 路由路径 | -| `component` | 组件路径(传`component`组件路径,那么`path`可以随便写,如果不传,`component`组件路径会跟`path`保持一致) | -| `rank` | 菜单排序(平台规定只有`home`路由的`rank`才能为`0`,所以后端在返回`rank`的时候需要从非`0`开始 [点击查看更多](https://pure-admin.github.io/pure-admin-doc/pages/routerMenu/#%E8%8F%9C%E5%8D%95%E6%8E%92%E5%BA%8F-rank)) | -| `redirect` | 路由重定向 | -| `icon` | 菜单图标 | -| `extraIcon` | 右侧图标 | -| `enterTransition` | 进场动画(页面加载动画) | -| `leaveTransition` | 离场动画(页面加载动画) | -| `activePath` | 菜单激活(将某个菜单激活,主要用于通过`query`或`params`传参的路由,当它们通过配置`showLink: false`后不在菜单中显示,就不会有任何菜单高亮,而通过设置`activePath`指定激活菜单即可获得高亮,`activePath`为指定激活菜单的`path`) | -| `auths` | 权限标识(按钮级别权限设置) | -| `frameSrc` | 链接地址(需要内嵌的`iframe`链接地址) | -| `frameLoading` | 加载动画(内嵌的`iframe`页面是否开启首次加载动画) | -| `keepAlive` | 缓存页面(是否缓存该路由页面,开启后会保存该页面的整体状态,刷新后会清空状态) | -| `hiddenTag` | 标签页(当前菜单名称或自定义信息禁止添加到标签页) | -| `fixedTag` | 固定标签页(当前菜单名称是否固定显示在标签页且不可关闭) | -| `showLink` | 菜单(是否显示该菜单) | -| `showParent` | 父级菜单(是否显示父级菜单 [点击查看更多](https://pure-admin.github.io/pure-admin-doc/pages/routerMenu/#%E7%AC%AC%E4%B8%80%E7%A7%8D-%E8%AF%A5%E6%A8%A1%E5%BC%8F%E9%92%88%E5%AF%B9%E7%88%B6%E7%BA%A7%E8%8F%9C%E5%8D%95%E4%B8%8B%E5%8F%AA%E6%9C%89%E4%B8%80%E4%B8%AA%E5%AD%90%E8%8F%9C%E5%8D%95%E7%9A%84%E6%83%85%E5%86%B5-%E5%9C%A8%E5%AD%90%E8%8F%9C%E5%8D%95%E7%9A%84-meta-%E5%B1%9E%E6%80%A7%E4%B8%AD%E5%8A%A0%E4%B8%8A-showparent-true-%E5%8D%B3%E5%8F%AF)) | - diff --git a/src/views/system/menu/form.vue b/src/views/system/menu/form.vue deleted file mode 100644 index 954952d..0000000 --- a/src/views/system/menu/form.vue +++ /dev/null @@ -1,238 +0,0 @@ - - - diff --git a/src/views/system/menu/index.vue b/src/views/system/menu/index.vue deleted file mode 100644 index 79d3d9c..0000000 --- a/src/views/system/menu/index.vue +++ /dev/null @@ -1,91 +0,0 @@ - - - - - diff --git a/src/views/system/menu/utils/enums.ts b/src/views/system/menu/utils/enums.ts deleted file mode 100644 index 4466b61..0000000 --- a/src/views/system/menu/utils/enums.ts +++ /dev/null @@ -1,108 +0,0 @@ -import type { OptionsType } from "@/components/ReSegmented"; - -const menuTypeOptions: Array = [ - { - label: "菜单", - value: 0 - }, - { - label: "iframe", - value: 1 - }, - { - label: "外链", - value: 2 - }, - { - label: "按钮", - value: 3 - } -]; - -const showLinkOptions: Array = [ - { - label: "显示", - tip: "会在菜单中显示", - value: true - }, - { - label: "隐藏", - tip: "不会在菜单中显示", - value: false - } -]; - -const fixedTagOptions: Array = [ - { - label: "固定", - tip: "当前菜单名称固定显示在标签页且不可关闭", - value: true - }, - { - label: "不固定", - tip: "当前菜单名称不固定显示在标签页且可关闭", - value: false - } -]; - -const keepAliveOptions: Array = [ - { - label: "缓存", - tip: "会保存该页面的整体状态,刷新后会清空状态", - value: true - }, - { - label: "不缓存", - tip: "不会保存该页面的整体状态", - value: false - } -]; - -const hiddenTagOptions: Array = [ - { - label: "允许", - tip: "当前菜单名称或自定义信息允许添加到标签页", - value: false - }, - { - label: "禁止", - tip: "当前菜单名称或自定义信息禁止添加到标签页", - value: true - } -]; - -const showParentOptions: Array = [ - { - label: "显示", - tip: "会显示父级菜单", - value: true - }, - { - label: "隐藏", - tip: "不会显示父级菜单", - value: false - } -]; - -const frameLoadingOptions: Array = [ - { - label: "开启", - tip: "有首次加载动画", - value: true - }, - { - label: "关闭", - tip: "无首次加载动画", - value: false - } -]; - -export { - menuTypeOptions, - showLinkOptions, - fixedTagOptions, - keepAliveOptions, - hiddenTagOptions, - showParentOptions, - frameLoadingOptions -}; diff --git a/src/views/system/menu/utils/hook.tsx b/src/views/system/menu/utils/hook.tsx deleted file mode 100644 index 6aa8e81..0000000 --- a/src/views/system/menu/utils/hook.tsx +++ /dev/null @@ -1,225 +0,0 @@ -import editForm from "../form.vue"; -import { handleTree } from "@/utils/tree"; -import { message } from "@/utils/message"; -import { getMenuList } from "@/api/system"; -import { transformI18n } from "@/plugins/i18n"; -import { addDialog } from "@/components/ReDialog"; -import { reactive, ref, onMounted, h } from "vue"; -import type { FormItemProps } from "../utils/types"; -import { useRenderIcon } from "@/components/ReIcon/src/hooks"; -import { cloneDeep, isAllEmpty, deviceDetection } from "@pureadmin/utils"; - -export function useMenu() { - const form = reactive({ - title: "" - }); - - const formRef = ref(); - const dataList = ref([]); - const loading = ref(true); - - const getMenuType = (type, text = false) => { - switch (type) { - case 0: - return text ? "菜单" : "primary"; - case 1: - return text ? "iframe" : "warning"; - case 2: - return text ? "外链" : "danger"; - case 3: - return text ? "按钮" : "info"; - } - }; - - const columns: TableColumnList = [ - { - label: "菜单名称", - prop: "title", - align: "left", - cellRenderer: ({ row }) => ( - <> - - {h(useRenderIcon(row.icon), { - style: { paddingTop: "1px" } - })} - - {transformI18n(row.title)} - - ) - }, - { - label: "菜单类型", - prop: "menuType", - width: 100, - cellRenderer: ({ row, props }) => ( - - {getMenuType(row.menuType, true)} - - ) - }, - { - label: "路由路径", - prop: "path" - }, - { - label: "组件路径", - prop: "component", - formatter: ({ path, component }) => - isAllEmpty(component) ? path : component - }, - { - label: "权限标识", - prop: "auths" - }, - { - label: "排序", - prop: "rank", - width: 100 - }, - { - label: "隐藏", - prop: "showLink", - formatter: ({ showLink }) => (showLink ? "否" : "是"), - width: 100 - }, - { - label: "操作", - fixed: "right", - width: 210, - slot: "operation" - } - ]; - - function handleSelectionChange(val) { - console.log("handleSelectionChange", val); - } - - function resetForm(formEl) { - if (!formEl) return; - formEl.resetFields(); - onSearch(); - } - - async function onSearch() { - loading.value = true; - const { data } = await getMenuList(); // 这里是返回一维数组结构,前端自行处理成树结构,返回格式要求:唯一id加父节点parentId,parentId取父节点id - let newData = data; - if (!isAllEmpty(form.title)) { - // 前端搜索菜单名称 - newData = newData.filter(item => - transformI18n(item.title).includes(form.title) - ); - } - dataList.value = handleTree(newData); // 处理成树结构 - setTimeout(() => { - loading.value = false; - }, 500); - } - - function formatHigherMenuOptions(treeList) { - if (!treeList || !treeList.length) return; - const newTreeList = []; - for (let i = 0; i < treeList.length; i++) { - treeList[i].title = transformI18n(treeList[i].title); - formatHigherMenuOptions(treeList[i].children); - newTreeList.push(treeList[i]); - } - return newTreeList; - } - - function openDialog(title = "新增", row?: FormItemProps) { - addDialog({ - title: `${title}菜单`, - props: { - formInline: { - menuType: row?.menuType ?? 0, - higherMenuOptions: formatHigherMenuOptions(cloneDeep(dataList.value)), - parentId: row?.parentId ?? 0, - title: row?.title ?? "", - name: row?.name ?? "", - path: row?.path ?? "", - component: row?.component ?? "", - rank: row?.rank ?? 99, - redirect: row?.redirect ?? "", - icon: row?.icon ?? "", - extraIcon: row?.extraIcon ?? "", - enterTransition: row?.enterTransition ?? "", - leaveTransition: row?.leaveTransition ?? "", - activePath: row?.activePath ?? "", - auths: row?.auths ?? "", - frameSrc: row?.frameSrc ?? "", - frameLoading: row?.frameLoading ?? true, - keepAlive: row?.keepAlive ?? false, - hiddenTag: row?.hiddenTag ?? false, - fixedTag: row?.fixedTag ?? false, - showLink: row?.showLink ?? true, - showParent: row?.showParent ?? false - } - }, - width: "45%", - draggable: true, - fullscreen: deviceDetection(), - fullscreenIcon: true, - closeOnClickModal: false, - contentRenderer: () => h(editForm, { ref: formRef }), - beforeSure: (done, { options }) => { - const FormRef = formRef.value.getRef(); - const curData = options.props.formInline as FormItemProps; - function chores() { - message( - `您${title}了菜单名称为${transformI18n(curData.title)}的这条数据`, - { - type: "success" - } - ); - done(); // 关闭弹框 - onSearch(); // 刷新表格数据 - } - FormRef.validate(valid => { - if (valid) { - console.log("curData", curData); - // 表单规则校验通过 - if (title === "新增") { - // 实际开发先调用新增接口,再进行下面操作 - chores(); - } else { - // 实际开发先调用修改接口,再进行下面操作 - chores(); - } - } - }); - } - }); - } - - function handleDelete(row) { - message(`您删除了菜单名称为${transformI18n(row.title)}的这条数据`, { - type: "success" - }); - onSearch(); - } - - onMounted(() => { - onSearch(); - }); - - return { - form, - loading, - columns, - dataList, - /** 搜索 */ - onSearch, - /** 重置 */ - resetForm, - /** 新增、修改菜单 */ - openDialog, - /** 删除菜单 */ - handleDelete, - handleSelectionChange - }; -} diff --git a/src/views/system/menu/utils/rule.ts b/src/views/system/menu/utils/rule.ts deleted file mode 100644 index 90b3548..0000000 --- a/src/views/system/menu/utils/rule.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { reactive } from "vue"; -import type { FormRules } from "element-plus"; - -/** 自定义表单规则校验 */ -export const formRules = reactive({ - title: [{ required: true, message: "菜单名称为必填项", trigger: "blur" }], - name: [{ required: true, message: "路由名称为必填项", trigger: "blur" }], - path: [{ required: true, message: "路由路径为必填项", trigger: "blur" }], - auths: [{ required: true, message: "权限标识为必填项", trigger: "blur" }] -}); diff --git a/src/views/system/menu/utils/types.ts b/src/views/system/menu/utils/types.ts deleted file mode 100644 index f07d1f7..0000000 --- a/src/views/system/menu/utils/types.ts +++ /dev/null @@ -1,30 +0,0 @@ -interface FormItemProps { - /** 菜单类型(0代表菜单、1代表iframe、2代表外链、3代表按钮)*/ - menuType: number; - higherMenuOptions: Record[]; - parentId: number; - title: string; - name: string; - path: string; - component: string; - rank: number; - redirect: string; - icon: string; - extraIcon: string; - enterTransition: string; - leaveTransition: string; - activePath: string; - auths: string; - frameSrc: string; - frameLoading: boolean; - keepAlive: boolean; - hiddenTag: boolean; - fixedTag: boolean; - showLink: boolean; - showParent: boolean; -} -interface FormProps { - formInline: FormItemProps; -} - -export type { FormItemProps, FormProps }; diff --git a/src/views/system/role/form.vue b/src/views/system/role/form.vue deleted file mode 100644 index 65d4ef0..0000000 --- a/src/views/system/role/form.vue +++ /dev/null @@ -1,55 +0,0 @@ - - - diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue deleted file mode 100644 index 4faba3b..0000000 --- a/src/views/system/role/index.vue +++ /dev/null @@ -1,254 +0,0 @@ - - - - - diff --git a/src/views/system/role/utils/hook.tsx b/src/views/system/role/utils/hook.tsx deleted file mode 100644 index c3a78cf..0000000 --- a/src/views/system/role/utils/hook.tsx +++ /dev/null @@ -1,288 +0,0 @@ -import dayjs from "dayjs"; -import editForm from "../form.vue"; -import { handleTree } from "@/utils/tree"; -import { message } from "@/utils/message"; -import { ElMessageBox } from "element-plus"; -import { usePublicHooks } from "@/hooks/system/usePublicHooks"; -import { transformI18n } from "@/plugins/i18n"; -import { addDialog } from "@/components/ReDialog"; -import type { FormItemProps } from "../utils/types"; -import type { PaginationProps } from "@pureadmin/table"; -import { deviceDetection, getKeyList } from "@pureadmin/utils"; -import { getRoleList, getRoleMenu, getRoleMenuIds } from "@/api/system"; -import { h, onMounted, reactive, type Ref, ref, toRaw, watch } from "vue"; - -export function useRole(treeRef: Ref) { - const form = reactive({ - name: "", - code: "", - status: "" - }); - const curRow = ref(); - const formRef = ref(); - const dataList = ref([]); - const treeIds = ref([]); - const treeData = ref([]); - const isShow = ref(false); - const loading = ref(true); - const isLinkage = ref(false); - const treeSearchValue = ref(); - const switchLoadMap = ref({}); - const isExpandAll = ref(false); - const isSelectAll = ref(false); - const { switchStyle } = usePublicHooks(); - const treeProps = { - value: "id", - label: "title", - children: "children" - }; - const pagination = reactive({ - total: 0, - pageSize: 10, - currentPage: 1, - background: true - }); - const columns: TableColumnList = [ - { - label: "角色编号", - prop: "id" - }, - { - label: "角色名称", - prop: "name" - }, - { - label: "角色标识", - prop: "code" - }, - { - label: "状态", - cellRenderer: scope => ( - onChange(scope as any)} - /> - ), - minWidth: 90 - }, - { - label: "备注", - prop: "remark", - minWidth: 160 - }, - { - label: "创建时间", - prop: "createTime", - minWidth: 160, - formatter: ({ createTime }) => dayjs(createTime).format("YYYY-MM-DD HH:mm:ss") - }, - { - label: "操作", - fixed: "right", - width: 210, - slot: "operation" - } - ]; - - function onChange({ row, index }) { - ElMessageBox.confirm(`确认要${row.status === 0 ? "停用" : "启用"}${row.name}吗?`, "系统提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning", - dangerouslyUseHTMLString: true, - draggable: true - }) - .then(() => { - switchLoadMap.value[index] = Object.assign({}, switchLoadMap.value[index], { - loading: true - }); - setTimeout(() => { - switchLoadMap.value[index] = Object.assign({}, switchLoadMap.value[index], { - loading: false - }); - message(`已${row.status === 0 ? "停用" : "启用"}${row.name}`, { - type: "success" - }); - }, 300); - }) - .catch(() => { - row.status === 0 ? (row.status = 1) : (row.status = 0); - }); - } - - function handleDelete(row) { - message(`您删除了角色名称为${row.name}的这条数据`, { type: "success" }); - onSearch(); - } - - function handleSizeChange(val: number) { - console.log(`${val} items per page`); - } - - function handleCurrentChange(val: number) { - console.log(`current page: ${val}`); - } - - function handleSelectionChange(val) { - console.log("handleSelectionChange", val); - } - - async function onSearch() { - loading.value = true; - const { data } = await getRoleList(toRaw(form)); - dataList.value = data.list; - pagination.total = data.total; - pagination.pageSize = data.pageSize; - pagination.currentPage = data.currentPage; - - setTimeout(() => { - loading.value = false; - }, 500); - } - - const resetForm = formEl => { - if (!formEl) return; - formEl.resetFields(); - onSearch().then(); - }; - - function openDialog(title = "新增", row?: FormItemProps) { - addDialog({ - title: `${title}角色`, - props: { - formInline: { - name: row?.name ?? "", - code: row?.code ?? "", - remark: row?.remark ?? "" - } - }, - width: "40%", - draggable: true, - fullscreen: deviceDetection(), - fullscreenIcon: true, - closeOnClickModal: false, - contentRenderer: () => h(editForm, { ref: formRef }), - beforeSure: (done, { options }) => { - const FormRef = formRef.value.getRef(); - const curData = options.props.formInline as FormItemProps; - - function chores() { - message(`您${title}了角色名称为${curData.name}的这条数据`, { - type: "success" - }); - done(); // 关闭弹框 - onSearch(); // 刷新表格数据 - } - - FormRef.validate(valid => { - if (valid) { - console.log("curData", curData); - // 表单规则校验通过 - if (title === "新增") { - // 实际开发先调用新增接口,再进行下面操作 - chores(); - } else { - // 实际开发先调用修改接口,再进行下面操作 - chores(); - } - } - }); - } - }); - } - - /** 菜单权限 */ - async function handleMenu(row?: any) { - const { id } = row; - if (id) { - curRow.value = row; - isShow.value = true; - const { data } = await getRoleMenuIds({ id }); - treeRef.value.setCheckedKeys(data); - } else { - curRow.value = null; - isShow.value = false; - } - } - - /** 高亮当前权限选中行 */ - function rowStyle({ row: { id } }) { - return { - cursor: "pointer", - background: id === curRow.value?.id ? "var(--el-fill-color-light)" : "" - }; - } - - /** 菜单权限-保存 */ - function handleSave() { - const { id, name } = curRow.value; - // 根据用户 id 调用实际项目中菜单权限修改接口 - console.log(id, treeRef.value.getCheckedKeys()); - message(`角色名称为${name}的菜单权限修改成功`, { - type: "success" - }); - } - - /** 数据权限 可自行开发 */ - // function handleDatabase() {} - - const onQueryChanged = (query: string) => { - treeRef.value!.filter(query); - }; - - const filterMethod = (query: string, node) => { - return transformI18n(node.title)!.includes(query); - }; - - onMounted(async () => { - onSearch(); - const { data } = await getRoleMenu(); - treeIds.value = getKeyList(data, "id"); - treeData.value = handleTree(data); - }); - - watch(isExpandAll, val => { - val ? treeRef.value.setExpandedKeys(treeIds.value) : treeRef.value.setExpandedKeys([]); - }); - - watch(isSelectAll, val => { - val ? treeRef.value.setCheckedKeys(treeIds.value) : treeRef.value.setCheckedKeys([]); - }); - - return { - form, - isShow, - curRow, - loading, - columns, - rowStyle, - dataList, - treeData, - treeProps, - isLinkage, - pagination, - isExpandAll, - isSelectAll, - treeSearchValue, - onSearch, - resetForm, - openDialog, - handleMenu, - handleSave, - handleDelete, - filterMethod, - transformI18n, - onQueryChanged, - handleSizeChange, - handleCurrentChange, - handleSelectionChange - }; -} diff --git a/src/views/system/role/utils/rule.ts b/src/views/system/role/utils/rule.ts deleted file mode 100644 index ea1dd19..0000000 --- a/src/views/system/role/utils/rule.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { reactive } from "vue"; -import type { FormRules } from "element-plus"; - -/** 自定义表单规则校验 */ -export const formRules = reactive({ - name: [{ required: true, message: "角色名称为必填项", trigger: "blur" }], - code: [{ required: true, message: "角色标识为必填项", trigger: "blur" }] -}); diff --git a/src/views/system/role/utils/types.ts b/src/views/system/role/utils/types.ts deleted file mode 100644 index a17e900..0000000 --- a/src/views/system/role/utils/types.ts +++ /dev/null @@ -1,15 +0,0 @@ -// 虽然字段很少 但是抽离出来 后续有扩展字段需求就很方便了 - -interface FormItemProps { - /** 角色名称 */ - name: string; - /** 角色编号 */ - code: string; - /** 备注 */ - remark: string; -} -interface FormProps { - formInline: FormItemProps; -} - -export type { FormItemProps, FormProps }; diff --git a/src/views/system/user/form/index.vue b/src/views/system/user/form/index.vue deleted file mode 100644 index 6f8273f..0000000 --- a/src/views/system/user/form/index.vue +++ /dev/null @@ -1,119 +0,0 @@ - - - diff --git a/src/views/system/user/form/role.vue b/src/views/system/user/form/role.vue deleted file mode 100644 index 19adc5b..0000000 --- a/src/views/system/user/form/role.vue +++ /dev/null @@ -1,53 +0,0 @@ - - - diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue deleted file mode 100644 index 754f76c..0000000 --- a/src/views/system/user/index.vue +++ /dev/null @@ -1,162 +0,0 @@ - - - - - diff --git a/src/views/system/user/svg/expand.svg b/src/views/system/user/svg/expand.svg deleted file mode 100644 index bb41c35..0000000 --- a/src/views/system/user/svg/expand.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/views/system/user/svg/unexpand.svg b/src/views/system/user/svg/unexpand.svg deleted file mode 100644 index 04b3e9d..0000000 --- a/src/views/system/user/svg/unexpand.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/views/system/user/tree.vue b/src/views/system/user/tree.vue deleted file mode 100644 index 2e9e82c..0000000 --- a/src/views/system/user/tree.vue +++ /dev/null @@ -1,213 +0,0 @@ - - - - - diff --git a/src/views/system/user/utils/hook.tsx b/src/views/system/user/utils/hook.tsx deleted file mode 100644 index aaf476a..0000000 --- a/src/views/system/user/utils/hook.tsx +++ /dev/null @@ -1,454 +0,0 @@ -import "./reset.css"; -import dayjs from "dayjs"; -import roleForm from "../form/role.vue"; -import editForm from "../form/index.vue"; -import { zxcvbn } from "@zxcvbn-ts/core"; -import { handleTree } from "@/utils/tree"; -import { message } from "@/utils/message"; -import userAvatar from "@/assets/user.jpg"; -import { usePublicHooks } from "@/hooks/system/usePublicHooks"; -import { addDialog } from "@/components/ReDialog"; -import type { PaginationProps } from "@pureadmin/table"; -import ReCropperPreview from "@/components/ReCropperPreview"; -import type { FormItemProps, RoleFormItemProps } from "../utils/types"; -import { deviceDetection, getKeyList, hideTextAtIndex, isAllEmpty } from "@pureadmin/utils"; -import { getAllRoleList, getDeptList, getRoleIds, getUserList } from "@/api/system"; -import { ElForm, ElFormItem, ElInput, ElMessageBox, ElProgress } from "element-plus"; -import { computed, h, onMounted, reactive, ref, type Ref, toRaw, watch } from "vue"; - -export function useUser(tableRef: Ref, treeRef: Ref) { - const form = reactive({ - // 左侧部门树的id - deptId: "", - username: "", - phone: "", - status: "" - }); - const formRef = ref(); - const ruleFormRef = ref(); - const dataList = ref([]); - const loading = ref(true); - // 上传头像信息 - const avatarInfo = ref(); - const switchLoadMap = ref({}); - const { switchStyle } = usePublicHooks(); - const higherDeptOptions = ref(); - const treeData = ref([]); - const treeLoading = ref(true); - const selectedNum = ref(0); - const pagination = reactive({ - total: 0, - pageSize: 10, - currentPage: 1, - background: true - }); - const columns: TableColumnList = [ - { - label: "勾选列", // 如果需要表格多选,此处label必须设置 - type: "selection", - fixed: "left", - reserveSelection: true // 数据刷新后保留选项 - }, - { - label: "用户编号", - prop: "id", - width: 90 - }, - { - label: "用户头像", - prop: "avatar", - cellRenderer: ({ row }) => , - width: 90 - }, - { - label: "用户名称", - prop: "username", - minWidth: 130 - }, - { - label: "用户昵称", - prop: "nickname", - minWidth: 130 - }, - { - label: "性别", - prop: "sex", - minWidth: 90, - cellRenderer: ({ row, props }) => ( - - {row.sex === 1 ? "女" : "男"} - - ) - }, - { - label: "部门", - prop: "dept.name", - minWidth: 90 - }, - { - label: "手机号码", - prop: "phone", - minWidth: 90, - formatter: ({ phone }) => hideTextAtIndex(phone, { start: 3, end: 6 }) - }, - { - label: "状态", - prop: "status", - minWidth: 90, - cellRenderer: scope => ( - onChange(scope as any)} - /> - ) - }, - { - label: "创建时间", - minWidth: 90, - prop: "createTime", - formatter: ({ createTime }) => dayjs(createTime).format("YYYY-MM-DD HH:mm:ss") - }, - { - label: "操作", - fixed: "right", - width: 180, - slot: "operation" - } - ]; - const buttonClass = computed(() => { - return ["!h-[20px]", "reset-margin", "!text-gray-500", "dark:!text-white", "dark:hover:!text-primary"]; - }); - // 重置的新密码 - const pwdForm = reactive({ - newPwd: "" - }); - const pwdProgress = [ - { color: "#e74242", text: "非常弱" }, - { color: "#EFBD47", text: "弱" }, - { color: "#ffa500", text: "一般" }, - { color: "#1bbf1b", text: "强" }, - { color: "#008000", text: "非常强" } - ]; - // 当前密码强度(0-4) - const curScore = ref(); - const roleOptions = ref([]); - - function onChange({ row, index }) { - ElMessageBox.confirm(`确认要${row.status === 0 ? "停用" : "启用"}${row.username}用户吗?`, "系统提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning", - dangerouslyUseHTMLString: true, - draggable: true - }) - .then(() => { - switchLoadMap.value[index] = Object.assign({}, switchLoadMap.value[index], { - loading: true - }); - setTimeout(() => { - switchLoadMap.value[index] = Object.assign({}, switchLoadMap.value[index], { - loading: false - }); - message("已成功修改用户状态", { - type: "success" - }); - }, 300); - }) - .catch(() => { - row.status === 0 ? (row.status = 1) : (row.status = 0); - }); - } - - function handleUpdate(row) { - console.log(row); - } - - function handleDelete(row) { - message(`您删除了用户编号为${row.id}的这条数据`, { type: "success" }); - onSearch(); - } - - function handleSizeChange(val: number) { - console.log(`${val} items per page`); - } - - function handleCurrentChange(val: number) { - console.log(`current page: ${val}`); - } - - /** 当CheckBox选择项发生变化时会触发该事件 */ - function handleSelectionChange(val) { - selectedNum.value = val.length; - // 重置表格高度 - tableRef.value.setAdaptive(); - } - - /** 取消选择 */ - function onSelectionCancel() { - selectedNum.value = 0; - // 用于多选表格,清空用户的选择 - tableRef.value.getTableRef().clearSelection(); - } - - /** 批量删除 */ - function onbatchDel() { - // 返回当前选中的行 - const curSelected = tableRef.value.getTableRef().getSelectionRows(); - // 接下来根据实际业务,通过选中行的某项数据,比如下面的id,调用接口进行批量删除 - message(`已删除用户编号为 ${getKeyList(curSelected, "id")} 的数据`, { - type: "success" - }); - tableRef.value.getTableRef().clearSelection(); - onSearch(); - } - - async function onSearch() { - loading.value = true; - const { data } = await getUserList(toRaw(form)); - dataList.value = data.list; - pagination.total = data.total; - pagination.pageSize = data.pageSize; - pagination.currentPage = data.currentPage; - - setTimeout(() => { - loading.value = false; - }, 500); - } - - const resetForm = formEl => { - if (!formEl) return; - formEl.resetFields(); - form.deptId = ""; - treeRef.value.onTreeReset(); - onSearch(); - }; - - function onTreeSelect({ id, selected }) { - form.deptId = selected ? id : ""; - onSearch(); - } - - function formatHigherDeptOptions(treeList) { - // 根据返回数据的status字段值判断追加是否禁用disabled字段,返回处理后的树结构,用于上级部门级联选择器的展示(实际开发中也是如此,不可能前端需要的每个字段后端都会返回,这时需要前端自行根据后端返回的某些字段做逻辑处理) - if (!treeList || !treeList.length) return; - const newTreeList = []; - for (let i = 0; i < treeList.length; i++) { - treeList[i].disabled = treeList[i].status === 0 ? true : false; - formatHigherDeptOptions(treeList[i].children); - newTreeList.push(treeList[i]); - } - return newTreeList; - } - - function openDialog(title = "新增", row?: FormItemProps) { - addDialog({ - title: `${title}用户`, - props: { - formInline: { - title, - higherDeptOptions: formatHigherDeptOptions(higherDeptOptions.value), - parentId: row?.dept.id ?? 0, - nickname: row?.nickname ?? "", - username: row?.username ?? "", - password: row?.password ?? "", - phone: row?.phone ?? "", - email: row?.email ?? "", - sex: row?.sex ?? "", - status: row?.status ?? 1, - remark: row?.remark ?? "" - } - }, - width: "46%", - draggable: true, - fullscreen: deviceDetection(), - fullscreenIcon: true, - closeOnClickModal: false, - contentRenderer: () => h(editForm, { ref: formRef }), - beforeSure: (done, { options }) => { - const FormRef = formRef.value.getRef(); - const curData = options.props.formInline as FormItemProps; - - function chores() { - message(`您${title}了用户名称为${curData.username}的这条数据`, { - type: "success" - }); - done(); // 关闭弹框 - onSearch(); // 刷新表格数据 - } - - FormRef.validate(valid => { - if (valid) { - console.log("curData", curData); - // 表单规则校验通过 - if (title === "新增") { - // 实际开发先调用新增接口,再进行下面操作 - chores(); - } else { - // 实际开发先调用修改接口,再进行下面操作 - chores(); - } - } - }); - } - }); - } - - const cropRef = ref(); - - /** 上传头像 */ - function handleUpload(row) { - addDialog({ - title: "裁剪、上传头像", - width: "40%", - closeOnClickModal: false, - fullscreen: deviceDetection(), - contentRenderer: () => - h(ReCropperPreview, { - ref: cropRef, - imgSrc: row.avatar || userAvatar, - onCropper: info => (avatarInfo.value = info) - }), - beforeSure: done => { - console.log("裁剪后的图片信息:", avatarInfo.value); - // 根据实际业务使用avatarInfo.value和row里的某些字段去调用上传头像接口即可 - done(); // 关闭弹框 - onSearch(); // 刷新表格数据 - }, - closeCallBack: () => cropRef.value.hidePopover() - }); - } - - watch(pwdForm, ({ newPwd }) => (curScore.value = isAllEmpty(newPwd) ? -1 : zxcvbn(newPwd).score)); - - /** 重置密码 */ - function handleReset(row) { - addDialog({ - title: `重置 ${row.username} 用户的密码`, - width: "30%", - draggable: true, - closeOnClickModal: false, - fullscreen: deviceDetection(), - contentRenderer: () => ( - <> - - - - - -
- {pwdProgress.map(({ color, text }, idx) => ( -
- = idx ? 100 : 0} color={color} stroke-width={10} show-text={false} /> -

- {text} -

-
- ))} -
- - ), - closeCallBack: () => (pwdForm.newPwd = ""), - beforeSure: done => { - ruleFormRef.value.validate(valid => { - if (valid) { - // 表单规则校验通过 - message(`已成功重置 ${row.username} 用户的密码`, { - type: "success" - }); - console.log(pwdForm.newPwd); - // 根据实际业务使用pwdForm.newPwd和row里的某些字段去调用重置用户密码接口即可 - done(); // 关闭弹框 - onSearch(); // 刷新表格数据 - } - }); - } - }); - } - - /** 分配角色 */ - async function handleRole(row) { - // 选中的角色列表 - const ids = (await getRoleIds({ userId: row.id })).data ?? []; - addDialog({ - title: `分配 ${row.username} 用户的角色`, - props: { - formInline: { - username: row?.username ?? "", - nickname: row?.nickname ?? "", - roleOptions: roleOptions.value ?? [], - ids - } - }, - width: "400px", - draggable: true, - fullscreen: deviceDetection(), - fullscreenIcon: true, - closeOnClickModal: false, - contentRenderer: () => h(roleForm), - beforeSure: (done, { options }) => { - const curData = options.props.formInline as RoleFormItemProps; - console.log("curIds", curData.ids); - // 根据实际业务使用curData.ids和row里的某些字段去调用修改角色接口即可 - done(); // 关闭弹框 - } - }); - } - - onMounted(async () => { - treeLoading.value = true; - onSearch(); - - // 归属部门 - const { data } = await getDeptList(); - higherDeptOptions.value = handleTree(data); - treeData.value = handleTree(data); - treeLoading.value = false; - - // 角色列表 - roleOptions.value = (await getAllRoleList()).data; - }); - - return { - form, - loading, - columns, - dataList, - treeData, - treeLoading, - selectedNum, - pagination, - buttonClass, - deviceDetection, - onSearch, - resetForm, - onbatchDel, - openDialog, - onTreeSelect, - handleUpdate, - handleDelete, - handleUpload, - handleReset, - handleRole, - handleSizeChange, - onSelectionCancel, - handleCurrentChange, - handleSelectionChange - }; -} diff --git a/src/views/system/user/utils/reset.css b/src/views/system/user/utils/reset.css deleted file mode 100644 index 97f4e4f..0000000 --- a/src/views/system/user/utils/reset.css +++ /dev/null @@ -1,5 +0,0 @@ -/** 局部重置 ElProgress 的部分样式 */ -.el-progress-bar__outer, -.el-progress-bar__inner { - border-radius: 0; -} diff --git a/src/views/system/user/utils/rule.ts b/src/views/system/user/utils/rule.ts deleted file mode 100644 index f946ee2..0000000 --- a/src/views/system/user/utils/rule.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { reactive } from "vue"; -import type { FormRules } from "element-plus"; -import { isPhone, isEmail } from "@pureadmin/utils"; - -/** 自定义表单规则校验 */ -export const formRules = reactive({ - nickname: [{ required: true, message: "用户昵称为必填项", trigger: "blur" }], - username: [{ required: true, message: "用户名称为必填项", trigger: "blur" }], - password: [{ required: true, message: "用户密码为必填项", trigger: "blur" }], - phone: [ - { - validator: (rule, value, callback) => { - if (value === "") { - callback(); - } else if (!isPhone(value)) { - callback(new Error("请输入正确的手机号码格式")); - } else { - callback(); - } - }, - trigger: "blur" - // trigger: "click" // 如果想在点击确定按钮时触发这个校验,trigger 设置成 click 即可 - } - ], - email: [ - { - validator: (rule, value, callback) => { - if (value === "") { - callback(); - } else if (!isEmail(value)) { - callback(new Error("请输入正确的邮箱格式")); - } else { - callback(); - } - }, - trigger: "blur" - } - ] -}); diff --git a/src/views/system/user/utils/types.ts b/src/views/system/user/utils/types.ts deleted file mode 100644 index c5ab88c..0000000 --- a/src/views/system/user/utils/types.ts +++ /dev/null @@ -1,36 +0,0 @@ -interface FormItemProps { - id?: number; - /** 用于判断是`新增`还是`修改` */ - title: string; - higherDeptOptions: Record[]; - parentId: number; - nickname: string; - username: string; - password: string; - phone: string | number; - email: string; - sex: string | number; - status: number; - dept?: { - id?: number; - name?: string; - }; - remark: string; -} -interface FormProps { - formInline: FormItemProps; -} - -interface RoleFormItemProps { - username: string; - nickname: string; - /** 角色列表 */ - roleOptions: any[]; - /** 选中的角色列表 */ - ids: Record[]; -} -interface RoleFormProps { - formInline: RoleFormItemProps; -} - -export type { FormItemProps, FormProps, RoleFormItemProps, RoleFormProps }; diff --git a/src/views/tabs/index.vue b/src/views/tabs/index.vue deleted file mode 100644 index eccc068..0000000 --- a/src/views/tabs/index.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - diff --git a/src/views/tabs/params-detail.vue b/src/views/tabs/params-detail.vue deleted file mode 100644 index b27c22e..0000000 --- a/src/views/tabs/params-detail.vue +++ /dev/null @@ -1,17 +0,0 @@ - - - diff --git a/src/views/tabs/query-detail.vue b/src/views/tabs/query-detail.vue deleted file mode 100644 index 27e0cc5..0000000 --- a/src/views/tabs/query-detail.vue +++ /dev/null @@ -1,17 +0,0 @@ - - - diff --git a/src/views/welcome/index.vue b/src/views/welcome/index.vue index 5bc2903..0cf02bc 100644 --- a/src/views/welcome/index.vue +++ b/src/views/welcome/index.vue @@ -1,156 +1,138 @@ -- 2.43.0 From 2e89fd20d4577a705044156dbd15ecd37dde90ef Mon Sep 17 00:00:00 2001 From: Bunny <1319900154@qq.com> Date: Mon, 27 May 2024 23:02:39 +0800 Subject: [PATCH 3/3] =?UTF-8?q?style:=20=F0=9F=8E=A8=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F=E5=92=8C=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E4=B8=8D=E7=94=A8=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/optimize.ts | 92 +- build/plugins.ts | 115 +- build/utils.ts | 148 +- lint-staged.config.js | 12 +- mock/login.ts | 70 +- mock/modules/en.ts | 5 - mock/modules/zh.ts | 6 - mock/refreshToken.ts | 46 +- mock/system.ts | 3335 ++++++++--------- package.json | 400 +- pnpm-lock.yaml | 42 +- public/sponsors/aitools.svg | 1 - .../Editor/components/EditorBase.vue | 53 +- .../Editor/components/EditorMulti.vue | 91 +- .../Editor/components/EditorUpload.vue | 83 +- src/components/Empty/index.vue | 54 +- src/components/Error/403.vue | 122 +- src/components/Error/404.vue | 122 +- src/components/Error/500.vue | 122 +- src/components/ReAnimateSelector/index.ts | 4 +- .../ReAnimateSelector/src/animate.ts | 224 +- .../ReAnimateSelector/src/index.vue | 150 +- src/components/ReAuth/index.ts | 2 +- src/components/ReAuth/src/auth.tsx | 30 +- src/components/ReBarcode/index.ts | 4 +- src/components/ReBarcode/src/index.vue | 54 +- src/components/ReCol/index.ts | 50 +- src/components/ReCountTo/index.ts | 6 +- src/components/ReCountTo/src/normal/index.tsx | 280 +- src/components/ReCountTo/src/normal/props.ts | 54 +- .../ReCountTo/src/rebound/index.tsx | 100 +- src/components/ReCountTo/src/rebound/props.ts | 24 +- .../ReCountTo/src/rebound/rebound.css | 104 +- src/components/ReCropper/index.ts | 4 +- src/components/ReCropper/src/circled.css | 1 + src/components/ReCropper/src/index.tsx | 700 ++-- src/components/ReCropperPreview/index.ts | 4 +- src/components/ReCropperPreview/src/index.vue | 56 +- src/components/ReDialog/index.ts | 44 +- src/components/ReDialog/index.vue | 234 +- src/components/ReDialog/type.ts | 352 +- src/components/ReFlicker/index.css | 50 +- src/components/ReFlicker/index.ts | 56 +- src/components/ReFlop/index.ts | 4 +- src/components/ReFlop/src/filpper.css | 164 +- src/components/ReFlop/src/filpper.tsx | 154 +- src/components/ReFlop/src/index.vue | 138 +- src/components/ReFlowChart/index.ts | 8 +- src/components/ReFlowChart/src/Control.vue | 200 +- src/components/ReFlowChart/src/DataDialog.vue | 15 +- src/components/ReFlowChart/src/NodePanel.vue | 162 +- .../ReFlowChart/src/adpterForTurbo.ts | 270 +- .../src/assets/iconfont/iconfont.css | 14 +- src/components/ReFlowChart/src/config.ts | 100 +- src/components/ReIcon/src/hooks.ts | 98 +- src/components/ReIcon/src/iconfont.ts | 63 +- .../ReIcon/src/iconifyIconOffline.ts | 50 +- src/components/ReImageVerify/index.ts | 4 +- src/components/ReImageVerify/src/hooks.ts | 110 +- src/components/ReImageVerify/src/index.vue | 32 +- src/components/ReMap/index.ts | 4 +- src/components/ReMap/src/Amap.vue | 184 +- src/components/ReQrcode/index.ts | 4 +- src/components/ReQrcode/src/index.scss | 1 + src/components/ReQrcode/src/index.tsx | 406 +- src/components/ReSeamlessScroll/index.ts | 4 +- src/components/ReSeamlessScroll/src/index.vue | 613 +-- src/components/ReSegmented/index.ts | 6 +- src/components/ReSegmented/src/index.css | 198 +- src/components/ReSegmented/src/index.tsx | 318 +- src/components/ReSegmented/src/type.ts | 34 +- src/components/ReSelector/index.ts | 4 +- src/components/ReSelector/src/index.css | 2 +- src/components/ReSelector/src/index.tsx | 432 +-- src/components/ReSplitPane/index.css | 58 +- src/components/ReSplitPane/index.tsx | 164 +- src/components/ReSplitPane/resizer.css | 62 +- src/components/ReSplitPane/resizer.tsx | 38 +- src/components/ReText/index.ts | 4 +- src/components/ReText/src/index.vue | 61 +- src/components/ReTreeLine/index.scss | 12 +- src/components/ReTreeLine/index.ts | 278 +- src/components/ReTypeit/src/index.tsx | 76 +- src/components/Result/columns.tsx | 90 +- src/components/Result/fail.vue | 51 +- src/components/Result/success.vue | 147 +- src/plugins/echarts.ts | 50 +- src/plugins/elementPlus.ts | 465 ++- vite.config.ts | 111 +- 89 files changed, 6346 insertions(+), 6623 deletions(-) delete mode 100644 public/sponsors/aitools.svg diff --git a/build/optimize.ts b/build/optimize.ts index 9beb4f0..b142527 100644 --- a/build/optimize.ts +++ b/build/optimize.ts @@ -5,59 +5,55 @@ * 温馨提示:如果您使用的第三方库是全局引入,也就是引入到 src/main.ts 文件里,就不需要再添加到 include 里了,因为 vite 会自动将它们缓存到 node_modules/.vite */ const include = [ - "qs", - "mitt", - "xlsx", - "dayjs", - "axios", - "pinia", - "typeit", - "swiper", - "qrcode", - "intro.js", - "vue-i18n", - "vxe-table", - "vue-types", - "js-cookie", - "vue-tippy", - "cropperjs", - "jsbarcode", - "pinyin-pro", - "sortablejs", - "swiper/vue", - "mint-filter", - "@vueuse/core", - "vue3-danmaku", - "v-contextmenu", - "vue-pdf-embed", - "wavesurfer.js", - "swiper/modules", - "china-area-data", - "vue-json-pretty", - "@logicflow/core", - "@pureadmin/utils", - "@wangeditor/editor", - "responsive-storage", - "plus-pro-components", - "@howdyjs/mouse-menu", - "@logicflow/extension", - "vue-virtual-scroller", - "@amap/amap-jsapi-loader", - "el-table-infinite-scroll", - "vue-waterfall-plugin-next", - "@infectoone/vue-ganttastic", - "@wangeditor/editor-for-vue", - "vuedraggable/src/vuedraggable" + 'qs', + 'mitt', + 'xlsx', + 'dayjs', + 'axios', + 'pinia', + 'typeit', + 'swiper', + 'qrcode', + 'intro.js', + 'vue-i18n', + 'vxe-table', + 'vue-types', + 'js-cookie', + 'vue-tippy', + 'cropperjs', + 'jsbarcode', + 'pinyin-pro', + 'sortablejs', + 'swiper/vue', + 'mint-filter', + '@vueuse/core', + 'vue3-danmaku', + 'v-contextmenu', + 'vue-pdf-embed', + 'wavesurfer.js', + 'swiper/modules', + 'china-area-data', + 'vue-json-pretty', + '@logicflow/core', + '@pureadmin/utils', + '@wangeditor/editor', + 'responsive-storage', + 'plus-pro-components', + '@howdyjs/mouse-menu', + '@logicflow/extension', + 'vue-virtual-scroller', + '@amap/amap-jsapi-loader', + 'el-table-infinite-scroll', + 'vue-waterfall-plugin-next', + '@infectoone/vue-ganttastic', + '@wangeditor/editor-for-vue', + 'vuedraggable/src/vuedraggable', ]; /** * 在预构建中强制排除的依赖项 * 温馨提示:所有以 `@iconify-icons/` 开头引入的的本地图标模块,都应该加入到下面的 `exclude` 里,因为平台推荐的使用方式是哪里需要哪里引入而且都是单个的引入,不需要预构建,直接让浏览器加载就好 */ -const exclude = [ - "@iconify-icons/ep", - "@iconify-icons/ri", - "@pureadmin/theme/dist/browser-utils" -]; +const exclude = ['@iconify-icons/ep', '@iconify-icons/ri', '@pureadmin/theme/dist/browser-utils']; export { include, exclude }; diff --git a/build/plugins.ts b/build/plugins.ts index 04568ac..8f17758 100644 --- a/build/plugins.ts +++ b/build/plugins.ts @@ -1,62 +1,57 @@ -import { cdn } from "./cdn"; -import vue from "@vitejs/plugin-vue"; -import { pathResolve } from "./utils"; -import { viteBuildInfo } from "./info"; -import svgLoader from "vite-svg-loader"; -import type { PluginOption } from "vite"; -import vueJsx from "@vitejs/plugin-vue-jsx"; -import { configCompressPlugin } from "./compress"; -import removeNoMatch from "vite-plugin-router-warn"; -import { visualizer } from "rollup-plugin-visualizer"; -import removeConsole from "vite-plugin-remove-console"; -import { themePreprocessorPlugin } from "@pureadmin/theme"; -import VueI18nPlugin from "@intlify/unplugin-vue-i18n/vite"; -import { genScssMultipleScopeVars } from "../src/layout/theme"; -import { vitePluginFakeServer } from "vite-plugin-fake-server"; +import { cdn } from './cdn'; +import vue from '@vitejs/plugin-vue'; +import { pathResolve } from './utils'; +import { viteBuildInfo } from './info'; +import svgLoader from 'vite-svg-loader'; +import type { PluginOption } from 'vite'; +import vueJsx from '@vitejs/plugin-vue-jsx'; +import { configCompressPlugin } from './compress'; +import removeNoMatch from 'vite-plugin-router-warn'; +import { visualizer } from 'rollup-plugin-visualizer'; +import removeConsole from 'vite-plugin-remove-console'; +import { themePreprocessorPlugin } from '@pureadmin/theme'; +import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'; +import { genScssMultipleScopeVars } from '../src/layout/theme'; +import { vitePluginFakeServer } from 'vite-plugin-fake-server'; -export function getPluginsList( - VITE_CDN: boolean, - VITE_COMPRESSION: ViteCompression -): PluginOption[] { - const lifecycle = process.env.npm_lifecycle_event; - return [ - vue(), - // jsx、tsx语法支持 - vueJsx(), - VueI18nPlugin({ - jitCompilation: false, - include: [pathResolve("../locales/**")] - }), - viteBuildInfo(), - /** - * 开发环境下移除非必要的vue-router动态路由警告No match found for location with path - * 非必要具体看 https://github.com/vuejs/router/issues/521 和 https://github.com/vuejs/router/issues/359 - * vite-plugin-router-warn只在开发环境下启用,只处理vue-router文件并且只在服务启动或重启时运行一次,性能消耗可忽略不计 - */ - removeNoMatch(), - // mock支持 - vitePluginFakeServer({ - logger: false, - include: "mock", - infixName: false, - enableProd: true - }), - // 自定义主题 - themePreprocessorPlugin({ - scss: { - multipleScopeVars: genScssMultipleScopeVars(), - extract: true - } - }), - // svg组件化支持 - svgLoader(), - VITE_CDN ? cdn : null, - configCompressPlugin(VITE_COMPRESSION), - // 线上环境删除console - removeConsole({ external: ["src/assets/iconfont/iconfont.js"] }), - // 打包分析 - lifecycle === "report" - ? visualizer({ open: true, brotliSize: true, filename: "report.html" }) - : (null as any) - ]; +export function getPluginsList(VITE_CDN: boolean, VITE_COMPRESSION: ViteCompression): PluginOption[] { + const lifecycle = process.env.npm_lifecycle_event; + return [ + vue(), + // jsx、tsx语法支持 + vueJsx(), + VueI18nPlugin({ + jitCompilation: false, + include: [pathResolve('../locales/**')], + }), + viteBuildInfo(), + /** + * 开发环境下移除非必要的vue-router动态路由警告No match found for location with path + * 非必要具体看 https://github.com/vuejs/router/issues/521 和 https://github.com/vuejs/router/issues/359 + * vite-plugin-router-warn只在开发环境下启用,只处理vue-router文件并且只在服务启动或重启时运行一次,性能消耗可忽略不计 + */ + removeNoMatch(), + // mock支持 + vitePluginFakeServer({ + logger: false, + include: 'mock', + infixName: false, + enableProd: true, + }), + // 自定义主题 + themePreprocessorPlugin({ + scss: { + multipleScopeVars: genScssMultipleScopeVars(), + extract: true, + }, + }), + // svg组件化支持 + svgLoader(), + VITE_CDN ? cdn : null, + configCompressPlugin(VITE_COMPRESSION), + // 线上环境删除console + removeConsole({ external: ['src/assets/iconfont/iconfont.js'] }), + // 打包分析 + lifecycle === 'report' ? visualizer({ open: true, brotliSize: true, filename: 'report.html' }) : (null as any), + ]; } diff --git a/build/utils.ts b/build/utils.ts index 3d778fe..3adf897 100644 --- a/build/utils.ts +++ b/build/utils.ts @@ -1,15 +1,9 @@ -import dayjs from "dayjs"; -import { readdir, stat } from "node:fs"; -import { fileURLToPath } from "node:url"; -import { dirname, resolve } from "node:path"; -import { sum, formatBytes } from "@pureadmin/utils"; -import { - name, - version, - engines, - dependencies, - devDependencies -} from "../package.json"; +import dayjs from 'dayjs'; +import { readdir, stat } from 'node:fs'; +import { fileURLToPath } from 'node:url'; +import { dirname, resolve } from 'node:path'; +import { formatBytes, sum } from '@pureadmin/utils'; +import { dependencies, devDependencies, engines, name, version } from '../package.json'; /** 启动`node`进程时所在工作目录的绝对路径 */ const root: string = process.cwd(); @@ -19,92 +13,90 @@ const root: string = process.cwd(); * @param dir 路径片段,默认`build` * @param metaUrl 模块的完整`url`,如果在`build`目录外调用必传`import.meta.url` */ -const pathResolve = (dir = ".", metaUrl = import.meta.url) => { - // 当前文件目录的绝对路径 - const currentFileDir = dirname(fileURLToPath(metaUrl)); - // build 目录的绝对路径 - const buildDir = resolve(currentFileDir, "build"); - // 解析的绝对路径 - const resolvedPath = resolve(currentFileDir, dir); - // 检查解析的绝对路径是否在 build 目录内 - if (resolvedPath.startsWith(buildDir)) { - // 在 build 目录内,返回当前文件路径 - return fileURLToPath(metaUrl); - } - // 不在 build 目录内,返回解析后的绝对路径 - return resolvedPath; +const pathResolve = (dir = '.', metaUrl = import.meta.url) => { + // 当前文件目录的绝对路径 + const currentFileDir = dirname(fileURLToPath(metaUrl)); + // build 目录的绝对路径 + const buildDir = resolve(currentFileDir, 'build'); + // 解析的绝对路径 + const resolvedPath = resolve(currentFileDir, dir); + // 检查解析的绝对路径是否在 build 目录内 + if (resolvedPath.startsWith(buildDir)) { + // 在 build 目录内,返回当前文件路径 + return fileURLToPath(metaUrl); + } + // 不在 build 目录内,返回解析后的绝对路径 + return resolvedPath; }; /** 设置别名 */ const alias: Record = { - "@": pathResolve("../src"), - "@build": pathResolve() + '@': pathResolve('../src'), + '@build': pathResolve(), }; /** 平台的名称、版本、运行所需的`node`和`pnpm`版本、依赖、最后构建时间的类型提示 */ const __APP_INFO__ = { - pkg: { name, version, engines, dependencies, devDependencies }, - lastBuildTime: dayjs(new Date()).format("YYYY-MM-DD HH:mm:ss") + pkg: { name, version, engines, dependencies, devDependencies }, + lastBuildTime: dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss'), }; /** 处理环境变量 */ const wrapperEnv = (envConf: Recordable): ViteEnv => { - // 默认值 - const ret: ViteEnv = { - VITE_PORT: 8848, - VITE_PUBLIC_PATH: "", - VITE_ROUTER_HISTORY: "", - VITE_CDN: false, - VITE_HIDE_HOME: "false", - VITE_COMPRESSION: "none" - }; + // 默认值 + const ret: ViteEnv = { + VITE_PORT: 8848, + VITE_PUBLIC_PATH: '', + VITE_ROUTER_HISTORY: '', + VITE_CDN: false, + VITE_HIDE_HOME: 'false', + VITE_COMPRESSION: 'none', + }; - for (const envName of Object.keys(envConf)) { - let realName = envConf[envName].replace(/\\n/g, "\n"); - realName = - realName === "true" ? true : realName === "false" ? false : realName; + for (const envName of Object.keys(envConf)) { + let realName = envConf[envName].replace(/\\n/g, '\n'); + realName = realName === 'true' ? true : realName === 'false' ? false : realName; - if (envName === "VITE_PORT") { - realName = Number(realName); - } - ret[envName] = realName; - if (typeof realName === "string") { - process.env[envName] = realName; - } else if (typeof realName === "object") { - process.env[envName] = JSON.stringify(realName); - } - } - return ret; + if (envName === 'VITE_PORT') { + realName = Number(realName); + } + ret[envName] = realName; + if (typeof realName === 'string') { + process.env[envName] = realName; + } else if (typeof realName === 'object') { + process.env[envName] = JSON.stringify(realName); + } + } + return ret; }; const fileListTotal: number[] = []; /** 获取指定文件夹中所有文件的总大小 */ const getPackageSize = options => { - const { folder = "dist", callback, format = true } = options; - readdir(folder, (err, files: string[]) => { - if (err) throw err; - let count = 0; - const checkEnd = () => { - ++count == files.length && - callback(format ? formatBytes(sum(fileListTotal)) : sum(fileListTotal)); - }; - files.forEach((item: string) => { - stat(`${folder}/${item}`, async (err, stats) => { - if (err) throw err; - if (stats.isFile()) { - fileListTotal.push(stats.size); - checkEnd(); - } else if (stats.isDirectory()) { - getPackageSize({ - folder: `${folder}/${item}/`, - callback: checkEnd - }); - } - }); - }); - files.length === 0 && callback(0); - }); + const { folder = 'dist', callback, format = true } = options; + readdir(folder, (err, files: string[]) => { + if (err) throw err; + let count = 0; + const checkEnd = () => { + ++count == files.length && callback(format ? formatBytes(sum(fileListTotal)) : sum(fileListTotal)); + }; + files.forEach((item: string) => { + stat(`${folder}/${item}`, async (err, stats) => { + if (err) throw err; + if (stats.isFile()) { + fileListTotal.push(stats.size); + checkEnd(); + } else if (stats.isDirectory()) { + getPackageSize({ + folder: `${folder}/${item}/`, + callback: checkEnd, + }); + } + }); + }); + files.length === 0 && callback(0); + }); }; export { root, pathResolve, alias, __APP_INFO__, wrapperEnv, getPackageSize }; diff --git a/lint-staged.config.js b/lint-staged.config.js index c78044f..a751b5d 100644 --- a/lint-staged.config.js +++ b/lint-staged.config.js @@ -1,8 +1,8 @@ export default { - "*.{js,jsx,ts,tsx}": ["eslint --fix", "prettier --write"], - "{!(package)*.json,*.code-snippets,.!(browserslist)*rc}": ["prettier --write--parser json"], - "package.json": ["prettier --write"], - "*.vue": ["eslint --fix", "prettier --write", "stylelint --fix"], - "*.{scss,less,styl,html}": ["stylelint --fix", "prettier --write"], - "*.md": ["prettier --write"] + '*.{js,jsx,ts,tsx}': ['eslint --fix', 'prettier --write'], + '{!(package)*.json,*.code-snippets,.!(browserslist)*rc}': ['prettier --write--parser json'], + 'package.json': ['prettier --write'], + '*.vue': ['eslint --fix', 'prettier --write', 'stylelint --fix'], + '*.{scss,less,styl,html}': ['stylelint --fix', 'prettier --write'], + '*.md': ['prettier --write'], }; diff --git a/mock/login.ts b/mock/login.ts index 686c34c..761b0a5 100644 --- a/mock/login.ts +++ b/mock/login.ts @@ -1,39 +1,39 @@ // 根据角色动态生成路由 -import { defineFakeRoute } from "vite-plugin-fake-server/client"; +import { defineFakeRoute } from 'vite-plugin-fake-server/client'; export default defineFakeRoute([ - { - url: "/login", - method: "post", - response: ({ body }) => { - if (body.username === "admin") { - return { - success: true, - data: { - avatar: "https://pic3.zhimg.com/80/v2-0888fd6c14153bb36fb630230f73a802_720w.webp", - username: "admin", - nickname: "小铭", - // 一个用户可能有多个角色 - roles: ["admin"], - accessToken: "eyJhbGciOiJIUzUxMiJ9.admin", - refreshToken: "eyJhbGciOiJIUzUxMiJ9.adminRefresh", - expires: "2030/10/30 00:00:00" - } - }; - } else { - return { - success: true, - data: { - avatar: "https://pic2.zhimg.com/v2-9ee815c09ec2e1f3a007e8d77ec06375_r.jpg", - username: "common", - nickname: "小林", - roles: ["common"], - accessToken: "eyJhbGciOiJIUzUxMiJ9.common", - refreshToken: "eyJhbGciOiJIUzUxMiJ9.commonRefresh", - expires: "2030/10/30 00:00:00" - } - }; - } - } - } + { + url: '/login', + method: 'post', + response: ({ body }) => { + if (body.username === 'admin') { + return { + success: true, + data: { + avatar: 'https://pic3.zhimg.com/80/v2-0888fd6c14153bb36fb630230f73a802_720w.webp', + username: 'admin', + nickname: '小兔子', + // 一个用户可能有多个角色 + roles: ['admin'], + accessToken: 'eyJhbGciOiJIUzUxMiJ9.admin', + refreshToken: 'eyJhbGciOiJIUzUxMiJ9.adminRefresh', + expires: '2030/10/30 00:00:00', + }, + }; + } else { + return { + success: true, + data: { + avatar: 'https://pic2.zhimg.com/v2-9ee815c09ec2e1f3a007e8d77ec06375_r.jpg', + username: 'common', + nickname: '小林', + roles: ['common'], + accessToken: 'eyJhbGciOiJIUzUxMiJ9.common', + refreshToken: 'eyJhbGciOiJIUzUxMiJ9.commonRefresh', + expires: '2030/10/30 00:00:00', + }, + }; + } + }, + }, ]); diff --git a/mock/modules/en.ts b/mock/modules/en.ts index 58e7b86..20388ae 100644 --- a/mock/modules/en.ts +++ b/mock/modules/en.ts @@ -120,11 +120,6 @@ export default { pureCheckCard: 'CheckCard', pureMenus: 'MultiLevel Menu', pureMenu1: 'Menu1', - 'pureMenu1-1': 'Menu1-1', - 'pureMenu1-2': 'Menu1-2', - 'pureMenu1-2-1': 'Menu1-2-1', - 'pureMenu1-2-2': 'Menu1-2-2', - 'pureMenu1-3': 'Menu1-3', pureMenu2: 'Menu2', purePermission: 'Permission Manage', purePermissionPage: 'Page Permission', diff --git a/mock/modules/zh.ts b/mock/modules/zh.ts index 6e7c4ed..8d74d50 100644 --- a/mock/modules/zh.ts +++ b/mock/modules/zh.ts @@ -9,7 +9,6 @@ export default { pureCloseLeftTabs: '关闭左侧标签页', pureCloseRightTabs: '关闭右侧标签页', pureCloseOtherTabs: '关闭其他标签页', - pureCloseAllTabs: '关闭全部标签页', pureContentFullScreen: '内容区全屏', pureContentExitFullScreen: '内容区退出全屏', @@ -120,11 +119,6 @@ export default { pureCheckCard: '多选卡片', pureMenus: '多级菜单', pureMenu1: '菜单1', - 'pureMenu1-1': '菜单1-1', - 'pureMenu1-2': '菜单1-2', - 'pureMenu1-2-1': '菜单1-2-1', - 'pureMenu1-2-2': '菜单1-2-2', - 'pureMenu1-3': '菜单1-3', pureMenu2: '菜单2', purePermission: '权限管理', purePermissionPage: '页面权限', diff --git a/mock/refreshToken.ts b/mock/refreshToken.ts index 34d0e87..9d94682 100644 --- a/mock/refreshToken.ts +++ b/mock/refreshToken.ts @@ -1,27 +1,27 @@ -import { defineFakeRoute } from "vite-plugin-fake-server/client"; +import { defineFakeRoute } from 'vite-plugin-fake-server/client'; // 模拟刷新token接口 export default defineFakeRoute([ - { - url: "/refresh-token", - method: "post", - response: ({ body }) => { - if (body.refreshToken) { - return { - success: true, - data: { - accessToken: "eyJhbGciOiJIUzUxMiJ9.newAdmin", - refreshToken: "eyJhbGciOiJIUzUxMiJ9.newAdminRefresh", - // `expires`选择这种日期格式是为了方便调试,后端直接设置时间戳或许更方便(每次都应该递增)。如果后端返回的是时间戳格式,前端开发请来到这个目录`src/utils/auth.ts`,把第`38`行的代码换成expires = data.expires即可。 - expires: "2030/10/30 23:59:59" - } - }; - } else { - return { - success: false, - data: {} - }; - } - } - } + { + url: '/refresh-token', + method: 'post', + response: ({ body }) => { + if (body.refreshToken) { + return { + success: true, + data: { + accessToken: 'eyJhbGciOiJIUzUxMiJ9.newAdmin', + refreshToken: 'eyJhbGciOiJIUzUxMiJ9.newAdminRefresh', + // `expires`选择这种日期格式是为了方便调试,后端直接设置时间戳或许更方便(每次都应该递增)。如果后端返回的是时间戳格式,前端开发请来到这个目录`src/utils/auth.ts`,把第`38`行的代码换成expires = data.expires即可。 + expires: '2030/10/30 23:59:59', + }, + }; + } else { + return { + success: false, + data: {}, + }; + } + }, + }, ]); diff --git a/mock/system.ts b/mock/system.ts index a4e33f7..b5ee0d3 100644 --- a/mock/system.ts +++ b/mock/system.ts @@ -1,1679 +1,1662 @@ -import { defineFakeRoute } from "vite-plugin-fake-server/client"; -import { faker } from "@faker-js/faker/locale/zh_CN"; +import { defineFakeRoute } from 'vite-plugin-fake-server/client'; +import { faker } from '@faker-js/faker/locale/zh_CN'; export default defineFakeRoute([ - // 用户管理 - { - url: "/user", - method: "post", - response: ({ body }) => { - let list = [ - { - avatar: "https://avatars.githubusercontent.com/u/44761321", - username: "admin", - nickname: "小铭", - phone: "15888886789", - email: faker.internet.email(), - sex: 0, - id: 1, - status: 1, - dept: { - // 部门id - id: 103, - // 部门名称 - name: "研发部门" - }, - remark: "管理员", - createTime: 1605456000000 - }, - { - avatar: "https://avatars.githubusercontent.com/u/52823142", - username: "common", - nickname: "小林", - phone: "18288882345", - email: faker.internet.email(), - sex: 1, - id: 2, - status: 1, - dept: { - id: 105, - name: "测试部门" - }, - remark: "普通用户", - createTime: 1605456000000 - } - ]; - list = list.filter(item => item.username.includes(body?.username)); - list = list.filter(item => - String(item.status).includes(String(body?.status)) - ); - if (body.phone) list = list.filter(item => item.phone === body.phone); - if (body.deptId) list = list.filter(item => item.dept.id === body.deptId); - return { - success: true, - data: { - list, - total: list.length, // 总条目数 - pageSize: 10, // 每页显示条目个数 - currentPage: 1 // 当前页数 - } - }; - } - }, - // 用户管理-获取所有角色列表 - { - url: "/list-all-role", - method: "get", - response: () => { - return { - success: true, - data: [ - { id: 1, name: "超级管理员" }, - { id: 2, name: "普通角色" } - ] - }; - } - }, - // 用户管理-根据 userId 获取对应角色 id 列表(userId:用户id) - { - url: "/list-role-ids", - method: "post", - response: ({ body }) => { - if (body.userId) { - if (body.userId == 1) { - return { - success: true, - data: [1] - }; - } else if (body.userId == 2) { - return { - success: true, - data: [2] - }; - } - } else { - return { - success: false, - data: [] - }; - } - } - }, - // 角色管理 - { - url: "/role", - method: "post", - response: ({ body }) => { - let list = [ - { - createTime: 1605456000000, // 时间戳(毫秒ms) - updateTime: 1684512000000, - id: 1, - name: "超级管理员", - code: "admin", - status: 1, // 状态 1 启用 0 停用 - remark: "超级管理员拥有最高权限" - }, - { - createTime: 1605456000000, - updateTime: 1684512000000, - id: 2, - name: "普通角色", - code: "common", - status: 1, - remark: "普通角色拥有部分权限" - } - ]; - list = list.filter(item => item.name.includes(body?.name)); - list = list.filter(item => - String(item.status).includes(String(body?.status)) - ); - if (body.code) list = list.filter(item => item.code === body.code); - return { - success: true, - data: { - list, - total: list.length, // 总条目数 - pageSize: 10, // 每页显示条目个数 - currentPage: 1 // 当前页数 - } - }; - } - }, - // 角色管理-权限-菜单权限 - { - url: "/role-menu", - method: "post", - response: () => { - return { - success: true, - data: [ - // 外部页面 - { - parentId: 0, - id: 100, - menuType: 0, // 菜单类型(0代表菜单、1代表iframe、2代表外链、3代表按钮) - title: "menus.pureExternalPage" - }, - { - parentId: 100, - id: 101, - menuType: 0, - title: "menus.pureExternalDoc" - }, - { - parentId: 101, - id: 102, - menuType: 2, - title: "menus.pureExternalLink" - }, - { - parentId: 101, - id: 103, - menuType: 2, - title: "menus.pureUtilsLink" - }, - { - parentId: 100, - id: 104, - menuType: 1, - title: "menus.pureEmbeddedDoc" - }, - { - parentId: 104, - id: 105, - menuType: 1, - title: "menus.pureEpDoc" - }, - { - parentId: 104, - id: 106, - menuType: 1, - title: "menus.pureTailwindcssDoc" - }, - { - parentId: 104, - id: 107, - menuType: 1, - title: "menus.pureVueDoc" - }, - { - parentId: 104, - id: 108, - menuType: 1, - title: "menus.pureViteDoc" - }, - { - parentId: 104, - id: 109, - menuType: 1, - title: "menus.purePiniaDoc" - }, - { - parentId: 104, - id: 110, - menuType: 1, - title: "menus.pureRouterDoc" - }, - // 权限管理 - { - parentId: 0, - id: 200, - menuType: 0, - title: "menus.purePermission" - }, - { - parentId: 200, - id: 201, - menuType: 0, - title: "menus.purePermissionPage" - }, - { - parentId: 200, - id: 202, - menuType: 0, - title: "menus.purePermissionButton" - }, - { - parentId: 202, - id: 203, - menuType: 3, - title: "添加" - }, - { - parentId: 202, - id: 204, - menuType: 3, - title: "修改" - }, - { - parentId: 202, - id: 205, - menuType: 3, - title: "删除" - }, - // 系统管理 - { - parentId: 0, - id: 300, - menuType: 0, - title: "menus.pureSysManagement" - }, - { - parentId: 300, - id: 301, - menuType: 0, - title: "menus.pureUser" - }, - { - parentId: 300, - id: 302, - menuType: 0, - title: "menus.pureRole" - }, - { - parentId: 300, - id: 303, - menuType: 0, - title: "menus.pureSystemMenu" - }, - { - parentId: 300, - id: 304, - menuType: 0, - title: "menus.pureDept" - }, - // 系统监控 - { - parentId: 0, - id: 400, - menuType: 0, - title: "menus.pureSysMonitor" - }, - { - parentId: 400, - id: 401, - menuType: 0, - title: "menus.pureOnlineUser" - }, - { - parentId: 400, - id: 402, - menuType: 0, - title: "menus.pureLoginLog" - }, - { - parentId: 400, - id: 403, - menuType: 0, - title: "menus.pureOperationLog" - }, - { - parentId: 400, - id: 404, - menuType: 0, - title: "menus.pureSystemLog" - }, - // 标签页操作 - { - parentId: 0, - id: 500, - menuType: 0, - title: "menus.pureTabs" - }, - { - parentId: 500, - id: 501, - menuType: 0, - title: "menus.pureTabs" - }, - { - parentId: 500, - id: 502, - menuType: 0, - title: "query传参模式" - }, - { - parentId: 500, - id: 503, - menuType: 0, - title: "params传参模式" - } - ] - }; - } - }, - // 角色管理-权限-菜单权限-根据角色 id 查对应菜单 - { - url: "/role-menu-ids", - method: "post", - response: ({ body }) => { - if (body.id == 1) { - return { - success: true, - data: [ - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 200, 201, - 202, 203, 204, 205, 300, 301, 302, 303, 304, 400, 401, 402, 403, - 404, 500, 501, 502, 503 - ] - }; - } else if (body.id == 2) { - return { - success: true, - data: [ - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 404, 500, - 501, 502, 503 - ] - }; - } - } - }, - // 菜单管理 - { - url: "/menu", - method: "post", - response: () => { - return { - success: true, - data: [ - // 外部页面 - { - parentId: 0, - id: 100, - menuType: 0, // 菜单类型(0代表菜单、1代表iframe、2代表外链、3代表按钮) - title: "menus.pureExternalPage", - name: "PureIframe", - path: "/iframe", - component: "", - rank: 7, - redirect: "", - icon: "ri:links-fill", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 100, - id: 101, - menuType: 0, - title: "menus.pureExternalDoc", - name: "PureIframeExternal", - path: "/iframe/external", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 101, - id: 102, - menuType: 2, - title: "menus.pureExternalLink", - name: "https://pure-admin.github.io/pure-admin-doc", - path: "/external", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 101, - id: 103, - menuType: 2, - title: "menus.pureUtilsLink", - name: "https://pure-admin-utils.netlify.app/", - path: "/pureUtilsLink", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 100, - id: 104, - menuType: 1, - title: "menus.pureEmbeddedDoc", - name: "PureIframeEmbedded", - path: "/iframe/embedded", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 104, - id: 105, - menuType: 1, - title: "menus.pureEpDoc", - name: "FrameEp", - path: "/iframe/ep", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "https://element-plus.org/zh-CN/", - frameLoading: true, - keepAlive: true, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 104, - id: 106, - menuType: 1, - title: "menus.pureTailwindcssDoc", - name: "FrameTailwindcss", - path: "/iframe/tailwindcss", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "https://tailwindcss.com/docs/installation", - frameLoading: true, - keepAlive: true, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 104, - id: 107, - menuType: 1, - title: "menus.pureVueDoc", - name: "FrameVue", - path: "/iframe/vue3", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "https://cn.vuejs.org/", - frameLoading: true, - keepAlive: true, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 104, - id: 108, - menuType: 1, - title: "menus.pureViteDoc", - name: "FrameVite", - path: "/iframe/vite", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "https://cn.vitejs.dev/", - frameLoading: true, - keepAlive: true, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 104, - id: 109, - menuType: 1, - title: "menus.purePiniaDoc", - name: "FramePinia", - path: "/iframe/pinia", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "https://pinia.vuejs.org/zh/index.html", - frameLoading: true, - keepAlive: true, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 104, - id: 110, - menuType: 1, - title: "menus.pureRouterDoc", - name: "FrameRouter", - path: "/iframe/vue-router", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "https://router.vuejs.org/zh/", - frameLoading: true, - keepAlive: true, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - // 权限管理 - { - parentId: 0, - id: 200, - menuType: 0, - title: "menus.purePermission", - name: "PurePermission", - path: "/permission", - component: "", - rank: 9, - redirect: "", - icon: "ep:lollipop", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 200, - id: 201, - menuType: 0, - title: "menus.purePermissionPage", - name: "PermissionPage", - path: "/permission/page/index", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 200, - id: 202, - menuType: 0, - title: "menus.purePermissionButton", - name: "PermissionButton", - path: "/permission/button/index", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 202, - id: 203, - menuType: 3, - title: "添加", - name: "", - path: "", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "permission:btn:add", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 202, - id: 204, - menuType: 3, - title: "修改", - name: "", - path: "", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "permission:btn:edit", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 202, - id: 205, - menuType: 3, - title: "删除", - name: "", - path: "", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "permission:btn:delete", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - // 系统管理 - { - parentId: 0, - id: 300, - menuType: 0, - title: "menus.pureSysManagement", - name: "PureSystem", - path: "/system", - component: "", - rank: 10, - redirect: "", - icon: "ri:settings-3-line", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 300, - id: 301, - menuType: 0, - title: "menus.pureUser", - name: "SystemUser", - path: "/system/user/index", - component: "", - rank: null, - redirect: "", - icon: "ri:admin-line", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 300, - id: 302, - menuType: 0, - title: "menus.pureRole", - name: "SystemRole", - path: "/system/role/index", - component: "", - rank: null, - redirect: "", - icon: "ri:admin-fill", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 300, - id: 303, - menuType: 0, - title: "menus.pureSystemMenu", - name: "SystemMenu", - path: "/system/menu/index", - component: "", - rank: null, - redirect: "", - icon: "ep:menu", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 300, - id: 304, - menuType: 0, - title: "menus.pureDept", - name: "SystemDept", - path: "/system/dept/index", - component: "", - rank: null, - redirect: "", - icon: "ri:git-branch-line", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - // 系统监控 - { - parentId: 0, - id: 400, - menuType: 0, - title: "menus.pureSysMonitor", - name: "PureMonitor", - path: "/monitor", - component: "", - rank: 11, - redirect: "", - icon: "ep:monitor", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 400, - id: 401, - menuType: 0, - title: "menus.pureOnlineUser", - name: "OnlineUser", - path: "/monitor/online-user", - component: "monitor/online/index", - rank: null, - redirect: "", - icon: "ri:user-voice-line", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 400, - id: 402, - menuType: 0, - title: "menus.pureLoginLog", - name: "LoginLog", - path: "/monitor/login-logs", - component: "monitor/logs/login/index", - rank: null, - redirect: "", - icon: "ri:window-line", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 400, - id: 403, - menuType: 0, - title: "menus.pureOperationLog", - name: "OperationLog", - path: "/monitor/operation-logs", - component: "monitor/logs/operation/index", - rank: null, - redirect: "", - icon: "ri:history-fill", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 400, - id: 404, - menuType: 0, - title: "menus.pureSystemLog", - name: "SystemLog", - path: "/monitor/system-logs", - component: "monitor/logs/system/index", - rank: null, - redirect: "", - icon: "ri:file-search-line", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - // 标签页操作 - { - parentId: 0, - id: 500, - menuType: 0, - title: "menus.pureTabs", - name: "PureTabs", - path: "/tabs", - component: "", - rank: 12, - redirect: "", - icon: "ri:bookmark-2-line", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 500, - id: 501, - menuType: 0, - title: "menus.pureTabs", - name: "Tabs", - path: "/tabs/index", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 500, - id: 502, - menuType: 0, - title: "query传参模式", - name: "TabQueryDetail", - path: "/tabs/query-detail", - component: "", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "/tabs/index", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: false, - showParent: false - }, - { - parentId: 500, - id: 503, - menuType: 0, - title: "params传参模式", - name: "TabParamsDetail", - path: "/tabs/params-detail/:id", - component: "params-detail", - rank: null, - redirect: "", - icon: "", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "/tabs/index", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: false, - showParent: false - } - ] - }; - } - }, - // 部门管理 - { - url: "/dept", - method: "post", - response: () => { - return { - success: true, - data: [ - { - name: "杭州总公司", - parentId: 0, - id: 100, - sort: 0, - phone: "15888888888", - principal: faker.person.firstName(), - email: faker.internet.email(), - status: 1, // 状态 1 启用 0 停用 - type: 1, // 1 公司 2 分公司 3 部门 - createTime: 1605456000000, - remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息" - }, - { - name: "郑州分公司", - parentId: 100, - id: 101, - sort: 1, - phone: "15888888888", - principal: faker.person.firstName(), - email: faker.internet.email(), - status: 1, - type: 2, - createTime: 1605456000000, - remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息" - }, - { - name: "研发部门", - parentId: 101, - id: 103, - sort: 1, - phone: "15888888888", - principal: faker.person.firstName(), - email: faker.internet.email(), - status: 1, - type: 3, - createTime: 1605456000000, - remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息" - }, - { - name: "市场部门", - parentId: 102, - id: 108, - sort: 1, - phone: "15888888888", - principal: faker.person.firstName(), - email: faker.internet.email(), - status: 1, - type: 3, - createTime: 1605456000000, - remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息" - }, - { - name: "深圳分公司", - parentId: 100, - id: 102, - sort: 2, - phone: "15888888888", - principal: faker.person.firstName(), - email: faker.internet.email(), - status: 1, - type: 2, - createTime: 1605456000000, - remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息" - }, - { - name: "市场部门", - parentId: 101, - id: 104, - sort: 2, - phone: "15888888888", - principal: faker.person.firstName(), - email: faker.internet.email(), - status: 1, - type: 3, - createTime: 1605456000000, - remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息" - }, - { - name: "财务部门", - parentId: 102, - id: 109, - sort: 2, - phone: "15888888888", - principal: faker.person.firstName(), - email: faker.internet.email(), - status: 1, - type: 3, - createTime: 1605456000000, - remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息" - }, - { - name: "测试部门", - parentId: 101, - id: 105, - sort: 3, - phone: "15888888888", - principal: faker.person.firstName(), - email: faker.internet.email(), - status: 0, - type: 3, - createTime: 1605456000000, - remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息" - }, - { - name: "财务部门", - parentId: 101, - id: 106, - sort: 4, - phone: "15888888888", - principal: faker.person.firstName(), - email: faker.internet.email(), - status: 1, - type: 3, - createTime: 1605456000000, - remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息" - }, - { - name: "运维部门", - parentId: 101, - id: 107, - sort: 5, - phone: "15888888888", - principal: faker.person.firstName(), - email: faker.internet.email(), - status: 0, - type: 3, - createTime: 1605456000000, - remark: "这里是备注信息这里是备注信息这里是备注信息这里是备注信息" - } - ] - }; - } - }, - // 在线用户 - { - url: "/online-logs", - method: "post", - response: ({ body }) => { - let list = [ - { - id: 1, - username: "admin", - ip: faker.internet.ipv4(), - address: "中国河南省信阳市", - system: "macOS", - browser: "Chrome", - loginTime: new Date() - }, - { - id: 2, - username: "common", - ip: faker.internet.ipv4(), - address: "中国广东省深圳市", - system: "Windows", - browser: "Firefox", - loginTime: new Date() - } - ]; - list = list.filter(item => item.username.includes(body?.username)); - return { - success: true, - data: { - list, - total: list.length, // 总条目数 - pageSize: 10, // 每页显示条目个数 - currentPage: 1 // 当前页数 - } - }; - } - }, - // 登录日志 - { - url: "/login-logs", - method: "post", - response: ({ body }) => { - let list = [ - { - id: 1, - username: "admin", - ip: faker.internet.ipv4(), - address: "中国河南省信阳市", - system: "macOS", - browser: "Chrome", - status: 1, // 登录状态 1 成功 0 失败 - behavior: "账号登录", - loginTime: new Date() - }, - { - id: 2, - username: "common", - ip: faker.internet.ipv4(), - address: "中国广东省深圳市", - system: "Windows", - browser: "Firefox", - status: 0, - behavior: "第三方登录", - loginTime: new Date() - } - ]; - list = list.filter(item => item.username.includes(body?.username)); - list = list.filter(item => - String(item.status).includes(String(body?.status)) - ); - return { - success: true, - data: { - list, - total: list.length, // 总条目数 - pageSize: 10, // 每页显示条目个数 - currentPage: 1 // 当前页数 - } - }; - } - }, - // 操作日志 - { - url: "/operation-logs", - method: "post", - response: ({ body }) => { - let list = [ - { - id: 1, - username: "admin", - ip: faker.internet.ipv4(), - address: "中国河南省信阳市", - system: "macOS", - browser: "Chrome", - status: 1, // 操作状态 1 成功 0 失败 - summary: "菜单管理-添加菜单", // 操作概要 - module: "系统管理", // 所属模块 - operatingTime: new Date() // 操作时间 - }, - { - id: 2, - username: "common", - ip: faker.internet.ipv4(), - address: "中国广东省深圳市", - system: "Windows", - browser: "Firefox", - status: 0, - summary: "列表分页查询", - module: "在线用户", - operatingTime: new Date() - } - ]; - list = list.filter(item => item.module.includes(body?.module)); - list = list.filter(item => - String(item.status).includes(String(body?.status)) - ); - return { - success: true, - data: { - list, - total: list.length, // 总条目数 - pageSize: 10, // 每页显示条目个数 - currentPage: 1 // 当前页数 - } - }; - } - }, - // 系统日志 - { - url: "/system-logs", - method: "post", - response: ({ body }) => { - let list = [ - { - id: 1, // 日志ID - /** - * 日志级别 - * 0 debug调试(最低级别的日志,用于调试和开发阶段) - * 1 info信息(默认级别,用于记录一般的信息) - * 2 warn警告(表示可能出现的问题或潜在的错误,但不会影响系统的正常运行) - * 3 error错误(表示发生了错误,但不会导致系统崩溃) - * 4 fatal致命(最高级别的日志,表示发生了严重错误,导致系统无法继续运行) - */ - level: 1, - module: "菜单管理", // 所属模块 - url: "/menu", // 请求接口 - method: "post", // 请求方法 - ip: faker.internet.ipv4(), - address: "中国河南省信阳市", - system: "macOS", - browser: "Chrome", - /** - * 请求耗时(单位:ms 毫秒) - * 正常耗时:一般认为在几百毫秒(0.1-0.5秒)范围内的请求耗时较为正常 - * 较慢耗时:在1秒以上的耗时可以被认为是较慢的请求,但具体是否较慢还需要根据具体业务场景和性能要求来判断 - */ - takesTime: 10, - requestTime: new Date() // 请求时间 - }, - { - id: 2, - level: 0, - module: "地图", - url: "/get-map-info", - method: "get", - ip: faker.internet.ipv4(), - address: "中国广东省深圳市", - system: "Windows", - browser: "Firefox", - takesTime: 1200, - requestTime: new Date() - } - ]; - list = list.filter(item => item.module.includes(body?.module)); - return { - success: true, - data: { - list, - total: list.length, // 总条目数 - pageSize: 10, // 每页显示条目个数 - currentPage: 1 // 当前页数 - } - }; - } - }, - // 系统日志-根据 id 查日志详情 - { - url: "/system-logs-detail", - method: "post", - response: ({ body }) => { - if (body.id == 1) { - return { - id: 1, - level: 1, - module: "菜单管理", - url: "/menu", - method: "post", - ip: faker.internet.ipv4(), - address: "中国河南省信阳市", - system: "macOS", - browser: "Chrome", - takesTime: 10, - responseHeaders: { - traceId: "1495502411171032", - "Content-Type": "application/json", - Connection: "keep-alive", - "Keep-Alive": "timeout=5", - "Content-Length": 17019 - }, - responseBody: { - success: true, - data: [ - { - parentId: 0, - id: 400, - menuType: 0, - title: "menus.pureSysMonitor", - name: "PureMonitor", - path: "/monitor", - component: "", - rank: 11, - redirect: "", - icon: "ep:monitor", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 400, - id: 401, - menuType: 0, - title: "menus.pureOnlineUser", - name: "OnlineUser", - path: "/monitor/online-user", - component: "monitor/online/index", - rank: null, - redirect: "", - icon: "ri:user-voice-line", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 400, - id: 402, - menuType: 0, - title: "menus.pureLoginLog", - name: "LoginLog", - path: "/monitor/login-logs", - component: "monitor/logs/login/index", - rank: null, - redirect: "", - icon: "ri:window-line", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 400, - id: 403, - menuType: 0, - title: "menus.pureOperationLog", - name: "OperationLog", - path: "/monitor/operation-logs", - component: "monitor/logs/operation/index", - rank: null, - redirect: "", - icon: "ri:history-fill", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - }, - { - parentId: 400, - id: 404, - menuType: 0, - title: "menus.pureSystemLog", - name: "SystemLog", - path: "/monitor/system-logs", - component: "monitor/logs/system/index", - rank: null, - redirect: "", - icon: "ri:file-search-line", - extraIcon: "", - enterTransition: "", - leaveTransition: "", - activePath: "", - auths: "", - frameSrc: "", - frameLoading: true, - keepAlive: false, - hiddenTag: false, - fixedTag: false, - showLink: true, - showParent: false - } - ] - }, - requestHeaders: { - Accept: "application/json, text/plain, */*", - "Accept-Encoding": "gzip, deflate", - "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,eo;q=0.7", - Authorization: "Bearer eyJhbGciOiJIUzUxMiJ9.admin", - Connection: "keep-alive", - "Content-Length": 0, - Cookie: - "_ga=GA1.1.231800979.1704562367; _ga_M74ZHEQ1M1=GS1.1.1709299375.7.1.1709299476.0.0.0; Hm_lvt_6a7dac00248d3b6ad8479d7249bb29c5=1709032753,1709359575; Hm_lvt_23a157b7d0d9867f7a51e42628f052f5=1708960489,1709485849,1709879672; authorized-token={%22accessToken%22:%22eyJhbGciOiJIUzUxMiJ9.admin%22%2C%22expires%22:1919520000000}; multiple-tabs=true", - Host: "192.168.2.121:8848", - Origin: "http://192.168.2.121:8848", - Referer: "http://192.168.2.121:8848/", - "User-Agent": - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36", - "X-Requested-With": "XMLHttpRequest" - }, - requestBody: { - title: "系统监控" - }, - traceId: "1495502411171032", - requestTime: new Date() - }; - } else if (body.id == 2) { - return { - id: 2, - level: 0, - module: "地图", - url: "/get-map-info?plateNumber=豫A59778U", - method: "get", - ip: faker.internet.ipv4(), - address: "中国广东省深圳市", - system: "Windows", - browser: "Firefox", - takesTime: 1200, - responseHeaders: { - traceId: "2280443117103208", - "Content-Type": "application/json", - Connection: "keep-alive", - "Keep-Alive": "timeout=5", - "Content-Length": 28693 - }, - responseBody: { - plateNumber: "豫A59778U", - driver: "子骞", - orientation: 289, - lng: 113.8564, - lat: 34.373 - }, - requestHeaders: { - Accept: "application/json, text/plain, */*", - "Accept-Encoding": "gzip, deflate", - "Accept-Language": "zh-CN,zh;q=0.9,en;q=0.8,eo;q=0.7", - Authorization: "Bearer eyJhbGciOiJIUzUxMiJ9.admin", - Connection: "keep-alive", - "Content-Length": 0, - Cookie: - "_ga=GA1.1.231800979.1704562367; _ga_M74ZHEQ1M1=GS1.1.1709299375.7.1.1709299476.0.0.0; Hm_lvt_6a7dac00248d3b6ad8479d7249bb29c5=1709032753,1709359575; Hm_lvt_23a157b7d0d9867f7a51e42628f052f5=1708960489,1709485849,1709879672; authorized-token={%22accessToken%22:%22eyJhbGciOiJIUzUxMiJ9.admin%22%2C%22expires%22:1919520000000}; multiple-tabs=true", - Host: "192.168.2.121:8848", - Origin: "http://192.168.2.121:8848", - Referer: "http://192.168.2.121:8848/", - "User-Agent": - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36", - "X-Requested-With": "XMLHttpRequest" - }, - requestBody: null, - traceId: "2280443117103208", - requestTime: new Date() - }; - } - } - } + // 用户管理 + { + url: '/user', + method: 'post', + response: ({ body }) => { + let list = [ + { + avatar: 'https://pic3.zhimg.com/80/v2-0888fd6c14153bb36fb630230f73a802_720w.webp', + username: 'admin', + nickname: '小兔子', + phone: '15888886789', + email: faker.internet.email(), + sex: 0, + id: 1, + status: 1, + dept: { + // 部门id + id: 103, + // 部门名称 + name: '研发部门', + }, + remark: '管理员', + createTime: 1605456000000, + }, + { + avatar: 'https://pic2.zhimg.com/v2-9ee815c09ec2e1f3a007e8d77ec06375_r.jpg', + username: 'common', + nickname: '小林', + phone: '18288882345', + email: faker.internet.email(), + sex: 1, + id: 2, + status: 1, + dept: { + id: 105, + name: '测试部门', + }, + remark: '普通用户', + createTime: 1605456000000, + }, + ]; + list = list.filter(item => item.username.includes(body?.username)); + list = list.filter(item => String(item.status).includes(String(body?.status))); + if (body.phone) list = list.filter(item => item.phone === body.phone); + if (body.deptId) list = list.filter(item => item.dept.id === body.deptId); + return { + success: true, + data: { + list, + total: list.length, // 总条目数 + pageSize: 10, // 每页显示条目个数 + currentPage: 1, // 当前页数 + }, + }; + }, + }, + // 用户管理-获取所有角色列表 + { + url: '/list-all-role', + method: 'get', + response: () => { + return { + success: true, + data: [ + { id: 1, name: '超级管理员' }, + { id: 2, name: '普通角色' }, + ], + }; + }, + }, + // 用户管理-根据 userId 获取对应角色 id 列表(userId:用户id) + { + url: '/list-role-ids', + method: 'post', + response: ({ body }) => { + if (body.userId) { + if (body.userId == 1) { + return { + success: true, + data: [1], + }; + } else if (body.userId == 2) { + return { + success: true, + data: [2], + }; + } + } else { + return { + success: false, + data: [], + }; + } + }, + }, + // 角色管理 + { + url: '/role', + method: 'post', + response: ({ body }) => { + let list = [ + { + createTime: 1605456000000, // 时间戳(毫秒ms) + updateTime: 1684512000000, + id: 1, + name: '超级管理员', + code: 'admin', + status: 1, // 状态 1 启用 0 停用 + remark: '超级管理员拥有最高权限', + }, + { + createTime: 1605456000000, + updateTime: 1684512000000, + id: 2, + name: '普通角色', + code: 'common', + status: 1, + remark: '普通角色拥有部分权限', + }, + ]; + list = list.filter(item => item.name.includes(body?.name)); + list = list.filter(item => String(item.status).includes(String(body?.status))); + if (body.code) list = list.filter(item => item.code === body.code); + return { + success: true, + data: { + list, + total: list.length, // 总条目数 + pageSize: 10, // 每页显示条目个数 + currentPage: 1, // 当前页数 + }, + }; + }, + }, + // 角色管理-权限-菜单权限 + { + url: '/role-menu', + method: 'post', + response: () => { + return { + success: true, + data: [ + // 外部页面 + { + parentId: 0, + id: 100, + menuType: 0, // 菜单类型(0代表菜单、1代表iframe、2代表外链、3代表按钮) + title: 'menus.pureExternalPage', + }, + { + parentId: 100, + id: 101, + menuType: 0, + title: 'menus.pureExternalDoc', + }, + { + parentId: 101, + id: 102, + menuType: 2, + title: 'menus.pureExternalLink', + }, + { + parentId: 101, + id: 103, + menuType: 2, + title: 'menus.pureUtilsLink', + }, + { + parentId: 100, + id: 104, + menuType: 1, + title: 'menus.pureEmbeddedDoc', + }, + { + parentId: 104, + id: 105, + menuType: 1, + title: 'menus.pureEpDoc', + }, + { + parentId: 104, + id: 106, + menuType: 1, + title: 'menus.pureTailwindcssDoc', + }, + { + parentId: 104, + id: 107, + menuType: 1, + title: 'menus.pureVueDoc', + }, + { + parentId: 104, + id: 108, + menuType: 1, + title: 'menus.pureViteDoc', + }, + { + parentId: 104, + id: 109, + menuType: 1, + title: 'menus.purePiniaDoc', + }, + { + parentId: 104, + id: 110, + menuType: 1, + title: 'menus.pureRouterDoc', + }, + // 权限管理 + { + parentId: 0, + id: 200, + menuType: 0, + title: 'menus.purePermission', + }, + { + parentId: 200, + id: 201, + menuType: 0, + title: 'menus.purePermissionPage', + }, + { + parentId: 200, + id: 202, + menuType: 0, + title: 'menus.purePermissionButton', + }, + { + parentId: 202, + id: 203, + menuType: 3, + title: '添加', + }, + { + parentId: 202, + id: 204, + menuType: 3, + title: '修改', + }, + { + parentId: 202, + id: 205, + menuType: 3, + title: '删除', + }, + // 系统管理 + { + parentId: 0, + id: 300, + menuType: 0, + title: 'menus.pureSysManagement', + }, + { + parentId: 300, + id: 301, + menuType: 0, + title: 'menus.pureUser', + }, + { + parentId: 300, + id: 302, + menuType: 0, + title: 'menus.pureRole', + }, + { + parentId: 300, + id: 303, + menuType: 0, + title: 'menus.pureSystemMenu', + }, + { + parentId: 300, + id: 304, + menuType: 0, + title: 'menus.pureDept', + }, + // 系统监控 + { + parentId: 0, + id: 400, + menuType: 0, + title: 'menus.pureSysMonitor', + }, + { + parentId: 400, + id: 401, + menuType: 0, + title: 'menus.pureOnlineUser', + }, + { + parentId: 400, + id: 402, + menuType: 0, + title: 'menus.pureLoginLog', + }, + { + parentId: 400, + id: 403, + menuType: 0, + title: 'menus.pureOperationLog', + }, + { + parentId: 400, + id: 404, + menuType: 0, + title: 'menus.pureSystemLog', + }, + // 标签页操作 + { + parentId: 0, + id: 500, + menuType: 0, + title: 'menus.pureTabs', + }, + { + parentId: 500, + id: 501, + menuType: 0, + title: 'menus.pureTabs', + }, + { + parentId: 500, + id: 502, + menuType: 0, + title: 'query传参模式', + }, + { + parentId: 500, + id: 503, + menuType: 0, + title: 'params传参模式', + }, + ], + }; + }, + }, + // 角色管理-权限-菜单权限-根据角色 id 查对应菜单 + { + url: '/role-menu-ids', + method: 'post', + response: ({ body }) => { + if (body.id == 1) { + return { + success: true, + data: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 200, 201, 202, 203, 204, 205, 300, 301, 302, 303, 304, 400, 401, 402, 403, 404, 500, 501, 502, 503], + }; + } else if (body.id == 2) { + return { + success: true, + data: [100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 404, 500, 501, 502, 503], + }; + } + }, + }, + // 菜单管理 + { + url: '/menu', + method: 'post', + response: () => { + return { + success: true, + data: [ + // 外部页面 + { + parentId: 0, + id: 100, + menuType: 0, // 菜单类型(0代表菜单、1代表iframe、2代表外链、3代表按钮) + title: 'menus.pureExternalPage', + name: 'PureIframe', + path: '/iframe', + component: '', + rank: 7, + redirect: '', + icon: 'ri:links-fill', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 100, + id: 101, + menuType: 0, + title: 'menus.pureExternalDoc', + name: 'PureIframeExternal', + path: '/iframe/external', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 101, + id: 102, + menuType: 2, + title: 'menus.pureExternalLink', + name: 'https://pure-admin.github.io/pure-admin-doc', + path: '/external', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 101, + id: 103, + menuType: 2, + title: 'menus.pureUtilsLink', + name: 'https://pure-admin-utils.netlify.app/', + path: '/pureUtilsLink', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 100, + id: 104, + menuType: 1, + title: 'menus.pureEmbeddedDoc', + name: 'PureIframeEmbedded', + path: '/iframe/embedded', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 104, + id: 105, + menuType: 1, + title: 'menus.pureEpDoc', + name: 'FrameEp', + path: '/iframe/ep', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: 'https://element-plus.org/zh-CN/', + frameLoading: true, + keepAlive: true, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 104, + id: 106, + menuType: 1, + title: 'menus.pureTailwindcssDoc', + name: 'FrameTailwindcss', + path: '/iframe/tailwindcss', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: 'https://tailwindcss.com/docs/installation', + frameLoading: true, + keepAlive: true, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 104, + id: 107, + menuType: 1, + title: 'menus.pureVueDoc', + name: 'FrameVue', + path: '/iframe/vue3', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: 'https://cn.vuejs.org/', + frameLoading: true, + keepAlive: true, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 104, + id: 108, + menuType: 1, + title: 'menus.pureViteDoc', + name: 'FrameVite', + path: '/iframe/vite', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: 'https://cn.vitejs.dev/', + frameLoading: true, + keepAlive: true, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 104, + id: 109, + menuType: 1, + title: 'menus.purePiniaDoc', + name: 'FramePinia', + path: '/iframe/pinia', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: 'https://pinia.vuejs.org/zh/index.html', + frameLoading: true, + keepAlive: true, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 104, + id: 110, + menuType: 1, + title: 'menus.pureRouterDoc', + name: 'FrameRouter', + path: '/iframe/vue-router', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: 'https://router.vuejs.org/zh/', + frameLoading: true, + keepAlive: true, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + // 权限管理 + { + parentId: 0, + id: 200, + menuType: 0, + title: 'menus.purePermission', + name: 'PurePermission', + path: '/permission', + component: '', + rank: 9, + redirect: '', + icon: 'ep:lollipop', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 200, + id: 201, + menuType: 0, + title: 'menus.purePermissionPage', + name: 'PermissionPage', + path: '/permission/page/index', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 200, + id: 202, + menuType: 0, + title: 'menus.purePermissionButton', + name: 'PermissionButton', + path: '/permission/button/index', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 202, + id: 203, + menuType: 3, + title: '添加', + name: '', + path: '', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: 'permission:btn:add', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 202, + id: 204, + menuType: 3, + title: '修改', + name: '', + path: '', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: 'permission:btn:edit', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 202, + id: 205, + menuType: 3, + title: '删除', + name: '', + path: '', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: 'permission:btn:delete', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + // 系统管理 + { + parentId: 0, + id: 300, + menuType: 0, + title: 'menus.pureSysManagement', + name: 'PureSystem', + path: '/system', + component: '', + rank: 10, + redirect: '', + icon: 'ri:settings-3-line', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 300, + id: 301, + menuType: 0, + title: 'menus.pureUser', + name: 'SystemUser', + path: '/system/user/index', + component: '', + rank: null, + redirect: '', + icon: 'ri:admin-line', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 300, + id: 302, + menuType: 0, + title: 'menus.pureRole', + name: 'SystemRole', + path: '/system/role/index', + component: '', + rank: null, + redirect: '', + icon: 'ri:admin-fill', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 300, + id: 303, + menuType: 0, + title: 'menus.pureSystemMenu', + name: 'SystemMenu', + path: '/system/menu/index', + component: '', + rank: null, + redirect: '', + icon: 'ep:menu', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 300, + id: 304, + menuType: 0, + title: 'menus.pureDept', + name: 'SystemDept', + path: '/system/dept/index', + component: '', + rank: null, + redirect: '', + icon: 'ri:git-branch-line', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + // 系统监控 + { + parentId: 0, + id: 400, + menuType: 0, + title: 'menus.pureSysMonitor', + name: 'PureMonitor', + path: '/monitor', + component: '', + rank: 11, + redirect: '', + icon: 'ep:monitor', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 400, + id: 401, + menuType: 0, + title: 'menus.pureOnlineUser', + name: 'OnlineUser', + path: '/monitor/online-user', + component: 'monitor/online/index', + rank: null, + redirect: '', + icon: 'ri:user-voice-line', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 400, + id: 402, + menuType: 0, + title: 'menus.pureLoginLog', + name: 'LoginLog', + path: '/monitor/login-logs', + component: 'monitor/logs/login/index', + rank: null, + redirect: '', + icon: 'ri:window-line', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 400, + id: 403, + menuType: 0, + title: 'menus.pureOperationLog', + name: 'OperationLog', + path: '/monitor/operation-logs', + component: 'monitor/logs/operation/index', + rank: null, + redirect: '', + icon: 'ri:history-fill', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 400, + id: 404, + menuType: 0, + title: 'menus.pureSystemLog', + name: 'SystemLog', + path: '/monitor/system-logs', + component: 'monitor/logs/system/index', + rank: null, + redirect: '', + icon: 'ri:file-search-line', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + // 标签页操作 + { + parentId: 0, + id: 500, + menuType: 0, + title: 'menus.pureTabs', + name: 'PureTabs', + path: '/tabs', + component: '', + rank: 12, + redirect: '', + icon: 'ri:bookmark-2-line', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 500, + id: 501, + menuType: 0, + title: 'menus.pureTabs', + name: 'Tabs', + path: '/tabs/index', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 500, + id: 502, + menuType: 0, + title: 'query传参模式', + name: 'TabQueryDetail', + path: '/tabs/query-detail', + component: '', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '/tabs/index', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: false, + showParent: false, + }, + { + parentId: 500, + id: 503, + menuType: 0, + title: 'params传参模式', + name: 'TabParamsDetail', + path: '/tabs/params-detail/:id', + component: 'params-detail', + rank: null, + redirect: '', + icon: '', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '/tabs/index', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: false, + showParent: false, + }, + ], + }; + }, + }, + // 部门管理 + { + url: '/dept', + method: 'post', + response: () => { + return { + success: true, + data: [ + { + name: '杭州总公司', + parentId: 0, + id: 100, + sort: 0, + phone: '15888888888', + principal: faker.person.firstName(), + email: faker.internet.email(), + status: 1, // 状态 1 启用 0 停用 + type: 1, // 1 公司 2 分公司 3 部门 + createTime: 1605456000000, + remark: '这里是备注信息这里是备注信息这里是备注信息这里是备注信息', + }, + { + name: '郑州分公司', + parentId: 100, + id: 101, + sort: 1, + phone: '15888888888', + principal: faker.person.firstName(), + email: faker.internet.email(), + status: 1, + type: 2, + createTime: 1605456000000, + remark: '这里是备注信息这里是备注信息这里是备注信息这里是备注信息', + }, + { + name: '研发部门', + parentId: 101, + id: 103, + sort: 1, + phone: '15888888888', + principal: faker.person.firstName(), + email: faker.internet.email(), + status: 1, + type: 3, + createTime: 1605456000000, + remark: '这里是备注信息这里是备注信息这里是备注信息这里是备注信息', + }, + { + name: '市场部门', + parentId: 102, + id: 108, + sort: 1, + phone: '15888888888', + principal: faker.person.firstName(), + email: faker.internet.email(), + status: 1, + type: 3, + createTime: 1605456000000, + remark: '这里是备注信息这里是备注信息这里是备注信息这里是备注信息', + }, + { + name: '深圳分公司', + parentId: 100, + id: 102, + sort: 2, + phone: '15888888888', + principal: faker.person.firstName(), + email: faker.internet.email(), + status: 1, + type: 2, + createTime: 1605456000000, + remark: '这里是备注信息这里是备注信息这里是备注信息这里是备注信息', + }, + { + name: '市场部门', + parentId: 101, + id: 104, + sort: 2, + phone: '15888888888', + principal: faker.person.firstName(), + email: faker.internet.email(), + status: 1, + type: 3, + createTime: 1605456000000, + remark: '这里是备注信息这里是备注信息这里是备注信息这里是备注信息', + }, + { + name: '财务部门', + parentId: 102, + id: 109, + sort: 2, + phone: '15888888888', + principal: faker.person.firstName(), + email: faker.internet.email(), + status: 1, + type: 3, + createTime: 1605456000000, + remark: '这里是备注信息这里是备注信息这里是备注信息这里是备注信息', + }, + { + name: '测试部门', + parentId: 101, + id: 105, + sort: 3, + phone: '15888888888', + principal: faker.person.firstName(), + email: faker.internet.email(), + status: 0, + type: 3, + createTime: 1605456000000, + remark: '这里是备注信息这里是备注信息这里是备注信息这里是备注信息', + }, + { + name: '财务部门', + parentId: 101, + id: 106, + sort: 4, + phone: '15888888888', + principal: faker.person.firstName(), + email: faker.internet.email(), + status: 1, + type: 3, + createTime: 1605456000000, + remark: '这里是备注信息这里是备注信息这里是备注信息这里是备注信息', + }, + { + name: '运维部门', + parentId: 101, + id: 107, + sort: 5, + phone: '15888888888', + principal: faker.person.firstName(), + email: faker.internet.email(), + status: 0, + type: 3, + createTime: 1605456000000, + remark: '这里是备注信息这里是备注信息这里是备注信息这里是备注信息', + }, + ], + }; + }, + }, + // 在线用户 + { + url: '/online-logs', + method: 'post', + response: ({ body }) => { + let list = [ + { + id: 1, + username: 'admin', + ip: faker.internet.ipv4(), + address: '中国河南省信阳市', + system: 'macOS', + browser: 'Chrome', + loginTime: new Date(), + }, + { + id: 2, + username: 'common', + ip: faker.internet.ipv4(), + address: '中国广东省深圳市', + system: 'Windows', + browser: 'Firefox', + loginTime: new Date(), + }, + ]; + list = list.filter(item => item.username.includes(body?.username)); + return { + success: true, + data: { + list, + total: list.length, // 总条目数 + pageSize: 10, // 每页显示条目个数 + currentPage: 1, // 当前页数 + }, + }; + }, + }, + // 登录日志 + { + url: '/login-logs', + method: 'post', + response: ({ body }) => { + let list = [ + { + id: 1, + username: 'admin', + ip: faker.internet.ipv4(), + address: '中国河南省信阳市', + system: 'macOS', + browser: 'Chrome', + status: 1, // 登录状态 1 成功 0 失败 + behavior: '账号登录', + loginTime: new Date(), + }, + { + id: 2, + username: 'common', + ip: faker.internet.ipv4(), + address: '中国广东省深圳市', + system: 'Windows', + browser: 'Firefox', + status: 0, + behavior: '第三方登录', + loginTime: new Date(), + }, + ]; + list = list.filter(item => item.username.includes(body?.username)); + list = list.filter(item => String(item.status).includes(String(body?.status))); + return { + success: true, + data: { + list, + total: list.length, // 总条目数 + pageSize: 10, // 每页显示条目个数 + currentPage: 1, // 当前页数 + }, + }; + }, + }, + // 操作日志 + { + url: '/operation-logs', + method: 'post', + response: ({ body }) => { + let list = [ + { + id: 1, + username: 'admin', + ip: faker.internet.ipv4(), + address: '中国河南省信阳市', + system: 'macOS', + browser: 'Chrome', + status: 1, // 操作状态 1 成功 0 失败 + summary: '菜单管理-添加菜单', // 操作概要 + module: '系统管理', // 所属模块 + operatingTime: new Date(), // 操作时间 + }, + { + id: 2, + username: 'common', + ip: faker.internet.ipv4(), + address: '中国广东省深圳市', + system: 'Windows', + browser: 'Firefox', + status: 0, + summary: '列表分页查询', + module: '在线用户', + operatingTime: new Date(), + }, + ]; + list = list.filter(item => item.module.includes(body?.module)); + list = list.filter(item => String(item.status).includes(String(body?.status))); + return { + success: true, + data: { + list, + total: list.length, // 总条目数 + pageSize: 10, // 每页显示条目个数 + currentPage: 1, // 当前页数 + }, + }; + }, + }, + // 系统日志 + { + url: '/system-logs', + method: 'post', + response: ({ body }) => { + let list = [ + { + id: 1, // 日志ID + /** + * 日志级别 + * 0 debug调试(最低级别的日志,用于调试和开发阶段) + * 1 info信息(默认级别,用于记录一般的信息) + * 2 warn警告(表示可能出现的问题或潜在的错误,但不会影响系统的正常运行) + * 3 error错误(表示发生了错误,但不会导致系统崩溃) + * 4 fatal致命(最高级别的日志,表示发生了严重错误,导致系统无法继续运行) + */ + level: 1, + module: '菜单管理', // 所属模块 + url: '/menu', // 请求接口 + method: 'post', // 请求方法 + ip: faker.internet.ipv4(), + address: '中国河南省信阳市', + system: 'macOS', + browser: 'Chrome', + /** + * 请求耗时(单位:ms 毫秒) + * 正常耗时:一般认为在几百毫秒(0.1-0.5秒)范围内的请求耗时较为正常 + * 较慢耗时:在1秒以上的耗时可以被认为是较慢的请求,但具体是否较慢还需要根据具体业务场景和性能要求来判断 + */ + takesTime: 10, + requestTime: new Date(), // 请求时间 + }, + { + id: 2, + level: 0, + module: '地图', + url: '/get-map-info', + method: 'get', + ip: faker.internet.ipv4(), + address: '中国广东省深圳市', + system: 'Windows', + browser: 'Firefox', + takesTime: 1200, + requestTime: new Date(), + }, + ]; + list = list.filter(item => item.module.includes(body?.module)); + return { + success: true, + data: { + list, + total: list.length, // 总条目数 + pageSize: 10, // 每页显示条目个数 + currentPage: 1, // 当前页数 + }, + }; + }, + }, + // 系统日志-根据 id 查日志详情 + { + url: '/system-logs-detail', + method: 'post', + response: ({ body }) => { + if (body.id == 1) { + return { + id: 1, + level: 1, + module: '菜单管理', + url: '/menu', + method: 'post', + ip: faker.internet.ipv4(), + address: '中国河南省信阳市', + system: 'macOS', + browser: 'Chrome', + takesTime: 10, + responseHeaders: { + traceId: '1495502411171032', + 'Content-Type': 'application/json', + Connection: 'keep-alive', + 'Keep-Alive': 'timeout=5', + 'Content-Length': 17019, + }, + responseBody: { + success: true, + data: [ + { + parentId: 0, + id: 400, + menuType: 0, + title: 'menus.pureSysMonitor', + name: 'PureMonitor', + path: '/monitor', + component: '', + rank: 11, + redirect: '', + icon: 'ep:monitor', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 400, + id: 401, + menuType: 0, + title: 'menus.pureOnlineUser', + name: 'OnlineUser', + path: '/monitor/online-user', + component: 'monitor/online/index', + rank: null, + redirect: '', + icon: 'ri:user-voice-line', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 400, + id: 402, + menuType: 0, + title: 'menus.pureLoginLog', + name: 'LoginLog', + path: '/monitor/login-logs', + component: 'monitor/logs/login/index', + rank: null, + redirect: '', + icon: 'ri:window-line', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 400, + id: 403, + menuType: 0, + title: 'menus.pureOperationLog', + name: 'OperationLog', + path: '/monitor/operation-logs', + component: 'monitor/logs/operation/index', + rank: null, + redirect: '', + icon: 'ri:history-fill', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + { + parentId: 400, + id: 404, + menuType: 0, + title: 'menus.pureSystemLog', + name: 'SystemLog', + path: '/monitor/system-logs', + component: 'monitor/logs/system/index', + rank: null, + redirect: '', + icon: 'ri:file-search-line', + extraIcon: '', + enterTransition: '', + leaveTransition: '', + activePath: '', + auths: '', + frameSrc: '', + frameLoading: true, + keepAlive: false, + hiddenTag: false, + fixedTag: false, + showLink: true, + showParent: false, + }, + ], + }, + requestHeaders: { + Accept: 'application/json, text/plain, */*', + 'Accept-Encoding': 'gzip, deflate', + 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,eo;q=0.7', + Authorization: 'Bearer eyJhbGciOiJIUzUxMiJ9.admin', + Connection: 'keep-alive', + 'Content-Length': 0, + Cookie: + '_ga=GA1.1.231800979.1704562367; _ga_M74ZHEQ1M1=GS1.1.1709299375.7.1.1709299476.0.0.0; Hm_lvt_6a7dac00248d3b6ad8479d7249bb29c5=1709032753,1709359575; Hm_lvt_23a157b7d0d9867f7a51e42628f052f5=1708960489,1709485849,1709879672; authorized-token={%22accessToken%22:%22eyJhbGciOiJIUzUxMiJ9.admin%22%2C%22expires%22:1919520000000}; multiple-tabs=true', + Host: '192.168.2.121:8848', + Origin: 'http://192.168.2.121:8848', + Referer: 'http://192.168.2.121:8848/', + 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36', + 'X-Requested-With': 'XMLHttpRequest', + }, + requestBody: { + title: '系统监控', + }, + traceId: '1495502411171032', + requestTime: new Date(), + }; + } else if (body.id == 2) { + return { + id: 2, + level: 0, + module: '地图', + url: '/get-map-info?plateNumber=豫A59778U', + method: 'get', + ip: faker.internet.ipv4(), + address: '中国广东省深圳市', + system: 'Windows', + browser: 'Firefox', + takesTime: 1200, + responseHeaders: { + traceId: '2280443117103208', + 'Content-Type': 'application/json', + Connection: 'keep-alive', + 'Keep-Alive': 'timeout=5', + 'Content-Length': 28693, + }, + responseBody: { + plateNumber: '豫A59778U', + driver: '子骞', + orientation: 289, + lng: 113.8564, + lat: 34.373, + }, + requestHeaders: { + Accept: 'application/json, text/plain, */*', + 'Accept-Encoding': 'gzip, deflate', + 'Accept-Language': 'zh-CN,zh;q=0.9,en;q=0.8,eo;q=0.7', + Authorization: 'Bearer eyJhbGciOiJIUzUxMiJ9.admin', + Connection: 'keep-alive', + 'Content-Length': 0, + Cookie: + '_ga=GA1.1.231800979.1704562367; _ga_M74ZHEQ1M1=GS1.1.1709299375.7.1.1709299476.0.0.0; Hm_lvt_6a7dac00248d3b6ad8479d7249bb29c5=1709032753,1709359575; Hm_lvt_23a157b7d0d9867f7a51e42628f052f5=1708960489,1709485849,1709879672; authorized-token={%22accessToken%22:%22eyJhbGciOiJIUzUxMiJ9.admin%22%2C%22expires%22:1919520000000}; multiple-tabs=true', + Host: '192.168.2.121:8848', + Origin: 'http://192.168.2.121:8848', + Referer: 'http://192.168.2.121:8848/', + 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36', + 'X-Requested-With': 'XMLHttpRequest', + }, + requestBody: null, + traceId: '2280443117103208', + requestTime: new Date(), + }; + } + }, + }, ]); diff --git a/package.json b/package.json index 3d81530..7967a46 100644 --- a/package.json +++ b/package.json @@ -1,202 +1,202 @@ { - "name": "bunny-admin-element", - "version": "1.0.0", - "private": true, - "type": "module", - "keywords": [ - "bunny-admin-element", - "bunny-cli", - "element-plus", - "tailwindcss", - "typescript", - "pinia", - "vue3", - "vite", - "esm" - ], - "homepage": "https://gitee.com/BunnyBoss/bunny-admin-element.git", - "repository": { - "type": "git", - "url": "https://gitee.com/BunnyBoss/bunny-admin-element.git" - }, - "bugs": { - "url": "https://gitee.com/BunnyBoss/bunny-admin-element.git/issues" - }, - "license": "MIT", - "author": { - "name": "Bunny0212", - "email": "1319900154@qq.com", - "url": "https://github.com/xiaoxian521" - }, - "scripts": { - "dev": "NODE_OPTIONS=--max-old-space-size=4096 vite", - "serve": "pnpm vite", - "start": "vite", - "build": "rimraf dist && NODE_OPTIONS=--max-old-space-size=8192 vite build && generate-version-file", - "build:staging": "rimraf dist && vite build --mode staging", - "report": "rimraf dist && vite build", - "preview": "vite preview", - "preview:build": "pnpm build && vite preview", - "typecheck": "tsc --noEmit && vue-tsc --noEmit --skipLibCheck", - "svgo": "svgo -f . -r", - "clean:cache": "rimraf .eslintcache && rimraf pnpm-lock.yaml && rimraf node_modules && pnpm store prune && pnpm install", - "lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock,build}/**/*.{vue,js,ts,tsx}\" --fix", - "lint:prettier": "prettier --write \"src/**/*.{js,ts,json,tsx,css,scss,vue,html,md}\"", - "lint:stylelint": "stylelint --cache --fix \"**/*.{html,vue,css,scss}\" --cache-location node_modules/.cache/stylelint/", - "lint": "pnpm lint:eslint && pnpm lint:prettier && pnpm lint:stylelint", - "prepare": "husky", - "preinstall": "npx only-allow pnpm", - "commit": "git pull && git add -A && git-cz && git push" - }, - "dependencies": { - "@amap/amap-jsapi-loader": "^1.0.1", - "@howdyjs/mouse-menu": "^2.1.3", - "@infectoone/vue-ganttastic": "^2.3.2", - "@logicflow/core": "^1.2.27", - "@logicflow/extension": "^1.2.27", - "@pureadmin/descriptions": "^1.2.1", - "@pureadmin/table": "^3.1.2", - "@pureadmin/utils": "^2.4.7", - "@vue-flow/background": "^1.3.0", - "@vue-flow/core": "^1.33.6", - "@vueuse/core": "^10.9.0", - "@vueuse/motion": "^2.1.0", - "@wangeditor/editor": "^5.1.23", - "@wangeditor/editor-for-vue": "^5.1.12", - "@zxcvbn-ts/core": "^3.0.4", - "animate.css": "^4.1.1", - "axios": "^1.6.8", - "china-area-data": "^5.0.1", - "cropperjs": "^1.6.2", - "dayjs": "^1.11.11", - "echarts": "^5.5.0", - "el-table-infinite-scroll": "^3.0.3", - "element-plus": "2.7.1", - "intro.js": "^7.2.0", - "js-cookie": "^3.0.5", - "jsbarcode": "^3.11.6", - "localforage": "^1.10.0", - "mint-filter": "^4.0.3", - "mitt": "^3.0.1", - "mqtt": "4.3.7", - "nprogress": "^0.2.0", - "path": "^0.12.7", - "pinia": "^2.1.7", - "pinia-plugin-persistedstate": "^3.2.1", - "pinyin-pro": "^3.20.4", - "plus-pro-components": "^0.1.1", - "qrcode": "^1.5.3", - "qs": "^6.12.1", - "responsive-storage": "^2.2.0", - "sortablejs": "^1.15.2", - "swiper": "^11.1.1", - "typeit": "^8.8.3", - "v-contextmenu": "^3.2.0", - "v3-infinite-loading": "^1.3.1", - "version-rocket": "^1.7.1", - "vue": "^3.4.27", - "vue-i18n": "^9.13.1", - "vue-json-pretty": "^2.4.0", - "vue-pdf-embed": "^2.0.3", - "vue-router": "^4.3.2", - "vue-tippy": "^6.4.1", - "vue-types": "^5.1.2", - "vue-virtual-scroller": "2.0.0-beta.8", - "vue-waterfall-plugin-next": "^2.4.3", - "vue3-danmaku": "^1.6.0", - "vue3-puzzle-vcode": "^1.1.7", - "vuedraggable": "^4.1.0", - "vxe-table": "^4.6.9", - "wavesurfer.js": "^7.7.13", - "xgplayer": "^3.0.17", - "xlsx": "^0.18.5" - }, - "devDependencies": { - "@commitlint/cli": "^19.3.0", - "@commitlint/config-conventional": "^19.2.2", - "@commitlint/types": "^19.0.3", - "@eslint/js": "^9.2.0", - "@faker-js/faker": "^8.4.1", - "@iconify-icons/ep": "^1.2.12", - "@iconify-icons/ri": "^1.2.10", - "@iconify/vue": "^4.1.2", - "@intlify/unplugin-vue-i18n": "^4.0.0", - "@pureadmin/theme": "^3.2.0", - "@types/dagre": "^0.7.52", - "@types/gradient-string": "^1.1.6", - "@types/intro.js": "^5.1.5", - "@types/js-cookie": "^3.0.6", - "@types/node": "^20.12.11", - "@types/nprogress": "^0.2.3", - "@types/qrcode": "^1.5.5", - "@types/qs": "^6.9.15", - "@types/sortablejs": "^1.15.8", - "@typescript-eslint/eslint-plugin": "^7.8.0", - "@typescript-eslint/parser": "^7.8.0", - "@vitejs/plugin-vue": "^5.0.4", - "@vitejs/plugin-vue-jsx": "^3.1.0", - "autoprefixer": "^10.4.19", - "boxen": "^7.1.1", - "commitizen": "^4.2.4", - "commitlint": "^17.0.1", - "cssnano": "^7.0.1", - "cz-git": "^1.3.2", - "dagre": "^0.8.5", - "eslint": "^9.2.0", - "eslint-config-prettier": "^9.1.0", - "eslint-define-config": "^2.1.0", - "eslint-plugin-prettier": "^5.1.3", - "eslint-plugin-vue": "^9.25.0", - "gradient-string": "^2.0.2", - "husky": "^8.0.1", - "lint-staged": "^15.2.2", - "postcss": "^8.4.38", - "postcss-html": "^1.7.0", - "postcss-import": "^16.1.0", - "postcss-scss": "^4.0.9", - "prettier": "^3.2.5", - "rimraf": "^5.0.5", - "rollup-plugin-visualizer": "^5.12.0", - "sass": "^1.77.0", - "stylelint": "^16.5.0", - "stylelint-config-recess-order": "^5.0.1", - "stylelint-config-recommended-vue": "^1.5.0", - "stylelint-config-standard-scss": "^13.1.0", - "stylelint-prettier": "^5.0.0", - "svgo": "^3.3.0", - "tailwindcss": "^3.4.3", - "typescript": "^5.4.5", - "vite": "^5.2.11", - "vite-plugin-cdn-import": "^0.3.5", - "vite-plugin-compression": "^0.5.1", - "vite-plugin-fake-server": "^2.1.1", - "vite-plugin-remove-console": "^2.2.0", - "vite-plugin-router-warn": "^1.0.0", - "vite-svg-loader": "^5.1.0", - "vue-eslint-parser": "^9.4.2", - "vue-tsc": "^1.8.27" - }, - "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0", - "pnpm": ">=8.6.10" - }, - "pnpm": { - "allowedDeprecatedVersions": { - "sourcemap-codec": "*", - "domexception": "*", - "w3c-hr-time": "*", - "stable": "*", - "abab": "*" - }, - "peerDependencyRules": { - "allowedVersions": { - "eslint": "9" - } - } - }, - "config": { - "commitizen": { - "path": "node_modules/cz-git" - } - } + "name": "bunny-admin-element", + "version": "1.0.0", + "private": true, + "type": "module", + "keywords": [ + "bunny-admin-element", + "bunny-cli", + "element-plus", + "tailwindcss", + "typescript", + "pinia", + "vue3", + "vite", + "esm" + ], + "homepage": "https://gitee.com/BunnyBoss/bunny-admin-element.git", + "repository": { + "type": "git", + "url": "https://gitee.com/BunnyBoss/bunny-admin-element.git" + }, + "bugs": { + "url": "https://gitee.com/BunnyBoss/bunny-admin-element.git/issues" + }, + "license": "MIT", + "author": { + "name": "Bunny0212", + "email": "1319900154@qq.com", + "url": "https://github.com/xiaoxian521" + }, + "scripts": { + "dev": "NODE_OPTIONS=--max-old-space-size=4096 vite", + "serve": "pnpm vite", + "start": "vite", + "build": "rimraf dist && NODE_OPTIONS=--max-old-space-size=8192 vite build && generate-version-file", + "build:staging": "rimraf dist && vite build --mode staging", + "report": "rimraf dist && vite build", + "preview": "vite preview", + "preview:build": "pnpm build && vite preview", + "typecheck": "tsc --noEmit && vue-tsc --noEmit --skipLibCheck", + "svgo": "svgo -f . -r", + "clean:cache": "rimraf .eslintcache && rimraf pnpm-lock.yaml && rimraf node_modules && pnpm store prune && pnpm install", + "lint:eslint": "eslint --cache --max-warnings 0 \"{src,mock,build}/**/*.{vue,js,ts,tsx}\" --fix", + "lint:prettier": "prettier --write \"src/**/*.{js,ts,json,tsx,css,scss,vue,html,md}\"", + "lint:stylelint": "stylelint --cache --fix \"**/*.{html,vue,css,scss}\" --cache-location node_modules/.cache/stylelint/", + "lint": "pnpm lint:eslint && pnpm lint:prettier && pnpm lint:stylelint", + "prepare": "husky", + "preinstall": "npx only-allow pnpm", + "commit": "git pull && git add -A && git-cz && git push" + }, + "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", + "@howdyjs/mouse-menu": "^2.1.3", + "@infectoone/vue-ganttastic": "^2.3.2", + "@logicflow/core": "^1.2.27", + "@logicflow/extension": "^1.2.27", + "@pureadmin/descriptions": "^1.2.1", + "@pureadmin/table": "^3.1.2", + "@pureadmin/utils": "^2.4.7", + "@vue-flow/background": "^1.3.0", + "@vue-flow/core": "^1.33.6", + "@vueuse/core": "^10.9.0", + "@vueuse/motion": "^2.1.0", + "@wangeditor/editor": "^5.1.23", + "@wangeditor/editor-for-vue": "^5.1.12", + "@zxcvbn-ts/core": "^3.0.4", + "animate.css": "^4.1.1", + "axios": "^1.6.8", + "china-area-data": "^5.0.1", + "cropperjs": "^1.6.2", + "dayjs": "^1.11.11", + "echarts": "^5.5.0", + "el-table-infinite-scroll": "^3.0.3", + "element-plus": "2.7.1", + "intro.js": "^7.2.0", + "js-cookie": "^3.0.5", + "jsbarcode": "^3.11.6", + "localforage": "^1.10.0", + "mint-filter": "^4.0.3", + "mitt": "^3.0.1", + "mqtt": "4.3.7", + "nprogress": "^0.2.0", + "path": "^0.12.7", + "pinia": "^2.1.7", + "pinia-plugin-persistedstate": "^3.2.1", + "pinyin-pro": "^3.20.4", + "plus-pro-components": "^0.1.1", + "qrcode": "^1.5.3", + "qs": "^6.12.1", + "responsive-storage": "^2.2.0", + "sortablejs": "^1.15.2", + "swiper": "^11.1.1", + "typeit": "^8.8.3", + "v-contextmenu": "^3.2.0", + "v3-infinite-loading": "^1.3.1", + "version-rocket": "^1.7.1", + "vue": "^3.4.27", + "vue-i18n": "^9.13.1", + "vue-json-pretty": "^2.4.0", + "vue-pdf-embed": "^2.0.3", + "vue-router": "^4.3.2", + "vue-tippy": "^6.4.1", + "vue-types": "^5.1.2", + "vue-virtual-scroller": "2.0.0-beta.8", + "vue-waterfall-plugin-next": "^2.4.3", + "vue3-danmaku": "^1.6.0", + "vue3-puzzle-vcode": "^1.1.7", + "vuedraggable": "^4.1.0", + "vxe-table": "^4.6.9", + "wavesurfer.js": "^7.7.13", + "xgplayer": "^3.0.17", + "xlsx": "^0.18.5" + }, + "devDependencies": { + "@commitlint/cli": "^19.3.0", + "@commitlint/config-conventional": "^19.2.2", + "@commitlint/types": "^19.0.3", + "@eslint/js": "^9.2.0", + "@faker-js/faker": "^8.4.1", + "@iconify-icons/ep": "^1.2.12", + "@iconify-icons/ri": "^1.2.10", + "@iconify/vue": "^4.1.2", + "@intlify/unplugin-vue-i18n": "^4.0.0", + "@pureadmin/theme": "^3.2.0", + "@types/dagre": "^0.7.52", + "@types/gradient-string": "^1.1.6", + "@types/intro.js": "^5.1.5", + "@types/js-cookie": "^3.0.6", + "@types/node": "^20.12.11", + "@types/nprogress": "^0.2.3", + "@types/qrcode": "^1.5.5", + "@types/qs": "^6.9.15", + "@types/sortablejs": "^1.15.8", + "@typescript-eslint/eslint-plugin": "^7.8.0", + "@typescript-eslint/parser": "^7.8.0", + "@vitejs/plugin-vue": "^5.0.4", + "@vitejs/plugin-vue-jsx": "^3.1.0", + "autoprefixer": "^10.4.19", + "boxen": "^7.1.1", + "commitizen": "^4.2.4", + "commitlint": "^17.0.1", + "cssnano": "^7.0.1", + "cz-git": "^1.3.2", + "dagre": "^0.8.5", + "eslint": "^9.2.0", + "eslint-config-prettier": "^9.1.0", + "eslint-define-config": "^2.1.0", + "eslint-plugin-prettier": "^5.1.3", + "eslint-plugin-vue": "^9.25.0", + "gradient-string": "^2.0.2", + "husky": "^8.0.1", + "lint-staged": "^15.2.2", + "postcss": "^8.4.38", + "postcss-html": "^1.7.0", + "postcss-import": "^16.1.0", + "postcss-scss": "^4.0.9", + "prettier": "^3.2.5", + "rimraf": "^5.0.5", + "rollup-plugin-visualizer": "^5.12.0", + "sass": "^1.77.0", + "stylelint": "^16.5.0", + "stylelint-config-recess-order": "^5.0.1", + "stylelint-config-recommended-vue": "^1.5.0", + "stylelint-config-standard-scss": "^13.1.0", + "stylelint-prettier": "^5.0.0", + "svgo": "^3.3.0", + "tailwindcss": "^3.4.3", + "typescript": "^5.4.5", + "vite": "^5.2.11", + "vite-plugin-cdn-import": "^0.3.5", + "vite-plugin-compression": "^0.5.1", + "vite-plugin-fake-server": "^2.1.1", + "vite-plugin-remove-console": "^2.2.0", + "vite-plugin-router-warn": "^1.0.0", + "vite-svg-loader": "^5.1.0", + "vue-eslint-parser": "^9.4.2", + "vue-tsc": "^1.8.27" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0", + "pnpm": ">=8.6.10" + }, + "pnpm": { + "allowedDeprecatedVersions": { + "sourcemap-codec": "*", + "domexception": "*", + "w3c-hr-time": "*", + "stable": "*", + "abab": "*" + }, + "peerDependencyRules": { + "allowedVersions": { + "eslint": "9" + } + } + }, + "config": { + "commitizen": { + "path": "node_modules/cz-git" + } + } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 30975bb..46918e1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -40,7 +40,7 @@ importers: version: 1.33.8(vue@3.4.27(typescript@5.4.5)) '@vueuse/core': specifier: ^10.9.0 - version: 10.9.0(vue@3.4.27(typescript@5.4.5)) + version: 10.10.0(vue@3.4.27(typescript@5.4.5)) '@vueuse/motion': specifier: ^2.1.0 version: 2.1.0(rollup@4.18.0)(vue@3.4.27(typescript@5.4.5)) @@ -1735,8 +1735,8 @@ packages: '@vue/shared@3.4.27': resolution: {integrity: sha512-DL3NmY2OFlqmYYrzp39yi3LDkKxa5vZVwxWdQ3rG0ekuWscHraeIbnI8t+aZK7qhYqEqWKTUdijadunb9pnrgA==} - '@vueuse/core@10.9.0': - resolution: {integrity: sha512-/1vjTol8SXnx6xewDEKfS0Ra//ncg4Hb0DaZiwKf7drgfMsKFExQ+FnnENcN6efPen+1kIzhLQoGSy0eDUVOMg==} + '@vueuse/core@10.10.0': + resolution: {integrity: sha512-vexJ/YXYs2S42B783rI95lMt3GzEwkxzC8Hb0Ndpd8rD+p+Lk/Za4bd797Ym7yq4jXqdSyj3JLChunF/vyYjUw==} '@vueuse/core@8.9.4': resolution: {integrity: sha512-B/Mdj9TK1peFyWaPof+Zf/mP9XuGAngaJZBwPaXBvU3aCTZlx3ltlrFFFyMV4iGBwsjSCeUCgZrtkEj9dS2Y3Q==} @@ -1752,8 +1752,8 @@ packages: '@vueuse/core@9.13.0': resolution: {integrity: sha512-pujnclbeHWxxPRqXWmdkKV5OX4Wk4YeK7wusHqRwU0Q7EFusHoqNA/aPhB6KCh9hEqJkLAJo7bb0Lh9b+OIVzw==} - '@vueuse/metadata@10.9.0': - resolution: {integrity: sha512-iddNbg3yZM0X7qFY2sAotomgdHK7YJ6sKUvQqbvwnf7TmaVPxS4EJydcNsVejNdS8iWCtDk+fYXr7E32nyTnGA==} + '@vueuse/metadata@10.10.0': + resolution: {integrity: sha512-UNAo2sTCAW5ge6OErPEHb5z7NEAg3XcO9Cj7OK45aZXfLLH1QkexDcZD77HBi5zvEiLOm1An+p/4b5K3Worpug==} '@vueuse/metadata@8.9.4': resolution: {integrity: sha512-IwSfzH80bnJMzqhaapqJl9JRIiyQU0zsRGEgnxN6jhq7992cPUJIRfV+JHRIZXjYqbwt07E1gTEp0R0zPJ1aqw==} @@ -1766,8 +1766,8 @@ packages: peerDependencies: vue: '>=3.0.0' - '@vueuse/shared@10.9.0': - resolution: {integrity: sha512-Uud2IWncmAfJvRaFYzv5OHDli+FbOzxiVEQdLCKQKLyhz94PIyFC3CHcH7EDMwIn8NPtD06+PNbC/PiO0LGLtw==} + '@vueuse/shared@10.10.0': + resolution: {integrity: sha512-2aW33Ac0Uk0U+9yo3Ypg9s5KcR42cuehRWl7vnUHadQyFvCktseyxxEPBi1Eiq4D2yBGACOnqLZpx1eMc7g5Og==} '@vueuse/shared@8.9.4': resolution: {integrity: sha512-wt+T30c4K6dGRMVqPddexEVLa28YwxW5OFIPmzUHICjphfAuBFTTdDoyqREZNDOFJZ44ARH1WWQNCUK8koJ+Ag==} @@ -6376,7 +6376,7 @@ snapshots: lodash.merge: 4.6.2 lodash.uniq: 4.5.0 resolve-from: 5.0.0 - ts-node: 10.9.2(@types/node@20.12.12)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@20.5.1)(typescript@5.4.5) typescript: 5.4.5 transitivePeerDependencies: - '@swc/core' @@ -7429,7 +7429,7 @@ snapshots: '@vue-flow/core@1.33.8(vue@3.4.27(typescript@5.4.5))': dependencies: - '@vueuse/core': 10.9.0(vue@3.4.27(typescript@5.4.5)) + '@vueuse/core': 10.10.0(vue@3.4.27(typescript@5.4.5)) d3-drag: 3.0.0 d3-selection: 3.0.0 d3-zoom: 3.0.0 @@ -7535,11 +7535,11 @@ snapshots: '@vue/shared@3.4.27': {} - '@vueuse/core@10.9.0(vue@3.4.27(typescript@5.4.5))': + '@vueuse/core@10.10.0(vue@3.4.27(typescript@5.4.5))': dependencies: '@types/web-bluetooth': 0.0.20 - '@vueuse/metadata': 10.9.0 - '@vueuse/shared': 10.9.0(vue@3.4.27(typescript@5.4.5)) + '@vueuse/metadata': 10.10.0 + '@vueuse/shared': 10.10.0(vue@3.4.27(typescript@5.4.5)) vue-demi: 0.14.7(vue@3.4.27(typescript@5.4.5)) transitivePeerDependencies: - '@vue/composition-api' @@ -7564,7 +7564,7 @@ snapshots: - '@vue/composition-api' - vue - '@vueuse/metadata@10.9.0': {} + '@vueuse/metadata@10.10.0': {} '@vueuse/metadata@8.9.4': {} @@ -7572,8 +7572,8 @@ snapshots: '@vueuse/motion@2.1.0(rollup@4.18.0)(vue@3.4.27(typescript@5.4.5))': dependencies: - '@vueuse/core': 10.9.0(vue@3.4.27(typescript@5.4.5)) - '@vueuse/shared': 10.9.0(vue@3.4.27(typescript@5.4.5)) + '@vueuse/core': 10.10.0(vue@3.4.27(typescript@5.4.5)) + '@vueuse/shared': 10.10.0(vue@3.4.27(typescript@5.4.5)) csstype: 3.1.3 framesync: 6.1.2 popmotion: 11.0.5 @@ -7586,7 +7586,7 @@ snapshots: - rollup - supports-color - '@vueuse/shared@10.9.0(vue@3.4.27(typescript@5.4.5))': + '@vueuse/shared@10.10.0(vue@3.4.27(typescript@5.4.5))': dependencies: vue-demi: 0.14.7(vue@3.4.27(typescript@5.4.5)) transitivePeerDependencies: @@ -8281,7 +8281,7 @@ snapshots: dependencies: '@types/node': 20.5.1 cosmiconfig: 8.3.6(typescript@5.4.5) - ts-node: 10.9.2(@types/node@20.12.12)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@20.5.1)(typescript@5.4.5) typescript: 5.4.5 cosmiconfig-typescript-loader@5.0.0(@types/node@20.12.12)(cosmiconfig@9.0.0(typescript@5.4.5))(typescript@5.4.5): @@ -9699,7 +9699,7 @@ snapshots: slash: 3.0.0 strip-json-comments: 3.1.1 optionalDependencies: - ts-node: 10.9.2(@types/node@20.12.12)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@20.5.1)(typescript@5.4.5) transitivePeerDependencies: - bufferutil - canvas @@ -10786,7 +10786,7 @@ snapshots: yaml: 2.4.2 optionalDependencies: postcss: 8.4.38 - ts-node: 10.9.2(@types/node@20.12.12)(typescript@5.4.5) + ts-node: 10.9.2(@types/node@20.5.1)(typescript@5.4.5) postcss-media-query-parser@0.2.3: {} @@ -11796,14 +11796,14 @@ snapshots: ts-interface-checker@0.1.13: {} - ts-node@10.9.2(@types/node@20.12.12)(typescript@5.4.5): + ts-node@10.9.2(@types/node@20.5.1)(typescript@5.4.5): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.12.12 + '@types/node': 20.5.1 acorn: 8.11.3 acorn-walk: 8.3.2 arg: 4.1.3 diff --git a/public/sponsors/aitools.svg b/public/sponsors/aitools.svg deleted file mode 100644 index 9110b24..0000000 --- a/public/sponsors/aitools.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/components/Editor/components/EditorBase.vue b/src/components/Editor/components/EditorBase.vue index 762bd06..6793142 100644 --- a/src/components/Editor/components/EditorBase.vue +++ b/src/components/Editor/components/EditorBase.vue @@ -1,56 +1,45 @@ - diff --git a/src/components/Editor/components/EditorMulti.vue b/src/components/Editor/components/EditorMulti.vue index dcbccf7..7f8d774 100644 --- a/src/components/Editor/components/EditorMulti.vue +++ b/src/components/Editor/components/EditorMulti.vue @@ -1,76 +1,65 @@ - diff --git a/src/components/Editor/components/EditorUpload.vue b/src/components/Editor/components/EditorUpload.vue index de1ff3b..7fe799d 100644 --- a/src/components/Editor/components/EditorUpload.vue +++ b/src/components/Editor/components/EditorUpload.vue @@ -1,70 +1,57 @@ - diff --git a/src/components/Empty/index.vue b/src/components/Empty/index.vue index 6d3dab0..caa86fb 100644 --- a/src/components/Empty/index.vue +++ b/src/components/Empty/index.vue @@ -1,42 +1,42 @@ - diff --git a/src/components/Error/403.vue b/src/components/Error/403.vue index a16be3c..20c7cfa 100644 --- a/src/components/Error/403.vue +++ b/src/components/Error/403.vue @@ -1,70 +1,70 @@ - diff --git a/src/components/Error/404.vue b/src/components/Error/404.vue index cd780b7..d87bca0 100644 --- a/src/components/Error/404.vue +++ b/src/components/Error/404.vue @@ -1,70 +1,70 @@ - diff --git a/src/components/Error/500.vue b/src/components/Error/500.vue index e55a090..ae0ede6 100644 --- a/src/components/Error/500.vue +++ b/src/components/Error/500.vue @@ -1,70 +1,70 @@ - diff --git a/src/components/ReAnimateSelector/index.ts b/src/components/ReAnimateSelector/index.ts index 87c9008..296b07d 100644 --- a/src/components/ReAnimateSelector/index.ts +++ b/src/components/ReAnimateSelector/index.ts @@ -1,5 +1,5 @@ -import { withInstall } from "@pureadmin/utils"; -import reAnimateSelector from "./src/index.vue"; +import { withInstall } from '@pureadmin/utils'; +import reAnimateSelector from './src/index.vue'; /** [animate.css](https://animate.style/) 选择器组件 */ export const ReAnimateSelector = withInstall(reAnimateSelector); diff --git a/src/components/ReAnimateSelector/src/animate.ts b/src/components/ReAnimateSelector/src/animate.ts index 2b0593c..3a1728b 100644 --- a/src/components/ReAnimateSelector/src/animate.ts +++ b/src/components/ReAnimateSelector/src/animate.ts @@ -1,114 +1,114 @@ export const animates = [ - /* Attention seekers */ - "bounce", - "flash", - "pulse", - "rubberBand", - "shakeX", - "headShake", - "swing", - "tada", - "wobble", - "jello", - "heartBeat", - /* Back entrances */ - "backInDown", - "backInLeft", - "backInRight", - "backInUp", - /* Back exits */ - "backOutDown", - "backOutLeft", - "backOutRight", - "backOutUp", - /* Bouncing entrances */ - "bounceIn", - "bounceInDown", - "bounceInLeft", - "bounceInRight", - "bounceInUp", - /* Bouncing exits */ - "bounceOut", - "bounceOutDown", - "bounceOutLeft", - "bounceOutRight", - "bounceOutUp", - /* Fading entrances */ - "fadeIn", - "fadeInDown", - "fadeInDownBig", - "fadeInLeft", - "fadeInLeftBig", - "fadeInRight", - "fadeInRightBig", - "fadeInUp", - "fadeInUpBig", - "fadeInTopLeft", - "fadeInTopRight", - "fadeInBottomLeft", - "fadeInBottomRight", - /* Fading exits */ - "fadeOut", - "fadeOutDown", - "fadeOutDownBig", - "fadeOutLeft", - "fadeOutLeftBig", - "fadeOutRight", - "fadeOutRightBig", - "fadeOutUp", - "fadeOutUpBig", - "fadeOutTopLeft", - "fadeOutTopRight", - "fadeOutBottomRight", - "fadeOutBottomLeft", - /* Flippers */ - "flip", - "flipInX", - "flipInY", - "flipOutX", - "flipOutY", - /* Lightspeed */ - "lightSpeedInRight", - "lightSpeedInLeft", - "lightSpeedOutRight", - "lightSpeedOutLeft", - /* Rotating entrances */ - "rotateIn", - "rotateInDownLeft", - "rotateInDownRight", - "rotateInUpLeft", - "rotateInUpRight", - /* Rotating exits */ - "rotateOut", - "rotateOutDownLeft", - "rotateOutDownRight", - "rotateOutUpLeft", - "rotateOutUpRight", - /* Specials */ - "hinge", - "jackInTheBox", - "rollIn", - "rollOut", - /* Zooming entrances */ - "zoomIn", - "zoomInDown", - "zoomInLeft", - "zoomInRight", - "zoomInUp", - /* Zooming exits */ - "zoomOut", - "zoomOutDown", - "zoomOutLeft", - "zoomOutRight", - "zoomOutUp", - /* Sliding entrances */ - "slideInDown", - "slideInLeft", - "slideInRight", - "slideInUp", - /* Sliding exits */ - "slideOutDown", - "slideOutLeft", - "slideOutRight", - "slideOutUp" + /* Attention seekers */ + 'bounce', + 'flash', + 'pulse', + 'rubberBand', + 'shakeX', + 'headShake', + 'swing', + 'tada', + 'wobble', + 'jello', + 'heartBeat', + /* Back entrances */ + 'backInDown', + 'backInLeft', + 'backInRight', + 'backInUp', + /* Back exits */ + 'backOutDown', + 'backOutLeft', + 'backOutRight', + 'backOutUp', + /* Bouncing entrances */ + 'bounceIn', + 'bounceInDown', + 'bounceInLeft', + 'bounceInRight', + 'bounceInUp', + /* Bouncing exits */ + 'bounceOut', + 'bounceOutDown', + 'bounceOutLeft', + 'bounceOutRight', + 'bounceOutUp', + /* Fading entrances */ + 'fadeIn', + 'fadeInDown', + 'fadeInDownBig', + 'fadeInLeft', + 'fadeInLeftBig', + 'fadeInRight', + 'fadeInRightBig', + 'fadeInUp', + 'fadeInUpBig', + 'fadeInTopLeft', + 'fadeInTopRight', + 'fadeInBottomLeft', + 'fadeInBottomRight', + /* Fading exits */ + 'fadeOut', + 'fadeOutDown', + 'fadeOutDownBig', + 'fadeOutLeft', + 'fadeOutLeftBig', + 'fadeOutRight', + 'fadeOutRightBig', + 'fadeOutUp', + 'fadeOutUpBig', + 'fadeOutTopLeft', + 'fadeOutTopRight', + 'fadeOutBottomRight', + 'fadeOutBottomLeft', + /* Flippers */ + 'flip', + 'flipInX', + 'flipInY', + 'flipOutX', + 'flipOutY', + /* Lightspeed */ + 'lightSpeedInRight', + 'lightSpeedInLeft', + 'lightSpeedOutRight', + 'lightSpeedOutLeft', + /* Rotating entrances */ + 'rotateIn', + 'rotateInDownLeft', + 'rotateInDownRight', + 'rotateInUpLeft', + 'rotateInUpRight', + /* Rotating exits */ + 'rotateOut', + 'rotateOutDownLeft', + 'rotateOutDownRight', + 'rotateOutUpLeft', + 'rotateOutUpRight', + /* Specials */ + 'hinge', + 'jackInTheBox', + 'rollIn', + 'rollOut', + /* Zooming entrances */ + 'zoomIn', + 'zoomInDown', + 'zoomInLeft', + 'zoomInRight', + 'zoomInUp', + /* Zooming exits */ + 'zoomOut', + 'zoomOutDown', + 'zoomOutLeft', + 'zoomOutRight', + 'zoomOutUp', + /* Sliding entrances */ + 'slideInDown', + 'slideInLeft', + 'slideInRight', + 'slideInUp', + /* Sliding exits */ + 'slideOutDown', + 'slideOutLeft', + 'slideOutRight', + 'slideOutUp', ]; diff --git a/src/components/ReAnimateSelector/src/index.vue b/src/components/ReAnimateSelector/src/index.vue index e10056b..1dce705 100644 --- a/src/components/ReAnimateSelector/src/index.vue +++ b/src/components/ReAnimateSelector/src/index.vue @@ -1,17 +1,17 @@ - diff --git a/src/components/ReAuth/index.ts b/src/components/ReAuth/index.ts index 975ed2c..71f325f 100644 --- a/src/components/ReAuth/index.ts +++ b/src/components/ReAuth/index.ts @@ -1,4 +1,4 @@ -import auth from "./src/auth"; +import auth from './src/auth'; const Auth = auth; diff --git a/src/components/ReAuth/src/auth.tsx b/src/components/ReAuth/src/auth.tsx index c5f8d46..f293ce3 100644 --- a/src/components/ReAuth/src/auth.tsx +++ b/src/components/ReAuth/src/auth.tsx @@ -1,18 +1,18 @@ -import { defineComponent, Fragment } from "vue"; -import { hasAuth } from "@/router/utils"; +import { defineComponent, Fragment } from 'vue'; +import { hasAuth } from '@/router/utils'; export default defineComponent({ - name: "Auth", - props: { - value: { - type: undefined, - default: [] - } - }, - setup(props, { slots }) { - return () => { - if (!slots) return null; - return hasAuth(props.value) ? {slots.default?.()} : null; - }; - } + name: 'Auth', + props: { + value: { + type: undefined, + default: [], + }, + }, + setup(props, { slots }) { + return () => { + if (!slots) return null; + return hasAuth(props.value) ? {slots.default?.()} : null; + }; + }, }); diff --git a/src/components/ReBarcode/index.ts b/src/components/ReBarcode/index.ts index ad09848..d1a6003 100644 --- a/src/components/ReBarcode/index.ts +++ b/src/components/ReBarcode/index.ts @@ -1,5 +1,5 @@ -import { withInstall } from "@pureadmin/utils"; -import reBarcode from "./src/index.vue"; +import { withInstall } from '@pureadmin/utils'; +import reBarcode from './src/index.vue'; /** 条形码组件 */ export const ReBarcode = withInstall(reBarcode); diff --git a/src/components/ReBarcode/src/index.vue b/src/components/ReBarcode/src/index.vue index b8674f3..a8d2067 100644 --- a/src/components/ReBarcode/src/index.vue +++ b/src/components/ReBarcode/src/index.vue @@ -1,42 +1,42 @@ - diff --git a/src/components/ReCol/index.ts b/src/components/ReCol/index.ts index 7a6c937..3540e62 100644 --- a/src/components/ReCol/index.ts +++ b/src/components/ReCol/index.ts @@ -1,29 +1,29 @@ -import { ElCol } from "element-plus"; -import { h, defineComponent } from "vue"; +import { ElCol } from 'element-plus'; +import { defineComponent, h } from 'vue'; // 封装element-plus的el-col组件 export default defineComponent({ - name: "ReCol", - props: { - value: { - type: Number, - default: 24 - } - }, - render() { - const attrs = this.$attrs; - const val = this.value; - return h( - ElCol, - { - xs: val, - sm: val, - md: val, - lg: val, - xl: val, - ...attrs - }, - { default: () => this.$slots.default() } - ); - } + name: 'ReCol', + props: { + value: { + type: Number, + default: 24, + }, + }, + render() { + const attrs = this.$attrs; + const val = this.value; + return h( + ElCol, + { + xs: val, + sm: val, + md: val, + lg: val, + xl: val, + ...attrs, + }, + { default: () => this.$slots.default() }, + ); + }, }); diff --git a/src/components/ReCountTo/index.ts b/src/components/ReCountTo/index.ts index 1817218..8c19aa2 100644 --- a/src/components/ReCountTo/index.ts +++ b/src/components/ReCountTo/index.ts @@ -1,6 +1,6 @@ -import reNormalCountTo from "./src/normal"; -import reboundCountTo from "./src/rebound"; -import { withInstall } from "@pureadmin/utils"; +import reNormalCountTo from './src/normal'; +import reboundCountTo from './src/rebound'; +import { withInstall } from '@pureadmin/utils'; /** 普通数字动画组件 */ const ReNormalCountTo = withInstall(reNormalCountTo); diff --git a/src/components/ReCountTo/src/normal/index.tsx b/src/components/ReCountTo/src/normal/index.tsx index 2601dab..37af509 100644 --- a/src/components/ReCountTo/src/normal/index.tsx +++ b/src/components/ReCountTo/src/normal/index.tsx @@ -1,154 +1,154 @@ -import { computed, defineComponent, onMounted, reactive, unref, watch } from "vue"; -import { countToProps } from "./props"; -import { isNumber } from "@pureadmin/utils"; +import { computed, defineComponent, onMounted, reactive, unref, watch } from 'vue'; +import { countToProps } from './props'; +import { isNumber } from '@pureadmin/utils'; export default defineComponent({ - name: "ReNormalCountTo", - props: countToProps, - emits: ["mounted", "callback"], - setup(props, { emit }) { - const state = reactive<{ - localStartVal: number; - printVal: number | null; - displayValue: string; - paused: boolean; - localDuration: number | null; - startTime: number | null; - timestamp: number | null; - rAF: any; - remaining: number | null; - color: string; - fontSize: string; - }>({ - localStartVal: props.startVal, - displayValue: formatNumber(props.startVal), - printVal: null, - paused: false, - localDuration: props.duration, - startTime: null, - timestamp: null, - remaining: null, - rAF: null, - color: null, - fontSize: "16px" - }); + name: 'ReNormalCountTo', + props: countToProps, + emits: ['mounted', 'callback'], + setup(props, { emit }) { + const state = reactive<{ + localStartVal: number; + printVal: number | null; + displayValue: string; + paused: boolean; + localDuration: number | null; + startTime: number | null; + timestamp: number | null; + rAF: any; + remaining: number | null; + color: string; + fontSize: string; + }>({ + localStartVal: props.startVal, + displayValue: formatNumber(props.startVal), + printVal: null, + paused: false, + localDuration: props.duration, + startTime: null, + timestamp: null, + remaining: null, + rAF: null, + color: null, + fontSize: '16px', + }); - const getCountDown = computed(() => { - return props.startVal > props.endVal; - }); + const getCountDown = computed(() => { + return props.startVal > props.endVal; + }); - watch([() => props.startVal, () => props.endVal], () => { - if (props.autoplay) { - start(); - } - }); + watch([() => props.startVal, () => props.endVal], () => { + if (props.autoplay) { + start(); + } + }); - function start() { - const { startVal, duration, color, fontSize } = props; - state.localStartVal = startVal; - state.startTime = null; - state.localDuration = duration; - state.paused = false; - state.color = color; - state.fontSize = fontSize; - state.rAF = requestAnimationFrame(count); - } + function start() { + const { startVal, duration, color, fontSize } = props; + state.localStartVal = startVal; + state.startTime = null; + state.localDuration = duration; + state.paused = false; + state.color = color; + state.fontSize = fontSize; + state.rAF = requestAnimationFrame(count); + } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - function pauseResume() { - if (state.paused) { - resume(); - state.paused = false; - } else { - pause(); - state.paused = true; - } - } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + function pauseResume() { + if (state.paused) { + resume(); + state.paused = false; + } else { + pause(); + state.paused = true; + } + } - function pause() { - cancelAnimationFrame(state.rAF); - } + function pause() { + cancelAnimationFrame(state.rAF); + } - function resume() { - state.startTime = null; - state.localDuration = +(state.remaining as number); - state.localStartVal = +(state.printVal as number); - requestAnimationFrame(count); - } + function resume() { + state.startTime = null; + state.localDuration = +(state.remaining as number); + state.localStartVal = +(state.printVal as number); + requestAnimationFrame(count); + } - // eslint-disable-next-line @typescript-eslint/no-unused-vars - function reset() { - state.startTime = null; - cancelAnimationFrame(state.rAF); - state.displayValue = formatNumber(props.startVal); - } + // eslint-disable-next-line @typescript-eslint/no-unused-vars + function reset() { + state.startTime = null; + cancelAnimationFrame(state.rAF); + state.displayValue = formatNumber(props.startVal); + } - function count(timestamp: number) { - const { useEasing, easingFn, endVal } = props; - if (!state.startTime) state.startTime = timestamp; - state.timestamp = timestamp; - const progress = timestamp - state.startTime; - state.remaining = (state.localDuration as number) - progress; - if (useEasing) { - if (unref(getCountDown)) { - state.printVal = state.localStartVal - easingFn(progress, 0, state.localStartVal - endVal, state.localDuration as number); - } else { - state.printVal = easingFn(progress, state.localStartVal, endVal - state.localStartVal, state.localDuration as number); - } - } else { - if (unref(getCountDown)) { - state.printVal = state.localStartVal - (state.localStartVal - endVal) * (progress / (state.localDuration as number)); - } else { - state.printVal = state.localStartVal + (endVal - state.localStartVal) * (progress / (state.localDuration as number)); - } - } - if (unref(getCountDown)) { - state.printVal = state.printVal < endVal ? endVal : state.printVal; - } else { - state.printVal = state.printVal > endVal ? endVal : state.printVal; - } - state.displayValue = formatNumber(state.printVal); - if (progress < (state.localDuration as number)) { - state.rAF = requestAnimationFrame(count); - } else { - emit("callback"); - } - } + function count(timestamp: number) { + const { useEasing, easingFn, endVal } = props; + if (!state.startTime) state.startTime = timestamp; + state.timestamp = timestamp; + const progress = timestamp - state.startTime; + state.remaining = (state.localDuration as number) - progress; + if (useEasing) { + if (unref(getCountDown)) { + state.printVal = state.localStartVal - easingFn(progress, 0, state.localStartVal - endVal, state.localDuration as number); + } else { + state.printVal = easingFn(progress, state.localStartVal, endVal - state.localStartVal, state.localDuration as number); + } + } else { + if (unref(getCountDown)) { + state.printVal = state.localStartVal - (state.localStartVal - endVal) * (progress / (state.localDuration as number)); + } else { + state.printVal = state.localStartVal + (endVal - state.localStartVal) * (progress / (state.localDuration as number)); + } + } + if (unref(getCountDown)) { + state.printVal = state.printVal < endVal ? endVal : state.printVal; + } else { + state.printVal = state.printVal > endVal ? endVal : state.printVal; + } + state.displayValue = formatNumber(state.printVal); + if (progress < (state.localDuration as number)) { + state.rAF = requestAnimationFrame(count); + } else { + emit('callback'); + } + } - function formatNumber(num: number | string) { - const { decimals, decimal, separator, suffix, prefix } = props; - num = Number(num).toFixed(decimals); - num += ""; - const x = num.split("."); - let x1 = x[0]; - const x2 = x.length > 1 ? decimal + x[1] : ""; - const rgx = /(\d+)(\d{3})/; - if (separator && !isNumber(separator)) { - while (rgx.test(x1)) { - x1 = x1.replace(rgx, "$1" + separator + "$2"); - } - } - return prefix + x1 + x2 + suffix; - } + function formatNumber(num: number | string) { + const { decimals, decimal, separator, suffix, prefix } = props; + num = Number(num).toFixed(decimals); + num += ''; + const x = num.split('.'); + let x1 = x[0]; + const x2 = x.length > 1 ? decimal + x[1] : ''; + const rgx = /(\d+)(\d{3})/; + if (separator && !isNumber(separator)) { + while (rgx.test(x1)) { + x1 = x1.replace(rgx, '$1' + separator + '$2'); + } + } + return prefix + x1 + x2 + suffix; + } - onMounted(() => { - if (props.autoplay) { - start(); - } - emit("mounted"); - }); + onMounted(() => { + if (props.autoplay) { + start(); + } + emit('mounted'); + }); - return () => ( - <> - - {state.displayValue} - - - ); - } + return () => ( + <> + + {state.displayValue} + + + ); + }, }); diff --git a/src/components/ReCountTo/src/normal/props.ts b/src/components/ReCountTo/src/normal/props.ts index 1212223..03bb082 100644 --- a/src/components/ReCountTo/src/normal/props.ts +++ b/src/components/ReCountTo/src/normal/props.ts @@ -1,30 +1,30 @@ -import type { PropType } from "vue"; -import propTypes from "@/utils/propTypes"; +import type { PropType } from 'vue'; +import propTypes from '@/utils/propTypes'; export const countToProps = { - startVal: propTypes.number.def(0), - endVal: propTypes.number.def(2020), - duration: propTypes.number.def(1300), - autoplay: propTypes.bool.def(true), - decimals: { - type: Number as PropType, - required: false, - default: 0, - validator(value: number) { - return value >= 0; - } - }, - color: propTypes.string.def(), - fontSize: propTypes.string.def(), - decimal: propTypes.string.def("."), - separator: propTypes.string.def(","), - prefix: propTypes.string.def(""), - suffix: propTypes.string.def(""), - useEasing: propTypes.bool.def(true), - easingFn: { - type: Function as PropType<(t: number, b: number, c: number, d: number) => number>, - default(t: number, b: number, c: number, d: number) { - return (c * (-Math.pow(2, (-10 * t) / d) + 1) * 1024) / 1023 + b; - } - } + startVal: propTypes.number.def(0), + endVal: propTypes.number.def(2020), + duration: propTypes.number.def(1300), + autoplay: propTypes.bool.def(true), + decimals: { + type: Number as PropType, + required: false, + default: 0, + validator(value: number) { + return value >= 0; + }, + }, + color: propTypes.string.def(), + fontSize: propTypes.string.def(), + decimal: propTypes.string.def('.'), + separator: propTypes.string.def(','), + prefix: propTypes.string.def(''), + suffix: propTypes.string.def(''), + useEasing: propTypes.bool.def(true), + easingFn: { + type: Function as PropType<(t: number, b: number, c: number, d: number) => number>, + default(t: number, b: number, c: number, d: number) { + return (c * (-Math.pow(2, (-10 * t) / d) + 1) * 1024) / 1023 + b; + }, + }, }; diff --git a/src/components/ReCountTo/src/rebound/index.tsx b/src/components/ReCountTo/src/rebound/index.tsx index 72ceb40..0a77e19 100644 --- a/src/components/ReCountTo/src/rebound/index.tsx +++ b/src/components/ReCountTo/src/rebound/index.tsx @@ -1,60 +1,60 @@ -import "./rebound.css"; -import { defineComponent, onBeforeMount, onBeforeUnmount, ref, unref } from "vue"; -import { reboundProps } from "./props"; +import './rebound.css'; +import { defineComponent, onBeforeMount, onBeforeUnmount, ref, unref } from 'vue'; +import { reboundProps } from './props'; export default defineComponent({ - name: "ReboundCountTo", - props: reboundProps, - setup(props) { - const ulRef = ref(); - const timer = ref(null); + name: 'ReboundCountTo', + props: reboundProps, + setup(props) { + const ulRef = ref(); + const timer = ref(null); - onBeforeMount(() => { - const ua = navigator.userAgent.toLowerCase(); - const testUA = regexp => regexp.test(ua); - const isSafari = testUA(/safari/g) && !testUA(/chrome/g); + onBeforeMount(() => { + const ua = navigator.userAgent.toLowerCase(); + const testUA = regexp => regexp.test(ua); + const isSafari = testUA(/safari/g) && !testUA(/chrome/g); - // Safari浏览器的兼容代码 - isSafari && - (timer.value = setTimeout(() => { - ulRef.value.setAttribute( - "style", - ` + // Safari浏览器的兼容代码 + isSafari && + (timer.value = setTimeout(() => { + ulRef.value.setAttribute( + 'style', + ` animation: none; transform: translateY(calc(var(--i) * -9.09%)) - ` - ); - }, props.delay * 1000)); - }); + `, + ); + }, props.delay * 1000)); + }); - onBeforeUnmount(() => { - clearTimeout(unref(timer)); - }); + onBeforeUnmount(() => { + clearTimeout(unref(timer)); + }); - return () => ( - <> -
-
    -
  • 0
  • -
  • 1
  • -
  • 2
  • -
  • 3
  • -
  • 4
  • -
  • 5
  • -
  • 6
  • -
  • 7
  • -
  • 8
  • -
  • 9
  • -
  • 0
  • -
+ return () => ( + <> +
+
    +
  • 0
  • +
  • 1
  • +
  • 2
  • +
  • 3
  • +
  • 4
  • +
  • 5
  • +
  • 6
  • +
  • 7
  • +
  • 8
  • +
  • 9
  • +
  • 0
  • +
- - - - - -
- - ); - } + + + + + +
+ + ); + }, }); diff --git a/src/components/ReCountTo/src/rebound/props.ts b/src/components/ReCountTo/src/rebound/props.ts index 8b0491a..b0f94b6 100644 --- a/src/components/ReCountTo/src/rebound/props.ts +++ b/src/components/ReCountTo/src/rebound/props.ts @@ -1,15 +1,15 @@ -import type { PropType } from "vue"; -import propTypes from "@/utils/propTypes"; +import type { PropType } from 'vue'; +import propTypes from '@/utils/propTypes'; export const reboundProps = { - delay: propTypes.number.def(1), - blur: propTypes.number.def(2), - i: { - type: Number as PropType, - required: false, - default: 0, - validator(value: number) { - return value < 10 && value >= 0 && Number.isInteger(value); - } - } + delay: propTypes.number.def(1), + blur: propTypes.number.def(2), + i: { + type: Number as PropType, + required: false, + default: 0, + validator(value: number) { + return value < 10 && value >= 0 && Number.isInteger(value); + }, + }, }; diff --git a/src/components/ReCountTo/src/rebound/rebound.css b/src/components/ReCountTo/src/rebound/rebound.css index a56c3c1..0ff414b 100644 --- a/src/components/ReCountTo/src/rebound/rebound.css +++ b/src/components/ReCountTo/src/rebound/rebound.css @@ -1,76 +1,76 @@ .scroll-num { - animation: enhance-bounce-in-down 1s calc(var(--delay) * 1s) forwards; - color: var(--color, #333); - font-size: var(--height, calc(var(--width, 20px) * 1.1)); - height: var(--height, calc(var(--width, 20px) * 1.8)); - line-height: var(--height, calc(var(--width, 20px) * 1.8)); - overflow: hidden; - text-align: center; - width: var(--width, 20px); + animation: enhance-bounce-in-down 1s calc(var(--delay) * 1s) forwards; + color: var(--color, #333); + font-size: var(--height, calc(var(--width, 20px) * 1.1)); + height: var(--height, calc(var(--width, 20px) * 1.8)); + line-height: var(--height, calc(var(--width, 20px) * 1.8)); + overflow: hidden; + text-align: center; + width: var(--width, 20px); } ul { - animation: move 0.3s linear infinite, - bounce-in-down 1s calc(var(--delay) * 1s) forwards; + animation: move 0.3s linear infinite, + bounce-in-down 1s calc(var(--delay) * 1s) forwards; } @keyframes move { - from { - transform: translateY(-90%); - filter: url(#blur); - } + from { + transform: translateY(-90%); + filter: url(#blur); + } - to { - transform: translateY(1%); - filter: url(#blur); - } + to { + transform: translateY(1%); + filter: url(#blur); + } } @keyframes bounce-in-down { - from { - transform: translateY(calc(var(--i) * -9.09% - 7%)); - filter: none; - } + from { + transform: translateY(calc(var(--i) * -9.09% - 7%)); + filter: none; + } - 25% { - transform: translateY(calc(var(--i) * -9.09% + 3%)); - } + 25% { + transform: translateY(calc(var(--i) * -9.09% + 3%)); + } - 50% { - transform: translateY(calc(var(--i) * -9.09% - 1%)); - } + 50% { + transform: translateY(calc(var(--i) * -9.09% - 1%)); + } - 70% { - transform: translateY(calc(var(--i) * -9.09% + 0.6%)); - } + 70% { + transform: translateY(calc(var(--i) * -9.09% + 0.6%)); + } - 85% { - transform: translateY(calc(var(--i) * -9.09% - 0.3%)); - } + 85% { + transform: translateY(calc(var(--i) * -9.09% - 0.3%)); + } - to { - transform: translateY(calc(var(--i) * -9.09%)); - } + to { + transform: translateY(calc(var(--i) * -9.09%)); + } } @keyframes enhance-bounce-in-down { - 25% { - transform: translateY(8%); - } + 25% { + transform: translateY(8%); + } - 50% { - transform: translateY(-4%); - } + 50% { + transform: translateY(-4%); + } - 70% { - transform: translateY(2%); - } + 70% { + transform: translateY(2%); + } - 85% { - transform: translateY(-1%); - } + 85% { + transform: translateY(-1%); + } - to { - transform: translateY(0); - } + to { + transform: translateY(0); + } } diff --git a/src/components/ReCropper/index.ts b/src/components/ReCropper/index.ts index 62e2590..ce62b46 100644 --- a/src/components/ReCropper/index.ts +++ b/src/components/ReCropper/index.ts @@ -1,5 +1,5 @@ -import reCropper from "./src"; -import { withInstall } from "@pureadmin/utils"; +import reCropper from './src'; +import { withInstall } from '@pureadmin/utils'; /** 图片裁剪组件 */ export const ReCropper = withInstall(reCropper); diff --git a/src/components/ReCropper/src/circled.css b/src/components/ReCropper/src/circled.css index 54c77d2..773d446 100644 --- a/src/components/ReCropper/src/circled.css +++ b/src/components/ReCropper/src/circled.css @@ -6,3 +6,4 @@ border-radius: 50%; } } + diff --git a/src/components/ReCropper/src/index.tsx b/src/components/ReCropper/src/index.tsx index 4e3f68e..354a9a8 100644 --- a/src/components/ReCropper/src/index.tsx +++ b/src/components/ReCropper/src/index.tsx @@ -1,386 +1,386 @@ -import "./circled.css"; -import Cropper from "cropperjs"; -import { ElUpload } from "element-plus"; -import type { CSSProperties } from "vue"; -import { computed, defineComponent, onMounted, onUnmounted, type PropType, ref, unref } from "vue"; -import { useEventListener } from "@vueuse/core"; -import { longpress } from "@/directives/longpress"; -import { directive as tippy, useTippy } from "vue-tippy"; -import { debounce, delay, downloadByBase64, isArray, useResizeObserver } from "@pureadmin/utils"; -import { ArrowDown, ArrowH, ArrowLeft, ArrowRight, ArrowUp, ArrowV, ChangeIcon, DownloadIcon, Reload, RotateLeft, RotateRight, SearchMinus, SearchPlus, Upload } from "./svg"; +import './circled.css'; +import Cropper from 'cropperjs'; +import { ElUpload } from 'element-plus'; +import type { CSSProperties } from 'vue'; +import { computed, defineComponent, onMounted, onUnmounted, type PropType, ref, unref } from 'vue'; +import { useEventListener } from '@vueuse/core'; +import { longpress } from '@/directives/longpress'; +import { directive as tippy, useTippy } from 'vue-tippy'; +import { debounce, delay, downloadByBase64, isArray, useResizeObserver } from '@pureadmin/utils'; +import { ArrowDown, ArrowH, ArrowLeft, ArrowRight, ArrowUp, ArrowV, ChangeIcon, DownloadIcon, Reload, RotateLeft, RotateRight, SearchMinus, SearchPlus, Upload } from './svg'; type Options = Cropper.Options; const defaultOptions: Options = { - aspectRatio: 1, - zoomable: true, - zoomOnTouch: true, - zoomOnWheel: true, - cropBoxMovable: true, - cropBoxResizable: true, - toggleDragModeOnDblclick: true, - autoCrop: true, - background: true, - highlight: true, - center: true, - responsive: true, - restore: true, - checkCrossOrigin: true, - checkOrientation: true, - scalable: true, - modal: true, - guides: true, - movable: true, - rotatable: true + aspectRatio: 1, + zoomable: true, + zoomOnTouch: true, + zoomOnWheel: true, + cropBoxMovable: true, + cropBoxResizable: true, + toggleDragModeOnDblclick: true, + autoCrop: true, + background: true, + highlight: true, + center: true, + responsive: true, + restore: true, + checkCrossOrigin: true, + checkOrientation: true, + scalable: true, + modal: true, + guides: true, + movable: true, + rotatable: true, }; const props = { - src: { type: String, required: true }, - alt: { type: String }, - circled: { type: Boolean, default: false }, - /** 是否可以通过点击裁剪区域关闭右键弹出的功能菜单,默认 `true` */ - isClose: { type: Boolean, default: true }, - realTimePreview: { type: Boolean, default: true }, - height: { type: [String, Number], default: "360px" }, - crossorigin: { - type: String as PropType<"" | "anonymous" | "use-credentials" | undefined>, - default: undefined - }, - imageStyle: { type: Object as PropType, default: () => ({}) }, - options: { type: Object as PropType, default: () => ({}) } + src: { type: String, required: true }, + alt: { type: String }, + circled: { type: Boolean, default: false }, + /** 是否可以通过点击裁剪区域关闭右键弹出的功能菜单,默认 `true` */ + isClose: { type: Boolean, default: true }, + realTimePreview: { type: Boolean, default: true }, + height: { type: [String, Number], default: '360px' }, + crossorigin: { + type: String as PropType<'' | 'anonymous' | 'use-credentials' | undefined>, + default: undefined, + }, + imageStyle: { type: Object as PropType, default: () => ({}) }, + options: { type: Object as PropType, default: () => ({}) }, }; export default defineComponent({ - name: "ReCropper", - props, - setup(props, { attrs, emit }) { - const tippyElRef = ref>(); - const imgElRef = ref>(); - const cropper = ref>(); - const inCircled = ref(props.circled); - const isInClose = ref(props.isClose); - const inSrc = ref(props.src); - const isReady = ref(false); - const imgBase64 = ref(); + name: 'ReCropper', + props, + setup(props, { attrs, emit }) { + const tippyElRef = ref>(); + const imgElRef = ref>(); + const cropper = ref>(); + const inCircled = ref(props.circled); + const isInClose = ref(props.isClose); + const inSrc = ref(props.src); + const isReady = ref(false); + const imgBase64 = ref(); - let scaleX = 1; - let scaleY = 1; + let scaleX = 1; + let scaleY = 1; - const debounceRealTimeCroppered = debounce(realTimeCroppered, 80); + const debounceRealTimeCroppered = debounce(realTimeCroppered, 80); - const getImageStyle = computed((): CSSProperties => { - return { - height: props.height, - maxWidth: "100%", - ...props.imageStyle - }; - }); + const getImageStyle = computed((): CSSProperties => { + return { + height: props.height, + maxWidth: '100%', + ...props.imageStyle, + }; + }); - const getClass = computed(() => { - return [ - attrs.class, - { - ["re-circled"]: inCircled.value - } - ]; - }); + const getClass = computed(() => { + return [ + attrs.class, + { + ['re-circled']: inCircled.value, + }, + ]; + }); - const iconClass = computed(() => { - return ["p-[6px]", "h-[30px]", "w-[30px]", "outline-none", "rounded-[4px]", "cursor-pointer", "hover:bg-[rgba(0,0,0,0.06)]"]; - }); + const iconClass = computed(() => { + return ['p-[6px]', 'h-[30px]', 'w-[30px]', 'outline-none', 'rounded-[4px]', 'cursor-pointer', 'hover:bg-[rgba(0,0,0,0.06)]']; + }); - const getWrapperStyle = computed((): CSSProperties => { - return { height: `${props.height}`.replace(/px/, "") + "px" }; - }); + const getWrapperStyle = computed((): CSSProperties => { + return { height: `${props.height}`.replace(/px/, '') + 'px' }; + }); - onMounted(init); + onMounted(init); - onUnmounted(() => { - cropper.value?.destroy(); - isReady.value = false; - cropper.value = null; - imgBase64.value = ""; - scaleX = 1; - scaleY = 1; - }); + onUnmounted(() => { + cropper.value?.destroy(); + isReady.value = false; + cropper.value = null; + imgBase64.value = ''; + scaleX = 1; + scaleY = 1; + }); - useResizeObserver(tippyElRef, () => handCropper("reset")); + useResizeObserver(tippyElRef, () => handCropper('reset')); - async function init() { - const imgEl = unref(imgElRef); - if (!imgEl) return; - cropper.value = new Cropper(imgEl, { - ...defaultOptions, - ready: () => { - isReady.value = true; - realTimeCroppered(); - delay(400).then(() => emit("readied", cropper.value)); - }, - crop() { - debounceRealTimeCroppered(); - }, - zoom() { - debounceRealTimeCroppered(); - }, - cropmove() { - debounceRealTimeCroppered(); - }, - ...props.options - }); - } + async function init() { + const imgEl = unref(imgElRef); + if (!imgEl) return; + cropper.value = new Cropper(imgEl, { + ...defaultOptions, + ready: () => { + isReady.value = true; + realTimeCroppered(); + delay(400).then(() => emit('readied', cropper.value)); + }, + crop() { + debounceRealTimeCroppered(); + }, + zoom() { + debounceRealTimeCroppered(); + }, + cropmove() { + debounceRealTimeCroppered(); + }, + ...props.options, + }); + } - function realTimeCroppered() { - props.realTimePreview && croppered(); - } + function realTimeCroppered() { + props.realTimePreview && croppered(); + } - function croppered() { - if (!cropper.value) return; - const canvas = inCircled.value ? getRoundedCanvas() : cropper.value.getCroppedCanvas(); - // https://developer.mozilla.org/zh-CN/docs/Web/API/HTMLCanvasElement/toBlob - canvas.toBlob(blob => { - if (!blob) return; - const fileReader: FileReader = new FileReader(); - fileReader.readAsDataURL(blob); - fileReader.onloadend = e => { - if (!e.target?.result || !blob) return; - imgBase64.value = e.target.result; - emit("cropper", { - base64: e.target.result, - blob, - info: { size: blob.size, ...cropper.value.getData() } - }); - }; - fileReader.onerror = () => { - emit("error"); - }; - }); - } + function croppered() { + if (!cropper.value) return; + const canvas = inCircled.value ? getRoundedCanvas() : cropper.value.getCroppedCanvas(); + // https://developer.mozilla.org/zh-CN/docs/Web/API/HTMLCanvasElement/toBlob + canvas.toBlob(blob => { + if (!blob) return; + const fileReader: FileReader = new FileReader(); + fileReader.readAsDataURL(blob); + fileReader.onloadend = e => { + if (!e.target?.result || !blob) return; + imgBase64.value = e.target.result; + emit('cropper', { + base64: e.target.result, + blob, + info: { size: blob.size, ...cropper.value.getData() }, + }); + }; + fileReader.onerror = () => { + emit('error'); + }; + }); + } - function getRoundedCanvas() { - const sourceCanvas = cropper.value!.getCroppedCanvas(); - const canvas = document.createElement("canvas"); - const context = canvas.getContext("2d")!; - const width = sourceCanvas.width; - const height = sourceCanvas.height; - canvas.width = width; - canvas.height = height; - context.imageSmoothingEnabled = true; - context.drawImage(sourceCanvas, 0, 0, width, height); - context.globalCompositeOperation = "destination-in"; - context.beginPath(); - context.arc(width / 2, height / 2, Math.min(width, height) / 2, 0, 2 * Math.PI, true); - context.fill(); - return canvas; - } + function getRoundedCanvas() { + const sourceCanvas = cropper.value!.getCroppedCanvas(); + const canvas = document.createElement('canvas'); + const context = canvas.getContext('2d')!; + const width = sourceCanvas.width; + const height = sourceCanvas.height; + canvas.width = width; + canvas.height = height; + context.imageSmoothingEnabled = true; + context.drawImage(sourceCanvas, 0, 0, width, height); + context.globalCompositeOperation = 'destination-in'; + context.beginPath(); + context.arc(width / 2, height / 2, Math.min(width, height) / 2, 0, 2 * Math.PI, true); + context.fill(); + return canvas; + } - function handCropper(event: string, arg?: number | Array) { - if (event === "scaleX") { - scaleX = arg = scaleX === -1 ? 1 : -1; - } + function handCropper(event: string, arg?: number | Array) { + if (event === 'scaleX') { + scaleX = arg = scaleX === -1 ? 1 : -1; + } - if (event === "scaleY") { - scaleY = arg = scaleY === -1 ? 1 : -1; - } - arg && isArray(arg) ? cropper.value?.[event]?.(...arg) : cropper.value?.[event]?.(arg); - } + if (event === 'scaleY') { + scaleY = arg = scaleY === -1 ? 1 : -1; + } + arg && isArray(arg) ? cropper.value?.[event]?.(...arg) : cropper.value?.[event]?.(arg); + } - function beforeUpload(file) { - const reader = new FileReader(); - reader.readAsDataURL(file); - inSrc.value = ""; - reader.onload = e => { - inSrc.value = e.target?.result as string; - }; - reader.onloadend = () => { - init(); - }; - return false; - } + function beforeUpload(file) { + const reader = new FileReader(); + reader.readAsDataURL(file); + inSrc.value = ''; + reader.onload = e => { + inSrc.value = e.target?.result as string; + }; + reader.onloadend = () => { + init(); + }; + return false; + } - const menuContent = defineComponent({ - directives: { - tippy, - longpress - }, - setup() { - return () => ( -
- - - - downloadByBase64(imgBase64.value, "cropping.png")} - /> - { - inCircled.value = !inCircled.value; - realTimeCroppered(); - }} - /> - handCropper("reset")} - /> - handCropper("move", [0, -10]), "0:100"]} - /> - handCropper("move", [0, 10]), "0:100"]} - /> - handCropper("move", [-10, 0]), "0:100"]} - /> - handCropper("move", [10, 0]), "0:100"]} - /> - handCropper("scaleX", -1)} - /> - handCropper("scaleY", -1)} - /> - handCropper("rotate", -45)} - /> - handCropper("rotate", 45)} - /> - handCropper("zoom", 0.1), "0:100"]} - /> - handCropper("zoom", -0.1), "0:100"]} - /> -
- ); - } - }); + const menuContent = defineComponent({ + directives: { + tippy, + longpress, + }, + setup() { + return () => ( +
+ + + + downloadByBase64(imgBase64.value, 'cropping.png')} + /> + { + inCircled.value = !inCircled.value; + realTimeCroppered(); + }} + /> + handCropper('reset')} + /> + handCropper('move', [0, -10]), '0:100']} + /> + handCropper('move', [0, 10]), '0:100']} + /> + handCropper('move', [-10, 0]), '0:100']} + /> + handCropper('move', [10, 0]), '0:100']} + /> + handCropper('scaleX', -1)} + /> + handCropper('scaleY', -1)} + /> + handCropper('rotate', -45)} + /> + handCropper('rotate', 45)} + /> + handCropper('zoom', 0.1), '0:100']} + /> + handCropper('zoom', -0.1), '0:100']} + /> +
+ ); + }, + }); - function onContextmenu(event) { - event.preventDefault(); + function onContextmenu(event) { + event.preventDefault(); - const { show, setProps, destroy, state } = useTippy(tippyElRef, { - content: menuContent, - arrow: false, - theme: "light", - trigger: "manual", - interactive: true, - appendTo: "parent", - // hideOnClick: false, - placement: "bottom-end" - }); + const { show, setProps, destroy, state } = useTippy(tippyElRef, { + content: menuContent, + arrow: false, + theme: 'light', + trigger: 'manual', + interactive: true, + appendTo: 'parent', + // hideOnClick: false, + placement: 'bottom-end', + }); - setProps({ - getReferenceClientRect: () => ({ - width: 0, - height: 0, - top: event.clientY, - bottom: event.clientY, - left: event.clientX, - right: event.clientX - }) - }); + setProps({ + getReferenceClientRect: () => ({ + width: 0, + height: 0, + top: event.clientY, + bottom: event.clientY, + left: event.clientX, + right: event.clientX, + }), + }); - show(); + show(); - if (isInClose.value) { - if (!state.value.isShown && !state.value.isVisible) return; - useEventListener(tippyElRef, "click", destroy); - } - } + if (isInClose.value) { + if (!state.value.isShown && !state.value.isVisible) return; + useEventListener(tippyElRef, 'click', destroy); + } + } - return { - inSrc, - props, - imgElRef, - tippyElRef, - getClass, - getWrapperStyle, - getImageStyle, - isReady, - croppered, - onContextmenu - }; - }, + return { + inSrc, + props, + imgElRef, + tippyElRef, + getClass, + getWrapperStyle, + getImageStyle, + isReady, + croppered, + onContextmenu, + }; + }, - render() { - const { inSrc, isReady, getClass, getImageStyle, onContextmenu, getWrapperStyle } = this; - const { alt, crossorigin } = this.props; + render() { + const { inSrc, isReady, getClass, getImageStyle, onContextmenu, getWrapperStyle } = this; + const { alt, crossorigin } = this.props; - return inSrc ? ( -
onContextmenu(event)}> - {alt} -
- ) : null; - } + return inSrc ? ( +
onContextmenu(event)}> + {alt} +
+ ) : null; + }, }); diff --git a/src/components/ReCropperPreview/index.ts b/src/components/ReCropperPreview/index.ts index e7949fe..5f93385 100644 --- a/src/components/ReCropperPreview/index.ts +++ b/src/components/ReCropperPreview/index.ts @@ -1,5 +1,5 @@ -import reCropperPreview from "./src/index.vue"; -import { withInstall } from "@pureadmin/utils"; +import reCropperPreview from './src/index.vue'; +import { withInstall } from '@pureadmin/utils'; /** 图片裁剪预览组件 */ export const ReCropperPreview = withInstall(reCropperPreview); diff --git a/src/components/ReCropperPreview/src/index.vue b/src/components/ReCropperPreview/src/index.vue index b7bf3f5..1e797ec 100644 --- a/src/components/ReCropperPreview/src/index.vue +++ b/src/components/ReCropperPreview/src/index.vue @@ -1,53 +1,53 @@ diff --git a/src/components/ReDialog/index.ts b/src/components/ReDialog/index.ts index 3bbbef5..091919a 100644 --- a/src/components/ReDialog/index.ts +++ b/src/components/ReDialog/index.ts @@ -1,32 +1,32 @@ -import { ref } from "vue"; -import reDialog from "./index.vue"; -import { useTimeoutFn } from "@vueuse/core"; -import { withInstall } from "@pureadmin/utils"; -import type { ArgsType, ButtonProps, DialogOptions, DialogProps, EventType } from "./type"; +import { ref } from 'vue'; +import reDialog from './index.vue'; +import { useTimeoutFn } from '@vueuse/core'; +import { withInstall } from '@pureadmin/utils'; +import type { ArgsType, ButtonProps, DialogOptions, DialogProps, EventType } from './type'; const dialogStore = ref>([]); /** 打开弹框 */ const addDialog = (options: DialogOptions) => { - const open = () => dialogStore.value.push(Object.assign(options, { visible: true })); - if (options?.openDelay) { - useTimeoutFn(() => { - open(); - }, options.openDelay); - } else { - open(); - } + const open = () => dialogStore.value.push(Object.assign(options, { visible: true })); + if (options?.openDelay) { + useTimeoutFn(() => { + open(); + }, options.openDelay); + } else { + open(); + } }; /** 关闭弹框 */ const closeDialog = (options: DialogOptions, index: number, args?: any) => { - dialogStore.value[index].visible = false; - options.closeCallBack && options.closeCallBack({ options, index, args }); + dialogStore.value[index].visible = false; + options.closeCallBack && options.closeCallBack({ options, index, args }); - const closeDelay = options?.closeDelay ?? 200; - useTimeoutFn(() => { - dialogStore.value.splice(index, 1); - }, closeDelay); + const closeDelay = options?.closeDelay ?? 200; + useTimeoutFn(() => { + dialogStore.value.splice(index, 1); + }, closeDelay); }; /** @@ -35,13 +35,13 @@ const closeDialog = (options: DialogOptions, index: number, args?: any) => { * @param key 属性,默认`title` * @param index 弹框索引(默认`0`,代表只有一个弹框,对于嵌套弹框要改哪个弹框的属性值就把该弹框索引赋给`index`) */ -const updateDialog = (value: any, key = "title", index = 0) => { - dialogStore.value[index][key] = value; +const updateDialog = (value: any, key = 'title', index = 0) => { + dialogStore.value[index][key] = value; }; /** 关闭所有弹框 */ const closeAllDialog = () => { - dialogStore.value = []; + dialogStore.value = []; }; /** 千万别忘了在下面这三处引入并注册下,放心注册,不使用`addDialog`调用就不会被挂载 diff --git a/src/components/ReDialog/index.vue b/src/components/ReDialog/index.vue index b8eaf36..9991b76 100644 --- a/src/components/ReDialog/index.vue +++ b/src/components/ReDialog/index.vue @@ -1,138 +1,138 @@ diff --git a/src/components/ReDialog/type.ts b/src/components/ReDialog/type.ts index 95b3921..2802cf8 100644 --- a/src/components/ReDialog/type.ts +++ b/src/components/ReDialog/type.ts @@ -1,201 +1,201 @@ -import type { Component, CSSProperties, VNode } from "vue"; +import type { Component, CSSProperties, VNode } from 'vue'; type DoneFn = (cancel?: boolean) => void; -type EventType = "open" | "close" | "openAutoFocus" | "closeAutoFocus" | "fullscreenCallBack"; +type EventType = 'open' | 'close' | 'openAutoFocus' | 'closeAutoFocus' | 'fullscreenCallBack'; type ArgsType = { - /** `cancel` 点击取消按钮、`sure` 点击确定按钮、`close` 点击右上角关闭按钮或空白页或按下了esc键 */ - command: "cancel" | "sure" | "close"; + /** `cancel` 点击取消按钮、`sure` 点击确定按钮、`close` 点击右上角关闭按钮或空白页或按下了esc键 */ + command: 'cancel' | 'sure' | 'close'; }; -type ButtonType = "primary" | "success" | "warning" | "danger" | "info" | "text"; +type ButtonType = 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'; /** https://element-plus.org/zh-CN/component/dialog.html#attributes */ type DialogProps = { - /** `Dialog` 的显示与隐藏 */ - visible?: boolean; - /** `Dialog` 的标题 */ - title?: string; - /** `Dialog` 的宽度,默认 `50%` */ - width?: string | number; - /** 是否为全屏 `Dialog`(会一直处于全屏状态,除非弹框关闭),默认 `false`,`fullscreen` 和 `fullscreenIcon` 都传时只有 `fullscreen` 会生效 */ - fullscreen?: boolean; - /** 是否显示全屏操作图标,默认 `false`,`fullscreen` 和 `fullscreenIcon` 都传时只有 `fullscreen` 会生效 */ - fullscreenIcon?: boolean; - /** `Dialog CSS` 中的 `margin-top` 值,默认 `15vh` */ - top?: string; - /** 是否需要遮罩层,默认 `true` */ - modal?: boolean; - /** `Dialog` 自身是否插入至 `body` 元素上。嵌套的 `Dialog` 必须指定该属性并赋值为 `true`,默认 `false` */ - appendToBody?: boolean; - /** 是否在 `Dialog` 出现时将 `body` 滚动锁定,默认 `true` */ - lockScroll?: boolean; - /** `Dialog` 的自定义类名 */ - class?: string; - /** `Dialog` 的自定义样式 */ - style?: CSSProperties; - /** `Dialog` 打开的延时时间,单位毫秒,默认 `0` */ - openDelay?: number; - /** `Dialog` 关闭的延时时间,单位毫秒,默认 `0` */ - closeDelay?: number; - /** 是否可以通过点击 `modal` 关闭 `Dialog`,默认 `true` */ - closeOnClickModal?: boolean; - /** 是否可以通过按下 `ESC` 关闭 `Dialog`,默认 `true` */ - closeOnPressEscape?: boolean; - /** 是否显示关闭按钮,默认 `true` */ - showClose?: boolean; - /** 关闭前的回调,会暂停 `Dialog` 的关闭. 回调函数内执行 `done` 参数方法的时候才是真正关闭对话框的时候 */ - beforeClose?: (done: DoneFn) => void; - /** 为 `Dialog` 启用可拖拽功能,默认 `false` */ - draggable?: boolean; - /** 是否让 `Dialog` 的 `header` 和 `footer` 部分居中排列,默认 `false` */ - center?: boolean; - /** 是否水平垂直对齐对话框,默认 `false` */ - alignCenter?: boolean; - /** 当关闭 `Dialog` 时,销毁其中的元素,默认 `false` */ - destroyOnClose?: boolean; + /** `Dialog` 的显示与隐藏 */ + visible?: boolean; + /** `Dialog` 的标题 */ + title?: string; + /** `Dialog` 的宽度,默认 `50%` */ + width?: string | number; + /** 是否为全屏 `Dialog`(会一直处于全屏状态,除非弹框关闭),默认 `false`,`fullscreen` 和 `fullscreenIcon` 都传时只有 `fullscreen` 会生效 */ + fullscreen?: boolean; + /** 是否显示全屏操作图标,默认 `false`,`fullscreen` 和 `fullscreenIcon` 都传时只有 `fullscreen` 会生效 */ + fullscreenIcon?: boolean; + /** `Dialog CSS` 中的 `margin-top` 值,默认 `15vh` */ + top?: string; + /** 是否需要遮罩层,默认 `true` */ + modal?: boolean; + /** `Dialog` 自身是否插入至 `body` 元素上。嵌套的 `Dialog` 必须指定该属性并赋值为 `true`,默认 `false` */ + appendToBody?: boolean; + /** 是否在 `Dialog` 出现时将 `body` 滚动锁定,默认 `true` */ + lockScroll?: boolean; + /** `Dialog` 的自定义类名 */ + class?: string; + /** `Dialog` 的自定义样式 */ + style?: CSSProperties; + /** `Dialog` 打开的延时时间,单位毫秒,默认 `0` */ + openDelay?: number; + /** `Dialog` 关闭的延时时间,单位毫秒,默认 `0` */ + closeDelay?: number; + /** 是否可以通过点击 `modal` 关闭 `Dialog`,默认 `true` */ + closeOnClickModal?: boolean; + /** 是否可以通过按下 `ESC` 关闭 `Dialog`,默认 `true` */ + closeOnPressEscape?: boolean; + /** 是否显示关闭按钮,默认 `true` */ + showClose?: boolean; + /** 关闭前的回调,会暂停 `Dialog` 的关闭. 回调函数内执行 `done` 参数方法的时候才是真正关闭对话框的时候 */ + beforeClose?: (done: DoneFn) => void; + /** 为 `Dialog` 启用可拖拽功能,默认 `false` */ + draggable?: boolean; + /** 是否让 `Dialog` 的 `header` 和 `footer` 部分居中排列,默认 `false` */ + center?: boolean; + /** 是否水平垂直对齐对话框,默认 `false` */ + alignCenter?: boolean; + /** 当关闭 `Dialog` 时,销毁其中的元素,默认 `false` */ + destroyOnClose?: boolean; }; //element-plus.org/zh-CN/component/popconfirm.html#attributes type Popconfirm = { - /** 标题 */ - title?: string; - /** 确认按钮文字 */ - confirmButtonText?: string; - /** 取消按钮文字 */ - cancelButtonText?: string; - /** 确认按钮类型,默认 `primary` */ - confirmButtonType?: ButtonType; - /** 取消按钮类型,默认 `text` */ - cancelButtonType?: ButtonType; - /** 自定义图标,默认 `QuestionFilled` */ - icon?: string | Component; - /** `Icon` 颜色,默认 `#f90` */ - iconColor?: string; - /** 是否隐藏 `Icon`,默认 `false` */ - hideIcon?: boolean; - /** 关闭时的延迟,默认 `200` */ - hideAfter?: number; - /** 是否将 `popover` 的下拉列表插入至 `body` 元素,默认 `true` */ - teleported?: boolean; - /** 当 `popover` 组件长时间不触发且 `persistent` 属性设置为 `false` 时, `popover` 将会被删除,默认 `false` */ - persistent?: boolean; - /** 弹层宽度,最小宽度 `150px`,默认 `150` */ - width?: string | number; + /** 标题 */ + title?: string; + /** 确认按钮文字 */ + confirmButtonText?: string; + /** 取消按钮文字 */ + cancelButtonText?: string; + /** 确认按钮类型,默认 `primary` */ + confirmButtonType?: ButtonType; + /** 取消按钮类型,默认 `text` */ + cancelButtonType?: ButtonType; + /** 自定义图标,默认 `QuestionFilled` */ + icon?: string | Component; + /** `Icon` 颜色,默认 `#f90` */ + iconColor?: string; + /** 是否隐藏 `Icon`,默认 `false` */ + hideIcon?: boolean; + /** 关闭时的延迟,默认 `200` */ + hideAfter?: number; + /** 是否将 `popover` 的下拉列表插入至 `body` 元素,默认 `true` */ + teleported?: boolean; + /** 当 `popover` 组件长时间不触发且 `persistent` 属性设置为 `false` 时, `popover` 将会被删除,默认 `false` */ + persistent?: boolean; + /** 弹层宽度,最小宽度 `150px`,默认 `150` */ + width?: string | number; }; type BtnClickDialog = { - options?: DialogOptions; - index?: number; + options?: DialogOptions; + index?: number; }; type BtnClickButton = { - btn?: ButtonProps; - index?: number; + btn?: ButtonProps; + index?: number; }; /** https://element-plus.org/zh-CN/component/button.html#button-attributes */ type ButtonProps = { - /** 按钮文字 */ - label: string; - /** 按钮尺寸 */ - size?: "large" | "default" | "small"; - /** 按钮类型 */ - type?: "primary" | "success" | "warning" | "danger" | "info"; - /** 是否为朴素按钮,默认 `false` */ - plain?: boolean; - /** 是否为文字按钮,默认 `false` */ - text?: boolean; - /** 是否显示文字按钮背景颜色,默认 `false` */ - bg?: boolean; - /** 是否为链接按钮,默认 `false` */ - link?: boolean; - /** 是否为圆角按钮,默认 `false` */ - round?: boolean; - /** 是否为圆形按钮,默认 `false` */ - circle?: boolean; - /** 确认按钮的 `Popconfirm` 气泡确认框相关配置 */ - popconfirm?: Popconfirm; - /** 是否为加载中状态,默认 `false` */ - loading?: boolean; - /** 自定义加载中状态图标组件 */ - loadingIcon?: string | Component; - /** 按钮是否为禁用状态,默认 `false` */ - disabled?: boolean; - /** 图标组件 */ - icon?: string | Component; - /** 是否开启原生 `autofocus` 属性,默认 `false` */ - autofocus?: boolean; - /** 原生 `type` 属性,默认 `button` */ - nativeType?: "button" | "submit" | "reset"; - /** 自动在两个中文字符之间插入空格 */ - autoInsertSpace?: boolean; - /** 自定义按钮颜色, 并自动计算 `hover` 和 `active` 触发后的颜色 */ - color?: string; - /** `dark` 模式, 意味着自动设置 `color` 为 `dark` 模式的颜色,默认 `false` */ - dark?: boolean; - /** 自定义元素标签 */ - tag?: string | Component; - /** 点击按钮后触发的回调 */ - btnClick?: ({ - dialog, - button - }: { - /** 当前 `Dialog` 信息 */ - dialog: BtnClickDialog; - /** 当前 `button` 信息 */ - button: BtnClickButton; - }) => void; + /** 按钮文字 */ + label: string; + /** 按钮尺寸 */ + size?: 'large' | 'default' | 'small'; + /** 按钮类型 */ + type?: 'primary' | 'success' | 'warning' | 'danger' | 'info'; + /** 是否为朴素按钮,默认 `false` */ + plain?: boolean; + /** 是否为文字按钮,默认 `false` */ + text?: boolean; + /** 是否显示文字按钮背景颜色,默认 `false` */ + bg?: boolean; + /** 是否为链接按钮,默认 `false` */ + link?: boolean; + /** 是否为圆角按钮,默认 `false` */ + round?: boolean; + /** 是否为圆形按钮,默认 `false` */ + circle?: boolean; + /** 确认按钮的 `Popconfirm` 气泡确认框相关配置 */ + popconfirm?: Popconfirm; + /** 是否为加载中状态,默认 `false` */ + loading?: boolean; + /** 自定义加载中状态图标组件 */ + loadingIcon?: string | Component; + /** 按钮是否为禁用状态,默认 `false` */ + disabled?: boolean; + /** 图标组件 */ + icon?: string | Component; + /** 是否开启原生 `autofocus` 属性,默认 `false` */ + autofocus?: boolean; + /** 原生 `type` 属性,默认 `button` */ + nativeType?: 'button' | 'submit' | 'reset'; + /** 自动在两个中文字符之间插入空格 */ + autoInsertSpace?: boolean; + /** 自定义按钮颜色, 并自动计算 `hover` 和 `active` 触发后的颜色 */ + color?: string; + /** `dark` 模式, 意味着自动设置 `color` 为 `dark` 模式的颜色,默认 `false` */ + dark?: boolean; + /** 自定义元素标签 */ + tag?: string | Component; + /** 点击按钮后触发的回调 */ + btnClick?: ({ + dialog, + button, + }: { + /** 当前 `Dialog` 信息 */ + dialog: BtnClickDialog; + /** 当前 `button` 信息 */ + button: BtnClickButton; + }) => void; }; interface DialogOptions extends DialogProps { - /** 内容区组件的 `props`,可通过 `defineProps` 接收 */ - props?: any; - /** 是否隐藏 `Dialog` 按钮操作区的内容 */ - hideFooter?: boolean; - /** 确认按钮的 `Popconfirm` 气泡确认框相关配置 */ - popconfirm?: Popconfirm; - /** - * @description 自定义对话框标题的内容渲染器 - * @see {@link https://element-plus.org/zh-CN/component/dialog.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%A4%B4%E9%83%A8} - */ - headerRenderer?: ({ close, titleId, titleClass }: { close: Function; titleId: string; titleClass: string }) => VNode | Component; - /** 自定义内容渲染器 */ - contentRenderer?: ({ options, index }: { options: DialogOptions; index: number }) => VNode | Component; - /** 自定义按钮操作区的内容渲染器,会覆盖`footerButtons`以及默认的 `取消` 和 `确定` 按钮 */ - footerRenderer?: ({ options, index }: { options: DialogOptions; index: number }) => VNode | Component; - /** 自定义底部按钮操作 */ - footerButtons?: Array; - /** `Dialog` 打开后的回调 */ - open?: ({ options, index }: { options: DialogOptions; index: number }) => void; - /** `Dialog` 关闭后的回调(只有点击右上角关闭按钮或空白页或按下了esc键关闭页面时才会触发) */ - close?: ({ options, index }: { options: DialogOptions; index: number }) => void; - /** `Dialog` 关闭后的回调。 `args` 返回的 `command` 值解析:`cancel` 点击取消按钮、`sure` 点击确定按钮、`close` 点击右上角关闭按钮或空白页或按下了esc键 */ - closeCallBack?: ({ options, index, args }: { options: DialogOptions; index: number; args: any }) => void; - /** 点击全屏按钮时的回调 */ - fullscreenCallBack?: ({ options, index }: { options: DialogOptions; index: number }) => void; - /** 输入焦点聚焦在 `Dialog` 内容时的回调 */ - openAutoFocus?: ({ options, index }: { options: DialogOptions; index: number }) => void; - /** 输入焦点从 `Dialog` 内容失焦时的回调 */ - closeAutoFocus?: ({ options, index }: { options: DialogOptions; index: number }) => void; - /** 点击底部取消按钮的回调,会暂停 `Dialog` 的关闭. 回调函数内执行 `done` 参数方法的时候才是真正关闭对话框的时候 */ - beforeCancel?: ( - done: Function, - { - options, - index - }: { - options: DialogOptions; - index: number; - } - ) => void; - /** 点击底部确定按钮的回调,会暂停 `Dialog` 的关闭. 回调函数内执行 `done` 参数方法的时候才是真正关闭对话框的时候 */ - beforeSure?: ( - done: Function, - { - options, - index - }: { - options: DialogOptions; - index: number; - } - ) => void; + /** 内容区组件的 `props`,可通过 `defineProps` 接收 */ + props?: any; + /** 是否隐藏 `Dialog` 按钮操作区的内容 */ + hideFooter?: boolean; + /** 确认按钮的 `Popconfirm` 气泡确认框相关配置 */ + popconfirm?: Popconfirm; + /** + * @description 自定义对话框标题的内容渲染器 + * @see {@link https://element-plus.org/zh-CN/component/dialog.html#%E8%87%AA%E5%AE%9A%E4%B9%89%E5%A4%B4%E9%83%A8} + */ + headerRenderer?: ({ close, titleId, titleClass }: { close: Function; titleId: string; titleClass: string }) => VNode | Component; + /** 自定义内容渲染器 */ + contentRenderer?: ({ options, index }: { options: DialogOptions; index: number }) => VNode | Component; + /** 自定义按钮操作区的内容渲染器,会覆盖`footerButtons`以及默认的 `取消` 和 `确定` 按钮 */ + footerRenderer?: ({ options, index }: { options: DialogOptions; index: number }) => VNode | Component; + /** 自定义底部按钮操作 */ + footerButtons?: Array; + /** `Dialog` 打开后的回调 */ + open?: ({ options, index }: { options: DialogOptions; index: number }) => void; + /** `Dialog` 关闭后的回调(只有点击右上角关闭按钮或空白页或按下了esc键关闭页面时才会触发) */ + close?: ({ options, index }: { options: DialogOptions; index: number }) => void; + /** `Dialog` 关闭后的回调。 `args` 返回的 `command` 值解析:`cancel` 点击取消按钮、`sure` 点击确定按钮、`close` 点击右上角关闭按钮或空白页或按下了esc键 */ + closeCallBack?: ({ options, index, args }: { options: DialogOptions; index: number; args: any }) => void; + /** 点击全屏按钮时的回调 */ + fullscreenCallBack?: ({ options, index }: { options: DialogOptions; index: number }) => void; + /** 输入焦点聚焦在 `Dialog` 内容时的回调 */ + openAutoFocus?: ({ options, index }: { options: DialogOptions; index: number }) => void; + /** 输入焦点从 `Dialog` 内容失焦时的回调 */ + closeAutoFocus?: ({ options, index }: { options: DialogOptions; index: number }) => void; + /** 点击底部取消按钮的回调,会暂停 `Dialog` 的关闭. 回调函数内执行 `done` 参数方法的时候才是真正关闭对话框的时候 */ + beforeCancel?: ( + done: Function, + { + options, + index, + }: { + options: DialogOptions; + index: number; + }, + ) => void; + /** 点击底部确定按钮的回调,会暂停 `Dialog` 的关闭. 回调函数内执行 `done` 参数方法的时候才是真正关闭对话框的时候 */ + beforeSure?: ( + done: Function, + { + options, + index, + }: { + options: DialogOptions; + index: number; + }, + ) => void; } export type { EventType, ArgsType, DialogProps, ButtonProps, DialogOptions }; diff --git a/src/components/ReFlicker/index.css b/src/components/ReFlicker/index.css index 34d3d2c..1e3e72f 100644 --- a/src/components/ReFlicker/index.css +++ b/src/components/ReFlicker/index.css @@ -1,39 +1,39 @@ .point { - background: var(--point-background); - border-radius: var(--point-border-radius); - height: var(--point-height); - position: relative; - width: var(--point-width); + background: var(--point-background); + border-radius: var(--point-border-radius); + height: var(--point-height); + position: relative; + width: var(--point-width); } .point-flicker:after { - background: var(--point-background); + background: var(--point-background); } .point-flicker:before, .point-flicker:after { - animation: flicker 1.2s ease-out infinite; - border-radius: var(--point-border-radius); - content: ""; - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; + animation: flicker 1.2s ease-out infinite; + border-radius: var(--point-border-radius); + content: ""; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; } @keyframes flicker { - 0% { - transform: scale(0.5); - opacity: 1; - } + 0% { + transform: scale(0.5); + opacity: 1; + } - 30% { - opacity: 1; - } + 30% { + opacity: 1; + } - 100% { - transform: scale(var(--point-scale)); - opacity: 0; - } + 100% { + transform: scale(var(--point-scale)); + opacity: 0; + } } diff --git a/src/components/ReFlicker/index.ts b/src/components/ReFlicker/index.ts index 671e502..22f5e89 100644 --- a/src/components/ReFlicker/index.ts +++ b/src/components/ReFlicker/index.ts @@ -1,12 +1,12 @@ -import "./index.css"; -import { type Component, defineComponent, h } from "vue"; +import './index.css'; +import { type Component, defineComponent, h } from 'vue'; export interface attrsType { - width?: string; - height?: string; - borderRadius?: number | string; - background?: string; - scale?: number | string; + width?: string; + height?: string; + borderRadius?: number | string; + background?: string; + scale?: number | string; } /** @@ -19,25 +19,25 @@ export interface attrsType { * @returns Component */ export function useRenderFlicker(attrs?: attrsType): Component { - return defineComponent({ - name: "ReFlicker", - render() { - return h( - "div", - { - class: "point point-flicker", - style: { - "--point-width": attrs?.width ?? "12px", - "--point-height": attrs?.height ?? "12px", - "--point-background": attrs?.background ?? "var(--el-color-primary)", - "--point-border-radius": attrs?.borderRadius ?? "50%", - "--point-scale": attrs?.scale ?? "2" - } - }, - { - default: () => [] - } - ); - } - }); + return defineComponent({ + name: 'ReFlicker', + render() { + return h( + 'div', + { + class: 'point point-flicker', + style: { + '--point-width': attrs?.width ?? '12px', + '--point-height': attrs?.height ?? '12px', + '--point-background': attrs?.background ?? 'var(--el-color-primary)', + '--point-border-radius': attrs?.borderRadius ?? '50%', + '--point-scale': attrs?.scale ?? '2', + }, + }, + { + default: () => [], + }, + ); + }, + }); } diff --git a/src/components/ReFlop/index.ts b/src/components/ReFlop/index.ts index 7c9428a..44b49df 100644 --- a/src/components/ReFlop/index.ts +++ b/src/components/ReFlop/index.ts @@ -1,5 +1,5 @@ -import reFlop from "./src/index.vue"; -import { withInstall } from "@pureadmin/utils"; +import reFlop from './src/index.vue'; +import { withInstall } from '@pureadmin/utils'; /** 时间翻牌组件 */ export const ReFlop = withInstall(reFlop); diff --git a/src/components/ReFlop/src/filpper.css b/src/components/ReFlop/src/filpper.css index 8a7239a..610f4ad 100644 --- a/src/components/ReFlop/src/filpper.css +++ b/src/components/ReFlop/src/filpper.css @@ -1,184 +1,184 @@ .m-flipper { - background: #fff; - border: solid 1px #000; - border-radius: 10px; - box-shadow: 0 0 6px rgb(0 0 0 / 50%); - color: #fff; - display: inline-block; - font-family: "Helvetica Neue"; - font-size: 66px; - height: 100px; - line-height: 100px; - position: relative; - text-align: center; - width: 60px; + background: #fff; + border: solid 1px #000; + border-radius: 10px; + box-shadow: 0 0 6px rgb(0 0 0 / 50%); + color: #fff; + display: inline-block; + font-family: "Helvetica Neue"; + font-size: 66px; + height: 100px; + line-height: 100px; + position: relative; + text-align: center; + width: 60px; } .m-flipper .digital::before, .m-flipper .digital::after { - background: #000; - box-sizing: border-box; - content: ""; - left: 0; - overflow: hidden; - position: absolute; - right: 0; + background: #000; + box-sizing: border-box; + content: ""; + left: 0; + overflow: hidden; + position: absolute; + right: 0; } .m-flipper .digital::before { - border-bottom: solid 1px #666; - border-radius: 10px 10px 0 0; - bottom: 50%; - top: 0; + border-bottom: solid 1px #666; + border-radius: 10px 10px 0 0; + bottom: 50%; + top: 0; } .m-flipper .digital::after { - border-radius: 0 0 10px 10px; - bottom: 0; - line-height: 0; - top: 50%; + border-radius: 0 0 10px 10px; + bottom: 0; + line-height: 0; + top: 50%; } /* 向下翻 */ .m-flipper.down .front::before { - z-index: 3; + z-index: 3; } .m-flipper.down .back::after { - transform: perspective(160px) rotateX(180deg); - transform-origin: 50% 0%; - z-index: 2; + transform: perspective(160px) rotateX(180deg); + transform-origin: 50% 0%; + z-index: 2; } .m-flipper.down .front::after, .m-flipper.down .back::before { - z-index: 1; + z-index: 1; } .m-flipper.down.go .front::before { - animation: frontFlipDown 0.6s ease-in-out both; - backface-visibility: hidden; - box-shadow: 0 -2px 6px rgb(255 255 255 / 30%); - transform-origin: 50% 100%; + animation: frontFlipDown 0.6s ease-in-out both; + backface-visibility: hidden; + box-shadow: 0 -2px 6px rgb(255 255 255 / 30%); + transform-origin: 50% 100%; } .m-flipper.down.go .back::after { - animation: backFlipDown 0.6s ease-in-out both; + animation: backFlipDown 0.6s ease-in-out both; } /* 向上翻 */ .m-flipper.up .front::after { - z-index: 3; + z-index: 3; } .m-flipper.up .back::before { - transform: perspective(160px) rotateX(-180deg); - transform-origin: 50% 100%; - z-index: 2; + transform: perspective(160px) rotateX(-180deg); + transform-origin: 50% 100%; + z-index: 2; } .m-flipper.up .front::before, .m-flipper.up .back::after { - z-index: 1; + z-index: 1; } .m-flipper.up.go .front::after { - animation: frontFlipUp 0.6s ease-in-out both; - backface-visibility: hidden; - box-shadow: 0 2px 6px rgb(255 255 255 / 30%); - transform-origin: 50% 0; + animation: frontFlipUp 0.6s ease-in-out both; + backface-visibility: hidden; + box-shadow: 0 2px 6px rgb(255 255 255 / 30%); + transform-origin: 50% 0; } .m-flipper.up.go .back::before { - animation: backFlipUp 0.6s ease-in-out both; + animation: backFlipUp 0.6s ease-in-out both; } @keyframes frontFlipDown { - 0% { - transform: perspective(160px) rotateX(0deg); - } + 0% { + transform: perspective(160px) rotateX(0deg); + } - 100% { - transform: perspective(160px) rotateX(-180deg); - } + 100% { + transform: perspective(160px) rotateX(-180deg); + } } @keyframes backFlipDown { - 0% { - transform: perspective(160px) rotateX(180deg); - } + 0% { + transform: perspective(160px) rotateX(180deg); + } - 100% { - transform: perspective(160px) rotateX(0deg); - } + 100% { + transform: perspective(160px) rotateX(0deg); + } } @keyframes frontFlipUp { - 0% { - transform: perspective(160px) rotateX(0deg); - } + 0% { + transform: perspective(160px) rotateX(0deg); + } - 100% { - transform: perspective(160px) rotateX(180deg); - } + 100% { + transform: perspective(160px) rotateX(180deg); + } } @keyframes backFlipUp { - 0% { - transform: perspective(160px) rotateX(-180deg); - } + 0% { + transform: perspective(160px) rotateX(-180deg); + } - 100% { - transform: perspective(160px) rotateX(0deg); - } + 100% { + transform: perspective(160px) rotateX(0deg); + } } .m-flipper .number0::before, .m-flipper .number0::after { - content: "0"; + content: "0"; } .m-flipper .number1::before, .m-flipper .number1::after { - content: "1"; + content: "1"; } .m-flipper .number2::before, .m-flipper .number2::after { - content: "2"; + content: "2"; } .m-flipper .number3::before, .m-flipper .number3::after { - content: "3"; + content: "3"; } .m-flipper .number4::before, .m-flipper .number4::after { - content: "4"; + content: "4"; } .m-flipper .number5::before, .m-flipper .number5::after { - content: "5"; + content: "5"; } .m-flipper .number6::before, .m-flipper .number6::after { - content: "6"; + content: "6"; } .m-flipper .number7::before, .m-flipper .number7::after { - content: "7"; + content: "7"; } .m-flipper .number8::before, .m-flipper .number8::after { - content: "8"; + content: "8"; } .m-flipper .number9::before, .m-flipper .number9::after { - content: "9"; + content: "9"; } diff --git a/src/components/ReFlop/src/filpper.tsx b/src/components/ReFlop/src/filpper.tsx index 4519c91..9cded1d 100644 --- a/src/components/ReFlop/src/filpper.tsx +++ b/src/components/ReFlop/src/filpper.tsx @@ -1,92 +1,92 @@ -import "./filpper.css"; -import propTypes from "@/utils/propTypes"; -import { defineComponent, ref } from "vue"; +import './filpper.css'; +import propTypes from '@/utils/propTypes'; +import { defineComponent, ref } from 'vue'; const props = { - // front paper text - // 前牌文字 - frontText: propTypes.number.def(0), - // back paper text - // 后牌文字 - backText: propTypes.number.def(1), - // flipping duration, please be consistent with the CSS animation-duration value. - // 翻牌动画时间,与CSS中设置的animation-duration保持一致 - duration: propTypes.number.def(600) + // front paper text + // 前牌文字 + frontText: propTypes.number.def(0), + // back paper text + // 后牌文字 + backText: propTypes.number.def(1), + // flipping duration, please be consistent with the CSS animation-duration value. + // 翻牌动画时间,与CSS中设置的animation-duration保持一致 + duration: propTypes.number.def(600), }; export default defineComponent({ - name: "ReFlop", - props, - setup(props) { - const { frontText, backText, duration } = props; - const isFlipping = ref(false); - const flipType = ref("down"); - const frontTextFromData = ref(frontText); - const backTextFromData = ref(backText); + name: 'ReFlop', + props, + setup(props) { + const { frontText, backText, duration } = props; + const isFlipping = ref(false); + const flipType = ref('down'); + const frontTextFromData = ref(frontText); + const backTextFromData = ref(backText); - const textClass = (number: number) => { - return "number" + number; - }; + const textClass = (number: number) => { + return 'number' + number; + }; - const flip = (type: string, front: number, back: number) => { - // 如果处于翻转中,则不执行 - if (isFlipping.value) return false; - frontTextFromData.value = front; - backTextFromData.value = back; - // 根据传递过来的type设置翻转方向 - flipType.value = type; - // 设置翻转状态为true - isFlipping.value = true; + const flip = (type: string, front: number, back: number) => { + // 如果处于翻转中,则不执行 + if (isFlipping.value) return false; + frontTextFromData.value = front; + backTextFromData.value = back; + // 根据传递过来的type设置翻转方向 + flipType.value = type; + // 设置翻转状态为true + isFlipping.value = true; - setTimeout(() => { - // 设置翻转状态为false - isFlipping.value = false; - frontTextFromData.value = back; - }, duration); - }; + setTimeout(() => { + // 设置翻转状态为false + isFlipping.value = false; + frontTextFromData.value = back; + }, duration); + }; - // 下翻牌 - const flipDown = (front: any, back: any): void => { - flip("down", front, back); - }; + // 下翻牌 + const flipDown = (front: any, back: any): void => { + flip('down', front, back); + }; - // 上翻牌 - const flipUp = (front: any, back: any): void => { - flip("up", front, back); - }; + // 上翻牌 + const flipUp = (front: any, back: any): void => { + flip('up', front, back); + }; - // 设置前牌文字 - function setFront(text: number): void { - frontTextFromData.value = text; - } + // 设置前牌文字 + function setFront(text: number): void { + frontTextFromData.value = text; + } - // 设置后牌文字 - const setBack = (text: number): void => { - backTextFromData.value = text; - }; + // 设置后牌文字 + const setBack = (text: number): void => { + backTextFromData.value = text; + }; - return { - flipType, - isFlipping, - frontTextFromData, - backTextFromData, - textClass, - flipDown, - flipUp, - setFront, - setBack - }; - }, + return { + flipType, + isFlipping, + frontTextFromData, + backTextFromData, + textClass, + flipDown, + flipUp, + setFront, + setBack, + }; + }, - render() { - const main = `m-flipper ${this.flipType} ${this.isFlipping ? "go" : ""}`; - const front = `digital front ${this.textClass(this.frontTextFromData)}`; - const back = `digital back ${this.textClass(this.backTextFromData)}`; - return ( -
-
-
-
- ); - } + render() { + const main = `m-flipper ${this.flipType} ${this.isFlipping ? 'go' : ''}`; + const front = `digital front ${this.textClass(this.frontTextFromData)}`; + const back = `digital back ${this.textClass(this.backTextFromData)}`; + return ( +
+
+
+
+ ); + }, }); diff --git a/src/components/ReFlop/src/index.vue b/src/components/ReFlop/src/index.vue index 8858c0e..f764e16 100644 --- a/src/components/ReFlop/src/index.vue +++ b/src/components/ReFlop/src/index.vue @@ -1,9 +1,9 @@ diff --git a/src/components/ReFlowChart/index.ts b/src/components/ReFlowChart/index.ts index 0af0e0e..b3c9d18 100644 --- a/src/components/ReFlowChart/index.ts +++ b/src/components/ReFlowChart/index.ts @@ -1,7 +1,7 @@ -import control from "./src/Control.vue"; -import nodePanel from "./src/NodePanel.vue"; -import dataDialog from "./src/DataDialog.vue"; -import { withInstall } from "@pureadmin/utils"; +import control from './src/Control.vue'; +import nodePanel from './src/NodePanel.vue'; +import dataDialog from './src/DataDialog.vue'; +import { withInstall } from '@pureadmin/utils'; /** LogicFlow流程图-控制面板 */ const Control = withInstall(control); diff --git a/src/components/ReFlowChart/src/Control.vue b/src/components/ReFlowChart/src/Control.vue index e0f46fb..25f840d 100644 --- a/src/components/ReFlowChart/src/Control.vue +++ b/src/components/ReFlowChart/src/Control.vue @@ -1,18 +1,18 @@ - diff --git a/src/components/ReFlowChart/src/DataDialog.vue b/src/components/ReFlowChart/src/DataDialog.vue index 5740527..a044030 100644 --- a/src/components/ReFlowChart/src/DataDialog.vue +++ b/src/components/ReFlowChart/src/DataDialog.vue @@ -1,17 +1,12 @@ - diff --git a/src/components/ReFlowChart/src/NodePanel.vue b/src/components/ReFlowChart/src/NodePanel.vue index 53d0d5c..35a6f33 100644 --- a/src/components/ReFlowChart/src/NodePanel.vue +++ b/src/components/ReFlowChart/src/NodePanel.vue @@ -1,154 +1,146 @@ - diff --git a/src/components/ReFlowChart/src/adpterForTurbo.ts b/src/components/ReFlowChart/src/adpterForTurbo.ts index d3948b7..fa26348 100644 --- a/src/components/ReFlowChart/src/adpterForTurbo.ts +++ b/src/components/ReFlowChart/src/adpterForTurbo.ts @@ -1,166 +1,150 @@ const TurboType = { - SEQUENCE_FLOW: 1, - START_EVENT: 2, - END_EVENT: 3, - USER_TASK: 4, - SERVICE_TASK: 5, - EXCLUSIVE_GATEWAY: 6 + SEQUENCE_FLOW: 1, + START_EVENT: 2, + END_EVENT: 3, + USER_TASK: 4, + SERVICE_TASK: 5, + EXCLUSIVE_GATEWAY: 6, }; function getTurboType(type) { - switch (type) { - case "bpmn:sequenceFlow": - return TurboType.SEQUENCE_FLOW; - case "bpmn:startEvent": - return TurboType.START_EVENT; - case "bpmn:endEvent": - return TurboType.END_EVENT; - case "bpmn:userTask": - return TurboType.USER_TASK; - case "bpmn:serviceTask": - return TurboType.SERVICE_TASK; - case "bpmn:exclusiveGateway": - return TurboType.EXCLUSIVE_GATEWAY; - default: - return type; - } + switch (type) { + case 'bpmn:sequenceFlow': + return TurboType.SEQUENCE_FLOW; + case 'bpmn:startEvent': + return TurboType.START_EVENT; + case 'bpmn:endEvent': + return TurboType.END_EVENT; + case 'bpmn:userTask': + return TurboType.USER_TASK; + case 'bpmn:serviceTask': + return TurboType.SERVICE_TASK; + case 'bpmn:exclusiveGateway': + return TurboType.EXCLUSIVE_GATEWAY; + default: + return type; + } } function convertNodeToTurboElement(node) { - const { id, type, x, y, text = "", properties } = node; - return { - incoming: [], - outgoing: [], - dockers: [], - type: getTurboType(node.type), - properties: { - ...properties, - name: (text && text.value) || "", - x: x, - y: y, - text, - logicFlowType: type - }, - key: id - }; + const { id, type, x, y, text = '', properties } = node; + return { + incoming: [], + outgoing: [], + dockers: [], + type: getTurboType(node.type), + properties: { + ...properties, + name: (text && text.value) || '', + x: x, + y: y, + text, + logicFlowType: type, + }, + key: id, + }; } function convertEdgeToTurboElement(edge) { - const { - id, - type, - sourceNodeId, - targetNodeId, - startPoint, - endPoint, - pointsList, - text = "", - properties - } = edge; - return { - incoming: [sourceNodeId], - outgoing: [targetNodeId], - type: getTurboType(type), - dockers: [], - properties: { - ...properties, - name: (text && text.value) || "", - text, - startPoint, - endPoint, - pointsList, - logicFlowType: type - }, - key: id - }; + const { id, type, sourceNodeId, targetNodeId, startPoint, endPoint, pointsList, text = '', properties } = edge; + return { + incoming: [sourceNodeId], + outgoing: [targetNodeId], + type: getTurboType(type), + dockers: [], + properties: { + ...properties, + name: (text && text.value) || '', + text, + startPoint, + endPoint, + pointsList, + logicFlowType: type, + }, + key: id, + }; } export function toTurboData(data) { - const nodeMap = new Map(); - const turboData = { - flowElementList: [] - }; - data.nodes.forEach(node => { - const flowElement = convertNodeToTurboElement(node); - turboData.flowElementList.push(flowElement); - nodeMap.set(node.id, flowElement); - }); - data.edges.forEach(edge => { - const flowElement = convertEdgeToTurboElement(edge); - const sourceElement = nodeMap.get(edge.sourceNodeId); - sourceElement.outgoing.push(flowElement.key); - const targetElement = nodeMap.get(edge.targetNodeId); - targetElement.incoming.push(flowElement.key); - turboData.flowElementList.push(flowElement); - }); - return turboData; + const nodeMap = new Map(); + const turboData = { + flowElementList: [], + }; + data.nodes.forEach(node => { + const flowElement = convertNodeToTurboElement(node); + turboData.flowElementList.push(flowElement); + nodeMap.set(node.id, flowElement); + }); + data.edges.forEach(edge => { + const flowElement = convertEdgeToTurboElement(edge); + const sourceElement = nodeMap.get(edge.sourceNodeId); + sourceElement.outgoing.push(flowElement.key); + const targetElement = nodeMap.get(edge.targetNodeId); + targetElement.incoming.push(flowElement.key); + turboData.flowElementList.push(flowElement); + }); + return turboData; } function convertFlowElementToEdge(element) { - const { incoming, outgoing, properties, key } = element; - const { text, startPoint, endPoint, pointsList, logicFlowType } = properties; - const edge = { - id: key, - type: logicFlowType, - sourceNodeId: incoming[0], - targetNodeId: outgoing[0], - text, - startPoint, - endPoint, - pointsList, - properties: {} - }; - const excludeProperties = [ - "startPoint", - "endPoint", - "pointsList", - "text", - "logicFlowType" - ]; - Object.keys(element.properties).forEach(property => { - if (excludeProperties.indexOf(property) === -1) { - edge.properties[property] = element.properties[property]; - } - }); - return edge; + const { incoming, outgoing, properties, key } = element; + const { text, startPoint, endPoint, pointsList, logicFlowType } = properties; + const edge = { + id: key, + type: logicFlowType, + sourceNodeId: incoming[0], + targetNodeId: outgoing[0], + text, + startPoint, + endPoint, + pointsList, + properties: {}, + }; + const excludeProperties = ['startPoint', 'endPoint', 'pointsList', 'text', 'logicFlowType']; + Object.keys(element.properties).forEach(property => { + if (excludeProperties.indexOf(property) === -1) { + edge.properties[property] = element.properties[property]; + } + }); + return edge; } function convertFlowElementToNode(element) { - const { properties, key } = element; - const { x, y, text, logicFlowType } = properties; - const node = { - id: key, - type: logicFlowType, - x, - y, - text, - properties: {} - }; - const excludeProperties = ["x", "y", "text", "logicFlowType"]; - Object.keys(element.properties).forEach(property => { - if (excludeProperties.indexOf(property) === -1) { - node.properties[property] = element.properties[property]; - } - }); - return node; + const { properties, key } = element; + const { x, y, text, logicFlowType } = properties; + const node = { + id: key, + type: logicFlowType, + x, + y, + text, + properties: {}, + }; + const excludeProperties = ['x', 'y', 'text', 'logicFlowType']; + Object.keys(element.properties).forEach(property => { + if (excludeProperties.indexOf(property) === -1) { + node.properties[property] = element.properties[property]; + } + }); + return node; } export function toLogicflowData(data) { - const lfData = { - nodes: [], - edges: [] - }; - const list = data.flowElementList; - list && - list.length > 0 && - list.forEach(element => { - if (element.type === TurboType.SEQUENCE_FLOW) { - const edge = convertFlowElementToEdge(element); - lfData.edges.push(edge); - } else { - const node = convertFlowElementToNode(element); - lfData.nodes.push(node); - } - }); - return lfData; + const lfData = { + nodes: [], + edges: [], + }; + const list = data.flowElementList; + list && + list.length > 0 && + list.forEach(element => { + if (element.type === TurboType.SEQUENCE_FLOW) { + const edge = convertFlowElementToEdge(element); + lfData.edges.push(edge); + } else { + const node = convertFlowElementToNode(element); + lfData.nodes.push(node); + } + }); + return lfData; } diff --git a/src/components/ReFlowChart/src/assets/iconfont/iconfont.css b/src/components/ReFlowChart/src/assets/iconfont/iconfont.css index 2f47d92..5674cbf 100644 --- a/src/components/ReFlowChart/src/assets/iconfont/iconfont.css +++ b/src/components/ReFlowChart/src/assets/iconfont/iconfont.css @@ -1,15 +1,11 @@ @font-face { font-family: "iconfont"; src: url("iconfont.eot?t=1618544337340"); /* IE9 */ - src: - url("iconfont.eot?t=1618544337340#iefix") format("embedded-opentype"), - /* IE6-IE8 */ - url("data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAZ0AAsAAAAADKgAAAYmAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDZAqLQIldATYCJAMgCxIABCAFhG0HgQkb6ApRlA9Sk+xngd1wXQyjTXRCW7pkEvLB0N9/pZhyo7nvIIK1Nisnipg3omjUREiURDXNNEL/jDRCI5H/riTu/9q0D5OakT05VaM3E4kMJI2QhanZillesmYnVT0pD5+399suTrCEkjDhqLtAxyURhIU6Ser/1tp8aDPgI2g7ex2ah+Q7i0rI+Gy9rSNYOtEEdPFQVkrlj/1c3oZFk6Sv/bYQqWUunsgkk8QRkrgkCJEKpUcO8zx0cFLQr+x6CEiNi0BN2YWV4MwJhmDEqhdU4BwR8oIOEXPCjGMzcoKDuLmnLwLw6vy9vMCFM6ggIW50umRpIbVW14U29L/QmIZgqDs5cD0JDKwCHFIylReQ51yFpO+XKBwDcjHltbq9801mxdeFzX8inbguoAq1yCWzpH95JuRUJIC0EDPH5nNGtIkkA4GgvROBocpEEKLCCBwVj0BRF/CJHFYhEo9WCbF1TCdgEEgF0A0Ee8NxioIeN97QzQqFMd2tdfIJC3KeK0T3eJYu0J07g6BVbCB0IiDVDNsQ1mFcbNxDCTk6IWEb2ShHfHxUlvAjkfj0mHDhC56GAL4CWMUgQXgEywDxuH0TBAD7gDZuRqtx7KWpnyTbushlJUpytdfnUvoS/pXG880npIYe3wueUdIJoa9HlRgdsYiF5QJv8C2zjIbzXERGQmwH0QylmjJfC4evBB8UUKQZMsAMG2aWMU6nc6s9m7X4Thn0gTfomgnm5d0qwX4v0rQH3GZn4Ajp8F2VeUcTTARpA+FfyLcpc+T05bOemT2fny8EH8Vn4LPFh3htyOtB3jDSJj34IpEQ3HNboUdasWNDQifcA8BfPPkTe6YaWp0nF/IrhQHGW2D5HTO7O2zfTH3+gxip/NioTs9VwUXL7T3AbzTxHa3qSu1e4EZTfZl/QiC2c7UI5jZ/ET938pSH8Z8IPBwU0NopeLgB7h6Kvp0GVCOw72KAjKFA71sPKX7/9g+Js/AmNfj8/o28sqNVdSTVI93p08F3v/75zqw8W79vb0RVaCTrw6aNntrQwCtbzzDKosTRFMjp/WFqtpZUEGxsi6P8L09byvlyrrvUJ6/ZFJR/X32mbUmndlduWjbdnwnY2ZBHo8OIKIVDUJah62hi4aKdSoqZsWypN7d0w6nsAzb12tWrqZOl12+W/W7YyLFxDy/7U369cgFF85PUVevYahz8y/HS9ZGrbv7saR0sn5MfEzhinC2Dizcv5xHycyChG33pcskigbRkvXnDaurRjRuIeDdu4rnSgPQ/L196FHQg6FGs7266c82aTtDT1jU0CqzWoG2Ndf91wRo1g/0wo9b4VPtV+2iwl/fjvxq4f83CBZeYgx6njp8mb7jzou9FfPdwBBpffvyUx6XARoc/1umGwtrl034lryLH/YCEwly/XrrckYHsd+/YWY/u3EGI085rV6RD5+Bw7dqnoAvBjzifw3S3zdaNZL/dRnfz7XZup232DX4VtD6Cn+AzkqFgBq6unr/gwtCDuydN51fk76ocHS/nN25Y/WqMe1fzBRgEQHPEjqE0gIbkR1CKM/zYUukn9ItRVMHwLfuO1kaP2mlUivpAUpbb8f5wZS1eib+cs3/qlD9r8DU2NEccqhPVFos3SRGSKtb4hyJEcX6VZhArj8Y+edgVpHICKD9tt8ddsvuYpNLZfQGoyBiY2CzKm1chkFmHUGwbUityTs70kCCSE2DZZADRaSeo0heYTpdQ3vwIAv0+QagzEKTOQnnOzHzoXTMkrCJYy6q7Wb1GNPO6hLi6keVYaDeqpDDFGarGkqy3sLFRMXFPDjZjqYsD5A6BI4RneUk0sdlwM2w0iqxFEtuwhkTpCLHER0fzWQ+I0ogmcLVPgqkQmBZLrdvC1tMQmfGTE66J3y+HCdoZqUgFBd/Y1TCJTL92VqwoMRVQOUxzpYJTiZd1EHAIyXmskS4RmbCySY4ZpVPEsmRv1QbTIKLoGtgt4kVTI74qM2p4tulMzwFS4qPiUDFxCSSUSGJJKJd2ozFS1kgYmyN1snOnimh0brybVuw0G0WV9iF3xeYjFAg4LcEi4Q692C7TUI8omiJRZAN3M+4ikTLBlosAAAA=") - format("woff2"), - url("iconfont.woff?t=1618544337340") format("woff"), - url("iconfont.ttf?t=1618544337340") format("truetype"), - /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ - url("iconfont.svg?t=1618544337340#iconfont") format("svg"); /* iOS 4.1- */ + src: url("iconfont.eot?t=1618544337340#iefix") format("embedded-opentype"), + /* IE6-IE8 */ url("data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAZ0AAsAAAAADKgAAAYmAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCDZAqLQIldATYCJAMgCxIABCAFhG0HgQkb6ApRlA9Sk+xngd1wXQyjTXRCW7pkEvLB0N9/pZhyo7nvIIK1Nisnipg3omjUREiURDXNNEL/jDRCI5H/riTu/9q0D5OakT05VaM3E4kMJI2QhanZillesmYnVT0pD5+399suTrCEkjDhqLtAxyURhIU6Ser/1tp8aDPgI2g7ex2ah+Q7i0rI+Gy9rSNYOtEEdPFQVkrlj/1c3oZFk6Sv/bYQqWUunsgkk8QRkrgkCJEKpUcO8zx0cFLQr+x6CEiNi0BN2YWV4MwJhmDEqhdU4BwR8oIOEXPCjGMzcoKDuLmnLwLw6vy9vMCFM6ggIW50umRpIbVW14U29L/QmIZgqDs5cD0JDKwCHFIylReQ51yFpO+XKBwDcjHltbq9801mxdeFzX8inbguoAq1yCWzpH95JuRUJIC0EDPH5nNGtIkkA4GgvROBocpEEKLCCBwVj0BRF/CJHFYhEo9WCbF1TCdgEEgF0A0Ee8NxioIeN97QzQqFMd2tdfIJC3KeK0T3eJYu0J07g6BVbCB0IiDVDNsQ1mFcbNxDCTk6IWEb2ShHfHxUlvAjkfj0mHDhC56GAL4CWMUgQXgEywDxuH0TBAD7gDZuRqtx7KWpnyTbushlJUpytdfnUvoS/pXG880npIYe3wueUdIJoa9HlRgdsYiF5QJv8C2zjIbzXERGQmwH0QylmjJfC4evBB8UUKQZMsAMG2aWMU6nc6s9m7X4Thn0gTfomgnm5d0qwX4v0rQH3GZn4Ajp8F2VeUcTTARpA+FfyLcpc+T05bOemT2fny8EH8Vn4LPFh3htyOtB3jDSJj34IpEQ3HNboUdasWNDQifcA8BfPPkTe6YaWp0nF/IrhQHGW2D5HTO7O2zfTH3+gxip/NioTs9VwUXL7T3AbzTxHa3qSu1e4EZTfZl/QiC2c7UI5jZ/ET938pSH8Z8IPBwU0NopeLgB7h6Kvp0GVCOw72KAjKFA71sPKX7/9g+Js/AmNfj8/o28sqNVdSTVI93p08F3v/75zqw8W79vb0RVaCTrw6aNntrQwCtbzzDKosTRFMjp/WFqtpZUEGxsi6P8L09byvlyrrvUJ6/ZFJR/X32mbUmndlduWjbdnwnY2ZBHo8OIKIVDUJah62hi4aKdSoqZsWypN7d0w6nsAzb12tWrqZOl12+W/W7YyLFxDy/7U369cgFF85PUVevYahz8y/HS9ZGrbv7saR0sn5MfEzhinC2Dizcv5xHycyChG33pcskigbRkvXnDaurRjRuIeDdu4rnSgPQ/L196FHQg6FGs7266c82aTtDT1jU0CqzWoG2Ndf91wRo1g/0wo9b4VPtV+2iwl/fjvxq4f83CBZeYgx6njp8mb7jzou9FfPdwBBpffvyUx6XARoc/1umGwtrl034lryLH/YCEwly/XrrckYHsd+/YWY/u3EGI085rV6RD5+Bw7dqnoAvBjzifw3S3zdaNZL/dRnfz7XZup232DX4VtD6Cn+AzkqFgBq6unr/gwtCDuydN51fk76ocHS/nN25Y/WqMe1fzBRgEQHPEjqE0gIbkR1CKM/zYUukn9ItRVMHwLfuO1kaP2mlUivpAUpbb8f5wZS1eib+cs3/qlD9r8DU2NEccqhPVFos3SRGSKtb4hyJEcX6VZhArj8Y+edgVpHICKD9tt8ddsvuYpNLZfQGoyBiY2CzKm1chkFmHUGwbUityTs70kCCSE2DZZADRaSeo0heYTpdQ3vwIAv0+QagzEKTOQnnOzHzoXTMkrCJYy6q7Wb1GNPO6hLi6keVYaDeqpDDFGarGkqy3sLFRMXFPDjZjqYsD5A6BI4RneUk0sdlwM2w0iqxFEtuwhkTpCLHER0fzWQ+I0ogmcLVPgqkQmBZLrdvC1tMQmfGTE66J3y+HCdoZqUgFBd/Y1TCJTL92VqwoMRVQOUxzpYJTiZd1EHAIyXmskS4RmbCySY4ZpVPEsmRv1QbTIKLoGtgt4kVTI74qM2p4tulMzwFS4qPiUDFxCSSUSGJJKJd2ozFS1kgYmyN1snOnimh0brybVuw0G0WV9iF3xeYjFAg4LcEi4Q692C7TUI8omiJRZAN3M+4ikTLBlosAAAA=") format("woff2"), + url("iconfont.woff?t=1618544337340") format("woff"), + url("iconfont.ttf?t=1618544337340") format("truetype"), + /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ url("iconfont.svg?t=1618544337340#iconfont") format("svg"); /* iOS 4.1- */ } .iconfont { diff --git a/src/components/ReFlowChart/src/config.ts b/src/components/ReFlowChart/src/config.ts index 810431a..ec5d3ed 100644 --- a/src/components/ReFlowChart/src/config.ts +++ b/src/components/ReFlowChart/src/config.ts @@ -1,55 +1,55 @@ export const nodeList = [ - { - text: "开始", - type: "start", - class: "node-start" - }, - { - text: "矩形", - type: "rect", - class: "node-rect" - }, - { - type: "user", - text: "用户", - class: "node-user" - }, - { - type: "push", - text: "推送", - class: "node-push" - }, - { - type: "download", - text: "位置", - class: "node-download" - }, - { - type: "end", - text: "结束", - class: "node-end" - } + { + text: '开始', + type: 'start', + class: 'node-start', + }, + { + text: '矩形', + type: 'rect', + class: 'node-rect', + }, + { + type: 'user', + text: '用户', + class: 'node-user', + }, + { + type: 'push', + text: '推送', + class: 'node-push', + }, + { + type: 'download', + text: '位置', + class: 'node-download', + }, + { + type: 'end', + text: '结束', + class: 'node-end', + }, ]; export const BpmnNode = [ - { - type: "bpmn:startEvent", - text: "开始", - class: "bpmn-start" - }, - { - type: "bpmn:endEvent", - text: "结束", - class: "bpmn-end" - }, - { - type: "bpmn:exclusiveGateway", - text: "网关", - class: "bpmn-exclusiveGateway" - }, - { - type: "bpmn:userTask", - text: "用户", - class: "bpmn-user" - } + { + type: 'bpmn:startEvent', + text: '开始', + class: 'bpmn-start', + }, + { + type: 'bpmn:endEvent', + text: '结束', + class: 'bpmn-end', + }, + { + type: 'bpmn:exclusiveGateway', + text: '网关', + class: 'bpmn-exclusiveGateway', + }, + { + type: 'bpmn:userTask', + text: '用户', + class: 'bpmn-user', + }, ]; diff --git a/src/components/ReIcon/src/hooks.ts b/src/components/ReIcon/src/hooks.ts index 5a377da..347d0b6 100644 --- a/src/components/ReIcon/src/hooks.ts +++ b/src/components/ReIcon/src/hooks.ts @@ -1,6 +1,6 @@ -import type { iconType } from "./types"; -import { h, defineComponent, type Component } from "vue"; -import { IconifyIconOnline, IconifyIconOffline, FontIcon } from "../index"; +import type { iconType } from './types'; +import { type Component, defineComponent, h } from 'vue'; +import { FontIcon, IconifyIconOffline, IconifyIconOnline } from '../index'; /** * 支持 `iconfont`、自定义 `svg` 以及 `iconify` 中所有的图标 @@ -10,52 +10,48 @@ import { IconifyIconOnline, IconifyIconOffline, FontIcon } from "../index"; * @returns Component */ export function useRenderIcon(icon: any, attrs?: iconType): Component { - // iconfont - const ifReg = /^IF-/; - // typeof icon === "function" 属于SVG - if (ifReg.test(icon)) { - // iconfont - const name = icon.split(ifReg)[1]; - const iconName = name.slice( - 0, - name.indexOf(" ") == -1 ? name.length : name.indexOf(" ") - ); - const iconType = name.slice(name.indexOf(" ") + 1, name.length); - return defineComponent({ - name: "FontIcon", - render() { - return h(FontIcon, { - icon: iconName, - iconType, - ...attrs - }); - } - }); - } else if (typeof icon === "function" || typeof icon?.render === "function") { - // svg - return attrs ? h(icon, { ...attrs }) : icon; - } else if (typeof icon === "object") { - return defineComponent({ - name: "OfflineIcon", - render() { - return h(IconifyIconOffline, { - icon: icon, - ...attrs - }); - } - }); - } else { - // 通过是否存在 : 符号来判断是在线还是本地图标,存在即是在线图标,反之 - return defineComponent({ - name: "Icon", - render() { - const IconifyIcon = - icon && icon.includes(":") ? IconifyIconOnline : IconifyIconOffline; - return h(IconifyIcon, { - icon: icon, - ...attrs - }); - } - }); - } + // iconfont + const ifReg = /^IF-/; + // typeof icon === "function" 属于SVG + if (ifReg.test(icon)) { + // iconfont + const name = icon.split(ifReg)[1]; + const iconName = name.slice(0, name.indexOf(' ') == -1 ? name.length : name.indexOf(' ')); + const iconType = name.slice(name.indexOf(' ') + 1, name.length); + return defineComponent({ + name: 'FontIcon', + render() { + return h(FontIcon, { + icon: iconName, + iconType, + ...attrs, + }); + }, + }); + } else if (typeof icon === 'function' || typeof icon?.render === 'function') { + // svg + return attrs ? h(icon, { ...attrs }) : icon; + } else if (typeof icon === 'object') { + return defineComponent({ + name: 'OfflineIcon', + render() { + return h(IconifyIconOffline, { + icon: icon, + ...attrs, + }); + }, + }); + } else { + // 通过是否存在 : 符号来判断是在线还是本地图标,存在即是在线图标,反之 + return defineComponent({ + name: 'Icon', + render() { + const IconifyIcon = icon && icon.includes(':') ? IconifyIconOnline : IconifyIconOffline; + return h(IconifyIcon, { + icon: icon, + ...attrs, + }); + }, + }); + } } diff --git a/src/components/ReIcon/src/iconfont.ts b/src/components/ReIcon/src/iconfont.ts index c110451..f1771fb 100644 --- a/src/components/ReIcon/src/iconfont.ts +++ b/src/components/ReIcon/src/iconfont.ts @@ -1,48 +1,23 @@ -import { h, defineComponent } from "vue"; +import { defineComponent, h } from 'vue'; // 封装iconfont组件,默认`font-class`引用模式,支持`unicode`引用、`font-class`引用、`symbol`引用 (https://www.iconfont.cn/help/detail?spm=a313x.7781069.1998910419.20&helptype=code) export default defineComponent({ - name: "FontIcon", - props: { - icon: { - type: String, - default: "" - } - }, - render() { - const attrs = this.$attrs; - if (Object.keys(attrs).includes("uni") || attrs?.iconType === "uni") { - return h( - "i", - { - class: "iconfont", - ...attrs - }, - this.icon - ); - } else if ( - Object.keys(attrs).includes("svg") || - attrs?.iconType === "svg" - ) { - return h( - "svg", - { - class: "icon-svg", - "aria-hidden": true - }, - { - default: () => [ - h("use", { - "xlink:href": `#${this.icon}` - }) - ] - } - ); - } else { - return h("i", { - class: `iconfont ${this.icon}`, - ...attrs - }); - } - } + name: 'FontIcon', + props: { icon: { type: String, default: '' } }, + render() { + const attrs = this.$attrs; + if (Object.keys(attrs).includes('uni') || attrs?.iconType === 'uni') { + return h('i', { class: 'iconfont', ...attrs }, this.icon); + } else if (Object.keys(attrs).includes('svg') || attrs?.iconType === 'svg') { + return h( + 'svg', + { class: 'icon-svg', 'aria-hidden': true }, + { + default: () => [h('use', { 'xlink:href': `#${this.icon}` })], + }, + ); + } else { + return h('i', { class: `iconfont ${this.icon}`, ...attrs }); + } + }, }); diff --git a/src/components/ReIcon/src/iconifyIconOffline.ts b/src/components/ReIcon/src/iconifyIconOffline.ts index b47aa99..0ec0e4e 100644 --- a/src/components/ReIcon/src/iconifyIconOffline.ts +++ b/src/components/ReIcon/src/iconifyIconOffline.ts @@ -1,30 +1,28 @@ -import { h, defineComponent } from "vue"; -import { Icon as IconifyIcon, addIcon } from "@iconify/vue/dist/offline"; +import { defineComponent, h } from 'vue'; +import { addIcon, Icon as IconifyIcon } from '@iconify/vue/dist/offline'; // Iconify Icon在Vue里本地使用(用于内网环境) export default defineComponent({ - name: "IconifyIconOffline", - components: { IconifyIcon }, - props: { - icon: { - default: null - } - }, - render() { - if (typeof this.icon === "object") addIcon(this.icon, this.icon); - const attrs = this.$attrs; - return h( - IconifyIcon, - { - icon: this.icon, - style: attrs?.style - ? Object.assign(attrs.style, { outline: "none" }) - : { outline: "none" }, - ...attrs - }, - { - default: () => [] - } - ); - } + name: 'IconifyIconOffline', + components: { IconifyIcon }, + props: { + icon: { + default: null, + }, + }, + render() { + if (typeof this.icon === 'object') addIcon(this.icon, this.icon); + const attrs = this.$attrs; + return h( + IconifyIcon, + { + icon: this.icon, + style: attrs?.style ? Object.assign(attrs.style, { outline: 'none' }) : { outline: 'none' }, + ...attrs, + }, + { + default: () => [], + }, + ); + }, }); diff --git a/src/components/ReImageVerify/index.ts b/src/components/ReImageVerify/index.ts index 4215c52..62d23ac 100644 --- a/src/components/ReImageVerify/index.ts +++ b/src/components/ReImageVerify/index.ts @@ -1,5 +1,5 @@ -import reImageVerify from "./src/index.vue"; -import { withInstall } from "@pureadmin/utils"; +import reImageVerify from './src/index.vue'; +import { withInstall } from '@pureadmin/utils'; /** 图形验证码组件 */ export const ReImageVerify = withInstall(reImageVerify); diff --git a/src/components/ReImageVerify/src/hooks.ts b/src/components/ReImageVerify/src/hooks.ts index f1ced47..5c91cf3 100644 --- a/src/components/ReImageVerify/src/hooks.ts +++ b/src/components/ReImageVerify/src/hooks.ts @@ -1,4 +1,4 @@ -import { onMounted, ref } from "vue"; +import { onMounted, ref } from 'vue'; /** * 绘制图形验证码 @@ -6,74 +6,74 @@ import { onMounted, ref } from "vue"; * @param height - 图形高度 */ export const useImageVerify = (width = 120, height = 40) => { - const domRef = ref(); - const imgCode = ref(""); + const domRef = ref(); + const imgCode = ref(''); - function setImgCode(code: string) { - imgCode.value = code; - } + function setImgCode(code: string) { + imgCode.value = code; + } - function getImgCode() { - if (!domRef.value) return; - imgCode.value = draw(domRef.value, width, height); - } + function getImgCode() { + if (!domRef.value) return; + imgCode.value = draw(domRef.value, width, height); + } - onMounted(() => { - getImgCode(); - }); + onMounted(() => { + getImgCode(); + }); - return { domRef, imgCode, setImgCode, getImgCode }; + return { domRef, imgCode, setImgCode, getImgCode }; }; function randomNum(min: number, max: number) { - return Math.floor(Math.random() * (max - min) + min); + return Math.floor(Math.random() * (max - min) + min); } function randomColor(min: number, max: number) { - const r = randomNum(min, max); - const g = randomNum(min, max); - const b = randomNum(min, max); - return `rgb(${r},${g},${b})`; + const r = randomNum(min, max); + const g = randomNum(min, max); + const b = randomNum(min, max); + return `rgb(${r},${g},${b})`; } function draw(dom: HTMLCanvasElement, width: number, height: number) { - let imgCode = ""; + let imgCode = ''; - const NUMBER_STRING = "0123456789"; + const NUMBER_STRING = '0123456789'; - const ctx = dom.getContext("2d"); - if (!ctx) return imgCode; + const ctx = dom.getContext('2d'); + if (!ctx) return imgCode; - ctx.fillStyle = randomColor(180, 230); - ctx.fillRect(0, 0, width, height); - for (let i = 0; i < 4; i += 1) { - const text = NUMBER_STRING[randomNum(0, NUMBER_STRING.length)]; - imgCode += text; - const fontSize = randomNum(18, 41); - const deg = randomNum(-30, 30); - ctx.font = `${fontSize}px Simhei`; - ctx.textBaseline = "top"; - ctx.fillStyle = randomColor(80, 150); - ctx.save(); - ctx.translate(30 * i + 15, 15); - ctx.rotate((deg * Math.PI) / 180); - ctx.fillText(text, -15 + 5, -15); - ctx.restore(); - } - for (let i = 0; i < 5; i += 1) { - ctx.beginPath(); - ctx.moveTo(randomNum(0, width), randomNum(0, height)); - ctx.lineTo(randomNum(0, width), randomNum(0, height)); - ctx.strokeStyle = randomColor(180, 230); - ctx.closePath(); - ctx.stroke(); - } - for (let i = 0; i < 41; i += 1) { - ctx.beginPath(); - ctx.arc(randomNum(0, width), randomNum(0, height), 1, 0, 2 * Math.PI); - ctx.closePath(); - ctx.fillStyle = randomColor(150, 200); - ctx.fill(); - } - return imgCode; + ctx.fillStyle = randomColor(180, 230); + ctx.fillRect(0, 0, width, height); + for (let i = 0; i < 4; i += 1) { + const text = NUMBER_STRING[randomNum(0, NUMBER_STRING.length)]; + imgCode += text; + const fontSize = randomNum(18, 41); + const deg = randomNum(-30, 30); + ctx.font = `${fontSize}px Simhei`; + ctx.textBaseline = 'top'; + ctx.fillStyle = randomColor(80, 150); + ctx.save(); + ctx.translate(30 * i + 15, 15); + ctx.rotate((deg * Math.PI) / 180); + ctx.fillText(text, -15 + 5, -15); + ctx.restore(); + } + for (let i = 0; i < 5; i += 1) { + ctx.beginPath(); + ctx.moveTo(randomNum(0, width), randomNum(0, height)); + ctx.lineTo(randomNum(0, width), randomNum(0, height)); + ctx.strokeStyle = randomColor(180, 230); + ctx.closePath(); + ctx.stroke(); + } + for (let i = 0; i < 41; i += 1) { + ctx.beginPath(); + ctx.arc(randomNum(0, width), randomNum(0, height), 1, 0, 2 * Math.PI); + ctx.closePath(); + ctx.fillStyle = randomColor(150, 200); + ctx.fill(); + } + return imgCode; } diff --git a/src/components/ReImageVerify/src/index.vue b/src/components/ReImageVerify/src/index.vue index 03d0662..0c48c89 100644 --- a/src/components/ReImageVerify/src/index.vue +++ b/src/components/ReImageVerify/src/index.vue @@ -1,21 +1,21 @@ - diff --git a/src/components/ReMap/index.ts b/src/components/ReMap/index.ts index 4bcd828..b282676 100644 --- a/src/components/ReMap/index.ts +++ b/src/components/ReMap/index.ts @@ -1,5 +1,5 @@ -import amap from "./src/Amap.vue"; -import { withInstall } from "@pureadmin/utils"; +import amap from './src/Amap.vue'; +import { withInstall } from '@pureadmin/utils'; /** 高德地图组件 */ export const Amap = withInstall(amap); diff --git a/src/components/ReMap/src/Amap.vue b/src/components/ReMap/src/Amap.vue index fc02efa..776614a 100644 --- a/src/components/ReMap/src/Amap.vue +++ b/src/components/ReMap/src/Amap.vue @@ -1,22 +1,22 @@ diff --git a/src/components/ReQrcode/index.ts b/src/components/ReQrcode/index.ts index 48037a8..7caa6e4 100644 --- a/src/components/ReQrcode/index.ts +++ b/src/components/ReQrcode/index.ts @@ -1,5 +1,5 @@ -import reQrcode from "./src/index"; -import { withInstall } from "@pureadmin/utils"; +import reQrcode from './src/index'; +import { withInstall } from '@pureadmin/utils'; /** 二维码组件 */ export const ReQrcode = withInstall(reQrcode); diff --git a/src/components/ReQrcode/src/index.scss b/src/components/ReQrcode/src/index.scss index 66ff634..134365d 100644 --- a/src/components/ReQrcode/src/index.scss +++ b/src/components/ReQrcode/src/index.scss @@ -7,3 +7,4 @@ } } } + diff --git a/src/components/ReQrcode/src/index.tsx b/src/components/ReQrcode/src/index.tsx index fbff02e..92eadd2 100644 --- a/src/components/ReQrcode/src/index.tsx +++ b/src/components/ReQrcode/src/index.tsx @@ -1,212 +1,212 @@ -import { computed, defineComponent, nextTick, type PropType, ref, unref, watch } from "vue"; -import "./index.scss"; -import propTypes from "@/utils/propTypes"; -import { cloneDeep, isString } from "@pureadmin/utils"; -import QRCode, { type QRCodeRenderersOptions } from "qrcode"; -import RefreshRight from "@iconify-icons/ep/refresh-right"; +import { computed, defineComponent, nextTick, type PropType, ref, unref, watch } from 'vue'; +import './index.scss'; +import propTypes from '@/utils/propTypes'; +import { cloneDeep, isString } from '@pureadmin/utils'; +import QRCode, { type QRCodeRenderersOptions } from 'qrcode'; +import RefreshRight from '@iconify-icons/ep/refresh-right'; interface QrcodeLogo { - src?: string; - logoSize?: number; - bgColor?: string; - borderSize?: number; - crossOrigin?: string; - borderRadius?: number; - logoRadius?: number; + src?: string; + logoSize?: number; + bgColor?: string; + borderSize?: number; + crossOrigin?: string; + borderRadius?: number; + logoRadius?: number; } const props = { - // img 或者 canvas,img不支持logo嵌套 - tag: propTypes.string.validate((v: string) => ["canvas", "img"].includes(v)).def("canvas"), - // 二维码内容 - text: { - type: [String, Array] as PropType, - default: null - }, - // qrcode.js配置项 - options: { - type: Object as PropType, - default: (): QRCodeRenderersOptions => ({}) - }, - // 宽度 - width: propTypes.number.def(200), - // logo - logo: { - type: [String, Object] as PropType | string>, - default: (): QrcodeLogo | string => "" - }, - // 是否过期 - disabled: propTypes.bool.def(false), - // 过期提示内容 - disabledText: propTypes.string.def("") + // img 或者 canvas,img不支持logo嵌套 + tag: propTypes.string.validate((v: string) => ['canvas', 'img'].includes(v)).def('canvas'), + // 二维码内容 + text: { + type: [String, Array] as PropType, + default: null, + }, + // qrcode.js配置项 + options: { + type: Object as PropType, + default: (): QRCodeRenderersOptions => ({}), + }, + // 宽度 + width: propTypes.number.def(200), + // logo + logo: { + type: [String, Object] as PropType | string>, + default: (): QrcodeLogo | string => '', + }, + // 是否过期 + disabled: propTypes.bool.def(false), + // 过期提示内容 + disabledText: propTypes.string.def(''), }; export default defineComponent({ - name: "ReQrcode", - props, - emits: ["done", "click", "disabled-click"], - setup(props, { emit }) { - const { toCanvas, toDataURL } = QRCode; - const loading = ref(true); - const wrapRef = ref>(null); - const renderText = computed(() => String(props.text)); - const wrapStyle = computed(() => { - return { - width: props.width + "px", - height: props.width + "px" - }; - }); - const initQrcode = async () => { - await nextTick(); - const options = cloneDeep(props.options || {}); - if (props.tag === "canvas") { - // 容错率,默认对内容少的二维码采用高容错率,内容多的二维码采用低容错率 - options.errorCorrectionLevel = options.errorCorrectionLevel || getErrorCorrectionLevel(unref(renderText)); - const _width: number = await getOriginWidth(unref(renderText), options); - options.scale = props.width === 0 ? undefined : (props.width / _width) * 4; - const canvasRef: any = await toCanvas(unref(wrapRef) as HTMLCanvasElement, unref(renderText), options); - if (props.logo) { - const url = await createLogoCode(canvasRef); - emit("done", url); - loading.value = false; - } else { - emit("done", canvasRef.toDataURL()); - loading.value = false; - } - } else { - const url = await toDataURL(renderText.value, { - errorCorrectionLevel: "H", - width: props.width, - ...options - }); - (unref(wrapRef) as any).src = url; - emit("done", url); - loading.value = false; - } - }; - watch( - () => renderText.value, - val => { - if (!val) return; - initQrcode(); - }, - { - deep: true, - immediate: true - } - ); - const createLogoCode = (canvasRef: HTMLCanvasElement) => { - const canvasWidth = canvasRef.width; - const logoOptions: QrcodeLogo = Object.assign( - { - logoSize: 0.15, - bgColor: "#ffffff", - borderSize: 0.05, - crossOrigin: "anonymous", - borderRadius: 8, - logoRadius: 0 - }, - isString(props.logo) ? {} : props.logo - ); - const { logoSize = 0.15, bgColor = "#ffffff", borderSize = 0.05, crossOrigin = "anonymous", borderRadius = 8, logoRadius = 0 } = logoOptions; - const logoSrc = isString(props.logo) ? props.logo : props.logo.src; - const logoWidth = canvasWidth * logoSize; - const logoXY = (canvasWidth * (1 - logoSize)) / 2; - const logoBgWidth = canvasWidth * (logoSize + borderSize); - const logoBgXY = (canvasWidth * (1 - logoSize - borderSize)) / 2; - const ctx = canvasRef.getContext("2d"); - if (!ctx) return; - // logo 底色 - canvasRoundRect(ctx)(logoBgXY, logoBgXY, logoBgWidth, logoBgWidth, borderRadius); - ctx.fillStyle = bgColor; - ctx.fill(); - // logo - const image = new Image(); - if (crossOrigin || logoRadius) { - image.setAttribute("crossOrigin", crossOrigin); - } - (image as any).src = logoSrc; - // 使用image绘制可以避免某些跨域情况 - const drawLogoWithImage = (image: HTMLImageElement) => { - ctx.drawImage(image, logoXY, logoXY, logoWidth, logoWidth); - }; - // 使用canvas绘制以获得更多的功能 - const drawLogoWithCanvas = (image: HTMLImageElement) => { - const canvasImage = document.createElement("canvas"); - canvasImage.width = logoXY + logoWidth; - canvasImage.height = logoXY + logoWidth; - const imageCanvas = canvasImage.getContext("2d"); - if (!imageCanvas || !ctx) return; - imageCanvas.drawImage(image, logoXY, logoXY, logoWidth, logoWidth); - canvasRoundRect(ctx)(logoXY, logoXY, logoWidth, logoWidth, logoRadius); - if (!ctx) return; - const fillStyle = ctx.createPattern(canvasImage, "no-repeat"); - if (fillStyle) { - ctx.fillStyle = fillStyle; - ctx.fill(); - } - }; - // 将 logo绘制到 canvas上 - return new Promise((resolve: any) => { - image.onload = () => { - logoRadius ? drawLogoWithCanvas(image) : drawLogoWithImage(image); - resolve(canvasRef.toDataURL()); - }; - }); - }; - // 得到原QrCode的大小,以便缩放得到正确的QrCode大小 - const getOriginWidth = async (content: string, options: QRCodeRenderersOptions) => { - const _canvas = document.createElement("canvas"); - await toCanvas(_canvas, content, options); - return _canvas.width; - }; - // 对于内容少的QrCode,增大容错率 - const getErrorCorrectionLevel = (content: string) => { - if (content.length > 36) { - return "M"; - } else if (content.length > 16) { - return "Q"; - } else { - return "H"; - } - }; - // 用于绘制圆角 - const canvasRoundRect = (ctx: CanvasRenderingContext2D) => { - return (x: number, y: number, w: number, h: number, r: number) => { - const minSize = Math.min(w, h); - if (r > minSize / 2) { - r = minSize / 2; - } - ctx.beginPath(); - ctx.moveTo(x + r, y); - ctx.arcTo(x + w, y, x + w, y + h, r); - ctx.arcTo(x + w, y + h, x, y + h, r); - ctx.arcTo(x, y + h, x, y, r); - ctx.arcTo(x, y, x + w, y, r); - ctx.closePath(); - return ctx; - }; - }; - const clickCode = () => { - emit("click"); - }; - const disabledClick = () => { - emit("disabled-click"); - }; - return () => ( - <> -
- {props.tag === "canvas" ? : } - {props.disabled && ( -
-
- -
{props.disabledText}
-
-
- )} -
- - ); - } + name: 'ReQrcode', + props, + emits: ['done', 'click', 'disabled-click'], + setup(props, { emit }) { + const { toCanvas, toDataURL } = QRCode; + const loading = ref(true); + const wrapRef = ref>(null); + const renderText = computed(() => String(props.text)); + const wrapStyle = computed(() => { + return { + width: props.width + 'px', + height: props.width + 'px', + }; + }); + const initQrcode = async () => { + await nextTick(); + const options = cloneDeep(props.options || {}); + if (props.tag === 'canvas') { + // 容错率,默认对内容少的二维码采用高容错率,内容多的二维码采用低容错率 + options.errorCorrectionLevel = options.errorCorrectionLevel || getErrorCorrectionLevel(unref(renderText)); + const _width: number = await getOriginWidth(unref(renderText), options); + options.scale = props.width === 0 ? undefined : (props.width / _width) * 4; + const canvasRef: any = await toCanvas(unref(wrapRef) as HTMLCanvasElement, unref(renderText), options); + if (props.logo) { + const url = await createLogoCode(canvasRef); + emit('done', url); + loading.value = false; + } else { + emit('done', canvasRef.toDataURL()); + loading.value = false; + } + } else { + const url = await toDataURL(renderText.value, { + errorCorrectionLevel: 'H', + width: props.width, + ...options, + }); + (unref(wrapRef) as any).src = url; + emit('done', url); + loading.value = false; + } + }; + watch( + () => renderText.value, + val => { + if (!val) return; + initQrcode(); + }, + { + deep: true, + immediate: true, + }, + ); + const createLogoCode = (canvasRef: HTMLCanvasElement) => { + const canvasWidth = canvasRef.width; + const logoOptions: QrcodeLogo = Object.assign( + { + logoSize: 0.15, + bgColor: '#ffffff', + borderSize: 0.05, + crossOrigin: 'anonymous', + borderRadius: 8, + logoRadius: 0, + }, + isString(props.logo) ? {} : props.logo, + ); + const { logoSize = 0.15, bgColor = '#ffffff', borderSize = 0.05, crossOrigin = 'anonymous', borderRadius = 8, logoRadius = 0 } = logoOptions; + const logoSrc = isString(props.logo) ? props.logo : props.logo.src; + const logoWidth = canvasWidth * logoSize; + const logoXY = (canvasWidth * (1 - logoSize)) / 2; + const logoBgWidth = canvasWidth * (logoSize + borderSize); + const logoBgXY = (canvasWidth * (1 - logoSize - borderSize)) / 2; + const ctx = canvasRef.getContext('2d'); + if (!ctx) return; + // logo 底色 + canvasRoundRect(ctx)(logoBgXY, logoBgXY, logoBgWidth, logoBgWidth, borderRadius); + ctx.fillStyle = bgColor; + ctx.fill(); + // logo + const image = new Image(); + if (crossOrigin || logoRadius) { + image.setAttribute('crossOrigin', crossOrigin); + } + (image as any).src = logoSrc; + // 使用image绘制可以避免某些跨域情况 + const drawLogoWithImage = (image: HTMLImageElement) => { + ctx.drawImage(image, logoXY, logoXY, logoWidth, logoWidth); + }; + // 使用canvas绘制以获得更多的功能 + const drawLogoWithCanvas = (image: HTMLImageElement) => { + const canvasImage = document.createElement('canvas'); + canvasImage.width = logoXY + logoWidth; + canvasImage.height = logoXY + logoWidth; + const imageCanvas = canvasImage.getContext('2d'); + if (!imageCanvas || !ctx) return; + imageCanvas.drawImage(image, logoXY, logoXY, logoWidth, logoWidth); + canvasRoundRect(ctx)(logoXY, logoXY, logoWidth, logoWidth, logoRadius); + if (!ctx) return; + const fillStyle = ctx.createPattern(canvasImage, 'no-repeat'); + if (fillStyle) { + ctx.fillStyle = fillStyle; + ctx.fill(); + } + }; + // 将 logo绘制到 canvas上 + return new Promise((resolve: any) => { + image.onload = () => { + logoRadius ? drawLogoWithCanvas(image) : drawLogoWithImage(image); + resolve(canvasRef.toDataURL()); + }; + }); + }; + // 得到原QrCode的大小,以便缩放得到正确的QrCode大小 + const getOriginWidth = async (content: string, options: QRCodeRenderersOptions) => { + const _canvas = document.createElement('canvas'); + await toCanvas(_canvas, content, options); + return _canvas.width; + }; + // 对于内容少的QrCode,增大容错率 + const getErrorCorrectionLevel = (content: string) => { + if (content.length > 36) { + return 'M'; + } else if (content.length > 16) { + return 'Q'; + } else { + return 'H'; + } + }; + // 用于绘制圆角 + const canvasRoundRect = (ctx: CanvasRenderingContext2D) => { + return (x: number, y: number, w: number, h: number, r: number) => { + const minSize = Math.min(w, h); + if (r > minSize / 2) { + r = minSize / 2; + } + ctx.beginPath(); + ctx.moveTo(x + r, y); + ctx.arcTo(x + w, y, x + w, y + h, r); + ctx.arcTo(x + w, y + h, x, y + h, r); + ctx.arcTo(x, y + h, x, y, r); + ctx.arcTo(x, y, x + w, y, r); + ctx.closePath(); + return ctx; + }; + }; + const clickCode = () => { + emit('click'); + }; + const disabledClick = () => { + emit('disabled-click'); + }; + return () => ( + <> +
+ {props.tag === 'canvas' ? : } + {props.disabled && ( +
+
+ +
{props.disabledText}
+
+
+ )} +
+ + ); + }, }); diff --git a/src/components/ReSeamlessScroll/index.ts b/src/components/ReSeamlessScroll/index.ts index 2d3766a..54096fb 100644 --- a/src/components/ReSeamlessScroll/index.ts +++ b/src/components/ReSeamlessScroll/index.ts @@ -1,5 +1,5 @@ -import reSeamlessScroll from "./src/index.vue"; -import { withInstall } from "@pureadmin/utils"; +import reSeamlessScroll from './src/index.vue'; +import { withInstall } from '@pureadmin/utils'; /** 无缝滚动组件 */ export const ReSeamlessScroll = withInstall(reSeamlessScroll); diff --git a/src/components/ReSeamlessScroll/src/index.vue b/src/components/ReSeamlessScroll/src/index.vue index 8eeb90d..a853c44 100644 --- a/src/components/ReSeamlessScroll/src/index.vue +++ b/src/components/ReSeamlessScroll/src/index.vue @@ -1,26 +1,26 @@ diff --git a/src/components/ReSegmented/index.ts b/src/components/ReSegmented/index.ts index de4253c..5e0975e 100644 --- a/src/components/ReSegmented/index.ts +++ b/src/components/ReSegmented/index.ts @@ -1,8 +1,8 @@ -import reSegmented from "./src/index"; -import { withInstall } from "@pureadmin/utils"; +import reSegmented from './src/index'; +import { withInstall } from '@pureadmin/utils'; /** 分段控制器组件 */ export const ReSegmented = withInstall(reSegmented); export default ReSegmented; -export type { OptionsType } from "./src/type"; +export type { OptionsType } from './src/type'; diff --git a/src/components/ReSegmented/src/index.css b/src/components/ReSegmented/src/index.css index ad333fb..92be4ed 100644 --- a/src/components/ReSegmented/src/index.css +++ b/src/components/ReSegmented/src/index.css @@ -1,157 +1,157 @@ .pure-segmented { - background-color: rgb(0 0 0 / 4%); - border-radius: var(--pure-segmented-border-radius-base); - box-sizing: border-box; - color: rgba(0, 0, 0, 0.65); + background-color: rgb(0 0 0 / 4%); + border-radius: var(--pure-segmented-border-radius-base); + box-sizing: border-box; + color: rgba(0, 0, 0, 0.65); - --pure-control-padding-horizontal: 12px; - --pure-control-padding-horizontal-sm: 8px; - display: inline-block; + --pure-control-padding-horizontal: 12px; + --pure-control-padding-horizontal-sm: 8px; + display: inline-block; - font-size: var(--el-font-size-base); - padding: var(--pure-segmented-track-padding); - --pure-segmented-border-radius-base: 6px; - --pure-segmented-border-radius-large: 8px; - --pure-segmented-border-radius-small: 4px; - --pure-segmented-line-width: 1px; - --pure-segmented-track-padding: 2px; + font-size: var(--el-font-size-base); + padding: var(--pure-segmented-track-padding); + --pure-segmented-border-radius-base: 6px; + --pure-segmented-border-radius-large: 8px; + --pure-segmented-border-radius-small: 4px; + --pure-segmented-line-width: 1px; + --pure-segmented-track-padding: 2px; } .pure-segmented-block { - display: flex; + display: flex; } .pure-segmented-block .pure-segmented-item { - flex: 1; - min-width: 0; + flex: 1; + min-width: 0; } .pure-segmented-block .pure-segmented-item > .pure-segmented-item-label > span { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } /* small */ .pure-segmented.pure-segmented--small { - border-radius: var(--pure-segmented-border-radius-small); + border-radius: var(--pure-segmented-border-radius-small); } .pure-segmented.pure-segmented--small .pure-segmented-item { - border-radius: var(--el-border-radius-small); + border-radius: var(--el-border-radius-small); } .pure-segmented.pure-segmented--small .pure-segmented-item > div { - line-height: calc( - var(--el-component-size-small) - var(--pure-segmented-track-padding) * 2 - ); - min-height: calc( - var(--el-component-size-small) - var(--pure-segmented-track-padding) * 2 - ); - padding: 0 calc( - var(--pure-control-padding-horizontal-sm) - - var(--pure-segmented-line-width) - ); + line-height: calc( + var(--el-component-size-small) - var(--pure-segmented-track-padding) * 2 + ); + min-height: calc( + var(--el-component-size-small) - var(--pure-segmented-track-padding) * 2 + ); + padding: 0 calc( + var(--pure-control-padding-horizontal-sm) - + var(--pure-segmented-line-width) + ); } /* large */ .pure-segmented.pure-segmented--large { - border-radius: var(--pure-segmented-border-radius-large); + border-radius: var(--pure-segmented-border-radius-large); } .pure-segmented.pure-segmented--large .pure-segmented-item { - border-radius: calc( - var(--el-border-radius-base) + var(--el-border-radius-small) - ); + border-radius: calc( + var(--el-border-radius-base) + var(--el-border-radius-small) + ); } .pure-segmented.pure-segmented--large .pure-segmented-item > div { - font-size: var(--el-font-size-medium); - line-height: calc( - var(--el-component-size-large) - var(--pure-segmented-track-padding) * 2 - ); - min-height: calc( - var(--el-component-size-large) - var(--pure-segmented-track-padding) * 2 - ); - padding: 0 calc( - var(--pure-control-padding-horizontal) - var(--pure-segmented-line-width) - ); + font-size: var(--el-font-size-medium); + line-height: calc( + var(--el-component-size-large) - var(--pure-segmented-track-padding) * 2 + ); + min-height: calc( + var(--el-component-size-large) - var(--pure-segmented-track-padding) * 2 + ); + padding: 0 calc( + var(--pure-control-padding-horizontal) - var(--pure-segmented-line-width) + ); } /* default */ .pure-segmented-item { - border-radius: var(--el-border-radius-base); - cursor: pointer; - position: relative; - text-align: center; - transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); + border-radius: var(--el-border-radius-base); + cursor: pointer; + position: relative; + text-align: center; + transition: all 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); } .pure-segmented .pure-segmented-item > div { - line-height: calc( - var(--el-component-size) - var(--pure-segmented-track-padding) * 2 - ); - min-height: calc( - var(--el-component-size) - var(--pure-segmented-track-padding) * 2 - ); - overflow: hidden; - padding: 0 calc( - var(--pure-control-padding-horizontal) - var(--pure-segmented-line-width) - ); - text-overflow: ellipsis; - transition: 0.1s; - white-space: nowrap; + line-height: calc( + var(--el-component-size) - var(--pure-segmented-track-padding) * 2 + ); + min-height: calc( + var(--el-component-size) - var(--pure-segmented-track-padding) * 2 + ); + overflow: hidden; + padding: 0 calc( + var(--pure-control-padding-horizontal) - var(--pure-segmented-line-width) + ); + text-overflow: ellipsis; + transition: 0.1s; + white-space: nowrap; } .pure-segmented-group { - align-items: stretch; - display: flex; - justify-items: flex-start; - position: relative; - width: 100%; + align-items: stretch; + display: flex; + justify-items: flex-start; + position: relative; + width: 100%; } .pure-segmented-item-selected { - background-color: #fff; - border-radius: 4px; - box-shadow: 0 2px 8px -2px rgb(0 0 0 / 5%), - 0 1px 4px -1px rgb(0 0 0 / 7%), - 0 0 1px rgb(0 0 0 / 7%); - box-sizing: border-box; - display: none; - height: 100%; - left: 0; - padding: 4px 0; - position: absolute; - top: 0; - transition: transform 0.5s cubic-bezier(0.645, 0.045, 0.355, 1), - width 0.5s cubic-bezier(0.645, 0.045, 0.355, 1); - width: 0; - will-change: transform, width; + background-color: #fff; + border-radius: 4px; + box-shadow: 0 2px 8px -2px rgb(0 0 0 / 5%), + 0 1px 4px -1px rgb(0 0 0 / 7%), + 0 0 1px rgb(0 0 0 / 7%); + box-sizing: border-box; + display: none; + height: 100%; + left: 0; + padding: 4px 0; + position: absolute; + top: 0; + transition: transform 0.5s cubic-bezier(0.645, 0.045, 0.355, 1), + width 0.5s cubic-bezier(0.645, 0.045, 0.355, 1); + width: 0; + will-change: transform, width; } .pure-segmented-item > input { - height: 0; - inset-block-start: 0; - inset-inline-start: 0; - opacity: 0; - pointer-events: none; - position: absolute; - width: 0; + height: 0; + inset-block-start: 0; + inset-inline-start: 0; + opacity: 0; + pointer-events: none; + position: absolute; + width: 0; } .pure-segmented-item-label { - align-items: center; - display: flex; - justify-content: center; + align-items: center; + display: flex; + justify-content: center; } .pure-segmented-item-icon svg { - height: 16px; - width: 16px; + height: 16px; + width: 16px; } .pure-segmented-item-disabled { - color: rgba(0, 0, 0, 0.25); - cursor: not-allowed; + color: rgba(0, 0, 0, 0.25); + cursor: not-allowed; } diff --git a/src/components/ReSegmented/src/index.tsx b/src/components/ReSegmented/src/index.tsx index d81e574..27df1de 100644 --- a/src/components/ReSegmented/src/index.tsx +++ b/src/components/ReSegmented/src/index.tsx @@ -1,175 +1,175 @@ -import "./index.css"; -import type { OptionsType } from "./type"; -import { useRenderIcon } from "@/components/ReIcon/src/hooks"; -import { isFunction, isNumber, useDark, useResizeObserver } from "@pureadmin/utils"; -import { defineComponent, getCurrentInstance, h, nextTick, type PropType, ref, toRef, watch } from "vue"; +import './index.css'; +import type { OptionsType } from './type'; +import { useRenderIcon } from '@/components/ReIcon/src/hooks'; +import { isFunction, isNumber, useDark, useResizeObserver } from '@pureadmin/utils'; +import { defineComponent, getCurrentInstance, h, nextTick, type PropType, ref, toRef, watch } from 'vue'; const props = { - options: { - type: Array, - default: () => [] - }, - /** 默认选中,按照第一个索引为 `0` 的模式,可选(`modelValue`只有传`number`类型时才为响应式) */ - modelValue: { - type: undefined, - require: false, - default: "0" - }, - /** 将宽度调整为父元素宽度 */ - block: { - type: Boolean, - default: false - }, - /** 控件尺寸 */ - size: { - type: String as PropType<"small" | "default" | "large"> - }, - /** 是否全局禁用,默认 `false` */ - disabled: { - type: Boolean, - default: false - }, - /** 当内容发生变化时,设置 `resize` 可使其自适应容器位置 */ - resize: { - type: Boolean, - default: false - } + options: { + type: Array, + default: () => [], + }, + /** 默认选中,按照第一个索引为 `0` 的模式,可选(`modelValue`只有传`number`类型时才为响应式) */ + modelValue: { + type: undefined, + require: false, + default: '0', + }, + /** 将宽度调整为父元素宽度 */ + block: { + type: Boolean, + default: false, + }, + /** 控件尺寸 */ + size: { + type: String as PropType<'small' | 'default' | 'large'>, + }, + /** 是否全局禁用,默认 `false` */ + disabled: { + type: Boolean, + default: false, + }, + /** 当内容发生变化时,设置 `resize` 可使其自适应容器位置 */ + resize: { + type: Boolean, + default: false, + }, }; export default defineComponent({ - name: "ReSegmented", - props, - emits: ["change", "update:modelValue"], - setup(props, { emit }) { - const width = ref(0); - const translateX = ref(0); - const { isDark } = useDark(); - const initStatus = ref(false); - const curMouseActive = ref(-1); - const segmentedItembg = ref(""); - const instance = getCurrentInstance()!; - const curIndex = isNumber(props.modelValue) ? toRef(props, "modelValue") : ref(0); + name: 'ReSegmented', + props, + emits: ['change', 'update:modelValue'], + setup(props, { emit }) { + const width = ref(0); + const translateX = ref(0); + const { isDark } = useDark(); + const initStatus = ref(false); + const curMouseActive = ref(-1); + const segmentedItembg = ref(''); + const instance = getCurrentInstance()!; + const curIndex = isNumber(props.modelValue) ? toRef(props, 'modelValue') : ref(0); - function handleChange({ option, index }, event: Event) { - if (props.disabled || option.disabled) return; - event.preventDefault(); - isNumber(props.modelValue) ? emit("update:modelValue", index) : (curIndex.value = index); - segmentedItembg.value = ""; - emit("change", { index, option }); - } + function handleChange({ option, index }, event: Event) { + if (props.disabled || option.disabled) return; + event.preventDefault(); + isNumber(props.modelValue) ? emit('update:modelValue', index) : (curIndex.value = index); + segmentedItembg.value = ''; + emit('change', { index, option }); + } - function handleMouseenter({ option, index }, event: Event) { - if (props.disabled) return; - event.preventDefault(); - curMouseActive.value = index; - if (option.disabled || curIndex.value === index) { - segmentedItembg.value = ""; - } else { - segmentedItembg.value = isDark.value ? "#1f1f1f" : "rgba(0, 0, 0, 0.06)"; - } - } + function handleMouseenter({ option, index }, event: Event) { + if (props.disabled) return; + event.preventDefault(); + curMouseActive.value = index; + if (option.disabled || curIndex.value === index) { + segmentedItembg.value = ''; + } else { + segmentedItembg.value = isDark.value ? '#1f1f1f' : 'rgba(0, 0, 0, 0.06)'; + } + } - function handleMouseleave(_, event: Event) { - if (props.disabled) return; - event.preventDefault(); - curMouseActive.value = -1; - } + function handleMouseleave(_, event: Event) { + if (props.disabled) return; + event.preventDefault(); + curMouseActive.value = -1; + } - function handleInit(index = curIndex.value) { - nextTick(() => { - const curLabelRef = instance?.proxy?.$refs[`labelRef${index}`] as ElRef; - if (!curLabelRef) return; - width.value = curLabelRef.clientWidth; - translateX.value = curLabelRef.offsetLeft; - initStatus.value = true; - }); - } + function handleInit(index = curIndex.value) { + nextTick(() => { + const curLabelRef = instance?.proxy?.$refs[`labelRef${index}`] as ElRef; + if (!curLabelRef) return; + width.value = curLabelRef.clientWidth; + translateX.value = curLabelRef.offsetLeft; + initStatus.value = true; + }); + } - function handleResizeInit() { - useResizeObserver(".pure-segmented", () => { - nextTick(() => { - handleInit(curIndex.value); - }); - }); - } + function handleResizeInit() { + useResizeObserver('.pure-segmented', () => { + nextTick(() => { + handleInit(curIndex.value); + }); + }); + } - (props.block || props.resize) && handleResizeInit(); + (props.block || props.resize) && handleResizeInit(); - watch( - () => curIndex.value, - index => { - nextTick(() => { - handleInit(index); - }); - }, - { - immediate: true - } - ); + watch( + () => curIndex.value, + index => { + nextTick(() => { + handleInit(index); + }); + }, + { + immediate: true, + }, + ); - watch(() => props.size, handleResizeInit, { - immediate: true - }); + watch(() => props.size, handleResizeInit, { + immediate: true, + }); - const rendLabel = () => { - return props.options.map((option, index) => { - return ( - - ); - }); - }; + const rendLabel = () => { + return props.options.map((option, index) => { + return ( + + ); + }); + }; - return () => ( -
-
-
- {rendLabel()} -
-
- ); - } + return () => ( +
+
+
+ {rendLabel()} +
+
+ ); + }, }); diff --git a/src/components/ReSegmented/src/type.ts b/src/components/ReSegmented/src/type.ts index ee34a84..678206a 100644 --- a/src/components/ReSegmented/src/type.ts +++ b/src/components/ReSegmented/src/type.ts @@ -1,20 +1,20 @@ -import type { Component, VNode } from "vue"; -import type { iconType } from "@/components/ReIcon/src/types.ts"; +import type { Component, VNode } from 'vue'; +import type { iconType } from '@/components/ReIcon/src/types.ts'; export interface OptionsType { - /** 文字 */ - label?: string | (() => VNode | Component); - /** - * @description 图标,采用平台内置的 `useRenderIcon` 函数渲染 - * @see {@link 用法参考 https://pure-admin.github.io/pure-admin-doc/pages/icon/#%E9%80%9A%E7%94%A8%E5%9B%BE%E6%A0%87-userendericon-hooks } - */ - icon?: string | Component; - /** 图标属性、样式配置 */ - iconAttrs?: iconType; - /** 值 */ - value?: any; - /** 是否禁用 */ - disabled?: boolean; - /** `tooltip` 提示 */ - tip?: string; + /** 文字 */ + label?: string | (() => VNode | Component); + /** + * @description 图标,采用平台内置的 `useRenderIcon` 函数渲染 + * @see {@link 用法参考 https://pure-admin.github.io/pure-admin-doc/pages/icon/#%E9%80%9A%E7%94%A8%E5%9B%BE%E6%A0%87-userendericon-hooks } + */ + icon?: string | Component; + /** 图标属性、样式配置 */ + iconAttrs?: iconType; + /** 值 */ + value?: any; + /** 是否禁用 */ + disabled?: boolean; + /** `tooltip` 提示 */ + tip?: string; } diff --git a/src/components/ReSelector/index.ts b/src/components/ReSelector/index.ts index 3e28ddc..98169ba 100644 --- a/src/components/ReSelector/index.ts +++ b/src/components/ReSelector/index.ts @@ -1,5 +1,5 @@ -import reSelector from "./src"; -import { withInstall } from "@pureadmin/utils"; +import reSelector from './src'; +import { withInstall } from '@pureadmin/utils'; /** 选择器组件 */ export const ReSelector = withInstall(reSelector); diff --git a/src/components/ReSelector/src/index.css b/src/components/ReSelector/src/index.css index b66b337..bb57d1b 100644 --- a/src/components/ReSelector/src/index.css +++ b/src/components/ReSelector/src/index.css @@ -14,7 +14,7 @@ background-color: #409eff; border-radius: 50%; } - + .hs-range { background-color: #f2f6fc; } diff --git a/src/components/ReSelector/src/index.tsx b/src/components/ReSelector/src/index.tsx index 39e2abb..3d7990c 100644 --- a/src/components/ReSelector/src/index.tsx +++ b/src/components/ReSelector/src/index.tsx @@ -1,256 +1,256 @@ -import "./index.css"; -import { computed, defineComponent, getCurrentInstance, nextTick, onBeforeMount, unref } from "vue"; -import { addClass, removeClass, toggleClass } from "@pureadmin/utils"; +import './index.css'; +import { computed, defineComponent, getCurrentInstance, nextTick, onBeforeMount, unref } from 'vue'; +import { addClass, removeClass, toggleClass } from '@pureadmin/utils'; -const stayClass = "stay"; //鼠标点击 -const activeClass = "hs-on"; //鼠标移动上去 -const voidClass = "hs-off"; //鼠标移开 -const inRange = "hs-range"; //当前选中的两个元素之间的背景 -const bothLeftSides = "both-left-sides"; -const bothRightSides = "both-right-sides"; -let selectedDirection = "right"; //默认从左往右,索引变大 +const stayClass = 'stay'; //鼠标点击 +const activeClass = 'hs-on'; //鼠标移动上去 +const voidClass = 'hs-off'; //鼠标移开 +const inRange = 'hs-range'; //当前选中的两个元素之间的背景 +const bothLeftSides = 'both-left-sides'; +const bothRightSides = 'both-right-sides'; +let selectedDirection = 'right'; //默认从左往右,索引变大 let overList = []; // 存放第一个选中的元素和最后一个选中元素,只能存放这两个元素 let selectedList = []; const props = { - HsKey: { - type: Number || String, - default: 0 - }, - disabled: { - type: Boolean, - default: false - }, - value: { - type: Number, - default: 0 - }, - max: { - type: Array, - default() { - return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - } - }, - // 回显数据的索引,长度必须是2 - echo: { - type: Array, - default() { - return []; - } - } + HsKey: { + type: Number || String, + default: 0, + }, + disabled: { + type: Boolean, + default: false, + }, + value: { + type: Number, + default: 0, + }, + max: { + type: Array, + default() { + return [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + }, + }, + // 回显数据的索引,长度必须是2 + echo: { + type: Array, + default() { + return []; + }, + }, }; export default defineComponent({ - name: "ReSelector", - props, - emits: ["selectedVal"], - setup(props, { emit }) { - const instance = getCurrentInstance(); - const currentValue = props.value; + name: 'ReSelector', + props, + emits: ['selectedVal'], + setup(props, { emit }) { + const instance = getCurrentInstance(); + const currentValue = props.value; - const rateDisabled = computed(() => { - return props.disabled; - }); + const rateDisabled = computed(() => { + return props.disabled; + }); - const classes = computed(() => { - const result = []; - let i = 0; - let threshold = currentValue; - if (currentValue !== Math.floor(currentValue)) { - threshold--; - } - for (; i < threshold; i++) { - result.push(activeClass); - } - for (; i < props.max.length; i++) { - result.push(voidClass); - } - return result; - }); + const classes = computed(() => { + const result = []; + let i = 0; + let threshold = currentValue; + if (currentValue !== Math.floor(currentValue)) { + threshold--; + } + for (; i < threshold; i++) { + result.push(activeClass); + } + for (; i < props.max.length; i++) { + result.push(voidClass); + } + return result; + }); - // 鼠标移入 - const setCurrentValue = index => { - if (props.disabled) return; - // 当选中一个元素后,开始添加背景色 - if (selectedList.length === 1) { - if (overList.length < 1) overList.push({ index }); + // 鼠标移入 + const setCurrentValue = index => { + if (props.disabled) return; + // 当选中一个元素后,开始添加背景色 + if (selectedList.length === 1) { + if (overList.length < 1) overList.push({ index }); - let firstIndex = overList[0].index; + let firstIndex = overList[0].index; - // 往右走,索引变大 - if (index > firstIndex) { - selectedDirection = "right"; - toggleClass(false, bothRightSides, document.querySelector(".hs-select__item" + selectedList[0].index)); + // 往右走,索引变大 + if (index > firstIndex) { + selectedDirection = 'right'; + toggleClass(false, bothRightSides, document.querySelector('.hs-select__item' + selectedList[0].index)); - while (index >= firstIndex) { - addClass(document.querySelector(".hs-select__item" + firstIndex), inRange); - firstIndex++; - } - } else { - selectedDirection = "left"; - toggleClass(true, bothRightSides, document.querySelector(".hs-select__item" + selectedList[0].index)); + while (index >= firstIndex) { + addClass(document.querySelector('.hs-select__item' + firstIndex), inRange); + firstIndex++; + } + } else { + selectedDirection = 'left'; + toggleClass(true, bothRightSides, document.querySelector('.hs-select__item' + selectedList[0].index)); - while (index <= firstIndex) { - addClass(document.querySelector(".hs-select__item" + firstIndex), inRange); - firstIndex--; - } - } - } + while (index <= firstIndex) { + addClass(document.querySelector('.hs-select__item' + firstIndex), inRange); + firstIndex--; + } + } + } - addClass(document.querySelector("." + voidClass + index), activeClass); - }; + addClass(document.querySelector('.' + voidClass + index), activeClass); + }; - // 鼠标离开 - const resetCurrentValue = index => { - if (props.disabled) return; - // 移除先检查是否选中 选中则返回false 不移除 - const currentHsDom = document.querySelector("." + voidClass + index); - if (currentHsDom.className.includes(stayClass)) { - return false; - } else { - removeClass(currentHsDom, activeClass); - } + // 鼠标离开 + const resetCurrentValue = index => { + if (props.disabled) return; + // 移除先检查是否选中 选中则返回false 不移除 + const currentHsDom = document.querySelector('.' + voidClass + index); + if (currentHsDom.className.includes(stayClass)) { + return false; + } else { + removeClass(currentHsDom, activeClass); + } - // 当选中一个元素后,开始移除背景色 - if (selectedList.length === 1) { - const firstIndex = overList[0].index; - if (index >= firstIndex) { - for (let i = 0; i <= index; i++) { - removeClass(document.querySelector(".hs-select__item" + i), inRange); - } - } else { - while (index <= firstIndex) { - removeClass(document.querySelector(".hs-select__item" + index), inRange); - index++; - } - } - } - }; + // 当选中一个元素后,开始移除背景色 + if (selectedList.length === 1) { + const firstIndex = overList[0].index; + if (index >= firstIndex) { + for (let i = 0; i <= index; i++) { + removeClass(document.querySelector('.hs-select__item' + i), inRange); + } + } else { + while (index <= firstIndex) { + removeClass(document.querySelector('.hs-select__item' + index), inRange); + index++; + } + } + } + }; - // 鼠标点击 - const selectValue = (index, item) => { - if (props.disabled) return; - const len = selectedList.length; + // 鼠标点击 + const selectValue = (index, item) => { + if (props.disabled) return; + const len = selectedList.length; - if (len < 2) { - selectedList.push({ item, index }); - addClass(document.querySelector("." + voidClass + index), stayClass); + if (len < 2) { + selectedList.push({ item, index }); + addClass(document.querySelector('.' + voidClass + index), stayClass); - addClass(document.querySelector(".hs-select__item" + selectedList[0].index), bothLeftSides); + addClass(document.querySelector('.hs-select__item' + selectedList[0].index), bothLeftSides); - if (selectedList[1]) { - if (selectedDirection === "right") { - addClass(document.querySelector(".hs-select__item" + selectedList[1].index), bothRightSides); - } else { - addClass(document.querySelector(".hs-select__item" + selectedList[1].index), bothLeftSides); - } - } + if (selectedList[1]) { + if (selectedDirection === 'right') { + addClass(document.querySelector('.hs-select__item' + selectedList[1].index), bothRightSides); + } else { + addClass(document.querySelector('.hs-select__item' + selectedList[1].index), bothLeftSides); + } + } - if (len === 1) { - // 顺时针排序 - if (selectedDirection === "right") { - emit("selectedVal", { - left: selectedList[0].item, - right: selectedList[1].item, - whole: selectedList - }); - } else { - emit("selectedVal", { - left: selectedList[1].item, - right: selectedList[0].item, - whole: selectedList - }); - } - } - } else { - nextTick(() => { - selectedList.forEach(v => { - removeClass(document.querySelector("." + voidClass + v.index), activeClass, stayClass); + if (len === 1) { + // 顺时针排序 + if (selectedDirection === 'right') { + emit('selectedVal', { + left: selectedList[0].item, + right: selectedList[1].item, + whole: selectedList, + }); + } else { + emit('selectedVal', { + left: selectedList[1].item, + right: selectedList[0].item, + whole: selectedList, + }); + } + } + } else { + nextTick(() => { + selectedList.forEach(v => { + removeClass(document.querySelector('.' + voidClass + v.index), activeClass, stayClass); - removeClass(document.querySelector(".hs-select__item" + v.index), bothLeftSides, bothRightSides); - }); + removeClass(document.querySelector('.hs-select__item' + v.index), bothLeftSides, bothRightSides); + }); - selectedList = []; - overList = []; - for (let i = 0; i <= props.max.length; i++) { - const currentDom = document.querySelector(".hs-select__item" + i); - if (currentDom) { - removeClass(currentDom, inRange); - } - } + selectedList = []; + overList = []; + for (let i = 0; i <= props.max.length; i++) { + const currentDom = document.querySelector('.hs-select__item' + i); + if (currentDom) { + removeClass(currentDom, inRange); + } + } - selectedList.push({ item, index }); - addClass(document.querySelector("." + voidClass + index), stayClass); + selectedList.push({ item, index }); + addClass(document.querySelector('.' + voidClass + index), stayClass); - addClass(document.querySelector(".hs-select__item" + selectedList[0].index), bothLeftSides); - }); - } - }; + addClass(document.querySelector('.hs-select__item' + selectedList[0].index), bothLeftSides); + }); + } + }; - // 回显数据 - const echoView = item => { - if (item.length === 0) return; + // 回显数据 + const echoView = item => { + if (item.length === 0) return; - if (item.length > 2 || item.length === 1) { - throw "传入的数组长度必须是2"; - } + if (item.length > 2 || item.length === 1) { + throw '传入的数组长度必须是2'; + } - item.sort((a, b) => { - return a - b; - }); + item.sort((a, b) => { + return a - b; + }); - addClass(instance.refs["hsdiv" + props.HsKey + item[0]] as Element, activeClass, stayClass); + addClass(instance.refs['hsdiv' + props.HsKey + item[0]] as Element, activeClass, stayClass); - addClass(instance.refs["hstd" + props.HsKey + item[0]] as Element, bothLeftSides); + addClass(instance.refs['hstd' + props.HsKey + item[0]] as Element, bothLeftSides); - addClass(instance.refs["hsdiv" + props.HsKey + item[1]] as Element, activeClass, stayClass); + addClass(instance.refs['hsdiv' + props.HsKey + item[1]] as Element, activeClass, stayClass); - addClass(instance.refs["hstd" + props.HsKey + item[1]] as Element, bothRightSides); + addClass(instance.refs['hstd' + props.HsKey + item[1]] as Element, bothRightSides); - while (item[1] >= item[0]) { - addClass(instance.refs["hstd" + props.HsKey + item[0]] as Element, inRange); - item[0]++; - } - }; + while (item[1] >= item[0]) { + addClass(instance.refs['hstd' + props.HsKey + item[0]] as Element, inRange); + item[0]++; + } + }; - onBeforeMount(() => { - nextTick(() => { - echoView(props.echo); - }); - }); + onBeforeMount(() => { + nextTick(() => { + echoView(props.echo); + }); + }); - return () => ( - <> - - - - {props.max.map((item, key) => { - return ( - - ); - })} - - -
setCurrentValue(key)} - onMouseleave={() => resetCurrentValue(key)} - onClick={() => selectValue(key, item)} - style={{ - cursor: unref(rateDisabled) ? "auto" : "pointer", - textAlign: "center" - }} - key={key} - > -
- {item} -
-
- - ); - } + return () => ( + <> + + + + {props.max.map((item, key) => { + return ( + + ); + })} + + +
setCurrentValue(key)} + onMouseleave={() => resetCurrentValue(key)} + onClick={() => selectValue(key, item)} + style={{ + cursor: unref(rateDisabled) ? 'auto' : 'pointer', + textAlign: 'center', + }} + key={key} + > +
+ {item} +
+
+ + ); + }, }); diff --git a/src/components/ReSplitPane/index.css b/src/components/ReSplitPane/index.css index 2c33cef..5836185 100644 --- a/src/components/ReSplitPane/index.css +++ b/src/components/ReSplitPane/index.css @@ -1,49 +1,49 @@ .clearfix::after { - clear: both; - content: " "; - display: block; - font-size: 0; - height: 0; - visibility: hidden; + clear: both; + content: " "; + display: block; + font-size: 0; + height: 0; + visibility: hidden; } .vue-splitter-container { - height: 100%; - position: relative; + height: 100%; + position: relative; } .vue-splitter-container-mask { - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; - z-index: 9999; + height: 100%; + left: 0; + position: absolute; + top: 0; + width: 100%; + z-index: 9999; } .splitter-pane.vertical.splitter-paneL { - height: 100%; - left: 0; - padding-right: 3px; - position: absolute; + height: 100%; + left: 0; + padding-right: 3px; + position: absolute; } .splitter-pane.vertical.splitter-paneR { - height: 100%; - padding-left: 3px; - position: absolute; - right: 0; + height: 100%; + padding-left: 3px; + position: absolute; + right: 0; } .splitter-pane.horizontal.splitter-paneL { - position: absolute; - top: 0; - width: 100%; + position: absolute; + top: 0; + width: 100%; } .splitter-pane.horizontal.splitter-paneR { - bottom: 0; - padding-top: 3px; - position: absolute; - width: 100%; + bottom: 0; + padding-top: 3px; + position: absolute; + width: 100%; } diff --git a/src/components/ReSplitPane/index.tsx b/src/components/ReSplitPane/index.tsx index afb67d6..873f7c6 100644 --- a/src/components/ReSplitPane/index.tsx +++ b/src/components/ReSplitPane/index.tsx @@ -1,102 +1,102 @@ -import "./index.css"; -import resizer from "./resizer"; -import { computed, defineComponent, type PropType, ref, unref } from "vue"; +import './index.css'; +import resizer from './resizer'; +import { computed, defineComponent, type PropType, ref, unref } from 'vue'; export interface ContextProps { - minPercent: number; - defaultPercent: number; - split: string; + minPercent: number; + defaultPercent: number; + split: string; } /** 切割面板组件 */ export default defineComponent({ - name: "SplitPane", - components: { resizer }, - props: { - splitSet: { - type: Object as PropType, - require: true - } - }, - emits: ["resize"], - setup(props, ctx) { - const active = ref(false); - const hasMoved = ref(false); - const percent = ref(props.splitSet?.defaultPercent); - const type = props.splitSet?.split === "vertical" ? "width" : "height"; - const resizeType = props.splitSet?.split === "vertical" ? "left" : "top"; + name: 'SplitPane', + components: { resizer }, + props: { + splitSet: { + type: Object as PropType, + require: true, + }, + }, + emits: ['resize'], + setup(props, ctx) { + const active = ref(false); + const hasMoved = ref(false); + const percent = ref(props.splitSet?.defaultPercent); + const type = props.splitSet?.split === 'vertical' ? 'width' : 'height'; + const resizeType = props.splitSet?.split === 'vertical' ? 'left' : 'top'; - const leftClass = ref(["splitter-pane splitter-paneL", props.splitSet?.split]); + const leftClass = ref(['splitter-pane splitter-paneL', props.splitSet?.split]); - const rightClass = ref(["splitter-pane splitter-paneR", props.splitSet?.split]); + const rightClass = ref(['splitter-pane splitter-paneR', props.splitSet?.split]); - const cursor = computed(() => { - return active.value ? (props.splitSet?.split === "vertical" ? { cursor: "col-resize" } : { cursor: "row-resize" }) : { cursor: "default" }; - }); + const cursor = computed(() => { + return active.value ? (props.splitSet?.split === 'vertical' ? { cursor: 'col-resize' } : { cursor: 'row-resize' }) : { cursor: 'default' }; + }); - const onClick = (): void => { - if (!hasMoved.value) { - percent.value = 50; - ctx.emit("resize", percent.value); - } - }; + const onClick = (): void => { + if (!hasMoved.value) { + percent.value = 50; + ctx.emit('resize', percent.value); + } + }; - const onMouseDown = (): void => { - active.value = true; - hasMoved.value = false; - }; + const onMouseDown = (): void => { + active.value = true; + hasMoved.value = false; + }; - const onMouseUp = (): void => { - active.value = false; - }; + const onMouseUp = (): void => { + active.value = false; + }; - const onMouseMove = (e: any): void => { - if (e.buttons === 0 || e.which === 0) { - active.value = false; - } + const onMouseMove = (e: any): void => { + if (e.buttons === 0 || e.which === 0) { + active.value = false; + } - if (active.value) { - let offset = 0; - let target = e.currentTarget; - if (props.splitSet?.split === "vertical") { - while (target) { - offset += target.offsetLeft; - target = target.offsetParent; - } - } else { - while (target) { - offset += target.offsetTop; - target = target.offsetParent; - } - } + if (active.value) { + let offset = 0; + let target = e.currentTarget; + if (props.splitSet?.split === 'vertical') { + while (target) { + offset += target.offsetLeft; + target = target.offsetParent; + } + } else { + while (target) { + offset += target.offsetTop; + target = target.offsetParent; + } + } - const currentPage = props.splitSet?.split === "vertical" ? e.pageX : e.pageY; - const targetOffset = props.splitSet?.split === "vertical" ? e.currentTarget.offsetWidth : e.currentTarget.offsetHeight; - const percents = Math.floor(((currentPage - offset) / targetOffset) * 10000) / 100; + const currentPage = props.splitSet?.split === 'vertical' ? e.pageX : e.pageY; + const targetOffset = props.splitSet?.split === 'vertical' ? e.currentTarget.offsetWidth : e.currentTarget.offsetHeight; + const percents = Math.floor(((currentPage - offset) / targetOffset) * 10000) / 100; - if (percents > props.splitSet?.minPercent && percents < 100 - props.splitSet?.minPercent) { - percent.value = percents; - } + if (percents > props.splitSet?.minPercent && percents < 100 - props.splitSet?.minPercent) { + percent.value = percents; + } - ctx.emit("resize", percent.value); + ctx.emit('resize', percent.value); - hasMoved.value = true; - } - }; + hasMoved.value = true; + } + }; - return () => ( - <> -
onMouseUp()} onMousemove={() => onMouseMove(event)}> -
- {ctx.slots.paneL()} -
- onMouseDown()} onClick={() => onClick()}> -
- {ctx.slots.paneR()} -
-
-
- - ); - } + return () => ( + <> +
onMouseUp()} onMousemove={() => onMouseMove(event)}> +
+ {ctx.slots.paneL()} +
+ onMouseDown()} onClick={() => onClick()}> +
+ {ctx.slots.paneR()} +
+
+
+ + ); + }, }); diff --git a/src/components/ReSplitPane/resizer.css b/src/components/ReSplitPane/resizer.css index 253181e..ebfb3c1 100644 --- a/src/components/ReSplitPane/resizer.css +++ b/src/components/ReSplitPane/resizer.css @@ -1,47 +1,47 @@ @import "./iconfont/iconfont.css"; .splitter-pane-resizer { - background: #000; - background-clip: padding; - background-clip: padding-box; - box-sizing: border-box; - opacity: 0.2; - position: absolute; - z-index: 1; + background: #000; + background-clip: padding; + background-clip: padding-box; + box-sizing: border-box; + opacity: 0.2; + position: absolute; + z-index: 1; } .splitter-pane-resizer.horizontal { - background: #e5e6eb; - cursor: row-resize; - height: 6px; - width: 100%; + background: #e5e6eb; + cursor: row-resize; + height: 6px; + width: 100%; } .splitter-pane-resizer.horizontal:before { - color: #000; - content: "\eda3"; - font-family: "iconfont"; - font-size: 13px; - left: 50%; - position: absolute; - top: 50%; - transform: translate(-50%, -50%); + color: #000; + content: "\eda3"; + font-family: "iconfont"; + font-size: 13px; + left: 50%; + position: absolute; + top: 50%; + transform: translate(-50%, -50%); } .splitter-pane-resizer.vertical { - background: #e5e6eb; - cursor: col-resize; - height: 100%; - width: 6px; + background: #e5e6eb; + cursor: col-resize; + height: 100%; + width: 6px; } .splitter-pane-resizer.vertical:before { - color: #000; - content: "\e647"; - font-family: "iconfont"; - font-size: 13px; - left: 50%; - position: absolute; - top: 50%; - transform: translate(-50%, -50%); + color: #000; + content: "\e647"; + font-family: "iconfont"; + font-size: 13px; + left: 50%; + position: absolute; + top: 50%; + transform: translate(-50%, -50%); } diff --git a/src/components/ReSplitPane/resizer.tsx b/src/components/ReSplitPane/resizer.tsx index 75d665e..a2e8d0b 100644 --- a/src/components/ReSplitPane/resizer.tsx +++ b/src/components/ReSplitPane/resizer.tsx @@ -1,23 +1,23 @@ -import "./resizer.css"; -import { computed, defineComponent, unref } from "vue"; +import './resizer.css'; +import { computed, defineComponent, unref } from 'vue'; export default defineComponent({ - name: "Resizer", - props: { - split: { - type: String, - required: true - }, - className: { - type: String, - default: "" - } - }, - setup(props) { - const classes = computed(() => { - return ["splitter-pane-resizer", props.split, props.className].join(" "); - }); + name: 'Resizer', + props: { + split: { + type: String, + required: true, + }, + className: { + type: String, + default: '', + }, + }, + setup(props) { + const classes = computed(() => { + return ['splitter-pane-resizer', props.split, props.className].join(' '); + }); - return () =>
; - } + return () =>
; + }, }); diff --git a/src/components/ReText/index.ts b/src/components/ReText/index.ts index 6213566..173669d 100644 --- a/src/components/ReText/index.ts +++ b/src/components/ReText/index.ts @@ -1,5 +1,5 @@ -import reText from "./src/index.vue"; -import { withInstall } from "@pureadmin/utils"; +import reText from './src/index.vue'; +import { withInstall } from '@pureadmin/utils'; /** 支持`Tooltip`提示的文本省略组件 */ export const ReText = withInstall(reText); diff --git a/src/components/ReText/src/index.vue b/src/components/ReText/src/index.vue index aaa43b9..2ef4202 100644 --- a/src/components/ReText/src/index.vue +++ b/src/components/ReText/src/index.vue @@ -1,58 +1,57 @@ diff --git a/src/components/ReTreeLine/index.scss b/src/components/ReTreeLine/index.scss index c3d22d2..c21e15c 100644 --- a/src/components/ReTreeLine/index.scss +++ b/src/components/ReTreeLine/index.scss @@ -23,12 +23,10 @@ $--element-tree-line-width: 1px !default; left: 0; display: block; height: 100%; - border-left: $--element-tree-line-width $--element-tree-line-style - $--element-tree-line-color; + border-left: $--element-tree-line-width $--element-tree-line-style $--element-tree-line-color; &.last-node-line { - border-left: $--element-tree-line-width $--element-tree-line-style - transparent; + border-left: $--element-tree-line-width $--element-tree-line-style transparent; } &.last-node-isLeaf-line { @@ -42,14 +40,12 @@ $--element-tree-line-width: 1px !default; left: 0; display: block; height: 0; - border-bottom: $--element-tree-line-width $--element-tree-line-style - $--element-tree-line-color; + border-bottom: $--element-tree-line-width $--element-tree-line-style $--element-tree-line-color; } .element-tree-node-label-line { flex: 1; align-self: center; margin: 0 10px; - border-top: $--element-tree-line-width $--element-tree-line-style - $--element-tree-line-color; + border-top: $--element-tree-line-width $--element-tree-line-style $--element-tree-line-color; } diff --git a/src/components/ReTreeLine/index.ts b/src/components/ReTreeLine/index.ts index f4c99a9..9d99762 100644 --- a/src/components/ReTreeLine/index.ts +++ b/src/components/ReTreeLine/index.ts @@ -1,145 +1,145 @@ // 参考https://www.npmjs.com/package/element-tree-line (主要是替换需要通过函数传参的方式去注册组件,并添加更好的类型支持,并移除this.$scopedSlots,在3.x中,将所有this.$scopedSlots替换为this.$slots) -import "./index.scss"; -import { isFunction } from "@pureadmin/utils"; -import { defineComponent, h, type PropType } from "vue"; -import type { TreeData, TreeNode, TreeNodeData } from "element-plus/es/components/tree-v2/src/types"; +import './index.scss'; +import { isFunction } from '@pureadmin/utils'; +import { defineComponent, h, type PropType } from 'vue'; +import type { TreeData, TreeNode, TreeNodeData } from 'element-plus/es/components/tree-v2/src/types'; /** 树形连接线组件 */ export default defineComponent({ - name: "ReTreeLine", - props: { - node: { - type: Object as PropType, - required: true - }, - data: { - type: Array as PropType, - default: () => {} - }, - treeData: { - type: Array as PropType, - default: () => [] - }, - indent: { - type: Number, - default: 16 - }, - showLabelLine: { - type: Boolean, - default: true - } - }, - setup(_, context) { - const { slots } = context; - const getScopedSlot = slotName => { - if (!slotName) { - return null; - } - const slotNameSplits = slotName.split("||"); - let slot = null; - for (let index = 0; index < slotNameSplits.length; index++) { - const name = slotNameSplits[index]; - slot = (slots || {})[name]; - } - return slot; - }; - const getSlotValue = (slot, scopedData, defaultNode = null) => { - if (isFunction(slot)) { - return slot(scopedData) || defaultNode; - } - return slot || defaultNode; - }; + name: 'ReTreeLine', + props: { + node: { + type: Object as PropType, + required: true, + }, + data: { + type: Array as PropType, + default: () => {}, + }, + treeData: { + type: Array as PropType, + default: () => [], + }, + indent: { + type: Number, + default: 16, + }, + showLabelLine: { + type: Boolean, + default: true, + }, + }, + setup(_, context) { + const { slots } = context; + const getScopedSlot = slotName => { + if (!slotName) { + return null; + } + const slotNameSplits = slotName.split('||'); + let slot = null; + for (let index = 0; index < slotNameSplits.length; index++) { + const name = slotNameSplits[index]; + slot = (slots || {})[name]; + } + return slot; + }; + const getSlotValue = (slot, scopedData, defaultNode = null) => { + if (isFunction(slot)) { + return slot(scopedData) || defaultNode; + } + return slot || defaultNode; + }; - return { - getScopedSlot, - getSlotValue - }; - }, - render() { - // 自定义整行节点label区域 - const scopeSlotDefault = this.getScopedSlot("default"); - // 显示横线时自定义节点label区域 - const labelSlot = this.getScopedSlot("node-label"); - // 显示横线时追加在横线右边的内容 - const afterLabelSlot = this.getScopedSlot("after-node-label"); - const labelNodes = scopeSlotDefault - ? this.getSlotValue(scopeSlotDefault, { - node: this.node, - data: this.data - }) - : [ - labelSlot - ? this.getSlotValue(labelSlot, { - node: this.node, - data: this.data - }) - : h("span", { class: "element-tree-node-label" }, this.node.label), - this.showLabelLine - ? h("span", { - class: "element-tree-node-label-line" - }) - : null, - this.getSlotValue(afterLabelSlot, { - node: this.node, - data: this.data - }) - ]; - // 取得每一层的当前节点是不是在当前层级列表的最后一个 - const lastnodeArr = []; - let currentNode = this.node; - while (currentNode) { - let parentNode = currentNode.parent; - // 兼容element-plus的 el-tree-v2 (Virtualized Tree 虚拟树) - if (currentNode.level === 1 && !currentNode.parent) { - // el-tree-v2的第一层node是没有parent的,必需 treeData 创建一个parent - if (!this.treeData || !Array.isArray(this.treeData)) { - throw Error("if you using el-tree-v2 (Virtualized Tree) of element-plus,element-tree-line required data."); - } - parentNode = { - children: Array.isArray(this.treeData) - ? this.treeData.map(item => { - return { ...item, key: item.id }; - }) - : [], - level: 0, - key: "node-0", - parent: null - }; - } - if (parentNode) { - // element-plus的 el-tree-v2 使用的是children和key, 其他使用的是 childNodes和id - const index = (parentNode.children || parentNode.childNodes).findIndex(item => (item.key || item.id) === (currentNode.key || currentNode.id)); - lastnodeArr.unshift(index === (parentNode.children || parentNode.childNodes).length - 1); - } - currentNode = parentNode; - } - const lineNodes = []; - for (let i = 0; i < this.node.level; i++) { - lineNodes.push( - h("span", { - class: { - "element-tree-node-line-ver": true, - "last-node-line": lastnodeArr[i] && this.node.level - 1 !== i, - "last-node-isLeaf-line": lastnodeArr[i] && this.node.level - 1 === i - }, - style: { left: this.indent * i + "px" } - }) - ); - } - return h( - "span", - { - class: "element-tree-node-label-wrapper" - }, - [labelNodes].concat(lineNodes).concat([ - h("span", { - class: "element-tree-node-line-hor", - style: { - width: (this.node.isLeaf ? 24 : 8) + "px", - left: (this.node.level - 1) * this.indent + "px" - } - }) - ]) - ); - } + return { + getScopedSlot, + getSlotValue, + }; + }, + render() { + // 自定义整行节点label区域 + const scopeSlotDefault = this.getScopedSlot('default'); + // 显示横线时自定义节点label区域 + const labelSlot = this.getScopedSlot('node-label'); + // 显示横线时追加在横线右边的内容 + const afterLabelSlot = this.getScopedSlot('after-node-label'); + const labelNodes = scopeSlotDefault + ? this.getSlotValue(scopeSlotDefault, { + node: this.node, + data: this.data, + }) + : [ + labelSlot + ? this.getSlotValue(labelSlot, { + node: this.node, + data: this.data, + }) + : h('span', { class: 'element-tree-node-label' }, this.node.label), + this.showLabelLine + ? h('span', { + class: 'element-tree-node-label-line', + }) + : null, + this.getSlotValue(afterLabelSlot, { + node: this.node, + data: this.data, + }), + ]; + // 取得每一层的当前节点是不是在当前层级列表的最后一个 + const lastnodeArr = []; + let currentNode = this.node; + while (currentNode) { + let parentNode = currentNode.parent; + // 兼容element-plus的 el-tree-v2 (Virtualized Tree 虚拟树) + if (currentNode.level === 1 && !currentNode.parent) { + // el-tree-v2的第一层node是没有parent的,必需 treeData 创建一个parent + if (!this.treeData || !Array.isArray(this.treeData)) { + throw Error('if you using el-tree-v2 (Virtualized Tree) of element-plus,element-tree-line required data.'); + } + parentNode = { + children: Array.isArray(this.treeData) + ? this.treeData.map(item => { + return { ...item, key: item.id }; + }) + : [], + level: 0, + key: 'node-0', + parent: null, + }; + } + if (parentNode) { + // element-plus的 el-tree-v2 使用的是children和key, 其他使用的是 childNodes和id + const index = (parentNode.children || parentNode.childNodes).findIndex(item => (item.key || item.id) === (currentNode.key || currentNode.id)); + lastnodeArr.unshift(index === (parentNode.children || parentNode.childNodes).length - 1); + } + currentNode = parentNode; + } + const lineNodes = []; + for (let i = 0; i < this.node.level; i++) { + lineNodes.push( + h('span', { + class: { + 'element-tree-node-line-ver': true, + 'last-node-line': lastnodeArr[i] && this.node.level - 1 !== i, + 'last-node-isLeaf-line': lastnodeArr[i] && this.node.level - 1 === i, + }, + style: { left: this.indent * i + 'px' }, + }), + ); + } + return h( + 'span', + { + class: 'element-tree-node-label-wrapper', + }, + [labelNodes].concat(lineNodes).concat([ + h('span', { + class: 'element-tree-node-line-hor', + style: { + width: (this.node.isLeaf ? 24 : 8) + 'px', + left: (this.node.level - 1) * this.indent + 'px', + }, + }), + ]), + ); + }, }); diff --git a/src/components/ReTypeit/src/index.tsx b/src/components/ReTypeit/src/index.tsx index bfbaa58..84afbe9 100644 --- a/src/components/ReTypeit/src/index.tsx +++ b/src/components/ReTypeit/src/index.tsx @@ -1,49 +1,49 @@ -import type { El } from "typeit/dist/types"; -import TypeIt, { type Options as TypeItOptions } from "typeit"; -import { defineComponent, onMounted, type PropType, ref } from "vue"; +import type { El } from 'typeit/dist/types'; +import TypeIt, { type Options as TypeItOptions } from 'typeit'; +import { defineComponent, onMounted, type PropType, ref } from 'vue'; // 打字机效果组件(配置项详情请查阅 https://www.typeitjs.com/docs/vanilla/usage#options) export default defineComponent({ - name: "TypeIt", - props: { - options: { - type: Object as PropType, - default: () => ({}) as TypeItOptions - } - }, - setup(props, { slots, expose }) { - /** - * 输出错误信息 - * @param message 错误信息 - */ - function throwError(message: string) { - throw new TypeError(message); - } + name: 'TypeIt', + props: { + options: { + type: Object as PropType, + default: () => ({}) as TypeItOptions, + }, + }, + setup(props, { slots, expose }) { + /** + * 输出错误信息 + * @param message 错误信息 + */ + function throwError(message: string) { + throw new TypeError(message); + } - /** - * 获取浏览器默认语言 - */ - function getBrowserLanguage() { - return navigator.language; - } + /** + * 获取浏览器默认语言 + */ + function getBrowserLanguage() { + return navigator.language; + } - const typedItRef = ref(null); + const typedItRef = ref(null); - onMounted(() => { - const $typed = typedItRef.value!.querySelector(".type-it") as El; + onMounted(() => { + const $typed = typedItRef.value!.querySelector('.type-it') as El; - if (!$typed) { - const errorMsg = getBrowserLanguage() === "zh-CN" ? "请确保有且只有一个具有class属性为 'type-it' 的元素" : "Please make sure that there is only one element with a Class attribute with 'type-it'"; - throwError(errorMsg); - } + if (!$typed) { + const errorMsg = getBrowserLanguage() === 'zh-CN' ? "请确保有且只有一个具有class属性为 'type-it' 的元素" : "Please make sure that there is only one element with a Class attribute with 'type-it'"; + throwError(errorMsg); + } - const typeIt = new TypeIt($typed, props.options).go(); + const typeIt = new TypeIt($typed, props.options).go(); - expose({ - typeIt - }); - }); + expose({ + typeIt, + }); + }); - return () =>
{slots.default?.() ?? }
; - } + return () =>
{slots.default?.() ?? }
; + }, }); diff --git a/src/components/Result/columns.tsx b/src/components/Result/columns.tsx index f6ad232..045f4e9 100644 --- a/src/components/Result/columns.tsx +++ b/src/components/Result/columns.tsx @@ -1,62 +1,36 @@ -import ArrowRightSLine from "@iconify-icons/ri/arrow-right-s-line"; -import CloseCircleLine from "@iconify-icons/ri/close-circle-line"; +import ArrowRightSLine from '@iconify-icons/ri/arrow-right-s-line'; +import CloseCircleLine from '@iconify-icons/ri/close-circle-line'; export function useColumns() { - const columns = [ - { - cellRenderer: () => { - return ( -
-
- - 您的账户已被冻结 - - 立即解冻 - - -
-
-
- - 您的账户还不具备申请资格 - - 立即升级 - - -
-
- ); - } - } - ]; + const columns = [ + { + cellRenderer: () => { + return ( +
+
+ + 您的账户已被冻结 + + 立即解冻 + + +
+
+
+ + 您的账户还不具备申请资格 + + 立即升级 + + +
+
+ ); + }, + }, + ]; - return { - columns - }; + return { + columns, + }; } diff --git a/src/components/Result/fail.vue b/src/components/Result/fail.vue index 98b6cef..e6e4d67 100644 --- a/src/components/Result/fail.vue +++ b/src/components/Result/fail.vue @@ -1,45 +1,32 @@ - diff --git a/src/components/Result/success.vue b/src/components/Result/success.vue index 8871a65..5565763 100644 --- a/src/components/Result/success.vue +++ b/src/components/Result/success.vue @@ -1,99 +1,80 @@ - diff --git a/src/plugins/echarts.ts b/src/plugins/echarts.ts index cb62d96..ba53c1e 100644 --- a/src/plugins/echarts.ts +++ b/src/plugins/echarts.ts @@ -1,36 +1,26 @@ -import type { App } from "vue"; -import * as echarts from "echarts/core"; -import { PieChart, BarChart, LineChart } from "echarts/charts"; -import { CanvasRenderer, SVGRenderer } from "echarts/renderers"; -import { - GridComponent, - TitleComponent, - PolarComponent, - LegendComponent, - GraphicComponent, - ToolboxComponent, - TooltipComponent, - DataZoomComponent, - VisualMapComponent -} from "echarts/components"; +import type { App } from 'vue'; +import * as echarts from 'echarts/core'; +import { BarChart, LineChart, PieChart } from 'echarts/charts'; +import { CanvasRenderer, SVGRenderer } from 'echarts/renderers'; +import { DataZoomComponent, GraphicComponent, GridComponent, LegendComponent, PolarComponent, TitleComponent, ToolboxComponent, TooltipComponent, VisualMapComponent } from 'echarts/components'; const { use } = echarts; use([ - PieChart, - BarChart, - LineChart, - CanvasRenderer, - SVGRenderer, - GridComponent, - TitleComponent, - PolarComponent, - LegendComponent, - GraphicComponent, - ToolboxComponent, - TooltipComponent, - DataZoomComponent, - VisualMapComponent + PieChart, + BarChart, + LineChart, + CanvasRenderer, + SVGRenderer, + GridComponent, + TitleComponent, + PolarComponent, + LegendComponent, + GraphicComponent, + ToolboxComponent, + TooltipComponent, + DataZoomComponent, + VisualMapComponent, ]); /** @@ -38,7 +28,7 @@ use([ * @see 温馨提示:必须将 `$echarts` 添加到全局 `globalProperties` ,具体看 https://pure-admin-utils.netlify.app/hooks/useECharts/useECharts#%E4%BD%BF%E7%94%A8%E5%89%8D%E6%8F%90 */ export function useEcharts(app: App) { - app.config.globalProperties.$echarts = echarts; + app.config.globalProperties.$echarts = echarts; } export default echarts; diff --git a/src/plugins/elementPlus.ts b/src/plugins/elementPlus.ts index 2ff3b5b..de6aea4 100644 --- a/src/plugins/elementPlus.ts +++ b/src/plugins/elementPlus.ts @@ -1,246 +1,239 @@ // 按需引入element-plus(该方法稳定且明确。当然也支持:https://element-plus.org/zh-CN/guide/quickstart.html#%E6%8C%89%E9%9C%80%E5%AF%BC%E5%85%A5) -import type { App, Component } from "vue"; +import type { App, Component } from 'vue'; import { - /** - * 为了方便演示平台将 element-plus 导出的所有组件引入,实际使用中如果你没用到哪个组件,将其注释掉就行 - * 导出来源:https://github.com/element-plus/element-plus/blob/dev/packages/element-plus/component.ts#L111-L211 - * */ - ElAffix, - ElAlert, - ElAutocomplete, - ElAutoResizer, - ElAvatar, - ElAnchor, - ElAnchorLink, - ElBacktop, - ElBadge, - ElBreadcrumb, - ElBreadcrumbItem, - ElButton, - ElButtonGroup, - ElCalendar, - ElCard, - ElCarousel, - ElCarouselItem, - ElCascader, - ElCascaderPanel, - ElCheckTag, - ElCheckbox, - ElCheckboxButton, - ElCheckboxGroup, - ElCol, - ElCollapse, - ElCollapseItem, - ElCollapseTransition, - ElColorPicker, - ElConfigProvider, - ElContainer, - ElAside, - ElFooter, - ElHeader, - ElMain, - ElDatePicker, - ElDescriptions, - ElDescriptionsItem, - ElDialog, - ElDivider, - ElDrawer, - ElDropdown, - ElDropdownItem, - ElDropdownMenu, - ElEmpty, - ElForm, - ElFormItem, - ElIcon, - ElImage, - ElImageViewer, - ElInput, - ElInputNumber, - ElLink, - ElMenu, - ElMenuItem, - ElMenuItemGroup, - ElSubMenu, - ElPageHeader, - ElPagination, - ElPopconfirm, - ElPopover, - ElPopper, - ElProgress, - ElRadio, - ElRadioButton, - ElRadioGroup, - ElRate, - ElResult, - ElRow, - ElScrollbar, - ElSelect, - ElOption, - ElOptionGroup, - ElSelectV2, - ElSkeleton, - ElSkeletonItem, - ElSlider, - ElSpace, - ElStatistic, - ElCountdown, - ElSteps, - ElStep, - ElSwitch, - ElTable, - ElTableColumn, - ElTableV2, - ElTabs, - ElTabPane, - ElTag, - ElText, - ElTimePicker, - ElTimeSelect, - ElTimeline, - ElTimelineItem, - ElTooltip, - ElTransfer, - ElTree, - ElTreeSelect, - ElTreeV2, - ElUpload, - ElWatermark, - ElTour, - ElTourStep, - /** - * 为了方便演示平台将 element-plus 导出的所有插件引入,实际使用中如果你没用到哪个插件,将其注释掉就行 - * 导出来源:https://github.com/element-plus/element-plus/blob/dev/packages/element-plus/plugin.ts#L11-L16 - * */ - ElLoading, // v-loading 指令 - ElInfiniteScroll, // v-infinite-scroll 指令 - ElPopoverDirective, // v-popover 指令 - ElMessage, // $message 全局属性对象globalProperties - ElMessageBox, // $msgbox、$alert、$confirm、$prompt 全局属性对象globalProperties - ElNotification // $notify 全局属性对象globalProperties -} from "element-plus"; + /** + * 为了方便演示平台将 element-plus 导出的所有组件引入,实际使用中如果你没用到哪个组件,将其注释掉就行 + * 导出来源:https://github.com/element-plus/element-plus/blob/dev/packages/element-plus/component.ts#L111-L211 + * */ + ElAffix, + ElAlert, + ElAnchor, + ElAnchorLink, + ElAside, + ElAutocomplete, + ElAutoResizer, + ElAvatar, + ElBacktop, + ElBadge, + ElBreadcrumb, + ElBreadcrumbItem, + ElButton, + ElButtonGroup, + ElCalendar, + ElCard, + ElCarousel, + ElCarouselItem, + ElCascader, + ElCascaderPanel, + ElCheckbox, + ElCheckboxButton, + ElCheckboxGroup, + ElCheckTag, + ElCol, + ElCollapse, + ElCollapseItem, + ElCollapseTransition, + ElColorPicker, + ElConfigProvider, + ElContainer, + ElCountdown, + ElDatePicker, + ElDescriptions, + ElDescriptionsItem, + ElDialog, + ElDivider, + ElDrawer, + ElDropdown, + ElDropdownItem, + ElDropdownMenu, + ElEmpty, + ElFooter, + ElForm, + ElFormItem, + ElHeader, + ElIcon, + ElImage, + ElImageViewer, + ElInfiniteScroll, + ElInput, + ElInputNumber, + ElLink, + /** + * 为了方便演示平台将 element-plus 导出的所有插件引入,实际使用中如果你没用到哪个插件,将其注释掉就行 + * 导出来源:https://github.com/element-plus/element-plus/blob/dev/packages/element-plus/plugin.ts#L11-L16 + * */ + ElLoading, + ElMain, + ElMenu, + ElMenuItem, + ElMenuItemGroup, + ElMessage, + ElMessageBox, + ElNotification, + ElOption, + ElOptionGroup, + ElPageHeader, + ElPagination, + ElPopconfirm, + ElPopover, + ElPopoverDirective, + ElPopper, + ElProgress, + ElRadio, + ElRadioButton, + ElRadioGroup, + ElRate, + ElResult, + ElRow, + ElScrollbar, + ElSelect, + ElSelectV2, + ElSkeleton, + ElSkeletonItem, + ElSlider, + ElSpace, + ElStatistic, + ElStep, + ElSteps, + ElSubMenu, + ElSwitch, + ElTable, + ElTableColumn, + ElTableV2, + ElTabPane, + ElTabs, + ElTag, + ElText, + ElTimeline, + ElTimelineItem, + ElTimePicker, + ElTimeSelect, + ElTooltip, + ElTour, + ElTourStep, + ElTransfer, + ElTree, + ElTreeSelect, + ElTreeV2, + ElUpload, + ElWatermark, +} from 'element-plus'; const components = [ - ElAffix, - ElAlert, - ElAutocomplete, - ElAutoResizer, - ElAvatar, - ElAnchor, - ElAnchorLink, - ElBacktop, - ElBadge, - ElBreadcrumb, - ElBreadcrumbItem, - ElButton, - ElButtonGroup, - ElCalendar, - ElCard, - ElCarousel, - ElCarouselItem, - ElCascader, - ElCascaderPanel, - ElCheckTag, - ElCheckbox, - ElCheckboxButton, - ElCheckboxGroup, - ElCol, - ElCollapse, - ElCollapseItem, - ElCollapseTransition, - ElColorPicker, - ElConfigProvider, - ElContainer, - ElAside, - ElFooter, - ElHeader, - ElMain, - ElDatePicker, - ElDescriptions, - ElDescriptionsItem, - ElDialog, - ElDivider, - ElDrawer, - ElDropdown, - ElDropdownItem, - ElDropdownMenu, - ElEmpty, - ElForm, - ElFormItem, - ElIcon, - ElImage, - ElImageViewer, - ElInput, - ElInputNumber, - ElLink, - ElMenu, - ElMenuItem, - ElMenuItemGroup, - ElSubMenu, - ElPageHeader, - ElPagination, - ElPopconfirm, - ElPopover, - ElPopper, - ElProgress, - ElRadio, - ElRadioButton, - ElRadioGroup, - ElRate, - ElResult, - ElRow, - ElScrollbar, - ElSelect, - ElOption, - ElOptionGroup, - ElSelectV2, - ElSkeleton, - ElSkeletonItem, - ElSlider, - ElSpace, - ElStatistic, - ElCountdown, - ElSteps, - ElStep, - ElSwitch, - ElTable, - ElTableColumn, - ElTableV2, - ElTabs, - ElTabPane, - ElTag, - ElText, - ElTimePicker, - ElTimeSelect, - ElTimeline, - ElTimelineItem, - ElTooltip, - ElTransfer, - ElTree, - ElTreeSelect, - ElTreeV2, - ElUpload, - ElWatermark, - ElTour, - ElTourStep + ElAffix, + ElAlert, + ElAutocomplete, + ElAutoResizer, + ElAvatar, + ElAnchor, + ElAnchorLink, + ElBacktop, + ElBadge, + ElBreadcrumb, + ElBreadcrumbItem, + ElButton, + ElButtonGroup, + ElCalendar, + ElCard, + ElCarousel, + ElCarouselItem, + ElCascader, + ElCascaderPanel, + ElCheckTag, + ElCheckbox, + ElCheckboxButton, + ElCheckboxGroup, + ElCol, + ElCollapse, + ElCollapseItem, + ElCollapseTransition, + ElColorPicker, + ElConfigProvider, + ElContainer, + ElAside, + ElFooter, + ElHeader, + ElMain, + ElDatePicker, + ElDescriptions, + ElDescriptionsItem, + ElDialog, + ElDivider, + ElDrawer, + ElDropdown, + ElDropdownItem, + ElDropdownMenu, + ElEmpty, + ElForm, + ElFormItem, + ElIcon, + ElImage, + ElImageViewer, + ElInput, + ElInputNumber, + ElLink, + ElMenu, + ElMenuItem, + ElMenuItemGroup, + ElSubMenu, + ElPageHeader, + ElPagination, + ElPopconfirm, + ElPopover, + ElPopper, + ElProgress, + ElRadio, + ElRadioButton, + ElRadioGroup, + ElRate, + ElResult, + ElRow, + ElScrollbar, + ElSelect, + ElOption, + ElOptionGroup, + ElSelectV2, + ElSkeleton, + ElSkeletonItem, + ElSlider, + ElSpace, + ElStatistic, + ElCountdown, + ElSteps, + ElStep, + ElSwitch, + ElTable, + ElTableColumn, + ElTableV2, + ElTabs, + ElTabPane, + ElTag, + ElText, + ElTimePicker, + ElTimeSelect, + ElTimeline, + ElTimelineItem, + ElTooltip, + ElTransfer, + ElTree, + ElTreeSelect, + ElTreeV2, + ElUpload, + ElWatermark, + ElTour, + ElTourStep, ]; -const plugins = [ - ElLoading, - ElInfiniteScroll, - ElPopoverDirective, - ElMessage, - ElMessageBox, - ElNotification -]; +const plugins = [ElLoading, ElInfiniteScroll, ElPopoverDirective, ElMessage, ElMessageBox, ElNotification]; /** 按需引入`element-plus` */ export function useElementPlus(app: App) { - // 全局注册组件 - components.forEach((component: Component) => { - app.component(component.name, component); - }); - // 全局注册插件 - plugins.forEach(plugin => { - app.use(plugin); - }); + // 全局注册组件 + components.forEach((component: Component) => { + app.component(component.name, component); + }); + // 全局注册插件 + plugins.forEach(plugin => { + app.use(plugin); + }); } diff --git a/vite.config.ts b/vite.config.ts index 1d1b01a..95fac64 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,62 +1,55 @@ -import { getPluginsList } from "./build/plugins"; -import { include, exclude } from "./build/optimize"; -import { type UserConfigExport, type ConfigEnv, loadEnv } from "vite"; -import { - root, - alias, - wrapperEnv, - pathResolve, - __APP_INFO__ -} from "./build/utils"; +import { getPluginsList } from './build/plugins'; +import { include, exclude } from './build/optimize'; +import { type UserConfigExport, type ConfigEnv, loadEnv } from 'vite'; +import { root, alias, wrapperEnv, pathResolve, __APP_INFO__ } from './build/utils'; export default ({ mode }: ConfigEnv): UserConfigExport => { - const { VITE_CDN, VITE_PORT, VITE_COMPRESSION, VITE_PUBLIC_PATH } = - wrapperEnv(loadEnv(mode, root)); - return { - base: VITE_PUBLIC_PATH, - root, - resolve: { - alias - }, - // 服务端渲染 - server: { - // 端口号 - port: VITE_PORT, - host: "0.0.0.0", - // 本地跨域代理 https://cn.vitejs.dev/config/server-options.html#server-proxy - proxy: {}, - // 预热文件以提前转换和缓存结果,降低启动期间的初始页面加载时长并防止转换瀑布 - warmup: { - clientFiles: ["./index.html", "./src/{views,components}/*"] - } - }, - plugins: getPluginsList(VITE_CDN, VITE_COMPRESSION), - // https://cn.vitejs.dev/config/dep-optimization-options.html#dep-optimization-options - optimizeDeps: { - include, - exclude - }, - build: { - // https://cn.vitejs.dev/guide/build.html#browser-compatibility - target: "es2015", - sourcemap: false, - // 消除打包大小超过500kb警告 - chunkSizeWarningLimit: 4000, - rollupOptions: { - input: { - index: pathResolve("./index.html", import.meta.url) - }, - // 静态资源分类打包 - output: { - chunkFileNames: "static/js/[name]-[hash].js", - entryFileNames: "static/js/[name]-[hash].js", - assetFileNames: "static/[ext]/[name]-[hash].[ext]" - } - } - }, - define: { - __INTLIFY_PROD_DEVTOOLS__: false, - __APP_INFO__: JSON.stringify(__APP_INFO__) - } - }; + const { VITE_CDN, VITE_PORT, VITE_COMPRESSION, VITE_PUBLIC_PATH } = wrapperEnv(loadEnv(mode, root)); + return { + base: VITE_PUBLIC_PATH, + root, + resolve: { + alias, + }, + // 服务端渲染 + server: { + // 端口号 + port: VITE_PORT, + host: '0.0.0.0', + // 本地跨域代理 https://cn.vitejs.dev/config/server-options.html#server-proxy + proxy: {}, + // 预热文件以提前转换和缓存结果,降低启动期间的初始页面加载时长并防止转换瀑布 + warmup: { + clientFiles: ['./index.html', './src/{views,components}/*'], + }, + }, + plugins: getPluginsList(VITE_CDN, VITE_COMPRESSION), + // https://cn.vitejs.dev/config/dep-optimization-options.html#dep-optimization-options + optimizeDeps: { + include, + exclude, + }, + build: { + // https://cn.vitejs.dev/guide/build.html#browser-compatibility + target: 'es2015', + sourcemap: false, + // 消除打包大小超过500kb警告 + chunkSizeWarningLimit: 4000, + rollupOptions: { + input: { + index: pathResolve('./index.html', import.meta.url), + }, + // 静态资源分类打包 + output: { + chunkFileNames: 'static/js/[name]-[hash].js', + entryFileNames: 'static/js/[name]-[hash].js', + assetFileNames: 'static/[ext]/[name]-[hash].[ext]', + }, + }, + }, + define: { + __INTLIFY_PROD_DEVTOOLS__: false, + __APP_INFO__: JSON.stringify(__APP_INFO__), + }, + }; }; -- 2.43.0