user-identity-table-column.vue
724 Bytes
<script setup lang="ts">
import { eq, get } from 'lodash';
import TableColumn from '@/components/filter/table-column.vue';
const props = defineProps<{ title?: string; dataIndex?: string }>();
const getValue = (record: object) => {
return get(record, props.dataIndex || '', '');
};
</script>
<template>
<TableColumn v-bind="$attrs" :title="title" :data-index="dataIndex">
<template #default="{ record }">
<span v-if="eq(getValue(record), 1)">音乐人</span>
<span v-else-if="[2, 3].includes(Number(getValue(record)))">经纪人</span>
<span v-else style="color: rgba(44, 44, 44, 0.5)">未认证</span>
</template>
</TableColumn>
</template>
<style scoped lang="less"></style>