diff --git a/eslint.config.js b/eslint.config.js index 6304f0a..33bb0b2 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -14,6 +14,11 @@ export default lintConfig({ 'antfu/top-level-function': 0, 'ts/no-use-before-define': 0, 'no-alert': 0, + 'unused-imports/no-unused-vars': 0, }, globals: { process: 'readonly' }, + extends: [ + 'plugin:vue/vue3-recommended', + 'plugin:vue-pug/vue3-recommended', + ], }) diff --git a/package.json b/package.json index f0e7885..4c6370f 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "autoprefixer": "^10.4.20", "axios": "1.8.2", "cssnano": "^7.0.6", + "echarts": "^5.6.0", "element-plus": "^2.9.5", "express": "^5.1.0", "konva": "^9.3.18", @@ -56,23 +57,29 @@ "@typescript-eslint/eslint-plugin": "^8.25.0", "@typescript-eslint/parser": "^8.25.0", "@vitejs/plugin-vue": "^5.2.1", + "@vitejs/plugin-vue-jsx": "^5.0.1", "@vue/eslint-config-prettier": "^10.2.0", + "@vue/language-plugin-pug": "^3.0.3", "concurrently": "^9.1.2", "eslint": "^9.21.0", "eslint-config-prettier": "^10.0.2", "eslint-plugin-prettier": "^5.2.3", "eslint-plugin-vue": "^9.32.0", + "eslint-plugin-vue-pug": "^0.6.2", "husky": "^9.1.7", "lint-staged": "^15.4.3", "prettier": "^3.5.2", + "pug": "^3.0.3", "sass": "^1.85.1", "semver": "^7.7.1", + "stylus": "^0.64.0", "typescript": "^5.7.3", "unplugin-auto-import": "^19.1.1", "unplugin-vue-components": "^28.4.1", "vite": "6.2.6", "vite-plugin-compression": "^0.5.1", "vite-plugin-eslint": "^1.8.1", + "vue-eslint-parser": "^10.2.0", "vue-tsc": "^2.2.4" }, "husky": { diff --git a/src/components/common/FTChart/index.vue b/src/components/common/FTChart/index.vue new file mode 100644 index 0000000..277ea82 --- /dev/null +++ b/src/components/common/FTChart/index.vue @@ -0,0 +1,81 @@ + + + + + diff --git a/src/layouts/default.vue b/src/layouts/default.vue index cacdc9a..44421cf 100644 --- a/src/layouts/default.vue +++ b/src/layouts/default.vue @@ -451,6 +451,7 @@ const containerStatus = computed(() => { border-radius: 10px; box-shadow: 0 0 1px rgba(0, 0, 0, 0.1); padding: 10px; + overflow: hidden; } .footer-expand { padding: 10px 15px 10px 85px !important; diff --git a/src/main.ts b/src/main.ts index 6d0810a..7fdb599 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,6 @@ import * as ElementPlusIconsVue from '@element-plus/icons-vue' import FtButton from 'components/common/FTButton/index.vue' +import FtChart from 'components/common/FTChart/index.vue' import FtDialog from 'components/common/FTDialog/index.vue' import FtStream from 'components/common/FTStream/index.vue' import FtTable from 'components/common/FTTable/index.vue' @@ -21,6 +22,7 @@ app.component('FtTable', FtTable) app.component('FtButton', FtButton) app.component('FtDialog', FtDialog) app.component('FtStream', FtStream) +app.component('FtChart', FtChart) app .use(router) .use(ElementPlus, { locale, zIndex: 3000 }) diff --git a/src/stores/debugStore.ts b/src/stores/debugStore.ts index 553dd75..b8d90a3 100644 --- a/src/stores/debugStore.ts +++ b/src/stores/debugStore.ts @@ -7,32 +7,51 @@ import { useSystemStore } from 'stores/systemStore' export const useDebugStore = defineStore('debug', { state: (): Debug.DebugStore => ({ formData: { - liquidModule: { - liquidMotor: { - absolutely: {}, - relative: {}, - }, - liquidPump: { - }, + lightModule: { + color: 'green', }, // 加热区 heatArea: { - heatModuleCode: 'heat_module_01', + heatModuleCode: 'heat_module_1', }, // 转运模组 transferModule: { // X轴 - xMotorData: { - absolutely: {}, + bigMotorData: { + absolute: {}, + relative: {}, + }, + smallMotorData: { + absolute: {}, relative: {}, }, // z轴 zMotorData: { - absolutely: {}, + absolute: {}, relative: {}, }, + // 夹爪 + clawMotorData: { + }, + }, + peristalticPumpData: { + ceramicPump: { + pumpCode: 'ceramic_pump_1', + }, + brushlessPump: { + pumpCode: 'brushless_pump_1', + }, + stepPump: { + pumpCode: 'step_pump_1', + }, + }, + titrationModule: { + absolute: { motorCode: 'titration_motor_1' }, + relative: { motorCode: 'titration_motor_1' }, }, - door: { + magnetStirMotor: { + absolute: { motorCode: 'magnet_stir_motor_1' }, + relative: { motorCode: 'magnet_stir_motor_1' }, }, }, }), diff --git a/src/types/debug.d.ts b/src/types/debug.d.ts index d602277..81be497 100644 --- a/src/types/debug.d.ts +++ b/src/types/debug.d.ts @@ -3,29 +3,38 @@ declare namespace Debug { formData: FormData } interface FormData { - liquidModule: LiquidModule heatArea: HeatArea transferModule: TransferModule - door: Door + peristalticPumpData: PeristalticPump + titrationModule: TitrationModule + lightModule: LightModule + magnetStirMotor: MagnetStirMotor } - interface Door { - speed?: number + + interface MagnetStirMotor { + absolute: MotorData & { + motorCode: 'magnet_stir_motor_1' | 'magnet_stir_motor_2' + } + relative: MotorData & { + motorCode: 'magnet_stir_motor_1' | 'magnet_stir_motor_2' + } } - interface LiquidModule { - liquidMotor: { - absolutely: MotorData - relative: MotorData + + interface TitrationModule { + absolute: MotorData & { + motorCode: 'titration_motor_1' | 'titration_motor_2' + } + relative: MotorData & { + motorCode: 'titration_motor_1' | 'titration_motor_2' } - liquidPump: LiquidPumpData } - interface LiquidPumpData { - speed?: number - volume?: number + interface LightModule { + color: 'red' | 'green' | 'yellow' } interface HeatArea { - heatModuleCode: 'heat_module_01' | 'heat_module_02' | 'heat_module_03' + heatModuleCode: 'heat_module_1' | 'heat_module_2' temperature?: number } @@ -36,15 +45,45 @@ declare namespace Debug { position?: number } + interface RoboticArmMotorData { + angle?: number + speed?: number + times?: number + position?: number + } + + interface PumpData { + speed?: number + volume?: number + direction?: 'forward' | 'backward' + } + + interface PeristalticPump { + ceramicPump: PumpData & { + pumpCode: 'ceramic_pump_1' | 'ceramic_pump_2' + } + brushlessPump: PumpData & { + pumpCode: 'brushless_pump_1' | 'brushless_pump_2' | 'brushless_pump_3' | 'brushless_pump_4' | 'brushless_pump_5' | 'brushless_pump_6' | 'brushless_pump_7' | 'brushless_pump_8' | 'brushless_pump_9' | 'brushless_pump_10' + } + stepPump: PumpData & { + pumpCode: 'step_pump_1' | 'step_pump_2' | 'step_pump_3' + } + } + interface TransferModule { - xMotorData: { - absolutely: MotorData - relative: MotorData + bigMotorData: { + absolute: RoboticArmMotorData + relative: RoboticArmMotorData + } + smallMotorData: { + absolute: RoboticArmMotorData + relative: RoboticArmMotorData } zMotorData: { - absolutely: MotorData + absolute: MotorData relative: MotorData } + clawMotorData: MotorData } } diff --git a/src/views/debug/index.vue b/src/views/debug/index.vue index acca2f6..b05c255 100644 --- a/src/views/debug/index.vue +++ b/src/views/debug/index.vue @@ -1,5 +1,4 @@ -