parent
0e654ec1c0
commit
530b1ee02b
@ -1,4 +1,4 @@
|
||||
import Private from './Private'
|
||||
import Share from './Share'
|
||||
|
||||
export const PhotoList = [...Private, ...Share]
|
||||
export const PhotoList = [...Private, ]//...Share
|
||||
|
@ -1,22 +1,61 @@
|
||||
export const lineAndBar = `
|
||||
const obj = {
|
||||
dimensions: ['product', 'data1'],
|
||||
source:[]
|
||||
}
|
||||
if(res.type === 'bar' || res.type === 'line'){
|
||||
res.data.forEach((item,index) => {
|
||||
// export const lineAndBar = `
|
||||
// const obj = {
|
||||
// dimensions: ['product', 'data1'],
|
||||
// source:[]
|
||||
// }
|
||||
// if(res.type === 'bar' || res.type === 'line'){
|
||||
// res.data.forEach((item,index) => {
|
||||
// obj.source.push({
|
||||
// product: res.xData[index] ,
|
||||
// data1: item,
|
||||
// })
|
||||
// });
|
||||
// }else if(res.type === 'pie'){
|
||||
// res.data.forEach((item)=>{
|
||||
// obj.source.push({
|
||||
// product:item.name,
|
||||
// data1:item.value,
|
||||
// })
|
||||
// })
|
||||
// }
|
||||
|
||||
// return obj `
|
||||
|
||||
const lineAndBar = `
|
||||
const obj = {
|
||||
dimensions: ['product', '数据'],
|
||||
source:[]
|
||||
}
|
||||
res.data.forEach((item,index) => {
|
||||
obj.source.push({
|
||||
product: res.xData[index] ,
|
||||
data1: item,
|
||||
数据: item,
|
||||
})
|
||||
});
|
||||
}else if(res.type === 'pie'){
|
||||
res.data.forEach((item)=>{
|
||||
obj.source.push({
|
||||
product:item.name,
|
||||
data1:item.value,
|
||||
})
|
||||
})
|
||||
}
|
||||
return obj`
|
||||
|
||||
const pie = `
|
||||
const obj = {
|
||||
dimensions: ['product', '数据'],
|
||||
source:[]
|
||||
}
|
||||
res.data.forEach((item)=>{
|
||||
obj.source.push({
|
||||
product:item.name,
|
||||
数据:item.value,
|
||||
})
|
||||
})
|
||||
return obj
|
||||
`
|
||||
|
||||
const filterData = {
|
||||
LineCommon: lineAndBar,
|
||||
LineLinearSingle: lineAndBar,
|
||||
BarCommon:lineAndBar,
|
||||
BarCrossrange:lineAndBar,
|
||||
PieCommon:pie,
|
||||
PieCircle:'return res.data',
|
||||
Dial:'return res.data'
|
||||
}
|
||||
|
||||
return obj `
|
||||
export { filterData }
|
||||
|
Loading…
Reference in new issue