Commit a7c95aa5 authored by 罗超's avatar 罗超

Merge branch '1.2.0' of http://gitlab.oytour.com/viitto/pptist into 1.2.0

# Conflicts:
#	src/views/Editor/Toolbar/ElementStylePanel/TextStylePanel.vue
#	src/views/Editor/Toolbar/SlideDesignPanel.vue
parents fbbde361 7ed6e01f
......@@ -90,6 +90,7 @@ const userLoginHandler = async ()=>{
if(ConfigId>0&&model!=2) await GetTripConfig(ConfigId)
} catch (error) {}
if(userId>0)isFinish.value=true
if(param.ViewSlideshow) {
searchData.value.ViewSlideshow = param.ViewSlideshow
try {
......@@ -124,10 +125,13 @@ const sellHistoryTripTemplate = async (sellId:any,LogId:any) => {
let queryMsg
let dataRes
if(!LogId){
queryMsg = {
Id: sellId,
Status: searchData.value.ViewSlideshow==1?1:0
}
// 行程广告浏览记录
if(queryMsg.Status==0) await ConfigService.SetTripBrowse({FileId: sellId});
dataRes = await ConfigService.sellGetTemplateDetails(queryMsg);
}else{
queryMsg = {
......@@ -167,6 +171,7 @@ const sellHistoryTripTemplate = async (sellId:any,LogId:any) => {
ScreenStore.setScreening(true)
enterScreeningFromStart
slidesStore.updateSlideIndex(0)
}else{
loading.value = true
ShareTips.value = dataRes.data.message
......@@ -176,7 +181,6 @@ const sellHistoryTripTemplate = async (sellId:any,LogId:any) => {
}
}
// 销售分享模版数据
const sellShareTemplate = async () =>{
......
......@@ -70,7 +70,7 @@
<IconUpload class="icon" />
</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" />
</div>
<el-button type="primary"
......@@ -85,7 +85,7 @@
</template>
</el-button>
<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)">
保存
<template #dropdown>
......@@ -109,7 +109,7 @@
</el-dropdown-menu>
</template>
</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"
style="color: #ffff;margin-left: 10px;"
@click="setTemplate(0)">
......@@ -129,6 +129,12 @@
<FullscreenSpin :loading="exporting" tip="正在导入..." />
<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="(type:Number,FolderId:Number)=>SetSellTemplate(type,FolderId)"></CopyFile>
</div>
</template>
......@@ -167,7 +173,7 @@ import { PPTImageElement } from '@/types/slides'
import AliyunUpload from '@/utils/upload/aliyun'
import { ElLoading, ElMessage } from 'element-plus'
import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
import CopyFile from "@/views/SellTemplate/components/CopyFile.vue";
const mainStore = useMainStore()
const slidesStore = useSlidesStore()
......@@ -208,6 +214,8 @@ const TempIdStore = useScreenStore()
const ConfigIdStore = useScreenStore()
const loadingInstance = ref<any>(null)
const thumbnails = ref<string[]>()
const isCopyTo = ref(false)
const journeyAdsDetails = ref<Object>()
const psdVisibleStatus = ref(false)
const { market, model, ConfigId, CoverImg, dataLoading, TempId, SourceLoading } = storeToRefs(useScreenStore())
......@@ -275,7 +283,8 @@ const UploadPsdHandler = () => {
}
// 销售新增修改行程、广告
const SetSellTemplate = async (type) => {
const SetSellTemplate = async (type:Number,FolderId:Number) => {
if(FolderId>=0) datas.loading = true
try {
let TempId = 0
if(queryObj.value.TempId) TempId = queryObj.value.TempId
......@@ -296,11 +305,15 @@ const SetSellTemplate = async (type) => {
Title: queryObj.value.Title,
OWidth: 0,
OHeight: 0,
FolderId: FolderId>=0?FolderId:searchData.value.ParentFileId
}
if(queryObj.value.TemplateType==2){
queryMsg.OWidth = queryObj.value.Width
queryMsg.OHeight = queryObj.value.Height
}
journeyAdsDetails.value = ''
isCopyTo.value = false
console.log(queryMsg,'------queryMsg销售保存')
let TemplateRes = await ConfigService.sellSetTemplate(queryMsg);
if (TemplateRes.data.resultCode == 1) {
ElMessage({
......@@ -460,7 +473,7 @@ const SetTripTemplateConfig = async () => {
// 保存
const setTemplate = async (type) =>{
queryObj.value.Title = title.value
datas.loading = true
if(SourceLoading.value) setNewDatasList(datas.DataSource)
await uploadImageHandler()
......@@ -526,11 +539,24 @@ const setTemplate = async (type) =>{
queryObj.value.TempData = JSON.stringify(arr)
if(model.value==1&&userInfo.value.IsEditTripTemplate==1){
datas.loading = true
await SetTripTemplateSlide()
}else if(ConfigId.value&&model.value!=2){
datas.loading = true
await SetTripTemplateConfig()
}else if(model.value==2&&SalesEditor.value>0){
await SetSellTemplate(type)
if(type==1||!searchData.value.sellId){
let obj = {
FileName: queryObj.value.Title,
FileType: queryObj.value.TemplateType,
type: type,
}
journeyAdsDetails.value = obj
isCopyTo.value = true
}else{
datas.loading = true
await SetSellTemplate(type)
}
}
}
......
......@@ -60,7 +60,7 @@ import useScreening from '@/hooks/useScreening'
import useLoadSlides from '@/hooks/useLoadSlides'
import { injectKeyDataSource, injectKeyTemplate } from '@/types/injectKey'
import ConfigService from '@/services/ConfigService'
import { getHtmlPlainText } from '@/utils/common'
import { getHtmlPlainText, query } from '@/utils/common'
import useEditor from '@/utils/Editor/index'
import { VIEWPORT_SIZE, VIEWPORT_VER_SIZE } from '@/configs/canvas'
......@@ -505,9 +505,10 @@ const sellGetTripTemplate = async () =>{
let queryMsg = {
Id: Id
}
// 行程广告浏览记录
await ConfigService.SetTripBrowse({FileId: searchData.value.sellId});
let dataRes = await ConfigService.sellGetTemplateDetails(queryMsg);
if (dataRes.data.resultCode == 1) {
RecordBrowsing()
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.sellTempId) queryObj.value.TempId = searchData.value.sellTempId
......@@ -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>>()
......@@ -755,7 +739,7 @@ const contextmenusThumbnailItem = (): ContextmenuItem[] => {
]
}
if(searchData.value.sellId&&!searchData.value.TempId) sellGetTripTemplate()
GetTripTemplate()
if(!query().ViewSlideshow) GetTripTemplate()
</script>
......
......@@ -4,12 +4,13 @@
class="origin-image"
:style="{ backgroundImage: `url(${handleImageElement.src})` }"
></div>
<Button class="full-width-btn" @click="getImgVis()" :style="{'margin-bottom': mode==1?0:''}"><IconTransform class="btn-icon"/> 替换图片</Button>
<Divider v-if="mode==1" />
<div v-if="mode==1" class="row items-center">
<div class="col">图层名称:</div>
<el-input style="width:60%;" v-model="layerName" @input="updateLayerName"></el-input>
</div>
<Divider v-if="mode==1" />
<ElementFlip />
......@@ -69,7 +70,6 @@
<FileInput @change="files => replaceImage(files)">
<Button class="full-width-btn"><IconTransform class="btn-icon" /> 替换图片</Button>
</FileInput> -->
<Button class="full-width-btn" @click="getImgVis()"><IconTransform class="btn-icon"/> 替换图片</Button>
<Button class="full-width-btn" @click="resetImage()"><IconUndo class="btn-icon" /> 重置样式</Button>
<Button class="full-width-btn" @click="setBackgroundImage()"><IconTheme class="btn-icon" /> 设为背景</Button>
<!-- 上传图片 -->
......
......@@ -22,16 +22,30 @@
<Divider />
<SelectGroup class="row formatFontsBox">
<el-select v-model="richTextAttrs.fontname" placeholder="" filterable
@change="emitRichTextCommand('fontname', richTextAttrs.fontname)">
<el-option
v-for="item in formatFonts"
:key="item.value"
:label="item.label"
:value="item.value"
:style="{'font-family':item.reduce!=''?item.reduce:item.label}"
/>
</el-select>
<span class="selectText">
<el-select v-model="richTextAttrs.fontname" placeholder="" filterable
@change="emitRichTextCommand('fontname', richTextAttrs.fontname)">
<el-option
v-for="item in formatFonts"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</span>
<span class="selectTextInput">
<el-autocomplete
v-model="richTextAttrs.fontsize"
:fetch-suggestions="(queryString: string, cb: any)=>querySearchFont(queryString,cb,'fontsize')"
class="inline-input w-50"
placeholder="例:14px"
@select="handleSelect('fontsize')"
@blur="handleSelect('fontsize')">
<template #suffix>
<IconAddText />
</template>
</el-autocomplete>
</span>
<!-- <Select
class="font-select"
style="width: 60%;"
......@@ -44,7 +58,7 @@
<template #icon>
<IconFontSize />
</template>
</Select> -->
</Select>
<Select
style="width: 40%;"
:value="richTextAttrs.fontsize"
......@@ -56,7 +70,7 @@
<template #icon>
<IconAddText />
</template>
</Select>
</Select> -->
</SelectGroup>
<ButtonGroup class="row" passive>
......@@ -277,7 +291,20 @@
<div class="row">
<div style="width: 40%;">行间距:</div>
<Select style="width: 60%;"
<span class="selectText selectTextLH border2">
<el-autocomplete
v-model="lineHeight"
:fetch-suggestions="(queryString: string, cb: any)=>querySearchFont(queryString,cb,'lineHeight')"
class="inline-input w-50"
placeholder="字体行间距"
@select="handleSelect('lineHeight')"
@blur="handleSelect('lineHeight')">
<template #suffix>
<IconRowHeight />
</template>
</el-autocomplete>
</span>
<!-- <Select style="width: 60%;"
:value="lineHeight || 1"
@update:value="value => updateLineHeight(value as number)"
:options="lineHeightOptions.map(item => ({
......@@ -287,11 +314,24 @@
<template #icon>
<IconRowHeight />
</template>
</Select>
</Select> -->
</div>
<div class="row">
<div style="width: 40%;">段间距:</div>
<Select style="width: 60%;"
<span class="selectText selectTextLH border2">
<el-autocomplete
v-model="paragraphSpace"
:fetch-suggestions="(queryString: string, cb: any)=>querySearchFont(queryString,cb,'paragraphSpace')"
class="inline-input w-50"
placeholder="字体段间距"
@select="handleSelect('paragraphSpace')"
@blur="handleSelect('paragraphSpace')">
<template #suffix>
<IconVerticalSpacingBetweenItems />
</template>
</el-autocomplete>
</span>
<!-- <Select style="width: 60%;"
:value="paragraphSpace || 0"
@update:value="value => updateParagraphSpace(value as number)"
:options="paragraphSpaceOptions.map(item => ({
......@@ -301,11 +341,24 @@
<template #icon>
<IconVerticalSpacingBetweenItems />
</template>
</Select>
</Select> -->
</div>
<div class="row">
<div style="width: 40%;">字间距:</div>
<Select style="width: 60%;"
<span class="selectText selectTextLH border2">
<el-autocomplete
v-model="wordSpace"
:fetch-suggestions="(queryString: string, cb: any)=>querySearchFont(queryString,cb,'wordSpace')"
class="inline-input w-50"
placeholder="字体字间距"
@select="handleSelect('wordSpace')"
@blur="handleSelect('wordSpace')">
<template #suffix>
<IconFullwidth />
</template>
</el-autocomplete>
</span>
<!-- <Select style="width: 60%;"
:value="wordSpace || 0"
@update:value="value => updateWordSpace(value as number)"
:options="wordSpaceOptions.map(item => ({
......@@ -315,7 +368,7 @@
<template #icon>
<IconFullwidth />
</template>
</Select>
</Select> -->
</div>
<div class="row">
<div style="width: 40%;">文本框填充:</div>
......@@ -479,14 +532,90 @@ const fontSizeOptions = [
'36px', '40px', '44px', '48px', '54px', '60px', '66px', '72px', '76px',
'80px', '88px', '96px', '104px', '112px', '120px',
]
const fontSizes = ref<Array>([])
for(let i=0;i<fontSizeOptions.length;i++){
let obj = {
label: fontSizeOptions[i],
value: fontSizeOptions[i],
}
fontSizes.value.push(obj)
}
const lineHeightOptions = [0.9, 1.0, 1.15, 1.2, 1.4, 1.5, 1.8, 2.0, 2.5, 3.0]
const wordSpaceOptions = ref([])
const lineHeights = ref<Array>([])
for(let i=0;i<lineHeightOptions.length;i++){
let obj = {
label: lineHeightOptions[i]+'倍',
value: lineHeightOptions[i],
}
lineHeights.value.push(obj)
}
const wordSpaceOptions = ref([])
for(let i=0;i<31;i++){
wordSpaceOptions.value.push(i)
let obj = {
label: `${i}`,
value: i,
}
wordSpaceOptions.value.push(obj)
}
const paragraphSpaceOptions = [0, 5, 10, 15, 20, 25, 30, 40, 50, 80]
const paragraphSpaces = ref<Array>([])
for(let i=0;i<paragraphSpaceOptions.length;i++){
let obj = {
label: paragraphSpaceOptions[i]+'px',
value: paragraphSpaceOptions[i],
}
paragraphSpaces.value.push(obj)
}
interface RestaurantItem {
value: string
label: string
}
const handleSelect = (font:string) => {
let value
if(font=='fontsize') {
value = richTextAttrs.value.fontsize
emitRichTextCommand('fontsize', value as string)
}else if(font=='lineHeight'){
value = lineHeight.value
updateLineHeight(value)
}else if(font=='paragraphSpace'){
value = paragraphSpace.value
updateParagraphSpace(value)
}else if(font=='wordSpace'){
value = wordSpace.value
updateWordSpace(value)
}
}
const createFilter = (queryString: string) => {
return (restaurant:RestaurantItem) => {
return (
restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) === 0
)
}
}
const querySearchFont = (queryString: string, cb: any, font:string) => {
let results
if(font=='fontsize'){
results = queryString? fontSizes.value.filter(createFilter(queryString))
: fontSizes.value
}else if(font=='lineHeight'){
results = queryString? lineHeights.value.filter(x=>{return x.label.indexOf(queryString)!=-1})
: lineHeights.value
}else if(font=='paragraphSpace'){
results = queryString? paragraphSpaces.value.filter(x=>{return x.label.indexOf(queryString)!=-1})
: paragraphSpaces.value
}else if(font=='wordSpace'){
results = queryString? wordSpaceOptions.value.filter(x=>{return x.label.indexOf(queryString)!=-1})
: wordSpaceOptions.value
}
cb(results)
}
// 设置行高
const updateLineHeight = (value: number) => {
......@@ -578,6 +707,33 @@ watch(handleElement, () => {
</script>
<style lang="scss" scoped>
.selectText.selectTextLH::v-deep(.el-input__wrapper){
border-radius: 2px;
}
.selectTextInput::v-deep(.el-input__wrapper){
border-radius: 0 2px 2px 0;
padding: 1px 10px;
border-left: 0;
}
.selectTextInput{
width: 40%;
position: absolute;
right: 1px;
top: 0;
}
.selectText::v-deep(.el-input__wrapper){
border-radius: 2px 0 0 2px;
padding: 1px 10px;
}
.selectText{
width: 140px;
}
.formatFontsBox{
position: relative;
}
.formatFontsBox::v-deep(.el-input__wrapper):hover{
border: 0;
}
.text-style-panel {
user-select: none;
}
......
......@@ -140,16 +140,18 @@
</div>
<div class="row formatFontsBox">
<div style="width: 40%;">字体:</div>
<el-select v-model="theme.fontName" placeholder="" filterable style="width: 137px;"
@change="updateTheme({ fontName: theme.fontName })">
<el-option
v-for="item in formatFonts"
:key="item.value"
:label="item.label"
:value="item.value"
:style="{'font-family':item.reduce!=''?item.reduce:item.label}"
/>
</el-select>
<span class="selectText">
<el-select v-model="theme.fontName" placeholder="" filterable style="width: 137px;"
@change="updateTheme({ fontName: theme.fontName })">
<el-option
v-for="item in formatFonts"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</span>
<!-- <Select
style="width: 60%;"
:value="theme.fontName"
......@@ -443,6 +445,13 @@ const updateViewportRatio = (value: number) => {
</script>
<style lang="scss" scoped>
.selectText::v-deep(.el-input__wrapper){
border-radius: 2px;
padding: 1px 10px;
}
.selectText{
width: 140px;
}
.slide-design-panel {
user-select: none;
}
......
......@@ -32,7 +32,8 @@
>
<ExportDialog />
</Modal>
<div v-if="model&&model==3" style="position: fixed;left: 0;right: 0;top: 0;bottom: 0; overflow: auto;">
<div v-if="model&&model==3" style="position: fixed;left: 0;right: 0;top: 0;bottom: 0;"
:style="{'overflow':param.w?'':'auto'}">
<div class="export-img-dialog">
<div class="thumbnails-view" ref="refThumbnails">
<div class="thumbnails" v-for="slide in slides">
......@@ -174,7 +175,7 @@ const GetTripFiled = async () =>{
console.log("TemplateGetTripFiled", error);
}
}
if(searchData.value.TemplateType!=2) GetTripFiled()
if(searchData.value.TemplateType!=2&&!query().ViewSlideshow) GetTripFiled()
const mainStore = useMainStore()
......
......@@ -72,7 +72,7 @@
{{ formatDateTimeToRead(scope.row.UpdateTime&&scope.row.UpdateTime!=''?scope.row.UpdateTime:scope.row.CreateTime) }}
</template>
</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">
<template #default="scope">
<div class="row items-center" :class="{'hover':showItemId!=scope.row.FileId}">
......@@ -148,7 +148,6 @@ const tempFilterName = ref('')
const currentRootDom = ref()
const hgihlightId = ref(0)
const dataTableRef = ref()
const lastKeyword = ref('')
const backInquireHandler = () => {
let Navigation = navigations.value[navigations.value.length - 2];
......@@ -179,11 +178,14 @@ const editorFileHandler = (item:any)=>{
searchData.value.sellId = item.FileId;
searchData.value.sellTempId = item.TempId;
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);
marketStore.setMarket(false);
}
const getDocumentData = async () => {
lastKeyword.value = queryObj.FileName
if(loading.value) return
loading.value=true
try {
......@@ -375,9 +377,6 @@ getDocumentData()
text-overflow:ellipsis !important;
width: 100%;
}
.el-table .caret-wrapper{
height: 12px !important;
}
/* .sample-table th:nth-child(2) .cell{
padding-left: 0 !important;
} */
......
......@@ -2,8 +2,8 @@
<el-dialog v-model="show" v-loading="loading" :show-close="false" :close-on-press-escape="false"
:close-on-click-modal="false" style="width: 260px">
<template #header>
<div class="row overflow-hide" @click="OffEdit">
<div>
<div class="row overflow-hide">
<div @click="OffEdit">
<img v-if="details.FileType > 0" class="q-px-md"
: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" />
......@@ -20,11 +20,12 @@
{{ details.FileName }}
</div>
</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"
@blur="handleUpdateTitle" />
@blur="OffEdit" />
</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">
{{ details.CreateByName }}
......@@ -37,7 +38,7 @@
</div>
</template>
<div class="TreeFile-container" @click="!type?OffEdit:''">
<div class="TreeFile-container">
<el-tree-select
placeholder="请选择文件"
node-key="FileId"
......@@ -48,7 +49,7 @@
:render-after-expand="false"
style="width: 220px"
filterable
@check="handleTreeNodeClick"
@node-click="handleTreeNodeClick"
class="auto-width-tree"
/>
......@@ -57,10 +58,9 @@
<template #footer>
<div @click="OffEdit">
<span class="dialog-footer">
<el-button @click="() => closedhandler()">关闭</el-button>
<el-button type="primary" @click="() => save()">
保存<template v-if="type == 1">另存</template>
<template v-else-if="type == 2">替换</template>
<el-button @click.stop="() => closedhandler()">关闭</el-button>
<el-button type="primary" @click.stop="() => save()">
保存<template v-if="type">另存</template>
<template v-else>复制</template>
</el-button>
</span>
......@@ -125,21 +125,17 @@ const dataList = ref([]);
const OffEdit = () => {
datas.editTitle = false;
};
const handleUpdateTitle = () => {
OffEdit();
};
const closedhandler = () => {
emit("close");
emit("close");
};
const handleTreeNodeClick = (data: any, checkObj: any) => {
datas.FolderObj = data;
OffEdit();
if (checkObj.checkedKeys.length != 0) {
datas.FolderObj = data;
}
};
const save = () => {
let title = props.details.FileName;
if (props.type) title = props.type == 1 ? "另存" : "替换";
if (props.type) title = "另存";
else title = title + "复制";
ElMessageBox.confirm(
`此操作将${title}${datas.FolderObj.FileName ? datas.FolderObj.FileName : "根目录"
......@@ -153,8 +149,12 @@ const save = () => {
)
.then(async () => {
try {
if (props.type) SaveOverlay(title);
else CopyId();
if (props.type==1) SaveOverlay(title);
else if(props.type==2) {
let FolderId = datas.FolderId!=null?datas.FolderId:0
emit('success',props.details.type,FolderId);
}
else if(!props.type) CopyId();
} catch (error) { }
})
.catch(() => { });
......@@ -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,
};
......
......@@ -25,7 +25,7 @@
<div class="HistoricalVersion-container"
ref="HistoricalVersion"
style="min-height: 200px;max-height: 400px;">
<el-scrollbar @scroll="scrollingHandler">
<el-scrollbar @scroll="scrollingHandler" height="400">
<table class="text-small" style="width: 100%;">
<tr class="text-left">
<th class="text-light" style="min-width: 150px;width: 150px;">时间</th>
......@@ -45,18 +45,18 @@
</td>
<td class="text-light text-5B5D62"><span>{{item.FileSize}}KB</span></td>
<td class="text-light">
<span :class="[item.NewTitle?'active':'text-5B5D62']">
{{item.NewTitle?item.NewTitle:''}}</span>
<span :class="[item.LogId==0?'active':'text-5B5D62']">
{{item.LogId==0?'当前版本':''}}</span>
</td>
<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-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 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>
</template>
</el-dropdown>
......@@ -65,9 +65,9 @@
</tr>
</template>
</table>
<div v-if="dataList.length == 0 && !loading" class="bg-white rounded"
style="padding: 0 10px;">
<el-empty :image-size="60" description="暂无数据" />
<div v-if="dataList.length == 0 && !loading" class="bg-white rounded col"
style="padding: 40px 10px;">
<el-empty :image-size="150" description="文档没有历史版本" />
</div>
<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>
......@@ -129,10 +129,9 @@ import CopyFile from "./CopyFile.vue";
const deleteLoading = ref<any>(null);
const queryObj = reactive({
pageIndex: 1,
pageSize: 30,
pageSize: 10,
pageCount: 0, //总页数
FileId: props.details.FileId,
UpdateTime: ''
})
const journeyAdsDetails = ref('');
const isCopyTo = ref(false);
......@@ -212,11 +211,13 @@ import CopyFile from "./CopyFile.vue";
};
arrList(pageRes.data.data.pageData);
dataList.value = dataList.value.concat(pageRes.data.data.pageData);
dataList.value[0].NewTitle = '当前版本'
queryObj.pageCount = pageRes.data.data.pageCount;
}
loading.value = false
} catch (error) {
ElMessage.error({
message:'数据加载异常,请刷新页面'
})
loading.value = false
}
}
......
......@@ -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>
......@@ -121,6 +121,7 @@ const editorFileHandler = (item:any)=>{
searchData.value.sellId = item.FileId;
searchData.value.sellTempId = item.TempId;
searchData.value.TemplateType = item.FileType;
searchData.value.ParentFileId = item.FolderId
SalesEditorStore.setSalesEditor(2);
marketStore.setMarket(false);
}
......
......@@ -60,7 +60,7 @@
:render-after-expand="false"
style="width: 220px"
filterable
@check="handleTreeNodeClick"
@current-change="handleTreeNodeClick"
class="auto-width-tree"
/>
......@@ -139,9 +139,7 @@ import FolderService from "@/services/FolderService";
const handleTreeNodeClick = (data:any,checkObj:any) => {
// 共两个参数,依次为:传递给 data 属性的数组中该节点所对应的对象、树目前的选中状态对象
// 树目前的选中状态对象,包含 checkedNodes、checkedKeys、halfCheckedNodes、halfCheckedKeys 四个属性
if (checkObj.checkedKeys.length != 0) {
datas.FolderObj = data
}
datas.FolderObj = data
}
const filterNode = (value: string, data: Tree) => {
if (!value) return true
......@@ -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: "确定",
cancelButtonText: "取消",
type: "warning",
......
......@@ -139,7 +139,7 @@ import FolderService from "@/services/FolderService";
}
const save = () => {
let title = props.details.FileName
ElMessageBox.confirm(`此操作将${title}恢复到${datas.FolderObj.FileName},是否确定?`, "提示", {
ElMessageBox.confirm(`此操作将${title}恢复到${datas.FolderObj.FileName?datas.FolderObj.FileName:'根目录'},是否确定?`, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
......
<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' }"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="20" v-if="currentMenu==3||currentMenu==4"/>
......@@ -55,24 +55,29 @@
</div>
</template>
</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">
{{ formatDateTimeToRead(scope.row.UpdateTime&&scope.row.UpdateTime!=''?scope.row.UpdateTime:scope.row.CreateTime) }}
</template>
</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">
<template #default="scope">
<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-else type="primary" icon="Position" size="small" @click.stop="recover(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="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>
<template #dropdown>
<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>
<template v-if="currentMenu!=-1">
<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>
<el-dropdown-item icon="Position" @click.stop="()=>setFileShareHandler(scope.row)">分享</el-dropdown-item>
......@@ -85,10 +90,10 @@
<span>{{scope.row.IsCollect?'取消收藏':'收藏'}}</span>
</span>
</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>
</template>
<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>
......@@ -100,7 +105,7 @@
<el-empty :image-size="150" v-if="(!dataList || dataList.length==0) && !loading"
:description="datas.emptyTitle" />
</template>
</el-table>
</el-table>
<ShareForm
:id="shareId"
:file-type="shareFileType"
......@@ -148,6 +153,8 @@
emit('success')}"></TreeFileRecover>
</template>
<script setup lang="ts">
import { userStore } from '@/store/user';
import { storeToRefs } from 'pinia';
import { ApiResult } from '@/configs/axios';
import OrgService from '@/services/OrgService';
import { ref,reactive,watch,inject,nextTick, PropType } from 'vue';
......@@ -208,6 +215,7 @@ import CopyFile from "./CopyFile.vue";
type: number;
}>({ id: -1, name: "", parentId: 0, number: 1 });
const datas = reactive({
loggedder: '',
emptyTitle: '',
Title: '',
selectAll: false as any,
......@@ -222,11 +230,14 @@ import CopyFile from "./CopyFile.vue";
});
const SalesEditorStore = useSellTemplateStore();
const marketStore = useScreenStore();
const { userInfo } = storeToRefs(userStore())
datas.loggedder = userInfo.value.emName
const dataList = ref([] as Array<any>);
dataList.value = props.list
const queryObj = ref({} as any);
queryObj.value = props.msg
const loading = ref(false) as Boolean
const shareId = ref(0);
const shareFileType = ref(0)
......@@ -291,12 +302,6 @@ import CopyFile from "./CopyFile.vue";
}
emit('refreshHandler',obj)
}
const clickSort = (type:any) =>{
let obj = {
OrderByType: queryObj.value.OrderByType==2?1:2
}
emit('refreshHandler',obj)
}
const sortHandler = (val:any)=>{
queryObj.value.OrderByType = val.order=='descending'?2:1
let obj = {
......@@ -554,6 +559,15 @@ import CopyFile from "./CopyFile.vue";
searchData.value.sellId = row.FileId;
searchData.value.sellTempId = row.TempId;
searchData.value.TemplateType = row.FileType;
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);
} else {
......@@ -607,13 +621,21 @@ import CopyFile from "./CopyFile.vue";
}
},500)
}
loading.value = true
setTimeout(()=>{
loading.value = false
},300)
watch(() => props.list, (n,o) => {
loading.value = true
if (props.list) {
nextTick(() => {
dataList.value = props.list
setCurrentRow()
})
}
setTimeout(()=>{
loading.value = false
},300)
})
watch(() => props.navigations, (n,o) => {
......@@ -626,14 +648,14 @@ import CopyFile from "./CopyFile.vue";
padding: 0;
}
.journeyAds-Input {
padding-right: 20px;
position: relative;
margin-bottom: 2px;
::v-deep(.el-textarea__inner) {
padding: 5px;
background: #f5f5f5;
}
}
padding-right: 20px;
position: relative;
margin-bottom: 2px;
::v-deep(.el-textarea__inner) {
padding: 5px;
background: #f5f5f5;
}
}
.el-table{
height: 100% !important;
}
......
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