Browse Source

品种模块权限控制

jwyu 1 year ago
parent
commit
cbbed43d41

+ 33 - 17
src/utils/buttonConfig.js

@@ -75,27 +75,39 @@ export const enReportManageBtn = {
 */
 export const classifyBtn={
     classifyList_cnClassify:'classifyList:cnClassify',//中文分类这个选项卡是否显示
-    classifyList_cnClassify_classifyDel:'classifyList:cnClassify:classifyDel',//一二级分类删除
-    classifyList_cnClassify_authSetting:'classifyList:cnClassify:authSetting',//二级分类权限配置
-    classifyList_cnClassify_chapterSetting:'classifyList:cnClassify:chapterSetting',//晨周报章节设置
+    // classifyList_cnClassify_classifyDel:'classifyList:cnClassify:classifyDel',//一二级分类删除
+    // classifyList_cnClassify_authSetting:'classifyList:cnClassify:authSetting',//二级分类权限配置
+    
     /*---------添加编辑分类------------- */
-    classifyList_cnClassify_classifyAdd:'classifyList:cnClassify:classifyAdd',//一二级添加编辑分类
-    classifyList_cnClassify_relateSetting:'classifyList:cnClassify:relateSetting',//表单项:关联设置
-    classifyList_cnClassify_miniHidden:'classifyList:cnClassify:miniHidden',//表单项:小程序隐藏
-    classifyList_cnClassify_pcBackColor:'classifyList:cnClassify:pcBackColor',//表单项:PC端背景颜色
-    classifyList_cnClassify_shareImgs:'classifyList:cnClassify:shareImgs',//表单项:分享链接配图
-    classifyList_cnClassify_reportImgs:'classifyList:cnClassify:reportImgs',//表单项:报告合集配图
-    classifyList_cnClassify_ficcIcon:'classifyList:cnClassify:ficcIcon',//表单项:FICCicon
-    classifyList_cnClassify_ficcSort:'classifyList:cnClassify:ficcSort',//表单项:FICC页排序
-    classifyList_cnClassify_backSort:'classifyList:cnClassify:backSort',//表单项:后台排序
-    classifyList_cnClassify_showType:'classifyList:cnClassify:showType',//表单项:展示形式
-    classifyList_cnClassify_childMenu:'classifyList:cnClassify:childMenu',//表单项:子目录
+    classifyList_cnClassify_classifyAdd:'classifyList:cnClassify:add',//添加分类
+    classifyList_cnClassify_classifyEdit:'classifyList:cnClassify:edit',//添加分类
+    classifyList_cnClassify_connect_variety:'classifyList:cnClassify:variety',//关联品种
+    classifyList_cnClassify_chapterSetting:'classifyList:cnClassify:chapterSetting',//晨周报章节设置
+    classifyList_cnClassify_enable:'classifyList:cnClassify:enable',//启用\禁用
+
+
+    // classifyList_cnClassify_relateSetting:'classifyList:cnClassify:relateSetting',//表单项:关联设置
+    // classifyList_cnClassify_miniHidden:'classifyList:cnClassify:miniHidden',//表单项:小程序隐藏
+    // classifyList_cnClassify_pcBackColor:'classifyList:cnClassify:pcBackColor',//表单项:PC端背景颜色
+    // classifyList_cnClassify_shareImgs:'classifyList:cnClassify:shareImgs',//表单项:分享链接配图
+    // classifyList_cnClassify_reportImgs:'classifyList:cnClassify:reportImgs',//表单项:报告合集配图
+    // classifyList_cnClassify_ficcIcon:'classifyList:cnClassify:ficcIcon',//表单项:FICCicon
+    // classifyList_cnClassify_ficcSort:'classifyList:cnClassify:ficcSort',//表单项:FICC页排序
+    // classifyList_cnClassify_backSort:'classifyList:cnClassify:backSort',//表单项:后台排序
+    // classifyList_cnClassify_showType:'classifyList:cnClassify:showType',//表单项:展示形式
+    // classifyList_cnClassify_childMenu:'classifyList:cnClassify:childMenu',//表单项:子目录
 }
 /*
 *--------英文分类-----------   ETA_1.1.7 不区分英文研报和线上路演 统一使用英文研报的标识
 */
 export const enClassifyBtn = {
     classifyList_enClassify:'classifyList:enClassify',//英文分类这个选项卡是否展示
+    classifyList_enClassify_add:'classifyList:enClassify:rpAddClassify',//英文分类添加按钮
+    classifyList_enClassify_edit:'classifyList:enClassify:rpEdit',//英文分类编辑
+    classifyList_enClassify_enable:'classifyList:enClassify:enable',//启用\禁用
+    classifyList_enClassify_connect_variety:'classifyList:enClassify:variety',//关联品种
+
+
     /* -------------线上路演------------- */ 
     classifyList_enClassify_roadshow:'classifyList:enClassify:roadshow',//线上路演这个选项卡是否展示
     classifyList_enClassify_rsDel:'classifyList:enClassify:rsDel',//线上路演一二级分类删除
@@ -130,9 +142,13 @@ export const authorManage = {
 *--------品种配置----------- 
 */
 export const reportVariety = {
-    
-    enChartPermission_del:'enChartPermission:del',
-    enChartPermission_save:'enChartPermission:save',
+    zhVarietyHas:'reportvariety:chinese',//中文品种
+    zhPublicSet:'reportvariety:chinese:ispublic',//公有权限设置
+    zhVarietyEdit:'reportvariety:chinese:set',//品种设置
+    zhVarietyAdd:'reportvariety:chinese:add',//添加品种
+    enVarietyHas:'reportvariety:english',//英文品种
+    enVarietyEdit:'enChartPermission:edit',//品种设置
+    enVarietyAdd:'enChartPermission:save',//添加品种
 }
 /*
 *--------云盘----------- 

+ 8 - 4
src/views/classify_manage/classifyEnlistV2.vue

@@ -9,7 +9,7 @@
             <el-button 
                 type="primary"
                 @click="addClassify"
-                v-permission="permissionBtn.enClassifyBtn.classifyList_enClassify_rpAddClassify"
+                v-permission="permissionBtn.enClassifyBtn.classifyList_enClassify_add"
             >添加分类</el-button>
             <el-input placeholder="分类名称" v-model="searchVal" style="max-width: 262px;" @change="getList" clearable>
                 <i slot="prefix" class="el-input__icon el-icon-search"></i>
@@ -42,7 +42,7 @@
 					
                     <div class="opt-box">
                         <img class="icon-drag" src="~@/assets/img/data_m/move_ico2.png" alt="">
-                        <img class="icon-set" src="~@/assets/img/icons/variety_set.png" alt="" @click.stop="handleEdit(data,node)">
+                        <img class="icon-set" src="~@/assets/img/icons/variety_set.png" alt="" @click.stop="handleEdit(data,node)" v-permission="permissionBtn.enClassifyBtn.classifyList_enClassify_edit">
                     </div>
 				</div>
 			</el-tree>
@@ -50,7 +50,7 @@
 
         <!-- 分类弹窗 -->
         <m-dialog 
-            :title="classifyForm.id?'编辑分类':'新增分类'" 
+            :title="classifyForm.classify_id?'编辑分类':'新增分类'" 
             :show.sync="classifyForm.show" 
             width="650px"
         >
@@ -74,7 +74,7 @@
                         <el-cascader :options="classifyparentArr" v-model="classifyForm.parent_id" placeholder="请选择"
                         :props="{value:'Id',label:'ClassifyName',children:'Child',checkStrictly:true,emitPath:false}" style="min-width:400px;"></el-cascader>
                     </el-form-item>
-                    <el-form-item prop="variety" label="关联品种" v-if="classifyForm.level==3">
+                    <el-form-item prop="variety" label="关联品种" v-if="classifyForm.level==3&&permissionBtn.enClassifyBtn.classifyList_enClassify_connect_variety">
                         <template slot="label">
                             <el-tooltip class="item" effect="dark" content="控制报告阅读权限">
                                 <div>
@@ -159,6 +159,10 @@ export default {
 
         //启用\禁用设置
         handleEnableSet(item){
+            // 判断权限
+            const {enClassifyBtn,checkPermissionBtn} = this.permissionBtn
+            if(checkPermissionBtn(enClassifyBtn.classifyList_enClassify_enable)) return
+
             classifyEnInterface.enableSet({
                 ClassifyId:item.Id,
                 Enabled:item.Enabled==1?0:1

+ 8 - 4
src/views/classify_manage/classifylistV2.vue

@@ -41,9 +41,9 @@
                     </div>
 					
                     <div class="opt-box">
-                        <span class="editsty" v-if="['晨报','周报'].includes(data.ClassifyName)" @click="chapterSetting(data)">章节设置</span>
+                        <span class="editsty" v-if="['晨报','周报'].includes(data.ClassifyName)" @click="chapterSetting(data)" v-permission="permissionBtn.classifyBtn.classifyList_cnClassify_chapterSetting">章节设置</span>
                         <img class="icon-drag" src="~@/assets/img/data_m/move_ico2.png" alt="">
-                        <img class="icon-set" src="~@/assets/img/icons/variety_set.png" alt="" @click.stop="handleEdit(data)">
+                        <img class="icon-set" src="~@/assets/img/icons/variety_set.png" alt="" @click.stop="handleEdit(data)" v-permission="permissionBtn.classifyBtn.classifyList_cnClassify_classifyEdit">
                     </div>
 				</div>
 			</el-tree>
@@ -51,7 +51,7 @@
 
         <!-- 分类弹窗 -->
         <m-dialog 
-            :title="classifyForm.id?'编辑分类':'新增分类'" 
+            :title="classifyForm.classify_id?'编辑分类':'新增分类'" 
             :show.sync="classifyForm.show" 
             width="650px"
         >
@@ -77,7 +77,7 @@
                             <el-option v-for="(item,index) in classifyparentArr" :key="index" :label="item.ClassifyName" :value="item.Id"></el-option>
                         </el-select>
                     </el-form-item>
-                    <el-form-item prop="variety" label="关联品种" v-if="classifyForm.parent_id">
+                    <el-form-item prop="variety" label="关联品种" v-if="classifyForm.parent_id&&permissionBtn.classifyBtn.classifyList_cnClassify_connect_variety">
                         <template slot="label">
                             <el-tooltip class="item" effect="dark" content="控制报告阅读权限">
                                 <div>
@@ -231,6 +231,10 @@ export default {
 
         //启用\禁用设置
         handleEnableSet(item){
+            // 判断权限
+            const {classifyBtn,checkPermissionBtn} = this.permissionBtn
+            if(checkPermissionBtn(classifyBtn.classifyList_cnClassify_enable)) return
+            
             classifyPermissionInterface.enableSet({
                 ClassifyId:item.Id,
                 Enabled:item.Enabled==1?0:1

+ 1 - 1
src/views/classify_manage/indexList.vue

@@ -15,7 +15,7 @@ export default {
     },
     data() {
         return {
-            type:'2',//1 中文研报分类 2英文研报分类
+            type:'1',//1 中文研报分类 2英文研报分类
         }
     },
     methods:{

+ 36 - 9
src/views/report_manage/reportVarietyV2.vue

@@ -2,14 +2,14 @@
     <div class="report-variety-page">
         <div class="top-wrap">
             <div class="type-box">
-                <div :class="['item',typeVal==1?'active':'']" @click="handleTypeChange(1)">中文品种</div>
-                <div :class="['item',typeVal==2?'active':'']" @click="handleTypeChange(2)">英文品种</div>
+                <div :class="['item',typeVal==1?'active':'']" @click="handleTypeChange(1)" v-permission="permissionBtn.reportVariety.zhVarietyHas">中文品种</div>
+                <div :class="['item',typeVal==2?'active':'']" @click="handleTypeChange(2)" v-permission="permissionBtn.reportVariety.enVarietyHas">英文品种</div>
             </div>
         </div>
         <div class="main-wrap">
             <div class="left-wrap">
                 <div class="add-btn-box">
-                    <el-button type="primary" @click="handleAddVariety">添加品种</el-button>
+                    <el-button type="primary" @click="handleAddVariety" v-if="isShowAddBtn">添加品种</el-button>
                 </div>
                 <div class="first-variety-wrap">
                     <draggable
@@ -29,7 +29,7 @@
                             <div class="name">{{item.PermissionName}}</div>
                             <div class="menu-box">
                                 <img class="icon-drag" src="~@/assets/img/data_m/move_ico2.png" alt="">
-                                <img class="icon-set" src="~@/assets/img/icons/variety_set.png" alt="" @click="handleShowEdit(item)">
+                                <img class="icon-set" src="~@/assets/img/icons/variety_set.png" alt="" @click="handleShowEdit(item)" v-if="isShowEdit">
                             </div>
                         </li> 
                     </draggable>
@@ -51,7 +51,7 @@
                 <li class="item" v-for="item in secondVarietyList" :key="item.PermissionId">
                     <div class="top-icons">
                         <img class="icon-drag" src="~@/assets/img/data_m/move_ico2.png" alt="">
-                        <span @click="handleQuickSet(item,'enable')">
+                        <span @click="handleQuickSet(item,'enable')" v-if="isShowEdit">
                             <el-switch
                                 :value="item.Enabled==1"
                                 active-color="#0052D9"
@@ -60,9 +60,9 @@
                     </div>
                     <div class="name-box">
                         <div class="name" >{{item.PermissionName}}</div>
-                        <img @click="handleShowEdit(item)" class="icon-edit" src="~@/assets/img/icons/variety_name_edit.png" alt="">
+                        <img v-if="isShowEdit" @click="handleShowEdit(item)" class="icon-edit" src="~@/assets/img/icons/variety_name_edit.png" alt="">
                     </div>
-                    <template v-if="typeVal==1">
+                    <template v-if="typeVal==1&&permissionBtn.isShowBtn('reportVariety','zhPublicSet')">
                     <div class="tag-box open" v-if="item.IsPublic==1" @click="handleQuickSet(item,'ispublic')">
                         <span class="tag">公有</span>
                         <img class="icon" src="~@/assets/img/icons/changeLang01.png" alt="">
@@ -74,7 +74,7 @@
                     </template>
                 </li> 
             </draggable>
-            <ul class="list-wrap" style="float:left;margin-top:20px">
+            <ul class="list-wrap" style="float:left;margin-top:20px" v-if="isShowAddBtn">
                 <li class="item add-btn" v-if="selectFirstId" @click="handleAddVariety(2)">
                     <img class="icon" src="~@/assets/img/icons/variety_add.png" alt="">
                 </li>
@@ -114,7 +114,7 @@
                         </el-switch>
                     </el-form-item>
                     <!-- 中文品种特有的设置公有权限 -->
-                    <div class="public-auth-box" v-if="typeVal==1&&checkOpts.length>0&&editBreedData.parentId==0">
+                    <div class="public-auth-box" v-if="typeVal==1&&checkOpts.length>0&&editBreedData.parentId==0&&permissionBtn.isShowBtn('reportVariety','zhPublicSet')">
                         <el-tooltip effect="dark" content="默认为私有,勾选并保存设置为公有">
                             <div style="display:inline-block">
                                 <span>公有权限设置</span>
@@ -143,6 +143,25 @@ import draggable from 'vuedraggable';
 import {reportVarietyENInterence,reportVarietyInterence} from '@/api/modules/reportVariety'
 export default {
     components:{draggable},
+    computed:{
+        // 添加品种按钮
+        isShowAddBtn(){
+            if(this.typeVal==1){
+                return this.permissionBtn.isShowBtn('reportVariety','zhVarietyAdd')
+            }else{
+                return this.permissionBtn.isShowBtn('reportVariety','enVarietyAdd')
+            }
+        },
+        // 品种编辑
+        isShowEdit(){
+            if(this.typeVal==1){
+                return this.permissionBtn.isShowBtn('reportVariety','zhVarietyEdit')
+            }else{
+                return this.permissionBtn.isShowBtn('reportVariety','enVarietyEdit')
+            }
+        },
+
+    },
     watch: {
         showEditBreed(n){
             if(!n){
@@ -188,6 +207,14 @@ export default {
     created(){
         this.getList()
     },
+    mounted(){
+        const {reportVariety,checkPermissionBtn} = this.permissionBtn
+        if(checkPermissionBtn(reportVariety.zhVarietyHas)){
+            this.type = 1
+        }else if(checkPermissionBtn(reportVariety.enVarietyHas)){
+            this.type = 2
+        }
+    },
     methods: {
         async getList(){
             this.listLoading=true