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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
| <template>
| <el-container>
| <el-header style="height:unset">
| <div class="topSelect">
| <DropSelect v-model="SO.a" :options="options1" :select-title="title1" @change="change('a',SO.a)" />
| <DropSelect v-model="SO.b" :options="options2" :select-title="title2" @change="change('b',SO.b)" />
| <DropSelect v-model="SO.c" :options="options3" :select-title="title3" @change="change('c',SO.c)" />
| <DropSelect v-model="SO.d" :options="options4" :select-title="title4" @change="change('d',SO.d)" />
| <DropSelect v-model="SO.e" :options="options5" :select-title="title5" @change="change('e',SO.e)" />
| <DropSelect v-model="SO.f" :options="options6" :select-title="title6" @change="change('f',SO.f)" />
| </div>
| <div class="top2Select">
| <div>
| <DropSelect :options="options1" :select-title="title1" />
| <DropSelect :options="options2" :select-title="title2" />
| <DropSelect :options="options3" :select-title="title3" />
| <DatePickers />
| <Radio :radio="radio" :radio-data="radioData" />
| </div>
| <div>
| <el-button type="primary">查询</el-button>
| </div>
| </div>
| </el-header>
| <el-main>
| <LineChart :chart-data="lineChartData" />
| <BarChart />
| </el-main>
| </el-container>
| </template>
|
| <script>
|
| // 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
| // 例如:import《组件名称》from'《组件路径》';
| import DropSelect from '@/components/Form/DropSelect'
| import DatePickers from '@/components/Form/DatePicker'
| import Radio from '@/components/Form/Radio'
| import LineChart from '@/components/Echarts/LineChart'
| import BarChart from '@/components/Echarts/BarChart'
|
| const lineChartData = {
| newVisitis: {
| expectedData: [100, 120, 161, 134, 105, 160, 165],
| actualData: [120, 82, 91, 154, 162, 140, 145]
| },
| messages: {
| expectedData: [200, 192, 120, 144, 160, 130, 140],
| actualData: [180, 160, 151, 106, 145, 150, 130]
| },
| purchases: {
| expectedData: [80, 100, 121, 104, 105, 90, 100],
| actualData: [120, 90, 100, 138, 142, 130, 130]
| },
| shoppings: {
| expectedData: [130, 140, 141, 142, 145, 150, 160],
| actualData: [120, 82, 91, 154, 162, 140, 130]
| }
| }
|
| export default {
| // import 引入的组件需要注入到对象中才能使用
| components: {
| DropSelect,
| DatePickers,
| Radio,
| LineChart,
| BarChart
| },
| props: {},
| data() {
| // 这里存放数据
| return {
| SO: {
| a: '',
| b: '',
| c: '',
| d: '',
| e: '',
| f: ''
| },
| radioData: {
| 0: '全部',
| 1: '一级',
| 2: '二级',
| 3: '三级'
| },
| radio: 3,
| lineChartData: lineChartData.newVisitis,
| title1: '监测因子展示',
| title2: '警报占比',
| title3: '排放量',
| title4: '溯源预测',
| title5: '巡航轨迹',
| title6: '报表管理',
| options1: [{
| value: '选项1',
| label: '监测因子趋势图'
| }, {
| value: '选项2',
| label: '监测因子对比图'
| }, {
| value: '选项3',
| label: '国控监测因子图'
| }, {
| value: '选项4',
| label: '臭氧预测图'
| }, {
| value: '选项5',
| label: '实时风场图'
| }],
| options2: [{
| value: '选项1',
| label: '监测站警报占比'
| }, {
| value: '选项2',
| label: '监测因子警报占比'
| }],
| options3: [{
| value: '选项1',
| label: '污染排放量'
| }, {
| value: '选项2',
| label: '净化率'
| }, {
| value: '选项3',
| label: '收集率'
| }, {
| value: '选项4',
| label: '无组织排放'
| }, {
| value: '选项5',
| label: '无组织排放实时'
| }],
| options4: [{
| value: '选项1',
| label: 'AI智能预测'
| }, {
| value: '选项2',
| label: '污染溯源'
| }, {
| value: '选项3',
| label: '扬尘一体化监控'
| }],
| options5: [{
| value: '选项1',
| label: '无人机飞行轨迹'
| }, {
| value: '选项2',
| label: '走航车轨迹'
| }, {
| value: '选项3',
| label: '无人机落点'
| }, {
| value: '选项4',
| label: '无人机污染源通道'
| }, {
| value: '选项5',
| label: '无人机污染源溯源'
| }],
| options6: [{
| value: '选项1',
| label: '列表数据导出'
| }, {
| value: '选项2',
| label: '设备数据导出'
| }],
| value1: '',
| value2: '',
| value3: '',
| value4: '',
| value5: '',
| value6: '',
| date1: ''
| }
| },
| // 计算属性 类似于data概念
| computed: {},
| // 监控data中的数据变化
| watch: {
| },
| // 生命周期 - 创建完成(可以访问当前 this 实例)
| created() {
|
| },
| // 生命周期 - 挂载完成(可以访问 DOM 元素)
| mounted() {
|
| },
| beforeCreate() {}, // 生命周期 - 创建之前
| beforeMount() {}, // 生命周期 - 挂载之前
| beforeUpdate() {}, // 生命周期 - 更新之前
| updated() {}, // 生命周期 - 更新之后
| beforeDestroy() {}, // 生命周期 - 销毁之前
| destroyed() {}, // 生命周期 - 销毁完成
| activated() {},
| // 方法集合
| methods: {
| change(params, val) {
| console.log(params)
| if ((params === 'a') && (val !== '')) {
| this.SO.b = ''
| this.SO.c = ''
| this.SO.d = ''
| this.SO.e = ''
| this.SO.f = ''
| }
| if ((params === 'b') && (val !== '')) {
| this.SO.a = ''
| this.SO.c = ''
| this.SO.d = ''
| this.SO.e = ''
| this.SO.f = ''
| }
| if ((params === 'c') && (val !== '')) {
| this.SO.a = ''
| this.SO.b = ''
| this.SO.d = ''
| this.SO.e = ''
| this.SO.f = ''
| }
| if ((params === 'd') && (val !== '')) {
| this.SO.a = ''
| this.SO.b = ''
| this.SO.c = ''
| this.SO.e = ''
| this.SO.f = ''
| }
| if ((params === 'e') && (val !== '')) {
| this.SO.a = ''
| this.SO.b = ''
| this.SO.c = ''
| this.SO.d = ''
| this.SO.f = ''
| }
| if ((params === 'f') && (val !== '')) {
| this.SO.a = ''
| this.SO.b = ''
| this.SO.c = ''
| this.SO.d = ''
| this.SO.e = ''
| }
| }
| } // 如果页面有keep-alive缓存功能,这个函数会触发
| }
| </script>
| <style scoped>
| .topSelect{
| padding: 20px;
| }
| .top2Select{
| padding: 20px;
| display: flex;
| justify-content: space-between;
| }
| .top2Select>div:nth-child(1){
| display: flex;
| flex: 1;
| margin-right: 10px;
| /* justify-content:space-between */
| }
| .top2Select>div:nth-child(1)>*{
| margin-right: 20px;
| }
| .top2Select>div:nth-child(2){
| display: flex;
| justify-content:flex-end;
| margin-left: 50px;
| }
| </style>
|
|