From f443eb6bbef2e89fc11080d311d755b05074204c Mon Sep 17 00:00:00 2001 From: "Ray.Hao" <1490493387@qq.com> Date: Thu, 29 Oct 2026 08:13:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=8A=B6=E6=80=81=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E4=B8=BA=E5=9C=86=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增状态圆点组件,用户管理、角色与字典的状态改用圆点 - 用户管理操作列放宽到 200,登录页移动端版本号紧随项目名 - 应用中心分组按内容高度排列 - 函数注释统一为展开式多行 - 格式校验脚本忽略不存在的目录 --- mock/codegen.mock.ts | 12 +++++-- package.json | 2 +- src/components/StatusDot/index.vue | 27 ++++++++++++++++ src/components/TableSelect/index.vue | 4 ++- src/composables/usePageTable.ts | 16 +++++++--- src/views/demo/table/vxe-table/index.vue | 32 ++++++++++++++----- src/views/login/index.vue | 12 +++++++ .../system/dict/components/DictItemPanel.vue | 12 +++++-- src/views/system/dict/index.vue | 20 +++++++++++- src/views/system/role/index.vue | 18 ++--------- src/views/system/user/index.vue | 2 +- .../workflow/components/BpmnDesigner.vue | 8 +++-- src/views/workspace/apps/index.vue | 7 ++++ 13 files changed, 133 insertions(+), 39 deletions(-) create mode 100644 src/components/StatusDot/index.vue diff --git a/mock/codegen.mock.ts b/mock/codegen.mock.ts index a20b88a2..eef1ecd8 100644 --- a/mock/codegen.mock.ts +++ b/mock/codegen.mock.ts @@ -36,7 +36,9 @@ const tableList = [ }, ]; -/** 下划线命名转驼峰首字母大写,如 sys_user → SysUser */ +/** + * 下划线命名转驼峰首字母大写,如 sys_user → SysUser + */ function toPascalCase(name: string): string { return name .split("_") @@ -196,7 +198,9 @@ const genConfigMap: Record = { }, }; -/** 未配置表的默认生成配置(无 id,进入抽屉后从基础配置步骤开始) */ +/** + * 未配置表的默认生成配置(无 id,进入抽屉后从基础配置步骤开始) + */ function buildDefaultConfig(tableName: string) { return { tableName, @@ -214,7 +218,9 @@ function buildDefaultConfig(tableName: string) { }; } -/** 构造代码生成预览文件列表 */ +/** + * 构造代码生成预览文件列表 + */ function buildPreviewFiles(tableName: string, tableComment: string) { const bizName = tableName.replace(/^sys_/, ""); const entityName = toPascalCase(bizName); diff --git a/package.json b/package.json index 7edba4c5..2493f829 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "lint:lint-staged": "lint-staged", "lint": "pnpm run lint:eslint && pnpm run lint:prettier && pnpm run lint:stylelint", "lint:check": "eslint src mock vite.config.ts uno.config.ts eslint.config.ts", - "format:check": "prettier --check \"src/**/*.{ts,vue,scss,css,json}\" \"mock/**/*.ts\" \"*.{ts,cjs,mjs,json,yaml}\" \".github/workflows/*.{yml,yaml}\"", + "format:check": "prettier --check --no-error-on-unmatched-pattern \"src/**/*.{ts,vue,scss,css,json}\" \"mock/**/*.ts\" \"*.{ts,cjs,mjs,json,yaml}\" \".github/workflows/*.{yml,yaml}\"", "style:check": "stylelint \"src/**/*.{css,scss,vue}\"", "check": "pnpm run type-check && pnpm run lint:check && pnpm run format:check && pnpm run style:check", "preinstall": "npx only-allow pnpm", diff --git a/src/components/StatusDot/index.vue b/src/components/StatusDot/index.vue new file mode 100644 index 00000000..0118412d --- /dev/null +++ b/src/components/StatusDot/index.vue @@ -0,0 +1,27 @@ + + + + + + diff --git a/src/components/TableSelect/index.vue b/src/components/TableSelect/index.vue index 0fca0f8d..1171feb3 100644 --- a/src/components/TableSelect/index.vue +++ b/src/components/TableSelect/index.vue @@ -161,7 +161,9 @@ export interface ISelectConfig { placeholder?: string; /** popover 组件属性 */ popover?: Partial>; - /** 列表的网络请求函数(需返回 Promise) */ + /** + * 列表的网络请求函数(需返回 Promise) + */ indexAction: (_queryParams: T) => Promise; /** 主键(跨页选择必填,默认为 id) */ pk?: string; diff --git a/src/composables/usePageTable.ts b/src/composables/usePageTable.ts index 9eae5f1f..b72b0856 100644 --- a/src/composables/usePageTable.ts +++ b/src/composables/usePageTable.ts @@ -78,7 +78,9 @@ export function usePageTable( export interface UsePageTableOptions { /** 初值会深复制,请求和编辑不会改变重置基准。 */ initialParams: Q; - /** 接收查询快照;请求异常由调用方处理。 */ + /** + * 接收查询快照;请求异常由调用方处理。 + */ request: (params: Q) => Promise>; /** 恢复参数前,同步重置页面自有的搜索控件。 */ onBeforeReset?: () => void; @@ -93,10 +95,16 @@ export interface UsePageTableReturn { total: Ref; params: Q; fetchData: () => Promise; - /** 回到第一页并查询。 */ + /** + * 回到第一页并查询。 + */ handleQuery: () => Promise; - /** 恢复初始条件后重新查询。 */ + /** + * 恢复初始条件后重新查询。 + */ handleResetQuery: () => Promise; - /** 仅恢复参数,不发请求。 */ + /** + * 仅恢复参数,不发请求。 + */ resetParams: () => void; } diff --git a/src/views/demo/table/vxe-table/index.vue b/src/views/demo/table/vxe-table/index.vue index 8c79b6e8..e286520d 100644 --- a/src/views/demo/table/vxe-table/index.vue +++ b/src/views/demo/table/vxe-table/index.vue @@ -721,11 +721,17 @@ const xModalEvent: VxeModalListeners = { const crudStore = { /** 表单类型,true 表示修改,false 表示新增 */ isUpdate: true, - /** 加载表格数据 */ + /** + * 加载表格数据 + */ commitQuery: () => xGridDom.value?.commitProxy("query"), - /** 清空表格数据 */ + /** + * 清空表格数据 + */ clearTable: () => xGridDom.value?.reloadData([]), - /** 新增后是否跳入最后一页 */ + /** + * 新增后是否跳入最后一页 + */ afterInsert: () => { const pager = xGridDom.value?.getProxyInfo()?.pager; if (pager) { @@ -735,7 +741,9 @@ const crudStore = { } } }, - /** 删除后是否返回上一页 */ + /** + * 删除后是否返回上一页 + */ afterDelete: () => { const tableData: RowMeta[] = xGridDom.value!.getData(); const pager = xGridDom.value?.getProxyInfo()?.pager; @@ -743,7 +751,9 @@ const crudStore = { --pager.currentPage; } }, - /** 点击显示弹窗 */ + /** + * 点击显示弹窗 + */ onShowModal: (row?: RowMeta) => { if (row) { crudStore.isUpdate = true; @@ -755,7 +765,9 @@ const crudStore = { } xModalDom.value?.open(); }, - /** 确定并保存 */ + /** + * 确定并保存 + */ onSubmitForm: () => { if (xModalOpt.loading) return; // 表单校验 @@ -775,7 +787,9 @@ const crudStore = { callback(); }); }, - /** 删除 */ + /** + * 删除 + */ onDelete: (row?: RowMeta) => { let ids = []; if (row === undefined) { @@ -808,7 +822,9 @@ const crudStore = { onModify: (id: number, field: string, value: any) => { console.debug("🚀 ~ onModify", { id, field, value }); }, - /** 更多自定义方法 */ + /** + * 更多自定义方法 + */ moreFn: () => {}, }; diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 54c034fe..bc3efa77 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -954,6 +954,18 @@ $input-h: 44px; .login-brand { padding: 24px 24px 28px; + + /* 版本号移到名称下方,避免与右上角工具栏图标重叠 */ + &__identity { + flex-direction: column; + gap: 6px; + align-items: flex-start; + } + + &__name { + font-size: 20px; + white-space: nowrap; + } } .login-card { diff --git a/src/views/system/dict/components/DictItemPanel.vue b/src/views/system/dict/components/DictItemPanel.vue index 2b5fd735..71f0e51b 100644 --- a/src/views/system/dict/components/DictItemPanel.vue +++ b/src/views/system/dict/components/DictItemPanel.vue @@ -61,9 +61,10 @@ @@ -172,6 +173,7 @@ import { FullScreen, QuestionFilled, Refresh } from "@element-plus/icons-vue"; import DictAPI from "@/api/system/dict"; import type { DictItem, DictItemForm, DictItemQuery } from "@/api/system/dict"; import { usePageTable, useTableSelection } from "@/composables"; +import StatusDot from "@/components/StatusDot/index.vue"; import { CommonStatus } from "@/enums"; import { useDictStoreHook } from "@/stores/dict"; @@ -378,4 +380,10 @@ onMounted(() => { font-size: 13px; color: var(--el-text-color-placeholder); } + +.dict-item-panel__status { + display: inline-flex; + gap: 6px; + align-items: center; +} diff --git a/src/views/system/dict/index.vue b/src/views/system/dict/index.vue index f2c4ff4e..86e6eac3 100644 --- a/src/views/system/dict/index.vue +++ b/src/views/system/dict/index.vue @@ -29,7 +29,10 @@ @click="handleTypeClick(row)" >
- {{ row.name }} + + + {{ row.name }} + {{ row.dictCode }}
@@ -143,6 +146,7 @@ import { ArrowLeft, ArrowRight, Delete, Edit, Plus } from "@element-plus/icons-v import DictAPI from "@/api/system/dict"; import type { DictTypeForm, DictTypeItem, DictTypeQuery } from "@/api/system/dict"; import { usePageTable } from "@/composables"; +import StatusDot from "@/components/StatusDot/index.vue"; import { CommonStatus } from "@/enums"; import DictItemPanel from "./components/DictItemPanel.vue"; @@ -376,6 +380,20 @@ onMounted(() => { line-height: 1.35; } + &__dot { + display: inline-block; + width: 6px; + height: 6px; + margin-right: 6px; + vertical-align: middle; + background-color: var(--el-color-success); + border-radius: 50%; + + &.is-stopped { + background-color: var(--el-text-color-placeholder); + } + } + &__name { overflow: hidden; text-overflow: ellipsis; diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 260cb261..9fd3fac5 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -34,10 +34,7 @@ >
- + {{ row.name }} @@ -310,6 +307,7 @@ import type { MenuItem } from "@/api/system/menu"; import DeptAPI from "@/api/system/dept"; import type { OptionItem } from "@/api/common"; import { usePageTable } from "@/composables"; +import StatusDot from "@/components/StatusDot/index.vue"; import { CommonStatus } from "@/enums"; import { ROLE_ROOT } from "@/constants"; @@ -957,18 +955,6 @@ onMounted(() => { white-space: nowrap; } - &__dot { - flex: 0 0 auto; - width: 6px; - height: 6px; - background-color: var(--el-color-success); - border-radius: 50%; - - &.is-stopped { - background-color: var(--el-text-color-placeholder); - } - } - &__meta { display: flex; gap: 6px; diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index c3efc82d..b89d2275 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -153,7 +153,7 @@ - + diff --git a/src/views/workflow/components/BpmnDesigner.vue b/src/views/workflow/components/BpmnDesigner.vue index dc3074c9..f0dcadcf 100644 --- a/src/views/workflow/components/BpmnDesigner.vue +++ b/src/views/workflow/components/BpmnDesigner.vue @@ -381,9 +381,13 @@ onBeforeUnmount(() => { defineExpose({ /** 供承载页触发的保存动作(与工具栏保存共用一套导出逻辑) */ save: handleSave, - /** 画布是否有未保存的修改 */ + /** + * 画布是否有未保存的修改 + */ isDirty: () => dirty.value, - /** 持久化成功后清除脏标记(由承载页调用) */ + /** + * 持久化成功后清除脏标记(由承载页调用) + */ markSaved: () => { dirty.value = false; }, diff --git a/src/views/workspace/apps/index.vue b/src/views/workspace/apps/index.vue index be838df5..9c1724fd 100644 --- a/src/views/workspace/apps/index.vue +++ b/src/views/workspace/apps/index.vue @@ -195,6 +195,13 @@ function handleAppClick(app: AppCard): void {