修改前必读 根规则、工程规则。
保存、导入、复制、子数据移除与流程配置必须完整阅读 子数据保存规则,移动 H5 同样适用。
以下 src/ 路径相对 web-admin,docs/、openspec/ 路径相对仓库根。
src/main.ts;管理端业务在 src/views/,移动 H5 在 src/views/m/;API / store / router 分别在 src/api/、src/store/modules/、src/router/。pnpm install、pnpm dev、pnpm build、pnpm build:typecheck、pnpm lint。pnpm fix、pnpm lint:prettier、pnpm lint:stylelint 会修改文件,只在目标范围使用,避免无关格式化。pnpm commit 使用 cz-git;pnpm clean:dev 会清理 Demo,不能作为日常验证或工程清理命令。@element-plus/icons-vue 导入。vueIndentScriptAndStyle: true;遵守 ESLint / Stylelint / Husky 的现有配置。@ 为 src,另有 @views、@imgs、@icons、@utils、@stores、@plugins、@styles,以 tsconfig / vite 为准。vite.config.ts 注入,包含 @styles/core/el-light.scss 与 @styles/core/mixin.scss;Tailwind 经现有 Vite 插件接入。/#/;.env.development / .env.production 使用 VITE_*。/api 代理受 VITE_API_PROXY_URL 控制,另有 /web / /mini 代理;加密和访问模式以现有配置为准,不为方便绕过加密。#10b981、深色 #059669、背景 #ecfdf5;不得使用小程序 #0a9f6d 作主色。| 用途 | Hash 路由 | 参考源码(相对 web-admin) |
|---|---|---|
| 工作台 | /#/demo/console |
src/views/dashboard/console/index.vue |
| 标准列表 | /#/demo/unit |
src/views/demo/unit/index.vue |
| 复杂业务列表 | /#/demo/order |
src/views/demo/order/index.vue |
| 商品列表与查看 | /#/demo/product |
src/views/demo/product/index.vue |
| 树形主数据 | /#/demo/category |
src/views/demo/category/index.vue |
| 用户 CRUD | /#/demo/user |
src/views/system/user/index.vue |
上述四类 Demo 的旧 src/views/system/ 路径已迁至 src/views/demo/;以 src/router/modules/demo.ts 和上表为当前入口,旧 UI 文档中的路径按此对应,不据旧路径新建重复页面。
商品只读查看弹窗同时参照 src/components/business/product-view-dialog/index.vue。新页面必须对齐所选模板。
filter-block → 列表工具栏 → list-body / list-wrap(含表格)→ 分页。panel-top,筛选区不重复增加「筛选条件」标题。panel-top 内 h2.title-bar-heading 用 ::before 显示主色竖条;竖条标题须在 src/App.vue 的 panelTitleBarTextRules 注册完整文案,尤其「租户」等易误匹配标题,不依赖短正则或图标自动判断。space-between 将整组按钮推到行末。type="primary" / btn-main;删除、导入导出等为中性描边。el-button 必须带前置 <el-icon>,图标显式导入。sort_order / orderNum 默认不在列表、新增、编辑弹窗展示;确有功能需要再添加。list-table + stripe;对齐订单模板时勿随意加 border。min-width 而非 width;selection / index 使用固定 width(约 48–55 / 60–68)。fixed="right"、min-width ≥ 260px,避免按钮裁切;标准 CRUD 无操作列规则见下文。list-body 顶边框,列表与分页衔接避免重复分隔线。el-pagination 同在 list-body.list-wrap;分页外层 .pagination.list-pager-bar,margin-top: 0,边框 / padding 按规范第 7.9 节。<el-link type="primary"> 打开查看,保留 @row-dblclick,不在操作列重复提供「查看」。SystemViewDialog 的 #hero-actions。编辑要求恰选一条,删除支持批量;参照 src/views/crm/product/index.vue、src/views/system/user/index.vue。/;复用 src/utils/tree-path.ts。resolveSidebarMenuIcon,缺省 folder / file;WorkTab 页签仅文字,不显示图标,meta.icon 只用于侧栏。el-tag;表格 <el-tag :type="..." size="small">,SystemViewDialog 使用 ViewField.tagType。el-ui.scss 全局控制:success / primary #059669、warning #d97706、danger #dc2626;info 透明底 + #1e293b,不使用默认 #909399。<span class="tag"> 或浅填充标签替代非 info 标签;订单 / 配送等枚举映射保持语义一致。el-dialog 根加 .dialog-form-layout,max-height: calc(100vh - 100px);仅 .el-dialog__body 纵向滚动,头部与底栏固定。align-center 与全局 ElConfigProvider 居中;遮罩 backdrop-filter: none,沿用现有 modal-class 策略,禁止背景模糊。label-position="top";字段少时宽约 560–720px,字段多时适当加宽。.form-grid-2,最多 .form-grid-5;窄视口降列。长字段和备注 .form-col-span-2 / grid-column: 1 / -1。el-form-item 宜 margin-bottom: 0,纵向间距靠 gap;不要在 scoped 中重复定义全局 .form-grid-2、.form-col-span-2、.sort-field、.form-tip。<template #label>字段名<span class="form-label-tip">注释</span></template>;12px、--mint-text-muted,不得放在输入控件旁。scroll-to-error 和 scroll-into-view-options,校验失败提示与现有页面一致,可配合 ElMessageBox.alert。#a7f3d0 虚线边框卡片,作为附件卡片同一 flex 行的第一项;提示位于整行下方。fetchUploadAttachment;卡片提供预览、下载、删除,不将上传延迟到业务保存。ProtocolFormDialog.vue「协议附件」,该文件不在当前树;现有通用组件为 src/components/business/attachment-upload-field/index.vue,以上布局和行为仍须遵守。openspec/changes/zkxw-engineering-standards/specs/ui-conventions/spec.md 的附件、按钮、标签、列表与模式索引条款,以及 UI 规范第 7、9.3.1 节。