jwyu 6 сар өмнө
parent
commit
a9db581bfe

+ 3 - 2
src/views/BI_manage/index.vue

@@ -92,7 +92,7 @@
           v-if="canEdit"
         >{{boardInfo.IsEditing?boardInfo.Editor.Editor+'编辑中...':'编辑'}}</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>
+        <el-button type="text" v-if="navType === 1&&[4,5,6].includes(boardInfo.State)" @click="handleBackSetCommon">撤销</el-button>
       </div>
     </div>
     <!-- 看板内容模块 -->
@@ -157,6 +157,7 @@ export default {
     if(this.$route.query.id){
       
       this.selectBoardId=Number(this.$route.query.id)
+      this.navType=Number(this.$route.query.type)
       if(this.$route.query.type==1){
         this.getMyBoardList('init')
       }else if(this.$route.query.type==2){
@@ -222,7 +223,7 @@ export default {
       this.$message.success('删除成功')
       this.selectBoardId =''
       this.boardDataList = []
-      this.boardDetail = null
+      this.boardInfo = null
       if (this.navType === 1) {
         this.getMyBoardList()
         return

+ 18 - 8
src/views/home_manage/components/SelectBoard.vue

@@ -48,12 +48,22 @@ export default {
       type: Boolean,
       default: false
     },
-    boardId:''
+    boardId:'',
+    homeBoardInfo:null
   },
   watch: {
     show(n) {
       if (n) {
-        this.selectBoardId=this.boardId||''
+        if(this.boardId&&this.homeBoardInfo){
+          if(this.homeBoardInfo.FromType===1){
+            this.selectBoardId='我的看板_'+this.boardId
+          }else if(this.homeBoardInfo.FromType===2){
+            this.selectBoardId='共享看板_'+this.boardId
+          }else{
+            this.selectBoardId='公共看板_'+this.boardId
+          }
+        }
+        
         this.getList()
       }
     }
@@ -97,7 +107,7 @@ export default {
       }
 
       const res=await apiBiBoard.setHomePageBoard({
-        BiDashboardId:this.selectBoardId,
+        BiDashboardId:Number(this.selectBoardId.split('_')[1]),
         FromType:FromType
       })
       if(res.Ret===200){
@@ -108,6 +118,7 @@ export default {
     },
 
     // 看板列表
+    // 由于一个看板既可以在我的也可以在共享也可以在公共 所以id加个前缀
     async getList(type) {
       const resMy = await apiBiBoard.myBoardList()
       if (resMy.Ret === 200) {
@@ -115,7 +126,7 @@ export default {
         this.list[0].children = arr.map(item => {
           return {
             label: item.BiDashboardName,
-            value: item.BiDashboardId
+            value: '我的看板_'+item.BiDashboardId
           }
         })
       }
@@ -131,7 +142,7 @@ export default {
             children: myArr.map(item => {
               return {
                 label: item.BiDashboardName,
-                value: item.BiDashboardId
+                value: '共享看板_'+item.BiDashboardId
               }
             })
           },
@@ -142,7 +153,7 @@ export default {
               const cArr=item.DashboardList.map(_i=>{
                 return{
                   label: _i.BiDashboardName,
-                  value: _i.BiDashboardId,
+                  value: '共享看板_'+_i.BiDashboardId,
                 }
               })
               return {
@@ -173,12 +184,11 @@ export default {
             obj2.children=item2.DashboardList?item2.DashboardList.map(item3=>{
               return {
                 label:item3.BiDashboardName,
-                value:item3.BiDashboardId,
+                value:'公共看板_'+item3.BiDashboardId,
               }
             }):[]
             return obj2
           }):[]
-          console.log(obj1);
 
           return obj1
         })

+ 1 - 1
src/views/home_manage/index.vue

@@ -11,7 +11,7 @@
     <BIBoardContent v-model="boardDataList"/>
 
     <!-- 设置看板 -->
-    <SelectBoard v-model="showSet" :boardId="boardId" @change="getBoardData"/>
+    <SelectBoard v-model="showSet" :boardId="boardId" :homeBoardInfo="homeBoardInfo" @change="getBoardData"/>
   </div>
 </template>