Commit af5295e4 authored by zhengke's avatar zhengke

批量删除文件

parent 4f42aff7
......@@ -216,8 +216,10 @@ const getTemplate = async (item:any) => {
imgList.value[i].imgTop = (scrollToElement.value[i].offsetHeight+30)*i
}
document.querySelector("#scrollId .Details-left").addEventListener("scroll", handleScroll);
scrollContainer.value.scrollTop = 0
},500)
}
}else{
ElMessage.warning({
showClose: true,
......
......@@ -75,6 +75,13 @@ class ConfigService{
return Api.Post("triptemplate_GetTripOther",params)
}
/**
* 回收站删除
*/
static async DeleteFileBatch(params : any):Promise<HttpResponse>{
return Api.Post("triptemplate_DeleteFileBatch",params)
}
/**
* 销售删除模版
*/
......
......@@ -26,10 +26,15 @@ export type SlideDataSource = Ref<{
TravelAatas?:TravelAatas,
[key: string]: any;
}>
export type RecycleBinDelete = Ref<{
RecycleBinList:Array<any>,
RecoveryManage:boolean,
}>
export type OperaKey = Ref<number>
export const injectKeySlideScale: InjectionKey<SlideScale> = Symbol()
export const injectKeySlideId: InjectionKey<SlideId> = Symbol()
export const injectKeyRadioGroupValue: InjectionKey<RadioGroupValue> = Symbol()
export const injectKeyDataSource: InjectionKey<SlideDataSource> = Symbol()
export const injectKeyTemplate: InjectionKey<SlideDataSource> = Symbol()
export const injectKeyMapOperaIndex: InjectionKey<OperaKey> = Symbol()
\ No newline at end of file
export const injectKeyMapOperaIndex: InjectionKey<OperaKey> = Symbol()
export const injectKeyRecycleBin: InjectionKey<RecycleBinDelete> = Symbol()
\ No newline at end of file
<template>
<div class="q-px-md q-pt-lg column full-height" ref="currentRootDom">
<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()">
回收站
<div class="q-pl-lg row flex-between q-mb-lg">
<div class="col">
<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>
<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="!RefreshLoading"
@click="() => refreshHandler()"
/>
<Refresh v-else />
</el-icon>
</h5>
<div class="select-btn q-pl-lg pointer q-mt-sm">
<el-icon>
<RefreshRight
v-if="!RefreshLoading"
@click="() => refreshHandler()"
/>
<Refresh v-else />
</el-icon>
</div>
</div>
</div>
<div class="shrink q-px-lg" v-if="RecycleBinDatas.RecycleBinList&&RecycleBinDatas.RecycleBinList.length>0">
<el-button @click="BatchDeletion">
<el-icon><Delete /></el-icon>
<span class="">批量删除</span>
</el-button>
</div>
<div v-else style="height: 32px;"></div>
<div>
</div>
......@@ -50,13 +60,14 @@
</template>
<script setup lang="ts">
import { ref, reactive, watch, onMounted, PropType } from "vue";
import { ref, reactive, watch, onMounted, PropType, inject } from "vue";
import { ElMessage } from "element-plus";
import { ArrowLeft } from "@element-plus/icons-vue";
import FolderService from "@/services/FolderService";
import { ApiResult } from "@/configs/axios";
import journeyAdsList from "./components/journeyAdsList.vue";
import breadPeeling from "./components/breadPeeling.vue";
import { injectKeyRecycleBin } from "@/types/injectKey";
const props = defineProps({
currentMenu: {
......@@ -87,7 +98,8 @@
type: number;
}>({ id: -1, name: "", parentId: 0, number: 1 })
const emit = defineEmits<{
(event: 'destroy-position'): void
(event: 'destroy-position'): void,
(event: 'BatchDeletion'): void,
}>()
const queryObj = reactive({
pageIndex: 1,
......@@ -99,7 +111,17 @@
});
const loading = ref(false as any);
const RecycleBinDatas = ref({} as any);
RecycleBinDatas.value = inject(injectKeyRecycleBin);
const BatchDeletion = () =>{
if(!RecycleBinDatas.value.RecycleBinList||RecycleBinDatas.value.RecycleBinList.length==0) return ElMessage.error({
message:'请勾选需要永久删除的文件'
})
RecycleBinDatas.value.RecoveryManage = true
}
// 已选数据
const UpdateData = (obj:any) =>{
if(obj){
......
......@@ -43,7 +43,7 @@
<script setup lang="ts">
import { useUserStore } from '@/store/user';
import { storeToRefs } from 'pinia';
import { ref, watch, inject } from 'vue';
import { ref, watch, inject, provide } from 'vue';
import BrowsingHistory from './BrowsingHistory.vue'
import StarTarget from './StarTarget.vue'
import ShareList from './Share.vue';
......@@ -53,7 +53,7 @@ import { Plus,ArrowDown,Clock,Star,Share,Picture,Management,Delete,Setting } fro
import { useRouter } from 'vue-router';
import { openNewBlank } from '@/utils/common';
import { useSellTemplateStore } from '@/store';
import { injectKeyTemplate } from '@/types/injectKey'
import { injectKeyTemplate, injectKeyRecycleBin } from '@/types/injectKey'
const router = useRouter();
const sellStore = useSellTemplateStore()
......@@ -66,6 +66,9 @@ const position = ref<{FileId:number,FileType:1|2,Position:{FileId:number,FileNam
const searchData = ref({} as any)
searchData.value = inject(injectKeyTemplate)
const RecycleBinDatas = ref({} as any)
provide(injectKeyRecycleBin,RecycleBinDatas)
const openMarketHandler = (type:string='') =>{
openNewBlank(`/market/create${type}/${currentMenu.value}`)
}
......
......@@ -2,7 +2,7 @@
<el-table v-loading="loading" ref="dataTableRef" highlight-current-row class="sample-table" v-load-more="tableScrollHandler" :data="dataList" style="width: 100%"
@sort-change="sortHandler" :default-sort="{ prop: 'CreateTime', order: 'descending' }"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="20" v-if="currentMenu==3||currentMenu==4"/>
<el-table-column type="selection" width="20" v-if="currentMenu==3||currentMenu==4||currentMenu==-1"/>
<el-table-column className="indentLeft">
<template #header>
<div class="row items-center" @click="OffEdit()">
......@@ -119,6 +119,7 @@
</el-dropdown-item>
<el-dropdown-item icon="Delete" @click="editDelete(scope.row,1)">删除</el-dropdown-item>
</template>
<el-dropdown-item v-if="currentMenu==-1" icon="Delete" @click="DeleteRecycleBin(scope.row)">删除</el-dropdown-item>
<el-dropdown-item v-if="(datas.loggedder==scope.row.CreateName&&scope.row.FileType&&currentMenu!=-1)||scope.row.IsDownLoad" icon="Download" @click="exportDocument(scope.row,0)">导出PDF</el-dropdown-item>
<el-dropdown-item v-if="(datas.loggedder==scope.row.CreateName&&scope.row.FileType&&currentMenu!=-1)||scope.row.IsDownLoad" icon="Download" @click="exportDocument(scope.row,2)">导出IMG</el-dropdown-item>
<el-dropdown-item v-if="(datas.loggedder==scope.row.CreateName&&scope.row.FileType&&currentMenu!=-1)||scope.row.IsView" icon="CopyDocument" @click.stop="CopyTo(scope.row)">复制到</el-dropdown-item>
......@@ -193,7 +194,7 @@ import { ElMessage,ElTree,ElLoading, ElMessageBox } from 'element-plus';
import ConfigService from "@/services/ConfigService";
import FolderService from "@/services/FolderService";
import { injectKeyTemplate } from "@/types/injectKey";
import { injectKeyTemplate, injectKeyRecycleBin } from "@/types/injectKey";
import { createPlayLink, createSaleEditorLink, downLoadFile, formatDateTimeToRead } from "@/utils/common";
import { useSellTemplateStore, useScreenStore, useSlidesStore } from "@/store";
import { isPC, query } from '@/utils/common'
......@@ -210,7 +211,7 @@ import { useRouter } from 'vue-router';
const props = defineProps({
currentMenu:{
type: Number,
default: 3,
default: 0,
},
position:{
type:Object as PropType<{FileId:number,FileType:1|2,Position:{FileId:number,FileName:string}[]}|null>,
......@@ -307,6 +308,9 @@ import { useRouter } from 'vue-router';
const downloadLink= ref()
const fileUrl = ref("")
const RecycleBinDatas = ref({} as any);
RecycleBinDatas.value = inject(injectKeyRecycleBin);
const SynchronousUpdate = async (row: any) => {
ElMessageBox.confirm(`此操作将更新行程${row.FileName},是否确定?`, "提示", {
confirmButtonText: "确定",
......@@ -360,6 +364,9 @@ import { useRouter } from 'vue-router';
window.open(url);
}
const handleSelectionChange = (val: []) =>{
if(props.currentMenu==-1){
return RecycleBinDatas.value.RecycleBinList = val
}
let obj = {
selectedDatas: val.map(x=>{return x.FileId}),
}
......@@ -676,6 +683,56 @@ import { useRouter } from 'vue-router';
}
},500)
}
// 回收站删除
const DeleteRecycleBin = async (item: any) => {
let queryMsg = {
FileList: [],
};
if(item){
queryMsg.FileList.push({FileId:item.FileId,FileType:item.FileType})
}else{
for(let i=0;i<RecycleBinDatas.value.RecycleBinList.length;i++){
let x = RecycleBinDatas.value.RecycleBinList[i]
queryMsg.FileList.push({FileId:x.FileId,FileType:x.FileType})
}
}
ElMessageBox.confirm("此操作将永久删除文件,无法恢复,是否确定?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(async () => {
try {
deleteLoading.value = ElLoading.service({
lock: true,
text: "正在处理",
});
let pageRes = await ConfigService.DeleteFileBatch(queryMsg);
if (pageRes.data.resultCode == ApiResult.SUCCESS) {
RecycleBinDatas.value.RecycleBinList = []
ElMessage({
showClose: true,
message: `删除文件成功`,
type: "success",
});
emit('refreshHandler');
} else {
ElMessage({
showClose: true,
message: `删除文件失败`,
type: "warning",
});
}
deleteLoading.value.close();
deleteLoading.value = null;
RecycleBinDatas.value.RecoveryManage = false
} catch (error) {}
})
.catch(() => {});
};
loading.value = true
setTimeout(()=>{
loading.value = false
......@@ -696,6 +753,10 @@ import { useRouter } from 'vue-router';
watch(() => props.navigations, (n,o) => {
Navigations.value = n
})
watch(() => RecycleBinDatas.value.RecoveryManage, (n,o) => {
if(n) DeleteRecycleBin()
})
setCurrentRow()
</script>
......
......@@ -55,15 +55,17 @@
<div class="row flex-end q-mb-lg">
<el-button type="primary" size="small" style="color: #ffff;">
<el-upload
ref="upload"
:on-change="(uploadFile:any, uploadFiles:any)=> uploadFontHandler(uploadFile, uploadFiles,datas.params.fontFamily)"
action=""
:limit="1"
:auto-upload="false"
accept=".ttf, .woff, otf"
:show-file-list="false"
:on-exceed="handleExceed"
>
<template #trigger>
{{datas.params.id?'替换':'上传'}}字体
<span class="text-white">{{datas.params.id?'替换':'上传'}}字体</span>
</template>
</el-upload>
</el-button>
......@@ -103,7 +105,7 @@
import { storeToRefs } from "pinia";
import { USER_DEFAULT_HEADER } from '@/configs/customer'
import { Edit,Delete } from '@element-plus/icons-vue';
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'
import { ElLoading, ElMessage, ElMessageBox, UploadInstance } from 'element-plus'
import { CustomerFonts } from '@/store/font'
import {getFonts} from '@/utils/psdParser/index'
import FontService from '@/services/FontService'
......@@ -146,6 +148,7 @@
const fonts = ref<{fontFamily:string,uploadType:number,selectedFont?:string}[]>()
const uploadingIndex = ref(-1)
const upload = ref<UploadInstance>()
const close = () => {
datas.params = {
......@@ -157,6 +160,14 @@
reduceUrl: '',
}
}
const handleExceed: UploadProps['onExceed'] = (files) => {
upload.value!.clearFiles()
const file = files[0] as UploadRawFile
upload.value!.handleStart(file)
upload.value.submit()
}
const ConfirmCreation = async () => {
//添加、编辑字体
if(!datas.params.label)return ElMessage({
......
......@@ -33,7 +33,7 @@
<div class="text-dark">账号</div>
<div class="">{{personalInfor.EmLoginMobile}}</div>
</div>
<el-button v-if="personalInfor.IsDefaultAccount==1" :disabled="personalInfor.IsDefaultAccount!=1" @click="bindDatas(4)">修改账号</el-button>
<el-button :disabled="personalInfor.IsDefaultAccount!=1" @click="bindDatas(4)">修改账号</el-button>
</div>
<div class="setting-item">
<div>
......
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