| | |
| | | <template> |
| | | <div class="title"></div> |
| | | <el-container> |
| | | <!-- <el-header>æ¥å¿</el-header> --> |
| | | <el-main> |
| | | <el-card v-for="(log, index) in logs" :key="index" class="log-card" :style="{ color: log.color }"> |
| | | <div :style="{ color: log.color }">{{ log.logEntry }}</div> |
| | | <div :style="{ color: log.color }">{{ log.time }}</div> |
| | | </el-card> |
| | | </el-main> |
| | | </el-container> |
| | | <div class="container"> |
| | | <div class="input-group"> |
| | | <span class="label">ç«å°ï¼</span> |
| | | <el-select v-model="value1" placeholder="è¯·éæ©" style="width: 40%;"> |
| | | <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="input-group" style="width:50%;"> |
| | | <span class="label">æ¡ç ï¼</span> |
| | | <el-input v-model="input2" placeholder="请è¾å
¥å
容"></el-input> |
| | | </div> |
| | | <div class="input-group"> |
| | | <el-button type="primary" style="width: 50%;" @click="setBorot()">åå
¥</el-button> |
| | | </div> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { ref, onMounted } from 'vue' |
| | | import eventBus from "@/uitils/eventBus"; |
| | | |
| | | export default { |
| | | setup() { |
| | | const logs = ref([]); |
| | | onMounted(() => { |
| | | eventBus.on('Logs', eventData => { |
| | | if (logs.value.length > 500) { |
| | | logs.value = []; |
| | | } |
| | | const logEntry = "æ¥å¿ä¿¡æ¯ï¼" + eventData.log |
| | | const time = "æ¶é´ï¼" + eventData.time |
| | | logs.value.unshift({ logEntry: logEntry, time: time, color: eventData.color }); |
| | | |
| | | // logs.value.unshift(logEntry); |
| | | }); |
| | | }); |
| | | data() { |
| | | return { |
| | | logs |
| | | options: [{ |
| | | value: '1010', |
| | | label: '1010' |
| | | }, { |
| | | value: '2015', |
| | | label: '2015' |
| | | }, { |
| | | value: '2017', |
| | | label: '2017' |
| | | }, { |
| | | value: '2021', |
| | | label: '2021' |
| | | }], |
| | | value1: '', |
| | | input2: '', |
| | | } |
| | | }, |
| | | methods: { |
| | | setBorot() { |
| | | if (this.value1 == "") { |
| | | this.$message.error("è¯·éæ©è¦åå
¥çç«å°"); |
| | | } |
| | | if (this.input2 == "") { |
| | | this.$message.error("è¯·éæ©è¦åå
¥çæ¡ç "); |
| | | } |
| | | this.$confirm("æ¯å¦ç¡®å®éè¦å¯¹è¯¥ç«å°åå
¥æ¡ç ä¿¡æ¯ï¼ï¼ï¼", "æç¤º", { |
| | | // iconClass:"el-icon-success",//el-icon-removeèªå®ä¹å¾æ æ ·å¼ |
| | | confirmButtonText: "确认",//确认æé®æåæ´æ¢ |
| | | cancelButtonText: "åæ¶",//åæ¶æé®æåæ´æ¢ |
| | | // cancelBtn:"åæ¶",//åæ¶æé®æåæ´æ¢ |
| | | showClose: true,//æ¯å¦æ¾ç¤ºå³ä¸è§å
³éæé® |
| | | type: "warning",//æç¤ºç±»å success:æå/info:ä¿¡æ¯/warning:è¦å/error:æ¥é |
| | | }).then(() => { |
| | | var param = { |
| | | DelKeys: [this.value1,this.input2], |
| | | Extra: true |
| | | } |
| | | this.http |
| | | .post("api/Task/SetPlcPalletCode",param, "æ°æ®å¤çä¸...") |
| | | .then((x) => { |
| | | if (x.status) { |
| | | this.$Message.success('æå.'); |
| | | this.refresh(); |
| | | } else { |
| | | return this.$error(x.message); |
| | | } |
| | | }); |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .title { |
| | | line-height: 70vh; |
| | | text-align: center; |
| | | font-size: 28px; |
| | | color: orange; |
| | | .container { |
| | | font-size: 22px; |
| | | margin-top: 20px; |
| | | width: 50%; |
| | | } |
| | | |
| | | .log-card { |
| | | margin-bottom: 10px; |
| | | .input-group { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-bottom: 15px; |
| | | } |
| | | |
| | | .label { |
| | | min-width: 60px; |
| | | /* 为æ ç¾è®¾ç½®æå°å®½åº¦ä¿æå¯¹é½ */ |
| | | margin-right: 10px; |
| | | } |
| | | |
| | | .el-input { |
| | | flex: 1; |
| | | /* è¾å
¥æ¡å æ®å©ä½ç©ºé´ */ |
| | | } |
| | | </style> |