提交 71438db6 authored 作者: wangjiahao's avatar wangjiahao

refactor:组件调色板优化

上级 22e204a0
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
<i class="icon iconfont icon-zimua" @click="goColor" /> <i class="icon iconfont icon-zimua" @click="goColor" />
</el-tooltip> </el-tooltip>
<div :style="letterDivColor" /> <div :style="letterDivColor" />
<el-color-picker ref="colorPicker" v-model="styleInfo.color" style="margin-top: 7px;height: 0px" size="mini" @change="styleChange" /> <el-color-picker ref="colorPicker" v-model="styleInfo.color" style="margin-top: 7px;height: 0px" size="mini" :predefine="predefineColors" @change="styleChange" />
</div> </div>
</div> </div>
<div v-if="attrShow('borderColor')" style="width: 20px;float: left;margin-top: 2px;margin-left: 10px;"> <div v-if="attrShow('borderColor')" style="width: 20px;float: left;margin-top: 2px;margin-left: 10px;">
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
<i class="iconfont icon-huabi" @click="goBoardColor" /> <i class="iconfont icon-huabi" @click="goBoardColor" />
</el-tooltip> </el-tooltip>
<div :style="boardDivColor" /> <div :style="boardDivColor" />
<el-color-picker ref="boardColorPicker" v-model="styleInfo.borderColor" style="margin-top: 7px;height: 0px" size="mini" @change="styleChange" /> <el-color-picker ref="boardColorPicker" v-model="styleInfo.borderColor" style="margin-top: 7px;height: 0px" size="mini" :predefine="predefineColors" @change="styleChange" />
</div> </div>
</div> </div>
...@@ -127,7 +127,7 @@ ...@@ -127,7 +127,7 @@
<i class="iconfont icon-beijingse1" @click="goBackgroundColor" /> <i class="iconfont icon-beijingse1" @click="goBackgroundColor" />
</el-tooltip> </el-tooltip>
<div :style="backgroundDivColor" /> <div :style="backgroundDivColor" />
<el-color-picker ref="backgroundColorPicker" v-model="styleInfo.backgroundColor" style="margin-top: 7px;height: 0px" size="mini" @change="styleChange" /> <el-color-picker ref="backgroundColorPicker" v-model="styleInfo.backgroundColor" style="margin-top: 7px;height: 0px" :predefine="predefineColors" size="mini" @change="styleChange" />
</div> </div>
</div> </div>
...@@ -157,6 +157,7 @@ import { mapState } from 'vuex' ...@@ -157,6 +157,7 @@ import { mapState } from 'vuex'
import Hyperlinks from '@/components/canvas/components/Editor/Hyperlinks' import Hyperlinks from '@/components/canvas/components/Editor/Hyperlinks'
import VideoLinks from '@/components/canvas/components/Editor/VideoLinks' import VideoLinks from '@/components/canvas/components/Editor/VideoLinks'
import DateFormat from '@/components/canvas/components/Editor/DateFormat' import DateFormat from '@/components/canvas/components/Editor/DateFormat'
import { COLOR_PANEL } from '@/views/chart/chart/chart'
export default { export default {
components: { Hyperlinks, DateFormat, VideoLinks }, components: { Hyperlinks, DateFormat, VideoLinks },
...@@ -172,6 +173,7 @@ export default { ...@@ -172,6 +173,7 @@ export default {
}, },
data() { data() {
return { return {
predefineColors: COLOR_PANEL,
showMain: true, showMain: true,
innerOpacity: 0, innerOpacity: 0,
textAlignOptions: [ textAlignOptions: [
...@@ -431,4 +433,8 @@ export default { ...@@ -431,4 +433,8 @@ export default {
padding: 5px!important; padding: 5px!important;
width: 30px!important; width: 30px!important;
} }
::v-deep .el-color-dropdown__link-btn {
display: inline!important;
}
</style> </style>
...@@ -864,6 +864,6 @@ export const COLOR_PANEL = [ ...@@ -864,6 +864,6 @@ export const COLOR_PANEL = [
'#1e90ff', '#1e90ff',
'#c71585', '#c71585',
'#999999', '#999999',
'#00008b', '#000000',
'#000000' '#FFFFFF'
] ]
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<el-radio v-model="panel.backgroundType" label="color" @change="onChangeType">{{ $t('chart.color') }}</el-radio> <el-radio v-model="panel.backgroundType" label="color" @change="onChangeType">{{ $t('chart.color') }}</el-radio>
</el-col> </el-col>
<el-col :span="18"> <el-col :span="18">
<el-color-picker v-model="panel.color" size="mini" style="cursor: pointer;z-index: 1004;" @change="onChangeType"/> <el-color-picker v-model="panel.color" :predefine="predefineColors" size="mini" style="cursor: pointer;z-index: 1004;" @change="onChangeType" />
</el-col> </el-col>
</el-row> </el-row>
<el-row style="height: 60px;margin-top:10px;overflow: hidden"> <el-row style="height: 60px;margin-top:10px;overflow: hidden">
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
import { mapState } from 'vuex' import { mapState } from 'vuex'
import { deepCopy } from '@/components/canvas/utils/utils' import { deepCopy } from '@/components/canvas/utils/utils'
import { COLOR_PANEL } from '@/views/chart/chart/chart'
export default { export default {
name: 'BackgroundSelector', name: 'BackgroundSelector',
...@@ -59,7 +60,9 @@ export default { ...@@ -59,7 +60,9 @@ export default {
dialogImageUrl: '', dialogImageUrl: '',
dialogVisible: false, dialogVisible: false,
uploadDisabled: false, uploadDisabled: false,
panel: null panel: null,
predefineColors: COLOR_PANEL
} }
}, },
computed: mapState([ computed: mapState([
...@@ -80,7 +83,7 @@ export default { ...@@ -80,7 +83,7 @@ export default {
const canvasStyleData = deepCopy(this.canvasStyleData) const canvasStyleData = deepCopy(this.canvasStyleData)
canvasStyleData.panel = this.panel canvasStyleData.panel = this.panel
this.$store.commit('setCanvasStyle', canvasStyleData) this.$store.commit('setCanvasStyle', canvasStyleData)
this.$store.commit('recordSnapshot','commitStyle') this.$store.commit('recordSnapshot', 'commitStyle')
}, },
onChangeType() { onChangeType() {
this.commitStyle() this.commitStyle()
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论