Commit 4ff950f8 authored by zhengke's avatar zhengke

优化 移动 组件

parent 1f554245
......@@ -5,6 +5,27 @@ 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)
}
/**
* 获取行程广告最近版本
*/
......
......@@ -55,94 +55,95 @@
<el-scrollbar @scroll="scrollingHandler" class="q-px-md" style="height: 100%;">
<div style="min-width: '700px';height: 100%;">
<table class="text-small" style="width: 100%">
<tr @click="OffEdit">
<th class="text-left" style="width: 20px;">
<el-checkbox
size="sm"
class="SelectAllBox"
v-model="datas.selectAll"
@click="clickSelectAll"
:indeterminate="isIndeterminate"
/>
</th>
<th colspan="2" class="text-light">
<div class="text-left q-pl-md">文档名称</div>
</th>
<th class="text-light" style="min-width: 150px; width: 150px">
<div class="row items-center just-center pointer" @click.stop="clickSort">
<span>最近浏览 </span>
<span class="column">
<el-icon class="reactive"
style="top: 3px" :class="[datas.Sort==2?'active':'']"><CaretTop /></el-icon>
<el-icon class="reactive"
style="top:-3px" :class="[datas.Sort==1?'active':'']"><CaretBottom /></el-icon>
</span>
</div>
</th>
<th class="text-light" style="min-width: 100px; width: 100px">
创建者
</th>
<th class="text-light" style="min-width: 120px; width: 120px">
操作
</th>
<tr @click="OffEdit">
<th class="text-left" style="width: 20px;">
<el-checkbox
size="sm"
class="SelectAllBox"
v-model="datas.selectAll"
@click="clickSelectAll"
:indeterminate="isIndeterminate"
/>
</th>
<th colspan="2" class="text-light">
<div class="text-left q-pl-md">文档名称</div>
</th>
<th class="text-light" style="min-width: 150px; width: 150px">
<div class="row items-center just-center pointer" @click.stop="clickSort">
<span>最近修改 </span>
<span class="column">
<el-icon class="reactive"
style="top: 3px" :class="[datas.Sort==2?'active':'']"><CaretTop /></el-icon>
<el-icon class="reactive"
style="top:-3px" :class="[datas.Sort==1?'active':'']"><CaretBottom /></el-icon>
</span>
</div>
</th>
<th class="text-light" style="min-width: 100px; width: 100px">
创建者
</th>
<th class="text-light" style="min-width: 120px; width: 120px">
操作
</th>
</tr>
<template v-for="(item,index) in dataList">
<tr class="text-5B5D62 journeyAdsple-table pointer">
<td @click.stop="OffEdit()"><div class="row items-center hoverShow"
:style="{'opacity':item.singleChoice?1:''}">
<el-checkbox size="sm" class="SelectAllBox" v-model="item.singleChoice"
@click.stop="singleChoice(item)"/></div></td>
<td style="width: 30px;" @click.stop="OffEdit()" valign="middle" >
<div :class="{'share-icon-box':item.IsShare}" style="display: inline-block;">
<img v-if="item.FileType" class="q-px-md " :src="item.FileType==1?datas.pdfImg:datas.adsImg" style="height: 25px;" />
<img v-else class="q-px-md" src="@/assets/img/file.png" style="height: 23px;" />
</div>
</td>
<td class="journeyAds-title wrap row">
<div class="col" v-if="!item.editTitle" @click.stop="OffEdit()">
<div class="row flex-center">
<el-tooltip
placement="top-start">
<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
class="journeyAds-Input"
v-model="item.FileName"
autosize
type="textarea"
placeholder="Please input"
maxlength="500"
size="small"
v-if="item.editTitle"
@blur="handleUpdateTitle(item)"
/></td>
<td class="text-center" @click.stop="OffEdit()"><span>{{item.Day?item.Day+'天前':item.UpdateTime}}</span></td>
<td class="text-center" @click.stop="OffEdit()"><span>{{item.CreateName}}</span></td>
<td class="text-center">
<div class="hoverShow row items-center just-center q-pt-sm">
<el-button type="primary" :icon="Edit" size="small" @click.stop="editDelete(item)">编辑</el-button>
<el-dropdown class="q-pl-md" trigger="click">
<el-icon size="16" color="#b1b7cf"><MoreFilled /></el-icon>
<template #dropdown>
<el-dropdown-menu class="q-pa-md" @click.stop="OffEdit">
<el-dropdown-item v-if="item.FileType" icon="EditPen" @click.stop="startEditTitle(item)">重命名</el-dropdown-item>
<el-dropdown-item v-if="item.FileType" icon="Clock" @click.stop="history(item)">历史版本</el-dropdown-item>
<el-dropdown-item icon="Position" @click.stop="()=>shareId=item.FileId">分享</el-dropdown-item>
<el-dropdown-item v-if="item.IsShare" icon="Hide" @click.stop="removeShareHandler(item)">取消分享</el-dropdown-item>
<el-dropdown-item icon="Delete" @click="editDelete(item,1)">删除</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</td>
</tr>
<template v-for="(item,index) in dataList">
<tr class="text-5B5D62 journeyAdsple-table pointer">
<td @click.stop="OffEdit()"><div class="row items-center hoverShow"
:style="{'opacity':item.singleChoice?1:''}">
<el-checkbox size="sm" class="SelectAllBox" v-model="item.singleChoice"
@click.stop="singleChoice(item)"/></div></td>
<td style="width: 30px;" @click.stop="OffEdit()">
<img v-if="item.FileType" class="q-px-md" :src="item.FileType==1?datas.pdfImg:datas.adsImg"
style="height: 25px;" />
<img v-else class="q-px-md" src="@/assets/img/file.png"
style="height: 23px;" />
</td>
<td class="journeyAds-title wrap row">
<div class="col" v-if="!item.editTitle" @click.stop="OffEdit()">
<div class="row flex-center">
<el-tooltip
placement="top-start">
<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
class="journeyAds-Input"
v-model="item.FileName"
autosize
type="textarea"
placeholder="Please input"
maxlength="500"
size="small"
v-if="item.editTitle"
@blur="handleUpdateTitle(item)"
/></td>
<td class="text-center" @click.stop="OffEdit()"><span>{{item.Day?item.Day+'天前':item.UpdateTime}}</span></td>
<td class="text-center" @click.stop="OffEdit()"><span>{{item.CreateName}}</span></td>
<td class="text-center">
<div class="hoverShow row items-center just-center q-pt-sm">
<el-button type="primary" :icon="Edit" size="small" @click.stop="editDelete(item)">编辑</el-button>
<el-dropdown class="q-pl-md" trigger="click">
<el-icon size="16" color="#b1b7cf"><MoreFilled /></el-icon>
<template #dropdown>
<el-dropdown-menu class="q-pa-md" @click.stop="OffEdit">
<el-dropdown-item v-if="item.FileType" icon="EditPen" @click.stop="startEditTitle(item)">重命名</el-dropdown-item>
<el-dropdown-item v-if="item.FileType" icon="Clock" @click.stop="history(item)">历史版本</el-dropdown-item>
<el-dropdown-item v-if="item.FileType" icon="Position" @click.stop="()=>shareId=item.FileId">分享</el-dropdown-item>
<el-dropdown-item icon="Delete" @click="editDelete(item,1)">删除</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</div>
</td>
</tr>
</template>
</table>
</template>
</table>
</div>
<div
v-if="dataList.length == 0 && !loading"
......@@ -217,6 +218,7 @@
const searchData = ref({} as any);
searchData.value = inject(injectKeyTemplate);
const deleteLoading = ref<any>(null);
const removeShareLoading = ref<any>(null);
const datas = reactive({
Sort: 0,
selectedDatas: [] as Array,
......@@ -334,7 +336,33 @@
editObj.value = JSON.parse(JSON.stringify(row));
};
const removeShareHandler= async (item:any) =>{
if(removeShareLoading.value) return
removeShareLoading.value=ElLoading.service({
lock: true,
text: "正在处理",
})
let errmsg=''
try {
let response = await ConfigService.RemoveFileShareAsync([item.FileId])
if(response.data.resultCode==ApiResult.SUCCESS){
ElMessage.success({
message:'设置成功'
})
item.IsShare=false
} else errmsg='取消分享失败,请刷新重试'
} catch (error) {
errmsg = '取消分享失败,请刷新重试'
}
if(errmsg!='') {
ElMessage.error({
message:errmsg
})
}
removeShareLoading.value.close();
removeShareLoading.value = null;
}
// 全选按钮
const clickSelectAll = () => {
setTimeout(() => {
......@@ -525,7 +553,7 @@
.journeyAds-TitleCenter {
width: 100%;
height: 18px;
padding-bottom: 21px;
margin-bottom: 3px;
overflow: hidden; /* 隐藏超出部分 */
text-overflow: ellipsis; /* 显示省略号 */
white-space: wrap; /* 不换行 */
......@@ -580,6 +608,20 @@
.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;
}
......
......@@ -56,13 +56,12 @@
:props="defaultProps"
v-model="datas.FolderId"
:data="dataList"
default-expand-all
check-strictly
:render-after-expand="false"
show-checkbox
check-on-click-node
style="width: 220px"
default-expand-all
:filter-node-method="filterNode"
@check="handleTreeNodeClick"
/>
</div>
......@@ -137,16 +136,13 @@ 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
// if(checkObj.checkedNodes.length>1)
treeRef.value.setCheckedKeys([data.FileId]);
}else{
datas.FolderId = data.FileId
treeRef.value.setCheckedKeys([data.FileId]);
}
// 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) => {
......
......@@ -494,7 +494,7 @@ const singleChoice = (row: any) => {
};
const DeleteFile = async (item: any) => {
ElMessageBox.confirm("此操作将删除该文件夹,是否确定?", "提示", {
ElMessageBox.confirm("此操作将删除该文件夹及其下的文件,是否确定?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
......
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