mirror of
https://gitee.com/dromara/go-view.git
synced 2025-10-13 22:12:11 +08:00
feat: 修复背景图 顶栏图路径错误
This commit is contained in:
parent
abb99c6f77
commit
ee54a366f0
BIN
src/assets/images/chart/decorates/TimeCommon1.png
Normal file
BIN
src/assets/images/chart/decorates/TimeCommon1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
@ -3,7 +3,7 @@
|
|||||||
<n-image
|
<n-image
|
||||||
:object-fit="fit"
|
:object-fit="fit"
|
||||||
preview-disabled
|
preview-disabled
|
||||||
:src="`/src/assets/images/chart/customponents/${dataset}`"
|
:src="imageInfo"
|
||||||
:fallback-src="requireErrorImg()"
|
:fallback-src="requireErrorImg()"
|
||||||
:width="w"
|
:width="w"
|
||||||
lazy
|
lazy
|
||||||
@ -13,10 +13,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PropType, toRefs } from 'vue'
|
import { PropType, toRefs, ref } from 'vue'
|
||||||
import { requireErrorImg } from '@/utils'
|
import { requireErrorImg } from '@/utils'
|
||||||
import { CreateComponentType } from '@/packages/index.d'
|
import { CreateComponentType } from '@/packages/index.d'
|
||||||
// import background from '@/assets/customComponents/theme1/backgrond.jpg'
|
// import background from '@/assets/customComponents/theme1/backgrond.jpg'
|
||||||
|
import { fetchImages } from '@/packages'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
chartConfig: {
|
chartConfig: {
|
||||||
@ -28,6 +29,13 @@ const props = defineProps({
|
|||||||
const { w, h } = toRefs(props.chartConfig.attr)
|
const { w, h } = toRefs(props.chartConfig.attr)
|
||||||
const { dataset, fit, borderRadius } = toRefs(props.chartConfig.option)
|
const { dataset, fit, borderRadius } = toRefs(props.chartConfig.option)
|
||||||
|
|
||||||
|
let imageInfo = ref('')
|
||||||
|
// 获取图片
|
||||||
|
const fetchImageUrl = async () => {
|
||||||
|
imageInfo.value = await fetchImages(props.chartConfig.chartConfig)
|
||||||
|
}
|
||||||
|
fetchImageUrl()
|
||||||
|
|
||||||
const getStyle = (radius: number) => {
|
const getStyle = (radius: number) => {
|
||||||
return {
|
return {
|
||||||
borderRadius: `${radius}px`,
|
borderRadius: `${radius}px`,
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<n-image
|
<n-image
|
||||||
:object-fit="fit"
|
:object-fit="fit"
|
||||||
preview-disabled
|
preview-disabled
|
||||||
:src="`/src/assets/images/chart/decorates/${dataset}`"
|
:src="imageInfo"
|
||||||
:fallback-src="requireErrorImg()"
|
:fallback-src="requireErrorImg()"
|
||||||
:width="w"
|
:width="w"
|
||||||
lazy
|
lazy
|
||||||
@ -13,9 +13,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PropType, toRefs } from 'vue'
|
import { PropType, ref, toRefs } from 'vue'
|
||||||
import { requireErrorImg } from '@/utils'
|
import { requireErrorImg } from '@/utils'
|
||||||
import { CreateComponentType } from '@/packages/index.d'
|
import { CreateComponentType } from '@/packages/index.d'
|
||||||
|
import { fetchImages } from "@/packages/index";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
chartConfig: {
|
chartConfig: {
|
||||||
@ -27,6 +28,13 @@ const props = defineProps({
|
|||||||
const { w, h } = toRefs(props.chartConfig.attr)
|
const { w, h } = toRefs(props.chartConfig.attr)
|
||||||
const { dataset, fit, borderRadius } = toRefs(props.chartConfig.option)
|
const { dataset, fit, borderRadius } = toRefs(props.chartConfig.option)
|
||||||
|
|
||||||
|
let imageInfo = ref('')
|
||||||
|
// 获取图片
|
||||||
|
const fetchImageUrl = async () => {
|
||||||
|
imageInfo.value = await fetchImages(props.chartConfig.chartConfig)
|
||||||
|
}
|
||||||
|
fetchImageUrl()
|
||||||
|
|
||||||
const getStyle = (radius: number) => {
|
const getStyle = (radius: number) => {
|
||||||
return {
|
return {
|
||||||
borderRadius: `${radius}px`,
|
borderRadius: `${radius}px`,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user