提交: 修改bug 问题优化

This commit is contained in:
23688nl 2022-11-18 15:13:09 +08:00
parent 0d605a1a62
commit 3d99964997
7 changed files with 40 additions and 12 deletions

View File

@ -117,13 +117,31 @@ export function resetPssword(data) {
}
// 开关控制
export function setSwitchControl(data) {
export function setSwitchControlold(data) {
return request({
url: "/iot/dev/opt/down",
method: "post",
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) {

View File

@ -147,6 +147,9 @@ export default {
type: String,
default: "",
},
wsGuid: {
type: String
}
},
data() {
return {
@ -255,6 +258,7 @@ export default {
projectId: this.sourceId || "",
deviceTags: this.deviceType || "",
pid: this.gatewayDevice.deviceId || "",
sign: this.wsGuid
},
this.queryParams
)
@ -286,7 +290,9 @@ export default {
}
},
handleChildStatus(type) {
this.handleSendSwitchDirect(type, this.tableSelectList.toString());
if (this.tableSelectList && this.tableSelectList.length > 0) {
this.handleSendSwitchDirect(type, this.tableSelectList.toString());
}
},
// 线
handleSendSwitchDirect(type, ids) {
@ -299,7 +305,7 @@ export default {
}).then(({ value }) => {
let params = {
data: {
cmd: "set_switch",
// cmd: "set_switch",
params: {
switch: 1,
},

View File

@ -185,6 +185,7 @@
:gatewayDevice="showGatewayInfo"
:sourceId="sourceId"
:deviceType="deviceType"
:wsGuid="ws_guid"
@handleLinkToHome="handleLinkToHome"
></e-device-children>
</div>
@ -233,6 +234,7 @@ export default {
stompClient: null,
socket_flag: true,
timeout_flag: null,
ws_guid: '',
};
},
watch: {
@ -255,6 +257,7 @@ export default {
getIotFileUrl,
// init html
initHTML() {
this.ws_guid = this.getGuid();
this.getGatewayList();
this.getProjectModelList();
},
@ -325,11 +328,13 @@ export default {
//
getGatewayList() {
this.list = [];
this.ws_guid = this.getGuid();
listProjectDevice(
Object.assign(
{
projectId: this.sourceId,
deviceTags: this.deviceType || "",
sign: this.ws_guid,
},
this.queryParams
)
@ -354,7 +359,7 @@ export default {
}
let deviceIds = this.list.map((v) => v["deviceKey"]);
this.stompClient = new WebSocket(
`${webSocketProjectGatewayUrl}/${this.getGuid()}/${deviceIds.toString()}`
`${webSocketProjectGatewayUrl}/${this.ws_guid}/${deviceIds.toString()}`
);
this.stompClient.onmessage = this.socket_message;
this.stompClient.onclose = this.socket_onclose;

View File

@ -83,7 +83,6 @@ export default {
selectId: null,
inputValueName: "",
slectList: [],
selectTableShow: false,
tableSelectOption: {
otherOption: {
tableType: "device",
@ -206,6 +205,7 @@ export default {
this.tableSelectOption.tableList = response.rows;
this.tableSelectOption.queryOpt.page.total = Number(response.total);
}
this.tableSelectOption.tableOpt.loading = false
}
);
},

View File

@ -5,6 +5,7 @@ import ESelectDevice from './ESelectDevice'
import EConditionTemp from './EConditionTemp'
import ECronForm from './ECronForm'
import EInterval from './EInterval'
import EDialogTableInput from "@/components/EDialogTableInput";
export default {

View File

@ -531,7 +531,7 @@ export default {
key: "todayAlarmTotal",
},
{
label: "本月报警数",
label: "近30天报警数",
key: "alarmTotal",
},
],

View File

@ -328,7 +328,7 @@
</template>
<script>
import { listChildrenDevice, setSwitchControl } from "@/api/iot/device";
import { listChildrenDevice, setSwitchControl, setLivetimeControl } from "@/api/iot/device";
import {
devLiveWebSocketBaseUrl,
webSocketProjectGatewayUrl,
@ -491,7 +491,7 @@ export default {
}).then(({ value }) => {
let params = {
data: {
cmd: "set_switch",
// cmd: "set_switch",
params: {
switch: 1,
},
@ -646,7 +646,6 @@ export default {
extenSubmit(row) {
let params = {
data: {
cmd: "set_live_time",
params: {
ltime: 15, // (0.1)
dtime: 1200, //(0.1)
@ -654,7 +653,7 @@ export default {
},
deviceId: row.deviceId,
};
setSwitchControl(params).then((res) => {
setLivetimeControl(params).then((res) => {
console.log(res);
// this.msgSuccess("");
});
@ -670,7 +669,6 @@ export default {
}).then(({ value }) => {
let params = {
data: {
cmd: "set_switch",
params: {
switch: type === "true" ? 1 : 0,
},