From 45d54c50d5bf74715e45b3050a8f0981c2a73021 Mon Sep 17 00:00:00 2001 From: "Mr.j" <2221464500@qq.com> Date: Wed, 6 Aug 2025 14:53:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=8A=E8=AE=BE=E5=A4=87=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=92=8C=E5=9F=B9=E8=AE=AD=E6=A8=A1=E5=9D=97=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=88=B0devlopment=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 + package-lock.json | 580 ++++++- package.json | 6 + src/apis/bussiness/bussiness.ts | 56 + src/apis/equipment/index.ts | 5 +- src/apis/equipment/procurement.ts | 125 ++ src/apis/index.ts | 3 + src/apis/training/index.ts | 44 + .../components/HeaderRightBar/index.vue | 2 +- src/router/route.ts | 129 +- src/stores/modules/route.ts | 76 + src/styles/base.scss | 2 +- src/styles/global.scss | 2 +- src/styles/index.scss | 12 +- src/test-console.vue | 41 + src/types/components.d.ts | 59 - src/types/training.d.ts | 71 + src/views/bussiness-data/bussiness.vue | 2 +- .../components/DeviceModal.vue | 1417 +++++++++++++++++ .../components/EquipmentSearch.vue | 496 ++++++ .../device-management/detail.vue | 4 +- .../device-management/index.vue | 1269 +++++++++++---- .../components/ProcurementModal.vue | 865 ++++++++++ .../components/ProcurementSearch.vue | 491 ++++++ .../device-management/procurement/index.vue | 856 ++++++++++ .../device-management/procurement/test.vue | 136 ++ src/views/training/detail.vue | 81 + .../plan/components/TrainingPlanModal.vue | 576 +++++++ src/views/training/plan/index.vue | 577 +++++++ .../user/message/components/MyMessage.vue | 6 +- tsconfig.json | 48 +- 31 files changed, 7551 insertions(+), 489 deletions(-) create mode 100644 src/apis/equipment/procurement.ts create mode 100644 src/apis/training/index.ts create mode 100644 src/test-console.vue create mode 100644 src/types/training.d.ts create mode 100644 src/views/system-resource/device-management/components/DeviceModal.vue create mode 100644 src/views/system-resource/device-management/components/EquipmentSearch.vue create mode 100644 src/views/system-resource/device-management/procurement/components/ProcurementModal.vue create mode 100644 src/views/system-resource/device-management/procurement/components/ProcurementSearch.vue create mode 100644 src/views/system-resource/device-management/procurement/index.vue create mode 100644 src/views/system-resource/device-management/procurement/test.vue create mode 100644 src/views/training/detail.vue create mode 100644 src/views/training/plan/components/TrainingPlanModal.vue create mode 100644 src/views/training/plan/index.vue diff --git a/.gitignore b/.gitignore index 3c3629e..d6008f4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ node_modules +dist +.gitignore +.env.development diff --git a/package-lock.json b/package-lock.json index 9de5c1b..d1fc496 100644 --- a/package-lock.json +++ b/package-lock.json @@ -60,21 +60,27 @@ "devDependencies": { "@antfu/eslint-config": "^2.16.3", "@arco-design/web-vue": "^2.57.0", + "@eslint/js": "^9.32.0", "@types/crypto-js": "^4.2.2", "@types/lodash-es": "^4.17.12", "@types/node": "^20.2.5", "@types/query-string": "^6.3.0", + "@typescript-eslint/eslint-plugin": "^8.39.0", + "@typescript-eslint/parser": "^8.39.0", "@vitejs/plugin-vue": "^5.2.1", "@vitejs/plugin-vue-jsx": "^3.1.0", "@vue/tsconfig": "^0.1.3", "boxen": "^7.1.1", - "eslint": "^9.0.0", + "eslint": "^9.32.0", + "eslint-plugin-react": "^7.37.5", + "globals": "^16.3.0", "less": "^4.1.3", "less-loader": "^11.0.0", "picocolors": "^1.0.0", "sass": "^1.62.1", "sass-loader": "^13.2.2", "typescript": "~5.0.4", + "typescript-eslint": "^8.39.0", "unplugin-auto-import": "^0.16.4", "unplugin-vue-components": "^0.25.1", "vite": "^5.1.5", @@ -210,6 +216,18 @@ } } }, + "node_modules/@antfu/eslint-config/node_modules/globals": { + "version": "15.15.0", + "resolved": "https://registry.npmmirror.com/globals/-/globals-15.15.0.tgz", + "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/@antfu/install-pkg": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/@antfu/install-pkg/-/install-pkg-0.4.1.tgz", @@ -3324,17 +3342,16 @@ "license": "MIT" }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.38.0.tgz", - "integrity": "sha512-CPoznzpuAnIOl4nhj4tRr4gIPj5AfKgkiJmGQDaq+fQnRJTYlcBjbX3wbciGmpoPf8DREufuPRe1tNMZnGdanA==", + "version": "8.39.0", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.39.0.tgz", + "integrity": "sha512-bhEz6OZeUR+O/6yx9Jk6ohX6H9JSFTaiY0v9/PuKT3oGK0rn0jNplLmyFUGV+a9gfYnVNwGDwS/UkLIuXNb2Rw==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.38.0", - "@typescript-eslint/type-utils": "8.38.0", - "@typescript-eslint/utils": "8.38.0", - "@typescript-eslint/visitor-keys": "8.38.0", + "@typescript-eslint/scope-manager": "8.39.0", + "@typescript-eslint/type-utils": "8.39.0", + "@typescript-eslint/utils": "8.39.0", + "@typescript-eslint/visitor-keys": "8.39.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -3348,9 +3365,9 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.38.0", + "@typescript-eslint/parser": "^8.39.0", "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { @@ -3364,16 +3381,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.38.0.tgz", - "integrity": "sha512-Zhy8HCvBUEfBECzIl1PKqF4p11+d0aUJS1GeUiuqK9WmOug8YCmC4h4bjyBvMyAMI9sbRczmrYL5lKg/YMbrcQ==", + "version": "8.39.0", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/parser/-/parser-8.39.0.tgz", + "integrity": "sha512-g3WpVQHngx0aLXn6kfIYCZxM6rRJlWzEkVpqEFLT3SgEDsp9cpCbxxgwnE504q4H+ruSDh/VGS6nqZIDynP+vg==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "8.38.0", - "@typescript-eslint/types": "8.38.0", - "@typescript-eslint/typescript-estree": "8.38.0", - "@typescript-eslint/visitor-keys": "8.38.0", + "@typescript-eslint/scope-manager": "8.39.0", + "@typescript-eslint/types": "8.39.0", + "@typescript-eslint/typescript-estree": "8.39.0", + "@typescript-eslint/visitor-keys": "8.39.0", "debug": "^4.3.4" }, "engines": { @@ -3385,18 +3401,17 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/project-service": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.38.0.tgz", - "integrity": "sha512-dbK7Jvqcb8c9QfH01YB6pORpqX1mn5gDZc9n63Ak/+jD67oWXn3Gs0M6vddAN+eDXBCS5EmNWzbSxsn9SzFWWg==", + "version": "8.39.0", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/project-service/-/project-service-8.39.0.tgz", + "integrity": "sha512-CTzJqaSq30V/Z2Og9jogzZt8lJRR5TKlAdXmWgdu4hgcC9Kww5flQ+xFvMxIBWVNdxJO7OifgdOK4PokMIWPew==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.38.0", - "@typescript-eslint/types": "^8.38.0", + "@typescript-eslint/tsconfig-utils": "^8.39.0", + "@typescript-eslint/types": "^8.39.0", "debug": "^4.3.4" }, "engines": { @@ -3407,18 +3422,17 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.38.0.tgz", - "integrity": "sha512-WJw3AVlFFcdT9Ri1xs/lg8LwDqgekWXWhH3iAF+1ZM+QPd7oxQ6jvtW/JPwzAScxitILUIFs0/AnQ/UWHzbATQ==", + "version": "8.39.0", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/scope-manager/-/scope-manager-8.39.0.tgz", + "integrity": "sha512-8QOzff9UKxOh6npZQ/4FQu4mjdOCGSdO3p44ww0hk8Vu+IGbg0tB/H1LcTARRDzGCC8pDGbh2rissBuuoPgH8A==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.38.0", - "@typescript-eslint/visitor-keys": "8.38.0" + "@typescript-eslint/types": "8.39.0", + "@typescript-eslint/visitor-keys": "8.39.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3429,11 +3443,10 @@ } }, "node_modules/@typescript-eslint/tsconfig-utils": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.38.0.tgz", - "integrity": "sha512-Lum9RtSE3EroKk/bYns+sPOodqb2Fv50XOl/gMviMKNvanETUuUcC9ObRbzrJ4VSd2JalPqgSAavwrPiPvnAiQ==", + "version": "8.39.0", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.39.0.tgz", + "integrity": "sha512-Fd3/QjmFV2sKmvv3Mrj8r6N8CryYiCS8Wdb/6/rgOXAWGcFuc+VkQuG28uk/4kVNVZBQuuDHEDUpo/pQ32zsIQ==", "dev": true, - "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -3442,19 +3455,18 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/type-utils": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.38.0.tgz", - "integrity": "sha512-c7jAvGEZVf0ao2z+nnz8BUaHZD09Agbh+DY7qvBQqLiz8uJzRgVPj5YvOh8I8uEiH8oIUGIfHzMwUcGVco/SJg==", + "version": "8.39.0", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/type-utils/-/type-utils-8.39.0.tgz", + "integrity": "sha512-6B3z0c1DXVT2vYA9+z9axjtc09rqKUPRmijD5m9iv8iQpHBRYRMBcgxSiKTZKm6FwWw1/cI4v6em35OsKCiN5Q==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.38.0", - "@typescript-eslint/typescript-estree": "8.38.0", - "@typescript-eslint/utils": "8.38.0", + "@typescript-eslint/types": "8.39.0", + "@typescript-eslint/typescript-estree": "8.39.0", + "@typescript-eslint/utils": "8.39.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -3467,15 +3479,14 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/types": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.38.0.tgz", - "integrity": "sha512-wzkUfX3plUqij4YwWaJyqhiPE5UCRVlFpKn1oCRn2O1bJ592XxWJj8ROQ3JD5MYXLORW84063z3tZTb/cs4Tyw==", + "version": "8.39.0", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/types/-/types-8.39.0.tgz", + "integrity": "sha512-ArDdaOllnCj3yn/lzKn9s0pBQYmmyme/v1HbGIGB0GB/knFI3fWMHloC+oYTJW46tVbYnGKTMDK4ah1sC2v0Kg==", "dev": true, - "license": "MIT", "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, @@ -3485,16 +3496,15 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.38.0.tgz", - "integrity": "sha512-fooELKcAKzxux6fA6pxOflpNS0jc+nOQEEOipXFNjSlBS6fqrJOVY/whSn70SScHrcJ2LDsxWrneFoWYSVfqhQ==", + "version": "8.39.0", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.39.0.tgz", + "integrity": "sha512-ndWdiflRMvfIgQRpckQQLiB5qAKQ7w++V4LlCHwp62eym1HLB/kw7D9f2e8ytONls/jt89TEasgvb+VwnRprsw==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/project-service": "8.38.0", - "@typescript-eslint/tsconfig-utils": "8.38.0", - "@typescript-eslint/types": "8.38.0", - "@typescript-eslint/visitor-keys": "8.38.0", + "@typescript-eslint/project-service": "8.39.0", + "@typescript-eslint/tsconfig-utils": "8.39.0", + "@typescript-eslint/types": "8.39.0", + "@typescript-eslint/visitor-keys": "8.39.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", @@ -3510,20 +3520,19 @@ "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/utils": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.38.0.tgz", - "integrity": "sha512-hHcMA86Hgt+ijJlrD8fX0j1j8w4C92zue/8LOPAFioIno+W0+L7KqE8QZKCcPGc/92Vs9x36w/4MPTJhqXdyvg==", + "version": "8.39.0", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/utils/-/utils-8.39.0.tgz", + "integrity": "sha512-4GVSvNA0Vx1Ktwvf4sFE+exxJ3QGUorQG1/A5mRfRNZtkBT2xrA/BCO2H0eALx/PnvCS6/vmYwRdDA41EoffkQ==", "dev": true, - "license": "MIT", "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.38.0", - "@typescript-eslint/types": "8.38.0", - "@typescript-eslint/typescript-estree": "8.38.0" + "@typescript-eslint/scope-manager": "8.39.0", + "@typescript-eslint/types": "8.39.0", + "@typescript-eslint/typescript-estree": "8.39.0" }, "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" @@ -3534,17 +3543,16 @@ }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", - "typescript": ">=4.8.4 <5.9.0" + "typescript": ">=4.8.4 <6.0.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "8.38.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.38.0.tgz", - "integrity": "sha512-pWrTcoFNWuwHlA9CvlfSsGWs14JxfN1TH25zM5L7o0pRLhsoZkDnTsXfQRJBEWJoV5DL0jf+Z+sxiud+K0mq1g==", + "version": "8.39.0", + "resolved": "https://registry.npmmirror.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.39.0.tgz", + "integrity": "sha512-ldgiJ+VAhQCfIjeOgu8Kj5nSxds0ktPOSO9p4+0VDH2R2pLvQraaM5Oen2d7NxzMCm+Sn/vJT+mv2H5u6b/3fA==", "dev": true, - "license": "MIT", "dependencies": { - "@typescript-eslint/types": "8.38.0", + "@typescript-eslint/types": "8.39.0", "eslint-visitor-keys": "^4.2.1" }, "engines": { @@ -4823,6 +4831,28 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/array-includes": { + "version": "3.1.9", + "resolved": "https://registry.npmmirror.com/array-includes/-/array-includes-3.1.9.tgz", + "integrity": "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-abstract": "^1.24.0", + "es-object-atoms": "^1.1.1", + "get-intrinsic": "^1.3.0", + "is-string": "^1.1.1", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/array-unique": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", @@ -4833,6 +4863,78 @@ "node": ">=0.10.0" } }, + "node_modules/array.prototype.findlast": { + "version": "1.2.5", + "resolved": "https://registry.npmmirror.com/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", + "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flat": { + "version": "1.3.3", + "resolved": "https://registry.npmmirror.com/array.prototype.flat/-/array.prototype.flat-1.3.3.tgz", + "integrity": "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.flatmap": { + "version": "1.3.3", + "resolved": "https://registry.npmmirror.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.3.tgz", + "integrity": "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.5", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/array.prototype.tosorted": { + "version": "1.1.4", + "resolved": "https://registry.npmmirror.com/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", + "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.3", + "es-errors": "^1.3.0", + "es-shim-unscopables": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/arraybuffer.prototype.slice": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.4.tgz", @@ -6437,6 +6539,18 @@ "url": "https://github.com/sponsors/wooorm" } }, + "node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmmirror.com/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/dom-serializer": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.2.2.tgz", @@ -6764,6 +6878,33 @@ "node": ">= 0.4" } }, + "node_modules/es-iterator-helpers": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/es-iterator-helpers/-/es-iterator-helpers-1.2.1.tgz", + "integrity": "sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-set-tostringtag": "^2.0.3", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.6", + "globalthis": "^1.0.4", + "gopd": "^1.2.0", + "has-property-descriptors": "^1.0.2", + "has-proto": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "iterator.prototype": "^1.1.4", + "safe-array-concat": "^1.1.3" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-module-lexer": { "version": "0.9.3", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-0.9.3.tgz", @@ -6798,6 +6939,18 @@ "node": ">= 0.4" } }, + "node_modules/es-shim-unscopables": { + "version": "1.1.0", + "resolved": "https://registry.npmmirror.com/es-shim-unscopables/-/es-shim-unscopables-1.1.0.tgz", + "integrity": "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==", + "dev": true, + "dependencies": { + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/es-to-primitive": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.3.0.tgz", @@ -7645,6 +7798,18 @@ "eslint": ">=8.23.0" } }, + "node_modules/eslint-plugin-n/node_modules/globals": { + "version": "15.15.0", + "resolved": "https://registry.npmmirror.com/globals/-/globals-15.15.0.tgz", + "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint-plugin-no-only-tests": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/eslint-plugin-no-only-tests/-/eslint-plugin-no-only-tests-3.3.0.tgz", @@ -7692,6 +7857,86 @@ } } }, + "node_modules/eslint-plugin-react": { + "version": "7.37.5", + "resolved": "https://registry.npmmirror.com/eslint-plugin-react/-/eslint-plugin-react-7.37.5.tgz", + "integrity": "sha512-Qteup0SqU15kdocexFNAJMvCJEfa2xUKNV4CC1xsVMrIIqEy3SQ/rqyxCWNzfrd3/ldy6HMlD2e0JDVpDg2qIA==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.8", + "array.prototype.findlast": "^1.2.5", + "array.prototype.flatmap": "^1.3.3", + "array.prototype.tosorted": "^1.1.4", + "doctrine": "^2.1.0", + "es-iterator-helpers": "^1.2.1", + "estraverse": "^5.3.0", + "hasown": "^2.0.2", + "jsx-ast-utils": "^2.4.1 || ^3.0.0", + "minimatch": "^3.1.2", + "object.entries": "^1.1.9", + "object.fromentries": "^2.0.8", + "object.values": "^1.2.1", + "prop-types": "^15.8.1", + "resolve": "^2.0.0-next.5", + "semver": "^6.3.1", + "string.prototype.matchall": "^4.0.12", + "string.prototype.repeat": "^1.0.0" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" + } + }, + "node_modules/eslint-plugin-react/node_modules/brace-expansion": { + "version": "1.1.12", + "resolved": "https://registry.npmmirror.com/brace-expansion/-/brace-expansion-1.1.12.tgz", + "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint-plugin-react/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmmirror.com/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint-plugin-react/node_modules/resolve": { + "version": "2.0.0-next.5", + "resolved": "https://registry.npmmirror.com/resolve/-/resolve-2.0.0-next.5.tgz", + "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", + "dev": true, + "dependencies": { + "is-core-module": "^2.13.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/eslint-plugin-react/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmmirror.com/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, "node_modules/eslint-plugin-regexp": { "version": "2.9.0", "resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-2.9.0.tgz", @@ -7786,6 +8031,18 @@ "eslint": ">=8.56.0" } }, + "node_modules/eslint-plugin-unicorn/node_modules/globals": { + "version": "15.15.0", + "resolved": "https://registry.npmmirror.com/globals/-/globals-15.15.0.tgz", + "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", + "dev": true, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint-plugin-unused-imports": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/eslint-plugin-unused-imports/-/eslint-plugin-unused-imports-4.1.4.tgz", @@ -8839,11 +9096,10 @@ "peer": true }, "node_modules/globals": { - "version": "15.15.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-15.15.0.tgz", - "integrity": "sha512-7ACyT3wmyp3I61S4fG682L0VA2RGD9otkqGJIwNUMF1SWUombIIk+af1unuDYgMm082aHYwD+mzJvv9Iu8dsgg==", + "version": "16.3.0", + "resolved": "https://registry.npmmirror.com/globals/-/globals-16.3.0.tgz", + "integrity": "sha512-bqWEnJ1Nt3neqx2q5SFfGS8r/ahumIakg3HcwtNlrVlwXIeNumWn/c7Pn/wKzGhf6SaW6H6uWXLqC30STCMchQ==", "dev": true, - "license": "MIT", "engines": { "node": ">=18" }, @@ -9995,6 +10251,23 @@ "node": ">=0.10.0" } }, + "node_modules/iterator.prototype": { + "version": "1.1.5", + "resolved": "https://registry.npmmirror.com/iterator.prototype/-/iterator.prototype-1.1.5.tgz", + "integrity": "sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==", + "dev": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "get-proto": "^1.0.0", + "has-symbols": "^1.1.0", + "set-function-name": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", @@ -10191,6 +10464,21 @@ "html2canvas": "^1.0.0-rc.5" } }, + "node_modules/jsx-ast-utils": { + "version": "3.3.5", + "resolved": "https://registry.npmmirror.com/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", + "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "object.assign": "^4.1.4", + "object.values": "^1.1.6" + }, + "engines": { + "node": ">=4.0" + } + }, "node_modules/keyv": { "version": "4.5.4", "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", @@ -10576,6 +10864,18 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmmirror.com/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "dependencies": { + "js-tokens": "^3.0.0 || ^4.0.0" + }, + "bin": { + "loose-envify": "cli.js" + } + }, "node_modules/lower-case": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", @@ -11412,6 +11712,39 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/object.entries": { + "version": "1.1.9", + "resolved": "https://registry.npmmirror.com/object.entries/-/object.entries-1.1.9.tgz", + "integrity": "sha512-8u/hfXFRBD1O0hPUjioLhoWFHRmt6tKA4/vZPyckBr18l1KE9uHrFaFaUi8MDRTpi4uak2goyPTSNJLXX2k2Hw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.4", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/object.fromentries": { + "version": "2.0.8", + "resolved": "https://registry.npmmirror.com/object.fromentries/-/object.fromentries-2.0.8.tgz", + "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.7", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.2", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/object.pick": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", @@ -11435,6 +11768,24 @@ "node": ">=0.10.0" } }, + "node_modules/object.values": { + "version": "1.2.1", + "resolved": "https://registry.npmmirror.com/object.values/-/object.values-1.2.1.tgz", + "integrity": "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/on-finished": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", @@ -12053,6 +12404,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/prop-types": { + "version": "15.8.1", + "resolved": "https://registry.npmmirror.com/prop-types/-/prop-types-15.8.1.tgz", + "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", + "dev": true, + "dependencies": { + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.13.1" + } + }, "node_modules/prosemirror-changeset": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/prosemirror-changeset/-/prosemirror-changeset-2.3.1.tgz", @@ -12365,6 +12727,12 @@ "safe-buffer": "^5.1.0" } }, + "node_modules/react-is": { + "version": "16.13.1", + "resolved": "https://registry.npmmirror.com/react-is/-/react-is-16.13.1.tgz", + "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", + "dev": true + }, "node_modules/read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -13897,6 +14265,43 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/string.prototype.matchall": { + "version": "4.0.12", + "resolved": "https://registry.npmmirror.com/string.prototype.matchall/-/string.prototype.matchall-4.0.12.tgz", + "integrity": "sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.8", + "call-bound": "^1.0.3", + "define-properties": "^1.2.1", + "es-abstract": "^1.23.6", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.0.0", + "get-intrinsic": "^1.2.6", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "internal-slot": "^1.1.0", + "regexp.prototype.flags": "^1.5.3", + "set-function-name": "^2.0.2", + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/string.prototype.repeat": { + "version": "1.0.0", + "resolved": "https://registry.npmmirror.com/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", + "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, "node_modules/string.prototype.trim": { "version": "1.2.10", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.10.tgz", @@ -14888,6 +15293,29 @@ "node": ">=12.20" } }, + "node_modules/typescript-eslint": { + "version": "8.39.0", + "resolved": "https://registry.npmmirror.com/typescript-eslint/-/typescript-eslint-8.39.0.tgz", + "integrity": "sha512-lH8FvtdtzcHJCkMOKnN73LIn6SLTpoojgJqDAxPm1jCR14eWSGPX8ul/gggBdPMk/d5+u9V854vTYQ8T5jF/1Q==", + "dev": true, + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.39.0", + "@typescript-eslint/parser": "8.39.0", + "@typescript-eslint/typescript-estree": "8.39.0", + "@typescript-eslint/utils": "8.39.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0", + "typescript": ">=4.8.4 <6.0.0" + } + }, "node_modules/uc.micro": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", diff --git a/package.json b/package.json index 623060d..2d31bef 100644 --- a/package.json +++ b/package.json @@ -66,21 +66,27 @@ "devDependencies": { "@antfu/eslint-config": "^2.16.3", "@arco-design/web-vue": "^2.57.0", + "@eslint/js": "^9.32.0", "@types/crypto-js": "^4.2.2", "@types/lodash-es": "^4.17.12", "@types/node": "^20.2.5", "@types/query-string": "^6.3.0", + "@typescript-eslint/eslint-plugin": "^8.39.0", + "@typescript-eslint/parser": "^8.39.0", "@vitejs/plugin-vue": "^5.2.1", "@vitejs/plugin-vue-jsx": "^3.1.0", "@vue/tsconfig": "^0.1.3", "boxen": "^7.1.1", "eslint": "^9.0.0", + "eslint-plugin-react": "^7.37.5", + "globals": "^16.3.0", "less": "^4.1.3", "less-loader": "^11.0.0", "picocolors": "^1.0.0", "sass": "^1.62.1", "sass-loader": "^13.2.2", "typescript": "~5.0.4", + "typescript-eslint": "^8.39.0", "unplugin-auto-import": "^0.16.4", "unplugin-vue-components": "^0.25.1", "vite": "^5.1.5", diff --git a/src/apis/bussiness/bussiness.ts b/src/apis/bussiness/bussiness.ts index 8a6dc25..eb07866 100644 --- a/src/apis/bussiness/bussiness.ts +++ b/src/apis/bussiness/bussiness.ts @@ -26,6 +26,15 @@ export function getFolderTreeApi() { }) } +// 获取文件夹列表 +export function getFolderListApi(params?: { page?: number; pageSize?: number; folderName?: string }) { + return request<{ list: KnowledgeFolder[]; total: number }>({ + url: '/knowledge/folder-list', + method: 'get', + params, + }) +} + // 获取文件列表(按文件夹) export function getFilesApi(folderId: string) { return request({ @@ -44,6 +53,23 @@ export function createFolderApi(data: { name: string; parentId?: string }) { }) } +// 更新文件夹 +export function updateFolderApi(folderId: string, data: { name: string }) { + return request({ + url: `/knowledge/update-folder/${folderId}`, + method: 'put', + data, + }) +} + +// 删除文件夹 +export function deleteFolderApi(folderId: string) { + return request({ + url: `/knowledge/delete-folder/${folderId}`, + method: 'delete', + }) +} + // 删除文件 export function deleteFileApi(fileId: string) { return request({ @@ -60,3 +86,33 @@ export function downloadFileApi(fileId: string) { responseType: 'blob', }) } + +// 上传文件 +export function uploadFileApi(data: FormData) { + return request({ + url: '/knowledge/upload', + method: 'post', + data, + headers: { + 'Content-Type': 'multipart/form-data', + }, + }) +} + +// 更新文件名 +export function updateFileNameApi(fileId: string, newName: string) { + return request({ + url: `/knowledge/update-filename/${fileId}`, + method: 'put', + data: { newName }, + }) +} + +// 预览文件 +export function previewFileApi(fileId: string) { + return request({ + url: `/knowledge/preview/${fileId}`, + method: 'get', + responseType: 'blob', + }) +} diff --git a/src/apis/equipment/index.ts b/src/apis/equipment/index.ts index 3cf43b6..79de61c 100644 --- a/src/apis/equipment/index.ts +++ b/src/apis/equipment/index.ts @@ -46,4 +46,7 @@ export function assignEquipment(equipmentId: string, userId: string) { /** @desc 设备归还 */ export function returnEquipment(equipmentId: string) { return http.put(`${BASE_URL}/${equipmentId}/return`) -} \ No newline at end of file +} + +// 导出设备采购 API +export * from './procurement' \ No newline at end of file diff --git a/src/apis/equipment/procurement.ts b/src/apis/equipment/procurement.ts new file mode 100644 index 0000000..cae4d71 --- /dev/null +++ b/src/apis/equipment/procurement.ts @@ -0,0 +1,125 @@ +import http from '@/utils/http' +import type { EquipmentListReq, EquipmentReq, EquipmentResp } from './type' + +/** + * 设备采购管理API + */ +export const equipmentProcurementApi = { + /** + * 分页查询设备采购记录 + */ + page: (params: EquipmentListReq) => { + console.log('🔍 API - equipmentProcurementApi.page 被调用') + console.log('🔍 API - 接收到的参数:', params) + console.log('🔍 API - 参数类型:', typeof params) + console.log('🔍 API - 参数的键值对:') + Object.entries(params).forEach(([key, value]) => { + console.log(` ${key}: ${value} (${typeof value})`) + }) + + // 确保参数格式正确 + const requestParams = { + ...params, + // 确保分页参数存在 + page: params.page || 1, + pageSize: params.pageSize || 10, + } + + console.log('🔍 API - 最终请求参数:', requestParams) + console.log('🔍 API - 准备发送GET请求到 /equipment/procurement/page') + console.log('🔍 API - 请求参数序列化前:', requestParams) + + // 手动序列化参数进行调试(使用URLSearchParams) + const searchParams = new URLSearchParams() + Object.entries(requestParams).forEach(([key, value]) => { + if (value !== undefined && value !== null && value !== '') { + searchParams.append(key, String(value)) + } + }) + console.log('🔍 API - 手动序列化后的参数:', searchParams.toString()) + + // 参考设备模块的调用方式,直接将参数作为第二个参数传递 + return http.get>>('/equipment/procurement/page', requestParams) + }, + + /** + * 测试参数传递 - 使用API文档中的参数格式 + */ + testPage: () => { + console.log('🧪 API - 测试参数传递') + + // 使用API文档中的参数格式进行测试 + const testParams = { + page: 1, + pageSize: 10, + equipmentName: '测试设备', + supplierName: '测试供应商', + quantity: 10, + unitPrice: 100.50, + totalPrice: 1005.00, + accountNumber: 'TEST001', + brand: '测试品牌', + locationStatus: 'spare', + physicalLocation: '测试位置', + purchaseOrder: 'PO001', + inventoryBasis: '测试依据', + dynamicRecord: '测试记录' + } + + console.log('🧪 API - 测试参数:', testParams) + + return http.get>>('/equipment/procurement/page', testParams) + }, + + /** + * 新增设备采购记录 + */ + add: (data: EquipmentReq) => { + return http.post>('/equipment/procurement', data) + }, + + /** + * 修改设备采购记录 + */ + update: (equipmentId: string, data: EquipmentReq) => { + return http.put>(`/equipment/procurement/${equipmentId}`, data) + }, + + /** + * 删除设备采购记录 + */ + delete: (equipmentId: string) => { + return http.del>(`/equipment/procurement/${equipmentId}`) + }, + + /** + * 获取设备采购记录详情 + */ + detail: (equipmentId: string) => { + return http.get>(`/equipment/procurement/detail/${equipmentId}`) + }, + + /** + * 获取采购统计信息 + */ + getStats: () => { + return http.get>('/equipment/procurement/stats') + }, + + /** + * 批量删除设备采购记录 + */ + batchDelete: (equipmentIds: string[]) => { + return http.del>('/equipment/procurement/batch', { data: equipmentIds }) + }, + + /** + * 导出设备采购记录 + */ + export: (params: EquipmentListReq) => { + return http.get('/equipment/procurement/export', { + params, + responseType: 'blob' + }) + } +} \ No newline at end of file diff --git a/src/apis/index.ts b/src/apis/index.ts index 1b8228f..8218898 100644 --- a/src/apis/index.ts +++ b/src/apis/index.ts @@ -17,6 +17,9 @@ export * as HealthRecordAPI from './health-record' export * as InsuranceFileAPI from './insurance-file' export * as EmployeeAPI from './employee' export * as RegulationAPI from './regulation' +export * as TrainingAPI from './training' +export * as EquipmentAPI from './equipment' +export * as BussinessAPI from './bussiness/bussiness' export * from './area/type' export * from './auth/type' diff --git a/src/apis/training/index.ts b/src/apis/training/index.ts new file mode 100644 index 0000000..3a6f038 --- /dev/null +++ b/src/apis/training/index.ts @@ -0,0 +1,44 @@ +import http from '@/utils/http' +import type * as T from '@/types/training.d' + +const BASE_URL = '/training' + +/** @desc 分页查询培训计划列表 */ +export function pageTrainingPlan(query: T.TrainingPlanPageQuery) { + return http.get(`${BASE_URL}/plan/page`, query) +} + +/** @desc 查询培训计划列表 */ +export function listTrainingPlan(query?: T.TrainingPlanPageQuery) { + return http.get(`${BASE_URL}/plan/list`, query) +} + +/** @desc 查询培训计划详情 */ +export function getTrainingPlanDetail(planId: string) { + return http.get(`${BASE_URL}/plan/detail/${planId}`) +} + +/** @desc 新增培训计划 */ +export function createTrainingPlan(data: T.TrainingPlanReq) { + return http.post(`${BASE_URL}/plan`, data) +} + +/** @desc 更新培训计划 */ +export function updateTrainingPlan(planId: string, data: T.TrainingPlanReq) { + return http.put(`${BASE_URL}/plan/${planId}`, data) +} + +/** @desc 删除培训计划 */ +export function deleteTrainingPlan(planId: string) { + return http.del(`${BASE_URL}/plan/${planId}`) +} + +/** @desc 发布培训计划 */ +export function publishTrainingPlan(planId: string) { + return http.put(`${BASE_URL}/plan/${planId}/publish`) +} + +/** @desc 取消培训计划 */ +export function cancelTrainingPlan(planId: string) { + return http.put(`${BASE_URL}/plan/${planId}/cancel`) +} diff --git a/src/layout/components/HeaderRightBar/index.vue b/src/layout/components/HeaderRightBar/index.vue index 854cea3..ecc4a36 100644 --- a/src/layout/components/HeaderRightBar/index.vue +++ b/src/layout/components/HeaderRightBar/index.vue @@ -80,7 +80,7 @@ import { onMounted, ref, nextTick } from 'vue' import Message from './Message.vue' import SettingDrawer from './SettingDrawer.vue' import Search from './Search.vue' -import { getUnreadMessageCount } from '@/apis' + import { useUserStore } from '@/stores' import { getToken } from '@/utils/auth' import { useBreakpoint, useDevice } from '@/hooks' diff --git a/src/router/route.ts b/src/router/route.ts index 0854679..fb76aea 100644 --- a/src/router/route.ts +++ b/src/router/route.ts @@ -296,64 +296,98 @@ export const systemRoutes: RouteRecordRaw[] = [ path: '/asset-management', name: 'AssetManagement', component: Layout, - redirect: '/asset-management/device/inventory', - meta: { title: '资产管理', icon: 'property-safety', hidden: false, sort: 3 }, + redirect: '/asset-management/device-management/device-center', + meta: { title: '资产管理', icon: 'property-safety', hidden: true, sort: 3 }, children: [ { - path: '/asset-management/intellectual-property1', - name: 'IntellectualProperty1', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '设备管理', icon: 'copyright', hidden: false }, + path: '/asset-management/device-management', + name: 'DeviceManagement', + component: () => import('@/components/ParentView/index.vue'), + redirect: '/asset-management/device-management/device-center', + meta: { + title: '设备管理', + icon: 'device', + hidden: false, + }, children: [ { - path: '/asset-management/intellectual-property1', - name: 'IntellectualProperty11', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '库存管理', hidden: false }, + path: '/asset-management/device-management/device-center', + name: 'DeviceCenter', + component: () => import('@/views/system-resource/device-management/index.vue'), + meta: { + title: '设备中心', + icon: 'appstore', + hidden: false, + }, }, { - path: '/asset-management/intellectual-property1', - name: 'IntellectualProperty12', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '设备采购', hidden: false }, + path: '/asset-management/device-management/device-detail/:id', + name: 'DeviceDetail', + component: () => import('@/views/system-resource/device-management/detail.vue'), + meta: { + title: '设备详情', + icon: 'info-circle', + hidden: true, + }, }, { - path: '/asset-management/intellectual-property1', - name: 'IntellectualProperty13', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '在线管理', hidden: false }, + path: '/asset-management/device-management/procurement', + name: 'DeviceProcurement', + component: () => import('@/views/system-resource/device-management/procurement/index.vue'), + meta: { + title: '设备采购', + icon: 'shopping-cart', + hidden: false, + }, + }, + { + path: '/asset-management/device-management/online', + name: 'DeviceOnline', + component: () => import('@/components/ParentView/index.vue'), + redirect: '/asset-management/device-management/online/drone', + meta: { + title: '在线管理', + icon: 'cloud', + hidden: false, + }, children: [ { - path: '/asset-management/intellectual-property11', - name: 'IntellectualProperty14', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '无人机', hidden: false }, + path: '/asset-management/device-management/online/drone', + name: 'DeviceDrone', + component: () => import('@/views/system-resource/device-management/index.vue'), + meta: { + title: '无人机', + icon: 'drone', + hidden: false, + }, }, { - path: '/asset-management/intellectual-property12', - name: 'IntellectualProperty15', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '机巢', hidden: false }, + path: '/asset-management/device-management/online/nest', + name: 'DeviceNest', + component: () => import('@/views/system-resource/device-management/index.vue'), + meta: { + title: '机巢', + icon: 'nest', + hidden: false, + }, }, { - path: '/asset-management/intellectual-property13', - name: 'IntellectualProperty16', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '其他智能终端', hidden: false }, - }, - { - path: '/asset-management/intellectual-property14', - name: 'IntellectualProperty17', - component: () => import('@/views/system-resource/information-system/software-management/index.vue'), - meta: { title: '车辆管理', hidden: false }, + path: '/asset-management/device-management/online/smart-terminal', + name: 'DeviceSmartTerminal', + component: () => import('@/views/system-resource/device-management/index.vue'), + meta: { + title: '其他智能终端', + icon: 'terminal', + hidden: false, + }, }, ], }, ], }, { - path: '/asset-management/intellectual-property', - name: 'IntellectualProperty', + path: '/asset-management/other-assets', + name: 'OtherAssets', component: () => import('@/views/system-resource/information-system/software-management/index.vue'), meta: { title: '其他资产', icon: 'copyright', hidden: false }, }, @@ -1158,6 +1192,25 @@ export const systemRoutes: RouteRecordRaw[] = [ }, ], }, + { + path: '/training', + name: 'Training', + component: Layout, + redirect: '/training/plan', + meta: { title: '培训管理', icon: 'book', hidden: false, sort: 9 }, + children: [ + { + path: '/training/plan', + name: 'TrainingPlan', + component: () => import('@/views/training/plan/index.vue'), + meta: { + title: '培训计划', + icon: 'calendar', + hidden: false, + }, + }, + ], + }, { path: '/system-resource', name: 'SystemResource', diff --git a/src/stores/modules/route.ts b/src/stores/modules/route.ts index 7b7ca42..2001fea 100644 --- a/src/stores/modules/route.ts +++ b/src/stores/modules/route.ts @@ -150,6 +150,82 @@ const storeSetup = () => { sort: 3, }, ], + }, + { + id: 2000, + parentId: 0, + title: '资产管理', + type: 1, + path: '/asset-management', + name: 'AssetManagement', + component: 'Layout', + redirect: '/asset-management/device-management/device-center', + icon: 'desktop', + isExternal: false, + isCache: false, + isHidden: false, + sort: 2, + children: [ + { + id: 2010, + parentId: 2000, + title: '设备管理', + type: 1, + path: '/asset-management/device-management', + name: 'DeviceManagement', + component: 'Layout', + redirect: '/asset-management/device-management/device-center', + icon: 'desktop', + isExternal: false, + isCache: false, + isHidden: false, + sort: 1, + children: [ + { + id: 2011, + parentId: 2010, + title: '设备中心', + type: 2, + path: '/asset-management/device-management/device-center', + name: 'DeviceCenter', + component: 'system-resource/device-management/index', + icon: 'desktop', + isExternal: false, + isCache: false, + isHidden: false, + sort: 1, + }, + { + id: 2012, + parentId: 2010, + title: '设备采购', + type: 2, + path: '/asset-management/device-management/procurement', + name: 'DeviceProcurement', + component: 'system-resource/device-management/procurement/index', + icon: 'shopping-cart', + isExternal: false, + isCache: false, + isHidden: false, + sort: 2, + }, + { + id: 2013, + parentId: 2010, + title: '设备详情', + type: 2, + path: '/asset-management/device-management/device-detail/:id', + name: 'DeviceDetail', + component: 'system-resource/device-management/detail', + icon: 'file-text', + isExternal: false, + isCache: false, + isHidden: true, + sort: 3, + }, + ], + }, + ], }] // 使用已转换的数据生成路由 const asyncRoutes = formatAsyncRoutes(data as unknown as RouteItem[]) diff --git a/src/styles/base.scss b/src/styles/base.scss index c80b245..69cbf57 100644 --- a/src/styles/base.scss +++ b/src/styles/base.scss @@ -1,4 +1,4 @@ -@import './var.scss'; +@use './var.scss' as *; body { --margin: 14px; // 通用外边距 diff --git a/src/styles/global.scss b/src/styles/global.scss index e306f79..86d49ac 100644 --- a/src/styles/global.scss +++ b/src/styles/global.scss @@ -1,5 +1,5 @@ /* 全局样式 */ -@import './var.scss'; +@use './var.scss' as *; .w-full { width: 100%; diff --git a/src/styles/index.scss b/src/styles/index.scss index 0971ac3..c6ff7d9 100644 --- a/src/styles/index.scss +++ b/src/styles/index.scss @@ -1,17 +1,17 @@ // 基础样式 -@import './base.scss'; +@use './base.scss'; // 全局类名样式 -@import './global.scss'; +@use './global.scss'; // 自定义原生滚动条样式 -@import './scrollbar-reset.scss'; +@use './scrollbar-reset.scss'; // 自定义 nprogress 插件进度条颜色 -@import './nprogress.scss'; +@use './nprogress.scss'; // 富文本的css主题颜色变量 -@import './editor.scss'; +@use './editor.scss'; // 动画类名 -@import './animated.scss'; +@use './animated.scss'; diff --git a/src/test-console.vue b/src/test-console.vue new file mode 100644 index 0000000..dfa6c7f --- /dev/null +++ b/src/test-console.vue @@ -0,0 +1,41 @@ + + + + + \ No newline at end of file diff --git a/src/types/components.d.ts b/src/types/components.d.ts index 19a4246..7fa6b1b 100644 --- a/src/types/components.d.ts +++ b/src/types/components.d.ts @@ -7,66 +7,7 @@ export {} declare module 'vue' { export interface GlobalComponents { - Avatar: typeof import('./../components/Avatar/index.vue')['default'] - Breadcrumb: typeof import('./../components/Breadcrumb/index.vue')['default'] - CellCopy: typeof import('./../components/CellCopy/index.vue')['default'] - Chart: typeof import('./../components/Chart/index.vue')['default'] - ColumnSetting: typeof import('./../components/GiTable/src/components/ColumnSetting.vue')['default'] - CronForm: typeof import('./../components/GenCron/CronForm/index.vue')['default'] - CronModal: typeof import('./../components/GenCron/CronModal/index.vue')['default'] - DateRangePicker: typeof import('./../components/DateRangePicker/index.vue')['default'] - DayForm: typeof import('./../components/GenCron/CronForm/component/day-form.vue')['default'] - FilePreview: typeof import('./../components/FilePreview/index.vue')['default'] - GiCellAvatar: typeof import('./../components/GiCell/GiCellAvatar.vue')['default'] - GiCellGender: typeof import('./../components/GiCell/GiCellGender.vue')['default'] - GiCellStatus: typeof import('./../components/GiCell/GiCellStatus.vue')['default'] - GiCellTag: typeof import('./../components/GiCell/GiCellTag.vue')['default'] - GiCellTags: typeof import('./../components/GiCell/GiCellTags.vue')['default'] - GiCodeView: typeof import('./../components/GiCodeView/index.vue')['default'] - GiDot: typeof import('./../components/GiDot/index.tsx')['default'] - GiEditTable: typeof import('./../components/GiEditTable/GiEditTable.vue')['default'] - GiFooter: typeof import('./../components/GiFooter/index.vue')['default'] - GiForm: typeof import('./../components/GiForm/src/GiForm.vue')['default'] - GiIconBox: typeof import('./../components/GiIconBox/index.vue')['default'] - GiIconSelector: typeof import('./../components/GiIconSelector/index.vue')['default'] - GiIframe: typeof import('./../components/GiIframe/index.vue')['default'] - GiOption: typeof import('./../components/GiOption/index.vue')['default'] - GiOptionItem: typeof import('./../components/GiOptionItem/index.vue')['default'] - GiPageLayout: typeof import('./../components/GiPageLayout/index.vue')['default'] - GiSpace: typeof import('./../components/GiSpace/index.vue')['default'] - GiSplitButton: typeof import('./../components/GiSplitButton/index.vue')['default'] - GiSplitPane: typeof import('./../components/GiSplitPane/index.vue')['default'] - GiSplitPaneFlexibleBox: typeof import('./../components/GiSplitPane/components/GiSplitPaneFlexibleBox.vue')['default'] - GiSvgIcon: typeof import('./../components/GiSvgIcon/index.vue')['default'] - GiTable: typeof import('./../components/GiTable/src/GiTable.vue')['default'] - GiTag: typeof import('./../components/GiTag/index.tsx')['default'] - GiThemeBtn: typeof import('./../components/GiThemeBtn/index.vue')['default'] - HourForm: typeof import('./../components/GenCron/CronForm/component/hour-form.vue')['default'] - Icon403: typeof import('./../components/icons/Icon403.vue')['default'] - Icon404: typeof import('./../components/icons/Icon404.vue')['default'] - Icon500: typeof import('./../components/icons/Icon500.vue')['default'] - IconBorders: typeof import('./../components/icons/IconBorders.vue')['default'] - IconTableSize: typeof import('./../components/icons/IconTableSize.vue')['default'] - IconTreeAdd: typeof import('./../components/icons/IconTreeAdd.vue')['default'] - IconTreeReduce: typeof import('./../components/icons/IconTreeReduce.vue')['default'] - ImageImport: typeof import('./../components/ImageImport/index.vue')['default'] - ImageImportWizard: typeof import('./../components/ImageImportWizard/index.vue')['default'] - IndustrialImageList: typeof import('./../components/IndustrialImageList/index.vue')['default'] - JsonPretty: typeof import('./../components/JsonPretty/index.vue')['default'] - MinuteForm: typeof import('./../components/GenCron/CronForm/component/minute-form.vue')['default'] - MonthForm: typeof import('./../components/GenCron/CronForm/component/month-form.vue')['default'] - ParentView: typeof import('./../components/ParentView/index.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] RouterView: typeof import('vue-router')['RouterView'] - SecondForm: typeof import('./../components/GenCron/CronForm/component/second-form.vue')['default'] - SplitPanel: typeof import('./../components/SplitPanel/index.vue')['default'] - TextCopy: typeof import('./../components/TextCopy/index.vue')['default'] - TurbineGrid: typeof import('./../components/TurbineGrid/index.vue')['default'] - UserSelect: typeof import('./../components/UserSelect/index.vue')['default'] - Verify: typeof import('./../components/Verify/index.vue')['default'] - VerifyPoints: typeof import('./../components/Verify/Verify/VerifyPoints.vue')['default'] - VerifySlide: typeof import('./../components/Verify/Verify/VerifySlide.vue')['default'] - WeekForm: typeof import('./../components/GenCron/CronForm/component/week-form.vue')['default'] - YearForm: typeof import('./../components/GenCron/CronForm/component/year-form.vue')['default'] } } diff --git a/src/types/training.d.ts b/src/types/training.d.ts new file mode 100644 index 0000000..f8f296b --- /dev/null +++ b/src/types/training.d.ts @@ -0,0 +1,71 @@ +export interface TrainingPlanPageQuery { + planName?: string + trainingType?: string + trainingLevel?: string + status?: string + trainer?: string + startTime?: string + endTime?: string + page?: number + pageSize?: number +} + +export interface TrainingPlanReq { + planName: string + trainingType: string + trainingLevel: string + trainingContent?: string + trainer?: string + trainingLocation?: string + startTime: string + endTime: string + status?: string + maxParticipants?: number + requirements?: string + remark?: string +} + +export interface TrainingPlanResp { + planId: string + planName: string + trainingType: string + trainingLevel: string + trainingContent?: string + trainer?: string + trainingLocation?: string + startTime: string + endTime: string + status: string + maxParticipants?: number + currentParticipants?: number + requirements?: string + remark?: string + createTime: string + createBy: string + materials?: TrainingMaterialResp[] + records?: TrainingRecordResp[] +} + +export interface TrainingMaterialResp { + materialId: string + materialName: string + materialType: string + materialPath?: string + materialSize?: number + description?: string + sortOrder?: number +} + +export interface TrainingRecordResp { + recordId: string + userId: string + userName: string + deptId?: string + deptName?: string + attendanceStatus: string + signInTime?: string + signOutTime?: string + score?: number + feedback?: string + certificateId?: string +} \ No newline at end of file diff --git a/src/views/bussiness-data/bussiness.vue b/src/views/bussiness-data/bussiness.vue index 5b0dded..a7385a5 100644 --- a/src/views/bussiness-data/bussiness.vue +++ b/src/views/bussiness-data/bussiness.vue @@ -532,7 +532,7 @@ import { uploadFileApi, updateFileNameApi, previewFileApi -} from '@/apis/bussiness/bussiness.js' +} from '@/apis/bussiness/bussiness' // 状态管理 const folderList = ref([]); diff --git a/src/views/system-resource/device-management/components/DeviceModal.vue b/src/views/system-resource/device-management/components/DeviceModal.vue new file mode 100644 index 0000000..fd51549 --- /dev/null +++ b/src/views/system-resource/device-management/components/DeviceModal.vue @@ -0,0 +1,1417 @@ + + + + + diff --git a/src/views/system-resource/device-management/components/EquipmentSearch.vue b/src/views/system-resource/device-management/components/EquipmentSearch.vue new file mode 100644 index 0000000..65b720c --- /dev/null +++ b/src/views/system-resource/device-management/components/EquipmentSearch.vue @@ -0,0 +1,496 @@ + + + + + diff --git a/src/views/system-resource/device-management/detail.vue b/src/views/system-resource/device-management/detail.vue index e740ae2..aa98a23 100644 --- a/src/views/system-resource/device-management/detail.vue +++ b/src/views/system-resource/device-management/detail.vue @@ -54,7 +54,7 @@ import { onMounted, ref } from 'vue' import { useRoute } from 'vue-router' import { IconUpload } from '@arco-design/web-vue/es/icon' -import { getEquipmentDetail } from '@/apis/equipment' +import { EquipmentAPI } from '@/apis' import type { EquipmentResp } from '@/types/equipment.d' defineOptions({ name: 'DeviceDetail' }) @@ -245,7 +245,7 @@ const getHealthStatusText = (status: string) => { // 加载设备详情 const loadDeviceDetail = async () => { try { - const res = await getEquipmentDetail(deviceId) + const res = await EquipmentAPI.getEquipmentDetail(deviceId) const device = res.data as EquipmentResp // 更新基本信息 diff --git a/src/views/system-resource/device-management/index.vue b/src/views/system-resource/device-management/index.vue index 1131622..f9575bb 100644 --- a/src/views/system-resource/device-management/index.vue +++ b/src/views/system-resource/device-management/index.vue @@ -1,337 +1,1048 @@ - - \ No newline at end of file + diff --git a/src/views/system-resource/device-management/procurement/components/ProcurementModal.vue b/src/views/system-resource/device-management/procurement/components/ProcurementModal.vue new file mode 100644 index 0000000..89a88bb --- /dev/null +++ b/src/views/system-resource/device-management/procurement/components/ProcurementModal.vue @@ -0,0 +1,865 @@ + + + + + \ No newline at end of file diff --git a/src/views/system-resource/device-management/procurement/components/ProcurementSearch.vue b/src/views/system-resource/device-management/procurement/components/ProcurementSearch.vue new file mode 100644 index 0000000..6ffbbbf --- /dev/null +++ b/src/views/system-resource/device-management/procurement/components/ProcurementSearch.vue @@ -0,0 +1,491 @@ + + + + + diff --git a/src/views/system-resource/device-management/procurement/index.vue b/src/views/system-resource/device-management/procurement/index.vue new file mode 100644 index 0000000..8bc491b --- /dev/null +++ b/src/views/system-resource/device-management/procurement/index.vue @@ -0,0 +1,856 @@ + + + + + \ No newline at end of file diff --git a/src/views/system-resource/device-management/procurement/test.vue b/src/views/system-resource/device-management/procurement/test.vue new file mode 100644 index 0000000..888a618 --- /dev/null +++ b/src/views/system-resource/device-management/procurement/test.vue @@ -0,0 +1,136 @@ + + + + + \ No newline at end of file diff --git a/src/views/training/detail.vue b/src/views/training/detail.vue new file mode 100644 index 0000000..1fe1821 --- /dev/null +++ b/src/views/training/detail.vue @@ -0,0 +1,81 @@ + + + + + diff --git a/src/views/training/plan/components/TrainingPlanModal.vue b/src/views/training/plan/components/TrainingPlanModal.vue new file mode 100644 index 0000000..40ddd0c --- /dev/null +++ b/src/views/training/plan/components/TrainingPlanModal.vue @@ -0,0 +1,576 @@ + + + + + diff --git a/src/views/training/plan/index.vue b/src/views/training/plan/index.vue new file mode 100644 index 0000000..40562de --- /dev/null +++ b/src/views/training/plan/index.vue @@ -0,0 +1,577 @@ + + + + + diff --git a/src/views/user/message/components/MyMessage.vue b/src/views/user/message/components/MyMessage.vue index 03395c7..b0f3768 100644 --- a/src/views/user/message/components/MyMessage.vue +++ b/src/views/user/message/components/MyMessage.vue @@ -104,11 +104,11 @@ import { useWindowSize } from '@vueuse/core' import { type MessageQuery, type MessageResp, - deleteMessage, - getUserMessage, listMessage, - readAllMessage, + deleteMessage, readMessage, + readAllMessage, + getUserMessage, } from '@/apis' import { useTable } from '@/hooks' import { useDict } from '@/hooks/app' diff --git a/tsconfig.json b/tsconfig.json index da01396..bcd3595 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,27 +1,33 @@ { - "extends": "@vue/tsconfig/tsconfig.web.json", "compilerOptions": { - "target": "ES2020", // 指定 ECMAScript 目标版本: 'ES3' (default), 'ES5', 'ES6'/'ES2015', 'ES2016', 'ES2017', or 'ESNEXT' - "jsx": "preserve", // 指定 jsx 代码的生成: 'preserve', 'react-native', or 'react' - "jsxFactory": "h", // 当使用经典的JSX运行时编译JSX元素时,更改.js文件中调用的函数,默认:React.createElement - "jsxFragmentFactory": "Fragment", // 指定 JSX 片段工厂函数在指定了 jsxFactory 编译器选项的情况下针对 react JSX 发出时使用 指定使用模块: 'commonjs', 'amd', 'system', 'umd' or 'es2015' - "lib": ["ES2020", "DOM"], // 指定要包含在编译中的库文件 - "baseUrl": ".", // 用于解析非相对模块名称的基目录 - "module": "ES2020", // - "moduleResolution": "node", // 选择模块解析策略: 'node' (Node.js) or 'classic' (TypeScript pre-1.6) + // "preserveValueImports": true, // 已废弃,移除 + // "importsNotUsedAsValues": "error", // 已废弃,移除 + "target": "ES2020", + "jsx": "preserve", + "lib": ["ES2020", "DOM"], + "useDefineForClassFields": true, // 合并 web 配置 + "baseUrl": ".", + // 基于 @vue/tsconfig/tsconfig.json + "module": "ES2020", // 用户自定义覆盖 + "moduleResolution": "node", // 用户自定义 "paths": { - "@/*": ["src/*"] // 模块名到基于 baseUrl 的路径映射的列表 - }, - "resolveJsonModule": true, // 是否解析 JSON 模块 - "allowJs": true, // 允许编译 javascript 文件 - "checkJs": true, // 报告 javascript 文件中的错误 - "strict": true, // 开启所有严格的类型检查 + "@/*": ["src/*"] + }, // 用户自定义覆盖 + "resolveJsonModule": true, // 合并 web 配置 + "types": [], + "allowJs": true, + "checkJs": true, + "strict": true, "noImplicitAny": false, - "sourceMap": true, // 是否生成相应的Map映射的文件,默认:false - "esModuleInterop": true, // 是否通过为所有导入模块创建命名空间对象,允许CommonJS和ES模块之间的互操作性,开启改选项时,也自动开启allowSyntheticDefaultImports选项,默认:false - "skipLibCheck": true, // 是否跳过声明文件的类型检查,这可以在编译期间以牺牲类型系统准确性为代价来节省时间,默认:false - "ignoreDeprecations": "5.0" // 选项 importsNotUsedAsValues 已弃用,并将在 TypeScript 5.5 中停止工作。指定 compilerOption 的 "ignoreprecations ": "5.0" 来消除这个错误,使用 verbatimModuleSyntax 代替 + "noImplicitThis": true, + "sourceMap": true, // 用户自定义覆盖 + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true, + "ignoreDeprecations": "5.0" }, - "include": ["src/**/*", "src/**/*.vue", "vite.config.ts"], // 指定被编译文件所在的目录 - "exclude": ["node_modules", "dist", "**/*.js"] // 指定不需要被编译的目录 + "include": ["src/**/*", "src/**/*.vue", "vite.config.ts"], + "exclude": ["node_modules", "dist", "**/*.js"] }