浏览代码

ETA表格配置化

cxmo 1 年之前
父节点
当前提交
171313080f
共有 3 个文件被更改,包括 52 次插入3 次删除
  1. 19 0
      src/utils/buttonConfig.js
  2. 31 3
      src/views/datasheet_manage/sheetList.vue
  3. 2 0
      src/vuex/modules/permissionButton.js

+ 19 - 0
src/utils/buttonConfig.js

@@ -278,3 +278,22 @@ export const myETAPermission = {
     /*-----------页面按钮--------- */
     myChart_selectChart:'myChart:selectChart',//选择图表
 }
+/*
+ * --------------------------------------------------------------------------ETA表格------------------------------------------------
+*/
+export const etaTablePermission = {
+    /*-----------页面按钮--------- */
+    etaTable_customize:'etaTable:customize',//自定义表格这个按钮显示不显示
+    etaTable_excel:'etaTable:excel',//添加Excel表格这个按钮显示不显示
+    /*-----------自定义表格--------- */
+    etaTable_customize_del:'etaTable:customize:del',
+    etaTable_customize_download:'etaTable:customize:download',
+    etaTable_customize_otherSave:'etaTable:customize:otherSave',
+    etaTable_customize_refresh:'etaTable:customize:refresh',
+    etaTable_customize_edit:'etaTable:customize:edit',
+    /*-----------常规表格--------- */
+    etaTable_excel_del:'etaTable:excel:del',
+    etaTable_excel_download:'etaTable:excel:download',
+    etaTable_excel_save:'etaTable:excel:save'
+
+}

+ 31 - 3
src/views/datasheet_manage/sheetList.vue

@@ -10,10 +10,12 @@
     <div class="data-sheet-main" id="box">
       <div class="main-left left" id="left" v-show="!isSlideLeft">
         <div class="datasheet_top">
-          <el-button type="primary" style="margin-right:20px" @click="goAddSheetHandle(1)"
+          <el-button v-permission="permissionBtn.etaTablePermission.etaTable_excel"
+            type="primary" style="margin-right:20px" @click="goAddSheetHandle(1)"
           >添加Excel表格</el-button >
 
-          <el-dropdown @command="goAddSheetHandle">
+          <el-dropdown v-permission="permissionBtn.etaTablePermission.etaTable_customize"
+            @command="goAddSheetHandle">
             <el-button type="primary">
               自定义表格<i class="el-icon-arrow-down el-icon--right"></i>
             </el-button>
@@ -165,6 +167,7 @@
             </span>
             <ul class="action-ul">
               <li
+                v-permission="permissionBtn.etaTablePermission.etaTable_excel_save"
                 class="editsty"
                 @click="saveHandle"
                 v-if="
@@ -176,6 +179,7 @@
               </li>
               <template v-if="[2, 3].includes(sheetDetailInfo.Source)">
                 <li
+                  v-permission="permissionBtn.etaTablePermission.etaTable_customize_edit"
                   class="editsty"
                   @click="goEditHandle"
                   v-if="sheetDetailInfo.Button.OpButton"
@@ -183,6 +187,7 @@
                   编辑
                 </li>
                 <li
+                  v-permission="permissionBtn.etaTablePermission.etaTable_customize_refresh"
                   class="editsty"
                   @click="refreshSheet"
                   v-if="sheetDetailInfo.Button.RefreshButton"
@@ -190,6 +195,7 @@
                   刷新
                 </li>
                 <li
+                  v-permission="permissionBtn.etaTablePermission.etaTable_customize_otherSave"
                   class="editsty"
                   @click="saveOtherHandle"
                   v-if="sheetDetailInfo.Button.CopyButton"
@@ -197,13 +203,15 @@
                   另存为
                 </li>
               </template>
-              <li class="editsty" @click="downloadExcel(sheetDetailInfo)">
+              <li v-if="isDownLoadShow(sheetDetailInfo)"
+                class="editsty" @click="downloadExcel(sheetDetailInfo)">
                 下载
               </li>
               <li
                 class="deletesty"
                 v-if="
                   sheetDetailInfo.Button && sheetDetailInfo.Button.DeleteButton
+                  &&isDeleteShow(sheetDetailInfo)
                 "
                 @click="delSheetHandle(sheetDetailInfo, 'del')"
               >
@@ -266,12 +274,14 @@
                   <span>创建时间: {{ cell.CreateTime.slice(0, 10) }}</span>
                   <div>
                     <span
+                      v-if="isDownLoadShow(cell)"
                       class="editsty"
                       style="margin-right: 10px"
                       @click="downloadExcel(cell)"
                       >下载</span
                     >
                     <span
+                      v-if="isDeleteShow(cell)"
                       class="deletesty"
                       @click="delSheetHandle(cell, 'del-list')"
                       >删除</span
@@ -855,6 +865,24 @@ export default {
               : 150;
         });
     },
+    //判断右侧列表的下载按钮是否显示
+    isDownLoadShow(cell){
+        const {checkPermissionBtn,etaTablePermission} = this.permissionBtn
+        if(cell.Source===1){
+            return checkPermissionBtn(etaTablePermission.etaTable_excel_download)
+        }else{
+            return checkPermissionBtn(etaTablePermission.etaTable_customize_download)
+        }
+    },
+    //判断右侧列表的删除按钮是否显示
+    isDeleteShow(cell){
+        const {checkPermissionBtn,etaTablePermission} = this.permissionBtn
+        if(cell.Source===1){
+            return checkPermissionBtn(etaTablePermission.etaTable_excel_del)
+        }else{
+            return checkPermissionBtn(etaTablePermission.etaTable_customize_del)
+        }
+    },
   },
   mounted() {
     if (this.$route.query.code) {

+ 2 - 0
src/vuex/modules/permissionButton.js

@@ -34,6 +34,8 @@ const permissionButtons = {
                     //ppt test
                     {button_code:'ppt:show'},
                     {button_code:'pptEn:show'},
+                    //table test
+                    {button_code:'etaTable:excel:download'},
                 ]
                 commit('SET_PERMISSION_BUTTONS',buttons)
                 resolve('获取权限按钮成功')