index.vue
1.17 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
<template>
<el-tooltip :content="$t('common.columnSettings')" placement="top">
<el-popover width="200" popper-class="columnSetting-popover">
<el-link icon="icon-ym icon-ym-options NCC-common-head-icon" :underline="false"
slot="reference" />
<NCC-table :data="data" class="columnTable" :hasNO="false" size="mini" ref="columnTable"
@selection-change="columnSelectionChange" @row-click="handleRowClick">
<el-table-column prop="label" label="列表字段" />
<el-table-column type="selection" width="50" align="center" />
</NCC-table>
</el-popover>
</el-tooltip>
</template>
<script>
export default {
name: 'ColumnSettings',
model: {
prop: 'value',
event: 'change'
},
props: {
value: Array,
data: {
type: Array,
default: () => []
}
},
mounted() {
this.$refs.columnTable.$refs.NCCTable.toggleAllSelection()
},
methods: {
handleRowClick(row) {
this.$refs.columnTable.$refs.NCCTable.toggleRowSelection(row)
},
columnSelectionChange(val) {
this.$emit('change', val)
}
}
}
</script>
<style lang="scss">
.columnSetting-popover {
padding: 0 !important;
}
</style>