mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-25 02:40:16 +08:00
fix: 修改水球图编辑和颜色跟随变换
This commit is contained in:
parent
7b8d996ef6
commit
6ed7c130cb
@ -5,6 +5,7 @@ import { RequestHttpEnum } from '@/enums/httpEnum'
|
|||||||
// 单个X数据
|
// 单个X数据
|
||||||
export const chartDataUrl = '/mock/chartData'
|
export const chartDataUrl = '/mock/chartData'
|
||||||
export const rankListUrl = '/mock/RankList'
|
export const rankListUrl = '/mock/RankList'
|
||||||
|
export const numberUrl = '/mock/number'
|
||||||
|
|
||||||
const mockObject: MockMethod[] = [
|
const mockObject: MockMethod[] = [
|
||||||
{
|
{
|
||||||
@ -19,6 +20,11 @@ const mockObject: MockMethod[] = [
|
|||||||
method: RequestHttpEnum.GET,
|
method: RequestHttpEnum.GET,
|
||||||
response: () => test.fetchRankList,
|
response: () => test.fetchRankList,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
url: '/mock/number',
|
||||||
|
method: RequestHttpEnum.GET,
|
||||||
|
response: () => test.fetchNumber,
|
||||||
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
export default mockObject
|
export default mockObject
|
||||||
|
@ -59,4 +59,10 @@ export default {
|
|||||||
{ name: '@name', 'value|100-900': 5 },
|
{ name: '@name', 'value|100-900': 5 },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
// 获取数字
|
||||||
|
fetchNumber: {
|
||||||
|
status: 200,
|
||||||
|
msg: '请求成功',
|
||||||
|
data: '@float(0, 0.99)',
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
@ -50,11 +50,11 @@ export const option = {
|
|||||||
borderDistance: 10,
|
borderDistance: 10,
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
borderWidth: 2,
|
borderWidth: 2,
|
||||||
borderColor: '#112165',
|
borderColor: '#112165'
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
],
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class Config extends publicConfig implements CreateComponentType
|
export default class Config extends publicConfig implements CreateComponentType
|
||||||
|
@ -68,22 +68,18 @@ watch(
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
const updateDataset = (newData: number) => {
|
const updateDataset = (newData: string | number) => {
|
||||||
props.chartConfig.option.series[0].data = [newData]
|
props.chartConfig.option.series[0].data = [parseFloat(`${newData}`).toFixed(2)]
|
||||||
option.options = props.chartConfig.option
|
option.options = props.chartConfig.option
|
||||||
}
|
}
|
||||||
|
|
||||||
updateDataset(0.5)
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.chartConfig.option.value,
|
() => props.chartConfig.option.dataset,
|
||||||
newData => updateDataset(newData),
|
newData => updateDataset(newData),
|
||||||
{
|
{
|
||||||
deep: true,
|
immediate: true,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
const { vChartRef } = useChartDataFetch(props.chartConfig, useChartEditStore, (newData: number) => {
|
const { vChartRef } = useChartDataFetch(props.chartConfig, useChartEditStore)
|
||||||
updateDataset(newData)
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
<li>
|
<li>
|
||||||
<n-text type="info"> 【表格】{{ rankListUrl }} </n-text>
|
<n-text type="info"> 【表格】{{ rankListUrl }} </n-text>
|
||||||
</li>
|
</li>
|
||||||
|
<li>
|
||||||
|
<n-text type="info"> 【0~1数字】{{ numberUrl }} </n-text>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</n-tooltip>
|
</n-tooltip>
|
||||||
</template>
|
</template>
|
||||||
@ -65,7 +68,7 @@ import { ref, toRefs } from 'vue'
|
|||||||
import { icon } from '@/plugins'
|
import { icon } from '@/plugins'
|
||||||
import { SettingItemBox } from '@/components/Pages/ChartItemSetting'
|
import { SettingItemBox } from '@/components/Pages/ChartItemSetting'
|
||||||
import { RequestHttpEnum } from '@/enums/httpEnum'
|
import { RequestHttpEnum } from '@/enums/httpEnum'
|
||||||
import { chartDataUrl, rankListUrl } from '@/api/mock'
|
import { chartDataUrl, rankListUrl, numberUrl } from '@/api/mock'
|
||||||
import { http } from '@/api/http'
|
import { http } from '@/api/http'
|
||||||
import { SelectHttpType } from '../../index.d'
|
import { SelectHttpType } from '../../index.d'
|
||||||
import { ChartDataMatchingAndShow } from '../ChartDataMatchingAndShow'
|
import { ChartDataMatchingAndShow } from '../ChartDataMatchingAndShow'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user