From a3b4eb017a0f948348ef7732267c7ed0d4bca8c0 Mon Sep 17 00:00:00 2001
From: zhanghua <314079846@qq.com>
Date: 星期二, 12 三月 2024 16:15:27 +0800
Subject: [PATCH] bug修改

---
 src/views/operate/video/index.vue |  165 +++++++++++++++++++++++++++++-------------------------
 1 files changed, 89 insertions(+), 76 deletions(-)

diff --git a/src/views/operate/video/index.vue b/src/views/operate/video/index.vue
index 30d0cf2..0e47a53 100644
--- a/src/views/operate/video/index.vue
+++ b/src/views/operate/video/index.vue
@@ -3,14 +3,7 @@
     <header>
       <div class="headerContent">
         <div class="search">
-          <span>绛涢�夋潯浠�:</span>
-          <div class="option">
-            <el-input
-              v-model="searchContent"
-              placeholder="璇疯緭鍏ュ唴瀹�"
-            ></el-input>
-          </div>
-          <span>涓婁紶鏃堕棿:</span>
+          <span>涓婁紶鏃堕棿锛�</span>
           <div class="option">
             <el-date-picker
                 v-model="datePicked"
@@ -24,10 +17,10 @@
           <div class="findBtn">
             <el-button type="primary" @click="searchVideoList">鏌ヨ</el-button>
           </div>
-          <div class="findBtn">
-            <el-button class="button-addition" type="primary" @click="handleOpera(null, 'create')">娣诲姞瑙嗛</el-button>
-          </div>
         </div>
+        <div class="addBtn">
+            <el-button type="primary" @click="handleOpera(null, 'create')">鏂板</el-button>
+          </div>
       </div>
     </header>
     <main>
@@ -44,11 +37,11 @@
         </div>
         <!-- 鏁版嵁灞曠ず -->
         <el-table
+            border
+            stripe
           ref="multipleTable"
           :header-cell-style="{
-            background: '#06122c',
-            'font-size': '12px',
-            color: '#4b9bb7',
+           'background':'#F5F5F5',
             'font-weight': '650',
             'line-height': '45px',
           }"
@@ -57,8 +50,8 @@
           :row-class-name="tableRowClassName"
           @selection-change="tableChange"
         >
-          <el-table-column type="selection" min-width="5"> </el-table-column>
-          <el-table-column prop="baseId" label="鎵�灞炰簨浠剁紪鍙�" min-width="18">
+          <el-table-column v-show="mystatus == 1" type="selection" min-width="5" :selectable="selectable"> </el-table-column>
+          <el-table-column prop="code" label="鎵�灞炰簨浠剁紪鍙�" min-width="18">
           </el-table-column>
           <el-table-column prop="category" label="闂绫诲埆" min-width="8">
             <template slot-scope="scope">
@@ -85,10 +78,10 @@
             <template slot-scope="scope">
               <div class="operation">
                 <span @click="handleOpera(scope.row, 'view')">鏌ョ湅</span>
-                <span class="line">|</span>
-                <span @click="handleOpera(scope.row, 'update')">淇敼</span>
-                <span class="line">|</span>
-                <span @click="handleDelete(scope.row)">鍒犻櫎</span>
+                <span v-if="mystatus === 2" class="line">|</span>
+                <span v-if="mystatus === 2" @click="handleOpera(scope.row, 'update')">淇敼</span>
+                <span v-if="mystatus === 2" class="line">|</span>
+                <span v-if="mystatus === 2" @click="handleDelete(scope.row)">鍒犻櫎</span>
               </div>
             </template>
           </el-table-column>
@@ -105,12 +98,12 @@
 
         <div class="tools">
           <div class="funs">
-            <div class="funsItem funs-sp">
+            <div class="funsItem funs-sp funs-first">
               <el-checkbox v-model="all" @change="selectAll()"
                 >鍏ㄩ��</el-checkbox
               >
             </div>
-            <div class="funsItem funs-sp">
+            <div class="funsItem funs-sp ">
               <el-checkbox v-model="unsame" @change="disSame(tableData)"
                 >鍙嶉��</el-checkbox
               >
@@ -119,8 +112,6 @@
               <el-select
                 v-model="myIdx"
                 placeholder="鎵归噺鎿嶄綔"
-                @change="selectChange"
-                disabled
               >
                 <el-option
                   v-for="item in options"
@@ -128,6 +119,7 @@
                   :label="item.label"
                   :value="item.value"
                   :disabled="item.disabled"
+                  @click.native="selectChange"
                 >
                 </el-option>
               </el-select>
@@ -155,6 +147,7 @@
 import { CATEGOTY, EVENT_SOURCE } from "@/utils/helper";
 
 export default {
+  name: 'video-upload-page',
   components: { updateInterface },
   data() {
     return {
@@ -178,14 +171,14 @@
           label: "鎵归噺鎿嶄綔",
           disabled: true,
         },
-        {
-          value: 1,
-          label: "鎵归噺鍚敤",
-        },
-        {
-          value: 2,
-          label: "鎵归噺绂佺敤",
-        },
+        // {
+        //   value: 1,
+        //   label: "鎵归噺鍚敤",
+        // },
+        // {
+        //   value: 2,
+        //   label: "鎵归噺绂佺敤",
+        // },
         {
           value: 3,
           label: "鎵归噺鍒犻櫎",
@@ -195,12 +188,12 @@
       typeList: [
         {
           name: "鎽勫儚澶存帹閫�",
-          value: 1,
+          value: "01",
           checked: true,
         },
         {
           name: "鍗曞叺鎺ㄩ��",
-          value: 2,
+          value: "03",
           checked: false,
         },
       ],
@@ -222,13 +215,8 @@
     }
   },
   created() {
-    this.statusArr[0] = 6;
+    this.searchContent = this.typeList.find((item) => item.checked).value;
     this.searchVideoList();
-    this.typeList.forEach((item) => {
-      if (item.checked) {
-        this.statusArr[1] = item.value;
-      }
-    });
   },
   methods: {
     // 椤堕儴涓嬫媺妗�
@@ -238,22 +226,35 @@
     },
     // 鎵归噺鍒犻櫎
     mulDelete(idArr) {
-      videoManagement.deleteVideoRescources({ ids: idArr })
-          .then(() => {
-            this.$message.success('鎿嶄綔鎴愬姛');
-            this.searchVideoList();
-          })
-          .catch(err => {
-            this.$message.error(`${err}`);
-          })
+      this.$confirm("鎮ㄧ‘瀹氳鎵归噺鍒犻櫎瑙嗛鍚�?")
+                .then((_) => {
+                    this.$axios({
+                        method: "delete",
+                        url: "/sccg/video_resources/deletion_batch?ids=" + idArr,
+                    }).then((res) => {
+                        if (res.code === 200) {
+                            this.$message({
+                                type: "success",
+                                message: "鎵归噺鍒犻櫎瑙嗛鎴愬姛",
+                            });
+                            this.searchVideoList();
+                        } else {
+                            this.$message({
+                                type: "error",
+                                message: res.message,
+                            });
+                        }
+                    });
+                })
+                .catch((err) => {
+                    console.log(err);
+                });
     },
     // 鎵ц涓嬫媺妗嗘搷浣�
     selectChange(list) {
       if (this.tempList.length !== 0) {
-        if (list === 3) {
           this.preMyIdx = list;
           this.mulDelete(this.tempList);
-        }
       } else {
         this.myIdx = this.preMyIdx;
         this.$message({
@@ -266,7 +267,7 @@
     tableChange(list) {
       this.tempList = [];
       list.forEach((item) => {
-        this.tempList.push(item.code);
+        this.tempList.push(item.id);
       });
       this.all = list.length === this.tableData.length;
     },
@@ -312,6 +313,8 @@
       });
       this.mystatus = idx + 1;
       this.statusArr[1] = this.typeList[idx].value;
+      this.searchContent = this.typeList[idx].value;
+      this.searchVideoList();
     },
     // 璁剧疆琛ㄦ牸鏂戦┈绾�
     tableRowClassName({ row, rowIndex }) {
@@ -351,7 +354,14 @@
 
     getEventSource(value) {
       return EVENT_SOURCE.find(item => item.value === value);
-    }
+    },
+    selectable(row,index){
+         if(this.mystatus == '1'){
+           return false;//绂佺敤鐘舵��
+         }else{
+           return true;//闈炵鐢ㄧ姸鎬�
+         }
+    },
   },
 };
 </script>
@@ -359,14 +369,14 @@
 <style lang="scss" scoped>
 .userList {
   text-align: left;
-  margin: 10px 20px;
+  padding: 10px 20px;
   color: #4b9bb7;
-
+  border: 1px solid #ccc;
   header {
-    background-color: #09152f;
+    background-color: white;
 
     .headerContent {
-      padding: 0 40px;
+      padding: 0;
       display: flex;
       line-height: 100px;
       justify-content: space-between;
@@ -385,8 +395,8 @@
           color: #1d3f57;
 
           &::v-deep .el-input__inner {
-            background-color: #09152f;
-            border: 1px solid #17324c;
+            // background-color: #09152f;
+            //border: 1px solid #17324c;
           }
         }
       }
@@ -400,26 +410,26 @@
 
         .el-button {
           padding: 12px 25px;
-          border-radius: 20px;
+          //border-radius: 20px;
         }
       }
 
       .addBtn {
-        background-color: #eb5d01;
+        // background-color: #eb5d01;
         border: none;
-        border-radius: 20px;
+        //border-radius: 20px;
         padding: 12px 30px;
       }
     }
   }
 
   &::v-deep .el-input__inner {
-    background-color: #09152f;
-    border: 1px solid #17324c;
+    // background-color: #09152f;
+    //border: 1px solid #17324c;
   }
 
   main {
-    background-color: #09152f;
+    // background-color: #09152f;
     margin-top: 20px;
     padding-bottom: 50px;
 
@@ -430,7 +440,7 @@
     .type-nav {
       display: flex;
       line-height: 40px;
-      margin-left: 30px;
+      //margin-left: 30px;
       padding-top: 10px;
       margin-bottom: 10px;
 
@@ -445,9 +455,10 @@
       }
 
       .is-active {
-        background-color: #070f22;
+        // background-color: #070f22;
         border-radius: 4px;
-        color: #fff;
+            color: #333;
+        font-size: 500;
       }
     }
 
@@ -455,10 +466,12 @@
       display: flex;
       justify-content: space-between;
       align-items: center;
-      padding: 0 20px;
-
+      padding: 0;
+      .funs-first{
+        margin-left: 0!important;
+      }
       .funs-sp {
-        border: 1px solid #17324c;
+        border: 1px solid #DCDFE6;
       }
 
       .funs {
@@ -501,7 +514,7 @@
           &::v-deep li,
           &::v-deep .btn-prev,
           &::v-deep .btn-next {
-            background-color: #071f39;
+            // background-color: #071f39;
             color: #4b9bb7;
           }
 
@@ -514,8 +527,8 @@
     }
 
     .el-table {
-      color: #4b9bb7;
-      font-size: 10px;
+      // color: #4b9bb7;
+      // font-size: 10px;
 
       &::v-deep .cell {
         text-overflow: ellipsis;
@@ -529,7 +542,7 @@
         .line {
           padding: 0 5px;
         }
-
+        color: var(--operation-color);
         span:hover {
           cursor: pointer;
         }
@@ -542,7 +555,7 @@
   }
 
   :deep(.el-range-input) {
-    background-color: #09152f;
+    // background-color: #09152f;
   }
 }
-</style>
\ No newline at end of file
+</style>

--
Gitblit v1.8.0