diff --git a/src/components/_G2/charts/Column/1.vue b/src/components/_G2/charts/Column/1.vue deleted file mode 100644 index 7dcdbd2f..00000000 --- a/src/components/_G2/charts/Column/1.vue +++ /dev/null @@ -1,42 +0,0 @@ - - - diff --git a/src/components/_G2/charts/Line/1.vue b/src/components/_G2/charts/Line/1.vue deleted file mode 100644 index 1596f040..00000000 --- a/src/components/_G2/charts/Line/1.vue +++ /dev/null @@ -1,54 +0,0 @@ - - - diff --git a/src/components/_G2/charts/Pie/1.vue b/src/components/_G2/charts/Pie/1.vue deleted file mode 100644 index e1f06770..00000000 --- a/src/components/_G2/charts/Pie/1.vue +++ /dev/null @@ -1,81 +0,0 @@ - - - diff --git a/src/components/_G2/index.js b/src/components/_G2/index.js deleted file mode 100644 index b7a7aab3..00000000 --- a/src/components/_G2/index.js +++ /dev/null @@ -1,5 +0,0 @@ -import Vue from 'vue' - -Vue.component('G2Line1', resolve => { require(['@/components/G2/charts/Line/1.vue'], resolve) }) -Vue.component('G2Pie1', resolve => { require(['@/components/G2/charts/Pie/1.vue'], resolve) }) -Vue.component('G2Column1', resolve => { require(['@/components/G2/charts/Column/1.vue'], resolve) }) diff --git a/src/components/_G2/mixins/G2.js b/src/components/_G2/mixins/G2.js deleted file mode 100644 index 83831a05..00000000 --- a/src/components/_G2/mixins/G2.js +++ /dev/null @@ -1,79 +0,0 @@ -import G2 from '@antv/g2' -import * as DataSet from '@antv/data-set' - -// 关闭 G2 的体验改进计划打点请求 -G2.track(false) - -export default { - props: { - // 图表数据 - data: { - type: Array, - required: false, - default: () => [] - }, - // [图表设置项] 高度 - height: { - type: Number, - required: false, - default: 300 - }, - // [图表设置项] 开启自动填充父元素高度 - autoHeight: { - type: Boolean, - required: false, - default: false - }, - // [图表设置项] 自动宽度 - forceFit: { - type: Boolean, - required: false, - default: true - } - }, - data () { - return { - // 在页面中不需要再引入 直接使用 this.G2 - G2, - // 数据处理模块 - DataSet, - // 图表实例 - chart: null, - // 在组件 mounted 后立即初始化图表 - autoInit: true, - // [图表设置项] padding - padding: [40, 40, 40, 40] - } - }, - mounted () { - // 如果设置了在 mounted 后自动初始化 就在这里初始化 - if (this.autoInit) { - setTimeout(() => { - this.initHandler() - }, 0) - } - }, - watch: { - // 数据改变 - data () { - this.changeData() - } - }, - methods: { - // 创建图表对象 - creatChart () { - this.chart = new this.G2.Chart({ - container: this.$refs.chart, - forceFit: this.forceFit, - height: this.G2.DomUtil.getHeight(this.$refs.chart), - padding: this.padding - }) - }, - // 重绘大小 - resize (width, height) { - if (this.chart) { - this.chart.changeSize(width || this.G2.DomUtil.getWidth(this.$refs.chart), height || this.G2.DomUtil.getHeight(this.$refs.chart)) - } - } - } -} diff --git a/src/pages/demo/chart/_index/index.vue b/src/pages/demo/chart/_index/index.vue deleted file mode 100644 index 8526efe3..00000000 --- a/src/pages/demo/chart/_index/index.vue +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - diff --git a/src/pages/demo/chart/_index/mixins/chart.js b/src/pages/demo/chart/_index/mixins/chart.js deleted file mode 100644 index 5ec7f3f2..00000000 --- a/src/pages/demo/chart/_index/mixins/chart.js +++ /dev/null @@ -1,34 +0,0 @@ -export default { - data () { - return { - // 数据 - chartData: { - G2Line1: [], - G2Pie1: [], - G2Column1: [] - } - } - }, - mounted () { - // 请求图表数据 - this.syncData() - }, - methods: { - // 请求图表数据 - syncData () { - const api = [ - {url: '/api/chart/G2Line', data: {code: 1}}, - {url: '/api/chart/G2Pie', data: {code: 1}}, - {url: '/api/chart/G2Column', data: {code: 1}} - ] - this.$axios.all(api.map(e => this.$axios.post(e.url, e.data))) - .then(this.$axios.spread((G2Line1, G2Pie1, G2Column1) => { - this.chartData = { - G2Line1, - G2Pie1, - G2Column1 - } - })) - } - } -} diff --git a/src/pages/demo/chart/_index/mixins/layout.js b/src/pages/demo/chart/_index/mixins/layout.js deleted file mode 100644 index 12d5e68c..00000000 --- a/src/pages/demo/chart/_index/mixins/layout.js +++ /dev/null @@ -1,42 +0,0 @@ -export default { - data () { - return { - layout: { - layout: [ - {'x': 0, 'y': 0, 'w': 8, 'h': 9, 'i': '0'}, - {'x': 8, 'y': 0, 'w': 4, 'h': 9, 'i': '1'}, - {'x': 0, 'y': 9, 'w': 4, 'h': 7, 'i': '2'} - ], - colNum: 12, - rowHeight: 30, - isDraggable: true, - isResizable: true, - isMirrored: false, - verticalCompact: true, - margin: [10, 10], - useCssTransforms: true - } - } - }, - methods: { - layoutUpdatedHandler (newLayout) { - console.group('layoutUpdatedHandler') - newLayout.forEach(e => { - console.log(`{'x': ${e.x}, 'y': ${e.y}, 'w': ${e.w}, 'h': ${e.h}, 'i': '${e.i}'},`) - }) - console.groupEnd() - }, - // 改变尺寸 - resizeHandler (name) { - this.$nextTick(() => { - this.$refs[name].resize() - }) - }, - // 改变尺寸完成 - resizedHandler (name) { - this.$nextTick(() => { - this.$refs[name].resize() - }) - } - } -} diff --git a/src/pages/demo/chart/_index/style.scss b/src/pages/demo/chart/_index/style.scss deleted file mode 100644 index c3e9bd6b..00000000 --- a/src/pages/demo/chart/_index/style.scss +++ /dev/null @@ -1,28 +0,0 @@ -@import '~@/assets/style/public.scss'; -.demo-chart-index { - .vue-grid-layout { - margin: -10px; - .el-card { - @extend %unable-select; - height: 100%; - .el-card__body { - height: 100%; - padding: 0px; - } - // 有header的卡片的body高度需要减去header - &.header-in { - .el-card__body { - height: calc(100% - 59px); - } - } - } - .vue-resizable-handle { - bottom: 6px; - right: 6px; - opacity: .3; - &:hover{ - opacity: 1; - } - } - } -} \ No newline at end of file