ソースを参照

视频库优化

pansl 2 年 前
コミット
b18953fcc0
3 ファイル変更14 行追加12 行削除
  1. 1 1
      src/layout/components/header/index.vue
  2. 11 9
      src/views/videoManage/index.vue
  3. 2 2
      vite.config.js

+ 1 - 1
src/layout/components/header/index.vue

@@ -85,7 +85,7 @@ const appChange = (e) => {
   let timer = setTimeout(() => {
     location.reload()
     clearTimeout(timer)
-  }, 50)
+  }, 500)
   searchMenuVisiable.value = false
 }
 

+ 11 - 9
src/views/videoManage/index.vue

@@ -23,7 +23,7 @@
       <Operate :show="open" v-action="'video.video.add'" />
       <el-table :data="tableData" class="mt-3" v-loading="loading" @selection-change="handleSelectionChange">
         <el-table-column type="selection" width="55" />
-        <el-table-column type="index" width="100" label="剧号" />
+        <el-table-column prop="id" width="100" label="剧号" />
         <el-table-column label="封面" width="200" show-overflow-tooltip>
           <template #default="scope">
             <div class="flex flex-col items-center justify-center wrapper">
@@ -119,7 +119,7 @@
     <Dialog v-model="uploadVisible" width="50%" title="上传视频" destroy-on-close>
       <uploadVideo @close="closeType('uploadVisible')" :primary="uploadData"></uploadVideo>
     </Dialog>
-    <Dialog v-action="'video.episode.list'" v-model="videoDetailVisible" width="50%" title="短剧详情" destroy-on-close>
+    <Dialog v-action="'video.video.list'" v-model="videoDetailVisible" width="50%" title="短剧详情" destroy-on-close>
       <videoDetail @close="closeType('videoDetailVisible')" :primary="videoDetailData"></videoDetail>
     </Dialog>
   </div>
@@ -141,11 +141,11 @@ import { shortcuts } from '@/utils/shortcuts';
 import moment from 'moment';
 import { videoStockVideoUpdate, videoStockVideoAdd, videoStockVideoCategoryList } from '@/api/video/index'
 import { useUserStore } from '@/stores/modules/user/index'
-
+import Cache from '@/support/cache';
 const ismulSet = ref(false)
 const api = 'videoStock/video/list';
 const addApi = 'contentManage/book/edit_author';
-const multipleSelection = reactive([]);
+const multipleSelection = ref([]);
 const { data, query, search, reset, loading } = useGetList(api);
 const { deleted } = useDestroy();
 const uploadBooksVisible = ref(false)
@@ -164,7 +164,6 @@ const cooperations = ref([]);
 
 
 const userStore = useUserStore()
-console.log('userStore', userStore.roles);
 
 const handleCascaderChange = (val: any) => {
   console.log(val, 'valval');
@@ -222,7 +221,7 @@ const { open, close, title, visible, id } = useOpen();
 
 const handleSelectionChange = (val: []) => {
   console.log(toRaw(val));
-  multipleSelection = val;
+  multipleSelection.value = val;
 };
 
 const closeType = (type) => {
@@ -245,7 +244,7 @@ const closeType = (type) => {
 }
 
 const mulSet = () => {
-  if (multipleSelection.length <= 0) {
+  if (multipleSelection.value.length <= 0) {
     return ElMessage.warning({
       message: '至少选择一条数据',
       type: 'warning'
@@ -258,7 +257,7 @@ const mulSet = () => {
         h(
           'span',
           { style: 'color:red' },
-          multipleSelection.map(el => el.name).join(',')
+          multipleSelection.value.map(el => el.name).join(',')
         ),
         h('span', null, `吗?`)
       ]),
@@ -269,7 +268,7 @@ const mulSet = () => {
       beforeClose: (action, instance, done) => {
         if (action === 'confirm') {
           ismulSet.value = true
-          let ids = multipleSelection.map(el => el.id);
+          let ids = multipleSelection.value.map(el => el.id);
           console.log(ids);
           open(ids);
         }
@@ -280,6 +279,9 @@ const mulSet = () => {
 };
 
 onMounted(() => {
+  if (userStore.getRoles?.some(el => (el?.identify == 'company'))) {
+    query.value.operateUserId = JSON.parse(Cache.get('nav_data'))?.advertiser?.id;
+  }
   initType()
   search();
 });

+ 2 - 2
vite.config.js

@@ -74,9 +74,9 @@ export default defineConfig(({ command, mode }) => {
           // 自动注册图标组件
           IconsResolver({
             enabledCollections: ['ep'] //@iconify-json/ep 是 Element Plus 的图标库
-          })
+          }),
           // 自动导入 Element Plus 组件//dev环境会特别慢加上,build的时候可以放开
-          // ElementPlusResolver()
+          ElementPlusResolver()
         ],
         dirs: ['src/components/', 'src/layout/'],