yangyin
2024-11-22 c10af99bb6639ec4b66c0e639361307917550d20
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
<!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="marketIntegrationLineChart"></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 initMarketIntegrationCigarLineChart = () => {
                    var chartDom = document.getElementById('marketIntegrationLineChart');
                    var marketIntegrationLineChartDom = echarts.init(chartDom);
                    marketIntegrationLineChartDomRef.value = marketIntegrationLineChartDom;
                    let option = {
                        title: [
                            {
                                text: '市场综合状态',
                                left: 50,
                                top: 10,
                                textStyle: {
                                    fontSize: 20,
                                },
                            },
                            {
                                text: '(得分)',
                                top: 10,
                                left: 180,
                                textStyle: {
                                    fontSize: 14,
                                },
                            },
                        ],
                        grid: {
                            left: 10,
                            right: 40,
                        },
                        xAxis: {
                            type: 'category',
                            show: false,
                        },
                        yAxis: {
                            type: 'value',
                            show: false,
                        },
                        series: [
                            {
                                data: [150, 230, 224, 218, 135, 147, 260],
                                type: 'line',
                                areaStyle: {
                                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                                        { offset: 0, color: '#48C78E' },
                                        { offset: 0.5, color: 'rgba(182,229,187,0.3)' },
                                        { offset: 1, color: 'rgba(182,229,187,0.1)' },
                                    ]),
                                },
                                lineStyle: {
                                    color: '#48C78E',
                                    width: 3,
                                },
                                itemStyle: {
                                    color: '#48C78E',
                                },
                                label: {
                                    show: true,
                                    position: 'top', // 顶部显示
                                },
                            },
                        ],
                    };
 
                    option && marketIntegrationLineChartDom.setOption(option);
                };
                const chartContainerResize = ({ width, height }) => {
                    marketIntegrationLineChartDomRef.value.resize();
                };
                onMounted(() => {
                    initMarketIntegrationCigarLineChart();
                });
 
                return { state, chartContainerResize };
            },
        });
        App.use(ElementPlus);
        elementResizeDirective(App);
        App.mount('#marketIntegrationBoard');
    </script>
</html>