Commit 8ecaba8c authored by zhengke's avatar zhengke

文件夹

parent c8ddf84c
...@@ -120,6 +120,9 @@ page { ...@@ -120,6 +120,9 @@ page {
.flex-end{ .flex-end{
justify-content: end; justify-content: end;
} }
.flex-center{
justify-content: center;
}
.text-primary{ .text-primary{
color:#0b40fe; color:#0b40fe;
} }
......
...@@ -57,6 +57,7 @@ const saveFolder=async ()=>{ ...@@ -57,6 +57,7 @@ const saveFolder=async ()=>{
try { try {
let response = await FolderService.SetFolderAsync(props.folderId,name.value,props.parentId,props.folderType) let response = await FolderService.SetFolderAsync(props.folderId,name.value,props.parentId,props.folderType)
if(response.data.resultCode==ApiResult.SUCCESS){ if(response.data.resultCode==ApiResult.SUCCESS){
emit('close')
emit('success') emit('success')
ElMessage.success({ ElMessage.success({
message:'操作成功' message:'操作成功'
......
<template> <template>
<div class="q-px-md q-pt-lg"> <div class="q-px-md q-pt-lg">
<div class="q-pl-lg row q-mb-lg"> <div class="q-pl-lg row q-mb-lg">
<div class="col row items-center q-pl-md"> <div class="col row items-center q-pl-md">
<h5 class="row items-center"> <h5>
<span class="pointer" @click="()=>{queryObj.FileId=0;refreshHandler()}"><el-icon class="q-pt-md" v-if="queryObj.FileId>0" size="20"><ArrowLeft /></el-icon></span> <template v-if="currentMenu==3">行程文档</template>
<span v-if="queryObj.FileId==0" class="q-pl-md"> <template v-else-if="currentMenu==4">广告图</template>
<template v-if="currentMenu==3">行程文档</template> </h5>
<template v-else-if="currentMenu==4">广告图</template> <div class="select-btn q-pl-lg pointer q-mt-sm">
</span> <el-icon>
<span v-else class="q-pl-md row items-center"> <RefreshRight v-if="!datas.journeyAds.RefreshLoading"
<span> @click="()=>refreshHandler()"/>
<template v-if="currentMenu==3">行程文档</template> <Refresh v-else />
<template v-else-if="currentMenu==4">广告图</template> </el-icon>
</span> </div>
<span>/{{Navigation.FileName}}</span> </div>
</span> <div>
</h5> <el-dropdown trigger="click">
<div class="select-btn q-pl-lg pointer q-mt-sm"> <el-button>新建</el-button>
<el-icon> <template #dropdown>
<RefreshRight v-if="!datas.journeyAds.RefreshLoading" <el-dropdown-menu>
@click="()=>refreshHandler()"/> <el-dropdown-item @click="()=>operaFolder(0,'')">新建文件夹</el-dropdown-item>
<Refresh v-else /> <el-dropdown-item @click="searchData.TemplateType=1,sellAdd(1)" v-if="currentMenu==3">新建行程</el-dropdown-item>
</el-icon> <el-dropdown-item @click="searchData.TemplateType=2,sellAdd(3)" v-if="currentMenu==4">建广告图</el-dropdown-item>
</div> </el-dropdown-menu>
</div> </template>
<div> </el-dropdown>
<el-dropdown trigger="click"> </div>
<el-button>新建</el-button> </div>
<template #dropdown> </div>
<el-dropdown-menu> <div ref="SellTemplateRef" class="journeyAds-container" style="height: 100%;overflow: auto;">
<el-dropdown-item @click="()=>operaFolder(0,'')">新建文件夹</el-dropdown-item> <el-scrollbar @scroll="scrollingHandler" height="100%" class="q-px-md">
<el-dropdown-item @click="searchData.TemplateType=1,sellAdd(1)" v-if="currentMenu==3">新建行程</el-dropdown-item> <div style="min-width:'700px';overflow-x: scroll;">
<el-dropdown-item @click="searchData.TemplateType=2,sellAdd(3)" v-if="currentMenu==4">建广告图</el-dropdown-item> <table class="text-small" style="width: 100%;">
</el-dropdown-menu> <tr @click.stop="OffEdit">
</template> <th class="text-left" style="width: 20px;"><el-checkbox size="sm" class="SelectAllBox" v-model="datas.selectAll"
</el-dropdown> @click="clickSelectAll"
</div> :indeterminate="isIndeterminate"/></th>
</div> <th colspan="2" class="text-light"><div class="text-left q-pl-md">文档名称</div></th>
</div> <th class="text-light" style="min-width: 100px;width: 110px;">最近修改</th>
<div ref="SellTemplateRef" class="journeyAds-container" style="height: 100%;overflow: auto;"> <th class="text-light" style="min-width: 100px;width: 100px;">创建者</th>
<el-scrollbar @scroll="scrollingHandler" height="100%" class="q-px-md"> <th class="text-light" style="min-width: 120px;width: 120px;">操作</th>
<div style="min-width:'700px';overflow-x: scroll;"> </tr>
<table class="text-small" style="width: 100%;"> <template v-for="(item,index) in dataList">
<tr @click.stop="OffEdit"> <tr class="text-5B5D62 journeyAdsple-table pointer" v-on:click.right="handleRightClick(item)">
<th class="text-left" style="width: 20px;"><el-checkbox size="sm" class="SelectAllBox" v-model="datas.selectAll" <td @click.stop="OffEdit"><div class="row items-center hoverShow"
@click="clickSelectAll" :style="{'opacity':item.singleChoice?1:''}">
:indeterminate="isIndeterminate"/></th> <el-checkbox size="sm" class="SelectAllBox" v-model="item.singleChoice"
<th colspan="2" class="text-light"><div class="text-left q-pl-md">文档名称</div></th> @click="singleChoice(item)"/></div></td>
<th class="text-light" style="min-width: 150px;width: 150px;">最近修改</th> <td style="width: 30px;" @click.stop="OffEdit">
<th class="text-light" style="min-width: 100px;width: 100px;">创建者</th> <img v-if="item.TemplateType" class="q-px-md" :src="item.TemplateType==1?datas.pdfImg:datas.adsImg"
<th class="text-light" style="min-width: 120px;width: 120px;">操作</th> style="height: 25px;" />
</tr> <img v-else class="q-px-md" :src="datas.folderImg"
<template v-for="(item,index) in dataList"> style="height: 25px;" />
<tr class="text-5B5D62 journeyAdsple-table pointer"> </td>
<td @click.stop="OffEdit"><div class="row items-center hoverShow" <td class="journeyAds-title wrap row">
:style="{'opacity':item.singleChoice?1:''}"> <div class="col" v-if="!item.editTitle" @click.stop="OffEdit">
<el-checkbox size="sm" class="SelectAllBox" v-model="item.singleChoice" <div class="row flex-center">
@click="singleChoice(item)"/></div></td> <el-tooltip
<td style="width: 30px;" @click.stop="OffEdit"> effect="dark"
<img v-if="item.FileType" class="q-px-md" :src="item.FileType==1?datas.pdfImg:datas.adsImg" placement="top-start">
style="height: 25px;" /> <template #content><div style="max-width: 600px;">{{item.Title}}</div></template>
<img v-else @click.stop="editDelete(item,2)" class="q-px-md" :src="datas.adsImg" <div class="journeyAds-TitleCenter">{{item.Title}}
style="height: 25px;" /> <span v-if="item.Title.length>70">...</span>
</td> </div>
<td class="journeyAds-title wrap row"> </el-tooltip>
<div v-if="!item.editTitle" class="col" @click.stop="item.FileType?OffEdit():editDelete(item,2)">
<el-tooltip
class="box-item"
effect="dark"
placement="top">
<template #content><div style="max-width: 600px;">{{item.FileName}}</div></template>
<div class="journeyAds-TitleCenter">{{item.FileName}}
<span v-if="item.FileName.length>70">...</span>
</div>
</el-tooltip>
</div> </div>
<el-input </div>
class="journeyAds-Input" <el-input
v-model="item.FileName" class="journeyAds-Input"
autosize v-model="item.Title"
type="textarea" autosize
placeholder="Please input" type="textarea"
maxlength="500" placeholder="Please input"
size="small" maxlength="500"
v-if="item.editTitle" size="small"
@blur="handleUpdateTitle(item)"/> v-if="item.editTitle"
</td> @blur="handleUpdateTitle(item)"
<td class="text-center" @click.stop="item.FileType?OffEdit():editDelete(item,2)"><span>{{item.Day?item.Day+'天前':item.UpdateTime}}</span></td> /></td>
<td class="text-center" @click.stop="item.FileType?OffEdit():editDelete(item,2)"><span>{{item.CreateName}}</span></td> <td class="text-center" @click.stop="OffEdit"><span>{{item.Day?item.Day+'天前':item.UpdateTime}}</span></td>
<td class="text-center"> <td class="text-center" @click.stop="OffEdit"><span>{{item.CreateByName}}</span></td>
<div class="hoverShow row items-center just-center q-pt-sm"> <td class="text-center">
<el-button type="primary" :icon="Edit" size="small" @click.stop="editDelete(item)">编辑</el-button> <div class="hoverShow row items-center just-center q-pt-sm">
<el-dropdown class="q-pl-md" trigger="click"> <el-button type="primary" :icon="Edit" size="small" @click.stop="editDelete(item)">编辑</el-button>
<el-icon size="16" color="#b1b7cf"><MoreFilled /></el-icon> <el-dropdown class="q-pl-md" trigger="click">
<template #dropdown> <el-icon size="16" color="#b1b7cf"><MoreFilled /></el-icon>
<el-dropdown-menu class="q-pa-md" @click.stop="OffEdit"> <template #dropdown>
<el-dropdown-item v-if="item.FileType" icon="EditPen" @click.stop="startEditTitle(item)">重命名</el-dropdown-item> <el-dropdown-menu class="q-pa-md" @click.stop="OffEdit">
<el-dropdown-item v-if="item.FileType" icon="Clock" @click.stop="history(item)">历史版本</el-dropdown-item> <el-dropdown-item icon="EditPen" @click.stop="startEditTitle(item)">重命名</el-dropdown-item>
<el-dropdown-item v-if="item.FileType" icon="Position" @click="()=>shareId=item.FileId">分享</el-dropdown-item> <el-dropdown-item icon="Clock" @click.stop="history(item)">历史版本</el-dropdown-item>
<el-dropdown-item icon="Delete" @click="editDelete(item,1)">删除</el-dropdown-item> <el-dropdown-item icon="Position" @click="()=>shareId=item.Id">分享</el-dropdown-item>
</el-dropdown-menu> <el-dropdown-item icon="Delete" @click="editDelete(item,1)">删除</el-dropdown-item>
</template> </el-dropdown-menu>
</el-dropdown> </template>
</div> </el-dropdown>
</td> </div></td>
</tr> </tr>
</template> </template>
</table> </table>
</div> </div>
<div v-if="dataList.length == 0 && !loading" class="q-mt-lg bg-white rounded" <div v-if="dataList.length == 0 && !loading" class="q-mt-lg bg-white rounded"
style="padding: 30px 10px 30px 10px;"> style="padding: 30px 10px 30px 10px;">
<el-empty description="暂无数据" /> <el-empty description="暂无数据" />
</div> </div>
<el-divider class="no-bg q-mt-lg" v-if='queryObj.pageCount == queryObj.pageIndex && !loading'> <el-divider class="no-bg q-mt-lg" v-if='queryObj.pageCount == queryObj.pageIndex && !loading'>
<span class="text-small bg-white" style="padding: 0 10px;color:#a3a3a3">已加载完成所有数据</span> <span class="text-small bg-white" style="padding: 0 10px;color:#a3a3a3">已加载完成所有数据</span>
</el-divider> </el-divider>
<div style="height:40px;" class="q-mt-md no-bg" background="transparent" v-loading="loading" element-loading-text="正在加载中"></div> <div style="height:40px;" class="q-mt-md no-bg" background="transparent" v-loading="loading" element-loading-text="正在加载中"></div>
</el-scrollbar> </el-scrollbar>
</div> </div>
<ShareForm :id="shareId" v-if="shareId>0" @close="()=>shareId=0"></ShareForm> <ShareForm :id="shareId" v-if="shareId>0" @close="()=>shareId=0"></ShareForm>
<Folder :folder-id="folderObj?.id" :folder-name="folderObj?.name" <Folder :folder-id="folderObj?.id" :folder-name="folderObj?.name" :parent-id="folderObj.parentId" v-if="folderObj.id>-1" @close="()=>folderObj.id=-1" @success="refreshHandler()"></Folder>
:parent-id="folderObj.parentId" :folder-type="folderObj?.type" v-if="folderObj.id>-1" <HistoricalVersion :details="journeyAdsDetails" v-if="journeyAdsDetails.Id>0" @close="()=>journeyAdsDetails={}"></HistoricalVersion>
@close="()=>folderObj.id=-1" @success="()=>{folderObj.id=-1;refreshHandler()}"></Folder>
<HistoricalVersion :details="journeyAdsDetails"
v-if="journeyAdsDetails.FileId>0"
@close="()=>journeyAdsDetails={}"></HistoricalVersion>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, reactive, provide, watch, inject, onMounted } from 'vue' import { ref, reactive, provide, watch, inject, onMounted } from 'vue'
import { ElLoading, ElMessage, ElMessageBox } from "element-plus"; import { ElLoading, ElMessage, ElMessageBox } from "element-plus";
import { MoreFilled,Edit,ArrowLeft } from '@element-plus/icons-vue' import { MoreFilled,Edit } from '@element-plus/icons-vue'
import ConfigService from '@/services/ConfigService' import ConfigService from '@/services/ConfigService'
import FolderService from '@/services/FolderService'; import { injectKeyTemplate } from '@/types/injectKey'
import { injectKeyTemplate } from '@/types/injectKey' import { getDaysBetween } from '@/utils/common'
import { getDaysBetween } from '@/utils/common' import { useSellTemplateStore, useScreenStore, useSlidesStore } from '@/store'
import { useSellTemplateStore, useScreenStore, useSlidesStore } from '@/store' import ShareForm from './ShareForm.vue';
import ShareForm from './ShareForm.vue'; import Folder from './Folder.vue';
import Folder from './Folder.vue'; import HistoricalVersion from './HistoricalVersion.vue';
import HistoricalVersion from './HistoricalVersion.vue';
import Draggable from 'vuedraggable' const SalesEditorStore = useSellTemplateStore()
const marketStore = useScreenStore()
const SalesEditorStore = useSellTemplateStore() const props = defineProps({
const marketStore = useScreenStore() currentMenu:{
const props = defineProps({ type:Number,
currentMenu:{ default:3
type:Number, }
default:3 })
}
})
const PopoverVisibleControls = ref(false) const PopoverVisibleControls = ref(false)
const shareId = ref(0) const shareId = ref(0)
const journeyAdsDetails = ref({}) const journeyAdsDetails = ref({})
const Navigation = ref({}) const showHistory = ref(true)
const showHistory = ref(true) const isIndeterminate = ref(false)
const isIndeterminate = ref(false) const dataList = ref([] as Array < any > )
const dataList = ref([] as Array < any > ) const searchData = ref({} as any)
const searchData = ref({} as any) searchData.value = inject(injectKeyTemplate)
searchData.value = inject(injectKeyTemplate) const datas = reactive({
const deleteLoading = ref<any>(null) selectedDatas: [] as Array,
const datas = reactive({ selectAll: false as any,
selectedDatas: [] as Array, journeyAds:{RefreshLoading:false} as any,
selectAll: false as any, pdfImg: 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1708337830000_43.png',
journeyAds:{RefreshLoading:false} as any, adsImg: 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1708250377000_777.png',
pdfImg: 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1708337830000_43.png', folderImg: 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1708250377000_777.png',
adsImg: 'https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Test/Upload/Goods/1708250377000_777.png',
folderImg: '',
}) })
const folderObj = ref<{id:number,name:string,parentId:number,type:number}>({id:-1,name:'',parentId:0,number:1}) const folderObj = ref<{id:number,name:string,parentId:number}>({id:-1,name:'',parentId:0})
let TemplateType = 0 let TemplateType = 0
if(searchData.value.SellTemplateType) TemplateType = searchData.value.SellTemplateType if(searchData.value.SellTemplateType) TemplateType = searchData.value.SellTemplateType
const queryObj = reactive({ const queryObj = reactive({
pageIndex: 1, Title: '',
pageSize: 20, pageIndex: 1,
pageCount: 0, //总页数 pageSize: 20,
FileType: TemplateType, pageCount: 0, //总页数
FileId: 0 TemplateType: TemplateType,
}) })
const editObj = reactive({}) const editObj = reactive({})
//datas.journeyAds = inject('journeyAds') //datas.journeyAds = inject('journeyAds')
const loading = ref(false as any) const loading = ref(false as any)
const SellTemplateRef = ref<any>() const SellTemplateRef = ref<any>()
// 长按鼠标 const history = (row:any) => {
const handleFileDrop = (event) => { journeyAdsDetails.value = row
event.preventDefault(); }
const files = event.dataTransfer.files;
this.uploadFiles(files);
}
const uploadFiles = (files:any) => {
console.log(files,'=====files')
}
const LongPressMouse = (row:any) => {
// console.log(row,'-----')
}
// 历史版本
const history = (row:any) => {
journeyAdsDetails.value = row
}
// 重命名 //
const OffEdit = () => { const handleRightClick = () =>{
for(let i=0;i<dataList.value.length;i++){
dataList.value[i].editTitle = false
if(editObj.value&&editObj.value.FileId
&&dataList.value[i].FileId==editObj.value.FileId) {
dataList.value[i].FileName = editObj.value.FileName
}
}
}
const handleUpdateTitle = (row:any) => {
if(!row.FileName) row.FileName = editObj.value.FileName
row.editTitle = false
if(row.FileName!=editObj.value.FileName) {
editObj.value.FileName = row.FileName
SetSellTemplate(row)
}
}
const startEditTitle = (row:any) => {
row.editTitle = true
editObj.value = JSON.parse(JSON.stringify(row))
}
// 保存重命名 }
const SetSellTemplate = async (row:any) => {
try {
let queryMsg = {
FileId: row.FileId,
Title: editObj.value.FileName
}
let TemplateRes = await ConfigService.ReNameTripOther(queryMsg);
if (TemplateRes.data.resultCode == 1) {
ElMessage({
showClose: true,
message: '重命名成功',
type: 'success',
})
}else{
ElMessage({
showClose: true,
message: '重命名失败',
type: 'warning',
})
}
} catch (error) {}
}
// 全选按钮 // 重命名
const clickSelectAll = () => { const OffEdit = () => {
if(datas.selectAll) { for(let i=0;i<dataList.value.length;i++){
datas.selectedDatas = dataList.value.map(x=>{ dataList.value[i].editTitle = false
return x.FileId if(editObj.value&&editObj.value.Id
}) &&dataList.value[i].Id==editObj.value.Id) {
}else { dataList.value[i].Title = editObj.value.Title
datas.selectedDatas = [] }
isIndeterminate.value = false }
} }
const handleUpdateTitle = (row:any) => {
setTimeout(()=>{ if(!row.Title) return ElMessage({
for(let i=0;i<dataList.value.length;i++){ showClose: true,
if(datas.selectAll==true) dataList.value[i].singleChoice = true message: '文档名称不能为空',
else dataList.value[i].singleChoice = false type: 'warning',
} })
},100) row.editTitle = false
} if(row.Title!=editObj.value.Title) {
const singleChoice = (row:any) => { editObj.value.Title = row.Title
if(!row.singleChoice){ SetSellTemplate(row)
datas.selectedDatas.push(row.FileId) }
}else { }
let index const startEditTitle = (row:any) => {
for(let i=0;i<datas.selectedDatas.length;i++){ for(let i=0;i<dataList.value.length;i++){
if(datas.selectedDatas[i] == row.FileId) index = i dataList.value[i].editTitle = false
} if(dataList.value[i].Id==row.Id) {
datas.selectedDatas.splice(index,1) row.editTitle = true
} sellGetTripTemplate(row)
isIndeterminate.value = false }
let checkedCount = datas.selectedDatas.length }
let datasList = dataList.value.length
if(datasList>0 }
&&checkedCount>0 // 销售模版数据
&&datasList==checkedCount) datas.selectAll = true const sellGetTripTemplate = async (row:any) =>{
if(datasList>0 try {
&&checkedCount>0 let queryMsg = {
&&datasList>checkedCount) { Id: row.Id
datas.selectAll = '' }
isIndeterminate.value = true let dataRes = await ConfigService.sellGetTemplateDetails(queryMsg);
} if (dataRes.data.resultCode == 1) {
if(datasList==0&&checkedCount==0) datas.selectAll = '' editObj.value = dataRes.data.data
}
} catch (error) {
}
}
// 保存重命名
const SetSellTemplate = async (row:any) => {
try {
let TempId = row.TempId
let Id = row.Id
let queryMsg = {
Id: Id,
TempId: TempId,
TempData: editObj.value.TempData,
Title: editObj.value.Title,
OWidth: 0,
OHeight: 0,
}
if(editObj.value.TemplateType==2){
queryMsg.OWidth = editObj.value.Width
queryMsg.OHeight = editObj.value.Height
}
let TemplateRes = await ConfigService.sellSetTemplate(queryMsg);
if (TemplateRes.data.resultCode == 1) {
ElMessage({
showClose: true,
message: '重命名成功',
type: 'success',
})
}else{
ElMessage({
showClose: true,
message: '重命名失败',
type: 'warning',
})
}
} catch (error) {}
}
} // 全选按钮
const clickSelectAll = () => {
if(datas.selectAll) {
datas.selectedDatas = dataList.value.map(x=>{
return x.Id
})
}else {
datas.selectedDatas = []
isIndeterminate.value = false
}
setTimeout(()=>{
for(let i=0;i<dataList.value.length;i++){
if(datas.selectAll==true) dataList.value[i].singleChoice = true
else dataList.value[i].singleChoice = false
}
},100)
}
const singleChoice = (row:any) => {
if(!row.singleChoice){
datas.selectedDatas.push(row.Id)
}else {
let index
for(let i=0;i<datas.selectedDatas.length;i++){
if(datas.selectedDatas[i] == row.Id) index = i
}
datas.selectedDatas.splice(index,1)
}
isIndeterminate.value = false
let checkedCount = datas.selectedDatas.length
let datasList = dataList.value.length
if(datasList>0
&&checkedCount>0
&&datasList==checkedCount) datas.selectAll = true
if(datasList>0
&&checkedCount>0
&&datasList>checkedCount) {
datas.selectAll = ''
isIndeterminate.value = true
}
if(datasList==0&&checkedCount==0) datas.selectAll = ''
const DeleteFile = async (item:any) => { }
ElMessageBox.confirm( const setTemplateType = (Id:number) => {
'此操作将删除该文件夹,是否确定?', queryObj.pageIndex = 1
'提示', queryObj.TemplateType = Id
{ querySearchHandler()
confirmButtonText: '确定', }
cancelButtonText: '取消', const DeleteTemplate = async (item:any) => {
type: 'warning', ElMessageBox.confirm(
} '此操作将删除该模版,是否确定?',
).then(async () => { '提示',
try { {
let queryMsg = { confirmButtonText: '确定',
FolderId: item.FileId cancelButtonText: '取消',
} type: 'warning',
deleteLoading.value = ElLoading.service({ }
lock:true, ).then(async () => {
text:'正在处理' try {
}) let queryMsg = {
let pageRes = await FolderService.RemoveTripFolder(queryMsg); Id: item.Id
if (pageRes.data.resultCode == 1) { }
ElMessage({ deleteLoading.value = ElLoading.service({
showClose: true, lock:true,
message: `删除${queryObj.FileType==2?'广告':'行程'}文件夹成功`, text:'正在处理'
type: 'success', })
}) let pageRes = await ConfigService.sellSetRemoveTemplate(queryMsg);
refreshHandler() if (pageRes.data.resultCode == 1) {
}else { queryObj.pageIndex = 1
ElMessage({ ElMessage({
showClose: true, showClose: true,
message: `删除${queryObj.FileType==2?'广告':'行程'}文件夹失败`, message: `删除${item.TemplateType==2?'广告':'行程'}成功`,
type: 'warning', type: 'success',
}) })
} querySearchHandler()
deleteLoading.value.close() }else {
deleteLoading.value = null ElMessage({
} catch (error) {} showClose: true,
}).catch(() => {}) message: `删除${item.TemplateType==2?'广告':'行程'}失败`,
type: 'warning',
} })
}
const DeleteTemplate = async (item:any) => { deleteLoading.value.close()
ElMessageBox.confirm( deleteLoading.value = null
'此操作将删除该模版,是否确定?', } catch (error) {}
'提示', }).catch(() => {})
{
confirmButtonText: '确定', }
cancelButtonText: '取消', const editDelete = async (row:any,type:Number) => {
type: 'warning', if(type==1){
} DeleteTemplate(row)
).then(async () => { }else{
try { let list = [
let queryMsg = { {
Id: item.FileId id: 'test-slide-1',
} pageType: 0,
deleteLoading.value = ElLoading.service({ elements: [],
lock:true, background: {
text:'正在处理' type: 'solid',
}) color: '#ffffff',
let pageRes = await ConfigService.sellSetRemoveTemplate(queryMsg); },
if (pageRes.data.resultCode == 1) { }
ElMessage({ ]
showClose: true, useSlidesStore().setSlides(list)
message: `删除${queryObj.FileType==2?'广告':'行程'}成功`, searchData.value.sellId = row.Id
type: 'success', searchData.value.sellTempId = row.TempId
}) searchData.value.TemplateType = row.TemplateType
refreshHandler() SalesEditorStore.setSalesEditor(2)
}else { marketStore.setMarket(false)
ElMessage({ }
showClose: true, }
message: `删除${queryObj.FileType==2?'广告':'行程'}失败`, const querySearchHandler = async () => {
type: 'warning', loading.value = true
}) try {
} if(queryObj.pageIndex == 1) dataList.value =[]
deleteLoading.value.close() let pageRes = await ConfigService.sellGetTripOtherPage(queryObj);
deleteLoading.value = null if (pageRes.data.resultCode == 1) {
} catch (error) {} let arrList = function(list){
}).catch(() => {}) list.forEach(x => {
x.show = false
} x.singleChoice = false
const editDelete = async (row:any,type:Number) => { if(datas.selectAll) {
if(type==1){ x.singleChoice = true
if(row.FileType) DeleteTemplate(row) datas.selectedDatas.push(x.Id)
else DeleteFile(row) }else if(datas.selectedDatas.length>0&&datas.selectedDatas.indexOf(x.Id)!=-1) x.singleChoice = true
}else{ const date1 = new Date();
if(row.FileType){ const date2 = new Date(x.UpdateTime);
let list = [ x.Day = getDaysBetween(date1, date2)
{ });
id: 'test-slide-1', }
pageType: 0, arrList(pageRes.data.data.pageData)
elements: [], dataList.value = dataList.value.concat(pageRes.data.data.pageData);
background: { queryObj.pageCount = pageRes.data.data.pageCount;
type: 'solid', }
color: '#ffffff', loading.value = false
}, datas.journeyAds.RefreshLoading = false
} } catch (error) {
] loading.value = false
useSlidesStore().setSlides(list) datas.journeyAds.RefreshLoading = false
searchData.value.sellId = row.FileId }
searchData.value.sellTempId = row.TempId }
searchData.value.TemplateType = row.FileType const scrollingHandler = () =>{
SalesEditorStore.setSalesEditor(2) if(SellTemplateRef.value && !loading.value){
marketStore.setMarket(false) let maxHeight = SellTemplateRef.value.scrollHeight - SellTemplateRef.value.offsetHeight
}else { let scrollTop = SellTemplateRef.value.scrollTop
// 2文件夹详情 if((maxHeight - scrollTop==0||maxHeight - scrollTop<1) && queryObj.pageCount > queryObj.pageIndex) {
if(type==2){ queryObj.pageIndex++
queryObj.FileId = row.FileId querySearchHandler()
Navigation.value = row }
refreshHandler() }
}else{
folderObj.value.FileId=row.FileId }
folderObj.value.name=row.FileName const refreshHandler = ()=>{
folderObj.value.type=row.FileType datas.journeyAds.RefreshLoading=true
} queryObj.pageIndex = 1
querySearchHandler()
} }
} const operaFolder = (id:number,name:string)=>{
} folderObj.value.id=id
const querySearchHandler = async () => { folderObj.value.name=name
loading.value = true }
try {
if(queryObj.pageIndex == 1) dataList.value =[]
let pageRes = await FolderService.GetMyTripFolderPage(queryObj);
if (pageRes.data.resultCode == 1) {
let arrList = function(list){
list.forEach(x => {
x.show = false
x.singleChoice = false
if(datas.selectAll) {
x.singleChoice = true
datas.selectedDatas.push(x.FileId)
}else if(datas.selectedDatas.length>0&&datas.selectedDatas.indexOf(x.FileId)!=-1) x.singleChoice = true
const date1 = new Date();
const date2 = new Date(x.UpdateTime);
x.Day = getDaysBetween(date1, date2)
});
}
arrList(pageRes.data.data.pageData)
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 = ()=>{
datas.journeyAds.RefreshLoading=true
queryObj.pageIndex = 1
querySearchHandler()
}
const operaFolder = (id:number,name:string)=>{
folderObj.value.FileId=id
folderObj.value.name=name
folderObj.value.type=queryObj.FileType
console.log(folderObj.value)
}
watch(() => searchData.value.SellTemplateType, (n,o) => { watch(() => searchData.value.SellTemplateType, (n,o) => {
isIndeterminate.value = false isIndeterminate.value = false
datas.selectAll = false datas.selectAll = false
datas.selectedDatas = [] datas.selectedDatas = []
queryObj.FileType = n setTemplateType(n)
queryObj.FileId = 0 })
refreshHandler()
})
onMounted(()=>{ onMounted(()=>{
}) })
querySearchHandler() querySearchHandler()
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import url('../../../assets/styles/common.css'); @import url('../../../assets/styles/common.css');
.SelectAllBox{ .SelectAllBox{
position: relative; position: relative;
top: 3px; top: 3px;
} }
.journeyAds-title{ .journeyAds-title{
} }
.journeyAds-TitleCenter{ .journeyAds-TitleCenter{
width: 100%; width: 100%;
height: 21px; height: 18px;
overflow: hidden; /* 隐藏超出部分 */ padding-bottom: 21px;
text-overflow: ellipsis; /* 显示省略号 */ overflow: hidden; /* 隐藏超出部分 */
white-space: wrap; /* 不换行 */ text-overflow: ellipsis; /* 显示省略号 */
position: relative; white-space: wrap; /* 不换行 */
padding-right: 20px; position: relative;
} padding-right: 20px;
.journeyAds-TitleCenter span{ }
position: absolute; .journeyAds-TitleCenter span{
right: 16px; position: absolute;
top: 0px; right: 16px;
} top: 0px;
.journeyAds-Input{ }
padding-right: 20px; .journeyAds-Input{
position: relative; padding-right: 20px;
margin-bottom: 2px; position: relative;
::v-deep(.el-textarea__inner){ margin-bottom: 0px;
padding: 5px; ::v-deep(.el-textarea__inner){
background: #f5f5f5; padding: 5px;
} background: #f5f5f5;
} }
.journeyAds-container { }
position: relative; .journeyAds-container {
overflow: auto ; position: relative;
overflow: auto ;
}
.journeyAds-container th { }
background: #fff; .journeyAds-container th {
position: sticky; background: #fff;
top: 0px; position: sticky;
z-index: 2; top: 0px;
} z-index: 2;
.journeyAdsple-table td>div{ }
display: flex; .journeyAdsple-table td>div{
} display: flex;
.journeyAdsple-table td,.journeyAds-container th{ }
border-bottom: 1px solid #F6F6F6; .journeyAdsple-table td,.journeyAds-container th{
} border-bottom: 1px solid #F6F6F6;
.journeyAdsple-table td:first-child, }
.journeyAdsple-table td:nth-child(2), .journeyAdsple-table td:first-child,
.journeyAds-container th:first-child{ .journeyAdsple-table td:nth-child(2),
border: 0; .journeyAds-container th:first-child{
} border: 0;
.journeyAdsple-table td{ }
padding-bottom: 6px; .journeyAdsple-table td{
} padding-bottom: 6px;
.journeyAdsple-table td:nth-child(2){ }
padding-bottom: 0; .journeyAdsple-table td:nth-child(2){
} padding-bottom: 0;
.hoverShow{ }
opacity: 0; .hoverShow{
} opacity: 0;
.journeyAdsple-table:hover .hoverShow{ }
opacity: 1; .journeyAdsple-table:hover .hoverShow{
} opacity: 1;
}
</style> </style>
\ No newline at end of file
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