提交: 修改bug 问题优化
This commit is contained in:
parent
0d605a1a62
commit
3d99964997
|
@ -117,13 +117,31 @@ export function resetPssword(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 开关控制
|
// 开关控制
|
||||||
export function setSwitchControl(data) {
|
export function setSwitchControlold(data) {
|
||||||
return request({
|
return request({
|
||||||
url: "/iot/dev/opt/down",
|
url: "/iot/dev/opt/down",
|
||||||
method: "post",
|
method: "post",
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 开关控制 最新接口
|
||||||
|
export function setSwitchControl(data) {
|
||||||
|
return request({
|
||||||
|
url: "/iot/dev/opt/switch",
|
||||||
|
method: "post",
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 断路器上报间隔设置
|
||||||
|
export function setLivetimeControl(data) {
|
||||||
|
return request({
|
||||||
|
url: "/iot/dev/opt/livetime",
|
||||||
|
method: "post",
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 获取未绑定设备列表
|
// 获取未绑定设备列表
|
||||||
export function listNoParent(query) {
|
export function listNoParent(query) {
|
||||||
|
|
|
@ -147,6 +147,9 @@ export default {
|
||||||
type: String,
|
type: String,
|
||||||
default: "",
|
default: "",
|
||||||
},
|
},
|
||||||
|
wsGuid: {
|
||||||
|
type: String
|
||||||
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -255,6 +258,7 @@ export default {
|
||||||
projectId: this.sourceId || "",
|
projectId: this.sourceId || "",
|
||||||
deviceTags: this.deviceType || "",
|
deviceTags: this.deviceType || "",
|
||||||
pid: this.gatewayDevice.deviceId || "",
|
pid: this.gatewayDevice.deviceId || "",
|
||||||
|
sign: this.wsGuid
|
||||||
},
|
},
|
||||||
this.queryParams
|
this.queryParams
|
||||||
)
|
)
|
||||||
|
@ -286,7 +290,9 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleChildStatus(type) {
|
handleChildStatus(type) {
|
||||||
this.handleSendSwitchDirect(type, this.tableSelectList.toString());
|
if (this.tableSelectList && this.tableSelectList.length > 0) {
|
||||||
|
this.handleSendSwitchDirect(type, this.tableSelectList.toString());
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 点击子设备 线路开关
|
// 点击子设备 线路开关
|
||||||
handleSendSwitchDirect(type, ids) {
|
handleSendSwitchDirect(type, ids) {
|
||||||
|
@ -299,7 +305,7 @@ export default {
|
||||||
}).then(({ value }) => {
|
}).then(({ value }) => {
|
||||||
let params = {
|
let params = {
|
||||||
data: {
|
data: {
|
||||||
cmd: "set_switch",
|
// cmd: "set_switch",
|
||||||
params: {
|
params: {
|
||||||
switch: 1,
|
switch: 1,
|
||||||
},
|
},
|
||||||
|
|
|
@ -185,6 +185,7 @@
|
||||||
:gatewayDevice="showGatewayInfo"
|
:gatewayDevice="showGatewayInfo"
|
||||||
:sourceId="sourceId"
|
:sourceId="sourceId"
|
||||||
:deviceType="deviceType"
|
:deviceType="deviceType"
|
||||||
|
:wsGuid="ws_guid"
|
||||||
@handleLinkToHome="handleLinkToHome"
|
@handleLinkToHome="handleLinkToHome"
|
||||||
></e-device-children>
|
></e-device-children>
|
||||||
</div>
|
</div>
|
||||||
|
@ -233,6 +234,7 @@ export default {
|
||||||
stompClient: null,
|
stompClient: null,
|
||||||
socket_flag: true,
|
socket_flag: true,
|
||||||
timeout_flag: null,
|
timeout_flag: null,
|
||||||
|
ws_guid: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -255,6 +257,7 @@ export default {
|
||||||
getIotFileUrl,
|
getIotFileUrl,
|
||||||
// init html
|
// init html
|
||||||
initHTML() {
|
initHTML() {
|
||||||
|
this.ws_guid = this.getGuid();
|
||||||
this.getGatewayList();
|
this.getGatewayList();
|
||||||
this.getProjectModelList();
|
this.getProjectModelList();
|
||||||
},
|
},
|
||||||
|
@ -325,11 +328,13 @@ export default {
|
||||||
// 获取 项目网关设备列表
|
// 获取 项目网关设备列表
|
||||||
getGatewayList() {
|
getGatewayList() {
|
||||||
this.list = [];
|
this.list = [];
|
||||||
|
this.ws_guid = this.getGuid();
|
||||||
listProjectDevice(
|
listProjectDevice(
|
||||||
Object.assign(
|
Object.assign(
|
||||||
{
|
{
|
||||||
projectId: this.sourceId,
|
projectId: this.sourceId,
|
||||||
deviceTags: this.deviceType || "",
|
deviceTags: this.deviceType || "",
|
||||||
|
sign: this.ws_guid,
|
||||||
},
|
},
|
||||||
this.queryParams
|
this.queryParams
|
||||||
)
|
)
|
||||||
|
@ -354,7 +359,7 @@ export default {
|
||||||
}
|
}
|
||||||
let deviceIds = this.list.map((v) => v["deviceKey"]);
|
let deviceIds = this.list.map((v) => v["deviceKey"]);
|
||||||
this.stompClient = new WebSocket(
|
this.stompClient = new WebSocket(
|
||||||
`${webSocketProjectGatewayUrl}/${this.getGuid()}/${deviceIds.toString()}`
|
`${webSocketProjectGatewayUrl}/${this.ws_guid}/${deviceIds.toString()}`
|
||||||
);
|
);
|
||||||
this.stompClient.onmessage = this.socket_message;
|
this.stompClient.onmessage = this.socket_message;
|
||||||
this.stompClient.onclose = this.socket_onclose;
|
this.stompClient.onclose = this.socket_onclose;
|
||||||
|
@ -549,4 +554,4 @@ export default {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
|
@ -83,7 +83,6 @@ export default {
|
||||||
selectId: null,
|
selectId: null,
|
||||||
inputValueName: "",
|
inputValueName: "",
|
||||||
slectList: [],
|
slectList: [],
|
||||||
selectTableShow: false,
|
|
||||||
tableSelectOption: {
|
tableSelectOption: {
|
||||||
otherOption: {
|
otherOption: {
|
||||||
tableType: "device",
|
tableType: "device",
|
||||||
|
@ -206,6 +205,7 @@ export default {
|
||||||
this.tableSelectOption.tableList = response.rows;
|
this.tableSelectOption.tableList = response.rows;
|
||||||
this.tableSelectOption.queryOpt.page.total = Number(response.total);
|
this.tableSelectOption.queryOpt.page.total = Number(response.total);
|
||||||
}
|
}
|
||||||
|
this.tableSelectOption.tableOpt.loading = false
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
@ -5,6 +5,7 @@ import ESelectDevice from './ESelectDevice'
|
||||||
import EConditionTemp from './EConditionTemp'
|
import EConditionTemp from './EConditionTemp'
|
||||||
import ECronForm from './ECronForm'
|
import ECronForm from './ECronForm'
|
||||||
import EInterval from './EInterval'
|
import EInterval from './EInterval'
|
||||||
|
import EDialogTableInput from "@/components/EDialogTableInput";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -531,7 +531,7 @@ export default {
|
||||||
key: "todayAlarmTotal",
|
key: "todayAlarmTotal",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "本月报警数",
|
label: "近30天报警数",
|
||||||
key: "alarmTotal",
|
key: "alarmTotal",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -328,7 +328,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listChildrenDevice, setSwitchControl } from "@/api/iot/device";
|
import { listChildrenDevice, setSwitchControl, setLivetimeControl } from "@/api/iot/device";
|
||||||
import {
|
import {
|
||||||
devLiveWebSocketBaseUrl,
|
devLiveWebSocketBaseUrl,
|
||||||
webSocketProjectGatewayUrl,
|
webSocketProjectGatewayUrl,
|
||||||
|
@ -491,7 +491,7 @@ export default {
|
||||||
}).then(({ value }) => {
|
}).then(({ value }) => {
|
||||||
let params = {
|
let params = {
|
||||||
data: {
|
data: {
|
||||||
cmd: "set_switch",
|
// cmd: "set_switch",
|
||||||
params: {
|
params: {
|
||||||
switch: 1,
|
switch: 1,
|
||||||
},
|
},
|
||||||
|
@ -646,7 +646,6 @@ export default {
|
||||||
extenSubmit(row) {
|
extenSubmit(row) {
|
||||||
let params = {
|
let params = {
|
||||||
data: {
|
data: {
|
||||||
cmd: "set_live_time",
|
|
||||||
params: {
|
params: {
|
||||||
ltime: 15, // 上报间隔(0.1秒)
|
ltime: 15, // 上报间隔(0.1秒)
|
||||||
dtime: 1200, //上报时长(0.1秒)
|
dtime: 1200, //上报时长(0.1秒)
|
||||||
|
@ -654,7 +653,7 @@ export default {
|
||||||
},
|
},
|
||||||
deviceId: row.deviceId,
|
deviceId: row.deviceId,
|
||||||
};
|
};
|
||||||
setSwitchControl(params).then((res) => {
|
setLivetimeControl(params).then((res) => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
// this.msgSuccess("成功");
|
// this.msgSuccess("成功");
|
||||||
});
|
});
|
||||||
|
@ -670,7 +669,6 @@ export default {
|
||||||
}).then(({ value }) => {
|
}).then(({ value }) => {
|
||||||
let params = {
|
let params = {
|
||||||
data: {
|
data: {
|
||||||
cmd: "set_switch",
|
|
||||||
params: {
|
params: {
|
||||||
switch: type === "true" ? 1 : 0,
|
switch: type === "true" ? 1 : 0,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue