From a14e1841cc84f72124804b771c3714e1ed98861b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?= <14103883+leaf-phos@user.noreply.gitee.com> Date: Mon, 30 Dec 2024 14:52:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .cursorrules | 36 +++++++++ .gitignore | 1 + jsconfig.json | 10 +++ src/api/system/device.js | 8 +- src/utils/constants.js | 6 ++ .../components/VipLevelEditDialog.vue | 2 +- src/views/ss/vipLevel/index.vue | 2 +- src/views/system/device/detail.vue | 80 ++++++++++--------- 8 files changed, 102 insertions(+), 43 deletions(-) create mode 100644 .cursorrules create mode 100644 jsconfig.json diff --git a/.cursorrules b/.cursorrules new file mode 100644 index 0000000..718bbd6 --- /dev/null +++ b/.cursorrules @@ -0,0 +1,36 @@ +# 项目背景 +这是一个基于RuoYi-Vue的智能开关项目后台管理系统,主要用于管理智能开关设备、用户、订单、支付、设备状态、设备参数等。 + +# 主要框架 +- Vue2 +- Element-UI +- Axios +- Vuex +- Vue-Router + +# 编码标准 +- 变量和函数名使用 camelCase 规范,组件名使用 PascalCase +- 组件的样式使用 scoped 属性,避免样式污染 +- 样式使用scss +- props、data、methods、computed、watch 生命周期函数等都使用驼峰命名 +- 对于全局能够重复使用的组件,尽量封装成组件,并放在 src/components 目录下 +- 对于业务能够重复使用的组件,尽量封装成组件,并放在 src/views/{模块名}/components 目录下 +- 所有请求都需要在 src/api/{模块名}.js 文件中定义,并保持统一的命名规范,使用时统一调用 +- 业务操作尽量封装成方法或组件 +- table中的数据使用columns定义,具体可以参考其他组件 +- 保持与现有代码风格一致 +- 代码需要具有可读性,注释清晰,后续可拓展 +- 生成的代码需要自动导入相关依赖,这点很重要 + +# 项目结构 +- src/api 目录下存放接口文件 +- src/assets 目录下存放静态资源 +- src/components 目录下存放全局组件 +- src/views 目录下存放页面 +- src/utils 目录下存放工具类 +- src/utils/constants.js 目录下存放常量 +- src/views/ss 目录下存放业务相关页面 +- src/views/system 目录下存放系统相关页面 + +# 文档规范 +- 使用 JSDoc 格式编写函数和组件的注释 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 78a752d..82c3521 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,4 @@ selenium-debug.log package-lock.json yarn.lock +dist.zip diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..af62672 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "baseUrl": "./", + "paths": { + "@/*": ["src/*"] + } + }, + "include": ["src/**/*"], + "exclude": ["node_modules"] +} \ No newline at end of file diff --git a/src/api/system/device.js b/src/api/system/device.js index 17e49ab..04db57d 100644 --- a/src/api/system/device.js +++ b/src/api/system/device.js @@ -70,10 +70,14 @@ export function logicDelDevice(deviceId) { // 刷新物联网设备信息 -export function refreshIot(deviceId) { +export function refreshIot(deviceId, onlineType) { return request({ url: `/system/device/${deviceId}/refreshIot`, - method: 'get' + method: 'get', + timeout: 20000, + params: { + onlineType + } }) } diff --git a/src/utils/constants.js b/src/utils/constants.js index 6b1dfff..88b4aab 100644 --- a/src/utils/constants.js +++ b/src/utils/constants.js @@ -289,3 +289,9 @@ export const VipExpireType = { FOREVER: "1", // 永久有效 TIME: "2", // 有效期 } + +// 设备获取在线状态类型 +export const DeviceOnlineType = { + GET: "1", //OneNet获取 + COMMAND: "2", // 命令获取 +} diff --git a/src/views/ss/vipLevel/components/VipLevelEditDialog.vue b/src/views/ss/vipLevel/components/VipLevelEditDialog.vue index 6d781b2..0d06e40 100644 --- a/src/views/ss/vipLevel/components/VipLevelEditDialog.vue +++ b/src/views/ss/vipLevel/components/VipLevelEditDialog.vue @@ -49,7 +49,7 @@ export default { default: getVipLevel }, addApi: { - typ: Function, + type: Function, default: addVipLevel }, updateApi: { diff --git a/src/views/ss/vipLevel/index.vue b/src/views/ss/vipLevel/index.vue index 8bef577..d27380a 100644 --- a/src/views/ss/vipLevel/index.vue +++ b/src/views/ss/vipLevel/index.vue @@ -58,7 +58,7 @@ -