houzhongjian
2024-07-23 8501060c4f921d1e744c477e4dc08eb47b52693c
提交 | 用户 | 时间
850106 1 <template>
H 2     <div class="wash-curves">
3         <div id="wash" ref="wash"
4              style="width: 36vw; height: 30vw; text-align: center"></div>
5          <el-col :span="24">
6                 <div style="text-align: left; font-size: 12px; font-weight: 600;">
7                   综合查询
8                 </div>
9                 <el-form :inline="true" :model="curvesQueryForm">
10                   <el-form-item>
11                     <el-select size="mini" v-model="curvesQueryForm.type" placeholder="查询条件">
12                       <el-option
13                           v-for="item in typeOptions"
14                           :key="item.value"
15                           :label="item.label"
16                           :value="item.value">
17                       </el-option>
18                     </el-select>
19                   </el-form-item>
20                   <el-form-item>
21                     <el-input size="mini" v-model="curvesQueryForm.value" placeholder="变量值"></el-input>
22                   </el-form-item>
23                   <el-form-item>
24                     <el-button size="mini" @click="queryCurvesValue">查询</el-button>
25                   </el-form-item>
26                 </el-form>
27                 <el-form :model="formInlineForm" class="demo-form-inline" label-width="100px">
28                   <el-row>
29                     <el-col :span="8">
30                       <el-form-item label="精美产率:" prop="jmcl">
31                         {{formInlineForm.jmcl}}
32                       </el-form-item>
33                     </el-col>
34                     <el-col :span="8">
35                       <el-form-item label="精煤灰分:" prop="hf">
36                         {{formInlineForm.hf}}
37                       </el-form-item>
38                     </el-col>
39                     <el-col :span="8">
40                       <el-form-item label="精煤密度:" prop="md">
41                         {{formInlineForm.md}}
42                       </el-form-item>
43                     </el-col>
44                   </el-row>
45                   <el-row>
46                     <el-col :span="8">
47                       <el-form-item label="δ±0.1初值:" prop="δcz">
48                         {{formInlineForm.δcz}}
49                       </el-form-item>
50                     </el-col>
51                     <el-col :span="8">
52                       <el-form-item :label-width="80" label="δ±0.1最终值:" prop="δzzz">
53                         {{formInlineForm.δzzz}}
54                       </el-form-item>
55                     </el-col>
56                     <el-col :span="8">
57                       <el-form-item label="可选性等级:" prop="kxxdj">
58                         {{formInlineForm.kxxdj}}
59                       </el-form-item>
60                     </el-col>
61                   </el-row>
62                 </el-form>
63
64       <el-table
65         ref="table"
66         v-loading="dataListLoading"
67         :data="dataList"
68         border
69         height="300"
70       >
71         <el-table-column prop="mdj" label="密度(g/cm^3)" header-align="center"
72                          align="center" min-width="150"></el-table-column>
73         <el-table-column prop="cl" :label="$t('washCurves.cl')" header-align="center"
74                          align="center"></el-table-column>
75         <el-table-column prop="hf" :label="$t('washCurves.hf')" header-align="center"
76                          align="center"></el-table-column>
77         <el-table-column :label="$t('washCurves.fwlj')" header-align="center">
78           <el-table-column prop="fwljcl" :label="$t('washCurves.cl')" header-align="center"
79                            align="center"></el-table-column>
80           <el-table-column prop="fwljhf" :label="$t('washCurves.hf')" header-align="center"
81                            align="center"></el-table-column>
82         </el-table-column>
83         <el-table-column :label="$t('washCurves.cwlj')" header-align="center">
84           <el-table-column prop="cwljcl" :label="$t('washCurves.cl')" header-align="center"
85                            align="center"></el-table-column>
86           <el-table-column prop="fwljhf" :label="$t('washCurves.hf')" header-align="center"
87                            align="center"></el-table-column>
88         </el-table-column>
89         <el-table-column label="密度±1" header-align="center">
90           <el-table-column prop="fxmd" label="密度" header-align="center"
91                            align="center"></el-table-column>
92           <el-table-column prop="fxcl" label="产率" header-align="center"
93                            align="center"></el-table-column>
94         </el-table-column>
95       </el-table>
96
97     </el-col>
98   </div>
99 </template>
100 <script>
101   export default {
102     data() {
103       return {
104         chartLoading: false,
105         loadChart: {},
106         dataListLoading: false,
107         dataList: [],
108         paramsExample:[],
109         resList: [],
110         legendData: [],
111         xFloatAshPyNewCurve: [],
112         xDensityPyNewCurve: [],
113         xDensityScopePyNewCurve: [],
114         queryInformation: [],
115         curvesQueryForm: {
116           type: '',
117           value: ''
118         },
119         formInlineForm: {
120           md: '',
121           jmcl: '',
122           hf: '',
123           δcz: '',
124           δzzz: '',
125           kxxdj: '',
126         },
127         typeOptions: [
128           {
129             value: 'hf',
130             label: '灰分'
131           },
132           {
133             value: 'md',
134             label: '密度'
135           }
136         ],
137       }
138     },
139     computed: {
140       dataRule() {
141         return {}
142       }
143     },
144
145     methods: {
146       init (data) {
147           this.dataList = data.result_sheet.map(row => {
148             return {
149               mdj: row[0]=='-1'?"——":row[0],
150               cl: row[1]=='-1'?"——":row[1],
151               hf: row[2]=='-1'?"——":row[2],
152               fwljcl: row[3]=='-1'?"——":row[3],
153               fwljhf: row[4]=='-1'?"——":row[4],
154               cwljcl: row[5]=='-1'?"——":row[5],
155               fwljhf: row[6]=='-1'?"——":row[6],
156               fxmd: row[7]=='-1'?"——":row[7],
157               fxcl: row[8]=='-1'?"——":row[8]
158             };
159           });
160           this.resList = data.result_sheet
161           this.xFloatAshPyNewCurve = data.xFloatAshPyNew_curve
162           this.xDensityPyNewCurve = data.xDensityPyNew_curve
163           this.xDensityScopePyNewCurve = data.xDensityScopePyNew_curve
164           this.$nextTick(() => {
165               this.loadChart = this.$echarts.init(document.getElementById('wash'));
166               this.getChart(data)
167           })
168       },
169       // 可选性曲线
170       getChart(data) {
171         let seriesData = []
172         //灰分点数据
173         seriesData.push(
174           {
175             name: '灰分',
176             symbolSize: 10,
177             data: data.cellAshArray_xy_point,
178             xAxisIndex: 0,
179             yAxisIndex: 0,
180             type: 'scatter'
181           }
182         )
183         //密度点数据
184         seriesData.push(
185           {
186             name: '密度',
187             symbolSize: 10,
188             data: data.densityArray_xy_point,
189             xAxisIndex: 1,
190             yAxisIndex: 0,
191             type: 'scatter'
192           }
193         )
194         //浮物点数据
195         seriesData.push(
196           {
197             name: '浮物',
198             symbolSize: 10,
199             data: data.floatAshArray_xy_point,
200             xAxisIndex: 0,
201             yAxisIndex: 0,
202             type: 'scatter'
203           }
204         )
205         //沉物点数据
206         seriesData.push(
207           {
208             name: '沉物',
209             symbolSize: 10,
210             data: data.sinkAshArray_xy_point,
211             xAxisIndex: 0,
212             yAxisIndex: 1,
213             type: 'scatter'
214           }
215         )
216         //密度±0.1点数据
217         seriesData.push(
218           {
219             name: '密度±0.1',
220             symbolSize: 10,
221             data: data.densityScopeArray_xy_point,
222             xAxisIndex: 1,
223             yAxisIndex: 0,
224             type: 'scatter'
225           }
226         )
227         //灰分特性曲线
228         seriesData.push(
229           {
230             showSymbol: false,
231             name: '灰分特性曲线',
232             type: 'line',
233             xAxisIndex: 0,
234             yAxisIndex: 0,
235             smooth: true,
236             emphasis: {
237               focus: 'series'
238             },
239             data: data.xCellAshPyNew_curve
240           }
241         )
242         //密度曲线
243         seriesData.push(
244           {
245             showSymbol: false,
246             name: '密度曲线',
247             type: 'line',
248             xAxisIndex: 1,
249             yAxisIndex: 0,
250             smooth: true,
251             emphasis: {
252               focus: 'series'
253             },
254             data: data.xDensityPyNew_curve
255           }
256         )
257         //浮物曲线
258         seriesData.push(
259           {
260             showSymbol: false,
261             name: '浮物曲线',
262             type: 'line',
263             xAxisIndex: 0,
264             yAxisIndex: 0,
265             smooth: true,
266             emphasis: {
267               focus: 'series'
268             },
269             data: data.xFloatAshPyNew_curve
270           }
271         )
272         //沉物曲线
273         seriesData.push(
274           {
275             showSymbol: false,
276             name: '沉物曲线',
277             type: 'line',
278             xAxisIndex: 0,
279             yAxisIndex: 1,
280             smooth: true,
281             emphasis: {
282               focus: 'series'
283             },
284             data: data.xSinkAshPyNew_curve
285           }
286         )
287         //密度±0.1曲线
288         seriesData.push(
289           {
290             showSymbol: false,
291             name: '密度±0.1曲线',
292             type: 'line',
293             xAxisIndex: 1,
294             yAxisIndex: 0,
295             smooth: true,
296             emphasis: {
297               focus: 'series'
298             },
299             data: data.xDensityScopePyNew_curve
300           }
301         )
302         this.drawWashCurves(seriesData)
303       },
304
305       drawWashCurves(seriesData) {
306         let option = {
307           tooltip: {
308             trigger: 'axis',
309             axisPointer: {
310               type: 'cross'
311             },
312             formatter: function (params) {
313               let res = '';
314               for (let i = 0, l = params.length; i < l; i++) {
315                 res += '<p style="text-align: left"><span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:' + params[i].color + ';"></span>' + params[i].seriesName + ' : [' + params[i].value + ']</p>';
316               }
317               return res;
318             }
319           },
320           legend: {},
321           grid: {
322             top: 70,
323             bottom: 50
324           },
325           yAxis: [
326             {
327               type: "value",
328               min: 0,
329               max: 100,
330               interval: 10,
331               inverse: true //反转坐标轴
332             },
333             {
334               type: "value",
335               min: 0,
336               max: 100,
337               interval: 10
338             }
339           ],
340           xAxis: [
341             {
342               type: 'value',
343               boundaryGap: false,
344               axisTick: {
345                 alignWithLabel: true
346               },
347               min: 0,
348               max: 100,
349               interval: 10
350             },
351             {
352               type: 'value',
353               boundaryGap: false,
354               axisTick: {
355                 alignWithLabel: true
356               },
357               inverse: true,
358               min: 1.2,
359               max: 2.2,
360               interval: 0.1
361             }
362           ],
363           series: seriesData
364         };
365         this.loadChart.setOption(option, true);
366       },
367       // 综合查询
368       queryCurvesValue() {
369         if (!this.curvesQueryForm.type || !this.curvesQueryForm.value) {
370           console.log("请输入")
371           return
372         }
373         this.queryInformation = [[this.curvesQueryForm.type==="md"?1:0,Number(this.curvesQueryForm.value)]]
374         this.paramsExample = [this.resList,this.xFloatAshPyNewCurve,this.xDensityPyNewCurve,this.xDensityScopePyNewCurve,this.queryInformation]
375          this.$http['post']("/iailab-ntt-model/api/model/execute?modelCode=washability_query", JSON.parse(JSON.stringify(this.paramsExample))).then(({data: res}) => {
376            this.formInlineForm.hf = res.data.ash
377            this.formInlineForm.md = res.data.density
378            this.formInlineForm.jmcl = res.data.productivity
379            this.formInlineForm.δcz = res.data.density_scope_val
380            this.formInlineForm.δzzz = res.data.density_scope_content
381            this.formInlineForm.kxxdj = res.data.可选性等级
382          })
383       },
384     }
385   }
386 </script>
387 <style scoped>
388   .chart-body {
389     width: 40vh;
390     height: 40vh;
391   }
392
393   .chart-line {
394     width: 40vh;
395     height: 40vh;
396   }
397
398 </style>