Commit bffa3549 authored by zhengke's avatar zhengke

修复颜色bug

parent f9b47d4f
...@@ -70,7 +70,6 @@ watch(() => router.currentRoute.value.path, (toPath) => { ...@@ -70,7 +70,6 @@ watch(() => router.currentRoute.value.path, (toPath) => {
watch(()=>userInfo.value, (newUser)=>{ watch(()=>userInfo.value, (newUser)=>{
let tempId = userInfo.value && userInfo.value.id ? userInfo.value.id : '' let tempId = userInfo.value && userInfo.value.id ? userInfo.value.id : ''
console.log(tempId!=currentId.value)
if(tempId!=currentId.value){ if(tempId!=currentId.value){
if(userInfo.value.iv || userInfo.value.it) loadWater() if(userInfo.value.iv || userInfo.value.it) loadWater()
else freeUserWatermake() else freeUserWatermake()
......
...@@ -229,7 +229,7 @@ if(queryObj.value.Title) titleValue.value = queryObj.value.Title ...@@ -229,7 +229,7 @@ if(queryObj.value.Title) titleValue.value = queryObj.value.Title
const MonitoringNumber = ref(0) const MonitoringNumber = ref(0)
const MonitoringTNumber = ref(0) const MonitoringTNumber = ref(0)
const timer = 60 const timer = 30
const Countdown = ref<any>(timer) const Countdown = ref<any>(timer)
const intervalId = ref(null); const intervalId = ref(null);
const showTimer = ref(false); const showTimer = ref(false);
...@@ -239,13 +239,14 @@ const goType = ref(null) ...@@ -239,13 +239,14 @@ const goType = ref(null)
const goBack = (type:any) =>{ const goBack = (type:any) =>{
mainBackVisible.value = false mainBackVisible.value = false
goType.value = type goType.value = type
if(model.value==2){ if(model.value==2&&(searchData.value.MonitoringNumber>1||MonitoringTNumber.value>1)){
ElMessageBox.confirm( ElMessageBox.confirm(
'退出此页面将清空当前数据,是否保存当前数据,并退出?', '退出此页面将清空当前数据,是否保存当前数据,并退出?',
'提示', '提示',
{ {
confirmButtonText: '保存', confirmButtonText: '保存',
cancelButtonText: '退出', cancelButtonText: '退出',
distinguishCancelAndClose: true,
type: 'warning', type: 'warning',
} }
).then(() => { ).then(() => {
...@@ -254,8 +255,8 @@ const goBack = (type:any) =>{ ...@@ -254,8 +255,8 @@ const goBack = (type:any) =>{
intervalId.value = null; intervalId.value = null;
} }
setTemplate(0,1) setTemplate(0,1)
}).catch(() => { }).catch((action:string) => {
SaveStroke(type) if(action=='cancel') SaleExit(type)
}) })
}else{ }else{
...@@ -276,6 +277,8 @@ const goBack = (type:any) =>{ ...@@ -276,6 +277,8 @@ const goBack = (type:any) =>{
if(model.value==0) { if(model.value==0) {
path = `/market/op/${ConfigId.value}/${TempType.value}` path = `/market/op/${ConfigId.value}/${TempType.value}`
router.push({path}) router.push({path})
}else if(model.value==2){
SaleExit(type)
}else window.history.back() }else window.history.back()
}).catch(() => {}) }).catch(() => {})
...@@ -283,8 +286,12 @@ const goBack = (type:any) =>{ ...@@ -283,8 +286,12 @@ const goBack = (type:any) =>{
} }
const SaveStroke = (type:any) => { const SaleExit = (type:any) => {
let path = '' setNewDatas(type,0)
mainStore.setToolbarState(ToolbarStates.SLIDE_DESIGN)
let path ='/'
const t = useSlidesStore().viewportRatio<0?1:2
searchData.value.SalesEditor = null
if(type==1) { if(type==1) {
searchData.value.SalesEditor = router.currentRoute.value.params searchData.value.SalesEditor = router.currentRoute.value.params
if(searchData.value.sellId)searchData.value.TempId2 = queryObj.value.TempId if(searchData.value.sellId)searchData.value.TempId2 = queryObj.value.TempId
...@@ -405,7 +412,7 @@ const SetSellTemplate = async (type:Number,FolderId:Number,sellType:any) => { ...@@ -405,7 +412,7 @@ const SetSellTemplate = async (type:Number,FolderId:Number,sellType:any) => {
}) })
} }
// 保存并退出当前页 // 保存并退出当前页
if(sellType) SaveStroke(goType.value) if(sellType) SaleExit(goType.value)
}else{ }else{
ElMessage({ ElMessage({
showClose: true, showClose: true,
...@@ -695,26 +702,27 @@ watch(()=>autoSave.value,(newVal)=>{ ...@@ -695,26 +702,27 @@ watch(()=>autoSave.value,(newVal)=>{
}) })
watch(()=>slides.value,(newVal,oldVal)=>{ watch(()=>slides.value,(newVal,oldVal)=>{
if(model.value==2&&SalesEditor.value>0&&searchData.value.sellId){ if(model.value==2&&SalesEditor.value>0&&searchData.value.sellId){
if(!MonitoringNumber.value||MonitoringNumber.value<2) MonitoringNumber.value++ searchData.value.MonitoringNumber++
if(MonitoringNumber.value>1) { if(searchData.value.MonitoringNumber&&searchData.value.MonitoringNumber>1) {
Countdown.value = timer Countdown.value = timer
benginTimer() benginTimer()
} }
} // MonitoringNumber.value++
}
},{ },{
deep: true, deep: true,
immediate: false immediate: false
}) })
watch(()=>queryObj.value.Title,(newVal,oldVal)=>{ watch(()=>queryObj.value,(newVal,oldVal)=>{
if(model.value==2&&SalesEditor.value>0&&searchData.value.sellId){ if(model.value==2&&SalesEditor.value>0&&searchData.value.sellId){
if(!MonitoringTNumber.value||MonitoringTNumber.value<2) MonitoringTNumber.value++ MonitoringTNumber.value++
if(MonitoringTNumber.value>1) { if(MonitoringTNumber.value>1) {
Countdown.value = timer Countdown.value = timer
benginTimer() benginTimer()
} }
} }
},{
deep: true
}) })
handleUpdateTitle() handleUpdateTitle()
......
...@@ -752,7 +752,7 @@ const sellGetTripTemplate = async () =>{ ...@@ -752,7 +752,7 @@ const sellGetTripTemplate = async () =>{
newSlides.push(x) newSlides.push(x)
}) })
slidesStore.setSlides(newSlides) slidesStore.setSlides(newSlides)
searchData.value.MonitoringNumber = 0
} }
}else ElMessage({ }else ElMessage({
......
...@@ -175,7 +175,7 @@ ...@@ -175,7 +175,7 @@
<div class="addTemplateInput q-mt-xs q-mb-lg"> <div class="addTemplateInput q-mt-xs q-mb-lg">
<template v-for="(x,index) in multipleSelection"> <template v-for="(x,index) in multipleSelection">
<el-tag <el-tag
:color="x.ColorValue" :color="x.Content"
effect="dark" class="q-mr-xs w10"> effect="dark" class="q-mr-xs w10">
&nbsp; &nbsp;
</el-tag> </el-tag>
...@@ -300,7 +300,7 @@ ...@@ -300,7 +300,7 @@
} }
const handleSelectionChange = (val: any) =>{ const handleSelectionChange = (val: any) =>{
multipleSelection.value = val multipleSelection.value = val
datas.paramsParent.ColorList = val.length>0? val.map(x=> {return x.ID}) : 0 datas.paramsParent.ColorList = val.length>0? val.map(x=> {return x.ID}) : []
} }
// 批量设置颜色分类 // 批量设置颜色分类
const BatchSetting = () => { const BatchSetting = () => {
...@@ -348,6 +348,7 @@ ...@@ -348,6 +348,7 @@
if(result.data.resultCode==1){ if(result.data.resultCode==1){
datas.DominantColour = false datas.DominantColour = false
datas.requestLoading = false datas.requestLoading = false
datas.paramsParent.ColorList = []
toggleSelection() toggleSelection()
querySearchHandler() querySearchHandler()
}else{ }else{
...@@ -360,6 +361,7 @@ ...@@ -360,6 +361,7 @@
} }
const addEditColor = async () => { const addEditColor = async () => {
//添加、编辑颜色 //添加、编辑颜色
if(!datas.params.Name)return ElMessage({ if(!datas.params.Name)return ElMessage({
showClose: true, showClose: true,
message: '请完善颜色名称', message: '请完善颜色名称',
...@@ -367,7 +369,7 @@ ...@@ -367,7 +369,7 @@
}) })
let color = datas.params.Name.slice(0,1) let color = datas.params.Name.slice(0,1)
let colorList = ColorList.value.filter(x=>{ return x.Name.toLowerCase().includes(color.toLowerCase())}) let colorList = ColorList.value.filter(x=>{ return x.Name.toLowerCase().includes(color.toLowerCase())})
if(colorList.length>0&&!datas.params.Code) datas.addColor.Code = colorList[0].ID if(colorList.length>0&&!datas.params.Code&&datas.type==1) datas.params.Code = colorList[0].ID
if(!datas.params.Content){ if(!datas.params.Content){
ElMessage({ ElMessage({
showClose: true, showClose: true,
...@@ -411,7 +413,7 @@ ...@@ -411,7 +413,7 @@
datas.params = JSON.parse(JSON.stringify(item)) datas.params = JSON.parse(JSON.stringify(item))
datas.params.Code = item.Code?Number(item.Code):'' datas.params.Code = item.Code?Number(item.Code):''
datas.params.Content = item.Content datas.params.Content = item.Content
datas.type = item.ChildList&&item.ChildList.length>0?2:1 datas.type = !item.Code?2:1
if(datas.type==2||(datas.type==1&&!datas.params.Name))datas.params.Name = item.Name if(datas.type==2||(datas.type==1&&!datas.params.Name))datas.params.Name = item.Name
datas.addEditVisible = true datas.addEditVisible = true
} }
......
...@@ -32,12 +32,13 @@ ...@@ -32,12 +32,13 @@
}" }"
:class="{'clip-box':elementInfo.clip}" :class="{'clip-box':elementInfo.clip}"
> >
<!-- :editable="!elementInfo.lock" -->
<ProsemirrorEditor <ProsemirrorEditor
:class="{'text-static':elementInfo.clip,'text':!elementInfo.clip}" :class="{'text-static':elementInfo.clip,'text':!elementInfo.clip}"
:elementId="elementInfo.id" :elementId="elementInfo.id"
:defaultColor="elementInfo.defaultColor" :defaultColor="elementInfo.defaultColor"
:defaultFontName="elementInfo.defaultFontName" :defaultFontName="elementInfo.defaultFontName"
:editable="!elementInfo.lock"
:value="elementInfo.content" :value="elementInfo.content"
:style="{ :style="{
'--paragraphSpace': `${elementInfo.paragraphSpace === undefined ? 5 : elementInfo.paragraphSpace}px`, '--paragraphSpace': `${elementInfo.paragraphSpace === undefined ? 5 : elementInfo.paragraphSpace}px`,
......
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