This commit is contained in:
lll 2023-11-06 17:49:10 +08:00
parent 7f3c696dd4
commit f011be96b1
10 changed files with 465 additions and 335 deletions

View File

@ -1,11 +1,17 @@
import axios from "axios";
export const GetDbwirldList = () => {
return axios.get("/wangguan?action=queryanswer&mark=DB-IotLite_yx")
}
return axios.get("/wangguan?action=queryanswer&mark=DB-IotLite_yx");
};
export const SaveUserAnswer = (data) => {
return axios.post(`/wangguan?action=updatecache&mark=${data.mark}&user_id=${data.user_id}&mark_value=${data.mark_value}`, {
})
}
return axios.post(
`/wangguan?action=updatecache&mark=${data.mark}&user_id=${data.user_id}&mark_value=${data.mark_value}`,
{}
);
};
export const GetUserAnswer = (data) => {
return axios.get(`/wangguan?action=querycache&mark=${data.mark}&user_id=${data.user_id}`)
}
return axios.get(
`/wangguan?action=querycache&mark=${data.mark}&user_id=${data.user_id}`
);
};
//网关配置

View File

@ -156,50 +156,41 @@
</el-form-item>
<el-form-item label="目的对象:" prop="clgl_mddx">
<el-col :span="19">
<!-- <el-select v-model="ruleForm1.clgl_mddx" placeholder="请选择">
<el-option
v-for="item in options6"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select> -->
<el-input v-model="ruleForm1.clgl_mddx"></el-input>
</el-col>
</el-form-item>
<el-form-item label="入口IP:" prop="clgl_rkip">
<el-col :span="5">
<el-input v-model="clgl_rkip1"></el-input>
<el-input v-model="clgl_rkip1" :maxlength="3"></el-input>
</el-col>
<el-col :span="1">. </el-col>
<el-col :span="5">
<el-input v-model="clgl_rkip2"></el-input>
<el-input v-model="clgl_rkip2" :maxlength="3"></el-input>
</el-col>
<el-col :span="1">.</el-col>
<el-col :span="5">
<el-input v-modl="clgl_rkip3"></el-input>
<el-input v-model="clgl_rkip3" :maxlength="3"></el-input>
</el-col>
<el-col :span="1">.</el-col>
<el-col :span="5">
<el-input v-model="clgl_rkip4"></el-input>
<el-input v-model="clgl_rkip4" :maxlength="3"></el-input>
</el-col>
</el-form-item>
<el-form-item label="出口IP:" prop="clgl_ckip">
<el-col :span="5">
<el-input v-model="clgl_ckip1"></el-input>
<el-input v-model="clgl_ckip1" :maxlength="3"></el-input>
</el-col>
<el-col :span="1">. </el-col>
<el-col :span="5">
<el-input v-model="clgl_ckip2"></el-input>
<el-input v-model="clgl_ckip2" :maxlength="3"></el-input>
</el-col>
<el-col :span="1">.</el-col>
<el-col :span="5">
<el-input v-model="clgl_ckip3"></el-input>
<el-input v-model="clgl_ckip3" :maxlength="3"></el-input>
</el-col>
<el-col :span="1">.</el-col>
<el-col :span="5">
<el-input v-model="clgl_ckip4"></el-input>
<el-input v-model="clgl_ckip4" :maxlength="3"></el-input>
</el-col>
</el-form-item>
</el-col>
@ -235,13 +226,7 @@
</el-row>
</el-form>
<span>记录日志</span>
<el-switch
style="margin-left: 6%"
v-model="switchvalue"
active-color="#13ce66"
inactive-color="#ff4949"
>
</el-switch>
<el-switch style="margin-left: 6%" v-model="switchvalue"> </el-switch>
<div
class="title"
style="
@ -281,9 +266,7 @@
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogVisible1 = false"
> </el-button
>
<el-button type="primary" @click="saveAll"> </el-button>
<el-button @click="dialogVisible1 = false"> </el-button>
</span>
</el-dialog>
@ -365,44 +348,8 @@
</el-col>
</el-form-item>
</el-form>
<!-- <span>记录日志</span>
<el-switch
style="margin-left: 6%"
v-model="value"
active-color="#13ce66"
inactive-color="#ff4949"
>
</el-switch> -->
<!-- <div
class="title"
style="display: flex; justify-content: space-between; margin-top: 10px"
>
<h3 style="margin-top: 10px; margin-bottom: 3px">命令列表</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="ml" label="命令(功能码)"> </el-table-column>
<el-table-column prop="address" label="起码地址"> </el-table-column>
<el-table-column prop="length" label="地址长度"> </el-table-column>
<el-table-column prop="ms" label="描述"> </el-table-column>
<el-table-column prop="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">删除</el-button>
</template>
</el-table-column>
</el-table> -->
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="flag = false">保存</el-button>
<el-button type="primary" @click="saveAll">保存</el-button>
<el-button @click="flag = false"> </el-button>
</span>
</el-dialog>
@ -411,6 +358,7 @@
</template>
<script>
import { SaveUserAnswer } from "../api/user";
export default {
name: "InternetCompetitionAddPolicy",
@ -428,6 +376,16 @@ export default {
clgl_ckip2: "",
clgl_ckip3: "",
clgl_ckip4: "",
//
clgl_rkwg1: "",
clgl_rkwg2: "",
clgl_rkwg3: "",
clgl_rkwg4: "",
//
clgl_ckwg1: "",
clgl_ckwg2: "",
clgl_ckwg3: "",
clgl_ckwg4: "",
options1: [
{
label: "有线区策略",
@ -604,18 +562,45 @@ export default {
wdyml: "",
},
rules1: {
clgl_name: [{ required: true, trigger: "change" }],
clgl_xy: [{ required: true, trigger: "change" }],
clgl_gzms: [{ required: true, trigger: "change" }],
clgl_mddk: [{ required: true, trigger: "blur" }],
clgl_rkwk: [{ required: true, trigger: "change" }],
clgl_ckwk: [{ required: true, trigger: "change" }],
clgl_rkip: [{ required: true, trigger: "blur" }],
clgl_ckip: [{ required: true, trigger: "blur" }],
clgl_ydx: [{ required: true, trigger: "blur" }],
clgl_ydk: [{ required: true, trigger: "change" }],
clgl_mddx: [{ required: true, trigger: "change" }],
clgl_wdyml: [{ required: true, trigger: "change" }],
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, message: "IP地址不能为空" }],
clgl_ckip: [
{ required: true, trigger: "change", message: "IP地址不能为空" },
],
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: "读线圈状态",
@ -639,7 +624,60 @@ export default {
mounted() {},
methods: {},
methods: {
async saveAll() {
let { data } = await SaveUserAnswer(
JSON.stringify({
mark: "GYWZ_wx",
user_id: "USER202307301109254198",
mark_value: {
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.clgl_rkip1 +
"." +
this.clgl_rkip2 +
"." +
this.clgl_rkip3 +
"." +
this.clgl_rkip4,
clgl_rkwg:
this.clgl_rkwg1 +
"." +
this.clgl_rkwg2 +
"." +
this.clgl_rkwg3 +
"." +
this.clgl_rkwg4,
clgl_ckwk: this.ruleForm1.clgl_ckwk,
clgl_ckip:
this.clgl_ckip1 +
"." +
this.clgl_ckip2 +
"." +
this.clgl_ckip3 +
"." +
this.clgl_ckip4,
clgl_ckwg:
this.clgl_ckwg1 +
"." +
this.clgl_ckwg2 +
"." +
this.clgl_ckwg3 +
"." +
this.clgl_ckwg4,
clgl_mddx: this.ruleForm1.clgl_mddx,
clgl_mddk: this.ruleForm1.clgl_mddk,
},
})
);
},
},
};
</script>

View File

@ -1,161 +1,214 @@
<!-- Db网关配置-无线网关配置 -->
<template>
<div>
<!-- <div class="data_acquire">
<div>
<!-- <div class="data_acquire">
<el-button type="info" plain @click="outerVisible = true">数据采集设备</el-button>
</div> -->
<div>
<el-dialog title="新建网关" :visible.sync="outerVisible" width="382px">
<el-form :model="formdata" :rules="rules" ref="ruleForm" label-width="85px" class="demo-ruleForm">
<el-form-item label="网关名称:" prop="wgpz_wgmc">
<el-select v-model="formdata.wgpz_wgmc" placeholder="有线区网关1" style="width: 200px;">
<el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="网关ID:" prop="wgpz_wgid">
<el-select v-model="formdata.wgpz_wgid" placeholder="LAN-BOX1" style="width: 200px;">
<el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="网关类型:" prop="wgpz_wglx">
<el-select v-model="formdata.wgpz_wglx" placeholder="lot Life 网关" style="width: 200px;">
<el-option v-for="item in options3" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
</el-form>
<el-dialog width="382px" title="系统提示" :visible.sync="innerVisible" append-to-body>
<p class="inner_content">请确认选择的网关类型与网关实体一致:否则该工程无法下载至实体网关</p>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="innerConfirm">确定</el-button>
<el-button @click="innerVisible = false"> </el-button>
</div>
</el-dialog>
<div slot="footer" class="dialog-footer-outer">
<el-button type="primary" @click="innerVisible = true">保存</el-button>
<el-button @click="outerVisible = false"> </el-button>
</div>
</el-dialog>
<div>
<el-dialog title="新建网关" :visible.sync="outerVisible" width="382px">
<el-form
:model="formdata"
:rules="rules"
ref="ruleForm"
label-width="85px"
class="demo-ruleForm"
>
<el-form-item label="网关名称:" prop="wgpz_wgmc">
<el-select
v-model="formdata.wgpz_wgmc"
placeholder="有线区网关1"
style="width: 200px"
>
<el-option
v-for="item in options1"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="网关ID:" prop="wgpz_wgid">
<el-select
v-model="formdata.wgpz_wgid"
placeholder="LAN-BOX1"
style="width: 200px"
>
<el-option
v-for="item in options2"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="网关类型:" prop="wgpz_wglx">
<el-select
v-model="formdata.wgpz_wglx"
placeholder="lot Life 网关"
style="width: 200px"
>
<el-option
v-for="item in options3"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<el-dialog
width="382px"
title="系统提示"
:visible.sync="innerVisible"
append-to-body
>
<p class="inner_content">
请确认选择的网关类型与网关实体一致:否则该工程无法下载至实体网关
</p>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="innerConfirm">确定</el-button>
<el-button @click="innerVisible = false"> </el-button>
</div>
</el-dialog>
<div slot="footer" class="dialog-footer-outer">
<el-button type="primary" @click="innerVisible = true"
>保存</el-button
>
<el-button @click="outerVisible = false"> </el-button>
</div>
</el-dialog>
</div>
</div>
</template>
<script>
import { SaveUserAnswer, GetUserAnswer } from "@/api/user";
export default {
name: 'TestDataAcquisition',
name: "TestDataAcquisition",
data() {
return {
options1: [{
value: "有线区网关1",
label: "有线区网关1",
}, {
value: "无线区网关1",
label: "无线区网关1",
}],
options2: [{
value: "LAN-BOX1",
label: "LAN-BOX1",
}, {
value: "WLAN-BOX1",
label: "WLAN-BOX1",
}],
options3: [{
value: 'loT Lite网关',
label: 'loT Lite网关'
}, {
value: 'MODBUS网关',
label: 'MODBUS网关'
}, {
value: 'BACNET网关',
label: 'BACNET网关'
}, {
value: 'OPC UA网关',
label: 'OPC UA网关'
}, {
value: 'OPC DA网关',
label: 'OPC DA网关'
},
{
value: 'loT网关',
label: 'loT网关'
}],
value: '',
formdata: {
wgpz_wgmc: "有线区网关1",
wgpz_wgid: "LAN-BOX1",
wgpz_wglx: "loT网关"
},
rules: {
wgpz_wgmc: [
{ required: true, message: '请选择网关名称', trigger: 'change' },
],
wgpz_wgid: [
{ required: true, message: '请选择网关id', trigger: 'change' },
],
wgpz_wglx: [
{ required: true, message: '请选择网关类型', trigger: 'change' }
],
},
outerVisible: true,
innerVisible: false,
};
data() {
return {
options1: [
{
value: "有线区网关1",
label: "有线区网关1",
},
{
value: "无线区网关1",
label: "无线区网关1",
},
],
options2: [
{
value: "LAN-BOX1",
label: "LAN-BOX1",
},
{
value: "WLAN-BOX1",
label: "WLAN-BOX1",
},
],
options3: [
{
value: "loT Lite网关",
label: "loT Lite网关",
},
{
value: "MODBUS网关",
label: "MODBUS网关",
},
{
value: "BACNET网关",
label: "BACNET网关",
},
{
value: "OPC UA网关",
label: "OPC UA网关",
},
{
value: "OPC DA网关",
label: "OPC DA网关",
},
{
value: "loT网关",
label: "loT网关",
},
],
value: "",
formdata: {
wgpz_wgmc: "有线区网关1",
wgpz_wgid: "LAN-BOX1",
wgpz_wglx: "loT网关",
},
rules: {
wgpz_wgmc: [
{ required: true, message: "请选择网关名称", trigger: "change" },
],
wgpz_wgid: [
{ required: true, message: "请选择网关id", trigger: "change" },
],
wgpz_wglx: [
{ required: true, message: "请选择网关类型", trigger: "change" },
],
},
outerVisible: true,
innerVisible: false,
};
},
mounted() {},
methods: {
async innerConfirm() {
this.outerVisible = false;
this.innerVisible = false;
let datas = sessionStorage.getItem("answer");
console.log(JSON.parse(datas));
this.formdata = { ...this.formdata, ...JSON.parse(datas) };
console.log(this.formdata);
let res = await SaveUserAnswer({
mark: "DB-IotLite_yx",
user_id: "USER202307301109254198",
mark_value: JSON.stringify(this.formdata),
});
console.log(JSON.parse(res.data.data.mark_value));
sessionStorage.setItem("answer", JSON.stringify(this.formdata));
this.$router.replace("/channelconfig");
},
mounted() {
},
methods: {
async innerConfirm() {
this.outerVisible = false;
this.innerVisible = false;
let datas = sessionStorage.getItem("answer");
console.log(JSON.parse(datas));
this.formdata = { ...this.formdata, ...JSON.parse(datas) };
console.log(this.formdata);
let res = await SaveUserAnswer({
mark: "DB-IotLite_yx",
user_id: "USER202307301109254198",
mark_value: JSON.stringify(this.formdata),
})
console.log(JSON.parse(res.data.data.mark_value));
sessionStorage.setItem('answer', JSON.stringify(this.formdata))
this.$router.replace("/channelconfig");
}
},
async created() {
let res2 = await GetUserAnswer({
mark: "DB-IotLite_yx",
user_id: "USER202307301109254198",
});
console.log(res2);
let res3 = JSON.parse(res2.data.data.mark_value);
console.log(res3);
console.log(res3.wgpz_wgid);
this.formdata.wgpz_wgid = res3.wgpz_wgid;
console.log(this.formdata.wgpz_wgid);
this.formdata.wgpz_wgmc = res3.wgpz_wgmc;
this.formdata.wgpz_wglx = res3.wgpz_wglx;
}
},
async created() {
let res2 = await GetUserAnswer({
mark: "DB-IotLite_yx",
user_id: "USER202307301109254198",
});
console.log(res2);
let res3 = JSON.parse(res2.data.data.mark_value);
console.log(res3);
console.log(res3.wgpz_wgid);
this.formdata.wgpz_wgid = res3.wgpz_wgid;
console.log(this.formdata.wgpz_wgid);
this.formdata.wgpz_wgmc = res3.wgpz_wgmc;
this.formdata.wgpz_wglx = res3.wgpz_wglx;
},
};
</script>
<style lang="less" scoped>
.data_acquire {
font-size: 14px;
font-size: 14px;
}
.inner_content {
margin-left: 30px;
width: 280px;
height: 40px;
// color: rgba(255, 255, 255, 0);
font-size: 14px;
text-align: left;
font-family: SourceHanSansSC-regular;
margin-left: 30px;
width: 280px;
height: 40px;
// color: rgba(255, 255, 255, 0);
font-size: 14px;
text-align: left;
font-family: "SourceHanSansSC-regular";
color: #fff;
}
</style>
</style>

View File

@ -1,7 +1,6 @@
<!-- IP设置-网络方式 -->
<template>
<div>
<!-- <div> <el-button type="info" plain @click="dialogFormVisible = true">IP设置</el-button></div> -->
<!-- 无线网关 -->
<el-dialog
title="IP设置"

View File

@ -1,15 +1,14 @@
<template>
<div>
<!-- <el-button @click="dialogVisible = true">网关配置</el-button> -->
<el-dialog title="网关配置" :visible.sync="dialogVisible">
<div class="title">
<div class="left">
<el-button @click="flag = true">新建网关</el-button>
<el-button>删除</el-button>
<el-button @click="deleteSelectedRows">删除</el-button>
</div>
<div class="right">
<el-input type="search"></el-input>
<el-button>筛选</el-button>
<el-input type="search" v-model="search"></el-input>
<el-button @click="select">筛选</el-button>
</div>
</div>
<el-table
@ -19,7 +18,6 @@
style="margin-top: 10px; width: 100%"
tooltip-effect="dark"
@selection-change="handleSelectionChange"
:cell-style="cellStyle"
>
<el-table-column label="序号">
<template slot-scope="scope">
@ -35,7 +33,12 @@
<el-table-column prop="whsj" label="维护时间"> </el-table-column>
<el-table-column label="修改">
<template slot-scope="scope">
<el-button type="text" size="small">删除</el-button>
<el-button
type="text"
size="small"
@click="handleDelete(scope.$index, scope.row)"
>删除</el-button
>
</template></el-table-column
>
<el-table-column label="详细">
@ -48,7 +51,7 @@
<el-button
type="text"
size="small"
@click="$router.push('/ntmaintenance')"
@click="$router.push('/ntmaintenance?' + scope.row.wgbh)"
>参数配置</el-button
>
</template>
@ -137,19 +140,9 @@ export default {
dialogVisible: true,
flag: false,
labelPosition: "left",
wgpz: [
{
wgid: "",
wgbh: "",
wgmc: "",
wglx: "",
whr: "",
whsj: "",
wgzt: "",
zxxtsj: "",
},
],
wgpz: [],
FormData: [],
search: "",
ruleForm: {
wglx: "",
wgid: "",
@ -172,34 +165,60 @@ export default {
},
};
},
created() {
this.wgpz = JSON.parse(localStorage.getItem("wgpz")) || [];
},
methods: {
handleSelectionChange() {},
cellStyle({ row, column }) {
if (column.property === "status") {
if (row.status === "离线") {
return { background: "#6C6C6C", color: "#fff" };
} else {
return { background: "#fff" };
}
}
},
//
saveinfo() {
this.flag = false;
console.log("124214");
if (this.FormData.length < 4) {
this.FormData.push(this.ruleForm);
this.$message({
message: "添加成功",
type: "success",
});
console.log(this.FormData);
} else {
this.$message({
message: "抱歉,只能添加四条数据",
type: "error",
});
return false;
}
this.$refs["ruleForm"].validate((valid) => {
if (valid) {
if (this.wgpz.length < 4) {
this.wgpz.push(this.ruleForm);
localStorage.setItem("wgpz", JSON.stringify(this.wgpz));
this.$message({
message: "添加成功",
type: "success",
});
this.flag = false;
} else {
this.$message({
message: "抱歉,只能添加四条数据",
type: "error",
});
return false;
}
} else {
console.log("error submit!!");
return false;
}
});
},
//
handleDelete(a, b) {
this.wgpz.splice(a, 1);
localStorage.setItem("wgpz", JSON.stringify(this.wgpz));
this.$message({
message: "删除成功",
type: "success",
});
},
//
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
deleteSelectedRows() {
this.wgpz = this.wgpz.filter(
(row) => !this.multipleSelection.includes(row)
);
this.multipleSelection = [];
localStorage.setItem("wgpz", JSON.stringify(this.wgpz));
this.$message({
message: "删除成功",
type: "success",
});
},
},
};

View File

@ -1,6 +1,5 @@
<template>
<div>
<!-- <el-button @click="dialogVisible = true">网关维护</el-button> -->
<el-dialog
title="网关维护"
:visible.sync="dialogVisible"
@ -9,7 +8,7 @@
<div class="title">
<div class="left">
<el-button @click="flag = true">新增参数</el-button>
<el-button>删除</el-button>
<el-button @click="deleteSelectedRows">删除</el-button>
</div>
<div class="right">
<el-input type="search" style="margin-right: 10px"></el-input>
@ -23,7 +22,6 @@
style="margin-top: 10px"
tooltip-effect="dark"
@selection-change="handleSelectionChange"
:cell-style="cellStyle"
>
<el-table-column label="序号">
<template slot-scope="scope">
@ -44,7 +42,12 @@
<el-table-column label="修改">
<template slot-scope="scope">
<el-button type="text" size="small">删除</el-button>
<el-button
type="text"
size="small"
@click="handleDelete(scope.$index, scope.row)"
>删除</el-button
>
</template></el-table-column
>
<el-table-column label="详细">
@ -156,19 +159,21 @@ export default {
dialogVisible: true,
labelPosition: "left",
flag: false,
wgid: "",
multipleSelection: [],
tableData: [
{
wgsn: "",
wgbh: "",
wgmc: "",
cskey: "",
csmc: "",
xsws: "",
sdz: "",
pcz: "",
whr: "",
whsj: "",
},
// {
// wgsn: "",
// wgbh: "",
// wgmc: "",
// cskey: "",
// csmc: "",
// xsws: "",
// sdz: "",
// pcz: "",
// whr: "",
// whsj: "",
// },
],
ruleForm: {
sswg: "",
@ -202,41 +207,59 @@ export default {
},
};
},
created() {},
created() {
this.wgid = this.$route.fullPath.split("?")[1];
this.tableData = JSON.parse(localStorage.getItem("wgwh")) || [];
},
methods: {
handleSelectionChange() {},
cellStyle({ row, column }) {
if (column.property === "open") {
if (row.open === "是") {
return { background: "#75F9FD", color: "#000" };
} else if (row.open === "否") {
return { background: "#6C6C6C", color: "#fff" };
}
} else if (column.property === "sos") {
if (row.sos === "是") {
return { background: "#75F9FD", color: "#000" };
} else if (row.sos === "否") {
return { background: "#6C6C6C", color: "#fff" };
}
}
},
saveinfo() {
this.flag = false;
console.log("124214");
if (this.FormData.length < 4) {
this.FormData.push(this.ruleForm);
this.$message({
message: "添加成功",
type: "success",
});
console.log(this.FormData);
} else {
this.$message({
message: "抱歉,只能添加四条数据",
type: "error",
});
return false;
}
this.$refs["ruleForm"].validate((valid) => {
if (valid) {
if (this.tableData.length < 4) {
this.tableData.push(this.ruleForm);
localStorage.setItem("wgwh", JSON.stringify(this.tableData));
this.$message({
message: "添加成功",
type: "success",
});
this.flag = false;
} else {
this.$message({
message: "抱歉,只能添加四条数据",
type: "error",
});
return false;
}
} else {
console.log("error submit!!");
return false;
}
});
},
//
handleDelete(a, b) {
this.wgwh.splice(a, 1);
localStorage.setItem("wgwh", JSON.stringify(this.tableData));
this.$message({
message: "删除成功",
type: "success",
});
},
//
handleSelectionChange(val) {
this.multipleSelection = val;
},
//
deleteSelectedRows() {
this.tableData = this.tableData.filter(
(row) => !this.multipleSelection.includes(row)
);
this.multipleSelection = [];
localStorage.setItem("wgwh", JSON.stringify(this.tableData));
this.$message({
message: "删除成功",
type: "success",
});
},
},
};

View File

@ -1,6 +1,5 @@
<template>
<div>
<!-- <el-button @click="dialogVisible = true">策略管理</el-button> -->
<el-dialog title="策略管理" :visible.sync="dialogVisible" width="50%">
<div class="title">
<el-button style="margin-bottom: 10px" @click="addPolicy"

View File

@ -170,6 +170,7 @@ export default {
// background-image: url("../assets/image/ 2 Copy@1x.png");
background-size: cover; /* 图像大小适应容器 */
background-repeat: no-repeat; /* 防止图像平铺 */
background-color: transparent;
background-position: center; /* 图像在容器中居中 */
.title {

View File

@ -5,28 +5,20 @@
</template>
<script>
import PolicyManagement from '@/components/PolicyManagement.vue';
import PolicyManagement from "@/components/PolicyManagement.vue";
export default {
name: 'InternetCompetitionStrategyManagement',
components:{
PolicyManagement
name: "InternetCompetitionStrategyManagement",
components: {
PolicyManagement,
},
data() {
return {
};
return {};
},
mounted() {
},
mounted() {},
methods: {
},
methods: {},
};
</script>
<style lang="less" scoped>
</style>
<style lang="less" scoped></style>

View File

@ -6,7 +6,7 @@ module.exports = defineConfig({
devServer: {
proxy: {
"/wangguan": {
target: "http://172.16.1.254:10014/Handler/Config.ashx",
target: "http://111.229.30.246:10013/Handler/Config.ashx",
pathRewrite: { "^/wangguan": "" },
secure: false,
// 开启代理:在本地会创建一个虚拟服务端,然后发送请求的数据,