Merge branch 'master' of https://gitee.com/MTrun/big-screen-vue-datav into development

This commit is contained in:
ldz
2020-10-19 10:48:52 +08:00
15 changed files with 64 additions and 90 deletions
@@ -258,9 +258,6 @@ export default {
};
this.chart.setOption(option);
}
},
destroyed() {
window.onresize = null;
}
};
</script>
@@ -393,12 +393,8 @@ export default {
}
]
};
this.chart.setOption(option);
}
},
destroyed() {
window.onresize = null;
}
};
</script>
@@ -94,9 +94,6 @@ export default {
};
this.chart.setOption(option);
}
},
destroyed() {
window.onresize = null;
}
};
</script>
@@ -192,9 +192,6 @@ export default {
};
this.chart.setOption(option);
}
},
destroyed() {
window.onresize = null;
}
};
</script>
@@ -153,9 +153,6 @@ export default {
};
this.chart.setOption(option);
}
},
destroyed() {
window.onresize = null;
}
};
</script>
+29 -40
View File
@@ -1,35 +1,16 @@
export function debounce(func, wait, immediate) {
let timeout, args, context, timestamp, result;
const later = function() {
// 据上一次触发时间间隔
const last = +new Date() - timestamp;
// 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
if (last < wait && last > 0) {
timeout = setTimeout(later, wait - last);
} else {
timeout = null;
// 如果设定为immediate===true,因为开始边界已经调用过了此处无需调用
if (!immediate) {
result = func.apply(context, args);
if (!timeout) context = args = null;
}
}
};
return function(...args) {
context = this;
timestamp = +new Date();
const callNow = immediate && !timeout;
// 如果延时不存在,重新设定延时
if (!timeout) timeout = setTimeout(later, wait);
if (callNow) {
result = func.apply(context, args);
context = args = null;
}
return result;
/**
* @param {Function} fn 函数
* @param {Number} delay 延迟时间
*/
export function debounce(fn, delay) {
var timer;
return function () {
var context = this;
var args = arguments;
clearTimeout(timer);
timer = setTimeout(function () {
fn.apply(context, args);
}, delay);
};
}
@@ -38,9 +19,9 @@ export function debounce(func, wait, immediate) {
* @param {String} fmt 需要转换的格式 如 yyyy-MM-dd、yyyy-MM-dd HH:mm:ss
*/
export function formatTime(time, fmt) {
if (!time) return ''
if (!time) return '';
else {
const date = new Date(time)
const date = new Date(time);
const o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
@@ -48,15 +29,23 @@ export function formatTime(time, fmt) {
'm+': date.getMinutes(),
's+': date.getSeconds(),
'q+': Math.floor((date.getMonth() + 3) / 3),
'S': date.getMilliseconds()
}
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length))
S: date.getMilliseconds(),
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(
RegExp.$1,
(date.getFullYear() + '').substr(4 - RegExp.$1.length)
);
for (const k in o) {
if (new RegExp('(' + k + ')').test(fmt)) {
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : ((
'00' + o[k]).substr(('' + o[k]).length)))
fmt = fmt.replace(
RegExp.$1,
RegExp.$1.length === 1
? o[k]
: ('00' + o[k]).substr(('' + o[k]).length)
);
}
}
return fmt
return fmt;
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
// 混入代码 resize-mixins.js
import { debounce } from '@/utils/index';
import { debounce } from '@/utils';
const resizeChartMethod = '$__resizeChartMethod';
export default {
+3 -3
View File
@@ -10,20 +10,20 @@
</div>
</div>
<div>
<bottomLeftChart />
<BottomLeftChart />
</div>
</div>
</div>
</template>
<script>
import bottomLeftChart from "@/components/echart/bottom/bottomLeftChart";
import BottomLeftChart from "@/components/echart/bottom/bottomLeftChart";
export default {
data() {
return {};
},
components: {
bottomLeftChart
BottomLeftChart
},
mounted() {},
methods: {}
+3 -3
View File
@@ -13,20 +13,20 @@
</div>
</div>
<div>
<bottomRightChart />
<BottomRightChart />
</div>
</div>
</div>
</template>
<script>
import bottomRightChart from "@/components/echart/bottom/bottomRightChart";
import BottomRightChart from "@/components/echart/bottom/bottomRightChart";
export default {
data() {
return {};
},
components: {
bottomRightChart
BottomRightChart
},
mounted() {},
methods: {}
+5 -5
View File
@@ -19,11 +19,11 @@
<div class="percent">
<div class="item bg-color-black">
<span>今日任务通过率</span>
<centerChart :id="rate[0].id" :tips="rate[0].tips" :colorObj="rate[0].colorData" />
<CenterChart :id="rate[0].id" :tips="rate[0].tips" :colorObj="rate[0].colorData" />
</div>
<div class="item bg-color-black">
<span>今日任务达标率</span>
<centerChart :id="rate[1].id" :tips="rate[1].tips" :colorObj="rate[1].colorData" />
<CenterChart :id="rate[1].id" :tips="rate[1].tips" :colorObj="rate[1].colorData" />
</div>
<div class="water">
<dv-water-level-pond :config="water" style="height: 1.5rem" />
@@ -34,7 +34,7 @@
</template>
<script>
import centerChart from "@/components/echart/center/centerChartRate";
import CenterChart from "@/components/echart/center/centerChartRate";
export default {
data () {
@@ -133,7 +133,7 @@ export default {
},
],
carousel: "single",
unit: "份"
unit: "人"
},
water: {
data: [24, 45],
@@ -175,7 +175,7 @@ export default {
};
},
components: {
centerChart
CenterChart
// centerChart1,
// centerChart2
}
+3 -3
View File
@@ -11,7 +11,7 @@
</div>
</div>
<div class="d-flex jc-center">
<centreLeft1Chart />
<CentreLeft1Chart />
</div>
<!-- 4个主要的数据 -->
<div class="bottom-data">
@@ -31,7 +31,7 @@
</template>
<script>
import centreLeft1Chart from "@/components/echart/centerLeft2/centreLeft1Chart";
import CentreLeft1Chart from "@/components/echart/centerLeft/centreLeft1Chart";
export default {
data() {
return {
@@ -100,7 +100,7 @@ export default {
};
},
components: {
centreLeft1Chart
CentreLeft1Chart
},
mounted() {
this.changeTiming();
+3 -3
View File
@@ -11,20 +11,20 @@
</div>
</div>
<div class="d-flex jc-center">
<centreLeft2Chart />
<CentreLeft2Chart />
</div>
</div>
</div>
</template>
<script>
import centreLeft2Chart from "@/components/echart/centerLeft2/centreLeft2Chart";
import CentreLeft2Chart from "@/components/echart/centerLeft/centreLeft2Chart";
export default {
data() {
return {};
},
components: {
centreLeft2Chart
CentreLeft2Chart
},
mounted() {},
methods: {}
+2 -2
View File
@@ -10,14 +10,14 @@
<div class="d-flex jc-center body-box" style=" margin-top: 0;">
<dv-capsule-chart :config="config" style="width: 100%;height:2rem" />
<!-- ---------------------------------------- -->
<centreRight2Chart1></centreRight2Chart1>
<centreRight2Chart1 />
</div>
</div>
</div>
</template>
<script>
import centreRight2Chart1 from "@/components/echart/centreRight2/centreRight2Chart1";
import centreRight2Chart1 from "@/components/echart/centerRight/centerRight2Chart";
export default {
data() {