Commit 1729badb authored by 张伯涛's avatar 张伯涛

状态显示

parent dfdca5bc
import { getAllRoleList, isAccountExist } from '@/api/demo/system';
import { BasicColumn, FormSchema } from '@/components/Table';
import {optionsListApi} from "@/api/demo/select";
import {h} from "vue";
import {Tag} from "ant-design-vue";
/**
* transform mock data
......@@ -44,6 +46,13 @@ export const columns: BasicColumn[] = [
title: '状态',
dataIndex: 'flag',
width: 180,
customRender: ({ record }) => {
const status = record.status;
const enable = ~~status === 0;
const color = enable ? 'green' : 'red';
const text = enable ? '启用' : '停用';
return h(Tag, { color: color }, () => text);
},
},
{
title: '创建时间',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment