wasteList.vue
1.7 KB
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
<template>
<div class="content">
<table>
<tr>
<th>名称</th>
<th>代码</th>
<th>重量</th>
<th>操作</th>
</tr>
<tr v-for="(item, index) in wasteList" :key="index">
<td>{{ item.wasteName }}</td>
<td>{{ item.wasteCode }}</td>
<td>{{ item.wasteWeight }}/kg</td>
<td :class="'text-center'">
<button @click="Jump(item)">跳转</button>
</td>
</tr>
</table>
</div>
</template>
<script>
import {getWasteInfoList} from '@/api/api';
export default {
name: "wasteList",
data() {
return {
wasteList: []
}
},
created() {
getWasteInfoList().then(res => {
this.wasteList = res.result;
})
},
methods: {
Jump(record) {
var url = this.MTS.base_pro_URL + '/waste/wasteInfo?id=' + record.id + '&type=' + record.picType;
window.location.href = url
},
},
}
</script>
<style scoped>
.app-body {
width: 100%;
height: 100%;
}
.content {
width: 99.1%;
height: 100%;
border: 1px solid yellowgreen;
margin: 0 auto;
}
body {
font-size: 1rem;
}
table,
td,
th {
border-collapse: collapse;
border-spacing: 0;
}
table {
width: 100%;
margin-top: 10px;
}
td,
th {
border: 2px solid #000000;
padding: 5px 10px;
}
th {
background: #42b983;
font-size: 1.2rem;
font-weight: 400;
color: #fff;
cursor: pointer;
}
tr:nth-of-type(odd) {
background: #fff;
}
tr:nth-of-type(even) {
background: #eee;
}
button {
outline: none;
padding: 5px 8px;
color: #fff;
border: 1px solid #bcbcbc;
border-radius: 3px;
background-color: #009a61;
cursor: pointer;
}
button:hover {
opacity: 0.8;
}
.text-center {
text-align: center;
}
</style>