mirror of
https://gitee.com/dromara/go-view.git
synced 2025-02-25 00:33:00 +08:00
feat:标签选择器增加默认值选项
This commit is contained in:
parent
2f43ddd59b
commit
84f6bfcb8a
@ -1,8 +1,11 @@
|
||||
<template>
|
||||
<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" />
|
||||
</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>
|
||||
</template>
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
<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-tabs>
|
||||
</template>
|
||||
@ -12,6 +12,7 @@ import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore
|
||||
import { useChartInteract } from '@/hooks'
|
||||
import { InteractEventOn } from '@/enums/eventEnum'
|
||||
import { ComponentInteractParamsEnum } from './interact'
|
||||
import { changeURLStatic } from '@/utils/changeURLParam'
|
||||
|
||||
const props = defineProps({
|
||||
chartConfig: {
|
||||
@ -29,6 +30,9 @@ const option = shallowReactive({
|
||||
const onChange = (v: string) => {
|
||||
if (v === undefined) return
|
||||
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(
|
||||
props.chartConfig,
|
||||
|
Loading…
Reference in New Issue
Block a user