feat(电伴热): 添加电伴热设备配置及API接口

在config.js中添加电伴热设备配置,新增电伴热设备图标和任务列表
在api/index.js中添加电伴热设备状态控制和设备列表接口
更新vue.config.js代理配置,添加本地测试API代理
This commit is contained in:
liangbin 2025-12-31 17:15:55 +08:00
parent b3893f6af1
commit db08b3b81d
4 changed files with 1250 additions and 1738 deletions

View File

@ -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: '雨水泵',
},
}

View File

@ -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',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"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',
method: "post",
headers: {
'Content-Type':'application/json',
}
})
"Content-Type": "application/json",
},
});
}
export function addOrModDevice(data, url) {
return request({
url: url,
data: data,
method: 'post',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"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',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
export function iotControl(data, url) {
return request({
url: url,
data: data,
method: 'post',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
export function newIotControl(data, url) {
return request({
url: url,
data: data,
method: 'post',
method: "post",
headers: {
'Content-Type':'application/json',
}
})
"Content-Type": "application/json",
},
});
}
export function newIotControlS(data, url) {
return request({
url: url,
data: data,
method: 'post',
method: "post",
headers: {
'Content-Type':'application/json',
}
})
"Content-Type": "application/json",
},
});
}
export function playManuallyTriggered(data, url) {
return request({
url: url,
data: data,
method: 'post',
method: "post",
headers: {
'Content-Type':'application/json',
}
})
"Content-Type": "application/json",
},
});
}
export function getIotDeviceStatus(data) {
return request({
url: '/iotApi/mDevice/getIotDeviceStatus',
url: "/iotApi/mDevice/getIotDeviceStatus",
data: data,
method: 'post',
method: "post",
headers: {
'Content-Type':'application/json',
}
})
"Content-Type": "application/json",
},
});
}
export function batchControl(data) {
return request({
url: '/xjIotApi/iotServiceCommon/batchControl',
url: "/xjIotApi/iotServiceCommon/batchControl",
data: data,
method: 'post',
method: "post",
headers: {
'Content-Type':'application/json',
}
})
"Content-Type": "application/json",
},
});
}
export function deviceStatus(data) {
return request({
url: '/json/iot/deviceStatus',
url: "/json/iot/deviceStatus",
data: data,
method: 'post',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"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',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
//节目单接口
@ -141,202 +141,225 @@ export function getProgramTree(data) {
method: "post",
data: data,
headers: {
'Content-Type':'application/json',
}
"Content-Type": "application/json",
},
});
}
export function warnList(data) {
return request({
url: '/json/warn/warnList',
url: "/json/warn/warnList",
data: data,
method: 'post',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"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',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"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',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"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',
method: "get",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"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',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"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',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"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',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8",
},
});
}
export function planAddOrMod(data, url) {
return request({
url: url,
data: data,
method: 'post',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"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',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"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',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"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',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"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',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"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',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"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',
method: "post",
headers: {
'Content-Type':'application/x-www-form-urlencoded;charset=UTF-8',
}
})
"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();
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();
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();
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",
},
});
}

File diff suppressed because it is too large Load Diff

View File

@ -1,73 +1,82 @@
const webpack = require('webpack')
const port = 7774
var path = require('path') //必须引入path 否则报错
const webpack = require("webpack");
const port = 7774;
var path = require("path"); //必须引入path 否则报错
module.exports = {
publicPath: './',
publicPath: "./",
devServer: {
port,
// 允许被主应用跨域fetch请求到
headers: {
'Access-Control-Allow-Origin': '*',
"Access-Control-Allow-Origin": "*",
},
proxy: {
'/json': {
"/TestApi": {
//本地服务接口地址
target: "http://127.0.0.1:8000", // 陈
ws: true,
https: true,
pathRewrite: {
"^/TestApi": "",
},
},
"/json": {
//本地服务接口地址
// target: 'http://link.ser99.vip:8080/zhongkai',
// target: 'http://65.73.11.246:7774',
// target: 'http://172.16.1.111:8000',
target: 'http://172.16.1.148:8084',
target: "http://172.16.1.148:8084",
// target: 'http://172.16.1.162:8233',
// target: 'http://192.168.13.138:8233',
// target: 'http://172.16.1.113:8012',
ws: true,
https: true,
pathRewrite: {
'^/json': '/json',
"^/json": "/json",
},
},
'/xjIotApi': {
"/xjIotApi": {
//集采
// target: 'http://65.73.11.246:8083',
// target: 'http://172.16.1.155:8080',
target: 'http://172.16.1.148:8083',
target: "http://172.16.1.148:8083",
ws: true,
https: true,
pathRewrite: {
'^/xjIotApi': '/xjIotApi',
"^/xjIotApi": "/xjIotApi",
},
},
'/iotApi': {
"/iotApi": {
//平台
// target: 'http://65.73.11.246:8090',
// target: 'http://172.16.1.155:8080',
target: 'http://172.16.1.148:8080',
target: "http://172.16.1.148:8080",
ws: true,
https: true,
pathRewrite: {
'^/iotApi': '/iotApi',
"^/iotApi": "/iotApi",
},
},
},
},
chainWebpack: (config) => {
//设置图片不转base64格式 图片少 且对图片质量要求高
const imagesRule = config.module.rule('images')
imagesRule.uses.clear() //清除原本的images loader配置
const imagesRule = config.module.rule("images");
imagesRule.uses.clear(); //清除原本的images loader配置
imagesRule
.test(/\.(jpg|gif|png|svg)$/)
.exclude.add(path.join(__dirname, '../node_modules')) //去除node_modules里的图片转base64配置
.exclude.add(path.join(__dirname, "../node_modules")) //去除node_modules里的图片转base64配置
.end()
.use('url-loader')
.loader('url-loader')
.options({ name: 'img/[name].[hash:8].[ext]', limit: 1 })
.use("url-loader")
.loader("url-loader")
.options({ name: "img/[name].[hash:8].[ext]", limit: 1 });
},
configureWebpack: {
plugins: [
new webpack.ProvidePlugin({
$: 'jquery',
jQuery: 'jquery',
'windows.jQuery': 'jquery',
$: "jquery",
jQuery: "jquery",
"windows.jQuery": "jquery",
}),
],
},
}
};