1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
| <!DOCTYPE html>
| <html lang="en">
| <head>
| <meta charset="UTF-8" />
| <meta name="viewport" content="width=device-width, initial-scale=1.0" />
| <title>经济运行</title>
| <script src="/customer_list/ch/ai_html/views/demo/js/tailwind.js"></script>
| <script src="/customer_list/ch/ai_html/views/demo/js/vue.global.js"></script>
| <script src="/customer_list/ch/ai_html/views/demo/js/iframe-resizer/child-5.1.5.js" async></script>
| <script src="/customer_list/ch/ai_html/views/demo/js/index.full.js"></script>
| <script src="/customer_list/ch/ai_html/views/demo/js/customInstruction.js"></script>
| <link href="/customer_list/ch/static/fonts/iconfont/iconfont.css" rel="stylesheet" type="text/css" />
| <link href="/customer_list/ch/ai_html/views/demo/css/ele-index.css" rel="stylesheet" type="text/css" />
| <script src="/customer_list/ch/ai_html/views/demo/js/echarts.min.js"></script>
| </head>
|
| <body>
| <div class="w-full h-full bg-[#f2f4f8] px-[5px] py-[5px]" id="marketIntegrationBoard">
| <div class="bg-[rgb(242,244,248)] space-y-1">
| <div v-resize="chartContainerResize" class="w-full h-full bg-white">
| <div class="w-full bg-white h-[320px]" id="marketIntegrationBarChart"></div>
| </div>
| </div>
| </div>
| </body>
| <script>
| const { createApp, onMounted, ref, reactive } = Vue;
| const marketIntegrationBarChartDomRef = ref(null);
| const marketIntegrationLineChartDomRef = ref(null);
| const App = createApp({
| setup() {
| let state = reactive({
| marketIntegrationBoardList: [
| {
| Name: '总',
| Amount: '10000',
| NewRecord: '2022-01-01',
| CompanyName: '张三',
| },
| {
| Name: '细支烟',
| Amount: '4354363',
| NewRecord: '2022-01-01',
| CompanyName: '张三',
| },
| {
| Name: '中支烟',
| Amount: '435233',
| NewRecord: '2022-01-01',
| CompanyName: '李四',
| },
| {
| Name: '短支烟',
| Amount: '54545',
| NewRecord: '2023-01-01',
| CompanyName: '王二',
| },
| {
| Name: '爆珠烟',
| Amount: '577887',
| NewRecord: '2024-01-01',
| CompanyName: '张三',
| },
| ],
| });
| const initMarketIntegrationBoardBarChart = () => {
| const barXData = state.marketIntegrationBoardList.map((item) => item.Name);
| var chartDom = document.getElementById('marketIntegrationBarChart');
| var marketIntegrationBarChartDom = echarts.init(chartDom);
| marketIntegrationBarChartDomRef.value = marketIntegrationBarChartDom;
| var option = {
| title: [
| {
| text: '各分公司销售量',
| left: 50,
| top: 10,
| textStyle: {
| fontSize: 20,
| },
| },
| {
| text: '(万箱)',
| top: 10,
| left: 200,
| textStyle: {
| fontSize: 14,
| },
| },
| ],
| grid: {
| left: 10,
| right: 40,
| },
| legend: {
| top: 30,
| },
| xAxis: {
| type: 'category',
| // data: barXData,
| },
| yAxis: {
| show: false,
| },
| dataset: {
| source: [
| ['product', '往期', '本期'],
| ['吴中', 43.3, 85.8],
| ['吴江', 83.1, 73.4],
| ['昆山', 86.4, 65.2],
| ['张家港', 72.4, 53.9],
| ['常熟', 72.4, 53.9],
| ['太仓', 72.4, 53.9],
| ],
| },
| series: [
| {
| type: 'bar',
| label: {
| show: true,
| position: 'top', // 顶部显示
| },
| },
| {
| type: 'bar',
| label: {
| show: true,
| position: 'top', // 顶部显示
| },
| },
| ],
| };
|
| option && marketIntegrationBarChartDom.setOption(option);
| };
| const chartContainerResize = ({ width, height }) => {
| marketIntegrationBarChartDomRef.value.resize();
| };
| onMounted(() => {
| initMarketIntegrationBoardBarChart();
| });
|
| return { state, chartContainerResize };
| },
| });
| App.use(ElementPlus);
| elementResizeDirective(App);
| App.mount('#marketIntegrationBoard');
| </script>
| </html>
|
|