This commit is contained in:
lll 2023-11-12 17:07:46 +08:00
parent 466e58e82b
commit 131835201a
12 changed files with 265 additions and 401 deletions

BIN
dist.zip

Binary file not shown.

View File

@ -1,5 +1,5 @@
export let answer = { export let answer = {
kqwk: "", kqwk: "1",
wkgzfs: "", wkgzfs: "2",
wkms: "", wkms: "3",
}; };

View File

@ -51,96 +51,46 @@
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="3"> <el-form-item label="入口网关" prop="clgl_rkwg">
<el-form-item label="入口网关:" prop="clgl_rkwg1"> <el-row>
<el-col :span="5"> <el-col :span="5">
<el-input <el-input v-model="ruleForm1.clgl_rkwg1"></el-input>
v-model="ruleForm1.clgl_rkwg1" </el-col>
:maxlength="3" <el-col :span="1">. </el-col>
></el-input> <el-col :span="5">
<el-input v-model="ruleForm1.clgl_rkwg2"></el-input>
</el-col> </el-col>
<el-col :span="1">.</el-col> <el-col :span="1">.</el-col>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="" prop="clgl_rkwg2">
<el-col :span="5"> <el-col :span="5">
<el-input <el-input v-model="ruleForm1.clgl_rkwg3"></el-input>
v-model="ruleForm1.clgl_rkwg2"
:maxlength="3"
></el-input>
</el-col> </el-col>
<el-col :span="1">.</el-col> <el-col :span="1">.</el-col>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="" prop="clgl_rkwg3">
<el-col :span="5"> <el-col :span="5">
<el-input <el-input v-model="ruleForm1.clgl_rkwg4"></el-input>
v-model="ruleForm1.clgl_rkwg3"
:maxlength="3"
></el-input>
</el-col> </el-col>
<el-col :span="1">.</el-col> </el-row>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="" prop="clgl_rkwg4">
<el-col :span="5">
<el-input
v-model="ruleForm1.clgl_rkwg4"
:maxlength="3"
></el-input>
</el-col>
<el-col :span="1">.</el-col>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="3"> <el-form-item label="出口网关" prop="clgl_ckwg">
<el-form-item label="出口网关:" prop="clgl_ckwg1"> <el-row>
<el-col :span="5"> <el-col :span="5">
<el-input <el-input v-model="ruleForm1.clgl_ckwg1"></el-input>
v-model="ruleForm1.clgl_ckwg1" </el-col>
:maxlength="3" <el-col :span="1">. </el-col>
></el-input> <el-col :span="5">
<el-input v-model="ruleForm1.clgl_ckwg2"></el-input>
</el-col> </el-col>
<el-col :span="1">.</el-col> <el-col :span="1">.</el-col>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="" prop="clgl_ckwg2">
<el-col :span="5"> <el-col :span="5">
<el-input <el-input v-model="ruleForm1.clgl_ckwg3"></el-input>
v-model="ruleForm1.clgl_ckwg2"
:maxlength="3"
></el-input>
</el-col> </el-col>
<el-col :span="1">.</el-col> <el-col :span="1">.</el-col>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="" prop="clgl_ckwg3">
<el-col :span="5"> <el-col :span="5">
<el-input <el-input v-model="ruleForm1.clgl_ckwg4"></el-input>
v-model="ruleForm1.clgl_ckwg3"
:maxlength="3"
></el-input>
</el-col> </el-col>
<el-col :span="1">.</el-col> </el-row>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="" prop="clgl_ckwg4">
<el-col :span="5">
<el-input
v-model="ruleForm1.clgl_ckwg4"
:maxlength="3"
></el-input>
</el-col>
<el-col :span="1">.</el-col>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@ -214,114 +164,69 @@
</el-form-item> </el-form-item>
<el-form-item label="目的对象:" prop="clgl_mddx"> <el-form-item label="目的对象:" prop="clgl_mddx">
<el-col :span="19"> <el-col :span="19">
<el-input v-model="ruleForm1.clgl_mddx"></el-input> <el-select v-model="ruleForm1.clgl_mddx">
<el-option
label="数采服务器"
value="数采服务器"
></el-option>
</el-select>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-row> <el-row>
<el-col :span="3"> <el-form-item label="入口IP" prop="clgl_rkip">
<el-form-item label="入口IP:" prop="clgl_rkip1"> <el-row>
<el-col :span="5"> <el-col :span="5">
<el-input <el-input v-model="ruleForm1.clgl_rkip1"></el-input>
v-model="ruleForm1.clgl_rkip1" </el-col>
:maxlength="3" <el-col :span="1">. </el-col>
></el-input> <el-col :span="5">
<el-input v-model="ruleForm1.clgl_rkip2"></el-input>
</el-col> </el-col>
<el-col :span="1">.</el-col> <el-col :span="1">.</el-col>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="" prop="clgl_rkip2">
<el-col :span="5"> <el-col :span="5">
<el-input <el-input v-model="ruleForm1.clgl_rkip3"></el-input>
v-model="ruleForm1.clgl_rkip2"
:maxlength="3"
></el-input>
</el-col> </el-col>
<el-col :span="1">.</el-col> <el-col :span="1">.</el-col>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="" prop="clgl_rkip3">
<el-col :span="5"> <el-col :span="5">
<el-input <el-input v-model="ruleForm1.clgl_rkip4"></el-input>
v-model="ruleForm1.clgl_rkip3"
:maxlength="3"
></el-input>
</el-col> </el-col>
<el-col :span="1">.</el-col> </el-row>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="" prop="clgl_rkip4">
<el-col :span="5">
<el-input
v-model="ruleForm1.clgl_rkip4"
:maxlength="3"
></el-input>
</el-col>
<el-col :span="1">.</el-col>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="3"> <el-form-item label="出口IP" prop="clgl_ckip">
<el-form-item label="出口IP:" prop="clgl_ckip1"> <el-row>
<el-col :span="5"> <el-col :span="5">
<el-input <el-input v-model="ruleForm1.clgl_ckip1"></el-input>
v-model="ruleForm1.clgl_ckip1" </el-col>
:maxlength="3" <el-col :span="1">. </el-col>
></el-input> <el-col :span="5">
<el-input v-model="ruleForm1.clgl_ckip2"></el-input>
</el-col> </el-col>
<el-col :span="1">.</el-col> <el-col :span="1">.</el-col>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="" prop="clgl_ckip2">
<el-col :span="5"> <el-col :span="5">
<el-input <el-input v-model="ruleForm1.clgl_ckip3"></el-input>
v-model="ruleForm1.clgl_ckip2"
:maxlength="3"
></el-input>
</el-col> </el-col>
<el-col :span="1">.</el-col> <el-col :span="1">.</el-col>
</el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="" prop="clgl_ckip3">
<el-col :span="5"> <el-col :span="5">
<el-input <el-input v-model="ruleForm1.clgl_ckip4"></el-input>
v-model="ruleForm1.clgl_ckip3"
:maxlength="3"
></el-input>
</el-col> </el-col>
<el-col :span="1">.</el-col> </el-row>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="3">
<el-form-item label="" prop="clgl_ckip4">
<el-col :span="5">
<el-input
v-model="ruleForm1.clgl_ckip4"
:maxlength="3"
></el-input>
</el-col>
<el-col :span="1">.</el-col>
</el-form-item>
</el-col>
</el-row> </el-row>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="代理端口:" prop="clgl_dldk">
<el-col :span="19">
<el-input v-model="ruleForm1.clgl_dldk"> </el-input>
</el-col>
</el-form-item>
<el-form-item label="目的端口:" prop="clgl_mddk"> <el-form-item label="目的端口:" prop="clgl_mddk">
<el-col :span="19"> <el-col :span="19">
<el-input v-model="ruleForm1.clgl_mddk"> </el-input> <el-input v-model="ruleForm1.clgl_mddk"> </el-input>
</el-col> </el-col>
</el-form-item> </el-form-item>
<el-form-item label="代理端口:" prop="clgl_dldk">
<el-col :span="19">
<el-input v-model="ruleForm1.clgl_dldk"> </el-input>
</el-col>
</el-form-item>
<el-form-item label="未定义命令:" prop="clgl_wdyml"> <el-form-item label="未定义命令:" prop="clgl_wdyml">
<el-col :span="19"> <el-col :span="19">
<el-select <el-select
@ -491,8 +396,8 @@ export default {
clgl_qidong: true, clgl_qidong: true,
options1: [ options1: [
{ {
label: "有线区策略", label: "",
value: "有线区策略", value: "",
}, },
{ {
label: "无线区策略", label: "无线区策略",
@ -650,19 +555,19 @@ export default {
// }, // },
], ],
ruleForm1: { ruleForm1: {
clgl_name: "有线区策略", clgl_name: "",
clgl_xy: ["Modbus(TCP)"], clgl_xy: [],
clgl_gzms: "透明模式", clgl_gzms: "",
clgl_ydx: "有线区交换机", clgl_ydx: "",
clgl_ydk: "", clgl_ydk: "",
clgl_mddx: "数采服务器", clgl_mddx: "",
clgl_mddk: "", clgl_mddk: "",
clgl_rkwg: "", clgl_rkwg: "",
clgl_rkwk: "有线区网闸(内网)", clgl_rkwk: "",
clgl_rkip: "", clgl_rkip: "",
clgl_dldk: "", clgl_dldk: "",
clgl_ckwg: "", clgl_ckwg: "",
clgl_ckwk: "有线区网闸(外网)", clgl_ckwk: "",
clgl_ckip: "", clgl_ckip: "",
clgl_wdyml: "拒绝", clgl_wdyml: "拒绝",
dlport: "", dlport: "",
@ -707,135 +612,26 @@ export default {
clgl_ckwk: [ clgl_ckwk: [
{ required: true, trigger: "change", message: "选择一个出口网卡" }, { required: true, trigger: "change", message: "选择一个出口网卡" },
], ],
clgl_rkip1: [ clgl_rkip: [
{ required: true, trigger: "blur", message: "片段为空" },
{ {
message: "片段无效", required: true,
validator: this.validateIpAddress,
trigger: "blur", trigger: "blur",
pattern: /^(25[0-5]|2[0-4][0-9]|[1-9][0-9]?)$/, message: "",
},
],
clgl_rkip2: [
{ required: true, trigger: "blur", message: "片段为空" },
{
message: "片段无效",
trigger: "blur",
pattern: /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
},
],
clgl_rkip3: [
{ required: true, trigger: "blur", message: "片段为空" },
{
message: "片段无效",
trigger: "blur",
pattern: /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
},
],
clgl_rkip4: [
{ required: true, trigger: "blur", message: "片段为空" },
{
message: "片段无效",
trigger: "blur",
pattern: /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
}, },
], ],
clgl_ckip1: [ clgl_ckip: [
{ required: true, trigger: "blur", message: "片段为空" },
{ {
message: "片段无效", required: true,
validator: this.validateIpAddress1,
trigger: "blur", trigger: "blur",
pattern: /^(25[0-5]|2[0-4][0-9]|[1-9][0-9]?)$/, message: "",
},
],
clgl_ckip2: [
{ required: true, trigger: "blur", message: "片段为空" },
{
message: "片段无效",
trigger: "blur",
pattern: /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
},
],
clgl_ckip3: [
{ required: true, trigger: "blur", message: "片段为空" },
{
message: "片段无效",
trigger: "blur",
pattern: /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
},
],
clgl_ckip4: [
{ required: true, trigger: "blur", message: "片段为空" },
{
message: "片段无效",
trigger: "blur",
pattern: /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
},
],
clgl_rkwg1: [
{ trigger: "blur", message: "片段为空" },
{
message: "片段无效",
trigger: "blur",
pattern: /^(25[0-5]|2[0-4][0-9]|[1-9][0-9]?)$/,
},
],
clgl_rkwg2: [
{ trigger: "blur", message: "片段为空" },
{
message: "片段无效",
trigger: "blur",
pattern: /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
},
],
clgl_rkwg3: [
{ trigger: "blur", message: "片段为空" },
{
message: "片段无效",
trigger: "blur",
pattern: /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
},
],
clgl_rkwg4: [
{ trigger: "blur", message: "片段为空" },
{
message: "片段无效",
trigger: "blur",
pattern: /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
},
],
clgl_ckwg1: [
{ trigger: "blur", message: "片段为空" },
{
message: "片段无效",
trigger: "blur",
pattern: /^(25[0-5]|2[0-4][0-9]|[1-9][0-9]?)$/,
},
],
clgl_ckwg2: [
{ trigger: "blur", message: "片段为空" },
{
message: "片段无效",
trigger: "blur",
pattern: /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
},
],
clgl_ckwg3: [
{ trigger: "blur", message: "片段为空" },
{
message: "片段无效",
trigger: "blur",
pattern: /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
},
],
clgl_ckwg4: [
{ trigger: "blur", message: "片段为空" },
{
message: "片段无效",
trigger: "blur",
pattern: /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,
}, },
], ],
clgl_rkwg: [],
clgl_ckwg: [],
clgl_ydx: [ clgl_ydx: [
{ required: true, trigger: "change", message: "选择一个源对象" }, { required: true, trigger: "change", message: "选择一个源对象" },
], ],
@ -881,6 +677,63 @@ export default {
mounted() {}, mounted() {},
methods: { methods: {
//ip
validateIpAddress(rule, value, callback) {
if (
this.ruleForm1.clgl_rkip1 +
"." +
this.ruleForm1.clgl_rkip2 +
"." +
this.ruleForm1.clgl_rkip3 +
"." +
this.ruleForm1.clgl_rkip4 ===
""
) {
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.ruleForm1.clgl_rkip1 +
"." +
this.ruleForm1.clgl_rkip2 +
"." +
this.ruleForm1.clgl_rkip3 +
"." +
this.ruleForm1.clgl_rkip4
)
) {
callback(new Error("请输入有效的IP地址"));
} else {
callback();
}
},
validateIpAddress1(rule, value, callback) {
if (
this.ruleForm1.clgl_ckip1 +
"." +
this.ruleForm1.clgl_ckip2 +
"." +
this.ruleForm1.clgl_ckip3 +
"." +
this.ruleForm1.clgl_ckip4 ===
""
) {
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.ruleForm1.clgl_ckip1 +
"." +
this.ruleForm1.clgl_ckip2 +
"." +
this.ruleForm1.clgl_ckip3 +
"." +
this.ruleForm1.clgl_ckip4
)
) {
callback(new Error("请输入有效的IP地址"));
} else {
callback();
}
},
// //
async saveAll() { async saveAll() {
this.$refs["ruleForm1"].validate((valid) => { this.$refs["ruleForm1"].validate((valid) => {
@ -1119,12 +972,4 @@ export default {
height: 30px; height: 30px;
} }
} }
/deep/ .el-form-item__error {
min-width: 50px;
}
/deep/.el-col-1 {
height: 10px !important;
}
</style> </style>

View File

@ -23,10 +23,6 @@
<el-button @click="flag = true">新建网关</el-button> <el-button @click="flag = true">新建网关</el-button>
<el-button @click="deleteSelectedRows">删除</el-button> <el-button @click="deleteSelectedRows">删除</el-button>
</div> </div>
<!-- <div class="right">
<el-input type="search" v-model="search"></el-input>
<el-button @click="select">筛选</el-button>
</div> -->
</div> </div>
<el-table <el-table
ref="multipleTable" ref="multipleTable"
@ -41,7 +37,7 @@
{{ scope.$index + 1 }} {{ scope.$index + 1 }}
</template></el-table-column </template></el-table-column
> >
<el-table-column type="selection" width="40"> </el-table-column> <el-table-column type="selection"> </el-table-column>
<el-table-column prop="wgid" label="网关ID"> </el-table-column> <el-table-column prop="wgid" label="网关ID"> </el-table-column>
<el-table-column prop="wgbh" label="网关编号"> </el-table-column> <el-table-column prop="wgbh" label="网关编号"> </el-table-column>
<el-table-column prop="wgmc" label="网关名称"> </el-table-column> <el-table-column prop="wgmc" label="网关名称"> </el-table-column>
@ -105,8 +101,6 @@
<el-option label="2000808011" value="2000808011"></el-option> <el-option label="2000808011" value="2000808011"></el-option>
<el-option label="2000808012" value="2000808012"></el-option> <el-option label="2000808012" value="2000808012"></el-option>
<el-option label="2000808013" value="2000808013"></el-option> <el-option label="2000808013" value="2000808013"></el-option>
<!-- <el-option label="2000808014" value="2000808014"></el-option>
<el-option label="2000808015" value="2000808015"></el-option> -->
</el-select> </el-select>
</el-col> </el-col>
</el-form-item> </el-form-item>
@ -117,14 +111,6 @@
<el-option label="lan-box2" value="lan-box2"></el-option> <el-option label="lan-box2" value="lan-box2"></el-option>
<el-option label="wlan-box1" value="wlan-box1"></el-option> <el-option label="wlan-box1" value="wlan-box1"></el-option>
<el-option label="wlan-box2" value="wlan-box2"></el-option> <el-option label="wlan-box2" value="wlan-box2"></el-option>
<!-- <el-option
label="lan- server port"
value="lan- server port"
></el-option>
<el-option
label="wlan- server port"
value="wlan- server port"
></el-option> -->
</el-select> </el-select>
</el-col> </el-col>
</el-form-item> </el-form-item>
@ -135,14 +121,6 @@
<el-option label="有线区网关2" value="有线区网关2"></el-option> <el-option label="有线区网关2" value="有线区网关2"></el-option>
<el-option label="无线区网关1" value="无线区网关1"></el-option> <el-option label="无线区网关1" value="无线区网关1"></el-option>
<el-option label="无线区网关2" value="无线区网关2"></el-option> <el-option label="无线区网关2" value="无线区网关2"></el-option>
<!-- <el-option
label="有线区串口服务器"
value="有线区串口服务器"
></el-option>
<el-option
label="无线区串口服务器"
value="无线区串口服务器"
></el-option> -->
</el-select> </el-select>
</el-col> </el-col>
</el-form-item> </el-form-item>
@ -220,17 +198,31 @@ export default {
}); });
}, },
// //
handleDelete(a, b) { async handleDelete(a, b) {
this.wgpz.splice(a, 1); this.wgpz.splice(a, 1);
localStorage.setItem("wgpz", JSON.stringify(this.wgpz)); localStorage.setItem("wgpz", JSON.stringify(this.wgpz));
this.SaveUserAnswer(); let { data } = await SaveUserAnswer({
mark: "YDPZYM_wgpz",
user_id: `${this.user_id}`,
// user_id: "USER202307301109254198",
mark_value: JSON.stringify(this.wgpz),
});
if (data.state) {
this.$message({
message: "操作成功",
type: "success",
});
} else {
this.$message.error("保存失败");
return;
}
}, },
// //
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
// //
deleteSelectedRows() { async deleteSelectedRows() {
if (this.multipleSelection.length == 0) { if (this.multipleSelection.length == 0) {
this.$message({ this.$message({
message: "请先选择数据", message: "请先选择数据",
@ -243,7 +235,21 @@ export default {
); );
this.multipleSelection = []; this.multipleSelection = [];
localStorage.setItem("wgpz", JSON.stringify(this.wgpz)); localStorage.setItem("wgpz", JSON.stringify(this.wgpz));
this.SaveUserAnswer(); let { data } = await SaveUserAnswer({
mark: "YDPZYM_wgpz",
user_id: `${this.user_id}`,
// user_id: "USER202307301109254198",
mark_value: JSON.stringify(this.wgpz),
});
if (data.state) {
this.$message({
message: "操作成功",
type: "success",
});
} else {
this.$message.error("保存失败");
return;
}
}, },
// //
chakan(a, b) { chakan(a, b) {
@ -255,6 +261,7 @@ export default {
let { data } = await GetUserAnswer({ let { data } = await GetUserAnswer({
mark: "YDPZYM_wgpz", mark: "YDPZYM_wgpz",
user_id: `${this.user_id}`, user_id: `${this.user_id}`,
// user_id: "USER202307301109254198",
}); });
console.log(data.data); console.log(data.data);
if (data.data && data.state) { if (data.data && data.state) {
@ -263,18 +270,27 @@ export default {
}, },
// //
async SaveUserAnswer() { async SaveUserAnswer() {
this.wgpz.push({
wglx: this.ruleForm.wglx,
wgid: this.ruleForm.wgid,
wgbh: this.ruleForm.wgbh,
wgmc: this.ruleForm.wgmc,
});
let { data } = await SaveUserAnswer({ let { data } = await SaveUserAnswer({
mark: "YDPZYM_wgpz", mark: "YDPZYM_wgpz",
user_id: `${this.user_id}`, user_id: `${this.user_id}`,
// user_id: "USER202307301109254198",
mark_value: JSON.stringify(this.wgpz), mark_value: JSON.stringify(this.wgpz),
}); });
if (data.state) { if (data.state) {
this.wgpz.push(this.ruleForm);
this.$message({ this.$message({
message: "操作成功", message: "操作成功",
type: "success", type: "success",
}); });
this.flag = true; this.flag = false;
for (let key in this.ruleForm) {
this.ruleForm[key] = "";
}
} else { } else {
this.$message.error("保存失败"); this.$message.error("保存失败");
return; return;

View File

@ -262,6 +262,7 @@ export default {
let { data } = await GetUserAnswer({ let { data } = await GetUserAnswer({
mark: "YDPZYM_wgwh", mark: "YDPZYM_wgwh",
user_id: `${this.user_id}`, user_id: `${this.user_id}`,
// user_id: "USER202307301109254198",
}); });
console.log(data); console.log(data);
if (data.data && data.state) { if (data.data && data.state) {
@ -289,17 +290,30 @@ export default {
}); });
}, },
// //
handleDelete(a, b) { async handleDelete(a, b) {
this.tableData.splice(a, 1); this.tableData.splice(a, 1);
localStorage.setItem("wgwh", JSON.stringify(this.tableData)); localStorage.setItem("wgwh", JSON.stringify(this.tableData));
this.SaveUserAnswer(); let { data } = await SaveUserAnswer({
mark: "YDPZYM_wgwh",
user_id: this.user_id,
// user_id: "USER202307301109254198",
mark_value: JSON.stringify(this.tableData),
});
if (data.state) {
this.$message({
message: "操作成功",
type: "success",
});
} else {
this.$message.error("操作失败");
}
}, },
// //
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val; this.multipleSelection = val;
}, },
// //
deleteSelectedRows() { async deleteSelectedRows() {
if (this.multipleSelection.length == 0) { if (this.multipleSelection.length == 0) {
this.$message({ this.$message({
message: "请先选择要删除的数据", message: "请先选择要删除的数据",
@ -312,7 +326,20 @@ export default {
); );
this.multipleSelection = []; this.multipleSelection = [];
localStorage.setItem("wgwh", JSON.stringify(this.tableData)); localStorage.setItem("wgwh", JSON.stringify(this.tableData));
this.SaveUserAnswer(); let { data } = await SaveUserAnswer({
mark: "YDPZYM_wgwh",
user_id: this.user_id,
// user_id: "USER202307301109254198",
mark_value: JSON.stringify(this.tableData),
});
if (data.state) {
this.$message({
message: "操作成功",
type: "success",
});
} else {
this.$message.error("操作失败");
}
}, },
chakan(a, b) { chakan(a, b) {
console.log(b); console.log(b);
@ -327,15 +354,28 @@ export default {
} }
let { data } = await SaveUserAnswer({ let { data } = await SaveUserAnswer({
mark: "YDPZYM_wgwh", mark: "YDPZYM_wgwh",
user_id: `${this.user_id}`, user_id: this.user_id,
// user_id: "USER202307301109254198",
mark_value: JSON.stringify(this.tableData), mark_value: JSON.stringify(this.tableData),
}); });
if (data.state) { if (data.state) {
this.tableData.push(this.ruleForm); let obj = {
sswg: this.ruleForm.sswg,
csname: this.ruleForm.csname,
// sfyxbz: "",
sdz: this.ruleForm.sdz,
cskey: this.ruleForm.cskey,
xsws: this.ruleForm.xsws,
pcz: this.ruleForm.pcz,
};
this.tableData.push(obj);
this.$message({ this.$message({
message: "操作成功", message: "操作成功",
type: "success", type: "success",
}); });
for (let key in this.ruleForm) {
this.ruleForm[key] = "";
}
} else { } else {
this.$message.error(data.message); this.$message.error(data.message);
} }

View File

@ -49,13 +49,14 @@
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm">保存</el-button> <el-button type="primary" @click="submitForm">保存</el-button>
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
<!-- <el-button @click="change">改变</el-button> --> <el-button @click="change">改变</el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
<script> <script>
import { SaveUserAnswer, GetUserAnswer } from "@/api/user"; import { SaveUserAnswer, GetUserAnswer } from "@/api/user";
import { answer } from "../answerObj";
export default { export default {
data() { data() {
return { return {
@ -68,11 +69,7 @@ export default {
wkgzfs: "LAN口", wkgzfs: "LAN口",
wkms: "n", wkms: "n",
}, },
// $answerObj: {
// kqwk: "",
// wkgzfs: "",
// wkms: "",
// },
rules: { rules: {
kqwk: [{ required: true, trigger: "change", message: "必填项" }], kqwk: [{ required: true, trigger: "change", message: "必填项" }],
wkgzfs: [{ required: true, trigger: "change", message: "必填项" }], wkgzfs: [{ required: true, trigger: "change", message: "必填项" }],
@ -90,7 +87,7 @@ export default {
this.user_id = data; this.user_id = data;
}, },
change() { change() {
console.log(this.$answerObj); this.$set(answer, "kqwk", "11111111");
}, },
async saveDatas() { async saveDatas() {
let datas = JSON.parse(sessionStorage.getItem("CKFWQ_wx")); let datas = JSON.parse(sessionStorage.getItem("CKFWQ_wx"));
@ -109,8 +106,6 @@ export default {
message: "保存成功", message: "保存成功",
type: "success", type: "success",
}); });
this.dialogVisible = false;
console.log({ ...datas, ...this.ruleForm }, "存储");
} else { } else {
this.$message.error("保存失败"); this.$message.error("保存失败");
} }
@ -121,7 +116,7 @@ export default {
mark: "CKFWQ_wx", mark: "CKFWQ_wx",
user_id: this.user_id, user_id: this.user_id,
}); });
if (res.data.data && res.data.state) { if (JSON.parse(res.data.data.mark_value) && res.data.state) {
var obj = JSON.parse(res.data.data.mark_value); var obj = JSON.parse(res.data.data.mark_value);
this.ruleForm.kqwk = obj.kqwk; this.ruleForm.kqwk = obj.kqwk;
this.ruleForm.wkgzfs = obj.wkgzfs; this.ruleForm.wkgzfs = obj.wkgzfs;

View File

@ -81,7 +81,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-select v-model="scope.row.wlgl_ww_name" placeholder=""> <el-select v-model="scope.row.wlgl_ww_name" placeholder="">
<el-option <el-option
v-for="item in options1" v-for="item in options2"
:key="item" :key="item"
:label="item.label" :label="item.label"
:value="item.value" :value="item.value"
@ -205,6 +205,7 @@ export default {
}; };
}, },
created() { created() {
this.dialogVisible = true;
let str = window.location.href.split("?")[1]; let str = window.location.href.split("?")[1];
this.user_id = str.split("|")[0]; this.user_id = str.split("|")[0];
let type = str.split("|")[1]; let type = str.split("|")[1];
@ -264,7 +265,6 @@ export default {
message: "保存成功", message: "保存成功",
type: "success", type: "success",
}); });
this.dialogVisible = false;
} else { } else {
this.$message.error("保存失败"); this.$message.error("保存失败");
} }

View File

@ -132,6 +132,7 @@ export default {
}; };
}, },
created() { created() {
this.dialogVisible = true;
let str = window.location.href.split("?")[1]; let str = window.location.href.split("?")[1];
this.user_id = str.split("|")[0]; this.user_id = str.split("|")[0];
let type = str.split("|")[1]; let type = str.split("|")[1];
@ -172,17 +173,24 @@ export default {
if (this.dxgl.length == 2) { if (this.dxgl.length == 2) {
return false; return false;
} }
this.dxgl.push({
dx_name: this.ruleForm.dxmc,
iplx: this.ruleForm.iplx,
ip: this.ip1 + "." + this.ip2 + "." + this.ip3 + "." + this.ip4,
});
var json = JSON.parse(sessionStorage.getItem(this.$store.state.type)); var json = JSON.parse(sessionStorage.getItem(this.$store.state.type));
// console.log(this.dxgl);
let { data } = await SaveUserAnswer({ let { data } = await SaveUserAnswer({
mark: `${this.$store.state.type}`, mark: `${this.$store.state.type}`,
// mark: "GYWZ_yx",
user_id: this.user_id, user_id: this.user_id,
// user_id: "USER202307301109254198",
mark_value: JSON.stringify({ ...json, ...{ dxgl: this.dxgl } }), mark_value: JSON.stringify({ ...json, ...{ dxgl: this.dxgl } }),
}); });
console.log(data.state);
if (data.state) { if (data.state) {
console.log(data.data.mark_value); // console.log(data.data.mark_value);
this.dxgl.push({ this.dxgl.push({
dx_name: this.ruleForm.dxmc, dx_name: this.ruleForm.dxmc,
iplx: this.ruleForm.iplx, iplx: this.ruleForm.iplx,
@ -207,7 +215,9 @@ export default {
async GetUserAnswer() { async GetUserAnswer() {
let { data } = await GetUserAnswer({ let { data } = await GetUserAnswer({
mark: `${this.$store.state.type}`, mark: `${this.$store.state.type}`,
// mark: "GYWZ_yx",
user_id: this.user_id, user_id: this.user_id,
// user_id: "USER202307301109254198",
}); });
if (data.state && data.data) { if (data.state && data.data) {
console.log(JSON.parse(data.data.mark_value).dxgl); console.log(JSON.parse(data.data.mark_value).dxgl);
@ -219,10 +229,13 @@ export default {
// //
async deleteRow(index, rows) { async deleteRow(index, rows) {
var json = JSON.parse(sessionStorage.getItem(this.$store.state.type)); var json = JSON.parse(sessionStorage.getItem(this.$store.state.type));
var json = JSON.parse(sessionStorage.getItem("GYWZ_yx"));
this.dxgl.splice(index, 1); this.dxgl.splice(index, 1);
let { data } = await SaveUserAnswer({ let { data } = await SaveUserAnswer({
mark: `${this.$store.state.type}`, mark: `${this.$store.state.type}`,
// mark: "GYWZ_yx",
user_id: this.user_id, user_id: this.user_id,
// user_id: "USER202307301109254198",
mark_value: JSON.stringify({ ...json, ...{ dxgl: this.dxgl } }), mark_value: JSON.stringify({ ...json, ...{ dxgl: this.dxgl } }),
}); });
console.log(data.data); console.log(data.data);
@ -245,35 +258,6 @@ export default {
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
// /deep/ .ip_address {
// .el-input__inner {
// height: 30px;
// text-align: center;
// padding: 0;
// }
// .el-row {
// display: flex;
// align-items: flex-end;
// .el-col-1 {
// padding: 0px 2px;
// color: black;
// text-align: left;
// line-height: 32px;
// height: 20px;
// }
// .el-col-5 {
// width: 43px;
// height: 30px;
// }
// .el-col-24 {
// padding-right: 152px;
// }
// }
// }
.el-table--enable-row-hover .el-table__body tr:hover > td { .el-table--enable-row-hover .el-table__body tr:hover > td {
background-color: transparent !important; background-color: transparent !important;
} }
@ -297,7 +281,7 @@ export default {
} }
.el-col-5 { .el-col-5 {
width: 43px; width: 55px;
height: 30px; height: 30px;
} }
.el-table { .el-table {

View File

@ -106,7 +106,6 @@
></el-checkbox> ></el-checkbox>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<!-- <el-button type="primary" @click="submitForm('ruleForm'), (dialogVisible = false)">保存</el-button> -->
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="dialogVisible = false"> </el-button>
</span> </span>
@ -116,7 +115,6 @@
</template> </template>
<script> <script>
import { SaveUserAnswer, GetUserAnswer } from "@/api/user"; import { SaveUserAnswer, GetUserAnswer } from "@/api/user";
import { isValidPrimaryDNS } from "../validate";
export default { export default {
data() { data() {
return { return {
@ -143,7 +141,6 @@ export default {
], ],
}, },
], ],
defaultProps: { defaultProps: {
children: "children", children: "children",
label: "name", label: "name",
@ -285,7 +282,6 @@ export default {
text-align: center; text-align: center;
border: 1px solid rgba(220, 220, 220, 1); border: 1px solid rgba(220, 220, 220, 1);
} }
/deep/ .port_content { /deep/ .port_content {
.el-input { .el-input {
width: 200px; width: 200px;

View File

@ -1,6 +1,5 @@
<template> <template>
<div> <div>
<!-- <el-button @click="dialogVisible = true">无线设置</el-button> -->
<el-dialog title="无线设置" :visible.sync="dialogVisible" width="30%"> <el-dialog title="无线设置" :visible.sync="dialogVisible" width="30%">
<el-form <el-form
:model="ruleForm" :model="ruleForm"
@ -22,15 +21,9 @@
<el-col :span="10"> <el-col :span="10">
<el-select v-model="ruleForm.wxpz_wlmc" placeholder="无线网名称"> <el-select v-model="ruleForm.wxpz_wlmc" placeholder="无线网名称">
<el-option label="无线区无限网" value="shanghai"></el-option> <el-option label="无线区无限网" value="shanghai"></el-option>
<!-- <el-option label="区域二" value="beijing"></el-option> -->
</el-select> </el-select>
</el-col> </el-col>
</el-form-item> </el-form-item>
<!-- <el-form-item label="MAC地址:" prop="wxpz_mac">
<el-col :span="10">
<el-input v-model="ruleForm.wxpz_mac"> </el-input>
</el-col>
</el-form-item> -->
<el-form-item label="加密模式:" prop="wxpz_jmms"> <el-form-item label="加密模式:" prop="wxpz_jmms">
<el-col :span="10"> <el-col :span="10">
<el-select v-model="ruleForm.wxpz_jmms"> <el-select v-model="ruleForm.wxpz_jmms">
@ -110,7 +103,6 @@ export default {
message: "保存成功", message: "保存成功",
type: "success", type: "success",
}); });
this.dialogVisible = false;
} else { } else {
this.$message.error("保存失败"); this.$message.error("保存失败");
} }
@ -120,8 +112,8 @@ export default {
mark: "CKFWQ_wx", mark: "CKFWQ_wx",
user_id: `${this.user_id}`, user_id: `${this.user_id}`,
}); });
console.log(obj); console.log(data);
if (data.data && data.state) { if (JSON.parse(data.data.mark_value) && data.state) {
var obj = JSON.parse(data.data.mark_value); var obj = JSON.parse(data.data.mark_value);
this.ruleForm.wxpz_gzms = obj.wxpz_gzms; this.ruleForm.wxpz_gzms = obj.wxpz_gzms;
this.ruleForm.wxpz_wlmc = obj.wxpz_wlmc; this.ruleForm.wxpz_wlmc = obj.wxpz_wlmc;
@ -129,7 +121,6 @@ export default {
this.ruleForm.wxpz_jmms = obj.wxpz_jmms; this.ruleForm.wxpz_jmms = obj.wxpz_jmms;
this.ruleForm.wxpz_jmsf = obj.wxpz_jmsf; this.ruleForm.wxpz_jmsf = obj.wxpz_jmsf;
this.ruleForm.wxpz_mm = obj.wxpz_mm; this.ruleForm.wxpz_mm = obj.wxpz_mm;
console.log(this.ruleForm, "取");
} }
}, },
submitForm(formName) { submitForm(formName) {

View File

@ -69,6 +69,7 @@
<el-form-item label="数据位(bit):" prop="ckcssz_sjw"> <el-form-item label="数据位(bit):" prop="ckcssz_sjw">
<el-select v-model="ruleForm.ckcssz_sjw" placeholder="请选择数据位"> <el-select v-model="ruleForm.ckcssz_sjw" placeholder="请选择数据位">
<el-option label="8" value="8"></el-option> <el-option label="8" value="8"></el-option>
<el-option label="7" value="7"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="停止位:" prop="ckcssz_tzw"> <el-form-item label="停止位:" prop="ckcssz_tzw">
@ -149,19 +150,18 @@ export default {
user_id: "", user_id: "",
loading: false, loading: false,
ruleForm: { ruleForm: {
ckcssz_btl: "9600", ckcssz_btl: "",
ckcssz_jyw: "无校验none", ckcssz_jyw: "",
ckcssz_lk: "关闭", ckcssz_lk: "",
ckcssz_zdybtl: "开启", ckcssz_zdybtl: "",
ckcssz_sjw: "8", ckcssz_sjw: "",
ckcssz_tzw: "1", ckcssz_tzw: "",
ckcssz_485: "关闭", ckcssz_485: "",
qtsz_ckzdcz: "关闭", qtsz_ckzdcz: "",
qtsz_zcblx: "关闭", qtsz_zcblx: "",
qtsz_zdyxtb: "关闭", qtsz_zdyxtb: "",
qtsz_tjzffgn: "关闭", qtsz_tjzffgn: "",
}, },
rules: { rules: {
ckcssz_btl: [{ required: true, trigger: "change", message: "必选" }], ckcssz_btl: [{ required: true, trigger: "change", message: "必选" }],
ckcssz_jyw: [{ required: true, trigger: "change", message: "必选" }], ckcssz_jyw: [{ required: true, trigger: "change", message: "必选" }],
@ -191,7 +191,6 @@ export default {
console.log(res); console.log(res);
if (res.data.state) { if (res.data.state) {
sessionStorage.setItem("CKFWQ_wx", JSON.stringify(datas)); sessionStorage.setItem("CKFWQ_wx", JSON.stringify(datas));
this.dialogVisible = false;
this.$message({ this.$message({
message: "保存成功", message: "保存成功",
type: "success", type: "success",
@ -209,7 +208,6 @@ export default {
console.log(answers); console.log(answers);
if (answers.data.data && answers.data.state) { if (answers.data.data && answers.data.state) {
let obj = JSON.parse(answers.data.data.mark_value); let obj = JSON.parse(answers.data.data.mark_value);
this.ruleForm.ckcssz_btl = obj.ckcssz_btl; this.ruleForm.ckcssz_btl = obj.ckcssz_btl;
this.ruleForm.ckcssz_jyw = obj.ckcssz_jyw; this.ruleForm.ckcssz_jyw = obj.ckcssz_jyw;
this.ruleForm.ckcssz_lk = obj.ckcssz_lk; this.ruleForm.ckcssz_lk = obj.ckcssz_lk;
@ -224,7 +222,6 @@ export default {
} }
}, },
// //
submitForm(formName) { submitForm(formName) {
this.$refs["ruleForm"].validate((valid) => { this.$refs["ruleForm"].validate((valid) => {
if (valid) { if (valid) {

View File

@ -120,9 +120,9 @@ export default {
// 线 - ; // 线 - ;
// 线 - ; // 线 - ;
// 线; // 线;
this.user_id = window.location.href.split("?")[1].split("|")[0]; this.user_id = window.location.href.split("?")[1].split("|")[0];
this.toObj(window.location.href.split("?")[1].split("|")[1]); this.toObj(window.location.href.split("?")[1].split("|")[1]);
alert(this.user_id);
this.time = this.$moment().format("HH:mm:ss"); this.time = this.$moment().format("HH:mm:ss");
this.productChartOption = productChart; this.productChartOption = productChart;