From e1aa0ecffbabd618c71e4ad94370fb8dffe6ee1c Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期日, 21 一月 2024 20:54:49 +0800
Subject: [PATCH] 优化

---
 src/views/operate/fivepack/threepack/components/content.vue |  187 ++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 171 insertions(+), 16 deletions(-)

diff --git a/src/views/operate/fivepack/threepack/components/content.vue b/src/views/operate/fivepack/threepack/components/content.vue
index d399d6b..eaf9c3b 100644
--- a/src/views/operate/fivepack/threepack/components/content.vue
+++ b/src/views/operate/fivepack/threepack/components/content.vue
@@ -6,7 +6,7 @@
           <div class="search-item">
             <span>杈撳叆鏌ヨ:</span>
             <el-input
-              style="flex: 1"
+              style="flex: 1; margin-left: 15px"
               :placeholder="
                 isStorePage() ? '搴楅摵锛堥棬搴楋級鍚嶇О' : '璇疯緭鍏ュ簵閾虹紪鍙�'
               "
@@ -15,7 +15,11 @@
           </div>
           <div class="search-item">
             <span>搴楅摵鐘舵��:</span>
-            <el-select v-model="storeStatus" placeholder="閫夋嫨搴楅摵鐘舵��">
+            <el-select
+              v-model="storeStatus"
+              style="margin-left: 15px"
+              placeholder="閫夋嫨搴楅摵鐘舵��"
+            >
               <el-option
                 v-for="item in options"
                 :key="item.value"
@@ -57,6 +61,7 @@
         :data="tableData"
         style="width: 100%"
         :row-class-name="tableRowClassName"
+        @selection-change="tableChange"
       >
         <el-table-column type="selection" min-width="5"> </el-table-column>
         <el-table-column prop="storeNumber" label="搴楅摵缂栧彿" min-width="10">
@@ -73,8 +78,8 @@
           min-width="10"
         >
         </el-table-column>
-        <el-table-column prop="storeScore" label="搴楅摵绉垎" min-width="10">
-        </el-table-column>
+        <!-- <el-table-column prop="storeScore" label="搴楅摵绉垎" min-width="10">
+        </el-table-column> -->
         <el-table-column prop="videoPoint" label="鍏宠仈鎽勫儚鏈�" min-width="10">
           <template v-if="scope.row.videoId" slot-scope="scope">
             <span>{{ scope.row.videoPoint.name }}</span>
@@ -253,18 +258,57 @@
           </el-form>
         </div>
       </el-dialog>
-      <!-- 鍒嗛〉 -->
-      <div class="pagination">
-        <el-pagination
-          background
-          :current-page="currentPage"
-          layout="prev, pager, next"
-          :total="totalNum"
-          :page-size="pageSize"
-          @current-change="changeCurrentPage"
-        >
-        </el-pagination>
+      <div class="tools">
+        <div class="funs">
+          <div class="funsItem">
+            <el-checkbox v-model="all" @change="selectAll()">鍏ㄩ��</el-checkbox>
+          </div>
+          <div class="funsItem">
+            <el-checkbox v-model="unsame" @change="disSame(tableData)"
+              >鍙嶉��</el-checkbox
+            >
+          </div>
+          <div class="funsItem">
+            <el-select
+              v-model="myIdx"
+              placeholder="鎵归噺鎿嶄綔"
+              @change="selectChange"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+                :disabled="item.disabled"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </div>
+        <div class="pagination">
+          <el-pagination
+            background
+            :current-page="currentPage"
+            layout="prev, pager, next"
+            :total="totalNum"
+            :page-size="pageSize"
+            @current-change="changeCurrentPage"
+          >
+          </el-pagination>
+        </div>
       </div>
+      <!-- 鍒嗛〉 -->
+      <!--      <div class="pagination">-->
+      <!--        <el-pagination-->
+      <!--          background-->
+      <!--          :current-page="currentPage"-->
+      <!--          layout="prev, pager, next"-->
+      <!--          :total="totalNum"-->
+      <!--          :page-size="pageSize"-->
+      <!--          @current-change="changeCurrentPage"-->
+      <!--        >-->
+      <!--        </el-pagination>-->
+      <!--      </div>-->
     </main>
   </div>
 </template>
@@ -297,6 +341,10 @@
       }
     };
     return {
+      tempList: [],
+      myIdx: 0,
+      all: false,
+      unsame: false,
       storeCode: null,
       storeStatus: null,
       options: [
@@ -314,6 +362,9 @@
       dialogType: "",
       isShowDialog: false,
       storeInfo: null,
+      all: false,
+      unsame: false,
+      myIdx: null,
       storeInfoScoreView: {},
       role: {
         messageType: "",
@@ -358,6 +409,51 @@
   },
 
   methods: {
+    // 鐩戝惉琛ㄦ牸閫変腑鐘舵��
+    tableChange(list) {
+      this.tempList = list;
+      this.all = list.length === this.tableData.length;
+    },
+    // 鎵归噺鍒犻櫎
+    mulDelete(idArr) {
+      this.$axios({
+        method: "delete",
+        url: "sccg/illegal_building/batch_delete?ids=" + idArr,
+      }).then((res) => {
+        this.getUserList();
+        this.$message({
+          message: res.message,
+          type: res.code === 200 ? "success" : "warning",
+        });
+      });
+    },
+    // 鎵ц涓嬫媺妗嗘搷浣�
+    selectChange(val) {
+      let ids = [];
+      this.tempList.forEach((item) => {
+        ids.push(item.number);
+      });
+      if (ids.length !== 0) {
+        if (val === 3) {
+          this.mulDelete(ids);
+        }
+      } else {
+        this.$message({
+          type: "warning",
+          message: "鎮ㄨ繕娌¢�変腑浠讳綍鏁版嵁",
+        });
+      }
+    },
+    // 鍏ㄩ��
+    selectAll() {
+      this.$refs.multipleTable.toggleAllSelection();
+    },
+    // 鍙嶉��
+    disSame(list) {
+      list.forEach((row) => {
+        this.$refs.multipleTable.toggleRowSelection(row);
+      });
+    },
     // 鏂板缓/淇濆瓨娑堟伅(1:鏂板缓,0淇濆瓨娑堟伅)
     handleSubmit(mystatus) {
       this.role.body = this.$refs.edit.editor.txt.html();
@@ -426,7 +522,6 @@
       getStoreInfoList({ keyword: this.storeCode, status })
         .then(({ list, pageSize, totalPage }) => {
           this.tableData = list;
-          console.log(list);
           this.pageSize = pageSize;
           this.totalNum = totalPage;
         })
@@ -623,7 +718,67 @@
     .mainTitle {
       line-height: 60px;
     }
+    .tools {
+      display: flex;
+      justify-content: space-between;
+      align-items: center;
+      padding: 0 20px;
 
+      .funs {
+        display: flex;
+
+        .funsItem {
+          line-height: 28px;
+          display: flex;
+          align-items: center;
+          border: 1px solid #ccc;
+          border-radius: 4px;
+          font-size: 12px;
+          margin-left: 10px;
+
+          .el-checkbox {
+            width: 80px;
+            padding: 0 10px;
+          }
+
+          .el-select {
+            width: 120px;
+          }
+          &::v-deep .el-input__inner {
+            border: none;
+            // background-color: #09152f;
+          }
+          &:hover {
+            border: 1px solid #4b9bb7;
+          }
+
+          &:hover .el-checkbox {
+            color: #4b9bb7;
+          }
+        }
+      }
+
+      .pagination {
+        margin-top: 50px;
+        display: flex;
+        line-height: 50px;
+        justify-content: center;
+
+        .el-pagination {
+          &::v-deep li,
+          &::v-deep .btn-prev,
+          &::v-deep .btn-next {
+            // background-color: #071f39;
+            color: #4b9bb7;
+          }
+
+          &::v-deep .active {
+            background-color: #409eff;
+            color: #fff;
+          }
+        }
+      }
+    }
     .el-link {
       color: #4b9bb7;
     }

--
Gitblit v1.8.0