Bladeren bron

小程序管理动态权限等

pansl 1 jaar geleden
bovenliggende
commit
bcefaa66d3

+ 0 - 20
src/router/modules/applet.ts

@@ -1,20 +0,0 @@
-import { RouteRecordRaw } from 'vue-router';
-// eslint-disable-next-line @typescript-eslint/ban-ts-comment
-// @ts-ignore
-const router: RouteRecordRaw[] = [
-  {
-    path: '/applet',
-    component: () => import('@/layout/index.vue'),
-    meta: { title: '小程序管理', icon: 'user' },
-    children: [
-      {
-        path: 'applet',
-        name: 'applet-account',
-        meta: { title: '小程序管理', icon: 'home' },
-        component: () => import('@/views/appletManage/index.vue')
-      }
-    ]
-  }
-];
-
-export default router;

+ 1 - 2
src/views/appletManage/form/create.vue

@@ -23,7 +23,7 @@
           <el-input v-model="formData.appsecret" clearable size="large" placeholder="请输入APP 密钥" />
         </el-form-item>
         <el-form-item label="状态" prop="status">
-          <el-switch v-model="formData.status" :active-value="1" :inactive-value="2" />
+          <el-switch v-model="formData.status" :active-value="1" :inactive-value="0" />
         </el-form-item>
         <el-form-item label="备注" prop="remark">
           <el-tooltip placement="top">
@@ -138,7 +138,6 @@ if (props.primary) {
 }
 
 const emit = defineEmits(['close']);
-const cpList = ref();
 onMounted(() => {
   initAppletType()
 });

+ 6 - 16
src/views/appletManage/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="flex flex-col justify-between w-full sm:flex-row">
-    <div :class="hasRoles ? 'w-full ml-0 sm:ml-2 mt-2 sm:mt-0' : 'w-full'">
+    <div class="w-full">
       <Search :search="search" :reset="reset">
         <template v-slot:body>
           <el-form-item label="小程序名称">
@@ -15,7 +15,7 @@
         </template>
       </Search>
       <div class="table-default">
-        <Operate :show="open" />
+        <Operate :show="open" v-action="'manage.MinprogramManage.MinprogramManageAdd'" />
         <el-table :data="tableData" class="mt-3" v-loading="loading">
           <el-table-column prop="id" label="ID" />
           <el-table-column prop="name" label="小程序名称">
@@ -33,12 +33,13 @@
           <el-table-column prop="type_name" label="类型" />
           <el-table-column label="操作" width="200">
             <template #default="scope">
-              <el-button link type="primary" size="small" @click="opendepots(scope.row)">分配</el-button>
-              <el-button link type="primary" size="small" @click="open(scope.row.id)">编辑</el-button>
+              <el-button link type="primary" size="small" @click="opendepots(scope.row)"
+                v-action="'manage.MinprogramManage.MinprogramManageAllocation'">分配</el-button>
+              <el-button link type="primary" size="small" @click="open(scope.row.id)"
+                v-action="'manage.MinprogramManage.MinprogramManageEdit'">编辑</el-button>
             </template>
           </el-table-column>
         </el-table>
-
         <Paginate />
       </div>
       <Dialog width="800px" v-model="depotsVisible" title="分配" destroy-on-close>
@@ -57,28 +58,17 @@ import { computed, onMounted, ref } from 'vue';
 import Create from './form/create.vue';
 import depotsTransfer from './form/depotsTransfer.vue';
 import { useGetList } from '@/hook/curd/useGetList';
-import { useDestroy } from '@/hook/curd/useDestroy';
 import { useOpen } from '@/hook/curd/useOpen';
-import Department from './components/department.vue';
-import { useUserStore } from '@/stores/modules/user';
-import { isUndefined } from '@/support/helper';
-import { manageMiniprogramIndex } from '@/api/applet/index'
-
-const userStore = useUserStore();
-const applet = ref([{ id: 1, name: '微信', value: 'wx' }, { id: 2, name: '抖音', value: 'dy' }])
 
 const api = '/manage/miniprogram/index';
 const depotsVisible = ref(false)
 const depotsData = ref({})
 
 const { data, query, search, reset, loading } = useGetList(api);
-const { destroy, deleted } = useDestroy();
 const { open, close, title, visible, id } = useOpen();
 
 const tableData = computed(() => data.value?.data);
 
-const roles = ref<Array<Object>>();
-const hasRoles = ref<boolean>(false);
 
 const opendepots = (data) => {
   depotsVisible.value = true

+ 0 - 12
src/views/videoManage/form/create.vue

@@ -69,10 +69,7 @@
 
 <script lang="ts" setup>
 import { InfoFilled } from '@element-plus/icons-vue';
-import { useCreate } from '@/hook/curd/useCreate';
-import { useShow } from '@/hook/curd/useShow';
 import { cpManageCpList, cpOptions } from '@/api/cp/index'
-import { advertiserGetAdvertiser, advertiserAdd, advertiserUpdateAdvertiser } from '@/api/advertiser/index'
 import { videoStockVideoUpdate, videoStockVideoAdd, videoStockVideoCategoryList } from '@/api/video/index'
 import type { FormInstance, FormRules } from 'element-plus'
 const ruleForm = ref<FormInstance>()
@@ -150,15 +147,6 @@ const rules = reactive({
 });
 const selectType = ref([])
 const loading = ref(false)
-const typeChange = (e) => {
-  console.log(e, 'typeChangetypeChange');
-  formData.value.category_id = ''
-  if (e == 1) {
-    categoryList.value = cooperations.value.length > 0 ? cooperations.value[0]?.list : []
-  } else if (e == 2) {
-    categoryList.value = cooperations.value.length > 0 ? cooperations.value[1]?.list : []
-  }
-}
 const handleCascaderChange = (val: any) => {
   console.log(val, 'valval');
   if (val) {

+ 0 - 2
src/views/videoManage/form/subscribeSet.vue

@@ -29,8 +29,6 @@
 
 <script lang="ts" setup>
 import { InfoFilled } from '@element-plus/icons-vue';
-import { useCreate } from '@/hook/curd/useCreate';
-import { useShow } from '@/hook/curd/useShow';
 import { videoStockVideoSetChargeConfig } from '@/api/video/index'
 import type { FormInstance, FormRules } from 'element-plus'
 const ruleForm = ref<FormInstance>()

+ 0 - 1
src/views/videoManage/form/uploadVideo.vue

@@ -25,7 +25,6 @@
 import { FormInstance } from 'element-plus';
 import { InfoFilled } from '@element-plus/icons-vue';
 import { videoStockEpisodeAdd } from '@/api/video/index'
-import { defineComponent, inject } from 'vue'
 const props = defineProps({
   primary: String | Number,
 });

+ 4 - 2
src/views/videoManage/form/videoDL.vue

@@ -9,8 +9,10 @@
       <div class="flex items-center justify-between h-10">
         <div class="text-base font-medium">剧名: <span class="ml-2 text-lg font-bold text-dark-600">{{
           props.primary.name }}</span></div>
-        <download v-if="videoChoose.length > 0" :urls="videoChooseUrls" :fileName="props.primary.name"></download>
-        <!-- <div v-if="videoChoose.length > 0"><el-button type="primary" size="default">下载</el-button></div> -->
+        <el-tooltip placement="top">
+          <template #content> 如需批量下载,则多选目标集数,点击下载按钮即可<br /> </template>
+          <download v-if="videoChoose.length > 0" :urls="videoChooseUrls" :fileName="props.primary.name"></download>
+        </el-tooltip>
       </div>
       <mytabs :meta="meta" v-if="meta.total" @change="handChange">
         <template v-slot:content>

+ 16 - 13
src/views/videoManage/index.vue

@@ -22,11 +22,11 @@
       </div>
       <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 prop="id" width="100" label="剧号" />
-        <el-table-column label="封面" width="200" show-overflow-tooltip>
+        <el-table-column type="selection" />
+        <el-table-column prop="id" label="剧号" />
+        <el-table-column label="封面" show-overflow-tooltip>
           <template #default="scope">
-            <div class="flex flex-col items-center justify-center wrapper">
+            <div class="flex flex-col items-start justify-center wrapper">
               <el-popover placement="top" :width="200" trigger="hover">
                 <template #reference>
                   <el-image :src="scope.row.cover_image" class="cursor-pointer" style="width:48px;height:48px;"
@@ -38,24 +38,24 @@
             </div>
           </template>
         </el-table-column>
-        <el-table-column label="短剧名称" width="250" show-overflow-tooltip>
+        <el-table-column label="短剧名称" show-overflow-tooltip min-width="250">
           <template #default="scope">
             <div class="wrapper">
               <span class="text-lg font-bold text-blue-400 cursor-pointer content"
                 @click="openType('videoDetailVisible', scope.row)">
                 {{ scope.row.name }}
               </span>
-              <span>
+              <span v-if="!rolesIdentify.includes('company')">
                 【 {{ scope.row.update_type_str }} 】
               </span>
             </div>
-            <div class="wrapper">
+            <div class="wrapper" v-if="!rolesIdentify.includes('optimizer')">
               <span class="label">上架时间:</span>
               <span class="content">{{ scope.row.shelf_at }}</span>
             </div>
           </template>
         </el-table-column>
-        <el-table-column prop="total_episode_num" label="集数">
+        <el-table-column prop="total_episode_num" label="集数" v-if="!rolesIdentify.includes('optimizer')">
           <template #default="scope">
             <div class="flex wrapper">
               <div v-if="scope.row.update_type == 1">
@@ -72,15 +72,15 @@
             </div>
           </template>
         </el-table-column>
-        <el-table-column prop="category_str" label="频道" />
-        <el-table-column prop="shelf_type_str" label="上架状态" />
-        <el-table-column prop="charge_sequence" label="起始集" />
-        <el-table-column prop="charge_coin" label="定价">
+        <el-table-column prop="category_str" label="频道" v-if="!rolesIdentify.includes('optimizer')" />
+        <el-table-column prop="shelf_type_str" label="上架状态" v-if="!rolesIdentify.includes('optimizer')" />
+        <el-table-column prop="charge_sequence" label="起始集" v-if="!rolesIdentify.includes('optimizer')" />
+        <el-table-column prop="charge_coin" label="定价" v-if="!rolesIdentify.includes('optimizer')">
           <template #header>
             <div class="flex items-center">
               <span>定价</span>
               <el-tooltip placement="top">
-                <template #content> multiple lines<br />second line </template>
+                <template #content> 定价为所需看剧币<br />1元等于100币 </template>
                 <el-icon>
                   <InfoFilled />
                 </el-icon>
@@ -161,6 +161,7 @@ const current = ref({})
 const selectType = ref([])
 const statusOptions = ref([{ label: '连载中', value: '1' }, { label: '完结', value: '2' }]);
 const cooperations = ref([]);
+const rolesIdentify = ref([]);
 
 
 const userStore = useUserStore()
@@ -279,6 +280,8 @@ const mulSet = () => {
 };
 
 onMounted(() => {
+  rolesIdentify.value = userStore.getRoles?.map(el => el?.identify)
+  console.log(rolesIdentify.value, 'rolesroles');
   if (userStore.getRoles?.some(el => (el?.identify == 'company'))) {
     query.value.operateUserId = JSON.parse(Cache.get('nav_data'))?.advertiser?.id;
   }