mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-24 02:16:10 +08:00
fix:修改请求的数据格式错误的问题
This commit is contained in:
parent
bf020e3d3e
commit
9ca618c3c5
@ -18,7 +18,7 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
'product': '@name',
|
'product': '@name',
|
||||||
'dataOne1|100-900': 3,
|
'dataOne|100-900': 3,
|
||||||
'dataTwo|100-900': 3,
|
'dataTwo|100-900': 3,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr v-for="(item, index) in getDimensionsAndSource" :key="index">
|
<tr v-for="(item, index) in dimensionsAndSource" :key="index">
|
||||||
<td>{{ item.field }}</td>
|
<td>{{ item.field }}</td>
|
||||||
<td>{{ item.mapping }}</td>
|
<td>{{ item.mapping }}</td>
|
||||||
<td>
|
<td>
|
||||||
@ -91,52 +91,53 @@ const { DocumentAddIcon, DocumentDownloadIcon } = icon.carbon
|
|||||||
const uploadFileListRef = ref()
|
const uploadFileListRef = ref()
|
||||||
const source = ref()
|
const source = ref()
|
||||||
const dimensions = ref()
|
const dimensions = ref()
|
||||||
|
const dimensionsAndSource = ref()
|
||||||
|
|
||||||
// 获取数据
|
// 获取数据
|
||||||
const getSource = computed(() => {
|
const getSource = computed(() => {
|
||||||
return JSON.stringify(source.value)
|
return JSON.stringify(source.value)
|
||||||
})
|
})
|
||||||
|
|
||||||
watch(() => props.targetData?.option?.dataset, (newData) => {
|
|
||||||
if (newData) {
|
|
||||||
source.value = newData.source
|
|
||||||
dimensions.value = newData.dimensions
|
|
||||||
}
|
|
||||||
}, {
|
|
||||||
immediate: true
|
|
||||||
})
|
|
||||||
|
|
||||||
// 处理映射列表状态结果
|
// 处理映射列表状态结果
|
||||||
const matchingHandle = (mapping: string) => {
|
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
|
||||||
break
|
|
||||||
}
|
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return DataResultEnum.SUCCESS
|
return DataResultEnum.SUCCESS
|
||||||
}
|
}
|
||||||
|
|
||||||
// 处理映射列表
|
// 处理映射列表
|
||||||
const getDimensionsAndSource = computed(() => {
|
const dimensionsAndSourceHandle = () => {
|
||||||
// 去除首项数据轴标识
|
// 去除首项数据轴标识
|
||||||
return dimensions.value.map((item: string, index: number) => {
|
return dimensions.value.map((dimensionsItem: string, index: number) => {
|
||||||
return index === 0 ?
|
return index === 0 ?
|
||||||
{
|
{
|
||||||
// 字段
|
// 字段
|
||||||
field: '通用标识',
|
field: '通用标识',
|
||||||
// 映射
|
// 映射
|
||||||
mapping: item,
|
mapping: dimensionsItem,
|
||||||
// 结果
|
// 结果
|
||||||
result: DataResultEnum.NULL
|
result: DataResultEnum.NULL
|
||||||
} : {
|
} : {
|
||||||
field: `数据项-${index}`,
|
field: `数据项-${index}`,
|
||||||
mapping: item,
|
mapping: dimensionsItem,
|
||||||
result: matchingHandle(item)
|
result: matchingHandle(dimensionsItem)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(() => props.targetData?.option?.dataset, (newData) => {
|
||||||
|
if (newData) {
|
||||||
|
source.value = newData.source
|
||||||
|
dimensions.value = newData.dimensions
|
||||||
|
dimensionsAndSource.value = dimensionsAndSourceHandle()
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
immediate: true
|
||||||
})
|
})
|
||||||
|
|
||||||
//@ts-ignore
|
//@ts-ignore
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
const useFile = () => {
|
||||||
|
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user