jwyu 1 жил өмнө
parent
commit
cee12ce2b8

+ 2 - 0
src/assets/styles/common.scss

@@ -1,5 +1,7 @@
 :root:root {
     --van-blue: #0052D9;
+    --van-red:#C54322;
+    --van-green:#2BA471; 
     --van-gray-3:#DCDFE6;
 }
 

+ 2 - 0
src/hooks/useDownLoadFile.js

@@ -62,6 +62,8 @@ export function useDownLoadFile(){
     const cancelDownload=()=>{
         // 取消请求
         controller.abort()
+        progress.value=0
+        fileSize.value=0
     }
 
     return {

+ 8 - 1
src/router/index.js

@@ -92,7 +92,14 @@ const router = createRouter({
 function setKeeplive(to){
 	const cachedViewsStore=useCachedViewsStore()
 	if(to.meta.keepAlive){
-		cachedViewsStore.addCaches(to.name)
+		let name=to.name
+		if(name==='PPTENSearch'){
+			name='PPTSearch'
+		}
+		if(name==='PPTENDetail'){
+			name='PPTDetail'
+		}
+		cachedViewsStore.addCaches(name)
 	}
 }
 

+ 2 - 1
src/router/ppt.js

@@ -22,7 +22,8 @@ export const pptRoutes=[
         component: () => import("@/views/ppt/Detail.vue"),
         meta: { 
             title: "智能PPT",
-            hasBackHome:true
+            hasBackHome:true,
+            keepAlive:true
         },
     },
     {

+ 5 - 4
src/router/pptEn.js

@@ -11,7 +11,7 @@
         name:"PPTENIndex",
         component: () => import("@/views/ppt/Index.vue"),
         meta: { 
-            title: "智能PPT",
+            title: "英文PPT",
             hasBackHome:true,
             keepAlive:false
         },
@@ -21,8 +21,9 @@
         name:"PPTENDetail",
         component: () => import("@/views/ppt/Detail.vue"),
         meta: { 
-            title: "智能PPT",
-            hasBackHome:true
+            title: "英文PPT",
+            hasBackHome:true,
+            keepAlive:true
         },
     },
     {
@@ -36,7 +37,7 @@
         name:"PPTENPreview",
         component: () => import("@/views/ppt/Preview.vue"),
         meta: { 
-            title: "智能PPT",
+            title: "英文PPT",
             noHead:true 
         },
     },

+ 11 - 8
src/store/modules/cachedViews.js

@@ -19,15 +19,18 @@ export const useCachedViewsStore=defineStore('cachedViews',{
         },
         //将组件移除缓存
         removeCaches(name){
-            if(name===-1){
-                this.cachesList=[]
-            }else{
-                const index=this.cachesList.indexOf(name)
-                if(index!==-1){
-                    console.log('移除缓存',name);
-                    this.cachesList.splice(index,1)
+            return new Promise((resolve)=>{
+                if(name===-1){
+                    this.cachesList=[]
+                }else{
+                    const index=this.cachesList.indexOf(name)
+                    if(index!==-1){
+                        console.log('移除缓存',name);
+                        this.cachesList.splice(index,1)
+                    }
                 }
-            }
+                resolve(true)
+            })
         }
     }
 })

+ 2 - 1
src/views/myETA/components/PadClasssifyWrap.vue

@@ -48,6 +48,7 @@ function handleChangeShareStatus(type,item){
 }
 
 function goMobileSearch() {
+
     router.push({
         path:'/myETA/searchlist'
     })
@@ -215,7 +216,7 @@ function goChooseChart(){
                     readonly 
                     placeholder="请输入图表名称"
                     style="flex:1"
-                    @click="goMobileSearch"
+                    @click-input="goMobileSearch"
                 />
                 <div class="btn" @click="goChooseChart">选择图表</div>
                 <div class="btn" @click="handleAddClassify('')">添加分类</div>

+ 30 - 12
src/views/ppt/Detail.vue

@@ -1,4 +1,4 @@
-<script setup>
+<script setup name="PPTDetail">
 import { ref,nextTick} from 'vue'
 import { useRoute, useRouter } from "vue-router";
 import { vElementSize } from '@vueuse/components'
@@ -32,6 +32,7 @@ async function getPPTDetail(){
         onResize({width:document.getElementsByClassName('ppt-content-wrap')[0].clientWidth})
     })
     document.title=res.Data.Title
+    handleShowPPTOpt(true)
 }
 getPPTDetail()
 
@@ -66,7 +67,7 @@ const {
 getPPTClassifyData()
 
 // 显示更多操作
-function handleShowPPTOpt(){
+function handleShowPPTOpt(init){
     PPTOptState.data={
         AdminId: PPTInfo.value.AdminId,
         AdminRealName: PPTInfo.value.AdminRealName,
@@ -78,6 +79,7 @@ function handleShowPPTOpt(){
         Title: PPTInfo.value.Title
     }
     PPTOptState.isCommon=userInfo.value.AdminId!=PPTInfo.value.AdminId?true:false
+    if(init===true) return
     PPTOptState.show=true
 }
 
@@ -93,9 +95,12 @@ function onSelectPlayOpt(e){
         const itemH=pptContentHeight.value/conArr.value.length
         index=Math.floor(y.value/itemH)
     }
-    let routerEl
+    // 本来可以定义属性close-on-click-action自动关闭弹窗的
+    //不知道为啥加了keepalive 返回时他弹窗又会自动出来 所以加了v-if
+    //并且手动控制收起
+    showPlayOpt.value=false
     if(window.location.pathname.startsWith('/ppten')){
-        routerEl=router.resolve({
+        router.push({
             path:"/ppten/preview",
             query:{
                 id:pptId,
@@ -103,15 +108,15 @@ function onSelectPlayOpt(e){
             }
         })
     }else{
-        routerEl=router.resolve({
+        router.push({
             path:"/ppt/preview",
             query:{
                 id:pptId,
                 index
             }
         })
-    } 
-    window.open(routerEl.href,'_blank')
+    }
+    
 }
 
 
@@ -156,6 +161,14 @@ const showPopover=ref(false)
                 <img src="@/assets/imgs/icon_del.png" alt="">
                 <span>删除</span>
             </div>
+            <div class="item-box" style="flex-direction:row">
+                <span style="margin-right:4px">公开</span>
+                <van-switch 
+                    size="22px" 
+                    :model-value="PPTOptState.data.IsSingleShareBoolean"
+                    @update:model-value="handlePPTShare"
+                />
+            </div>
         </div>
         <div class="ppt-content-wrap" v-element-size="onResize">
             <template v-for="(item,index) in conArr" :key="item.id">
@@ -241,20 +254,22 @@ const showPopover=ref(false)
                         v-for="item in PPTOptState.copyActions" 
                         :key="item.GroupId"
                         @click="PPTOptState.copySelectData=item;showPopover=false"
-                    >{{item.text}}111</li>
+                    >{{item.text}}</li>
                 </ul>
                 <template #reference>
-                    <span class="select-value-box">{{PPTOptState.copySelectData.GroupName||'请选择目录'}}</span>
+                    <span 
+                        :class="['select-value-box',!PPTOptState.copySelectData.GroupName&&'grey-text']"
+                        >{{PPTOptState.copySelectData.GroupName||'请选择目录'}}</span>
                 </template>
             </van-popover>
         </div>
     </van-dialog>
     <!-- 播放选项弹窗 -->
-    <van-action-sheet 
+    <van-action-sheet
+        v-if="showPlayOpt"
         v-model:show="showPlayOpt" 
         :actions="playActions" 
         cancel-text="取消"
-        close-on-click-action
         @select="onSelectPlayOpt" 
     />
 
@@ -278,7 +293,7 @@ const showPopover=ref(false)
                 <span v-if="progress<100">{{progress}}%</span>
                 <img v-if="progress==100" width="28"  height="28" src="@/assets/imgs/icon_success.png" alt="">
             </div>
-            <div class="cancel-btn" v-show="progress<100" @click="cancelDownload">取消下载</div>
+            <div class="cancel-btn" v-show="progress<100" @click="cancelDownload();showDownload=false">取消下载</div>
         </div>
     </van-popup>
 </template>
@@ -395,6 +410,9 @@ const showPopover=ref(false)
         border-radius: 70px;
         border: 1px solid $border-color;
         min-width: 150px;
+        &.grey-text{
+            color: $font-grey;
+        }
     }
 }
 .pad-top-action-wrap{

+ 1 - 1
src/views/ppt/Index.vue

@@ -1,4 +1,4 @@
-<script setup>
+<script setup name="PPTIndex">
 import {ref,reactive} from 'vue'
 import MobileClassifyWrap from './components/MobileClassifyWrap.vue'
 import PadPPTIndexWrap from './components/PadPPTIndexWrap.vue'

+ 5 - 4
src/views/ppt/Preview.vue

@@ -1,6 +1,6 @@
 <script setup>
 import { ref,nextTick, computed} from 'vue'
-import { useRoute } from "vue-router";
+import { useRoute, useRouter } from "vue-router";
 import {apiPPTDetail} from '@/api/ppt'
 import {createPPTContent,getTemplate} from './hooks/createPPTContent'
 import { useWindowSize } from '@vueuse/core'
@@ -9,6 +9,7 @@ import { Swipe, SwipeItem,showToast } from 'vant';
 const { width, height } = useWindowSize()
 
 const route=useRoute()
+const router=useRouter()
 
 const pptId=route.query.id
 
@@ -73,7 +74,7 @@ function handleShowAction(){
 }
 
 function handleCloseWindow(){
-    window.close()
+    router.back()
 }
 
 </script>
@@ -122,8 +123,8 @@ function handleCloseWindow(){
 </style>
 <style lang="scss" scoped>
 .ppt-preview-page{
-    width: 100vw;
-    height: 100vh;
+    width: 100%;
+    height: 100%;
     background-color: rgba($color: #000000, $alpha: 1.0);
     position: relative;
     overflow: hidden;

+ 17 - 22
src/views/ppt/Search.vue

@@ -1,8 +1,10 @@
-<script setup>
+<script setup name="PPTSearch">
 import {ref} from 'vue'
 import {apiPPTSearch} from '@/api/ppt'
 import { showToast } from 'vant'
 import { useRouter,onBeforeRouteLeave } from 'vue-router'
+import {useCachedViewsStore} from '@/store/modules/cachedViews'
+const cachedViewsStore=useCachedViewsStore()
 
 const router=useRouter()
 
@@ -29,32 +31,25 @@ function onSearch(){
     handleSearch()
 }
 
-function goDetail(item){
+async function goDetail(item){
+    await cachedViewsStore.removeCaches('PPTDetail')
     if(window.location.pathname.startsWith('/ppten')){
-            router.push({
-                path:"/ppten/detail",
-                query:{
-                    id:item.PptId
-                }
-            })
+        router.push({
+            path:"/ppten/detail",
+            query:{
+                id:item.PptId
+            }
+        })
     }else{
-            router.push({
-                path:"/ppt/detail",
-                query:{
-                    id:item.PptId
-                }
-            })
+        router.push({
+            path:"/ppt/detail",
+            query:{
+                id:item.PptId
+            }
+        })
     }
 }
 
-onBeforeRouteLeave((to,from)=>{
-    if(to.path=='/ppt/index'||to.path=='/ppten/index'){
-        searchVal.value=''
-        list.value=[]
-        finished.value=false
-    }
-})
-
 </script>
 
 <template>

+ 9 - 3
src/views/ppt/components/MobileClassifyWrap.vue

@@ -2,6 +2,8 @@
 import { useRouter } from 'vue-router'
 import {useClassify} from '../hooks/useClassify'
 import {ref} from 'vue'
+import {useCachedViewsStore} from '@/store/modules/cachedViews'
+const cachedViewsStore=useCachedViewsStore()
 
 const router=useRouter()
 const {
@@ -29,7 +31,8 @@ getPPTClassifyData()
 
 
 // 跳转搜索
-function goMobileSearch(){
+async function goMobileSearch(){
+    await cachedViewsStore.removeCaches('PPTSearch')
     if(window.location.pathname.startsWith('/ppten')){
         router.push('/ppten/search')
     }else{
@@ -48,7 +51,7 @@ const showPopover=ref(false)
                 shape="round" 
                 readonly 
                 placeholder="请输入PPT标题" 
-                @click="goMobileSearch"
+                @click-input="goMobileSearch"
             />
         </div>
         <van-collapse v-model="classifyState.activeType" :border="false">
@@ -219,7 +222,7 @@ const showPopover=ref(false)
                     >{{item.text}}111</li>
                 </ul>
                 <template #reference>
-                    <span class="select-value-box">{{PPTOptState.copySelectData.GroupName||'请选择目录'}}</span>
+                    <span :class="['select-value-box',!PPTOptState.copySelectData.GroupName&&'grey-text']">{{PPTOptState.copySelectData.GroupName||'请选择目录'}}</span>
                 </template>
             </van-popover>
         </div>
@@ -413,6 +416,9 @@ const showPopover=ref(false)
         border-radius: 70px;
         border: 1px solid $border-color;
         min-width: 150px;
+        &.grey-text{
+            color: $font-grey;
+        }
     }
 }
 

+ 39 - 6
src/views/ppt/components/PadPPTIndexWrap.vue

@@ -6,6 +6,9 @@ import closeShareIcon from '@/assets/imgs/ppt/ppt_icon_user2.png'
 import {apiPPTList,apiPPTPubList} from '@/api/ppt'
 import { useRouter } from 'vue-router'
 import moment from 'moment'
+import {useCachedViewsStore} from '@/store/modules/cachedViews'
+
+const cachedViewsStore=useCachedViewsStore()
 
 const router=useRouter()
 
@@ -63,8 +66,13 @@ function handleChangePPTShare(type,item){
 }
 
 // 跳转搜索
-function goMobileSearch(){
-    router.push('/ppt/search')
+async function goMobileSearch(){
+    await cachedViewsStore.removeCaches('PPTSearch')
+    if(window.location.pathname.startsWith('/ppten')){
+        router.push('/ppten/search')
+    }else{
+        router.push('/ppt/search')
+    }
 }
 
 
@@ -219,7 +227,7 @@ const showPopover=ref(false)
                     shape="round" 
                     readonly 
                     placeholder="请输入PPT标题" 
-                    @click="goMobileSearch"
+                    @click-input="goMobileSearch"
                 />
             </div>
             <ul class="list-wrap">
@@ -230,7 +238,11 @@ const showPopover=ref(false)
                     @click="goPPTDetail(item)"
                 >
                     <div class="van-ellipsis title">{{item.Title}}</div>
-                    <img class="bg-img" src="/pptImg/pptcover_bg1.jpg" alt="">
+                    <div class="bg-img">
+                        <span class="text">{{item.Title}}</span>
+                        <img src="/pptImg/pptcover_bg1.jpg" alt="">
+                    </div>
+                    
                     <div class="time">创建时间:{{moment(item.PptCreateTime).format('YYYY-MM-DD')}}</div>
                 </li>
                 <li class="empty-item"></li>
@@ -269,10 +281,12 @@ const showPopover=ref(false)
                         v-for="item in PPTOptState.copyActions" 
                         :key="item.GroupId"
                         @click="PPTOptState.copySelectData=item;showPopover=false"
-                    >{{item.text}}111</li>
+                    >{{item.text}}</li>
                 </ul>
                 <template #reference>
-                    <span class="select-value-box">{{PPTOptState.copySelectData.GroupName||'请选择目录'}}</span>
+                    <span 
+                        :class="['select-value-box',!PPTOptState.copySelectData.GroupName&&'grey-text']"
+                        >{{PPTOptState.copySelectData.GroupName||'请选择目录'}}</span>
                 </template>
             </van-popover>
         </div>
@@ -449,6 +463,22 @@ const showPopover=ref(false)
                         width: 100%;
                         display: block;
                         margin: 10px 0;
+                        position: relative;
+                        .text{
+                            display: inline-block;
+                            width: 80%;
+                            text-align: center;
+                            position: absolute;
+                            top: 50%;
+                            left: 50%;
+                            transform: translate(-50%,-50%);
+                            color: #fff;
+                            font-size: 14px;
+                        }
+                        img{
+                            width: 100%;
+                            height: 100%;
+                        }
                     }
                 }
                 .empty-item{
@@ -498,6 +528,9 @@ const showPopover=ref(false)
             border-radius: 35px;
             border: 1px solid $border-color;
             // min-width: 150px;
+            &.grey-text{
+                color: $font-grey;
+            }
         }
     }
 

+ 6 - 1
src/views/ppt/hooks/useClassify.js

@@ -13,6 +13,9 @@ import {
     apiPPTShare,
     apiPPTCopy
 } from '@/api/ppt'
+import {useCachedViewsStore} from '@/store/modules/cachedViews'
+
+const cachedViewsStore=useCachedViewsStore()
 
 const userInfo =useUserInfo()
 
@@ -65,6 +68,7 @@ export function useClassify(){
     const handlePPTCatalogueCopy=async()=>{
         const res=await apiPPTCatalogueCopy({GroupId:fileOptState.data.GroupId})
         if(res.Ret===200){
+            showToast('复制成功')
             getPPTClassifyData()
             fileOptState.show=false
         }
@@ -199,7 +203,8 @@ export function useClassify(){
 
 
     // 跳转ppt详情
-    const goPPTDetail=(e)=>{
+    const goPPTDetail=async (e)=>{
+        await cachedViewsStore.removeCaches('PPTDetail')
         if(window.location.pathname.startsWith('/ppten')){
             router.push({
                 path:"/ppten/detail",

+ 3 - 3
src/views/report/List.vue

@@ -250,9 +250,9 @@ function handleConfirmStatus(){
     showMoreFilter.value=false
 }
 
-function goSearch(){
+async function goSearch(){
     // 删除报告搜索页的缓存
-    cachedViewsStore.removeCaches('ReportSearch')
+    await cachedViewsStore.removeCaches('ReportSearch')
     router.push('/report/search')
 }
 
@@ -267,7 +267,7 @@ function goSearch(){
                     shape="round" 
                     readonly 
                     placeholder="请输入报告标题或作者"
-                    @click="goSearch"
+                    @click-input="goSearch"
                 />
                 <div :class="['menu-icon',showClassify?'active':'']" @click="showClassify=true">
                     <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">

+ 4 - 0
src/views/report/components/AudioBox.vue

@@ -97,6 +97,10 @@ function handleAudioTimeChange(type){
                     <rect width="8" height="40" fill="white"/>
                     <rect x="28" width="8" height="40" fill="white"/>
                 </svg>
+                <svg v-show="!play" class="play-btn" style="transform: rotate(-180deg);" width="38" height="42" viewBox="0 0 38 42" fill="none" xmlns="http://www.w3.org/2000/svg">
+                    <path d="M36.8138 19.2476C38.1953 20.0074 38.1953 21.9926 36.8138 22.7524L2.96383 41.3699C1.63093 42.103 5.42246e-07 41.1387 6.0874e-07 39.6175L2.23633e-06 2.38254C2.30282e-06 0.861333 1.63093 -0.102989 2.96384 0.630109L36.8138 19.2476Z" fill="white"/>
+                </svg>
+
             </div>
             <img class="time-btn" src="@/assets/imgs/icon_audio_time_next.png" alt="" @click="handleAudioTimeChange('next')">
         </div>