diff --git a/pages/index/index.vue b/pages/index/index.vue index a6e46db..1823ab4 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -3620,14 +3620,14 @@ }} 已完成/{{ plan.revenueType === "yi" ? "亿元" : "万元" - }} + }} {{ plan.BudgetYear_Amount ? plan.BudgetYear_Amount : "-" }} 计划/{{ plan.budgetType === "yi" ? "亿元" : "万元" - }} + }} {{ @@ -3945,7 +3945,7 @@ export default { }, data() { const lastDay = this.$util.cutDate(new Date(), "YYYY-MM-DD", -1); - // const lastDay = '2026-01-01' + // const lastDay = '2026-02-02' const nowDay = this.$util.cutDate(new Date(), "YYYY-MM-DD"); // const nowDay = '2026-01-01' return { 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 0d0108b..d5dd03e 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 @@ -240,6 +240,50 @@ let chineseCalendar2025 = [ '正月廿五', ] +// 2026年农历日历 +let chineseCalendar2026 = [ + '腊月十五', + '腊月十六', + '腊月十七', + '腊月十八', + '腊月十九', + '腊月二十', + '腊月廿一', + '腊月廿二', + '北小年', + '南小年', + '腊月廿五', + '腊月廿六', + '腊月廿七', + '腊月廿八', + '除夕', + '春节', + '正月初二', + '正月初三', + '正月初四', + '正月初五', + '正月初六', + '正月初七', + '正月初八', + '正月初九', + '正月初十', + '正月十一', + '正月十二', + '正月十三', + '正月十四', + '正月十五', + '正月十六', + '正月十七', + '正月十八', + '正月十九', + '正月二十', + '正月廿一', + '正月廿二', + '正月廿三', + '正月廿四', + '正月廿五', +] + // 2023年节假日安排表 let festivalObj2023 = { "2023-01-01": "元旦", @@ -279,47 +323,47 @@ const handleRedText = (value) => { //事件转换函数,主要用作格式化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') { + 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') { + if (returnType == 'y-m-d') { return y + '-' + m + '-' + d; } - if (returnType == 'h:m') { + if (returnType == 'h:m') { return h + ':' + minute; } - if (returnType == 'h:m:s') { + if (returnType == 'h:m:s') { return h + ':' + minute + ':' + second; } - return [y, m, d, 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) { + 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) { @@ -349,55 +393,55 @@ const cfu = { "entryCarNumber2": function (item, category, index, opts) { console.log('item', item) console.log('category', category) - console.log('index', index) - console.log('opts', opts) + 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 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) + console.log('data', data) + console.log('day', day) - if (item.name === '23年') { + 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 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:''}` + 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 = "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] - } + 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:''}` + 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 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 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] // 显示具体的日期 @@ -405,24 +449,24 @@ const cfu = { // 显示具体的日期 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年') { + 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?'(清明节)':''}` + 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?'(清明节)':''}` + 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 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 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] // 显示具体的日期 @@ -430,24 +474,24 @@ const cfu = { // 显示具体的日期 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年') { + 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?'(劳动节)':''}` + 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?'(劳动节)':''}` + 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 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 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] // 显示具体的日期 @@ -455,117 +499,119 @@ const cfu = { // 显示具体的日期 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年') { + 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?'(端午节)':''}` + 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?'(端午节)':''}` + return `${realDate}:${data ? getMoney(data / 10000, 2) : ''}万元${index === 1 ? '(端午节)' : ''}` } } else { - let festivalType = opts.series[0].selectFestival + 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 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 (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?'(国庆节)': - ''}` + 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 `${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); - // 先拿到节日类型 - let festival = opts.selectFestival - // 需要添加在显示文字的节日文字 - let otherFestivalTest = '' + console.log('category', category); + console.log('index', index); + console.log('opts', opts); + // 先拿到节日类型 + let festival = opts.selectFestival + // 需要添加在显示文字的节日文字 + let otherFestivalTest = '' // 从opts里面 拿到这一行的详细数据 let detail = opts.series.filter(subItem => subItem.name === item.name)[0] - console.log('detail.realDateList[index]', detail.realDateList[index]); + console.log('detail.realDateList[index]', detail.realDateList[index]); - if (festival === 2) { - // 春节 - let resObj = []; - if (item.name === 2023) { - resObj = chineseCalendar2023 - } else if (item.name === 2024) { - resObj = chineseCalendar2024 - } else if (item.name === 2025) { - resObj = chineseCalendar2025 - } - otherFestivalTest = resObj[index] + if (festival === 2) { + // 春节 + let resObj = []; + if (item.name === 2023) { + resObj = chineseCalendar2023 + } else if (item.name === 2024) { + resObj = chineseCalendar2024 + } else if (item.name === 2025) { + resObj = chineseCalendar2025 + }else if (item.name === 2026) { + resObj = chineseCalendar2026 + } + otherFestivalTest = resObj[index] } else if (festival === 1 || festival === 3 || festival === 4 || festival === 5 || festival === 7 || festival === 8) { - // 非春节和暑期 - let resObj = {} - if (item.name === 2023) { - resObj = festivalObj2023 - } else if (item.name === 2024) { - resObj = festivalObj2024 - } else if (item.name === 2025) { - resObj = festivalObj2025 - } - if (detail.realDateList[index]) { + // 非春节和暑期 + let resObj = { } + if (item.name === 2023) { + resObj = festivalObj2023 + } else if (item.name === 2024) { + resObj = festivalObj2024 + } else if (item.name === 2025) { + resObj = festivalObj2025 + } + if (detail.realDateList[index]) { if (resObj[detail.realDateList[index]]) { - otherFestivalTest = resObj[detail.realDateList[index]] - } + otherFestivalTest = resObj[detail.realDateList[index]] + } } } - // 日期格式老的太长了修改一下显示 - const date = new Date(detail.realDateList[index]) - let y = date.getFullYear() - y = y.toString().slice(2, 4) - let m = date.getMonth() + 1 - if (m < 10) { - m = '0' + m - } - let d = date.getDate() - if (d < 10) { - d = '0' + d - } - let dateText = `${y}.${m}.${d}` + // 日期格式老的太长了修改一下显示 + const date = new Date(detail.realDateList[index]) + let y = date.getFullYear() + y = y.toString().slice(2, 4) + let m = date.getMonth() + 1 + if (m < 10) { + m = '0' + m + } + let d = date.getDate() + if (d < 10) { + d = '0' + d + } + let dateText = `${y}.${m}.${d}` - let add = '' + 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 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) + '%' } - return `${dateText}${otherFestivalTest?`(${otherFestivalTest})`:'' }: ${detail.data[index].toFixed(2)}万元${add?detail.data[index]>0?','+add:'':''}` + return `${dateText}${otherFestivalTest ? `(${otherFestivalTest})` : ''}: ${detail.data[index].toFixed(2)}万元${add ? detail.data[index] > 0 ? ',' + add : '' : ''}` // return item.name // let data = opts.series.filter(subItem=> subItem.name === item.name)[0].real[index] @@ -622,52 +668,52 @@ const cfu = { }, 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 === '车流量') { + 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):''} 辆` + 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):''} 辆` + 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 + 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):''} 元` + 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):''} 元` + 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 + return text } }, homePlace: function (item, category, index, opts) { console.log('item', item) console.log('opts', opts) - if (item.name.split(' ')[0] === '其他') { - let str = '' + 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]}` - } + str = item.name.split(' ')[0] + } else { + str += `,${item.name.split(' ')[0]}` + } } }) } - return item.name + ":" + item.data + '辆'; + return item.name + ":" + item.data + '辆'; }, carTypeTime: function (item, category, index, opts) { if (this.num === 0) { - this.num++ + this.num++ return '日均车辆' + ":" + opts.series[0].valueList[index] + '辆,占比' + item.data + '%'; } else { - this.num = 0 + this.num = 0 return '平均停留' + ":" + item.data + '分钟'; } }, @@ -679,11 +725,11 @@ const cfu = { }, "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) + 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 === '工作日平均') { @@ -795,18 +841,18 @@ const cfu = { }, 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) { + 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", + //这里演示了自定义您的图表类型的option,可以随意命名,之后在组件上 type="demotype" 后,组件会调用这个花括号里的option,如果组件上还存在opts参数,会将demotype与opts中option合并后渲染图表。 + "demotype": { + //我这里把曲线图当做了自定义图表类型,您可以根据需要随意指定类型或配置 + "type": "line", "color": color, "padding": [15, 10, 0, 15], "xAxis": { @@ -814,159 +860,159 @@ const cfu = { }, "yAxis": { "gridType": "dash", - "dashLength": 2, + "dashLength": 2, }, - "legend": {}, + "legend": { }, "extra": { "line": { - "type": "curve", - "width": 2 + "type": "curve", + "width": 2 }, } }, - //下面是自定义配置,请添加项目所需的通用配置 - "pie": { - "type": "pie", + //下面是自定义配置,请添加项目所需的通用配置 + "pie": { + "type": "pie", "color": color, "padding": [5, 5, 5, 5], "extra": { "pie": { - "activeOpacity": 0.5, - "activeRadius": 10, - "offsetAngle": 0, - "labelWidth": 15, - "border": true, - "borderWidth": 3, - "borderColor": "#FFFFFF" + "activeOpacity": 0.5, + "activeRadius": 10, + "offsetAngle": 0, + "labelWidth": 15, + "border": true, + "borderWidth": 3, + "borderColor": "#FFFFFF" }, } }, - "ring": { - "type": "ring", + "ring": { + "type": "ring", "color": color, "padding": [5, 5, 5, 5], "rotate": false, "dataLabel": true, "legend": { "show": true, - "position": "right", - "lineHeight": 25, + "position": "right", + "lineHeight": 25, }, "title": { "name": "收益率", - "fontSize": 15, - "color": "#666666" + "fontSize": 15, + "color": "#666666" }, "subtitle": { "name": "70%", - "fontSize": 25, - "color": "#7cb5ec" + "fontSize": 25, + "color": "#7cb5ec" }, "extra": { "ring": { - "ringWidth": 30, - "activeOpacity": 0.5, - "activeRadius": 10, - "offsetAngle": 0, - "labelWidth": 15, - "border": true, - "borderWidth": 3, - "borderColor": "#FFFFFF" + "ringWidth": 30, + "activeOpacity": 0.5, + "activeRadius": 10, + "offsetAngle": 0, + "labelWidth": 15, + "border": true, + "borderWidth": 3, + "borderColor": "#FFFFFF" }, }, }, - "rose": { - "type": "rose", + "rose": { + "type": "rose", "color": color, "padding": [5, 5, 5, 5], "legend": { "show": true, - "position": "left", - "lineHeight": 25, + "position": "left", + "lineHeight": 25, }, "extra": { "rose": { - "type": "area", - "minRadius": 50, - "activeOpacity": 0.5, - "activeRadius": 10, - "offsetAngle": 0, - "labelWidth": 15, - "border": false, - "borderWidth": 2, - "borderColor": "#FFFFFF" + "type": "area", + "minRadius": 50, + "activeOpacity": 0.5, + "activeRadius": 10, + "offsetAngle": 0, + "labelWidth": 15, + "border": false, + "borderWidth": 2, + "borderColor": "#FFFFFF" }, } }, - "word": { - "type": "word", + "word": { + "type": "word", "color": color, "extra": { "word": { - "type": "normal", - "autoColors": false + "type": "normal", + "autoColors": false } } }, - "funnel": { - "type": "funnel", + "funnel": { + "type": "funnel", "color": color, "padding": [15, 15, 0, 15], "extra": { "funnel": { - "activeOpacity": 0.3, - "activeWidth": 10, - "border": true, - "borderWidth": 2, - "borderColor": "#FFFFFF", - "fillOpacity": 1, - "labelAlign": "right" + "activeOpacity": 0.3, + "activeWidth": 10, + "border": true, + "borderWidth": 2, + "borderColor": "#FFFFFF", + "fillOpacity": 1, + "labelAlign": "right" }, } }, - "map": { - "type": "map", + "map": { + "type": "map", "color": color, "padding": [0, 0, 0, 0], "dataLabel": true, "extra": { "map": { - "border": true, - "borderWidth": 1, - "borderColor": "#666666", - "fillOpacity": 0.6, - "activeBorderColor": "#F04864", - "activeFillColor": "#FACC14", - "activeFillOpacity": 1 + "border": true, + "borderWidth": 1, + "borderColor": "#666666", + "fillOpacity": 0.6, + "activeBorderColor": "#F04864", + "activeFillColor": "#FACC14", + "activeFillOpacity": 1 }, } }, - "arcbar": { - "type": "arcbar", + "arcbar": { + "type": "arcbar", "color": color, "title": { "name": "百分比", - "fontSize": 25, - "color": "#00FF00" + "fontSize": 25, + "color": "#00FF00" }, "subtitle": { "name": "默认标题", - "fontSize": 15, - "color": "#666666" + "fontSize": 15, + "color": "#666666" }, "extra": { "arcbar": { - "type": "default", - "width": 12, - "backgroundColor": "#E9E9E9", - "startAngle": 0.75, - "endAngle": 0.25, - "gap": 2 + "type": "default", + "width": 12, + "backgroundColor": "#E9E9E9", + "startAngle": 0.75, + "endAngle": 0.25, + "gap": 2 } } }, - "line": { - "type": "line", + "line": { + "type": "line", "color": color, "padding": [15, 10, 0, 15], "xAxis": { @@ -974,72 +1020,72 @@ const cfu = { }, "yAxis": { "gridType": "dash", - "dashLength": 2, + "dashLength": 2, }, - "legend": {}, + "legend": { }, "extra": { "line": { - "type": "straight", - "width": 2, - "activeType": "hollow" + "type": "straight", + "width": 2, + "activeType": "hollow" }, } }, - "tline": { - "type": "line", + "tline": { + "type": "line", "color": color, "padding": [15, 10, 0, 15], "xAxis": { "disableGrid": false, - "boundaryGap": "justify", + "boundaryGap": "justify", }, "yAxis": { "gridType": "dash", - "dashLength": 2, - "data": [{ - "min": 0, - "max": 80 + "dashLength": 2, + "data": [{ + "min": 0, + "max": 80 }] }, - "legend": {}, + "legend": { }, "extra": { "line": { - "type": "curve", - "width": 2, - "activeType": "hollow" + "type": "curve", + "width": 2, + "activeType": "hollow" }, } }, - "tarea": { - "type": "area", + "tarea": { + "type": "area", "color": color, "padding": [15, 10, 0, 15], "xAxis": { "disableGrid": true, - "boundaryGap": "justify", + "boundaryGap": "justify", }, "yAxis": { "gridType": "dash", - "dashLength": 2, - "data": [{ - "min": 0, - "max": 80 + "dashLength": 2, + "data": [{ + "min": 0, + "max": 80 }] }, - "legend": {}, + "legend": { }, "extra": { "area": { - "type": "curve", - "opacity": 0.2, - "addLine": true, - "width": 2, - "gradient": true, - "activeType": "hollow" + "type": "curve", + "opacity": 0.2, + "addLine": true, + "width": 2, + "gradient": true, + "activeType": "hollow" }, } }, - "column": { - "type": "column", + "column": { + "type": "column", "color": color, "padding": [15, 15, 0, 5], "xAxis": { @@ -1047,21 +1093,21 @@ const cfu = { }, "yAxis": { "data": [{ - "min": 0 + "min": 0 }] }, - "legend": {}, + "legend": { }, "extra": { "column": { - "type": "group", - "width": 30, - "activeBgColor": "#000000", - "activeBgOpacity": 0.08 + "type": "group", + "width": 30, + "activeBgColor": "#000000", + "activeBgOpacity": 0.08 }, } }, - "mount": { - "type": "mount", + "mount": { + "type": "mount", "color": color, "padding": [15, 15, 0, 5], "xAxis": { @@ -1069,42 +1115,42 @@ const cfu = { }, "yAxis": { "data": [{ - "min": 0 + "min": 0 }] }, - "legend": {}, + "legend": { }, "extra": { "mount": { - "type": "mount", - "widthRatio": 1.5, + "type": "mount", + "widthRatio": 1.5, }, } }, - "bar": { - "type": "bar", + "bar": { + "type": "bar", "color": color, "padding": [15, 30, 0, 5], "xAxis": { "boundaryGap": "justify", - "disableGrid": false, - "min": 0, - "axisLine": false + "disableGrid": false, + "min": 0, + "axisLine": false }, - "yAxis": {}, - "legend": {}, + "yAxis": { }, + "legend": { }, "extra": { "bar": { - "type": "group", - "width": 30, - "meterBorde": 1, - "meterFillColor": "#FFFFFF", - "activeBgColor": "#000000", - "activeBgOpacity": 0.08 + "type": "group", + "width": 30, + "meterBorde": 1, + "meterFillColor": "#FFFFFF", + "activeBgColor": "#000000", + "activeBgOpacity": 0.08 }, } }, - "area": { - "type": "area", + "area": { + "type": "area", "color": color, "padding": [15, 15, 0, 15], "xAxis": { @@ -1112,83 +1158,83 @@ const cfu = { }, "yAxis": { "gridType": "dash", - "dashLength": 2, + "dashLength": 2, }, - "legend": {}, + "legend": { }, "extra": { "area": { - "type": "straight", - "opacity": 0.2, - "addLine": true, - "width": 2, - "gradient": false, - "activeType": "hollow" + "type": "straight", + "opacity": 0.2, + "addLine": true, + "width": 2, + "gradient": false, + "activeType": "hollow" }, } }, - "radar": { - "type": "radar", + "radar": { + "type": "radar", "color": color, "padding": [5, 5, 5, 5], "dataLabel": false, "legend": { "show": true, - "position": "right", - "lineHeight": 25, + "position": "right", + "lineHeight": 25, }, "extra": { "radar": { - "gridType": "radar", - "gridColor": "#CCCCCC", - "gridCount": 3, - "opacity": 0.2, - "max": 200, - "labelShow": true + "gridType": "radar", + "gridColor": "#CCCCCC", + "gridCount": 3, + "opacity": 0.2, + "max": 200, + "labelShow": true }, } }, - "gauge": { - "type": "gauge", + "gauge": { + "type": "gauge", "color": color, "title": { "name": "66Km/H", - "fontSize": 25, - "color": "#2fc25b", - "offsetY": 50 + "fontSize": 25, + "color": "#2fc25b", + "offsetY": 50 }, "subtitle": { "name": "实时速度", - "fontSize": 15, - "color": "#1890ff", - "offsetY": -50 + "fontSize": 15, + "color": "#1890ff", + "offsetY": -50 }, "extra": { "gauge": { - "type": "default", - "width": 30, - "labelColor": "#666666", - "startAngle": 0.75, - "endAngle": 0.25, - "startNumber": 0, - "endNumber": 100, - "labelFormat": "", - "splitLine": { - "fixRadius": 0, - "splitNumber": 10, - "width": 30, - "color": "#FFFFFF", - "childNumber": 5, - "childWidth": 12 + "type": "default", + "width": 30, + "labelColor": "#666666", + "startAngle": 0.75, + "endAngle": 0.25, + "startNumber": 0, + "endNumber": 100, + "labelFormat": "", + "splitLine": { + "fixRadius": 0, + "splitNumber": 10, + "width": 30, + "color": "#FFFFFF", + "childNumber": 5, + "childWidth": 12 }, - "pointer": { - "width": 24, - "color": "auto" + "pointer": { + "width": 24, + "color": "auto" } } } }, - "candle": { - "type": "candle", + "candle": { + "type": "candle", "color": color, "padding": [15, 15, 0, 15], "enableScroll": true, @@ -1196,52 +1242,52 @@ const cfu = { "dataLabel": false, "xAxis": { "labelCount": 4, - "itemCount": 40, - "disableGrid": true, - "gridColor": "#CCCCCC", - "gridType": "solid", - "dashLength": 4, - "scrollShow": true, - "scrollAlign": "left", - "scrollColor": "#A6A6A6", - "scrollBackgroundColor": "#EFEBEF" + "itemCount": 40, + "disableGrid": true, + "gridColor": "#CCCCCC", + "gridType": "solid", + "dashLength": 4, + "scrollShow": true, + "scrollAlign": "left", + "scrollColor": "#A6A6A6", + "scrollBackgroundColor": "#EFEBEF" }, - "yAxis": {}, - "legend": {}, + "yAxis": { }, + "legend": { }, "extra": { "candle": { - "color": { - "upLine": "#f04864", - "upFill": "#f04864", - "downLine": "#2fc25b", - "downFill": "#2fc25b" + "color": { + "upLine": "#f04864", + "upFill": "#f04864", + "downLine": "#2fc25b", + "downFill": "#2fc25b" }, - "average": { - "show": true, - "name": ["MA5", "MA10", "MA30"], - "day": [5, 10, 20], - "color": ["#1890ff", "#2fc25b", "#facc14"] + "average": { + "show": true, + "name": ["MA5", "MA10", "MA30"], + "day": [5, 10, 20], + "color": ["#1890ff", "#2fc25b", "#facc14"] } }, - "markLine": { - "type": "dash", - "dashLength": 5, - "data": [{ - "value": 2150, - "lineColor": "#f04864", - "showLabel": true + "markLine": { + "type": "dash", + "dashLength": 5, + "data": [{ + "value": 2150, + "lineColor": "#f04864", + "showLabel": true }, - { - "value": 2350, - "lineColor": "#f04864", - "showLabel": true + { + "value": 2350, + "lineColor": "#f04864", + "showLabel": true } - ] + ] } } }, - "mix": { - "type": "mix", + "mix": { + "type": "mix", "color": color, "padding": [15, 15, 0, 15], "xAxis": { @@ -1249,73 +1295,73 @@ const cfu = { }, "yAxis": { "disabled": false, - "disableGrid": false, - "splitNumber": 5, - "gridType": "dash", - "dashLength": 4, - "gridColor": "#CCCCCC", - "padding": 10, - "showTitle": true, - "data": [] + "disableGrid": false, + "splitNumber": 5, + "gridType": "dash", + "dashLength": 4, + "gridColor": "#CCCCCC", + "padding": 10, + "showTitle": true, + "data": [] }, - "legend": {}, + "legend": { }, "extra": { "mix": { - "column": { - "width": 20 + "column": { + "width": 20 } }, } }, - "scatter": { - "type": "scatter", + "scatter": { + "type": "scatter", "color": color, "padding": [15, 15, 0, 15], "dataLabel": false, "xAxis": { "disableGrid": false, - "gridType": "dash", - "splitNumber": 5, - "boundaryGap": "justify", - "min": 0 + "gridType": "dash", + "splitNumber": 5, + "boundaryGap": "justify", + "min": 0 }, "yAxis": { "disableGrid": false, - "gridType": "dash", + "gridType": "dash", }, - "legend": {}, + "legend": { }, "extra": { - "scatter": {}, + "scatter": { }, } }, - "bubble": { - "type": "bubble", + "bubble": { + "type": "bubble", "color": color, "padding": [15, 15, 0, 15], "xAxis": { "disableGrid": false, - "gridType": "dash", - "splitNumber": 5, - "boundaryGap": "justify", - "min": 0, - "max": 250 + "gridType": "dash", + "splitNumber": 5, + "boundaryGap": "justify", + "min": 0, + "max": 250 }, "yAxis": { "disableGrid": false, - "gridType": "dash", - "data": [{ - "min": 0, - "max": 150 + "gridType": "dash", + "data": [{ + "min": 0, + "max": 150 }] }, - "legend": {}, + "legend": { }, "extra": { "bubble": { - "border": 2, - "opacity": 0.5, + "border": 2, + "opacity": 0.5, }, } } } -export default cfu; \ No newline at end of file + export default cfu; \ No newline at end of file diff --git a/pages/nationalPage/springTravel.vue b/pages/nationalPage/springTravel.vue index c9fca6b..4503983 100644 --- a/pages/nationalPage/springTravel.vue +++ b/pages/nationalPage/springTravel.vue @@ -3426,7 +3426,7 @@ export default { // 拿到计算数据的标准日 this.lastDay = uni.getStorageSync("lastDay"); - // this.lastDay = '2026-09-30'; + // this.lastDay = '2026-02-02'; const currentDate = new Date(this.lastDay); let currentY = currentDate.getFullYear(); // 年 let currentM = currentDate.getMonth() + 1; // 月