cxmo 1 жил өмнө
parent
commit
1f9056b10f

+ 67 - 9
src/components/chart/chartDetailHandlesWrap.vue

@@ -5,18 +5,20 @@
       class="span-item shareLink"
       @click="copyChartConfirm('url')"
       :data-clipboard-text="linkUrl"
-      v-if="!chartInfo.Disabled"
+      v-if="!chartInfo.Disabled&&isShowBtn('share')"
     >
       <i class="el-icon-share" />&nbsp;分享
     </li>
-    <li class="span-item" @click="addMychartHandle(chartInfo)">
+    <li v-if="isShowBtn('addMyChart')"
+        class="span-item" @click="addMychartHandle(chartInfo)">
       <img
         :src="$icons.chart_join_ico"
         alt=""
         style="width: 13px; height: 12px; vertical-align: middle"
       />加入我的图库
     </li>
-    <li class="span-item" @click="refreshHandle">
+    <li v-if="isShowBtn('refresh')"
+        class="span-item" @click="refreshHandle">
       <span
         ><i class="el-icon-refresh" style="margin-left: 0" />&nbsp;刷新
       </span>
@@ -26,12 +28,12 @@
         <i class="el-icon-collection" />&nbsp;保存
       </span>
     </li>
-    <li class="span-item" v-if="chartInfo.Button.IsCopy">
+    <li class="span-item" v-if="chartInfo.Button.IsCopy&&isShowBtn('otherSave')">
       <span @click="saveChartOtherHandle">
         <i class="el-icon-document-add" />&nbsp;另存为
       </span>
     </li>
-    <li class="span-item" v-if="chartInfo.Button.IsEdit" @click="editChartHandle">
+    <li class="span-item" v-if="chartInfo.Button.IsEdit&&isShowBtn('edit')" @click="editChartHandle">
       <img
         src="~@/assets/img/set_m/edit.png"
         alt=""
@@ -41,21 +43,22 @@
     <li
       class="span-item copy"
       @click="copyChartConfirm('office')"
-      v-if="!chartInfo.Disabled"
+      v-if="!chartInfo.Disabled&&isShowBtn('copyOffice')"
     >
       <i class="el-icon-document-copy" />&nbsp;复制至office
     </li>
     <li
       class="span-item copy"
       @click="copyChartConfirm('微信')"
-      v-if="!chartInfo.Disabled"
+      v-if="!chartInfo.Disabled&&isShowBtn('copyWechat')"
     >
       <img
         style="width: 13px; height: 12px; vertical-align: middle"
         src="~@/assets/img/chart_m/WeChat.jpg"
       />&nbsp;复制至微信
     </li>
-    <li class="span-item copy" @click="openEnNameDia">
+    <li v-if="isShowBtn('enNameSetting')"
+        class="span-item copy" @click="openEnNameDia">
       <img
         style="width: 16px; vertical-align: middle"
         :src="$icons.to_en"
@@ -65,7 +68,7 @@
       class="span-item"
       style="color: #ff4040"
       @click="delChartHandle"
-      v-if="chartInfo.Button.IsEdit"
+      v-if="chartInfo.Button.IsEdit&&isShowBtn('del')"
     >
       <i class="el-icon-delete" style="color: #ff4040" />&nbsp;删除
     </li>
@@ -98,6 +101,61 @@ export default {
     },
     delChartHandle() {
       this.$emit('delChartHandle')
+    },
+    //在原先按钮显示的逻辑上,加上权限控制
+    //由于多个图表共用这个操作栏,通过路由判断
+    isShowBtn(btn){
+        const {path} = this.$route
+        const {statisticPermission,checkPermissionBtn} = this.permissionBtn
+        const chartrelevanceMap = {
+            share:checkPermissionBtn(statisticPermission.corrAnalysis_share),
+            addMyChart:checkPermissionBtn(statisticPermission.corrAnalysis_addMyChart),
+            refresh:checkPermissionBtn(statisticPermission.corrAnalysis_refresh),
+            otherSave:checkPermissionBtn(statisticPermission.corrAnalysis_otherSave),
+            edit:checkPermissionBtn(statisticPermission.corrAnalysis_edit),
+            copyOffice:checkPermissionBtn(statisticPermission.corrAnalysis_copyOffice),
+            copyWechat:checkPermissionBtn(statisticPermission.corrAnalysis_copyWechat),
+            enNameSetting:checkPermissionBtn(statisticPermission.corrAnalysis_enNameSetting),
+            del:checkPermissionBtn(statisticPermission.corrAnalysis_del),
+        }
+        const fittingEquationMap = {
+            share:checkPermissionBtn(statisticPermission.fittingEq_share),
+            addMyChart:checkPermissionBtn(statisticPermission.fittingEq_addMyChart),
+            refresh:checkPermissionBtn(statisticPermission.fittingEq_refresh),
+            otherSave:checkPermissionBtn(statisticPermission.fittingEq_otherSave),
+            edit:checkPermissionBtn(statisticPermission.fittingEq_edit),
+            copyOffice:checkPermissionBtn(statisticPermission.fittingEq_copyOffice),
+            copyWechat:checkPermissionBtn(statisticPermission.fittingEq_copyWechat),
+            enNameSetting:checkPermissionBtn(statisticPermission.fittingEq_enNameSetting),
+            del:checkPermissionBtn(statisticPermission.fittingEq_del),
+        }
+        const statisticFeatureMap = {
+            share:checkPermissionBtn(statisticPermission.statisticFeature_share),
+            addMyChart:checkPermissionBtn(statisticPermission.statisticFeature_addMyChart),
+            refresh:checkPermissionBtn(statisticPermission.statisticFeature_refresh),
+            otherSave:checkPermissionBtn(statisticPermission.statisticFeature_otherSave),
+            edit:checkPermissionBtn(statisticPermission.statisticFeature_edit),
+            copyOffice:checkPermissionBtn(statisticPermission.statisticFeature_copyOffice),
+            copyWechat:checkPermissionBtn(statisticPermission.statisticFeature_copyWechat),
+            enNameSetting:checkPermissionBtn(statisticPermission.statisticFeature_enNameSetting),
+            del:checkPermissionBtn(statisticPermission.statisticFeature_del),
+        }
+        //相关性分析
+        if(path==='/chartrelevance'){
+            return chartrelevanceMap[btn]
+        }
+        //拟合方程曲线
+        if(path==='/fittingEquationList'){
+            return fittingEquationMap[btn]
+        }
+        //统计特性
+        if(path==='/statisticFeatureList'){
+            return statisticFeatureMap[btn]
+        }
+        //商品价格曲线
+        if(path==='/commordityChartBase'){}
+
+        return false
     }
   },
 };

+ 45 - 0
src/utils/buttonConfig.js

@@ -317,3 +317,48 @@ export const semanticPermission = {
     tagPage_del:'tagPage:del',
     tagPage_save:'tagPage:save',//添加编辑标签
 }
+/*
+ * --------------------------------------------------------------------------统计分析------------------------------------------------
+*/
+export const statisticPermission = {
+    /*-----------相关性分析--------- */
+    corrAnalysis_addChart:'corrAnalysis:addChart',//添加图表按钮
+    corrAnalysis_viewData:'corrAnalysis:viewData',//查看表格数据
+    corrAnalysis_copyData:'corrAnalysis:copyData',//复制表格数据
+        /*---图表操作栏--- */
+    corrAnalysis_del:'corrAnalysis:del',
+    corrAnalysis_enNameSetting:'corrAnalysis:enNameSetting',
+    corrAnalysis_copyWechat:'corrAnalysis:copyWechat',
+    corrAnalysis_copyOffice:'corrAnalysis:copyOffice',
+    corrAnalysis_edit:'corrAnalysis:edit',
+    corrAnalysis_otherSave:'corrAnalysis:otherSave',
+    corrAnalysis_refresh:'corrAnalysis:refresh',
+    corrAnalysis_addMyChart:'corrAnalysis:addMyChart',
+    corrAnalysis_share:'corrAnalysis:share',
+
+    /*-----------统计特征--------- */
+    statisticFeature_addChart:'statisticFeature:addChart',//添加图表按钮
+        /*---图表操作栏--- */
+    statisticFeature_del:'statisticFeature:del',
+    statisticFeature_enNameSetting:'statisticFeature:enNameSetting',
+    statisticFeature_copyWechat:'statisticFeature:copyWechat',
+    statisticFeature_copyOffice:'statisticFeature:copyOffice',
+    statisticFeature_edit:'statisticFeature:edit',
+    statisticFeature_otherSave:'statisticFeature:otherSave',
+    statisticFeature_refresh:'statisticFeature:refresh',
+    statisticFeature_addMyChart:'statisticFeature:addMyChart',
+    statisticFeature_share:'statisticFeature:share',
+
+    /*-----------拟合方程曲线--------- */
+    fittingEq_addChart:'fittingEq:addChart',//添加图表按钮
+        /*---图表操作栏--- */
+    fittingEq_del:'fittingEq:del',
+    fittingEq_enNameSetting:'fittingEq:enNameSetting',
+    fittingEq_copyWechat:'fittingEq:copyWechat',
+    fittingEq_copyOffice:'fittingEq:copyOffice',
+    fittingEq_edit:'fittingEq:edit',
+    fittingEq_otherSave:'fittingEq:otherSave',
+    fittingEq_refresh:'fittingEq:refresh',
+    fittingEq_addMyChart:'fittingEq:addMyChart',
+    fittingEq_share:'fittingEq:share',
+}

+ 2 - 1
src/views/chartRelevance_manage/fittingEquationList.vue

@@ -11,7 +11,8 @@
 		<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" @click="goAddChart">添加图表</el-button>
+						<el-button v-permission="permissionBtn.statisticPermission.fittingEq_addChart"
+							type="primary" @click="goAddChart">添加图表</el-button>
 						<div style="color: #666">
 							 使用说明
 							<el-tooltip

+ 6 - 3
src/views/chartRelevance_manage/list.vue

@@ -11,7 +11,8 @@
     <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" @click="goAddChart">添加图表</el-button>
+          <el-button v-permission="permissionBtn.statisticPermission.corrAnalysis_addChart"
+            type="primary" @click="goAddChart">添加图表</el-button>
         </div>
         <div
           style="padding: 0 20px; display: flex; justify-content: space-between"
@@ -233,10 +234,12 @@
             <el-table-column label="操作" key="Copy" align="center" width="140">
               <template slot-scope="scope">
                 <!-- <span @click="delTarget(scope.row)" class="deletesty">删除&nbsp;</span> -->
-                <span class="editsty" @click="copyCode(scope.row)">
+                <span v-permission="permissionBtn.statisticPermission.corrAnalysis_copyData"
+                    class="editsty" @click="copyCode(scope.row)">
                   <i class="el-icon-document-copy" />&nbsp;复制数据</span
                 ><br />
-                <span class="editsty" @click="viewTarget(scope.row)"
+                <span v-permission="permissionBtn.statisticPermission.corrAnalysis_viewData"
+                    class="editsty" @click="viewTarget(scope.row)"
                   >查看数据</span
                 >
               </template>

+ 2 - 1
src/views/chartRelevance_manage/statisticFeatureList.vue

@@ -11,7 +11,8 @@
 		<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" @click="goAddChart">添加图表</el-button>
+						<el-button v-permission="permissionBtn.statisticPermission.statisticFeature_addChart"
+							 type="primary" @click="goAddChart">添加图表</el-button>
 				</div>
 
 				<div class="search-cont">

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

@@ -38,6 +38,8 @@ const permissionButtons = {
                     {button_code:'etaTable:excel:download'},
                     //sandbox test
                     {button_code:'sandbox:saveView'},
+                    //chartHandle test
+                    {button_code:'statisticFeature:share'},
                 ]
                 commit('SET_PERMISSION_BUTTONS',buttons)
                 resolve('获取权限按钮成功')