This commit is contained in:
parent
11029b223e
commit
2e45cfeab5
|
|
@ -939,14 +939,17 @@ export default {
|
|||
clgl_wdyml: this.ruleForm1.clgl_wdyml,
|
||||
};
|
||||
//拿缓存数据
|
||||
var json = JSON.parse(sessionStorage.getItem("GYWZ_yx"));
|
||||
var json = JSON.parse(sessionStorage.getItem(this.$store.state.type));
|
||||
let { data } = await SaveUserAnswer({
|
||||
mark: `${this.$store.state.type}`,
|
||||
user_id: `${this.$route.query.id}`,
|
||||
mark_value: JSON.stringify({ ...json, ...obj }),
|
||||
});
|
||||
if (data.state) {
|
||||
sessionStorage.setItem("GYWZ_yx", JSON.stringify({ ...json, ...obj }));
|
||||
sessionStorage.setItem(
|
||||
this.$store.state.type,
|
||||
JSON.stringify({ ...json, ...obj })
|
||||
);
|
||||
this.$message({
|
||||
message: "缓存成功",
|
||||
type: "success",
|
||||
|
|
@ -1024,7 +1027,7 @@ export default {
|
|||
cmdlist_dz: this.ruleForm2.cmdlist_dz,
|
||||
};
|
||||
//拿缓存数据
|
||||
var json = JSON.parse(sessionStorage.getItem("GYWZ_yx"));
|
||||
var json = JSON.parse(sessionStorage.getItem(this.$store.state.type));
|
||||
let { data } = await SaveUserAnswer({
|
||||
mark: `${this.$store.state.type}`,
|
||||
user_id: `${this.$route.query.id}`,
|
||||
|
|
@ -1032,7 +1035,10 @@ export default {
|
|||
});
|
||||
if (data.state) {
|
||||
this.tableData1 = [obj];
|
||||
sessionStorage.setItem("GYWZ_yx", JSON.stringify({ ...json, ...obj }));
|
||||
sessionStorage.setItem(
|
||||
this.$store.state.type,
|
||||
JSON.stringify({ ...json, ...obj })
|
||||
);
|
||||
this.flag = false;
|
||||
this.$message({
|
||||
message: "新增成功",
|
||||
|
|
@ -1045,14 +1051,14 @@ export default {
|
|||
//删除命令
|
||||
async handleDel(index, row) {
|
||||
this.tableData1 = [];
|
||||
let obj = JSON.parse(sessionStorage.getItem("GYWZ_yx"));
|
||||
let obj = JSON.parse(sessionStorage.getItem(this.$store.state.type));
|
||||
obj.cmdlist_ml = "";
|
||||
obj.cmdlist_sbid = "";
|
||||
obj.cmdlist_qsdz = "";
|
||||
obj.cmdlist_dzcd = "";
|
||||
obj.cmdlist_ms = "";
|
||||
obj.cmdlist_dz = "";
|
||||
localStorage.setItem("GYWZ_yx", JSON.stringify(obj));
|
||||
localStorage.setItem(this.$store.state.type, JSON.stringify(obj));
|
||||
let { data } = await SaveUserAnswer({
|
||||
mark: `${this.$store.state.type}`,
|
||||
user_id: `${this.$route.query.id}`,
|
||||
|
|
|
|||
|
|
@ -2,15 +2,31 @@
|
|||
<template>
|
||||
<div>
|
||||
<div class="tree_menu" v-show="dialogVisible">
|
||||
<el-tree :data="trees" node-key="id" :props="defaultProps" default-expand-all @node-contextmenu="rightClick"
|
||||
@node-click="treeNodeClick" ref="tree">
|
||||
<el-tree
|
||||
:data="trees"
|
||||
node-key="id"
|
||||
:props="defaultProps"
|
||||
default-expand-all
|
||||
@node-contextmenu="rightClick"
|
||||
@node-click="treeNodeClick"
|
||||
ref="tree"
|
||||
>
|
||||
<!-- :render-content="renderContent" -->
|
||||
<span class="custom-tree-node" slot-scope="{ node, data }">
|
||||
<template v-if="data.editing == 1">
|
||||
<el-button type="mini" v-if="flag" style="right: 50px; top: 0; position: absolute; border: none"
|
||||
@click.stop="done">完成</el-button>
|
||||
<el-button type="mini" style="right: 0; top: 0; position: absolute; border: none"
|
||||
@click.stop="edit">编辑</el-button>
|
||||
<el-button
|
||||
type="mini"
|
||||
v-if="flag"
|
||||
style="right: 50px; top: 0; position: absolute; border: none"
|
||||
@click.stop="done"
|
||||
>完成</el-button
|
||||
>
|
||||
<el-button
|
||||
type="mini"
|
||||
style="right: 0; top: 0; position: absolute; border: none"
|
||||
@click.stop="edit"
|
||||
>编辑</el-button
|
||||
>
|
||||
<span v-if="!flag">{{ data.label }}</span>
|
||||
<el-input v-else style="width: 150px" v-model="gateway"></el-input>
|
||||
</template>
|
||||
|
|
@ -19,7 +35,11 @@
|
|||
</el-tree>
|
||||
<!-- 树形控件右键组件 -->
|
||||
<div v-show="menuShow" class="tree_rightmenu" :style="{ ...rightMenu }">
|
||||
<el-menu class="el-menu-vertical-demo" @select="selectMenuNode" default-active="#0078FE">
|
||||
<el-menu
|
||||
class="el-menu-vertical-demo"
|
||||
@select="selectMenuNode"
|
||||
default-active="#0078FE"
|
||||
>
|
||||
<el-menu-item id="menuitem" index="1" style="font-size: 12px">
|
||||
<span slot="title">新建设备</span>
|
||||
</el-menu-item>
|
||||
|
|
@ -35,14 +55,36 @@
|
|||
<!-- </div> -->
|
||||
<!-- 网口设备 -->
|
||||
<div class="pas_params">
|
||||
<el-dialog title="设备属性" :visible.sync="add_passage" width="382px" v-loading="loading">
|
||||
<el-form :model="formdata" :label-position="labelPosition" :rules="rules" ref="formdata">
|
||||
<el-dialog
|
||||
title="设备属性"
|
||||
:visible.sync="add_passage"
|
||||
width="382px"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-form
|
||||
:model="formdata"
|
||||
:label-position="labelPosition"
|
||||
:rules="rules"
|
||||
ref="formdata"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="设备ID:" :label-width="formLabelWidth" prop="sbpz_sbid">
|
||||
<el-select v-model="formdata.sbpz_sbid" placeholder="" style="width: 200px; height: 30px">
|
||||
<el-option v-for="(item, index) in options1" :key="index" :label="item.label"
|
||||
:value="item.value">
|
||||
<el-form-item
|
||||
label="设备ID:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="sbpz_sbid"
|
||||
>
|
||||
<el-select
|
||||
v-model="formdata.sbpz_sbid"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in options1"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -50,10 +92,22 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="设备名称:" :label-width="formLabelWidth" prop="sbpz_sbmc">
|
||||
<el-select v-model="formdata.sbpz_sbmc" placeholder="" style="width: 200px; height: 30px">
|
||||
<el-option v-for="(item, index) in options2" :key="index" :label="item.label"
|
||||
:value="item.value">
|
||||
<el-form-item
|
||||
label="设备名称:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="sbpz_sbmc"
|
||||
>
|
||||
<el-select
|
||||
v-model="formdata.sbpz_sbmc"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in options2"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
|
@ -61,9 +115,16 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="MAC地址:" :label-width="formLabelWidth" prop="sbpz_mac">
|
||||
<el-input v-model="formdata.sbpz_mac" placeholder=""
|
||||
style="width: 200px; height: 30px"></el-input>
|
||||
<el-form-item
|
||||
label="MAC地址:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="sbpz_mac"
|
||||
>
|
||||
<el-input
|
||||
v-model="formdata.sbpz_mac"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
|
@ -265,8 +326,8 @@ export default {
|
|||
this.$refs["tree"].remove(this.nodekey);
|
||||
this.sendTree();
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
message: "删除成功",
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
@ -294,7 +355,7 @@ export default {
|
|||
sbpz_mac: this.formdata.sbpz_mac,
|
||||
sbpz_jysb: String(Number(this.formdata.sbpz_jysb)),
|
||||
sbpz_jdzxz: String(Number(this.formdata.sbpz_jdzxz)),
|
||||
}
|
||||
};
|
||||
datas = { ...JSON.parse(datas), ...obj };
|
||||
this.add_passage = false;
|
||||
let res = await SaveUserAnswer({
|
||||
|
|
@ -304,17 +365,20 @@ export default {
|
|||
});
|
||||
if (res.status == 200) {
|
||||
this.$message({
|
||||
message: '保存成功',
|
||||
type: 'success'
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
}
|
||||
sessionStorage.setItem("DB-IotLite_wx", JSON.stringify(datas));
|
||||
// console.log(res);
|
||||
// console.log(JSON.parse(res.data.data.mark_value));
|
||||
this.$refs["tree"].append({
|
||||
this.$refs["tree"].append(
|
||||
{
|
||||
id: this.nodekey + 10000,
|
||||
label: this.formdata.sbpz_sbmc,
|
||||
}, this.nodekey);
|
||||
},
|
||||
this.nodekey
|
||||
);
|
||||
// console.log(this.trees);
|
||||
this.sendTree();
|
||||
this.$router.push(`/dbwificollect?user_id=${this.user_id}`);
|
||||
|
|
@ -323,11 +387,12 @@ export default {
|
|||
let answer = await GetUserAnswer({
|
||||
mark: "DB-IotLite_wx",
|
||||
user_id: this.user_id,
|
||||
})
|
||||
console.log(answer);
|
||||
let obj = JSON.parse(answer.data.data.mark_value);
|
||||
console.log(obj);
|
||||
});
|
||||
// console.log(answer);
|
||||
// console.log(obj);
|
||||
if (obj.sbpz_sbid) {
|
||||
let obj = JSON.parse(answer.data.data.mark_value);
|
||||
|
||||
this.formdata.sbpz_sbid = obj.sbpz_sbid;
|
||||
this.formdata.sbpz_jdzxz = Boolean(Number(obj.sbpz_jdzxz));
|
||||
this.formdata.sbpz_jysb = Boolean(Number(obj.sbpz_jysb));
|
||||
|
|
@ -340,7 +405,7 @@ export default {
|
|||
user_id: this.user_id,
|
||||
data: JSON.stringify(this.trees),
|
||||
type: "2",
|
||||
})
|
||||
});
|
||||
console.log(result);
|
||||
},
|
||||
},
|
||||
|
|
@ -353,7 +418,7 @@ export default {
|
|||
console.log(res);
|
||||
console.log(JSON.parse(res.data.data.data));
|
||||
this.trees = JSON.parse(res.data.data.data);
|
||||
})
|
||||
});
|
||||
this.loading = true;
|
||||
this.GetUserAnswer();
|
||||
this.loading = false;
|
||||
|
|
@ -487,4 +552,3 @@ export default {
|
|||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -255,15 +255,15 @@ export default {
|
|||
created() {
|
||||
let that = this;
|
||||
window.getParameter = that.getParameter;
|
||||
this.wgid = this.$route.fullPath.split("?")[1];
|
||||
this.user_id = this.$route.fullPath.split("?")[1];
|
||||
this.GetUserAnswer();
|
||||
// this.tableData = JSON.parse(localStorage.getItem("wgwh")) || [];
|
||||
},
|
||||
methods: {
|
||||
getParameter(data) {
|
||||
alert(data);
|
||||
this.user_id = data;
|
||||
},
|
||||
// getParameter(data) {
|
||||
// alert(data);
|
||||
// this.user_id = data;
|
||||
// },
|
||||
//读缓存
|
||||
async GetUserAnswer() {
|
||||
let { data } = await GetUserAnswer({
|
||||
|
|
|
|||
|
|
@ -321,7 +321,7 @@ export default {
|
|||
mark_value: JSON.stringify(datas),
|
||||
});
|
||||
console.log(res);
|
||||
if (res.status == 200) {
|
||||
if (res.state) {
|
||||
sessionStorage.setItem("CKFWQ_yx", JSON.stringify(datas));
|
||||
this.$message({
|
||||
message: "保存成功",
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ export default {
|
|||
mark_value: JSON.stringify(datas),
|
||||
});
|
||||
console.log(res);
|
||||
if (res.status == 200) {
|
||||
if (res.state) {
|
||||
sessionStorage.setItem(
|
||||
"CKFWQ_wx",
|
||||
JSON.stringify({ ...datas, ...this.ruleForm })
|
||||
|
|
|
|||
|
|
@ -269,6 +269,8 @@ export default {
|
|||
type: "success",
|
||||
});
|
||||
this.dialogVisible = false;
|
||||
} else {
|
||||
this.$message.error("保存失败");
|
||||
}
|
||||
},
|
||||
//拿缓存
|
||||
|
|
|
|||
|
|
@ -232,7 +232,16 @@ export default {
|
|||
}).then((res) => {
|
||||
console.log(res);
|
||||
});
|
||||
if (data.state) {
|
||||
localStorage.setItem("CKFWQ_yx", JSON.stringify(datas));
|
||||
|
||||
this.$message({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
this.$message.error("错了哦,这是一条错误消息");
|
||||
}
|
||||
},
|
||||
submitForm(formName) {
|
||||
this.$refs["ruleForm"].validate((valid) => {
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ export default {
|
|||
user_id: `${this.user_id}`,
|
||||
mark_value: JSON.stringify(datas),
|
||||
});
|
||||
if (res.status == 200) {
|
||||
if (res.state) {
|
||||
sessionStorage.setItem(
|
||||
"CKFWQ_wx",
|
||||
JSON.stringify({ ...datas, ...this.ruleForm })
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ export default {
|
|||
mark_value: JSON.stringify(datas),
|
||||
});
|
||||
console.log(res);
|
||||
if (res.status == 200) {
|
||||
if (res.state) {
|
||||
sessionStorage.setItem("CKFWQ_wx", JSON.stringify(datas));
|
||||
this.dialogVisible = false;
|
||||
this.$message({
|
||||
|
|
|
|||
|
|
@ -4,44 +4,87 @@
|
|||
|
||||
<div class="db_lite" style="background-color: aqua; height: 100px">
|
||||
<router-link to="/cockpit">驾驶舱</router-link>
|
||||
<!-- <router-link to="/ipsetting">IP设置</router-link> -->
|
||||
<router-link to="/wiredgatewayip">db网关-ip配置-有线网关</router-link>
|
||||
<router-link to="/dbcollectiongate">db有线网关-数据采集配置-有线网关配置</router-link>
|
||||
<router-link to="/channelconfig">db有线网关-数据采集配置-网口通道配置</router-link>
|
||||
<router-link to="/dbcollectdevice">db有线网关-数据采集配置-网口设备配置</router-link>
|
||||
<router-link to="/dbcollect">db有线网关-数据采集配置-网口采集点配置</router-link>
|
||||
<router-link to="/mqttconfig">db有线网关-MQTT上云-网口MQTT1配置</router-link>
|
||||
<router-link to="/dbcollectiongate"
|
||||
>db有线网关-数据采集配置-有线网关配置</router-link
|
||||
>
|
||||
<router-link to="/channelconfig"
|
||||
>db有线网关-数据采集配置-网口通道配置</router-link
|
||||
>
|
||||
<router-link to="/dbcollectdevice"
|
||||
>db有线网关-数据采集配置-网口设备配置</router-link
|
||||
>
|
||||
<router-link to="/dbcollect"
|
||||
>db有线网关-数据采集配置-网口采集点配置</router-link
|
||||
>
|
||||
<router-link to="/mqttconfig"
|
||||
>db有线网关-MQTT上云-网口MQTT1配置</router-link
|
||||
>
|
||||
<!--db无线网关配置 -->
|
||||
<router-link to="/wirelessgatewayip">db网关-ip配置-无线网关</router-link>
|
||||
<router-link to="/dbcollectionwifi">db无线网关-数据采集配置-网关配置配置</router-link>
|
||||
<router-link to="/dbcollectserial">db无线网关-数据采集配置-串口通道配置</router-link>
|
||||
<router-link to="/dbserialdevice">db无线网关-数据采集配置-串口设备配置</router-link>
|
||||
<router-link to="/dbwificollect">db无线网关-数据采集配置-网口采集点配置</router-link>
|
||||
<router-link to="/mqttconfigwifi">db无线网关-MQTT上云-网口MQTT1配置</router-link>
|
||||
<router-link to="/dbcollectionwifi"
|
||||
>db无线网关-数据采集配置-网关配置配置</router-link
|
||||
>
|
||||
<router-link to="/dbcollectserial"
|
||||
>db无线网关-数据采集配置-串口通道配置</router-link
|
||||
>
|
||||
<router-link to="/dbserialdevice"
|
||||
>db无线网关-数据采集配置-串口设备配置</router-link
|
||||
>
|
||||
<router-link to="/dbwificollect"
|
||||
>db无线网关-数据采集配置-网口采集点配置</router-link
|
||||
>
|
||||
<router-link to="/mqttconfigwifi"
|
||||
>db无线网关-MQTT上云-网口MQTT1配置</router-link
|
||||
>
|
||||
</div>
|
||||
<div class="chihou" style="background-color: aqua; height: 100px">
|
||||
<router-link to="/chwiredgatewayip">斥候工业网关-ip配置-有线网关</router-link>
|
||||
<router-link to="/gatewayconfiguration">斥候有线工业网关-数据采集配置-网关配置</router-link>
|
||||
<router-link to="/configuration">斥候有线工业网关-数据采集配置-设备配置</router-link>
|
||||
<router-link to="/collectionpoint">斥候有线工业网关-数据采集配置-采集点配置</router-link>
|
||||
<router-link to="/chmqtt">斥候有线工业网关-数据上云配置-MQTT上云</router-link>
|
||||
<router-link to="/chwiredgatewayip"
|
||||
>斥候工业网关-ip配置-有线网关</router-link
|
||||
>
|
||||
<router-link to="/gatewayconfiguration"
|
||||
>斥候有线工业网关-数据采集配置-网关配置</router-link
|
||||
>
|
||||
<router-link to="/configuration"
|
||||
>斥候有线工业网关-数据采集配置-设备配置</router-link
|
||||
>
|
||||
<router-link to="/collectionpoint"
|
||||
>斥候有线工业网关-数据采集配置-采集点配置</router-link
|
||||
>
|
||||
<router-link to="/chmqtt"
|
||||
>斥候有线工业网关-数据上云配置-MQTT上云</router-link
|
||||
>
|
||||
|
||||
<router-link to="/chwirelessgatewayip">斥候工业网关-ip配置-无线网关</router-link>
|
||||
<router-link to="/chiwifigate">斥候无线工业网关-数据采集配置-网关配置</router-link>
|
||||
<router-link to="/chiwifidevice">斥候无线工业网关-数据采集配置-设备配置</router-link>
|
||||
<router-link to="/chiwificollect">斥候无线工业网关-数据采集配置-采集点配置</router-link>
|
||||
<router-link to="/chiwifimqtt">斥候无线工业网关-数据上云配置-MQTT上云</router-link>
|
||||
<router-link to="/chwirelessgatewayip"
|
||||
>斥候工业网关-ip配置-无线网关</router-link
|
||||
>
|
||||
<router-link to="/chiwifigate"
|
||||
>斥候无线工业网关-数据采集配置-网关配置</router-link
|
||||
>
|
||||
<router-link to="/chiwifidevice"
|
||||
>斥候无线工业网关-数据采集配置-设备配置</router-link
|
||||
>
|
||||
<router-link to="/chiwificollect"
|
||||
>斥候无线工业网关-数据采集配置-采集点配置</router-link
|
||||
>
|
||||
<router-link to="/chiwifimqtt"
|
||||
>斥候无线工业网关-数据上云配置-MQTT上云</router-link
|
||||
>
|
||||
</div>
|
||||
<div class="serial" style="background-color: aqua; height: 100px">
|
||||
<router-link to="/ckipconfig">串口服务器-Ip配置</router-link>
|
||||
<router-link to="/ckportconfig">串口服务器-端口配置</router-link>
|
||||
<router-link to="/towifi">串口服务器-485towifi-串口及网络协议设置</router-link>
|
||||
<router-link to="/towifi"
|
||||
>串口服务器-485towifi-串口及网络协议设置</router-link
|
||||
>
|
||||
<router-link to="/cknet">串口服务器-485towifi-网口配置</router-link>
|
||||
<router-link to="/ckwireless">串口服务器-485towifi-无线配置</router-link>
|
||||
<router-link to="/networkmanagement">工业网闸配置-网络管理</router-link>
|
||||
<router-link to="/objmanagement">工业网闸配置-对象管理</router-link>
|
||||
<router-link to="/strategyManagement">工业网闸配置-策略管理</router-link>
|
||||
<router-link to="/addstrategy">工业网闸配置-策略管理-添加策略</router-link>
|
||||
<router-link to="/addstrategy"
|
||||
>工业网闸配置-策略管理-添加策略</router-link
|
||||
>
|
||||
<router-link to="/ntconfig">网络优化-网关配置</router-link>
|
||||
<router-link to="/ntmaintenance">网络优化-网关维护</router-link>
|
||||
</div>
|
||||
|
|
@ -133,8 +176,15 @@ export default {
|
|||
// },
|
||||
// ])
|
||||
// );
|
||||
|
||||
let that = this;
|
||||
window.getParameter = that.getParameter;
|
||||
},
|
||||
methods: {
|
||||
getParameter(data) {
|
||||
this.$router.push(`/${data}`);
|
||||
},
|
||||
},
|
||||
methods: {},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue