Merge branch 'master' of http://192.168.4.125:32792/04787/smart-power-ui
This commit is contained in:
commit
395d915758
|
@ -42,3 +42,12 @@ export function exportRecord(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 新增报警记录
|
||||
export function addAlarmRecord(data) {
|
||||
return request({
|
||||
url: '/iot/maintenance/',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -60,3 +60,13 @@ export function exportMaintenance(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 获取租户下用户
|
||||
export function getTenantHandleUser(query) {
|
||||
return request({
|
||||
url: '/system/user/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
|
|
@ -156,6 +156,9 @@ export function getIotFileUrl(importUrl) {
|
|||
if (!importUrl) {
|
||||
return '/assets/logo/logo.png';
|
||||
}
|
||||
if (importUrl.indexOf(':8899') > 0) {
|
||||
importUrl = importUrl.replace(':8899', ':9988')
|
||||
}
|
||||
if (importUrl.indexOf('http') === 0 || importUrl.indexOf('https') === 0) {
|
||||
return importUrl;
|
||||
} else if (importUrl.indexOf('/profile/upload/') === 0 || importUrl.indexOf('/profile/avatar/') === 0) {
|
||||
|
|
|
@ -65,7 +65,7 @@
|
|||
v-hasPermi="['iot:type:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
|
@ -73,7 +73,7 @@
|
|||
@click="handleExport"
|
||||
v-hasPermi="['iot:type:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
line-height: 1.5;
|
||||
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>
|
||||
<el-divider></el-divider>
|
||||
<div v-html="info.noticeContent" style="padding: 20px;"></div>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
line-height: 1.5;
|
||||
font: 13px/1.6 Arial,sans-serif,Tahoma,Roboto,'Source Code Pro';
|
||||
"
|
||||
>发布时间:{{info.updateTime}}</span>
|
||||
>发布时间:{{info.createTime}}</span>
|
||||
<el-divider></el-divider>
|
||||
<div v-html="info.noticeContent" style="padding: 20px;"></div>
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@
|
|||
v-hasPermi="['iot:type:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
|
@ -91,7 +91,7 @@
|
|||
@click="handleExport"
|
||||
v-hasPermi="['iot:type:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
|
@ -184,6 +184,22 @@
|
|||
</el-select>
|
||||
</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-radio-group v-model="form.alarmDivide">
|
||||
<el-radio :label="vals" v-for="(keys, vals) in alarmDivideType" :key="vals">{{keys}}</el-radio>
|
||||
|
@ -217,6 +233,7 @@ import {
|
|||
updateAlarmType
|
||||
} from "@/api/alarm/alarmType";
|
||||
import { listDeviceTypeList } from "@/api/iot/device";
|
||||
import { listUser } from "@/api/system/user";
|
||||
// import { selectedProdmodel } from "@/api/device/prodmodel";
|
||||
const alarmDivideType = {
|
||||
ALARM: "报警",
|
||||
|
@ -265,15 +282,22 @@ export default {
|
|||
tag: [{ required: true, message: "告警标签不能为空", trigger: "blur" }]
|
||||
},
|
||||
tenantId: "",
|
||||
deviceTypeList: []
|
||||
deviceTypeList: [],
|
||||
userList: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.tenantId = this.$store.getters.tenantId;
|
||||
this.getList();
|
||||
this.getUserList()
|
||||
this.getDeviceTypeList();
|
||||
},
|
||||
methods: {
|
||||
getUserList() {
|
||||
listUser().then(response => {
|
||||
this.userList = response.rows;
|
||||
});
|
||||
},
|
||||
indexFormatter(val) {
|
||||
return (
|
||||
val + 1 + (this.queryParams.pageNum - 1) * this.queryParams.pageSize
|
||||
|
|
|
@ -891,7 +891,7 @@ export default {
|
|||
height: 30px;
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
top: 170px;
|
||||
top: 220px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
|
|
@ -420,7 +420,7 @@ export default {
|
|||
this.upload.open = false;
|
||||
this.upload.isUploading = false;
|
||||
this.$refs.upload.clearFiles();
|
||||
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
|
||||
this.$alert(response.msg || '导入失败,格式不正确!', "导入结果", { dangerouslyUseHTMLString: true });
|
||||
this.getList();
|
||||
},
|
||||
// 提交上传文件
|
||||
|
|
|
@ -105,7 +105,13 @@
|
|||
width="200px"
|
||||
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
|
||||
label="设备类型"
|
||||
|
|
|
@ -180,7 +180,7 @@
|
|||
v-show="temp.hasCtl"
|
||||
ref="paramsWrap"
|
||||
:disabled="false"
|
||||
v-for="(item,index) in relationList"
|
||||
v-for="(item) in relationList"
|
||||
:tempIndex="item.guid"
|
||||
:deleteButtonD="false"
|
||||
:key="item.guid"
|
||||
|
|
|
@ -465,7 +465,7 @@ export default {
|
|||
height: 30px;
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
top: 170px;
|
||||
top: 210px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
|
|
@ -266,18 +266,6 @@
|
|||
</el-form-item>
|
||||
|
||||
<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
|
||||
v-model="form.handlerId"
|
||||
style="width: 100%"
|
||||
|
@ -475,6 +463,7 @@ export default {
|
|||
},
|
||||
// 查看详情
|
||||
handleDetails(row) {
|
||||
console.log('handleDetail:', row)
|
||||
this.workDetails = row;
|
||||
this.openDestail = true;
|
||||
},
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
<el-col :span="12">
|
||||
<div class="item-block">
|
||||
<span>工单 I D :</span>
|
||||
<span>{{ workDetails.maintenanceId }}</span>
|
||||
<span>{{ workDetails['maintenanceId'] }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="item-block">
|
||||
<span>工单状态:</span>
|
||||
<span>{{ workStateList[workDetails.maintenanceStatus] }}</span>
|
||||
<span>{{ workStateList[workDetails['maintenanceStatus']] }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -36,13 +36,13 @@
|
|||
<el-col :span="12">
|
||||
<div class="item-block">
|
||||
<span>设备名称:</span>
|
||||
<span>{{ workDetails.deviceName }}</span>
|
||||
<span>{{ workDetails['deviceName'] }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="item-block">
|
||||
<span>故障类型:</span>
|
||||
<span>{{ fanltTypeList[workDetails.faultType] }}</span>
|
||||
<span>{{ fanltTypeList[workDetails['faultType']] }}</span>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -160,7 +160,7 @@
|
|||
border-radius: 3px;
|
||||
"
|
||||
:src="getIotFileUrl(val)"
|
||||
v-for="(val, index) in pictures"
|
||||
v-for="(val) in pictures"
|
||||
:key="val"
|
||||
/>
|
||||
</div>
|
||||
|
@ -169,6 +169,35 @@
|
|||
</el-row>
|
||||
</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
|
||||
content-position="left"
|
||||
v-if="
|
||||
|
@ -314,6 +343,16 @@
|
|||
"
|
||||
v-text="'工单正在等待处理人确认...'"
|
||||
></span>
|
||||
|
||||
<span
|
||||
style="margin-left: 20px; height: 50px; display: block"
|
||||
v-show="
|
||||
workDetails.handlerId !== logUser &&
|
||||
workDetails.maintenanceStatus === '-1'
|
||||
"
|
||||
v-text="'工单正在等待分配指定处理人...'"
|
||||
></span>
|
||||
|
||||
<span
|
||||
style="margin-left: 20px; height: 50px; display: block"
|
||||
v-show="
|
||||
|
@ -532,7 +571,7 @@
|
|||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { updateMaintenance, getMaintenance } from "@/api/power/maintenance";
|
||||
import { updateMaintenance, getMaintenance, getTenantHandleUser } from "@/api/power/maintenance";
|
||||
import { uploadFile } from "@/api/file";
|
||||
import { getIotFileUrl } from "@/utils/hciot";
|
||||
// 工单状态(0:工单已创建 1:工单执行中 2:工单审核失败 3:工单审核成功)
|
||||
|
@ -575,14 +614,28 @@ export default {
|
|||
pictures: [],
|
||||
dialogVisible: false,
|
||||
dialogImageUrl: "",
|
||||
handleUserList: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.logUser = this.$store.getters.userId;
|
||||
this.getHandleUser();
|
||||
this.handleDetails();
|
||||
},
|
||||
methods: {
|
||||
getIotFileUrl,
|
||||
// 获取处理人
|
||||
getHandleUser() {
|
||||
getTenantHandleUser({
|
||||
tenantId: this.$store.getters.tenantId,
|
||||
pageNum: '1',
|
||||
pageSize: '9999',
|
||||
orderByColumn: 'createTime',
|
||||
isAsc: 'desc'
|
||||
}).then(res => {
|
||||
this.handleUserList = res.rows
|
||||
})
|
||||
},
|
||||
// 限制图片大小和类型
|
||||
beforeAvatarUpload(file) {
|
||||
const isJPG = this.fileType.indexOf(file.type) >= 0;
|
||||
|
|
|
@ -393,7 +393,7 @@ export default {
|
|||
deviceName: "",
|
||||
modelId: "",
|
||||
parentId: 0,
|
||||
deviceType: "GATEWAY_CONTROLLER"
|
||||
deviceType: ""
|
||||
},
|
||||
page: {
|
||||
pageSize: 10,
|
||||
|
|
|
@ -1,107 +1,141 @@
|
|||
<template>
|
||||
<div class="device-select-nav">
|
||||
<el-card
|
||||
:body-style="{ padding: '0px', width: '220px' }"
|
||||
:style="
|
||||
deviceInfo.deviceId === checkobxDeviceId
|
||||
? 'border: 1px solid #1890ff; margin: 5px; width: 220px; flex-shrink: 0;'
|
||||
: ' margin: 5px; width: 220px; flex-shrink: 0;'
|
||||
"
|
||||
>
|
||||
<div class="nav-p-dev">
|
||||
<div
|
||||
style="
|
||||
height: 25px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding-right: 10px;
|
||||
padding-top: 5px;
|
||||
"
|
||||
<div class="layout-select-wrap" v-if="childDeviceList.length > 0">
|
||||
<el-button plain size="mini" :disabled="tSelectLabelList.length <= 0" @click="handleChildStatus('true')">合闸</el-button>
|
||||
<el-button plain size="mini" :disabled="tSelectLabelList.length <= 0" @click="handleChildStatus('false')">分闸</el-button>
|
||||
<el-button plain size="mini" @click="handleAllStatus('true')" >一键合闸</el-button>
|
||||
<el-button plain size="mini" @click="handleAllStatus('false')">一键分闸</el-button>
|
||||
<span class="title-span">已选择设备:</span>
|
||||
<span v-if="tSelectLabelList.length <= 0">当前未选择设备</span>
|
||||
<el-tag
|
||||
style="margin: 5px 5px 5px 0px;"
|
||||
v-for="(item, idx) in tSelectLabelList"
|
||||
:key="idx"
|
||||
closable
|
||||
@close="selectDevClose(item)"
|
||||
>
|
||||
<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-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>
|
||||
{{item}}
|
||||
</el-tag>
|
||||
|
||||
<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 style="
|
||||
</div>
|
||||
<div class="layout-select-wrap" v-else>
|
||||
<span class="title-span">当前没有可用于分闸合闸设备~</span>
|
||||
</div>
|
||||
<div class="layout-device-list">
|
||||
<el-card
|
||||
:body-style="{ padding: '0px', width: '220px' }"
|
||||
:style="
|
||||
deviceInfo.deviceId === checkobxDeviceId
|
||||
? 'border: 1px solid #1890ff; margin: 5px; width: 220px; flex-shrink: 0;'
|
||||
: ' margin: 5px; width: 220px; flex-shrink: 0;'
|
||||
"
|
||||
>
|
||||
<div class="nav-p-dev">
|
||||
<div
|
||||
style="
|
||||
height: 25px;
|
||||
width: 100%;
|
||||
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'"
|
||||
>
|
||||
<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;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
|
@ -109,83 +143,84 @@
|
|||
<i :class="signalType(item.stype)" style="color: black; font-size: 20px;" ></i>
|
||||
<signal-intensity :intensityNumber="item.signal" ></signal-intensity>
|
||||
</div> -->
|
||||
<i
|
||||
v-if="item.deviceId === checkobxDeviceId"
|
||||
class="el-icon-success"
|
||||
style="font-size: 25px; color: #1890ff"
|
||||
></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
|
||||
>
|
||||
<i
|
||||
v-if="item.deviceId === checkobxDeviceId"
|
||||
class="el-icon-s-claim"
|
||||
style="font-size: 25px; color: #1890ff"
|
||||
></i>
|
||||
</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"
|
||||
<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-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-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
|
||||
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
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="viewDeviceChange(item.deviceId)"
|
||||
>查看</el-button
|
||||
>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="viewDeviceChange(item.deviceId)"
|
||||
>查看</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -220,6 +255,8 @@ export default {
|
|||
socket_flag: true,
|
||||
setTimeOut_flag: null,
|
||||
timingPingWs_flag: null,
|
||||
tSelectList: [],
|
||||
tSelectLabelList: []
|
||||
// wsDeviceInfo: null?
|
||||
};
|
||||
},
|
||||
|
@ -260,6 +297,70 @@ export default {
|
|||
},
|
||||
},
|
||||
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) {
|
||||
switch (val) {
|
||||
case "5G":
|
||||
|
@ -307,18 +408,24 @@ export default {
|
|||
},
|
||||
handlerWsMsgData(evt) {
|
||||
// console.log("msg:", evt);
|
||||
this.$emit("wsRealTImeMsg", JSON.stringify(evt))
|
||||
this.$emit("wsRealTImeMsg", JSON.stringify(evt));
|
||||
if (this.deviceInfo.deviceId !== this.wsDeviceInfo.deviceId) {
|
||||
for (let i = 0; i < this.childDeviceList.length; i++) {
|
||||
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();
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.deviceInfo["stype"] = evt["params"]["stype"] ? evt["params"]["stype"].toString() : '0';
|
||||
this.deviceInfo["signal"] = evt["params"]["signal"] ? evt["params"]["signal"].toString() : '0';
|
||||
this.deviceInfo["stype"] = evt["params"]["stype"]
|
||||
? evt["params"]["stype"].toString()
|
||||
: "0";
|
||||
this.deviceInfo["signal"] = evt["params"]["signal"]
|
||||
? evt["params"]["signal"].toString()
|
||||
: "0";
|
||||
}
|
||||
},
|
||||
socket_onclose(e) {
|
||||
|
@ -347,27 +454,27 @@ export default {
|
|||
},
|
||||
// 定时 ping ws
|
||||
timingPingWs(row) {
|
||||
this.extenSubmit(row)
|
||||
this.extenSubmit(row);
|
||||
const _this = this;
|
||||
this.timingPingWs_flag = setInterval(function () {
|
||||
_this.extenSubmit(row)
|
||||
_this.extenSubmit(row);
|
||||
}, 110000);
|
||||
},
|
||||
extenSubmit(row) {
|
||||
let params = {
|
||||
data: {
|
||||
cmd: "set_live_time",
|
||||
params: {
|
||||
ltime: 15, // 上报间隔(0.1秒)
|
||||
dtime: 1200, //上报时长(0.1秒)
|
||||
},
|
||||
data: {
|
||||
cmd: "set_live_time",
|
||||
params: {
|
||||
ltime: 15, // 上报间隔(0.1秒)
|
||||
dtime: 1200, //上报时长(0.1秒)
|
||||
},
|
||||
deviceId: row.deviceId,
|
||||
};
|
||||
setSwitchControl(params).then((res) => {
|
||||
console.log(res)
|
||||
// this.msgSuccess("成功");
|
||||
});
|
||||
},
|
||||
deviceId: row.deviceId,
|
||||
};
|
||||
setSwitchControl(params).then((res) => {
|
||||
console.log(res);
|
||||
// this.msgSuccess("成功");
|
||||
});
|
||||
},
|
||||
// 点击子设备 线路开关
|
||||
submitChildStatus(type, row) {
|
||||
|
@ -414,18 +521,42 @@ export default {
|
|||
},
|
||||
},
|
||||
destroyed() {
|
||||
this.closeWebscoket()
|
||||
this.closeWebscoket();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.device-select-nav {
|
||||
height: 130px;
|
||||
min-height: 180px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
overflow-y: auto;
|
||||
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 {
|
||||
display: flex;
|
||||
-ms-flex-wrap: wrap;
|
||||
|
@ -474,6 +605,24 @@ export default {
|
|||
justify-content: flex-end;
|
||||
// padding-top: 10px;
|
||||
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 {
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<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="breadcrumb-wrap" v-show="breadcrumbList.length > 1">
|
||||
<el-breadcrumb separator-class="el-icon-arrow-right">
|
||||
|
@ -80,7 +80,8 @@ export default {
|
|||
tempType: "bs",
|
||||
deviceId: "",
|
||||
devudeRunState: false,
|
||||
realTimeData: null
|
||||
realTimeData: null,
|
||||
hzSelectList: []
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
@ -104,6 +105,7 @@ export default {
|
|||
}
|
||||
this.infoData = response.data;
|
||||
this.devudeRunState = true;
|
||||
this.activeName = "runingState";
|
||||
});
|
||||
},
|
||||
toNewDevice(data) {
|
||||
|
@ -113,8 +115,9 @@ export default {
|
|||
this.deviceInfo();
|
||||
this.activeName = "runingState";
|
||||
},
|
||||
updateInfo(...data) {
|
||||
this.deviceInfo();
|
||||
updateInfo(data) {
|
||||
console.log(data)
|
||||
this.deviceInfo(data.deviceId === this.pInfo.deviceId ? null : 'children' );
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -265,7 +268,7 @@ export default {
|
|||
position: relative;
|
||||
box-sizing: border-box;
|
||||
.el-tabs__content {
|
||||
height: calc(100vh - 341px);
|
||||
height: calc(100vh - 381px);
|
||||
overflow: auto;
|
||||
}
|
||||
.el-tabs__header {
|
||||
|
|
|
@ -264,7 +264,7 @@ export default {
|
|||
deviceName: "",
|
||||
modelId: "",
|
||||
parentId: 0,
|
||||
deviceType: "GATEWAY_CONTROLLER"
|
||||
deviceType: ""
|
||||
},
|
||||
page: {
|
||||
pageSize: 10,
|
||||
|
|
|
@ -289,7 +289,7 @@ export default {
|
|||
deviceName: "",
|
||||
modelId: "",
|
||||
parentId: 0,
|
||||
deviceType: "GATEWAY_CONTROLLER"
|
||||
deviceType: ""
|
||||
},
|
||||
page: {
|
||||
pageSize: 10,
|
||||
|
|
|
@ -125,26 +125,25 @@
|
|||
width="200px"
|
||||
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">
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
v-show="scope.row.processStatus === '1'"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['iot:record:edit']"
|
||||
>处理</el-button>
|
||||
>处理</el-button> -->
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
v-show="scope.row.processStatus === '1'"
|
||||
@click="handleWork(scope.row)"
|
||||
v-hasPermi="['iot:record:edit']"
|
||||
v-hasPermi="['iot:maintenance:add']"
|
||||
>创建工单</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
|
@ -194,6 +193,7 @@ import {
|
|||
exportRecord,
|
||||
updateRecord,
|
||||
delRecord,
|
||||
addAlarmRecord,
|
||||
} from "@/api/alarm/tenantAlarm";
|
||||
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) {
|
||||
this.resetFomr();
|
||||
|
|
|
@ -124,26 +124,25 @@
|
|||
width="200px"
|
||||
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">
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
v-show="scope.row.processStatus === '1'"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['iot:record:edit']"
|
||||
>处理</el-button>
|
||||
>处理</el-button> -->
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
v-show="scope.row.processStatus === '1'"
|
||||
@click="handleWork(scope.row)"
|
||||
v-hasPermi="['iot:record:edit']"
|
||||
v-hasPermi="['iot:maintenance:add']"
|
||||
>创建工单</el-button>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
|
@ -193,6 +192,7 @@ import {
|
|||
exportRecord,
|
||||
updateRecord,
|
||||
delRecord,
|
||||
addAlarmRecord
|
||||
} from "@/api/alarm/tenantAlarm";
|
||||
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) {
|
||||
this.resetFomr();
|
||||
|
|
|
@ -756,7 +756,7 @@ export default {
|
|||
height: 30px;
|
||||
position: absolute;
|
||||
right: 30px;
|
||||
top: 170px;
|
||||
top: 210px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
|
Loading…
Reference in New Issue