Compare commits

...

5 Commits

Author SHA1 Message Date
奔跑的面条
7f9cde3c67 build: 升级版本到2.1.8 2023-02-27 19:04:05 +08:00
奔跑的面条
effd870897 Merge branch 'dev' into master-fetch-dev 2023-02-27 13:07:05 +08:00
奔跑的面条
61c43df51b fix: 解决删除颜色之后自动选择的错误 2023-02-27 13:06:27 +08:00
奔跑的面条
dd7e1692d6 Merge branch 'dev' into master-fetch-dev 2023-02-27 12:53:44 +08:00
奔跑的面条
82d800f943 perf: 优化自定义颜色组件交互 2023-02-27 12:46:36 +08:00
4 changed files with 19 additions and 9 deletions

View File

@ -1,6 +1,6 @@
{
"name": "go-view",
"version": "2.1.7",
"version": "2.1.8",
"engines": {
"node": ">=16.14 <18.0.0"
},

View File

@ -56,7 +56,7 @@
<n-a @click="createColor">立即创建</n-a>
</n-text>
<!-- 列表 -->
<div class="color-card-box" v-for="(item, index) in colorList" :key="item.id">
<div class="color-card-box" v-for="(item, index) in colorList" :key="index">
<n-card
class="color-card"
:class="{ selected: item.id === selectColorId }"
@ -69,8 +69,8 @@
<n-ellipsis style="text-align: left; width: 70px">{{ item.name }} </n-ellipsis>
<span
class="theme-color-item"
v-for="colorItem in item.color"
:key="colorItem"
v-for="(colorItem, index) in item.color"
:key="index"
:style="{ backgroundColor: colorItem }"
></span>
</div>
@ -127,7 +127,7 @@ type ColorType = {
const defaultColor: ColorType = {
id: getUUID(),
name: '未命名',
color: ['#6ae5bb', '#69e3de', '#5ac4ee', '#5ac4ee', '#4498ec', '#3c7ddf']
color: ['#6ae5bb', '#69e3de', '#5ac5ee', '#5ac4ee', '#4498ec', '#3c7ddf']
}
const chartEditStore = useChartEditStore()
const modelShowRef = ref(false)
@ -204,8 +204,8 @@ const deleteHandle = (index: number) => {
colorList.splice(index, 1)
chartEditStore.setEditCanvasConfig(EditCanvasConfigEnum.CHART_CUSTOM_THEME_COLOR_INFO, cloneDeep(colorList))
nextTick(() => {
if (index) {
selectHandle(colorList[index - 1])
if (colorList.length) {
selectHandle(colorList[index - 1 > -1 ? index - 1 : index])
} else {
//
selectColor.selectInfo = undefined

View File

@ -27,6 +27,7 @@
:show-preview="true"
:modes="['hex']"
@complete="completeHandle($event, index)"
@update:show="selectHandle(item, index)"
/>
<div v-show="index > 5">
<n-tooltip trigger="hover">
@ -183,7 +184,13 @@ const getRenderBackgroundColor = (color?: string) => {
}
}
//
//
const selectHandle = (color: string, index: number) => {
targetColor.color = color
targetColor.index = index
}
//
const completeHandle = (color?: string, index?: number) => {
color && (targetColor.color = color)
index && (targetColor.index = index)
@ -205,6 +212,9 @@ const selectExpandColor = (color: string, isHexa: boolean) => {
const addColor = () => {
const lastData = editColor.value?.color[editColor.value?.color.length - 1] || '#2c2c31'
editColor.value?.color.push(lastData)
nextTick(() => {
emit('updateColor', editColor.value)
})
}
//

View File

@ -55,7 +55,7 @@ const rangeModelStyle = computed(() => {
position: relative;
transform-origin: left top;
background-size: cover;
border-radius: 20px;
border-radius: 10px;
overflow: hidden;
@include fetch-border-color('hover-border-color');
@include fetch-bg-color('background-color2');