diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..79cfd95 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,10 @@ +:4173 { + handle_path /prod-api/* { + reverse_proxy 192.168.1.201:1616 + } + handle { + root * /Users/ailanyin/WebstormProjects/qiaoba-ui/dist + file_server + try_files {path} / + } +} diff --git a/env.d.ts b/env.d.ts new file mode 100644 index 0000000..151aa68 --- /dev/null +++ b/env.d.ts @@ -0,0 +1 @@ +/// \ No newline at end of file diff --git a/package.json b/package.json index e35b4ef..119e3b7 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,11 @@ "@amap/amap-jsapi-loader": "^1.0.1", "@element-plus/icons-vue": "2.0.10", "@vueuse/core": "9.5.0", + "@wangeditor/editor": "^5.1.23", + "@wangeditor/editor-for-vue": "^5.1.12", "axios": "0.27.2", + "chart.js": "^4.2.1", + "dayjs": "^1.11.7", "echarts": "5.4.0", "element-plus": "2.2.27", "file-saver": "2.0.5", @@ -29,9 +33,14 @@ "jsencrypt": "3.3.1", "lodash-es": "^4.17.21", "nprogress": "0.2.0", + "patternomaly": "^1.3.2", "pinia": "2.0.22", + "pinia-plugin-persistedstate": "^3.1.0", + "reconnecting-websocket": "^4.4.0", "uuid": "^9.0.0", + "v3-infinite-loading": "^1.2.2", "vue": "3.2.45", + "vue-chartjs": "^5.2.0", "vue-cropper": "1.0.3", "vue-router": "4.1.4", "vue3-json-viewer": "^2.2.2" @@ -39,8 +48,10 @@ "devDependencies": { "@vitejs/plugin-vue": "3.1.0", "@vue/compiler-sfc": "3.2.45", + "@vue/tsconfig": "^0.1.3", "prettier": "^2.8.4", "sass": "1.56.1", + "typescript": "^5.0.4", "unplugin-auto-import": "0.11.4", "vite": "3.2.3", "vite-plugin-compression": "0.5.1", diff --git a/src/api/alert/log.js b/src/api/alert/log.js new file mode 100644 index 0000000..9ece5dc --- /dev/null +++ b/src/api/alert/log.js @@ -0,0 +1,44 @@ +import request from "@/utils/request"; + +// 查询设备告警日志列表 +export function listLog(query) { + return request({ + url: "/alert/log/list", + method: "get", + params: query, + }); +} + +// 查询设备告警日志详细 +export function getLog(alertId) { + return request({ + url: "/alert/log/" + alertId, + method: "get", + }); +} + +// 新增设备告警日志 +export function addLog(data) { + return request({ + url: "/alert/log", + method: "post", + data: data, + }); +} + +// 修改设备告警日志 +export function updateLog(data) { + return request({ + url: "/alert/log", + method: "put", + data: data, + }); +} + +// 删除设备告警日志 +export function delLog(alertId) { + return request({ + url: "/alert/log/" + alertId, + method: "delete", + }); +} diff --git a/src/api/iot/device.js b/src/api/iot/device.js index 299e75e..26aba66 100644 --- a/src/api/iot/device.js +++ b/src/api/iot/device.js @@ -50,13 +50,77 @@ export function fetchOperatingStatus(deviceSn) { }); } +/** + * 查询设备物模型某一指标历史 + * @param params + * @return {*} + */ export function selectIdentifierHistory(params) { + let start_time = null; + let end_time = null; + if (params.startTime) start_time = new Date(params.startTime).getTime(); + if (params.endTime) end_time = new Date(params.endTime).getTime(); return request({ - url: `/iot/device/selectIdentifierHistory/${params.deviceSn}/${params.identifier}`, + url: `/iot/device/selectIdentifierHistory/${params.deviceSn}`, method: "GET", params: { pageNum: params.pageNum, pageSize: params.pageSize, + identifier: params.identifier, + type: params.type, + startTime: start_time, + endTime: end_time, + sort: params.sort, }, }); } + +export function setDeviceAttr(data) { + const { version, method, params } = data; + return request({ + url: `/iot/device/set/${data.productSn}/${data.deviceSn}`, + method: "post", + data: { + version, + method, + params, + }, + }); +} + +export function setDeviceInvoke(data) { + const { version, method, params } = data; + return request({ + url: `/iot/device/invoke/${data.productSn}/${data.deviceSn}`, + method: "post", + data: { + version, + method, + params, + }, + }); +} + +/** + * 属性设置日志列表 + * @param params + * @return {*} + */ +export function setPropertyLog(params) { + return request({ + url: `/device/setPropertyLog/list`, + params, + }); +} + +/** + * 服务调用日志列表 + * @return {*} + * @param params + */ +export function setFunctionLog(params) { + return request({ + url: `/device/setFunctionLog/list`, + params, + }); +} diff --git a/src/api/msg/msg.js b/src/api/msg/msg.js new file mode 100644 index 0000000..5e741ff --- /dev/null +++ b/src/api/msg/msg.js @@ -0,0 +1,29 @@ +import request from "@/utils/request"; + +// 查询消息列表 +export function listMsg(query) { + return request({ + url: "/msg/msg/list", + method: "get", + params: query, + }); +} + +// 修改消息 +export function updateMsg(msgIds, status) { + return request({ + url: `/msg/msg/${msgIds}/status`, + method: "put", + params: { + status, + }, + }); +} + +// 删除消息 +export function delMsg(msgIds) { + return request({ + url: "/msg/msg/" + msgIds, + method: "delete", + }); +} diff --git a/src/api/notice/config.js b/src/api/notice/config.js new file mode 100644 index 0000000..cd06e62 --- /dev/null +++ b/src/api/notice/config.js @@ -0,0 +1,14 @@ +import request from "@/utils/request"; + +export const msgConfig = () => + request({ + url: `/msg/config/getInfo`, + method: "GET", + }); + +export const saveConfig = (data) => + request({ + url: "/msg/config", + method: "POST", + data, + }); diff --git a/src/api/notice/template.js b/src/api/notice/template.js new file mode 100644 index 0000000..89f9c75 --- /dev/null +++ b/src/api/notice/template.js @@ -0,0 +1,44 @@ +import request from "@/utils/request"; + +// 查询通知模板列表 +export function listTemplate(query) { + return request({ + url: "/notice/template/list", + method: "get", + params: query, + }); +} + +// 查询通知模板详细 +export function getTemplate(templateId) { + return request({ + url: "/notice/template/" + templateId, + method: "get", + }); +} + +// 新增通知模板 +export function addTemplate(data) { + return request({ + url: "/notice/template", + method: "post", + data: data, + }); +} + +// 修改通知模板 +export function updateTemplate(data) { + return request({ + url: "/notice/template", + method: "put", + data: data, + }); +} + +// 删除通知模板 +export function delTemplate(templateId) { + return request({ + url: "/notice/template/" + templateId, + method: "delete", + }); +} diff --git a/src/api/product/noticeConfig.js b/src/api/product/noticeConfig.js new file mode 100644 index 0000000..8c1e257 --- /dev/null +++ b/src/api/product/noticeConfig.js @@ -0,0 +1,44 @@ +import request from "@/utils/request"; + +// 查询告警消息配置列表 +export function listNoticeConfig(query) { + return request({ + url: "/product/noticeConfig/list", + method: "get", + params: query, + }); +} + +// 查询告警消息配置详细 +export function getNoticeConfig(configId) { + return request({ + url: "/product/noticeConfig/" + configId, + method: "get", + }); +} + +// 新增告警消息配置 +export function addNoticeConfig(data) { + return request({ + url: "/product/noticeConfig", + method: "post", + data: data, + }); +} + +// 修改告警消息配置 +export function updateNoticeConfig(data) { + return request({ + url: "/product/noticeConfig", + method: "put", + data: data, + }); +} + +// 删除告警消息配置 +export function delNoticeConfig(configId) { + return request({ + url: "/product/noticeConfig/" + configId, + method: "delete", + }); +} diff --git a/src/assets/styles/element-ui.scss b/src/assets/styles/element-ui.scss index 3ac74c2..d3109df 100644 --- a/src/assets/styles/element-ui.scss +++ b/src/assets/styles/element-ui.scss @@ -101,6 +101,12 @@ border-radius: 6px; .el-radio-button { + &:first-child { + } + + &:last-child { + } + .el-radio-button__inner { background-color: transparent; border: none; @@ -118,3 +124,29 @@ } } } + +.custom-table-style { + box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); + border-radius: 8px; + //border: 1px solid rgb(226 232 240); + border: none; + + .el-table__inner-wrapper { + //overflow: hidden; + //box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); + + &::before { + display: none; + } + + .el-table__header-wrapper th { + background-color: #fbfbfb !important; + } + + .el-table__row:last-child { + td.el-table__cell { + border-bottom: none; + } + } + } +} diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss index c3d14a2..769e104 100644 --- a/src/assets/styles/sidebar.scss +++ b/src/assets/styles/sidebar.scss @@ -111,6 +111,7 @@ } } + /* rounded menu indicator */ & .router-link-active:not(.sidebar-logo-link) { position: relative; @@ -136,10 +137,8 @@ top: 50%; border-radius: 28px; box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), - 0 2px 4px -2px rgb(0 0 0 / 0.1), inset 0 2px 4px 0 rgb(0 0 0 / 0.05); + 0 2px 4px -2px rgb(0 0 0 / 0.1); } - - //background-color: aliceblue; } } diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue new file mode 100644 index 0000000..29d2e01 --- /dev/null +++ b/src/components/Editor/index.vue @@ -0,0 +1,168 @@ + + + + diff --git a/src/components/MapSelect/index.vue b/src/components/MapSelect/index.vue index a1993fe..0079bbe 100644 --- a/src/components/MapSelect/index.vue +++ b/src/components/MapSelect/index.vue @@ -1,5 +1,5 @@ diff --git a/src/components/NotificationCenter/index.vue b/src/components/NotificationCenter/index.vue new file mode 100644 index 0000000..0874dc4 --- /dev/null +++ b/src/components/NotificationCenter/index.vue @@ -0,0 +1,465 @@ + + + + + diff --git a/src/components/Pagination/index.vue b/src/components/Pagination/index.vue index 8200733..ffd46f0 100644 --- a/src/components/Pagination/index.vue +++ b/src/components/Pagination/index.vue @@ -1,12 +1,13 @@ diff --git a/src/views/iot/device/index.vue b/src/views/iot/device/index.vue index 0fa0f45..9a370b0 100644 --- a/src/views/iot/device/index.vue +++ b/src/views/iot/device/index.vue @@ -189,17 +189,17 @@ >删除 - - 导出 - - + + + + + + + + + + + @@ -218,7 +219,7 @@ - + - - - + + + + + + + - - - + + + + + + + + + + @@ -291,7 +302,7 @@ type="primary" @click="handleDetail(scope.row)" > - 修改 + 详情 + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + @@ -461,7 +412,13 @@ - + + + + - - - - - - - - - - - - - - --> + + + + + + + + + + + + + + + + + + + + + + + + + @@ -218,7 +219,9 @@ style="width: 100%" > + + + + + @@ -313,7 +339,7 @@ size="small" type="danger" @click="removeTriggerItem(index)" - >删除 + >删除 @@ -575,19 +601,19 @@ size="small" type="danger" @click="removeActionItem(index)" - >删除 + >删除 添加执行动作 + >添加执行动作 - - - + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + { getList(); getProductOptions(); -getTenantOptions(); +// getTenantOptions(); diff --git a/src/views/product/noticeConfig/index.vue b/src/views/product/noticeConfig/index.vue new file mode 100644 index 0000000..b5697ab --- /dev/null +++ b/src/views/product/noticeConfig/index.vue @@ -0,0 +1,646 @@ + + + + diff --git a/src/views/product/product/edit.vue b/src/views/product/product/edit.vue index 41fa5c7..bd2b9db 100644 --- a/src/views/product/product/edit.vue +++ b/src/views/product/product/edit.vue @@ -1,16 +1,13 @@ -