This commit is contained in:
parent
c1bbf72272
commit
d17542edf5
|
@ -243,10 +243,6 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
getParameter(data) {
|
||||
console.log(data);
|
||||
this.user_id = data;
|
||||
},
|
||||
async saveGate() {
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "CHGYWG_yx",
|
||||
|
|
|
@ -425,10 +425,6 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
getParameter(data) {
|
||||
console.log(data);
|
||||
this.user_id = data;
|
||||
},
|
||||
Merge(value, value1, value2, value3, value4) {
|
||||
value = value1 + "." + value2 + "." + value3 + "." + value4;
|
||||
return value;
|
||||
|
|
|
@ -4,8 +4,15 @@
|
|||
<!-- <div v-click-outside="closeMenu"> -->
|
||||
<!-- <el-button type="info" plain @click="dialogVisible = !dialogVisible">MQTT云</el-button> -->
|
||||
<div v-show="dialogVisible" class="tree_menu">
|
||||
<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"
|
||||
>
|
||||
</el-tree>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
|
@ -16,7 +23,12 @@
|
|||
MQTT Client
|
||||
</h3>
|
||||
<el-divider></el-divider>
|
||||
<el-form :model="formData" :label-position="labelPosition" :rules="rules" ref="formData">
|
||||
<el-form
|
||||
:model="formData"
|
||||
:label-position="labelPosition"
|
||||
:rules="rules"
|
||||
ref="formData"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item>
|
||||
|
@ -26,30 +38,50 @@
|
|||
</el-row>
|
||||
<el-row class="serveip">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="服务器IP:" :label-width="formLabelWidth" prop="mqtt_ip">
|
||||
<el-form-item
|
||||
label="服务器IP:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_ip"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-form-item prop="mqtt_ip1">
|
||||
<el-input v-model="mqtt_ip1" style="width: 43px; height: 30px" maxlength="3">
|
||||
<el-input
|
||||
v-model="mqtt_ip1"
|
||||
style="width: 43px; height: 30px"
|
||||
maxlength="3"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item prop="mqtt_ip2">
|
||||
<el-input v-model="mqtt_ip2" style="width: 43px; height: 30px" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="mqtt_ip2"
|
||||
style="width: 43px; height: 30px"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item prop="mqtt_ip3">
|
||||
<el-input v-model="mqtt_ip3" style="width: 43px; height: 30px" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="mqtt_ip3"
|
||||
style="width: 43px; height: 30px"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item prop="mqtt_ip4">
|
||||
<el-input v-model="mqtt_ip4" style="width: 43px; height: 30px" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="mqtt_ip4"
|
||||
style="width: 43px; height: 30px"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -58,29 +90,63 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="端口号:" :label-width="formLabelWidth" prop="mqtt_port">
|
||||
<el-input v-model="formData.mqtt_port" placeholder="" style="width: 200px; height: 30px"></el-input>
|
||||
<el-form-item
|
||||
label="端口号:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_port"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.mqtt_port"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="网关SN号:" :label-width="formLabelWidth" prop="mqtt_wgsn">
|
||||
<el-input v-model="formData.mqtt_wgsn" placeholder="" style="width: 200px; height: 30px"></el-input>
|
||||
<el-form-item
|
||||
label="网关SN号:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_wgsn"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.mqtt_wgsn"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row class="theme">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实时数据发布的主题" style="display: block" label-width="168px" prop="mqtt_sssjfbzt">
|
||||
<el-form-item
|
||||
label="实时数据发布的主题"
|
||||
style="display: block"
|
||||
label-width="168px"
|
||||
prop="mqtt_sssjfbzt"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="15">
|
||||
<el-input v-model="formData.mqtt_sssjfbzt" placeholder="" style="width: 200px"></el-input>
|
||||
<el-input
|
||||
v-model="formData.mqtt_sssjfbzt"
|
||||
placeholder=""
|
||||
style="width: 200px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<el-select v-model="formData.mqtt_qos" placeholder="请选择" style="width: 99px">
|
||||
<el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.mqtt_qos"
|
||||
placeholder="请选择"
|
||||
style="width: 99px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
|
@ -95,22 +161,47 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="上传模式:" :label-width="formLabelWidth" prop="mqtt_scms">
|
||||
<el-select v-model="formData.mqtt_scms" placeholder="请选择" style="width: 99px">
|
||||
<el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-form-item
|
||||
label="上传模式:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_scms"
|
||||
>
|
||||
<el-select
|
||||
v-model="formData.mqtt_scms"
|
||||
placeholder="请选择"
|
||||
style="width: 99px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="上传周期(s):" label-width="108px" prop="mqtt_sczq">
|
||||
<el-input v-model="formData.mqtt_sczq" placeholder="" style="width: 200px; height: 30px"></el-input>
|
||||
<el-form-item
|
||||
label="上传周期(s):"
|
||||
label-width="108px"
|
||||
prop="mqtt_sczq"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.mqtt_sczq"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="数据过滤:" :label-width="formLabelWidth" prop="mqtt_sjgl">
|
||||
<el-form-item
|
||||
label="数据过滤:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_sjgl"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-checkbox-group v-model="formData.mqtt_sjgl">
|
||||
|
@ -131,7 +222,9 @@
|
|||
</div>
|
||||
<div>
|
||||
<div class="con_right">
|
||||
<h3 class="mqtt" style="margin-top: 20px; color: white">MQTT Client采集点</h3>
|
||||
<h3 class="mqtt" style="margin-top: 20px; color: white">
|
||||
MQTT Client采集点
|
||||
</h3>
|
||||
<el-divider></el-divider>
|
||||
<!-- <el-button type="info" plain @click="handleSelect">保存</el-button> -->
|
||||
<!-- <el-menu class="el-menu-demo" mode="horizontal" @select="handleSelect">
|
||||
|
@ -145,16 +238,24 @@
|
|||
<el-table-column property="mqtt_cjd_sbmc" label="设备名称">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.mqtt_cjd_sbmc" placeholder="">
|
||||
<el-option v-for="(option, index) in options2" :key="index" :label="option.label"
|
||||
:value="option.value"></el-option>
|
||||
<el-option
|
||||
v-for="(option, index) in options2"
|
||||
:key="index"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="mqtt_cjd_tagid" label="TagID">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.mqtt_cjd_tagid" placeholder="">
|
||||
<el-option v-for="(option, index) in options3" :key="index" :label="option.label"
|
||||
:value="option.value"></el-option>
|
||||
<el-option
|
||||
v-for="(option, index) in options3"
|
||||
:key="index"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -165,8 +266,14 @@
|
|||
<!-- 添加按钮下显示出来的弹框信息 -->
|
||||
<div>
|
||||
<el-dialog title="选择点" :visible.sync="choose_point" width="30%">
|
||||
<el-tree :data="points" show-checkbox node-key="id" :default-expanded-keys="[1, 2]"
|
||||
:default-checked-keys="[3, 4, 5, 6]" :props="defaultProps">
|
||||
<el-tree
|
||||
:data="points"
|
||||
show-checkbox
|
||||
node-key="id"
|
||||
:default-expanded-keys="[1, 2]"
|
||||
:default-checked-keys="[3, 4, 5, 6]"
|
||||
:props="defaultProps"
|
||||
>
|
||||
</el-tree>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="savePoint">保 存</el-button>
|
||||
|
@ -177,22 +284,55 @@
|
|||
|
||||
<div class="gateway">
|
||||
<el-dialog title="新建网关" :visible.sync="outerVisible" width="382px">
|
||||
<el-form :model="formData" :rules="rulesGate" ref="gateWay" label-width="85px" class="demo-ruleForm">
|
||||
<el-form
|
||||
:model="formData"
|
||||
:rules="rulesGate"
|
||||
ref="gateWay"
|
||||
label-width="85px"
|
||||
class="demo-ruleForm"
|
||||
>
|
||||
<el-form-item label="网关名称:" prop="wgpz_wgmc">
|
||||
<el-select v-model="formData.wgpz_wgmc" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in opts1" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.wgpz_wgmc"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in opts1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="网关ID:" prop="wgpz_wgid">
|
||||
<el-select v-model="formData.wgpz_wgid" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in opts2" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.wgpz_wgid"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in opts2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="网关类型:" prop="wgpz_wglx">
|
||||
<el-select v-model="formData.wgpz_wglx" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in opts3" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.wgpz_wglx"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in opts3"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -534,7 +674,7 @@ export default {
|
|||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIp,
|
||||
trigger: "blur"
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
mqtt_port: [{ required: true, message: "请输入端口", trigger: "blur" }],
|
||||
|
@ -625,24 +765,24 @@ export default {
|
|||
validateIp(rule, value, callback) {
|
||||
if (
|
||||
this.mqtt_ip1 +
|
||||
"." +
|
||||
this.mqtt_ip2 +
|
||||
"." +
|
||||
this.mqtt_ip3 +
|
||||
"." +
|
||||
this.mqtt_ip4 ===
|
||||
"." +
|
||||
this.mqtt_ip2 +
|
||||
"." +
|
||||
this.mqtt_ip3 +
|
||||
"." +
|
||||
this.mqtt_ip4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入IP地址"));
|
||||
} else if (
|
||||
!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(
|
||||
this.mqtt_ip1 +
|
||||
"." +
|
||||
this.mqtt_ip2 +
|
||||
"." +
|
||||
this.mqtt_ip3 +
|
||||
"." +
|
||||
this.mqtt_ip4
|
||||
"." +
|
||||
this.mqtt_ip2 +
|
||||
"." +
|
||||
this.mqtt_ip3 +
|
||||
"." +
|
||||
this.mqtt_ip4
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的IP地址"));
|
||||
|
@ -745,8 +885,8 @@ export default {
|
|||
let datas = { ...this.formData, ...obj };
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
// user_id: this.user_id,
|
||||
user_id:"USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id:"USER202307301114011710",
|
||||
mark_value: JSON.stringify(datas),
|
||||
});
|
||||
if (res.data.state) {
|
||||
|
@ -774,8 +914,8 @@ export default {
|
|||
async GetUserAnswer() {
|
||||
let answer = await GetUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
// user_id: this.user_id,
|
||||
user_id:"USER202307301114011710"
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
// console.log(answer);
|
||||
if (answer.data.data && answer.data.state) {
|
||||
|
@ -843,8 +983,8 @@ export default {
|
|||
},
|
||||
async sendTree() {
|
||||
let result = await SendTree({
|
||||
// user_id: this.user_id,
|
||||
usr_id:"USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// usr_id: "USER202307301114011710",
|
||||
data: JSON.stringify(this.trees),
|
||||
type: "1",
|
||||
});
|
||||
|
@ -852,7 +992,7 @@ export default {
|
|||
},
|
||||
async getTree() {
|
||||
console.log("12341");
|
||||
let res = await GetTree({ user_id: 'USER202307301114011710', type: "1" });
|
||||
let res = await GetTree({ user_id: this.user_id, type: "1" });
|
||||
// console.log(res);
|
||||
// console.log(JSON.parse(res.data.data.data));
|
||||
this.trees = JSON.parse(res.data.data.data);
|
||||
|
@ -878,8 +1018,8 @@ export default {
|
|||
// console.log(datas);
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
// user_id: this.user_id,
|
||||
user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(this.formData),
|
||||
});
|
||||
if (res.data.state) {
|
||||
|
@ -897,7 +1037,7 @@ export default {
|
|||
});
|
||||
}
|
||||
console.log(res);
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.user_id = window.location.href.split("?")[1];
|
||||
|
|
|
@ -4,8 +4,15 @@
|
|||
<!-- <div v-click-outside="closeMenu"> -->
|
||||
<!-- <el-button type="info" plain @click="dialogVisible = !dialogVisible">MQTT云</el-button> -->
|
||||
<div v-show="dialogVisible" class="tree_menu">
|
||||
<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"
|
||||
>
|
||||
</el-tree>
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
|
@ -16,7 +23,12 @@
|
|||
MQTT Client
|
||||
</h3>
|
||||
<el-divider></el-divider>
|
||||
<el-form :model="formData" :label-position="labelPosition" :rules="rules" ref="formData">
|
||||
<el-form
|
||||
:model="formData"
|
||||
:label-position="labelPosition"
|
||||
:rules="rules"
|
||||
ref="formData"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item>
|
||||
|
@ -26,30 +38,50 @@
|
|||
</el-row>
|
||||
<el-row class="serveip">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="服务器IP:" :label-width="formLabelWidth" prop="mqtt_ip">
|
||||
<el-form-item
|
||||
label="服务器IP:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_ip"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-form-item prop="mqtt_ip1">
|
||||
<el-input v-model="mqtt_ip1" style="width: 43px; height: 30px" maxlength="3">
|
||||
<el-input
|
||||
v-model="mqtt_ip1"
|
||||
style="width: 43px; height: 30px"
|
||||
maxlength="3"
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item prop="mqtt_ip2">
|
||||
<el-input v-model="mqtt_ip2" style="width: 43px; height: 30px" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="mqtt_ip2"
|
||||
style="width: 43px; height: 30px"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item prop="mqtt_ip3">
|
||||
<el-input v-model="mqtt_ip3" style="width: 43px; height: 30px" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="mqtt_ip3"
|
||||
style="width: 43px; height: 30px"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-form-item prop="mqtt_ip4">
|
||||
<el-input v-model="mqtt_ip4" style="width: 43px; height: 30px" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="mqtt_ip4"
|
||||
style="width: 43px; height: 30px"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -58,29 +90,63 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="端口号:" :label-width="formLabelWidth" prop="mqtt_port">
|
||||
<el-input v-model="formData.mqtt_port" placeholder="" style="width: 200px; height: 30px"></el-input>
|
||||
<el-form-item
|
||||
label="端口号:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_port"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.mqtt_port"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="网关SN号:" :label-width="formLabelWidth" prop="mqtt_wgsn">
|
||||
<el-input v-model="formData.mqtt_wgsn" placeholder="" style="width: 200px; height: 30px"></el-input>
|
||||
<el-form-item
|
||||
label="网关SN号:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_wgsn"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.mqtt_wgsn"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-divider></el-divider>
|
||||
<el-row class="theme">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="实时数据发布的主题" style="display: block" label-width="168px" prop="mqtt_sssjfbzt">
|
||||
<el-form-item
|
||||
label="实时数据发布的主题"
|
||||
style="display: block"
|
||||
label-width="168px"
|
||||
prop="mqtt_sssjfbzt"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="15">
|
||||
<el-input v-model="formData.mqtt_sssjfbzt" placeholder="" style="width: 200px"></el-input>
|
||||
<el-input
|
||||
v-model="formData.mqtt_sssjfbzt"
|
||||
placeholder=""
|
||||
style="width: 200px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="9">
|
||||
<el-select v-model="formData.mqtt_qos" placeholder="请选择" style="width: 99px">
|
||||
<el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.mqtt_qos"
|
||||
placeholder="请选择"
|
||||
style="width: 99px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
|
@ -88,29 +154,58 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="retained:" :label-width="formLabelWidth" prop="mqtt_retained">
|
||||
<el-form-item
|
||||
label="retained:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_retained"
|
||||
>
|
||||
<el-switch v-model="formData.mqtt_retained"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="上传模式:" :label-width="formLabelWidth" prop="mqtt_scms">
|
||||
<el-select v-model="formData.mqtt_scms" placeholder="请选择" style="width: 99px">
|
||||
<el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-form-item
|
||||
label="上传模式:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_scms"
|
||||
>
|
||||
<el-select
|
||||
v-model="formData.mqtt_scms"
|
||||
placeholder="请选择"
|
||||
style="width: 99px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="上传周期(s):" label-width="108px" prop="mqtt_sczq">
|
||||
<el-input v-model="formData.mqtt_sczq" placeholder="" style="width: 200px; height: 30px"></el-input>
|
||||
<el-form-item
|
||||
label="上传周期(s):"
|
||||
label-width="108px"
|
||||
prop="mqtt_sczq"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.mqtt_sczq"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="数据过滤:" :label-width="formLabelWidth" prop="mqtt_sjgl">
|
||||
<el-form-item
|
||||
label="数据过滤:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_sjgl"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-checkbox-group v-model="formData.mqtt_sjgl">
|
||||
|
@ -131,7 +226,9 @@
|
|||
</div>
|
||||
<div>
|
||||
<div class="con_right">
|
||||
<h3 class="mqtt" style="margin-top: 20px; color: white">MQTT Client采集点</h3>
|
||||
<h3 class="mqtt" style="margin-top: 20px; color: white">
|
||||
MQTT Client采集点
|
||||
</h3>
|
||||
<el-divider></el-divider>
|
||||
<!-- <el-button type="info" plain @click="handleSelect">保存</el-button> -->
|
||||
<!-- <el-menu class="el-menu-demo" mode="horizontal" @select="handleSelect">
|
||||
|
@ -145,16 +242,24 @@
|
|||
<el-table-column property="mqtt_cjd_sbmc" label="设备名称">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.mqtt_cjd_sbmc" placeholder="">
|
||||
<el-option v-for="(option, index) in options2" :key="index" :label="option.label"
|
||||
:value="option.value"></el-option>
|
||||
<el-option
|
||||
v-for="(option, index) in options2"
|
||||
:key="index"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="mqtt_cjd_tagid" label="TagID">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.mqtt_cjd_tagid" placeholder="">
|
||||
<el-option v-for="(option, index) in options3" :key="index" :label="option.label"
|
||||
:value="option.value"></el-option>
|
||||
<el-option
|
||||
v-for="(option, index) in options3"
|
||||
:key="index"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -165,8 +270,14 @@
|
|||
<!-- 添加按钮下显示出来的弹框信息 -->
|
||||
<div>
|
||||
<el-dialog title="选择点" :visible.sync="choose_point" width="30%">
|
||||
<el-tree :data="points" show-checkbox node-key="id" :default-expanded-keys="[1, 2]"
|
||||
:default-checked-keys="[3, 4, 5, 6]" :props="defaultProps">
|
||||
<el-tree
|
||||
:data="points"
|
||||
show-checkbox
|
||||
node-key="id"
|
||||
:default-expanded-keys="[1, 2]"
|
||||
:default-checked-keys="[3, 4, 5, 6]"
|
||||
:props="defaultProps"
|
||||
>
|
||||
</el-tree>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="savePoint">保 存</el-button>
|
||||
|
@ -177,22 +288,55 @@
|
|||
|
||||
<div class="gateway">
|
||||
<el-dialog title="新建网关" :visible.sync="outerVisible" width="382px">
|
||||
<el-form :model="formData" :rules="rulesGate" ref="gateWay" label-width="85px" class="demo-ruleForm">
|
||||
<el-form
|
||||
:model="formData"
|
||||
:rules="rulesGate"
|
||||
ref="gateWay"
|
||||
label-width="85px"
|
||||
class="demo-ruleForm"
|
||||
>
|
||||
<el-form-item label="网关名称:" prop="wgpz_wgmc">
|
||||
<el-select v-model="formData.wgpz_wgmc" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in opts1" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.wgpz_wgmc"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in opts1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="网关ID:" prop="wgpz_wgid">
|
||||
<el-select v-model="formData.wgpz_wgid" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in opts2" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.wgpz_wgid"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in opts2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="网关类型:" prop="wgpz_wglx">
|
||||
<el-select v-model="formData.wgpz_wglx" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in opts3" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.wgpz_wglx"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in opts3"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -542,7 +686,7 @@ export default {
|
|||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIp,
|
||||
trigger: "blur"
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
mqtt_port: [{ required: true, message: "请输入端口", trigger: "blur" }],
|
||||
|
@ -633,24 +777,24 @@ export default {
|
|||
validateIp(rule, value, callback) {
|
||||
if (
|
||||
this.mqtt_ip1 +
|
||||
"." +
|
||||
this.mqtt_ip2 +
|
||||
"." +
|
||||
this.mqtt_ip3 +
|
||||
"." +
|
||||
this.mqtt_ip4 ===
|
||||
"." +
|
||||
this.mqtt_ip2 +
|
||||
"." +
|
||||
this.mqtt_ip3 +
|
||||
"." +
|
||||
this.mqtt_ip4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入IP地址"));
|
||||
} else if (
|
||||
!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(
|
||||
this.mqtt_ip1 +
|
||||
"." +
|
||||
this.mqtt_ip2 +
|
||||
"." +
|
||||
this.mqtt_ip3 +
|
||||
"." +
|
||||
this.mqtt_ip4
|
||||
"." +
|
||||
this.mqtt_ip2 +
|
||||
"." +
|
||||
this.mqtt_ip3 +
|
||||
"." +
|
||||
this.mqtt_ip4
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的IP地址"));
|
||||
|
@ -681,7 +825,7 @@ export default {
|
|||
this.GetUserAnswer();
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
treeNodeClick() {
|
||||
this.add_passage = true;
|
||||
},
|
||||
|
@ -719,8 +863,8 @@ export default {
|
|||
let datas = { ...this.formData, ...obj };
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_wx",
|
||||
// user_id: this.user_id,
|
||||
user_id:"USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id:"USER202307301114011710",
|
||||
mark_value: JSON.stringify(datas),
|
||||
});
|
||||
if (res.data.state) {
|
||||
|
@ -748,8 +892,8 @@ export default {
|
|||
async GetUserAnswer() {
|
||||
let answer = await GetUserAnswer({
|
||||
mark: "DB-IotLite_wx",
|
||||
// user_id: this.user_id,
|
||||
user_id:"USER202307301114011710"
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
// console.log(answer);
|
||||
if (answer.data.data && answer.data.state) {
|
||||
|
@ -824,8 +968,8 @@ export default {
|
|||
},
|
||||
async sendTree() {
|
||||
let result = await SendTree({
|
||||
// user_id: this.user_id,
|
||||
user_id:"USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
data: JSON.stringify(this.trees),
|
||||
type: "2",
|
||||
});
|
||||
|
@ -833,7 +977,7 @@ export default {
|
|||
},
|
||||
async getTree() {
|
||||
console.log("12341");
|
||||
let res = await GetTree({ user_id: 'USER202307301114011710', type: "2" });
|
||||
let res = await GetTree({ user_id: this.user_id, type: "2" });
|
||||
// console.log(res);
|
||||
// console.log(JSON.parse(res.data.data.data));
|
||||
this.trees = JSON.parse(res.data.data.data);
|
||||
|
@ -859,8 +1003,8 @@ export default {
|
|||
// console.log(datas);
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_wx",
|
||||
// user_id: this.user_id,
|
||||
user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(this.formData),
|
||||
});
|
||||
if (res.data.state) {
|
||||
|
@ -878,7 +1022,7 @@ export default {
|
|||
});
|
||||
}
|
||||
console.log(res);
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.user_id = window.location.href.split("?")[1];
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -1,38 +1,85 @@
|
|||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<el-dialog title="新建网关" :visible.sync="outerVisible" width="382px" v-loading="loading">
|
||||
<el-form :model="formData" :rules="rules" ref="formData" label-width="85px" class="demo-ruleForm">
|
||||
<el-dialog
|
||||
title="新建网关"
|
||||
:visible.sync="outerVisible"
|
||||
width="382px"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-form
|
||||
:model="formData"
|
||||
:rules="rules"
|
||||
ref="formData"
|
||||
label-width="85px"
|
||||
class="demo-ruleForm"
|
||||
>
|
||||
<el-form-item label="网关名称:" prop="wgpz_wgmc">
|
||||
<el-select v-model="formData.wgpz_wgmc" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.wgpz_wgmc"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="网关ID:" prop="wgpz_wgid">
|
||||
<el-select v-model="formData.wgpz_wgid" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.wgpz_wgid"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="网关类型:" prop="wgpz_wglx">
|
||||
<el-select v-model="formData.wgpz_wglx" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in options3" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.wgpz_wglx"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options3"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-dialog width="382px" title="系统提示" :visible.sync="innerVisible" append-to-body>
|
||||
<el-dialog
|
||||
width="382px"
|
||||
title="系统提示"
|
||||
:visible.sync="innerVisible"
|
||||
append-to-body
|
||||
>
|
||||
<p class="inner_content" style="color: #fff !important">
|
||||
请确认选择的网关类型与网关实体一致:否则该工程无法下载至实体网关
|
||||
</p>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="innerConfirm('formData')">确定</el-button>
|
||||
<el-button type="primary" @click="innerConfirm('formData')"
|
||||
>确定</el-button
|
||||
>
|
||||
<el-button @click="innerVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<div slot="footer" class="dialog-footer-outer">
|
||||
<el-button type="primary" @click="saveInfo('formData')">保存</el-button>
|
||||
<el-button type="primary" @click="saveInfo('formData')"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button @click="outerVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
@ -169,10 +216,6 @@ export default {
|
|||
};
|
||||
},
|
||||
methods: {
|
||||
getParameter(data) {
|
||||
console.log(data);
|
||||
this.user_id = data;
|
||||
},
|
||||
saveInfo(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
|
@ -193,8 +236,8 @@ export default {
|
|||
// console.log(this.formdata);
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_wx",
|
||||
// user_id: this.user_id,
|
||||
user_id:'USER202307301114011710',
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(this.formData),
|
||||
step: "1",
|
||||
});
|
||||
|
@ -205,7 +248,7 @@ export default {
|
|||
});
|
||||
sessionStorage.setItem("DB-IotLite_wx", JSON.stringify(this.formData));
|
||||
// this.$router.replace(`/dbcollectserial?user_id=${this.user_id}`);
|
||||
this.$router.replace(`/dbcollectserial?user_id=USER202307301114011710`);
|
||||
this.$router.replace(`/dbcollectserial?user_id=${this.user_id}`);
|
||||
} else {
|
||||
this.$message({
|
||||
message: `保存失败,原因是${res.data.message}`,
|
||||
|
@ -219,17 +262,17 @@ export default {
|
|||
this.loading = true;
|
||||
let res2 = await GetUserAnswer({
|
||||
mark: "DB-IotLite_wx",
|
||||
// user_id: this.user_id,
|
||||
user_id:"USER202307301114011710"
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
this.loading = false;
|
||||
if (res2.data.data && res2.data.state) {
|
||||
if (res2.data.data.step == 1) {
|
||||
this.$router.push(`/dbcollectserial?user_id=${'USER202307301114011710'}`)
|
||||
this.$router.push(`/dbcollectserial?user_id=${this.user_id}`);
|
||||
} else if (res2.data.data.step == 2) {
|
||||
this.$router.push(`/dbserialdevice?user_id=${'USER202307301114011710'}`)
|
||||
this.$router.push(`/dbserialdevice?user_id=${this.user_id}`);
|
||||
} else if (res2.data.data.step == 3) {
|
||||
this.$router.push(`/dbwificollect?user_id=${'USER202307301114011710'}`)
|
||||
this.$router.push(`/dbwificollect?user_id=${this.user_id}`);
|
||||
} else {
|
||||
console.log(res2);
|
||||
let res3 = JSON.parse(res2.data.data.mark_value);
|
||||
|
|
|
@ -1,28 +1,71 @@
|
|||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<el-dialog title="新建网关" :visible.sync="outerVisible" width="382px" v-loading="loading">
|
||||
<el-form :model="formData" :rules="rules" ref="formData" label-width="85px" class="demo-ruleForm">
|
||||
<el-dialog
|
||||
title="新建网关"
|
||||
:visible.sync="outerVisible"
|
||||
width="382px"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-form
|
||||
:model="formData"
|
||||
:rules="rules"
|
||||
ref="formData"
|
||||
label-width="85px"
|
||||
class="demo-ruleForm"
|
||||
>
|
||||
<el-form-item label="网关名称:" prop="wgpz_wgmc">
|
||||
<el-select v-model="formData.wgpz_wgmc" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.wgpz_wgmc"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="网关ID:" prop="wgpz_wgid">
|
||||
<el-select v-model="formData.wgpz_wgid" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.wgpz_wgid"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="网关类型:" prop="wgpz_wglx">
|
||||
<el-select v-model="formData.wgpz_wglx" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in options3" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.wgpz_wglx"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options3"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-dialog width="382px" title="系统提示" :visible.sync="innerVisible" append-to-body>
|
||||
<el-dialog
|
||||
width="382px"
|
||||
title="系统提示"
|
||||
:visible.sync="innerVisible"
|
||||
append-to-body
|
||||
>
|
||||
<p class="inner_content" style="color: #fff !important">
|
||||
请确认选择的网关类型与网关实体一致:否则该工程无法下载至实体网关
|
||||
</p>
|
||||
|
@ -182,8 +225,8 @@ export default {
|
|||
// console.log(datas);
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
// user_id: this.user_id,
|
||||
user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(this.formData),
|
||||
step: "1",
|
||||
});
|
||||
|
@ -193,7 +236,9 @@ export default {
|
|||
type: "success",
|
||||
});
|
||||
// sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.formData));
|
||||
this.$router.push(`/channelconfig?user_id=${'USER202307301114011710'}&firstlabel=${this.formData.wgpz_wgid}`);
|
||||
this.$router.push(
|
||||
`/channelconfig?user_id=${this.user_id}&firstlabel=${this.formData.wgpz_wgid}`
|
||||
);
|
||||
} else {
|
||||
this.$message({
|
||||
message: `保存失败,原因是${res.data.message}`,
|
||||
|
@ -207,19 +252,19 @@ export default {
|
|||
this.loading = true;
|
||||
let res2 = await GetUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
// user_id: this.user_id,
|
||||
user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
this.loading = false;
|
||||
console.log(res2);
|
||||
console.log(res2.data.data.step);
|
||||
if (res2.data.data && res2.data.state) {
|
||||
if (res2.data.data.step == 1) {
|
||||
this.$router.replace(`/channelconfig?user_id=${"USER202307301114011710"}`)
|
||||
this.$router.replace(`/channelconfig?user_id=${this.user_id}`);
|
||||
} else if (res2.data.data.step == 2) {
|
||||
this.$router.replace(`/dbcollectdevice?user_id=${"USER202307301114011710"}`)
|
||||
this.$router.replace(`/dbcollectdevice?user_id=${this.user_id}`);
|
||||
} else if (res2.data.data.step == 3) {
|
||||
this.$router.replace(`/dbcollect?user_id=${"USER202307301114011710"}`)
|
||||
this.$router.replace(`/dbcollect?user_id=${this.user_id}`);
|
||||
} else {
|
||||
console.log(res2.data.data.mark_value);
|
||||
let res3 = JSON.parse(res2.data.data.mark_value);
|
||||
|
|
|
@ -2,31 +2,64 @@
|
|||
<template>
|
||||
<div>
|
||||
<!-- 无线网关 -->
|
||||
<el-dialog title="IP设置" :visible.sync="dialogFormVisible" v-loading="loading" :append-to-body="true" width="894px">
|
||||
<el-dialog
|
||||
title="IP设置"
|
||||
:visible.sync="dialogFormVisible"
|
||||
v-loading="loading"
|
||||
:append-to-body="true"
|
||||
width="894px"
|
||||
>
|
||||
<div class="form_content">
|
||||
<div>
|
||||
<p class="netWay">网络方式</p>
|
||||
<el-radio v-model="ruleForm.ippz_lwfs" label="有线" style="color:white;">有线</el-radio>
|
||||
<el-radio v-model="ruleForm.ippz_lwfs" label="无线" style="color:white;">WIFI</el-radio>
|
||||
<el-radio
|
||||
v-model="ruleForm.ippz_lwfs"
|
||||
label="有线"
|
||||
style="color: white"
|
||||
>有线</el-radio
|
||||
>
|
||||
<el-radio
|
||||
v-model="ruleForm.ippz_lwfs"
|
||||
label="无线"
|
||||
style="color: white"
|
||||
>WIFI</el-radio
|
||||
>
|
||||
<el-divider></el-divider>
|
||||
</div>
|
||||
<!-- v-if="ippz_lwfs == 1 ? true : false" -->
|
||||
<div>
|
||||
<h2>有线</h2>
|
||||
<div class="wired">
|
||||
<el-form :model="ruleForm" :label-position="labelPosition" label-width="80px" :rules="rules_ippz_wirle"
|
||||
ref="rule">
|
||||
<el-form
|
||||
:model="ruleForm"
|
||||
:label-position="labelPosition"
|
||||
label-width="80px"
|
||||
:rules="rules_ippz_wirle"
|
||||
ref="rule"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="网口:" :label-width="formLabelWidth" prop="ippz_wangkou">
|
||||
<el-select v-model="ruleForm.ippz_wangkou" placeholder="" style="width: 200px; height: 30px">
|
||||
<el-form-item
|
||||
label="网口:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_wangkou"
|
||||
>
|
||||
<el-select
|
||||
v-model="ruleForm.ippz_wangkou"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
>
|
||||
<el-option label="ETH0" value="ETH0"></el-option>
|
||||
<el-option label="ETH1" value="ETH1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="默认网关:" :label-width="formLabelWidth" prop="ippz_mrwg">
|
||||
<el-form-item
|
||||
label="默认网关:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_mrwg"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_mrwg1" maxlength="3"></el-input>
|
||||
|
@ -49,7 +82,11 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="子网掩码:" :label-width="formLabelWidth" prop="ippz_zwym">
|
||||
<el-form-item
|
||||
label="子网掩码:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_zwym"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym1" maxlength="3"></el-input>
|
||||
|
@ -70,7 +107,11 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="IP地址:" :label-width="formLabelWidth" prop="ippz_ip">
|
||||
<el-form-item
|
||||
label="IP地址:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_ip"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip1" maxlength="3"></el-input>
|
||||
|
@ -93,43 +134,75 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="首选DNS:" :label-width="formLabelWidth" prop="ippz_dns_sx">
|
||||
<el-form-item
|
||||
label="首选DNS:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_dns_sx"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_sx1" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="ippz_dns_sx1"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_sx2" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="ippz_dns_sx2"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_sx3" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="ippz_dns_sx3"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_sx4" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="ippz_dns_sx4"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备选DNS:" :label-width="formLabelWidth" prop="ippz_dns_by">
|
||||
<el-form-item
|
||||
label="备选DNS:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_dns_by"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_by1" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="ippz_dns_by1"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_by2" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="ippz_dns_by2"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_by3" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="ippz_dns_by3"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_by4" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="ippz_dns_by4"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
|
@ -137,11 +210,20 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="MAC地址:" :label-width="formLabelWidth" prop="ippz_mac">
|
||||
<el-form-item
|
||||
label="MAC地址:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_mac"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24" class="mac">
|
||||
<el-input style="width: 200px; height: 30px" v-model="ruleForm.ippz_mac"></el-input><el-button
|
||||
v-copy="ruleForm.ippz_mac" @click="CopyText">复制</el-button>
|
||||
<el-input
|
||||
style="width: 200px; height: 30px"
|
||||
v-model="ruleForm.ippz_mac"
|
||||
></el-input
|
||||
><el-button v-copy="ruleForm.ippz_mac" @click="CopyText"
|
||||
>复制</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
|
@ -154,18 +236,37 @@
|
|||
<div>
|
||||
<h2>WIFI</h2>
|
||||
<div class="wifi">
|
||||
<el-form :model="ruleForm" :label-position="labelPosition" label-width="80px" :rules="rules_ippz_wirle"
|
||||
ref="ruleForm">
|
||||
<el-form
|
||||
:model="ruleForm"
|
||||
:label-position="labelPosition"
|
||||
label-width="80px"
|
||||
:rules="rules_ippz_wirle"
|
||||
ref="ruleForm"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="SSID:" :label-width="formLabelWidth" prop="ippz_wifi_ssid">
|
||||
<el-input v-model="ruleForm.ippz_wifi_ssid" placeholder="请输入SSID"></el-input>
|
||||
<el-form-item
|
||||
label="SSID:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_wifi_ssid"
|
||||
>
|
||||
<el-input
|
||||
v-model="ruleForm.ippz_wifi_ssid"
|
||||
placeholder="请输入SSID"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="密码:" :label-width="formLabelWidth" prop="ippz_wifi_mm">
|
||||
<el-input v-model="ruleForm.ippz_wifi_mm" placeholder=""
|
||||
style="width: 200px; height: 30px"></el-input>
|
||||
<el-form-item
|
||||
label="密码:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_wifi_mm"
|
||||
>
|
||||
<el-input
|
||||
v-model="ruleForm.ippz_wifi_mm"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -236,22 +337,38 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="首选DNS:" :label-width="formLabelWidth" prop="ippz_dns_sx">
|
||||
<el-form-item
|
||||
label="首选DNS:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_dns_sx"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_sx1" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="ippz_dns_sx1"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_sx2" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="ippz_dns_sx2"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_sx3" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="ippz_dns_sx3"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_sx4" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="ippz_dns_sx4"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
|
@ -259,32 +376,58 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备选DNS:" :label-width="formLabelWidth" prop="ippz_dns_by">
|
||||
<el-form-item
|
||||
label="备选DNS:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_dns_by"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_by1" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="ippz_dns_by1"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_by2" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="ippz_dns_by2"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_by3" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="ippz_dns_by3"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_by4" maxlength="3"></el-input>
|
||||
<el-input
|
||||
v-model="ippz_dns_by4"
|
||||
maxlength="3"
|
||||
></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="MAC地址:" :label-width="formLabelWidth" prop="ippz_mac">
|
||||
<el-form-item
|
||||
label="MAC地址:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_mac"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24" class="mac">
|
||||
<el-input style="width: 200px" v-model="ruleForm.ippz_mac" /><el-button v-copy="ruleForm.ippz_mac"
|
||||
@click="CopyText">复制</el-button>
|
||||
<el-input
|
||||
style="width: 200px"
|
||||
v-model="ruleForm.ippz_mac"
|
||||
/><el-button
|
||||
v-copy="ruleForm.ippz_mac"
|
||||
@click="CopyText"
|
||||
>复制</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
|
@ -409,21 +552,23 @@ export default {
|
|||
required: true,
|
||||
message: "",
|
||||
validator: this.validateZwym,
|
||||
trigger: "blur"
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_ip: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIp,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_ip: [{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIp,
|
||||
trigger: "blur"
|
||||
}],
|
||||
ippz_mrwg: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateMrwg,
|
||||
trigger: "blur"
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_sx: [
|
||||
|
@ -431,7 +576,7 @@ export default {
|
|||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsSx,
|
||||
trigger: "blur"
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_by: [
|
||||
|
@ -439,7 +584,7 @@ export default {
|
|||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsBy,
|
||||
trigger: "blur"
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mac: [
|
||||
|
@ -483,24 +628,24 @@ export default {
|
|||
validateZwym(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_zwym1 +
|
||||
"." +
|
||||
this.ippz_zwym2 +
|
||||
"." +
|
||||
this.ippz_zwym3 +
|
||||
"." +
|
||||
this.ippz_zwym4 ===
|
||||
"." +
|
||||
this.ippz_zwym2 +
|
||||
"." +
|
||||
this.ippz_zwym3 +
|
||||
"." +
|
||||
this.ippz_zwym4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入子网掩码"));
|
||||
} else if (
|
||||
!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(
|
||||
this.ippz_zwym1 +
|
||||
"." +
|
||||
this.ippz_zwym2 +
|
||||
"." +
|
||||
this.ippz_zwym3 +
|
||||
"." +
|
||||
this.ippz_zwym4
|
||||
"." +
|
||||
this.ippz_zwym2 +
|
||||
"." +
|
||||
this.ippz_zwym3 +
|
||||
"." +
|
||||
this.ippz_zwym4
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的子网掩码"));
|
||||
|
@ -512,24 +657,24 @@ export default {
|
|||
validateIp(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_ip1 +
|
||||
"." +
|
||||
this.ippz_ip2 +
|
||||
"." +
|
||||
this.ippz_ip3 +
|
||||
"." +
|
||||
this.ippz_ip4 ===
|
||||
"." +
|
||||
this.ippz_ip2 +
|
||||
"." +
|
||||
this.ippz_ip3 +
|
||||
"." +
|
||||
this.ippz_ip4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入IP地址"));
|
||||
} else if (
|
||||
!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(
|
||||
this.ippz_ip1 +
|
||||
"." +
|
||||
this.ippz_ip2 +
|
||||
"." +
|
||||
this.ippz_ip3 +
|
||||
"." +
|
||||
this.ippz_ip4
|
||||
"." +
|
||||
this.ippz_ip2 +
|
||||
"." +
|
||||
this.ippz_ip3 +
|
||||
"." +
|
||||
this.ippz_ip4
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的IP地址"));
|
||||
|
@ -541,24 +686,24 @@ export default {
|
|||
validateMrwg(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_mrwg1 +
|
||||
"." +
|
||||
this.ippz_mrwg2 +
|
||||
"." +
|
||||
this.ippz_mrwg3 +
|
||||
"." +
|
||||
this.ippz_mrwg4 ===
|
||||
"." +
|
||||
this.ippz_mrwg2 +
|
||||
"." +
|
||||
this.ippz_mrwg3 +
|
||||
"." +
|
||||
this.ippz_mrwg4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入网关地址"));
|
||||
} else if (
|
||||
!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(
|
||||
this.ippz_mrwg1 +
|
||||
"." +
|
||||
this.ippz_mrwg2 +
|
||||
"." +
|
||||
this.ippz_mrwg3 +
|
||||
"." +
|
||||
this.ippz_mrwg4
|
||||
"." +
|
||||
this.ippz_mrwg2 +
|
||||
"." +
|
||||
this.ippz_mrwg3 +
|
||||
"." +
|
||||
this.ippz_mrwg4
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的网关地址"));
|
||||
|
@ -570,24 +715,24 @@ export default {
|
|||
validateDnsSx(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_dns_sx1 +
|
||||
"." +
|
||||
this.ippz_dns_sx2 +
|
||||
"." +
|
||||
this.ippz_dns_sx3 +
|
||||
"." +
|
||||
this.ippz_dns_sx4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入主DNS服务器地址"));
|
||||
} else if (!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test
|
||||
(
|
||||
this.ippz_dns_sx1 +
|
||||
"." +
|
||||
this.ippz_dns_sx2 +
|
||||
"." +
|
||||
this.ippz_dns_sx3 +
|
||||
"." +
|
||||
this.ippz_dns_sx4
|
||||
this.ippz_dns_sx4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入主DNS服务器地址"));
|
||||
} else if (
|
||||
!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(
|
||||
this.ippz_dns_sx1 +
|
||||
"." +
|
||||
this.ippz_dns_sx2 +
|
||||
"." +
|
||||
this.ippz_dns_sx3 +
|
||||
"." +
|
||||
this.ippz_dns_sx4
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的主DNS服务器地址"));
|
||||
|
@ -599,24 +744,24 @@ export default {
|
|||
validateDnsBy(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_dns_by1 +
|
||||
"." +
|
||||
this.ippz_dns_by2 +
|
||||
"." +
|
||||
this.ippz_dns_by3 +
|
||||
"." +
|
||||
this.ippz_dns_by4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入备用DNS服务器地址"));
|
||||
} else if (!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test
|
||||
(
|
||||
this.ippz_dns_by1 +
|
||||
"." +
|
||||
this.ippz_dns_by2 +
|
||||
"." +
|
||||
this.ippz_dns_by3 +
|
||||
"." +
|
||||
this.ippz_dns_by4
|
||||
this.ippz_dns_by4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入备用DNS服务器地址"));
|
||||
} else if (
|
||||
!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(
|
||||
this.ippz_dns_by1 +
|
||||
"." +
|
||||
this.ippz_dns_by2 +
|
||||
"." +
|
||||
this.ippz_dns_by3 +
|
||||
"." +
|
||||
this.ippz_dns_by4
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的备用DNS服务器地址"));
|
||||
|
@ -635,10 +780,6 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
getParameter(data) {
|
||||
console.log(data);
|
||||
this.user_id = data
|
||||
},
|
||||
// 封装合并输入框的数据
|
||||
Merge(value, value1, value2, value3, value4) {
|
||||
value = value1 + "." + value2 + "." + value3 + "." + value4;
|
||||
|
@ -655,20 +796,55 @@ export default {
|
|||
var obj = {
|
||||
ippz_lwfs: this.ruleForm.ippz_lwfs,
|
||||
ippz_wangkou: this.ruleForm.ippz_wangkou,
|
||||
ippz_zwym: this.ippz_zwym1 + "." + this.ippz_zwym2 + "." + this.ippz_zwym3 + "." + this.ippz_zwym4,
|
||||
ippz_ip: this.ippz_ip1 + "." + this.ippz_ip2 + "." + this.ippz_ip3 + "." + this.ippz_ip4,
|
||||
ippz_mrwg: this.ippz_mrwg1 + "." + this.ippz_mrwg2 + "." + this.ippz_mrwg3 + "." + this.ippz_mrwg4,
|
||||
ippz_dns_sx: this.ippz_dns_sx1 + "." + this.ippz_dns_sx2 + "." + this.ippz_dns_sx3 + "." + this.ippz_dns_sx4,
|
||||
ippz_dns_by: this.ippz_dns_by1 + "." + this.ippz_dns_by2 + "." + this.ippz_dns_by3 + "." + this.ippz_dns_by4,
|
||||
ippz_zwym:
|
||||
this.ippz_zwym1 +
|
||||
"." +
|
||||
this.ippz_zwym2 +
|
||||
"." +
|
||||
this.ippz_zwym3 +
|
||||
"." +
|
||||
this.ippz_zwym4,
|
||||
ippz_ip:
|
||||
this.ippz_ip1 +
|
||||
"." +
|
||||
this.ippz_ip2 +
|
||||
"." +
|
||||
this.ippz_ip3 +
|
||||
"." +
|
||||
this.ippz_ip4,
|
||||
ippz_mrwg:
|
||||
this.ippz_mrwg1 +
|
||||
"." +
|
||||
this.ippz_mrwg2 +
|
||||
"." +
|
||||
this.ippz_mrwg3 +
|
||||
"." +
|
||||
this.ippz_mrwg4,
|
||||
ippz_dns_sx:
|
||||
this.ippz_dns_sx1 +
|
||||
"." +
|
||||
this.ippz_dns_sx2 +
|
||||
"." +
|
||||
this.ippz_dns_sx3 +
|
||||
"." +
|
||||
this.ippz_dns_sx4,
|
||||
ippz_dns_by:
|
||||
this.ippz_dns_by1 +
|
||||
"." +
|
||||
this.ippz_dns_by2 +
|
||||
"." +
|
||||
this.ippz_dns_by3 +
|
||||
"." +
|
||||
this.ippz_dns_by4,
|
||||
ippz_mac: this.ruleForm.ippz_mac,
|
||||
ippz_wifi_ssid: this.ruleForm.ippz_wifi_ssid,
|
||||
ippz_wifi_mm: this.ruleForm.ippz_wifi_mm,
|
||||
}
|
||||
};
|
||||
let datas = { ...this.ruleForm, ...obj };
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_wx",
|
||||
user_id: "USER202307301114011710",
|
||||
// user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
mark_value: JSON.stringify(datas),
|
||||
});
|
||||
if (res.data.state) {
|
||||
|
@ -695,8 +871,8 @@ export default {
|
|||
this.loading = true;
|
||||
let res2 = await GetUserAnswer({
|
||||
mark: "DB-IotLite_wx",
|
||||
user_id: "USER202307301114011710",
|
||||
// user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
});
|
||||
this.loading = false;
|
||||
console.log(res2);
|
||||
|
@ -781,13 +957,13 @@ export default {
|
|||
this.ruleForm.mqtt_cjd_sbmc = res3.mqtt_cjd_sbmc;
|
||||
this.ruleForm.mqtt_cjd_tagid = res3.mqtt_cjd_tagid;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.user_id = window.location.href.split("?")[1];
|
||||
this.GetUserAnswer();
|
||||
},
|
||||
mounted() { },
|
||||
mounted() {},
|
||||
directives: {
|
||||
copy: {
|
||||
bind(el, { value }) {
|
||||
|
|
|
@ -2,8 +2,15 @@
|
|||
<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"
|
||||
>
|
||||
<!-- <span class="custom-tree-node" slot-scope="{ node, data }">
|
||||
<template v-if="data.editing == 1 && flag">
|
||||
<el-input style="width: 260px;" v-model="gateway" @change="changeInput"></el-input>
|
||||
|
@ -13,7 +20,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>
|
||||
|
@ -29,13 +40,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>
|
||||
|
@ -43,9 +77,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>
|
||||
|
@ -53,8 +100,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>
|
||||
|
@ -82,25 +137,57 @@
|
|||
</el-dialog>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="gateway">
|
||||
<el-dialog title="新建网关" :visible.sync="outerVisible" width="382px">
|
||||
<el-form :model="formdata" :rules="rulesGate" ref="gateWay" label-width="85px" class="demo-ruleForm">
|
||||
<el-form
|
||||
:model="formdata"
|
||||
:rules="rulesGate"
|
||||
ref="gateWay"
|
||||
label-width="85px"
|
||||
class="demo-ruleForm"
|
||||
>
|
||||
<el-form-item label="网关名称:" prop="wgpz_wgmc">
|
||||
<el-select v-model="formdata.wgpz_wgmc" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in opts1" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formdata.wgpz_wgmc"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in opts1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="网关ID:" prop="wgpz_wgid">
|
||||
<el-select v-model="formdata.wgpz_wgid" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in opts2" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formdata.wgpz_wgid"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in opts2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="网关类型:" prop="wgpz_wglx">
|
||||
<el-select v-model="formdata.wgpz_wglx" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in opts3" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formdata.wgpz_wglx"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in opts3"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -407,8 +494,8 @@ export default {
|
|||
this.$refs["tree"].remove(this.nodekey);
|
||||
this.sendTree();
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'success'
|
||||
message: "删除成功",
|
||||
type: "success",
|
||||
});
|
||||
this.$router.back();
|
||||
}
|
||||
|
@ -437,13 +524,13 @@ 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 = { ...this.formdata, ...obj };
|
||||
this.add_passage = false;
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
// user_id: this.user_id,
|
||||
user_id:'USER202307301114011710',
|
||||
user_id: this.user_id,
|
||||
// user_id:'USER202307301114011710',
|
||||
mark_value: JSON.stringify(datas),
|
||||
step: "3",
|
||||
});
|
||||
|
@ -455,13 +542,16 @@ export default {
|
|||
sessionStorage.setItem("DB-IotLite_yx", 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);
|
||||
this.$refs["tree"].append(
|
||||
{
|
||||
id: this.nodekey + 10000,
|
||||
label: this.formdata.sbpz_sbmc,
|
||||
},
|
||||
this.nodekey
|
||||
);
|
||||
// console.log(this.trees);
|
||||
this.sendTree();
|
||||
this.$router.push(`/dbcollect?user_id=${'USER202307301114011710'}`);
|
||||
this.$router.push(`/dbcollect?user_id=${this.user_id}`);
|
||||
} else {
|
||||
this.$message({
|
||||
message: `保存失败`,
|
||||
|
@ -472,9 +562,9 @@ export default {
|
|||
async GetUserAnswer() {
|
||||
let answer = await GetUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
// user_id: this.user_id,
|
||||
user_id:'USER202307301114011710'
|
||||
})
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
console.log(answer);
|
||||
if (answer.data.data && answer.data.state) {
|
||||
let obj = JSON.parse(answer.data.data.mark_value);
|
||||
|
@ -531,11 +621,11 @@ export default {
|
|||
},
|
||||
async sendTree() {
|
||||
let result = await SendTree({
|
||||
// user_id: this.user_id,
|
||||
user_id:'USER202307301114011710',
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
data: JSON.stringify(this.trees),
|
||||
type: "1",
|
||||
})
|
||||
});
|
||||
console.log(result);
|
||||
},
|
||||
//网关信息配置
|
||||
|
@ -550,7 +640,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
//
|
||||
//
|
||||
async saveGates() {
|
||||
this.outerVisible = false;
|
||||
// this.innerVisible = false;
|
||||
|
@ -560,8 +650,8 @@ export default {
|
|||
// console.log(datas);
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
// user_id: this.user_id,
|
||||
user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(this.formdata),
|
||||
// step: "2",
|
||||
});
|
||||
|
@ -580,20 +670,20 @@ export default {
|
|||
});
|
||||
}
|
||||
console.log(res);
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
console.log(this.$route.query.user_id);
|
||||
this.user_id = this.$route.query.user_id;
|
||||
GetTree({
|
||||
// user_id: this.user_id,
|
||||
user_id:"USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
type: "1",
|
||||
}).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;
|
||||
|
|
|
@ -2,8 +2,15 @@
|
|||
<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"
|
||||
>
|
||||
<!-- <span class="custom-tree-node" slot-scope="{ node, data }">
|
||||
<template v-if="data.editing == 1 && flag">
|
||||
<el-input style="width: 260px;" v-model="gateway" @change="changeInput"></el-input>
|
||||
|
@ -13,7 +20,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>
|
||||
|
@ -29,13 +40,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>
|
||||
|
@ -43,9 +77,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>
|
||||
|
@ -53,8 +100,16 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="设备地址:" :label-width="formLabelWidth" prop="sbpz_sbdz">
|
||||
<el-input v-model="formData.sbpz_sbdz" placeholder="" style="width: 200px; height: 30px"></el-input>
|
||||
<el-form-item
|
||||
label="设备地址:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="sbpz_sbdz"
|
||||
>
|
||||
<el-input
|
||||
v-model="formData.sbpz_sbdz"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -85,22 +140,55 @@
|
|||
<!-- 网关 -->
|
||||
<div class="gateway">
|
||||
<el-dialog title="新建网关" :visible.sync="outerVisible" width="382px">
|
||||
<el-form :model="formData" :rules="rulesGate" ref="gateWay" label-width="85px" class="demo-ruleForm">
|
||||
<el-form
|
||||
:model="formData"
|
||||
:rules="rulesGate"
|
||||
ref="gateWay"
|
||||
label-width="85px"
|
||||
class="demo-ruleForm"
|
||||
>
|
||||
<el-form-item label="网关名称:" prop="wgpz_wgmc">
|
||||
<el-select v-model="formData.wgpz_wgmc" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in opts1" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.wgpz_wgmc"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in opts1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="网关ID:" prop="wgpz_wgid">
|
||||
<el-select v-model="formData.wgpz_wgid" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in opts2" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.wgpz_wgid"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in opts2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="网关类型:" prop="wgpz_wglx">
|
||||
<el-select v-model="formData.wgpz_wglx" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in opts3" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="formData.wgpz_wglx"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in opts3"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -334,7 +422,7 @@ export default {
|
|||
if (ev.target !== document.querySelector(".el-menu-item.is-active")) {
|
||||
this.foo();
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
},
|
||||
getDriveName() {
|
||||
|
@ -374,13 +462,13 @@ export default {
|
|||
sbpz_sbmc: this.formData.sbpz_sbmc,
|
||||
sbpz_jysb: String(Number(this.formData.sbpz_jysb)),
|
||||
sbpz_jdzxz: String(Number(this.formData.sbpz_jdzxz)),
|
||||
}
|
||||
};
|
||||
let datas = { ...this.formData, ...obj };
|
||||
this.add_passage = false;
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_wx",
|
||||
// user_id: this.user_id,
|
||||
user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(datas),
|
||||
step: "3",
|
||||
});
|
||||
|
@ -392,14 +480,17 @@ export default {
|
|||
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);
|
||||
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}`);
|
||||
this.$router.push(`/dbwificollect?user_id=USER202307301114011710`);
|
||||
this.$router.push(`/dbwificollect?user_id=${this.user_id}`);
|
||||
} else {
|
||||
this.$message({
|
||||
message: `保存失败`,
|
||||
|
@ -410,9 +501,9 @@ export default {
|
|||
async GetUserAnswer() {
|
||||
let answer = await GetUserAnswer({
|
||||
mark: "DB-IotLite_wx",
|
||||
user_id: "USER202307301114011710",
|
||||
// user_id: this.user_id,
|
||||
})
|
||||
// user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
});
|
||||
if (answer.data.data && answer.data.state) {
|
||||
console.log(answer);
|
||||
let obj = JSON.parse(answer.data.data.mark_value);
|
||||
|
@ -479,11 +570,11 @@ export default {
|
|||
},
|
||||
async sendTree() {
|
||||
let result = await SendTree({
|
||||
user_id: "USER202307301114011710",
|
||||
// user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
data: JSON.stringify(this.trees),
|
||||
type: "2",
|
||||
})
|
||||
});
|
||||
console.log(result);
|
||||
},
|
||||
//网关配置的信息
|
||||
|
@ -498,7 +589,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
//
|
||||
//
|
||||
async saveGates() {
|
||||
this.outerVisible = false;
|
||||
// this.innerVisible = false;
|
||||
|
@ -508,8 +599,8 @@ export default {
|
|||
// console.log(datas);
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_wx",
|
||||
// user_id: this.user_id,
|
||||
user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(this.formData),
|
||||
});
|
||||
if (res.data.state) {
|
||||
|
@ -532,8 +623,8 @@ export default {
|
|||
created() {
|
||||
this.user_id = this.$route.query.user_id;
|
||||
GetTree({
|
||||
user_id: "USER202307301114011710",
|
||||
// user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
type: "2",
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
|
@ -544,7 +635,7 @@ export default {
|
|||
this.GetUserAnswer();
|
||||
this.loading = false;
|
||||
},
|
||||
}
|
||||
};
|
||||
// 点击时候的判断,判断是否为新增设备
|
||||
// async saveDevice() {
|
||||
// let datas = sessionStorage.getItem("DB-IotLite_wx");
|
||||
|
|
|
@ -2,23 +2,45 @@
|
|||
<template>
|
||||
<div>
|
||||
<!-- <div> <el-button type="info" plain @click="dialogFormVisible = true">IP设置</el-button></div> -->
|
||||
<el-dialog title="IP设置" :visible.sync="dialogFormVisible" :append-to-body="true" width="894px" v-loading="loading">
|
||||
<el-dialog
|
||||
title="IP设置"
|
||||
:visible.sync="dialogFormVisible"
|
||||
:append-to-body="true"
|
||||
width="894px"
|
||||
v-loading="loading"
|
||||
>
|
||||
<div class="form_content">
|
||||
<span class="title_center">注意:本页面涉及排错,请检查修改默认值</span>
|
||||
<el-form :model="formData" :label-position="labelPosition" label-width="80px" :rules="rules_ippz_wirle"
|
||||
ref="formData">
|
||||
<el-form
|
||||
:model="formData"
|
||||
:label-position="labelPosition"
|
||||
label-width="80px"
|
||||
:rules="rules_ippz_wirle"
|
||||
ref="formData"
|
||||
>
|
||||
<div class="wired">
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="网口:" :label-width="formLabelWidth" prop="ippz_wangkou">
|
||||
<el-select v-model="formData.ippz_wangkou" style="width: 200px; height: 30px">
|
||||
<el-form-item
|
||||
label="网口:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_wangkou"
|
||||
>
|
||||
<el-select
|
||||
v-model="formData.ippz_wangkou"
|
||||
style="width: 200px; height: 30px"
|
||||
>
|
||||
<el-option label="ETH0" value="ETH0"></el-option>
|
||||
<el-option label="ETH1" value="ETH1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="IP地址:" :label-width="formLabelWidth" prop="ippz_ip">
|
||||
<el-form-item
|
||||
label="IP地址:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_ip"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip1" maxlength="3"></el-input>
|
||||
|
@ -41,7 +63,11 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="子网掩码:" :label-width="formLabelWidth" prop="ippz_zwym">
|
||||
<el-form-item
|
||||
label="子网掩码:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_zwym"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym1" maxlength="3"></el-input>
|
||||
|
@ -62,23 +88,38 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="默认网关:" :label-width="formLabelWidth" prop="ippz_mrwg">
|
||||
<el-form-item
|
||||
label="默认网关:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_mrwg"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5"><el-input v-model="ippz_mrwg1" maxlength="3"></el-input></el-col>
|
||||
<el-col :span="5"
|
||||
><el-input v-model="ippz_mrwg1" maxlength="3"></el-input
|
||||
></el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5"><el-input v-model="ippz_mrwg2" maxlength="3"></el-input></el-col>
|
||||
<el-col :span="5"
|
||||
><el-input v-model="ippz_mrwg2" maxlength="3"></el-input
|
||||
></el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5"><el-input v-model="ippz_mrwg3" maxlength="3"></el-input></el-col>
|
||||
<el-col :span="5"
|
||||
><el-input v-model="ippz_mrwg3" maxlength="3"></el-input
|
||||
></el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5"><el-input v-model="ippz_mrwg4" maxlength="3"></el-input></el-col>
|
||||
<el-col :span="5"
|
||||
><el-input v-model="ippz_mrwg4" maxlength="3"></el-input
|
||||
></el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="首选DNS:" :label-width="formLabelWidth" prop="ippz_dns_sx">
|
||||
<el-form-item
|
||||
label="首选DNS:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_dns_sx"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_sx1" maxlength="3"></el-input>
|
||||
|
@ -99,7 +140,11 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备选DNS:" :label-width="formLabelWidth" prop="ippz_dns_by">
|
||||
<el-form-item
|
||||
label="备选DNS:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_dns_by"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_dns_by1" maxlength="3"></el-input>
|
||||
|
@ -122,11 +167,20 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="MAC地址:" :label-width="formLabelWidth" prop="ippz_mac">
|
||||
<el-form-item
|
||||
label="MAC地址:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="ippz_mac"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24" class="mac">
|
||||
<el-input style="width: 200px; height: 30px" v-model="formData.ippz_mac"></el-input><el-button
|
||||
v-copy="formData.ippz_mac" @click="CopyText">复制</el-button>
|
||||
<el-input
|
||||
style="width: 200px; height: 30px"
|
||||
v-model="formData.ippz_mac"
|
||||
></el-input
|
||||
><el-button v-copy="formData.ippz_mac" @click="CopyText"
|
||||
>复制</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
|
@ -234,7 +288,7 @@ export default {
|
|||
{
|
||||
required: true,
|
||||
message: "请输入网口",
|
||||
trigger: "change"
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
ippz_zwym: [
|
||||
|
@ -242,7 +296,7 @@ export default {
|
|||
required: true,
|
||||
message: "",
|
||||
validator: this.validateZwym,
|
||||
trigger: "blur"
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_ip: [
|
||||
|
@ -250,7 +304,7 @@ export default {
|
|||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIp,
|
||||
trigger: "blur"
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mrwg: [
|
||||
|
@ -258,14 +312,15 @@ export default {
|
|||
required: true,
|
||||
message: "",
|
||||
validator: this.validateMrwg,
|
||||
trigger: "blur"
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_sx: [
|
||||
{
|
||||
required: true, message: "",
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsSx,
|
||||
trigger: "blur"
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_by: [
|
||||
|
@ -273,7 +328,7 @@ export default {
|
|||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsBy,
|
||||
trigger: "blur"
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mac: [
|
||||
|
@ -311,24 +366,24 @@ export default {
|
|||
validateZwym(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_zwym1 +
|
||||
"." +
|
||||
this.ippz_zwym2 +
|
||||
"." +
|
||||
this.ippz_zwym3 +
|
||||
"." +
|
||||
this.ippz_zwym4 ===
|
||||
"." +
|
||||
this.ippz_zwym2 +
|
||||
"." +
|
||||
this.ippz_zwym3 +
|
||||
"." +
|
||||
this.ippz_zwym4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入子网掩码"));
|
||||
} else if (
|
||||
!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(
|
||||
this.ippz_zwym1 +
|
||||
"." +
|
||||
this.ippz_zwym2 +
|
||||
"." +
|
||||
this.ippz_zwym3 +
|
||||
"." +
|
||||
this.ippz_zwym4
|
||||
"." +
|
||||
this.ippz_zwym2 +
|
||||
"." +
|
||||
this.ippz_zwym3 +
|
||||
"." +
|
||||
this.ippz_zwym4
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的子网掩码"));
|
||||
|
@ -340,24 +395,24 @@ export default {
|
|||
validateIp(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_ip1 +
|
||||
"." +
|
||||
this.ippz_ip2 +
|
||||
"." +
|
||||
this.ippz_ip3 +
|
||||
"." +
|
||||
this.ippz_ip4 ===
|
||||
"." +
|
||||
this.ippz_ip2 +
|
||||
"." +
|
||||
this.ippz_ip3 +
|
||||
"." +
|
||||
this.ippz_ip4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入IP地址"));
|
||||
} else if (
|
||||
!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(
|
||||
this.ippz_ip1 +
|
||||
"." +
|
||||
this.ippz_ip2 +
|
||||
"." +
|
||||
this.ippz_ip3 +
|
||||
"." +
|
||||
this.ippz_ip4
|
||||
"." +
|
||||
this.ippz_ip2 +
|
||||
"." +
|
||||
this.ippz_ip3 +
|
||||
"." +
|
||||
this.ippz_ip4
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的IP地址"));
|
||||
|
@ -369,24 +424,24 @@ export default {
|
|||
validateMrwg(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_mrwg1 +
|
||||
"." +
|
||||
this.ippz_mrwg2 +
|
||||
"." +
|
||||
this.ippz_mrwg3 +
|
||||
"." +
|
||||
this.ippz_mrwg4 ===
|
||||
"." +
|
||||
this.ippz_mrwg2 +
|
||||
"." +
|
||||
this.ippz_mrwg3 +
|
||||
"." +
|
||||
this.ippz_mrwg4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入网关地址"));
|
||||
} else if (
|
||||
!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(
|
||||
this.ippz_mrwg1 +
|
||||
"." +
|
||||
this.ippz_mrwg2 +
|
||||
"." +
|
||||
this.ippz_mrwg3 +
|
||||
"." +
|
||||
this.ippz_mrwg4
|
||||
"." +
|
||||
this.ippz_mrwg2 +
|
||||
"." +
|
||||
this.ippz_mrwg3 +
|
||||
"." +
|
||||
this.ippz_mrwg4
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的网关地址"));
|
||||
|
@ -398,24 +453,24 @@ export default {
|
|||
validateDnsSx(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_dns_sx1 +
|
||||
"." +
|
||||
this.ippz_dns_sx2 +
|
||||
"." +
|
||||
this.ippz_dns_sx3 +
|
||||
"." +
|
||||
this.ippz_dns_sx4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入主DNS服务器地址"));
|
||||
} else if (!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test
|
||||
(
|
||||
this.ippz_dns_sx1 +
|
||||
"." +
|
||||
this.ippz_dns_sx2 +
|
||||
"." +
|
||||
this.ippz_dns_sx3 +
|
||||
"." +
|
||||
this.ippz_dns_sx4
|
||||
this.ippz_dns_sx4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入主DNS服务器地址"));
|
||||
} else if (
|
||||
!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(
|
||||
this.ippz_dns_sx1 +
|
||||
"." +
|
||||
this.ippz_dns_sx2 +
|
||||
"." +
|
||||
this.ippz_dns_sx3 +
|
||||
"." +
|
||||
this.ippz_dns_sx4
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的主DNS服务器地址"));
|
||||
|
@ -427,24 +482,24 @@ export default {
|
|||
validateDnsBy(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_dns_by1 +
|
||||
"." +
|
||||
this.ippz_dns_by2 +
|
||||
"." +
|
||||
this.ippz_dns_by3 +
|
||||
"." +
|
||||
this.ippz_dns_by4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入备用DNS服务器地址"));
|
||||
} else if (!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test
|
||||
(
|
||||
this.ippz_dns_by1 +
|
||||
"." +
|
||||
this.ippz_dns_by2 +
|
||||
"." +
|
||||
this.ippz_dns_by3 +
|
||||
"." +
|
||||
this.ippz_dns_by4
|
||||
this.ippz_dns_by4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入备用DNS服务器地址"));
|
||||
} else if (
|
||||
!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(
|
||||
this.ippz_dns_by1 +
|
||||
"." +
|
||||
this.ippz_dns_by2 +
|
||||
"." +
|
||||
this.ippz_dns_by3 +
|
||||
"." +
|
||||
this.ippz_dns_by4
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的备用DNS服务器地址"));
|
||||
|
@ -494,8 +549,8 @@ export default {
|
|||
// sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.formData));
|
||||
let data = {
|
||||
mark: "DB-IotLite_yx",
|
||||
// user_id: this.user_id,
|
||||
user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(this.formData),
|
||||
};
|
||||
let res = await SaveUserAnswer(data);
|
||||
|
@ -523,8 +578,8 @@ export default {
|
|||
this.loading = true;
|
||||
let res2 = await GetUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
// user_id: this.user_id,
|
||||
user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
this.loading = false;
|
||||
console.log(res2);
|
||||
|
@ -532,7 +587,9 @@ export default {
|
|||
let res3 = JSON.parse(res2.data.data.mark_value);
|
||||
console.log(res3);
|
||||
this.formData.ippz_wangkou = res3.ippz_wangkou;
|
||||
if (res3.ippz_mac) { this.formData.ippz_mac = res3.ippz_mac; }
|
||||
if (res3.ippz_mac) {
|
||||
this.formData.ippz_mac = res3.ippz_mac;
|
||||
}
|
||||
if (res3.ippz_mrwg) {
|
||||
this.formData.ippz_mrwg = res3.ippz_mrwg;
|
||||
this.formData.ippz_ip = res3.ippz_ip;
|
||||
|
@ -610,7 +667,7 @@ export default {
|
|||
this.user_id = window.location.href.split("?")[1];
|
||||
this.getUserAnswer();
|
||||
},
|
||||
mounted() { },
|
||||
mounted() {},
|
||||
directives: {
|
||||
copy: {
|
||||
bind(el, { value }) {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -4,8 +4,15 @@
|
|||
<!-- v-click-outside="closeMenu" -->
|
||||
<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"
|
||||
>
|
||||
<!-- <span class="custom-tree-node" slot-scope="{ node, data }">
|
||||
<template v-if="data.editing == 1 && flag">
|
||||
<el-input style="width: 260px;" v-model="gateway" @change="changeInput"></el-input>
|
||||
|
@ -15,7 +22,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>
|
||||
|
@ -27,13 +38,36 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="pas_params">
|
||||
<el-dialog title="通道参数设置" :visible.sync="add_passage" width="765px" v-loading="loading">
|
||||
<el-form :model="FormData" :label-position="labelPosition" :rules="rules" ref="FormData">
|
||||
<el-dialog
|
||||
title="通道参数设置"
|
||||
:visible.sync="add_passage"
|
||||
width="765px"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-form
|
||||
:model="FormData"
|
||||
:label-position="labelPosition"
|
||||
:rules="rules"
|
||||
ref="FormData"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="通道名称:" :label-width="formLabelWidth" prop="tdpz_tdmc">
|
||||
<el-select v-model="FormData.tdpz_tdmc" 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="通道名称:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="tdpz_tdmc"
|
||||
>
|
||||
<el-select
|
||||
v-model="FormData.tdpz_tdmc"
|
||||
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>
|
||||
|
@ -41,21 +75,46 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="通道:" :label-width="formLabelWidth" prop="tdpz_td">
|
||||
<el-select v-model="FormData.tdpz_td" 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="tdpz_td"
|
||||
>
|
||||
<el-select
|
||||
v-model="FormData.tdpz_td"
|
||||
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-col :span="12">
|
||||
<el-form-item label="驱动名称:" :label-width="formLabelWidth" prop="tdpz_qdmc">
|
||||
<el-form-item
|
||||
label="驱动名称:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="tdpz_qdmc"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="18">
|
||||
<el-input v-model="FormData.tdpz_qdmc" placeholder="" style="width: 200px; height: 30px"></el-input>
|
||||
<el-input
|
||||
v-model="FormData.tdpz_qdmc"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-button style="width: 50px; height: 30px" @click="getDriveName">...</el-button>
|
||||
<el-button
|
||||
style="width: 50px; height: 30px"
|
||||
@click="getDriveName"
|
||||
>...</el-button
|
||||
>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
|
@ -63,22 +122,38 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="IP地址:" :label-width="formLabelWidth" prop="tdpz_ip">
|
||||
<el-form-item
|
||||
label="IP地址:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="tdpz_ip"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="tdpz_ip1" style="width: 43px; height: 30px"></el-input>
|
||||
<el-input
|
||||
v-model="tdpz_ip1"
|
||||
style="width: 43px; height: 30px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1" style="color: #fff">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="tdpz_ip2" style="width: 43px; height: 30px"></el-input>
|
||||
<el-input
|
||||
v-model="tdpz_ip2"
|
||||
style="width: 43px; height: 30px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1" style="color: #fff">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="tdpz_ip3" style="width: 43px; height: 30px"></el-input>
|
||||
<el-input
|
||||
v-model="tdpz_ip3"
|
||||
style="width: 43px; height: 30px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1" style="color: #fff">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="tdpz_ip4" style="width: 43px; height: 30px"></el-input>
|
||||
<el-input
|
||||
v-model="tdpz_ip4"
|
||||
style="width: 43px; height: 30px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
|
@ -86,32 +161,72 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="端口号:" :label-width="formLabelWidth" prop="tdpz_port">
|
||||
<el-input v-model="FormData.tdpz_port" placeholder="" style="width: 200px; height: 30px"></el-input>
|
||||
<el-form-item
|
||||
label="端口号:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="tdpz_port"
|
||||
>
|
||||
<el-input
|
||||
v-model="FormData.tdpz_port"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="超过时间(ms):" :label-width="formLabelWidth" prop="tdpz_cssj">
|
||||
<el-input v-model="FormData.tdpz_cssj" placeholder="" style="width: 200px; height: 30px"></el-input>
|
||||
<el-form-item
|
||||
label="超过时间(ms):"
|
||||
:label-width="formLabelWidth"
|
||||
prop="tdpz_cssj"
|
||||
>
|
||||
<el-input
|
||||
v-model="FormData.tdpz_cssj"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="间隔时间(ms):" :label-width="formLabelWidth" prop="tdpz_jgsj">
|
||||
<el-input v-model="FormData.tdpz_jgsj" placeholder="" style="width: 200px; height: 30px"></el-input>
|
||||
<el-form-item
|
||||
label="间隔时间(ms):"
|
||||
:label-width="formLabelWidth"
|
||||
prop="tdpz_jgsj"
|
||||
>
|
||||
<el-input
|
||||
v-model="FormData.tdpz_jgsj"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="轮询时间(ms):" :label-width="formLabelWidth" prop="tdpz_lxsj">
|
||||
<el-input v-model="FormData.tdpz_lxsj" placeholder="" style="width: 200px; height: 30px"></el-input>
|
||||
<el-form-item
|
||||
label="轮询时间(ms):"
|
||||
:label-width="formLabelWidth"
|
||||
prop="tdpz_lxsj"
|
||||
>
|
||||
<el-input
|
||||
v-model="FormData.tdpz_lxsj"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="重复次数:" :label-width="formLabelWidth" prop="tdpz_cfcs">
|
||||
<el-input v-model="FormData.tdpz_cfcs" placeholder="" style="width: 200px; height: 30px"></el-input>
|
||||
<el-form-item
|
||||
label="重复次数:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="tdpz_cfcs"
|
||||
>
|
||||
<el-input
|
||||
v-model="FormData.tdpz_cfcs"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -121,29 +236,47 @@
|
|||
<div>
|
||||
<i class="el-icon-caret-bottom" v-if="is_retract"></i>
|
||||
<i class="el-icon-caret-top" v-else="is_retract"></i>
|
||||
<el-button type="text" plain @click="getRetract" style="
|
||||
<el-button
|
||||
type="text"
|
||||
plain
|
||||
@click="getRetract"
|
||||
style="
|
||||
width: 28px;
|
||||
border: none;
|
||||
color: rgba(16, 16, 16, 1);
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
">
|
||||
收起</el-button>
|
||||
"
|
||||
>
|
||||
收起</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="super_con" v-show="is_retract">
|
||||
<el-form :label-position="labelPosition" :rules="rules" ref="ruleForm">
|
||||
<el-form
|
||||
:label-position="labelPosition"
|
||||
:rules="rules"
|
||||
ref="ruleForm"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="FormData.tdpz_watchtime">watch time(s)</el-checkbox>
|
||||
<el-input v-model="input1" placeholder="" style="width: 200px; height: 30px"
|
||||
:disabled="isdisabled"></el-input>
|
||||
<el-checkbox v-model="FormData.tdpz_watchtime"
|
||||
>watch time(s)</el-checkbox
|
||||
>
|
||||
<el-input
|
||||
v-model="input1"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
:disabled="isdisabled"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="FormData.tdpz_cjsylxdz">采集使用连续地址</el-checkbox>
|
||||
<el-checkbox v-model="FormData.tdpz_cjsylxdz"
|
||||
>采集使用连续地址</el-checkbox
|
||||
>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -152,11 +285,17 @@
|
|||
<el-form-item label="读写占空比:" :label-width="formLabelWidth">
|
||||
<el-row>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="tdpz_dxzkb1" style="width: 91px; height: 30px"></el-input>
|
||||
<el-input
|
||||
v-model="tdpz_dxzkb1"
|
||||
style="width: 91px; height: 30px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="4">: </el-col>
|
||||
<el-col :span="10">
|
||||
<el-input v-model="tdpz_dxzkb2" style="width: 91px; height: 30px"></el-input>
|
||||
<el-input
|
||||
v-model="tdpz_dxzkb2"
|
||||
style="width: 91px; height: 30px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
|
@ -166,18 +305,42 @@
|
|||
<el-col :span="12">
|
||||
<el-form-item label="05/0F:" :label-width="formLabelWidth">
|
||||
<el-row>
|
||||
<el-col :span="8"><el-radio v-model="FormData.tdpz_050F" label="auto">auto</el-radio></el-col>
|
||||
<el-col :span="8"><el-radio v-model="FormData.tdpz_050F" label="05">05</el-radio></el-col>
|
||||
<el-col :span="8"><el-radio v-model="FormData.tdpz_050F" label="0F">0F</el-radio></el-col>
|
||||
<el-col :span="8"
|
||||
><el-radio v-model="FormData.tdpz_050F" label="auto"
|
||||
>auto</el-radio
|
||||
></el-col
|
||||
>
|
||||
<el-col :span="8"
|
||||
><el-radio v-model="FormData.tdpz_050F" label="05"
|
||||
>05</el-radio
|
||||
></el-col
|
||||
>
|
||||
<el-col :span="8"
|
||||
><el-radio v-model="FormData.tdpz_050F" label="0F"
|
||||
>0F</el-radio
|
||||
></el-col
|
||||
>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="06/10:" :label-width="formLabelWidth">
|
||||
<el-row>
|
||||
<el-col :span="8"><el-radio v-model="FormData.tdpz_0610" label="auto">auto</el-radio></el-col>
|
||||
<el-col :span="8"><el-radio v-model="FormData.tdpz_0610" label="06">06</el-radio></el-col>
|
||||
<el-col :span="8"><el-radio v-model="FormData.tdpz_0610" label="10">10</el-radio></el-col>
|
||||
<el-col :span="8"
|
||||
><el-radio v-model="FormData.tdpz_0610" label="auto"
|
||||
>auto</el-radio
|
||||
></el-col
|
||||
>
|
||||
<el-col :span="8"
|
||||
><el-radio v-model="FormData.tdpz_0610" label="06"
|
||||
>06</el-radio
|
||||
></el-col
|
||||
>
|
||||
<el-col :span="8"
|
||||
><el-radio v-model="FormData.tdpz_0610" label="10"
|
||||
>10</el-radio
|
||||
></el-col
|
||||
>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -196,26 +359,64 @@
|
|||
<i class="el-icon-close title_r" @click="diag_drive = false"></i>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<el-tree :data="datas2" :props="defaultProps" @node-click="handleDetailClick" default-expand-all></el-tree>
|
||||
<el-tree
|
||||
:data="datas2"
|
||||
:props="defaultProps"
|
||||
@node-click="handleDetailClick"
|
||||
default-expand-all
|
||||
></el-tree>
|
||||
</div>
|
||||
<div class="gateway">
|
||||
<el-dialog title="新建网关" :visible.sync="outerVisible" width="382px">
|
||||
<el-form :model="FormData" :rules="rulesGate" ref="gateWay" label-width="85px" class="demo-ruleForm">
|
||||
<el-form
|
||||
:model="FormData"
|
||||
:rules="rulesGate"
|
||||
ref="gateWay"
|
||||
label-width="85px"
|
||||
class="demo-ruleForm"
|
||||
>
|
||||
<el-form-item label="网关名称:" prop="wgpz_wgmc">
|
||||
<el-select v-model="FormData.wgpz_wgmc" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in opts1" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="FormData.wgpz_wgmc"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in opts1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="网关ID:" prop="wgpz_wgid">
|
||||
<el-select v-model="FormData.wgpz_wgid" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in opts2" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="FormData.wgpz_wgid"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in opts2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="网关类型:" prop="wgpz_wglx">
|
||||
<el-select v-model="FormData.wgpz_wglx" placeholder="请选择" style="width: 200px">
|
||||
<el-option v-for="item in opts3" :key="item.value" :label="item.label" :value="item.value">
|
||||
<el-select
|
||||
v-model="FormData.wgpz_wglx"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in opts3"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -442,12 +643,14 @@ export default {
|
|||
tdpz_qdmc: [
|
||||
{ required: true, message: "请输入驱动名称", trigger: "change" },
|
||||
],
|
||||
tdpz_ip: [{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIpAddress,
|
||||
trigger: "blur"
|
||||
}],
|
||||
tdpz_ip: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIpAddress,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
tdpz_port: [
|
||||
{ required: true, message: "请输入端口号", trigger: "blur" },
|
||||
],
|
||||
|
@ -536,24 +739,24 @@ export default {
|
|||
validateIpAddress(rule, value, callback) {
|
||||
if (
|
||||
this.tdpz_ip1 +
|
||||
"." +
|
||||
this.tdpz_ip2 +
|
||||
"." +
|
||||
this.tdpz_ip3 +
|
||||
"." +
|
||||
this.tdpz_ip4 ===
|
||||
"." +
|
||||
this.tdpz_ip2 +
|
||||
"." +
|
||||
this.tdpz_ip3 +
|
||||
"." +
|
||||
this.tdpz_ip4 ===
|
||||
"..."
|
||||
) {
|
||||
callback(new Error("请输入IP地址"));
|
||||
} else if (
|
||||
!/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/.test(
|
||||
this.tdpz_ip1 +
|
||||
"." +
|
||||
this.tdpz_ip2 +
|
||||
"." +
|
||||
this.tdpz_ip3 +
|
||||
"." +
|
||||
this.tdpz_ip4
|
||||
"." +
|
||||
this.tdpz_ip2 +
|
||||
"." +
|
||||
this.tdpz_ip3 +
|
||||
"." +
|
||||
this.tdpz_ip4
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的IP地址"));
|
||||
|
@ -675,8 +878,8 @@ export default {
|
|||
console.log(datas);
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: "USER202307301114011710",
|
||||
// user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
mark_value: JSON.stringify(datas),
|
||||
step: "2",
|
||||
});
|
||||
|
@ -701,7 +904,7 @@ export default {
|
|||
);
|
||||
// console.log(this.trees);
|
||||
this.sendTree();
|
||||
this.$router.push(`/dbcollectdevice?user_id=${'USER202307301114011710'}`);
|
||||
this.$router.push(`/dbcollectdevice?user_id=${this.user_id}`);
|
||||
} else {
|
||||
this.$message({
|
||||
message: `保存失败`,
|
||||
|
@ -721,8 +924,8 @@ export default {
|
|||
async GetUserAnswer() {
|
||||
let answer = await GetUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
// user_id: this.user_id,
|
||||
user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
console.log(answer);
|
||||
if (answer.data.data && answer.data.state) {
|
||||
|
@ -795,8 +998,8 @@ export default {
|
|||
},
|
||||
async sendTree() {
|
||||
let result = await SendTree({
|
||||
// user_id: this.user_id,
|
||||
user_id:"USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
data: JSON.stringify(this.trees),
|
||||
type: "1",
|
||||
});
|
||||
|
@ -815,7 +1018,7 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
//
|
||||
//
|
||||
async saveGates() {
|
||||
this.outerVisible = false;
|
||||
// this.innerVisible = false;
|
||||
|
@ -825,8 +1028,8 @@ export default {
|
|||
// console.log(datas);
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
// user_id: this.user_id,
|
||||
user_id: "USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(this.FormData),
|
||||
// step: "1",
|
||||
});
|
||||
|
@ -845,14 +1048,14 @@ export default {
|
|||
});
|
||||
}
|
||||
console.log(res);
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
console.log(this.$route.query.user_id);
|
||||
this.user_id = this.$route.query.user_id;
|
||||
GetTree({
|
||||
// user_id: this.user_id,
|
||||
user_id:"USER202307301114011710",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
type: "1",
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
|
|
Loading…
Reference in New Issue