diff --git a/src/api/user.js b/src/api/user.js
index 048bb99..0a5f254 100644
--- a/src/api/user.js
+++ b/src/api/user.js
@@ -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}`)
-}
\ No newline at end of file
+ return axios.get(
+ `/wangguan?action=querycache&mark=${data.mark}&user_id=${data.user_id}`
+ );
+};
+
+//网关配置
diff --git a/src/components/AddPolicy.vue b/src/components/AddPolicy.vue
index 0b9968c..311f73d 100644
--- a/src/components/AddPolicy.vue
+++ b/src/components/AddPolicy.vue
@@ -156,50 +156,41 @@
-
-
+
.
-
+
.
-
+
.
-
+
-
+
.
-
+
.
-
+
.
-
+
@@ -235,13 +226,7 @@
记录日志:
-
-
+
-
保 存
+
保 存
取 消
@@ -365,44 +348,8 @@
-
-
-
@@ -411,6 +358,7 @@
diff --git a/src/components/DataAcquire.vue b/src/components/DataAcquire.vue
index da111cc..69d5f0f 100644
--- a/src/components/DataAcquire.vue
+++ b/src/components/DataAcquire.vue
@@ -1,161 +1,214 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 请确认选择的网关类型与网关实体一致:否则该工程无法下载至实体网关
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 请确认选择的网关类型与网关实体一致:否则该工程无法下载至实体网关
+
+
+
+
+
+
\ No newline at end of file
+
diff --git a/src/components/DataView.vue b/src/components/DataView.vue
index 04f2970..045312e 100644
--- a/src/components/DataView.vue
+++ b/src/components/DataView.vue
@@ -1,7 +1,6 @@
-
-
新建网关
- 删除
+ 删除
-
- 筛选
+
+ 筛选
@@ -35,7 +33,12 @@
- 删除
+ 删除
@@ -48,7 +51,7 @@
参数配置
@@ -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",
+ });
},
},
};
diff --git a/src/components/GatewayMaintenance.vue b/src/components/GatewayMaintenance.vue
index 1bf9053..0150384 100644
--- a/src/components/GatewayMaintenance.vue
+++ b/src/components/GatewayMaintenance.vue
@@ -1,6 +1,5 @@
-
新增参数
- 删除
+ 删除
@@ -23,7 +22,6 @@
style="margin-top: 10px"
tooltip-effect="dark"
@selection-change="handleSelectionChange"
- :cell-style="cellStyle"
>
@@ -44,7 +42,12 @@
- 删除
+ 删除
@@ -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",
+ });
},
},
};
diff --git a/src/components/PolicyManagement.vue b/src/components/PolicyManagement.vue
index 657ad5b..f0d216d 100644
--- a/src/components/PolicyManagement.vue
+++ b/src/components/PolicyManagement.vue
@@ -1,6 +1,5 @@
-
-
\ No newline at end of file
+
diff --git a/vue.config.js b/vue.config.js
index 96a197c..25f29bf 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -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,
// 开启代理:在本地会创建一个虚拟服务端,然后发送请求的数据,