Commit 3ffc7951 authored by zhengke's avatar zhengke

优化 最近 分享给我的操作

parent de57bf49
...@@ -90,6 +90,7 @@ const userLoginHandler = async ()=>{ ...@@ -90,6 +90,7 @@ const userLoginHandler = async ()=>{
if(ConfigId>0&&model!=2) await GetTripConfig(ConfigId) if(ConfigId>0&&model!=2) await GetTripConfig(ConfigId)
} catch (error) {} } catch (error) {}
if(userId>0)isFinish.value=true if(userId>0)isFinish.value=true
if(param.ViewSlideshow) { if(param.ViewSlideshow) {
searchData.value.ViewSlideshow = param.ViewSlideshow searchData.value.ViewSlideshow = param.ViewSlideshow
try { try {
...@@ -124,10 +125,13 @@ const sellHistoryTripTemplate = async (sellId:any,LogId:any) => { ...@@ -124,10 +125,13 @@ const sellHistoryTripTemplate = async (sellId:any,LogId:any) => {
let queryMsg let queryMsg
let dataRes let dataRes
if(!LogId){ if(!LogId){
queryMsg = { queryMsg = {
Id: sellId, Id: sellId,
Status: searchData.value.ViewSlideshow==1?1:0 Status: searchData.value.ViewSlideshow==1?1:0
} }
// 行程广告浏览记录
if(queryMsg.Status==0) await ConfigService.SetTripBrowse({FileId: sellId});
dataRes = await ConfigService.sellGetTemplateDetails(queryMsg); dataRes = await ConfigService.sellGetTemplateDetails(queryMsg);
}else{ }else{
queryMsg = { queryMsg = {
...@@ -167,6 +171,7 @@ const sellHistoryTripTemplate = async (sellId:any,LogId:any) => { ...@@ -167,6 +171,7 @@ const sellHistoryTripTemplate = async (sellId:any,LogId:any) => {
ScreenStore.setScreening(true) ScreenStore.setScreening(true)
enterScreeningFromStart enterScreeningFromStart
slidesStore.updateSlideIndex(0) slidesStore.updateSlideIndex(0)
}else{ }else{
loading.value = true loading.value = true
ShareTips.value = dataRes.data.message ShareTips.value = dataRes.data.message
...@@ -176,7 +181,6 @@ const sellHistoryTripTemplate = async (sellId:any,LogId:any) => { ...@@ -176,7 +181,6 @@ const sellHistoryTripTemplate = async (sellId:any,LogId:any) => {
} }
} }
// 销售分享模版数据 // 销售分享模版数据
const sellShareTemplate = async () =>{ const sellShareTemplate = async () =>{
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<IconUpload class="icon" /> <IconUpload class="icon" />
</div> </div>
</div> </div>
<div class="menu-item" v-tooltip="'导出'" @click="setDialogForExport('image')"> <div v-if="!searchData.noExportPermission" class="menu-item" v-tooltip="'导出'" @click="setDialogForExport('image')">
<IconDownload class="icon" /> <IconDownload class="icon" />
</div> </div>
<el-button type="primary" <el-button type="primary"
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
</template> </template>
</el-button> </el-button>
<template v-if="model==2"> <template v-if="model==2">
<el-dropdown v-if="searchData.sellId>0" split-button <el-dropdown v-if="searchData.sellId>0&&!searchData.noCopyPermission" split-button
size="small" type="primary" @click="setTemplate(0)"> size="small" type="primary" @click="setTemplate(0)">
保存 保存
<template #dropdown> <template #dropdown>
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
<el-button v-if="!searchData.sellId" type="primary" <el-button v-if="!searchData.sellId||(searchData.sellId>0&&searchData.noCopyPermission)" type="primary"
size="small" :loading="datas.loading" size="small" :loading="datas.loading"
style="color: #ffff;margin-left: 10px;" style="color: #ffff;margin-left: 10px;"
@click="setTemplate(0)"> @click="setTemplate(0)">
...@@ -129,6 +129,12 @@ ...@@ -129,6 +129,12 @@
<FullscreenSpin :loading="exporting" tip="正在导入..." /> <FullscreenSpin :loading="exporting" tip="正在导入..." />
<Psd-Upload :visible="psdVisibleStatus" @closed="psdVisibleStatus=false"></Psd-Upload> <Psd-Upload :visible="psdVisibleStatus" @closed="psdVisibleStatus=false"></Psd-Upload>
<CopyFile v-if="isCopyTo"
:details="journeyAdsDetails"
:type="2"
@close="() => {journeyAdsDetails = '';isCopyTo=false;datas.loading = false}"
@success="(FolderId:Number)=>SetSellTemplate(1,FolderId)"></CopyFile>
</div> </div>
</template> </template>
...@@ -167,7 +173,7 @@ import { PPTImageElement } from '@/types/slides' ...@@ -167,7 +173,7 @@ import { PPTImageElement } from '@/types/slides'
import AliyunUpload from '@/utils/upload/aliyun' import AliyunUpload from '@/utils/upload/aliyun'
import { ElLoading, ElMessage } from 'element-plus' import { ElLoading, ElMessage } from 'element-plus'
import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue' import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
import CopyFile from "@/views/SellTemplate/components/CopyFile.vue";
const mainStore = useMainStore() const mainStore = useMainStore()
const slidesStore = useSlidesStore() const slidesStore = useSlidesStore()
...@@ -208,6 +214,8 @@ const TempIdStore = useScreenStore() ...@@ -208,6 +214,8 @@ const TempIdStore = useScreenStore()
const ConfigIdStore = useScreenStore() const ConfigIdStore = useScreenStore()
const loadingInstance = ref<any>(null) const loadingInstance = ref<any>(null)
const thumbnails = ref<string[]>() const thumbnails = ref<string[]>()
const isCopyTo = ref(false)
const journeyAdsDetails = ref<Object>()
const psdVisibleStatus = ref(false) const psdVisibleStatus = ref(false)
const { market, model, ConfigId, CoverImg, dataLoading, TempId, SourceLoading } = storeToRefs(useScreenStore()) const { market, model, ConfigId, CoverImg, dataLoading, TempId, SourceLoading } = storeToRefs(useScreenStore())
...@@ -275,7 +283,8 @@ const UploadPsdHandler = () => { ...@@ -275,7 +283,8 @@ const UploadPsdHandler = () => {
} }
// 销售新增修改行程、广告 // 销售新增修改行程、广告
const SetSellTemplate = async (type) => { const SetSellTemplate = async (type:Number,FolderId:Number) => {
if(FolderId>=0) datas.loading = true
try { try {
let TempId = 0 let TempId = 0
if(queryObj.value.TempId) TempId = queryObj.value.TempId if(queryObj.value.TempId) TempId = queryObj.value.TempId
...@@ -296,11 +305,15 @@ const SetSellTemplate = async (type) => { ...@@ -296,11 +305,15 @@ const SetSellTemplate = async (type) => {
Title: queryObj.value.Title, Title: queryObj.value.Title,
OWidth: 0, OWidth: 0,
OHeight: 0, OHeight: 0,
FolderId: FolderId>=0?FolderId:searchData.value.ParentFileId
} }
if(queryObj.value.TemplateType==2){ if(queryObj.value.TemplateType==2){
queryMsg.OWidth = queryObj.value.Width queryMsg.OWidth = queryObj.value.Width
queryMsg.OHeight = queryObj.value.Height queryMsg.OHeight = queryObj.value.Height
} }
journeyAdsDetails.value = ''
isCopyTo.value = false
console.log(queryMsg,'------queryMsg销售保存')
let TemplateRes = await ConfigService.sellSetTemplate(queryMsg); let TemplateRes = await ConfigService.sellSetTemplate(queryMsg);
if (TemplateRes.data.resultCode == 1) { if (TemplateRes.data.resultCode == 1) {
ElMessage({ ElMessage({
...@@ -460,7 +473,7 @@ const SetTripTemplateConfig = async () => { ...@@ -460,7 +473,7 @@ const SetTripTemplateConfig = async () => {
// 保存 // 保存
const setTemplate = async (type) =>{ const setTemplate = async (type) =>{
queryObj.value.Title = title.value queryObj.value.Title = title.value
datas.loading = true
if(SourceLoading.value) setNewDatasList(datas.DataSource) if(SourceLoading.value) setNewDatasList(datas.DataSource)
await uploadImageHandler() await uploadImageHandler()
...@@ -526,12 +539,24 @@ const setTemplate = async (type) =>{ ...@@ -526,12 +539,24 @@ const setTemplate = async (type) =>{
queryObj.value.TempData = JSON.stringify(arr) queryObj.value.TempData = JSON.stringify(arr)
if(model.value==1&&userInfo.value.IsEditTripTemplate==1){ if(model.value==1&&userInfo.value.IsEditTripTemplate==1){
datas.loading = true
await SetTripTemplateSlide() await SetTripTemplateSlide()
}else if(ConfigId.value&&model.value!=2){ }else if(ConfigId.value&&model.value!=2){
datas.loading = true
await SetTripTemplateConfig() await SetTripTemplateConfig()
}else if(model.value==2&&SalesEditor.value>0){ }else if(model.value==2&&SalesEditor.value>0){
if(type==1){
let obj = {
FileName: queryObj.value.Title,
FileType: queryObj.value.TemplateType
}
journeyAdsDetails.value = obj
isCopyTo.value = true
}else{
datas.loading = true
await SetSellTemplate(type) await SetSellTemplate(type)
} }
}
} }
......
...@@ -60,7 +60,7 @@ import useScreening from '@/hooks/useScreening' ...@@ -60,7 +60,7 @@ import useScreening from '@/hooks/useScreening'
import useLoadSlides from '@/hooks/useLoadSlides' import useLoadSlides from '@/hooks/useLoadSlides'
import { injectKeyDataSource, injectKeyTemplate } from '@/types/injectKey' import { injectKeyDataSource, injectKeyTemplate } from '@/types/injectKey'
import ConfigService from '@/services/ConfigService' import ConfigService from '@/services/ConfigService'
import { getHtmlPlainText } from '@/utils/common' import { getHtmlPlainText, query } from '@/utils/common'
import useEditor from '@/utils/Editor/index' import useEditor from '@/utils/Editor/index'
import { VIEWPORT_SIZE, VIEWPORT_VER_SIZE } from '@/configs/canvas' import { VIEWPORT_SIZE, VIEWPORT_VER_SIZE } from '@/configs/canvas'
...@@ -505,9 +505,10 @@ const sellGetTripTemplate = async () =>{ ...@@ -505,9 +505,10 @@ const sellGetTripTemplate = async () =>{
let queryMsg = { let queryMsg = {
Id: Id Id: Id
} }
// 行程广告浏览记录
await ConfigService.SetTripBrowse({FileId: searchData.value.sellId});
let dataRes = await ConfigService.sellGetTemplateDetails(queryMsg); let dataRes = await ConfigService.sellGetTemplateDetails(queryMsg);
if (dataRes.data.resultCode == 1) { if (dataRes.data.resultCode == 1) {
RecordBrowsing()
if(searchData.value.TempId) queryObj.value.TempId = searchData.value.TempId if(searchData.value.TempId) queryObj.value.TempId = searchData.value.TempId
else if(searchData.value.TempId2&&!searchData.value.TempId) queryObj.value.TempId = searchData.value.TempId2 else if(searchData.value.TempId2&&!searchData.value.TempId) queryObj.value.TempId = searchData.value.TempId2
else if(searchData.value.sellTempId) queryObj.value.TempId = searchData.value.sellTempId else if(searchData.value.sellTempId) queryObj.value.TempId = searchData.value.sellTempId
...@@ -551,23 +552,6 @@ const sellGetTripTemplate = async () =>{ ...@@ -551,23 +552,6 @@ const sellGetTripTemplate = async () =>{
} }
} }
/**
* 行程广告浏览记录
*/
const RecordBrowsing = async () => {
try {
let queryMsg = {
FileId: searchData.value.sellId
}
let datasRes = await ConfigService.SetTripBrowse(queryMsg);
if (datasRes.data.resultCode == 1 && datasRes.data.data && datasRes.data.data.TempId) {
}
} catch (error) {
}
}
// 页面被切换时 // 页面被切换时
const thumbnailsRef = ref<InstanceType<typeof Draggable>>() const thumbnailsRef = ref<InstanceType<typeof Draggable>>()
...@@ -755,7 +739,7 @@ const contextmenusThumbnailItem = (): ContextmenuItem[] => { ...@@ -755,7 +739,7 @@ const contextmenusThumbnailItem = (): ContextmenuItem[] => {
] ]
} }
if(searchData.value.sellId&&!searchData.value.TempId) sellGetTripTemplate() if(searchData.value.sellId&&!searchData.value.TempId) sellGetTripTemplate()
GetTripTemplate() if(!query().ViewSlideshow) GetTripTemplate()
</script> </script>
......
...@@ -174,7 +174,7 @@ const GetTripFiled = async () =>{ ...@@ -174,7 +174,7 @@ const GetTripFiled = async () =>{
console.log("TemplateGetTripFiled", error); console.log("TemplateGetTripFiled", error);
} }
} }
if(searchData.value.TemplateType!=2) GetTripFiled() if(searchData.value.TemplateType!=2&&!query().ViewSlideshow) GetTripFiled()
const mainStore = useMainStore() const mainStore = useMainStore()
......
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
{{ formatDateTimeToRead(scope.row.UpdateTime&&scope.row.UpdateTime!=''?scope.row.UpdateTime:scope.row.CreateTime) }} {{ formatDateTimeToRead(scope.row.UpdateTime&&scope.row.UpdateTime!=''?scope.row.UpdateTime:scope.row.CreateTime) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="分享人" prop="CreateName" width="100" /> <el-table-column label="分享人" prop="CreateName" width="180" />
<el-table-column label="操作" width="120"> <el-table-column label="操作" width="120">
<template #default="scope"> <template #default="scope">
<div class="row items-center" :class="{'hover':showItemId!=scope.row.FileId}"> <div class="row items-center" :class="{'hover':showItemId!=scope.row.FileId}">
...@@ -148,7 +148,6 @@ const tempFilterName = ref('') ...@@ -148,7 +148,6 @@ const tempFilterName = ref('')
const currentRootDom = ref() const currentRootDom = ref()
const hgihlightId = ref(0) const hgihlightId = ref(0)
const dataTableRef = ref() const dataTableRef = ref()
const lastKeyword = ref('')
const backInquireHandler = () => { const backInquireHandler = () => {
let Navigation = navigations.value[navigations.value.length - 2]; let Navigation = navigations.value[navigations.value.length - 2];
...@@ -179,11 +178,14 @@ const editorFileHandler = (item:any)=>{ ...@@ -179,11 +178,14 @@ const editorFileHandler = (item:any)=>{
searchData.value.sellId = item.FileId; searchData.value.sellId = item.FileId;
searchData.value.sellTempId = item.TempId; searchData.value.sellTempId = item.TempId;
searchData.value.TemplateType = item.FileType; searchData.value.TemplateType = item.FileType;
if(item.IsDownload==0) searchData.value.noExportPermission = true
else searchData.value.noExportPermission = false
if(item.IsView==0) searchData.value.noCopyPermission = true
else searchData.value.noCopyPermission = false
SalesEditorStore.setSalesEditor(2); SalesEditorStore.setSalesEditor(2);
marketStore.setMarket(false); marketStore.setMarket(false);
} }
const getDocumentData = async () => { const getDocumentData = async () => {
lastKeyword.value = queryObj.FileName
if(loading.value) return if(loading.value) return
loading.value=true loading.value=true
try { try {
...@@ -375,9 +377,6 @@ getDocumentData() ...@@ -375,9 +377,6 @@ getDocumentData()
text-overflow:ellipsis !important; text-overflow:ellipsis !important;
width: 100%; width: 100%;
} }
.el-table .caret-wrapper{
height: 12px !important;
}
/* .sample-table th:nth-child(2) .cell{ /* .sample-table th:nth-child(2) .cell{
padding-left: 0 !important; padding-left: 0 !important;
} */ } */
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<el-dialog v-model="show" v-loading="loading" :show-close="false" :close-on-press-escape="false" <el-dialog v-model="show" v-loading="loading" :show-close="false" :close-on-press-escape="false"
:close-on-click-modal="false" style="width: 260px"> :close-on-click-modal="false" style="width: 260px">
<template #header> <template #header>
<div class="row overflow-hide" @click="OffEdit"> <div class="row overflow-hide">
<div> <div @click="OffEdit">
<img v-if="details.FileType > 0" class="q-px-md" <img v-if="details.FileType > 0" class="q-px-md"
:src="details.FileType == 1 ? datas.pdfImg : datas.adsImg" style="height: 43px" /> :src="details.FileType == 1 ? datas.pdfImg : datas.adsImg" style="height: 43px" />
<img v-else class="q-px-md" src="@/assets/img/file.png" style="height: 43px" /> <img v-else class="q-px-md" src="@/assets/img/file.png" style="height: 43px" />
...@@ -20,11 +20,12 @@ ...@@ -20,11 +20,12 @@
{{ details.FileName }} {{ details.FileName }}
</div> </div>
</el-tooltip> </el-tooltip>
<el-input class="journeyAds-Input" v-model="details.FileName" autosize type="textarea" <el-input v-model="details.FileName" autosize type="textarea"
placeholder="Please input" maxlength="500" size="small" v-if="datas.editTitle" placeholder="Please input" maxlength="500" size="small" v-if="datas.editTitle"
@blur="handleUpdateTitle" /> @blur="OffEdit" />
</div> </div>
<div class="text-small text-5B5D62 q-pt-sm"> <div class="text-small text-5B5D62 q-pt-sm" v-if="details.CreateByName||details.CreateName"
@click="OffEdit">
创建者: 创建者:
<template v-if="type == 1"> <template v-if="type == 1">
{{ details.CreateByName }} {{ details.CreateByName }}
...@@ -37,7 +38,7 @@ ...@@ -37,7 +38,7 @@
</div> </div>
</template> </template>
<div class="TreeFile-container" @click="!type?OffEdit:''"> <div class="TreeFile-container">
<el-tree-select <el-tree-select
placeholder="请选择文件" placeholder="请选择文件"
node-key="FileId" node-key="FileId"
...@@ -48,7 +49,7 @@ ...@@ -48,7 +49,7 @@
:render-after-expand="false" :render-after-expand="false"
style="width: 220px" style="width: 220px"
filterable filterable
@check="handleTreeNodeClick" @node-click="handleTreeNodeClick"
class="auto-width-tree" class="auto-width-tree"
/> />
...@@ -57,10 +58,9 @@ ...@@ -57,10 +58,9 @@
<template #footer> <template #footer>
<div @click="OffEdit"> <div @click="OffEdit">
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="() => closedhandler()">关闭</el-button> <el-button @click.stop="() => closedhandler()">关闭</el-button>
<el-button type="primary" @click="() => save()"> <el-button type="primary" @click.stop="() => save()">
保存<template v-if="type == 1">另存</template> 保存<template v-if="type">另存</template>
<template v-else-if="type == 2">替换</template>
<template v-else>复制</template> <template v-else>复制</template>
</el-button> </el-button>
</span> </span>
...@@ -125,21 +125,17 @@ const dataList = ref([]); ...@@ -125,21 +125,17 @@ const dataList = ref([]);
const OffEdit = () => { const OffEdit = () => {
datas.editTitle = false; datas.editTitle = false;
}; };
const handleUpdateTitle = () => {
OffEdit();
};
const closedhandler = () => { const closedhandler = () => {
emit("close"); emit("close");
}; };
const handleTreeNodeClick = (data: any, checkObj: any) => { const handleTreeNodeClick = (data: any, checkObj: any) => {
OffEdit();
if (checkObj.checkedKeys.length != 0) {
datas.FolderObj = data; datas.FolderObj = data;
} OffEdit();
}; };
const save = () => { const save = () => {
let title = props.details.FileName; let title = props.details.FileName;
if (props.type) title = props.type == 1 ? "另存" : "替换"; if (props.type) title = "另存";
else title = title + "复制"; else title = title + "复制";
ElMessageBox.confirm( ElMessageBox.confirm(
`此操作将${title}${datas.FolderObj.FileName ? datas.FolderObj.FileName : "根目录" `此操作将${title}${datas.FolderObj.FileName ? datas.FolderObj.FileName : "根目录"
...@@ -153,8 +149,12 @@ const save = () => { ...@@ -153,8 +149,12 @@ const save = () => {
) )
.then(async () => { .then(async () => {
try { try {
if (props.type) SaveOverlay(title); if (props.type==1) SaveOverlay(title);
else CopyId(); else if(props.type==2) {
let FolderId = datas.FolderId!=null?datas.FolderId:0
emit('success',FolderId);
}
else if(!props.type) CopyId();
} catch (error) { } } catch (error) { }
}) })
.catch(() => { }); .catch(() => { });
......
...@@ -45,18 +45,18 @@ ...@@ -45,18 +45,18 @@
</td> </td>
<td class="text-light text-5B5D62"><span>{{item.FileSize}}KB</span></td> <td class="text-light text-5B5D62"><span>{{item.FileSize}}KB</span></td>
<td class="text-light"> <td class="text-light">
<span :class="[item.NewTitle?'active':'text-5B5D62']"> <span :class="[item.LogId==0?'active':'text-5B5D62']">
{{item.NewTitle?item.NewTitle:''}}</span> {{item.LogId==0?'当前版本':''}}</span>
</td> </td>
<td class="text-center"> <td class="text-center">
<span class="hoverShow"> <span class="hoverShow row items-center">
<el-button type="primary" icon="View" size="small" @click.stop="clickControls(item)">查看</el-button> <el-button type="primary" icon="View" size="small" @click.stop="clickControls(item)">查看</el-button>
<el-dropdown class="q-pl-md" trigger="click"> <el-dropdown class="q-pl-md" trigger="click">
<el-icon size="16" color="#b1b7cf"><MoreFilled /></el-icon> <el-icon size="16" color="#b1b7cf"><MoreFilled /></el-icon>
<template #dropdown> <template #dropdown>
<el-dropdown-menu class="q-pa-md" @click.stop="OffEdit"> <el-dropdown-menu class="q-pa-md" @click.stop="OffEdit">
<el-dropdown-item icon="Promotion" @click.stop="clickControls(item,1)">另存</el-dropdown-item> <el-dropdown-item icon="Promotion" @click.stop="clickControls(item,1)">另存</el-dropdown-item>
<el-dropdown-item v-if="!item.NewTitle" icon="Switch" @click.stop="clickControls(item,2)">替换</el-dropdown-item> <el-dropdown-item v-if="item.LogId!=0" icon="Switch" @click.stop="clickControls(item,2)">替换</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
...@@ -65,9 +65,9 @@ ...@@ -65,9 +65,9 @@
</tr> </tr>
</template> </template>
</table> </table>
<div v-if="dataList.length == 0 && !loading" class="bg-white rounded" <div v-if="dataList.length == 0 && !loading" class="bg-white rounded col"
style="padding: 0 10px;"> style="padding: 40px 10px;">
<el-empty :image-size="60" description="暂无数据" /> <el-empty :image-size="150" description="文档没有历史版本" />
</div> </div>
<el-divider class="no-bg q-mt-lg" v-if='dataList.length>0 && queryObj.pageCount == queryObj.pageIndex && !loading && queryObj.pageCount != 1'> <el-divider class="no-bg q-mt-lg" v-if='dataList.length>0 && queryObj.pageCount == queryObj.pageIndex && !loading && queryObj.pageCount != 1'>
<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>
...@@ -132,7 +132,6 @@ import CopyFile from "./CopyFile.vue"; ...@@ -132,7 +132,6 @@ import CopyFile from "./CopyFile.vue";
pageSize: 10, pageSize: 10,
pageCount: 0, //总页数 pageCount: 0, //总页数
FileId: props.details.FileId, FileId: props.details.FileId,
UpdateTime: ''
}) })
const journeyAdsDetails = ref(''); const journeyAdsDetails = ref('');
const isCopyTo = ref(false); const isCopyTo = ref(false);
...@@ -212,11 +211,13 @@ import CopyFile from "./CopyFile.vue"; ...@@ -212,11 +211,13 @@ import CopyFile from "./CopyFile.vue";
}; };
arrList(pageRes.data.data.pageData); arrList(pageRes.data.data.pageData);
dataList.value = dataList.value.concat(pageRes.data.data.pageData); dataList.value = dataList.value.concat(pageRes.data.data.pageData);
dataList.value[0].NewTitle = '当前版本'
queryObj.pageCount = pageRes.data.data.pageCount; queryObj.pageCount = pageRes.data.data.pageCount;
} }
loading.value = false loading.value = false
} catch (error) { } catch (error) {
ElMessage.error({
message:'数据加载异常,请刷新页面'
})
loading.value = false loading.value = false
} }
} }
......
...@@ -121,6 +121,7 @@ const editorFileHandler = (item:any)=>{ ...@@ -121,6 +121,7 @@ const editorFileHandler = (item:any)=>{
searchData.value.sellId = item.FileId; searchData.value.sellId = item.FileId;
searchData.value.sellTempId = item.TempId; searchData.value.sellTempId = item.TempId;
searchData.value.TemplateType = item.FileType; searchData.value.TemplateType = item.FileType;
searchData.value.ParentFileId = item.FolderId
SalesEditorStore.setSalesEditor(2); SalesEditorStore.setSalesEditor(2);
marketStore.setMarket(false); marketStore.setMarket(false);
} }
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
:render-after-expand="false" :render-after-expand="false"
style="width: 220px" style="width: 220px"
filterable filterable
@check="handleTreeNodeClick" @current-change="handleTreeNodeClick"
class="auto-width-tree" class="auto-width-tree"
/> />
...@@ -139,10 +139,8 @@ import FolderService from "@/services/FolderService"; ...@@ -139,10 +139,8 @@ import FolderService from "@/services/FolderService";
const handleTreeNodeClick = (data:any,checkObj:any) => { const handleTreeNodeClick = (data:any,checkObj:any) => {
// 共两个参数,依次为:传递给 data 属性的数组中该节点所对应的对象、树目前的选中状态对象 // 共两个参数,依次为:传递给 data 属性的数组中该节点所对应的对象、树目前的选中状态对象
// 树目前的选中状态对象,包含 checkedNodes、checkedKeys、halfCheckedNodes、halfCheckedKeys 四个属性 // 树目前的选中状态对象,包含 checkedNodes、checkedKeys、halfCheckedNodes、halfCheckedKeys 四个属性
if (checkObj.checkedKeys.length != 0) {
datas.FolderObj = data datas.FolderObj = data
} }
}
const filterNode = (value: string, data: Tree) => { const filterNode = (value: string, data: Tree) => {
if (!value) return true if (!value) return true
return data.FileName.includes(value) return data.FileName.includes(value)
...@@ -169,7 +167,7 @@ import FolderService from "@/services/FolderService"; ...@@ -169,7 +167,7 @@ import FolderService from "@/services/FolderService";
}) })
} }
ElMessageBox.confirm(`此操作将${title}移动到${datas.FolderObj.FileName},是否确定?`, "提示", { ElMessageBox.confirm(`此操作将${title}移动到${datas.FolderObj.FileName?datas.FolderObj.FileName:'根目录'},是否确定?`, "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
......
...@@ -139,7 +139,7 @@ import FolderService from "@/services/FolderService"; ...@@ -139,7 +139,7 @@ import FolderService from "@/services/FolderService";
} }
const save = () => { const save = () => {
let title = props.details.FileName let title = props.details.FileName
ElMessageBox.confirm(`此操作将${title}恢复到${datas.FolderObj.FileName},是否确定?`, "提示", { ElMessageBox.confirm(`此操作将${title}恢复到${datas.FolderObj.FileName?datas.FolderObj.FileName:'根目录'},是否确定?`, "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
......
<template> <template>
<el-table ref="dataTableRef" highlight-current-row class="sample-table" v-load-more="tableScrollHandler" :data="dataList" style="width: 100%" <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' }" @sort-change="sortHandler" :default-sort="{ prop: 'CreateTime', order: 'descending' }"
@selection-change="handleSelectionChange"> @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"/>
...@@ -55,24 +55,29 @@ ...@@ -55,24 +55,29 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="datas.Title" width="150" sortable="custom" prop=""> <el-table-column :label="datas.Title" width="150" sortable="custom" prop="CreateTime">
<template #default="scope"> <template #default="scope">
{{ formatDateTimeToRead(scope.row.UpdateTime&&scope.row.UpdateTime!=''?scope.row.UpdateTime:scope.row.CreateTime) }} {{ formatDateTimeToRead(scope.row.UpdateTime&&scope.row.UpdateTime!=''?scope.row.UpdateTime:scope.row.CreateTime) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="创建人" prop="CreateName" width="100" /> <el-table-column label="创建人" prop="" width="180" >
<template #default="scope">
{{scope.row.CreateName}}
<span class="text-info" v-if="datas.loggedder!=scope.row.CreateName"> 分享的</span>
</template>
</el-table-column>
<el-table-column label="操作" width="120"> <el-table-column label="操作" width="120">
<template #default="scope"> <template #default="scope">
<div class="row items-center" :class="{'hover':showItemId!=scope.row.FileId}"> <div class="row items-center" :class="{'hover':showItemId!=scope.row.FileId}">
<el-button v-if="currentMenu!=-1" type="primary" :icon="Edit" size="small" @click.stop="editDelete(scope.row)">编辑</el-button> <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-else type="primary" icon="Position" size="small" @click.stop="recover(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)" <el-dropdown class="q-pl-md" trigger="click" @visible-change="(val:boolean)=>dropdownChange(val,scope.row.FileId)"
v-if="scope.row.FileType||currentMenu!=-1"> 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> <el-icon size="16" color="#b1b7cf"><MoreFilled /></el-icon>
<template #dropdown> <template #dropdown>
<el-dropdown-menu class="q-pa-md" @click.stop="OffEdit"> <el-dropdown-menu class="q-pa-md" @click.stop="OffEdit">
<el-dropdown-item v-if="scope.row.FileType>0" icon="View" @click="viewTemplate(scope.row)">查看</el-dropdown-item> <el-dropdown-item v-if="scope.row.FileType>0&&scope.row.IsView" icon="View" @click="viewTemplate(scope.row)">查看</el-dropdown-item>
<template v-if="currentMenu!=-1"> <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="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> <el-dropdown-item v-if="scope.row.FileType" icon="Clock" @click.stop="history(scope.row)">历史版本</el-dropdown-item>
<el-dropdown-item icon="Position" @click.stop="()=>setFileShareHandler(scope.row)">分享</el-dropdown-item> <el-dropdown-item icon="Position" @click.stop="()=>setFileShareHandler(scope.row)">分享</el-dropdown-item>
...@@ -85,10 +90,10 @@ ...@@ -85,10 +90,10 @@
<span>{{scope.row.IsCollect?'取消收藏':'收藏'}}</span> <span>{{scope.row.IsCollect?'取消收藏':'收藏'}}</span>
</span> </span>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item v-if="scope.row.FileType!=0&&currentMenu!=-1" icon="Download" @click="exportDocument(scope.row)">导出</el-dropdown-item>
<el-dropdown-item v-if="scope.row.FileType" icon="CopyDocument" @click.stop="CopyTo(scope.row)">复制到</el-dropdown-item>
<el-dropdown-item icon="Delete" @click="editDelete(scope.row,1)">删除</el-dropdown-item> <el-dropdown-item icon="Delete" @click="editDelete(scope.row,1)">删除</el-dropdown-item>
</template> </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-menu> </el-dropdown-menu>
</template> </template>
...@@ -148,6 +153,8 @@ ...@@ -148,6 +153,8 @@
emit('success')}"></TreeFileRecover> emit('success')}"></TreeFileRecover>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { userStore } from '@/store/user';
import { storeToRefs } from 'pinia';
import { ApiResult } from '@/configs/axios'; import { ApiResult } from '@/configs/axios';
import OrgService from '@/services/OrgService'; import OrgService from '@/services/OrgService';
import { ref,reactive,watch,inject,nextTick, PropType } from 'vue'; import { ref,reactive,watch,inject,nextTick, PropType } from 'vue';
...@@ -208,6 +215,7 @@ import CopyFile from "./CopyFile.vue"; ...@@ -208,6 +215,7 @@ import CopyFile from "./CopyFile.vue";
type: number; type: number;
}>({ id: -1, name: "", parentId: 0, number: 1 }); }>({ id: -1, name: "", parentId: 0, number: 1 });
const datas = reactive({ const datas = reactive({
loggedder: '',
emptyTitle: '', emptyTitle: '',
Title: '', Title: '',
selectAll: false as any, selectAll: false as any,
...@@ -222,11 +230,14 @@ import CopyFile from "./CopyFile.vue"; ...@@ -222,11 +230,14 @@ import CopyFile from "./CopyFile.vue";
}); });
const SalesEditorStore = useSellTemplateStore(); const SalesEditorStore = useSellTemplateStore();
const marketStore = useScreenStore(); const marketStore = useScreenStore();
const { userInfo } = storeToRefs(userStore())
datas.loggedder = userInfo.value.emName
const dataList = ref([] as Array<any>); const dataList = ref([] as Array<any>);
dataList.value = props.list dataList.value = props.list
const queryObj = ref({} as any); const queryObj = ref({} as any);
queryObj.value = props.msg queryObj.value = props.msg
const loading = ref(false) as Boolean
const shareId = ref(0); const shareId = ref(0);
const shareFileType = ref(0) const shareFileType = ref(0)
...@@ -291,12 +302,6 @@ import CopyFile from "./CopyFile.vue"; ...@@ -291,12 +302,6 @@ import CopyFile from "./CopyFile.vue";
} }
emit('refreshHandler',obj) emit('refreshHandler',obj)
} }
const clickSort = (type:any) =>{
let obj = {
OrderByType: queryObj.value.OrderByType==2?1:2
}
emit('refreshHandler',obj)
}
const sortHandler = (val:any)=>{ const sortHandler = (val:any)=>{
queryObj.value.OrderByType = val.order=='descending'?2:1 queryObj.value.OrderByType = val.order=='descending'?2:1
let obj = { let obj = {
...@@ -554,6 +559,13 @@ import CopyFile from "./CopyFile.vue"; ...@@ -554,6 +559,13 @@ import CopyFile from "./CopyFile.vue";
searchData.value.sellId = row.FileId; searchData.value.sellId = row.FileId;
searchData.value.sellTempId = row.TempId; searchData.value.sellTempId = row.TempId;
searchData.value.TemplateType = row.FileType; searchData.value.TemplateType = row.FileType;
searchData.value.ParentFileId = row.ParentFileId;
if(props.currentMenu==0&&datas.loggedder!=row.CreateName){
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
}
SalesEditorStore.setSalesEditor(2); SalesEditorStore.setSalesEditor(2);
marketStore.setMarket(false); marketStore.setMarket(false);
} else { } else {
...@@ -607,13 +619,21 @@ import CopyFile from "./CopyFile.vue"; ...@@ -607,13 +619,21 @@ import CopyFile from "./CopyFile.vue";
} }
},500) },500)
} }
loading.value = true
setTimeout(()=>{
loading.value = false
},300)
watch(() => props.list, (n,o) => { watch(() => props.list, (n,o) => {
loading.value = true
if (props.list) { if (props.list) {
nextTick(() => { nextTick(() => {
dataList.value = props.list dataList.value = props.list
setCurrentRow() setCurrentRow()
}) })
} }
setTimeout(()=>{
loading.value = false
},300)
}) })
watch(() => props.navigations, (n,o) => { watch(() => props.navigations, (n,o) => {
......
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