Commit 3a65d394 authored by 罗超's avatar 罗超

Merge branch '1.2.0' of http://gitlab.oytour.com/viitto/pptist into 1.2.0

parents 56571cf2 9b1785dc
......@@ -93,7 +93,7 @@ const userLoginHandler = async ()=>{
if(param.ViewSlideshow) {
searchData.value.ViewSlideshow = param.ViewSlideshow
try {
await sellHistoryTripTemplate(param.sellId)
await sellHistoryTripTemplate(param.sellId,param.LogId)
} catch (error) {}
}
if(!ConfigId&&!model&&(param.SalesTripId&&param.SalesTripId=='')) ElMessageBox.confirm(
......@@ -115,16 +115,17 @@ onMounted(async () => {
})
// 销售历史版本模版数据
const sellHistoryTripTemplate = async (sellId:any) => {
const sellHistoryTripTemplate = async (sellId:any,LogId:any) => {
const loadingObj = ElLoading.service({
text:'正在渲染数据',
lock:true
})
try {
let queryMsg = {
Id: sellId
LogId: LogId,
FileId: sellId,
}
let dataRes = await ConfigService.sellGetTemplateDetails(queryMsg);
let dataRes = await ConfigService.GetHistoryInfo(queryMsg);
if (dataRes.data.resultCode==ApiResult.SUCCESS) {
loadingObj.close()
loading.value = false
......
......@@ -5,27 +5,6 @@ import Api,{ HttpResponse, Result } from './../utils/request';
*/
class ConfigService{
/**
* 我的回收站
*/
static async GetTripOtherRecycleBinPage(params : any):Promise<HttpResponse>{
return Api.Post("triptemplate_GetTripOtherRecycleBinPage",params)
}
/**
* 共享给我的文件
*/
static async GetShareMyFile(params : any):Promise<HttpResponse>{
return Api.Post("triptemplate_GetShareMyFile",params)
}
/**
* 获取我的收藏
*/
static async GetTripCollectListPage(params : any):Promise<HttpResponse>{
return Api.Post("triptemplate_GetTripCollectListPage",params)
}
/**
* 获取行程广告最近版本
*/
......@@ -40,6 +19,13 @@ class ConfigService{
return Api.Post("triptemplate_SetTripBrowse",params)
}
/**
* 历史版本详情
*/
static async GetHistoryInfo(params : any):Promise<HttpResponse>{
return Api.Post("triptemplate_GetHistoryInfo",params)
}
/**
* 历史版本另存、替换
*/
......
......@@ -2,6 +2,21 @@ import Api,{ HttpResponse, Result } from './../utils/request';
class FolderService{
/**
* 我的回收站
*/
static async GetTripOtherRecycleBinPage(params : any):Promise<HttpResponse>{
return Api.Post("triptemplate_GetTripOtherRecycleBinPage",params)
}
/**
* 获取我的收藏
*/
static async GetTripCollectListPage(params : any):Promise<HttpResponse>{
return Api.Post("triptemplate_GetTripCollectListPage",params)
}
/**
* 复制文件夹、文件到指定目录
*/
......
......@@ -77,6 +77,7 @@
</div>
<div class="col">
<BrowsingHistory :current-menu="currentMenu" v-if="currentMenu==0"></BrowsingHistory>
<StarTarget :current-menu="currentMenu" v-if="currentMenu==1"></StarTarget>
<journeyAds :position="position" :current-menu="currentMenu" v-if="currentMenu==3||currentMenu==4" @destroy-position="()=>position=null"></journeyAds>
<ShareList :position="position" v-if="currentMenu==2" @destroy-position="()=>position=null"></ShareList>
</div>
......@@ -90,6 +91,7 @@ import { storeToRefs } from 'pinia';
import { ref,reactive,provide,inject } from 'vue';
import SearchDocument from './components/SearchDocument.vue'
import BrowsingHistory from './components/BrowsingHistory.vue'
import StarTarget from './components/StarTarget.vue'
import ShareList from './Share.vue';
import journeyAds from './components/journeyAds.vue'
import { Plus,ArrowDown,Clock,Star,Share,Picture,Management,Delete,RefreshRight,Refresh,Loading } from '@element-plus/icons-vue';
......
......@@ -144,7 +144,7 @@ import CopyFile from "./CopyFile.vue";
isCopyTo.value = true
}else {
let param = query()
const url = `${process.env.VUE_APP_SHARE_URL}/?uid=${param.uid}&sellId=${row.FileId}&ViewSlideshow=1`
const url = `${process.env.VUE_APP_SHARE_URL}/?uid=${param.uid}&sellId=${row.FileId}&LogId=${row.LogId}&ViewSlideshow=1`
window.open(url);
}
}
......
<template>
<div class="q-px-md q-pt-lg">
<div class="q-pl-lg row q-mb-lg">
<div class="col row items-center q-pl-md">
<h5 class="row items-center">
<span
class="pointer"
@click="BackInquire"
><el-icon class="q-pt-md" v-if="queryObj.FileId > 0" size="20"
><ArrowLeft /></el-icon
></span>
<span class="q-pl-md"
:class="[queryObj.FileId == 0?'':'row items-center']">
<span class="pointer" @click="queryObj.FileId=0,refreshHandler()">
星标
</span>
<breadPeeling v-if="queryObj.FileId" :navigations="Navigations"
@Inquire="breadPeelingInquire"></breadPeeling>
</span>
</h5>
<div class="select-btn q-pl-lg pointer q-mt-sm">
<el-icon>
<RefreshRight
v-if="!datas.journeyAds.RefreshLoading"
@click="() => refreshHandler()"
/>
<Refresh v-else />
</el-icon>
</div>
</div>
<div>
<el-dropdown v-if="datas.selectedDatas.length>0" trigger="click" class="q-px-md">
<el-button>
<el-icon><CopyDocument /></el-icon>
<span class="">批量操作</span>
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item icon="Expand" @click="MoveFile(0)">移动至</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
<!--
<el-dropdown trigger="click">
<el-button>新建</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="() => operaFolder(0, '')"
>新建文件夹</el-dropdown-item
>
<el-dropdown-item
@click="(searchData.TemplateType = 1), sellAdd(1)"
v-if="currentMenu == 3"
>新建行程</el-dropdown-item
>
<el-dropdown-item
@click="(searchData.TemplateType = 2), sellAdd(3)"
v-if="currentMenu == 4"
>建广告图</el-dropdown-item
>
</el-dropdown-menu>
</template>
</el-dropdown> -->
</div>
</div>
</div>
<div
ref="SellTemplateRef"
class="journeyAds-container"
style="height: 100%; overflow: auto"
>
<el-scrollbar @scroll="scrollingHandler" class="q-px-md" style="height: 100%;">
<journeyAdsList
:current-menu="currentMenu"
:position="position"
:set-file-list="datas.setFileList"
:list="dataList"
:msg="queryObj"
:navigations="Navigations"
:selected-datas="datas.selectedDatas"
@UpdateData="UpdateData"
@success="success"
@refreshHandler="refreshHandler"></journeyAdsList>
<div
v-if="dataList.length == 0 && !loading"
class="q-mt-lg bg-white rounded"
style="padding: 30px 10px 30px 10px"
>
<el-empty description="暂无数据" />
</div>
<el-divider
class="no-bg q-mt-lg"
v-if="queryObj.pageCount == queryObj.pageIndex && !loading && queryObj.pageCount != 1"
>
<span
class="text-small bg-white"
style="padding: 0 10px; color: #a3a3a3"
>已加载完成所有数据</span
>
</el-divider>
<div
style="height: 40px"
class="q-mt-md no-bg"
background="transparent"
v-loading="loading"
element-loading-text="正在加载中"
></div>
</el-scrollbar>
</div>
<Folder
:folder-id="folderObj?.id"
:folder-name="folderObj?.name"
:parent-id="folderObj.parentId"
:folder-type="folderObj?.type"
v-if="folderObj.id > -1"
@close="() => (folderObj.id = -1)"
@success="refreshHandler()"
></Folder>
<TreeFile v-if="isTreeFile"
:details="journeyAdsDetails"
:selected-datas="datas.selectedDatas"
:set-file-list="datas.setFileList"
:file-type="queryObj.FileType"
:file-id="queryObj.FileId"
:msg="queryObj"
@close="() => {journeyAdsDetails = '';isTreeFile=false}"
@success="success()"></TreeFile>
</template>
<script setup lang="ts">
import { ref, reactive, provide, watch, inject, onMounted, PropType } from "vue";
import { ElLoading, ElMessage, ElMessageBox } from "element-plus";
import { MoreFilled, Edit, ArrowLeft,CopyDocument,DCaret,CaretTop,CaretBottom } from "@element-plus/icons-vue";
import ConfigService from "@/services/ConfigService";
import FolderService from "@/services/FolderService";
import { injectKeyTemplate } from "@/types/injectKey";
import { getDaysBetween,formatDateTimeToRead } from "@/utils/common";
import { useSellTemplateStore, useScreenStore, useSlidesStore } from "@/store";
import ShareForm from "./ShareForm.vue";
import Folder from "./Folder.vue";
import HistoricalVersion from "./HistoricalVersion.vue";
import TreeFile from "./TreeFile.vue";
import breadPeeling from "./breadPeeling.vue";
import { ApiResult } from "@/configs/axios";
import journeyAdsList from "./journeyAdsList.vue";
const SalesEditorStore = useSellTemplateStore();
const marketStore = useScreenStore();
const props = defineProps({
currentMenu: {
type: Number,
default: 3,
},
position:{
type:Object as PropType<{FileId:number,FileType:1|2,Position:{FileId:number,FileName:string}[]}|null>,
default:null
}
});
const PopoverVisibleControls = ref(false);
const journeyAdsDetails = ref('');
const isTreeFile = ref(false)
const Navigations = ref([] as Array<any>);
const dataList = ref([] as Array<any>);
const NewDataList = ref([] as Array<any>);
const searchData = ref({} as any);
searchData.value = inject(injectKeyTemplate);
const datas = reactive({
selectedDatas: [] as Array,
selectAll: false as any,
journeyAds: { RefreshLoading: false } as any,
fileList: [] as any,
setFileList: [] as any,
pdfImg:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1708337830000_43.png",
adsImg:
"https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1708250377000_777.png",
folderImg: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1708250377000_777.png",
});
const folderObj = ref<{
id: number;
name: string;
parentId: number;
type: number;
}>({ id: -1, name: "", parentId: 0, number: 1 });
let TemplateType = 0;
if (searchData.value.SellTemplateType)
TemplateType = searchData.value.SellTemplateType;
const emit = defineEmits<{
(event: 'destroy-position'): void
}>()
const queryObj = reactive({
pageIndex: 1,
pageSize: 50,
pageCount: 0, //总页数
FileName: '',
FileType: '',
FileId: 0,
OrderByType: 2,//1 升序 2倒序
});
const loading = ref(false as any);
const SellTemplateRef = ref<any>();
// 已选数据
const UpdateData = (obj:any) =>{
if(obj){
if(obj.list) dataList.value = obj.list
if(obj.selectedDatas) datas.selectedDatas = obj.selectedDatas
}
}
const success = () => {
isTreeFile.value = false;
datas.selectedDatas = [];
for (let index = 0; index < dataList.value.length; index++) {
const element = dataList.value[index]
element.singleChoice = false;
}
refreshHandler()
}
// 导航
const BackInquire = () => {
datas.selectedDatas = [];
let Navigation = Navigations.value[Navigations.value.length-2]
if(Navigation&&Navigation.FileId){
breadPeelingInquire(Navigation.FileId,Navigations.value.length-2)
}else breadPeelingInquire(0,0)
}
const breadPeelingInquire = (FileId:number,index:number)=> {
datas.selectedDatas = [];
Navigations.value.splice(index+1, Navigations.value.length-1)
queryObj.FileId = FileId
refreshHandler()
}
const sellAdd = (type:number) =>{
searchData.value.sellId = 0
searchData.value.sellTempId = 0
SalesEditorStore.setSalesEditor(type)
marketStore.setMarket(true)
}
// 移动到文件夹
const MoveFile = () => {
datas.setFileList = []
for(let i=0;i<dataList.value.length;i++){
for(let j=0;j<datas.selectedDatas.length;j++){
if(dataList.value[i].FileId==datas.selectedDatas[j]){
datas.setFileList.push(
{
FileId: dataList.value[i].FileId,
FileType: dataList.value[i].FileType,
ParentFileId: dataList.value[i].ParentFileId
}
)
}
}
}
isTreeFile.value = true
}
const querySearchHandler = async () => {
if(loading.value) return
loading.value = true;
try {
if (queryObj.pageIndex == 1) dataList.value = [];
let pageRes = await FolderService.GetTripCollectListPage(queryObj);
if (pageRes.data.resultCode == 1) {
let arrList = function (list) {
list.forEach((x) => {
x.show = false;
x.singleChoice = false;
x.Id = ''
x.showSelect = false
const date1 = new Date();
const date2 = new Date(x.UpdateTime);
x.Day = getDaysBetween(date1, date2);
});
};
arrList(pageRes.data.data.pageData);
datas.selectedDatas = Array.from(new Set(datas.selectedDatas))
dataList.value = dataList.value.concat(pageRes.data.data.pageData);
queryObj.pageCount = pageRes.data.data.pageCount;
}
loading.value = false;
datas.journeyAds.RefreshLoading = false;
} catch (error) {
loading.value = false;
datas.journeyAds.RefreshLoading = false;
}
};
const scrollingHandler = () => {
if (SellTemplateRef.value && !loading.value) {
let maxHeight =
SellTemplateRef.value.scrollHeight - SellTemplateRef.value.offsetHeight;
let scrollTop = SellTemplateRef.value.scrollTop;
if (
(maxHeight - scrollTop == 0 || maxHeight - scrollTop < 1) &&
queryObj.pageCount > queryObj.pageIndex
) {
queryObj.pageIndex++;
querySearchHandler();
}
}
};
const refreshHandler = (obj:any) => {
if(obj){
if(obj.FileId) {
queryObj.FileId = obj.FileId
datas.selectedDatas = []
}
if(obj.OrderByType) queryObj.OrderByType = obj.OrderByType
if(obj.Navigations) Navigations.value = obj.Navigations
}
datas.journeyAds.RefreshLoading = true;
queryObj.pageIndex = 1;
querySearchHandler();
};
const operaFolder = (id: number, name: string) => {
folderObj.value.id = id;
folderObj.value.name = name;
folderObj.value.type = queryObj.FileType;
folderObj.value.parentId = queryObj.FileId
};
const checkPositionHandler = (n:any)=>{
if(n){
if(n.Position && n.Position.length>0){
Navigations.value=n.Position
queryObj.FileId = n.Position[n.Position.length-1].FileId
queryObj.FileType = 0
}else{
Navigations.value=[]
queryObj.FileId = 0
queryObj.FileType = n.FileType
}
emit('destroy-position')
}
}
watch(
() => searchData.value.SellTemplateType,
(n, o) => {
datas.selectedDatas = [];
queryObj.FileType = n;
queryObj.FileId = 0;
refreshHandler();
}
);
watch(() => queryObj.FileId,(n, o) => {
if(!n) Navigations.value = []
}
);
watch(() => props.position,(n,o)=>{
if(n){
checkPositionHandler(n)
refreshHandler()
}
},{
deep:true
})
onMounted(() => {});
checkPositionHandler(props.position)
querySearchHandler();
</script>
<style lang="scss" scoped>
@import url("../../../assets/styles/common.css");
.SelectAllBox {
position: relative;
top: 3px;
}
.journeyAds-title {
}
.journeyAds-TitleCenter {
width: 100%;
height: 18px;
margin-bottom: 3px;
overflow: hidden; /* 隐藏超出部分 */
text-overflow: ellipsis; /* 显示省略号 */
white-space: wrap; /* 不换行 */
position: relative;
padding-right: 20px;
}
.journeyAds-TitleCenter span {
position: absolute;
right: 16px;
top: 0px;
}
.journeyAds-Input {
padding-right: 20px;
position: relative;
margin-bottom: 2px;
::v-deep(.el-textarea__inner) {
padding: 5px;
background: #f5f5f5;
}
}
.journeyAds-container {
position: relative;
overflow: auto;
}
.journeyAds-container th {
background: #fff;
position: sticky;
top: 0px;
z-index: 2;
}
.journeyAdsple-table td > div {
display: flex;
}
.journeyAdsple-table td,
.journeyAds-container th {
border-bottom: 1px solid #f6f6f6;
}
.journeyAdsple-table td:first-child,
.journeyAdsple-table td:nth-child(2),
.journeyAds-container th:first-child {
border: 0;
}
.journeyAdsple-table td {
padding-bottom: 6px;
}
.journeyAdsple-table td:nth-child(2) {
padding-bottom: 0;
}
.hoverShow {
opacity: 0;
}
.journeyAdsple-table:hover .hoverShow {
opacity: 1;
}
.share-icon-box{
position: relative;
}
.share-icon-box::after{
display: block;
position: absolute;
bottom: -4px;
right: 6px;
content: " ";
background: url('../../../assets/img/share.png');
width: 14px;
height: 14px;
z-index: 2;
}
.active {
color: $themeColor;
}
</style>
\ No newline at end of file
......@@ -140,13 +140,6 @@ import FolderService from "@/services/FolderService";
// 树目前的选中状态对象,包含 checkedNodes、checkedKeys、halfCheckedNodes、halfCheckedKeys 四个属性
if (checkObj.checkedKeys.length != 0) {
datas.FolderObj = data
// if (checkObj.checkedKeys.length == 2) {
// datas.FolderId = data.FileId
// treeRef.value.setCheckedKeys([data.FileId]);
// }else{
// datas.FolderId = data.FileId
// treeRef.value.setCheckedKeys([data.FileId]);
// }
}
}
const filterNode = (value: string, data: Tree) => {
......@@ -226,7 +219,6 @@ import FolderService from "@/services/FolderService";
const recursive = (arrs:Array,disabled:any) =>{
console.log(props.setFileList[0],'=====')
let isDisableds:Boolean
if(arrs.length>0) arrs.forEach(x => {
isDisableds = (props.selectedDatas.indexOf(x.FileId)!=-1&&!props.details)||props.details.FileId==x.FileId||disabled?true:false
......
......@@ -178,6 +178,10 @@ import CopyFile from "./CopyFile.vue";
type:Object,
required:{}
},
setFileList:{
type:Array,
required:[]
},
selectedDatas:{
type:Array,
required:[]
......@@ -279,25 +283,10 @@ import CopyFile from "./CopyFile.vue";
}
// 移动到文件夹
const MoveFile = (item:any) => {
if(item) journeyAdsDetails.value = item
else {
datas.setFileList = []
for(let i=0;i<dataList.value.length;i++){
for(let j=0;j<datas.selectedDatas.length;j++){
if(dataList.value[i].FileId==datas.selectedDatas[j]){
datas.setFileList.push(
{
FileId: dataList.value[i].FileId,
FileType: dataList.value[i].FileType,
ParentFileId: dataList.value[i].ParentFileId
}
)
}
}
}
}
journeyAdsDetails.value = item
isTreeFile.value = true
}
// 历史版本
const history = (row: any) => {
journeyAdsDetails.value = row;
......@@ -413,12 +402,13 @@ import CopyFile from "./CopyFile.vue";
emit('UpdateData',obj)
};
const getSelectBox = () => {
isIndeterminate.value = false;
let checkedCount = datas.selectedDatas.length;
let datasList = dataList.value.length;
if (checkedCount > 0 && datasList == checkedCount) {
datas.selectAll = true
};
if (checkedCount > 0 && (datasList > checkedCount||datasList < checkedCount)) {
if (checkedCount > 0&& (datasList > checkedCount||datasList < checkedCount)) {
datas.selectAll = ""
isIndeterminate.value = true;
}
......@@ -574,27 +564,17 @@ import CopyFile from "./CopyFile.vue";
shareFileType.value=item.FileType
shareId.value =item.FileId
}
watch(() => props.list, (n,o) => {
if (props.list) {
nextTick(() => {
dataList.value = props.list
for (let index = 0; index < dataList.value.length; index++) {
const element = dataList.value[index];
if (datas.selectAll) {
element.singleChoice = true;
datas.selectedDatas.push(element.FileId);
} else if (
datas.selectedDatas.length > 0 &&
datas.selectedDatas.indexOf(element.FileId) != -1
) element.singleChoice = true;
}
datas.selectAll = false
isIndeterminate.value = false
datas.selectedDatas = []
})
}
})
watch(() => props.selectedDatas, (n,o) => {
datas.selectedDatas = props.selectedDatas
getSelectBox()
})
watch(() => props.navigations, (n,o) => {
Navigations.value = n
......
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