xs-common-plugins 1.1.2 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/README.md +37 -0
  2. package/package.json +1 -1
  3. package/src/App.vue +11 -11
  4. package/src/common/common.js +143 -14
  5. package/src/common/createMenuId.js +7 -7
  6. package/src/common/uploadImgToBase64.js +12 -12
  7. package/src/common/utils.js +95 -95
  8. package/src/components/Breadcrumb/index.vue +81 -81
  9. package/src/components/Col_TableCell/data.js +4 -4
  10. package/src/components/Col_TableCell/index.scss +77 -77
  11. package/src/components/Col_TableCell/index.vue +43 -43
  12. package/src/components/Col_TableCell/methods.js +19 -19
  13. package/src/components/Hamburger/index.vue +44 -44
  14. package/src/components/ReportCmp/data.js +3 -3
  15. package/src/components/ReportCmp/index.scss +29 -29
  16. package/src/components/ReportCmp/index.vue +2 -2
  17. package/src/components/ReportCmp/methods.js +30 -30
  18. package/src/components/Search/cascader/data.js +3 -3
  19. package/src/components/Search/cascader/index.scss +17 -17
  20. package/src/components/Search/cascader/index.vue +96 -96
  21. package/src/components/Search/cascader/methods.js +41 -41
  22. package/src/components/Search/data.js +5 -5
  23. package/src/components/Search/hk_cascader/index.vue +104 -104
  24. package/src/components/Search/hk_cascader_qudao/index.vue +94 -94
  25. package/src/components/Search/methods.js +86 -86
  26. package/src/components/Search/product_option/data.js +3 -3
  27. package/src/components/Search/product_option/index.scss +68 -68
  28. package/src/components/Search/product_option/index.vue +419 -419
  29. package/src/components/Search/product_option/methods.js +46 -46
  30. package/src/components/Search/select/data.js +3 -3
  31. package/src/components/Search/select/index.scss +2 -2
  32. package/src/components/Search/select/index.vue +114 -114
  33. package/src/components/Search/select/methods.js +51 -51
  34. package/src/components/Search_filter/data.js +5 -5
  35. package/src/components/Search_filter/index.vue +88 -88
  36. package/src/components/Search_filter/methods.js +43 -43
  37. package/src/components/TableCmp/data.js +3 -3
  38. package/src/components/TableCmp/index.scss +22 -22
  39. package/src/components/TableCmp/index.vue +98 -98
  40. package/src/components/TableCmp/methods.js +35 -35
  41. package/src/components/home/BarChart.vue +118 -118
  42. package/src/components/home/LineChart.vue +146 -146
  43. package/src/components/home/Panel.vue +135 -135
  44. package/src/components/home/PanelGroup.vue +146 -146
  45. package/src/components/home/PieChart.vue +81 -81
  46. package/src/components/home/RaddarChart.vue +119 -119
  47. package/src/components/home/TabLayout.vue +88 -88
  48. package/src/components/home/TableList.vue +158 -158
  49. package/src/components/home/Teng.vue +248 -248
  50. package/src/components/home/TransactionTable.vue +49 -49
  51. package/src/components/home/mixins/resize.js +55 -55
  52. package/src/components/im/methods.js +25 -25
  53. package/src/components/image-singleUpload/data.js +3 -3
  54. package/src/components/image-singleUpload/index.scss +26 -26
  55. package/src/components/image-singleUpload/index.vue +56 -56
  56. package/src/components/image-singleUpload/methods.js +30 -30
  57. package/src/components/image-upload/data.js +7 -7
  58. package/src/components/image-upload/index.vue +41 -41
  59. package/src/components/image-upload/methods.js +80 -80
  60. package/src/components/multiple-image-upload/data.js +11 -11
  61. package/src/components/multiple-image-upload/index.scss +8 -8
  62. package/src/components/multiple-image-upload/index.vue +63 -63
  63. package/src/components/multiple-image-upload/methods.js +45 -45
  64. package/src/components/pro-upload/data.js +3 -3
  65. package/src/components/pro-upload/index.scss +4 -4
  66. package/src/components/pro-upload/index.vue +89 -89
  67. package/src/components/pro-upload/methods.js +86 -86
  68. package/src/components/report_set/index.scss +44 -44
  69. package/src/components/report_set/index.vue +153 -153
  70. package/src/components/search-page/src/index.scss +5 -5
  71. package/src/components/search-page/src/index.vue +76 -76
  72. package/src/components/search-page/src/methods.js +36 -36
  73. package/src/mixin/dialog.js +31 -31
  74. package/src/mixin/dlg.js +46 -46
  75. package/src/mixin/newDialog.js +19 -19
  76. package/src/mixin/report.js +82 -82
  77. package/src/mixin/table.js +93 -93
  78. package/src/mixin/tableCell/colTableCell_analysis.js +103 -103
  79. package/src/mixin/upload.js +22 -22
  80. package/src/mixin/vmodel.js +26 -26
  81. package/src/plugins/im/components/conversation-list/index.css +91 -91
  82. package/src/plugins/im/components/conversation-list/index.json +3 -3
  83. package/src/plugins/im/components/conversation-list/index.vue +89 -89
  84. package/src/plugins/im/components/loading/loading.css +69 -69
  85. package/src/plugins/im/components/loading/loading.json +3 -3
  86. package/src/plugins/im/components/loading/loading.vue +14 -14
  87. package/src/plugins/im/components/msg-image/index.json +3 -3
  88. package/src/plugins/im/components/msg-text/index.json +3 -3
  89. package/src/plugins/im/components/msg-text/index.vue +24 -24
  90. package/src/plugins/im/im-plug-in/Protobuf-2.3.7.min.js +1 -1
  91. package/src/plugins/im/im-plug-in/RongCallLib-3.1.5.min.js +74 -74
  92. package/src/plugins/im/im-plug-in/RongIMLib-4.1.0.js +17420 -17420
  93. package/src/plugins/im/im-plug-in/init.js +216 -216
  94. package/src/plugins/im/im-plug-in/qiniu.js +266 -266
  95. package/src/plugins/im/im-plug-in/send-data.js +431 -431
  96. package/src/plugins/im/im-plug-in/upload.js +232 -232
  97. package/src/plugins/im/lib/RongIMEmoji-2.2.6.js +332 -332
  98. package/src/plugins/im/lib/RongIMLib-3.0.7.2-dev.js +11635 -11635
  99. package/src/plugins/im/lib/RongIMLib-3.0.7.2-dev.min.js +6 -6
  100. package/src/plugins/im/utils/underscore-1.8.3.js +1531 -1531
  101. package/src/plugins/im/utils/utils.js +149 -149
  102. package/src/plugins/row-col-cmp/colCmp/data.js +3 -3
  103. package/src/plugins/row-col-cmp/colCmp/index.scss +50 -50
  104. package/src/plugins/row-col-cmp/colCmp/index.vue +53 -53
  105. package/src/plugins/row-col-cmp/colCmp/methods.js +25 -25
  106. package/src/plugins/row-col-cmp/rowCmp/data.js +3 -3
  107. package/src/plugins/row-col-cmp/rowCmp/index.scss +3 -3
  108. package/src/plugins/row-col-cmp/rowCmp/index.vue +43 -43
  109. package/src/plugins/row-col-cmp/rowCmp/methods.js +29 -29
  110. package/src/router/index.js +47 -43
  111. package/src/store/getters.js +13 -13
  112. package/src/store/index.js +58 -58
  113. package/src/store/modules/app.js +55 -55
  114. package/src/store/modules/dic.js +1 -1
  115. package/src/store/modules/settings.js +28 -28
  116. package/src/store/modules/user.js +94 -94
  117. package/src/store/modules/widgetdata.js +42 -42
  118. package/src/styles/element-ui.scss +49 -49
  119. package/src/styles/mixin.scss +28 -28
  120. package/src/styles/sidebar.scss +210 -210
  121. package/src/styles/transition.scss +48 -48
  122. package/src/styles/variables.scss +25 -25
  123. package/src/utils/get-page-title.js +10 -10
  124. package/src/utils/getMenu.js +2 -1
  125. package/src/utils/global-config.js +15 -15
  126. package/src/utils/index.js +332 -332
  127. package/src/utils/localStorage.js +21 -21
  128. package/src/utils/validate.js +20 -20
  129. package/src/views/layout/components/AllSearch/index.vue +44 -44
  130. package/src/views/layout/components/AppMain.vue +50 -50
  131. package/src/views/layout/components/Navbar.vue +43 -2
  132. package/src/views/layout/components/Sidebar/FixiOSBug.js +26 -26
  133. package/src/views/layout/components/Sidebar/Item.vue +28 -28
  134. package/src/views/layout/components/Sidebar/Link.vue +34 -34
  135. package/src/views/layout/components/Sidebar/Logo.vue +79 -79
  136. package/src/views/layout/components/Sidebar/SidebarItem.vue +67 -67
  137. package/src/views/layout/components/Sidebar/index.vue +114 -114
  138. package/src/views/layout/components/index.js +3 -3
  139. package/src/views/layout/index.vue +105 -105
@@ -1,43 +1,43 @@
1
- export default {
2
- // ------------------------------------------------------------------
3
- // pragma mark - inti(初始化行为)
4
- // ------------------------------------------------------------------
5
- createdInit() {
6
- this.reqSeleOtion(this.selectCont, {});
7
- },
8
- mountedInit() {
9
-
10
- },
11
-
12
- // ------------------------------------------------------------------
13
- // pragma mark - Event Response(响应事件)
14
- // 命名规范: Name + EventHandler
15
- // ------------------------------------------------------------------
16
- visibleChange(status, val) {
17
- if (status) {
18
- this.curDataSourceObj = val;
19
- this.selectOption = [];
20
- this.reqSeleOtion(val, {})
21
- }
22
- },
23
- remoteMethod(query) {
24
- if (query) {
25
- let sourceObj = this.curDataSourceObj;
26
- let paramName = sourceObj.urlParam;
27
- let params = {};
28
- if (paramName) {
29
- params = {
30
- [paramName]: query
31
- }
32
- }
33
- this.reqSeleOtion(sourceObj, params)
34
- }
35
- },
36
- reqSeleOtion(val, params) {
37
- this.$http.get(val.url, params).then(res => {
38
- if (res.data) {
39
- this.selectOption = res.data;
40
- }
41
- })
42
- }
43
- }
1
+ export default {
2
+ // ------------------------------------------------------------------
3
+ // pragma mark - inti(初始化行为)
4
+ // ------------------------------------------------------------------
5
+ createdInit() {
6
+ this.reqSeleOtion(this.selectCont, {});
7
+ },
8
+ mountedInit() {
9
+
10
+ },
11
+
12
+ // ------------------------------------------------------------------
13
+ // pragma mark - Event Response(响应事件)
14
+ // 命名规范: Name + EventHandler
15
+ // ------------------------------------------------------------------
16
+ visibleChange(status, val) {
17
+ if (status) {
18
+ this.curDataSourceObj = val;
19
+ this.selectOption = [];
20
+ this.reqSeleOtion(val, {})
21
+ }
22
+ },
23
+ remoteMethod(query) {
24
+ if (query) {
25
+ let sourceObj = this.curDataSourceObj;
26
+ let paramName = sourceObj.urlParam;
27
+ let params = {};
28
+ if (paramName) {
29
+ params = {
30
+ [paramName]: query
31
+ }
32
+ }
33
+ this.reqSeleOtion(sourceObj, params)
34
+ }
35
+ },
36
+ reqSeleOtion(val, params) {
37
+ this.$http.get(val.url, params).then(res => {
38
+ if (res.data) {
39
+ this.selectOption = res.data;
40
+ }
41
+ })
42
+ }
43
+ }
@@ -1,4 +1,4 @@
1
- export default () => {
2
- return {
3
- }
1
+ export default () => {
2
+ return {
3
+ }
4
4
  };
@@ -1,23 +1,23 @@
1
- .table-wrapper {
2
- width: 100%;
3
- height: 100%;
4
- display: flex;
5
- flex-direction: column;
6
-
7
- .t-search {
8
- // box-shadow: 0 2px 4px rgba(0, 0, 0, .12),
9
- // 0 0 6px rgba(0, 0, 0, .04);
10
- }
11
-
12
- .t-table {
13
- flex: 99;
14
- overflow: hidden;
15
- }
16
-
17
- .t-page {
18
- height: 32px;
19
- background-color: #fff;
20
- border-top: 1px solid #eee;
21
- }
22
-
1
+ .table-wrapper {
2
+ width: 100%;
3
+ height: 100%;
4
+ display: flex;
5
+ flex-direction: column;
6
+
7
+ .t-search {
8
+ // box-shadow: 0 2px 4px rgba(0, 0, 0, .12),
9
+ // 0 0 6px rgba(0, 0, 0, .04);
10
+ }
11
+
12
+ .t-table {
13
+ flex: 99;
14
+ overflow: hidden;
15
+ }
16
+
17
+ .t-page {
18
+ height: 32px;
19
+ background-color: #fff;
20
+ border-top: 1px solid #eee;
21
+ }
22
+
23
23
  }
@@ -1,98 +1,98 @@
1
- <template>
2
- <div v-loading="glo_loading" class="table-wrapper" style="display: flex">
3
- <div v-if="!hidSearch" class="t-search">
4
- <search-cmp
5
- v-model="query"
6
- :form-content="formContent"
7
- :btn-content="btnContent"
8
- @search-click="handleSearch"
9
- @btn-click="handleCommand"
10
- @btns-click="btnsClick"
11
- >
12
- <div slot="search_custemBtn">
13
- <slot name="custemBtn" />
14
- </div>
15
- </search-cmp>
16
- </div>
17
- <div class="t-handle">
18
- <slot name="total" />
19
- </div>
20
- <div class="t-table">
21
- <el-table
22
- :data="query.data || []"
23
- style="width: 100%"
24
- size="mini"
25
- border
26
- fit
27
- highlight-current-row
28
- default-expand-all
29
- :height="height ? height : '100%'"
30
- :row-class-name="rowClassName"
31
- @selection-change="handleSelectionChange"
32
- @sort-change="customSortChange"
33
- :row-key="rowKey"
34
- :tree-props="treeProps"
35
- >
36
- <slot />
37
- </el-table>
38
- </div>
39
- <div v-if="query.pageInfo" class="t-page">
40
- <el-pagination
41
- class="pages"
42
- :current-page.sync="query.pageInfo.page"
43
- :page-sizes="[10, 30, 50, 100, 200, 300, 400]"
44
- :page-size="query.pageInfo.pageSize"
45
- layout="total, sizes, prev, pager, next, jumper"
46
- :total="query.pageInfo.totalCount"
47
- @size-change="handleSizeChange"
48
- @current-change="handleCurrentChange"
49
- />
50
- </div>
51
- </div>
52
- </template>
53
- <script>
54
- import data from "./data";
55
- import methods from "./methods";
56
- import SearchCmp from "../Search";
57
- import { ElTable } from "element-ui";
58
- import { mapState } from "vuex";
59
-
60
- export default {
61
- name: "Table",
62
- props: {
63
- height: [String],
64
- hidSearch: {
65
- type: [Boolean],
66
- default: false,
67
- },
68
- query: {
69
- type: [Object],
70
- },
71
- formContent: {
72
- type: [Object, Array],
73
- },
74
- btnContent: {
75
- type: [Object, Array],
76
- },
77
- rowClassName: {
78
- type: [String, Function],
79
- },
80
- treeProps: {
81
- type: [Object],
82
- },
83
- rowKey: [String, Function],
84
- defaultExpandAll: {
85
- type: Boolean,
86
- default: false,
87
- },
88
- },
89
- data,
90
- computed: {
91
- ...mapState(["glo_loading"]),
92
- },
93
- mounted() {},
94
- methods,
95
- components: { SearchCmp },
96
- };
97
- </script>
98
- <style lang="scss" src="./index.scss" scoped></style>
1
+ <template>
2
+ <div v-loading="glo_loading" class="table-wrapper" style="display: flex">
3
+ <div v-if="!hidSearch" class="t-search">
4
+ <search-cmp
5
+ v-model="query"
6
+ :form-content="formContent"
7
+ :btn-content="btnContent"
8
+ @search-click="handleSearch"
9
+ @btn-click="handleCommand"
10
+ @btns-click="btnsClick"
11
+ >
12
+ <div slot="search_custemBtn">
13
+ <slot name="custemBtn" />
14
+ </div>
15
+ </search-cmp>
16
+ </div>
17
+ <div class="t-handle">
18
+ <slot name="total" />
19
+ </div>
20
+ <div class="t-table">
21
+ <el-table
22
+ :data="query.data || []"
23
+ style="width: 100%"
24
+ size="mini"
25
+ border
26
+ fit
27
+ highlight-current-row
28
+ default-expand-all
29
+ :height="height ? height : '100%'"
30
+ :row-class-name="rowClassName"
31
+ @selection-change="handleSelectionChange"
32
+ @sort-change="customSortChange"
33
+ :row-key="rowKey"
34
+ :tree-props="treeProps"
35
+ >
36
+ <slot />
37
+ </el-table>
38
+ </div>
39
+ <div v-if="query.pageInfo" class="t-page">
40
+ <el-pagination
41
+ class="pages"
42
+ :current-page.sync="query.pageInfo.page"
43
+ :page-sizes="[10, 30, 50, 100, 200, 300, 400]"
44
+ :page-size="query.pageInfo.pageSize"
45
+ layout="total, sizes, prev, pager, next, jumper"
46
+ :total="query.pageInfo.totalCount"
47
+ @size-change="handleSizeChange"
48
+ @current-change="handleCurrentChange"
49
+ />
50
+ </div>
51
+ </div>
52
+ </template>
53
+ <script>
54
+ import data from "./data";
55
+ import methods from "./methods";
56
+ import SearchCmp from "../Search";
57
+ import { ElTable } from "element-ui";
58
+ import { mapState } from "vuex";
59
+
60
+ export default {
61
+ name: "Table",
62
+ props: {
63
+ height: [String],
64
+ hidSearch: {
65
+ type: [Boolean],
66
+ default: false,
67
+ },
68
+ query: {
69
+ type: [Object],
70
+ },
71
+ formContent: {
72
+ type: [Object, Array],
73
+ },
74
+ btnContent: {
75
+ type: [Object, Array],
76
+ },
77
+ rowClassName: {
78
+ type: [String, Function],
79
+ },
80
+ treeProps: {
81
+ type: [Object],
82
+ },
83
+ rowKey: [String, Function],
84
+ defaultExpandAll: {
85
+ type: Boolean,
86
+ default: false,
87
+ },
88
+ },
89
+ data,
90
+ computed: {
91
+ ...mapState(["glo_loading"]),
92
+ },
93
+ mounted() {},
94
+ methods,
95
+ components: { SearchCmp },
96
+ };
97
+ </script>
98
+ <style lang="scss" src="./index.scss" scoped></style>
@@ -1,35 +1,35 @@
1
- export default {
2
- // ------------------------------------------------------------------
3
- // pragma mark - inti(初始化行为)
4
- // ------------------------------------------------------------------
5
- handleSelectionChange(val) {
6
- this.$emit("select-change", val);
7
- },
8
- handleCommand(val) {
9
- this.$emit("btn-click", val);
10
- },
11
- btnsClick(obj) {
12
- this.$emit("btns-click", obj);
13
- },
14
- handleSearch() {
15
- this.handleCurrentChange(1);
16
- },
17
-
18
- handleSizeChange(val) {
19
- this.query.pageInfo.pageSize = val;
20
- this.$emit("loadData");
21
- },
22
-
23
- handleCurrentChange(val) {
24
- this.query.pageInfo.page = val;
25
- this.$emit("loadData");
26
- },
27
-
28
- customSortChange(obj) {
29
- this.query.orderAsc = obj.order == "ascending" ? true : false;
30
- this.query.orderBy = obj.prop;
31
- if (obj.order) {
32
- this.$emit("loadData");
33
- }
34
- }
35
- };
1
+ export default {
2
+ // ------------------------------------------------------------------
3
+ // pragma mark - inti(初始化行为)
4
+ // ------------------------------------------------------------------
5
+ handleSelectionChange(val) {
6
+ this.$emit("select-change", val);
7
+ },
8
+ handleCommand(val) {
9
+ this.$emit("btn-click", val);
10
+ },
11
+ btnsClick(obj) {
12
+ this.$emit("btns-click", obj);
13
+ },
14
+ handleSearch() {
15
+ this.handleCurrentChange(1);
16
+ },
17
+
18
+ handleSizeChange(val) {
19
+ this.query.pageInfo.pageSize = val;
20
+ this.$emit("loadData");
21
+ },
22
+
23
+ handleCurrentChange(val) {
24
+ this.query.pageInfo.page = val;
25
+ this.$emit("loadData");
26
+ },
27
+
28
+ customSortChange(obj) {
29
+ this.query.orderAsc = obj.order == "ascending" ? true : false;
30
+ this.query.orderBy = obj.prop;
31
+ if (obj.order) {
32
+ this.$emit("loadData");
33
+ }
34
+ }
35
+ };
@@ -1,118 +1,118 @@
1
- <template>
2
- <div :class="[className,'chart-wrapper']" :style="{height:height,width:width}" />
3
- </template>
4
-
5
- <script>
6
- import echarts from 'echarts'
7
- require('echarts/theme/macarons') // echarts theme
8
- import resize from './mixins/resize'
9
-
10
- const animationDuration = 6000
11
-
12
- export default {
13
- mixins: [resize],
14
- props: {
15
-
16
- layoutItem: Object,
17
- rootData: Object,
18
- rootMeta: Object,
19
- curData: Array,
20
- curMeta: Object,
21
-
22
- className: {
23
- type: String,
24
- default: 'chart'
25
- },
26
- width: {
27
- type: String,
28
- default: '100%'
29
- },
30
- height: {
31
- type: String,
32
- default: '300px'
33
- }
34
- },
35
- data() {
36
- return {
37
- chart: null
38
- }
39
- },
40
- mounted() {
41
- this.$nextTick(() => {
42
- this.initChart()
43
- })
44
- },
45
- beforeDestroy() {
46
- if (!this.chart) {
47
- return
48
- }
49
- this.chart.dispose()
50
- this.chart = null
51
- },
52
- methods: {
53
- initChart() {
54
- this.chart = echarts.init(this.$el, 'macarons')
55
-
56
- this.chart.setOption({
57
- tooltip: {
58
- trigger: 'axis',
59
- axisPointer: {
60
- // 坐标轴指示器,坐标轴触发有效
61
- type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
62
- }
63
- },
64
- grid: {
65
- top: 10,
66
- left: '2%',
67
- right: '2%',
68
- bottom: '3%',
69
- containLabel: true
70
- },
71
- xAxis: [
72
- {
73
- type: 'category',
74
- data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
75
- axisTick: {
76
- alignWithLabel: true
77
- }
78
- }
79
- ],
80
- yAxis: [
81
- {
82
- type: 'value',
83
- axisTick: {
84
- show: false
85
- }
86
- }
87
- ],
88
- series: [
89
- {
90
- name: 'pageA',
91
- type: 'bar',
92
- stack: 'vistors',
93
- barWidth: '60%',
94
- data: [79, 52, 200, 334, 390, 330, 220],
95
- animationDuration
96
- },
97
- {
98
- name: 'pageB',
99
- type: 'bar',
100
- stack: 'vistors',
101
- barWidth: '60%',
102
- data: [80, 52, 200, 334, 390, 330, 220],
103
- animationDuration
104
- },
105
- {
106
- name: 'pageC',
107
- type: 'bar',
108
- stack: 'vistors',
109
- barWidth: '60%',
110
- data: [30, 52, 200, 334, 390, 330, 220],
111
- animationDuration
112
- }
113
- ]
114
- })
115
- }
116
- }
117
- }
118
- </script>
1
+ <template>
2
+ <div :class="[className,'chart-wrapper']" :style="{height:height,width:width}" />
3
+ </template>
4
+
5
+ <script>
6
+ import echarts from 'echarts'
7
+ require('echarts/theme/macarons') // echarts theme
8
+ import resize from './mixins/resize'
9
+
10
+ const animationDuration = 6000
11
+
12
+ export default {
13
+ mixins: [resize],
14
+ props: {
15
+
16
+ layoutItem: Object,
17
+ rootData: Object,
18
+ rootMeta: Object,
19
+ curData: Array,
20
+ curMeta: Object,
21
+
22
+ className: {
23
+ type: String,
24
+ default: 'chart'
25
+ },
26
+ width: {
27
+ type: String,
28
+ default: '100%'
29
+ },
30
+ height: {
31
+ type: String,
32
+ default: '300px'
33
+ }
34
+ },
35
+ data() {
36
+ return {
37
+ chart: null
38
+ }
39
+ },
40
+ mounted() {
41
+ this.$nextTick(() => {
42
+ this.initChart()
43
+ })
44
+ },
45
+ beforeDestroy() {
46
+ if (!this.chart) {
47
+ return
48
+ }
49
+ this.chart.dispose()
50
+ this.chart = null
51
+ },
52
+ methods: {
53
+ initChart() {
54
+ this.chart = echarts.init(this.$el, 'macarons')
55
+
56
+ this.chart.setOption({
57
+ tooltip: {
58
+ trigger: 'axis',
59
+ axisPointer: {
60
+ // 坐标轴指示器,坐标轴触发有效
61
+ type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
62
+ }
63
+ },
64
+ grid: {
65
+ top: 10,
66
+ left: '2%',
67
+ right: '2%',
68
+ bottom: '3%',
69
+ containLabel: true
70
+ },
71
+ xAxis: [
72
+ {
73
+ type: 'category',
74
+ data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
75
+ axisTick: {
76
+ alignWithLabel: true
77
+ }
78
+ }
79
+ ],
80
+ yAxis: [
81
+ {
82
+ type: 'value',
83
+ axisTick: {
84
+ show: false
85
+ }
86
+ }
87
+ ],
88
+ series: [
89
+ {
90
+ name: 'pageA',
91
+ type: 'bar',
92
+ stack: 'vistors',
93
+ barWidth: '60%',
94
+ data: [79, 52, 200, 334, 390, 330, 220],
95
+ animationDuration
96
+ },
97
+ {
98
+ name: 'pageB',
99
+ type: 'bar',
100
+ stack: 'vistors',
101
+ barWidth: '60%',
102
+ data: [80, 52, 200, 334, 390, 330, 220],
103
+ animationDuration
104
+ },
105
+ {
106
+ name: 'pageC',
107
+ type: 'bar',
108
+ stack: 'vistors',
109
+ barWidth: '60%',
110
+ data: [30, 52, 200, 334, 390, 330, 220],
111
+ animationDuration
112
+ }
113
+ ]
114
+ })
115
+ }
116
+ }
117
+ }
118
+ </script>