jwyu 6 months ago
parent
commit
ec14751dbf

+ 14 - 1
src/utils/buttonConfig.js

@@ -865,6 +865,18 @@ export const chartThemePermission = {
     chartTheme_chartsource:'chartTheme:chartsource',//图表的数据来源
 }
 
+/* BI看板配置 */
+export const BIBoardPermission = {
+    BIBoard_add:'BI:addBoard',//添加
+    BIBoard_setshare:'BI:setShare',//设置共享
+    BIBoard_setcommon:'BI:setCommon',//
+    BIBoard_addclassify:'BI:setCommonClassify',//
+    BIBoard_edit:'BI:edit',//
+    BIBoard_delete:'BI:delete',//
+    BIBoard_refresh:'BI:refresh',//
+    BIBoard_sort:'BI:sort',//
+}
+
 
 //创建了新的ManageBtn记得添加到这里
 const btnMap  = {
@@ -883,7 +895,8 @@ const btnMap  = {
     approvePermission,
     outlinkConfigPermission,
     chartThemePermission,
-    toolBoxPermission
+    toolBoxPermission,
+    BIBoardPermission
 }
 
 /**

+ 6 - 2
src/views/BI_manage/components/BoardContent.vue

@@ -24,7 +24,7 @@
             />
           </template>
           <template v-slot:delete>
-            <img class="icon" src="~@/assets/img/icons/delete-red.png" alt="" @click="handleDel(index)"/>
+            <img class="icon" v-if="canDelete" src="~@/assets/img/icons/delete-red.png" alt="" @click="handleDel(index)"/>
           </template>
         </component>
       </div>
@@ -47,6 +47,10 @@ export default {
     canDrag: {//能否拖动
       type: Boolean,
       default: true
+    },
+    canDelete:{//能否删除
+      type: Boolean,
+      default: false
     }
   },
   data() {
@@ -60,7 +64,7 @@ export default {
     },
     handleDel(index){
       this.value.splice(index,1)
-      this.$emit('change',this.value)
+      this.$emit('delete',this.value)
     },
     setDraggable(draggable, index) {
       const box = this.$el.querySelectorAll('.BI-board-item-box')[index];

+ 38 - 6
src/views/BI_manage/components/ChartBox.vue

@@ -7,6 +7,7 @@
           class="icon"
           src="~@/assets/img/icons/refresh_blue_new.png"
           alt=""
+          @click="refreshHandle"
         />
         <slot name="drag"></slot>
         <slot name="delete"></slot>
@@ -32,6 +33,9 @@
 import Chart from '@/views/dataEntry_manage/components/chart';
 import { chartSetMixin } from '@/views/dataEntry_manage/mixins/chartPublic'
 import { dataBaseInterface } from '@/api/api.js';
+import chartRelevanceApi from '@/api/modules/chartRelevanceApi';
+import apiIntervalAnalysis from '@/api/modules/intervalAnalysis'
+import { fittingEquationInterface,statisticFeatureInterface,crossVarietyInterface } from '@/api/modules/chartRelevanceApi';
 export default {
   components: { Chart },
   mixins: [chartSetMixin],
@@ -65,14 +69,42 @@ export default {
     }
   },
   methods: {
+    /* 一键刷新 超长等待..*/
+    async refreshHandle() {
+      // 清除缓存配置项
+      this.loading = true;
+      const { Source, ChartInfoId, } = this.chartInfo;
+
+      let res = null
+      if (Source === 1) {
+        res = await dataBaseInterface.chartRefresh({ ChartInfoId })
+      } else if ([3].includes(Source)) {
+        res = await chartRelevanceApi.refreshChart({ ChartInfoId })
+      } else if (Source === 6) {
+        res = await fittingEquationInterface.refreshChart({ ChartInfoId })
+      } else if ([7].includes(Source)) {
+        res = await statisticFeatureInterface.refreshChart({ ChartInfoId })
+      } else if (Source === 10) {
+        res = await crossVarietyInterface.refreshChart({ ChartInfoId })
+      }  else if (Source === 12) {
+        res = await apiIntervalAnalysis.chartRefresh({ ChartInfoId })
+      }
+
+      this.loading = false;
+      if (res.Ret !== 200) return
+      this.$message.success(res.Msg);
+
+      this.handleGetChartData()
+    },
+
     goDetail() {
       const pathMap = new Map([
-        [1,'/chartsetting'],
-        [3,'/chartrelevance'],
-        [6,'/fittingEquationList'],
-        [7,'/statisticFeatureList'],
-        [10,'/crossVarietyChartList'],
-        [12,'/rangeAnalysis']
+        [1, '/chartsetting'],
+        [3, '/chartrelevance'],
+        [6, '/fittingEquationList'],
+        [7, '/statisticFeatureList'],
+        [10, '/crossVarietyChartList'],
+        [12, '/rangeAnalysis']
       ])
       const href = this.$router.resolve({
         path: pathMap.get(this.chartInfo.Source),

+ 1 - 1
src/views/BI_manage/editBoard.vue

@@ -18,7 +18,7 @@
       </div>
     </div>
     <!-- 看板内容模块 -->
-    <BIBoardContent v-model="boardDataList" />
+    <BIBoardContent v-model="boardDataList" :canDelete="true" />
 
     <!-- 选择图表 -->
     <SelectChart

+ 96 - 68
src/views/BI_manage/index.vue

@@ -26,30 +26,57 @@
       </div>
       <!-- 添加看板 -->
       <div class="right-btn-box" v-if="navType === 1">
-        <el-button type="primary" @click="$router.push('/editBIBoard')">添加看板</el-button>
+        <el-button
+          type="primary"
+          @click="$router.push('/editBIBoard')"
+          v-permission="permissionBtn.BIBoardPermission.BIBoard_add"
+          >添加看板</el-button
+        >
       </div>
       <!-- 设置公共看板分类 -->
       <div class="right-btn-box" v-if="navType === 3">
-        <el-button type="primary" @click="showCommonClassify=true">设置公共看板分类</el-button>
+        <el-button
+          type="primary"
+          @click="showCommonClassify = true"
+          v-permission="permissionBtn.BIBoardPermission.BIBoard_addclassify"
+          >设置公共看板分类</el-button
+        >
       </div>
     </div>
     <div class="opt-box">
       <!-- 我的看板  -->
-      <el-select v-model="selectBoardId" placeholder="请选择看板" v-if="navType === 1">
-        <el-option 
-          v-for="item in myBoardList" 
+      <el-select
+        v-model="selectBoardId"
+        placeholder="请选择看板"
+        v-if="navType === 1"
+      >
+        <el-option
+          v-for="item in myBoardList"
           :key="item.BiDashboardId"
           :value="item.BiDashboardId"
           :label="item.BiDashboardName"
         ></el-option>
       </el-select>
       <!-- 共享看板 -->
-      <el-cascader v-model="selectBoardId" :props="{emitPath:false}" :options="shareBoardList" v-if="navType === 2"></el-cascader>
+      <el-cascader
+        v-model="selectBoardId"
+        :props="{ emitPath: false }"
+        :options="shareBoardList"
+        v-if="navType === 2"
+      ></el-cascader>
       <!-- 公共看板 -->
-      <el-cascader v-model="selectBoardId" :props="{emitPath:false}" :options="commonBoardList" v-if="navType === 3"></el-cascader>
-      
+      <el-cascader
+        v-model="selectBoardId"
+        :props="{ emitPath: false }"
+        :options="commonBoardList"
+        v-if="navType === 3"
+      ></el-cascader>
+
       <div class="right-opt-box">
-        <el-button v-if="navType===1" type="text" @click="showSetCommon = true"
+        <el-button
+          v-if="navType === 1&&permissionBtn.isShowBtn('BIBoardPermission','BIBoard_setcommon')"
+          type="text"
+          @click="showSetCommon = true"
           >设置公共</el-button
         >
         <el-button type="text" @click="showSetShare = true">设置共享</el-button>
@@ -58,14 +85,14 @@
       </div>
     </div>
     <!-- 看板内容模块 -->
-    <BIBoardContent v-model="boardDataList" />
+    <BIBoardContent v-model="boardDataList" :canDrag="false" />
 
     <!-- 设置共享 -->
     <set-share v-model="showSetShare" />
     <!-- 设置公共 -->
     <SetCommon v-model="showSetCommon" />
     <!-- 公共看板分类 -->
-    <CommonClassify v-model="showCommonClassify"/>
+    <CommonClassify v-model="showCommonClassify" />
   </div>
 </template>
 
@@ -77,125 +104,126 @@ import SetCommon from './components/SetCommon.vue'
 import SetShare from './components/SetShare.vue'
 
 export default {
-  components: { BIBoardContent, SetShare, SetCommon,CommonClassify },
+  components: { BIBoardContent, SetShare, SetCommon, CommonClassify },
   data() {
     return {
       navType: 1,// 
 
-      boardInfo:null,//看板详情数据
-      boardDataList:[],//看板数据
+      boardInfo: null,//看板详情数据
+      boardDataList: [],//看板数据
 
-      selectBoardId:0,//当前选择的看板id
-      myBoardList:[],
-      shareBoardList:[],
-      commonBoardList:[],
+      selectBoardId: 0,//当前选择的看板id
+      myBoardList: [],
+      shareBoardList: [],
+      commonBoardList: [],
 
       showSetShare: false,
       showSetCommon: false,
-      showCommonClassify:false,
+      showCommonClassify: false,
     }
   },
   watch: {
-    selectBoardId(n){
-      n&&this.getBoardDetail()
+    selectBoardId(n) {
+      n && this.getBoardDetail()
     }
   },
   created() {
     this.getMyBoardList()
   },
   methods: {
-    handleGoEdit(){
+    handleGoEdit() {
       this.$router.push({
-        path:"/editBIBoard",
-        query:{
-          id:this.selectBoardId
+        path: "/editBIBoard",
+        query: {
+          id: this.selectBoardId
         }
       })
     },
 
     // 获取看板详情
-    async getBoardDetail(){
-      const res=await apiBiBoard.boardDetail({DashboardId:this.selectBoardId})
-      if(res.Ret===200){
-        this.boardInfo=res.Data
-        this.boardDataList=res.Data.List||[]
+    async getBoardDetail() {
+      const res = await apiBiBoard.boardDetail({ DashboardId: this.selectBoardId })
+      if (res.Ret === 200) {
+        this.boardInfo = res.Data
+        this.boardDataList = res.Data.List || []
+        console.log(this.permissionBtn);
       }
     },
 
     // 我的看板列表
-    async getMyBoardList(){
-      const res=await apiBiBoard.myBoardList()
-      if(res.Ret===200){
-        this.myBoardList=res.Data||[]
-        if(this.myBoardList.length>0){
-          this.selectBoardId=this.myBoardList[0].BiDashboardId
+    async getMyBoardList() {
+      const res = await apiBiBoard.myBoardList()
+      if (res.Ret === 200) {
+        this.myBoardList = res.Data || []
+        if (this.myBoardList.length > 0) {
+          this.selectBoardId = this.myBoardList[0].BiDashboardId
         }
       }
     },
 
     // 共享看板列表
-    async getShareBoardList(){
-      const res=await apiBiBoard.shareBoardList()
-      if(res.Ret===200){
-        const myArr=res.Data.MyList||[]
-        const otherArr=res.Data.OtherList||[]
-        const temarr=[...myArr,...otherArr]
-        this.shareBoardList=[
+    async getShareBoardList() {
+      const res = await apiBiBoard.shareBoardList()
+      if (res.Ret === 200) {
+        const myArr = res.Data.MyList || []
+        const otherArr = res.Data.OtherList || []
+        const temarr = [...myArr, ...otherArr]
+        this.shareBoardList = [
           {
-            label:'我共享的',
-            value:'my_share',
-            children:myArr.map(item=>{
+            label: '我共享的',
+            value: 'my_share',
+            children: myArr.map(item => {
               return {
-                label:item.BiDashboardName,
-                value:item.BiDashboardId
+                label: item.BiDashboardName,
+                value: item.BiDashboardId
               }
             })
           },
           {
-            label:'共享给我的',
-            value:'other_share',
-            children:otherArr.map(item=>{
+            label: '共享给我的',
+            value: 'other_share',
+            children: otherArr.map(item => {
               return {
-                label:item.BiDashboardName,
-                value:item.BiDashboardId
+                label: item.BiDashboardName,
+                value: item.BiDashboardId
               }
             })
           }
         ]
 
-        if(temarr.length>0){
-          this.selectBoardId=temarr[0].BiDashboardId
+        if (temarr.length > 0) {
+          this.selectBoardId = temarr[0].BiDashboardId
         }
       }
     },
 
     // 公共看板列表
-    async getCommonBoardList(){
-      const res=await apiBiBoard.commonBoardList()
-      if(res.Ret===200){
-        this.commonBoardList=res.Data||[]
-        if(this.commonBoardList.length>0){
-          this.selectBoardId=this.commonBoardList[0].BiDashboardId
+    async getCommonBoardList() {
+      const res = await apiBiBoard.commonBoardList()
+      if (res.Ret === 200) {
+        this.commonBoardList = res.Data || []
+        if (this.commonBoardList.length > 0) {
+          this.selectBoardId = this.commonBoardList[0].BiDashboardId
         }
       }
     },
 
     handleNavTypeChange(e) {
-      if(this.navType===e) return
+      if (this.navType === e) return
       this.navType = e
 
-      this.selectBoardId=0
-      this.boardDataList=[]
-      this.boardDetail=null
-      if(this.navType===1){
+      this.selectBoardId = 0
+      this.boardDataList = []
+      this.boardDetail = null
+      if (this.navType === 1) {
         this.getMyBoardList()
         return
       }
-      if(this.navType===2){
+      if (this.navType === 2) {
         this.getShareBoardList()
         return
       }
-      if(this.navType===3){
+      if (this.navType === 3) {
         this.getCommonBoardList()
         return
       }