zouyu
2023-08-23 15083d598b0291d64b61df319d1764e63007cc69
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
<template>
  <div class="work-main" style="overflow: scroll;width:100%;height:100vh">
      <div class="work-head">
          <el-row :gutter="10">
            <el-col :span="24">
                <el-card>
                  <el-form :inline="true" :model="formInline" class="demo-form-inline">
                    <el-form-item>
                      <p><span>*</span>检测日期:</p>
                      <el-date-picker
                        v-model="dateTime"
                        type="daterange"
                        range-separator="至"
                        start-placeholder="开始日期"
                        end-placeholder="结束日期">
                      </el-date-picker>
                    </el-form-item>
                    <el-form-item>
                      <p><span>*</span>检验类型:</p>
                      <el-select v-model="formInline.region" placeholder="采购入库">
                        <el-option label="区域一" value="shanghai"></el-option>
                        <el-option label="区域二" value="beijing"></el-option>
                      </el-select>
                    </el-form-item>
                    <el-form-item class="buttons">
                      <el-button>清空</el-button>
                      <el-button type="primary" @click="onSubmit">查询</el-button>
                    </el-form-item>
                  </el-form>
                </el-card>
            </el-col>
          </el-row>
      </div>
      <div class="work-center" >
        <el-row :gutter="20">
          <el-col :span="12">
              <el-card>
                <p>负责人统计</p>
                <div id="leaderStati" style="width:100%;height:400px;"></div>
              </el-card>
          </el-col>
          <el-col :span="12">
              <el-card>
                <p>实验员统计</p>
                <div id="testerStati" style="width:100%;height:400px;"></div>
              </el-card>
          </el-col>
          <el-col :span="12">
              <el-card>
                <p>负责人及时率</p>
                <div id="leaderTimly" style="width:100%;height:400px;"></div>
              </el-card>
          </el-col>
          <el-col :span="12">
              <el-card>
                <p>实验员及时率</p>
                <div id="testerTimly" style="width:100%;height:400px;"></div>
              </el-card>
          </el-col>
        </el-row>
      </div>
      <div class="work-foot"></div>
  </div>
</template>
 
<script>
import * as echarts from 'echarts';
export default {
  data() {
      return {
        formInline: {
          user: '',
          region: ''
        },
        dateTime: '',
      }
    },
    mounted(){
      this.initLeaderStatiChart('leaderStati');
      this.initLeaderTimlyChart();
      this.initLeaderStatiChart('testerStati');
      this.initTesterTimlyChart();
    },
    methods: {
      onSubmit() {
        console.log('submit!');
      },
      initLeaderStatiChart(id){
        var chartDom = document.getElementById(id);
        var myChart = echarts.init(chartDom);
        var option;
 
        let xAxisData = [];
        let data1 = [];
        let data2 = [];
        let data3 = [];
        let data4 = [];
        for (let i = 0; i < 10; i++) {
          xAxisData.push('Class' + i);
          data1.push(+(Math.random() * 2).toFixed(2));
          data2.push(+(Math.random() * 5).toFixed(2));
          data3.push(+(Math.random() + 0.3).toFixed(2));
          data4.push(+Math.random().toFixed(2));
        }
        var emphasisStyle = {
          itemStyle: {
            shadowBlur: 10,
            shadowColor: 'rgba(0,0,0,0.3)'
          }
        };
        option = {
          legend: {
            data: ['bar', 'bar2'],
            left: 'center'
          },
          tooltip: {},
          xAxis: {
            data: xAxisData,
            name: '姓名',
            axisLine: { onZero: true },
            splitLine: { show: false },
            splitArea: { show: false }
          },
          yAxis: {},
          grid: {
            bottom: 100
          },
          series: [
            {
              name: 'bar',
              type: 'bar',
              stack: 'one',
              emphasis: emphasisStyle,
              data: data1
            },
            {
              name: 'bar2',
              type: 'bar',
              stack: 'one',
              emphasis: emphasisStyle,
              data: data2
            }
          ]
        };
        myChart.on('brushSelected', function (params) {
          var brushed = [];
          var brushComponent = params.batch[0];
          for (var sIdx = 0; sIdx < brushComponent.selected.length; sIdx++) {
            var rawIndices = brushComponent.selected[sIdx].dataIndex;
            brushed.push('[Series ' + sIdx + '] ' + rawIndices.join(', '));
          }
          myChart.setOption({
            title: {
              backgroundColor: '#333',
              text: 'SELECTED DATA INDICES: \n' + brushed.join('\n'),
              bottom: 0,
              right: '10%',
              width: 100,
              textStyle: {
                fontSize: 12,
                color: '#fff'
              }
            }
          });
        });
 
        option && myChart.setOption(option);
      },
      initTesterStatiChart(){
 
      },
      initLeaderTimlyChart(){
 
      },
      initTesterTimlyChart(){
 
      },
    }
}
</script>
 
<style lang="scss" scoped>
  .work-main{
    width:100%;
    margin:0;
    padding: 0;
    .work-head{
      width:94%;
      height:100;
      margin: 5px 10px;
      position: fixed;
      z-index: 10;
      .demo-form-inline{
        margin: 0px 10px;
        p{
          margin: 0;
          font-size: 16px;
          font-weight: bold;
          span{
            font-size: 16px;
            font-weight: bold;
            color: red;
          }
        }
        .buttons{
          margin: 40px 0px 0px 900px;
        }
      }
    }
    .work-center{
      margin: 0px 0px 5px 10px;
      padding: 18vh 0px 5px 0px;
      .el-card{
        margin: 5px 0px;
        height:500px;
      }
    }
  }
</style>