Commit 922d8095 authored by zhengke's avatar zhengke

优化 顶部搜索 编辑权限

parent 3ffc7951
......@@ -134,7 +134,7 @@
:details="journeyAdsDetails"
:type="2"
@close="() => {journeyAdsDetails = '';isCopyTo=false;datas.loading = false}"
@success="(FolderId:Number)=>SetSellTemplate(1,FolderId)"></CopyFile>
@success="(type:Number,FolderId:Number)=>SetSellTemplate(type,FolderId)"></CopyFile>
</div>
</template>
......@@ -545,10 +545,11 @@ const setTemplate = async (type) =>{
datas.loading = true
await SetTripTemplateConfig()
}else if(model.value==2&&SalesEditor.value>0){
if(type==1){
if(type==1||!searchData.value.sellId){
let obj = {
FileName: queryObj.value.Title,
FileType: queryObj.value.TemplateType
FileType: queryObj.value.TemplateType,
type: type,
}
journeyAdsDetails.value = obj
isCopyTo.value = true
......
......@@ -152,7 +152,7 @@ const save = () => {
if (props.type==1) SaveOverlay(title);
else if(props.type==2) {
let FolderId = datas.FolderId!=null?datas.FolderId:0
emit('success',FolderId);
emit('success',props.details.type,FolderId);
}
else if(!props.type) CopyId();
} catch (error) { }
......@@ -224,7 +224,6 @@ const getFile = async () => {
let FileType
if(props.details.FileType>0) FileType = props.details.FileType
else FileType = props.details.FolderType
console.log(props.details,'---',FileType)
let querys = {
FileType: FileType,
};
......
......@@ -19,7 +19,7 @@
<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="editorFileHandler(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>
......@@ -35,7 +35,7 @@
</div>
</template>
<el-menu mode="vertical">
<el-menu-item index="1" @click="editorFileHandler(item)">打开文件</el-menu-item>
<el-menu-item v-if="item.IsEdit" index="1" @click="editorFileHandler(item)">打开文件</el-menu-item>
<el-menu-item index="2-4-1" @click="openFilePositionHandler(item)">打开文件所在位置</el-menu-item>
</el-menu>
</el-popover>
......
......@@ -69,14 +69,14 @@
<el-table-column label="操作" width="120">
<template #default="scope">
<div class="row items-center" :class="{'hover':showItemId!=scope.row.FileId}">
<el-button v-if="currentMenu!=-1&&scope.row.IsEdit" type="primary" :icon="Edit" size="small" @click.stop="editDelete(scope.row)">编辑</el-button>
<el-button v-if="(datas.loggedder==scope.row.CreateName&&currentMenu!=-1)||scope.row.IsEdit" type="primary" :icon="Edit" size="small" @click.stop="editDelete(scope.row)">编辑</el-button>
<el-button v-if="currentMenu==-1" type="primary" icon="Position" size="small" @click.stop="recover(scope.row)">恢复</el-button>
<el-dropdown class="q-pl-md" trigger="click" @visible-change="(val:boolean)=>dropdownChange(val,scope.row.FileId)"
v-if="(datas.loggedder==scope.row.CreateName&&(scope.row.FileType||currentMenu!=-1))||scope.row.IsDownload||scope.row.IsView">
<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="scope.row.FileType>0&&scope.row.IsView" icon="View" @click="viewTemplate(scope.row)">查看</el-dropdown-item>
<el-dropdown-item v-if="(datas.loggedder==scope.row.CreateName&&scope.row.FileType>0)||scope.row.IsView" icon="View" @click="viewTemplate(scope.row)">查看</el-dropdown-item>
<template v-if="currentMenu!=-1&&datas.loggedder==scope.row.CreateName">
<el-dropdown-item v-if="scope.row.FileType" icon="EditPen" @click.stop="startEditTitle(scope.row)">重命名</el-dropdown-item>
<el-dropdown-item v-if="scope.row.FileType" icon="Clock" @click.stop="history(scope.row)">历史版本</el-dropdown-item>
......@@ -92,8 +92,8 @@
</el-dropdown-item>
<el-dropdown-item icon="Delete" @click="editDelete(scope.row,1)">删除</el-dropdown-item>
</template>
<el-dropdown-item v-if="scope.row.FileType!=0&&currentMenu!=-1&&scope.row.IsDownLoad" icon="Download" @click="exportDocument(scope.row)">导出</el-dropdown-item>
<el-dropdown-item v-if="scope.row.FileType&&scope.row.IsView" icon="CopyDocument" @click.stop="CopyTo(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)">导出</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>
</el-dropdown-menu>
</template>
......@@ -559,12 +559,14 @@ import CopyFile from "./CopyFile.vue";
searchData.value.sellId = row.FileId;
searchData.value.sellTempId = row.TempId;
searchData.value.TemplateType = row.FileType;
searchData.value.ParentFileId = row.ParentFileId;
if(props.currentMenu==0&&datas.loggedder!=row.CreateName){
searchData.value.ParentFileId = 0
if(row.IsDownLoad==0) searchData.value.noExportPermission = true
else searchData.value.noExportPermission = false
if(row.IsView==0) searchData.value.noCopyPermission = true
else searchData.value.noCopyPermission = false
}else{
searchData.value.ParentFileId = row.ParentFileId;
}
SalesEditorStore.setSalesEditor(2);
marketStore.setMarket(false);
......
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