Commit c7bf1a0c authored by zhengke's avatar zhengke

修复 头部分享 bug

parent fbf367db
......@@ -104,7 +104,7 @@ import { ApiResult } from "@/configs/axios";
import ConfigService from "@/services/ConfigService";
import { ElMessage } from "element-plus";
import { PropType, inject, reactive, ref, watch } from "vue";
import {createPlayLink, createSaleEditorLink, downLoadFile, formatDateTimeToRead, query} from '@/utils/common'
import {createPlayLink, createSaleEditorLink, downLoadFile, formatDateTimeToRead, query, openNewBlank} from '@/utils/common'
import breadPeeling from './components/breadPeeling.vue'
import CopyFile from './components/CopyFile.vue'
import { injectKeyTemplate } from "@/types/injectKey";
......@@ -171,9 +171,10 @@ const editorFileHandler = (item:any)=>{
const ep = item.IsDownload==0?0:1
//@TODO:返回字段中缺少CreateBy,
const url = createSaleEditorLink(item.FileId,item.TempId,item.FileType,0,ep,cp)
router.push({
path:url
})
openNewBlank(url)
// router.push({
// path:url
// })
}
const getDocumentData = async () => {
if(loading.value) return
......@@ -202,7 +203,7 @@ const getDocumentData = async () => {
const openFileDocument = (item:any) => {
let param = query()
const url = createPlayLink(item.FileId,0,2)//`${location.origin}/?uid=${param.uid}&sellId=${item.FileId}&ViewSlideshow=2`
window.open(url);
openNewBlank(url);
}
const exportDocument = (item:any,type:0|1|2) => {
downLoadFile({
......
......@@ -19,7 +19,8 @@
<el-scrollbar max-height="300px">
<div class="search-result-block" :class="{'q-mt-lg':i>0}" v-for="(x,i) in searchResult">
<div class="text-h6 text-left text-bolder q-mx-md q-mb-sm">{{x.type==1?'行程文档':'广告图'}}</div>
<div class="items row items-center q-pa-md" v-for="(item) in x.pageData" @click="item.IsEdit?editorFileHandler(item):openFilePositionHandler(item)" v-click-outside="()=>showRightContent=0" @contextmenu="()=>showRightContent=item.FileId">
<div class="items row items-center q-pa-md" v-for="(item) in x.pageData" @click="item.IsEdit?editorFileHandler(item):openFilePositionHandler(item)"
v-click-outside="()=>showRightContent=0" @contextmenu="()=>showRightContent=item.FileId">
<img class="biao" :src="(x.type==1 ?'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1708337830000_43.png':'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1708250377000_777.png')" />
<el-popover :width="200" trigger="contextmenu" :visible="showRightContent==item.FileId">
<template #reference>
......@@ -30,7 +31,8 @@
<span class="folder-path">{{x.type==1?'行程文档':'广告图'}}{{item.FolderName=='/'?'':'/'+item.FolderName}}</span>
</el-tooltip>
<span class="q-mx-md col"> {{formatDateTimeToRead((item.UpdateTime && item.UpdateTime!=''?item.UpdateTime:item.CreateTime))}} {{ item.UpdateTime&&item.UpdateTime!=''?'修改过':'创建' }}</span>
<span>{{userInfo.EmployeeId==item.CreateBy?'我 创建的':`${item.CreateName} 分享的`}}</span>
<span>{{item.IsCreate?'我 创建的':`${item.CreateName} 分享的`}}</span>
</div>
</div>
</template>
......@@ -53,9 +55,10 @@ import { Search } from '@element-plus/icons-vue';
import ConfigService from '@/services/ConfigService';
import { useUserStore } from '@/store/user';
import { storeToRefs } from 'pinia';
import {formatDateTimeToRead} from '@/utils/common'
import {formatDateTimeToRead,createSaleEditorLink, openNewBlank } from '@/utils/common'
import { useScreenStore, useSellTemplateStore, useSlidesStore } from '@/store';
import { injectKeyTemplate } from '@/types/injectKey';
import { useRouter } from 'vue-router';
import { pl } from 'element-plus/es/locale';
const emit = defineEmits<{
......@@ -63,6 +66,7 @@ const emit = defineEmits<{
}>()
const {userInfo} = storeToRefs(useUserStore())
const router = useRouter()
const searchKey = ref<string>('')
const isSearchFocus = ref(false)
const searchType = ref<string>('0')
......@@ -72,6 +76,7 @@ const lastKeyword = ref('')
const searchData = ref({} as any);
searchData.value = inject(injectKeyTemplate);
const showRightContent = ref(0)
const loggedder = ref('')
loggedder.value = userInfo.value.nickname
......@@ -106,26 +111,20 @@ const searchHandler = ()=>{
}
const editorFileHandler = (item:any)=>{
let list:any = [{
id: "test-slide-1",
pageType: 0,
elements: [],
background: {
type: "solid",
color: "#ffffff",
},
}];
const SalesEditorStore = useSellTemplateStore();
useSlidesStore().setSlides(list);
const marketStore = useScreenStore();
searchData.value.sellId = item.FileId;
searchData.value.sellTempId = item.TempId;
searchData.value.TemplateType = item.FileType;
if(loggedder.value!=item.CreateName){
searchData.value.ParentFileId = 0
}else searchData.value.ParentFileId = item.FolderId
SalesEditorStore.setSalesEditor(2);
marketStore.setMarket(false);
if(item.IsEdit==0){
ElMessage.error({
message:'你没有权限执行这个操作,请联系分享者'
})
return
}
const cp = item.IsView==0?0:1
const ep = item.IsDownload==0?0:1
//@TODO:返回字段中缺少CreateBy,
const url = createSaleEditorLink(item.FileId,item.TempId,item.FileType,0,ep,cp)
openNewBlank(url)
// router.push({
// path:url
// })
}
const searchByType = (t:1|2,count:number)=>{
return ConfigService.SearchFileAsync({
......@@ -142,7 +141,7 @@ const openFilePositionHandler = (item:any)=>{
let playload = {
FileId:item.FileId,
FileType:item.FileType,
FormShare:userInfo.value.EmployeeId!=item.CreateBy,
FormShare:!item.IsCreate,
Position:[] as any[]
}
if(item.FolderPath && item.FolderPath!='/'){
......@@ -158,6 +157,7 @@ const openFilePositionHandler = (item:any)=>{
playload.Position=posis
}
emit('open-position',playload)
showRightContent.value = 0
}
</script>
<style>
......
......@@ -199,9 +199,8 @@ import { ElMessage,ElTree,ElLoading, ElMessageBox } from 'element-plus';
import ConfigService from "@/services/ConfigService";
import FolderService from "@/services/FolderService";
import { injectKeyTemplate, injectKeyRecycleBin } from "@/types/injectKey";
import { createPlayLink, createSaleEditorLink, downLoadFile, formatDateTimeToRead } from "@/utils/common";
import { isPC, query,createPlayLink, createSaleEditorLink, downLoadFile, formatDateTimeToRead, openNewBlank } from "@/utils/common";
import { useSellTemplateStore, useScreenStore, useSlidesStore } from "@/store";
import { isPC, query } from '@/utils/common'
import ShareForm from "./ShareForm.vue";
import Folder from "./Folder.vue";
......@@ -633,9 +632,10 @@ import { useRouter } from 'vue-router';
const ep =userInfo.value.nickname!=row.CreateName&&row.IsDownLoad==0?0:1
//@TODO:返回字段中缺少CreateBy,
const url = createSaleEditorLink(row.FileId,row.TempId,row.FileType,row.ParentFileId,ep,cp)
router.push({
path:url
})
openNewBlank(url)
// router.push({
// path:url
// })
} else {
// 2文件夹详情
if (type == 2) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment