This commit is contained in:
lll 2023-11-11 09:45:20 +08:00
parent 11029b223e
commit 2e45cfeab5
10 changed files with 616 additions and 485 deletions

View File

@ -939,14 +939,17 @@ export default {
clgl_wdyml: this.ruleForm1.clgl_wdyml, 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({ let { data } = await SaveUserAnswer({
mark: `${this.$store.state.type}`, mark: `${this.$store.state.type}`,
user_id: `${this.$route.query.id}`, user_id: `${this.$route.query.id}`,
mark_value: JSON.stringify({ ...json, ...obj }), mark_value: JSON.stringify({ ...json, ...obj }),
}); });
if (data.state) { if (data.state) {
sessionStorage.setItem("GYWZ_yx", JSON.stringify({ ...json, ...obj })); sessionStorage.setItem(
this.$store.state.type,
JSON.stringify({ ...json, ...obj })
);
this.$message({ this.$message({
message: "缓存成功", message: "缓存成功",
type: "success", type: "success",
@ -1024,7 +1027,7 @@ export default {
cmdlist_dz: this.ruleForm2.cmdlist_dz, 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({ let { data } = await SaveUserAnswer({
mark: `${this.$store.state.type}`, mark: `${this.$store.state.type}`,
user_id: `${this.$route.query.id}`, user_id: `${this.$route.query.id}`,
@ -1032,7 +1035,10 @@ export default {
}); });
if (data.state) { if (data.state) {
this.tableData1 = [obj]; 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.flag = false;
this.$message({ this.$message({
message: "新增成功", message: "新增成功",
@ -1045,14 +1051,14 @@ export default {
// //
async handleDel(index, row) { async handleDel(index, row) {
this.tableData1 = []; 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_ml = "";
obj.cmdlist_sbid = ""; obj.cmdlist_sbid = "";
obj.cmdlist_qsdz = ""; obj.cmdlist_qsdz = "";
obj.cmdlist_dzcd = ""; obj.cmdlist_dzcd = "";
obj.cmdlist_ms = ""; obj.cmdlist_ms = "";
obj.cmdlist_dz = ""; obj.cmdlist_dz = "";
localStorage.setItem("GYWZ_yx", JSON.stringify(obj)); localStorage.setItem(this.$store.state.type, JSON.stringify(obj));
let { data } = await SaveUserAnswer({ let { data } = await SaveUserAnswer({
mark: `${this.$store.state.type}`, mark: `${this.$store.state.type}`,
user_id: `${this.$route.query.id}`, user_id: `${this.$route.query.id}`,

View File

@ -1,490 +1,554 @@
<!-- 设备配置----网口设备 --> <!-- 设备配置----网口设备 -->
<template> <template>
<div> <div>
<div class="tree_menu" v-show="dialogVisible"> <div class="tree_menu" v-show="dialogVisible">
<el-tree :data="trees" node-key="id" :props="defaultProps" default-expand-all @node-contextmenu="rightClick" <el-tree
@node-click="treeNodeClick" ref="tree"> :data="trees"
<!-- :render-content="renderContent" --> node-key="id"
<span class="custom-tree-node" slot-scope="{ node, data }"> :props="defaultProps"
<template v-if="data.editing == 1"> default-expand-all
<el-button type="mini" v-if="flag" style="right: 50px; top: 0; position: absolute; border: none" @node-contextmenu="rightClick"
@click.stop="done">完成</el-button> @node-click="treeNodeClick"
<el-button type="mini" style="right: 0; top: 0; position: absolute; border: none" ref="tree"
@click.stop="edit">编辑</el-button> >
<span v-if="!flag">{{ data.label }}</span> <!-- :render-content="renderContent" -->
<el-input v-else style="width: 150px" v-model="gateway"></el-input> <span class="custom-tree-node" slot-scope="{ node, data }">
</template> <template v-if="data.editing == 1">
<template v-else>{{ data.label }}</template> <el-button
</span> type="mini"
</el-tree> v-if="flag"
<!-- 树形控件右键组件 --> style="right: 50px; top: 0; position: absolute; border: none"
<div v-show="menuShow" class="tree_rightmenu" :style="{ ...rightMenu }"> @click.stop="done"
<el-menu class="el-menu-vertical-demo" @select="selectMenuNode" default-active="#0078FE"> >完成</el-button
<el-menu-item id="menuitem" index="1" style="font-size: 12px"> >
<span slot="title">新建设备</span> <el-button
</el-menu-item> type="mini"
<el-menu-item index="2" style="font-size: 12px"> style="right: 0; top: 0; position: absolute; border: none"
<span slot="title"> </span> @click.stop="edit"
</el-menu-item> >编辑</el-button
<el-menu-item index="3" style="font-size: 12px"> >
<span slot="title"> </span> <span v-if="!flag">{{ data.label }}</span>
</el-menu-item> <el-input v-else style="width: 150px" v-model="gateway"></el-input>
</el-menu> </template>
</div> <template v-else>{{ data.label }}</template>
</div> </span>
<!-- </div> --> </el-tree>
<!-- 网口设备 --> <!-- 树形控件右键组件 -->
<div class="pas_params"> <div v-show="menuShow" class="tree_rightmenu" :style="{ ...rightMenu }">
<el-dialog title="设备属性" :visible.sync="add_passage" width="382px" v-loading="loading"> <el-menu
<el-form :model="formdata" :label-position="labelPosition" :rules="rules" ref="formdata"> class="el-menu-vertical-demo"
<el-row> @select="selectMenuNode"
<el-col :span="24"> default-active="#0078FE"
<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-menu-item id="menuitem" index="1" style="font-size: 12px">
<el-option v-for="(item, index) in options1" :key="index" :label="item.label" <span slot="title">新建设备</span>
:value="item.value"> </el-menu-item>
</el-option> <el-menu-item index="2" style="font-size: 12px">
</el-select> <span slot="title"> </span>
</el-form-item> </el-menu-item>
</el-col> <el-menu-item index="3" style="font-size: 12px">
</el-row> <span slot="title"> </span>
<el-row> </el-menu-item>
<el-col :span="24"> </el-menu>
<el-form-item label="设备名称:" :label-width="formLabelWidth" prop="sbpz_sbmc"> </div>
<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>
</el-col>
</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>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item>
<!-- 需要修改的地方 -->
<el-checkbox v-model="formdata.sbpz_jysb">禁用地址</el-checkbox>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="基地址选择:">
<el-switch v-model="formdata.sbpz_jdzxz"> </el-switch>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="add_passage = false"> </el-button>
</span>
</el-dialog>
</div>
</div> </div>
<!-- </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-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-option>
</el-select>
</el-form-item>
</el-col>
</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-option>
</el-select>
</el-form-item>
</el-col>
</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>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item>
<!-- 需要修改的地方 -->
<el-checkbox v-model="formdata.sbpz_jysb">禁用地址</el-checkbox>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="基地址选择:">
<el-switch v-model="formdata.sbpz_jdzxz"> </el-switch>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="add_passage = false"> </el-button>
</span>
</el-dialog>
</div>
</div>
</template> </template>
<script> <script>
import { SaveUserAnswer, GetUserAnswer, GetTree, SendTree } from "@/api/user"; import { SaveUserAnswer, GetUserAnswer, GetTree, SendTree } from "@/api/user";
export default { export default {
name: "DeviceView", name: "DeviceView",
data() { data() {
return { return {
loading: false, loading: false,
flag: false, flag: false,
gateway: "", gateway: "",
user_id: "", user_id: "",
trees: [], trees: [],
formdata: { formdata: {
sbpz_sbid: "", sbpz_sbid: "",
sbpz_sbmc: "", sbpz_sbmc: "",
sbpz_mac: "3C:2D:50:20:30:3D", sbpz_mac: "3C:2D:50:20:30:3D",
sbpz_jysb: false, sbpz_jysb: false,
sbpz_jdzxz: false, sbpz_jdzxz: false,
},
labelPosition: "left",
formLabelWidth: "116px",
input1: 192,
add_passage: false,
rightMenu: "",
dialogVisible: true,
menuShow: false,
options1: [
{
value: "有线区加工设备1",
label: "有线区加工设备1",
},
{
value: "无线区加工设备1",
label: "无线区加工设备1",
},
],
options2: [
{
value: "有线区精雕1",
label: "有线区精雕1",
},
{
value: "无线区精雕1",
label: "无线区精雕1",
},
],
datas: [
{
label: "Gateway",
children: [
{
label: "数据采集",
children: [
{
label: "I/O点",
},
{
label: "用户点",
},
{
label: "计算点",
},
{
label: "系统点",
},
],
}, },
labelPosition: "left", {
formLabelWidth: "116px", label: "用户点",
input1: 192,
add_passage: false,
rightMenu: "",
dialogVisible: true,
menuShow: false,
options1: [
{
value: "有线区加工设备1",
label: "有线区加工设备1",
},
{
value: "无线区加工设备1",
label: "无线区加工设备1",
},
],
options2: [
{
value: "有线区精雕1",
label: "有线区精雕1",
},
{
value: "无线区精雕1",
label: "无线区精雕1",
},
],
datas: [
{
label: "Gateway",
children: [
{
label: "数据采集",
children: [
{
label: "I/O点",
},
{
label: "用户点",
},
{
label: "计算点",
},
{
label: "系统点",
},
],
},
{
label: "用户点",
},
{
label: "计算点",
},
{
label: "系统点",
},
],
},
{
label: "数据服务",
children: [
{
label: "Modbus",
},
],
},
{
label: "IOT",
children: [
{
label: "Mqtt Client",
},
{
label: "Alink",
},
{
label: "Tlink",
},
{
label: "loTDDC",
},
{
label: "Ulink",
},
],
},
],
defaultProps: {
children: "children",
label: "label",
}, },
nodekey: "", {
rules: { label: "计算点",
sbpz_sbid: [
{ required: true, message: "请输入设备ID", trigger: "blur" },
],
sbpz_sbmc: [
{ required: true, message: "请输入设备名称", trigger: "blur" },
],
sbpz_mac: [
{ required: true, message: "请输入设备地址", trigger: "blur" },
],
}, },
}; {
label: "系统点",
},
],
},
{
label: "数据服务",
children: [
{
label: "Modbus",
},
],
},
{
label: "IOT",
children: [
{
label: "Mqtt Client",
},
{
label: "Alink",
},
{
label: "Tlink",
},
{
label: "loTDDC",
},
{
label: "Ulink",
},
],
},
],
defaultProps: {
children: "children",
label: "label",
},
nodekey: "",
rules: {
sbpz_sbid: [
{ required: true, message: "请输入设备ID", trigger: "blur" },
],
sbpz_sbmc: [
{ required: true, message: "请输入设备名称", trigger: "blur" },
],
sbpz_mac: [
{ required: true, message: "请输入设备地址", trigger: "blur" },
],
},
};
},
methods: {
//
submitForm() {
this.$refs["formdata"].validate((valid) => {
if (valid) {
this.saveDevice();
} else {
console.log("error submit!!");
return false;
}
});
}, },
methods: { //
// edit(event) {
submitForm() { this.flag = true;
this.$refs["formdata"].validate((valid) => { },
if (valid) { //
this.saveDevice(); done(event) {
} else { this.flag = false;
console.log("error submit!!"); this.trees[0].label = this.gateway;
return false; this.sendTree();
} },
}); rightClick(e, data, node) {
}, console.log(node);
// if (node.level == 4) {
edit(event) { this.menuShow = false;
this.flag = true; this.menuShow = true;
}, this.nodekey = data.id;
// e.preventDefault(); //
done(event) { this.rightMenu = { top: e.pageY + "px", left: e.pageX + "px" };
this.flag = false; document.addEventListener("click", (ev) => {
this.trees[0].label = this.gateway; ev.stopImmediatePropagation();
this.sendTree(); if (ev.target !== document.querySelector(".el-menu-item.is-active")) {
},
rightClick(e, data, node) {
console.log(node);
if (node.level == 4) {
this.menuShow = false;
this.menuShow = true;
this.nodekey = data.id;
e.preventDefault(); //
this.rightMenu = { top: e.pageY + "px", left: e.pageX + "px" };
document.addEventListener("click", (ev) => {
ev.stopImmediatePropagation();
if (ev.target !== document.querySelector(".el-menu-item.is-active")) {
this.foo();
}
});
}
},
// ,
selectMenuNode(index, indexPath) {
console.log(index);
if (index == 1) {
this.add_passage = true;
} else if (index == 2) {
this.$refs["tree"].remove(this.nodekey);
this.sendTree();
this.$message({
message: '删除成功',
type: 'success'
});
}
},
foo() {
//
this.menuShow = false;
document.removeEventListener("click", this.foo); //
},
treeNodeClick() {
this.foo(); this.foo();
}, }
getDriveName() { });
this.diag_drive = true; }
},
closeMenu(ev) {
console.log({ ev });
this.dialogVisible = false;
},
async saveDevice() {
let datas = sessionStorage.getItem("DB-IotLite_wx");
console.log(datas);
var obj = {
sbpz_sbid: this.formdata.sbpz_sbid,
sbpz_sbmc: this.formdata.sbpz_sbmc,
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({
mark: "DB-IotLite_wx",
user_id: this.user_id,
mark_value: JSON.stringify(datas),
});
if (res.status == 200) {
this.$message({
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({
id: this.nodekey + 10000,
label: this.formdata.sbpz_sbmc,
}, this.nodekey);
// console.log(this.trees);
this.sendTree();
this.$router.push(`/dbwificollect?user_id=${this.user_id}`);
},
async GetUserAnswer() {
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);
if (obj.sbpz_sbid) {
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));
this.formdata.sbpz_sbmc = obj.sbpz_sbmc;
this.formdata.sbpz_mac = obj.sbpz_mac;
}
},
async sendTree() {
let result = await SendTree({
user_id: this.user_id,
data: JSON.stringify(this.trees),
type: "2",
})
console.log(result);
},
}, },
created() { // ,
this.user_id = this.$route.query.user_id; selectMenuNode(index, indexPath) {
GetTree({ console.log(index);
user_id: this.user_id, if (index == 1) {
type: "2", this.add_passage = true;
}).then((res) => { } else if (index == 2) {
console.log(res); this.$refs["tree"].remove(this.nodekey);
console.log(JSON.parse(res.data.data.data)); this.sendTree();
this.trees = JSON.parse(res.data.data.data); this.$message({
}) message: "删除成功",
this.loading = true; type: "success",
this.GetUserAnswer(); });
this.loading = false; }
}, },
directives: { foo() {
"click-outside": { //
bind: function (el, binding, vnode) { this.menuShow = false;
console.log("el", el); document.removeEventListener("click", this.foo); //
console.log("binding", binding); },
el.event = function (event) { treeNodeClick() {
// this.foo();
if (!(el == event.target || el.contains(event.target))) { },
// getDriveName() {
// this.diag_drive = true;
// vnode.context },
if (typeof vnode.context[binding.expression] == "function") { closeMenu(ev) {
vnode.context[binding.expression](event); console.log({ ev });
} this.dialogVisible = false;
} },
}; async saveDevice() {
// let datas = sessionStorage.getItem("DB-IotLite_wx");
// trueDOMlistener console.log(datas);
document.body.addEventListener("click", el.event, true); var obj = {
}, sbpz_sbid: this.formdata.sbpz_sbid,
unbind: function (el) { sbpz_sbmc: this.formdata.sbpz_sbmc,
// sbpz_mac: this.formdata.sbpz_mac,
document.body.removeEventListener("click", el.event, true); 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({
mark: "DB-IotLite_wx",
user_id: this.user_id,
mark_value: JSON.stringify(datas),
});
if (res.status == 200) {
this.$message({
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(
{
id: this.nodekey + 10000,
label: this.formdata.sbpz_sbmc,
}, },
this.nodekey
);
// console.log(this.trees);
this.sendTree();
this.$router.push(`/dbwificollect?user_id=${this.user_id}`);
}, },
async GetUserAnswer() {
let answer = await GetUserAnswer({
mark: "DB-IotLite_wx",
user_id: this.user_id,
});
// 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));
this.formdata.sbpz_sbmc = obj.sbpz_sbmc;
this.formdata.sbpz_mac = obj.sbpz_mac;
}
},
async sendTree() {
let result = await SendTree({
user_id: this.user_id,
data: JSON.stringify(this.trees),
type: "2",
});
console.log(result);
},
},
created() {
this.user_id = this.$route.query.user_id;
GetTree({
user_id: this.user_id,
type: "2",
}).then((res) => {
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;
},
directives: {
"click-outside": {
bind: function (el, binding, vnode) {
console.log("el", el);
console.log("binding", binding);
el.event = function (event) {
//
if (!(el == event.target || el.contains(event.target))) {
//
//
// vnode.context
if (typeof vnode.context[binding.expression] == "function") {
vnode.context[binding.expression](event);
}
}
};
//
// trueDOMlistener
document.body.addEventListener("click", el.event, true);
},
unbind: function (el) {
//
document.body.removeEventListener("click", el.event, true);
},
},
},
}; };
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.tree_menu { .tree_menu {
position: absolute; position: absolute;
width: 286px; width: 286px;
height: 753px; height: 753px;
left: 64px; left: 64px;
top: 104px; top: 104px;
width: 286px; width: 286px;
height: 753px; height: 753px;
line-height: 20px; line-height: 20px;
border-radius: 3px; border-radius: 3px;
background-color: rgba(255, 255, 255, 1); background-color: rgba(255, 255, 255, 1);
text-align: center; text-align: center;
border: 1px solid rgba(220, 220, 220, 1); border: 1px solid rgba(220, 220, 220, 1);
} }
.tree_rightmenu { .tree_rightmenu {
position: fixed; position: fixed;
width: 120px; width: 120px;
border: 1px solid rgba(0, 0, 0, 0.15); border: 1px solid rgba(0, 0, 0, 0.15);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175); box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
z-index: 1000; z-index: 1000;
} }
.super_parmams { .super_parmams {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
width: 668px; width: 668px;
i { i {
width: 24px; width: 24px;
height: 24px; height: 24px;
display: inline-block; display: inline-block;
} }
} }
/deep/ .pas_params { /deep/ .pas_params {
.el-col-12:last-child { .el-col-12:last-child {
padding-right: 150px; padding-right: 150px;
}
.el-col-12:first-child {
padding-right: 42px;
}
.el-input__inner {
height: 30px;
text-align: left;
padding: 0px 8px;
}
.el-row {
display: flex;
align-items: flex-end;
.el-col-1 {
text-align: center;
line-height: 20px;
height: 20px;
} }
.el-col-12:first-child { .el-col-6 {
padding-right: 42px; height: 40px;
} top: 5px;
left: 77px;
.el-input__inner { position: relative;
height: 30px; width: 50px;
text-align: left;
padding: 0px 8px;
}
.el-row {
display: flex;
align-items: flex-end;
.el-col-1 {
text-align: center;
line-height: 20px;
height: 20px;
}
.el-col-6 {
height: 40px;
top: 5px;
left: 77px;
position: relative;
width: 50px;
}
} }
}
} }
.super_con { .super_con {
.el-col-12:last-child { .el-col-12:last-child {
padding-right: 28px; padding-right: 28px;
} }
.el-col-12:first-child { .el-col-12:first-child {
padding-right: 42px; padding-right: 42px;
} }
.el-input__inner { .el-input__inner {
text-align: left; text-align: left;
padding: 0 8px; padding: 0 8px;
} }
.el-row { .el-row {
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
.el-col-4 { .el-col-4 {
padding-left: 5px; padding-left: 5px;
width: 14px; width: 14px;
text-align: center; text-align: center;
line-height: 4px; line-height: 4px;
height: 20px; height: 20px;
}
} }
}
} }
</style> </style>

View File

@ -255,15 +255,15 @@ export default {
created() { created() {
let that = this; let that = this;
window.getParameter = that.getParameter; window.getParameter = that.getParameter;
this.wgid = this.$route.fullPath.split("?")[1]; this.user_id = this.$route.fullPath.split("?")[1];
this.GetUserAnswer(); this.GetUserAnswer();
// this.tableData = JSON.parse(localStorage.getItem("wgwh")) || []; // this.tableData = JSON.parse(localStorage.getItem("wgwh")) || [];
}, },
methods: { methods: {
getParameter(data) { // getParameter(data) {
alert(data); // alert(data);
this.user_id = data; // this.user_id = data;
}, // },
// //
async GetUserAnswer() { async GetUserAnswer() {
let { data } = await GetUserAnswer({ let { data } = await GetUserAnswer({

View File

@ -321,7 +321,7 @@ export default {
mark_value: JSON.stringify(datas), mark_value: JSON.stringify(datas),
}); });
console.log(res); console.log(res);
if (res.status == 200) { if (res.state) {
sessionStorage.setItem("CKFWQ_yx", JSON.stringify(datas)); sessionStorage.setItem("CKFWQ_yx", JSON.stringify(datas));
this.$message({ this.$message({
message: "保存成功", message: "保存成功",

View File

@ -104,7 +104,7 @@ export default {
mark_value: JSON.stringify(datas), mark_value: JSON.stringify(datas),
}); });
console.log(res); console.log(res);
if (res.status == 200) { if (res.state) {
sessionStorage.setItem( sessionStorage.setItem(
"CKFWQ_wx", "CKFWQ_wx",
JSON.stringify({ ...datas, ...this.ruleForm }) JSON.stringify({ ...datas, ...this.ruleForm })

View File

@ -269,6 +269,8 @@ export default {
type: "success", type: "success",
}); });
this.dialogVisible = false; this.dialogVisible = false;
} else {
this.$message.error("保存失败");
} }
}, },
// //

View File

@ -232,7 +232,16 @@ export default {
}).then((res) => { }).then((res) => {
console.log(res); console.log(res);
}); });
localStorage.setItem("CKFWQ_yx", JSON.stringify(datas)); if (data.state) {
localStorage.setItem("CKFWQ_yx", JSON.stringify(datas));
this.$message({
message: "保存成功",
type: "success",
});
} else {
this.$message.error("错了哦,这是一条错误消息");
}
}, },
submitForm(formName) { submitForm(formName) {
this.$refs["ruleForm"].validate((valid) => { this.$refs["ruleForm"].validate((valid) => {

View File

@ -106,7 +106,7 @@ export default {
user_id: `${this.user_id}`, user_id: `${this.user_id}`,
mark_value: JSON.stringify(datas), mark_value: JSON.stringify(datas),
}); });
if (res.status == 200) { if (res.state) {
sessionStorage.setItem( sessionStorage.setItem(
"CKFWQ_wx", "CKFWQ_wx",
JSON.stringify({ ...datas, ...this.ruleForm }) JSON.stringify({ ...datas, ...this.ruleForm })

View File

@ -197,7 +197,7 @@ export default {
mark_value: JSON.stringify(datas), mark_value: JSON.stringify(datas),
}); });
console.log(res); console.log(res);
if (res.status == 200) { if (res.state) {
sessionStorage.setItem("CKFWQ_wx", JSON.stringify(datas)); sessionStorage.setItem("CKFWQ_wx", JSON.stringify(datas));
this.dialogVisible = false; this.dialogVisible = false;
this.$message({ this.$message({

View File

@ -4,44 +4,87 @@
<div class="db_lite" style="background-color: aqua; height: 100px"> <div class="db_lite" style="background-color: aqua; height: 100px">
<router-link to="/cockpit">驾驶舱</router-link> <router-link to="/cockpit">驾驶舱</router-link>
<!-- <router-link to="/ipsetting">IP设置</router-link> -->
<router-link to="/wiredgatewayip">db网关-ip配置-有线网关</router-link> <router-link to="/wiredgatewayip">db网关-ip配置-有线网关</router-link>
<router-link to="/dbcollectiongate">db有线网关-数据采集配置-有线网关配置</router-link> <router-link to="/dbcollectiongate"
<router-link to="/channelconfig">db有线网关-数据采集配置-网口通道配置</router-link> >db有线网关-数据采集配置-有线网关配置</router-link
<router-link to="/dbcollectdevice">db有线网关-数据采集配置-网口设备配置</router-link> >
<router-link to="/dbcollect">db有线网关-数据采集配置-网口采集点配置</router-link> <router-link to="/channelconfig"
<router-link to="/mqttconfig">db有线网关-MQTT上云-网口MQTT1配置</router-link> >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无线网关配置 --> <!--db无线网关配置 -->
<router-link to="/wirelessgatewayip">db网关-ip配置-无线网关</router-link> <router-link to="/wirelessgatewayip">db网关-ip配置-无线网关</router-link>
<router-link to="/dbcollectionwifi">db无线网关-数据采集配置-网关配置配置</router-link> <router-link to="/dbcollectionwifi"
<router-link to="/dbcollectserial">db无线网关-数据采集配置-串口通道配置</router-link> >db无线网关-数据采集配置-网关配置配置</router-link
<router-link to="/dbserialdevice">db无线网关-数据采集配置-串口设备配置</router-link> >
<router-link to="/dbwificollect">db无线网关-数据采集配置-网口采集点配置</router-link> <router-link to="/dbcollectserial"
<router-link to="/mqttconfigwifi">db无线网关-MQTT上云-网口MQTT1配置</router-link> >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>
<div class="chihou" style="background-color: aqua; height: 100px"> <div class="chihou" style="background-color: aqua; height: 100px">
<router-link to="/chwiredgatewayip">斥候工业网关-ip配置-有线网关</router-link> <router-link to="/chwiredgatewayip"
<router-link to="/gatewayconfiguration">斥候有线工业网关-数据采集配置-网关配置</router-link> >斥候工业网关-ip配置-有线网关</router-link
<router-link to="/configuration">斥候有线工业网关-数据采集配置-设备配置</router-link> >
<router-link to="/collectionpoint">斥候有线工业网关-数据采集配置-采集点配置</router-link> <router-link to="/gatewayconfiguration"
<router-link to="/chmqtt">斥候有线工业网关-数据上云配置-MQTT上云</router-link> >斥候有线工业网关-数据采集配置-网关配置</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="/chwirelessgatewayip"
<router-link to="/chiwifigate">斥候无线工业网关-数据采集配置-网关配置</router-link> >斥候工业网关-ip配置-无线网关</router-link
<router-link to="/chiwifidevice">斥候无线工业网关-数据采集配置-设备配置</router-link> >
<router-link to="/chiwificollect">斥候无线工业网关-数据采集配置-采集点配置</router-link> <router-link to="/chiwifigate"
<router-link to="/chiwifimqtt">斥候无线工业网关-数据上云配置-MQTT上云</router-link> >斥候无线工业网关-数据采集配置-网关配置</router-link
>
<router-link to="/chiwifidevice"
>斥候无线工业网关-数据采集配置-设备配置</router-link
>
<router-link to="/chiwificollect"
>斥候无线工业网关-数据采集配置-采集点配置</router-link
>
<router-link to="/chiwifimqtt"
>斥候无线工业网关-数据上云配置-MQTT上云</router-link
>
</div> </div>
<div class="serial" style="background-color: aqua; height: 100px"> <div class="serial" style="background-color: aqua; height: 100px">
<router-link to="/ckipconfig">串口服务器-Ip配置</router-link> <router-link to="/ckipconfig">串口服务器-Ip配置</router-link>
<router-link to="/ckportconfig">串口服务器-端口配置</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="/cknet">串口服务器-485towifi-网口配置</router-link>
<router-link to="/ckwireless">串口服务器-485towifi-无线配置</router-link> <router-link to="/ckwireless">串口服务器-485towifi-无线配置</router-link>
<router-link to="/networkmanagement">工业网闸配置-网络管理</router-link> <router-link to="/networkmanagement">工业网闸配置-网络管理</router-link>
<router-link to="/objmanagement">工业网闸配置-对象管理</router-link> <router-link to="/objmanagement">工业网闸配置-对象管理</router-link>
<router-link to="/strategyManagement">工业网闸配置-策略管理</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="/ntconfig">网络优化-网关配置</router-link>
<router-link to="/ntmaintenance">网络优化-网关维护</router-link> <router-link to="/ntmaintenance">网络优化-网关维护</router-link>
</div> </div>
@ -133,8 +176,15 @@ export default {
// }, // },
// ]) // ])
// ); // );
let that = this;
window.getParameter = that.getParameter;
},
methods: {
getParameter(data) {
this.$router.push(`/${data}`);
},
}, },
methods: {},
}; };
</script> </script>