| | |
| | | import { BasicColumn } from '/@/components/Table'; |
| | | import { FormSchema } from '/@/components/Table'; |
| | | import { BasicColumn, FormSchema } from '/@/components/Table'; |
| | | import { h } from 'vue'; |
| | | import { Tag } from 'ant-design-vue'; |
| | | |
| | |
| | | { |
| | | title: '部门名称', |
| | | dataIndex: 'deptName', |
| | | width: 300, |
| | | width: 160, |
| | | align: 'left', |
| | | }, |
| | | { |
| | | title: '排序', |
| | | dataIndex: 'orderNo', |
| | | width: 80, |
| | | width: 50, |
| | | }, |
| | | { |
| | | title: '状态', |
| | | dataIndex: 'status', |
| | | width: 120, |
| | | width: 80, |
| | | customRender: ({ record }) => { |
| | | const status = record.status; |
| | | const enable = ~~status === 0; |
| | | const color = enable ? 'green' : 'red'; |
| | | const text = enable ? '正常' : '停用'; |
| | | const text = enable ? '启用' : '停用'; |
| | | return h(Tag, { color: color }, () => text); |
| | | }, |
| | | }, |
| | |
| | | field: 'parentDept', |
| | | label: '上级部门', |
| | | component: 'TreeSelect', |
| | | |
| | | componentProps: { |
| | | replaceFields: { |
| | | title: 'deptName', |
| | | fieldNames: { |
| | | label: 'deptName', |
| | | key: 'id', |
| | | value: 'id', |
| | | }, |
| | |
| | | field: 'status', |
| | | label: '状态', |
| | | component: 'RadioButtonGroup', |
| | | defaultValue: '0', |
| | | componentProps: { |
| | | options: [ |
| | | { label: '正常', value: '0' }, |
| | | { label: '禁用', value: '1' }, |
| | | { label: '启用', value: '0' }, |
| | | { label: '停用', value: '1' }, |
| | | ], |
| | | }, |
| | | required: true, |