tijioa
This commit is contained in:
parent
2d05e10f14
commit
d9d52747b9
|
@ -8,7 +8,7 @@
|
|||
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||
<link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/1.0.0/index.css">
|
||||
<link rel="stylesheet" href="<%= BASE_URL %>cdn/iconfont/1.0.0/iconfont.css">
|
||||
<link rel="stylesheet" href="//at.alicdn.com/t/font_2506643_p77wcbhksgm.css">
|
||||
<link rel="stylesheet" href="//at.alicdn.com/t/font_2506643_eumy2msqof4.css">
|
||||
<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.4.15&key=aabc97a5e095102787d405719847ecf0"></script>
|
||||
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ export function listProject(query) {
|
|||
// 查询项目详细
|
||||
export function getProject(projectId) {
|
||||
return request({
|
||||
url: "/tenant/project/" + projectId,
|
||||
url: "/iot/project/" + projectId,
|
||||
method: "get"
|
||||
});
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ export function getProject(projectId) {
|
|||
// 导出项目
|
||||
export function exportProject(query) {
|
||||
return request({
|
||||
url: "/tenant/project/export",
|
||||
url: "/iot/project/export",
|
||||
method: "get",
|
||||
params: query
|
||||
});
|
||||
|
|
|
@ -85,7 +85,7 @@ export default {
|
|||
},
|
||||
// 地图标点 点击事件
|
||||
markerClick(e) {
|
||||
console.log('地图点击标注点!!')
|
||||
// console.log('地图点击标注点!!')
|
||||
if (!this.infoWindow) {
|
||||
this.createInfoWindowO();
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ export default {
|
|||
this.aMap.clearMap();
|
||||
}
|
||||
this.createMarker();
|
||||
console.log("map_projectList: ", list);
|
||||
// console.log("map_projectList: ", list);
|
||||
// this.textFu();
|
||||
},
|
||||
deep: true
|
||||
|
@ -94,7 +94,7 @@ export default {
|
|||
},
|
||||
// 地图标点 点击事件
|
||||
markerClick(e) {
|
||||
console.log("地图点击标注点!!");
|
||||
// console.log("地图点击标注点!!");
|
||||
if (!this.infoWindow) {
|
||||
this.createInfoWindowO();
|
||||
}
|
||||
|
@ -212,9 +212,6 @@ export default {
|
|||
}
|
||||
return resultStr;
|
||||
},
|
||||
st(v) {
|
||||
console.log('srccc:', v)
|
||||
},
|
||||
// 实例化信息窗体
|
||||
createInfoWindow(content) {
|
||||
var info = document.createElement("div");
|
||||
|
|
|
@ -85,7 +85,7 @@ export default {
|
|||
},
|
||||
// 地图标点 点击事件
|
||||
markerClick(e) {
|
||||
console.log('地图点击标注点!!')
|
||||
// console.log('地图点击标注点!!')
|
||||
if (!this.infoWindow) {
|
||||
this.createInfoWindowO();
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ export default {
|
|||
this.valueLoop.start = 2
|
||||
this.valueLoop.interval = 1
|
||||
this.parseProp(this.prop)
|
||||
console.log(this.valueList)
|
||||
// console.log(this.valueList)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -35,7 +35,7 @@ export default {
|
|||
if (typeof val !== 'string') return
|
||||
const themeCluster = this.getThemeCluster(val.replace('#', ''))
|
||||
const originalCluster = this.getThemeCluster(oldVal.replace('#', ''))
|
||||
console.log(themeCluster, originalCluster)
|
||||
// console.log(themeCluster, originalCluster)
|
||||
|
||||
const $message = this.$message({
|
||||
message: ' Compiling the theme',
|
||||
|
|
|
@ -71,7 +71,7 @@ export default {
|
|||
this.dialogVisible = true;
|
||||
},
|
||||
beforeAvatarUpload(file) {
|
||||
console.log(file.type)
|
||||
// console.log(file.type)
|
||||
const isJPG = this.fileType.indexOf(file.type) >= 0;
|
||||
const isLt2M = file.size < this.fileSize;
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ var iotHost="192.168.18.139"; // 海创iot 平台 host
|
|||
// iot.gkiiot.com 192.168.18.139
|
||||
var flowIotUrl = '';
|
||||
let iotWebSocketBaseUrl = ''
|
||||
let devLiveWebSocketBaseUrl = ''
|
||||
let sysWebSocket = 'ws://'
|
||||
let prodApi = '/prod-api';
|
||||
var hrefHost = window.location.host;
|
||||
|
@ -24,11 +25,13 @@ if (env.NODE_ENV == 'development') {
|
|||
iotWebSocketAlarmBaseUrl = sysWebSocket + hrefHost + ':8899/ws/alarm/live'
|
||||
sysWebSocket = sysWebSocket + hrefHost + prodApi;
|
||||
iotWebSocketBaseUrl = sysWebSocket + '/ws/dev/up/'
|
||||
devLiveWebSocketBaseUrl = sysWebSocket + '/ws/dev/live/'
|
||||
iotPlatformUrl = 'http://' + iotHost + '/prod-api'
|
||||
|
||||
export {
|
||||
iotPlatformUrl,
|
||||
sysWebSocket,
|
||||
iotWebSocketBaseUrl,
|
||||
iotWebSocketAlarmBaseUrl
|
||||
iotWebSocketAlarmBaseUrl,
|
||||
devLiveWebSocketBaseUrl
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<div v-if="device==='mobile'&&sidebar.opened" class="drawer-bg" @click="handleClickOutside"/>
|
||||
<sidebar class="sidebar-container" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBg : variables.menuLightBg }" />
|
||||
<div :class="{hasTagsView:needTagsView}" class="main-container">
|
||||
<div :class="{'fixed-header':fixedHeader}">
|
||||
<div :class="{'fixed-header':fixedHeader}" id="navbar-top" :style="navbarShow() ? 'display: none;' : ''">
|
||||
<navbar />
|
||||
<tags-view v-if="needTagsView" />
|
||||
</div>
|
||||
|
@ -56,6 +56,9 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
navbarShow() {
|
||||
return this.$route.path === '/index'
|
||||
},
|
||||
handleClickOutside() {
|
||||
this.$store.dispatch('app/closeSideBar', { withoutAnimation: false })
|
||||
}
|
||||
|
|
|
@ -64,6 +64,9 @@ export const constantRoutes = [
|
|||
name: 'BigScreen',
|
||||
meta: {
|
||||
title: '数据总览', icon: 'dashboard', noCache: true, affix: true
|
||||
},
|
||||
params: {
|
||||
showNav: false
|
||||
}
|
||||
},
|
||||
]
|
||||
|
|
|
@ -88,7 +88,7 @@ service.interceptors.response.use(res => {
|
|||
}
|
||||
},
|
||||
error => {
|
||||
console.log('err' + error)
|
||||
// console.log('err' + error)
|
||||
let { message } = error;
|
||||
if (message == "Network Error") {
|
||||
message = "后端接口连接异常";
|
||||
|
|
|
@ -85,7 +85,7 @@ export default {
|
|||
watch: {
|
||||
option(val, oldVal) {
|
||||
this.chart = null
|
||||
console.log(val)
|
||||
// console.log(val)
|
||||
this.drawLine()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ export default {
|
|||
}
|
||||
]
|
||||
};
|
||||
console.log('radar',this.option, this.chart)
|
||||
// console.log('radar',this.option, this.chart)
|
||||
this.chart.setOption(option);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -59,7 +59,7 @@ export default {
|
|||
}
|
||||
if (list) {
|
||||
for(var i = 0; i < list.length; i++) {
|
||||
console.log(list[i]['typeCode'].indexOf('a'))
|
||||
// console.log(list[i]['typeCode'].indexOf('a'))
|
||||
if (list[i]['typeCode'].indexOf('a') === 0) {
|
||||
this.templist['alarm'].push({ value: list[i].alarmTotal, name: list[i].typeName })
|
||||
} else if (list[i]['typeCode'].indexOf('w') === 0) {
|
||||
|
@ -67,7 +67,7 @@ export default {
|
|||
}
|
||||
}
|
||||
}
|
||||
console.log(this.templist)
|
||||
// console.log(this.templist)
|
||||
this.updateEcharts()
|
||||
},
|
||||
deep: true
|
||||
|
|
|
@ -107,7 +107,9 @@ export default {
|
|||
this.thisScrollTopY = document.getElementById("con_lf_top_div").scrollTop;
|
||||
document.getElementById("con_lf_top_div").style.background = "#010a31";
|
||||
document.getElementById("con_lf_top_div").style.height =
|
||||
"calc(100vh - 84px)";
|
||||
"calc(100vh - 0px)";
|
||||
document.getElementById("con_lf_top_div").style.minHeight =
|
||||
"calc(100vh - 0px)";
|
||||
document.getElementById("con_lf_top_div").style.overflow = "hidden";
|
||||
document.getElementById("con_lf_top_div").scrollTop = 0;
|
||||
window.addEventListener("resize", () => {
|
||||
|
@ -181,7 +183,7 @@ export default {
|
|||
if (this.fullscreen) {
|
||||
w_height = Number(document.documentElement.clientHeight / 1080);
|
||||
} else {
|
||||
w_height = Number(document.documentElement.clientHeight / 1186);
|
||||
w_height = Number(document.documentElement.clientHeight / 1080);
|
||||
}
|
||||
this.scalseNum = w_height;
|
||||
},
|
||||
|
@ -224,7 +226,7 @@ export default {
|
|||
<style lang="scss">
|
||||
.big-v1-wrap {
|
||||
width: 100%;
|
||||
height: calc(100vh - 85px);
|
||||
height: calc(100vh - 0px);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
background-image: url("../../../assets/images/big/bigpg_v2.jpg");
|
||||
|
@ -272,7 +274,7 @@ export default {
|
|||
}
|
||||
.app-main {
|
||||
width: 100%;
|
||||
height: calc(100vh - 100px);
|
||||
height: calc(100vh - 0);
|
||||
// background: #021c80;
|
||||
}
|
||||
.big-v1-wrap {
|
||||
|
|
|
@ -105,7 +105,7 @@ export default {
|
|||
}
|
||||
]
|
||||
};
|
||||
console.log('radar',this.option, this.chart)
|
||||
// console.log('radar',this.option, this.chart)
|
||||
this.chart.setOption(option);
|
||||
}
|
||||
},
|
||||
|
|
|
@ -60,7 +60,7 @@ export default {
|
|||
}
|
||||
if (list) {
|
||||
for(var i = 0; i < list.length; i++) {
|
||||
console.log(list[i]['typeCode'].indexOf('a'))
|
||||
// console.log(list[i]['typeCode'].indexOf('a'))
|
||||
if (list[i]['typeCode'].indexOf('a') === 0) {
|
||||
this.templist['alarm'].push({ value: list[i].alarmTotal, name: list[i].typeName })
|
||||
} else if (list[i]['typeCode'].indexOf('w') === 0) {
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
:sourceId="deviceId"
|
||||
:deviceInfo="infoData"
|
||||
:prodId="infoData.prodKey"
|
||||
:wsUrl="iotWebSocketBaseUrl"
|
||||
></device-run-starts-wrap>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
@ -54,6 +55,7 @@ import { getDevice } from "@/api/iot/device";
|
|||
import InfoWrap from "./info";
|
||||
import ChildDevice from "./childDevice";
|
||||
import DeviceRunStartsWrap from "@/views/profile/DeviceRunStarts/index";
|
||||
import { iotWebSocketBaseUrl } from "@/config/env";
|
||||
import TriggerWrap from "@/views/profile/DeviceTrigger/index";
|
||||
export default {
|
||||
name: "DetailsWrap",
|
||||
|
@ -67,6 +69,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
infoData: {},
|
||||
iotWebSocketBaseUrl,
|
||||
activeName: "runingState",
|
||||
breadcrumbList: [],
|
||||
tempType: "bs",
|
||||
|
|
|
@ -168,6 +168,14 @@
|
|||
<el-input v-model="form.modelName" placeholder="请输入型号名称" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="产品json:" prop="prodJson" v-if="form.protocolType === 'OFFICIAL'">
|
||||
<el-input v-model="form.prodJson" type="textarea" :rows="5" placeholder="请输入产品json" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="分组json:" prop="remark" v-if="form.protocolType === 'OFFICIAL'">
|
||||
<el-input v-model="form.remark" type="textarea" :rows="5" placeholder="请输入分组json" />
|
||||
</el-form-item>
|
||||
|
||||
|
||||
<el-form-item label="设备类型:" prop="deviceType">
|
||||
<el-select
|
||||
|
@ -610,7 +618,8 @@ export default {
|
|||
prodKey: "",
|
||||
deviceType: "",
|
||||
paramList: [],
|
||||
protocolType: 'IOTOS'
|
||||
protocolType: 'IOTOS',
|
||||
prodJson: ''
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
|
|
@ -862,8 +862,6 @@ export default {
|
|||
if (this.temp.model) {
|
||||
this.temp.modelName = this.temp.model.modelName
|
||||
this.getcomdlist(this.temp.model.modelId);
|
||||
} else {
|
||||
console.log('型号参数错误!')
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
|
|
|
@ -200,7 +200,7 @@ export default {
|
|||
rouetParams["tempType"] && rouetParams["tempType"] !== "list"
|
||||
? "DetailsWrap"
|
||||
: "";
|
||||
console.log(rouetParams);
|
||||
// console.log(rouetParams);
|
||||
},
|
||||
sortChange(column) {
|
||||
const sort = {
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
:sourceId="deviceId"
|
||||
:deviceInfo="infoData"
|
||||
:prodId="infoData.prodKey"
|
||||
:wsUrl="iotWebSocketBaseUrl"
|
||||
></device-run-starts-wrap>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
@ -49,6 +50,7 @@ import { getDevice } from "@/api/personal/device";
|
|||
import InfoWrap from "./info";
|
||||
import ChildDevice from "./childDevice";
|
||||
import DeviceRunStartsWrap from "@/views/profile/DeviceRunStarts/index";
|
||||
import { iotWebSocketBaseUrl } from "@/config/env";
|
||||
export default {
|
||||
name: "DetailsWrap",
|
||||
props: ["sourceId"],
|
||||
|
@ -60,6 +62,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
infoData: {},
|
||||
iotWebSocketBaseUrl,
|
||||
activeName: "runingState",
|
||||
breadcrumbList: [],
|
||||
tempType: "bs",
|
||||
|
|
|
@ -468,7 +468,7 @@ export default {
|
|||
this.dialogVisible = true;
|
||||
},
|
||||
handelDelFile(file) {
|
||||
console.log(file);
|
||||
// console.log(file);
|
||||
this.pictures.splice(this.pictures.indexOf(file), 1);
|
||||
},
|
||||
uploud(file) {
|
||||
|
|
|
@ -9,34 +9,41 @@
|
|||
"
|
||||
>
|
||||
<div class="nav-p-dev">
|
||||
<!-- <el-radio
|
||||
v-model="checkobxDeviceId"
|
||||
style="margin-right: 10px"
|
||||
:label="deviceInfo.deviceId"
|
||||
>
|
||||
{{
|
||||
deviceInfo.deviceId === checkobxDeviceId ? "已选择" : "未选择"
|
||||
}}</el-radio
|
||||
> -->
|
||||
<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-success"
|
||||
style="
|
||||
font-size: 25px;
|
||||
color: #1890ff;
|
||||
position: relative;
|
||||
top: 5px;
|
||||
z-index: 100;
|
||||
right: 8px;
|
||||
"
|
||||
style="font-size: 25px; color: #1890ff"
|
||||
></i>
|
||||
</div>
|
||||
<div class="dev-info">
|
||||
|
@ -84,55 +91,48 @@
|
|||
:key="item.deviceId"
|
||||
>
|
||||
<div class="nav-c-dev">
|
||||
<!-- <el-radio
|
||||
v-model="checkobxDeviceId"
|
||||
:label="item.deviceId"
|
||||
style="margin-right: 10px"
|
||||
>
|
||||
{{ item.deviceId === checkobxDeviceId ? "已选择" : "未选择" }}
|
||||
</el-radio> -->
|
||||
<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;
|
||||
">
|
||||
<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;
|
||||
position: relative;
|
||||
top: 5px;
|
||||
z-index: 100;
|
||||
right: 8px;
|
||||
"
|
||||
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">
|
||||
<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 type="danger" v-else-if="item.deviceState === 'OFFLINE'"
|
||||
>离线</el-tag
|
||||
>
|
||||
<el-tag
|
||||
type="danger"
|
||||
v-else-if="item.deviceState === 'OUTLINE'"
|
||||
<el-tag type="danger" v-else-if="item.deviceState === 'OUTLINE'"
|
||||
>脱线</el-tag
|
||||
>
|
||||
<el-tag
|
||||
type="info"
|
||||
v-else-if="item.deviceState === 'UNACTIVE'"
|
||||
<el-tag type="info" v-else-if="item.deviceState === 'UNACTIVE'"
|
||||
>未激活</el-tag
|
||||
>
|
||||
<el-button
|
||||
|
@ -142,7 +142,10 @@
|
|||
>查看</el-button
|
||||
>
|
||||
</div>
|
||||
<div class="dev-info-state" v-show="item.deviceId === checkobxDeviceId">
|
||||
<div
|
||||
class="dev-info-state"
|
||||
v-show="item.deviceId === checkobxDeviceId"
|
||||
>
|
||||
<el-switch
|
||||
size="mini"
|
||||
v-model="item.switch"
|
||||
|
@ -188,9 +191,13 @@
|
|||
|
||||
<script>
|
||||
import { listDevice, setSwitchControl } from "@/api/iot/device";
|
||||
import { iotWebSocketBaseUrl } from "@/config/env";
|
||||
import { iotWebSocketBaseUrl, devLiveWebSocketBaseUrl } from "@/config/env";
|
||||
import SignalIntensity from "./signalIntensity";
|
||||
export default {
|
||||
name: "DeviceSelectNav",
|
||||
components: {
|
||||
SignalIntensity,
|
||||
},
|
||||
props: {
|
||||
deviceInfo: {
|
||||
type: Object,
|
||||
|
@ -212,6 +219,7 @@ export default {
|
|||
stompClient: null,
|
||||
socket_flag: true,
|
||||
setTimeOut_flag: null,
|
||||
timingPingWs_flag: null,
|
||||
// wsDeviceInfo: null?
|
||||
};
|
||||
},
|
||||
|
@ -221,16 +229,24 @@ export default {
|
|||
watch: {
|
||||
wsDeviceInfo: {
|
||||
handler: function () {
|
||||
this.timingPingWs(this.wsDeviceInfo);
|
||||
if (this.deviceInfo.deviceId !== this.wsDeviceInfo.deviceId) {
|
||||
for(let i =0; i < this.childDeviceList.length; i++) {
|
||||
if (this.childDeviceList[i]['deviceId'] === this.wsDeviceInfo['deviceId']) {
|
||||
this.childDeviceList[i]['switch'] = this.wsDeviceInfo['switch'].toString();
|
||||
this.$forceUpdate()
|
||||
for (let i = 0; i < this.childDeviceList.length; i++) {
|
||||
if (
|
||||
this.childDeviceList[i]["deviceId"] ===
|
||||
this.wsDeviceInfo["deviceId"]
|
||||
) {
|
||||
this.childDeviceList[i]["switch"] =
|
||||
this.wsDeviceInfoswitch?.switch.toString();
|
||||
this.$forceUpdate();
|
||||
break;
|
||||
}
|
||||
}
|
||||
// this.timingPingWs(this.wsDeviceInfo);
|
||||
// 更换设备 开启ws
|
||||
this.connection();
|
||||
} else {
|
||||
this.connection();
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
|
@ -244,6 +260,20 @@ export default {
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
signalType(val) {
|
||||
switch (val) {
|
||||
case "5G":
|
||||
return "iconfont icona-5G";
|
||||
case "4G":
|
||||
return "iconfont icon4g";
|
||||
case "3G":
|
||||
return "iconfont icon3g";
|
||||
case "2G":
|
||||
return "iconfont icong";
|
||||
default:
|
||||
return "iconfont icong";
|
||||
}
|
||||
},
|
||||
// ws 获取子设备 状态
|
||||
connection() {
|
||||
if (this.stompClient) {
|
||||
|
@ -252,7 +282,7 @@ export default {
|
|||
if (!this.wsDeviceInfo) {
|
||||
return;
|
||||
}
|
||||
if (!iotWebSocketBaseUrl) {
|
||||
if (!devLiveWebSocketBaseUrl) {
|
||||
return;
|
||||
}
|
||||
let headers = {
|
||||
|
@ -260,9 +290,9 @@ export default {
|
|||
username: this.wsDeviceInfo.wsUsername,
|
||||
sign: this.wsDeviceInfo.wsSign,
|
||||
};
|
||||
console.log("connection:--");
|
||||
// console.log("connection:--");
|
||||
this.stompClient = new WebSocket(
|
||||
`${iotWebSocketBaseUrl}${headers.clientid}/${headers.username}/${headers.sign}`
|
||||
`${devLiveWebSocketBaseUrl}${headers.clientid}/${headers.username}/${headers.sign}`
|
||||
);
|
||||
this.socket_flag = true;
|
||||
this.stompClient.onopen = this.socket_open;
|
||||
|
@ -273,20 +303,26 @@ export default {
|
|||
console.log("ws-open:", evt);
|
||||
},
|
||||
socket_onmsg(evt) {
|
||||
this.handlerWsMsgData(JSON.parse(evt.data))
|
||||
this.handlerWsMsgData(JSON.parse(evt.data));
|
||||
},
|
||||
handlerWsMsgData(evt) {
|
||||
console.log('msg:', evt)
|
||||
for(let i =0; i < this.childDeviceList.length; i++) {
|
||||
if (this.childDeviceList[i]['deviceKey'] === evt['devId']) {
|
||||
this.childDeviceList[i]['switch'] = evt['params']['switch'].toString();
|
||||
this.$forceUpdate()
|
||||
// console.log("msg:", 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.$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';
|
||||
}
|
||||
},
|
||||
socket_onclose(e) {
|
||||
console.log("socket_onclose:--", e, this.stompClient);
|
||||
// console.log("socket_onclose:--", e, this.stompClient);
|
||||
this.stompClient = null;
|
||||
if (this.socket_flag) {
|
||||
this.socket_flag = false;
|
||||
|
@ -299,26 +335,52 @@ export default {
|
|||
},
|
||||
// 销毁事件
|
||||
closeWebscoket() {
|
||||
console.log(this.stompClient)
|
||||
// console.log(this.stompClient);
|
||||
this.socket_flag = false;
|
||||
if (this.stompClient) {
|
||||
console.log('we-close---')
|
||||
console.log("we-close---");
|
||||
this.stompClient.close();
|
||||
}
|
||||
this.stompClient = null;
|
||||
clearInterval(this.timingPingWs_flag);
|
||||
clearTimeout(this.setTimeOut_flag);
|
||||
},
|
||||
// 定时 ping ws
|
||||
timingPingWs(row) {
|
||||
this.extenSubmit(row)
|
||||
const _this = this;
|
||||
this.timingPingWs_flag = setInterval(function () {
|
||||
_this.extenSubmit(row)
|
||||
}, 5000);
|
||||
},
|
||||
extenSubmit(row) {
|
||||
let params = {
|
||||
data: {
|
||||
cmd: "set_live_time",
|
||||
params: {
|
||||
ltime: 10,
|
||||
dtime: 1200,
|
||||
},
|
||||
},
|
||||
deviceId: row.deviceId,
|
||||
};
|
||||
setSwitchControl(params).then((res) => {
|
||||
console.log(res)
|
||||
// this.msgSuccess("成功");
|
||||
});
|
||||
},
|
||||
// 点击子设备 线路开关
|
||||
submitChildStatus(type, row) {
|
||||
this.$prompt("请输入登录密码", "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
inputPattern: /^[a-z A-z 0-9 $.]+/,
|
||||
inputType: 'password',
|
||||
inputType: "password",
|
||||
inputErrorMessage: "登录密码不能为空",
|
||||
}).then(({ value }) => {
|
||||
let params = {
|
||||
data: {
|
||||
cmd: "set_switch",
|
||||
params: {
|
||||
switch: type === "true" ? 1 : 0,
|
||||
},
|
||||
|
@ -326,9 +388,9 @@ export default {
|
|||
deviceId: row.deviceId,
|
||||
verifyKey: value,
|
||||
};
|
||||
console.log(params);
|
||||
|
||||
setSwitchControl(params).then((res) => {
|
||||
console.log(res);
|
||||
// console.log(res);
|
||||
this.msgSuccess("修改成功");
|
||||
});
|
||||
});
|
||||
|
@ -339,15 +401,6 @@ export default {
|
|||
this.checkobxDeviceId = id;
|
||||
// 销毁当前ws
|
||||
this.closeWebscoket();
|
||||
if (this.deviceInfo.deviceId !== id) {
|
||||
// 更换设备 开启ws
|
||||
// this.connection()
|
||||
// let resArr = this.childDeviceList.filter((item) => {
|
||||
// return item.deviceId === id
|
||||
// })
|
||||
// this.wsDeviceInfo = resArr.shift()
|
||||
// this.connection()
|
||||
}
|
||||
this.$emit("changeEvent", { val: id });
|
||||
}
|
||||
},
|
||||
|
@ -360,6 +413,9 @@ export default {
|
|||
});
|
||||
},
|
||||
},
|
||||
destroyed() {
|
||||
this.closeWebscoket()
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div class="iot-circuit-breaker-details-warp">
|
||||
<device-select 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">
|
||||
|
@ -19,6 +19,7 @@
|
|||
<state-management
|
||||
v-if="devudeRunState"
|
||||
:deviceInfo="infoData"
|
||||
:realTimeData="realTimeData"
|
||||
></state-management>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
@ -41,7 +42,6 @@
|
|||
import { getDevice } from "@/api/iot/device";
|
||||
import InfoWrap from "./info";
|
||||
import StateManagement from "./stateManagement";
|
||||
import DeviceRunStartsWrap from "@/views/profile/DeviceRunStarts/index";
|
||||
import TriggerWrap from "@/views/profile/DeviceTrigger/index";
|
||||
import DeviceSelect from './deviceSelectNav'
|
||||
export default {
|
||||
|
@ -50,7 +50,6 @@ export default {
|
|||
components: {
|
||||
InfoWrap,
|
||||
StateManagement,
|
||||
DeviceRunStartsWrap,
|
||||
TriggerWrap,
|
||||
DeviceSelect
|
||||
},
|
||||
|
@ -62,7 +61,8 @@ export default {
|
|||
breadcrumbList: [],
|
||||
tempType: "bs",
|
||||
deviceId: "",
|
||||
devudeRunState: false
|
||||
devudeRunState: false,
|
||||
realTimeData: null
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
@ -70,6 +70,9 @@ export default {
|
|||
this.deviceInfo();
|
||||
},
|
||||
methods: {
|
||||
wsRealTImeMsg(data) {
|
||||
this.realTimeData = Object.assign(data)
|
||||
},
|
||||
viewDeviceChange(row) {
|
||||
this.deviceId = row.val;
|
||||
this.deviceInfo(row.val === this.pInfo.deviceId ? null : 'children')
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
<template>
|
||||
<div class="signal-intensity-view">
|
||||
<div class="box">
|
||||
<span class="wifi-icon strength-no strength-3">
|
||||
<span v-for="idx in list" :key="idx" :style="signalIntensity(idx) ? 'background: #07eb58': ''"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "SignalIntensity",
|
||||
props: {
|
||||
intensityNumber: {
|
||||
type: [String,Number],
|
||||
default: '0'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: 5
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
signalIntensity(idx){
|
||||
return Number(this.intensityNumber) ? Number(this.intensityNumber) >= idx : false
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.signal-intensity-view {
|
||||
width: 23px;
|
||||
align-content: baseline;
|
||||
align-items: flex-end;
|
||||
display: flex;
|
||||
height: 21px;
|
||||
.box {
|
||||
width: 100%;
|
||||
> span {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
height: 15px;
|
||||
|
||||
>span {
|
||||
width: 3px;
|
||||
border-radius: 5px;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
span:nth-child(1) {
|
||||
height: 20%;
|
||||
left: 0px;
|
||||
}
|
||||
span:nth-child(2) {
|
||||
height: 40%;
|
||||
left: 10px;
|
||||
}
|
||||
span:nth-child(3) {
|
||||
height: 60%;
|
||||
left: 20px;
|
||||
}
|
||||
span:nth-child(4) {
|
||||
height: 80%;
|
||||
left: 30px;
|
||||
}
|
||||
span:nth-child(5) {
|
||||
height: 100%;
|
||||
left: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -5,12 +5,15 @@
|
|||
:sourceId="deviceInfo.deviceId"
|
||||
:deviceInfo="deviceInfo"
|
||||
:prodId="deviceInfo.prodKey"
|
||||
:wsUrl="iotWebSocketBaseUrl"
|
||||
:realTimeData="realTimeData"
|
||||
></device-run-starts-wrap>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import DeviceRunStartsWrap from "@/views/profile/DeviceRunStarts/index";
|
||||
import { iotWebSocketBaseUrl } from "@/config/env";
|
||||
import DeviceSelect from './deviceSelectNav'
|
||||
export default {
|
||||
name: "StateManagement",
|
||||
|
@ -24,10 +27,17 @@ export default {
|
|||
default: () => {
|
||||
return {};
|
||||
},
|
||||
},
|
||||
realTimeData: {
|
||||
type: String,
|
||||
default: () => {
|
||||
return "{}";
|
||||
},
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
iotWebSocketBaseUrl,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
|
@ -71,7 +71,7 @@ import { iotWebSocketBaseUrl } from "@/config/env";
|
|||
import RunStateTable from "./table";
|
||||
export default {
|
||||
name: "RunStartsWrap",
|
||||
props: ["prodId", "sourceId", "deviceInfo"],
|
||||
props: ["prodId", "sourceId", "deviceInfo", 'wsUrl', 'realTimeData'],
|
||||
components: {
|
||||
RunStateTable,
|
||||
},
|
||||
|
@ -109,7 +109,7 @@ export default {
|
|||
if (this.stompClient) {
|
||||
return;
|
||||
}
|
||||
if (!iotWebSocketBaseUrl) {
|
||||
if (!this.wsUrl) {
|
||||
return;
|
||||
}
|
||||
// let locahostUrl = 'ws://192.168.18.138/device/ws/dev/send/'
|
||||
|
@ -119,7 +119,7 @@ export default {
|
|||
sign: this.deviceInfo.wsSign,
|
||||
};
|
||||
this.stompClient = new WebSocket(
|
||||
`${iotWebSocketBaseUrl}${headers.clientid}/${headers.username}/${headers.sign}`
|
||||
`${this.wsUrl}${headers.clientid}/${headers.username}/${headers.sign}`
|
||||
);
|
||||
this.stompClient.onmessage = this.socket_onmsg;
|
||||
this.stompClient.onclose = this.socket_onclose;
|
||||
|
@ -232,6 +232,12 @@ export default {
|
|||
// this.connection()
|
||||
}
|
||||
},
|
||||
realTimeData: {
|
||||
handler: function () {
|
||||
this.setListData(this.realTimeData)
|
||||
},
|
||||
deep: true,
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>-
|
||||
|
|
|
@ -203,7 +203,7 @@ export default {
|
|||
reultEventFu() {
|
||||
this.form.guid = this.tempIndex;
|
||||
this.returnIsSumbit();
|
||||
console.log(this.form);
|
||||
// console.log(this.form);
|
||||
this.$emit("resultEvent", { result: this.form, index: this.tempIndex });
|
||||
},
|
||||
returnIsSumbit() {
|
||||
|
|
|
@ -619,7 +619,7 @@ export default {
|
|||
// 勾选数据保存操作
|
||||
submitFileForm() {
|
||||
// 目前从选择到逻辑都是没有问题的,数据都到位了,就差接口
|
||||
console.log(this.otherOption["inputType"], ":", this.childIds);
|
||||
// console.log(this.otherOption["inputType"], ":", this.childIds);
|
||||
} /** 修改按钮操作 */,
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
|
@ -661,7 +661,7 @@ export default {
|
|||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
console.log(row);
|
||||
// console.log(row);
|
||||
const tenantIds = row.tenantId || this.ids;
|
||||
this.$confirm(
|
||||
// '是否确认删除序号为"' + tenantIds + '"的数据项?',
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
:sourceId="deviceId"
|
||||
:deviceInfo="infoData"
|
||||
:prodId="infoData.prodKey"
|
||||
:wsUrl="iotWebSocketBaseUrl"
|
||||
></device-run-starts-wrap>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
@ -54,6 +55,7 @@ import { getDevice } from "@/api/tenant/device";
|
|||
import InfoWrap from "./info";
|
||||
import ChildDevice from "./childDevice";
|
||||
import DeviceRunStartsWrap from "@/views/profile/DeviceRunStarts/index";
|
||||
import { iotWebSocketBaseUrl } from "@/config/env";
|
||||
import TriggerWrap from "@/views/profile/DeviceTrigger/index";
|
||||
export default {
|
||||
name: "DetailsWrap",
|
||||
|
@ -71,7 +73,8 @@ export default {
|
|||
breadcrumbList: [],
|
||||
tempType: "bs",
|
||||
deviceId: "",
|
||||
devudeRunState: false
|
||||
devudeRunState: false,
|
||||
iotWebSocketBaseUrl
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
|
|
@ -40,7 +40,7 @@ export default {
|
|||
},
|
||||
/** 查询空间设备列表 */
|
||||
getList() {
|
||||
console.log(this.sourceId)
|
||||
// console.log(this.sourceId)
|
||||
this.loading = true;
|
||||
listDeviceByProjectId(this.sourceId).then(response => {
|
||||
this.list = response.data;
|
||||
|
|
Loading…
Reference in New Issue