jwyu преди 8 месеца
родител
ревизия
e966f6d13e
променени са 2 файла, в които са добавени 39 реда и са изтрити 12 реда
  1. 10 6
      src/api/http.js
  2. 29 6
      src/views/BI_manage/index.vue

+ 10 - 6
src/api/http.js

@@ -67,6 +67,7 @@ function errorMsgShow(closableErrMsg,msg){
   }
 }
 
+let loginOutCount=0
 function checkStatus(response,closableErrMsg) {
   //处理响应数据
   if (response && response.status === 200) {
@@ -78,16 +79,19 @@ function checkStatus(response,closableErrMsg) {
     } else if (res.Ret == 403) {
       errorMsgShow(closableErrMsg,res.Msg)
     } else if (res.Ret === 408) {
-      // localStorage.setItem("auth", "")
-      localStorage.setItem("loginTime", "")
-      bus
-        .$alert(res.Msg, "提示", {
+      if(loginOutCount===0){
+        localStorage.setItem("loginTime", "")
+        bus.$alert(res.Msg, "提示", {
           showClose: false,
-        })
-        .then(() => {
+        }).then(() => {
+          loginOutCount=0
           router.replace('/login')
           // window.location.href = window.location.origin + '/login';
         });
+      }
+      loginOutCount++
+      // localStorage.setItem("auth", "")
+      
     }
     return res;
   } else {

+ 29 - 6
src/views/BI_manage/index.vue

@@ -89,9 +89,10 @@
         <el-button 
           type="text" 
           @click="handleGoEdit" 
-          v-if="navType !== 3&&permissionBtn.isShowBtn('BIBoardPermission','BIBoard_edit')"
+          v-if="canEdit"
         >{{boardInfo.IsEditing?boardInfo.Editor.Editor+'编辑中...':'编辑'}}</el-button>
-        <el-button type="text" style="color: #f00" v-if="navType !== 3&&permissionBtn.isShowBtn('BIBoardPermission','BIBoard_delete')&&currentBoardIsSelf" @click="handleDeleteBoard">删除</el-button>
+        <el-button type="text" style="color: #f00" v-if="canDelete" @click="handleDeleteBoard">删除</el-button>
+        <el-button type="text" v-if="navType === 1&&[5,6].includes(boardInfo.State)" @click="handleBackSetCommon">撤销</el-button>
       </div>
     </div>
     <!-- 看板内容模块 -->
@@ -120,6 +121,14 @@ export default {
       if(!this.boardInfo) return false
       const localAdminId=localStorage.getItem('AdminId')
       return localAdminId==this.boardInfo.SysAdminId
+    },
+    canEdit(){
+      if(!this.boardInfo) return false
+      return this.navType !== 3&&this.permissionBtn.isShowBtn('BIBoardPermission','BIBoard_edit')&&this.boardInfo.State===1
+    },
+    canDelete(){
+      if(!this.boardInfo) return false
+      return this.navType !== 3&&this.permissionBtn.isShowBtn('BIBoardPermission','BIBoard_delete')&&this.currentBoardIsSelf&&this.boardInfo.State===1
     }
   },
   data() {
@@ -162,6 +171,18 @@ export default {
     
   },
   methods: {
+    // 撤回设置公共
+    handleBackSetCommon(){
+      apiBiBoard.cancelBoardCommon({
+        BiDashboardId:this.boardInfo.BiDashboardId,
+      }).then(res=>{
+        if(res.Ret===200){
+          this.$message.success('撤销成功')
+          this.getBoardDetail()
+        }
+      })
+    },
+
     async handleGoEdit() {
       if(this.boardInfo.IsEditing&&this.boardInfo.Editor.AdminId!==Number(localStorage.getItem('AdminId'))){
         this.$message.warning(`${this.boardInfo.Editor.Editor}${this.$t('Slides.editing_progress_msg') }...`)
@@ -258,12 +279,13 @@ export default {
       if (res.Ret === 200) {
         const myArr = res.Data.MyList || []
         const otherArr = res.Data.OtherList || []
-        const temarr = [...myArr, ...otherArr]
+        const boardIds = []
         this.shareBoardList = [
           {
             label: '我共享的',
             value: 'my_share',
             children: myArr.map(item => {
+              boardIds.push(item.BiDashboardId)
               return {
                 label: item.BiDashboardName,
                 value: item.BiDashboardId
@@ -275,6 +297,7 @@ export default {
             value: 'other_share',
             children: otherArr.map(item => {
               const cArr=item.DashboardList.map(_i=>{
+                boardIds.push(_i.BiDashboardId)
                 return{
                   label: _i.BiDashboardName,
                   value: _i.BiDashboardId,
@@ -290,8 +313,8 @@ export default {
         ]
         // 编辑了分类回调 不更新选择的看板仅仅更新公共看板列表数据
         if(['update','init'].includes(type)) return
-        if (temarr.length > 0) {
-          this.selectBoardId = temarr[0].BiDashboardId
+        if (boardIds.length > 0) {
+          this.selectBoardId = boardIds[0]
         }
       }
     },
@@ -336,7 +359,7 @@ export default {
 
       this.selectBoardId = ''
       this.boardDataList = []
-      this.boardDetail = null
+      this.boardInfo = null
       if (this.navType === 1) {
         this.getMyBoardList()
         return