qukaidi 2 rokov pred
rodič
commit
53d56324ae

+ 22 - 2
src/views/monitor/alrtmList/index.vue

@@ -50,7 +50,7 @@
       <div>
         <el-button type="primary" size="mini" @click="getData">重新获取告警列表</el-button>
       </div>
-      <div>
+      <div style="display:flex;">
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
         <el-button v-show="show" @click="show = !show" icon="el-icon-arrow-up" size="mini">
@@ -60,6 +60,9 @@
           展开
         </el-button>
         <right-toolbar style="margin-left: 12px" :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+        <div style="margin: 0 12px">
+          <el-button icon="el-icon-setting" size="mini" circle @click="colSetting"></el-button>
+        </div>
       </div>
     </div>
     <el-table v-loading="loading" :data="list" style="width: 100%;">
@@ -87,12 +90,14 @@
     </el-table>
     <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
       @pagination="getList" />
+    <column-setting ref="columnSetting" @reset="reset" @getRowdata="getRowdata" tableName="监控列表" />
   </div>
 </template>
 
 <script>
 import { tableOption } from "./js/index";
 import { list } from "@/api/monitor/alrtmList";
+import columnSetting from "@/components/ColumnSetting/index";
 import Axios from "axios";
 
 export default {
@@ -117,6 +122,9 @@ export default {
       deviceOptions: [],
     };
   },
+  components: {
+    columnSetting,
+  },
   created() {
     this.getDicts("alarm_deal_result").then((response) => {
       this.dealOptions = response.data;
@@ -146,7 +154,19 @@ export default {
       return name;
     }
   },
+  activated() {
+    this.$refs.columnSetting.getRow(this.tableOption);
+  },
   methods: {
+    colSetting() {
+      this.$refs.columnSetting.init(this.tableOption);
+    },
+    getRowdata(list) {
+      this.tableOption = list;
+    },
+    reset() {
+      this.tableOption = this.$options.data().tableOption;
+    },
     /** 查询登录日志列表 */
     getList() {
       this.loading = true;
@@ -163,7 +183,7 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.queryForm = this.$options.data().queryForm
+      this.queryParams = this.$options.data().queryParams
       this.handleQuery();
     },
     getData() {

+ 22 - 2
src/views/monitor/monitorList/index.vue

@@ -26,10 +26,13 @@
         <el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd">新增
         </el-button>
       </div>
-      <div>
+      <div style="display:flex;">
         <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
         <right-toolbar style="margin-left: 12px" :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+        <div style="margin: 0 12px">
+          <el-button icon="el-icon-setting" size="mini" circle @click="colSetting"></el-button>
+        </div>
       </div>
     </div>
     <el-table v-loading="loading" :data="list" style="width: 100%;">
@@ -98,6 +101,7 @@
         </iframe>
       </div>
     </el-dialog>
+    <column-setting ref="columnSetting" @reset="reset" @getRowdata="getRowdata" tableName="监控列表" />
   </div>
 </template>
 
@@ -105,6 +109,7 @@
 import { tableOption } from "./js/index";
 import { list, addRow, editRow } from "@/api/monitor/monitorList";
 import { listWarehousesss } from '@/api/basicdata/warehouse'
+import columnSetting from "@/components/ColumnSetting/index";
 import Axios from "axios";
 
 export default {
@@ -153,6 +158,9 @@ export default {
       timer: null
     };
   },
+  components: {
+    columnSetting,
+  },
   created() {
     this.getDicts("monitor_project").then((response) => {
       this.projectIdOptions = response.data;
@@ -173,7 +181,19 @@ export default {
       return name;
     }
   },
+  activated() {
+    this.$refs.columnSetting.getRow(this.tableOption);
+  },
   methods: {
+    colSetting() {
+      this.$refs.columnSetting.init(this.tableOption);
+    },
+    getRowdata(list) {
+      this.tableOption = list;
+    },
+    reset() {
+      this.tableOption = this.$options.data().tableOption;
+    },
     /** 查询登录日志列表 */
     getList() {
       this.loading = true;
@@ -190,7 +210,7 @@ export default {
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
+      this.queryParams = this.$options.data().queryParams
       this.handleQuery();
     },
     handleAdd() {