Commit 7d913275 authored by zhengke's avatar zhengke

修复编辑模版 画布尺寸权限,

parent 45397db2
......@@ -92,7 +92,6 @@ import Button from '@/components/Button.vue'
import RadioButton from '@/components/RadioButton.vue'
import RadioGroup from '@/components/RadioGroup.vue'
import { injectKeyTemplate } from '@/types/injectKey'
import { query } from '@/utils/common'
const emit = defineEmits<{
(event: 'close'): void
......@@ -109,7 +108,7 @@ const range = ref<[number, number]>([1, slides.value.length])
const format = ref<'jpeg' | 'png'>('jpeg')
const quality = ref(1)
const ignoreWebfont = ref(false) //开启在线字体
let param = query()
const autoSave = inject('SellTravelSave') as Ref<number>
const downloadLink= ref()
const fileUrl = ref("")
......
......@@ -98,7 +98,6 @@ import Button from '@/components/Button.vue'
import ButtonGroup from '@/components/ButtonGroup.vue'
import Popover from '@/components/Popover.vue'
import UploadPicture from '../../CanvasTool/UploadPicture.vue'
import { query } from '@/utils/common'
const shapeClipPathOptions = CLIPPATHS
const ratioClipOptions = [
......@@ -141,8 +140,7 @@ const { handleElement, handleElementId } = storeToRefs(mainStore)
const { currentSlide } = storeToRefs(slidesStore)
const { ctrlKeyState } = storeToRefs(useKeyboardStore())
const layerName = ref(handleElement.value?.layerName??'')
const param = query()
const mode = parseInt(param.model??1)
const handleImageElement = handleElement as Ref<PPTImageElement>
......@@ -150,7 +148,8 @@ const clipPanelVisible = ref(false)
const { addHistorySnapshot } = useHistorySnapshot()
const { imgReplaceVisible } = storeToRefs(useScreenStore())
const { imgReplaceVisible, model } = storeToRefs(useScreenStore())
const mode = model.value??1
provide('imgType',2)
......
......@@ -130,17 +130,19 @@
<div class="row items-center">
<span class="Required q-mr-md">*</span>选择颜色:
</div>
<el-button v-if="searchData.isTeamManage" size="small" class="button-new-tag q-ml-md ml-1" @click="datas.addColorsShow=!datas.addColorsShow">
<el-button v-if="searchData.isTeamManage" size="small"
class="button-new-tag q-ml-md ml-1"
@click="setColorsShow">
+ 颜色
</el-button>
</p>
<div v-if="datas.addColorsShow"
class="ColorsShowBox">
class="ColorsShowBox" @click= "stopPropagation">
<p class="q-mt-md row flex-between">
<span>新增颜色:</span>
<span>
<el-button class="button-new-tag ml-1"
size="small" @click="CancelAddColor()">
size="small" @click.stop="CancelAddColor()">
取消
</el-button>
<el-button class="button-new-tag ml-1 q-ml-xs"
......@@ -221,57 +223,6 @@
</el-option>
</el-select>
</div>
<!-- <div class="q-mt-sm" v-if="datas.addColorsShow"
style="background: #eeee;border-radius: 3px;padding: 0 5px 10px 5px;">
<p class="q-mt-md row flex-between">
<span>新增颜色:</span>
<span>
<el-button class="button-new-tag ml-1"
size="small" @click="CancelAddColor()">
取消
</el-button>
<el-button class="button-new-tag ml-1 q-ml-xs"
:loading="datas.addColorLoading"
type="primary"
size="small" @click="setColor()">
提交
</el-button>
</span>
</p>
<div class="row q-mt-md items-center">
<span class="Required q-mr-xs">* </span>
<el-select v-model="datas.addColor.Code" placeholder="请选择分类">
<el-option
key=""
label="不限"
value=""
/>
<el-option
v-for="item in ColorList"
:key="item.ID"
:label="`${item.Name}`"
:value="item.ID"
/>
</el-select>
</div>
<div class="row q-mt-md items-center">
<span class="Required q-mr-xs">*</span>
<el-input
placeholder="颜色名称"
v-model="datas.addColor.Name"
class="ml-1 w-20 q-ml-sm"
size="small"
/>
<span class="Required q-mr-xs q-ml-sm">*</span>
<el-input
placeholder="例:#e5e3da"
v-model="datas.addColor.Content"
class="ml-1 w-20 q-ml-sm"
size="small"
/>
</div>
</div> -->
<p class="q-mt-md"><span class="Required q-mr-md">*</span>选择季节:</p>
<div class="row wrap q-mt-md">
<el-select v-model="queryObj.SeasonName" class="m-2" placeholder="请选择季节">
......@@ -311,7 +262,7 @@
<script lang="ts" setup>
import { computed, ref, reactive, watch, inject, nextTick } from 'vue'
import { computed, ref, reactive, watch, inject, nextTick, onMounted, onBeforeUnmount } from 'vue'
import { storeToRefs } from 'pinia'
import { ElInput } from 'element-plus'
import { useMainStore, useSlidesStore, useScreenStore } from '@/store'
......@@ -350,8 +301,6 @@
addColorLoading: false,
ColorList: [],
EditAddType: 0,//0新增 1编辑
addEditLoading: false,
EditAddCountryShow: false,
DataSource:{},
CountryValue: null,
})
......@@ -409,6 +358,15 @@
Name: queryObj.value.ColorStr
})
const stopPropagation = (event) => {
event.stopPropagation()
}
const setColorsShow = (event) => {
event.stopPropagation()
datas.addColorsShow=!datas.addColorsShow
}
const handleUpdateTitle = () => {
slidesStore.setTitle(titleValue.value)
queryObj.value.Title = titleValue.value
......@@ -458,7 +416,7 @@
message: '新增颜色成功',
type: 'success',
})
querySearchHandler(0)
getColor(0)
CancelAddColor()
}else {
ElMessage({
......@@ -707,6 +665,17 @@
getLinesHandler()
getColor(0)
// GetTemplateColors()
onMounted( () => {
document.addEventListener('click', (e) => {
if (datas.addColorsShow) {
CancelAddColor()
}
});
})
onBeforeUnmount(() => {
document.removeEventListener('click', () => {});
})
</script>
<style lang="scss" scoped>
......@@ -742,23 +711,24 @@
}
.ColorsShowBox{
position: absolute;
right: -10px;
right: 0px;
bottom: 34px;
width: 245px;
padding: 5px 15px 15px 15px;
background: #eee;
width: 224px;
padding: 0px 10px 10px 10px;
background: #FFF;
border-radius: 3px;
z-index: 999;
box-shadow: 2px 2px 10px 2px #EEE;
}
.ColorsShowBox::after{
content: '';
width: 0;
height: 0;
position: absolute;
right: 40px;
bottom: -10px;
right: 25px;
bottom: -8px;
border-left: 5px solid transparent;
border-right: 5px solid transparent;
border-top: 10px solid #eee;
border-top: 10px solid #FFF;
}
</style>
\ No newline at end of file
......@@ -99,6 +99,7 @@
<div class="row">
<Button style="flex: 1;" @click="applyBackgroundAllSlide()">应用背景到全部</Button>
</div>
<template v-if="model==1">
<template v-if="queryObj.TemplateType!=2">
<Divider />
......@@ -142,6 +143,7 @@
<span class="q-ml-md" >px</span>
</div>
</template>
</template>
<Divider />
......@@ -333,7 +335,7 @@
<script lang="ts" setup>
import { computed, ref, reactive,inject } from 'vue'
import { storeToRefs } from 'pinia'
import { useMainStore, useSlidesStore, useFontStore } from '@/store'
import { useMainStore, useSlidesStore, useFontStore, useScreenStore } from '@/store'
import type { SlideBackground, SlideTheme } from '@/types/slides'
import { PRESET_THEMES } from '@/configs/theme'
import { WEB_FONTS } from '@/configs/font'
......@@ -356,8 +358,8 @@ import { VIEWPORT_SIZE, VIEWPORT_VER_SIZE } from '@/configs/canvas'
const datas = reactive({
CustomSize:{ // 自定义尺寸
width: VIEWPORT_SIZE.value,
height: VIEWPORT_VER_SIZE.value,
width: VIEWPORT_SIZE.Value,
height: VIEWPORT_VER_SIZE.Value,
},
DataSource:{
DataSourceOverlay: false
......@@ -372,6 +374,7 @@ const slidesStore = useSlidesStore()
const { availableFonts } = storeToRefs(useMainStore())
const { slides, currentSlide, viewportRatio, theme, slideIndex } = storeToRefs(slidesStore)
const { formatFonts } = storeToRefs(useFontStore())
const { model } = storeToRefs(useScreenStore())
const moreThemeConfigsVisible = ref(false)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment