|
@@ -3,6 +3,7 @@ import {ref,reactive,computed} from 'vue'
|
|
import { useRouter } from 'vue-router'
|
|
import { useRouter } from 'vue-router'
|
|
import {useClassify} from './hooks/useClassify'
|
|
import {useClassify} from './hooks/useClassify'
|
|
import apiMyETA from '@/api/myETA'
|
|
import apiMyETA from '@/api/myETA'
|
|
|
|
+import apiETAForum from '@/api/etaForum'
|
|
import { showConfirmDialog, showToast } from 'vant';
|
|
import { showConfirmDialog, showToast } from 'vant';
|
|
import { useWindowSize } from '@vueuse/core'
|
|
import { useWindowSize } from '@vueuse/core'
|
|
import draggable from 'vuedraggable'
|
|
import draggable from 'vuedraggable'
|
|
@@ -21,6 +22,7 @@ const {
|
|
classifyState,
|
|
classifyState,
|
|
getMyClassify,
|
|
getMyClassify,
|
|
getPubClassify,
|
|
getPubClassify,
|
|
|
|
+ getETAForumClassify,
|
|
classifyTypeChange,
|
|
classifyTypeChange,
|
|
handleAddClassify,
|
|
handleAddClassify,
|
|
handleConfirmEditClassify,
|
|
handleConfirmEditClassify,
|
|
@@ -33,7 +35,9 @@ const {
|
|
}=useClassify()
|
|
}=useClassify()
|
|
|
|
|
|
const curChartClassifyList=computed(()=>{
|
|
const curChartClassifyList=computed(()=>{
|
|
- return classifyState.classifyTypeAct==1?classifyState.myClassifyList:classifyState.pubClassifyList
|
|
|
|
|
|
+ if(classifyState.classifyTypeAct==1) return classifyState.myClassifyList
|
|
|
|
+ if(classifyState.classifyTypeAct==2) return classifyState.pubClassifyList
|
|
|
|
+ if(classifyState.classifyTypeAct==3) return classifyState.forumClassifyList
|
|
})
|
|
})
|
|
//我的图库/公共图库opt:重命名、可见、复制、删除
|
|
//我的图库/公共图库opt:重命名、可见、复制、删除
|
|
const isOptShow = computed(()=>{
|
|
const isOptShow = computed(()=>{
|
|
@@ -66,6 +70,7 @@ function onClassifySortEnd(e){
|
|
const showClassifyPop=ref(false)
|
|
const showClassifyPop=ref(false)
|
|
|
|
|
|
async function initPage(){
|
|
async function initPage(){
|
|
|
|
+ getETAForumClassify()
|
|
getPubClassify()
|
|
getPubClassify()
|
|
await getMyClassify()
|
|
await getMyClassify()
|
|
listState.cid=classifyState.myClassifyList[0]?.MyChartClassifyId
|
|
listState.cid=classifyState.myClassifyList[0]?.MyChartClassifyId
|
|
@@ -92,7 +97,11 @@ const listState = reactive({
|
|
total:0,
|
|
total:0,
|
|
})
|
|
})
|
|
async function getChartList(){
|
|
async function getChartList(){
|
|
- const res=await apiMyETA.myChartList({
|
|
|
|
|
|
+ const res=classifyState.classifyTypeAct==3?await apiETAForum.getChartListForCollect({
|
|
|
|
+ CollectClassifyIds:`${listState.cid}`,
|
|
|
|
+ PageSize:listState.pageSize,
|
|
|
|
+ CurrentIndex:listState.page,
|
|
|
|
+ }) : await apiMyETA.myChartList({
|
|
CurrentIndex:listState.page,
|
|
CurrentIndex:listState.page,
|
|
PageSize:listState.pageSize,
|
|
PageSize:listState.pageSize,
|
|
MyChartClassifyId:listState.cid
|
|
MyChartClassifyId:listState.cid
|
|
@@ -107,7 +116,17 @@ async function getChartList(){
|
|
|
|
|
|
listState.finished=res.Data.Paging.IsEnd
|
|
listState.finished=res.Data.Paging.IsEnd
|
|
const arr=res.Data.List||[]
|
|
const arr=res.Data.List||[]
|
|
- listState.list=[...listState.list,...arr]
|
|
|
|
|
|
+ if(classifyState.classifyTypeAct==3){
|
|
|
|
+ arr.forEach(_item=>{
|
|
|
|
+ listState.list.push({
|
|
|
|
+ ..._item,
|
|
|
|
+ HaveOperaAuth:true
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ }else{
|
|
|
|
+ listState.list=[...listState.list,...arr]
|
|
|
|
+ }
|
|
|
|
+
|
|
listState.total=res.Data.Paging.Totals
|
|
listState.total=res.Data.Paging.Totals
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -118,7 +137,14 @@ function onLoad(){
|
|
|
|
|
|
// 切换分类
|
|
// 切换分类
|
|
function handleSwitchClassify(item){
|
|
function handleSwitchClassify(item){
|
|
- listState.ctype=classifyState.classifyTypeAct==1?'我的图库':'公共图库'
|
|
|
|
|
|
+ if(classifyState.classifyTypeAct==1){
|
|
|
|
+ listState.ctype='我的图库'
|
|
|
|
+ }else if(classifyState.classifyTypeAct==2){
|
|
|
|
+ listState.ctype='公共图库'
|
|
|
|
+ }else if(classifyState.classifyTypeAct==3){
|
|
|
|
+ listState.ctype='ETA社区图库'
|
|
|
|
+ }
|
|
|
|
+
|
|
listState.cid=item.MyChartClassifyId
|
|
listState.cid=item.MyChartClassifyId
|
|
listState.cname=item.MyChartClassifyName
|
|
listState.cname=item.MyChartClassifyName
|
|
listState.list=[]
|
|
listState.list=[]
|
|
@@ -180,7 +206,8 @@ function goDetail(item){
|
|
query:{
|
|
query:{
|
|
code:item.UniqueCode,
|
|
code:item.UniqueCode,
|
|
cid:listState.cid,
|
|
cid:listState.cid,
|
|
- iscommon:listState.ctype=='我的图库'?false:true
|
|
|
|
|
|
+ iscommon:listState.ctype=='我的图库'?false:true,
|
|
|
|
+ isETAForumChart:classifyState.classifyTypeAct==3?true:false
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
@@ -226,7 +253,7 @@ async function goSearch(){
|
|
@click="goDetail(item)"
|
|
@click="goDetail(item)"
|
|
>
|
|
>
|
|
<div class="van-multi-ellipsis--l2 name">{{item.ChartName}}</div>
|
|
<div class="van-multi-ellipsis--l2 name">{{item.ChartName}}</div>
|
|
- <img class="img" :src="!item.HaveOperaAuth?useNoAuth().noAuthImg:item.ChartImage" alt="">
|
|
|
|
|
|
+ <img class="img" :src="([1,11].includes(item.Source)&&!item.HaveOperaAuth)?useNoAuth().noAuthImg:item.ChartImage" alt="">
|
|
<div class="time">
|
|
<div class="time">
|
|
<span>{{item.CreateTime.slice(0,10)}}</span>
|
|
<span>{{item.CreateTime.slice(0,10)}}</span>
|
|
<img v-if="listState.ctype==='我的图库'&&checkAuthBtn(myETABtn.myChart_move)" class="remove-box" @click.stop="handleRemoveChart(item,index)" src="@/assets/imgs/myETA/icon_remove2.png" alt="">
|
|
<img v-if="listState.ctype==='我的图库'&&checkAuthBtn(myETABtn.myChart_move)" class="remove-box" @click.stop="handleRemoveChart(item,index)" src="@/assets/imgs/myETA/icon_remove2.png" alt="">
|
|
@@ -244,12 +271,20 @@ async function goSearch(){
|
|
>
|
|
>
|
|
<div class="classify-wrap">
|
|
<div class="classify-wrap">
|
|
<div class="type-box">
|
|
<div class="type-box">
|
|
- <span
|
|
|
|
|
|
+ <van-tabs class="type-tab" :active="classifyState.classifyTypeAct" @click-tab="classifyTypeChange">
|
|
|
|
+ <van-tab
|
|
|
|
+ :title="item.name"
|
|
|
|
+ :name="item.type"
|
|
|
|
+ v-for="item in classifyTypeOpt"
|
|
|
|
+ :key="item.type"
|
|
|
|
+ ></van-tab>
|
|
|
|
+ </van-tabs>
|
|
|
|
+ <!-- <span
|
|
:class="['item',item.type===classifyState.classifyTypeAct?'active':'']"
|
|
:class="['item',item.type===classifyState.classifyTypeAct?'active':'']"
|
|
v-for="item in classifyTypeOpt"
|
|
v-for="item in classifyTypeOpt"
|
|
:key="item.id"
|
|
:key="item.id"
|
|
@click="classifyTypeChange(item)"
|
|
@click="classifyTypeChange(item)"
|
|
- >{{item.name}}</span>
|
|
|
|
|
|
+ >{{item.name}}</span> -->
|
|
</div>
|
|
</div>
|
|
<draggable
|
|
<draggable
|
|
v-if="classifyState.classifyTypeAct==1"
|
|
v-if="classifyState.classifyTypeAct==1"
|
|
@@ -281,6 +316,21 @@ async function goSearch(){
|
|
</li>
|
|
</li>
|
|
</template>
|
|
</template>
|
|
</draggable>
|
|
</draggable>
|
|
|
|
+ <ul
|
|
|
|
+ class="list-box"
|
|
|
|
+ v-else-if="classifyState.classifyTypeAct==3"
|
|
|
|
+ >
|
|
|
|
+ <li
|
|
|
|
+ class="select-text-disabled item"
|
|
|
|
+ v-for="element in curChartClassifyList"
|
|
|
|
+ :key="element.CollectClassifyId"
|
|
|
|
+ @click="handleSwitchClassify(element)"
|
|
|
|
+ >
|
|
|
|
+ <div :class="['van-ellipsis name',element.CollectClassifyId===listState.cid&&'active-name']">{{element.ClassifyName}}</div>
|
|
|
|
+ </li>
|
|
|
|
+ </ul>
|
|
|
|
+
|
|
|
|
+
|
|
<div class="public-classify-wrap" v-else>
|
|
<div class="public-classify-wrap" v-else>
|
|
<van-collapse class="classify-level" v-model="activeMenu" :border="false">
|
|
<van-collapse class="classify-level" v-model="activeMenu" :border="false">
|
|
<van-collapse-item
|
|
<van-collapse-item
|
|
@@ -480,8 +530,9 @@ async function goSearch(){
|
|
display: flex;
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
.type-box{
|
|
.type-box{
|
|
- padding: $page-padding;
|
|
|
|
- box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.08);
|
|
|
|
|
|
+ // padding: $page-padding;
|
|
|
|
+ border-bottom: 1px solid #C6C6C6;
|
|
|
|
+ // box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.08);
|
|
.item{
|
|
.item{
|
|
margin-right: 40px;
|
|
margin-right: 40px;
|
|
font-size: 32px;
|
|
font-size: 32px;
|