|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<page-meta :page-style="showFilter? 'overflow: hidden;' : ''" :scroll-top="pageMetaScrollTop" />
|
|
|
- <view class="chart-page" v-if="true">
|
|
|
+ <view class="chart-page" v-if="hasAuth">
|
|
|
<van-sticky style="background: #fff">
|
|
|
<view class="flex search-wrap" id="search-wrap">
|
|
|
<van-search
|
|
@@ -45,7 +45,7 @@
|
|
|
</view>
|
|
|
|
|
|
<!-- 无权限 -->
|
|
|
- <noAuth v-else></noAuth>
|
|
|
+ <noAuth :info="noAuthData" v-else></noAuth>
|
|
|
|
|
|
<!-- 筛选弹窗 -->
|
|
|
<van-popup
|
|
@@ -78,6 +78,7 @@
|
|
|
:rowHeight="rowHeight"
|
|
|
:listHeight="classifyListHeight+20"
|
|
|
@onclick="myClassifyClick"
|
|
|
+ @confirm="myClassifyMoveEnd"
|
|
|
></dragSorts>
|
|
|
</block>
|
|
|
</view>
|
|
@@ -89,7 +90,7 @@
|
|
|
import chartItem from './component/chartItem.vue'
|
|
|
import dragSorts from '../../components/chartClassifyItem/HM-dragSorts.vue'
|
|
|
import noAuth from './component/noAuth.vue'
|
|
|
-import {apiChartList,apiChartClassifyList,apiChartMove} from '@/api/chart'
|
|
|
+import {apiChartList,apiChartClassifyList,apiChartMove,apiClassifyMove} from '@/api/chart'
|
|
|
export default {
|
|
|
components: {
|
|
|
'chart-item':chartItem,
|
|
@@ -114,6 +115,9 @@ export default {
|
|
|
rowHeight:44,
|
|
|
|
|
|
searchVal:'',//图库搜素关键词
|
|
|
+
|
|
|
+ hasAuth:true,//是否有权限
|
|
|
+ noAuthData:null,//没有权限时传给无权限组件的值
|
|
|
}
|
|
|
},
|
|
|
onLoad() {
|
|
@@ -155,6 +159,7 @@ export default {
|
|
|
})
|
|
|
// console.log(res);
|
|
|
if(res.code===200){
|
|
|
+ this.hasAuth=true
|
|
|
if(res.data){
|
|
|
// 公共图库分类下数据不允许拖动
|
|
|
let arr=res.data.map(item=>{
|
|
@@ -168,10 +173,13 @@ export default {
|
|
|
}else{
|
|
|
this.finished=true
|
|
|
}
|
|
|
+ }else if(res.code===403){//无权限
|
|
|
+ this.hasAuth=false
|
|
|
+ this.noAuthData=res.data
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- //移动排序结束
|
|
|
+ //图表移动排序结束
|
|
|
async chartSortend(e){
|
|
|
// curIndex 为排序前元素所在位置 listData为排序后的数组
|
|
|
let {curIndex,listData}=e.detail
|
|
@@ -203,15 +211,15 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- // 点击某项
|
|
|
+ // 图表点击某项
|
|
|
chartClick(e){
|
|
|
console.log(e.detail.data);
|
|
|
uni.navigateTo({
|
|
|
- url:'/pages-chart/chartDetail'
|
|
|
+ url:'/pages-chart/chartDetail?chartInfoId='+e.detail.data.ChartInfoId
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- // 移动时滚动
|
|
|
+ // 图表移动时滚动
|
|
|
chartScroll(e){
|
|
|
uni.stopPullDownRefresh()
|
|
|
this.pageMetaScrollTop=e.detail.scrollTop
|
|
@@ -258,12 +266,37 @@ export default {
|
|
|
this.showFilter=false
|
|
|
},
|
|
|
|
|
|
+ // 分类移动
|
|
|
+ async myClassifyMoveEnd(e){
|
|
|
+ const moveTarget=e.moveRow
|
|
|
+ const index=e.moveTo// 拖动后的序号
|
|
|
+ const list=e.list//拖动后的列表
|
|
|
+ // console.log(moveTarget.myChartClassifyId);
|
|
|
+ // console.log(index);
|
|
|
+ // console.log(list);
|
|
|
+ const PrevClassifyId=list[index-1]&&list[index-1].myChartClassifyId||0
|
|
|
+ const NextClassifyId=list[index+1]&&list[index+1].myChartClassifyId||0
|
|
|
+ const res=await apiClassifyMove({
|
|
|
+ MyChartClassifyId:moveTarget.myChartClassifyId,
|
|
|
+ PrevClassifyId:PrevClassifyId,
|
|
|
+ NextClassifyId:NextClassifyId
|
|
|
+ })
|
|
|
+ if(res.code===200){
|
|
|
+ this.myClassifyList=list
|
|
|
+ }else{
|
|
|
+ uni.showToast({
|
|
|
+ title: '移动失败',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
// 搜索关键词变化
|
|
|
searchValChange(e){
|
|
|
this.searchVal=e.detail
|
|
|
},
|
|
|
|
|
|
- // 确认搜索
|
|
|
+ // 确认搜索 搜索图表下的都不允许拖动排序
|
|
|
onSearch(){
|
|
|
this.initPage()
|
|
|
this.isPublic=true
|