Browse Source

feat: 数据看板 - 投手数据&投手投放数据 - "导出"权限控制逻辑

zhengxy 2 years ago
parent
commit
01ffde76d2

+ 12 - 3
project/src/components/dataBoard/throwPerson/throwPersonPuton.vue

@@ -4,15 +4,15 @@
4 4
       <div class="flex">
5 5
         <date-picker title="自定义" :quickFlag='true' :afferent_time="default_time" :clearFlag='false'
6 6
           @changeTime="changeTime"></date-picker>
7
-        <self-channel title="投手" style="margin-left: 20px" type='pitcher' :labelWidth="true"
7
+        <self-channel title="投手" type='pitcher' :labelWidth="true"
8 8
           :afferent_params="{ corp_id: '' }"
9 9
           @channelDefine="(val) => { duplicateRemovalData.flag = false; user_id = val; stat_throwPersonData(); init(1) }">
10 10
         </self-channel>
11
-        <self-channel title="剧集" style="margin-left: 20px" type='dramaList' :labelWidth="true"
11
+        <self-channel title="剧集" type='dramaList' :labelWidth="true"
12 12
           @channelDefine="(val) => { duplicateRemovalData.flag = false; drama_id = val; stat_throwPersonData(); init(1) }">
13 13
         </self-channel>
14 14
       </div>
15
-      <el-button type="primary" size="mini" @click="init(1, 'export')">导出Excel</el-button>
15
+      <el-button v-if="isCanExport" type="primary" size="mini" @click="init(1, 'export')">导出Excel</el-button>
16 16
     </div>
17 17
     <div class="dataInfoBox" v-loading="dataLoading">
18 18
       <div class="dataInfoItem" v-for="(item, index) in dataInfoArrs" :key="index">
@@ -158,6 +158,12 @@ export default {
158 158
       },//去重数据
159 159
     }
160 160
   },
161
+  computed: {
162
+    // 是否有“导出”权限
163
+    isCanExport() {
164
+      return !!this.$store.state.dataBoardAuth.can_export
165
+    },
166
+  },
161 167
   created () {
162 168
     this.height = document.documentElement.clientHeight - 340 > 400 ? document.documentElement.clientHeight - 340 : 400
163 169
     this.time = this.default_time
@@ -309,6 +315,9 @@ export default {
309 315
 }
310 316
 </script>
311 317
 <style lang="scss" scoped>
318
+/deep/ .common-screen-label {
319
+  flex-shrink: 0;
320
+}
312 321
 .screenBox {
313 322
   background: #fff;
314 323
   padding: 5px 20px;

+ 7 - 1
project/src/components/dataBoard/throwPerson/throwPersonSon.vue

@@ -8,7 +8,7 @@
8 8
           :afferent_params="{ corp_id: '' }"
9 9
           @channelDefine="(val) => { user_id = val; duplicateRemovalData.flag = false; init(1) }"></self-channel>
10 10
       </div>
11
-      <el-button type="primary" size="mini" @click="init(1, 'export')">导出Excel</el-button>
11
+      <el-button v-if="isCanExport" type="primary" size="mini" @click="init(1, 'export')">导出Excel</el-button>
12 12
     </div>
13 13
     <div class="dataInfoBox" v-loading="dataLoading">
14 14
       <div class="dataInfoItem" v-for="(item, index) in dataInfoArrs" :key="index">
@@ -155,6 +155,12 @@ export default {
155 155
       },//去重数据
156 156
     }
157 157
   },
158
+  computed: {
159
+    // 是否有“导出”权限
160
+    isCanExport() {
161
+      return !!this.$store.state.dataBoardAuth.can_export
162
+    },
163
+  },
158 164
   created () {
159 165
     this.height = document.documentElement.clientHeight - 340 > 400 ? document.documentElement.clientHeight - 340 : 400
160 166
     this.time = this.default_time