From f8331485341314c3d0613079d4981887a111568c Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期四, 24 十月 2024 17:20:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 src/views/system/work-order/threshold/index.vue |  252 +++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 225 insertions(+), 27 deletions(-)

diff --git a/src/views/system/work-order/threshold/index.vue b/src/views/system/work-order/threshold/index.vue
index 412791e..6e2d5af 100644
--- a/src/views/system/work-order/threshold/index.vue
+++ b/src/views/system/work-order/threshold/index.vue
@@ -13,8 +13,8 @@
     <!--        </el-button>-->
     <!--      </el-col>-->
     <!--    </el-row>-->
-    <div style="display: flex;overflow-x: auto;" >
-      <div>
+    <el-row>
+      <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
         <el-card style="margin-bottom: 20px; height: 350px; margin-right: 20px;color: #656565;">
           <div style="display: flex; justify-content: space-between">
             <div class="header鈥攖ext">瑙嗛</div>
@@ -102,8 +102,8 @@
             </div>
           </div>
         </el-card>
-      </div>
-      <div>
+      </el-col>
+      <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
         <el-card style="margin-bottom: 20px; height: 350px; margin-right: 20px;color: #656565;">
           <div style="display: flex; justify-content: space-between">
             <div class="header鈥攖ext">浜鸿劯</div>
@@ -191,9 +191,9 @@
               </div>
             </div>
           </div>
-        </el-card></div
+        </el-card></el-col
       >
-      <div>
+      <el-col :xs="24" :sm="24" :md="12" :lg="12" :xl="8">
         <el-card style="margin-bottom: 20px; height: 350px; margin-right: 20px;color: #656565;">
           <div style="display: flex; justify-content: space-between">
             <div class="header鈥攖ext">杞﹁締</div>
@@ -280,8 +280,105 @@
               </div>
             </div>
           </div>
-        </el-card></div>
-    </div>
+        </el-card></el-col
+      >
+    </el-row>
+    <el-row class="content-warp">
+      <div class="header鈥攖ext" style="margin-bottom: 5px">宸ュ崟鐧藉悕鍗�</div>
+      <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
+        <el-form-item label="璁惧缂栫爜" prop="serialNumber">
+          <el-input
+            v-model="queryParams.serialNumber"
+            placeholder="璁惧缂栫爜"
+            clearable
+            @keyup.enter.native="getWhiteList"
+            @clear="getWhiteList"
+          />
+        </el-form-item>
+        <el-form-item label="鐐逛綅鍚嶇О" prop="pointName">
+          <el-input
+            v-model="queryParams.pointName"
+            placeholder="鐐逛綅鍚嶇О"
+            clearable
+            @keyup.enter.native="getWhiteList"
+            @clear="getWhiteList"
+          />
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" icon="el-icon-search" size="small" @click="getWhiteList">鎼滅储</el-button>
+        </el-form-item>
+      </el-form>
+    </el-row>
+    <el-row class="content-warp">
+      <el-button size="small" type="success" @click="addOpen" plain>鏂板</el-button>
+      <el-button size="small" type="danger" @click="bathDelete" plain>鍒犻櫎</el-button>
+      <el-popover style="margin-left: 10px" placement="bottom" trigger="hover" content="瀵煎叆鐐逛綅">
+        <div class="bottom_">
+          <p>瀵煎叆鐐逛綅鍙仛鏂板鎿嶄綔</p>
+        </div>
+        <div class="bottom_">
+          <el-upload
+            ref="upload"
+            class="upload-demo"
+            drag
+            :action="importUrl"
+            :file-list="fileList"
+            :before-upload="beforeUpload"
+          >
+            <i class="el-icon-upload"></i>
+            <div class="el-upload__text">灏嗘枃浠舵嫋鍒版澶勶紝鎴�<em>鐐瑰嚮涓婁紶</em></div>
+            <div class="el-upload__tip" slot="tip">鍙兘涓婁紶xls/xlsx鏂囦欢</div>
+          </el-upload>
+        </div>
+        <div>
+          <el-button class="bottom_" type="primary" size="small" v-loading="upload" @click="handleImport"
+                     v-hasPermi="['point:import']">瀵煎叆</el-button>
+        </div>
+        <el-button type="primary" size="small" plain icon="el-icon-bottom" slot="reference" v-hasPermi="['point:import']">瀵煎叆鐧藉悕鍗�</el-button>
+      </el-popover>
+    </el-row>
+    <el-row class="content-warp">
+      <el-col :span="24">
+        <el-table v-loading="loading" :data="workOrderWhiteList" @selection-change="handleSelectionChange">
+          <el-table-column type="selection" width="55" align="center" prop="id"/>
+          <el-table-column label="璁惧缂栫爜" align="center" prop="serialNumber"/>
+          <el-table-column label="鐐逛綅鍚嶇О" align="center" prop="pointName"/>
+          <el-table-column label="鍒涘缓浜�" align="center" prop="createBy"/>
+          <el-table-column label="澶囨敞" align="center" prop="remark"/>
+        </el-table>
+
+        <pagination
+          v-show="total>0"
+          :total="total"
+          :page.sync="queryParams.pageNum"
+          :limit.sync="queryParams.pageSize"
+          @pagination="getWhiteList"
+        />
+      </el-col>
+    </el-row>
+
+<!--    鏂板鐧藉悕鍗�-->
+    <el-dialog
+      title="鏂板鐧藉悕鍗�"
+      :visible.sync="addShow"
+      width="500px"
+      :close-on-click-modal="false"
+      :before-close="addClose">
+      <div>
+        <el-form :model="addForm" label-position="top" :rules="addFormRules" ref="addForm" size="small">
+          <el-form-item label="璁惧缂栫爜" prop="serialNumber">
+            <el-input v-model="addForm.serialNumber"></el-input>
+          </el-form-item>
+          <el-form-item label="澶囨敞淇℃伅" prop="remark">
+            <el-input v-model="addForm.remark"></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="addClose">鍙� 娑�</el-button>
+        <el-button type="primary" @click="addSubmit">鏂� 澧�</el-button>
+      </span>
+    </el-dialog>
   </div>
 </template>
 
@@ -290,6 +387,7 @@
   listThreshold,
   getThreshold,
   updateThreshold,
+  importData,
 } from "@/api/platform/threshold";
 import {
   editCar,
@@ -298,6 +396,12 @@
   getFace,
   getVideo,
 } from "../../../../api/platform/threshold";
+
+import {
+  getWhiteList,
+  addWhiteList,
+  bathDelete,
+} from "@/api/platform/work-order";
 
 export default {
   dicts: ["image_qualify", "video_qualify"],
@@ -336,6 +440,8 @@
         pageNum: 1,
         pageSize: 10,
         monitorType: null,
+        serialNumber: null,
+        pointName: null,
       },
       // 琛ㄥ崟鍙傛暟
       videoForm: {},
@@ -344,48 +450,48 @@
       // 琛ㄥ崟鏍¢獙
       faceRules: {
         monitorType: [
-          { required: true, message: "璁惧绫诲瀷涓嶈兘涓虹┖", trigger: "change" },
+          {required: true, message: "璁惧绫诲瀷涓嶈兘涓虹┖", trigger: "change"},
         ],
         captureNum: [
-          { required: true, message: "璇峰~鍐欐姄鎷嶉噺", trigger: "blur" },
+          {required: true, message: "璇峰~鍐欐姄鎷嶉噺", trigger: "blur"},
         ],
         timelyRate: [
-          { required: true, message: "璇峰~鍐欏強鏃剁巼", trigger: "blur" },
+          {required: true, message: "璇峰~鍐欏強鏃剁巼", trigger: "blur"},
         ],
         delayAmount: [
-          { required: true, message: "璇峰~鍐欏欢杩熼噺", trigger: "blur" },
+          {required: true, message: "璇峰~鍐欏欢杩熼噺", trigger: "blur"},
         ],
         deviceActiveRate: [
-          { required: true, message: "璇峰~鍐欒澶囨椿璺冪巼", trigger: "blur" },
+          {required: true, message: "璇峰~鍐欒澶囨椿璺冪巼", trigger: "blur"},
         ],
         timeAccuracy: [
-          { required: true, message: "璇峰~鍐欐椂閽熷噯纭巼", trigger: "blur" },
+          {required: true, message: "璇峰~鍐欐椂閽熷噯纭巼", trigger: "blur"},
         ],
         timelyCapture: [
-          { required: true, message: "璇峰~鍐欐姄鎷嶅強鏃剁巼", trigger: "blur" },
+          {required: true, message: "璇峰~鍐欐姄鎷嶅強鏃剁巼", trigger: "blur"},
         ],
       },
       carRules: {
         monitorType: [
-          { required: true, message: "璁惧绫诲瀷涓嶈兘涓虹┖", trigger: "change" },
+          {required: true, message: "璁惧绫诲瀷涓嶈兘涓虹┖", trigger: "change"},
         ],
         passCarNum: [
-          { required: true, message: "璇峰~鍐欒繃杞︽暟鎹噺", trigger: "blur" },
+          {required: true, message: "璇峰~鍐欒繃杞︽暟鎹噺", trigger: "blur"},
         ],
         passCarMissRate: [
-          { required: true, message: "璇峰~鍐欒繃杞︾己澶辩巼", trigger: "blur" },
+          {required: true, message: "璇峰~鍐欒繃杞︾己澶辩巼", trigger: "blur"},
         ],
         passCarEffectiveNum: [
-          { required: true, message: "璇峰~鍐欐湁鏁堣繃杞︽暟鎹噺", trigger: "blur" },
+          {required: true, message: "璇峰~鍐欐湁鏁堣繃杞︽暟鎹噺", trigger: "blur"},
         ],
         timelyCapture: [
-          { required: true, message: "璇峰~鍐欐姄鎷嶅強鏃剁巼", trigger: "blur" },
+          {required: true, message: "璇峰~鍐欐姄鎷嶅強鏃剁巼", trigger: "blur"},
         ],
         deviceActiveRate: [
-          { required: true, message: "璇峰~鍐欒澶囨椿璺冪巼", trigger: "blur" },
+          {required: true, message: "璇峰~鍐欒澶囨椿璺冪巼", trigger: "blur"},
         ],
         timeAccuracy: [
-          { required: true, message: "璇峰~鍐欐椂閽熷噯纭巼", trigger: "blur" },
+          {required: true, message: "璇峰~鍐欐椂閽熷噯纭巼", trigger: "blur"},
         ],
       },
       rules: {
@@ -397,19 +503,39 @@
           },
         ],
         videoQuality: [
-          { required: true, message: "璇烽�夋嫨瑙嗛璐ㄩ噺闃堝��", trigger: "change" },
+          {required: true, message: "璇烽�夋嫨瑙嗛璐ㄩ噺闃堝��", trigger: "change"},
         ],
         imageQuality: [
-          { required: true, message: "璇烽�夋嫨鍥惧儚璐ㄩ噺闃堝��", trigger: "change" },
+          {required: true, message: "璇烽�夋嫨鍥惧儚璐ㄩ噺闃堝��", trigger: "change"},
         ],
         annotationAccuracy: [
-          { required: true, message: "璇峰~鍐欐爣娉ㄥ噯纭巼闃堝��", trigger: "blur" },
+          {required: true, message: "璇峰~鍐欐爣娉ㄥ噯纭巼闃堝��", trigger: "blur"},
         ],
       },
+      // 鐧藉悕鍗曞垪琛�
+      workOrderWhiteList: [],
+      // 鏂板妗�
+      addShow: false,
+      addForm: {
+        serialNumber: "",
+        remark: "",
+      },
+      // 鏂板妗嗘牎楠�
+      addFormRules: {
+        serialNumber: [
+          {required: true, message: "璁惧缂栫爜涓嶈兘涓虹┖", trigger: "blur"},
+        ],
+      },
+      // 瀵煎叆鏂囦欢璺緞
+      importUrl: '',
+      fileList: [],
+      importFile: null,
+      upload: false,
     };
   },
   created() {
     this.getList();
+    this.getWhiteList();
   },
   methods: {
     showEdit(value) {
@@ -502,6 +628,14 @@
         this.videoList = JSON.parse(JSON.stringify(this.thresholdList.video));
         this.faceList = JSON.parse(JSON.stringify(this.thresholdList.face));
         this.carList = JSON.parse(JSON.stringify(this.thresholdList.car));
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+    getWhiteList() {
+      this.loading = true;
+      getWhiteList(this.queryParams).then((response) => {
+        this.workOrderWhiteList = response.data;
         this.total = response.total;
         this.loading = false;
       });
@@ -657,7 +791,8 @@
           this.getList();
           this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
         })
-        .catch(() => {});
+        .catch(() => {
+        });
     },
     /** 鍒囨崲涓嶅悓鎸囨爣 */
     handleModeNameChange() {
@@ -748,7 +883,67 @@
         ];
       }
     },
-  },
+    // 鎵撳紑鏂板妗�
+    addOpen() {
+      this.addShow = true;
+    },
+    // 鍏抽棴鏂板妗�
+    addClose() {
+      this.addShow = false;
+      this.addReset();
+    },
+    // 鏂板妗嗘彁浜�
+    addSubmit() {
+      this.$refs["addForm"].validate((valid) => {
+        if (valid) {
+          addWhiteList(this.addForm).then((response) => {
+            this.$modal.msgSuccess("鏂板鎴愬姛");
+            this.addShow = false;
+            this.getWhiteList();
+            this.addReset();
+          });
+        }
+      });
+    },
+    // 鏂板妗嗛噸缃�
+    addReset() {
+      this.addForm = {
+        serialNumber: "",
+        remark: "",
+      };
+    },
+    // 澶氶�夋閫変腑鏁版嵁
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length !== 1
+      this.multiple = !selection.length
+    },
+    // 鎵归噺鍒犻櫎
+    bathDelete() {
+      bathDelete(this.ids).then(() => {
+        this.getWhiteList();
+        this.$modal.msgSuccess("鎵归噺鍒犻櫎鎴愬姛");
+        this.ids = [];
+      })
+    },
+    beforeUpload(file) {
+      this.importFile = file
+      this.fileList = [file]
+      return false
+    },
+    // 瀵煎叆鐧藉悕鍗�
+    handleImport() {
+      this.upload = true;
+      let formData = new FormData()
+      formData.append("file", this.importFile)
+      importData(formData).then(res => {
+        this.$message.success("瀵煎叆鎴愬姛")
+        this.upload = false
+        this.fileList = []
+        this.getWhiteList()
+      })
+    }
+  }
 };
 </script>
 <style scoped>
@@ -785,4 +980,7 @@
   margin-left: 5px;
   display: inline-block;
 }
+.content-warp {
+  margin-top: 10px;
+}
 </style>

--
Gitblit v1.8.0