Commit bffa3549 authored by zhengke's avatar zhengke

修复颜色bug

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