From 5a8d2cc0dba344fde214ae23bdbb254fbe500dbf Mon Sep 17 00:00:00 2001 From: lzq <2495532633@qq.com> Date: Tue, 3 Feb 2026 18:49:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugin/color-process.ts | 58 ++++++ plugin/color-schemes-config.ts | 84 +++++++++ src/assets/stylus/color.styl | 83 +++++++++ src/assets/stylus/dialog.styl | 5 +- src/assets/stylus/index.styl | 1 + src/assets/stylus/root.styl | 98 ++-------- src/assets/stylus/tag.styl | 8 + src/common/utils/color-schemes.ts | 95 ++++++++++ .../a-detail-panel/ADetailPanel.tsx | 2 +- .../a-detail-panel/a-detail-panel.module.styl | 9 + .../a-page/a-table-page/ATablePage.tsx | 1 + src/dts/auto-imports.d.ts | 20 +- src/pages/cst/driver/DriverDropTable.vue | 51 +++++ src/pages/order/TransRecode.vue | 119 ++++++++++++ src/pages/order/book/Book.vue | 86 +++++++-- src/pages/order/book/BookDetail.vue | 145 +++++++++------ src/pages/order/book/DispatchForm.vue | 80 ++++++++ src/pages/order/book/book.d.ts | 10 +- src/pages/order/constants.ts | 21 +++ src/pages/order/history/History.vue | 16 +- src/pages/order/order-api.ts | 3 + src/pages/order/realtime/Realtime.vue | 28 +-- src/pages/order/realtime/RealtimeDetail.vue | 175 ++++++++++++++++++ vite.config.ts | 3 +- 24 files changed, 1001 insertions(+), 200 deletions(-) create mode 100644 plugin/color-process.ts create mode 100644 plugin/color-schemes-config.ts create mode 100644 src/assets/stylus/color.styl create mode 100644 src/assets/stylus/tag.styl create mode 100644 src/common/utils/color-schemes.ts create mode 100644 src/pages/cst/driver/DriverDropTable.vue create mode 100644 src/pages/order/TransRecode.vue create mode 100644 src/pages/order/book/DispatchForm.vue create mode 100644 src/pages/order/realtime/RealtimeDetail.vue diff --git a/plugin/color-process.ts b/plugin/color-process.ts new file mode 100644 index 0000000..ecd8264 --- /dev/null +++ b/plugin/color-process.ts @@ -0,0 +1,58 @@ +import fs from 'fs' +import path from 'node:path' +import { colorSchemesConfig } from './color-schemes-config.ts' + +const targetFile = path.resolve(__dirname, './color-schemes-config.ts') + +function createStyl() { + const stylusFile = path.resolve(__dirname, '../src/assets/stylus/color.styl') + console.log('正在生成文件:', stylusFile) + let colorSchemes = [] + for (let k1 in colorSchemesConfig) { + let colors = [] + // @ts-ignore + for (let k2 in colorSchemesConfig[k1]) { + // @ts-ignore + colors.push(`${k2}: ${colorSchemesConfig[k1][k2]}`) + } + colorSchemes.push(` ${k1}: {\n ${colors.join(',\n ')}\n }`) + } + const stylContent = `colorSchemes = {\n${colorSchemes.join(',\n')}\n} + +` + fs.writeFileSync(stylusFile, stylContent, {encoding: 'utf-8'}) +} + +function createTs() { + const tsFile = path.resolve(__dirname, '../src/common/utils/color-schemes.ts') + console.log('正在生成文件:', tsFile) + let colorSchemes = [] + for (let k1 in colorSchemesConfig) { + let colors = [] + // @ts-ignore + for (let k2 in colorSchemesConfig[k1]) { + // @ts-ignore + colors.push(`${k2}: '${colorSchemesConfig[k1][k2]}'`) + } + colorSchemes.push(` ${k1}: {\n ${colors.join(',\n ')}\n }`) + } + const tsContent = `export const colorSchemes = {\n${colorSchemes.join(',\n')}\n} as const + +export type ColorSchemeType = keyof typeof colorSchemes + +` + fs.writeFileSync(tsFile, tsContent, {encoding: 'utf-8'}) +} + +/** + * 色系处理器 + */ +export default { + process(_: VitePluginTypes.FileWatcherProcessParam) { + createTs() + createStyl() + }, + isAccept(data: VitePluginTypes.FileWatcherAcceptParam) { + return data.event === 'change' && !data.isDir && data.filePath === targetFile + }, +} as VitePluginTypes.FileWatcherOptions diff --git a/plugin/color-schemes-config.ts b/plugin/color-schemes-config.ts new file mode 100644 index 0000000..8a6928e --- /dev/null +++ b/plugin/color-schemes-config.ts @@ -0,0 +1,84 @@ +export const colorSchemesConfig = { + default: { + dark2: '#6A788F', + base: '#7987A1', + light3: '#8E9AB0', + light5: '#A3ABC0', + light7: '#B8C0D0', + light8: '#CCD5DF', + light9: '#E1E9EE', + }, + primary: { + dark2: '#4A6FE6', + base: '#5D87FF', + light3: '#85A5FF', + light5: '#AAC0FF', + light7: '#C9D4FF', + light8: '#DCE4FF', + light9: '#EBF0FF', + }, + success: { + dark2: '#38A85E', + base: '#4CB772', + light3: '#6FC78C', + light5: '#91D6A7', + light7: '#B3E5C1', + light8: '#D5F4DB', + light9: '#F7FFF6', + }, + warning: { + dark2: '#E0A600', + base: '#F5B800', + light3: '#F9C733', + light5: '#FBD666', + light7: '#FDE599', + light8: '#FEF0BB', + light9: '#FFFAE0', + }, + info: { + dark2: '#485263', + base: '#5A6578', + light3: '#747F91', + light5: '#8D97A6', + light7: '#A6AEBD', + light8: '#C0C6D2', + light9: '#D9DCE4', + }, + danger: { + dark2: '#C93649', + base: '#E05F4D', + light3: '#F2998C', + light5: '#F7B8AF', + light7: '#FCD7D2', + light8: '#FFE6E5', + light9: '#FFF6F6', + }, + ycz: { + dark2: '#9E547A', + base: '#C06F98', + light3: '#CD8AAD', + light5: '#DAA5C1', + light7: '#E6BED2', + light8: '#F0D4E2', + light9: '#F8E8F1', + }, + dth: { + dark2: '#B83603', + base: '#E34303', + light3: '#FB5716', + light5: '#FC7642', + light7: '#FD956D', + light8: '#FDB498', + light9: '#FED4C3', + }, + sch: { + dark2: '#BB2243', + base: '#ED556A', + light3: '#FA6175', + light5: '#FF798A', + light7: '#FF90A0', + light8: '#FFA8B7', + light9: '#FFC0CE', + }, +} + diff --git a/src/assets/stylus/color.styl b/src/assets/stylus/color.styl new file mode 100644 index 0000000..f9f3da1 --- /dev/null +++ b/src/assets/stylus/color.styl @@ -0,0 +1,83 @@ +colorSchemes = { + default: { + dark2: #6A788F, + base: #7987A1, + light3: #8E9AB0, + light5: #A3ABC0, + light7: #B8C0D0, + light8: #CCD5DF, + light9: #E1E9EE + }, + primary: { + dark2: #4A6FE6, + base: #5D87FF, + light3: #85A5FF, + light5: #AAC0FF, + light7: #C9D4FF, + light8: #DCE4FF, + light9: #EBF0FF + }, + success: { + dark2: #38A85E, + base: #4CB772, + light3: #6FC78C, + light5: #91D6A7, + light7: #B3E5C1, + light8: #D5F4DB, + light9: #F7FFF6 + }, + warning: { + dark2: #E0A600, + base: #F5B800, + light3: #F9C733, + light5: #FBD666, + light7: #FDE599, + light8: #FEF0BB, + light9: #FFFAE0 + }, + info: { + dark2: #485263, + base: #5A6578, + light3: #747F91, + light5: #8D97A6, + light7: #A6AEBD, + light8: #C0C6D2, + light9: #D9DCE4 + }, + danger: { + dark2: #C93649, + base: #E05F4D, + light3: #F2998C, + light5: #F7B8AF, + light7: #FCD7D2, + light8: #FFE6E5, + light9: #FFF6F6 + }, + ycz: { + dark2: #9E547A, + base: #C06F98, + light3: #CD8AAD, + light5: #DAA5C1, + light7: #E6BED2, + light8: #F0D4E2, + light9: #F8E8F1 + }, + dth: { + dark2: #B83603, + base: #E34303, + light3: #FB5716, + light5: #FC7642, + light7: #FD956D, + light8: #FDB498, + light9: #FED4C3 + }, + sch: { + dark2: #BB2243, + base: #ED556A, + light3: #FA6175, + light5: #FF798A, + light7: #FF90A0, + light8: #FFA8B7, + light9: #FFC0CE + } +} diff --git a/src/assets/stylus/dialog.styl b/src/assets/stylus/dialog.styl index 17f109a..b959c85 100644 --- a/src/assets/stylus/dialog.styl +++ b/src/assets/stylus/dialog.styl @@ -23,8 +23,8 @@ } .el-dialog { - max-height 90% !important - max-width 90% !important; + max-height 100% !important + max-width 100% !important; margin 0 !important box-sizing border-box !important overflow: hidden; @@ -34,6 +34,7 @@ cursor move !important display block width 100% + text-align: start; } diff --git a/src/assets/stylus/index.styl b/src/assets/stylus/index.styl index eeb4415..a4296c7 100644 --- a/src/assets/stylus/index.styl +++ b/src/assets/stylus/index.styl @@ -9,3 +9,4 @@ @import "scrollbar.styl" @import "form.styl" @import "input.styl" +@import "tag.styl" diff --git a/src/assets/stylus/root.styl b/src/assets/stylus/root.styl index 3211fa5..67f4d46 100644 --- a/src/assets/stylus/root.styl +++ b/src/assets/stylus/root.styl @@ -1,85 +1,21 @@ +@import "color.styl" body { - /* Default 系列 */ - --el-color-default: #7987A1 !important; - --el-color-default-light-3: #8E9AB0 !important; - --el-color-default-light-5: #A3ABC0 !important; - --el-color-default-light-7: #B8C0D0 !important; - --el-color-default-light-8: #CCD5DF !important; - --el-color-default-light-9: #E1E9EE !important; - --el-color-default-dark-2: #6A788F !important; - - /* Primary 系列 */ - --el-color-primary: #5D87FF !important; - --el-color-primary-light-3: #85A5FF !important; - --el-color-primary-light-5: #AAC0FF !important; - --el-color-primary-light-7: #C9D4FF !important; - --el-color-primary-light-8: #DCE4FF !important; - --el-color-primary-light-9: #EBF0FF !important; - --el-color-primary-dark-2: #4A6FE6 !important; - - /* Success 系列 */ - --el-color-success: #4CB772 !important; - --el-color-success-light-3: #6FC78C !important; - --el-color-success-light-5: #91D6A7 !important; - --el-color-success-light-7: #B3E5C1 !important; - --el-color-success-light-8: #D5F4DB !important; - --el-color-success-light-9: #F7FFF6 !important; - --el-color-success-dark-2: #38A85E !important; - - /* Warning 系列 */ - --el-color-warning: #F5B800 !important; - --el-color-warning-dark-2: #E0A600 !important; - --el-color-warning-light-3: #F9C733 !important; - --el-color-warning-light-5: #FBD666 !important; - --el-color-warning-light-7: #FDE599 !important; - --el-color-warning-light-8: #FEF0BB !important; - --el-color-warning-light-9: #FFFAE0 !important; - - /* Info 系列 */ - --el-color-info: #5A6578 !important; - --el-color-info-light-3: #747F91 !important; - --el-color-info-light-5: #8D97A6 !important; - --el-color-info-light-7: #A6AEBD !important; - --el-color-info-light-8: #C0C6D2 !important; - --el-color-info-light-9: #D9DCE4 !important; - --el-color-info-dark-2: #485263 !important; - - - /* Danger 系列 */ - --el-color-danger: #E05F4D !important; - --el-color-danger-light-3: #F2998C !important; - --el-color-danger-light-5: #F7B8AF !important; - --el-color-danger-light-7: #FCD7D2 !important; - --el-color-danger-light-8: #FFE6E5 !important; - --el-color-danger-light-9: #FFF6F6 !important; - --el-color-danger-dark-2: #C93649 !important; - - /* 樱草紫 */ - --el-color-ycz: #C06F98 !important; - --el-color-ycz-dark-2: #9E547A !important; - --el-color-ycz-light-3: #CD8AAD !important; - --el-color-ycz-light-5: #DAA5C1 !important; - --el-color-ycz-light-7: #E6BED2 !important; - --el-color-ycz-light-8: #F0D4E2 !important; - --el-color-ycz-light-9: #F8E8F1 !important; - /* 淡土黄 */ - --el-color-dth: #8C4B31 !important; - --el-color-dth-dark-2: #792808 !important; - --el-color-dth-light-3: #915D47 !important; - --el-color-dth-light-5: #946A5A !important; - --el-color-dth-light-7: #957568 !important; - --el-color-dth-light-8: #94796E !important; - --el-color-dth-light-9: #937B72 !important; - - /*山茶红*/ - --el-color-sch: #ED556A !important; - --el-color-sch-light-3: #FA6175 !important; - --el-color-sch-light-5: #FF798A !important; - --el-color-sch-light-7: #FF90A0 !important; - --el-color-sch-light-8: #FFA8B7 !important; - --el-color-sch-light-9: #FFC0CE !important; - --el-color-sch-dark-2: #BB2243 !important; - + for key, value in colorSchemes { + /*noinspection CssOverwrittenProperties*/ + --el-color-{key}-dark-2: value.dark2 !important; + /*noinspection CssOverwrittenProperties*/ + --el-color-{key}: value.base !important; + /*noinspection CssOverwrittenProperties*/ + --el-color-{key}-light-3: value.light3 !important; + /*noinspection CssOverwrittenProperties*/ + --el-color-{key}-light-5: value.light5 !important; + /*noinspection CssOverwrittenProperties*/ + --el-color-{key}-light-7: value.light7 !important; + /*noinspection CssOverwrittenProperties*/ + --el-color-{key}-light-8: value.light8 !important; + /*noinspection CssOverwrittenProperties*/ + --el-color-{key}-light-9: value.light9 !important; + } --el-font-weight-primary: 400 !important; letter-spacing: .5px; diff --git a/src/assets/stylus/tag.styl b/src/assets/stylus/tag.styl new file mode 100644 index 0000000..2801de8 --- /dev/null +++ b/src/assets/stylus/tag.styl @@ -0,0 +1,8 @@ +@import "color.styl" +for key, value in colorSchemes + .el-tag.el-tag--primary.el-tag[data-cs=\"{key}\"] { + --el-tag-text-color value.base !important + --el-tag-bg-color value.light9 !important + --el-tag-border-color value.light8 !important + --el-tag-hover-color value.base !important + } diff --git a/src/common/utils/color-schemes.ts b/src/common/utils/color-schemes.ts new file mode 100644 index 0000000..1df6641 --- /dev/null +++ b/src/common/utils/color-schemes.ts @@ -0,0 +1,95 @@ +export const colorSchemes = { + // 默认色(已完成) + default: { + dark2: '#6A788F', + base: '#7987A1', + light3: '#8E9AB0', + light5: '#A3ABC0', + light7: '#B8C0D0', + light8: '#CCD5DF', + light9: '#E1E9EE', + }, + // 主色 + primary: { + dark2: '#4A6FE6', + base: '#5D87FF', + light3: '#85A5FF', + light5: '#AAC0FF', + light7: '#C9D4FF', + light8: '#DCE4FF', + light9: '#EBF0FF', + }, + // 成功色 + success: { + dark2: '#38A85E', + base: '#4CB772', + light3: '#6FC78C', + light5: '#91D6A7', + light7: '#B3E5C1', + light8: '#D5F4DB', + light9: '#F7FFF6', + }, + // 警告色 + warning: { + dark2: '#E0A600', + base: '#F5B800', + light3: '#F9C733', + light5: '#FBD666', + light7: '#FDE599', + light8: '#FEF0BB', + light9: '#FFFAE0', + }, + // 信息色 + info: { + dark2: '#485263', + base: '#5A6578', + light3: '#747F91', + light5: '#8D97A6', + light7: '#A6AEBD', + light8: '#C0C6D2', + light9: '#D9DCE4', + }, + // 危险色 + danger: { + dark2: '#C93649', + base: '#E05F4D', + light3: '#F2998C', + light5: '#F7B8AF', + light7: '#FCD7D2', + light8: '#FFE6E5', + light9: '#FFF6F6', + }, + // 樱草紫(已完成) + ycz: { + dark2: '#9E547A', + base: '#C06F98', + light3: '#CD8AAD', + light5: '#DAA5C1', + light7: '#E6BED2', + light8: '#F0D4E2', + light9: '#F8E8F1', + }, + // 淡土黄 + dth: { + dark2: '#B83603', + base: '#E34303', + light3: '#FB5716', + light5: '#FC7642', + light7: '#FD956D', + light8: '#FDB498', + light9: '#FED4C3', + }, + // 山茶红 + sch: { + dark2: '#BB2243', + base: '#ED556A', + light3: '#FA6175', + light5: '#FF798A', + light7: '#FF90A0', + light8: '#FFA8B7', + light9: '#FFC0CE', + }, +} as const + +export type ColorSchemeType = keyof typeof colorSchemes + diff --git a/src/components/a-detail-panel/ADetailPanel.tsx b/src/components/a-detail-panel/ADetailPanel.tsx index bd801e8..f9bafdf 100644 --- a/src/components/a-detail-panel/ADetailPanel.tsx +++ b/src/components/a-detail-panel/ADetailPanel.tsx @@ -54,7 +54,7 @@ const component = defineComponent( , [ [ ElLoading.directive, loading.value ] ], )), - footer: () => (