From 75fa05275c9c251e1264e7ebc876cbeb1a9235e1 Mon Sep 17 00:00:00 2001 From: zzi666 <756106614@qq.com> Date: Mon, 30 Dec 2024 16:42:06 +0800 Subject: [PATCH] style: reformat package.json indentation and wrap long html/md lines --- .prettierrc | 14 +- dc3/dependencies/README.md | 6 +- index.html | 4 +- package.json | 154 ++++++++-------- public/images/common/loading-init.svg | 3 +- public/images/error/error.svg | 27 ++- src-tauri/icons/icon.svg | 6 +- src/components/card/title/TitleCard.vue | 70 ++++---- src/components/layout/Layout.vue | 4 +- src/config/axios/index.ts | 5 +- src/config/constant/common.ts | 2 +- src/config/plugins/index.ts | 14 +- src/utils/utils.ts | 8 +- src/views/device/detail/DeviceDetail.vue | 212 +++++++++++------------ src/views/device/edit/DeviceEdit.vue | 4 +- src/views/device/edit/index.ts | 32 ++-- src/views/point/card/PointCard.vue | 20 +-- src/views/point/card/index.ts | 11 +- src/views/point/tool/PointTool.vue | 2 +- 19 files changed, 308 insertions(+), 290 deletions(-) diff --git a/.prettierrc b/.prettierrc index 27dbb9ac8..b8b20ecc3 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,9 +1,9 @@ { - "tabWidth": 4, - "printWidth": 180, - "semi": false, - "singleQuote": true, - "endOfLine": "auto", - "trailingComma": "none", - "objectCurlySpacing": false + "tabWidth": 4, + "printWidth": 180, + "semi": false, + "singleQuote": true, + "endOfLine": "auto", + "trailingComma": "none", + "objectCurlySpacing": false } diff --git a/dc3/dependencies/README.md b/dc3/dependencies/README.md index 4f054a3e0..063169e12 100644 --- a/dc3/dependencies/README.md +++ b/dc3/dependencies/README.md @@ -1,6 +1,7 @@ # 使用 ACME.SH 申请并安装 LET’S ENCRYPT SSL 证书 -Let’s Encrypt 是一个免费的, 自动化的, 开放的证书颁发机构(CA), 为公众的利益而运行。 它是一项由 Internet Security Research Group(ISRG)提供的服务。 +Let’s Encrypt 是一个免费的, 自动化的, 开放的证书颁发机构(CA), 为公众的利益而运行。 它是一项由 Internet Security Research +Group(ISRG)提供的服务。 acme.sh 则是实现了 acme 协议, 可以从 letsencrypt 生成免费的证书。 ## 安装 ACME.SH @@ -49,7 +50,8 @@ acme.sh --renew -d dc3.site --force ## 取消更新 -有时候你可能需要移除特定域名的自动申请, 这时候可以使用下面的命令让 acme.sh 取消对特定域名的自动续期。当然已申请的证书仍然有效, 不会失效。 +有时候你可能需要移除特定域名的自动申请, 这时候可以使用下面的命令让 acme.sh 取消对特定域名的自动续期。当然已申请的证书仍然有效, +不会失效。 ```bash acme.sh --remove -d dc3.site diff --git a/index.html b/index.html index 9d4d749ab..e71f6cc98 100644 --- a/index.html +++ b/index.html @@ -25,7 +25,9 @@ - + diff --git a/package.json b/package.json index e95714b9b..d6dc233e6 100644 --- a/package.json +++ b/package.json @@ -1,79 +1,79 @@ { - "name": "iot-dc3-web", - "version": "2024.3.0", - "private": true, - "author": "pnoker", - "description": "IoT DC3 平台前端页面", - "engines": { - "node": ">=18.0.0" - }, - "type": "module", - "scripts": { - "tauri": "tauri", - "serve": "vite --host --mode dev", - "test": "vite --host --mode test", - "pre": "vite --host --mode pre", - "pro": "vite --host --mode pro", - "build": "vite build", - "preview": "vite preview", - "check": "vue-tsc --build --force", - "format": "prettier --write src/", - "lint": "eslint . --ext .vue,.ts --fix --ignore-path .gitignore" - }, - "dependencies": { - "@amap/amap-jsapi-loader": "^1.0.1", - "@antv/g2": "^5.2.10", - "@element-plus/icons-vue": "^2.3.1", - "@tauri-apps/api": "^2.1.1", - "@tauri-apps/plugin-shell": "^2.2.0", - "axios": "^1.7.9", - "clipboard": "^2.0.11", - "core-js": "^3.39.0", - "echarts": "^5.6.0", - "element-plus": "^2.9.1", - "highlight.js": "^11.11.1", - "js-base64": "^3.7.7", - "js-cookie": "^3.0.5", - "js-md5": "^0.8.3", - "json-bigint": "^1.0.0", - "marked": "^15.0.4", - "mitt": "^3.0.1", - "moment": "^2.30.1", - "nprogress": "^0.2.0", - "pinia": "^2.3.0", - "screenfull": "^6.0.2", - "vue": "^3.5.13", - "vue-router": "^4.5.0", - "vuex": "^4.1.0" - }, - "devDependencies": { - "@tauri-apps/cli": "^2.1.0", - "@types/js-cookie": "^3.0.6", - "@types/json-bigint": "^1.0.4", - "@types/node": "^22.10.2", - "@types/nprogress": "^0.2.3", - "@typescript-eslint/eslint-plugin": "^8.18.2", - "@typescript-eslint/parser": "^8.18.2", - "@vitejs/plugin-legacy": "^6.0.0", - "@vitejs/plugin-vue": "^5.2.1", - "@vue/eslint-config-typescript": "^14.2.0", - "dotenv": "^16.4.7", - "eslint": "^9.17.0", - "eslint-config-prettier": "^9.1.0", - "eslint-plugin-prettier": "^5.2.1", - "eslint-plugin-vue": "^9.32.0", - "minimist": "^1.2.8", - "path": "^0.12.7", - "prettier": "^3.4.2", - "prettier-eslint": "^16.3.0", - "sass": "^1.83.0", - "terser": "^5.37.0", - "typescript": "~5.7.2", - "unplugin-auto-import": "^0.19.0", - "unplugin-vue-components": "^0.28.0", - "vite": "^6.0.6", - "vue-class-component": "^8.0.0-0", - "vue-template-compiler": "^2.7.16", - "vue-tsc": "^2.2.0" - } + "name": "iot-dc3-web", + "version": "2024.3.0", + "private": true, + "author": "pnoker", + "description": "IoT DC3 平台前端页面", + "engines": { + "node": ">=18.0.0" + }, + "type": "module", + "scripts": { + "tauri": "tauri", + "serve": "vite --host --mode dev", + "test": "vite --host --mode test", + "pre": "vite --host --mode pre", + "pro": "vite --host --mode pro", + "build": "vite build", + "preview": "vite preview", + "check": "vue-tsc --build --force", + "format": "prettier --write src/", + "lint": "eslint . --ext .vue,.ts --fix --ignore-path .gitignore" + }, + "dependencies": { + "@amap/amap-jsapi-loader": "^1.0.1", + "@antv/g2": "^5.2.10", + "@element-plus/icons-vue": "^2.3.1", + "@tauri-apps/api": "^2.1.1", + "@tauri-apps/plugin-shell": "^2.2.0", + "axios": "^1.7.9", + "clipboard": "^2.0.11", + "core-js": "^3.39.0", + "echarts": "^5.6.0", + "element-plus": "^2.9.1", + "highlight.js": "^11.11.1", + "js-base64": "^3.7.7", + "js-cookie": "^3.0.5", + "js-md5": "^0.8.3", + "json-bigint": "^1.0.0", + "marked": "^15.0.4", + "mitt": "^3.0.1", + "moment": "^2.30.1", + "nprogress": "^0.2.0", + "pinia": "^2.3.0", + "screenfull": "^6.0.2", + "vue": "^3.5.13", + "vue-router": "^4.5.0", + "vuex": "^4.1.0" + }, + "devDependencies": { + "@tauri-apps/cli": "^2.1.0", + "@types/js-cookie": "^3.0.6", + "@types/json-bigint": "^1.0.4", + "@types/node": "^22.10.2", + "@types/nprogress": "^0.2.3", + "@typescript-eslint/eslint-plugin": "^8.18.2", + "@typescript-eslint/parser": "^8.18.2", + "@vitejs/plugin-legacy": "^6.0.0", + "@vitejs/plugin-vue": "^5.2.1", + "@vue/eslint-config-typescript": "^14.2.0", + "dotenv": "^16.4.7", + "eslint": "^9.17.0", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-prettier": "^5.2.1", + "eslint-plugin-vue": "^9.32.0", + "minimist": "^1.2.8", + "path": "^0.12.7", + "prettier": "^3.4.2", + "prettier-eslint": "^16.3.0", + "sass": "^1.83.0", + "terser": "^5.37.0", + "typescript": "~5.7.2", + "unplugin-auto-import": "^0.19.0", + "unplugin-vue-components": "^0.28.0", + "vite": "^6.0.6", + "vue-class-component": "^8.0.0-0", + "vue-template-compiler": "^2.7.16", + "vue-tsc": "^2.2.0" + } } diff --git a/public/images/common/loading-init.svg b/public/images/common/loading-init.svg index 83b6d49e9..4b8134fd0 100644 --- a/public/images/common/loading-init.svg +++ b/public/images/common/loading-init.svg @@ -17,6 +17,7 @@ - + diff --git a/public/images/error/error.svg b/public/images/error/error.svg index fceda9b78..85aa9f885 100644 --- a/public/images/error/error.svg +++ b/public/images/error/error.svg @@ -73,24 +73,30 @@ fill: url(#_GradualChange_14); } - + - + - - + + - + - + @@ -122,15 +128,18 @@ class="cls-6"> - + - + - + diff --git a/src-tauri/icons/icon.svg b/src-tauri/icons/icon.svg index 885f8ed14..d34e21fce 100644 --- a/src-tauri/icons/icon.svg +++ b/src-tauri/icons/icon.svg @@ -1,5 +1,7 @@ - - + diff --git a/src/components/card/title/TitleCard.vue b/src/components/card/title/TitleCard.vue index 7e3f6a4eb..bd8c184fd 100644 --- a/src/components/card/title/TitleCard.vue +++ b/src/components/card/title/TitleCard.vue @@ -28,44 +28,44 @@ diff --git a/src/components/layout/Layout.vue b/src/components/layout/Layout.vue index 6d960e1fc..41faafe1c 100644 --- a/src/components/layout/Layout.vue +++ b/src/components/layout/Layout.vue @@ -31,7 +31,9 @@ diff --git a/src/views/device/edit/DeviceEdit.vue b/src/views/device/edit/DeviceEdit.vue index dbb01c66d..63e90fa1f 100644 --- a/src/views/device/edit/DeviceEdit.vue +++ b/src/views/device/edit/DeviceEdit.vue @@ -191,8 +191,8 @@ 上一步 - 修改 - 恢复 + 修改 + 恢复 下一步 diff --git a/src/views/device/edit/index.ts b/src/views/device/edit/index.ts index c718336c5..fe1f9e43b 100644 --- a/src/views/device/edit/index.ts +++ b/src/views/device/edit/index.ts @@ -369,15 +369,15 @@ export default defineComponent({ driverInfo.id ? updateDriverInfo(driverInfo) - .then(() => loadFormData(driverInfo)) - .catch(() => { - // nothing to do - }) + .then(() => loadFormData(driverInfo)) + .catch(() => { + // nothing to do + }) : addDriverInfo(driverInfo) - .then(() => loadFormData(driverInfo)) - .catch(() => { - // nothing to do - }) + .then(() => loadFormData(driverInfo)) + .catch(() => { + // nothing to do + }) function loadFormData(res: { id: any; driverAttributeId?: any; deviceId?: string; configValue: any }) { driverFormData[attribute.attributeName] = { @@ -406,15 +406,15 @@ export default defineComponent({ pointInfo.id ? updatePointInfo(pointInfo) - .then(() => loadFormData(pointInfo)) - .catch(() => { - // nothing to do - }) + .then(() => loadFormData(pointInfo)) + .catch(() => { + // nothing to do + }) : addPointInfo(pointInfo) - .then(() => loadFormData(pointInfo)) - .catch(() => { - // nothing to do - }) + .then(() => loadFormData(pointInfo)) + .catch(() => { + // nothing to do + }) function loadFormData(res: { id: any; pointAttributeId?: any; deviceId?: string; pointId?: any; configValue: any }) { reactiveData.pointInfoData.forEach((pointInfo) => { diff --git a/src/views/point/card/PointCard.vue b/src/views/point/card/PointCard.vue index 99bf7f563..7dd2ca990 100644 --- a/src/views/point/card/PointCard.vue +++ b/src/views/point/card/PointCard.vue @@ -38,54 +38,54 @@
  • 所属模板: 所属模板: {{ profile.profileName }}
  • 比例系数: 比例系数: {{ data.multiple }}
  • 数据精度: 数据精度: {{ data.valueDecimal }}
  • 单位: 单位: {{ data.unit }}
  • 修改日期: 修改日期: {{ timestamp(data.operateTime) }}
  • 数据类型: 数据类型: {{ pointTypeFlag }}
  • 基础值: 基础值: {{ data.baseValue }}
  • 处理值: 处理值: Y = {{ data.multiple }}X + {{ data.baseValue }}, 保留{{ data.valueDecimal }}位小数
  • 读写标识: 读写标识: {{ rwFlag }}
  • 创建日期: 创建日期: {{ timestamp(data.createTime) }}
diff --git a/src/views/point/card/index.ts b/src/views/point/card/index.ts index ccb766b96..27e383780 100644 --- a/src/views/point/card/index.ts +++ b/src/views/point/card/index.ts @@ -124,9 +124,14 @@ export default defineComponent({ } const edit = () => { - router.push({ name: 'pointEdit', query: { id: props.data.id, profileId: props.data.profileId, active: '0' } }).catch(() => { - // nothing to do - }) + router + .push({ + name: 'pointEdit', + query: { id: props.data.id, profileId: props.data.profileId, active: '0' } + }) + .catch(() => { + // nothing to do + }) } const detail = () => { diff --git a/src/views/point/tool/PointTool.vue b/src/views/point/tool/PointTool.vue index 9355e832c..ca6ab0e28 100644 --- a/src/views/point/tool/PointTool.vue +++ b/src/views/point/tool/PointTool.vue @@ -67,7 +67,7 @@