Commit ca2518f6 authored by zhengke's avatar zhengke

优化颜色新增

parent 4bd3c16e
<template> <template>
<div class="q-mt-xs bg-white q-pa-xs rounded ElementTemplateData"> <div class="bg-white rounded ElementTemplateData">
<div class="column text-mdall"> <div class="column text-mdall">
<div class="column"> <div class="column">
<template v-if="CoverImg&&!isCoverImg"> <template v-if="CoverImg&&!isCoverImg">
...@@ -501,6 +501,9 @@ ...@@ -501,6 +501,9 @@
}) })
return return
} }
let color = datas.addColor.Name.slice(0,1)
let colorList = ColorList.value.filter(x=>{ return x.Name.toLowerCase().includes(color.toLowerCase())})
if(colorList.length>0&&!datas.addColor.Code) datas.addColor.Code = colorList[0].ID
if(datas.addColor.Content.indexOf('#')==-1){ if(datas.addColor.Content.indexOf('#')==-1){
ElMessage({ ElMessage({
showClose: true, showClose: true,
......
...@@ -365,6 +365,9 @@ ...@@ -365,6 +365,9 @@
message: '请完善颜色名称', message: '请完善颜色名称',
type: 'warning', type: 'warning',
}) })
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(!datas.params.Content){ if(!datas.params.Content){
ElMessage({ ElMessage({
showClose: true, showClose: true,
......
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