|
@@ -8,9 +8,11 @@
|
|
<el-table-column label="操作" align="center">
|
|
<el-table-column label="操作" align="center">
|
|
<template v-slot="{ row, $index }">
|
|
<template v-slot="{ row, $index }">
|
|
<template v-for="(item, index) in opera">
|
|
<template v-for="(item, index) in opera">
|
|
- <el-tooltip :key="index" effect="dark" :content="item.label" placement="bottom">
|
|
|
|
- <el-button :key="index" type="text" :icon="item.icon || ''" size="mini" @click="handleOpera(row, item.method)"></el-button>
|
|
|
|
- </el-tooltip>
|
|
|
|
|
|
+ <template v-if="display(item, row)">
|
|
|
|
+ <el-tooltip :key="index" effect="dark" :content="item.label" placement="bottom">
|
|
|
|
+ <el-button :key="index" type="text" :icon="item.icon || ''" size="mini" @click="handleOpera(row, item.method)"></el-button>
|
|
|
|
+ </el-tooltip>
|
|
|
|
+ </template>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -46,6 +48,14 @@ export default {
|
|
handleOpera(data, method) {
|
|
handleOpera(data, method) {
|
|
this.$emit(method, data);
|
|
this.$emit(method, data);
|
|
},
|
|
},
|
|
|
|
+ display(item, row) {
|
|
|
|
+ let display = _.get(item, `display`, true);
|
|
|
|
+ if (display === true) return true;
|
|
|
|
+ else {
|
|
|
|
+ let res = display(row);
|
|
|
|
+ return res;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|