瀏覽代碼

修改wifi认证页面

“yueshang” 2 年之前
父節點
當前提交
a0a1749148
共有 1 個文件被更改,包括 127 次插入50 次删除
  1. 127 50
      src/views/biz/wifiInfo/index.vue

+ 127 - 50
src/views/biz/wifiInfo/index.vue

@@ -1,6 +1,13 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form
+      :model="queryParams"
+      ref="queryForm"
+      size="small"
+      :inline="true"
+      v-show="showSearch"
+      label-width="68px"
+    >
       <el-form-item label="设备ID" prop="deviceId">
         <el-input
           v-model="queryParams.deviceId"
@@ -42,7 +49,11 @@
         />
       </el-form-item>
       <el-form-item label="是否非法" prop="isIllegal">
-        <el-select v-model="queryParams.isIllegal" placeholder="请选择是否非法" clearable>
+        <el-select
+          v-model="queryParams.isIllegal"
+          placeholder="请选择是否非法"
+          clearable
+        >
           <el-option
             v-for="dict in dict.type.sys_yes_no"
             :key="dict.value"
@@ -52,16 +63,26 @@
         </el-select>
       </el-form-item>
       <el-form-item label="数据采集时间" prop="time">
-        <el-date-picker clearable
+        <el-date-picker
+          clearable
           v-model="queryParams.time"
           type="date"
           value-format="yyyy-MM-dd"
-          placeholder="请选择数据采集时间">
+          placeholder="请选择数据采集时间"
+        >
         </el-date-picker>
       </el-form-item>
       <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+        <el-button
+          type="primary"
+          icon="el-icon-search"
+          size="mini"
+          @click="handleQuery"
+          >搜索</el-button
+        >
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
+          >重置</el-button
+        >
       </el-form-item>
     </el-form>
 
@@ -74,7 +95,8 @@
           size="mini"
           @click="handleAdd"
           v-hasPermi="['biz:wifiInfo:add']"
-        >新增</el-button>
+          >新增</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -85,7 +107,8 @@
           :disabled="single"
           @click="handleUpdate"
           v-hasPermi="['biz:wifiInfo:edit']"
-        >修改</el-button>
+          >修改</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -96,7 +119,8 @@
           :disabled="multiple"
           @click="handleDelete"
           v-hasPermi="['biz:wifiInfo:remove']"
-        >删除</el-button>
+          >删除</el-button
+        >
       </el-col>
       <el-col :span="1.5">
         <el-button
@@ -106,12 +130,20 @@
           size="mini"
           @click="handleExport"
           v-hasPermi="['biz:wifiInfo:export']"
-        >导出</el-button>
+          >导出</el-button
+        >
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      <right-toolbar
+        :showSearch.sync="showSearch"
+        @queryTable="getList"
+      ></right-toolbar>
     </el-row>
 
-    <el-table v-loading="loading" :data="wifiInfoList" @selection-change="handleSelectionChange">
+    <el-table
+      v-loading="loading"
+      :data="wifiInfoList"
+      @selection-change="handleSelectionChange"
+    >
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="信息ID" align="center" prop="wifiInfoId" />
       <el-table-column label="设备ID" align="center" prop="deviceId" />
@@ -119,19 +151,40 @@
       <el-table-column label="区域ID" align="center" prop="areaId" />
       <el-table-column label="MAC地址" align="center" prop="bssid" />
       <el-table-column label="WIFI名称" align="center" prop="ssid" />
-      <el-table-column label="认证页面" align="center" prop="authPage" />
+      <el-table-column label="认证页面" align="center" prop="authPage">
+        <template>
+          <el-button
+            type="primary"
+            plain
+            size="mini"
+            @click="handleAuth"
+            >认证</el-button>
+        </template>
+      </el-table-column>
       <el-table-column label="是否非法" align="center" prop="isIllegal">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isIllegal"/>
+          <dict-tag
+            :options="dict.type.sys_yes_no"
+            :value="scope.row.isIllegal"
+          />
         </template>
       </el-table-column>
       <el-table-column label="关键字类型" align="center" prop="keyType" />
-      <el-table-column label="数据采集时间" align="center" prop="time" width="180">
+      <el-table-column
+        label="数据采集时间"
+        align="center"
+        prop="time"
+        width="180"
+      >
         <template slot-scope="scope">
-          <span>{{ parseTime(scope.row.time, '{y}-{m}-{d}') }}</span>
+          <span>{{ parseTime(scope.row.time, "{y}-{m}-{d}") }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+      <el-table-column
+        label="操作"
+        align="center"
+        class-name="small-padding fixed-width"
+      >
         <template slot-scope="scope">
           <el-button
             size="mini"
@@ -139,20 +192,22 @@
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
             v-hasPermi="['biz:wifiInfo:edit']"
-          >修改</el-button>
+            >修改</el-button
+          >
           <el-button
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
             v-hasPermi="['biz:wifiInfo:remove']"
-          >删除</el-button>
+            >删除</el-button
+          >
         </template>
       </el-table-column>
     </el-table>
-    
+
     <pagination
-      v-show="total>0"
+      v-show="total > 0"
       :total="total"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
@@ -178,7 +233,11 @@
           <el-input v-model="form.ssid" placeholder="请输入WIFI名称" />
         </el-form-item>
         <el-form-item label="认证页面" prop="authPage">
-          <el-input v-model="form.authPage" type="textarea" placeholder="请输入内容" />
+          <el-input
+            v-model="form.authPage"
+            type="textarea"
+            placeholder="请输入内容"
+          />
         </el-form-item>
         <el-form-item label="是否非法" prop="isIllegal">
           <el-select v-model="form.isIllegal" placeholder="请选择是否非法">
@@ -191,11 +250,13 @@
           </el-select>
         </el-form-item>
         <el-form-item label="数据采集时间" prop="time">
-          <el-date-picker clearable
+          <el-date-picker
+            clearable
             v-model="form.time"
             type="date"
             value-format="yyyy-MM-dd"
-            placeholder="请选择数据采集时间">
+            placeholder="请选择数据采集时间"
+          >
           </el-date-picker>
         </el-form-item>
       </el-form>
@@ -208,11 +269,17 @@
 </template>
 
 <script>
-import { listWifiInfo, getWifiInfo, delWifiInfo, addWifiInfo, updateWifiInfo } from "@/api/biz/wifiInfo";
+import {
+  listWifiInfo,
+  getWifiInfo,
+  delWifiInfo,
+  addWifiInfo,
+  updateWifiInfo,
+} from "@/api/biz/wifiInfo";
 
 export default {
   name: "WifiInfo",
-  dicts: ['sys_yes_no'],
+  dicts: ["sys_yes_no"],
   data() {
     return {
       // 遮罩层
@@ -245,23 +312,25 @@ export default {
         authPage: null,
         isIllegal: null,
         keyType: null,
-        time: null
+        time: null,
       },
       // 表单参数
       form: {},
       // 表单校验
-      rules: {
-      }
+      rules: {},
     };
   },
   created() {
     this.getList();
   },
   methods: {
+    handleAuth(){
+      
+    },
     /** 查询WIFI信息列表 */
     getList() {
       this.loading = true;
-      listWifiInfo(this.queryParams).then(response => {
+      listWifiInfo(this.queryParams).then((response) => {
         this.wifiInfoList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -284,7 +353,7 @@ export default {
         authPage: null,
         isIllegal: null,
         keyType: null,
-        time: null
+        time: null,
       };
       this.resetForm("form");
     },
@@ -300,9 +369,9 @@ export default {
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.wifiInfoId)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
+      this.ids = selection.map((item) => item.wifiInfoId);
+      this.single = selection.length !== 1;
+      this.multiple = !selection.length;
     },
     /** 新增按钮操作 */
     handleAdd() {
@@ -313,8 +382,8 @@ export default {
     /** 修改按钮操作 */
     handleUpdate(row) {
       this.reset();
-      const wifiInfoId = row.wifiInfoId || this.ids
-      getWifiInfo(wifiInfoId).then(response => {
+      const wifiInfoId = row.wifiInfoId || this.ids;
+      getWifiInfo(wifiInfoId).then((response) => {
         this.form = response.data;
         this.open = true;
         this.title = "修改WIFI信息";
@@ -322,16 +391,16 @@ export default {
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
+      this.$refs["form"].validate((valid) => {
         if (valid) {
           if (this.form.wifiInfoId != null) {
-            updateWifiInfo(this.form).then(response => {
+            updateWifiInfo(this.form).then((response) => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
               this.getList();
             });
           } else {
-            addWifiInfo(this.form).then(response => {
+            addWifiInfo(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
               this.getList();
@@ -343,19 +412,27 @@ export default {
     /** 删除按钮操作 */
     handleDelete(row) {
       const wifiInfoIds = row.wifiInfoId || this.ids;
-      this.$modal.confirm('是否确认删除WIFI信息编号为"' + wifiInfoIds + '"的数据项?').then(function() {
-        return delWifiInfo(wifiInfoIds);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+      this.$modal
+        .confirm('是否确认删除WIFI信息编号为"' + wifiInfoIds + '"的数据项?')
+        .then(function () {
+          return delWifiInfo(wifiInfoIds);
+        })
+        .then(() => {
+          this.getList();
+          this.$modal.msgSuccess("删除成功");
+        })
+        .catch(() => {});
     },
     /** 导出按钮操作 */
     handleExport() {
-      this.download('biz/wifiInfo/export', {
-        ...this.queryParams
-      }, `wifiInfo_${new Date().getTime()}.xlsx`)
-    }
-  }
+      this.download(
+        "biz/wifiInfo/export",
+        {
+          ...this.queryParams,
+        },
+        `wifiInfo_${new Date().getTime()}.xlsx`
+      );
+    },
+  },
 };
 </script>