Browse Source

Merge branch 'master' into 'master'

优化图形日期信息

See merge request lighter/vue-intergration-platform!37
huangshuhua 2 years ago
parent
commit
daefd722e4

+ 1 - 0
src/components/fullScreen/fullPage/FullScreenThirdPage.vue

@@ -193,6 +193,7 @@ header.el-dialog__header {
                 /*文字填充色为透明*/
                 -webkit-text-fill-color: transparent;
                 -webkit-background-clip: text;
+                background-clip: text;
                 /*背景剪裁为文字,只将文字显示为背景*/
                 background-size: 200% 100%;
                 /*背景图片向水平方向扩大一倍,这样background-position才有移动与变化的空间*/

+ 2 - 2
src/components/fullScreen/secondPage/roseChart.vue

@@ -92,9 +92,9 @@ watch(() => props.roseZyjc, () => {
                             // formatter: '{name} {value} ({percent}%)',
                             formatter: function (param: configType) {
                                 if(param.name === qt.name){
-                                    return qt.name + ': ' + qt.value + ' ' + ((qt.value / sum) * 100).toFixed(2) + '%'
+                                    return qt.name + ': ' + qt.value + props.roseZyjc.unit + ' ' + ((qt.value / sum) * 100).toFixed(2) + '%'
                                 } else {
-                                    return param.name + ': ' + (param.value - number) + ' ' + (((param.value - number) / sum) * 100).toFixed(2) + '%'
+                                    return param.name + ': ' + (param.value - number) + props.roseZyjc.unit + ' ' + (((param.value - number) / sum) * 100).toFixed(2) + '%'
                                 }
                             },
                             labelLineEndLength: 20,

+ 12 - 3
src/data/shortcuts.js

@@ -161,9 +161,18 @@ export const seltYearAndNowLast = [
     {
         text: '上一个月',
         value: (() => {
-            const start = moment(moment().month(moment().month() - 1).startOf('month').valueOf()).format('YYYY-MM-DD');
-            const end = moment(moment().month(moment().month() - 1).endOf('month').valueOf()).format('YYYY-MM-DD');
-            return [start, end]
+            const nowDate = new Date()
+            const month = nowDate.getMonth()
+            // 如果是现在1月份,就取现在1月份的时间,否则取上一个月的时间
+            if (month === 1) {
+                const start = nowDate.getFullYear() + "-01-01";
+                const end = nowDate.getFullYear() + "-01-31";
+                return [start, end]
+            } else {
+                const start = moment(moment().month(moment().month() - 1).startOf('month').valueOf()).format('YYYY-MM-DD');
+                const end = moment(moment().month(moment().month() - 1).endOf('month').valueOf()).format('YYYY-MM-DD');
+                return [start, end]
+            }
         })(),
     },
 ]