feat:新增下发查询设备控制功能按钮

This commit is contained in:
23357 2023-11-08 17:25:01 +08:00
parent dd2e64efd7
commit e253a0a873
3 changed files with 89 additions and 2 deletions

View File

@ -133,6 +133,15 @@ export function setSwitchControl(data) {
});
}
// 开关控制 最新接口
export function searchDevControl(data) {
return request({
url: "/iot/dev/opt/search",
method: "post",
data: data
});
}
// 断路器上报间隔设置
export function setLivetimeControl(data) {
return request({

View File

@ -45,6 +45,16 @@
>
一键分闸
</div>
<div
:class="
tableSelectList && tableSelectList.length > 0
? 'operate-onekey-on'
: 'operate-onekey-on but-disable'
"
@click="handleDevSearch()"
>
查找设备
</div>
<el-select
v-model="queryParams.prodKey"
style="margin-left: 5xp; width: 130px"
@ -128,7 +138,7 @@ import {
listProjectModel,
listProjectTableFilter,
} from "@/api/iot/project_new";
import { setSwitchControl } from "@/api/iot/device";
import { setSwitchControl,searchDevControl } from "@/api/iot/device";
import { webSocketProjectGatewayUrl } from "@/config/env";
export default {
name: "EDeviceChildren",
@ -296,6 +306,11 @@ export default {
this.handleSendSwitchDirect(type, this.tableSelectList.toString());
}
},
handleDevSearch() {
if (this.tableSelectList && this.tableSelectList.length > 0) {
this.handleSearchDevDirect( this.tableSelectList.toString());
}
},
// 线
handleSendSwitchDirect(type, ids) {
this.$prompt("请输入登录密码", "提示", {
@ -333,6 +348,29 @@ export default {
});
});
},
//
handleSearchDevDirect( ids) {
this.$prompt("请输入登录密码", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
inputPattern: /^[a-z A-z 0-9 $.]+/,
inputType: "password",
inputErrorMessage: "登录密码不能为空",
}).then(({ value }) => {
let params = {
data: {
params: {
},
},
deviceId: ids,
verifyKey: value,
};
searchDevControl(params).then((res) => {
this.msgSuccess("修改成功");
});
});
},
handleRefresh() {
this.queryParams.pageNum = 1;
this.getChildrenDeviceList();

View File

@ -109,6 +109,25 @@
一键分闸
</div></el-button
>
<el-button
plain
size="mini"
type="info"
:disabled="tSelectLabelList.length <= 0"
@click="handleDevSearch()"
>
<div
style="
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
"
>
<icon class="iconfont el-icon-search but-icon" />
查找设备
</div>
</el-button>
<el-button plain size="mini" type="info" @click="handleAllSelect()">
<div
style="
@ -328,7 +347,7 @@
</template>
<script>
import { listChildrenDevice, setSwitchControl, setLivetimeControl } from "@/api/iot/device";
import { listChildrenDevice, setSwitchControl, setLivetimeControl, searchDevControl } from "@/api/iot/device";
import {
devLiveWebSocketBaseUrl,
webSocketProjectGatewayUrl,
@ -462,7 +481,28 @@ export default {
this.handleChildStatus(type);
}
},
handleDevSearch(){
this.$prompt("请输入登录密码", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
inputPattern: /^[a-z A-z 0-9 $.]+/,
inputType: "password",
inputErrorMessage: "登录密码不能为空",
}).then(({ value }) => {
let params = {
data: {
params: {
},
},
deviceId: this.tSelectList.toString(),
verifyKey: value,
};
searchDevControl(params).then((res) => {
this.msgSuccess("修改成功");
});
});
},
handleAllSelect() {
if (this.childDeviceList.length > 0) {
if (this.tSelectList.length >= this.childDeviceList.length) {