diff --git a/pages.json b/pages.json index f763255..c1f1c30 100644 --- a/pages.json +++ b/pages.json @@ -807,6 +807,15 @@ } } ] + }, + { + "root": "pages/testPage", + "pages": [{ + "path": "index", + "style": { + "navigationBarTitleText": "测试页面" + } + }] } ], "globalStyle": { diff --git a/pages/index/index.vue b/pages/index/index.vue index 2d9fc54..1a5170a 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -6208,6 +6208,7 @@ export default { }, goToRobot() { this.$util.toNextRoute("navigateTo", `/pages/robot/index`); + // this.$util.toNextRoute("navigateTo", `/pages/testPage/index`); }, handleShowTrafficDetail() { this.showMonthDetail = !this.showMonthDetail; diff --git a/pages/nationalPage/components/qiun-data-charts/js_sdk/u-charts/config-ucharts.js b/pages/nationalPage/components/qiun-data-charts/js_sdk/u-charts/config-ucharts.js index 2a15b14..5267b28 100644 --- a/pages/nationalPage/components/qiun-data-charts/js_sdk/u-charts/config-ucharts.js +++ b/pages/nationalPage/components/qiun-data-charts/js_sdk/u-charts/config-ucharts.js @@ -39,21 +39,22 @@ const fmoney = (s, n) => { for (let i = 0; i < l.length; i++) { t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : ""); } - if (n===0){ + if (n === 0) { return s - }else{ + } else { return fuhao + [...t].reverse().join("") + "." + r; } } // 四舍五入不保留小数的 金额化数字方法 -const noDecimal = (s) =>{ +const noDecimal = (s) => { let fuhao = ''; //如果数字小于零则值为- if (s < 0) { s = Math.abs(s); fuhao = '-' } s = parseFloat((s + "").replace(/[^\d\.-]/g, "")) + "" - let l = s.split(".")[0].split("").reverse(), r = s.split(".")[1]; + let l = s.split(".")[0].split("").reverse(), + r = s.split(".")[1]; let t = '' for (let i = 0; i < l.length; i++) { t += l[i] + ((i + 1) % 3 == 0 && (i + 1) != l.length ? "," : ""); @@ -61,7 +62,7 @@ const noDecimal = (s) =>{ return fuhao + [...t].reverse().join("") } // 不四舍五入 保留两位小数的金额化方法 -const getMoney = (money)=>{ +const getMoney = (money) => { if (!money || isNaN(money)) return "0.00"; let num = parseFloat(money + '') + ''; num = parseInt(money * 100 + '') / 100 + '' @@ -85,7 +86,7 @@ const getMoney = (money)=>{ return num; } // 不四舍五入 不保留两位小数的金额化方法 -const getMoneyNoDecimal = (money)=>{ +const getMoneyNoDecimal = (money) => { if (!money || isNaN(money)) return "0"; let num = parseFloat(money + '') + ''; num = parseInt(money * 100 + '') / 100 + '' @@ -110,484 +111,519 @@ const getMoneyNoDecimal = (money)=>{ } -const handleRedText = (value)=>{ - return {{value}} +const handleRedText = (value) => { + return { + { + value + } + } < /text> } //事件转换函数,主要用作格式化x轴为时间轴,根据需求自行修改 -const formatDateTime = (timeStamp, returnType)=>{ - var date = new Date(); - date.setTime(timeStamp * 1000); - var y = date.getFullYear(); - var m = date.getMonth() + 1; - m = m < 10 ? ('0' + m) : m; - var d = date.getDate(); - d = d < 10 ? ('0' + d) : d; - var h = date.getHours(); - h = h < 10 ? ('0' + h) : h; - var minute = date.getMinutes(); - var second = date.getSeconds(); - minute = minute < 10 ? ('0' + minute) : minute; - second = second < 10 ? ('0' + second) : second; - if(returnType == 'full'){return y + '-' + m + '-' + d + ' '+ h +':' + minute + ':' + second;} - if(returnType == 'y-m-d'){return y + '-' + m + '-' + d;} - if(returnType == 'h:m'){return h +':' + minute;} - if(returnType == 'h:m:s'){return h +':' + minute +':' + second;} - return [y, m, d, h, minute, second]; +const formatDateTime = (timeStamp, returnType) => { + var date = new Date(); + date.setTime(timeStamp * 1000); + var y = date.getFullYear(); + var m = date.getMonth() + 1; + m = m < 10 ? ('0' + m) : m; + var d = date.getDate(); + d = d < 10 ? ('0' + d) : d; + var h = date.getHours(); + h = h < 10 ? ('0' + h) : h; + var minute = date.getMinutes(); + var second = date.getSeconds(); + minute = minute < 10 ? ('0' + minute) : minute; + second = second < 10 ? ('0' + second) : second; + if (returnType == 'full') { + return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second; + } + if (returnType == 'y-m-d') { + return y + '-' + m + '-' + d; + } + if (returnType == 'h:m') { + return h + ':' + minute; + } + if (returnType == 'h:m:s') { + return h + ':' + minute + ':' + second; + } + return [y, m, d, h, minute, second]; } const cfu = { - //demotype为自定义图表类型,一般不需要自定义图表类型,只需要改根节点上对应的类型即可 - "type":["pie","ring","rose","word","funnel","map","arcbar","line","column","mount","bar","area","radar","gauge","candle","mix","tline","tarea","scatter","bubble","demotype"], - "range":["饼状图","圆环图","玫瑰图","词云图","漏斗图","地图","圆弧进度条","折线图","柱状图","山峰图","条状图","区域图","雷达图","仪表盘","K线图","混合图","时间轴折线","时间轴区域","散点图","气泡图","自定义类型"], - //增加自定义图表类型,如果需要categories,请在这里加入您的图表类型,例如最后的"demotype" - //自定义类型时需要注意"tline","tarea","scatter","bubble"等时间轴(矢量x轴)类图表,没有categories,不需要加入categories - "categories":["line","column","mount","bar","area","radar","gauge","candle","mix","demotype"], - //instance为实例变量承载属性,不要删除 - "instance":{}, - //option为opts及eopts承载属性,不要删除 - "option":{}, - //下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换 - "formatter":{ - "yAxisDemo1":function(val, index, opts){return val+'元'}, - "yAxisDemo2":function(val, index, opts){return val.toFixed(2)}, - "xAxisDemo1":function(val, index, opts){return val+'年';}, - "xAxisDemo2":function(val, index, opts){return formatDateTime(val,'h:m')}, - "seriesDemo1":function(val, index, series, opts){return val+'元'}, - "tooltipDemo1":function(item, category, index, opts){ - if(index==0){ - return '随便用'+item.data+'年' - }else{ - return '其他我没改'+item.data+'天' - } - }, - "pieDemo":function(val, index, series, opts){ - if(index !== undefined){ - return series[index].name+':'+series[index].data+'元' - } - }, - "entryCarNumber2":function (item, category, index, opts){ - console.log('item',item) - console.log('category',category) - console.log('index',index) - console.log('opts',opts) + //demotype为自定义图表类型,一般不需要自定义图表类型,只需要改根节点上对应的类型即可 + "type": ["pie", "ring", "rose", "word", "funnel", "map", "arcbar", "line", "column", "mount", "bar", "area", "radar", "gauge", "candle", "mix", "tline", "tarea", "scatter", "bubble", "demotype"], + "range": ["饼状图", "圆环图", "玫瑰图", "词云图", "漏斗图", "地图", "圆弧进度条", "折线图", "柱状图", "山峰图", "条状图", "区域图", "雷达图", "仪表盘", "K线图", "混合图", "时间轴折线", "时间轴区域", "散点图", "气泡图", "自定义类型"], + //增加自定义图表类型,如果需要categories,请在这里加入您的图表类型,例如最后的"demotype" + //自定义类型时需要注意"tline","tarea","scatter","bubble"等时间轴(矢量x轴)类图表,没有categories,不需要加入categories + "categories": ["line", "column", "mount", "bar", "area", "radar", "gauge", "candle", "mix", "demotype"], + //instance为实例变量承载属性,不要删除 + "instance": {}, + //option为opts及eopts承载属性,不要删除 + "option": {}, + //下面是自定义format配置,因除H5端外的其他端无法通过props传递函数,只能通过此属性对应下标的方式来替换 + "formatter": { + "yAxisDemo1": function (val, index, opts) { + return val + '元' + }, + "yAxisDemo2": function (val, index, opts) { + return val.toFixed(2) + }, + "xAxisDemo1": function (val, index, opts) { + return val + '年'; + }, + "xAxisDemo2": function (val, index, opts) { + return formatDateTime(val, 'h:m') + }, + "seriesDemo1": function (val, index, series, opts) { + return val + '元' + }, + "tooltipDemo1": function (item, category, index, opts) { + if (index == 0) { + return '随便用' + item.data + '年' + } else { + return '其他我没改' + item.data + '天' + } + }, + "pieDemo": function (val, index, series, opts) { + if (index !== undefined) { + return series[index].name + ':' + series[index].data + '元' + } + }, + "entryCarNumber2": function (item, category, index, opts) { + console.log('item', item) + console.log('category', category) + console.log('index', index) + console.log('opts', opts) - let type = opts.series[0].selectFestival - console.log('type',type) - if (type===0){ - // return item.name - let data = opts.series.filter(subItem=> subItem.name === item.name)[0].real[index] - let day = opts.series.filter(subItem=> subItem.name === item.name)[0].howDayNumber - console.log('data',data) - console.log('day',day) + let type = opts.series[0].selectFestival + console.log('type', type) + if (type === 0) { + // return item.name + let data = opts.series.filter(subItem => subItem.name === item.name)[0].real[index] + let day = opts.series.filter(subItem => subItem.name === item.name)[0].howDayNumber + console.log('data', data) + console.log('day', day) - if (item.name==='23年'){ - if (index subItem.name === item.name)[0].tradDate - let realDate - if (index===6 ||index===8 ||index===14 ||index===15 ||index===20 ||index===22 ||index===24 ||index===25 ||index===29 ||index===30){ - realDate = dateList[index] - } - return item.name + ":" + getMoney(data / 10000,2) + '万元' + `,${realDate?realDate:''}` - } - }else{ - let indexList = "6,8,14,15,20,22,24,25,29,30" - // let indexList = "8,9,15,16,21,23,25,26,30,31" - let dateList = opts.series.filter(subItem=> subItem.name === item.name)[0].tradDate - console.log('dateList',dateList) - let realDate - if (index===6 ||index===8 ||index===14 ||index===15 ||index===20 ||index===22 ||index===24 ||index===25 ||index===29 ||index===30){ - realDate = dateList[index] - } - let curData = opts.series.filter(subItem=> subItem.name === '24年')[0].real[index] - let compareData = opts.series.filter(subItem=> subItem.name === '23年')[0].real[index] - let add = Number(((curData/compareData)-1)*100).toFixed(2) - if (index0?',+':add<0?',':''}${add?add+'%':''},${realDate?realDate:''}` - }else{ - return ' ' - } - } - }else if(type===1){ - let data = opts.series.filter(subItem=> subItem.name === item.name)[0].real[index] - let day = opts.series.filter(subItem=> subItem.name === item.name)[0].howDayNumber - let festivalType = opts.series[0].selectFestival - console.log('festivalType',festivalType) - console.log('data',data) - console.log('day',day) - let curData = opts.series.filter(subItem=> subItem.name === '24年')[0].real[index] - let compareData = opts.series.filter(subItem=> subItem.name === '23年')[0].real[index] - // 显示具体的日期 - let realDate = opts.series.filter(subItem=> subItem.name === '23年')[0].realDateList[index] - // 显示具体的日期 - let curDate = opts.series.filter(subItem=> subItem.name === '24年')[0].realDateList[index] + if (item.name === '23年') { + if (index < day) { + return item.name + ":" + getMoney(data / 10000, 2) + '万元' + } else { + let indexList = "6,8,14,15,20,22,24,25,29,30" + let dateList = opts.series.filter(subItem => subItem.name === item.name)[0].tradDate + let realDate + if (index === 6 || index === 8 || index === 14 || index === 15 || index === 20 || index === 22 || index === 24 || index === 25 || index === 29 || index === 30) { + realDate = dateList[index] + } + return item.name + ":" + getMoney(data / 10000, 2) + '万元' + `,${realDate?realDate:''}` + } + } else { + let indexList = "6,8,14,15,20,22,24,25,29,30" + // let indexList = "8,9,15,16,21,23,25,26,30,31" + let dateList = opts.series.filter(subItem => subItem.name === item.name)[0].tradDate + console.log('dateList', dateList) + let realDate + if (index === 6 || index === 8 || index === 14 || index === 15 || index === 20 || index === 22 || index === 24 || index === 25 || index === 29 || index === 30) { + realDate = dateList[index] + } + let curData = opts.series.filter(subItem => subItem.name === '24年')[0].real[index] + let compareData = opts.series.filter(subItem => subItem.name === '23年')[0].real[index] + let add = Number(((curData / compareData) - 1) * 100).toFixed(2) + if (index < day) { + return `${item.name}:${getMoney(data / 10000,2)}万元${add>0?',+':add<0?',':''}${add?add+'%':''},${realDate?realDate:''}` + } else { + return ' ' + } + } + } else if (type === 1) { + let data = opts.series.filter(subItem => subItem.name === item.name)[0].real[index] + let day = opts.series.filter(subItem => subItem.name === item.name)[0].howDayNumber + let festivalType = opts.series[0].selectFestival + console.log('festivalType', festivalType) + console.log('data', data) + console.log('day', day) + let curData = opts.series.filter(subItem => subItem.name === '24年')[0].real[index] + let compareData = opts.series.filter(subItem => subItem.name === '23年')[0].real[index] + // 显示具体的日期 + let realDate = opts.series.filter(subItem => subItem.name === '23年')[0].realDateList[index] + // 显示具体的日期 + let curDate = opts.series.filter(subItem => subItem.name === '24年')[0].realDateList[index] - let add = Number(((curData/compareData)-1)*100).toFixed(2) - if (item.name==='24年'){ - if (data){ - return `${festivalType===2?curDate:item.name}:${data?getMoney(data / 10000,2):''}万元${add>0?',+':add<0?',':''}${add?add+'%':''}${festivalType===1 && index===1?'(清明节)':''}` - }else{ - return `${curDate}:` - } - }else{ - return `${festivalType===2?realDate:item.name}:${data?getMoney(data / 10000,2):''}万元${festivalType===1 && index===1?'(清明节)':''}` - } - } else if(type===2){ - let data = opts.series.filter(subItem=> subItem.name === item.name)[0].real[index] - let day = opts.series.filter(subItem=> subItem.name === item.name)[0].howDayNumber + let add = Number(((curData / compareData) - 1) * 100).toFixed(2) + if (item.name === '24年') { + if (data) { + return `${festivalType===2?curDate:item.name}:${data?getMoney(data / 10000,2):''}万元${add>0?',+':add<0?',':''}${add?add+'%':''}${festivalType===1 && index===1?'(清明节)':''}` + } else { + return `${curDate}:` + } + } else { + return `${festivalType===2?realDate:item.name}:${data?getMoney(data / 10000,2):''}万元${festivalType===1 && index===1?'(清明节)':''}` + } + } else if (type === 2) { + let data = opts.series.filter(subItem => subItem.name === item.name)[0].real[index] + let day = opts.series.filter(subItem => subItem.name === item.name)[0].howDayNumber - let festivalType = opts.series[0].selectFestival - console.log('festivalType',festivalType) - console.log('data',data) - console.log('day',day) - let curData = opts.series.filter(subItem=> subItem.name === '24年')[0].real[index] - let compareData = opts.series.filter(subItem=> subItem.name === '23年')[0].real[index] - // 显示具体的日期 - let realDate = opts.series.filter(subItem=> subItem.name === '23年')[0].realDateList[index] - // 显示具体的日期 - let curDate = opts.series.filter(subItem=> subItem.name === '24年')[0].realDateList[index] + let festivalType = opts.series[0].selectFestival + console.log('festivalType', festivalType) + console.log('data', data) + console.log('day', day) + let curData = opts.series.filter(subItem => subItem.name === '24年')[0].real[index] + let compareData = opts.series.filter(subItem => subItem.name === '23年')[0].real[index] + // 显示具体的日期 + let realDate = opts.series.filter(subItem => subItem.name === '23年')[0].realDateList[index] + // 显示具体的日期 + let curDate = opts.series.filter(subItem => subItem.name === '24年')[0].realDateList[index] - let add = Number(((curData/compareData)-1)*100).toFixed(2) - if (item.name==='24年'){ - if (data){ - return `${curDate}:${data?getMoney(data / 10000,2):''}万元${add>0?',+':add<0?',':''}${add?add+'%':''}${festivalType===1 && index===1?'(劳动节)':''}` - }else{ - return `${curDate}:` - } - }else{ - return `${realDate}:${data?getMoney(data / 10000,2):''}万元${festivalType===1 && index===1?'(劳动节)':''}` - } - }else if(type===3){ - let data = opts.series.filter(subItem=> subItem.name === item.name)[0].real[index] - let day = opts.series.filter(subItem=> subItem.name === item.name)[0].howDayNumber + let add = Number(((curData / compareData) - 1) * 100).toFixed(2) + if (item.name === '24年') { + if (data) { + return `${curDate}:${data?getMoney(data / 10000,2):''}万元${add>0?',+':add<0?',':''}${add?add+'%':''}${festivalType===1 && index===1?'(劳动节)':''}` + } else { + return `${curDate}:` + } + } else { + return `${realDate}:${data?getMoney(data / 10000,2):''}万元${festivalType===1 && index===1?'(劳动节)':''}` + } + } else if (type === 3) { + let data = opts.series.filter(subItem => subItem.name === item.name)[0].real[index] + let day = opts.series.filter(subItem => subItem.name === item.name)[0].howDayNumber - let festivalType = opts.series[0].selectFestival - console.log('festivalType',festivalType) - console.log('data',data) - console.log('day',day) - let curData = opts.series.filter(subItem=> subItem.name === '24年')[0].real[index] - let compareData = opts.series.filter(subItem=> subItem.name === '23年')[0].real[index] - // 显示具体的日期 - let realDate = opts.series.filter(subItem=> subItem.name === '23年')[0].realDateList[index] - // 显示具体的日期 - let curDate = opts.series.filter(subItem=> subItem.name === '24年')[0].realDateList[index] + let festivalType = opts.series[0].selectFestival + console.log('festivalType', festivalType) + console.log('data', data) + console.log('day', day) + let curData = opts.series.filter(subItem => subItem.name === '24年')[0].real[index] + let compareData = opts.series.filter(subItem => subItem.name === '23年')[0].real[index] + // 显示具体的日期 + let realDate = opts.series.filter(subItem => subItem.name === '23年')[0].realDateList[index] + // 显示具体的日期 + let curDate = opts.series.filter(subItem => subItem.name === '24年')[0].realDateList[index] - let add = Number(((curData/compareData)-1)*100).toFixed(2) - if (item.name==='24年'){ - if (data){ - return `${curDate}:${data?getMoney(data / 10000,2):''}万元${add>0?',+':add<0?',':''}${add?add+'%':''}${index===3?'(端午节)':''}` - }else{ - return `${curDate}:` - } - }else{ - return `${realDate}:${data?getMoney(data / 10000,2):''}万元${index===1?'(端午节)':''}` - } - }else{ - let festivalType = opts.series[0].selectFestival - let curData = opts.series.filter(subItem=> subItem.name === '24年')[0].real[index] - let compareData = opts.series.filter(subItem=> subItem.name === '23年')[0].real[index] - // 显示具体的日期 - let realDate = opts.series.filter(subItem=> subItem.name === '23年')[0].realDateList[index] - // 显示具体的日期 - let curDate = opts.series.filter(subItem=> subItem.name === '24年')[0].realDateList[index] - let add = Number(((curData/compareData)-1)*100).toFixed(2) - console.log('curDate',curDate) - let data = opts.series.filter(subItem=> subItem.name === item.name)[0].real[index] - if(item.name==='24年'){ - if(data){ - return `${curDate}:${data?getMoney(data / 10000,2):''}万元${add>0?',+':add<0?',':''}${add?add+'%':''}${ + let add = Number(((curData / compareData) - 1) * 100).toFixed(2) + if (item.name === '24年') { + if (data) { + return `${curDate}:${data?getMoney(data / 10000,2):''}万元${add>0?',+':add<0?',':''}${add?add+'%':''}${index===3?'(端午节)':''}` + } else { + return `${curDate}:` + } + } else { + return `${realDate}:${data?getMoney(data / 10000,2):''}万元${index===1?'(端午节)':''}` + } + } else { + let festivalType = opts.series[0].selectFestival + let curData = opts.series.filter(subItem => subItem.name === '24年')[0].real[index] + let compareData = opts.series.filter(subItem => subItem.name === '23年')[0].real[index] + // 显示具体的日期 + let realDate = opts.series.filter(subItem => subItem.name === '23年')[0].realDateList[index] + // 显示具体的日期 + let curDate = opts.series.filter(subItem => subItem.name === '24年')[0].realDateList[index] + let add = Number(((curData / compareData) - 1) * 100).toFixed(2) + console.log('curDate', curDate) + let data = opts.series.filter(subItem => subItem.name === item.name)[0].real[index] + if (item.name === '24年') { + if (data) { + return `${curDate}:${data?getMoney(data / 10000,2):''}万元${add>0?',+':add<0?',':''}${add?add+'%':''}${ festivalType===1 && index===1?'(清明节)': festivalType===2 && index===2?'(劳动节)': festivalType===3 && index===3?'(端午节)': festivalType===5 && index===3?'(中秋节)': festivalType===6 && index===1?'(国庆节)': ''}` - }else{ - return `${curDate}:` - } - }else{ - return `${realDate}:${data?getMoney(data / 10000,2):''}万元${ + } else { + return `${curDate}:` + } + } else { + return `${realDate}:${data?getMoney(data / 10000,2):''}万元${ festivalType===1 && index===1?'(清明节)': festivalType===2 && index===3?'(劳动节)': festivalType===3 && index===1?'(端午节)': festivalType===5 && index===1?'(中秋节)': festivalType===6 && index===3?'(国庆节)': ''}` - } - } + } + } - }, - "entryCarNumber":function (item, category, index, opts){ - console.log('item',item) - console.log('category',category) - console.log('index',index) - console.log('opts',opts) - // return item.name - let data = opts.series.filter(subItem=> subItem.name === item.name)[0].real[index] - let day = opts.series.filter(subItem=> subItem.name === item.name)[0].howDayNumber + }, + "entryCarNumber": function (item, category, index, opts) { + console.log('item', item); + console.log('category', category); + console.log('index', index); + console.log('opts', opts); + // 从opts里面 拿到这一行的详细数据 + let detail = opts.series.filter(subItem => subItem.name === item.name)[0] + let add = '' + if (detail.linearIndex > 0) { + // 上一年 + let lastYearObj = opts.series[detail.linearIndex - 1] + console.log('lastYearObj', lastYearObj); + // 当前年 + let currentYearObj = opts.series[detail.linearIndex] + add = (((currentYearObj.real[index] - lastYearObj.real[index]) / lastYearObj.real[index]) * 100).toFixed(2) + '%' + } - let festivalType = opts.series[0].selectFestival - console.log('festivalType',festivalType) - console.log('data',data) - console.log('day',day) - let curData = opts.series.filter(subItem=> subItem.name === '24年')[0].real[index] - let compareData = opts.series.filter(subItem=> subItem.name === '23年')[0].real[index] - // 显示具体的日期 - let realDate = opts.series.filter(subItem=> subItem.name === '23年')[0].realDateList[index] - // 显示具体的日期 - let curDate = opts.series.filter(subItem=> subItem.name === '24年')[0].realDateList[index] + return `${detail.realDateList[index]}: ${detail.data[index].toFixed(2)}万元${add?detail.data[index]>0?','+add:'':''}` - let add = Number(((curData/compareData)-1)*100).toFixed(2) - if(item.name==='24年'){ - if(data){ - return `${curDate}:${data?getMoney(data / 10000,2):''}万元${add>0?',+':add<0?',':''}${add?add+'%':''}${ - festivalType===1 && index===1?'(清明节)': - festivalType===2 && index===2?'(劳动节)': - festivalType===3 && index===3?'(端午节)': - festivalType===5 && index===3?'(中秋节)': - festivalType===6 && index===1?'(国庆节)': - ''}` - }else{ - return `${curDate}:` - } - }else{ - return `${realDate}:${data?getMoney(data / 10000,2):''}万元${ - festivalType===1 && index===1?'(清明节)': - festivalType===2 && index===3?'(劳动节)': - festivalType===3 && index===1?'(端午节)': - festivalType===5 && index===1?'(中秋节)': - festivalType===6 && index===3?'(国庆节)': - ''}` - } + // return item.name + // let data = opts.series.filter(subItem=> subItem.name === item.name)[0].real[index] + // let day = opts.series.filter(subItem=> subItem.name === item.name)[0].howDayNumber + + // let festivalType = opts.series[0].selectFestival + // console.log('festivalType',festivalType) + // console.log('data',data) + // console.log('day',day) + // let curData = opts.series.filter(subItem=> subItem.name === '24年')[0].real[index] + // let compareData = opts.series.filter(subItem=> subItem.name === '23年')[0].real[index] + // // 显示具体的日期 + // let realDate = opts.series.filter(subItem=> subItem.name === '23年')[0].realDateList[index] + // // 显示具体的日期 + // let curDate = opts.series.filter(subItem=> subItem.name === '24年')[0].realDateList[index] + + // let add = Number(((curData/compareData)-1)*100).toFixed(2) + // if(item.name==='24年'){ + // if(data){ + // return `${curDate}:${data?getMoney(data / 10000,2):''}万元${add>0?',+':add<0?',':''}${add?add+'%':''}${ + // festivalType===1 && index===1?'(清明节)': + // festivalType===2 && index===2?'(劳动节)': + // festivalType===3 && index===3?'(端午节)': + // festivalType===5 && index===3?'(中秋节)': + // festivalType===6 && index===1?'(国庆节)': + // ''}` + // }else{ + // return `${curDate}:` + // } + // }else{ + // return `${realDate}:${data?getMoney(data / 10000,2):''}万元${ + // festivalType===1 && index===1?'(清明节)': + // festivalType===2 && index===3?'(劳动节)': + // festivalType===3 && index===1?'(端午节)': + // festivalType===5 && index===1?'(中秋节)': + // festivalType===6 && index===3?'(国庆节)': + // ''}` + // } - // if (item.name==='24年'){ + // if (item.name==='24年'){ // if (data){ // return `${festivalType===2 || festivalType===3?curDate:item.name}:${data?getMoney(data / 10000,2):''}万元${add>0?',+':add<0?',':''}${add?add+'%':''}${festivalType===1 && index===1?'(清明节)':festivalType===3 && index===3?'(端午节)':''}` // }else{ // return `${curDate}:` // } - // }else{ + // }else{ // return `${festivalType===2 || festivalType===3?realDate:item.name}:${data?getMoney(data / 10000,2):''}万元${festivalType===1 && index===1?'(清明节)':festivalType===3 && index===1?'(端午节)':''}` - // } + // } - }, - entryCarNumberXFormat:function (value,index,opts){ - return value - }, - monthTotal:function (item, category, index, opts){ - let text = '' - let type = item.name.slice(5,10) - let time = opts.series[0].info[index].year - if (type === '车流量'){ - if (`${time}年车流量` === item.name){ - let showTime = opts.series[0].info[index].year.toString().slice(2,5) - text = `${showTime}年入区 ${opts.series[0].info[index].allCarCount?fmoney(opts.series[0].info[index].allCarCount):''} 辆` - }else{ - let showTime = opts.series[1].info[index].year.toString().slice(2,5) - text = `${showTime}年入区 ${opts.series[1].info[index].allCarCount?fmoney(opts.series[1].info[index].allCarCount):''} 辆` - } - return text - }else{ - if (`${time}年交易额` === item.name){ - let showTime = opts.series[2].year.toString().slice(2,5) - console.log('showTime',showTime) - text = `${showTime}年金额 ${opts.series[2].info[index].money?fmoney(opts.series[2].info[index].money):''} 元, 单车消费 ${opts.series[0].info[index].allCarCount?((opts.series[0].info[index].money) / opts.series[0].info[index].allCarCount).toFixed(2):''} 元` - }else{ - let showTime = opts.series[3].year.toString().slice(2,5) - text = `${showTime}年金额 ${opts.series[3].info[index].money?fmoney(opts.series[3].info[index].money):''} 元, 单车消费 ${opts.series[1].info[index].allCarCount?((opts.series[1].info[index].money) / opts.series[1].info[index].allCarCount).toFixed(2):''} 元` - } - return text - } - }, - homePlace:function (item, category, index, opts){ - console.log('item',item) - console.log('opts',opts) - if (item.name.split(' ')[0] === '其他'){ - let str = '' - opts.homeData.forEach(item=>{ - if (item.name.split(' ')[0]!=='其他'){ - if (str===''){ - str = item.name.split(' ')[0] - }else{ - str+=`,${item.name.split(' ')[0]}` - } - } - }) - } - return item.name + ":" + item.data + '辆'; - }, - carTypeTime:function (item, category, index, opts){ - if (this.num===0){ - this.num++ - return '日均车辆' + ":" + opts.series[0].valueList[index] + '辆,占比' + item.data + '%'; - }else{ - this.num=0 - return '平均停留' + ":" + item.data + '分钟'; - } - }, - timeAnalysis:function (item, category, index, opts){ - return item.name + ":" + item.data + '分钟' - }, - businessType:function (item, category, index, opts){ - return item.name; - }, - "moneyCompare":function (item, category, index, opts){ - const date = new Date() - let m = date.getMonth() - console.log('item',item) - console.log('category',category) - console.log('index',index) - console.log('opts',opts) - if (index >m){ - if (opts.otherType===0){ - if (item.name === '工作日平均'){ - return item.name + ":" + item.data + '万元' - }else if(item.name === '周末平均'){ - return item.name + ":" + item.data + '万元' - }else { - return item.name + ":" + item.data + '万元' - } - }else if(opts.otherType === 1){ - if (item.name === '工作日平均'){ - return item.name + ":" + noDecimal(item.data) + '笔' - }else if(item.name === '周末平均'){ - return item.name + ":" + noDecimal(item.data) + '笔' - }else { - return item.name + ":" +noDecimal(item.data) + '笔' - } - }else if(opts.otherType === 2){ - if (item.name === '工作日平均'){ - return item.name + ":" + item.data + '元' - }else if(item.name === '周末平均'){ - return item.name + ":" + item.data + '元' - }else { - return item.name + ":" + item.data + '元' - } - } + }, + entryCarNumberXFormat: function (value, index, opts) { + return value + }, + monthTotal: function (item, category, index, opts) { + let text = '' + let type = item.name.slice(5, 10) + let time = opts.series[0].info[index].year + if (type === '车流量') { + if (`${time}年车流量` === item.name) { + let showTime = opts.series[0].info[index].year.toString().slice(2, 5) + text = `${showTime}年入区 ${opts.series[0].info[index].allCarCount?fmoney(opts.series[0].info[index].allCarCount):''} 辆` + } else { + let showTime = opts.series[1].info[index].year.toString().slice(2, 5) + text = `${showTime}年入区 ${opts.series[1].info[index].allCarCount?fmoney(opts.series[1].info[index].allCarCount):''} 辆` + } + return text + } else { + if (`${time}年交易额` === item.name) { + let showTime = opts.series[2].year.toString().slice(2, 5) + console.log('showTime', showTime) + text = `${showTime}年金额 ${opts.series[2].info[index].money?fmoney(opts.series[2].info[index].money):''} 元, 单车消费 ${opts.series[0].info[index].allCarCount?((opts.series[0].info[index].money) / opts.series[0].info[index].allCarCount).toFixed(2):''} 元` + } else { + let showTime = opts.series[3].year.toString().slice(2, 5) + text = `${showTime}年金额 ${opts.series[3].info[index].money?fmoney(opts.series[3].info[index].money):''} 元, 单车消费 ${opts.series[1].info[index].allCarCount?((opts.series[1].info[index].money) / opts.series[1].info[index].allCarCount).toFixed(2):''} 元` + } + return text + } + }, + homePlace: function (item, category, index, opts) { + console.log('item', item) + console.log('opts', opts) + if (item.name.split(' ')[0] === '其他') { + let str = '' + opts.homeData.forEach(item => { + if (item.name.split(' ')[0] !== '其他') { + if (str === '') { + str = item.name.split(' ')[0] + } else { + str += `,${item.name.split(' ')[0]}` + } + } + }) + } + return item.name + ":" + item.data + '辆'; + }, + carTypeTime: function (item, category, index, opts) { + if (this.num === 0) { + this.num++ + return '日均车辆' + ":" + opts.series[0].valueList[index] + '辆,占比' + item.data + '%'; + } else { + this.num = 0 + return '平均停留' + ":" + item.data + '分钟'; + } + }, + timeAnalysis: function (item, category, index, opts) { + return item.name + ":" + item.data + '分钟' + }, + businessType: function (item, category, index, opts) { + return item.name; + }, + "moneyCompare": function (item, category, index, opts) { + const date = new Date() + let m = date.getMonth() + console.log('item', item) + console.log('category', category) + console.log('index', index) + console.log('opts', opts) + if (index > m) { + if (opts.otherType === 0) { + if (item.name === '工作日平均') { + return item.name + ":" + item.data + '万元' + } else if (item.name === '周末平均') { + return item.name + ":" + item.data + '万元' + } else { + return item.name + ":" + item.data + '万元' + } + } else if (opts.otherType === 1) { + if (item.name === '工作日平均') { + return item.name + ":" + noDecimal(item.data) + '笔' + } else if (item.name === '周末平均') { + return item.name + ":" + noDecimal(item.data) + '笔' + } else { + return item.name + ":" + noDecimal(item.data) + '笔' + } + } else if (opts.otherType === 2) { + if (item.name === '工作日平均') { + return item.name + ":" + item.data + '元' + } else if (item.name === '周末平均') { + return item.name + ":" + item.data + '元' + } else { + return item.name + ":" + item.data + '元' + } + } - }else{ - if (opts.otherType===0){ - if (item.name === '工作日平均'){ - return item.name + ":" + item.data + '万元,' + '较上月:' + opts.series[0].qoqAdd[index] + '%' - }else if(item.name === '周末平均'){ - return item.name + ":" + item.data + '万元,' + '较工作日:'+ opts.series[1].qoqAdd[index] + '%' - }else { - // 判断有节假日就显示括号 没有就不显示 - if (opts.series[2].holiday[index][1]){ - return item.name + ":" + item.data + '万元' + '(' + opts.series[2].holiday[index][1] + ')' - }else{ - return item.name + ":" + item.data + '万元' - } - } - }else if (opts.otherType === 1){ - if (item.name === '工作日平均'){ - return item.name + ":" + noDecimal(item.data) + '笔,' + '较上月:' + opts.series[0].qoqAdd[index] + '%' - }else if(item.name === '周末平均'){ - return item.name + ":" + noDecimal(item.data) + '笔,' + '较工作日:'+ opts.series[1].qoqAdd[index] + '%' - }else { - if (opts.series[2].holiday[index][1]){ - return item.name + ":" + noDecimal(item.data) + '笔' + '(' + opts.series[2].holiday[index][1] + ')' - }else{ - return item.name + ":" + noDecimal(item.data) + '笔' - } - } - }else if(opts.otherType === 2){ - if (item.name === '工作日平均'){ - return item.name + ":" + item.data + '元,' + '较上月:' + opts.series[0].qoqAdd[index] + '%' - }else if(item.name === '周末平均'){ - return item.name + ":" + item.data + '元,' + '较工作日:'+ opts.series[1].qoqAdd[index] + '%' - }else { - if (opts.series[2].holiday[index][1]){ - return item.name + ":" + item.data + '元' + '(' + opts.series[2].holiday[index][1] + ')' - }else{ - return item.name + ":" + item.data + '元' - } - } - } - } - }, - consumptionCompare:function (item, category, index, opts){ - if (item.name === '客单数'){ - return item.name + ':'+ item.data + '笔' - }else{ - return item.name + ':'+ item.data + '辆,交易概率: ' + ((opts.series[0].data[index] / opts.series[1].data[index])*100).toFixed(2) + '%' - } - }, - consumptionCompareFormat:function (val){ - if (val==='0:00' || val==='4:00'|| val==='8:00'|| val==='12:00'|| val==='16:00'|| val==='20:00'|| val==='23:00'){ - if (val === '23:00'){ - return '24:00' - }else{ - return val - } - }else{ - return '' - } - }, - timePeriodAnalysisFormat:function (val){ - if (val===0 || val===4 || val===8 || val===12 || val===16 || val===20 || val===23){ - if (val===23){ - return '24:00' - }else{ - return `${val}:00` - } - }else{ - return '' - } - }, - timePeriodAnalysis:function (item, category, index, opts){ - return item.name + ':'+ item.data + '%,' +'数量:' + opts.series[0].number[index] + '笔,金额:' +opts.series[0].money[index] +'元' - }, - levelTop:function (item, category, index, opts){ - return item.name + ' '+ item.data + '%'; - }, - businessFormat:function (item, category, index, opts){ - return item.name+',' + opts.series[index].text - }, - fillingDegree:function (item, category, index, opts){ - return item.name; - }, - yearRevenue:function (item, category, index, opts){ - let data = opts.series.filter(subItem=> subItem.name === item.name)[0].real[index] - console.log('data',data) - if (data){ - return item.name + ":" + getMoneyNoDecimal(data)+ '辆'; - }else{ - return item.name + ":" + 0 + '辆'; - } - } - }, - //这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在opts参数,会将demotype与opts中option合并后渲染图表。 - "demotype":{ - //我这里把曲线图当做了自定义图表类型,您可以根据需要随意指定类型或配置 - "type": "line", - "color": color, - "padding": [15,10,0,15], - "xAxis": { - "disableGrid": true, - }, - "yAxis": { - "gridType": "dash", - "dashLength": 2, - }, - "legend": { - }, - "extra": { - "line": { - "type": "curve", - "width": 2 - }, - } - }, - //下面是自定义配置,请添加项目所需的通用配置 - "pie":{ + } else { + if (opts.otherType === 0) { + if (item.name === '工作日平均') { + return item.name + ":" + item.data + '万元,' + '较上月:' + opts.series[0].qoqAdd[index] + '%' + } else if (item.name === '周末平均') { + return item.name + ":" + item.data + '万元,' + '较工作日:' + opts.series[1].qoqAdd[index] + '%' + } else { + // 判断有节假日就显示括号 没有就不显示 + if (opts.series[2].holiday[index][1]) { + return item.name + ":" + item.data + '万元' + '(' + opts.series[2].holiday[index][1] + ')' + } else { + return item.name + ":" + item.data + '万元' + } + } + } else if (opts.otherType === 1) { + if (item.name === '工作日平均') { + return item.name + ":" + noDecimal(item.data) + '笔,' + '较上月:' + opts.series[0].qoqAdd[index] + '%' + } else if (item.name === '周末平均') { + return item.name + ":" + noDecimal(item.data) + '笔,' + '较工作日:' + opts.series[1].qoqAdd[index] + '%' + } else { + if (opts.series[2].holiday[index][1]) { + return item.name + ":" + noDecimal(item.data) + '笔' + '(' + opts.series[2].holiday[index][1] + ')' + } else { + return item.name + ":" + noDecimal(item.data) + '笔' + } + } + } else if (opts.otherType === 2) { + if (item.name === '工作日平均') { + return item.name + ":" + item.data + '元,' + '较上月:' + opts.series[0].qoqAdd[index] + '%' + } else if (item.name === '周末平均') { + return item.name + ":" + item.data + '元,' + '较工作日:' + opts.series[1].qoqAdd[index] + '%' + } else { + if (opts.series[2].holiday[index][1]) { + return item.name + ":" + item.data + '元' + '(' + opts.series[2].holiday[index][1] + ')' + } else { + return item.name + ":" + item.data + '元' + } + } + } + } + }, + consumptionCompare: function (item, category, index, opts) { + if (item.name === '客单数') { + return item.name + ':' + item.data + '笔' + } else { + return item.name + ':' + item.data + '辆,交易概率: ' + ((opts.series[0].data[index] / opts.series[1].data[index]) * 100).toFixed(2) + '%' + } + }, + consumptionCompareFormat: function (val) { + if (val === '0:00' || val === '4:00' || val === '8:00' || val === '12:00' || val === '16:00' || val === '20:00' || val === '23:00') { + if (val === '23:00') { + return '24:00' + } else { + return val + } + } else { + return '' + } + }, + timePeriodAnalysisFormat: function (val) { + if (val === 0 || val === 4 || val === 8 || val === 12 || val === 16 || val === 20 || val === 23) { + if (val === 23) { + return '24:00' + } else { + return `${val}:00` + } + } else { + return '' + } + }, + timePeriodAnalysis: function (item, category, index, opts) { + return item.name + ':' + item.data + '%,' + '数量:' + opts.series[0].number[index] + '笔,金额:' + opts.series[0].money[index] + '元' + }, + levelTop: function (item, category, index, opts) { + return item.name + ' ' + item.data + '%'; + }, + businessFormat: function (item, category, index, opts) { + return item.name + ',' + opts.series[index].text + }, + fillingDegree: function (item, category, index, opts) { + return item.name; + }, + yearRevenue: function (item, category, index, opts) { + let data = opts.series.filter(subItem => subItem.name === item.name)[0].real[index] + console.log('data', data) + if (data) { + return item.name + ":" + getMoneyNoDecimal(data) + '辆'; + } else { + return item.name + ":" + 0 + '辆'; + } + } + }, + //这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在opts参数,会将demotype与opts中option合并后渲染图表。 + "demotype": { + //我这里把曲线图当做了自定义图表类型,您可以根据需要随意指定类型或配置 + "type": "line", + "color": color, + "padding": [15, 10, 0, 15], + "xAxis": { + "disableGrid": true, + }, + "yAxis": { + "gridType": "dash", + "dashLength": 2, + }, + "legend": {}, + "extra": { + "line": { + "type": "curve", + "width": 2 + }, + } + }, + //下面是自定义配置,请添加项目所需的通用配置 + "pie": { "type": "pie", - "color": color, - "padding": [5,5,5,5], + "color": color, + "padding": [5, 5, 5, 5], "extra": { "pie": { "activeOpacity": 0.5, @@ -600,16 +636,16 @@ const cfu = { }, } }, - "ring":{ + "ring": { "type": "ring", - "color": color, - "padding": [5,5,5,5], + "color": color, + "padding": [5, 5, 5, 5], "rotate": false, "dataLabel": true, "legend": { "show": true, "position": "right", - "lineHeight": 25, + "lineHeight": 25, }, "title": { "name": "收益率", @@ -623,7 +659,7 @@ const cfu = { }, "extra": { "ring": { - "ringWidth":30, + "ringWidth": 30, "activeOpacity": 0.5, "activeRadius": 10, "offsetAngle": 0, @@ -634,14 +670,14 @@ const cfu = { }, }, }, - "rose":{ + "rose": { "type": "rose", - "color": color, - "padding": [5,5,5,5], + "color": color, + "padding": [5, 5, 5, 5], "legend": { "show": true, "position": "left", - "lineHeight": 25, + "lineHeight": 25, }, "extra": { "rose": { @@ -657,9 +693,9 @@ const cfu = { }, } }, - "word":{ + "word": { "type": "word", - "color": color, + "color": color, "extra": { "word": { "type": "normal", @@ -667,10 +703,10 @@ const cfu = { } } }, - "funnel":{ + "funnel": { "type": "funnel", - "color": color, - "padding": [15,15,0,15], + "color": color, + "padding": [15, 15, 0, 15], "extra": { "funnel": { "activeOpacity": 0.3, @@ -683,11 +719,11 @@ const cfu = { }, } }, - "map":{ + "map": { "type": "map", - "color": color, - "padding": [0,0,0,0], - "dataLabel": true, + "color": color, + "padding": [0, 0, 0, 0], + "dataLabel": true, "extra": { "map": { "border": true, @@ -700,9 +736,9 @@ const cfu = { }, } }, - "arcbar":{ + "arcbar": { "type": "arcbar", - "color": color, + "color": color, "title": { "name": "百分比", "fontSize": 25, @@ -724,98 +760,92 @@ const cfu = { } } }, - "line":{ + "line": { "type": "line", - "color": color, - "padding": [15,10,0,15], + "color": color, + "padding": [15, 10, 0, 15], "xAxis": { - "disableGrid": true, + "disableGrid": true, }, "yAxis": { - "gridType": "dash", - "dashLength": 2, - }, - "legend": { + "gridType": "dash", + "dashLength": 2, }, + "legend": {}, "extra": { "line": { "type": "straight", "width": 2, - "activeType": "hollow" + "activeType": "hollow" }, } }, - "tline":{ - "type": "line", - "color": color, - "padding": [15,10,0,15], - "xAxis": { - "disableGrid": false, - "boundaryGap":"justify", - }, - "yAxis": { - "gridType": "dash", - "dashLength": 2, - "data":[ - { - "min":0, - "max":80 - } - ] - }, - "legend": { - }, - "extra": { - "line": { - "type": "curve", - "width": 2, - "activeType": "hollow" - }, - } - }, - "tarea":{ - "type": "area", - "color": color, - "padding": [15,10,0,15], - "xAxis": { - "disableGrid": true, - "boundaryGap":"justify", - }, - "yAxis": { - "gridType": "dash", - "dashLength": 2, - "data":[ - { - "min":0, - "max":80 - } - ] - }, - "legend": { - }, - "extra": { - "area": { - "type": "curve", - "opacity": 0.2, - "addLine": true, - "width": 2, - "gradient": true, - "activeType": "hollow" - }, - } - }, - "column":{ - "type": "column", - "color": color, - "padding": [15,15,0,5], + "tline": { + "type": "line", + "color": color, + "padding": [15, 10, 0, 15], "xAxis": { - "disableGrid": true, + "disableGrid": false, + "boundaryGap": "justify", }, "yAxis": { - "data":[{"min":0}] + "gridType": "dash", + "dashLength": 2, + "data": [{ + "min": 0, + "max": 80 + }] }, - "legend": { + "legend": {}, + "extra": { + "line": { + "type": "curve", + "width": 2, + "activeType": "hollow" + }, + } + }, + "tarea": { + "type": "area", + "color": color, + "padding": [15, 10, 0, 15], + "xAxis": { + "disableGrid": true, + "boundaryGap": "justify", }, + "yAxis": { + "gridType": "dash", + "dashLength": 2, + "data": [{ + "min": 0, + "max": 80 + }] + }, + "legend": {}, + "extra": { + "area": { + "type": "curve", + "opacity": 0.2, + "addLine": true, + "width": 2, + "gradient": true, + "activeType": "hollow" + }, + } + }, + "column": { + "type": "column", + "color": color, + "padding": [15, 15, 0, 5], + "xAxis": { + "disableGrid": true, + }, + "yAxis": { + "data": [{ + "min": 0 + }] + }, + "legend": {}, "extra": { "column": { "type": "group", @@ -825,63 +855,61 @@ const cfu = { }, } }, - "mount":{ - "type": "mount", - "color": color, - "padding": [15,15,0,5], - "xAxis": { - "disableGrid": true, - }, - "yAxis": { - "data":[{"min":0}] - }, - "legend": { - }, - "extra": { - "mount": { - "type": "mount", - "widthRatio": 1.5, - }, - } - }, - "bar":{ - "type": "bar", - "color": color, - "padding": [15,30,0,5], - "xAxis": { - "boundaryGap":"justify", - "disableGrid":false, - "min":0, - "axisLine":false - }, - "yAxis": { - }, - "legend": { - }, - "extra": { - "bar": { - "type": "group", - "width": 30, - "meterBorde": 1, - "meterFillColor": "#FFFFFF", - "activeBgColor": "#000000", - "activeBgOpacity": 0.08 - }, - } - }, - "area":{ - "type": "area", + "mount": { + "type": "mount", "color": color, - "padding": [15,15,0,15], + "padding": [15, 15, 0, 5], "xAxis": { - "disableGrid": true, + "disableGrid": true, }, "yAxis": { - "gridType": "dash", - "dashLength": 2, + "data": [{ + "min": 0 + }] }, - "legend": { + "legend": {}, + "extra": { + "mount": { + "type": "mount", + "widthRatio": 1.5, + }, + } + }, + "bar": { + "type": "bar", + "color": color, + "padding": [15, 30, 0, 5], + "xAxis": { + "boundaryGap": "justify", + "disableGrid": false, + "min": 0, + "axisLine": false }, + "yAxis": {}, + "legend": {}, + "extra": { + "bar": { + "type": "group", + "width": 30, + "meterBorde": 1, + "meterFillColor": "#FFFFFF", + "activeBgColor": "#000000", + "activeBgOpacity": 0.08 + }, + } + }, + "area": { + "type": "area", + "color": color, + "padding": [15, 15, 0, 15], + "xAxis": { + "disableGrid": true, + }, + "yAxis": { + "gridType": "dash", + "dashLength": 2, + }, + "legend": {}, "extra": { "area": { "type": "straight", @@ -889,19 +917,19 @@ const cfu = { "addLine": true, "width": 2, "gradient": false, - "activeType": "hollow" + "activeType": "hollow" }, } }, - "radar":{ + "radar": { "type": "radar", "color": color, - "padding": [5,5,5,5], - "dataLabel": false, + "padding": [5, 5, 5, 5], + "dataLabel": false, "legend": { "show": true, "position": "right", - "lineHeight": 25, + "lineHeight": 25, }, "extra": { "radar": { @@ -914,7 +942,7 @@ const cfu = { }, } }, - "gauge":{ + "gauge": { "type": "gauge", "color": color, "title": { @@ -954,10 +982,10 @@ const cfu = { } } }, - "candle":{ + "candle": { "type": "candle", "color": color, - "padding": [15,15,0,15], + "padding": [15, 15, 0, 15], "enableScroll": true, "enableMarkLine": true, "dataLabel": false, @@ -973,10 +1001,8 @@ const cfu = { "scrollColor": "#A6A6A6", "scrollBackgroundColor": "#EFEBEF" }, - "yAxis": { - }, - "legend": { - }, + "yAxis": {}, + "legend": {}, "extra": { "candle": { "color": { @@ -987,16 +1013,15 @@ const cfu = { }, "average": { "show": true, - "name": ["MA5","MA10","MA30"], - "day": [5,10,20], - "color": ["#1890ff","#2fc25b","#facc14"] + "name": ["MA5", "MA10", "MA30"], + "day": [5, 10, 20], + "color": ["#1890ff", "#2fc25b", "#facc14"] } }, "markLine": { "type": "dash", "dashLength": 5, - "data": [ - { + "data": [{ "value": 2150, "lineColor": "#f04864", "showLabel": true @@ -1010,12 +1035,12 @@ const cfu = { } } }, - "mix":{ + "mix": { "type": "mix", "color": color, - "padding": [15,15,0,15], + "padding": [15, 15, 0, 15], "xAxis": { - "disableGrid": true, + "disableGrid": true, }, "yAxis": { "disabled": false, @@ -1028,8 +1053,7 @@ const cfu = { "showTitle": true, "data": [] }, - "legend": { - }, + "legend": {}, "extra": { "mix": { "column": { @@ -1038,58 +1062,55 @@ const cfu = { }, } }, - "scatter":{ + "scatter": { "type": "scatter", - "color":color, - "padding":[15,15,0,15], - "dataLabel":false, - "xAxis": { - "disableGrid": false, - "gridType":"dash", - "splitNumber":5, - "boundaryGap":"justify", - "min":0 - }, - "yAxis": { - "disableGrid": false, - "gridType":"dash", - }, - "legend": { - }, - "extra": { - "scatter": { - }, - } + "color": color, + "padding": [15, 15, 0, 15], + "dataLabel": false, + "xAxis": { + "disableGrid": false, + "gridType": "dash", + "splitNumber": 5, + "boundaryGap": "justify", + "min": 0 + }, + "yAxis": { + "disableGrid": false, + "gridType": "dash", + }, + "legend": {}, + "extra": { + "scatter": {}, + } }, - "bubble":{ + "bubble": { "type": "bubble", - "color":color, - "padding":[15,15,0,15], - "xAxis": { - "disableGrid": false, - "gridType":"dash", - "splitNumber":5, - "boundaryGap":"justify", - "min":0, - "max":250 - }, - "yAxis": { - "disableGrid": false, - "gridType":"dash", - "data":[{ - "min":0, - "max":150 - }] - }, - "legend": { - }, - "extra": { - "bubble": { - "border":2, - "opacity": 0.5, - }, - } + "color": color, + "padding": [15, 15, 0, 15], + "xAxis": { + "disableGrid": false, + "gridType": "dash", + "splitNumber": 5, + "boundaryGap": "justify", + "min": 0, + "max": 250 + }, + "yAxis": { + "disableGrid": false, + "gridType": "dash", + "data": [{ + "min": 0, + "max": 150 + }] + }, + "legend": {}, + "extra": { + "bubble": { + "border": 2, + "opacity": 0.5, + }, + } } } -export default cfu; +export default cfu; \ No newline at end of file diff --git a/pages/nationalPage/rankPage.vue b/pages/nationalPage/rankPage.vue index 7a813ef..522ac80 100644 --- a/pages/nationalPage/rankPage.vue +++ b/pages/nationalPage/rankPage.vue @@ -1,291 +1,755 @@ diff --git a/pages/testPage/index.vue b/pages/testPage/index.vue new file mode 100644 index 0000000..4e839b8 --- /dev/null +++ b/pages/testPage/index.vue @@ -0,0 +1,225 @@ + + + + \ No newline at end of file