mirror of
https://gitee.com/dromara/go-view.git
synced 2025-02-24 00:02:51 +08:00
style: 优化 pr_200 代码
This commit is contained in:
parent
742dc67235
commit
30e7a76de9
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,5 @@ node_modules
|
|||||||
dist
|
dist
|
||||||
dist-ssr
|
dist-ssr
|
||||||
*.local
|
*.local
|
||||||
pnpm-lock.yaml
|
|
||||||
.vscode
|
.vscode
|
||||||
.idea
|
.idea
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
import {ChartList} from '@/packages/components/Charts/index'
|
import { ChartList } from '@/packages/components/Charts/index'
|
||||||
import {DecorateList} from '@/packages/components/Decorates/index'
|
import { DecorateList } from '@/packages/components/Decorates/index'
|
||||||
import {InformationList} from '@/packages/components/Informations/index'
|
import { InformationList } from '@/packages/components/Informations/index'
|
||||||
import {TableList} from '@/packages/components/Tables/index'
|
import { TableList } from '@/packages/components/Tables/index'
|
||||||
import {PhotoList} from '@/packages/components/Photos/index'
|
import { PhotoList } from '@/packages/components/Photos/index'
|
||||||
import {IconList} from '@/packages/components/Icons/index'
|
import { IconList } from '@/packages/components/Icons/index'
|
||||||
import { PackagesCategoryEnum, PackagesType, ConfigType, FetchComFlagType } from '@/packages/index.d'
|
import { PackagesCategoryEnum, PackagesType, ConfigType, FetchComFlagType } from '@/packages/index.d'
|
||||||
|
|
||||||
const configModules: Record<string, { default: string }> = import.meta.glob('./components/**/config.vue', {
|
const configModules: Record<string, { default: string }> = import.meta.glob('./components/**/config.vue', {
|
||||||
@ -72,7 +72,7 @@ const fetchComponent = (chartName: string, flag: FetchComFlagType) => {
|
|||||||
* @param {ConfigType} dropData 配置项
|
* @param {ConfigType} dropData 配置项
|
||||||
*/
|
*/
|
||||||
export const fetchChartComponent = (dropData: ConfigType) => {
|
export const fetchChartComponent = (dropData: ConfigType) => {
|
||||||
const {key} = dropData
|
const { key } = dropData
|
||||||
return fetchComponent(key, FetchComFlagType.VIEW)?.default
|
return fetchComponent(key, FetchComFlagType.VIEW)?.default
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +81,7 @@ export const fetchChartComponent = (dropData: ConfigType) => {
|
|||||||
* @param {ConfigType} dropData 配置项
|
* @param {ConfigType} dropData 配置项
|
||||||
*/
|
*/
|
||||||
export const fetchConfigComponent = (dropData: ConfigType) => {
|
export const fetchConfigComponent = (dropData: ConfigType) => {
|
||||||
const {key} = dropData
|
const { key } = dropData
|
||||||
return fetchComponent(key, FetchComFlagType.CONFIG)?.default
|
return fetchComponent(key, FetchComFlagType.CONFIG)?.default
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,10 +94,7 @@ export const fetchImages = async (targetData?: ConfigType) => {
|
|||||||
// 正则判断图片是否为 url,是则直接返回该 url
|
// 正则判断图片是否为 url,是则直接返回该 url
|
||||||
if (/^(http|https):\/\/([\w.]+\/?)\S*/.test(targetData.image)) return targetData.image
|
if (/^(http|https):\/\/([\w.]+\/?)\S*/.test(targetData.image)) return targetData.image
|
||||||
// 新数据动态处理
|
// 新数据动态处理
|
||||||
const {
|
const { image } = targetData
|
||||||
image,
|
|
||||||
package: targetDataPackage
|
|
||||||
} = targetData
|
|
||||||
// 兼容旧数据
|
// 兼容旧数据
|
||||||
if (image.includes('@') || image.includes('base64')) return image
|
if (image.includes('@') || image.includes('base64')) return image
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user