From db08b3b81dfd0aefe7b9e87090b56ff7d84346e3 Mon Sep 17 00:00:00 2001 From: liangbin <15536829364@163.com> Date: Wed, 31 Dec 2025 17:15:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=94=B5=E4=BC=B4=E7=83=AD):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=94=B5=E4=BC=B4=E7=83=AD=E8=AE=BE=E5=A4=87=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E5=8F=8AAPI=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在config.js中添加电伴热设备配置,新增电伴热设备图标和任务列表 在api/index.js中添加电伴热设备状态控制和设备列表接口 更新vue.config.js代理配置,添加本地测试API代理 --- public/config/config.js | 6 + src/api/index.js | 401 +++--- src/views/view/index.vue | 2522 +++++++++++++++----------------------- vue.config.js | 59 +- 4 files changed, 1250 insertions(+), 1738 deletions(-) diff --git a/public/config/config.js b/public/config/config.js index b091c44..9795945 100644 --- a/public/config/config.js +++ b/public/config/config.js @@ -47,6 +47,7 @@ window.config = { { id: '40', name: '消防泵房' }, { id: '41', name: '污水泵房' }, { id: '42', name: '雨水泵房' }, + { id: '47', name: '电伴热' }, /* {id: '43', name: '液位计'}, */ { id: '45', name: '可变限速标志' }, { id: '51', name: '人行通道' }, { id: '52', name: '车辆通道' }, @@ -331,6 +332,9 @@ window.config = { 45: { taskList: [], }, + 47: { + taskList: [], + }, 51: { taskList: [], }, @@ -388,6 +392,7 @@ window.config = { 42: { url: './lib/icon/42.png', w: 35, h: 35 }, 43: { url: './lib/icon/43.png', w: 35, h: 35 }, 45: { url: './lib/icon/45.png', w: 35, h: 35 }, + 47: { url: './lib/icon/16.png', w: 35, h: 35 }, 51: { url: './lib/icon/51.png', w: 59, h: 59 }, 52: { url: './lib/icon/51.png', w: 59, h: 59 }, 55: { url: './lib/icon/55.png', w: 120, h: 209 }, @@ -411,5 +416,6 @@ window.config = { cd: '控制阀', ps: '压力传感器', hs: '液位计', + ys: '雨水泵', }, } diff --git a/src/api/index.js b/src/api/index.js index 937ca58..1957e31 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,137 +1,137 @@ -import request from '@/axios'; -import {hex_md5} from '@/utils/md5' +import request from "@/axios"; +import { hex_md5 } from "@/utils/md5"; export function deviceList(data) { return request({ - url: '/json/device/deviceList', + url: "/json/device/deviceList", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } export function deviceList1(data) { return request({ //url: '/json/device/deviceList', - url: '/iotApi/mDevice/deviceList', //改造后的 + url: "/iotApi/mDevice/deviceList", //改造后的 data: data, - method: 'post', - headers:{ - 'Content-Type':'application/json', - } - }) + method: "post", + headers: { + "Content-Type": "application/json", + }, + }); } -export function addOrModDevice(data,url) { +export function addOrModDevice(data, url) { return request({ url: url, data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } export function deviceDelete(data) { return request({ - url: '/json/device/deviceDelete', + url: "/json/device/deviceDelete", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } -export function iotControl(data,url) { +export function iotControl(data, url) { return request({ url: url, data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } -export function newIotControl(data,url) { +export function newIotControl(data, url) { return request({ url: url, data: data, - method: 'post', - headers:{ - 'Content-Type':'application/json', - } - }) + method: "post", + headers: { + "Content-Type": "application/json", + }, + }); } -export function newIotControlS(data,url) { +export function newIotControlS(data, url) { return request({ url: url, data: data, - method: 'post', - headers:{ - 'Content-Type':'application/json', - } - }) + method: "post", + headers: { + "Content-Type": "application/json", + }, + }); } -export function playManuallyTriggered(data,url) { +export function playManuallyTriggered(data, url) { return request({ url: url, data: data, - method: 'post', - headers:{ - 'Content-Type':'application/json', - } - }) + method: "post", + headers: { + "Content-Type": "application/json", + }, + }); } export function getIotDeviceStatus(data) { return request({ - url: '/iotApi/mDevice/getIotDeviceStatus', + url: "/iotApi/mDevice/getIotDeviceStatus", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/json', - } - }) + method: "post", + headers: { + "Content-Type": "application/json", + }, + }); } export function batchControl(data) { return request({ - url: '/xjIotApi/iotServiceCommon/batchControl', + url: "/xjIotApi/iotServiceCommon/batchControl", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/json', - } - }) + method: "post", + headers: { + "Content-Type": "application/json", + }, + }); } export function deviceStatus(data) { return request({ - url: '/json/iot/deviceStatus', + url: "/json/iot/deviceStatus", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } //节目单接口旧 export function infoBoardTemplateList(data) { return request({ - url: '/json/iot/infoBoardTemplateList', + url: "/json/iot/infoBoardTemplateList", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } //节目单接口 @@ -140,203 +140,226 @@ export function getProgramTree(data) { url: `/iotApi/informationPublish/program/getProgramTree`, method: "post", data: data, - headers:{ - 'Content-Type':'application/json', - } + headers: { + "Content-Type": "application/json", + }, }); } export function warnList(data) { return request({ - url: '/json/warn/warnList', + url: "/json/warn/warnList", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } export function statsticWhole(data) { return request({ - url: '/json/statstic/statsticWhole', + url: "/json/statstic/statsticWhole", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } export function flowStatistic(data) { return request({ - url: '/json/flow/flowStatistic', + url: "/json/flow/flowStatistic", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } export function getPlayAddressByPid(data) { return request({ - url: window.config.videoHttp + '/streammedia/getPlayAddressByPid', + url: window.config.videoHttp + "/streammedia/getPlayAddressByPid", params: data, - method: 'get', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "get", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } export function flowList(data) { return request({ - url: '/json/flow/flowList', + url: "/json/flow/flowList", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } export function deviceStatusBatch(data) { return request({ - url: '/json/iot/deviceStatusBatch', + url: "/json/iot/deviceStatusBatch", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } export function planList(data) { return request({ - url: '/json/plan/planList', + url: "/json/plan/planList", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } -export function planAddOrMod(data,url) { +export function planAddOrMod(data, url) { return request({ url: url, data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } export function planDelete(data) { return request({ - url: '/json/plan/planDelete', + url: "/json/plan/planDelete", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } export function planDetail(data) { return request({ - url: '/json/plan/planDetail', + url: "/json/plan/planDetail", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } export function planExecute(data) { return request({ - url: '/json/plan/planExecute', + url: "/json/plan/planExecute", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } export function planHisList(data) { return request({ - url: '/json/plan/planHisList', + url: "/json/plan/planHisList", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } export function latestWarnList(data) { return request({ - url: '/json/warn/latestWarnList', + url: "/json/warn/latestWarnList", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } export function verify(data) { return request({ - url: '/json/wran/verify', + url: "/json/wran/verify", data: data, - method: 'post', - headers:{ - 'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8', - } - }) + method: "post", + headers: { + "Content-Type": "application/x-www-form-urlencoded;charset=UTF-8", + }, + }); } -var access_key = 'uck2hoc0axpu3mm35w1t' -var secret_key = 'ahgkp8xhljmafg6iapok' +var access_key = "uck2hoc0axpu3mm35w1t"; +var secret_key = "ahgkp8xhljmafg6iapok"; export function getEmployeeList() { - var timestamp=new Date().getTime(); + var timestamp = new Date().getTime(); return request({ - url: window.config.mediaUrl + '/getEmployeeList', - data: {name:''}, - method: 'post', + url: window.config.mediaUrl + "/getEmployeeList", + data: { name: "" }, + method: "post", headers: { - 'access_key':access_key, - 'timestamp':timestamp, - 'sign':hex_md5(access_key + timestamp + secret_key), - } - }) + access_key: access_key, + timestamp: timestamp, + sign: hex_md5(access_key + timestamp + secret_key), + }, + }); } export function getMediaList() { - var timestamp=new Date().getTime(); + var timestamp = new Date().getTime(); return request({ - url: window.config.mediaUrl + '/getMediaList', - data: {name:''}, - method: 'post', + url: window.config.mediaUrl + "/getMediaList", + data: { name: "" }, + method: "post", headers: { - 'access_key':access_key, - 'timestamp':timestamp, - 'sign':hex_md5(access_key + timestamp + secret_key) - } - }) + access_key: access_key, + timestamp: timestamp, + sign: hex_md5(access_key + timestamp + secret_key), + }, + }); } export function addBroadcast(data) { - var timestamp=new Date().getTime(); + var timestamp = new Date().getTime(); return request({ - url: window.config.mediaUrl + '/addBroadcast', + url: window.config.mediaUrl + "/addBroadcast", data: data, - method: 'post', + method: "post", headers: { - 'access_key':access_key, - 'timestamp':timestamp, - 'sign':hex_md5(access_key + timestamp + secret_key) - } - }) + access_key: access_key, + timestamp: timestamp, + sign: hex_md5(access_key + timestamp + secret_key), + }, + }); +} + +// 获取电伴热设备列表 +export function getDbrIotDeviceList() { + return request({ + url: `/TestApi/devices`, + method: "get", + }); +} + +// 改变电伴热设备状态 +export function changeDbrIotDeviceStatus(data) { + return request({ + url: `/TestApi/device/${data.device_id}/control`, + method: "post", + data: { + value: data.device_id, + action: data.action, + }, + headers: { + "Content-Type": "application/json", + }, + }); } diff --git a/src/views/view/index.vue b/src/views/view/index.vue index dfc769b..d2db594 100644 --- a/src/views/view/index.vue +++ b/src/views/view/index.vue @@ -1,45 +1,30 @@ -