Merge branch 'master' of http://git.umayle.com:2023/chengdandan/InternetCompetition
This commit is contained in:
commit
5e0e5e7a21
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,729 @@
|
|||
<!-- 有线网关设置 -->
|
||||
<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">
|
||||
<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">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip4" 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="子网掩码:" :label-width="formLabelWidth" prop="ippz_zwym">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym4" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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="1">.</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="1">.</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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer footer">
|
||||
<el-button type="primary" @click="submitForm">保 存</el-button>
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { SaveUserAnswer, GetUserAnswer } from "../api/user";
|
||||
export default {
|
||||
name: "GateWay",
|
||||
data() {
|
||||
return {
|
||||
// disabled: true,
|
||||
user_id: "",
|
||||
// 判断是否保存过
|
||||
loading: false,
|
||||
formData: {
|
||||
ippz_wangkou: "",
|
||||
ippz_zwym: "",
|
||||
ippz_mrwg: "",
|
||||
ippz_dns_sx: "",
|
||||
ippz_dns_by: "",
|
||||
ippz_ip: "",
|
||||
ippz_mac: "3C:2D:50:20:30:3D",
|
||||
wgpz_wgmc: "",
|
||||
wgpz_wgid: "",
|
||||
wgpz_wglx: "",
|
||||
tdpz_tdmc: "",
|
||||
tdpz_td: "",
|
||||
tdpz_qdmc: "",
|
||||
tdpz_ip: "",
|
||||
tdpz_port: "",
|
||||
tdpz_cssj: "",
|
||||
tdpz_jgsj: "",
|
||||
tdpz_lxsj: "",
|
||||
tdpz_cfcs: "",
|
||||
tdpz_watchtime: "",
|
||||
tdpz_cjsylxdz: "",
|
||||
tdpz_dxzkb: "",
|
||||
tdpz_050F: "",
|
||||
tdpz_0610: "",
|
||||
sbpz_sbid: "",
|
||||
sbpz_sbmc: "",
|
||||
sbpz_mac: "",
|
||||
sbpz_jysb: "",
|
||||
sbpz_jdzxz: "",
|
||||
cjdpz_tagid: "",
|
||||
cjdpz_mc: "",
|
||||
cjdpz_sjq: "",
|
||||
cjdpz_jcqdz: "",
|
||||
cjdpz_cjsjlx: "",
|
||||
cjdpz_zjx: "",
|
||||
cjdpz_dxsx: "",
|
||||
cjdpz_beilv: "",
|
||||
mqtt_qiyong: "",
|
||||
mqtt_ip: "",
|
||||
mqtt_port: "",
|
||||
mqtt_wgsn: "",
|
||||
mqtt_sssjfbzt: "",
|
||||
mqtt_qos: "",
|
||||
mqtt_scms: "",
|
||||
mqtt_sczq: "",
|
||||
mqtt_sjgl: "",
|
||||
mqtt_cjd_sbmc: "",
|
||||
mqtt_cjd_tagid: "",
|
||||
},
|
||||
labelPosition: "left",
|
||||
ippz_zwym1: "255",
|
||||
ippz_zwym2: "255",
|
||||
ippz_zwym3: "255",
|
||||
ippz_zwym4: "0",
|
||||
ippz_ip1: "",
|
||||
ippz_ip2: "",
|
||||
ippz_ip3: "",
|
||||
ippz_ip4: "",
|
||||
ippz_mrwg1: "192",
|
||||
ippz_mrwg2: "168",
|
||||
ippz_mrwg3: "1",
|
||||
ippz_mrwg4: "1",
|
||||
ippz_dns_sx1: "8",
|
||||
ippz_dns_sx2: "8",
|
||||
ippz_dns_sx3: "8",
|
||||
ippz_dns_sx4: "8",
|
||||
|
||||
ippz_dns_by1: "8",
|
||||
ippz_dns_by2: "8",
|
||||
ippz_dns_by3: "8",
|
||||
ippz_dns_by4: "8",
|
||||
dialogFormVisible: true,
|
||||
formLabelWidth: "100px",
|
||||
// 有线的规则校验
|
||||
rules_ippz_wirle: {
|
||||
ippz_wangkou: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入网口",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
ippz_zwym: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateZwym,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_ip: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIp,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mrwg: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateMrwg,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_sx: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsSx,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_by: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsBy,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mac: [
|
||||
{ required: true, message: "请输入MAC地址", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// isSaveButtonDisabled() {
|
||||
// return (
|
||||
// !this.$refs.rules_ippz_wirle ||
|
||||
// this.$refs.rules_ippz_wirle.validateSync().length > 0
|
||||
// );
|
||||
// },
|
||||
},
|
||||
methods: {
|
||||
// 提交时的校验
|
||||
submitForm() {
|
||||
this.$refs["formData"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.saveAll();
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 封装合并输入框的数据
|
||||
Merge(value, value1, value2, value3, value4) {
|
||||
value = value1 + "." + value2 + "." + value3 + "." + value4;
|
||||
return value;
|
||||
},
|
||||
//子网掩码验证
|
||||
validateZwym(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_zwym1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的子网掩码"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//ip地址验证
|
||||
validateIp(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_ip1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的IP地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//默认网关验证
|
||||
validateMrwg(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_mrwg1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的网关地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//首选DNS服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的主DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//备选dns服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的备用DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
// 保存数据, 发送请求
|
||||
async saveAll() {
|
||||
this.formData.ippz_ip = this.Merge(
|
||||
this.formData.ippz_ip,
|
||||
this.ippz_ip1,
|
||||
this.ippz_ip2,
|
||||
this.ippz_ip3,
|
||||
this.ippz_ip4
|
||||
);
|
||||
this.formData.ippz_zwym = this.Merge(
|
||||
this.formData.ippz_zwym,
|
||||
this.ippz_zwym1,
|
||||
this.ippz_zwym2,
|
||||
this.ippz_zwym3,
|
||||
this.ippz_zwym4
|
||||
);
|
||||
this.formData.ippz_mrwg = this.Merge(
|
||||
this.formData.ippz_mrwg,
|
||||
this.ippz_mrwg1,
|
||||
this.ippz_mrwg2,
|
||||
this.ippz_mrwg3,
|
||||
this.ippz_mrwg4
|
||||
);
|
||||
this.formData.ippz_dns_sx = this.Merge(
|
||||
this.formData.ippz_dns_sx,
|
||||
this.ippz_dns_sx1,
|
||||
this.ippz_dns_sx2,
|
||||
this.ippz_dns_sx3,
|
||||
this.ippz_dns_sx4
|
||||
);
|
||||
this.formData.ippz_dns_by = this.Merge(
|
||||
this.formData.ippz_dns_by,
|
||||
this.ippz_dns_by1,
|
||||
this.ippz_dns_by2,
|
||||
this.ippz_dns_by3,
|
||||
this.ippz_dns_by4
|
||||
);
|
||||
console.log(this.formData);
|
||||
// sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.formData));
|
||||
let data = {
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(this.formData),
|
||||
};
|
||||
let res = await SaveUserAnswer(data);
|
||||
console.log(res);
|
||||
if (res.data.state) {
|
||||
this.$message({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
message: `保存失败`,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
console.log(res);
|
||||
},
|
||||
CopyText() {
|
||||
this.$message({
|
||||
message: "复制成功",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
async getUserAnswer() {
|
||||
this.loading = true;
|
||||
let res2 = await GetUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
this.loading = false;
|
||||
console.log(res2);
|
||||
if (res2.data.data && res2.data.state) {
|
||||
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_mrwg) {
|
||||
this.formData.ippz_mrwg = res3.ippz_mrwg;
|
||||
this.formData.ippz_ip = res3.ippz_ip;
|
||||
this.formData.zwym = res3.zwym;
|
||||
this.formData.ippz_dns_sx = res3.ippz_dns_sx;
|
||||
this.formData.ippz_dns_by = res3.ippz_dns_by;
|
||||
this.ippz_mrwg1 = res3.ippz_mrwg.split(".")[0];
|
||||
this.ippz_mrwg2 = res3.ippz_mrwg.split(".")[1];
|
||||
this.ippz_mrwg3 = res3.ippz_mrwg.split(".")[2];
|
||||
this.ippz_mrwg4 = res3.ippz_mrwg.split(".")[3];
|
||||
this.ippz_ip1 = res3.ippz_ip.split(".")[0];
|
||||
this.ippz_ip2 = res3.ippz_ip.split(".")[1];
|
||||
this.ippz_ip3 = res3.ippz_ip.split(".")[2];
|
||||
this.ippz_ip4 = res3.ippz_ip.split(".")[3];
|
||||
this.ippz_zwym1 = res3.ippz_zwym.split(".")[0];
|
||||
this.ippz_zwym2 = res3.ippz_zwym.split(".")[1];
|
||||
this.ippz_zwym3 = res3.ippz_zwym.split(".")[2];
|
||||
this.ippz_zwym4 = res3.ippz_zwym.split(".")[3];
|
||||
this.ippz_dns_sx1 = res3.ippz_dns_sx.split(".")[0];
|
||||
this.ippz_dns_sx2 = res3.ippz_dns_sx.split(".")[1];
|
||||
this.ippz_dns_sx3 = res3.ippz_dns_sx.split(".")[2];
|
||||
this.ippz_dns_sx4 = res3.ippz_dns_sx.split(".")[3];
|
||||
this.ippz_dns_by1 = res3.ippz_dns_by.split(".")[0];
|
||||
this.ippz_dns_by2 = res3.ippz_dns_by.split(".")[1];
|
||||
this.ippz_dns_by3 = res3.ippz_dns_by.split(".")[2];
|
||||
this.ippz_dns_by4 = res3.ippz_dns_by.split(".")[3];
|
||||
}
|
||||
this.formData.wgpz_wgmc = res3.wgpz_wgmc;
|
||||
this.formData.wgpz_wgid = res3.wgpz_wgid;
|
||||
this.formData.wgpz_wglx = res3.wgpz_wglx;
|
||||
this.formData.tdpz_tdmc = res3.tdpz_tdmc;
|
||||
this.formData.tdpz_td = res3.tdpz_td;
|
||||
this.formData.tdpz_qdmc = res3.tdpz_qdmc;
|
||||
this.formData.tdpz_ip = res3.tdpz_ip;
|
||||
this.formData.tdpz_port = res3.tdpz_port;
|
||||
this.formData.tdpz_cssj = res3.tdpz_cssj;
|
||||
this.formData.tdpz_jgsj = res3.tdpz_jgsj;
|
||||
this.formData.tdpz_lxsj = res3.tdpz_lxsj;
|
||||
this.formData.tdpz_cfcs = res3.tdpz_cfcs;
|
||||
this.formData.tdpz_watchtime = res3.tdpz_watchtime;
|
||||
this.formData.tdpz_cjsylxdz = res3.tdpz_cjsylxdz;
|
||||
this.formData.tdpz_dxzkb = res3.tdpz_dxzkb;
|
||||
this.formData.tdpz_050F = res3.tdpz_050F;
|
||||
this.formData.tdpz_0610 = res3.tdpz_0610;
|
||||
this.formData.sbpz_sbid = res3.sbpz_sbid;
|
||||
this.formData.sbpz_sbmc = res3.sbpz_sbmc;
|
||||
this.formData.sbpz_mac = res3.sbpz_mac;
|
||||
this.formData.sbpz_jysb = res3.sbpz_jysb;
|
||||
this.formData.sbpz_jdzxz = res3.sbpz_jdzxz;
|
||||
|
||||
this.formData.cjdpz_tagid = res3.cjdpz_tagid;
|
||||
this.formData.cjdpz_mc = res3.cjdpz_mc;
|
||||
this.formData.cjdpz_sjq = res3.cjdpz_sjq;
|
||||
this.formData.cjdpz_jcqdz = res3.cjdpz_jcqdz;
|
||||
this.formData.cjdpz_cjsjlx = res3.cjdpz_cjsjlx;
|
||||
this.formData.cjdpz_zjx = res3.cjdpz_zjx;
|
||||
this.formData.cjdpz_dxsx = res3.cjdpz_dxsx;
|
||||
this.formData.cjdpz_beilv = res3.cjdpz_beilv;
|
||||
|
||||
this.formData.mqtt_qiyong = res3.mqtt_qiyong;
|
||||
this.formData.mqtt_ip = res3.mqtt_ip;
|
||||
this.formData.mqtt_port = res3.mqtt_port;
|
||||
this.formData.mqtt_wgsn = res3.mqtt_wgsn;
|
||||
this.formData.mqtt_sssjfbzt = res3.mqtt_sssjfbzt;
|
||||
this.formData.mqtt_qos = res3.mqtt_qos;
|
||||
this.formData.mqtt_scms = res3.mqtt_scms;
|
||||
this.formData.mqtt_sczq = res3.mqtt_sczq;
|
||||
this.formData.mqtt_sjgl = res3.mqtt_sjgl;
|
||||
this.formData.mqtt_cjd_sbmc = res3.mqtt_cjd_sbmc;
|
||||
this.formData.mqtt_cjd_tagid = res3.mqtt_cjd_tagid;
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.user_id = window.location.href.split("?")[1];
|
||||
this.getUserAnswer();
|
||||
},
|
||||
mounted() { },
|
||||
directives: {
|
||||
copy: {
|
||||
bind(el, { value }) {
|
||||
// 给元素赋值一个$value值,即指令绑定的值
|
||||
el.$value = value;
|
||||
el.handler = () => {
|
||||
// 如果可复制的值为空的时候,给出提示;
|
||||
if (!el.$value) {
|
||||
console.log("无复制内容");
|
||||
return;
|
||||
}
|
||||
// 动态创建 textarea 标签
|
||||
const textarea = document.createElement("textarea");
|
||||
// 将该 textarea 设为 readonly 防止 IOS 下自动唤起键盘,同时将 textarea 移除可视区域
|
||||
textarea.readOnly = "readonly";
|
||||
textarea.style.position = "absolute";
|
||||
textarea.style.left = "-9999px";
|
||||
// 将要copy的值赋值给textarea 标签的value属性
|
||||
textarea.value = el.$value;
|
||||
// 将textarea 插入到body中
|
||||
document.body.appendChild(textarea);
|
||||
// 选中值并复制
|
||||
textarea.select();
|
||||
const result = document.execCommand("Copy");
|
||||
if (result) {
|
||||
console.log("复制成功");
|
||||
}
|
||||
document.body.removeChild(textarea);
|
||||
};
|
||||
// 绑定点击事件,点击的时候copy值
|
||||
el.addEventListener("click", el.handler);
|
||||
},
|
||||
// 当传递进来的值更新的时候触发
|
||||
componentUpdated(el, { value }) {
|
||||
el.$value = value;
|
||||
},
|
||||
// 指令与元素解绑的时候,移除事件绑定
|
||||
unbind(el) {
|
||||
el.removeEventListener("click", el.handler);
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.title_center {
|
||||
font-size: 18px;
|
||||
color: red;
|
||||
position: absolute;
|
||||
left: 100px;
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
/deep/ .wired,
|
||||
/deep/ .wifi {
|
||||
.el-row {
|
||||
.el-col-12:last-child {
|
||||
padding-right: 120px;
|
||||
}
|
||||
|
||||
.el-col-12:first-child {
|
||||
padding-right: 118px;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.el-row {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
|
||||
.el-col-1 {
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.mac {
|
||||
// display: flex;
|
||||
align-items: center;
|
||||
|
||||
.el-button {
|
||||
position: absolute;
|
||||
left: 200px;
|
||||
bottom: 5px;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
line-height: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.netWay {
|
||||
margin-bottom: 20px;
|
||||
width: 80px;
|
||||
color: rgba(16, 16, 16, 1);
|
||||
font-size: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
left: 360px;
|
||||
bottom: 2px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,729 @@
|
|||
<!-- 有线网关设置 -->
|
||||
<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">
|
||||
<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">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip4" 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="子网掩码:" :label-width="formLabelWidth" prop="ippz_zwym">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym4" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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="1">.</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="1">.</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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer footer">
|
||||
<el-button type="primary" @click="submitForm">保 存</el-button>
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { SaveUserAnswer, GetUserAnswer } from "../api/user";
|
||||
export default {
|
||||
name: "GateWay",
|
||||
data() {
|
||||
return {
|
||||
// disabled: true,
|
||||
user_id: "",
|
||||
// 判断是否保存过
|
||||
loading: false,
|
||||
formData: {
|
||||
ippz_wangkou: "",
|
||||
ippz_zwym: "",
|
||||
ippz_mrwg: "",
|
||||
ippz_dns_sx: "",
|
||||
ippz_dns_by: "",
|
||||
ippz_ip: "",
|
||||
ippz_mac: "3C:2D:50:20:30:3D",
|
||||
wgpz_wgmc: "",
|
||||
wgpz_wgid: "",
|
||||
wgpz_wglx: "",
|
||||
tdpz_tdmc: "",
|
||||
tdpz_td: "",
|
||||
tdpz_qdmc: "",
|
||||
tdpz_ip: "",
|
||||
tdpz_port: "",
|
||||
tdpz_cssj: "",
|
||||
tdpz_jgsj: "",
|
||||
tdpz_lxsj: "",
|
||||
tdpz_cfcs: "",
|
||||
tdpz_watchtime: "",
|
||||
tdpz_cjsylxdz: "",
|
||||
tdpz_dxzkb: "",
|
||||
tdpz_050F: "",
|
||||
tdpz_0610: "",
|
||||
sbpz_sbid: "",
|
||||
sbpz_sbmc: "",
|
||||
sbpz_mac: "",
|
||||
sbpz_jysb: "",
|
||||
sbpz_jdzxz: "",
|
||||
cjdpz_tagid: "",
|
||||
cjdpz_mc: "",
|
||||
cjdpz_sjq: "",
|
||||
cjdpz_jcqdz: "",
|
||||
cjdpz_cjsjlx: "",
|
||||
cjdpz_zjx: "",
|
||||
cjdpz_dxsx: "",
|
||||
cjdpz_beilv: "",
|
||||
mqtt_qiyong: "",
|
||||
mqtt_ip: "",
|
||||
mqtt_port: "",
|
||||
mqtt_wgsn: "",
|
||||
mqtt_sssjfbzt: "",
|
||||
mqtt_qos: "",
|
||||
mqtt_scms: "",
|
||||
mqtt_sczq: "",
|
||||
mqtt_sjgl: "",
|
||||
mqtt_cjd_sbmc: "",
|
||||
mqtt_cjd_tagid: "",
|
||||
},
|
||||
labelPosition: "left",
|
||||
ippz_zwym1: "255",
|
||||
ippz_zwym2: "255",
|
||||
ippz_zwym3: "255",
|
||||
ippz_zwym4: "0",
|
||||
ippz_ip1: "",
|
||||
ippz_ip2: "",
|
||||
ippz_ip3: "",
|
||||
ippz_ip4: "",
|
||||
ippz_mrwg1: "192",
|
||||
ippz_mrwg2: "168",
|
||||
ippz_mrwg3: "1",
|
||||
ippz_mrwg4: "1",
|
||||
ippz_dns_sx1: "8",
|
||||
ippz_dns_sx2: "8",
|
||||
ippz_dns_sx3: "8",
|
||||
ippz_dns_sx4: "8",
|
||||
|
||||
ippz_dns_by1: "8",
|
||||
ippz_dns_by2: "8",
|
||||
ippz_dns_by3: "8",
|
||||
ippz_dns_by4: "8",
|
||||
dialogFormVisible: true,
|
||||
formLabelWidth: "100px",
|
||||
// 有线的规则校验
|
||||
rules_ippz_wirle: {
|
||||
ippz_wangkou: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入网口",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
ippz_zwym: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateZwym,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_ip: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIp,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mrwg: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateMrwg,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_sx: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsSx,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_by: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsBy,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mac: [
|
||||
{ required: true, message: "请输入MAC地址", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// isSaveButtonDisabled() {
|
||||
// return (
|
||||
// !this.$refs.rules_ippz_wirle ||
|
||||
// this.$refs.rules_ippz_wirle.validateSync().length > 0
|
||||
// );
|
||||
// },
|
||||
},
|
||||
methods: {
|
||||
// 提交时的校验
|
||||
submitForm() {
|
||||
this.$refs["formData"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.saveAll();
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 封装合并输入框的数据
|
||||
Merge(value, value1, value2, value3, value4) {
|
||||
value = value1 + "." + value2 + "." + value3 + "." + value4;
|
||||
return value;
|
||||
},
|
||||
//子网掩码验证
|
||||
validateZwym(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_zwym1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的子网掩码"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//ip地址验证
|
||||
validateIp(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_ip1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的IP地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//默认网关验证
|
||||
validateMrwg(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_mrwg1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的网关地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//首选DNS服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的主DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//备选dns服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的备用DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
// 保存数据, 发送请求
|
||||
async saveAll() {
|
||||
this.formData.ippz_ip = this.Merge(
|
||||
this.formData.ippz_ip,
|
||||
this.ippz_ip1,
|
||||
this.ippz_ip2,
|
||||
this.ippz_ip3,
|
||||
this.ippz_ip4
|
||||
);
|
||||
this.formData.ippz_zwym = this.Merge(
|
||||
this.formData.ippz_zwym,
|
||||
this.ippz_zwym1,
|
||||
this.ippz_zwym2,
|
||||
this.ippz_zwym3,
|
||||
this.ippz_zwym4
|
||||
);
|
||||
this.formData.ippz_mrwg = this.Merge(
|
||||
this.formData.ippz_mrwg,
|
||||
this.ippz_mrwg1,
|
||||
this.ippz_mrwg2,
|
||||
this.ippz_mrwg3,
|
||||
this.ippz_mrwg4
|
||||
);
|
||||
this.formData.ippz_dns_sx = this.Merge(
|
||||
this.formData.ippz_dns_sx,
|
||||
this.ippz_dns_sx1,
|
||||
this.ippz_dns_sx2,
|
||||
this.ippz_dns_sx3,
|
||||
this.ippz_dns_sx4
|
||||
);
|
||||
this.formData.ippz_dns_by = this.Merge(
|
||||
this.formData.ippz_dns_by,
|
||||
this.ippz_dns_by1,
|
||||
this.ippz_dns_by2,
|
||||
this.ippz_dns_by3,
|
||||
this.ippz_dns_by4
|
||||
);
|
||||
console.log(this.formData);
|
||||
// sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.formData));
|
||||
let data = {
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(this.formData),
|
||||
};
|
||||
let res = await SaveUserAnswer(data);
|
||||
console.log(res);
|
||||
if (res.data.state) {
|
||||
this.$message({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
message: `保存失败`,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
console.log(res);
|
||||
},
|
||||
CopyText() {
|
||||
this.$message({
|
||||
message: "复制成功",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
async getUserAnswer() {
|
||||
this.loading = true;
|
||||
let res2 = await GetUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
this.loading = false;
|
||||
console.log(res2);
|
||||
if (res2.data.data && res2.data.state) {
|
||||
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_mrwg) {
|
||||
this.formData.ippz_mrwg = res3.ippz_mrwg;
|
||||
this.formData.ippz_ip = res3.ippz_ip;
|
||||
this.formData.zwym = res3.zwym;
|
||||
this.formData.ippz_dns_sx = res3.ippz_dns_sx;
|
||||
this.formData.ippz_dns_by = res3.ippz_dns_by;
|
||||
this.ippz_mrwg1 = res3.ippz_mrwg.split(".")[0];
|
||||
this.ippz_mrwg2 = res3.ippz_mrwg.split(".")[1];
|
||||
this.ippz_mrwg3 = res3.ippz_mrwg.split(".")[2];
|
||||
this.ippz_mrwg4 = res3.ippz_mrwg.split(".")[3];
|
||||
this.ippz_ip1 = res3.ippz_ip.split(".")[0];
|
||||
this.ippz_ip2 = res3.ippz_ip.split(".")[1];
|
||||
this.ippz_ip3 = res3.ippz_ip.split(".")[2];
|
||||
this.ippz_ip4 = res3.ippz_ip.split(".")[3];
|
||||
this.ippz_zwym1 = res3.ippz_zwym.split(".")[0];
|
||||
this.ippz_zwym2 = res3.ippz_zwym.split(".")[1];
|
||||
this.ippz_zwym3 = res3.ippz_zwym.split(".")[2];
|
||||
this.ippz_zwym4 = res3.ippz_zwym.split(".")[3];
|
||||
this.ippz_dns_sx1 = res3.ippz_dns_sx.split(".")[0];
|
||||
this.ippz_dns_sx2 = res3.ippz_dns_sx.split(".")[1];
|
||||
this.ippz_dns_sx3 = res3.ippz_dns_sx.split(".")[2];
|
||||
this.ippz_dns_sx4 = res3.ippz_dns_sx.split(".")[3];
|
||||
this.ippz_dns_by1 = res3.ippz_dns_by.split(".")[0];
|
||||
this.ippz_dns_by2 = res3.ippz_dns_by.split(".")[1];
|
||||
this.ippz_dns_by3 = res3.ippz_dns_by.split(".")[2];
|
||||
this.ippz_dns_by4 = res3.ippz_dns_by.split(".")[3];
|
||||
}
|
||||
this.formData.wgpz_wgmc = res3.wgpz_wgmc;
|
||||
this.formData.wgpz_wgid = res3.wgpz_wgid;
|
||||
this.formData.wgpz_wglx = res3.wgpz_wglx;
|
||||
this.formData.tdpz_tdmc = res3.tdpz_tdmc;
|
||||
this.formData.tdpz_td = res3.tdpz_td;
|
||||
this.formData.tdpz_qdmc = res3.tdpz_qdmc;
|
||||
this.formData.tdpz_ip = res3.tdpz_ip;
|
||||
this.formData.tdpz_port = res3.tdpz_port;
|
||||
this.formData.tdpz_cssj = res3.tdpz_cssj;
|
||||
this.formData.tdpz_jgsj = res3.tdpz_jgsj;
|
||||
this.formData.tdpz_lxsj = res3.tdpz_lxsj;
|
||||
this.formData.tdpz_cfcs = res3.tdpz_cfcs;
|
||||
this.formData.tdpz_watchtime = res3.tdpz_watchtime;
|
||||
this.formData.tdpz_cjsylxdz = res3.tdpz_cjsylxdz;
|
||||
this.formData.tdpz_dxzkb = res3.tdpz_dxzkb;
|
||||
this.formData.tdpz_050F = res3.tdpz_050F;
|
||||
this.formData.tdpz_0610 = res3.tdpz_0610;
|
||||
this.formData.sbpz_sbid = res3.sbpz_sbid;
|
||||
this.formData.sbpz_sbmc = res3.sbpz_sbmc;
|
||||
this.formData.sbpz_mac = res3.sbpz_mac;
|
||||
this.formData.sbpz_jysb = res3.sbpz_jysb;
|
||||
this.formData.sbpz_jdzxz = res3.sbpz_jdzxz;
|
||||
|
||||
this.formData.cjdpz_tagid = res3.cjdpz_tagid;
|
||||
this.formData.cjdpz_mc = res3.cjdpz_mc;
|
||||
this.formData.cjdpz_sjq = res3.cjdpz_sjq;
|
||||
this.formData.cjdpz_jcqdz = res3.cjdpz_jcqdz;
|
||||
this.formData.cjdpz_cjsjlx = res3.cjdpz_cjsjlx;
|
||||
this.formData.cjdpz_zjx = res3.cjdpz_zjx;
|
||||
this.formData.cjdpz_dxsx = res3.cjdpz_dxsx;
|
||||
this.formData.cjdpz_beilv = res3.cjdpz_beilv;
|
||||
|
||||
this.formData.mqtt_qiyong = res3.mqtt_qiyong;
|
||||
this.formData.mqtt_ip = res3.mqtt_ip;
|
||||
this.formData.mqtt_port = res3.mqtt_port;
|
||||
this.formData.mqtt_wgsn = res3.mqtt_wgsn;
|
||||
this.formData.mqtt_sssjfbzt = res3.mqtt_sssjfbzt;
|
||||
this.formData.mqtt_qos = res3.mqtt_qos;
|
||||
this.formData.mqtt_scms = res3.mqtt_scms;
|
||||
this.formData.mqtt_sczq = res3.mqtt_sczq;
|
||||
this.formData.mqtt_sjgl = res3.mqtt_sjgl;
|
||||
this.formData.mqtt_cjd_sbmc = res3.mqtt_cjd_sbmc;
|
||||
this.formData.mqtt_cjd_tagid = res3.mqtt_cjd_tagid;
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.user_id = window.location.href.split("?")[1];
|
||||
this.getUserAnswer();
|
||||
},
|
||||
mounted() { },
|
||||
directives: {
|
||||
copy: {
|
||||
bind(el, { value }) {
|
||||
// 给元素赋值一个$value值,即指令绑定的值
|
||||
el.$value = value;
|
||||
el.handler = () => {
|
||||
// 如果可复制的值为空的时候,给出提示;
|
||||
if (!el.$value) {
|
||||
console.log("无复制内容");
|
||||
return;
|
||||
}
|
||||
// 动态创建 textarea 标签
|
||||
const textarea = document.createElement("textarea");
|
||||
// 将该 textarea 设为 readonly 防止 IOS 下自动唤起键盘,同时将 textarea 移除可视区域
|
||||
textarea.readOnly = "readonly";
|
||||
textarea.style.position = "absolute";
|
||||
textarea.style.left = "-9999px";
|
||||
// 将要copy的值赋值给textarea 标签的value属性
|
||||
textarea.value = el.$value;
|
||||
// 将textarea 插入到body中
|
||||
document.body.appendChild(textarea);
|
||||
// 选中值并复制
|
||||
textarea.select();
|
||||
const result = document.execCommand("Copy");
|
||||
if (result) {
|
||||
console.log("复制成功");
|
||||
}
|
||||
document.body.removeChild(textarea);
|
||||
};
|
||||
// 绑定点击事件,点击的时候copy值
|
||||
el.addEventListener("click", el.handler);
|
||||
},
|
||||
// 当传递进来的值更新的时候触发
|
||||
componentUpdated(el, { value }) {
|
||||
el.$value = value;
|
||||
},
|
||||
// 指令与元素解绑的时候,移除事件绑定
|
||||
unbind(el) {
|
||||
el.removeEventListener("click", el.handler);
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.title_center {
|
||||
font-size: 18px;
|
||||
color: red;
|
||||
position: absolute;
|
||||
left: 100px;
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
/deep/ .wired,
|
||||
/deep/ .wifi {
|
||||
.el-row {
|
||||
.el-col-12:last-child {
|
||||
padding-right: 120px;
|
||||
}
|
||||
|
||||
.el-col-12:first-child {
|
||||
padding-right: 118px;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.el-row {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
|
||||
.el-col-1 {
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.mac {
|
||||
// display: flex;
|
||||
align-items: center;
|
||||
|
||||
.el-button {
|
||||
position: absolute;
|
||||
left: 200px;
|
||||
bottom: 5px;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
line-height: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.netWay {
|
||||
margin-bottom: 20px;
|
||||
width: 80px;
|
||||
color: rgba(16, 16, 16, 1);
|
||||
font-size: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
left: 360px;
|
||||
bottom: 2px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,730 @@
|
|||
<!-- 有线网关设置 -->
|
||||
<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">
|
||||
<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">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip4" 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="子网掩码:" :label-width="formLabelWidth" prop="ippz_zwym">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym4" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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="1">.</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="1">.</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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer footer">
|
||||
<el-button type="primary" @click="submitForm">保 存</el-button>
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { SaveUserAnswer, GetUserAnswer } from "../api/user";
|
||||
export default {
|
||||
name: "GateWay",
|
||||
data() {
|
||||
return {
|
||||
// disabled: true,
|
||||
user_id: "",
|
||||
// 判断是否保存过
|
||||
loading: false,
|
||||
formData: {
|
||||
ippz_wangkou: "",
|
||||
ippz_zwym: "",
|
||||
ippz_mrwg: "",
|
||||
ippz_dns_sx: "",
|
||||
ippz_dns_by: "",
|
||||
ippz_ip: "",
|
||||
ippz_mac: "3C:2D:50:20:30:3D",
|
||||
wgpz_wgmc: "",
|
||||
wgpz_wgid: "",
|
||||
wgpz_wglx: "",
|
||||
tdpz_tdmc: "",
|
||||
tdpz_td: "",
|
||||
tdpz_qdmc: "",
|
||||
tdpz_ip: "",
|
||||
tdpz_port: "",
|
||||
tdpz_cssj: "",
|
||||
tdpz_jgsj: "",
|
||||
tdpz_lxsj: "",
|
||||
tdpz_cfcs: "",
|
||||
tdpz_watchtime: "",
|
||||
tdpz_cjsylxdz: "",
|
||||
tdpz_dxzkb: "",
|
||||
tdpz_050F: "",
|
||||
tdpz_0610: "",
|
||||
sbpz_sbid: "",
|
||||
sbpz_sbmc: "",
|
||||
sbpz_mac: "",
|
||||
sbpz_jysb: "",
|
||||
sbpz_jdzxz: "",
|
||||
cjdpz_tagid: "",
|
||||
cjdpz_mc: "",
|
||||
cjdpz_sjq: "",
|
||||
cjdpz_jcqdz: "",
|
||||
cjdpz_cjsjlx: "",
|
||||
cjdpz_zjx: "",
|
||||
cjdpz_dxsx: "",
|
||||
cjdpz_beilv: "",
|
||||
mqtt_qiyong: "",
|
||||
mqtt_ip: "",
|
||||
mqtt_port: "",
|
||||
mqtt_wgsn: "",
|
||||
mqtt_sssjfbzt: "",
|
||||
mqtt_qos: "",
|
||||
mqtt_scms: "",
|
||||
mqtt_sczq: "",
|
||||
mqtt_sjgl: "",
|
||||
mqtt_cjd_sbmc: "",
|
||||
mqtt_cjd_tagid: "",
|
||||
},
|
||||
labelPosition: "left",
|
||||
ippz_zwym1: "255",
|
||||
ippz_zwym2: "255",
|
||||
ippz_zwym3: "255",
|
||||
ippz_zwym4: "0",
|
||||
ippz_ip1: "",
|
||||
ippz_ip2: "",
|
||||
ippz_ip3: "",
|
||||
ippz_ip4: "",
|
||||
ippz_mrwg1: "192",
|
||||
ippz_mrwg2: "168",
|
||||
ippz_mrwg3: "1",
|
||||
ippz_mrwg4: "1",
|
||||
ippz_dns_sx1: "8",
|
||||
ippz_dns_sx2: "8",
|
||||
ippz_dns_sx3: "8",
|
||||
ippz_dns_sx4: "8",
|
||||
|
||||
ippz_dns_by1: "8",
|
||||
ippz_dns_by2: "8",
|
||||
ippz_dns_by3: "8",
|
||||
ippz_dns_by4: "8",
|
||||
dialogFormVisible: true,
|
||||
formLabelWidth: "100px",
|
||||
// 有线的规则校验
|
||||
rules_ippz_wirle: {
|
||||
ippz_wangkou: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入网口",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
ippz_zwym: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateZwym,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_ip: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIp,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mrwg: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateMrwg,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_sx: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsSx,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_by: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsBy,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mac: [
|
||||
{ required: true, message: "请输入MAC地址", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// isSaveButtonDisabled() {
|
||||
// return (
|
||||
// !this.$refs.rules_ippz_wirle ||
|
||||
// this.$refs.rules_ippz_wirle.validateSync().length > 0
|
||||
// );
|
||||
// },
|
||||
},
|
||||
methods: {
|
||||
// 提交时的校验
|
||||
submitForm() {
|
||||
this.$refs["formData"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.saveAll();
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 封装合并输入框的数据
|
||||
Merge(value, value1, value2, value3, value4) {
|
||||
value = value1 + "." + value2 + "." + value3 + "." + value4;
|
||||
return value;
|
||||
},
|
||||
//子网掩码验证
|
||||
validateZwym(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_zwym1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的子网掩码"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//ip地址验证
|
||||
validateIp(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_ip1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的IP地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//默认网关验证
|
||||
validateMrwg(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_mrwg1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的网关地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//首选DNS服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的主DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//备选dns服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的备用DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
// 保存数据, 发送请求
|
||||
async saveAll() {
|
||||
this.formData.ippz_ip = this.Merge(
|
||||
this.formData.ippz_ip,
|
||||
this.ippz_ip1,
|
||||
this.ippz_ip2,
|
||||
this.ippz_ip3,
|
||||
this.ippz_ip4
|
||||
);
|
||||
this.formData.ippz_zwym = this.Merge(
|
||||
this.formData.ippz_zwym,
|
||||
this.ippz_zwym1,
|
||||
this.ippz_zwym2,
|
||||
this.ippz_zwym3,
|
||||
this.ippz_zwym4
|
||||
);
|
||||
this.formData.ippz_mrwg = this.Merge(
|
||||
this.formData.ippz_mrwg,
|
||||
this.ippz_mrwg1,
|
||||
this.ippz_mrwg2,
|
||||
this.ippz_mrwg3,
|
||||
this.ippz_mrwg4
|
||||
);
|
||||
this.formData.ippz_dns_sx = this.Merge(
|
||||
this.formData.ippz_dns_sx,
|
||||
this.ippz_dns_sx1,
|
||||
this.ippz_dns_sx2,
|
||||
this.ippz_dns_sx3,
|
||||
this.ippz_dns_sx4
|
||||
);
|
||||
this.formData.ippz_dns_by = this.Merge(
|
||||
this.formData.ippz_dns_by,
|
||||
this.ippz_dns_by1,
|
||||
this.ippz_dns_by2,
|
||||
this.ippz_dns_by3,
|
||||
this.ippz_dns_by4
|
||||
);
|
||||
console.log(this.formData);
|
||||
// sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.formData));
|
||||
let data = {
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(this.formData),
|
||||
};
|
||||
let res = await SaveUserAnswer(data);
|
||||
console.log(res);
|
||||
if (res.data.state) {
|
||||
this.$message({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
message: `保存失败`,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
console.log(res);
|
||||
},
|
||||
CopyText() {
|
||||
this.$message({
|
||||
message: "复制成功",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
async getUserAnswer() {
|
||||
this.loading = true;
|
||||
let res2 = await GetUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
this.loading = false;
|
||||
console.log(res2);
|
||||
if (res2.data.data && res2.data.state) {
|
||||
let res3 = JSON.parse(res2.data.data.mark_value);
|
||||
console.log(res3);
|
||||
|
||||
if (res3.ippz_mac) {
|
||||
this.formData.ippz_mac = res3.ippz_mac;
|
||||
}
|
||||
if (res3.ippz_mrwg) {
|
||||
this.formData.ippz_wangkou = res3.ippz_wangkou;
|
||||
this.formData.ippz_mrwg = res3.ippz_mrwg;
|
||||
this.formData.ippz_ip = res3.ippz_ip;
|
||||
this.formData.zwym = res3.zwym;
|
||||
this.formData.ippz_dns_sx = res3.ippz_dns_sx;
|
||||
this.formData.ippz_dns_by = res3.ippz_dns_by;
|
||||
this.ippz_mrwg1 = res3.ippz_mrwg.split(".")[0];
|
||||
this.ippz_mrwg2 = res3.ippz_mrwg.split(".")[1];
|
||||
this.ippz_mrwg3 = res3.ippz_mrwg.split(".")[2];
|
||||
this.ippz_mrwg4 = res3.ippz_mrwg.split(".")[3];
|
||||
this.ippz_ip1 = res3.ippz_ip.split(".")[0];
|
||||
this.ippz_ip2 = res3.ippz_ip.split(".")[1];
|
||||
this.ippz_ip3 = res3.ippz_ip.split(".")[2];
|
||||
this.ippz_ip4 = res3.ippz_ip.split(".")[3];
|
||||
this.ippz_zwym1 = res3.ippz_zwym.split(".")[0];
|
||||
this.ippz_zwym2 = res3.ippz_zwym.split(".")[1];
|
||||
this.ippz_zwym3 = res3.ippz_zwym.split(".")[2];
|
||||
this.ippz_zwym4 = res3.ippz_zwym.split(".")[3];
|
||||
this.ippz_dns_sx1 = res3.ippz_dns_sx.split(".")[0];
|
||||
this.ippz_dns_sx2 = res3.ippz_dns_sx.split(".")[1];
|
||||
this.ippz_dns_sx3 = res3.ippz_dns_sx.split(".")[2];
|
||||
this.ippz_dns_sx4 = res3.ippz_dns_sx.split(".")[3];
|
||||
this.ippz_dns_by1 = res3.ippz_dns_by.split(".")[0];
|
||||
this.ippz_dns_by2 = res3.ippz_dns_by.split(".")[1];
|
||||
this.ippz_dns_by3 = res3.ippz_dns_by.split(".")[2];
|
||||
this.ippz_dns_by4 = res3.ippz_dns_by.split(".")[3];
|
||||
}
|
||||
this.formData.wgpz_wgmc = res3.wgpz_wgmc;
|
||||
this.formData.wgpz_wgid = res3.wgpz_wgid;
|
||||
this.formData.wgpz_wglx = res3.wgpz_wglx;
|
||||
this.formData.tdpz_tdmc = res3.tdpz_tdmc;
|
||||
this.formData.tdpz_td = res3.tdpz_td;
|
||||
this.formData.tdpz_qdmc = res3.tdpz_qdmc;
|
||||
this.formData.tdpz_ip = res3.tdpz_ip;
|
||||
this.formData.tdpz_port = res3.tdpz_port;
|
||||
this.formData.tdpz_cssj = res3.tdpz_cssj;
|
||||
this.formData.tdpz_jgsj = res3.tdpz_jgsj;
|
||||
this.formData.tdpz_lxsj = res3.tdpz_lxsj;
|
||||
this.formData.tdpz_cfcs = res3.tdpz_cfcs;
|
||||
this.formData.tdpz_watchtime = res3.tdpz_watchtime;
|
||||
this.formData.tdpz_cjsylxdz = res3.tdpz_cjsylxdz;
|
||||
this.formData.tdpz_dxzkb = res3.tdpz_dxzkb;
|
||||
this.formData.tdpz_050F = res3.tdpz_050F;
|
||||
this.formData.tdpz_0610 = res3.tdpz_0610;
|
||||
this.formData.sbpz_sbid = res3.sbpz_sbid;
|
||||
this.formData.sbpz_sbmc = res3.sbpz_sbmc;
|
||||
this.formData.sbpz_mac = res3.sbpz_mac;
|
||||
this.formData.sbpz_jysb = res3.sbpz_jysb;
|
||||
this.formData.sbpz_jdzxz = res3.sbpz_jdzxz;
|
||||
|
||||
this.formData.cjdpz_tagid = res3.cjdpz_tagid;
|
||||
this.formData.cjdpz_mc = res3.cjdpz_mc;
|
||||
this.formData.cjdpz_sjq = res3.cjdpz_sjq;
|
||||
this.formData.cjdpz_jcqdz = res3.cjdpz_jcqdz;
|
||||
this.formData.cjdpz_cjsjlx = res3.cjdpz_cjsjlx;
|
||||
this.formData.cjdpz_zjx = res3.cjdpz_zjx;
|
||||
this.formData.cjdpz_dxsx = res3.cjdpz_dxsx;
|
||||
this.formData.cjdpz_beilv = res3.cjdpz_beilv;
|
||||
|
||||
this.formData.mqtt_qiyong = res3.mqtt_qiyong;
|
||||
this.formData.mqtt_ip = res3.mqtt_ip;
|
||||
this.formData.mqtt_port = res3.mqtt_port;
|
||||
this.formData.mqtt_wgsn = res3.mqtt_wgsn;
|
||||
this.formData.mqtt_sssjfbzt = res3.mqtt_sssjfbzt;
|
||||
this.formData.mqtt_qos = res3.mqtt_qos;
|
||||
this.formData.mqtt_scms = res3.mqtt_scms;
|
||||
this.formData.mqtt_sczq = res3.mqtt_sczq;
|
||||
this.formData.mqtt_sjgl = res3.mqtt_sjgl;
|
||||
this.formData.mqtt_cjd_sbmc = res3.mqtt_cjd_sbmc;
|
||||
this.formData.mqtt_cjd_tagid = res3.mqtt_cjd_tagid;
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.user_id = window.location.href.split("?")[1];
|
||||
this.getUserAnswer();
|
||||
},
|
||||
mounted() { },
|
||||
directives: {
|
||||
copy: {
|
||||
bind(el, { value }) {
|
||||
// 给元素赋值一个$value值,即指令绑定的值
|
||||
el.$value = value;
|
||||
el.handler = () => {
|
||||
// 如果可复制的值为空的时候,给出提示;
|
||||
if (!el.$value) {
|
||||
console.log("无复制内容");
|
||||
return;
|
||||
}
|
||||
// 动态创建 textarea 标签
|
||||
const textarea = document.createElement("textarea");
|
||||
// 将该 textarea 设为 readonly 防止 IOS 下自动唤起键盘,同时将 textarea 移除可视区域
|
||||
textarea.readOnly = "readonly";
|
||||
textarea.style.position = "absolute";
|
||||
textarea.style.left = "-9999px";
|
||||
// 将要copy的值赋值给textarea 标签的value属性
|
||||
textarea.value = el.$value;
|
||||
// 将textarea 插入到body中
|
||||
document.body.appendChild(textarea);
|
||||
// 选中值并复制
|
||||
textarea.select();
|
||||
const result = document.execCommand("Copy");
|
||||
if (result) {
|
||||
console.log("复制成功");
|
||||
}
|
||||
document.body.removeChild(textarea);
|
||||
};
|
||||
// 绑定点击事件,点击的时候copy值
|
||||
el.addEventListener("click", el.handler);
|
||||
},
|
||||
// 当传递进来的值更新的时候触发
|
||||
componentUpdated(el, { value }) {
|
||||
el.$value = value;
|
||||
},
|
||||
// 指令与元素解绑的时候,移除事件绑定
|
||||
unbind(el) {
|
||||
el.removeEventListener("click", el.handler);
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.title_center {
|
||||
font-size: 18px;
|
||||
color: red;
|
||||
position: absolute;
|
||||
left: 100px;
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
/deep/ .wired,
|
||||
/deep/ .wifi {
|
||||
.el-row {
|
||||
.el-col-12:last-child {
|
||||
padding-right: 120px;
|
||||
}
|
||||
|
||||
.el-col-12:first-child {
|
||||
padding-right: 118px;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.el-row {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
|
||||
.el-col-1 {
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.mac {
|
||||
// display: flex;
|
||||
align-items: center;
|
||||
|
||||
.el-button {
|
||||
position: absolute;
|
||||
left: 200px;
|
||||
bottom: 5px;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
line-height: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.netWay {
|
||||
margin-bottom: 20px;
|
||||
width: 80px;
|
||||
color: rgba(16, 16, 16, 1);
|
||||
font-size: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
left: 360px;
|
||||
bottom: 2px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,730 @@
|
|||
<!-- 有线网关设置 -->
|
||||
<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">
|
||||
<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">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip4" 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="子网掩码:" :label-width="formLabelWidth" prop="ippz_zwym">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym4" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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="1">.</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="1">.</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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer footer">
|
||||
<el-button type="primary" @click="submitForm">保 存</el-button>
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { SaveUserAnswer, GetUserAnswer } from "../api/user";
|
||||
export default {
|
||||
name: "GateWay",
|
||||
data() {
|
||||
return {
|
||||
// disabled: true,
|
||||
user_id: "",
|
||||
// 判断是否保存过
|
||||
loading: false,
|
||||
formData: {
|
||||
ippz_wangkou: "",
|
||||
ippz_zwym: "",
|
||||
ippz_mrwg: "",
|
||||
ippz_dns_sx: "",
|
||||
ippz_dns_by: "",
|
||||
ippz_ip: "",
|
||||
ippz_mac: "3C:2D:50:20:30:3D",
|
||||
wgpz_wgmc: "",
|
||||
wgpz_wgid: "",
|
||||
wgpz_wglx: "",
|
||||
tdpz_tdmc: "",
|
||||
tdpz_td: "",
|
||||
tdpz_qdmc: "",
|
||||
tdpz_ip: "",
|
||||
tdpz_port: "",
|
||||
tdpz_cssj: "",
|
||||
tdpz_jgsj: "",
|
||||
tdpz_lxsj: "",
|
||||
tdpz_cfcs: "",
|
||||
tdpz_watchtime: "",
|
||||
tdpz_cjsylxdz: "",
|
||||
tdpz_dxzkb: "",
|
||||
tdpz_050F: "",
|
||||
tdpz_0610: "",
|
||||
sbpz_sbid: "",
|
||||
sbpz_sbmc: "",
|
||||
sbpz_mac: "",
|
||||
sbpz_jysb: "",
|
||||
sbpz_jdzxz: "",
|
||||
cjdpz_tagid: "",
|
||||
cjdpz_mc: "",
|
||||
cjdpz_sjq: "",
|
||||
cjdpz_jcqdz: "",
|
||||
cjdpz_cjsjlx: "",
|
||||
cjdpz_zjx: "",
|
||||
cjdpz_dxsx: "",
|
||||
cjdpz_beilv: "",
|
||||
mqtt_qiyong: "",
|
||||
mqtt_ip: "",
|
||||
mqtt_port: "",
|
||||
mqtt_wgsn: "",
|
||||
mqtt_sssjfbzt: "",
|
||||
mqtt_qos: "",
|
||||
mqtt_scms: "",
|
||||
mqtt_sczq: "",
|
||||
mqtt_sjgl: "",
|
||||
mqtt_cjd_sbmc: "",
|
||||
mqtt_cjd_tagid: "",
|
||||
},
|
||||
labelPosition: "left",
|
||||
ippz_zwym1: "255",
|
||||
ippz_zwym2: "255",
|
||||
ippz_zwym3: "255",
|
||||
ippz_zwym4: "0",
|
||||
ippz_ip1: "",
|
||||
ippz_ip2: "",
|
||||
ippz_ip3: "",
|
||||
ippz_ip4: "",
|
||||
ippz_mrwg1: "192",
|
||||
ippz_mrwg2: "168",
|
||||
ippz_mrwg3: "1",
|
||||
ippz_mrwg4: "1",
|
||||
ippz_dns_sx1: "8",
|
||||
ippz_dns_sx2: "8",
|
||||
ippz_dns_sx3: "8",
|
||||
ippz_dns_sx4: "8",
|
||||
|
||||
ippz_dns_by1: "8",
|
||||
ippz_dns_by2: "8",
|
||||
ippz_dns_by3: "8",
|
||||
ippz_dns_by4: "8",
|
||||
dialogFormVisible: true,
|
||||
formLabelWidth: "100px",
|
||||
// 有线的规则校验
|
||||
rules_ippz_wirle: {
|
||||
ippz_wangkou: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入网口",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
ippz_zwym: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateZwym,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_ip: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIp,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mrwg: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateMrwg,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_sx: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsSx,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_by: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsBy,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mac: [
|
||||
{ required: true, message: "请输入MAC地址", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// isSaveButtonDisabled() {
|
||||
// return (
|
||||
// !this.$refs.rules_ippz_wirle ||
|
||||
// this.$refs.rules_ippz_wirle.validateSync().length > 0
|
||||
// );
|
||||
// },
|
||||
},
|
||||
methods: {
|
||||
// 提交时的校验
|
||||
submitForm() {
|
||||
this.$refs["formData"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.saveAll();
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 封装合并输入框的数据
|
||||
Merge(value, value1, value2, value3, value4) {
|
||||
value = value1 + "." + value2 + "." + value3 + "." + value4;
|
||||
return value;
|
||||
},
|
||||
//子网掩码验证
|
||||
validateZwym(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_zwym1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的子网掩码"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//ip地址验证
|
||||
validateIp(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_ip1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的IP地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//默认网关验证
|
||||
validateMrwg(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_mrwg1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的网关地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//首选DNS服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的主DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//备选dns服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的备用DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
// 保存数据, 发送请求
|
||||
async saveAll() {
|
||||
this.formData.ippz_ip = this.Merge(
|
||||
this.formData.ippz_ip,
|
||||
this.ippz_ip1,
|
||||
this.ippz_ip2,
|
||||
this.ippz_ip3,
|
||||
this.ippz_ip4
|
||||
);
|
||||
this.formData.ippz_zwym = this.Merge(
|
||||
this.formData.ippz_zwym,
|
||||
this.ippz_zwym1,
|
||||
this.ippz_zwym2,
|
||||
this.ippz_zwym3,
|
||||
this.ippz_zwym4
|
||||
);
|
||||
this.formData.ippz_mrwg = this.Merge(
|
||||
this.formData.ippz_mrwg,
|
||||
this.ippz_mrwg1,
|
||||
this.ippz_mrwg2,
|
||||
this.ippz_mrwg3,
|
||||
this.ippz_mrwg4
|
||||
);
|
||||
this.formData.ippz_dns_sx = this.Merge(
|
||||
this.formData.ippz_dns_sx,
|
||||
this.ippz_dns_sx1,
|
||||
this.ippz_dns_sx2,
|
||||
this.ippz_dns_sx3,
|
||||
this.ippz_dns_sx4
|
||||
);
|
||||
this.formData.ippz_dns_by = this.Merge(
|
||||
this.formData.ippz_dns_by,
|
||||
this.ippz_dns_by1,
|
||||
this.ippz_dns_by2,
|
||||
this.ippz_dns_by3,
|
||||
this.ippz_dns_by4
|
||||
);
|
||||
console.log(this.formData);
|
||||
// sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.formData));
|
||||
let data = {
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(this.formData),
|
||||
};
|
||||
let res = await SaveUserAnswer(data);
|
||||
console.log(res);
|
||||
if (res.data.state) {
|
||||
this.$message({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
message: `保存失败`,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
console.log(res);
|
||||
},
|
||||
CopyText() {
|
||||
this.$message({
|
||||
message: "复制成功",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
async getUserAnswer() {
|
||||
this.loading = true;
|
||||
let res2 = await GetUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
this.loading = false;
|
||||
console.log(res2);
|
||||
if (res2.data.data && res2.data.state) {
|
||||
let res3 = JSON.parse(res2.data.data.mark_value);
|
||||
console.log(res3);
|
||||
|
||||
if (res3.ippz_mac) {
|
||||
this.formData.ippz_mac = res3.ippz_mac;
|
||||
}
|
||||
if (res3.ippz_mrwg) {
|
||||
this.formData.ippz_wangkou = res3.ippz_wangkou;
|
||||
this.formData.ippz_mrwg = res3.ippz_mrwg;
|
||||
this.formData.ippz_ip = res3.ippz_ip;
|
||||
this.formData.ippz_zwym = res3.ippz_zwym;
|
||||
this.formData.ippz_dns_sx = res3.ippz_dns_sx;
|
||||
this.formData.ippz_dns_by = res3.ippz_dns_by;
|
||||
this.ippz_mrwg1 = res3.ippz_mrwg.split(".")[0];
|
||||
this.ippz_mrwg2 = res3.ippz_mrwg.split(".")[1];
|
||||
this.ippz_mrwg3 = res3.ippz_mrwg.split(".")[2];
|
||||
this.ippz_mrwg4 = res3.ippz_mrwg.split(".")[3];
|
||||
this.ippz_ip1 = res3.ippz_ip.split(".")[0];
|
||||
this.ippz_ip2 = res3.ippz_ip.split(".")[1];
|
||||
this.ippz_ip3 = res3.ippz_ip.split(".")[2];
|
||||
this.ippz_ip4 = res3.ippz_ip.split(".")[3];
|
||||
this.ippz_zwym1 = res3.ippz_zwym.split(".")[0];
|
||||
this.ippz_zwym2 = res3.ippz_zwym.split(".")[1];
|
||||
this.ippz_zwym3 = res3.ippz_zwym.split(".")[2];
|
||||
this.ippz_zwym4 = res3.ippz_zwym.split(".")[3];
|
||||
this.ippz_dns_sx1 = res3.ippz_dns_sx.split(".")[0];
|
||||
this.ippz_dns_sx2 = res3.ippz_dns_sx.split(".")[1];
|
||||
this.ippz_dns_sx3 = res3.ippz_dns_sx.split(".")[2];
|
||||
this.ippz_dns_sx4 = res3.ippz_dns_sx.split(".")[3];
|
||||
this.ippz_dns_by1 = res3.ippz_dns_by.split(".")[0];
|
||||
this.ippz_dns_by2 = res3.ippz_dns_by.split(".")[1];
|
||||
this.ippz_dns_by3 = res3.ippz_dns_by.split(".")[2];
|
||||
this.ippz_dns_by4 = res3.ippz_dns_by.split(".")[3];
|
||||
}
|
||||
this.formData.wgpz_wgmc = res3.wgpz_wgmc;
|
||||
this.formData.wgpz_wgid = res3.wgpz_wgid;
|
||||
this.formData.wgpz_wglx = res3.wgpz_wglx;
|
||||
this.formData.tdpz_tdmc = res3.tdpz_tdmc;
|
||||
this.formData.tdpz_td = res3.tdpz_td;
|
||||
this.formData.tdpz_qdmc = res3.tdpz_qdmc;
|
||||
this.formData.tdpz_ip = res3.tdpz_ip;
|
||||
this.formData.tdpz_port = res3.tdpz_port;
|
||||
this.formData.tdpz_cssj = res3.tdpz_cssj;
|
||||
this.formData.tdpz_jgsj = res3.tdpz_jgsj;
|
||||
this.formData.tdpz_lxsj = res3.tdpz_lxsj;
|
||||
this.formData.tdpz_cfcs = res3.tdpz_cfcs;
|
||||
this.formData.tdpz_watchtime = res3.tdpz_watchtime;
|
||||
this.formData.tdpz_cjsylxdz = res3.tdpz_cjsylxdz;
|
||||
this.formData.tdpz_dxzkb = res3.tdpz_dxzkb;
|
||||
this.formData.tdpz_050F = res3.tdpz_050F;
|
||||
this.formData.tdpz_0610 = res3.tdpz_0610;
|
||||
this.formData.sbpz_sbid = res3.sbpz_sbid;
|
||||
this.formData.sbpz_sbmc = res3.sbpz_sbmc;
|
||||
this.formData.sbpz_mac = res3.sbpz_mac;
|
||||
this.formData.sbpz_jysb = res3.sbpz_jysb;
|
||||
this.formData.sbpz_jdzxz = res3.sbpz_jdzxz;
|
||||
|
||||
this.formData.cjdpz_tagid = res3.cjdpz_tagid;
|
||||
this.formData.cjdpz_mc = res3.cjdpz_mc;
|
||||
this.formData.cjdpz_sjq = res3.cjdpz_sjq;
|
||||
this.formData.cjdpz_jcqdz = res3.cjdpz_jcqdz;
|
||||
this.formData.cjdpz_cjsjlx = res3.cjdpz_cjsjlx;
|
||||
this.formData.cjdpz_zjx = res3.cjdpz_zjx;
|
||||
this.formData.cjdpz_dxsx = res3.cjdpz_dxsx;
|
||||
this.formData.cjdpz_beilv = res3.cjdpz_beilv;
|
||||
|
||||
this.formData.mqtt_qiyong = res3.mqtt_qiyong;
|
||||
this.formData.mqtt_ip = res3.mqtt_ip;
|
||||
this.formData.mqtt_port = res3.mqtt_port;
|
||||
this.formData.mqtt_wgsn = res3.mqtt_wgsn;
|
||||
this.formData.mqtt_sssjfbzt = res3.mqtt_sssjfbzt;
|
||||
this.formData.mqtt_qos = res3.mqtt_qos;
|
||||
this.formData.mqtt_scms = res3.mqtt_scms;
|
||||
this.formData.mqtt_sczq = res3.mqtt_sczq;
|
||||
this.formData.mqtt_sjgl = res3.mqtt_sjgl;
|
||||
this.formData.mqtt_cjd_sbmc = res3.mqtt_cjd_sbmc;
|
||||
this.formData.mqtt_cjd_tagid = res3.mqtt_cjd_tagid;
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.user_id = window.location.href.split("?")[1];
|
||||
this.getUserAnswer();
|
||||
},
|
||||
mounted() { },
|
||||
directives: {
|
||||
copy: {
|
||||
bind(el, { value }) {
|
||||
// 给元素赋值一个$value值,即指令绑定的值
|
||||
el.$value = value;
|
||||
el.handler = () => {
|
||||
// 如果可复制的值为空的时候,给出提示;
|
||||
if (!el.$value) {
|
||||
console.log("无复制内容");
|
||||
return;
|
||||
}
|
||||
// 动态创建 textarea 标签
|
||||
const textarea = document.createElement("textarea");
|
||||
// 将该 textarea 设为 readonly 防止 IOS 下自动唤起键盘,同时将 textarea 移除可视区域
|
||||
textarea.readOnly = "readonly";
|
||||
textarea.style.position = "absolute";
|
||||
textarea.style.left = "-9999px";
|
||||
// 将要copy的值赋值给textarea 标签的value属性
|
||||
textarea.value = el.$value;
|
||||
// 将textarea 插入到body中
|
||||
document.body.appendChild(textarea);
|
||||
// 选中值并复制
|
||||
textarea.select();
|
||||
const result = document.execCommand("Copy");
|
||||
if (result) {
|
||||
console.log("复制成功");
|
||||
}
|
||||
document.body.removeChild(textarea);
|
||||
};
|
||||
// 绑定点击事件,点击的时候copy值
|
||||
el.addEventListener("click", el.handler);
|
||||
},
|
||||
// 当传递进来的值更新的时候触发
|
||||
componentUpdated(el, { value }) {
|
||||
el.$value = value;
|
||||
},
|
||||
// 指令与元素解绑的时候,移除事件绑定
|
||||
unbind(el) {
|
||||
el.removeEventListener("click", el.handler);
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.title_center {
|
||||
font-size: 18px;
|
||||
color: red;
|
||||
position: absolute;
|
||||
left: 100px;
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
/deep/ .wired,
|
||||
/deep/ .wifi {
|
||||
.el-row {
|
||||
.el-col-12:last-child {
|
||||
padding-right: 120px;
|
||||
}
|
||||
|
||||
.el-col-12:first-child {
|
||||
padding-right: 118px;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.el-row {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
|
||||
.el-col-1 {
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.mac {
|
||||
// display: flex;
|
||||
align-items: center;
|
||||
|
||||
.el-button {
|
||||
position: absolute;
|
||||
left: 200px;
|
||||
bottom: 5px;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
line-height: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.netWay {
|
||||
margin-bottom: 20px;
|
||||
width: 80px;
|
||||
color: rgba(16, 16, 16, 1);
|
||||
font-size: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
left: 360px;
|
||||
bottom: 2px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,730 @@
|
|||
<!-- 有线网关设置 -->
|
||||
<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">
|
||||
<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">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip4" 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="子网掩码:" :label-width="formLabelWidth" prop="ippz_zwym">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym4" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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="1">.</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="1">.</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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer footer">
|
||||
<el-button type="primary" @click="submitForm">保 存</el-button>
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { SaveUserAnswer, GetUserAnswer } from "../api/user";
|
||||
export default {
|
||||
name: "GateWay",
|
||||
data() {
|
||||
return {
|
||||
// disabled: true,
|
||||
user_id: "",
|
||||
// 判断是否保存过
|
||||
loading: false,
|
||||
formData: {
|
||||
ippz_wangkou: "",
|
||||
ippz_zwym: "",
|
||||
ippz_mrwg: "",
|
||||
ippz_dns_sx: "",
|
||||
ippz_dns_by: "",
|
||||
ippz_ip: "",
|
||||
ippz_mac: "3C:2D:50:20:30:3D",
|
||||
wgpz_wgmc: "",
|
||||
wgpz_wgid: "",
|
||||
wgpz_wglx: "",
|
||||
tdpz_tdmc: "",
|
||||
tdpz_td: "",
|
||||
tdpz_qdmc: "",
|
||||
tdpz_ip: "",
|
||||
tdpz_port: "",
|
||||
tdpz_cssj: "",
|
||||
tdpz_jgsj: "",
|
||||
tdpz_lxsj: "",
|
||||
tdpz_cfcs: "",
|
||||
tdpz_watchtime: "",
|
||||
tdpz_cjsylxdz: "",
|
||||
tdpz_dxzkb: "",
|
||||
tdpz_050F: "",
|
||||
tdpz_0610: "",
|
||||
sbpz_sbid: "",
|
||||
sbpz_sbmc: "",
|
||||
sbpz_mac: "",
|
||||
sbpz_jysb: "",
|
||||
sbpz_jdzxz: "",
|
||||
cjdpz_tagid: "",
|
||||
cjdpz_mc: "",
|
||||
cjdpz_sjq: "",
|
||||
cjdpz_jcqdz: "",
|
||||
cjdpz_cjsjlx: "",
|
||||
cjdpz_zjx: "",
|
||||
cjdpz_dxsx: "",
|
||||
cjdpz_beilv: "",
|
||||
mqtt_qiyong: "",
|
||||
mqtt_ip: "",
|
||||
mqtt_port: "",
|
||||
mqtt_wgsn: "",
|
||||
mqtt_sssjfbzt: "",
|
||||
mqtt_qos: "",
|
||||
mqtt_scms: "",
|
||||
mqtt_sczq: "",
|
||||
mqtt_sjgl: "",
|
||||
mqtt_cjd_sbmc: "",
|
||||
mqtt_cjd_tagid: "",
|
||||
},
|
||||
labelPosition: "left",
|
||||
ippz_zwym1: "255",
|
||||
ippz_zwym2: "255",
|
||||
ippz_zwym3: "255",
|
||||
ippz_zwym4: "0",
|
||||
ippz_ip1: "",
|
||||
ippz_ip2: "",
|
||||
ippz_ip3: "",
|
||||
ippz_ip4: "",
|
||||
ippz_mrwg1: "192",
|
||||
ippz_mrwg2: "168",
|
||||
ippz_mrwg3: "1",
|
||||
ippz_mrwg4: "1",
|
||||
ippz_dns_sx1: "8",
|
||||
ippz_dns_sx2: "8",
|
||||
ippz_dns_sx3: "8",
|
||||
ippz_dns_sx4: "8",
|
||||
|
||||
ippz_dns_by1: "8",
|
||||
ippz_dns_by2: "8",
|
||||
ippz_dns_by3: "8",
|
||||
ippz_dns_by4: "8",
|
||||
dialogFormVisible: true,
|
||||
formLabelWidth: "100px",
|
||||
// 有线的规则校验
|
||||
rules_ippz_wirle: {
|
||||
ippz_wangkou: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入网口",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
ippz_zwym: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateZwym,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_ip: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIp,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mrwg: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateMrwg,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_sx: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsSx,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_by: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsBy,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mac: [
|
||||
{ required: true, message: "请输入MAC地址", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// isSaveButtonDisabled() {
|
||||
// return (
|
||||
// !this.$refs.rules_ippz_wirle ||
|
||||
// this.$refs.rules_ippz_wirle.validateSync().length > 0
|
||||
// );
|
||||
// },
|
||||
},
|
||||
methods: {
|
||||
// 提交时的校验
|
||||
submitForm() {
|
||||
this.$refs["formData"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.saveAll();
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 封装合并输入框的数据
|
||||
Merge(value, value1, value2, value3, value4) {
|
||||
value = value1 + "." + value2 + "." + value3 + "." + value4;
|
||||
return value;
|
||||
},
|
||||
//子网掩码验证
|
||||
validateZwym(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_zwym1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的子网掩码"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//ip地址验证
|
||||
validateIp(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_ip1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的IP地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//默认网关验证
|
||||
validateMrwg(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_mrwg1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的网关地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//首选DNS服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的主DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//备选dns服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的备用DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
// 保存数据, 发送请求
|
||||
async saveAll() {
|
||||
this.formData.ippz_ip = this.Merge(
|
||||
this.formData.ippz_ip,
|
||||
this.ippz_ip1,
|
||||
this.ippz_ip2,
|
||||
this.ippz_ip3,
|
||||
this.ippz_ip4
|
||||
);
|
||||
this.formData.ippz_zwym = this.Merge(
|
||||
this.formData.ippz_zwym,
|
||||
this.ippz_zwym1,
|
||||
this.ippz_zwym2,
|
||||
this.ippz_zwym3,
|
||||
this.ippz_zwym4
|
||||
);
|
||||
this.formData.ippz_mrwg = this.Merge(
|
||||
this.formData.ippz_mrwg,
|
||||
this.ippz_mrwg1,
|
||||
this.ippz_mrwg2,
|
||||
this.ippz_mrwg3,
|
||||
this.ippz_mrwg4
|
||||
);
|
||||
this.formData.ippz_dns_sx = this.Merge(
|
||||
this.formData.ippz_dns_sx,
|
||||
this.ippz_dns_sx1,
|
||||
this.ippz_dns_sx2,
|
||||
this.ippz_dns_sx3,
|
||||
this.ippz_dns_sx4
|
||||
);
|
||||
this.formData.ippz_dns_by = this.Merge(
|
||||
this.formData.ippz_dns_by,
|
||||
this.ippz_dns_by1,
|
||||
this.ippz_dns_by2,
|
||||
this.ippz_dns_by3,
|
||||
this.ippz_dns_by4
|
||||
);
|
||||
console.log(this.formData);
|
||||
// sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.formData));
|
||||
let data = {
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(this.formData),
|
||||
};
|
||||
let res = await SaveUserAnswer(data);
|
||||
console.log(res);
|
||||
if (res.data.state) {
|
||||
this.$message({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
message: `保存失败`,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
console.log(res);
|
||||
},
|
||||
CopyText() {
|
||||
this.$message({
|
||||
message: "复制成功",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
async getUserAnswer() {
|
||||
this.loading = true;
|
||||
let res2 = await GetUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
this.loading = false;
|
||||
console.log(res2);
|
||||
if (res2.data.data && res2.data.state) {
|
||||
let res3 = JSON.parse(res2.data.data.mark_value);
|
||||
console.log(res3);
|
||||
|
||||
if (res3.ippz_mac) {
|
||||
this.formData.ippz_mac = res3.ippz_mac;
|
||||
}
|
||||
if (res3.ippz_mrwg) {
|
||||
this.formData.ippz_wangkou = res3.ippz_wangkou;
|
||||
this.formData.ippz_mrwg = res3.ippz_mrwg;
|
||||
this.formData.ippz_ip = res3.ippz_ip;
|
||||
this.formData.ippz_zwym = res3.ippz_zwym;
|
||||
this.formData.ippz_dns_sx = res3.ippz_dns_sx;
|
||||
this.formData.ippz_dns_by = res3.ippz_dns_by;
|
||||
this.ippz_mrwg1 = res3.ippz_mrwg.split(".")[0];
|
||||
this.ippz_mrwg2 = res3.ippz_mrwg.split(".")[1];
|
||||
this.ippz_mrwg3 = res3.ippz_mrwg.split(".")[2];
|
||||
this.ippz_mrwg4 = res3.ippz_mrwg.split(".")[3];
|
||||
this.ippz_ip1 = res3.ippz_ip.split(".")[0];
|
||||
this.ippz_ip2 = res3.ippz_ip.split(".")[1];
|
||||
this.ippz_ip3 = res3.ippz_ip.split(".")[2];
|
||||
this.ippz_ip4 = res3.ippz_ip.split(".")[3];
|
||||
this.ippz_zwym1 = res3.ippz_zwym.split(".")[0];
|
||||
this.ippz_zwym2 = res3.ippz_zwym.split(".")[1];
|
||||
this.ippz_zwym3 = res3.ippz_zwym.split(".")[2];
|
||||
this.ippz_zwym4 = res3.ippz_zwym.split(".")[3];
|
||||
this.ippz_dns_sx1 = res3.ippz_dns_sx.split(".")[0];
|
||||
this.ippz_dns_sx2 = res3.ippz_dns_sx.split(".")[1];
|
||||
this.ippz_dns_sx3 = res3.ippz_dns_sx.split(".")[2];
|
||||
this.ippz_dns_sx4 = res3.ippz_dns_sx.split(".")[3];
|
||||
this.ippz_dns_by1 = res3.ippz_dns_by.split(".")[0];
|
||||
this.ippz_dns_by2 = res3.ippz_dns_by.split(".")[1];
|
||||
this.ippz_dns_by3 = res3.ippz_dns_by.split(".")[2];
|
||||
this.ippz_dns_by4 = res3.ippz_dns_by.split(".")[3];
|
||||
}
|
||||
this.formData.wgpz_wgmc = res3.wgpz_wgmc;
|
||||
this.formData.wgpz_wgid = res3.wgpz_wgid;
|
||||
this.formData.wgpz_wglx = res3.wgpz_wglx;
|
||||
this.formData.tdpz_tdmc = res3.tdpz_tdmc;
|
||||
this.formData.tdpz_td = res3.tdpz_td;
|
||||
this.formData.tdpz_qdmc = res3.tdpz_qdmc;
|
||||
this.formData.tdpz_ip = res3.tdpz_ip;
|
||||
this.formData.tdpz_port = res3.tdpz_port;
|
||||
this.formData.tdpz_cssj = res3.tdpz_cssj;
|
||||
this.formData.tdpz_jgsj = res3.tdpz_jgsj;
|
||||
this.formData.tdpz_lxsj = res3.tdpz_lxsj;
|
||||
this.formData.tdpz_cfcs = res3.tdpz_cfcs;
|
||||
this.formData.tdpz_watchtime = res3.tdpz_watchtime;
|
||||
this.formData.tdpz_cjsylxdz = res3.tdpz_cjsylxdz;
|
||||
this.formData.tdpz_dxzkb = res3.tdpz_dxzkb;
|
||||
this.formData.tdpz_050F = res3.tdpz_050F;
|
||||
this.formData.tdpz_0610 = res3.tdpz_0610;
|
||||
this.formData.sbpz_sbid = res3.sbpz_sbid;
|
||||
this.formData.sbpz_sbmc = res3.sbpz_sbmc;
|
||||
this.formData.sbpz_mac = res3.sbpz_mac;
|
||||
this.formData.sbpz_jysb = res3.sbpz_jysb;
|
||||
this.formData.sbpz_jdzxz = res3.sbpz_jdzxz;
|
||||
|
||||
this.formData.cjdpz_tagid = res3.cjdpz_tagid;
|
||||
this.formData.cjdpz_mc = res3.cjdpz_mc;
|
||||
this.formData.cjdpz_sjq = res3.cjdpz_sjq;
|
||||
this.formData.cjdpz_jcqdz = res3.cjdpz_jcqdz;
|
||||
this.formData.cjdpz_cjsjlx = res3.cjdpz_cjsjlx;
|
||||
this.formData.cjdpz_zjx = res3.cjdpz_zjx;
|
||||
this.formData.cjdpz_dxsx = res3.cjdpz_dxsx;
|
||||
this.formData.cjdpz_beilv = res3.cjdpz_beilv;
|
||||
|
||||
this.formData.mqtt_qiyong = res3.mqtt_qiyong;
|
||||
this.formData.mqtt_ip = res3.mqtt_ip;
|
||||
this.formData.mqtt_port = res3.mqtt_port;
|
||||
this.formData.mqtt_wgsn = res3.mqtt_wgsn;
|
||||
this.formData.mqtt_sssjfbzt = res3.mqtt_sssjfbzt;
|
||||
this.formData.mqtt_qos = res3.mqtt_qos;
|
||||
this.formData.mqtt_scms = res3.mqtt_scms;
|
||||
this.formData.mqtt_sczq = res3.mqtt_sczq;
|
||||
this.formData.mqtt_sjgl = res3.mqtt_sjgl;
|
||||
this.formData.mqtt_cjd_sbmc = res3.mqtt_cjd_sbmc;
|
||||
this.formData.mqtt_cjd_tagid = res3.mqtt_cjd_tagid;
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.user_id = window.location.href.split("?")[1];
|
||||
this.getUserAnswer();
|
||||
},
|
||||
mounted() { },
|
||||
directives: {
|
||||
copy: {
|
||||
bind(el, { value }) {
|
||||
// 给元素赋值一个$value值,即指令绑定的值
|
||||
el.$value = value;
|
||||
el.handler = () => {
|
||||
// 如果可复制的值为空的时候,给出提示;
|
||||
if (!el.$value) {
|
||||
console.log("无复制内容");
|
||||
return;
|
||||
}
|
||||
// 动态创建 textarea 标签
|
||||
const textarea = document.createElement("textarea");
|
||||
// 将该 textarea 设为 readonly 防止 IOS 下自动唤起键盘,同时将 textarea 移除可视区域
|
||||
textarea.readOnly = "readonly";
|
||||
textarea.style.position = "absolute";
|
||||
textarea.style.left = "-9999px";
|
||||
// 将要copy的值赋值给textarea 标签的value属性
|
||||
textarea.value = el.$value;
|
||||
// 将textarea 插入到body中
|
||||
document.body.appendChild(textarea);
|
||||
// 选中值并复制
|
||||
textarea.select();
|
||||
const result = document.execCommand("Copy");
|
||||
if (result) {
|
||||
console.log("复制成功");
|
||||
}
|
||||
document.body.removeChild(textarea);
|
||||
};
|
||||
// 绑定点击事件,点击的时候copy值
|
||||
el.addEventListener("click", el.handler);
|
||||
},
|
||||
// 当传递进来的值更新的时候触发
|
||||
componentUpdated(el, { value }) {
|
||||
el.$value = value;
|
||||
},
|
||||
// 指令与元素解绑的时候,移除事件绑定
|
||||
unbind(el) {
|
||||
el.removeEventListener("click", el.handler);
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.title_center {
|
||||
font-size: 18px;
|
||||
color: red;
|
||||
position: absolute;
|
||||
left: 100px;
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
/deep/ .wired,
|
||||
/deep/ .wifi {
|
||||
.el-row {
|
||||
.el-col-12:last-child {
|
||||
padding-right: 120px;
|
||||
}
|
||||
|
||||
.el-col-12:first-child {
|
||||
padding-right: 118px;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.el-row {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
|
||||
.el-col-1 {
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.mac {
|
||||
// display: flex;
|
||||
align-items: center;
|
||||
|
||||
.el-button {
|
||||
position: absolute;
|
||||
left: 200px;
|
||||
bottom: 5px;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
line-height: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.netWay {
|
||||
margin-bottom: 20px;
|
||||
width: 80px;
|
||||
color: rgba(16, 16, 16, 1);
|
||||
font-size: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
left: 360px;
|
||||
bottom: 2px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,730 @@
|
|||
<!-- 有线网关设置 -->
|
||||
<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">
|
||||
<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">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip4" 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="子网掩码:" :label-width="formLabelWidth" prop="ippz_zwym">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym4" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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="1">.</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="1">.</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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer footer">
|
||||
<el-button type="primary" @click="submitForm">保 存</el-button>
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { SaveUserAnswer, GetUserAnswer } from "../api/user";
|
||||
export default {
|
||||
name: "GateWay",
|
||||
data() {
|
||||
return {
|
||||
// disabled: true,
|
||||
user_id: "",
|
||||
// 判断是否保存过
|
||||
loading: false,
|
||||
formData: {
|
||||
ippz_wangkou: "",
|
||||
ippz_zwym: "",
|
||||
ippz_mrwg: "",
|
||||
ippz_dns_sx: "",
|
||||
ippz_dns_by: "",
|
||||
ippz_ip: "",
|
||||
ippz_mac: "3C:2D:50:20:30:3D",
|
||||
wgpz_wgmc: "",
|
||||
wgpz_wgid: "",
|
||||
wgpz_wglx: "",
|
||||
tdpz_tdmc: "",
|
||||
tdpz_td: "",
|
||||
tdpz_qdmc: "",
|
||||
tdpz_ip: "",
|
||||
tdpz_port: "",
|
||||
tdpz_cssj: "",
|
||||
tdpz_jgsj: "",
|
||||
tdpz_lxsj: "",
|
||||
tdpz_cfcs: "",
|
||||
tdpz_watchtime: "",
|
||||
tdpz_cjsylxdz: "",
|
||||
tdpz_dxzkb: "",
|
||||
tdpz_050F: "",
|
||||
tdpz_0610: "",
|
||||
sbpz_sbid: "",
|
||||
sbpz_sbmc: "",
|
||||
sbpz_mac: "",
|
||||
sbpz_jysb: "",
|
||||
sbpz_jdzxz: "",
|
||||
cjdpz_tagid: "",
|
||||
cjdpz_mc: "",
|
||||
cjdpz_sjq: "",
|
||||
cjdpz_jcqdz: "",
|
||||
cjdpz_cjsjlx: "",
|
||||
cjdpz_zjx: "",
|
||||
cjdpz_dxsx: "",
|
||||
cjdpz_beilv: "",
|
||||
mqtt_qiyong: "",
|
||||
mqtt_ip: "",
|
||||
mqtt_port: "",
|
||||
mqtt_wgsn: "",
|
||||
mqtt_sssjfbzt: "",
|
||||
mqtt_qos: "",
|
||||
mqtt_scms: "",
|
||||
mqtt_sczq: "",
|
||||
mqtt_sjgl: "",
|
||||
mqtt_cjd_sbmc: "",
|
||||
mqtt_cjd_tagid: "",
|
||||
},
|
||||
labelPosition: "left",
|
||||
ippz_zwym1: "255",
|
||||
ippz_zwym2: "255",
|
||||
ippz_zwym3: "255",
|
||||
ippz_zwym4: "0",
|
||||
ippz_ip1: "",
|
||||
ippz_ip2: "",
|
||||
ippz_ip3: "",
|
||||
ippz_ip4: "",
|
||||
ippz_mrwg1: "192",
|
||||
ippz_mrwg2: "168",
|
||||
ippz_mrwg3: "1",
|
||||
ippz_mrwg4: "1",
|
||||
ippz_dns_sx1: "8",
|
||||
ippz_dns_sx2: "8",
|
||||
ippz_dns_sx3: "8",
|
||||
ippz_dns_sx4: "8",
|
||||
|
||||
ippz_dns_by1: "8",
|
||||
ippz_dns_by2: "8",
|
||||
ippz_dns_by3: "8",
|
||||
ippz_dns_by4: "8",
|
||||
dialogFormVisible: true,
|
||||
formLabelWidth: "100px",
|
||||
// 有线的规则校验
|
||||
rules_ippz_wirle: {
|
||||
ippz_wangkou: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入网口",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
ippz_zwym: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateZwym,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_ip: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIp,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mrwg: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateMrwg,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_sx: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsSx,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_by: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsBy,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mac: [
|
||||
{ required: true, message: "请输入MAC地址", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// isSaveButtonDisabled() {
|
||||
// return (
|
||||
// !this.$refs.rules_ippz_wirle ||
|
||||
// this.$refs.rules_ippz_wirle.validateSync().length > 0
|
||||
// );
|
||||
// },
|
||||
},
|
||||
methods: {
|
||||
// 提交时的校验
|
||||
submitForm() {
|
||||
this.$refs["formData"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.saveAll();
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 封装合并输入框的数据
|
||||
Merge(value, value1, value2, value3, value4) {
|
||||
value = value1 + "." + value2 + "." + value3 + "." + value4;
|
||||
return value;
|
||||
},
|
||||
//子网掩码验证
|
||||
validateZwym(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_zwym1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的子网掩码"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//ip地址验证
|
||||
validateIp(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_ip1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的IP地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//默认网关验证
|
||||
validateMrwg(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_mrwg1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的网关地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//首选DNS服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的主DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//备选dns服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的备用DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
// 保存数据, 发送请求
|
||||
async saveAll() {
|
||||
this.formData.ippz_ip = this.Merge(
|
||||
this.formData.ippz_ip,
|
||||
this.ippz_ip1,
|
||||
this.ippz_ip2,
|
||||
this.ippz_ip3,
|
||||
this.ippz_ip4
|
||||
);
|
||||
this.formData.ippz_zwym = this.Merge(
|
||||
this.formData.ippz_zwym,
|
||||
this.ippz_zwym1,
|
||||
this.ippz_zwym2,
|
||||
this.ippz_zwym3,
|
||||
this.ippz_zwym4
|
||||
);
|
||||
this.formData.ippz_mrwg = this.Merge(
|
||||
this.formData.ippz_mrwg,
|
||||
this.ippz_mrwg1,
|
||||
this.ippz_mrwg2,
|
||||
this.ippz_mrwg3,
|
||||
this.ippz_mrwg4
|
||||
);
|
||||
this.formData.ippz_dns_sx = this.Merge(
|
||||
this.formData.ippz_dns_sx,
|
||||
this.ippz_dns_sx1,
|
||||
this.ippz_dns_sx2,
|
||||
this.ippz_dns_sx3,
|
||||
this.ippz_dns_sx4
|
||||
);
|
||||
this.formData.ippz_dns_by = this.Merge(
|
||||
this.formData.ippz_dns_by,
|
||||
this.ippz_dns_by1,
|
||||
this.ippz_dns_by2,
|
||||
this.ippz_dns_by3,
|
||||
this.ippz_dns_by4
|
||||
);
|
||||
console.log(this.formData);
|
||||
// sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.formData));
|
||||
let data = {
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(this.formData),
|
||||
};
|
||||
let res = await SaveUserAnswer(data);
|
||||
console.log(res);
|
||||
if (res.data.state) {
|
||||
this.$message({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
message: `保存失败`,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
console.log(res);
|
||||
},
|
||||
CopyText() {
|
||||
this.$message({
|
||||
message: "复制成功",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
async getUserAnswer() {
|
||||
this.loading = true;
|
||||
let res2 = await GetUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
this.loading = false;
|
||||
console.log(res2);
|
||||
if (res2.data.data && res2.data.state) {
|
||||
let res3 = JSON.parse(res2.data.data.mark_value);
|
||||
console.log(res3);
|
||||
|
||||
if (res3.ippz_mac) {
|
||||
this.formData.ippz_mac = res3.ippz_mac;
|
||||
}
|
||||
if (res3.ippz_mrwg) {
|
||||
this.formData.ippz_wangkou = res3.ippz_wangkou;
|
||||
this.formData.ippz_mrwg = res3.ippz_mrwg;
|
||||
this.formData.ippz_ip = res3.ippz_ip;
|
||||
this.formData.ippz_zwym = res3.ippz_zwym;
|
||||
this.formData.ippz_dns_sx = res3.ippz_dns_sx;
|
||||
this.formData.ippz_dns_by = res3.ippz_dns_by;
|
||||
this.ippz_mrwg1 = res3.ippz_mrwg.split(".")[0];
|
||||
this.ippz_mrwg2 = res3.ippz_mrwg.split(".")[1];
|
||||
this.ippz_mrwg3 = res3.ippz_mrwg.split(".")[2];
|
||||
this.ippz_mrwg4 = res3.ippz_mrwg.split(".")[3];
|
||||
this.ippz_ip1 = res3.ippz_ip.split(".")[0];
|
||||
this.ippz_ip2 = res3.ippz_ip.split(".")[1];
|
||||
this.ippz_ip3 = res3.ippz_ip.split(".")[2];
|
||||
this.ippz_ip4 = res3.ippz_ip.split(".")[3];
|
||||
this.ippz_zwym1 = res3.ippz_zwym.split(".")[0];
|
||||
this.ippz_zwym2 = res3.ippz_zwym.split(".")[1];
|
||||
this.ippz_zwym3 = res3.ippz_zwym.split(".")[2];
|
||||
this.ippz_zwym4 = res3.ippz_zwym.split(".")[3];
|
||||
this.ippz_dns_sx1 = res3.ippz_dns_sx.split(".")[0];
|
||||
this.ippz_dns_sx2 = res3.ippz_dns_sx.split(".")[1];
|
||||
this.ippz_dns_sx3 = res3.ippz_dns_sx.split(".")[2];
|
||||
this.ippz_dns_sx4 = res3.ippz_dns_sx.split(".")[3];
|
||||
this.ippz_dns_by1 = res3.ippz_dns_by.split(".")[0];
|
||||
this.ippz_dns_by2 = res3.ippz_dns_by.split(".")[1];
|
||||
this.ippz_dns_by3 = res3.ippz_dns_by.split(".")[2];
|
||||
this.ippz_dns_by4 = res3.ippz_dns_by.split(".")[3];
|
||||
}
|
||||
this.formData.wgpz_wgmc = res3.wgpz_wgmc;
|
||||
this.formData.wgpz_wgid = res3.wgpz_wgid;
|
||||
this.formData.wgpz_wglx = res3.wgpz_wglx;
|
||||
this.formData.tdpz_tdmc = res3.tdpz_tdmc;
|
||||
this.formData.tdpz_td = res3.tdpz_td;
|
||||
this.formData.tdpz_qdmc = res3.tdpz_qdmc;
|
||||
this.formData.tdpz_ip = res3.tdpz_ip;
|
||||
this.formData.tdpz_port = res3.tdpz_port;
|
||||
this.formData.tdpz_cssj = res3.tdpz_cssj;
|
||||
this.formData.tdpz_jgsj = res3.tdpz_jgsj;
|
||||
this.formData.tdpz_lxsj = res3.tdpz_lxsj;
|
||||
this.formData.tdpz_cfcs = res3.tdpz_cfcs;
|
||||
this.formData.tdpz_watchtime = res3.tdpz_watchtime;
|
||||
this.formData.tdpz_cjsylxdz = res3.tdpz_cjsylxdz;
|
||||
this.formData.tdpz_dxzkb = res3.tdpz_dxzkb;
|
||||
this.formData.tdpz_050F = res3.tdpz_050F;
|
||||
this.formData.tdpz_0610 = res3.tdpz_0610;
|
||||
this.formData.sbpz_sbid = res3.sbpz_sbid;
|
||||
this.formData.sbpz_sbmc = res3.sbpz_sbmc;
|
||||
this.formData.sbpz_mac = res3.sbpz_mac;
|
||||
this.formData.sbpz_jysb = res3.sbpz_jysb;
|
||||
this.formData.sbpz_jdzxz = res3.sbpz_jdzxz;
|
||||
|
||||
this.formData.cjdpz_tagid = res3.cjdpz_tagid;
|
||||
this.formData.cjdpz_mc = res3.cjdpz_mc;
|
||||
this.formData.cjdpz_sjq = res3.cjdpz_sjq;
|
||||
this.formData.cjdpz_jcqdz = res3.cjdpz_jcqdz;
|
||||
this.formData.cjdpz_cjsjlx = res3.cjdpz_cjsjlx;
|
||||
this.formData.cjdpz_zjx = res3.cjdpz_zjx;
|
||||
this.formData.cjdpz_dxsx = res3.cjdpz_dxsx;
|
||||
this.formData.cjdpz_beilv = res3.cjdpz_beilv;
|
||||
|
||||
this.formData.mqtt_qiyong = res3.mqtt_qiyong;
|
||||
this.formData.mqtt_ip = res3.mqtt_ip;
|
||||
this.formData.mqtt_port = res3.mqtt_port;
|
||||
this.formData.mqtt_wgsn = res3.mqtt_wgsn;
|
||||
this.formData.mqtt_sssjfbzt = res3.mqtt_sssjfbzt;
|
||||
this.formData.mqtt_qos = res3.mqtt_qos;
|
||||
this.formData.mqtt_scms = res3.mqtt_scms;
|
||||
this.formData.mqtt_sczq = res3.mqtt_sczq;
|
||||
this.formData.mqtt_sjgl = res3.mqtt_sjgl;
|
||||
this.formData.mqtt_cjd_sbmc = res3.mqtt_cjd_sbmc;
|
||||
this.formData.mqtt_cjd_tagid = res3.mqtt_cjd_tagid;
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.user_id = window.location.href.split("?")[1];
|
||||
this.getUserAnswer();
|
||||
},
|
||||
mounted() { },
|
||||
directives: {
|
||||
copy: {
|
||||
bind(el, { value }) {
|
||||
// 给元素赋值一个$value值,即指令绑定的值
|
||||
el.$value = value;
|
||||
el.handler = () => {
|
||||
// 如果可复制的值为空的时候,给出提示;
|
||||
if (!el.$value) {
|
||||
console.log("无复制内容");
|
||||
return;
|
||||
}
|
||||
// 动态创建 textarea 标签
|
||||
const textarea = document.createElement("textarea");
|
||||
// 将该 textarea 设为 readonly 防止 IOS 下自动唤起键盘,同时将 textarea 移除可视区域
|
||||
textarea.readOnly = "readonly";
|
||||
textarea.style.position = "absolute";
|
||||
textarea.style.left = "-9999px";
|
||||
// 将要copy的值赋值给textarea 标签的value属性
|
||||
textarea.value = el.$value;
|
||||
// 将textarea 插入到body中
|
||||
document.body.appendChild(textarea);
|
||||
// 选中值并复制
|
||||
textarea.select();
|
||||
const result = document.execCommand("Copy");
|
||||
if (result) {
|
||||
console.log("复制成功");
|
||||
}
|
||||
document.body.removeChild(textarea);
|
||||
};
|
||||
// 绑定点击事件,点击的时候copy值
|
||||
el.addEventListener("click", el.handler);
|
||||
},
|
||||
// 当传递进来的值更新的时候触发
|
||||
componentUpdated(el, { value }) {
|
||||
el.$value = value;
|
||||
},
|
||||
// 指令与元素解绑的时候,移除事件绑定
|
||||
unbind(el) {
|
||||
el.removeEventListener("click", el.handler);
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.title_center {
|
||||
font-size: 18px;
|
||||
color: red;
|
||||
position: absolute;
|
||||
left: 100px;
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
/deep/ .wired,
|
||||
/deep/ .wifi {
|
||||
.el-row {
|
||||
.el-col-12:last-child {
|
||||
padding-right: 120px;
|
||||
}
|
||||
|
||||
.el-col-12:first-child {
|
||||
padding-right: 118px;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.el-row {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
|
||||
.el-col-1 {
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.mac {
|
||||
// display: flex;
|
||||
align-items: center;
|
||||
|
||||
.el-button {
|
||||
position: absolute;
|
||||
left: 200px;
|
||||
bottom: 5px;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
line-height: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.netWay {
|
||||
margin-bottom: 20px;
|
||||
width: 80px;
|
||||
color: rgba(16, 16, 16, 1);
|
||||
font-size: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
left: 360px;
|
||||
bottom: 2px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,698 @@
|
|||
<!-- 有线网关设置 -->
|
||||
<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">
|
||||
<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">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip4" 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="子网掩码:" :label-width="formLabelWidth" prop="ippz_zwym">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym4" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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="1">.</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="1">.</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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer footer">
|
||||
<el-button type="primary" @click="submitForm">保 存</el-button>
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { SaveUserAnswer, GetUserAnswer } from "../api/user";
|
||||
export default {
|
||||
name: "GateWay",
|
||||
data() {
|
||||
return {
|
||||
// disabled: true,
|
||||
user_id: "",
|
||||
// 判断是否保存过
|
||||
loading: false,
|
||||
formData: {
|
||||
ippz_wangkou: "",
|
||||
ippz_zwym: "",
|
||||
ippz_mrwg: "",
|
||||
ippz_dns_sx: "",
|
||||
ippz_dns_by: "",
|
||||
ippz_ip: "",
|
||||
ippz_mac: "3C:2D:50:20:30:3D",
|
||||
wgpz_wgmc: "",
|
||||
wgpz_wgid: "",
|
||||
wgpz_wglx: "",
|
||||
tdpz_tdmc: "",
|
||||
tdpz_td: "",
|
||||
tdpz_qdmc: "",
|
||||
tdpz_ip: "",
|
||||
tdpz_port: "",
|
||||
tdpz_cssj: "",
|
||||
tdpz_jgsj: "",
|
||||
tdpz_lxsj: "",
|
||||
tdpz_cfcs: "",
|
||||
tdpz_watchtime: "",
|
||||
tdpz_cjsylxdz: "",
|
||||
tdpz_dxzkb: "",
|
||||
tdpz_050F: "",
|
||||
tdpz_0610: "",
|
||||
sbpz_sbid: "",
|
||||
sbpz_sbmc: "",
|
||||
sbpz_mac: "",
|
||||
sbpz_jysb: "",
|
||||
sbpz_jdzxz: "",
|
||||
cjdpz_tagid: "",
|
||||
cjdpz_mc: "",
|
||||
cjdpz_sjq: "",
|
||||
cjdpz_jcqdz: "",
|
||||
cjdpz_cjsjlx: "",
|
||||
cjdpz_zjx: "",
|
||||
cjdpz_dxsx: "",
|
||||
cjdpz_beilv: "",
|
||||
mqtt_qiyong: "",
|
||||
mqtt_ip: "",
|
||||
mqtt_port: "",
|
||||
mqtt_wgsn: "",
|
||||
mqtt_sssjfbzt: "",
|
||||
mqtt_qos: "",
|
||||
mqtt_scms: "",
|
||||
mqtt_sczq: "",
|
||||
mqtt_sjgl: "",
|
||||
mqtt_cjd_sbmc: "",
|
||||
mqtt_cjd_tagid: "",
|
||||
},
|
||||
labelPosition: "left",
|
||||
ippz_zwym1: "255",
|
||||
ippz_zwym2: "255",
|
||||
ippz_zwym3: "255",
|
||||
ippz_zwym4: "0",
|
||||
ippz_ip1: "",
|
||||
ippz_ip2: "",
|
||||
ippz_ip3: "",
|
||||
ippz_ip4: "",
|
||||
ippz_mrwg1: "192",
|
||||
ippz_mrwg2: "168",
|
||||
ippz_mrwg3: "1",
|
||||
ippz_mrwg4: "1",
|
||||
ippz_dns_sx1: "8",
|
||||
ippz_dns_sx2: "8",
|
||||
ippz_dns_sx3: "8",
|
||||
ippz_dns_sx4: "8",
|
||||
|
||||
ippz_dns_by1: "8",
|
||||
ippz_dns_by2: "8",
|
||||
ippz_dns_by3: "8",
|
||||
ippz_dns_by4: "8",
|
||||
dialogFormVisible: true,
|
||||
formLabelWidth: "100px",
|
||||
// 有线的规则校验
|
||||
rules_ippz_wirle: {
|
||||
ippz_wangkou: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入网口",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
ippz_zwym: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateZwym,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_ip: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIp,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mrwg: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateMrwg,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_sx: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsSx,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_by: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsBy,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mac: [
|
||||
{ required: true, message: "请输入MAC地址", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// isSaveButtonDisabled() {
|
||||
// return (
|
||||
// !this.$refs.rules_ippz_wirle ||
|
||||
// this.$refs.rules_ippz_wirle.validateSync().length > 0
|
||||
// );
|
||||
// },
|
||||
},
|
||||
methods: {
|
||||
// 提交时的校验
|
||||
submitForm() {
|
||||
this.$refs["formData"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.saveAll();
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
//子网掩码验证
|
||||
validateZwym(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_zwym1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的子网掩码"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//ip地址验证
|
||||
validateIp(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_ip1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的IP地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//默认网关验证
|
||||
validateMrwg(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_mrwg1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的网关地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//首选DNS服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的主DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//备选dns服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的备用DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
// 保存数据, 发送请求
|
||||
async saveAll() {
|
||||
var obj = {
|
||||
ippz_ip: this.ippz_ip1 + "."+this.ippz_ip2 + "." + this.ippz_ip3 + "." + this.ippz_ip4,
|
||||
ippz_zwym:this.ippz_zwym1 + "."+this.ippz_zwym2 + "." + this.ippz_zwym3 + "." + this.ippz_zwym4,
|
||||
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,
|
||||
}
|
||||
let datas = {...this.formData, ...obj};
|
||||
console.log(this.formData);
|
||||
// sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.formData));
|
||||
let data = {
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(this.formData),
|
||||
};
|
||||
let res = await SaveUserAnswer(data);
|
||||
console.log(res);
|
||||
if (res.data.state) {
|
||||
this.$message({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
message: `保存失败`,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
console.log(res);
|
||||
},
|
||||
CopyText() {
|
||||
this.$message({
|
||||
message: "复制成功",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
async getUserAnswer() {
|
||||
this.loading = true;
|
||||
let res2 = await GetUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
this.loading = false;
|
||||
console.log(res2);
|
||||
if (res2.data.data && res2.data.state) {
|
||||
let res3 = JSON.parse(res2.data.data.mark_value);
|
||||
console.log(res3);
|
||||
|
||||
if (res3.ippz_mac) {
|
||||
this.formData.ippz_mac = res3.ippz_mac;
|
||||
}
|
||||
if (res3.ippz_mrwg) {
|
||||
this.formData.ippz_wangkou = res3.ippz_wangkou;
|
||||
this.formData.ippz_mrwg = res3.ippz_mrwg;
|
||||
this.formData.ippz_ip = res3.ippz_ip;
|
||||
this.formData.ippz_zwym = res3.ippz_zwym;
|
||||
this.formData.ippz_dns_sx = res3.ippz_dns_sx;
|
||||
this.formData.ippz_dns_by = res3.ippz_dns_by;
|
||||
this.ippz_mrwg1 = res3.ippz_mrwg.split(".")[0];
|
||||
this.ippz_mrwg2 = res3.ippz_mrwg.split(".")[1];
|
||||
this.ippz_mrwg3 = res3.ippz_mrwg.split(".")[2];
|
||||
this.ippz_mrwg4 = res3.ippz_mrwg.split(".")[3];
|
||||
this.ippz_ip1 = res3.ippz_ip.split(".")[0];
|
||||
this.ippz_ip2 = res3.ippz_ip.split(".")[1];
|
||||
this.ippz_ip3 = res3.ippz_ip.split(".")[2];
|
||||
this.ippz_ip4 = res3.ippz_ip.split(".")[3];
|
||||
this.ippz_zwym1 = res3.ippz_zwym.split(".")[0];
|
||||
this.ippz_zwym2 = res3.ippz_zwym.split(".")[1];
|
||||
this.ippz_zwym3 = res3.ippz_zwym.split(".")[2];
|
||||
this.ippz_zwym4 = res3.ippz_zwym.split(".")[3];
|
||||
this.ippz_dns_sx1 = res3.ippz_dns_sx.split(".")[0];
|
||||
this.ippz_dns_sx2 = res3.ippz_dns_sx.split(".")[1];
|
||||
this.ippz_dns_sx3 = res3.ippz_dns_sx.split(".")[2];
|
||||
this.ippz_dns_sx4 = res3.ippz_dns_sx.split(".")[3];
|
||||
this.ippz_dns_by1 = res3.ippz_dns_by.split(".")[0];
|
||||
this.ippz_dns_by2 = res3.ippz_dns_by.split(".")[1];
|
||||
this.ippz_dns_by3 = res3.ippz_dns_by.split(".")[2];
|
||||
this.ippz_dns_by4 = res3.ippz_dns_by.split(".")[3];
|
||||
}
|
||||
this.formData.wgpz_wgmc = res3.wgpz_wgmc;
|
||||
this.formData.wgpz_wgid = res3.wgpz_wgid;
|
||||
this.formData.wgpz_wglx = res3.wgpz_wglx;
|
||||
this.formData.tdpz_tdmc = res3.tdpz_tdmc;
|
||||
this.formData.tdpz_td = res3.tdpz_td;
|
||||
this.formData.tdpz_qdmc = res3.tdpz_qdmc;
|
||||
this.formData.tdpz_ip = res3.tdpz_ip;
|
||||
this.formData.tdpz_port = res3.tdpz_port;
|
||||
this.formData.tdpz_cssj = res3.tdpz_cssj;
|
||||
this.formData.tdpz_jgsj = res3.tdpz_jgsj;
|
||||
this.formData.tdpz_lxsj = res3.tdpz_lxsj;
|
||||
this.formData.tdpz_cfcs = res3.tdpz_cfcs;
|
||||
this.formData.tdpz_watchtime = res3.tdpz_watchtime;
|
||||
this.formData.tdpz_cjsylxdz = res3.tdpz_cjsylxdz;
|
||||
this.formData.tdpz_dxzkb = res3.tdpz_dxzkb;
|
||||
this.formData.tdpz_050F = res3.tdpz_050F;
|
||||
this.formData.tdpz_0610 = res3.tdpz_0610;
|
||||
this.formData.sbpz_sbid = res3.sbpz_sbid;
|
||||
this.formData.sbpz_sbmc = res3.sbpz_sbmc;
|
||||
this.formData.sbpz_mac = res3.sbpz_mac;
|
||||
this.formData.sbpz_jysb = res3.sbpz_jysb;
|
||||
this.formData.sbpz_jdzxz = res3.sbpz_jdzxz;
|
||||
|
||||
this.formData.cjdpz_tagid = res3.cjdpz_tagid;
|
||||
this.formData.cjdpz_mc = res3.cjdpz_mc;
|
||||
this.formData.cjdpz_sjq = res3.cjdpz_sjq;
|
||||
this.formData.cjdpz_jcqdz = res3.cjdpz_jcqdz;
|
||||
this.formData.cjdpz_cjsjlx = res3.cjdpz_cjsjlx;
|
||||
this.formData.cjdpz_zjx = res3.cjdpz_zjx;
|
||||
this.formData.cjdpz_dxsx = res3.cjdpz_dxsx;
|
||||
this.formData.cjdpz_beilv = res3.cjdpz_beilv;
|
||||
|
||||
this.formData.mqtt_qiyong = res3.mqtt_qiyong;
|
||||
this.formData.mqtt_ip = res3.mqtt_ip;
|
||||
this.formData.mqtt_port = res3.mqtt_port;
|
||||
this.formData.mqtt_wgsn = res3.mqtt_wgsn;
|
||||
this.formData.mqtt_sssjfbzt = res3.mqtt_sssjfbzt;
|
||||
this.formData.mqtt_qos = res3.mqtt_qos;
|
||||
this.formData.mqtt_scms = res3.mqtt_scms;
|
||||
this.formData.mqtt_sczq = res3.mqtt_sczq;
|
||||
this.formData.mqtt_sjgl = res3.mqtt_sjgl;
|
||||
this.formData.mqtt_cjd_sbmc = res3.mqtt_cjd_sbmc;
|
||||
this.formData.mqtt_cjd_tagid = res3.mqtt_cjd_tagid;
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.user_id = window.location.href.split("?")[1];
|
||||
this.getUserAnswer();
|
||||
},
|
||||
mounted() { },
|
||||
directives: {
|
||||
copy: {
|
||||
bind(el, { value }) {
|
||||
// 给元素赋值一个$value值,即指令绑定的值
|
||||
el.$value = value;
|
||||
el.handler = () => {
|
||||
// 如果可复制的值为空的时候,给出提示;
|
||||
if (!el.$value) {
|
||||
console.log("无复制内容");
|
||||
return;
|
||||
}
|
||||
// 动态创建 textarea 标签
|
||||
const textarea = document.createElement("textarea");
|
||||
// 将该 textarea 设为 readonly 防止 IOS 下自动唤起键盘,同时将 textarea 移除可视区域
|
||||
textarea.readOnly = "readonly";
|
||||
textarea.style.position = "absolute";
|
||||
textarea.style.left = "-9999px";
|
||||
// 将要copy的值赋值给textarea 标签的value属性
|
||||
textarea.value = el.$value;
|
||||
// 将textarea 插入到body中
|
||||
document.body.appendChild(textarea);
|
||||
// 选中值并复制
|
||||
textarea.select();
|
||||
const result = document.execCommand("Copy");
|
||||
if (result) {
|
||||
console.log("复制成功");
|
||||
}
|
||||
document.body.removeChild(textarea);
|
||||
};
|
||||
// 绑定点击事件,点击的时候copy值
|
||||
el.addEventListener("click", el.handler);
|
||||
},
|
||||
// 当传递进来的值更新的时候触发
|
||||
componentUpdated(el, { value }) {
|
||||
el.$value = value;
|
||||
},
|
||||
// 指令与元素解绑的时候,移除事件绑定
|
||||
unbind(el) {
|
||||
el.removeEventListener("click", el.handler);
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.title_center {
|
||||
font-size: 18px;
|
||||
color: red;
|
||||
position: absolute;
|
||||
left: 100px;
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
/deep/ .wired,
|
||||
/deep/ .wifi {
|
||||
.el-row {
|
||||
.el-col-12:last-child {
|
||||
padding-right: 120px;
|
||||
}
|
||||
|
||||
.el-col-12:first-child {
|
||||
padding-right: 118px;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.el-row {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
|
||||
.el-col-1 {
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.mac {
|
||||
// display: flex;
|
||||
align-items: center;
|
||||
|
||||
.el-button {
|
||||
position: absolute;
|
||||
left: 200px;
|
||||
bottom: 5px;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
line-height: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.netWay {
|
||||
margin-bottom: 20px;
|
||||
width: 80px;
|
||||
color: rgba(16, 16, 16, 1);
|
||||
font-size: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
left: 360px;
|
||||
bottom: 2px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,697 @@
|
|||
<!-- 有线网关设置 -->
|
||||
<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">
|
||||
<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">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip4" 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="子网掩码:" :label-width="formLabelWidth" prop="ippz_zwym">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym4" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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="1">.</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="1">.</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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer footer">
|
||||
<el-button type="primary" @click="submitForm">保 存</el-button>
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { SaveUserAnswer, GetUserAnswer } from "../api/user";
|
||||
export default {
|
||||
name: "GateWay",
|
||||
data() {
|
||||
return {
|
||||
// disabled: true,
|
||||
user_id: "",
|
||||
// 判断是否保存过
|
||||
loading: false,
|
||||
formData: {
|
||||
ippz_wangkou: "",
|
||||
ippz_zwym: "",
|
||||
ippz_mrwg: "",
|
||||
ippz_dns_sx: "",
|
||||
ippz_dns_by: "",
|
||||
ippz_ip: "",
|
||||
ippz_mac: "3C:2D:50:20:30:3D",
|
||||
wgpz_wgmc: "",
|
||||
wgpz_wgid: "",
|
||||
wgpz_wglx: "",
|
||||
tdpz_tdmc: "",
|
||||
tdpz_td: "",
|
||||
tdpz_qdmc: "",
|
||||
tdpz_ip: "",
|
||||
tdpz_port: "",
|
||||
tdpz_cssj: "",
|
||||
tdpz_jgsj: "",
|
||||
tdpz_lxsj: "",
|
||||
tdpz_cfcs: "",
|
||||
tdpz_watchtime: "",
|
||||
tdpz_cjsylxdz: "",
|
||||
tdpz_dxzkb: "",
|
||||
tdpz_050F: "",
|
||||
tdpz_0610: "",
|
||||
sbpz_sbid: "",
|
||||
sbpz_sbmc: "",
|
||||
sbpz_mac: "",
|
||||
sbpz_jysb: "",
|
||||
sbpz_jdzxz: "",
|
||||
cjdpz_tagid: "",
|
||||
cjdpz_mc: "",
|
||||
cjdpz_sjq: "",
|
||||
cjdpz_jcqdz: "",
|
||||
cjdpz_cjsjlx: "",
|
||||
cjdpz_zjx: "",
|
||||
cjdpz_dxsx: "",
|
||||
cjdpz_beilv: "",
|
||||
mqtt_qiyong: "",
|
||||
mqtt_ip: "",
|
||||
mqtt_port: "",
|
||||
mqtt_wgsn: "",
|
||||
mqtt_sssjfbzt: "",
|
||||
mqtt_qos: "",
|
||||
mqtt_scms: "",
|
||||
mqtt_sczq: "",
|
||||
mqtt_sjgl: "",
|
||||
mqtt_cjd_sbmc: "",
|
||||
mqtt_cjd_tagid: "",
|
||||
},
|
||||
labelPosition: "left",
|
||||
ippz_zwym1: "255",
|
||||
ippz_zwym2: "255",
|
||||
ippz_zwym3: "255",
|
||||
ippz_zwym4: "0",
|
||||
ippz_ip1: "",
|
||||
ippz_ip2: "",
|
||||
ippz_ip3: "",
|
||||
ippz_ip4: "",
|
||||
ippz_mrwg1: "192",
|
||||
ippz_mrwg2: "168",
|
||||
ippz_mrwg3: "1",
|
||||
ippz_mrwg4: "1",
|
||||
ippz_dns_sx1: "8",
|
||||
ippz_dns_sx2: "8",
|
||||
ippz_dns_sx3: "8",
|
||||
ippz_dns_sx4: "8",
|
||||
|
||||
ippz_dns_by1: "8",
|
||||
ippz_dns_by2: "8",
|
||||
ippz_dns_by3: "8",
|
||||
ippz_dns_by4: "8",
|
||||
dialogFormVisible: true,
|
||||
formLabelWidth: "100px",
|
||||
// 有线的规则校验
|
||||
rules_ippz_wirle: {
|
||||
ippz_wangkou: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入网口",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
ippz_zwym: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateZwym,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_ip: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIp,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mrwg: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateMrwg,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_sx: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsSx,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_by: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsBy,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mac: [
|
||||
{ required: true, message: "请输入MAC地址", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// isSaveButtonDisabled() {
|
||||
// return (
|
||||
// !this.$refs.rules_ippz_wirle ||
|
||||
// this.$refs.rules_ippz_wirle.validateSync().length > 0
|
||||
// );
|
||||
// },
|
||||
},
|
||||
methods: {
|
||||
// 提交时的校验
|
||||
submitForm() {
|
||||
this.$refs["formData"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.saveAll();
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
//子网掩码验证
|
||||
validateZwym(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_zwym1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的子网掩码"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//ip地址验证
|
||||
validateIp(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_ip1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的IP地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//默认网关验证
|
||||
validateMrwg(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_mrwg1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的网关地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//首选DNS服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的主DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//备选dns服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的备用DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
// 保存数据, 发送请求
|
||||
async saveAll() {
|
||||
var obj = {
|
||||
ippz_ip: this.ippz_ip1 + "." + this.ippz_ip2 + "." + this.ippz_ip3 + "." + this.ippz_ip4,
|
||||
ippz_zwym: this.ippz_zwym1 + "." + this.ippz_zwym2 + "." + this.ippz_zwym3 + "." + this.ippz_zwym4,
|
||||
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,
|
||||
}
|
||||
let datas = { ...this.formData, ...obj };
|
||||
console.log(this.formData);
|
||||
// sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.formData));
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(datas),
|
||||
});
|
||||
console.log(res);
|
||||
if (res.data.state) {
|
||||
this.$message({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
message: `保存失败`,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
console.log(res);
|
||||
},
|
||||
CopyText() {
|
||||
this.$message({
|
||||
message: "复制成功",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
async getUserAnswer() {
|
||||
this.loading = true;
|
||||
let res2 = await GetUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
this.loading = false;
|
||||
console.log(res2);
|
||||
if (res2.data.data && res2.data.state) {
|
||||
let res3 = JSON.parse(res2.data.data.mark_value);
|
||||
console.log(res3);
|
||||
|
||||
if (res3.ippz_mac) {
|
||||
this.formData.ippz_mac = res3.ippz_mac;
|
||||
}
|
||||
if (res3.ippz_mrwg) {
|
||||
this.formData.ippz_wangkou = res3.ippz_wangkou;
|
||||
this.formData.ippz_mrwg = res3.ippz_mrwg;
|
||||
this.formData.ippz_ip = res3.ippz_ip;
|
||||
this.formData.ippz_zwym = res3.ippz_zwym;
|
||||
this.formData.ippz_dns_sx = res3.ippz_dns_sx;
|
||||
this.formData.ippz_dns_by = res3.ippz_dns_by;
|
||||
this.ippz_mrwg1 = res3.ippz_mrwg.split(".")[0];
|
||||
this.ippz_mrwg2 = res3.ippz_mrwg.split(".")[1];
|
||||
this.ippz_mrwg3 = res3.ippz_mrwg.split(".")[2];
|
||||
this.ippz_mrwg4 = res3.ippz_mrwg.split(".")[3];
|
||||
this.ippz_ip1 = res3.ippz_ip.split(".")[0];
|
||||
this.ippz_ip2 = res3.ippz_ip.split(".")[1];
|
||||
this.ippz_ip3 = res3.ippz_ip.split(".")[2];
|
||||
this.ippz_ip4 = res3.ippz_ip.split(".")[3];
|
||||
this.ippz_zwym1 = res3.ippz_zwym.split(".")[0];
|
||||
this.ippz_zwym2 = res3.ippz_zwym.split(".")[1];
|
||||
this.ippz_zwym3 = res3.ippz_zwym.split(".")[2];
|
||||
this.ippz_zwym4 = res3.ippz_zwym.split(".")[3];
|
||||
this.ippz_dns_sx1 = res3.ippz_dns_sx.split(".")[0];
|
||||
this.ippz_dns_sx2 = res3.ippz_dns_sx.split(".")[1];
|
||||
this.ippz_dns_sx3 = res3.ippz_dns_sx.split(".")[2];
|
||||
this.ippz_dns_sx4 = res3.ippz_dns_sx.split(".")[3];
|
||||
this.ippz_dns_by1 = res3.ippz_dns_by.split(".")[0];
|
||||
this.ippz_dns_by2 = res3.ippz_dns_by.split(".")[1];
|
||||
this.ippz_dns_by3 = res3.ippz_dns_by.split(".")[2];
|
||||
this.ippz_dns_by4 = res3.ippz_dns_by.split(".")[3];
|
||||
}
|
||||
this.formData.wgpz_wgmc = res3.wgpz_wgmc;
|
||||
this.formData.wgpz_wgid = res3.wgpz_wgid;
|
||||
this.formData.wgpz_wglx = res3.wgpz_wglx;
|
||||
this.formData.tdpz_tdmc = res3.tdpz_tdmc;
|
||||
this.formData.tdpz_td = res3.tdpz_td;
|
||||
this.formData.tdpz_qdmc = res3.tdpz_qdmc;
|
||||
this.formData.tdpz_ip = res3.tdpz_ip;
|
||||
this.formData.tdpz_port = res3.tdpz_port;
|
||||
this.formData.tdpz_cssj = res3.tdpz_cssj;
|
||||
this.formData.tdpz_jgsj = res3.tdpz_jgsj;
|
||||
this.formData.tdpz_lxsj = res3.tdpz_lxsj;
|
||||
this.formData.tdpz_cfcs = res3.tdpz_cfcs;
|
||||
this.formData.tdpz_watchtime = res3.tdpz_watchtime;
|
||||
this.formData.tdpz_cjsylxdz = res3.tdpz_cjsylxdz;
|
||||
this.formData.tdpz_dxzkb = res3.tdpz_dxzkb;
|
||||
this.formData.tdpz_050F = res3.tdpz_050F;
|
||||
this.formData.tdpz_0610 = res3.tdpz_0610;
|
||||
this.formData.sbpz_sbid = res3.sbpz_sbid;
|
||||
this.formData.sbpz_sbmc = res3.sbpz_sbmc;
|
||||
this.formData.sbpz_mac = res3.sbpz_mac;
|
||||
this.formData.sbpz_jysb = res3.sbpz_jysb;
|
||||
this.formData.sbpz_jdzxz = res3.sbpz_jdzxz;
|
||||
|
||||
this.formData.cjdpz_tagid = res3.cjdpz_tagid;
|
||||
this.formData.cjdpz_mc = res3.cjdpz_mc;
|
||||
this.formData.cjdpz_sjq = res3.cjdpz_sjq;
|
||||
this.formData.cjdpz_jcqdz = res3.cjdpz_jcqdz;
|
||||
this.formData.cjdpz_cjsjlx = res3.cjdpz_cjsjlx;
|
||||
this.formData.cjdpz_zjx = res3.cjdpz_zjx;
|
||||
this.formData.cjdpz_dxsx = res3.cjdpz_dxsx;
|
||||
this.formData.cjdpz_beilv = res3.cjdpz_beilv;
|
||||
|
||||
this.formData.mqtt_qiyong = res3.mqtt_qiyong;
|
||||
this.formData.mqtt_ip = res3.mqtt_ip;
|
||||
this.formData.mqtt_port = res3.mqtt_port;
|
||||
this.formData.mqtt_wgsn = res3.mqtt_wgsn;
|
||||
this.formData.mqtt_sssjfbzt = res3.mqtt_sssjfbzt;
|
||||
this.formData.mqtt_qos = res3.mqtt_qos;
|
||||
this.formData.mqtt_scms = res3.mqtt_scms;
|
||||
this.formData.mqtt_sczq = res3.mqtt_sczq;
|
||||
this.formData.mqtt_sjgl = res3.mqtt_sjgl;
|
||||
this.formData.mqtt_cjd_sbmc = res3.mqtt_cjd_sbmc;
|
||||
this.formData.mqtt_cjd_tagid = res3.mqtt_cjd_tagid;
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.user_id = window.location.href.split("?")[1];
|
||||
this.getUserAnswer();
|
||||
},
|
||||
mounted() { },
|
||||
directives: {
|
||||
copy: {
|
||||
bind(el, { value }) {
|
||||
// 给元素赋值一个$value值,即指令绑定的值
|
||||
el.$value = value;
|
||||
el.handler = () => {
|
||||
// 如果可复制的值为空的时候,给出提示;
|
||||
if (!el.$value) {
|
||||
console.log("无复制内容");
|
||||
return;
|
||||
}
|
||||
// 动态创建 textarea 标签
|
||||
const textarea = document.createElement("textarea");
|
||||
// 将该 textarea 设为 readonly 防止 IOS 下自动唤起键盘,同时将 textarea 移除可视区域
|
||||
textarea.readOnly = "readonly";
|
||||
textarea.style.position = "absolute";
|
||||
textarea.style.left = "-9999px";
|
||||
// 将要copy的值赋值给textarea 标签的value属性
|
||||
textarea.value = el.$value;
|
||||
// 将textarea 插入到body中
|
||||
document.body.appendChild(textarea);
|
||||
// 选中值并复制
|
||||
textarea.select();
|
||||
const result = document.execCommand("Copy");
|
||||
if (result) {
|
||||
console.log("复制成功");
|
||||
}
|
||||
document.body.removeChild(textarea);
|
||||
};
|
||||
// 绑定点击事件,点击的时候copy值
|
||||
el.addEventListener("click", el.handler);
|
||||
},
|
||||
// 当传递进来的值更新的时候触发
|
||||
componentUpdated(el, { value }) {
|
||||
el.$value = value;
|
||||
},
|
||||
// 指令与元素解绑的时候,移除事件绑定
|
||||
unbind(el) {
|
||||
el.removeEventListener("click", el.handler);
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.title_center {
|
||||
font-size: 18px;
|
||||
color: red;
|
||||
position: absolute;
|
||||
left: 100px;
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
/deep/ .wired,
|
||||
/deep/ .wifi {
|
||||
.el-row {
|
||||
.el-col-12:last-child {
|
||||
padding-right: 120px;
|
||||
}
|
||||
|
||||
.el-col-12:first-child {
|
||||
padding-right: 118px;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.el-row {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
|
||||
.el-col-1 {
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.mac {
|
||||
// display: flex;
|
||||
align-items: center;
|
||||
|
||||
.el-button {
|
||||
position: absolute;
|
||||
left: 200px;
|
||||
bottom: 5px;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
line-height: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.netWay {
|
||||
margin-bottom: 20px;
|
||||
width: 80px;
|
||||
color: rgba(16, 16, 16, 1);
|
||||
font-size: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
left: 360px;
|
||||
bottom: 2px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,696 @@
|
|||
<!-- 有线网关设置 -->
|
||||
<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">
|
||||
<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">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip4" 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="子网掩码:" :label-width="formLabelWidth" prop="ippz_zwym">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym4" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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="1">.</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="1">.</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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer footer">
|
||||
<el-button type="primary" @click="submitForm">保 存</el-button>
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { SaveUserAnswer, GetUserAnswer } from "../api/user";
|
||||
export default {
|
||||
name: "GateWay",
|
||||
data() {
|
||||
return {
|
||||
// disabled: true,
|
||||
user_id: "",
|
||||
// 判断是否保存过
|
||||
loading: false,
|
||||
formData: {
|
||||
ippz_wangkou: "",
|
||||
ippz_zwym: "",
|
||||
ippz_mrwg: "",
|
||||
ippz_dns_sx: "",
|
||||
ippz_dns_by: "",
|
||||
ippz_ip: "",
|
||||
ippz_mac: "3C:2D:50:20:30:3D",
|
||||
wgpz_wgmc: "",
|
||||
wgpz_wgid: "",
|
||||
wgpz_wglx: "",
|
||||
tdpz_tdmc: "",
|
||||
tdpz_td: "",
|
||||
tdpz_qdmc: "",
|
||||
tdpz_ip: "",
|
||||
tdpz_port: "",
|
||||
tdpz_cssj: "",
|
||||
tdpz_jgsj: "",
|
||||
tdpz_lxsj: "",
|
||||
tdpz_cfcs: "",
|
||||
tdpz_watchtime: "",
|
||||
tdpz_cjsylxdz: "",
|
||||
tdpz_dxzkb: "",
|
||||
tdpz_050F: "",
|
||||
tdpz_0610: "",
|
||||
sbpz_sbid: "",
|
||||
sbpz_sbmc: "",
|
||||
sbpz_mac: "",
|
||||
sbpz_jysb: "",
|
||||
sbpz_jdzxz: "",
|
||||
cjdpz_tagid: "",
|
||||
cjdpz_mc: "",
|
||||
cjdpz_sjq: "",
|
||||
cjdpz_jcqdz: "",
|
||||
cjdpz_cjsjlx: "",
|
||||
cjdpz_zjx: "",
|
||||
cjdpz_dxsx: "",
|
||||
cjdpz_beilv: "",
|
||||
mqtt_qiyong: "",
|
||||
mqtt_ip: "",
|
||||
mqtt_port: "",
|
||||
mqtt_wgsn: "",
|
||||
mqtt_sssjfbzt: "",
|
||||
mqtt_qos: "",
|
||||
mqtt_scms: "",
|
||||
mqtt_sczq: "",
|
||||
mqtt_sjgl: "",
|
||||
mqtt_cjd_sbmc: "",
|
||||
mqtt_cjd_tagid: "",
|
||||
},
|
||||
labelPosition: "left",
|
||||
ippz_zwym1: "255",
|
||||
ippz_zwym2: "255",
|
||||
ippz_zwym3: "255",
|
||||
ippz_zwym4: "0",
|
||||
ippz_ip1: "",
|
||||
ippz_ip2: "",
|
||||
ippz_ip3: "",
|
||||
ippz_ip4: "",
|
||||
ippz_mrwg1: "192",
|
||||
ippz_mrwg2: "168",
|
||||
ippz_mrwg3: "1",
|
||||
ippz_mrwg4: "1",
|
||||
ippz_dns_sx1: "8",
|
||||
ippz_dns_sx2: "8",
|
||||
ippz_dns_sx3: "8",
|
||||
ippz_dns_sx4: "8",
|
||||
|
||||
ippz_dns_by1: "8",
|
||||
ippz_dns_by2: "8",
|
||||
ippz_dns_by3: "8",
|
||||
ippz_dns_by4: "8",
|
||||
dialogFormVisible: true,
|
||||
formLabelWidth: "100px",
|
||||
// 有线的规则校验
|
||||
rules_ippz_wirle: {
|
||||
ippz_wangkou: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入网口",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
ippz_zwym: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateZwym,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_ip: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIp,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mrwg: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateMrwg,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_sx: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsSx,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_by: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsBy,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mac: [
|
||||
{ required: true, message: "请输入MAC地址", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// isSaveButtonDisabled() {
|
||||
// return (
|
||||
// !this.$refs.rules_ippz_wirle ||
|
||||
// this.$refs.rules_ippz_wirle.validateSync().length > 0
|
||||
// );
|
||||
// },
|
||||
},
|
||||
methods: {
|
||||
// 提交时的校验
|
||||
submitForm() {
|
||||
this.$refs["formData"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.saveAll();
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
//子网掩码验证
|
||||
validateZwym(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_zwym1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的子网掩码"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//ip地址验证
|
||||
validateIp(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_ip1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的IP地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//默认网关验证
|
||||
validateMrwg(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_mrwg1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的网关地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//首选DNS服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的主DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//备选dns服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的备用DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
// 保存数据, 发送请求
|
||||
async saveAll() {
|
||||
var obj = {
|
||||
ippz_ip: this.ippz_ip1 + "." + this.ippz_ip2 + "." + this.ippz_ip3 + "." + this.ippz_ip4,
|
||||
ippz_zwym: this.ippz_zwym1 + "." + this.ippz_zwym2 + "." + this.ippz_zwym3 + "." + this.ippz_zwym4,
|
||||
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,
|
||||
}
|
||||
let datas = { ...this.formData, ...obj };
|
||||
console.log(this.formData);
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(datas),
|
||||
});
|
||||
console.log(res);
|
||||
if (res.data.state) {
|
||||
this.$message({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
message: `保存失败`,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
console.log(res);
|
||||
},
|
||||
CopyText() {
|
||||
this.$message({
|
||||
message: "复制成功",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
async getUserAnswer() {
|
||||
this.loading = true;
|
||||
let res2 = await GetUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
this.loading = false;
|
||||
console.log(res2);
|
||||
if (res2.data.data && res2.data.state) {
|
||||
let res3 = JSON.parse(res2.data.data.mark_value);
|
||||
console.log(res3);
|
||||
|
||||
if (res3.ippz_mac) {
|
||||
this.formData.ippz_mac = res3.ippz_mac;
|
||||
}
|
||||
if (res3.ippz_mrwg) {
|
||||
this.formData.ippz_wangkou = res3.ippz_wangkou;
|
||||
this.formData.ippz_mrwg = res3.ippz_mrwg;
|
||||
this.formData.ippz_ip = res3.ippz_ip;
|
||||
this.formData.ippz_zwym = res3.ippz_zwym;
|
||||
this.formData.ippz_dns_sx = res3.ippz_dns_sx;
|
||||
this.formData.ippz_dns_by = res3.ippz_dns_by;
|
||||
this.ippz_mrwg1 = res3.ippz_mrwg.split(".")[0];
|
||||
this.ippz_mrwg2 = res3.ippz_mrwg.split(".")[1];
|
||||
this.ippz_mrwg3 = res3.ippz_mrwg.split(".")[2];
|
||||
this.ippz_mrwg4 = res3.ippz_mrwg.split(".")[3];
|
||||
this.ippz_ip1 = res3.ippz_ip.split(".")[0];
|
||||
this.ippz_ip2 = res3.ippz_ip.split(".")[1];
|
||||
this.ippz_ip3 = res3.ippz_ip.split(".")[2];
|
||||
this.ippz_ip4 = res3.ippz_ip.split(".")[3];
|
||||
this.ippz_zwym1 = res3.ippz_zwym.split(".")[0];
|
||||
this.ippz_zwym2 = res3.ippz_zwym.split(".")[1];
|
||||
this.ippz_zwym3 = res3.ippz_zwym.split(".")[2];
|
||||
this.ippz_zwym4 = res3.ippz_zwym.split(".")[3];
|
||||
this.ippz_dns_sx1 = res3.ippz_dns_sx.split(".")[0];
|
||||
this.ippz_dns_sx2 = res3.ippz_dns_sx.split(".")[1];
|
||||
this.ippz_dns_sx3 = res3.ippz_dns_sx.split(".")[2];
|
||||
this.ippz_dns_sx4 = res3.ippz_dns_sx.split(".")[3];
|
||||
this.ippz_dns_by1 = res3.ippz_dns_by.split(".")[0];
|
||||
this.ippz_dns_by2 = res3.ippz_dns_by.split(".")[1];
|
||||
this.ippz_dns_by3 = res3.ippz_dns_by.split(".")[2];
|
||||
this.ippz_dns_by4 = res3.ippz_dns_by.split(".")[3];
|
||||
}
|
||||
this.formData.wgpz_wgmc = res3.wgpz_wgmc;
|
||||
this.formData.wgpz_wgid = res3.wgpz_wgid;
|
||||
this.formData.wgpz_wglx = res3.wgpz_wglx;
|
||||
this.formData.tdpz_tdmc = res3.tdpz_tdmc;
|
||||
this.formData.tdpz_td = res3.tdpz_td;
|
||||
this.formData.tdpz_qdmc = res3.tdpz_qdmc;
|
||||
this.formData.tdpz_ip = res3.tdpz_ip;
|
||||
this.formData.tdpz_port = res3.tdpz_port;
|
||||
this.formData.tdpz_cssj = res3.tdpz_cssj;
|
||||
this.formData.tdpz_jgsj = res3.tdpz_jgsj;
|
||||
this.formData.tdpz_lxsj = res3.tdpz_lxsj;
|
||||
this.formData.tdpz_cfcs = res3.tdpz_cfcs;
|
||||
this.formData.tdpz_watchtime = res3.tdpz_watchtime;
|
||||
this.formData.tdpz_cjsylxdz = res3.tdpz_cjsylxdz;
|
||||
this.formData.tdpz_dxzkb = res3.tdpz_dxzkb;
|
||||
this.formData.tdpz_050F = res3.tdpz_050F;
|
||||
this.formData.tdpz_0610 = res3.tdpz_0610;
|
||||
this.formData.sbpz_sbid = res3.sbpz_sbid;
|
||||
this.formData.sbpz_sbmc = res3.sbpz_sbmc;
|
||||
this.formData.sbpz_mac = res3.sbpz_mac;
|
||||
this.formData.sbpz_jysb = res3.sbpz_jysb;
|
||||
this.formData.sbpz_jdzxz = res3.sbpz_jdzxz;
|
||||
|
||||
this.formData.cjdpz_tagid = res3.cjdpz_tagid;
|
||||
this.formData.cjdpz_mc = res3.cjdpz_mc;
|
||||
this.formData.cjdpz_sjq = res3.cjdpz_sjq;
|
||||
this.formData.cjdpz_jcqdz = res3.cjdpz_jcqdz;
|
||||
this.formData.cjdpz_cjsjlx = res3.cjdpz_cjsjlx;
|
||||
this.formData.cjdpz_zjx = res3.cjdpz_zjx;
|
||||
this.formData.cjdpz_dxsx = res3.cjdpz_dxsx;
|
||||
this.formData.cjdpz_beilv = res3.cjdpz_beilv;
|
||||
|
||||
this.formData.mqtt_qiyong = res3.mqtt_qiyong;
|
||||
this.formData.mqtt_ip = res3.mqtt_ip;
|
||||
this.formData.mqtt_port = res3.mqtt_port;
|
||||
this.formData.mqtt_wgsn = res3.mqtt_wgsn;
|
||||
this.formData.mqtt_sssjfbzt = res3.mqtt_sssjfbzt;
|
||||
this.formData.mqtt_qos = res3.mqtt_qos;
|
||||
this.formData.mqtt_scms = res3.mqtt_scms;
|
||||
this.formData.mqtt_sczq = res3.mqtt_sczq;
|
||||
this.formData.mqtt_sjgl = res3.mqtt_sjgl;
|
||||
this.formData.mqtt_cjd_sbmc = res3.mqtt_cjd_sbmc;
|
||||
this.formData.mqtt_cjd_tagid = res3.mqtt_cjd_tagid;
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.user_id = window.location.href.split("?")[1];
|
||||
this.getUserAnswer();
|
||||
},
|
||||
mounted() { },
|
||||
directives: {
|
||||
copy: {
|
||||
bind(el, { value }) {
|
||||
// 给元素赋值一个$value值,即指令绑定的值
|
||||
el.$value = value;
|
||||
el.handler = () => {
|
||||
// 如果可复制的值为空的时候,给出提示;
|
||||
if (!el.$value) {
|
||||
console.log("无复制内容");
|
||||
return;
|
||||
}
|
||||
// 动态创建 textarea 标签
|
||||
const textarea = document.createElement("textarea");
|
||||
// 将该 textarea 设为 readonly 防止 IOS 下自动唤起键盘,同时将 textarea 移除可视区域
|
||||
textarea.readOnly = "readonly";
|
||||
textarea.style.position = "absolute";
|
||||
textarea.style.left = "-9999px";
|
||||
// 将要copy的值赋值给textarea 标签的value属性
|
||||
textarea.value = el.$value;
|
||||
// 将textarea 插入到body中
|
||||
document.body.appendChild(textarea);
|
||||
// 选中值并复制
|
||||
textarea.select();
|
||||
const result = document.execCommand("Copy");
|
||||
if (result) {
|
||||
console.log("复制成功");
|
||||
}
|
||||
document.body.removeChild(textarea);
|
||||
};
|
||||
// 绑定点击事件,点击的时候copy值
|
||||
el.addEventListener("click", el.handler);
|
||||
},
|
||||
// 当传递进来的值更新的时候触发
|
||||
componentUpdated(el, { value }) {
|
||||
el.$value = value;
|
||||
},
|
||||
// 指令与元素解绑的时候,移除事件绑定
|
||||
unbind(el) {
|
||||
el.removeEventListener("click", el.handler);
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.title_center {
|
||||
font-size: 18px;
|
||||
color: red;
|
||||
position: absolute;
|
||||
left: 100px;
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
/deep/ .wired,
|
||||
/deep/ .wifi {
|
||||
.el-row {
|
||||
.el-col-12:last-child {
|
||||
padding-right: 120px;
|
||||
}
|
||||
|
||||
.el-col-12:first-child {
|
||||
padding-right: 118px;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.el-row {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
|
||||
.el-col-1 {
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.mac {
|
||||
// display: flex;
|
||||
align-items: center;
|
||||
|
||||
.el-button {
|
||||
position: absolute;
|
||||
left: 200px;
|
||||
bottom: 5px;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
line-height: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.netWay {
|
||||
margin-bottom: 20px;
|
||||
width: 80px;
|
||||
color: rgba(16, 16, 16, 1);
|
||||
font-size: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
left: 360px;
|
||||
bottom: 2px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,696 @@
|
|||
<!-- 有线网关设置 -->
|
||||
<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">
|
||||
<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">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_ip4" 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="子网掩码:" :label-width="formLabelWidth" prop="ippz_zwym">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym1" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym2" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym3" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ippz_zwym4" maxlength="3"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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="1">.</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="1">.</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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-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-row>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<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-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
<div slot="footer" class="dialog-footer footer">
|
||||
<el-button type="primary" @click="submitForm">保 存</el-button>
|
||||
<el-button @click="dialogFormVisible = false">取 消</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { SaveUserAnswer, GetUserAnswer } from "../api/user";
|
||||
export default {
|
||||
name: "GateWay",
|
||||
data() {
|
||||
return {
|
||||
// disabled: true,
|
||||
user_id: "",
|
||||
// 判断是否保存过
|
||||
loading: false,
|
||||
formData: {
|
||||
ippz_wangkou: "",
|
||||
ippz_zwym: "",
|
||||
ippz_mrwg: "",
|
||||
ippz_dns_sx: "",
|
||||
ippz_dns_by: "",
|
||||
ippz_ip: "",
|
||||
ippz_mac: "3C:2D:50:20:30:3D",
|
||||
wgpz_wgmc: "",
|
||||
wgpz_wgid: "",
|
||||
wgpz_wglx: "",
|
||||
tdpz_tdmc: "",
|
||||
tdpz_td: "",
|
||||
tdpz_qdmc: "",
|
||||
tdpz_ip: "",
|
||||
tdpz_port: "",
|
||||
tdpz_cssj: "",
|
||||
tdpz_jgsj: "",
|
||||
tdpz_lxsj: "",
|
||||
tdpz_cfcs: "",
|
||||
tdpz_watchtime: "",
|
||||
tdpz_cjsylxdz: "",
|
||||
tdpz_dxzkb: "",
|
||||
tdpz_050F: "",
|
||||
tdpz_0610: "",
|
||||
sbpz_sbid: "",
|
||||
sbpz_sbmc: "",
|
||||
sbpz_mac: "",
|
||||
sbpz_jysb: "",
|
||||
sbpz_jdzxz: "",
|
||||
cjdpz_tagid: "",
|
||||
cjdpz_mc: "",
|
||||
cjdpz_sjq: "",
|
||||
cjdpz_jcqdz: "",
|
||||
cjdpz_cjsjlx: "",
|
||||
cjdpz_zjx: "",
|
||||
cjdpz_dxsx: "",
|
||||
cjdpz_beilv: "",
|
||||
mqtt_qiyong: "",
|
||||
mqtt_ip: "",
|
||||
mqtt_port: "",
|
||||
mqtt_wgsn: "",
|
||||
mqtt_sssjfbzt: "",
|
||||
mqtt_qos: "",
|
||||
mqtt_scms: "",
|
||||
mqtt_sczq: "",
|
||||
mqtt_sjgl: "",
|
||||
mqtt_cjd_sbmc: "",
|
||||
mqtt_cjd_tagid: "",
|
||||
},
|
||||
labelPosition: "left",
|
||||
ippz_zwym1: "255",
|
||||
ippz_zwym2: "255",
|
||||
ippz_zwym3: "255",
|
||||
ippz_zwym4: "0",
|
||||
ippz_ip1: "",
|
||||
ippz_ip2: "",
|
||||
ippz_ip3: "",
|
||||
ippz_ip4: "",
|
||||
ippz_mrwg1: "192",
|
||||
ippz_mrwg2: "168",
|
||||
ippz_mrwg3: "1",
|
||||
ippz_mrwg4: "1",
|
||||
ippz_dns_sx1: "8",
|
||||
ippz_dns_sx2: "8",
|
||||
ippz_dns_sx3: "8",
|
||||
ippz_dns_sx4: "8",
|
||||
|
||||
ippz_dns_by1: "8",
|
||||
ippz_dns_by2: "8",
|
||||
ippz_dns_by3: "8",
|
||||
ippz_dns_by4: "8",
|
||||
dialogFormVisible: true,
|
||||
formLabelWidth: "100px",
|
||||
// 有线的规则校验
|
||||
rules_ippz_wirle: {
|
||||
ippz_wangkou: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入网口",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
ippz_zwym: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateZwym,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_ip: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateIp,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mrwg: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateMrwg,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_sx: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsSx,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_dns_by: [
|
||||
{
|
||||
required: true,
|
||||
message: "",
|
||||
validator: this.validateDnsBy,
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
ippz_mac: [
|
||||
{ required: true, message: "请输入MAC地址", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// isSaveButtonDisabled() {
|
||||
// return (
|
||||
// !this.$refs.rules_ippz_wirle ||
|
||||
// this.$refs.rules_ippz_wirle.validateSync().length > 0
|
||||
// );
|
||||
// },
|
||||
},
|
||||
methods: {
|
||||
// 提交时的校验
|
||||
submitForm() {
|
||||
this.$refs["formData"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.saveAll();
|
||||
} else {
|
||||
console.log("error submit!!");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
//子网掩码验证
|
||||
validateZwym(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_zwym1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的子网掩码"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//ip地址验证
|
||||
validateIp(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_ip1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的IP地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//默认网关验证
|
||||
validateMrwg(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_mrwg1 +
|
||||
"." +
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的网关地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//首选DNS服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的主DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
//备选dns服务验证
|
||||
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
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的备用DNS服务器地址"));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
|
||||
// 保存数据, 发送请求
|
||||
async saveAll() {
|
||||
var obj = {
|
||||
ippz_ip: this.ippz_ip1 + "." + this.ippz_ip2 + "." + this.ippz_ip3 + "." + this.ippz_ip4,
|
||||
ippz_zwym: this.ippz_zwym1 + "." + this.ippz_zwym2 + "." + this.ippz_zwym3 + "." + this.ippz_zwym4,
|
||||
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,
|
||||
}
|
||||
let datas = { ...this.formData, ...obj };
|
||||
console.log(this.formData);
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(datas),
|
||||
});
|
||||
console.log(res);
|
||||
if (res.data.state) {
|
||||
this.$message({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
this.$message({
|
||||
message: `保存失败`,
|
||||
type: "error",
|
||||
});
|
||||
}
|
||||
console.log(res);
|
||||
},
|
||||
CopyText() {
|
||||
this.$message({
|
||||
message: "复制成功",
|
||||
type: "success",
|
||||
});
|
||||
},
|
||||
async getUserAnswer() {
|
||||
this.loading = true;
|
||||
let res2 = await GetUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
});
|
||||
this.loading = false;
|
||||
console.log(res2);
|
||||
if (res2.data.data && res2.data.state) {
|
||||
let res3 = JSON.parse(res2.data.data.mark_value);
|
||||
console.log(res3);
|
||||
|
||||
if (res3.ippz_mac) {
|
||||
this.formData.ippz_mac = res3.ippz_mac;
|
||||
}
|
||||
if (res3.ippz_mrwg) {
|
||||
this.formData.ippz_wangkou = res3.ippz_wangkou;
|
||||
this.formData.ippz_mrwg = res3.ippz_mrwg;
|
||||
this.formData.ippz_ip = res3.ippz_ip;
|
||||
this.formData.ippz_zwym = res3.ippz_zwym;
|
||||
this.formData.ippz_dns_sx = res3.ippz_dns_sx;
|
||||
this.formData.ippz_dns_by = res3.ippz_dns_by;
|
||||
this.ippz_mrwg1 = res3.ippz_mrwg.split(".")[0];
|
||||
this.ippz_mrwg2 = res3.ippz_mrwg.split(".")[1];
|
||||
this.ippz_mrwg3 = res3.ippz_mrwg.split(".")[2];
|
||||
this.ippz_mrwg4 = res3.ippz_mrwg.split(".")[3];
|
||||
this.ippz_ip1 = res3.ippz_ip.split(".")[0];
|
||||
this.ippz_ip2 = res3.ippz_ip.split(".")[1];
|
||||
this.ippz_ip3 = res3.ippz_ip.split(".")[2];
|
||||
this.ippz_ip4 = res3.ippz_ip.split(".")[3];
|
||||
this.ippz_zwym1 = res3.ippz_zwym.split(".")[0];
|
||||
this.ippz_zwym2 = res3.ippz_zwym.split(".")[1];
|
||||
this.ippz_zwym3 = res3.ippz_zwym.split(".")[2];
|
||||
this.ippz_zwym4 = res3.ippz_zwym.split(".")[3];
|
||||
this.ippz_dns_sx1 = res3.ippz_dns_sx.split(".")[0];
|
||||
this.ippz_dns_sx2 = res3.ippz_dns_sx.split(".")[1];
|
||||
this.ippz_dns_sx3 = res3.ippz_dns_sx.split(".")[2];
|
||||
this.ippz_dns_sx4 = res3.ippz_dns_sx.split(".")[3];
|
||||
this.ippz_dns_by1 = res3.ippz_dns_by.split(".")[0];
|
||||
this.ippz_dns_by2 = res3.ippz_dns_by.split(".")[1];
|
||||
this.ippz_dns_by3 = res3.ippz_dns_by.split(".")[2];
|
||||
this.ippz_dns_by4 = res3.ippz_dns_by.split(".")[3];
|
||||
}
|
||||
this.formData.wgpz_wgmc = res3.wgpz_wgmc;
|
||||
this.formData.wgpz_wgid = res3.wgpz_wgid;
|
||||
this.formData.wgpz_wglx = res3.wgpz_wglx;
|
||||
this.formData.tdpz_tdmc = res3.tdpz_tdmc;
|
||||
this.formData.tdpz_td = res3.tdpz_td;
|
||||
this.formData.tdpz_qdmc = res3.tdpz_qdmc;
|
||||
this.formData.tdpz_ip = res3.tdpz_ip;
|
||||
this.formData.tdpz_port = res3.tdpz_port;
|
||||
this.formData.tdpz_cssj = res3.tdpz_cssj;
|
||||
this.formData.tdpz_jgsj = res3.tdpz_jgsj;
|
||||
this.formData.tdpz_lxsj = res3.tdpz_lxsj;
|
||||
this.formData.tdpz_cfcs = res3.tdpz_cfcs;
|
||||
this.formData.tdpz_watchtime = res3.tdpz_watchtime;
|
||||
this.formData.tdpz_cjsylxdz = res3.tdpz_cjsylxdz;
|
||||
this.formData.tdpz_dxzkb = res3.tdpz_dxzkb;
|
||||
this.formData.tdpz_050F = res3.tdpz_050F;
|
||||
this.formData.tdpz_0610 = res3.tdpz_0610;
|
||||
this.formData.sbpz_sbid = res3.sbpz_sbid;
|
||||
this.formData.sbpz_sbmc = res3.sbpz_sbmc;
|
||||
this.formData.sbpz_mac = res3.sbpz_mac;
|
||||
this.formData.sbpz_jysb = res3.sbpz_jysb;
|
||||
this.formData.sbpz_jdzxz = res3.sbpz_jdzxz;
|
||||
|
||||
this.formData.cjdpz_tagid = res3.cjdpz_tagid;
|
||||
this.formData.cjdpz_mc = res3.cjdpz_mc;
|
||||
this.formData.cjdpz_sjq = res3.cjdpz_sjq;
|
||||
this.formData.cjdpz_jcqdz = res3.cjdpz_jcqdz;
|
||||
this.formData.cjdpz_cjsjlx = res3.cjdpz_cjsjlx;
|
||||
this.formData.cjdpz_zjx = res3.cjdpz_zjx;
|
||||
this.formData.cjdpz_dxsx = res3.cjdpz_dxsx;
|
||||
this.formData.cjdpz_beilv = res3.cjdpz_beilv;
|
||||
|
||||
this.formData.mqtt_qiyong = res3.mqtt_qiyong;
|
||||
this.formData.mqtt_ip = res3.mqtt_ip;
|
||||
this.formData.mqtt_port = res3.mqtt_port;
|
||||
this.formData.mqtt_wgsn = res3.mqtt_wgsn;
|
||||
this.formData.mqtt_sssjfbzt = res3.mqtt_sssjfbzt;
|
||||
this.formData.mqtt_qos = res3.mqtt_qos;
|
||||
this.formData.mqtt_scms = res3.mqtt_scms;
|
||||
this.formData.mqtt_sczq = res3.mqtt_sczq;
|
||||
this.formData.mqtt_sjgl = res3.mqtt_sjgl;
|
||||
this.formData.mqtt_cjd_sbmc = res3.mqtt_cjd_sbmc;
|
||||
this.formData.mqtt_cjd_tagid = res3.mqtt_cjd_tagid;
|
||||
}
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.user_id = window.location.href.split("?")[1];
|
||||
this.getUserAnswer();
|
||||
},
|
||||
mounted() { },
|
||||
directives: {
|
||||
copy: {
|
||||
bind(el, { value }) {
|
||||
// 给元素赋值一个$value值,即指令绑定的值
|
||||
el.$value = value;
|
||||
el.handler = () => {
|
||||
// 如果可复制的值为空的时候,给出提示;
|
||||
if (!el.$value) {
|
||||
console.log("无复制内容");
|
||||
return;
|
||||
}
|
||||
// 动态创建 textarea 标签
|
||||
const textarea = document.createElement("textarea");
|
||||
// 将该 textarea 设为 readonly 防止 IOS 下自动唤起键盘,同时将 textarea 移除可视区域
|
||||
textarea.readOnly = "readonly";
|
||||
textarea.style.position = "absolute";
|
||||
textarea.style.left = "-9999px";
|
||||
// 将要copy的值赋值给textarea 标签的value属性
|
||||
textarea.value = el.$value;
|
||||
// 将textarea 插入到body中
|
||||
document.body.appendChild(textarea);
|
||||
// 选中值并复制
|
||||
textarea.select();
|
||||
const result = document.execCommand("Copy");
|
||||
if (result) {
|
||||
console.log("复制成功");
|
||||
}
|
||||
document.body.removeChild(textarea);
|
||||
};
|
||||
// 绑定点击事件,点击的时候copy值
|
||||
el.addEventListener("click", el.handler);
|
||||
},
|
||||
// 当传递进来的值更新的时候触发
|
||||
componentUpdated(el, { value }) {
|
||||
el.$value = value;
|
||||
},
|
||||
// 指令与元素解绑的时候,移除事件绑定
|
||||
unbind(el) {
|
||||
el.removeEventListener("click", el.handler);
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.title_center {
|
||||
font-size: 18px;
|
||||
color: red;
|
||||
position: absolute;
|
||||
left: 100px;
|
||||
top: 20px;
|
||||
}
|
||||
|
||||
/deep/ .wired,
|
||||
/deep/ .wifi {
|
||||
.el-row {
|
||||
.el-col-12:last-child {
|
||||
padding-right: 120px;
|
||||
}
|
||||
|
||||
.el-col-12:first-child {
|
||||
padding-right: 118px;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
height: 30px;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.el-row {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
|
||||
.el-col-1 {
|
||||
text-align: center;
|
||||
line-height: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.mac {
|
||||
// display: flex;
|
||||
align-items: center;
|
||||
|
||||
.el-button {
|
||||
position: absolute;
|
||||
left: 200px;
|
||||
bottom: 5px;
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
line-height: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.netWay {
|
||||
margin-bottom: 20px;
|
||||
width: 80px;
|
||||
color: rgba(16, 16, 16, 1);
|
||||
font-size: 20px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: absolute;
|
||||
left: 360px;
|
||||
bottom: 2px;
|
||||
}
|
||||
</style>
|
|
@ -1,108 +1,18 @@
|
|||
<!-- 斥候数据采集——有线网关配置 -->
|
||||
<template>
|
||||
<div>
|
||||
<!-- <div class="gateway" v-show="isShow" v-loading="loading">
|
||||
<div class="title">
|
||||
<p class="title_l" style="color: #fff">新建网关</p>
|
||||
<i class="el-icon-close title_r" @click="isShow = false"></i>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<div class="content">
|
||||
<el-form
|
||||
:model="formData"
|
||||
:label-position="labelPosition"
|
||||
:rules="rules"
|
||||
ref="formData"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
label="网关名称:"
|
||||
:label-width="formLabelWidth"
|
||||
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-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
label="网关ID:"
|
||||
:label-width="formLabelWidth"
|
||||
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-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="footer">
|
||||
<el-button type="primary" @click="submitForm">保 存</el-button>
|
||||
<el-button @click="isShow = false">取 消</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="gateway">
|
||||
<el-dialog title="新建网关" :visible.sync="outerVisible" width="382px">
|
||||
<el-form
|
||||
:model="formData"
|
||||
:rules="rules"
|
||||
ref="formData"
|
||||
label-width="85px"
|
||||
class="demo-ruleForm"
|
||||
>
|
||||
<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>
|
||||
|
@ -114,12 +24,7 @@
|
|||
</el-dialog>
|
||||
</div>
|
||||
<div>
|
||||
<el-dialog
|
||||
title="系统提示"
|
||||
:visible.sync="innerVisible"
|
||||
append-to-body
|
||||
width="382px"
|
||||
>
|
||||
<el-dialog title="系统提示" :visible.sync="innerVisible" append-to-body width="382px">
|
||||
<p class="inner_content">
|
||||
请确认选择的网关类型与网关实体一致:否则该工程无法下载至实体网关
|
||||
</p>
|
||||
|
@ -332,7 +237,7 @@ export default {
|
|||
}
|
||||
},
|
||||
},
|
||||
created() {},
|
||||
created() { },
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
@ -4,15 +4,8 @@
|
|||
<!-- <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> -->
|
||||
|
@ -23,12 +16,7 @@
|
|||
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>
|
||||
|
@ -38,50 +26,30 @@
|
|||
</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>
|
||||
|
@ -90,63 +58,29 @@
|
|||
</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>
|
||||
|
@ -161,47 +95,22 @@
|
|||
</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">
|
||||
|
@ -238,24 +147,16 @@
|
|||
<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>
|
||||
|
@ -266,14 +167,8 @@
|
|||
<!-- 添加按钮下显示出来的弹框信息 -->
|
||||
<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>
|
||||
|
@ -284,55 +179,22 @@
|
|||
|
||||
<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>
|
||||
|
@ -765,24 +627,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地址"));
|
||||
|
@ -862,14 +724,7 @@ export default {
|
|||
async saveClone() {
|
||||
var obj = {
|
||||
mqtt_qiyong: String(Number(this.formData.mqtt_qiyong)),
|
||||
mqtt_ip:
|
||||
this.mqtt_ip1 +
|
||||
"." +
|
||||
this.mqtt_ip2 +
|
||||
"." +
|
||||
this.mqtt_ip3 +
|
||||
"." +
|
||||
this.mqtt_ip4,
|
||||
mqtt_ip: this.mqtt_ip1 + "." + this.mqtt_ip2 + "." + this.mqtt_ip3 + "." + this.mqtt_ip4,
|
||||
mqtt_port: this.formData.mqtt_port,
|
||||
mqtt_wgsn: this.formData.mqtt_wgsn,
|
||||
mqtt_sssjfbzt: this.formData.mqtt_sssjfbzt,
|
||||
|
@ -934,9 +789,10 @@ export default {
|
|||
this.formData.mqtt_sczq = obj.mqtt_sczq;
|
||||
this.formData.mqtt_sjgl = obj.mqtt_sjgl;
|
||||
}
|
||||
this.formData.ippz_wangkou = obj.ippz_wangkou;
|
||||
this.formData.ippz_mrwg = obj.ippz_mrwg;
|
||||
this.formData.ippz_ip = obj.ippz_ip;
|
||||
this.formData.zwym = obj.zwym;
|
||||
this.formData.ippz_zwym = obj.ippz_zwym;
|
||||
this.formData.ippz_dns_sx = obj.ippz_dns_sx;
|
||||
this.formData.ippz_dns_by = obj.ippz_dns_by;
|
||||
this.formData.wgpz_wgmc = obj.wgpz_wgmc;
|
||||
|
@ -991,7 +847,7 @@ export default {
|
|||
// console.log(result);
|
||||
},
|
||||
async getTree() {
|
||||
console.log("12341");
|
||||
// console.log("12341");
|
||||
let res = await GetTree({ user_id: this.user_id, type: "1" });
|
||||
// console.log(res);
|
||||
// console.log(JSON.parse(res.data.data.data));
|
||||
|
|
|
@ -5,33 +5,18 @@
|
|||
<!-- 设置树形控件 -->
|
||||
<!-- <el-button type="info" plain @click="dialogVisible = true">采集点设置</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">
|
||||
<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>
|
||||
<el-input style="width: 260px" v-model="gateway" @change="changeInput"></el-input>
|
||||
</template>
|
||||
<template v-else>{{ data.label }}</template>
|
||||
</span>
|
||||
</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>
|
||||
|
@ -53,142 +38,79 @@
|
|||
<!-- <el-menu-item index="1">保存</el-menu-item> -->
|
||||
<!-- </el-menu> -->
|
||||
</div>
|
||||
<el-table
|
||||
ref="singleTable"
|
||||
:data="tableData"
|
||||
style="width: 100%"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-table ref="singleTable" :data="tableData" style="width: 100%" v-loading="loading">
|
||||
<el-table-column type="index"> </el-table-column>
|
||||
<el-table-column property="cjdpz_tagid" label="TagID">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.cjdpz_tagid" placeholder="">
|
||||
<el-option
|
||||
v-for="(option, index) in options1"
|
||||
:key="index"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
></el-option>
|
||||
<el-option v-for="(option, index) in options1" :key="index" :label="option.label"
|
||||
:value="option.value"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="cjdpz_mc" label="名称">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.cjdpz_mc" 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="cjdpz_sjq" label="数据区">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.cjdpz_sjq" 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>
|
||||
<el-table-column
|
||||
property="cjdpz_jcqdz"
|
||||
label="寄存地址(十进制)"
|
||||
width="150px"
|
||||
>
|
||||
<el-table-column property="cjdpz_jcqdz" label="寄存地址(十进制)" width="150px">
|
||||
<template slot-scope="scope">
|
||||
<el-input
|
||||
v-model="scope.row.cjdpz_jcqdz"
|
||||
placeholder="1-9999"
|
||||
></el-input>
|
||||
<el-input v-model="scope.row.cjdpz_jcqdz" placeholder="1-9999"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="cjdpz_cjsjlx" label="采集数据类型">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.cjdpz_cjsjlx" placeholder="">
|
||||
<el-option
|
||||
v-for="(option, index) in options5"
|
||||
:key="index"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
></el-option>
|
||||
<el-option v-for="(option, index) in options5" :key="index" :label="option.label"
|
||||
:value="option.value"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="cjdpz_zjx" label="自节序">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.cjdpz_zjx" placeholder="">
|
||||
<el-option
|
||||
v-for="(option, index) in options6"
|
||||
:key="index"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
></el-option>
|
||||
<el-option v-for="(option, index) in options6" :key="index" :label="option.label"
|
||||
:value="option.value"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="cjdpz_dxsx" label="读写属性">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.cjdpz_dxsx" placeholder="">
|
||||
<el-option
|
||||
v-for="(option, index) in options7"
|
||||
:key="index"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
></el-option>
|
||||
<el-option v-for="(option, index) in options7" :key="index" :label="option.label"
|
||||
:value="option.value"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column property="cjdpz_beilv" label="倍率">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.cjdpz_beilv" placeholder="">
|
||||
<el-option
|
||||
v-for="(option, index) in options8"
|
||||
:key="index"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
></el-option>
|
||||
<el-option v-for="(option, index) in options8" :key="index" :label="option.label"
|
||||
:value="option.value"></el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="dev_attribute">
|
||||
<el-dialog
|
||||
title="设备属性"
|
||||
:visible.sync="edit_device"
|
||||
width="382px"
|
||||
v-loading="loading"
|
||||
>
|
||||
<el-form
|
||||
:model="tableData[0]"
|
||||
:label-position="labelPosition"
|
||||
:rules="rules"
|
||||
ref="formdata"
|
||||
>
|
||||
<el-dialog title="设备属性" :visible.sync="edit_device" width="382px" v-loading="loading">
|
||||
<el-form :model="tableData[0]" :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="tableData[0].sbpz_sbid"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in options9"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
<el-form-item label="设备ID:" :label-width="formLabelWidth" prop="sbpz_sbid">
|
||||
<el-select v-model="tableData[0].sbpz_sbid" placeholder="" style="width: 200px; height: 30px">
|
||||
<el-option v-for="(item, index) in options9" :key="index" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -196,22 +118,9 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
label="设备名称:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="sbpz_sbmc"
|
||||
>
|
||||
<el-select
|
||||
v-model="tableData[0].sbpz_sbmc"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
>
|
||||
<el-option
|
||||
v-for="(item, index) in options10"
|
||||
:key="index"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
<el-form-item label="设备名称:" :label-width="formLabelWidth" prop="sbpz_sbmc">
|
||||
<el-select v-model="tableData[0].sbpz_sbmc" placeholder="" style="width: 200px; height: 30px">
|
||||
<el-option v-for="(item, index) in options10" :key="index" :label="item.label" :value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
@ -219,16 +128,8 @@
|
|||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
label="MAC地址:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="sbpz_mac"
|
||||
>
|
||||
<el-input
|
||||
v-model="tableData[0].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="tableData[0].sbpz_mac" placeholder="" style="width: 200px; height: 30px"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -236,9 +137,7 @@
|
|||
<el-col :span="24">
|
||||
<el-form-item>
|
||||
<!-- 需要修改的地方 -->
|
||||
<el-checkbox v-model="tableData[0].sbpz_jysb"
|
||||
>禁用地址</el-checkbox
|
||||
>
|
||||
<el-checkbox v-model="tableData[0].sbpz_jysb">禁用地址</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
@ -260,55 +159,22 @@
|
|||
|
||||
<div class="gateway">
|
||||
<el-dialog title="新建网关" :visible.sync="outerVisible" width="382px">
|
||||
<el-form
|
||||
:model="tableData[0]"
|
||||
:rules="rulesGate"
|
||||
ref="gateWay"
|
||||
label-width="85px"
|
||||
class="demo-ruleForm"
|
||||
>
|
||||
<el-form :model="tableData[0]" :rules="rulesGate" ref="gateWay" label-width="85px" class="demo-ruleForm">
|
||||
<el-form-item label="网关名称:" prop="wgpz_wgmc">
|
||||
<el-select
|
||||
v-model="tableData[0].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="tableData[0].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="tableData[0].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="tableData[0].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="tableData[0].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="tableData[0].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>
|
||||
|
@ -1050,9 +916,10 @@ export default {
|
|||
this.tableData[0].cjdpz_dxsx = obj.cjdpz_dxsx;
|
||||
this.tableData[0].cjdpz_beilv = obj.cjdpz_beilv;
|
||||
}
|
||||
this.tableData[0].ippz_wangkou = obj.ippz_wangkou;
|
||||
this.tableData[0].ippz_mrwg = obj.ippz_mrwg;
|
||||
this.tableData[0].ippz_ip = obj.ippz_ip;
|
||||
this.tableData[0].ippz_zwym = obj.zwym;
|
||||
this.tableData[0].ippz_zwym = obj.ippz_zwym;
|
||||
this.tableData[0].ippz_dns_sx = obj.ippz_dns_sx;
|
||||
this.tableData[0].ippz_dns_by = obj.ippz_dns_by;
|
||||
this.tableData[0].wgpz_wgmc = obj.wgpz_wgmc;
|
||||
|
@ -1092,8 +959,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",
|
||||
});
|
||||
|
|
|
@ -273,11 +273,11 @@ export default {
|
|||
// console.log(this.formData.wgpz_wgid);
|
||||
this.formData.wgpz_wgmc = res3.wgpz_wgmc;
|
||||
this.formData.wgpz_wglx = res3.wgpz_wglx;
|
||||
|
||||
this.formData.ippz_wangkou = res3.ippz_wangkou;
|
||||
}
|
||||
this.formData.ippz_wangkou = res3.ippz_wangkou;
|
||||
this.formData.ippz_mrwg = res3.ippz_mrwg;
|
||||
this.formData.ippz_ip = res3.ippz_ip;
|
||||
this.formData.zwym = res3.zwym;
|
||||
this.formData.ippz_zwym = res3.ippz_zwym;
|
||||
this.formData.ippz_dns_sx = res3.ippz_dns_sx;
|
||||
this.formData.ippz_dns_by = res3.ippz_dns_by;
|
||||
this.formData.ippz_mac = res3.ippz_mac;
|
||||
|
@ -321,7 +321,6 @@ export default {
|
|||
this.formData.mqtt_sjgl = res3.mqtt_sjgl;
|
||||
this.formData.mqtt_cjd_sbmc = res3.mqtt_cjd_sbmc;
|
||||
this.formData.mqtt_cjd_tagid = res3.mqtt_cjd_tagid;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2,45 +2,23 @@
|
|||
<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>
|
||||
|
@ -63,11 +41,7 @@
|
|||
</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>
|
||||
|
@ -88,38 +62,22 @@
|
|||
</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>
|
||||
|
@ -140,11 +98,7 @@
|
|||
</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>
|
||||
|
@ -167,20 +121,11 @@
|
|||
</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>
|
||||
|
@ -357,33 +302,28 @@ export default {
|
|||
}
|
||||
});
|
||||
},
|
||||
// 封装合并输入框的数据
|
||||
Merge(value, value1, value2, value3, value4) {
|
||||
value = value1 + "." + value2 + "." + value3 + "." + value4;
|
||||
return value;
|
||||
},
|
||||
//子网掩码验证
|
||||
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("请输入有效的子网掩码"));
|
||||
|
@ -395,24 +335,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地址"));
|
||||
|
@ -424,24 +364,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("请输入有效的网关地址"));
|
||||
|
@ -453,24 +393,24 @@ export default {
|
|||
validateDnsSx(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_dns_sx1 +
|
||||
"." +
|
||||
this.ippz_dns_sx2 +
|
||||
"." +
|
||||
this.ippz_dns_sx3 +
|
||||
"." +
|
||||
this.ippz_dns_sx4 ===
|
||||
"." +
|
||||
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_sx2 +
|
||||
"." +
|
||||
this.ippz_dns_sx3 +
|
||||
"." +
|
||||
this.ippz_dns_sx4
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的主DNS服务器地址"));
|
||||
|
@ -482,24 +422,24 @@ export default {
|
|||
validateDnsBy(rule, value, callback) {
|
||||
if (
|
||||
this.ippz_dns_by1 +
|
||||
"." +
|
||||
this.ippz_dns_by2 +
|
||||
"." +
|
||||
this.ippz_dns_by3 +
|
||||
"." +
|
||||
this.ippz_dns_by4 ===
|
||||
"." +
|
||||
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_by2 +
|
||||
"." +
|
||||
this.ippz_dns_by3 +
|
||||
"." +
|
||||
this.ippz_dns_by4
|
||||
)
|
||||
) {
|
||||
callback(new Error("请输入有效的备用DNS服务器地址"));
|
||||
|
@ -510,50 +450,21 @@ export default {
|
|||
|
||||
// 保存数据, 发送请求
|
||||
async saveAll() {
|
||||
this.formData.ippz_ip = this.Merge(
|
||||
this.formData.ippz_ip,
|
||||
this.ippz_ip1,
|
||||
this.ippz_ip2,
|
||||
this.ippz_ip3,
|
||||
this.ippz_ip4
|
||||
);
|
||||
this.formData.ippz_zwym = this.Merge(
|
||||
this.formData.ippz_zwym,
|
||||
this.ippz_zwym1,
|
||||
this.ippz_zwym2,
|
||||
this.ippz_zwym3,
|
||||
this.ippz_zwym4
|
||||
);
|
||||
this.formData.ippz_mrwg = this.Merge(
|
||||
this.formData.ippz_mrwg,
|
||||
this.ippz_mrwg1,
|
||||
this.ippz_mrwg2,
|
||||
this.ippz_mrwg3,
|
||||
this.ippz_mrwg4
|
||||
);
|
||||
this.formData.ippz_dns_sx = this.Merge(
|
||||
this.formData.ippz_dns_sx,
|
||||
this.ippz_dns_sx1,
|
||||
this.ippz_dns_sx2,
|
||||
this.ippz_dns_sx3,
|
||||
this.ippz_dns_sx4
|
||||
);
|
||||
this.formData.ippz_dns_by = this.Merge(
|
||||
this.formData.ippz_dns_by,
|
||||
this.ippz_dns_by1,
|
||||
this.ippz_dns_by2,
|
||||
this.ippz_dns_by3,
|
||||
this.ippz_dns_by4
|
||||
);
|
||||
var obj = {
|
||||
ippz_ip: this.ippz_ip1 + "." + this.ippz_ip2 + "." + this.ippz_ip3 + "." + this.ippz_ip4,
|
||||
ippz_zwym: this.ippz_zwym1 + "." + this.ippz_zwym2 + "." + this.ippz_zwym3 + "." + this.ippz_zwym4,
|
||||
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,
|
||||
}
|
||||
let datas = { ...this.formData, ...obj };
|
||||
console.log(this.formData);
|
||||
// sessionStorage.setItem("DB-IotLite_yx", JSON.stringify(this.formData));
|
||||
let data = {
|
||||
let res = await SaveUserAnswer({
|
||||
mark: "DB-IotLite_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301114011710",
|
||||
mark_value: JSON.stringify(this.formData),
|
||||
};
|
||||
let res = await SaveUserAnswer(data);
|
||||
mark_value: JSON.stringify(datas),
|
||||
});
|
||||
console.log(res);
|
||||
if (res.data.state) {
|
||||
this.$message({
|
||||
|
@ -586,14 +497,15 @@ export default {
|
|||
if (res2.data.data && res2.data.state) {
|
||||
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_mrwg) {
|
||||
this.formData.ippz_wangkou = res3.ippz_wangkou;
|
||||
this.formData.ippz_mrwg = res3.ippz_mrwg;
|
||||
this.formData.ippz_ip = res3.ippz_ip;
|
||||
this.formData.zwym = res3.zwym;
|
||||
this.formData.ippz_zwym = res3.ippz_zwym;
|
||||
this.formData.ippz_dns_sx = res3.ippz_dns_sx;
|
||||
this.formData.ippz_dns_by = res3.ippz_dns_by;
|
||||
this.ippz_mrwg1 = res3.ippz_mrwg.split(".")[0];
|
||||
|
@ -667,7 +579,7 @@ export default {
|
|||
this.user_id = window.location.href.split("?")[1];
|
||||
this.getUserAnswer();
|
||||
},
|
||||
mounted() {},
|
||||
mounted() { },
|
||||
directives: {
|
||||
copy: {
|
||||
bind(el, { value }) {
|
||||
|
|
|
@ -4,15 +4,8 @@
|
|||
<!-- 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>
|
||||
|
@ -22,11 +15,7 @@
|
|||
</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>
|
||||
|
@ -38,36 +27,13 @@
|
|||
</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>
|
||||
|
@ -75,46 +41,21 @@
|
|||
</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>
|
||||
|
@ -122,38 +63,22 @@
|
|||
</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>
|
||||
|
@ -161,72 +86,32 @@
|
|||
</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>
|
||||
|
@ -236,47 +121,29 @@
|
|||
<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>
|
||||
|
@ -285,17 +152,11 @@
|
|||
<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>
|
||||
|
@ -305,42 +166,18 @@
|
|||
<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>
|
||||
|
@ -359,64 +196,26 @@
|
|||
<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>
|
||||
|
@ -739,24 +538,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地址"));
|
||||
|
@ -962,9 +761,10 @@ export default {
|
|||
this.FormData.tdpz_jgsj = obj.tdpz_jgsj;
|
||||
this.FormData.tdpz_lxsj = obj.tdpz_lxsj;
|
||||
this.FormData.tdpz_cfcs = obj.tdpz_cfcs;
|
||||
this.FormData.ippz_wangkou = obj.ippz_wangkou;
|
||||
this.FormData.ippz_mrwg = obj.ippz_mrwg;
|
||||
this.FormData.ippz_ip = obj.ippz_ip;
|
||||
this.FormData.zwym = obj.zwym;
|
||||
this.FormData.ippz_zwym = obj.ippz_zwym;
|
||||
this.FormData.ippz_dns_sx = obj.ippz_dns_sx;
|
||||
this.FormData.ippz_dns_by = obj.ippz_dns_by;
|
||||
this.FormData.wgpz_wgmc = obj.wgpz_wgmc;
|
||||
|
|
Loading…
Reference in New Issue