Commit 5e5d4f2a authored by zhengke's avatar zhengke

广告 功能

parent a3602cc7
...@@ -124,6 +124,9 @@ const handleChange: UploadProps['onChange'] = (uploadFile, uploadFiles) => { ...@@ -124,6 +124,9 @@ const handleChange: UploadProps['onChange'] = (uploadFile, uploadFiles) => {
let DrawingBoardSize = await getDrawingBoardSize(psd) let DrawingBoardSize = await getDrawingBoardSize(psd)
queryObj.value.Width = DrawingBoardSize.Width queryObj.value.Width = DrawingBoardSize.Width
queryObj.value.Height = DrawingBoardSize.Height queryObj.value.Height = DrawingBoardSize.Height
queryObj.value.TempType = queryObj.value.Width>queryObj.value.Height?1:2
let viewportRatio = queryObj.value.Height/queryObj.value.Width
useSlidesStore().setViewportRatio(viewportRatio)
} }
fonts.value = getFonts(psd) fonts.value = getFonts(psd)
if(fonts.value){ if(fonts.value){
......
...@@ -78,7 +78,7 @@ ...@@ -78,7 +78,7 @@
size="small" :loading="datas.loading" size="small" :loading="datas.loading"
@click="setTemplate" style="color: #ffff;margin-left: 10px;"> @click="setTemplate" style="color: #ffff;margin-left: 10px;">
<template v-if="userInfo.IsEditTripTemplate==1&&model==1"> <template v-if="userInfo.IsEditTripTemplate==1&&model==1">
{{searchData.TemplateType!=2?'保存模板':'保存广告'}} 保存{{searchData.TemplateType!=2?'模板':'广告'}}
</template> </template>
<template v-if="ConfigId>0&&model!=2"> <template v-if="ConfigId>0&&model!=2">
保存行程 保存行程
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
size="small" :loading="datas.loading" size="small" :loading="datas.loading"
style="color: #ffff;" style="color: #ffff;"
@click="setTemplate(0)"> @click="setTemplate(0)">
保存模板 保存{{searchData.TemplateType!=2?'模板':'广告'}}
</el-button> </el-button>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item> <el-dropdown-item>
...@@ -103,7 +103,7 @@ ...@@ -103,7 +103,7 @@
size="small" :loading="datas.loading" size="small" :loading="datas.loading"
style="color: #ffff;" style="color: #ffff;"
@click="setTemplate(1)"> @click="setTemplate(1)">
另存模板 另存{{searchData.TemplateType!=2?'模板':'广告'}}
</el-button> </el-button>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
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)">
保存模板 保存{{searchData.TemplateType!=2?'模板':'广告'}}
</el-button> </el-button>
</template> </template>
...@@ -282,7 +282,7 @@ const SetSellTemplate = async (type) => { ...@@ -282,7 +282,7 @@ const SetSellTemplate = async (type) => {
if(!TempId){ if(!TempId){
return ElMessage({ return ElMessage({
showClose: true, showClose: true,
message: '模版不存在, 请重选', message: `${queryObj.value.TemplateType==2?'广告':'模版'}不存在, 请重选`,
type: 'warning', type: 'warning',
}) })
} }
...@@ -293,7 +293,13 @@ const SetSellTemplate = async (type) => { ...@@ -293,7 +293,13 @@ const SetSellTemplate = async (type) => {
Id: Id, Id: Id,
TempId: TempId, TempId: TempId,
TempData: queryObj.value.TempData, TempData: queryObj.value.TempData,
Title: queryObj.value.Title Title: queryObj.value.Title,
OWidth: 0,
OHeight: 0,
}
if(queryObj.value.TemplateType==2){
queryMsg.OWidth = queryObj.value.Width
queryMsg.OHeight = queryObj.value.Height
} }
let TemplateRes = await ConfigService.sellSetTemplate(queryMsg); let TemplateRes = await ConfigService.sellSetTemplate(queryMsg);
if (TemplateRes.data.resultCode == 1) { if (TemplateRes.data.resultCode == 1) {
...@@ -320,8 +326,6 @@ const SetSellTemplate = async (type) => { ...@@ -320,8 +326,6 @@ const SetSellTemplate = async (type) => {
// 新增修改模版 // 新增修改模版
const SetTripTemplateSlide = async () => { const SetTripTemplateSlide = async () => {
try { try {
console.log(queryObj.value,'======')
return
let TemplateRes = await ConfigService.SetTripTemplateSlide(queryObj.value); let TemplateRes = await ConfigService.SetTripTemplateSlide(queryObj.value);
if (TemplateRes.data.resultCode == 1) { if (TemplateRes.data.resultCode == 1) {
if(!queryObj.value.TempId){ if(!queryObj.value.TempId){
...@@ -450,7 +454,6 @@ const SetTripTemplateConfig = async () => { ...@@ -450,7 +454,6 @@ const SetTripTemplateConfig = async () => {
} }
// 保存 // 保存
const setTemplate = async (type) =>{ const setTemplate = async (type) =>{
if(searchData.value.TemplateType) queryObj.value.TemplateType = searchData.value.TemplateType
queryObj.value.Title = title.value queryObj.value.Title = title.value
datas.loading = true datas.loading = true
if(SourceLoading.value) setNewDatasList(datas.DataSource) if(SourceLoading.value) setNewDatasList(datas.DataSource)
...@@ -474,7 +477,7 @@ const setTemplate = async (type) =>{ ...@@ -474,7 +477,7 @@ const setTemplate = async (type) =>{
message: '请生成封面图', message: '请生成封面图',
type: 'warning', type: 'warning',
}) })
}else if(queryObj.value.CoverImg=='' && CoverImg.value.startsWith("data:image")){ }else if(queryObj.value.CoverImg=='' && CoverImg.value && CoverImg.value.startsWith("data:image")){
let name = new Date().getTime()+".jpg" let name = new Date().getTime()+".jpg"
const file = dataURLtoFile(CoverImg.value, name) const file = dataURLtoFile(CoverImg.value, name)
let url = await AliyunUpload.UploadAsync(file,`Feature/CoverImg_${name}`) let url = await AliyunUpload.UploadAsync(file,`Feature/CoverImg_${name}`)
...@@ -511,15 +514,14 @@ const setTemplate = async (type) =>{ ...@@ -511,15 +514,14 @@ const setTemplate = async (type) =>{
}) })
} }
} }
// console.log(arr,'-------tttt')
queryObj.value.TempData = JSON.stringify(arr) queryObj.value.TempData = JSON.stringify(arr)
// console.log(JSON.stringify(queryObj.value))
if(model.value==1&&userInfo.value.IsEditTripTemplate==1){ if(model.value==1&&userInfo.value.IsEditTripTemplate==1){
await SetTripTemplateSlide() await SetTripTemplateSlide()
}else if(ConfigId.value&&model.value!=2){ }else if(ConfigId.value&&model.value!=2){
await SetTripTemplateConfig() await SetTripTemplateConfig()
}else if(model.value==2&&SalesEditor.value>0&&(SalesEditor.value==1||SalesEditor.value==2)){ }else if(model.value==2&&SalesEditor.value>0){
await SetSellTemplate(type) await SetSellTemplate(type)
} }
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
v-click-outside="() => setThumbnailsFocus(false)" v-click-outside="() => setThumbnailsFocus(false)"
v-contextmenu="contextmenusThumbnails" v-contextmenu="contextmenusThumbnails"
> >
<div class="add-slide"> <div class="add-slide" v-if="queryObj.TemplateType!=2">
<div class="btn" @click="createSlide()"><IconPlus class="icon" />添加幻灯片</div> <div class="btn" @click="createSlide()"><IconPlus class="icon" />添加幻灯片</div>
<Popover trigger="click" placement="bottom-start" v-model:value="presetLayoutPopoverVisible" center> <Popover trigger="click" placement="bottom-start" v-model:value="presetLayoutPopoverVisible" center>
<template #content> <template #content>
...@@ -147,7 +147,6 @@ queryObj.value = inject(injectKeyDataSource).queryObj ...@@ -147,7 +147,6 @@ queryObj.value = inject(injectKeyDataSource).queryObj
* 行程保存成功获取行程详情 * 行程保存成功获取行程详情
*/ */
const GetTripConfig = async () =>{ const GetTripConfig = async () =>{
console.log('行程详情--------')
try { try {
let queryMsg = { let queryMsg = {
ConfigId: ConfigId.value ConfigId: ConfigId.value
...@@ -390,7 +389,11 @@ const GetTripTemplate = async () =>{ ...@@ -390,7 +389,11 @@ const GetTripTemplate = async () =>{
if(SalesBack.value==0||(SalesBack.value==1&&searchData.value.TempId)){ if(SalesBack.value==0||(SalesBack.value==1&&searchData.value.TempId)){
let viewportRatio = 1.414 let viewportRatio = 1.414
if(dataRes.data.data.TempType==1) viewportRatio = 0.7069 if(dataRes.data.data.TempType==1) viewportRatio = 0.7069
if(dataRes.data.data.Width&&dataRes.data.data.Height) viewportRatio = dataRes.data.data.Height/dataRes.data.data.Width if(dataRes.data.data.TemplateType==2&&dataRes.data.data.Width&&dataRes.data.data.Height) {
viewportRatio = dataRes.data.data.Height/dataRes.data.data.Width
queryObj.value.Width = dataRes.data.data.Width
queryObj.value.Height = dataRes.data.data.Height
}
slidesStore.setViewportRatio(viewportRatio) slidesStore.setViewportRatio(viewportRatio)
let SlidesData = JSON.parse(dataRes.data.data.TempData) let SlidesData = JSON.parse(dataRes.data.data.TempData)
...@@ -434,6 +437,7 @@ const GetTripTemplate = async () =>{ ...@@ -434,6 +437,7 @@ const GetTripTemplate = async () =>{
queryObj.value.ColorName = dataRes.data.data.ColorName queryObj.value.ColorName = dataRes.data.data.ColorName
queryObj.value.ColorStr = dataRes.data.data.ColorStr queryObj.value.ColorStr = dataRes.data.data.ColorStr
queryObj.value.TempType = dataRes.data.data.TempType queryObj.value.TempType = dataRes.data.data.TempType
queryObj.value.TemplateType = dataRes.data.data.TemplateType
...@@ -466,8 +470,12 @@ const sellGetTripTemplate = async () =>{ ...@@ -466,8 +470,12 @@ const sellGetTripTemplate = async () =>{
let dataObj = dataRes.data.data let dataObj = dataRes.data.data
let viewportRatio = 1.414 let viewportRatio = 1.414
if(dataRes.data.data.TempType==1) viewportRatio = 0.7069 if(dataRes.data.data.TempType==1) viewportRatio = 0.7069
if(dataRes.data.data.Width&&dataRes.data.data.Height) viewportRatio = dataRes.data.data.Height/dataRes.data.data.Width if(dataRes.data.data.TemplateType==2&&dataRes.data.data.Width&&dataRes.data.data.Height) {
viewportRatio = dataRes.data.data.Height/dataRes.data.data.Width
}
queryObj.value.TemplateType = dataRes.data.data.TemplateType
slidesStore.setViewportRatio(viewportRatio) slidesStore.setViewportRatio(viewportRatio)
if(SalesBack.value==0) slidesStore.setTitle(dataRes.data.data.Title) if(SalesBack.value==0) slidesStore.setTitle(dataRes.data.data.Title)
if(SalesBack.value==0&&searchData.value.sellId){ if(SalesBack.value==0&&searchData.value.sellId){
console.log(JSON.parse(dataObj.TempData)) console.log(JSON.parse(dataObj.TempData))
...@@ -721,6 +729,9 @@ else GetTripTemplate() ...@@ -721,6 +729,9 @@ else GetTripTemplate()
font-size: 14px; font-size: 14px;
} }
} }
.add-slide.borderBottom0{
border-bottom: 0;
}
.thumbnail-list { .thumbnail-list {
padding: 5px 0; padding: 5px 0;
flex: 1; flex: 1;
......
...@@ -99,7 +99,7 @@ ...@@ -99,7 +99,7 @@
<div class="row"> <div class="row">
<Button style="flex: 1;" @click="applyBackgroundAllSlide()">应用背景到全部</Button> <Button style="flex: 1;" @click="applyBackgroundAllSlide()">应用背景到全部</Button>
</div> </div>
<template v-if="queryObj.TemplateType!=2">
<Divider /> <Divider />
<div class="row"> <div class="row">
...@@ -125,6 +125,8 @@ ...@@ -125,6 +125,8 @@
]" ]"
/> />
</div> </div>
</template>
<Divider /> <Divider />
...@@ -309,7 +311,7 @@ import { WEB_FONTS } from '@/configs/font' ...@@ -309,7 +311,7 @@ import { WEB_FONTS } from '@/configs/font'
import useHistorySnapshot from '@/hooks/useHistorySnapshot' import useHistorySnapshot from '@/hooks/useHistorySnapshot'
import useSlideTheme from '@/hooks/useSlideTheme' import useSlideTheme from '@/hooks/useSlideTheme'
import { getImageDataURL } from '@/utils/image' import { getImageDataURL } from '@/utils/image'
import { injectKeyDataSource } from '@/types/injectKey' import { injectKeyDataSource, injectKeyTemplate } from '@/types/injectKey'
import ColorButton from './common/ColorButton.vue' import ColorButton from './common/ColorButton.vue'
import FileInput from '@/components/FileInput.vue' import FileInput from '@/components/FileInput.vue'
...@@ -329,6 +331,8 @@ const datas = reactive({ ...@@ -329,6 +331,8 @@ const datas = reactive({
const queryObj = ref({} as any) const queryObj = ref({} as any)
datas.DataSource = inject(injectKeyDataSource) datas.DataSource = inject(injectKeyDataSource)
queryObj.value = inject(injectKeyDataSource).queryObj queryObj.value = inject(injectKeyDataSource).queryObj
const searchData = ref({} as any)
searchData.value = inject(injectKeyTemplate)
const slidesStore = useSlidesStore() const slidesStore = useSlidesStore()
const { availableFonts } = storeToRefs(useMainStore()) const { availableFonts } = storeToRefs(useMainStore())
const { slides, currentSlide, viewportRatio, theme, slideIndex } = storeToRefs(slidesStore) const { slides, currentSlide, viewportRatio, theme, slideIndex } = storeToRefs(slidesStore)
......
...@@ -87,8 +87,11 @@ searchData.value = inject(injectKeyTemplate) ...@@ -87,8 +87,11 @@ searchData.value = inject(injectKeyTemplate)
let TempIds = 0 let TempIds = 0
let TemplatesType = 0
if(searchData.value.TempId) TempIds = searchData.value.TempId if(searchData.value.TempId) TempIds = searchData.value.TempId
else if(TempId.value) TempIds = TempId.value else if(TempId.value) TempIds = TempId.value
if(searchData.value.TemplateType) TemplatesType = searchData.value.TemplateType
if(searchData.value.TemplateType!=2&&!searchData.value.TempId) useSlidesStore().setViewportRatio(1.414)
const refThumbnails = ref(null) const refThumbnails = ref(null)
const param = ref("") const param = ref("")
param.value = query() param.value = query()
...@@ -113,7 +116,7 @@ const datas = reactive({ ...@@ -113,7 +116,7 @@ const datas = reactive({
ColorStr: null,//颜色值 是 [string] ColorStr: null,//颜色值 是 [string]
TempType: 1,// 版面类型(1-横版,2-竖版) TempType: 1,// 版面类型(1-横版,2-竖版)
TagJsonStr: '',// 标签 TagJsonStr: '',// 标签
TemplateType: 0, TemplateType: TemplatesType,// 1行程模版 2广告模版
Width: 0, Width: 0,
Height: 0, Height: 0,
} }
...@@ -162,7 +165,8 @@ const GetTripFiled = async () =>{ ...@@ -162,7 +165,8 @@ const GetTripFiled = async () =>{
console.log("TemplateGetTripFiled", error); console.log("TemplateGetTripFiled", error);
} }
} }
GetTripFiled() if(searchData.value.TemplateType!=2) GetTripFiled()
const mainStore = useMainStore() const mainStore = useMainStore()
const { dialogForExport, showSelectPanel, showSearchPanel } = storeToRefs(mainStore) const { dialogForExport, showSelectPanel, showSearchPanel } = storeToRefs(mainStore)
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<el-dropdown split-button <el-dropdown split-button
size="small" type="primary" size="small" type="primary"
v-if="userInfo.IsEditTripTemplate==1&&model==1"> v-if="userInfo.IsEditTripTemplate==1&&model==1">
<span style="font-size: 23px;"> + </span> <span style="font-size: 23px;margin-right: 10px;"> + </span> <span>添加</span>
<template #dropdown> <template #dropdown>
<el-dropdown-menu> <el-dropdown-menu>
<el-dropdown-item> <el-dropdown-item>
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
添加模版 添加模版
</el-button> </el-button>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item v-if="false"> <el-dropdown-item v-if="true">
<el-button type="primary" size="small" <el-button type="primary" size="small"
@click="addTemplate(2)" style="color: #ffff;"> @click="addTemplate(2)" style="color: #ffff;">
添加广告 添加广告
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<el-check-tag :checked="queryObj.CountryName == x.CountryName" <el-check-tag :checked="queryObj.CountryName == x.CountryName"
@change="onCountryNameChangeHandler(x.CountryName)" class="text-small q-mr-md" @change="onCountryNameChangeHandler(x.CountryName)" class="text-small q-mr-md"
v-for="(x,i) in countries" :key="i">{{x.CountryName}}</el-check-tag> v-for="(x,i) in countries" :key="i">{{x.CountryName}}</el-check-tag>
<Popover v-if="colorArrOther.length>0" trigger="click" placement="bottom-start" v-model:value="MenuCountryVisible"> <Popover v-if="countriesOther.length>0" trigger="click" placement="bottom-start" v-model:value="MenuCountryVisible">
<template #content> <template #content>
<el-check-tag :checked="queryObj.CountryName == x.CountryName" <el-check-tag :checked="queryObj.CountryName == x.CountryName"
@change="onCountryNameChangeHandler(x.CountryName,1),MenuCountryVisible=false" class="text-small q-mr-md" @change="onCountryNameChangeHandler(x.CountryName,1),MenuCountryVisible=false" class="text-small q-mr-md"
...@@ -165,10 +165,11 @@ ...@@ -165,10 +165,11 @@
</Popover> </Popover>
</div> </div>
</div> </div>
<template v-if="!SalesEditor&&!ConfigId">
<div class="q-pb-md"> <div class="q-pb-md">
<div class="MarketVerticalLine">&nbsp;</div> <div class="MarketVerticalLine">&nbsp;</div>
</div> </div>
<div class="q-pb-md" v-if="false"> <div class="q-pb-md" v-if="true">
<div class="row text-small items-center wrap"> <div class="row text-small items-center wrap">
<span style="margin-right: 30px;">类型:</span> <span style="margin-right: 30px;">类型:</span>
<el-check-tag :checked="queryObj.TemplateType == 0" @change="onTypeChangeHandler('')" <el-check-tag :checked="queryObj.TemplateType == 0" @change="onTypeChangeHandler('')"
...@@ -177,6 +178,7 @@ ...@@ -177,6 +178,7 @@
class="text-small q-mr-md" v-for="(x,i) in typeArr" :key="i">{{x.typeName}}</el-check-tag> class="text-small q-mr-md" v-for="(x,i) in typeArr" :key="i">{{x.typeName}}</el-check-tag>
</div> </div>
</div> </div>
</template>
</div> </div>
</div> </div>
<div style="margin-top: 20px;"> <div style="margin-top: 20px;">
...@@ -190,7 +192,7 @@ ...@@ -190,7 +192,7 @@
</div> </div>
<div class="q-mt-lg"> <div class="q-mt-lg">
<el-button class="MarketIndexButtom" type="primary" <el-button class="MarketIndexButtom" type="primary"
@click="goToTemplate(item)">选择该模版</el-button> @click="goToTemplate(item)">选择该{{item.TemplateType!=2?'模版':'广告'}}</el-button>
</div> </div>
<div class="q-mt-lg" v-if="model==1"> <div class="q-mt-lg" v-if="model==1">
<el-button class="MarketIndexButtom" type="primary" <el-button class="MarketIndexButtom" type="primary"
...@@ -200,7 +202,11 @@ ...@@ -200,7 +202,11 @@
<div class="MarketIndexList-img"> <div class="MarketIndexList-img">
<img :src="item.CoverImg" class="rounded" /> <img :src="item.CoverImg" class="rounded" />
</div> </div>
<div class="MarketIndexList-text">{{item.Title}}</div> <div class="MarketIndexList-text row items-center">
<el-tag class="mx-1 q-mr-md" effect="dark" v-if="item.TemplateType==2"
size="small">广告</el-tag>
<span>{{item.Title}}</span>
</div>
</div> </div>
</template> </template>
...@@ -219,7 +225,7 @@ ...@@ -219,7 +225,7 @@
<el-dialog v-model="datas.DetailsVisible" :align-center="true" :show-close="true" :close-on-press-escape="false" <el-dialog v-model="datas.DetailsVisible" :align-center="true" :show-close="true" :close-on-press-escape="false"
:close-on-click-modal="true" style="width: 600px;" class="small-padding "> :close-on-click-modal="true" style="width: 600px;" class="small-padding ">
<template #header> <template #header>
<div class="text-title">模板预览</div> <div class="text-title">{{showCurrentTemplate.TemplateType!=2?'模板':'广告'}}预览</div>
</template> </template>
<div v-if="showCurrentTemplate && showCurrentTemplate.PageImageList" style="max-height: 80vh; overflow-y: auto;"> <div v-if="showCurrentTemplate && showCurrentTemplate.PageImageList" style="max-height: 80vh; overflow-y: auto;">
<img v-for="(x,i) in showCurrentTemplate.PageImageList" :src="x" :key="i" style="width:100%;height:auto;margin-bottom: 10px;"> <img v-for="(x,i) in showCurrentTemplate.PageImageList" :src="x" :key="i" style="width:100%;height:auto;margin-bottom: 10px;">
...@@ -257,6 +263,18 @@ ...@@ -257,6 +263,18 @@
const MenuCountryVisible = ref(false) const MenuCountryVisible = ref(false)
const CountryOtherName = ref(false) const CountryOtherName = ref(false)
const loading = ref(false as any)
const searchData = ref({} as any)
searchData.value = inject(injectKeyTemplate)
const marketStore = useScreenStore()
const isModelStore = useScreenStore()
const layoutsStore = useSlidesStore()
const TempIdStore = useScreenStore()
const { screening, market, model, isModel, ConfigId, TempId} = storeToRefs(useScreenStore())
const SalesEditorStore = useSellTemplateStore()
const { SalesEditor, SalesBack } = storeToRefs(useSellTemplateStore())
const currentPage = ref(1 as Number); const currentPage = ref(1 as Number);
const showCurrentTemplate = ref<any>() const showCurrentTemplate = ref<any>()
const deleteLoading = ref<any>(null) const deleteLoading = ref<any>(null)
...@@ -266,6 +284,9 @@ ...@@ -266,6 +284,9 @@
loading: false, loading: false,
ColorValue: '', ColorValue: '',
}) })
let TemplateType = 0
if(searchData.value.TemplateType) TemplateType = searchData.value.TemplateType
if(ConfigId.value>0) TemplateType = 1
const queryObj = reactive({ const queryObj = reactive({
pageIndex: 1, pageIndex: 1,
pageSize: 20, pageSize: 20,
...@@ -276,21 +297,11 @@ ...@@ -276,21 +297,11 @@
ColorName: '', //颜色名称 ColorName: '', //颜色名称
pageCount: 0, //总页数 pageCount: 0, //总页数
TempType: 0, TempType: 0,
TemplateType: 0,//1模版 2广告 TemplateType: TemplateType,//0 不限 1模版 2广告
type: 0, type: 0,
}) })
const loading = ref(false as any)
const searchData = ref({} as any)
searchData.value = inject(injectKeyTemplate)
const marketStore = useScreenStore()
const isModelStore = useScreenStore()
const layoutsStore = useSlidesStore()
const TempIdStore = useScreenStore()
const { screening, market, model, isModel, ConfigId, TempId} = storeToRefs(useScreenStore())
const SalesEditorStore = useSellTemplateStore()
const { SalesEditor, SalesBack } = storeToRefs(useSellTemplateStore())
const addTemplate = (type:number) =>{ const addTemplate = (type:number) =>{
searchData.value.TemplateType = type searchData.value.TemplateType = type
...@@ -329,14 +340,14 @@ ...@@ -329,14 +340,14 @@
queryObj.pageIndex = 1 queryObj.pageIndex = 1
ElMessage({ ElMessage({
showClose: true, showClose: true,
message: '删除模版成功', message: `删除${item.TemplateType==2?'广告':'模版'}成功`,
type: 'success', type: 'success',
}) })
await queryTemplateBySearchHandler() await queryTemplateBySearchHandler()
}else { }else {
ElMessage({ ElMessage({
showClose: true, showClose: true,
message: '删除模版失败', message: `删除${item.TemplateType==2?'广告':'模版'}失败`,
type: 'warning', type: 'warning',
}) })
} }
...@@ -456,13 +467,25 @@ ...@@ -456,13 +467,25 @@
var tempData = res.data.data; var tempData = res.data.data;
//国家 //国家
if (tempData && tempData.CountryList) { if (tempData && tempData.CountryList) {
countriesOther.value = tempData.CountryList.filter((x,index)=>{ return index>=3}) countriesOther.value = tempData.CountryList.filter((x,index)=>{
countries.value = tempData.CountryList.filter((x,index)=>{ return index<3}) if(model.value==1){ return index>=3 }
else return index>=4
})
countries.value = tempData.CountryList.filter((x,index)=>{
if(model.value==1) {return index<3}
else return index<4
})
} }
//颜色 //颜色
if (tempData && tempData.ColorList) { if (tempData && tempData.ColorList) {
colorArrOther.value = tempData.ColorList.filter((x,index)=>{ return index>=3}) colorArrOther.value = tempData.ColorList.filter((x,index)=>{
colorArr.value = tempData.ColorList.filter((x,index)=>{ return index<3}) if(model.value==1){ return index>=3 }
else return index>=7
})
colorArr.value = tempData.ColorList.filter((x,index)=>{
if(model.value==1){ return index<3 }
else return index<7
})
} }
//季节 //季节
if (tempData && tempData.SeasonList) { if (tempData && tempData.SeasonList) {
...@@ -574,7 +597,6 @@ ...@@ -574,7 +597,6 @@
position: relative; position: relative;
overflow: hidden; overflow: hidden;
} }
.MarketIndexList-Hover{ .MarketIndexList-Hover{
z-index: 1; z-index: 1;
position: absolute; position: absolute;
......
...@@ -2,19 +2,24 @@ ...@@ -2,19 +2,24 @@
<div ref="SellTemplateRef"> <div ref="SellTemplateRef">
<el-row justify="space-between" class="items-center"> <el-row justify="space-between" class="items-center">
<el-col :span="6" class="row items-center"> <el-col :span="6" class="row items-center">
<!-- <el-button-group class="ml-4"> <el-button-group class="ml-4">
<el-button type="primary" size="small" @click="querySearchHandler">模版</el-button> <template v-for="item in TemplateTypeList">
<el-button type="primary" size="small" @click="querySearchHandler">广告</el-button> <el-button type="primary"
</el-button-group> --> :plain="queryObj.TemplateType==item.Id?false:true" size="small"
@click="queryObj.TemplateType=item.Id,querySearchHandler()">
{{item.Name}}
</el-button>
</template>
</el-button-group>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="6">
<el-input v-model="queryObj.Title" placeholder="输入关键字快速查找" class="input-with-select"> <el-input v-model="queryObj.Title" placeholder="输入关键字快速查找" class="input-with-select">
<template #append> <template #append>
<el-button type="primary" @click="querySearchHandler">搜索</el-button> <el-button type="primary" @click="querySearchHandler">搜索</el-button>
</template> </template>
</el-input> </el-input>
</el-col> </el-col>
<el-col :span="4" class="row flex-end"> <el-col :span="6" class="row flex-end">
<sellNavs /> <sellNavs />
</el-col> </el-col>
</el-row> </el-row>
...@@ -28,7 +33,10 @@ ...@@ -28,7 +33,10 @@
</div> </div>
<div class="row flex-between nowrap sellList pointer" v-for="(item,index) in dataList"> <div class="row flex-between nowrap sellList pointer" v-for="(item,index) in dataList">
<div> <div>
<span class="iconfont icon-pdf sellPdf"></span>
<el-tag class="mx-1 q-mr-md" effect="dark" v-if="item.TemplateType==2"
size="small">广告</el-tag>
<span v-else class="iconfont icon-pdf sellPdf"></span>
<span>{{item.Title}}</span> <span>{{item.Title}}</span>
</div> </div>
<div> <div>
...@@ -92,7 +100,7 @@ ...@@ -92,7 +100,7 @@
import { ElLoading, ElMessage, ElMessageBox } from "element-plus"; import { ElLoading, ElMessage, ElMessageBox } from "element-plus";
import { injectKeyTemplate } from '@/types/injectKey' import { injectKeyTemplate } from '@/types/injectKey'
import { useSellTemplateStore, useScreenStore } from '@/store' import { useSellTemplateStore, useScreenStore, useSlidesStore } from '@/store'
import ConfigService from '@/services/ConfigService' import ConfigService from '@/services/ConfigService'
import { query } from '@/utils/common' import { query } from '@/utils/common'
...@@ -112,9 +120,15 @@ ...@@ -112,9 +120,15 @@
pageIndex: 1, pageIndex: 1,
pageSize: 20, pageSize: 20,
pageCount: 0, //总页数 pageCount: 0, //总页数
TemplateType: 0,
}) })
searchData.value.sellId = 0 searchData.value.sellId = 0
const dataList = ref([] as Array < any > ); const dataList = ref([] as Array < any > );
const TemplateTypeList = ref([
{Name:'不限',Id:0},
{Name:'模版',Id:1},
{Name:'广告',Id:2},
]);
const loading = ref(false as any) const loading = ref(false as any)
const SellTemplateRef = ref<any>() const SellTemplateRef = ref<any>()
const datas = reactive({ const datas = reactive({
...@@ -122,7 +136,7 @@ ...@@ -122,7 +136,7 @@
activeId: 1, activeId: 1,
} }
}) })
const DeleteTemplate = async (Id:Number) => { const DeleteTemplate = async (item:any) => {
ElMessageBox.confirm( ElMessageBox.confirm(
'此操作将删除该模版,是否确定?', '此操作将删除该模版,是否确定?',
'提示', '提示',
...@@ -134,7 +148,7 @@ ...@@ -134,7 +148,7 @@
).then(async () => { ).then(async () => {
try { try {
let queryMsg = { let queryMsg = {
Id: Id Id: item.Id
} }
deleteLoading.value = ElLoading.service({ deleteLoading.value = ElLoading.service({
lock:true, lock:true,
...@@ -145,14 +159,14 @@ ...@@ -145,14 +159,14 @@
queryObj.pageIndex = 1 queryObj.pageIndex = 1
ElMessage({ ElMessage({
showClose: true, showClose: true,
message: '删除模版成功', message: `删除${item.TemplateType==2?'广告':'模版'}成功`,
type: 'success', type: 'success',
}) })
querySearchHandler() querySearchHandler()
}else { }else {
ElMessage({ ElMessage({
showClose: true, showClose: true,
message: '删除模版失败', message: `删除${item.TemplateType==2?'广告':'模版'}失败`,
type: 'warning', type: 'warning',
}) })
} }
...@@ -164,10 +178,23 @@ ...@@ -164,10 +178,23 @@
} }
const editDelete = async (row:any,type:Number) => { const editDelete = async (row:any,type:Number) => {
if(type==1){ if(type==1){
DeleteTemplate(row.Id) DeleteTemplate(row)
}else{ }else{
let list = [
{
id: 'test-slide-1',
pageType: 0,
elements: [],
background: {
type: 'solid',
color: '#ffffff',
},
}
]
useSlidesStore().setSlides(list)
searchData.value.sellId = row.Id searchData.value.sellId = row.Id
searchData.value.sellTempId = row.TempId searchData.value.sellTempId = row.TempId
searchData.value.TemplateType = row.TemplateType
SalesEditorStore.setSalesEditor(2) SalesEditorStore.setSalesEditor(2)
marketStore.setMarket(false) marketStore.setMarket(false)
} }
...@@ -226,6 +253,9 @@ ...@@ -226,6 +253,9 @@
margin-right: 15px; margin-right: 15px;
color: $themeHoverColor; color: $themeHoverColor;
} }
.sellPdf.sellAd{
color: $textColor;
}
.sellHeader{ .sellHeader{
font-size: 14px; font-size: 14px;
padding: 10px 8px 10px 8px; padding: 10px 8px 10px 8px;
......
...@@ -9,18 +9,18 @@ ...@@ -9,18 +9,18 @@
<el-button type="primary" <el-button type="primary"
size="small" :loading="datas.loading" size="small" :loading="datas.loading"
style="color: #ffff;" style="color: #ffff;"
@click="sellAdd(1)"> @click="searchData.TemplateType=1,sellAdd(1)">
新建模版 新建模版
</el-button> </el-button>
</el-dropdown-item> </el-dropdown-item>
<!-- <el-dropdown-item> <el-dropdown-item v-if="true">
<el-button type="primary" <el-button type="primary"
size="small" :loading="datas.loading" size="small" :loading="datas.loading"
style="color: #ffff;" style="color: #ffff;"
@click="setTemplate(3)"> @click="searchData.TemplateType=2,sellAdd(3)">
新建广告 新建广告
</el-button> </el-button>
</el-dropdown-item> --> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</template> </template>
</el-dropdown> </el-dropdown>
......
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