mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-23 09:50:23 +08:00
fix: 修改展示的错误
This commit is contained in:
parent
5d585994ca
commit
f2d32d8256
@ -1,10 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<n-timeline class="go-chart-configurations-timeline">
|
<n-timeline class="go-chart-configurations-timeline">
|
||||||
<n-timeline-item
|
<n-timeline-item v-if="isCharts" type="info" :title="TimelineTitleEnum.MAPPING">
|
||||||
v-if="isCharts"
|
|
||||||
type="info"
|
|
||||||
:title="TimelineTitleEnum.MAPPING"
|
|
||||||
>
|
|
||||||
<n-table striped>
|
<n-table striped>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -21,10 +17,7 @@
|
|||||||
<n-text>无</n-text>
|
<n-text>无</n-text>
|
||||||
</n-space>
|
</n-space>
|
||||||
<n-space v-else>
|
<n-space v-else>
|
||||||
<n-badge
|
<n-badge dot :type="item.result === 1 ? 'success' : 'error'"></n-badge>
|
||||||
dot
|
|
||||||
:type="item.result === 1 ? 'success' : 'error'"
|
|
||||||
></n-badge>
|
|
||||||
<n-text>匹配{{ item.result === 1 ? '成功' : '失败' }}</n-text>
|
<n-text>匹配{{ item.result === 1 ? '成功' : '失败' }}</n-text>
|
||||||
</n-space>
|
</n-space>
|
||||||
</td>
|
</td>
|
||||||
@ -94,10 +87,10 @@ const source = ref()
|
|||||||
const dimensions = ref()
|
const dimensions = ref()
|
||||||
const dimensionsAndSource = ref()
|
const dimensionsAndSource = ref()
|
||||||
|
|
||||||
const { uploadFileListRef, customRequest, beforeUpload, download} = useFile(targetData)
|
const { uploadFileListRef, customRequest, beforeUpload, download } = useFile(targetData)
|
||||||
|
|
||||||
// 是图表类型
|
// 是图表类型
|
||||||
const isCharts = computed(()=> {
|
const isCharts = computed(() => {
|
||||||
return targetData.value.chartConfig.package === PackagesCategoryEnum.CHARTS
|
return targetData.value.chartConfig.package === PackagesCategoryEnum.CHARTS
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -111,7 +104,7 @@ const matchingHandle = (mapping: string) => {
|
|||||||
let res = DataResultEnum.SUCCESS
|
let res = DataResultEnum.SUCCESS
|
||||||
for (let i = 0; i < source.value.length; i++) {
|
for (let i = 0; i < source.value.length; i++) {
|
||||||
if (source.value[i][mapping] === undefined) {
|
if (source.value[i][mapping] === undefined) {
|
||||||
res = DataResultEnum.FAILURE
|
res = DataResultEnum.FAILURE
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -120,40 +113,44 @@ const matchingHandle = (mapping: string) => {
|
|||||||
|
|
||||||
// 处理映射列表
|
// 处理映射列表
|
||||||
const dimensionsAndSourceHandle = () => {
|
const dimensionsAndSourceHandle = () => {
|
||||||
// 去除首项数据轴标识
|
try {
|
||||||
return dimensions.value.map((dimensionsItem: string, index: number) => {
|
// 去除首项数据轴标识
|
||||||
return index === 0 ?
|
return dimensions.value.map((dimensionsItem: string, index: number) => {
|
||||||
{
|
return index === 0 ?
|
||||||
// 字段
|
{
|
||||||
field: '通用标识',
|
// 字段
|
||||||
// 映射
|
field: '通用标识',
|
||||||
mapping: dimensionsItem,
|
// 映射
|
||||||
// 结果
|
mapping: dimensionsItem,
|
||||||
result: DataResultEnum.NULL
|
// 结果
|
||||||
} : {
|
result: DataResultEnum.NULL
|
||||||
field: `数据项-${index}`,
|
} : {
|
||||||
mapping: dimensionsItem,
|
field: `数据项-${index}`,
|
||||||
result: matchingHandle(dimensionsItem)
|
mapping: dimensionsItem,
|
||||||
}
|
result: matchingHandle(dimensionsItem)
|
||||||
})
|
}
|
||||||
|
})
|
||||||
|
} catch (error) {
|
||||||
|
return []
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(() => targetData.value?.option?.dataset, (newData) => {
|
watch(() => targetData.value?.option?.dataset, (newData) => {
|
||||||
if (newData) {
|
if (newData) {
|
||||||
// 只有 Echarts 数据才有对应的格式
|
// 只有 Echarts 数据才有对应的格式
|
||||||
source.value = isCharts.value ? newData.source : newData
|
source.value = isCharts.value ? newData.source : newData
|
||||||
if(isCharts.value) {
|
if (isCharts.value) {
|
||||||
dimensions.value = newData.dimensions
|
dimensions.value = newData.dimensions
|
||||||
dimensionsAndSource.value = dimensionsAndSourceHandle()
|
dimensionsAndSource.value = dimensionsAndSourceHandle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},{
|
}, {
|
||||||
immediate: true
|
immediate: true
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@include go('chart-configurations-timeline') {
|
@include go("chart-configurations-timeline") {
|
||||||
@include deep() {
|
@include deep() {
|
||||||
pre {
|
pre {
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
type="segment"
|
type="segment"
|
||||||
>
|
>
|
||||||
<n-tab-pane
|
<n-tab-pane
|
||||||
v-for="(item, index) in canvasTabList"
|
v-for="(item) in canvasTabList"
|
||||||
:key="item.key"
|
:key="item.key"
|
||||||
:name="item.key"
|
:name="item.key"
|
||||||
size="small"
|
size="small"
|
||||||
|
@ -12,6 +12,9 @@
|
|||||||
</n-icon>
|
</n-icon>
|
||||||
</template>
|
</template>
|
||||||
<!-- 图层内容 -->
|
<!-- 图层内容 -->
|
||||||
|
<n-space v-if="reverseList.length === 0" justify="center">
|
||||||
|
<n-text class="not-layer-text">暂无图层~</n-text>
|
||||||
|
</n-space>
|
||||||
<!-- https://github.com/SortableJS/vue.draggable.next -->
|
<!-- https://github.com/SortableJS/vue.draggable.next -->
|
||||||
<draggable
|
<draggable
|
||||||
item-key="id"
|
item-key="id"
|
||||||
@ -108,6 +111,11 @@ $wight: 170px;
|
|||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
@extend .go-transition;
|
@extend .go-transition;
|
||||||
|
.not-layer-text {
|
||||||
|
position: relative;
|
||||||
|
top: 10px;
|
||||||
|
opacity: .4;
|
||||||
|
}
|
||||||
&.scoped {
|
&.scoped {
|
||||||
width: 0;
|
width: 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user