123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- // 常规列表混入
- export default {
- data() {
- return {
- resizeTime: true,
- windowWidth: 0,
- isVs3D: false,
- distance: 300, // 3D饼图大小配置
- isVsTab: false,
- leftBtn: true,
- rightBtn: true,
- }
- },
- watch: {
- '$store.state.typeTime' (val) {
- console.log(val)
- this.getData && this.getData(val)
- },
- '$store.state.timeList' (val) {
- console.log(val)
- this.getData && this.getData(val)
- }
- },
- mounted() {
- // window.addEventListener("resize", this.resizeTimeActions);
- },
- methods: {
- resizeTimeActions(list) {
- console.log(this.resizeTime)
- if (!this.resizeTime) return;
- console.log(list)
- this.resizeTime = false
- setTimeout(() => {
- list.forEach(element => {
- console.log(element)
- element && element.resize()
- });
- this.resizeTime = true
- this.windowWidth = document.documentElement.clientWidth + document.documentElement.clientHeight
- }, 0);
- },
- vsClick(val) {
- this[val] = !this[val]
- if (val === 'isVs3D') {
- if (this.isVs3D) {
- this.$nextTick(() => {
- // this.distance = 200
- this.$refs.pieThreeD1 && this.$refs.pieThreeD1.resize();
- this.$refs.pieThreeD2 && this.$refs.pieThreeD2.resize();
- })
- } else {
- this.$nextTick(() => {
- // this.distance = 150
- this.$refs.pieThreeD1 && this.$refs.pieThreeD1.resize();
- this.$refs.pieThreeD2 && this.$refs.pieThreeD2.resize();
- })
- }
- }
- },
- leftBtnClick() {
- this.leftBtn = !this.leftBtn
- },
- rightBtnClick() {
- this.rightBtn = !this.rightBtn
- }
- },
- unmount() {
- window.removeEventListener("resize", this.resizeTimeActions, true);
- },
- };
|