diff --git a/.env b/.env index 5dc33d1..8189420 100644 --- a/.env +++ b/.env @@ -1,3 +1,3 @@ VITE_BASE_API = '/remoteServer' VITE_SHOW_ONLINE_DEVICE = true -VITE_APP_ENV = local + diff --git a/.env.cloud b/.env.cloud deleted file mode 100644 index c493323..0000000 --- a/.env.cloud +++ /dev/null @@ -1,3 +0,0 @@ -VITE_APP_ENV = cloud -VITE_BASE_URL = 'http://192.168.1.3:8080' -VITE_ZMQ_BASE_URL = '192.168.1.99' \ No newline at end of file diff --git a/.env.local b/.env.local deleted file mode 100644 index 9491a04..0000000 --- a/.env.local +++ /dev/null @@ -1,3 +0,0 @@ -VITE_APP_ENV = local -VITE_BASE_URL = 'http://192.168.1.210:8080' -VITE_ZMQ_BASE_URL = '192.168.1.210' \ No newline at end of file diff --git a/global.types/components.d.ts b/global.types/components.d.ts index d0e786f..5b6a30b 100644 --- a/global.types/components.d.ts +++ b/global.types/components.d.ts @@ -10,6 +10,7 @@ declare module 'vue' { export interface GlobalComponents { EdfsButton: typeof import('./../src/components/Edfs-button.vue')['default'] EdfsDialog: typeof import('./../src/components/Edfs-dialog.vue')['default'] + EdfsException: typeof import('./../src/components/Edfs-exception.vue')['default'] EdfsInput: typeof import('./../src/components/Edfs-Input.vue')['default'] EdfsNumberInput: typeof import('./../src/components/Edfs-number-input.vue')['default'] EdfsTable: typeof import('./../src/components/Edfs-table/index.vue')['default'] @@ -18,11 +19,28 @@ declare module 'vue' { ElButton: typeof import('element-plus/es')['ElButton'] ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider'] ElContainer: typeof import('element-plus/es')['ElContainer'] + ElDialog: typeof import('element-plus/es')['ElDialog'] + ElEmpty: typeof import('element-plus/es')['ElEmpty'] + ElForm: typeof import('element-plus/es')['ElForm'] + ElFormItem: typeof import('element-plus/es')['ElFormItem'] ElHeader: typeof import('element-plus/es')['ElHeader'] + ElIcon: typeof import('element-plus/es')['ElIcon'] + ElInput: typeof import('element-plus/es')['ElInput'] + ElInputNumber: typeof import('element-plus/es')['ElInputNumber'] ElMenu: typeof import('element-plus/es')['ElMenu'] ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] + ElOption: typeof import('element-plus/es')['ElOption'] + ElPageHeader: typeof import('element-plus/es')['ElPageHeader'] + ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] + ElSelect: typeof import('element-plus/es')['ElSelect'] + ElStep: typeof import('element-plus/es')['ElStep'] + ElSteps: typeof import('element-plus/es')['ElSteps'] ElSubMenu: typeof import('element-plus/es')['ElSubMenu'] + ElTable: typeof import('element-plus/es')['ElTable'] + ElTableColumn: typeof import('element-plus/es')['ElTableColumn'] + ElTag: typeof import('element-plus/es')['ElTag'] + ElUpload: typeof import('element-plus/es')['ElUpload'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] } diff --git a/global.types/global.d.ts b/global.types/global.d.ts index f9aa897..9af2de7 100644 --- a/global.types/global.d.ts +++ b/global.types/global.d.ts @@ -43,8 +43,8 @@ declare global { } interface PageParam { - pageSize?: number - pageNo?: number + pageSize: number + pageNo: number } interface Tree { diff --git a/index.html b/index.html index 297b44d..eae25bd 100644 --- a/index.html +++ b/index.html @@ -5,7 +5,7 @@ - EMU + 工程管理 diff --git a/package-lock.json b/package-lock.json index 8031b11..c1cba8b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -33,6 +33,7 @@ "devDependencies": { "@iconify/json": "^2.2.310", "@tsconfig/node22": "^22.0.0", + "@types/mockjs": "^1.0.10", "@types/node": "^24.2.1", "@unocss/preset-icons": "^66.0.0", "@unocss/preset-rem-to-px": "^66.0.0", @@ -2421,6 +2422,13 @@ "@types/lodash": "*" } }, + "node_modules/@types/mockjs": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@types/mockjs/-/mockjs-1.0.10.tgz", + "integrity": "sha512-SXgrhajHG7boLv6oU93CcmdDm0HYRiceuz6b+7z+/2lCJPTWDv0V5YiwFHT2ejE4bQqgSXQiVPQYPWv7LGsK1g==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/node": { "version": "24.10.1", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", diff --git a/package.json b/package.json index 3d2f697..719fc15 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "devDependencies": { "@iconify/json": "^2.2.310", "@tsconfig/node22": "^22.0.0", + "@types/mockjs": "^1.0.10", "@types/node": "^24.2.1", "@unocss/preset-icons": "^66.0.0", "@unocss/preset-rem-to-px": "^66.0.0", diff --git a/src/api/modkJs/engineering/index.ts b/src/api/modkJs/engineering/index.ts index e69de29..b30f6a6 100644 --- a/src/api/modkJs/engineering/index.ts +++ b/src/api/modkJs/engineering/index.ts @@ -0,0 +1,40 @@ +import Mock from 'mockjs' +import type { IEngineeringOV, IEngineering } from '@/api/module/engineering/index.d' + +// Cache the data to ensure consistency across calls +const cachedData = Mock.mock({ + 'list|20': [ + { + 'id|+1': 1, + name: '@ctitle(5, 10)', + versions: 'v@integer(1, 9).@integer(0, 9).@integer(0, 9)', + description: '@cparagraph(1, 3)', + }, + ], + total: 20, +}) + +export const getEngineeringListMock = () => { + return new Promise<{ list: IEngineering[]; total: number }>((resolve) => { + setTimeout(() => { + resolve({ + list: cachedData.list.map((item: any) => ({ + ...item, + id: String(item.id), + })), + total: cachedData.total, + }) + }, 500) + }) +} + + +export const createEngineeringMock = (params: IEngineeringOV) => { + return new Promise<{ id: string }>((resolve) => { + setTimeout(() => { + resolve({ + id: '1', + }) + }, 500) + }) +} \ No newline at end of file diff --git a/src/api/module/engineering/index.d.ts b/src/api/module/engineering/index.d.ts index 175cf8c..bf79cdb 100644 --- a/src/api/module/engineering/index.d.ts +++ b/src/api/module/engineering/index.d.ts @@ -1,5 +1,8 @@ -export interface IEngineeringList { - id: string, - name: string, - description: string, -} \ No newline at end of file +export interface IEngineering { + id: string + versions: string + name: string + description: string +} + +export type IEngineeringOV = Omit diff --git a/src/api/module/engineering/index.ts b/src/api/module/engineering/index.ts index e69de29..21bc526 100644 --- a/src/api/module/engineering/index.ts +++ b/src/api/module/engineering/index.ts @@ -0,0 +1,14 @@ +import { globalServer } from '../index' + +import { getEngineeringListMock, createEngineeringMock } from '@/api/modkJs/engineering' +import type { IEngineeringOV, IEngineering } from './index.d' + +export const getEngineeringList = () => { + // Use mock data + return getEngineeringListMock() +} + +export const createEngineering = (params: IEngineeringOV) => { + // Use mock data + return createEngineeringMock(params) +} diff --git a/src/assets/images/device/bms.png b/src/assets/images/device/bms.png deleted file mode 100644 index f4b6379..0000000 Binary files a/src/assets/images/device/bms.png and /dev/null differ diff --git a/src/assets/images/device/cac.png b/src/assets/images/device/cac.png deleted file mode 100644 index a4f059b..0000000 Binary files a/src/assets/images/device/cac.png and /dev/null differ diff --git a/src/assets/images/device/dgs.png b/src/assets/images/device/dgs.png deleted file mode 100644 index 683b0ac..0000000 Binary files a/src/assets/images/device/dgs.png and /dev/null differ diff --git a/src/assets/images/device/ecg.png b/src/assets/images/device/ecg.png deleted file mode 100644 index cebce40..0000000 Binary files a/src/assets/images/device/ecg.png and /dev/null differ diff --git a/src/assets/images/device/ecu.png b/src/assets/images/device/ecu.png deleted file mode 100644 index a8efdfa..0000000 Binary files a/src/assets/images/device/ecu.png and /dev/null differ diff --git a/src/assets/images/device/em.png b/src/assets/images/device/em.png deleted file mode 100644 index 0b06670..0000000 Binary files a/src/assets/images/device/em.png and /dev/null differ diff --git a/src/assets/images/device/ems.png b/src/assets/images/device/ems.png deleted file mode 100644 index 4d28dd1..0000000 Binary files a/src/assets/images/device/ems.png and /dev/null differ diff --git a/src/assets/images/device/ffs.png b/src/assets/images/device/ffs.png deleted file mode 100644 index 8629291..0000000 Binary files a/src/assets/images/device/ffs.png and /dev/null differ diff --git a/src/assets/images/device/group.png b/src/assets/images/device/group.png deleted file mode 100644 index cebce40..0000000 Binary files a/src/assets/images/device/group.png and /dev/null differ diff --git a/src/assets/images/device/mppt.png b/src/assets/images/device/mppt.png deleted file mode 100644 index 9581849..0000000 Binary files a/src/assets/images/device/mppt.png and /dev/null differ diff --git a/src/assets/images/device/pcs.png b/src/assets/images/device/pcs.png deleted file mode 100644 index e357148..0000000 Binary files a/src/assets/images/device/pcs.png and /dev/null differ diff --git a/src/assets/images/device/ths.png b/src/assets/images/device/ths.png deleted file mode 100644 index 6f38e1d..0000000 Binary files a/src/assets/images/device/ths.png and /dev/null differ diff --git a/src/assets/images/device/tms.png b/src/assets/images/device/tms.png deleted file mode 100644 index 2ef2bac..0000000 Binary files a/src/assets/images/device/tms.png and /dev/null differ diff --git a/src/assets/images/device/unit.png b/src/assets/images/device/unit.png deleted file mode 100644 index a8efdfa..0000000 Binary files a/src/assets/images/device/unit.png and /dev/null differ diff --git a/src/assets/images/device/wpp.png b/src/assets/images/device/wpp.png deleted file mode 100644 index abbb146..0000000 Binary files a/src/assets/images/device/wpp.png and /dev/null differ diff --git a/src/assets/styles/theme-variables.css b/src/assets/styles/theme-variables.css index 4b3f291..f857740 100644 --- a/src/assets/styles/theme-variables.css +++ b/src/assets/styles/theme-variables.css @@ -47,28 +47,3 @@ html[data-theme='light'] { --icon-color: #aaa; --icon-hover-color: #606266; } - -html.dark { - --el-bg-color: #212327; - --el-border-color: rgba(255, 255, 255, 0.13); - --el-button-divide-border-color: rgba(255, 255, 255, 0.13); - --el-bg-color-overlay: #212327; - --el-text-color-regular: #c7c8cb; - --el-color-primary: #619925; - --el-color-primary-light-3: rgb(78.1, 141.8, 46.6); - --el-color-primary-light-5: rgb(61.5, 107, 39); - --el-color-primary-light-7: rgb(44.9, 72.2, 31.4); - --el-color-primary-light-8: rgb(36.6, 54.8, 27.6); - --el-color-primary-light-9: rgb(28.3, 37.4, 23.8); - --el-color-primary-dark-2: rgb(133.4, 206.2, 97.4); -} - -html.light { - --el-color-primary: #619925; - --el-color-primary-light-3: rgb(148.6, 212.3, 117.1); - --el-color-primary-light-5: rgb(179, 224.5, 156.5); - --el-color-primary-light-7: rgb(209.4, 236.7, 195.9); - --el-color-primary-light-8: rgb(224.6, 242.8, 215.6); - --el-color-primary-light-9: rgb(239.8, 248.9, 235.3); - --el-color-primary-dark-2: rgb(82.4, 155.2, 46.4); -} diff --git a/src/router/index.ts b/src/router/index.ts index 982c53d..9b5a9c6 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -22,8 +22,35 @@ export const defaultRouter = [ icon: 'i-icon-park-outline:data', }, }, + { + path: '/engineering-config/:type', + name: 'engineering-config', + component: () => import('@/views/engineering/config/index.vue'), + meta: { + title: '工程配置', + isShow: false, + icon: '', + }, + beforeEnter: (to: any, from: any, next: any) => { + const { type } = to.params; + if (type === 'created' || type === 'edit') { + next(); + } else { + next({ name: 'NoFound' }); + } + }, + } ], }, + { + path: '/404', + name: 'NoFound', + component: () => import('@/views/Error/404.vue'), + meta: { + hidden: true, + title: '404', + }, + }, ] const router = createRouter({ diff --git a/src/views/engineering/index.vue b/src/views/engineering/index.vue index 1f63808..14ffee3 100644 --- a/src/views/engineering/index.vue +++ b/src/views/engineering/index.vue @@ -1,19 +1,204 @@ + + diff --git a/src/views/layout/index.vue b/src/views/layout/index.vue index 6f2ff2b..75ee77a 100644 --- a/src/views/layout/index.vue +++ b/src/views/layout/index.vue @@ -2,36 +2,72 @@
- - +