feat:标签选择器增加默认值选项
This commit is contained in:
parent
2f43ddd59b
commit
84f6bfcb8a
@ -1,8 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<collapse-item name="标签页配置" :expanded="true">
|
<collapse-item name="标签页配置" :expanded="true">
|
||||||
<setting-item-box name="默认值" :alone="true">
|
<setting-item-box name="标签类型" :alone="true">
|
||||||
<n-select size="small" v-model:value="optionData.tabType" :options="tabTypeOptions" />
|
<n-select size="small" v-model:value="optionData.tabType" :options="tabTypeOptions" />
|
||||||
</setting-item-box>
|
</setting-item-box>
|
||||||
|
<setting-item-box name="默认值" :alone="true">
|
||||||
|
<n-select size="small" v-model:value="optionData.tabLabel" value-field="label" :options="optionData.dataset" />
|
||||||
|
</setting-item-box>
|
||||||
</collapse-item>
|
</collapse-item>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<n-tabs :type="option.value.tabType" @update:value="onChange">
|
<n-tabs :type="option.value.tabType" @update:value="onChange" :default-value="option.value.tabLabel">
|
||||||
<n-tab v-for="(item, index) in option.value.dataset" :name="item.label" :key="index"> {{ item.label }} </n-tab>
|
<n-tab v-for="(item, index) in option.value.dataset" :name="item.label" :key="index"> {{ item.label }} </n-tab>
|
||||||
</n-tabs>
|
</n-tabs>
|
||||||
</template>
|
</template>
|
||||||
@ -12,6 +12,7 @@ import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore
|
|||||||
import { useChartInteract } from '@/hooks'
|
import { useChartInteract } from '@/hooks'
|
||||||
import { InteractEventOn } from '@/enums/eventEnum'
|
import { InteractEventOn } from '@/enums/eventEnum'
|
||||||
import { ComponentInteractParamsEnum } from './interact'
|
import { ComponentInteractParamsEnum } from './interact'
|
||||||
|
import { changeURLStatic } from '@/utils/changeURLParam'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
chartConfig: {
|
chartConfig: {
|
||||||
@ -29,6 +30,9 @@ const option = shallowReactive({
|
|||||||
const onChange = (v: string) => {
|
const onChange = (v: string) => {
|
||||||
if (v === undefined) return
|
if (v === undefined) return
|
||||||
const selectItem = option.value.dataset.find((item: { label: string; value: any }) => item.label === v)
|
const selectItem = option.value.dataset.find((item: { label: string; value: any }) => item.label === v)
|
||||||
|
const { chartConfig } = props
|
||||||
|
const key = chartConfig.chartConfig.title || chartConfig.id;
|
||||||
|
changeURLStatic(key, selectItem.value)
|
||||||
// 存储到联动数据
|
// 存储到联动数据
|
||||||
useChartInteract(
|
useChartInteract(
|
||||||
props.chartConfig,
|
props.chartConfig,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user