zyh
This commit is contained in:
commit
dccd039ac4
|
|
@ -0,0 +1,975 @@
|
|||
<template>
|
||||
<div>
|
||||
<div>
|
||||
<el-dialog
|
||||
title="添加策略"
|
||||
:visible.sync="dialogVisible1"
|
||||
width="82%"
|
||||
:center="true"
|
||||
>
|
||||
<el-form
|
||||
:model="ruleForm1"
|
||||
:rules="rules1"
|
||||
ref="ruleForm1"
|
||||
label-width="150px"
|
||||
class="demo-ruleForm1"
|
||||
:label-position="labelPosition"
|
||||
>
|
||||
<el-row :justify="center">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="名称:" prop="clgl_name">
|
||||
<el-col :span="19">
|
||||
<el-select
|
||||
v-model="ruleForm1.clgl_name"
|
||||
placeholder="选择对象"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="源对象:" prop="clgl_ydx" style="color: red">
|
||||
<el-col :span="19">
|
||||
<el-select
|
||||
v-model="ruleForm1.clgl_ydx"
|
||||
placeholder="选择对象"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options4"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-form-item label="入口网关" prop="clgl_rkwg">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_rkwg1"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_rkwg2"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_rkwg3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_rkwg4"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="出口网关" prop="clgl_ckwg">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_ckwg1"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_ckwg2"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_ckwg3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_ckwg4"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="协议:" prop="clgl_xy">
|
||||
<el-col :span="19">
|
||||
<el-select
|
||||
v-model="ruleForm1.clgl_xy"
|
||||
multiple
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options2"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="源端口:" prop="clgl_ydk">
|
||||
<el-col :span="19">
|
||||
<el-input v-model="ruleForm1.clgl_ydk"></el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="入口网卡:" prop="clgl_rkwk">
|
||||
<el-col :span="19">
|
||||
<el-select
|
||||
v-model="ruleForm1.clgl_rkwk"
|
||||
placeholder="选择配置的内网网卡"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options8"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="出口网卡:" prop="clgl_ckwk">
|
||||
<el-col :span="19">
|
||||
<el-select
|
||||
v-model="ruleForm1.clgl_ckwk"
|
||||
placeholder="选择配置的外网网卡"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options9"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select> </el-col
|
||||
></el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="工作模式:" prop="clgl_gzms">
|
||||
<el-col :span="19">
|
||||
<el-select v-model="ruleForm1.clgl_gzms" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in options3"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="目的对象:" prop="clgl_mddx">
|
||||
<el-col :span="19">
|
||||
<el-select v-model="ruleForm1.clgl_mddx">
|
||||
<el-option
|
||||
label="数采服务器"
|
||||
value="数采服务器"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-form-item label="入口IP" prop="clgl_rkip">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_rkip1"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_rkip2"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_rkip3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_rkip4"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-form-item label="出口IP" prop="clgl_ckip">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_ckip1"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_ckip2"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_ckip3"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_ckip4"></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<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-col :span="19">
|
||||
<el-input v-model="ruleForm1.clgl_mddk"> </el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="未定义命令:" prop="clgl_wdyml">
|
||||
<el-col :span="19">
|
||||
<el-select
|
||||
v-model="ruleForm1.clgl_wdyml"
|
||||
placeholder="请选择"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options5"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<span style="color: #fff">记录日志:</span>
|
||||
<el-switch style="margin-left: 6%" v-model="switchvalue"> </el-switch>
|
||||
<div
|
||||
class="title"
|
||||
style="
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: 10px;
|
||||
"
|
||||
>
|
||||
<h3 style="margin-top: 10px; margin-bottom: 3px; color: #fff4">
|
||||
命令列表
|
||||
</h3>
|
||||
<el-button @click="flag = true">新增命令</el-button>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
<el-table :data="tableData1" style="width: 100%" border>
|
||||
<el-table-column label="序号">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.$index + 1 }}
|
||||
</template></el-table-column
|
||||
>
|
||||
<el-table-column prop="cmdlist_ml" label="命令(功能码)">
|
||||
</el-table-column>
|
||||
<el-table-column prop="cmdlist_qsdz" label="起始地址">
|
||||
</el-table-column>
|
||||
<el-table-column prop="cmdlist_dzcd" label="地址长度">
|
||||
</el-table-column>
|
||||
<el-table-column prop="cmdlist_ms" label="描述"> </el-table-column>
|
||||
<el-table-column prop="cmdlist_dz" label="动作"> </el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
@click="handleClick(scope.row)"
|
||||
type="text"
|
||||
size="small"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click="handleDel(scope.$index, scope.row)"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="saveAll">保 存</el-button>
|
||||
<el-button @click="dialogVisible1 = false">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
<div>
|
||||
<el-dialog
|
||||
title="新增命令"
|
||||
:visible.sync="flag"
|
||||
width="30%"
|
||||
:before-close="handleClose"
|
||||
>
|
||||
<el-form
|
||||
center
|
||||
:model="ruleForm2"
|
||||
:rules="rules2"
|
||||
ref="ruleForm2"
|
||||
label-width="150px"
|
||||
class="demo-ruleForm2"
|
||||
:label-position="labelPosition"
|
||||
>
|
||||
<el-form-item label="命令:" prop="cmdlist_ml">
|
||||
<el-col :span="6">
|
||||
<el-select v-model="ruleForm2.cmdlist_ml" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in options6"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="设备ID:" prop="cmdlist_sbid" style="color: red">
|
||||
<el-col :span="6">
|
||||
<el-select v-model="ruleForm2.cmdlist_sbid" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in options7"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="起始地址:" prop="cmdlist_qsdz">
|
||||
<el-col :span="6">
|
||||
<el-input v-model="ruleForm2.cmdlist_qsdz" style="width: 200px">
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="地址长度:" prop="cmdlist_dzcd">
|
||||
<el-col :span="6">
|
||||
<el-input v-model="ruleForm2.cmdlist_dzcd" style="width: 200px">
|
||||
</el-input>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述:" prop="cmdlist_ms">
|
||||
<el-col :span="6">
|
||||
<el-input
|
||||
v-model="ruleForm2.cmdlist_ms"
|
||||
style="width: 200px"
|
||||
></el-input
|
||||
></el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="动作:" prop="cmdlist_dz">
|
||||
<el-col :span="6">
|
||||
<el-select v-model="ruleForm2.cmdlist_dz" style="width: 200px">
|
||||
<el-option
|
||||
v-for="item in options5"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="saveMl">保存</el-button>
|
||||
<el-button @click="flag = false">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { SaveUserAnswer, GetUserAnswer } from "../api/user";
|
||||
export default {
|
||||
name: "InternetCompetitionAddPolicy",
|
||||
|
||||
data() {
|
||||
return {
|
||||
switchvalue: false,
|
||||
clgl_qidong: true,
|
||||
options1: [
|
||||
{
|
||||
label: "",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
label: "无线区策略",
|
||||
value: "无线区策略",
|
||||
},
|
||||
],
|
||||
options2: [
|
||||
{
|
||||
label: "OPC",
|
||||
value: "OPC",
|
||||
},
|
||||
{
|
||||
label: "Modbus(TCP)",
|
||||
value: "Modbus(TCP)",
|
||||
},
|
||||
{
|
||||
label: "DNP3",
|
||||
value: "DNP3",
|
||||
},
|
||||
{
|
||||
label: "S7",
|
||||
value: "S7",
|
||||
},
|
||||
{
|
||||
label: "EC104",
|
||||
value: "EC104",
|
||||
},
|
||||
],
|
||||
options3: [
|
||||
{
|
||||
label: "代理模式",
|
||||
value: "代理模式",
|
||||
},
|
||||
{
|
||||
label: "路由模式",
|
||||
value: "路由模式",
|
||||
},
|
||||
{
|
||||
label: "透明模式",
|
||||
value: "透明模式",
|
||||
},
|
||||
],
|
||||
options4: [
|
||||
{
|
||||
label: "有线区交换机",
|
||||
value: "有线区交换机",
|
||||
},
|
||||
{
|
||||
label: "无线区路由器",
|
||||
value: "无线区路由器",
|
||||
},
|
||||
],
|
||||
options5: [
|
||||
{
|
||||
label: "拒绝",
|
||||
value: "拒绝",
|
||||
},
|
||||
{
|
||||
label: "允许",
|
||||
value: "允许",
|
||||
},
|
||||
],
|
||||
options6: [
|
||||
{
|
||||
label: "读线圈状态",
|
||||
value: "读线圈状态",
|
||||
},
|
||||
{
|
||||
label: "读输入状态",
|
||||
value: "读输入状态",
|
||||
},
|
||||
{
|
||||
label: "读线保持寄存器",
|
||||
value: "读线保持寄存器",
|
||||
},
|
||||
{
|
||||
label: "读输入寄存器",
|
||||
value: "读输入寄存器",
|
||||
},
|
||||
{
|
||||
label: "强制单个线圈",
|
||||
value: "强制单个线圈",
|
||||
},
|
||||
{
|
||||
label: "预置单个寄存器",
|
||||
value: "预置单个寄存器",
|
||||
},
|
||||
{
|
||||
label: "强制多个寄存器",
|
||||
value: "强制多个寄存器",
|
||||
},
|
||||
],
|
||||
options7: [
|
||||
{
|
||||
label: "有线区交换机命令",
|
||||
value: "有线区交换机命令",
|
||||
},
|
||||
{
|
||||
label: "无线区路由器命令",
|
||||
value: "无线区路由器命令",
|
||||
},
|
||||
],
|
||||
options8: [
|
||||
{
|
||||
label: "有线区网闸(外网)",
|
||||
value: "有线区网闸(外网)",
|
||||
},
|
||||
{
|
||||
label: "无线区网闸(外网)",
|
||||
value: "无线区网闸(外网)",
|
||||
},
|
||||
],
|
||||
options9: [
|
||||
{
|
||||
label: "有线区网闸(外网)",
|
||||
value: "有线区网闸(外网)",
|
||||
},
|
||||
{
|
||||
label: "无线区网闸(内网)",
|
||||
value: "无线区网闸(内网)",
|
||||
},
|
||||
],
|
||||
dialogVisible1: true,
|
||||
labelPosition: "left",
|
||||
tableData: [
|
||||
{
|
||||
clgl_name: "数来服务器",
|
||||
cmdlist_qsdz: "192.168.89.21",
|
||||
clgl_xy: "Modbus(TCP)",
|
||||
clgl_gzms: "透明模式",
|
||||
clgl_ydx: "有线区交换机",
|
||||
clgl_ydk: "5200",
|
||||
clgl_rkwk: "有线区网闸(内网)",
|
||||
clgl_rkip: "",
|
||||
clgl_rkwg: "",
|
||||
clgl_ckwk: "有线区网闸(外网)",
|
||||
clgl_ckip: "",
|
||||
clgl_ckwg: "",
|
||||
clgl_mddx: "无限区路由器",
|
||||
clgl_mddk: "",
|
||||
clgl_rkip1: "",
|
||||
clgl_rkip2: "",
|
||||
clgl_rkip3: "",
|
||||
clgl_rkip4: "",
|
||||
},
|
||||
],
|
||||
tableData1: [
|
||||
// {
|
||||
// cmdlist_ml: "",
|
||||
// // cmdlist_sbid: "有线区交换机命令",
|
||||
// cmdlist_qsdz: "",
|
||||
// cmdlist_dzcd: "",
|
||||
// cmdlist_ms: "",
|
||||
// cmdlist_dz: "",
|
||||
// },
|
||||
],
|
||||
ruleForm1: {
|
||||
clgl_name: "",
|
||||
clgl_xy: [],
|
||||
clgl_gzms: "",
|
||||
clgl_ydx: "",
|
||||
clgl_ydk: "",
|
||||
clgl_mddx: "",
|
||||
clgl_mddk: "",
|
||||
clgl_rkwg: "",
|
||||
clgl_rkwk: "",
|
||||
clgl_rkip: "",
|
||||
clgl_dldk: "",
|
||||
clgl_ckwg: "",
|
||||
clgl_ckwk: "",
|
||||
clgl_ckip: "",
|
||||
clgl_wdyml: "",
|
||||
dlport: "",
|
||||
wdyml: "",
|
||||
clgl_rkip1: "",
|
||||
clgl_rkip2: "",
|
||||
clgl_rkip3: "",
|
||||
clgl_rkip4: "",
|
||||
clgl_ckip1: "",
|
||||
clgl_ckip2: "",
|
||||
clgl_ckip3: "",
|
||||
clgl_ckip4: "",
|
||||
clgl_rkwg1: "",
|
||||
clgl_rkwg2: "",
|
||||
clgl_rkwg3: "",
|
||||
clgl_rkwg4: "",
|
||||
clgl_ckwg1: "",
|
||||
clgl_ckwg2: "",
|
||||
clgl_ckwg3: "",
|
||||
clgl_ckwg4: "",
|
||||
},
|
||||
rules1: {
|
||||
clgl_name: [
|
||||
{ required: true, trigger: "change", message: "选择一个名称" },
|
||||
],
|
||||
clgl_xy: [
|
||||
{
|
||||
required: true,
|
||||
trigger: "change",
|
||||
message: "至少选择一个选择协议",
|
||||
},
|
||||
],
|
||||
clgl_gzms: [
|
||||
{ required: true, trigger: "change", message: "选择一个工作模式" },
|
||||
],
|
||||
clgl_mddk: [
|
||||
{ required: true, trigger: "blur", message: "目的端口是必填参数" },
|
||||
],
|
||||
clgl_rkwk: [
|
||||
{ required: true, trigger: "change", message: "选择一个入口网卡" },
|
||||
],
|
||||
clgl_ckwk: [
|
||||
{ required: true, trigger: "change", message: "选择一个出口网卡" },
|
||||
],
|
||||
clgl_rkip: [
|
||||
{
|
||||
required: true,
|
||||
validator: this.validateIpAddress,
|
||||
trigger: "blur",
|
||||
message: "",
|
||||
},
|
||||
],
|
||||
|
||||
clgl_ckip: [
|
||||
{
|
||||
required: true,
|
||||
validator: this.validateIpAddress1,
|
||||
trigger: "blur",
|
||||
message: "",
|
||||
},
|
||||
],
|
||||
clgl_rkwg: [],
|
||||
clgl_ckwg: [],
|
||||
|
||||
clgl_ydx: [
|
||||
{ required: true, trigger: "change", message: "选择一个源对象" },
|
||||
],
|
||||
clgl_ydk: [
|
||||
{ required: true, trigger: "blur", message: "源端口不能为空" },
|
||||
],
|
||||
clgl_mddx: [
|
||||
{ required: true, trigger: "blur", message: "源端口不能为空" },
|
||||
],
|
||||
clgl_wdyml: [
|
||||
{ required: true, trigger: "change", message: "选择一个命令" },
|
||||
],
|
||||
},
|
||||
ruleForm2: {
|
||||
cmdlist_ml: "读线圈状态",
|
||||
cmdlist_sbid: "",
|
||||
cmdlist_qsdz: "",
|
||||
cmdlist_dzcd: "",
|
||||
cmdlist_ms: "",
|
||||
cmdlist_dz: "",
|
||||
},
|
||||
rules2: {
|
||||
cmdlist_ml: [{ required: true, trigger: "change", message: "必填项" }],
|
||||
cmdlist_sbid: [
|
||||
{ required: true, trigger: "change", message: "必填项" },
|
||||
],
|
||||
cmdlist_qsdz: [
|
||||
{ required: true, trigger: "change", message: "必填项" },
|
||||
],
|
||||
cmdlist_dzcd: [
|
||||
{ required: true, trigger: "change", message: "必填项" },
|
||||
],
|
||||
cmdlist_dz: [{ required: true, trigger: "change", message: "必填项" }],
|
||||
},
|
||||
value: "",
|
||||
flag: false,
|
||||
json: {},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.GetUserAnswer();
|
||||
},
|
||||
mounted() {},
|
||||
|
||||
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() {
|
||||
this.$refs["ruleForm1"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.SaveUserAnswer();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
//保存上传服务器方法---新增策略
|
||||
async SaveUserAnswer() {
|
||||
var obj = {
|
||||
clgl_name: this.ruleForm1.clgl_name,
|
||||
cmdlist_qsdz: this.ruleForm1.cmdlist_qsdz,
|
||||
clgl_xy: this.ruleForm1.clgl_xy,
|
||||
clgl_gzms: this.ruleForm1.clgl_gzms,
|
||||
clgl_ydx: this.ruleForm1.clgl_ydx,
|
||||
clgl_ydk: this.ruleForm1.clgl_ydk,
|
||||
clgl_rkwk: this.ruleForm1.clgl_rkwk,
|
||||
clgl_rkip:
|
||||
this.ruleForm1.clgl_rkip1 +
|
||||
"." +
|
||||
this.ruleForm1.clgl_rkip2 +
|
||||
"." +
|
||||
this.ruleForm1.clgl_rkip3 +
|
||||
"." +
|
||||
this.ruleForm1.clgl_rkip4,
|
||||
clgl_rkwg:
|
||||
this.ruleForm1.clgl_rkwg1 +
|
||||
"." +
|
||||
this.ruleForm1.clgl_rkwg2 +
|
||||
"." +
|
||||
this.ruleForm1.clgl_rkwg3 +
|
||||
"." +
|
||||
this.ruleForm1.clgl_rkwg4,
|
||||
clgl_ckwk: this.ruleForm1.clgl_ckwk,
|
||||
clgl_ckip:
|
||||
this.ruleForm1.clgl_ckip1 +
|
||||
"." +
|
||||
this.ruleForm1.clgl_ckip2 +
|
||||
"." +
|
||||
this.ruleForm1.clgl_ckip3 +
|
||||
"." +
|
||||
this.ruleForm1.clgl_ckip4,
|
||||
clgl_ckwg:
|
||||
this.ruleForm1.clgl_ckwg1 +
|
||||
"." +
|
||||
this.ruleForm1.clgl_ckwg2 +
|
||||
"." +
|
||||
this.ruleForm1.clgl_ckwg3 +
|
||||
"." +
|
||||
this.ruleForm1.clgl_ckwg4,
|
||||
clgl_mddx: this.ruleForm1.clgl_mddx,
|
||||
clgl_mddk: this.ruleForm1.clgl_mddk,
|
||||
clgl_wdyml: this.ruleForm1.clgl_wdyml,
|
||||
};
|
||||
//拿缓存数据
|
||||
var json = JSON.parse(sessionStorage.getItem(this.$store.state.type));
|
||||
let { data } = await SaveUserAnswer({
|
||||
mark: `${this.$store.state.type}`,
|
||||
user_id: `${this.$route.query.id}`,
|
||||
mark_value: JSON.stringify({ ...json, ...obj }),
|
||||
});
|
||||
if (data.state) {
|
||||
sessionStorage.setItem(
|
||||
this.$store.state.type,
|
||||
JSON.stringify({ ...json, ...obj })
|
||||
);
|
||||
this.$message({
|
||||
message: "缓存成功",
|
||||
type: "success",
|
||||
});
|
||||
this.dialogVisible1 = false;
|
||||
} else {
|
||||
this.$message.error("操作失败");
|
||||
}
|
||||
},
|
||||
//获取缓存数据
|
||||
async GetUserAnswer() {
|
||||
let { data } = await GetUserAnswer({
|
||||
mark: `${this.$store.state.type}`,
|
||||
user_id: `${this.$route.query.id}`,
|
||||
});
|
||||
if (data.data && data.state) {
|
||||
let res = JSON.parse(data.data.mark_value);
|
||||
if (res.clgl_ckip) {
|
||||
this.ruleForm1.clgl_ckip1 = res.clgl_ckip.split(".")[0];
|
||||
this.ruleForm1.clgl_ckip2 = res.clgl_ckip.split(".")[1];
|
||||
this.ruleForm1.clgl_ckip3 = res.clgl_ckip.split(".")[2];
|
||||
this.ruleForm1.clgl_ckip4 = res.clgl_rkip.split(".")[3];
|
||||
this.ruleForm1.clgl_rkip1 = res.clgl_rkip.split(".")[0];
|
||||
this.ruleForm1.clgl_rkip2 = res.clgl_rkip.split(".")[1];
|
||||
this.ruleForm1.clgl_rkip3 = res.clgl_rkip.split(".")[2];
|
||||
this.ruleForm1.clgl_rkip4 = res.clgl_rkip.split(".")[3];
|
||||
this.ruleForm1.clgl_rkwg1 = res.clgl_rkwg.split(".")[0];
|
||||
this.ruleForm1.clgl_rkwg2 = res.clgl_rkwg.split(".")[1];
|
||||
this.ruleForm1.clgl_rkwg3 = res.clgl_rkwg.split(".")[2];
|
||||
this.ruleForm1.clgl_rkwg4 = res.clgl_rkwg.split(".")[3];
|
||||
this.ruleForm1.clgl_ckwg1 = res.clgl_ckwg.split(".")[0];
|
||||
this.ruleForm1.clgl_ckwg2 = res.clgl_ckwg.split(".")[1];
|
||||
this.ruleForm1.clgl_ckwg3 = res.clgl_ckwg.split(".")[2];
|
||||
this.ruleForm1.clgl_ckwg4 = res.clgl_ckwg.split(".")[3];
|
||||
this.ruleForm1.clgl_name = res.clgl_name;
|
||||
this.ruleForm1.clgl_xy = res.clgl_xy;
|
||||
this.ruleForm1.clgl_gzms = res.clgl_gzms;
|
||||
this.ruleForm1.clgl_mddk = res.clgl_mddk;
|
||||
this.ruleForm1.clgl_ydx = res.clgl_ydx;
|
||||
this.ruleForm1.clgl_ydk = res.clgl_ydk;
|
||||
this.ruleForm1.clgl_mddk = res.clgl_mddk;
|
||||
this.ruleForm1.clgl_dldk = res.clgl_dldk;
|
||||
this.ruleForm1.clgl_rkwk = res.clgl_rkwk;
|
||||
this.ruleForm1.clgl_wdyml = res.clgl_wdyml;
|
||||
this.ruleForm1.clgl_ckwk = res.clgl_ckwk;
|
||||
this.tableData1 = [
|
||||
{
|
||||
cmdlist_ml: res.cmdlist_ml,
|
||||
cmdlist_sbid: res.cmdlist_sbid,
|
||||
cmdlist_qsdz: res.cmdlist_qsdz,
|
||||
cmdlist_dzcd: res.cmdlist_dzcd,
|
||||
cmdlist_ms: res.cmdlist_ms,
|
||||
cmdlist_dz: res.cmdlist_dz,
|
||||
},
|
||||
];
|
||||
}
|
||||
}
|
||||
},
|
||||
//新增命令-保存
|
||||
saveMl() {
|
||||
this.$refs["ruleForm2"].validate((valid) => {
|
||||
if (valid) {
|
||||
this.saveMlAnswer();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
//新增命令方法
|
||||
async saveMlAnswer() {
|
||||
var obj = {
|
||||
cmdlist_ml: this.ruleForm2.cmdlist_ml,
|
||||
cmdlist_sbid: this.ruleForm2.cmdlist_sbid,
|
||||
cmdlist_qsdz: this.ruleForm2.cmdlist_qsdz,
|
||||
cmdlist_dzcd: this.ruleForm2.cmdlist_dzcd,
|
||||
cmdlist_ms: this.ruleForm2.cmdlist_ms,
|
||||
cmdlist_dz: this.ruleForm2.cmdlist_dz,
|
||||
};
|
||||
//拿缓存数据
|
||||
var json = JSON.parse(sessionStorage.getItem(this.$store.state.type));
|
||||
let { data } = await SaveUserAnswer({
|
||||
mark: `${this.$store.state.type}`,
|
||||
user_id: `${this.$route.query.id}`,
|
||||
mark_value: JSON.stringify({ ...json, ...obj }),
|
||||
});
|
||||
if (data.state) {
|
||||
this.tableData1 = [obj];
|
||||
sessionStorage.setItem(
|
||||
this.$store.state.type,
|
||||
JSON.stringify({ ...json, ...obj })
|
||||
);
|
||||
this.flag = false;
|
||||
this.$message({
|
||||
message: "新增成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.message);
|
||||
}
|
||||
},
|
||||
//删除命令
|
||||
async handleDel(index, row) {
|
||||
this.tableData1 = [];
|
||||
let obj = JSON.parse(sessionStorage.getItem(this.$store.state.type));
|
||||
obj.cmdlist_ml = "";
|
||||
obj.cmdlist_sbid = "";
|
||||
obj.cmdlist_qsdz = "";
|
||||
obj.cmdlist_dzcd = "";
|
||||
obj.cmdlist_ms = "";
|
||||
obj.cmdlist_dz = "";
|
||||
localStorage.setItem(this.$store.state.type, JSON.stringify(obj));
|
||||
let { data } = await SaveUserAnswer({
|
||||
mark: `${this.$store.state.type}`,
|
||||
user_id: `${this.$route.query.id}`,
|
||||
mark_value: JSON.stringify(obj),
|
||||
});
|
||||
if (data.state) {
|
||||
this.$message({
|
||||
message: "删除成功",
|
||||
type: "success",
|
||||
});
|
||||
} else {
|
||||
this.$message.error(data.message);
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.el-col-1 {
|
||||
padding: 0px 4px;
|
||||
line-height: 62px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.el-col-5 {
|
||||
width: 43px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
/deep/.el-dialog__header {
|
||||
text-align: left;
|
||||
/* 标题左对齐 */
|
||||
}
|
||||
|
||||
/deep/ .demo-ruleForm1 {
|
||||
.el-col-1 {
|
||||
padding: 0px 4px;
|
||||
line-height: 62px;
|
||||
height: 20px;
|
||||
text-align: center;
|
||||
color: transparent;
|
||||
}
|
||||
|
||||
.el-col-5 {
|
||||
width: 43px;
|
||||
height: 30px;
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
height: 30px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
export let answer = {
|
||||
kqwk: "",
|
||||
wkgzfs: "",
|
||||
wkms: "",
|
||||
kqwk: "1",
|
||||
wkgzfs: "2",
|
||||
wkms: "3",
|
||||
};
|
||||
|
|
|
|||
|
|
@ -51,96 +51,46 @@
|
|||
</el-col>
|
||||
</el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="入口网关:" prop="clgl_rkwg1">
|
||||
<el-form-item label="入口网关" prop="clgl_rkwg">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input
|
||||
v-model="ruleForm1.clgl_rkwg1"
|
||||
:maxlength="3"
|
||||
></el-input>
|
||||
<el-input v-model="ruleForm1.clgl_rkwg1"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_rkwg2"></el-input>
|
||||
</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-input
|
||||
v-model="ruleForm1.clgl_rkwg2"
|
||||
:maxlength="3"
|
||||
></el-input>
|
||||
<el-input v-model="ruleForm1.clgl_rkwg3"></el-input>
|
||||
</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-input
|
||||
v-model="ruleForm1.clgl_rkwg3"
|
||||
:maxlength="3"
|
||||
></el-input>
|
||||
<el-input v-model="ruleForm1.clgl_rkwg4"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
</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-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="出口网关:" prop="clgl_ckwg1">
|
||||
<el-form-item label="出口网关" prop="clgl_ckwg">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input
|
||||
v-model="ruleForm1.clgl_ckwg1"
|
||||
:maxlength="3"
|
||||
></el-input>
|
||||
<el-input v-model="ruleForm1.clgl_ckwg1"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_ckwg2"></el-input>
|
||||
</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-input
|
||||
v-model="ruleForm1.clgl_ckwg2"
|
||||
:maxlength="3"
|
||||
></el-input>
|
||||
<el-input v-model="ruleForm1.clgl_ckwg3"></el-input>
|
||||
</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-input
|
||||
v-model="ruleForm1.clgl_ckwg3"
|
||||
:maxlength="3"
|
||||
></el-input>
|
||||
<el-input v-model="ruleForm1.clgl_ckwg4"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
</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-form-item>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
|
|
@ -214,114 +164,69 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="目的对象:" prop="clgl_mddx">
|
||||
<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-form-item>
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="入口IP:" prop="clgl_rkip1">
|
||||
<el-form-item label="入口IP" prop="clgl_rkip">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input
|
||||
v-model="ruleForm1.clgl_rkip1"
|
||||
:maxlength="3"
|
||||
></el-input>
|
||||
<el-input v-model="ruleForm1.clgl_rkip1"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_rkip2"></el-input>
|
||||
</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-input
|
||||
v-model="ruleForm1.clgl_rkip2"
|
||||
:maxlength="3"
|
||||
></el-input>
|
||||
<el-input v-model="ruleForm1.clgl_rkip3"></el-input>
|
||||
</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-input
|
||||
v-model="ruleForm1.clgl_rkip3"
|
||||
:maxlength="3"
|
||||
></el-input>
|
||||
<el-input v-model="ruleForm1.clgl_rkip4"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
</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-form-item>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="3">
|
||||
<el-form-item label="出口IP:" prop="clgl_ckip1">
|
||||
<el-form-item label="出口IP" prop="clgl_ckip">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input
|
||||
v-model="ruleForm1.clgl_ckip1"
|
||||
:maxlength="3"
|
||||
></el-input>
|
||||
<el-input v-model="ruleForm1.clgl_ckip1"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input v-model="ruleForm1.clgl_ckip2"></el-input>
|
||||
</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-input
|
||||
v-model="ruleForm1.clgl_ckip2"
|
||||
:maxlength="3"
|
||||
></el-input>
|
||||
<el-input v-model="ruleForm1.clgl_ckip3"></el-input>
|
||||
</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-input
|
||||
v-model="ruleForm1.clgl_ckip3"
|
||||
:maxlength="3"
|
||||
></el-input>
|
||||
<el-input v-model="ruleForm1.clgl_ckip4"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
</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-form-item>
|
||||
</el-row>
|
||||
</el-col>
|
||||
<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-col :span="19">
|
||||
<el-input v-model="ruleForm1.clgl_mddk"> </el-input>
|
||||
</el-col>
|
||||
</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-col :span="19">
|
||||
<el-select
|
||||
|
|
@ -491,8 +396,8 @@ export default {
|
|||
clgl_qidong: true,
|
||||
options1: [
|
||||
{
|
||||
label: "有线区策略",
|
||||
value: "有线区策略",
|
||||
label: "",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
label: "无线区策略",
|
||||
|
|
@ -651,11 +556,11 @@ export default {
|
|||
],
|
||||
ruleForm1: {
|
||||
clgl_name: "",
|
||||
clgl_xy: [""],
|
||||
clgl_xy: [],
|
||||
clgl_gzms: "",
|
||||
clgl_ydx: "",
|
||||
clgl_ydk: "",
|
||||
clgl_mddx: "数采服务器",
|
||||
clgl_mddx: "",
|
||||
clgl_mddk: "",
|
||||
clgl_rkwg: "",
|
||||
clgl_rkwk: "",
|
||||
|
|
@ -707,135 +612,26 @@ export default {
|
|||
clgl_ckwk: [
|
||||
{ required: true, trigger: "change", message: "选择一个出口网卡" },
|
||||
],
|
||||
clgl_rkip1: [
|
||||
{ required: true, trigger: "blur", message: "片段为空" },
|
||||
clgl_rkip: [
|
||||
{
|
||||
message: "片段无效",
|
||||
required: true,
|
||||
validator: this.validateIpAddress,
|
||||
trigger: "blur",
|
||||
pattern: /^(25[0-5]|2[0-4][0-9]|[1-9][0-9]?)$/,
|
||||
},
|
||||
],
|
||||
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]?)$/,
|
||||
message: "",
|
||||
},
|
||||
],
|
||||
|
||||
clgl_ckip1: [
|
||||
{ required: true, trigger: "blur", message: "片段为空" },
|
||||
clgl_ckip: [
|
||||
{
|
||||
message: "片段无效",
|
||||
required: true,
|
||||
validator: this.validateIpAddress1,
|
||||
trigger: "blur",
|
||||
pattern: /^(25[0-5]|2[0-4][0-9]|[1-9][0-9]?)$/,
|
||||
},
|
||||
],
|
||||
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]?)$/,
|
||||
message: "",
|
||||
},
|
||||
],
|
||||
clgl_rkwg: [],
|
||||
clgl_ckwg: [],
|
||||
|
||||
clgl_ydx: [
|
||||
{ required: true, trigger: "change", message: "选择一个源对象" },
|
||||
],
|
||||
|
|
@ -881,6 +677,63 @@ export default {
|
|||
mounted() {},
|
||||
|
||||
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() {
|
||||
this.$refs["ruleForm1"].validate((valid) => {
|
||||
|
|
@ -1119,12 +972,4 @@ export default {
|
|||
height: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .el-form-item__error {
|
||||
min-width: 50px;
|
||||
}
|
||||
|
||||
/deep/.el-col-1 {
|
||||
height: 10px !important;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -23,10 +23,6 @@
|
|||
<el-button @click="flag = true">新建网关</el-button>
|
||||
<el-button @click="deleteSelectedRows">删除</el-button>
|
||||
</div>
|
||||
<!-- <div class="right">
|
||||
<el-input type="search" v-model="search"></el-input>
|
||||
<el-button @click="select">筛选</el-button>
|
||||
</div> -->
|
||||
</div>
|
||||
<el-table
|
||||
ref="multipleTable"
|
||||
|
|
@ -41,7 +37,7 @@
|
|||
{{ scope.$index + 1 }}
|
||||
</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="wgbh" 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="2000808012" value="2000808012"></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-col>
|
||||
</el-form-item>
|
||||
|
|
@ -117,14 +111,6 @@
|
|||
<el-option label="lan-box2" value="lan-box2"></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="lan- server port"
|
||||
value="lan- server port"
|
||||
></el-option>
|
||||
<el-option
|
||||
label="wlan- server port"
|
||||
value="wlan- server port"
|
||||
></el-option> -->
|
||||
</el-select>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
|
|
@ -135,14 +121,6 @@
|
|||
<el-option label="有线区网关2" value="有线区网关2"></el-option>
|
||||
<el-option label="无线区网关1" value="无线区网关1"></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-col>
|
||||
</el-form-item>
|
||||
|
|
@ -220,17 +198,31 @@ export default {
|
|||
});
|
||||
},
|
||||
//删除
|
||||
handleDelete(a, b) {
|
||||
async handleDelete(a, b) {
|
||||
this.wgpz.splice(a, 1);
|
||||
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) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
//多选删除
|
||||
deleteSelectedRows() {
|
||||
async deleteSelectedRows() {
|
||||
if (this.multipleSelection.length == 0) {
|
||||
this.$message({
|
||||
message: "请先选择数据",
|
||||
|
|
@ -243,7 +235,21 @@ export default {
|
|||
);
|
||||
this.multipleSelection = [];
|
||||
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) {
|
||||
|
|
@ -255,6 +261,7 @@ export default {
|
|||
let { data } = await GetUserAnswer({
|
||||
mark: "YDPZYM_wgpz",
|
||||
user_id: `${this.user_id}`,
|
||||
// user_id: "USER202307301109254198",
|
||||
});
|
||||
console.log(data.data);
|
||||
if (data.data && data.state) {
|
||||
|
|
@ -263,18 +270,27 @@ export default {
|
|||
},
|
||||
//保存数据
|
||||
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({
|
||||
mark: "YDPZYM_wgpz",
|
||||
user_id: `${this.user_id}`,
|
||||
// user_id: "USER202307301109254198",
|
||||
mark_value: JSON.stringify(this.wgpz),
|
||||
});
|
||||
if (data.state) {
|
||||
this.wgpz.push(this.ruleForm);
|
||||
this.$message({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
});
|
||||
this.flag = true;
|
||||
this.flag = false;
|
||||
for (let key in this.ruleForm) {
|
||||
this.ruleForm[key] = "";
|
||||
}
|
||||
} else {
|
||||
this.$message.error("保存失败");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -262,6 +262,7 @@ export default {
|
|||
let { data } = await GetUserAnswer({
|
||||
mark: "YDPZYM_wgwh",
|
||||
user_id: `${this.user_id}`,
|
||||
// user_id: "USER202307301109254198",
|
||||
});
|
||||
console.log(data);
|
||||
if (data.data && data.state) {
|
||||
|
|
@ -289,17 +290,30 @@ export default {
|
|||
});
|
||||
},
|
||||
//删除
|
||||
handleDelete(a, b) {
|
||||
async handleDelete(a, b) {
|
||||
this.tableData.splice(a, 1);
|
||||
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) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
//多选删除
|
||||
deleteSelectedRows() {
|
||||
async deleteSelectedRows() {
|
||||
if (this.multipleSelection.length == 0) {
|
||||
this.$message({
|
||||
message: "请先选择要删除的数据",
|
||||
|
|
@ -312,7 +326,20 @@ export default {
|
|||
);
|
||||
this.multipleSelection = [];
|
||||
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) {
|
||||
console.log(b);
|
||||
|
|
@ -327,15 +354,28 @@ export default {
|
|||
}
|
||||
let { data } = await SaveUserAnswer({
|
||||
mark: "YDPZYM_wgwh",
|
||||
user_id: `${this.user_id}`,
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301109254198",
|
||||
mark_value: JSON.stringify(this.tableData),
|
||||
});
|
||||
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({
|
||||
message: "操作成功",
|
||||
type: "success",
|
||||
});
|
||||
for (let key in this.ruleForm) {
|
||||
this.ruleForm[key] = "";
|
||||
}
|
||||
} else {
|
||||
this.$message.error(data.message);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,13 +49,14 @@
|
|||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">保存</el-button>
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<!-- <el-button @click="change">改变</el-button> -->
|
||||
<el-button @click="change">改变</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { SaveUserAnswer, GetUserAnswer } from "@/api/user";
|
||||
import { answer } from "../answerObj";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -68,11 +69,7 @@ export default {
|
|||
wkgzfs: "LAN口",
|
||||
wkms: "n",
|
||||
},
|
||||
// $answerObj: {
|
||||
// kqwk: "",
|
||||
// wkgzfs: "",
|
||||
// wkms: "",
|
||||
// },
|
||||
|
||||
rules: {
|
||||
kqwk: [{ required: true, trigger: "change", message: "必填项" }],
|
||||
wkgzfs: [{ required: true, trigger: "change", message: "必填项" }],
|
||||
|
|
@ -90,7 +87,7 @@ export default {
|
|||
this.user_id = data;
|
||||
},
|
||||
change() {
|
||||
console.log(this.$answerObj);
|
||||
this.$set(answer, "kqwk", "11111111");
|
||||
},
|
||||
async saveDatas() {
|
||||
let datas = JSON.parse(sessionStorage.getItem("CKFWQ_wx"));
|
||||
|
|
@ -109,8 +106,6 @@ export default {
|
|||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
this.dialogVisible = false;
|
||||
console.log({ ...datas, ...this.ruleForm }, "存储");
|
||||
} else {
|
||||
this.$message.error("保存失败");
|
||||
}
|
||||
|
|
@ -121,7 +116,7 @@ export default {
|
|||
mark: "CKFWQ_wx",
|
||||
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);
|
||||
this.ruleForm.kqwk = obj.kqwk;
|
||||
this.ruleForm.wkgzfs = obj.wkgzfs;
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@
|
|||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.wlgl_ww_name" placeholder="">
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
v-for="item in options2"
|
||||
:key="item"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
|
|
@ -205,6 +205,7 @@ export default {
|
|||
};
|
||||
},
|
||||
created() {
|
||||
this.dialogVisible = true;
|
||||
let str = window.location.href.split("?")[1];
|
||||
this.user_id = str.split("|")[0];
|
||||
let type = str.split("|")[1];
|
||||
|
|
@ -264,7 +265,6 @@ export default {
|
|||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
this.dialogVisible = false;
|
||||
} else {
|
||||
this.$message.error("保存失败");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,6 +132,7 @@ export default {
|
|||
};
|
||||
},
|
||||
created() {
|
||||
this.dialogVisible = true;
|
||||
let str = window.location.href.split("?")[1];
|
||||
this.user_id = str.split("|")[0];
|
||||
let type = str.split("|")[1];
|
||||
|
|
@ -172,17 +173,24 @@ export default {
|
|||
if (this.dxgl.length == 2) {
|
||||
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));
|
||||
|
||||
// console.log(this.dxgl);
|
||||
let { data } = await SaveUserAnswer({
|
||||
mark: `${this.$store.state.type}`,
|
||||
// mark: "GYWZ_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301109254198",
|
||||
|
||||
mark_value: JSON.stringify({ ...json, ...{ dxgl: this.dxgl } }),
|
||||
});
|
||||
console.log(data.state);
|
||||
|
||||
if (data.state) {
|
||||
console.log(data.data.mark_value);
|
||||
// console.log(data.data.mark_value);
|
||||
this.dxgl.push({
|
||||
dx_name: this.ruleForm.dxmc,
|
||||
iplx: this.ruleForm.iplx,
|
||||
|
|
@ -207,7 +215,9 @@ export default {
|
|||
async GetUserAnswer() {
|
||||
let { data } = await GetUserAnswer({
|
||||
mark: `${this.$store.state.type}`,
|
||||
// mark: "GYWZ_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301109254198",
|
||||
});
|
||||
if (data.state && data.data) {
|
||||
console.log(JSON.parse(data.data.mark_value).dxgl);
|
||||
|
|
@ -219,10 +229,13 @@ export default {
|
|||
//删除
|
||||
async deleteRow(index, rows) {
|
||||
var json = JSON.parse(sessionStorage.getItem(this.$store.state.type));
|
||||
var json = JSON.parse(sessionStorage.getItem("GYWZ_yx"));
|
||||
this.dxgl.splice(index, 1);
|
||||
let { data } = await SaveUserAnswer({
|
||||
mark: `${this.$store.state.type}`,
|
||||
// mark: "GYWZ_yx",
|
||||
user_id: this.user_id,
|
||||
// user_id: "USER202307301109254198",
|
||||
mark_value: JSON.stringify({ ...json, ...{ dxgl: this.dxgl } }),
|
||||
});
|
||||
console.log(data.data);
|
||||
|
|
@ -245,35 +258,6 @@ export default {
|
|||
};
|
||||
</script>
|
||||
<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 {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
|
@ -297,7 +281,7 @@ export default {
|
|||
}
|
||||
|
||||
.el-col-5 {
|
||||
width: 43px;
|
||||
width: 55px;
|
||||
height: 30px;
|
||||
}
|
||||
.el-table {
|
||||
|
|
|
|||
|
|
@ -106,7 +106,6 @@
|
|||
></el-checkbox>
|
||||
</el-form>
|
||||
<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 @click="dialogVisible = false">取 消</el-button>
|
||||
</span>
|
||||
|
|
@ -116,7 +115,6 @@
|
|||
</template>
|
||||
<script>
|
||||
import { SaveUserAnswer, GetUserAnswer } from "@/api/user";
|
||||
import { isValidPrimaryDNS } from "../validate";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -143,7 +141,6 @@ export default {
|
|||
],
|
||||
},
|
||||
],
|
||||
|
||||
defaultProps: {
|
||||
children: "children",
|
||||
label: "name",
|
||||
|
|
@ -285,7 +282,6 @@ export default {
|
|||
text-align: center;
|
||||
border: 1px solid rgba(220, 220, 220, 1);
|
||||
}
|
||||
|
||||
/deep/ .port_content {
|
||||
.el-input {
|
||||
width: 200px;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<template>
|
||||
<div>
|
||||
<!-- <el-button @click="dialogVisible = true">无线设置</el-button> -->
|
||||
<el-dialog title="无线设置" :visible.sync="dialogVisible" width="30%">
|
||||
<el-form
|
||||
:model="ruleForm"
|
||||
|
|
@ -22,15 +21,9 @@
|
|||
<el-col :span="10">
|
||||
<el-select v-model="ruleForm.wxpz_wlmc" placeholder="无线网名称">
|
||||
<el-option label="无线区无限网" value="shanghai"></el-option>
|
||||
<!-- <el-option label="区域二" value="beijing"></el-option> -->
|
||||
</el-select>
|
||||
</el-col>
|
||||
</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-col :span="10">
|
||||
<el-select v-model="ruleForm.wxpz_jmms">
|
||||
|
|
@ -110,7 +103,6 @@ export default {
|
|||
message: "保存成功",
|
||||
type: "success",
|
||||
});
|
||||
this.dialogVisible = false;
|
||||
} else {
|
||||
this.$message.error("保存失败");
|
||||
}
|
||||
|
|
@ -120,8 +112,8 @@ export default {
|
|||
mark: "CKFWQ_wx",
|
||||
user_id: `${this.user_id}`,
|
||||
});
|
||||
console.log(obj);
|
||||
if (data.data && data.state) {
|
||||
console.log(data);
|
||||
if (JSON.parse(data.data.mark_value) && data.state) {
|
||||
var obj = JSON.parse(data.data.mark_value);
|
||||
this.ruleForm.wxpz_gzms = obj.wxpz_gzms;
|
||||
this.ruleForm.wxpz_wlmc = obj.wxpz_wlmc;
|
||||
|
|
@ -129,7 +121,6 @@ export default {
|
|||
this.ruleForm.wxpz_jmms = obj.wxpz_jmms;
|
||||
this.ruleForm.wxpz_jmsf = obj.wxpz_jmsf;
|
||||
this.ruleForm.wxpz_mm = obj.wxpz_mm;
|
||||
console.log(this.ruleForm, "取");
|
||||
}
|
||||
},
|
||||
submitForm(formName) {
|
||||
|
|
|
|||
|
|
@ -69,6 +69,7 @@
|
|||
<el-form-item label="数据位(bit):" prop="ckcssz_sjw">
|
||||
<el-select v-model="ruleForm.ckcssz_sjw" placeholder="请选择数据位">
|
||||
<el-option label="8" value="8"></el-option>
|
||||
<el-option label="7" value="7"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="停止位:" prop="ckcssz_tzw">
|
||||
|
|
@ -149,19 +150,18 @@ export default {
|
|||
user_id: "",
|
||||
loading: false,
|
||||
ruleForm: {
|
||||
ckcssz_btl: "9600",
|
||||
ckcssz_jyw: "无校验(none)",
|
||||
ckcssz_lk: "关闭",
|
||||
ckcssz_zdybtl: "开启",
|
||||
ckcssz_sjw: "8",
|
||||
ckcssz_tzw: "1",
|
||||
ckcssz_485: "关闭",
|
||||
qtsz_ckzdcz: "关闭",
|
||||
qtsz_zcblx: "关闭",
|
||||
qtsz_zdyxtb: "关闭",
|
||||
qtsz_tjzffgn: "关闭",
|
||||
ckcssz_btl: "",
|
||||
ckcssz_jyw: "",
|
||||
ckcssz_lk: "",
|
||||
ckcssz_zdybtl: "",
|
||||
ckcssz_sjw: "",
|
||||
ckcssz_tzw: "",
|
||||
ckcssz_485: "",
|
||||
qtsz_ckzdcz: "",
|
||||
qtsz_zcblx: "",
|
||||
qtsz_zdyxtb: "",
|
||||
qtsz_tjzffgn: "",
|
||||
},
|
||||
|
||||
rules: {
|
||||
ckcssz_btl: [{ required: true, trigger: "change", message: "必选" }],
|
||||
ckcssz_jyw: [{ required: true, trigger: "change", message: "必选" }],
|
||||
|
|
@ -191,7 +191,6 @@ export default {
|
|||
console.log(res);
|
||||
if (res.data.state) {
|
||||
sessionStorage.setItem("CKFWQ_wx", JSON.stringify(datas));
|
||||
this.dialogVisible = false;
|
||||
this.$message({
|
||||
message: "保存成功",
|
||||
type: "success",
|
||||
|
|
@ -209,7 +208,6 @@ export default {
|
|||
console.log(answers);
|
||||
if (answers.data.data && answers.data.state) {
|
||||
let obj = JSON.parse(answers.data.data.mark_value);
|
||||
|
||||
this.ruleForm.ckcssz_btl = obj.ckcssz_btl;
|
||||
this.ruleForm.ckcssz_jyw = obj.ckcssz_jyw;
|
||||
this.ruleForm.ckcssz_lk = obj.ckcssz_lk;
|
||||
|
|
@ -224,7 +222,6 @@ export default {
|
|||
}
|
||||
},
|
||||
//交互方法
|
||||
|
||||
submitForm(formName) {
|
||||
this.$refs["ruleForm"].validate((valid) => {
|
||||
if (valid) {
|
||||
|
|
|
|||
|
|
@ -120,9 +120,9 @@ export default {
|
|||
// 有线串口 - 负载电流;
|
||||
// 无线串口 - 额定电流;
|
||||
// 这两个只要设备连线和设备配置信息对就展示数据;
|
||||
|
||||
this.user_id = window.location.href.split("?")[1].split("|")[0];
|
||||
this.toObj(window.location.href.split("?")[1].split("|")[1]);
|
||||
alert(this.user_id);
|
||||
|
||||
this.time = this.$moment().format("HH:mm:ss");
|
||||
this.productChartOption = productChart;
|
||||
|
|
|
|||
Loading…
Reference in New Issue