This commit is contained in:
23357 2022-04-18 09:06:29 +08:00
commit 395d915758
22 changed files with 520 additions and 244 deletions

View File

@ -42,3 +42,12 @@ export function exportRecord(query) {
params: query params: query
}) })
} }
// 新增报警记录
export function addAlarmRecord(data) {
return request({
url: '/iot/maintenance/',
method: 'post',
data: data
})
}

View File

@ -60,3 +60,13 @@ export function exportMaintenance(query) {
params: query params: query
}) })
} }
// 获取租户下用户
export function getTenantHandleUser(query) {
return request({
url: '/system/user/list',
method: 'get',
params: query
})
}

View File

@ -156,6 +156,9 @@ export function getIotFileUrl(importUrl) {
if (!importUrl) { if (!importUrl) {
return '/assets/logo/logo.png'; return '/assets/logo/logo.png';
} }
if (importUrl.indexOf(':8899') > 0) {
importUrl = importUrl.replace(':8899', ':9988')
}
if (importUrl.indexOf('http') === 0 || importUrl.indexOf('https') === 0) { if (importUrl.indexOf('http') === 0 || importUrl.indexOf('https') === 0) {
return importUrl; return importUrl;
} else if (importUrl.indexOf('/profile/upload/') === 0 || importUrl.indexOf('/profile/avatar/') === 0) { } else if (importUrl.indexOf('/profile/upload/') === 0 || importUrl.indexOf('/profile/avatar/') === 0) {

View File

@ -65,7 +65,7 @@
v-hasPermi="['iot:type:remove']" v-hasPermi="['iot:type:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
icon="el-icon-download" icon="el-icon-download"
@ -73,7 +73,7 @@
@click="handleExport" @click="handleExport"
v-hasPermi="['iot:type:export']" v-hasPermi="['iot:type:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col> -->
</el-row> </el-row>
<el-table <el-table

View File

@ -17,7 +17,7 @@
line-height: 1.5; line-height: 1.5;
font: 13px/1.6 Arial,sans-serif,Tahoma,Roboto,'Source Code Pro'; font: 13px/1.6 Arial,sans-serif,Tahoma,Roboto,'Source Code Pro';
" "
>发布时间{{info.updateTime}}</span> >发布时间{{info.createTime}}</span>
<span @click="toNowsTable(info.noticeId)" class="gd-news">更多新闻...</span> <span @click="toNowsTable(info.noticeId)" class="gd-news">更多新闻...</span>
<el-divider></el-divider> <el-divider></el-divider>
<div v-html="info.noticeContent" style="padding: 20px;"></div> <div v-html="info.noticeContent" style="padding: 20px;"></div>

View File

@ -23,7 +23,7 @@
line-height: 1.5; line-height: 1.5;
font: 13px/1.6 Arial,sans-serif,Tahoma,Roboto,'Source Code Pro'; font: 13px/1.6 Arial,sans-serif,Tahoma,Roboto,'Source Code Pro';
" "
>发布时间{{info.updateTime}}</span> >发布时间{{info.createTime}}</span>
<el-divider></el-divider> <el-divider></el-divider>
<div v-html="info.noticeContent" style="padding: 20px;"></div> <div v-html="info.noticeContent" style="padding: 20px;"></div>

View File

@ -83,7 +83,7 @@
v-hasPermi="['iot:type:remove']" v-hasPermi="['iot:type:remove']"
>删除</el-button> >删除</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
icon="el-icon-download" icon="el-icon-download"
@ -91,7 +91,7 @@
@click="handleExport" @click="handleExport"
v-hasPermi="['iot:type:export']" v-hasPermi="['iot:type:export']"
>导出</el-button> >导出</el-button>
</el-col> </el-col> -->
</el-row> </el-row>
<el-table <el-table
@ -184,6 +184,22 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="联系人" prop="userId">
<el-select
v-model="form.userId"
style="width: 100%;"
clearable
placeholder="请输入联系人"
>
<el-option
v-for="(doc, idx) in userList"
:label="doc.nickName"
:value="doc.userName"
:key="idx"
/>
</el-select>
</el-form-item>
<el-form-item label="报警划分" prop="alarmDivide"> <el-form-item label="报警划分" prop="alarmDivide">
<el-radio-group v-model="form.alarmDivide"> <el-radio-group v-model="form.alarmDivide">
<el-radio :label="vals" v-for="(keys, vals) in alarmDivideType" :key="vals">{{keys}}</el-radio> <el-radio :label="vals" v-for="(keys, vals) in alarmDivideType" :key="vals">{{keys}}</el-radio>
@ -217,6 +233,7 @@ import {
updateAlarmType updateAlarmType
} from "@/api/alarm/alarmType"; } from "@/api/alarm/alarmType";
import { listDeviceTypeList } from "@/api/iot/device"; import { listDeviceTypeList } from "@/api/iot/device";
import { listUser } from "@/api/system/user";
// import { selectedProdmodel } from "@/api/device/prodmodel"; // import { selectedProdmodel } from "@/api/device/prodmodel";
const alarmDivideType = { const alarmDivideType = {
ALARM: "报警", ALARM: "报警",
@ -265,15 +282,22 @@ export default {
tag: [{ required: true, message: "告警标签不能为空", trigger: "blur" }] tag: [{ required: true, message: "告警标签不能为空", trigger: "blur" }]
}, },
tenantId: "", tenantId: "",
deviceTypeList: [] deviceTypeList: [],
userList: []
}; };
}, },
created() { created() {
this.tenantId = this.$store.getters.tenantId; this.tenantId = this.$store.getters.tenantId;
this.getList(); this.getList();
this.getUserList()
this.getDeviceTypeList(); this.getDeviceTypeList();
}, },
methods: { methods: {
getUserList() {
listUser().then(response => {
this.userList = response.rows;
});
},
indexFormatter(val) { indexFormatter(val) {
return ( return (
val + 1 + (this.queryParams.pageNum - 1) * this.queryParams.pageSize val + 1 + (this.queryParams.pageNum - 1) * this.queryParams.pageSize

View File

@ -891,7 +891,7 @@ export default {
height: 30px; height: 30px;
position: absolute; position: absolute;
right: 30px; right: 30px;
top: 170px; top: 220px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;

View File

@ -420,7 +420,7 @@ export default {
this.upload.open = false; this.upload.open = false;
this.upload.isUploading = false; this.upload.isUploading = false;
this.$refs.upload.clearFiles(); this.$refs.upload.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true }); this.$alert(response.msg || '导入失败,格式不正确!', "导入结果", { dangerouslyUseHTMLString: true });
this.getList(); this.getList();
}, },
// //

View File

@ -105,7 +105,13 @@
width="200px" width="200px"
prop="prodKey" prop="prodKey"
/> />
<el-table-column label="产品密钥" align="left" prop="prodSecret" /> <el-table-column label="产品密钥" align="left" prop="prodSecret" >
<template slot-scope="scope">
<span class="lay-table-textarea" :title="scope.row.prodSecret">
{{ scope.row.prodSecret }}
</span>
</template>
</el-table-column>
<el-table-column <el-table-column
label="设备类型" label="设备类型"

View File

@ -180,7 +180,7 @@
v-show="temp.hasCtl" v-show="temp.hasCtl"
ref="paramsWrap" ref="paramsWrap"
:disabled="false" :disabled="false"
v-for="(item,index) in relationList" v-for="(item) in relationList"
:tempIndex="item.guid" :tempIndex="item.guid"
:deleteButtonD="false" :deleteButtonD="false"
:key="item.guid" :key="item.guid"

View File

@ -465,7 +465,7 @@ export default {
height: 30px; height: 30px;
position: absolute; position: absolute;
right: 30px; right: 30px;
top: 170px; top: 210px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;

View File

@ -266,18 +266,6 @@
</el-form-item> </el-form-item>
<el-form-item label="处理人" prop="handlerId"> <el-form-item label="处理人" prop="handlerId">
<!-- <treeselect
ref="treeselect"
@select="treeselect"
noChildrenText="暂无"
loadingText="加载中。。"
:normalizer="normalizer"
v-model="form.handlerId"
:options="deptOptions"
:disable-branch-nodes="true"
:show-count="true"
placeholder="请选择处理人"
/> -->
<el-select <el-select
v-model="form.handlerId" v-model="form.handlerId"
style="width: 100%" style="width: 100%"
@ -475,6 +463,7 @@ export default {
}, },
// //
handleDetails(row) { handleDetails(row) {
console.log('handleDetail:', row)
this.workDetails = row; this.workDetails = row;
this.openDestail = true; this.openDestail = true;
}, },

View File

@ -21,13 +21,13 @@
<el-col :span="12"> <el-col :span="12">
<div class="item-block"> <div class="item-block">
<span>工单 I D </span> <span>工单 I D </span>
<span>{{ workDetails.maintenanceId }}</span> <span>{{ workDetails['maintenanceId'] }}</span>
</div> </div>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<div class="item-block"> <div class="item-block">
<span>工单状态</span> <span>工单状态</span>
<span>{{ workStateList[workDetails.maintenanceStatus] }}</span> <span>{{ workStateList[workDetails['maintenanceStatus']] }}</span>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -36,13 +36,13 @@
<el-col :span="12"> <el-col :span="12">
<div class="item-block"> <div class="item-block">
<span>设备名称</span> <span>设备名称</span>
<span>{{ workDetails.deviceName }}</span> <span>{{ workDetails['deviceName'] }}</span>
</div> </div>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<div class="item-block"> <div class="item-block">
<span>故障类型</span> <span>故障类型</span>
<span>{{ fanltTypeList[workDetails.faultType] }}</span> <span>{{ fanltTypeList[workDetails['faultType']] }}</span>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -160,7 +160,7 @@
border-radius: 3px; border-radius: 3px;
" "
:src="getIotFileUrl(val)" :src="getIotFileUrl(val)"
v-for="(val, index) in pictures" v-for="(val) in pictures"
:key="val" :key="val"
/> />
</div> </div>
@ -169,6 +169,35 @@
</el-row> </el-row>
</div> </div>
<div
class="info-wrap feedback-wrap"
v-if="
showForm === '0' &&
(workDetails.maintenanceStatus === '-1')
"
>
<el-row :gutter="20">
<el-col :span="24">
<div class="item-block">
<span>处理人员</span>
<!-- <span>{{ workDetails.handlerName }}</span> -->
<el-select
v-model="form.handlerId"
style="width: 100%"
placeholder="请选择处理人"
>
<el-option
v-for="item in handleUserList"
:key="item.userId"
:label="item.nickName"
:value="item.userId"
/>
</el-select>
</div>
</el-col>
</el-row>
</div>
<el-divider <el-divider
content-position="left" content-position="left"
v-if=" v-if="
@ -314,6 +343,16 @@
" "
v-text="'工单正在等待处理人确认...'" v-text="'工单正在等待处理人确认...'"
></span> ></span>
<span
style="margin-left: 20px; height: 50px; display: block"
v-show="
workDetails.handlerId !== logUser &&
workDetails.maintenanceStatus === '-1'
"
v-text="'工单正在等待分配指定处理人...'"
></span>
<span <span
style="margin-left: 20px; height: 50px; display: block" style="margin-left: 20px; height: 50px; display: block"
v-show=" v-show="
@ -532,7 +571,7 @@
</div> </div>
</template> </template>
<script> <script>
import { updateMaintenance, getMaintenance } from "@/api/power/maintenance"; import { updateMaintenance, getMaintenance, getTenantHandleUser } from "@/api/power/maintenance";
import { uploadFile } from "@/api/file"; import { uploadFile } from "@/api/file";
import { getIotFileUrl } from "@/utils/hciot"; import { getIotFileUrl } from "@/utils/hciot";
// (0: 1: 2: 3:) // (0: 1: 2: 3:)
@ -575,14 +614,28 @@ export default {
pictures: [], pictures: [],
dialogVisible: false, dialogVisible: false,
dialogImageUrl: "", dialogImageUrl: "",
handleUserList: []
}; };
}, },
created() { created() {
this.logUser = this.$store.getters.userId; this.logUser = this.$store.getters.userId;
this.getHandleUser();
this.handleDetails(); this.handleDetails();
}, },
methods: { methods: {
getIotFileUrl, getIotFileUrl,
//
getHandleUser() {
getTenantHandleUser({
tenantId: this.$store.getters.tenantId,
pageNum: '1',
pageSize: '9999',
orderByColumn: 'createTime',
isAsc: 'desc'
}).then(res => {
this.handleUserList = res.rows
})
},
// //
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
const isJPG = this.fileType.indexOf(file.type) >= 0; const isJPG = this.fileType.indexOf(file.type) >= 0;

View File

@ -393,7 +393,7 @@ export default {
deviceName: "", deviceName: "",
modelId: "", modelId: "",
parentId: 0, parentId: 0,
deviceType: "GATEWAY_CONTROLLER" deviceType: ""
}, },
page: { page: {
pageSize: 10, pageSize: 10,

View File

@ -1,107 +1,141 @@
<template> <template>
<div class="device-select-nav"> <div class="device-select-nav">
<el-card <div class="layout-select-wrap" v-if="childDeviceList.length > 0">
:body-style="{ padding: '0px', width: '220px' }" <el-button plain size="mini" :disabled="tSelectLabelList.length <= 0" @click="handleChildStatus('true')">合闸</el-button>
:style=" <el-button plain size="mini" :disabled="tSelectLabelList.length <= 0" @click="handleChildStatus('false')">分闸</el-button>
deviceInfo.deviceId === checkobxDeviceId <el-button plain size="mini" @click="handleAllStatus('true')" >一键合闸</el-button>
? 'border: 1px solid #1890ff; margin: 5px; width: 220px; flex-shrink: 0;' <el-button plain size="mini" @click="handleAllStatus('false')">一键分闸</el-button>
: ' margin: 5px; width: 220px; flex-shrink: 0;' <span class="title-span">已选择设备</span>
" <span v-if="tSelectLabelList.length <= 0">当前未选择设备</span>
> <el-tag
<div class="nav-p-dev"> style="margin: 5px 5px 5px 0px;"
<div v-for="(item, idx) in tSelectLabelList"
style=" :key="idx"
height: 25px; closable
width: 100%; @close="selectDevClose(item)"
display: flex;
justify-content: flex-end;
padding-right: 10px;
padding-top: 5px;
"
> >
<div style="width: 60px; display: flex; justify-content: center" v-if="deviceInfo.stype === 'LAN'"> {{item}}
<i </el-tag>
class="iconfont iconkuandai"
style="color: black; font-size: 20px"
></i>
</div>
<div style="width: 60px; display: flex; justify-content: center" v-else>
<i
class="iconfont iconwifi"
style="color: black; font-size: 20px"
v-if="deviceInfo.stype === 'WIFI'"
></i>
<i
:class="signalType(deviceInfo.stype)"
style="color: black; font-size: 20px"
v-else
></i>
<signal-intensity
:intensityNumber="deviceInfo.signal"
></signal-intensity>
</div>
<i
v-if="deviceInfo.deviceId === checkobxDeviceId"
class="el-icon-success"
style="font-size: 25px; color: #1890ff"
></i>
</div>
<div class="dev-info">
<span class="dev-info-title" :title="deviceInfo.deviceName">{{
deviceInfo.deviceName
}}</span>
<div class="dev-info-state">
<el-tag type="success" v-if="deviceInfo.deviceState === 'ONLINE'"
>在线</el-tag
>
<el-tag
type="danger"
v-else-if="deviceInfo.deviceState === 'OFFLINE'"
>离线</el-tag
>
<el-tag
type="danger"
v-else-if="deviceInfo.deviceState === 'OUTLINE'"
>脱线</el-tag
>
<el-tag
type="info"
v-else-if="deviceInfo.deviceState === 'UNACTIVE'"
>未激活</el-tag
>
<el-button
type="primary"
size="mini"
@click="viewDeviceChange(deviceInfo.deviceId)"
>查看</el-button
>
</div>
</div>
</div>
</el-card>
<el-card </div>
:body-style="{ padding: '0px', width: '220px' }" <div class="layout-select-wrap" v-else>
:style=" <span class="title-span">当前没有可用于分闸合闸设备~</span>
item.deviceId === checkobxDeviceId </div>
? 'border: 1px solid #1890ff; margin: 5px; width: 220px; flex-shrink: 0;' <div class="layout-device-list">
: ' margin: 5px; width: 220px; flex-shrink: 0;' <el-card
" :body-style="{ padding: '0px', width: '220px' }"
v-for="item in childDeviceList" :style="
:key="item.deviceId" deviceInfo.deviceId === checkobxDeviceId
> ? 'border: 1px solid #1890ff; margin: 5px; width: 220px; flex-shrink: 0;'
<div class="nav-c-dev"> : ' margin: 5px; width: 220px; flex-shrink: 0;'
<div "
style=" >
height: 25px; <div class="nav-p-dev">
width: 100%; <div
display: flex; style="
justify-content: flex-end; height: 25px;
padding-right: 10px; width: 100%;
padding-top: 5px; display: flex;
" justify-content: flex-end;
> padding-right: 10px;
<!-- <div style=" padding-top: 5px;
"
>
<div
style="width: 60px; display: flex; justify-content: center"
v-if="deviceInfo.stype === 'LAN'"
>
<i
class="iconfont iconkuandai"
style="color: black; font-size: 20px"
></i>
</div>
<div
style="width: 60px; display: flex; justify-content: center"
v-else
>
<i
class="iconfont iconwifi"
style="color: black; font-size: 20px"
v-if="deviceInfo.stype === 'WIFI'"
></i>
<i
:class="signalType(deviceInfo.stype)"
style="color: black; font-size: 20px"
v-else
></i>
<signal-intensity
:intensityNumber="deviceInfo.signal"
></signal-intensity>
</div>
<i
v-if="deviceInfo.deviceId === checkobxDeviceId"
class="el-icon-s-claim"
style="font-size: 25px; color: #1890ff"
></i>
</div>
<div class="dev-info">
<span class="dev-info-title" :title="deviceInfo.deviceName">{{
deviceInfo.deviceName
}}</span>
<div class="dev-info-state">
<el-tag type="success" v-if="deviceInfo.deviceState === 'ONLINE'"
>在线</el-tag
>
<el-tag
type="danger"
v-else-if="deviceInfo.deviceState === 'OFFLINE'"
>离线</el-tag
>
<el-tag
type="danger"
v-else-if="deviceInfo.deviceState === 'OUTLINE'"
>脱线</el-tag
>
<el-tag
type="info"
v-else-if="deviceInfo.deviceState === 'UNACTIVE'"
>未激活</el-tag
>
<el-button
type="primary"
size="mini"
@click="viewDeviceChange(deviceInfo.deviceId)"
>查看</el-button
>
</div>
</div>
</div>
</el-card>
<el-card
:body-style="{ padding: '0px', width: '220px' }"
:style="
item.deviceId === checkobxDeviceId
? 'border: 1px solid #1890ff; margin: 5px; width: 220px; flex-shrink: 0;'
: ' margin: 5px; width: 220px; flex-shrink: 0;'
"
v-for="item in childDeviceList"
:key="item.deviceId"
>
<div class="nav-c-dev">
<div
style="
height: 25px;
width: 100%;
display: flex;
justify-content: flex-end;
padding-right: 10px;
padding-top: 5px;
"
>
<div @click="handleCheckbox(item)" :style="item.deviceId === checkobxDeviceId ? 'right: 159px;': ''" :class="tSelectList.indexOf(item.deviceId) >= 0 ? 'checkbox-i selected-c' : 'checkbox-i'">
<i
v-show="tSelectList.indexOf(item.deviceId) >= 0"
class="el-icon-check"
></i>
</div>
<!-- <div style="
width: 60px; width: 60px;
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -109,83 +143,84 @@
<i :class="signalType(item.stype)" style="color: black; font-size: 20px;" ></i> <i :class="signalType(item.stype)" style="color: black; font-size: 20px;" ></i>
<signal-intensity :intensityNumber="item.signal" ></signal-intensity> <signal-intensity :intensityNumber="item.signal" ></signal-intensity>
</div> --> </div> -->
<i <i
v-if="item.deviceId === checkobxDeviceId" v-if="item.deviceId === checkobxDeviceId"
class="el-icon-success" class="el-icon-s-claim"
style="font-size: 25px; color: #1890ff" style="font-size: 25px; color: #1890ff"
></i> ></i>
</div>
<div class="dev-info">
<span class="dev-info-title" :title="item.deviceName">{{
item.deviceName
}}</span>
<div
class="dev-info-state"
v-show="item.deviceId !== checkobxDeviceId"
>
<el-tag type="success" v-if="item.deviceState === 'ONLINE'"
>在线</el-tag
>
<el-tag type="danger" v-else-if="item.deviceState === 'OFFLINE'"
>离线</el-tag
>
<el-tag type="danger" v-else-if="item.deviceState === 'OUTLINE'"
>脱线</el-tag
>
<el-tag type="info" v-else-if="item.deviceState === 'UNACTIVE'"
>未激活</el-tag
>
<el-button
type="primary"
size="mini"
@click="viewDeviceChange(item.deviceId)"
>查看</el-button
>
</div> </div>
<div <div class="dev-info">
class="dev-info-state" <span class="dev-info-title" :title="item.deviceName">{{
v-show="item.deviceId === checkobxDeviceId" item.deviceName
> }}</span>
<el-switch <div
size="mini" class="dev-info-state"
v-model="item.switch" v-show="item.deviceId !== checkobxDeviceId"
active-text="开启"
disabled
inactive-text="关闭"
active-value="1"
inactive-value="0"
active-color="#13ce66"
inactive-color="#dcdfe6"
class="switch-wrap"
> >
</el-switch> <el-tag type="success" v-if="item.deviceState === 'ONLINE'"
<el-button >在线</el-tag
size="mini" >
v-if="item.switch === '1'" <el-tag type="danger" v-else-if="item.deviceState === 'OFFLINE'"
:disabled="item.deviceId !== checkobxDeviceId" >离线</el-tag
@click="submitChildStatus('false', item)" >
type="success" <el-tag type="danger" v-else-if="item.deviceState === 'OUTLINE'"
>关闭</el-button >脱线</el-tag
> >
<el-button <el-tag type="info" v-else-if="item.deviceState === 'UNACTIVE'"
size="mini" >未激活</el-tag
v-else >
:disabled="item.deviceId !== checkobxDeviceId" <el-button
@click="submitChildStatus('true', item)" type="primary"
type="danger" size="mini"
>开启</el-button @click="viewDeviceChange(item.deviceId)"
>查看</el-button
>
</div>
<div
class="dev-info-state"
v-show="item.deviceId === checkobxDeviceId"
> >
<el-switch
size="mini"
v-model="item.switch"
active-text="开启"
disabled
inactive-text="关闭"
active-value="1"
inactive-value="0"
active-color="#13ce66"
inactive-color="#dcdfe6"
class="switch-wrap"
>
</el-switch>
<el-button
size="mini"
v-if="item.switch === '1'"
:disabled="item.deviceId !== checkobxDeviceId"
@click="submitChildStatus('false', item)"
type="success"
>关闭</el-button
>
<el-button
size="mini"
v-else
:disabled="item.deviceId !== checkobxDeviceId"
@click="submitChildStatus('true', item)"
type="danger"
>开启</el-button
>
<el-button <el-button
type="primary" type="primary"
size="mini" size="mini"
@click="viewDeviceChange(item.deviceId)" @click="viewDeviceChange(item.deviceId)"
>查看</el-button >查看</el-button
> >
</div>
</div> </div>
</div> </div>
</div> </el-card>
</el-card> </div>
</div> </div>
</template> </template>
@ -220,6 +255,8 @@ export default {
socket_flag: true, socket_flag: true,
setTimeOut_flag: null, setTimeOut_flag: null,
timingPingWs_flag: null, timingPingWs_flag: null,
tSelectList: [],
tSelectLabelList: []
// wsDeviceInfo: null? // wsDeviceInfo: null?
}; };
}, },
@ -260,6 +297,70 @@ export default {
}, },
}, },
methods: { methods: {
handleAllStatus(type) {
if (this.childDeviceList.length > 0) {
this.childDeviceList.forEach(v => {
if (this.tSelectList.indexOf(v.deviceId) < 0) {
this.tSelectList.push(v.deviceId)
this.tSelectLabelList.push(v.deviceName)
}
})
this.handleChildStatus(type);
}
},
// 线
handleChildStatus(type) {
this.$prompt("请输入登录密码", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
inputPattern: /^[a-z A-z 0-9 $.]+/,
inputType: "password",
inputErrorMessage: "登录密码不能为空",
}).then(({ value }) => {
let params = {
data: {
cmd: "set_switch",
params: {
switch: 1
},
},
deviceId: '',
verifyKey: value,
};
switch(type) {
case 'true':
params.data.params.switch = 1;
params.deviceId = this.tSelectList.toString();
case 'false':
params.data.params.switch = 0;
params.deviceId = this.tSelectList.toString();
}
setSwitchControl(params).then((res) => {
this.msgSuccess("修改成功");
});
});
},
selectDevClose(e) {
console.log(e)
this.tSelectList.splice(this.tSelectLabelList.indexOf(e), 1);
this.tSelectLabelList.splice(this.tSelectLabelList.indexOf(e), 1)
},
handleCheckbox(e) {
if(this.tSelectList.indexOf(e.deviceId) >= 0) {
// delete e
this.tSelectList.splice(this.tSelectList.indexOf(e.deviceId), 1);
this.tSelectLabelList.splice(this.tSelectLabelList.indexOf(e.deviceName), 1)
} else {
this.tSelectLabelList.push(e.deviceName)
this.tSelectList.push(e.deviceId)
}
},
signalType(val) { signalType(val) {
switch (val) { switch (val) {
case "5G": case "5G":
@ -307,18 +408,24 @@ export default {
}, },
handlerWsMsgData(evt) { handlerWsMsgData(evt) {
// console.log("msg:", evt); // console.log("msg:", evt);
this.$emit("wsRealTImeMsg", JSON.stringify(evt)) this.$emit("wsRealTImeMsg", JSON.stringify(evt));
if (this.deviceInfo.deviceId !== this.wsDeviceInfo.deviceId) { if (this.deviceInfo.deviceId !== this.wsDeviceInfo.deviceId) {
for (let i = 0; i < this.childDeviceList.length; i++) { for (let i = 0; i < this.childDeviceList.length; i++) {
if (this.childDeviceList[i]["deviceKey"] === evt["devId"]) { if (this.childDeviceList[i]["deviceKey"] === evt["devId"]) {
this.childDeviceList[i]["switch"] = evt["params"]["switch"] ? evt["params"]["switch"].toString() : '0'; this.childDeviceList[i]["switch"] = evt["params"]["switch"]
? evt["params"]["switch"].toString()
: "0";
this.$forceUpdate(); this.$forceUpdate();
break; break;
} }
} }
} else { } else {
this.deviceInfo["stype"] = evt["params"]["stype"] ? evt["params"]["stype"].toString() : '0'; this.deviceInfo["stype"] = evt["params"]["stype"]
this.deviceInfo["signal"] = evt["params"]["signal"] ? evt["params"]["signal"].toString() : '0'; ? evt["params"]["stype"].toString()
: "0";
this.deviceInfo["signal"] = evt["params"]["signal"]
? evt["params"]["signal"].toString()
: "0";
} }
}, },
socket_onclose(e) { socket_onclose(e) {
@ -347,27 +454,27 @@ export default {
}, },
// ping ws // ping ws
timingPingWs(row) { timingPingWs(row) {
this.extenSubmit(row) this.extenSubmit(row);
const _this = this; const _this = this;
this.timingPingWs_flag = setInterval(function () { this.timingPingWs_flag = setInterval(function () {
_this.extenSubmit(row) _this.extenSubmit(row);
}, 110000); }, 110000);
}, },
extenSubmit(row) { extenSubmit(row) {
let params = { let params = {
data: { data: {
cmd: "set_live_time", cmd: "set_live_time",
params: { params: {
ltime: 15, // (0.1) ltime: 15, // (0.1)
dtime: 1200, //(0.1) dtime: 1200, //(0.1)
},
}, },
deviceId: row.deviceId, },
}; deviceId: row.deviceId,
setSwitchControl(params).then((res) => { };
console.log(res) setSwitchControl(params).then((res) => {
// this.msgSuccess(""); console.log(res);
}); // this.msgSuccess("");
});
}, },
// 线 // 线
submitChildStatus(type, row) { submitChildStatus(type, row) {
@ -414,18 +521,42 @@ export default {
}, },
}, },
destroyed() { destroyed() {
this.closeWebscoket() this.closeWebscoket();
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
.device-select-nav { .device-select-nav {
height: 130px; min-height: 180px;
width: 100%; width: 100%;
display: flex; display: flex;
overflow-y: auto; overflow-y: auto;
background-color: #e4eaf3; background-color: #e4eaf3;
flex-wrap: wrap;
align-items: flex-start;
.layout-select-wrap {
width: 100%;
min-height: 40px;
display: flex;
flex-wrap: wrap;
align-items: center;
padding-left: 5px;
border: 1px solid #1890ff;
margin: 10px 5px;
border-radius: 5px;
background-color: #1890ff17;
margin-bottom: 5px;
.title-span {
margin-left: 10px;
}
}
.layout-device-list {
width: 100%;
display: flex;
height: 130px;
}
.nav-p-dev { .nav-p-dev {
display: flex; display: flex;
-ms-flex-wrap: wrap; -ms-flex-wrap: wrap;
@ -474,6 +605,24 @@ export default {
justify-content: flex-end; justify-content: flex-end;
// padding-top: 10px; // padding-top: 10px;
flex-shrink: 0; flex-shrink: 0;
.checkbox-i {
width: 20px;
border: 1px solid #1890ff;
height: 20px;
border-radius: 3px;
position: relative;
right: 184px;
font-size: 17px;
display: flex;
align-items: center;
}
.selected-c {
background: #1890ff;
color: #fff;
border-color: #fff;
}
.dev-info { .dev-info {
padding: 10px; padding: 10px;
display: flex; display: flex;

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="iot-circuit-breaker-details-warp"> <div class="iot-circuit-breaker-details-warp">
<device-select @wsRealTImeMsg="wsRealTImeMsg($event)" v-if="pInfo" :deviceInfo="pInfo" :wsDeviceInfo="infoData" @changeEvent="viewDeviceChange($event)"></device-select> <device-select @wsRealTImeMsg="wsRealTImeMsg($event)" v-if="pInfo" :deviceInfo="pInfo" :wsDeviceInfo="infoData" @changeEvent="viewDeviceChange($event)"></device-select>
<div class="info-tabs-circuit"> <div class="info-tabs-circuit">
<div class="breadcrumb-wrap" v-show="breadcrumbList.length > 1"> <div class="breadcrumb-wrap" v-show="breadcrumbList.length > 1">
<el-breadcrumb separator-class="el-icon-arrow-right"> <el-breadcrumb separator-class="el-icon-arrow-right">
@ -80,7 +80,8 @@ export default {
tempType: "bs", tempType: "bs",
deviceId: "", deviceId: "",
devudeRunState: false, devudeRunState: false,
realTimeData: null realTimeData: null,
hzSelectList: []
}; };
}, },
created() { created() {
@ -104,6 +105,7 @@ export default {
} }
this.infoData = response.data; this.infoData = response.data;
this.devudeRunState = true; this.devudeRunState = true;
this.activeName = "runingState";
}); });
}, },
toNewDevice(data) { toNewDevice(data) {
@ -113,8 +115,9 @@ export default {
this.deviceInfo(); this.deviceInfo();
this.activeName = "runingState"; this.activeName = "runingState";
}, },
updateInfo(...data) { updateInfo(data) {
this.deviceInfo(); console.log(data)
this.deviceInfo(data.deviceId === this.pInfo.deviceId ? null : 'children' );
} }
} }
}; };
@ -265,7 +268,7 @@ export default {
position: relative; position: relative;
box-sizing: border-box; box-sizing: border-box;
.el-tabs__content { .el-tabs__content {
height: calc(100vh - 341px); height: calc(100vh - 381px);
overflow: auto; overflow: auto;
} }
.el-tabs__header { .el-tabs__header {

View File

@ -264,7 +264,7 @@ export default {
deviceName: "", deviceName: "",
modelId: "", modelId: "",
parentId: 0, parentId: 0,
deviceType: "GATEWAY_CONTROLLER" deviceType: ""
}, },
page: { page: {
pageSize: 10, pageSize: 10,

View File

@ -289,7 +289,7 @@ export default {
deviceName: "", deviceName: "",
modelId: "", modelId: "",
parentId: 0, parentId: 0,
deviceType: "GATEWAY_CONTROLLER" deviceType: ""
}, },
page: { page: {
pageSize: 10, pageSize: 10,

View File

@ -125,26 +125,25 @@
width="200px" width="200px"
prop="typeName" prop="typeName"
/> />
<!-- <el-table-column label="操作" width="200" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" width="200" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <!-- <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
v-show="scope.row.processStatus === '1'" v-show="scope.row.processStatus === '1'"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['iot:record:edit']" v-hasPermi="['iot:record:edit']"
>处理</el-button> >处理</el-button> -->
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
v-show="scope.row.processStatus === '1'"
@click="handleWork(scope.row)" @click="handleWork(scope.row)"
v-hasPermi="['iot:record:edit']" v-hasPermi="['iot:maintenance:add']"
>创建工单</el-button> >创建工单</el-button>
</template> </template>
</el-table-column> --> </el-table-column>
</el-table> </el-table>
<pagination <pagination
@ -194,6 +193,7 @@ import {
exportRecord, exportRecord,
updateRecord, updateRecord,
delRecord, delRecord,
addAlarmRecord,
} from "@/api/alarm/tenantAlarm"; } from "@/api/alarm/tenantAlarm";
import Editor from "@/components/Editor"; import Editor from "@/components/Editor";
@ -305,7 +305,22 @@ export default {
}); });
}, },
// //
handleWork() {}, handleWork(row) {
console.log('addWork:', row)
let param = {
"recordId": row.recordId,//id
"deviceId": row.deviceId,
"deviceName": row.deviceName,
"faultType": "3",//
"maintenanceStatus": "-1",//
"tenantId": null,
"faultTypeName": "告警工单"//
}
addAlarmRecord(param).then(res => {
this.msgSuccess("创建成功!");
this.$router.push('/power/maintenancet')
})
},
// //
handleUpdate(row) { handleUpdate(row) {
this.resetFomr(); this.resetFomr();

View File

@ -124,26 +124,25 @@
width="200px" width="200px"
prop="typeName" prop="typeName"
/> />
<!-- <el-table-column label="操作" width="200" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" width="200" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <!-- <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
v-show="scope.row.processStatus === '1'" v-show="scope.row.processStatus === '1'"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
v-hasPermi="['iot:record:edit']" v-hasPermi="['iot:record:edit']"
>处理</el-button> >处理</el-button> -->
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
v-show="scope.row.processStatus === '1'"
@click="handleWork(scope.row)" @click="handleWork(scope.row)"
v-hasPermi="['iot:record:edit']" v-hasPermi="['iot:maintenance:add']"
>创建工单</el-button> >创建工单</el-button>
</template> </template>
</el-table-column> --> </el-table-column>
</el-table> </el-table>
<pagination <pagination
@ -193,6 +192,7 @@ import {
exportRecord, exportRecord,
updateRecord, updateRecord,
delRecord, delRecord,
addAlarmRecord
} from "@/api/alarm/tenantAlarm"; } from "@/api/alarm/tenantAlarm";
import Editor from "@/components/Editor"; import Editor from "@/components/Editor";
@ -298,7 +298,22 @@ export default {
}); });
}, },
// //
handleWork() {}, handleWork(row) {
console.log('addWork:', row)
let param = {
"recordId": row.recordId,//id
"deviceId": row.deviceId,
"deviceName": row.deviceName,
"faultType": "3",//
"maintenanceStatus": "-1",//
"tenantId": null,
"faultTypeName": "告警工单"//
}
addAlarmRecord(param).then(res => {
this.msgSuccess("创建成功!");
this.$router.push('/power/maintenancet')
})
},
// //
handleUpdate(row) { handleUpdate(row) {
this.resetFomr(); this.resetFomr();

View File

@ -756,7 +756,7 @@ export default {
height: 30px; height: 30px;
position: absolute; position: absolute;
right: 30px; right: 30px;
top: 170px; top: 210px;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;