Commit 258cd81e authored by zhengke's avatar zhengke

模版颜色 修复及优化

parent d884d74a
......@@ -235,6 +235,7 @@ const goBack = (type:any) =>{
}
).then(() => {
setNewDatas(type,0)
mainStore.setToolbarState(ToolbarStates.SLIDE_DESIGN)
let path ='/'
const t = useSlidesStore().viewportRatio<0?1:2
if(model.value==0) {
......
......@@ -70,6 +70,7 @@ import ConfigService from '@/services/ConfigService'
import { getHtmlPlainText, query, getRgbLevel } from '@/utils/common'
import useEditor from '@/utils/Editor/index'
import { VIEWPORT_SIZE, VIEWPORT_VER_SIZE } from '@/configs/canvas'
import { ToolbarStates } from '@/types/toolbar'
import ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'
import LayoutPool from './LayoutPool.vue'
......@@ -511,6 +512,7 @@ const GetTripTemplate = async () =>{
VIEWPORT_SIZE.Value = 1754
VIEWPORT_VER_SIZE.Value = 1240
}
// if(searchData.value.isTeamManage) mainStore.setToolbarState(ToolbarStates.EL_TEMPLATEDATA)
setTimeout(()=>{
loadingObj.close()
},300)
......
......@@ -130,7 +130,7 @@
</p>
<div class="row q-mt-md">
<el-select v-model="queryColor.Code" placeholder="请选择分类"
@change="getColor(1)">
@change="getColor(2)">
<el-option
key=""
label="不限"
......@@ -248,7 +248,7 @@
searchData.value = inject(injectKeyTemplate)
const lines = ref([] as Array < any > ) //线路
const Series = ref([] as Array < any > ) //系列
const ColorList = ref([] as Array < any > )
const ColorList = ref([] as any )
const cursors = [] as Array<any>
......@@ -283,11 +283,7 @@
const ParentObj = reactive({
DictKey: 'Trip_Template_Color',
Name: ''
})
watch(() => datas.DataSource.pageType, (n,o) => {
Name: queryObj.value.ColorStr
})
const handleUpdateTitle = () => {
......@@ -474,7 +470,7 @@
}
}
const getColor = async (type:Number) => {
if(type==1&&(!queryColor.value.Code||queryColor.value.Code=='')) {
if(type==2) {
queryObj.value.ColorName = ''
queryObj.value.ColorStr = ''
let Colors = ColorList.value.filter(x=>x.ID==queryColor.value.Code)
......@@ -482,18 +478,27 @@
}
let response = await LineService.GetParentColor(queryColor.value)
if (response.data.resultCode == 1) {
if(type==0) {
if(!type) {
ColorList.value = response.data.data
if(!queryColor.value.SubColor){
ParentObj.Name = queryObj.value.ColorStr
await querySearchHandler()
if(!queryObj.value.SubColor){
if(ParentObj.Name) await querySearchHandler()
}else{
let Colors = ColorList.value.filter(x=>x.Content==queryColor.value.SubColor)
let Colors = ColorList.value.filter(x=>x.Content==queryObj.value.SubColor)
if(Colors&&Colors.length>0) queryColor.value.Code = Colors[0].ID
}
if(!queryColor.value.Code) datas.ColorList = response.data.data
}
else datas.ColorList = response.data.data;
else {
if(response.data.data.length>0) {
datas.ColorList = response.data.data
}else{
datas.ColorList = ColorList.value.filter(x=> x.ID==queryColor.value.Code)
if(datas.ColorList.length>0&&datas.ColorList.length==1) {
queryObj.value.ColorName = datas.ColorList[0].Name
queryObj.value.ColorStr = datas.ColorList[0].Content
}
}
}
}
}
......@@ -504,13 +509,13 @@
let response = await ConfigService.GetTemplateQueryAsync(ParentObj)
if (response.data.resultCode == 1&&response.data.data.ColorList.length>0) {
queryColor.value.Code = response.data.data.ColorList[0].ID
queryColor.value.SubColor = response.data.data.ColorList[0].ColorValue
queryObj.value.SubColor = response.data.data.ColorList[0].ColorValue
getColor(1)
}
} catch (error) {
}
}
// 获取所有颜色
const GetTemplateColors = async () => {
let pageRes = await LineService.GetTemplateConfigDataList(queryColors.value);
let colorArr = pageRes.data.data
......@@ -526,7 +531,7 @@
GetTemplateConfigDatas()
getLinesHandler()
getColor(0)
GetTemplateColors()
// GetTemplateColors()
</script>
<style lang="scss" scoped>
......
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