-
admin
2024-06-01 a846f28bef985e7671f0b469fb73541cbfb08a93
提交 | 用户 | 时间
2c7661 1 <template>
A 2   <div class="app-container">
3    <el-row :gutter="5">
4      <el-col :span="7">
5        <el-card shadow="never">
6          <span class="head-font">工位编号 : {{headContent.processesCode}}</span>
7        </el-card>
8      </el-col>
9      <el-col :span="7">
10        <el-card shadow="never">
11          <span class="head-font">工位名称 : {{headContent.processesName}}</span>
12        </el-card>
13      </el-col>
14      <el-col :span="10">
15        <el-card shadow="never">
16          <span class="head-font">产品序列号 : {{headContent.sfcCode}}</span>
17 <!--         <el-input v-model="content" style="float: right;width: 150px;" placeholder="请输入内容"></el-input>-->
18 <!--         <el-button @click="scanCompleted" style="float: right" type="primary">扫码完成</el-button>-->
19          <el-button type="primary" style="float: right" icon="el-icon-search" size="mini" @click="serialLink">串口连接</el-button>
20          <el-button @click="clearClick" style="float: right" type="danger" size="mini">清除</el-button>
21        </el-card>
22      </el-col>
23
24    </el-row>
25    <el-row :gutter="5" style="margin-top: 5px">
26      <el-col :span="24">
27        <el-tabs type="border-card"  style="height: 600px" v-model="activeName" @tab-click="changeMenu">
28          <el-tab-pane name="first">
29            <span slot="label"> <a class="el-icon-date"></a>首页</span>
30            <el-col :span="24">
31              <el-table height="500" :cell-style="rowStyle" :data="formulaChildList">
32                <el-table-column label="排序" width="60" align="center" type="index">
33                </el-table-column>
34                <el-table-column label="操作内容" :show-overflow-tooltip='true' align="center" prop="operationSteps">
35                </el-table-column>
36                <el-table-column label="产品编号" align="center" prop="productCode">
37                </el-table-column>
38                <el-table-column label="物料编码" align="center" prop="materialCode">
39                </el-table-column>
40                <el-table-column label="采集值" align="center" prop="collectData">
41                </el-table-column>
42                <el-table-column label="结果" align="center" prop="results">
43                </el-table-column>
44              </el-table>
45            </el-col>
46          </el-tab-pane>
47        </el-tabs>
48      </el-col>
49    </el-row>
50     <el-dialog v-dialogpop-up :title="title" :visible.sync="open1" width="1000" append-to-body>
51       <el-row
52         type="flex"
53         class="row-bg"
54         justify="center"
55         v-show="portsList.length === 0"
56       >
57         <el-col :span="7">
58           <div style="margin-top: 400px">
59           <span style="display: block">
60             仅支持Chrome 89+或者Edge 89+浏览器(安全上下文(HTTPS)中可用)
61           </span>
62             <el-button type="primary" @click="obtainAuthorization">授权</el-button>
63           </div>
64         </el-col>
65       </el-row>
66       <el-form
67         v-show="portsList.length > 0"
68         ref="form1"
69         :model="form1"
70         label-width="100px">
71         <el-row>
72           <el-col :span="24"
73           ><div>
74             <el-form-item label="串口">
75               <el-select
76                 v-model="form1.port"
77                 filterable
78                 placeholder="请选择串口"
79                 :disabled="isDisable"
80               >
81                 <el-option
82                   v-for="item in portsList"
83                   :key="item.value"
84                   :label="item.label"
85                   :value="item.value"
86                 >
87                 </el-option>
88               </el-select>
89             </el-form-item>
90             <el-form-item label="波特率">
91               <el-autocomplete
92                 popper-class="my-autocomplete"
93                 v-model="form1.baudRate"
94                 :fetch-suggestions="querySearch"
95                 placeholder="请输入波特率"
96                 :disabled="isDisable"
97               >
98                 <i class="el-icon-edit el-input__icon" slot="suffix"> </i>
99                 <template slot-scope="{ item }">
100                   <div class="name">{{ item.value }}</div>
101                   <span class="addr">{{ item.address }}</span>
102                 </template>
103               </el-autocomplete>
104             </el-form-item>
105             <el-form-item label="数据位">
106               <el-select
107                 v-model="form1.dataBits"
108                 placeholder="请选择数据位"
109                 :disabled="isDisable"
110               >
111                 <el-option label="7" value="7"></el-option>
112                 <el-option label="8" value="8"></el-option>
113               </el-select>
114             </el-form-item>
115             <el-form-item label="停止位">
116               <el-select
117                 v-model="form1.stopBits"
118                 placeholder="请选择停止位"
119                 :disabled="isDisable"
120               >
121                 <el-option label="1" value="1"></el-option>
122                 <el-option label="2" value="2"></el-option>
123               </el-select>
124             </el-form-item>
125
126             <el-form-item label="校验位">
127               <el-select
128                 v-model="form1.parity"
129                 placeholder="请选择校验位"
130                 :disabled="isDisable"
131               >
132                 <el-option label="None" value="none"></el-option>
133                 <el-option label="Even" value="even"></el-option>
134                 <el-option label="Odd" value="odd"></el-option>
135               </el-select>
136             </el-form-item>
137
138             <el-form-item label="流控制">
139               <el-select
140                 v-model="form1.flowControl"
141                 placeholder="请选择流控制"
142                 :disabled="isDisable"
143               >
144                 <el-option label="None" value="none"></el-option>
145                 <el-option label="HardWare" value="hardware"></el-option>
146               </el-select>
147             </el-form-item>
148             <el-form-item label="显示历史">
149               <el-switch
150                 v-model="form1.isShowHistory"
151                 @change="loadHistory"
152               ></el-switch>
153               <el-button
154                 type="danger"
155                 icon="el-icon-delete"
156                 circle
157                 title="清空历史"
158                 @click="clearHistory"
159               ></el-button>
160             </el-form-item>
161             <el-form-item label="发送区设置" v-show="isShowSendArea">
162               <el-form-item label="发送格式">
163                 <el-radio-group v-model="form1.type">
164                   <el-radio label="1">ASCII</el-radio>
165                   <el-radio label="2">HEX</el-radio>
166                 </el-radio-group>
167               </el-form-item>
168               <el-form-item label="发送信息">
169                 <el-input type="textarea" v-model="form1.sendMsg"></el-input>
170               </el-form-item>
171               <el-button type="primary" @click="sendCommon">发送</el-button>
172             </el-form-item>
173
174             <el-form-item>
175               <el-button :type="btnType" @click="connectBtn">{{
176                   btnText
177                 }}</el-button>
178               <el-button type="info" @click="obtainAuthorization"
179               >新增授权</el-button
180               >
181             </el-form-item>
182           </div>
183           </el-col>
184         </el-row>
185       </el-form>
186     </el-dialog>
187   </div>
188 </template>
189 <script>
6a462f 190 import {getIpv4, listStationConf} from "@/api/main/sc/stationConf";
2c7661 191 import {
A 192   noPageListFormulaChild,
6a462f 193   workpieceRelease,
W 194   yzUpdateResults,
195   yzUpdateTighteningFormula
2c7661 196 } from "@/api/main/bs/formulaChild/formulaChild";
A 197 import MySerialPort from "@/utils/MySerialPort";
198 import USBDevice from "@/utils/usb.json";
199 import {addPassingStationCollection} from "@/api/main/da/passingStationCollection/passingStationCollection";
200 import {
201   addTighteningParameters,
6a462f 202   replaceAssemblyCode,
2c7661 203   saveCampaignTimeParameters,
6a462f 204   yzAddBasicParameters,
2c7661 205 } from "@/api/main/da/paramCollection/paramCollection";
A 206
207 export default {
208   name: "stationTerminal",
209   data() {
210     return {
211       showInput: true,
212       serialPortContent: '',
213       // 查询参数
214       formulaChildParams: {
215         pageNum: 1,
216         pageSize: 10,
217         productCode: null,
218         processesCode: null,
219       },
220       // 配方配置子信息表格数据
221       formulaChildList: [],
222       ipAddress: '',
223       imgSrc: '',
224       headContent: {
225         processesCode: 'OP1010',
226         processesName: '贴标机-贴码',
227         sfcCode: '',
228         yzSfcCode: '',
229       },
230       workpieceInformation: {
231         workOrderNo: null,
232         productCode: null,
233         productModel: null,
234         productName: null,
235         beat: null,
236       },
237       // 查询参数
238       queryParams: {
239         pageNum: 1,
240         pageSize: 10,
241         sfcCode: null,
242       },
243       // 查询参数
244       StationConfQueryParams: {
245         pageNum: 1,
246         pageSize: 10,
247         ipAddress: null,
248       },
249       cakeLamp: {
250         plcState: 1, //plc
251         scannerState: 1, //扫码枪
252         InPlace: 0, //工件到位
253         scanFinish: 0,
254         startWork: 0,
255         release: 0 //允许放行
256       },
257       content: '',
258       activeName: 'first',
4a5f2a 259       url: "ws://192.168.2.76:8080/websocket/message/",
2c7661 260       message: "",
A 261       text_content: "",
262       ws: null,
263       inputValue: '9',
264
265       open1: false,
266       input: "",
267       keepReading: true,
268       form1: {
269         baudRate: "115200",
270         dataBits: "8",
271         stopBits: "1",
272         parity: "none",
273         flowControl: "none",
274         desc: "",
275         type: "1",
276         isShowHistory: false,
277       },
278       btnType: "primary",
279       btnText: "连接串口",
280       restaurants: [],
281       portsList: [],
282       isShowSendArea: false,
283       readType: 1,
284       title: "",
285
286       passingStationForm: {},
287       originalArray: [],
288     }
289   },
290   beforeDestroy() {
291     this.exit();
292   },
293   created() {
294     this.initStation();
295     // this.getStationConfList();
296     // setTimeout(() => {
297     //   this.connectWebsocket();
298     // }, 3000);
299   },
300   mounted() {
301     if ("serial" in navigator) {
302       this.myserialport = new MySerialPort();
303       this.getPorts();
304       navigator.serial.addEventListener("connect", (e) => {
305         this.$message.success("设备已连接");
306         this.getPorts();
307       });
308       navigator.serial.addEventListener("disconnect", (e) => {
309         this.$message.error("设备已断开");
310       });
311       this.restaurants = this.loadAll();
312     } else {
313       this.$message.error(
314         "当前为HTTP模式或者浏览器版本过低,不支持网页连接串口"
315       );
316     }
317   },
318   computed: {
319     isDisable() {
320       return this.btnType === "danger";
321     },
322   },
323   methods: {
324     serialLink() {
325       this.open1 = true
326     },
327     bindYzSfc(){
328       if(this.headContent.sfcCode!==""&&this.headContent.yzSfcCode!==""){
329         let param = {
330           sfcCode: this.headContent.sfcCode,
331           locationCode: this.headContent.processesCode,
332           yzSfcCode: this.headContent.yzSfcCode
333         }
334         this.$message('可以绑定!');
335         replaceAssemblyCode(param).then(response => {
336
337         });
338       }
339     },
4a5f2a 340
2c7661 341     Release(){
A 342       // this.$message('portsList!'+this.portsList.length);
343       if(this.btnType === "danger"){
344         this.$message('连接了!');
345
346       }else {
347         this.$message('mei连接了!');
348
349       }
350
351     },
352     serialPortMethod(value){
353       let formulaChildParams = {
354         scanBarcode: value,
355         sfcBarcode: this.headContent.sfcCode,
356         workOrderNo: this.workpieceInformation.workOrderNo,
357         productCode: "1P102S",
358         locationCode: this.headContent.processesCode,
359         collectionTime: new Date()
360       }
361       yzUpdateResults(formulaChildParams).then(response => {
362         this.getListFormulaChild()
363       });
364     },
365     rowStyle({ row }) {
366       if (row.results === 'OK') {
367         return 'background-color: PaleGreen';
368       } else if (row.results === 'NG') {
369         return 'background-color: LightSalmon';
370       }
371       return '';
372     },
373     /** 查询配方配置子信息列表 */
374     getListFormulaChild() {
375       this.formulaChildParams.productCode = "1P102S"
376       this.formulaChildParams.processesCode = this.headContent.processesCode
377       console.log(this.formulaChildParams)
378       noPageListFormulaChild(this.formulaChildParams).then(response => {
379         this.formulaChildList = response.rows;
6a462f 380         if (this.formulaChildList.length >0){
W 381           let pos = 0
382           const tempArr = this.formulaChildList.filter(x=> 'OK' === x.results)
383           if (tempArr.length>0){
384             pos = tempArr.length
385             this.$nextTick(() => {
386               let temp33 = document.getElementsByClassName('el-table__row')
387               console.log('temp33',temp33)
388               console.log('len',temp33.item(pos))
389               if (temp33.length > 0){
390                 console.log('1111111111111111')
391                 let arr = temp33[pos-1]
392                 console.log('srr',arr)
393                 arr.scrollIntoView({ block: 'center' })
394               }
395             })
396           }
397
398         }
2c7661 399       });
A 400     },
401     endClear(){
402
403     },
404     changeMenu(tab, event) {
405       console.log(tab, event);
406     },
407     clearClick(){
408       this.$message('这是一条清除消息提示');
409       this.headContent.sfcCode = null
410     },
411     scanCompleted(){
412       this.$message('扫码完成'+this.content);
413       this.headContent.sfcCode = this.content
414       this.queryParams.sfcCode = this.content
415       this.getList()
416       this.getListFormulaChild()
417       this.cakeLamp.scanFinish = 1
418       this.cakeLamp.startWork = 1
419
420     },
421     /** 查询工单列表 */
422     async getList() {
423       this.getListFormulaChild()
4a5f2a 424       this.addOverStationCollection()
2c7661 425     },
A 426
427     /** 入站增加过站采集记录 **/
428     addOverStationCollection(){
429       this.passingStationForm = {
430         id: null,
4a5f2a 431         // workOrderNo: this.workpieceInformation.workOrderNo,
A 432         productCode: "1P102S",
2c7661 433         locationCode: this.headContent.processesCode,
4a5f2a 434         // model: this.workpieceInformation.productModel,
2c7661 435         productBarcode: this.headContent.sfcCode,
A 436         sfcCode: this.headContent.sfcCode,
437         inboundTime: new Date()
438       }
439       addPassingStationCollection(this.passingStationForm).then(response => {});
4a5f2a 440       yzAddBasicParameters(this.passingStationForm).then(response => {});
2c7661 441     },
A 442     exit() {
443       if (this.ws) {
444         this.ws.close();
445         this.ws = null;
446       }
447     },
448     send() {
449       if (this.ws) {
450         this.ws.send(this.message);
451       } else {
452         alert("未连接到服务器");
453       }
454     },
455
456     initStation: async function () {
457       await getIpv4().then(response => {
458         this.StationConfQueryParams.ipAddress = response.msg
459         console.log('查询到本工位IP为' + this.StationConfQueryParams.ipAddress)
460       });
461       await listStationConf(this.StationConfQueryParams).then(response => {
462         let rows = response.rows[0]
463         if (response.rows.length === 0) {
464           this.$message('该工位没有配置IP,请联系管理员配置IP');
465           return
466         }
467         this.headContent.processesName = rows.processesName
468         this.headContent.processesCode = rows.processesCode
469         console.log('设置工位编码' + this.headContent.processesCode)
470
471       });
472       this.conCom()
473       console.log('websocket连接工位为' + this.headContent.processesCode)
474       const wsuri = this.url + this.headContent.processesCode;
475       this.ws = new WebSocket(wsuri);
476       const self = this;
477       this.ws.onopen = function (event) {
478         this.$message('websocket连接成功!');
479       };
480       this.ws.onmessage = function (event) {
481         if (event.data === "IN") {
482           self.cakeLamp.InPlace = 1;
483         } else if (event.data === "IN0") {
484           self.cakeLamp.InPlace = 0;
485         } else if (event.data === "OUT") {
486           console.log("out")
487
488           const param = {
489             workOrderNo: self.workpieceInformation.workOrderNo,
490             productCode: "1P102S",
491             locationCode: self.headContent.processesCode,
492             productBarcode: self.headContent.sfcCode,
493           }
494           // saveCampaignTimeParameters(param).then(response => {});
495           // self.cakeLamp.release = 1;
496           workpieceRelease(param).then(response => {});
497           self.formulaChildList = [];
498           self.headContent.sfcCode = '';
499           console.log(self.formulaChildList)
500         } else if (event.data === "END") {
501           // const param = {
502           //   workOrderNo: self.workpieceInformation.workOrderNo,
503           //   productCode: self.workpieceInformation.productCode,
504           //   locationCode: self.headContent.processesCode,
505           //   productBarcode: self.headContent.sfcCode,
506           // }
507           // saveCampaignTimeParameters(param).then(response => {});
508           // self.endClear()
509           // workpieceRelease(param).then(response => {});
510         } else if (event.data.includes("[")) {
511           let formulaChilds = "";
512           self.formulaChildList.sort((a, b) => a.stepSort - b.stepSort);
513           self.formulaChildList
514             .filter((formulaChild) => formulaChild.operationType === '1');
515           for (let i = 0; i < self.formulaChildList.length; i++) {
516             let formulaChild = self.formulaChildList[i];
517             let results = formulaChild.results;
518             if (results === '' || results === null || results === 'NG') {
519               formulaChilds = formulaChild;
520               break;
521             }
522           }
523           const param = {
524             tightenTheArray: event.data,
525             paramCode: formulaChilds.paramCode,
4a5f2a 526             // workOrderNo: self.workpieceInformation.workOrderNo,
A 527             productCode: "1P102S",
2c7661 528             locationCode: self.headContent.processesCode,
A 529             productBarcode: self.headContent.sfcCode,
530           }
531           addTighteningParameters(param).then(response => {});
532           yzUpdateTighteningFormula(param).then(response => {
a846f2 533             console.log(response)
A 534             if(response.msg === "1" || response.msg === "3"){
2c7661 535                 self.getListFormulaChild()
A 536             }else {
537               const param = {
538                 workOrderNo: self.workpieceInformation.workOrderNo,
539                 productCode: "1P102S",
540                 locationCode: self.headContent.processesCode,
541                 productBarcode: self.headContent.sfcCode,
542               }
543               saveCampaignTimeParameters(param).then(response => {});
544               workpieceRelease(param).then(response => {});
545               self.formulaChildList = [];
546               self.headContent.sfcCode = '';
547             }
548           });
a846f2 549           // self.getListFormulaChild()
A 550
2c7661 551         }
A 552       };
553     },
554
555
556
557     //接受数据的回调
558     callBack(value) {
559       if (this.form1.isShowHistory) this.form1.desc = this.readLi().join("");
560       else {
561         const scanValue = this.myserialport.hex2atostr(value).replace(/[\r\n]/g, '');
562         console.log("串口收到数据-------------------"+scanValue)
563
564         if(this.headContent.sfcCode !== ''){
a52d08 565           this.$message('预装工位扫描物料编码'+scanValue);
2c7661 566           console.log(scanValue)
A 567           this.serialPortMethod(scanValue)
568         } else {
569           this.headContent.sfcCode = scanValue;
570           this.getList()
571         }
572
573       }
574     },
575     clearHistory() {
576       this.form1.desc = "";
577       this.myserialport.state.readValue = [];
578     },
579     loadHistory() {
580       if (this.form1.isShowHistory) this.form1.desc = this.readLi().join("");
581       else {
582         let temp = this.readLi();
583         if (temp.length > 0) this.form1.desc = temp[temp.length - 1].join("");
584       }
585     },
586     readLi() {
587       let readType = this.readType;
588       return this.myserialport.state.readValue.map((items, index) => {
589         const item = items.value;
590         const type = items.type; // 1接收,2发送
591         let body = [];
592         if (item !== undefined) {
593           let strArr = [];
594           for (let hex of Array.from(item)) {
595             strArr.push(hex.toString(16).toLocaleUpperCase());
596           }
597           if (strArr.includes("D") && strArr.includes("A")) {
598             if (strArr.indexOf("A") - strArr.indexOf("D") === 1) {
599               strArr.splice(strArr.indexOf("D"), 1);
600               strArr.splice(strArr.indexOf("A"), 1, <br key={0} />);
601             }
602           }
603           strArr = strArr.map((item) => {
604             if (typeof item === "string") {
605               if (readType === 1) {
606                 return this.myserialport.hex2a(parseInt(item, 16));
607               } else if (readType === 2) {
608                 return item + " ";
609               }
610             }
611             return item;
612           });
613           if (typeof strArr[strArr.length - 1] === "string") {
614             strArr.push("\r\n");
615           }
616           body.push(strArr.join(""));
617         }
618         return body;
619       });
620     },
621     conCom(){
622       try {
623         this.myserialport.state.baudRate = this.form1.baudRate;
624         this.myserialport.state.dataBits = this.form1.dataBits;
625         this.myserialport.state.stopBits = this.form1.stopBits;
626         this.myserialport.state.parity = this.form1.parity;
627         this.myserialport.state.flowControl = this.form1.flowControl;
628         this.myserialport.openPort(0, true, this.callBack);
629         console.log(this.form1.port)
630       } catch (error) {
631         this.$message.error("串口连接失败!请检查串口是否已被占用");
632       }
633       if (this.myserialport.state.isOpen) {
634         this.$message.success("串口连接成功");
635       }
636     },
637     //连接
638     async connectBtn() {
639       if (this.btnType === "primary") {
640         try {
641           this.myserialport.state.baudRate = this.form1.baudRate;
642           this.myserialport.state.dataBits = this.form1.dataBits;
643           this.myserialport.state.stopBits = this.form1.stopBits;
644           this.myserialport.state.parity = this.form1.parity;
645           this.myserialport.state.flowControl = this.form1.flowControl;
646           await this.myserialport.openPort(this.form1.port, true, this.callBack);
647           console.log(this.form1.port)
648         } catch (error) {
649           this.$message.error("串口连接失败!请检查串口是否已被占用");
650         }
651         if (this.myserialport.state.isOpen) {
652           this.$message.success("串口连接成功");
653           this.open1 = false
654           this.btnType = "danger";
655           this.btnText = "关闭串口";
656         }
657       } else {
658         this.myserialport.openPort(this.form1.port, false, this.callBack);
659         this.$message.success("串口关闭成功");
660         this.btnType = "primary";
661         this.btnText = "连接串口";
662       }
663     },
664     //授权
665     async obtainAuthorization() {
666       if ("serial" in navigator) {
667         console.log("The Web Serial API is supported.");
668         if (!this.myserialport) this.myserialport = new MySerialPort();
669         try {
670           await this.myserialport.handleRequestPort();
671           this.$message.success("串口授权成功");
672           this.getPortInfo(this.myserialport.state.ports);
673         } catch (error) {
674           this.$message.warning("未选择新串口授权!");
675         }
676       } else {
677         this.$message.error(
678           "当前为HTTP模式或者浏览器版本过低,不支持网页连接串口"
679         );
680       }
681     },
682     //串口列表初始化
683     getPortInfo(portList) {
684       this.portsList = [];
685       portList.map((port, index) => {
686         const { usbProductId, usbVendorId } = port.getInfo();
687         if (usbProductId === undefined || usbVendorId === undefined) {
688           this.portsList.push({ label: "未知设备" + index, value: index });
689         } else {
690           const usbVendor = USBDevice.filter(
691             (item) => parseInt(item.vendor, 16) === usbVendorId
692           );
693           let usbProduct = [];
694           if (usbVendor.length === 1) {
695             usbProduct = usbVendor[0].devices.filter(
696               (item) => parseInt(item.devid, 16) === usbProductId
697             );
698           }
699           this.portsList.push({ label: usbProduct[0].devname, value: index });
700         }
701       });
702     },
703     // 发送
704     async sendCommon() {
705       if (this.myserialport.state.isOpen) {
706         if (this.form1.sendMsg.length !== 0) {
707           const writeType = this.form1.type;
708           let value = this.form1.sendMsg;
709           let arr = [];
710           if (writeType === 1) {
711             // ASCII
712             for (let i = 0; i < value.length; i++) {
713               arr.push(this.myserialport.a2hex(value[i]));
714             }
715           } else if (writeType === 2) {
716             // HEX
717             if (/^[0-9A-Fa-f]+$/.test(value) && value.length % 2 === 0) {
718               for (let i = 0; i < value.length; i = i + 2) {
719                 arr.push(parseInt(value.substring(i, i + 2), 16));
720               }
721             } else {
722               this.$message.error("格式错误");
723               return;
724             }
725           }
726           this.myserialport.writeText(arr);
727         } else {
728           this.$message.warning("请输入发送的信息");
729         }
730       } else {
731         this.$message.warning("串口处于关闭状态,请连接串口");
732       }
733     },
734     async getPorts() {
735       await this.myserialport.getPorts();
736       this.getPortInfo(this.myserialport.state.ports);
737     },
738     querySearch(queryString, cb) {
739       var restaurants = this.restaurants;
740       var results = queryString
741         ? restaurants.filter(this.createFilter(queryString))
742         : restaurants;
743       // 调用 callback 返回建议列表的数据
744       cb(results);
745     },
746     createFilter(queryString) {
747       return (restaurant) => {
748         return (
749           restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) ===
750           0
751         );
752       };
753     },
754     loadAll() {
755       return [
756         { value: "110" },
757         { value: "300" },
758         { value: "600" },
759         { value: "1200" },
760         { value: "2400" },
761         { value: "4800" },
762         { value: "7200" },
763         { value: "9600" },
764         { value: "14400" },
765         { value: "19200" },
766         { value: "28800" },
767         { value: "38400" },
768         { value: "56000" },
769         { value: "57600" },
770         { value: "76800" },
771         { value: "115200" },
772         { value: "230400" },
773         { value: "460800" },
774       ];
775     },
776   }
777 }
778
779 </script>
780 <style scoped>
781 .bottom-card{
782   height: 600px;
783 }
784 .circle-button{
785   height: 30px;
786   width: 30px;
787 }
788 .circle-red {
789   background-color: #e01a4f;
790 }
791 .circle-green {
792   background-color: green;
793 }
794 .circle-green-animate {
795   background-color: green;
796   animation: circle-green-animate 2s infinite;
797 }
798   @keyframes circle-green-animate {
799     50% {
800       opacity: 0.6;
801     }
802     0% {
803       opacity: 0.2;
804     }
805   }
806 .head-font{
807   /*font-weight: bold;*/
808   /*font-size: 25px;*/
809 }
810 span{
811   font-size: 15px;
812 }
813 .el-table .warning-row {
814   background: oldlace;
815 }
816
817 .el-table .success-row {
818   background: #f0f9eb;
819 }
820 </style>
821