# up screen

This commit is contained in:
xianfuxing 2018-08-22 19:17:21 +08:00
parent 0f18df3e03
commit 0c2f582b84
2 changed files with 39 additions and 24 deletions

View File

@ -2,7 +2,7 @@
<div class="screen-wrapper"> <div class="screen-wrapper">
<div class="device-base"> <div class="device-base">
<ul> <ul>
<li>设备: <span>{{this.$store.getters.deviceID}}</span></li> <li>设备: <span>{{deviceID}}</span></li>
<li class="region">地区: <span>尖沙咀</span></li> <li class="region">地区: <span>尖沙咀</span></li>
<li>设备名称: <span>香港大学1号机</span></li> <li>设备名称: <span>香港大学1号机</span></li>
</ul> </ul>
@ -11,22 +11,14 @@
<table cellspacing="0"> <table cellspacing="0">
<tbody> <tbody>
<tr> <tr>
<td>2</td> <td v-for="(item, index) of lastTime" :key="index">
<td>0</td> {{item}}
<td>1</td> </td>
<td>8</td> </tr>
<td>-</td> <tr>
<td>0</td> <td v-for="(item, index) of lastCount" :key="index">
<td>8</td> {{item}}
<td>-</td> </td>
<td>2</td>
<td>2</td>
<td> </td>
<td>1</td>
<td>1</td>
<td>:</td>
<td>3</td>
<td>3</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
@ -38,13 +30,26 @@
<script> <script>
export default { export default {
name: 'screen', name: 'screen',
props: {
deviceID: String,
lastItem: Object
},
data() { data() {
return { return {
//
} }
}, },
methods: { computed: {
// lastTime() {
return this.lastItem.calc_time.split('')
},
lastCount() {
const count = this.lastItem.mosq_count
const qty = 'Qty.' + ' '.repeat(13 - count.length) + '00' + count
return qty.split('')
}
},
mounted() {
console.log()
} }
} }
</script> </script>
@ -59,7 +64,7 @@ export default {
ul { ul {
padding: 0; padding: 0;
li { li {
font-size: .9rem; font-size: 1.1rem;
list-style-type: none; list-style-type: none;
display: inline-block; display: inline-block;
} }
@ -75,11 +80,14 @@ export default {
border: 1px solid #666; border: 1px solid #666;
border-collapse: collapse; border-collapse: collapse;
text-align: center; text-align: center;
margin: 2rem 0 2rem 0;
td { td {
border: 1px solid #666; border: 1px solid #666;
width: 1rem; width: 1rem;
height: 1.5rem; height: 1.5rem;
line-height: 1.5rem; line-height: 1.5rem;
font-weight: 600;
padding: .2rem;
} }
} }
} }

View File

@ -2,7 +2,11 @@
<div class="app-container"> <div class="app-container">
<el-tabs v-model="activeName" @tab-click="handleTabClick"> <el-tabs v-model="activeName" @tab-click="handleTabClick">
<el-tab-pane label="显示屏" name="screen"> <el-tab-pane label="显示屏" name="screen">
<screen></screen> <screen
:deviceID="this.$store.getters.deviceID"
:lastItem="lastItem"
v-if="flag"
></screen>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="趋势图" name="chart">配置管理</el-tab-pane> <el-tab-pane label="趋势图" name="chart">配置管理</el-tab-pane>
</el-tabs> </el-tabs>
@ -70,7 +74,9 @@ export default {
listLoading: true, listLoading: true,
deviceLogs: [], deviceLogs: [],
activeName: 'screen', activeName: 'screen',
total: 0 total: 0,
lastItem: {},
flag: false
} }
}, },
methods: { methods: {
@ -79,6 +85,8 @@ export default {
this.deviceLogs = response.data.results this.deviceLogs = response.data.results
this.total = response.data.count this.total = response.data.count
this.listLoading = false this.listLoading = false
this.lastItem = this.deviceLogs[0]
this.flag = true
}) })
}, },
coordinate(row, column) { coordinate(row, column) {
@ -101,7 +109,6 @@ export default {
created() { created() {
const device_id = this.$store.getters.deviceID const device_id = this.$store.getters.deviceID
this.getDeviceLogs({ device_id }) this.getDeviceLogs({ device_id })
console.log(this.$store.getters.deviceID)
} }
} }
</script> </script>