index.vue
2.33 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
<template>
<Table
class="fedexDetialTable fedexTableBlack tableHeightAuto bodyTable"
:data="tableData"
:headerData="bodyHeader"
:order="true"
:border="false"
:pagination="false"
:pageSizes="[20, 30, 50, 100]"
noLabel="序号"
rowKey="index"
emptyText="暂无数据"
:rowStyleType="true"
:rowStyleOption="{
key: 'isError',
value: 1,
className: 'tableErrorRow',
}"
:expandRowKeys="expandRowKeys"
>
<template v-slot:unit="scope">
<span>{{ selectDictLabel(scope.row.unit, "unit", "code") }}</span>
</template>
<template v-slot:currency="scope">
<span>{{
selectDictLabel(scope.row.currency, "currency", "value")
}}</span>
</template>
<!-- <template slot="optionColumn">
<el-table-column
header-align="center"
align="center"
label="操作"
width="120"
>
<template slot-scope="scope">
<el-button
type="text"
@click="
expandRowKeys.includes(scope.row.index)
? closeEdit()
: editDetail(scope.row)
"
>
<span v-show="expandRowKeys.includes(scope.row.index)">
<svg-icon icon-class="upIcon" />
{{ $t("entry.detial.form.up") }}
</span>
<span v-show="!expandRowKeys.includes(scope.row.index)"
><svg-icon icon-class="downIcon" />
{{ $t("entry.detial.form.down") }}
</span>
</el-button>
</template>
</el-table-column>
</template> -->
</Table>
</template>
<script>
export default {
props: {
tableData: {
type: Array,
default() {
return [];
},
},
bodyHeader: {
type: Array,
default() {
return [];
},
},
},
data() {
return {
expandRowKeys: [],
};
},
methods: {
editDetail(val) {
this.expandRowKeys = [val.index];
},
closeEdit() {
this.expandRowKeys = [];
},
selectDictLabel(value, dictkey, key) {
let str = value;
this.dictData[dictkey].forEach((item) => {
if (value == item[key]) {
str = item.name;
}
});
return str;
},
},
};
</script>
<style scoped lang="scss">
.fedexDetialTable {
max-height: 310px;
}
</style>