| | |
| | | import { BasicColumn } from '/@/components/Table'; |
| | | import { FormSchema } from '/@/components/Table'; |
| | | import { h } from 'vue'; |
| | | import { h, unref } from 'vue'; |
| | | import { Tag } from 'ant-design-vue'; |
| | | import { Icon } from '/@/components/Icon'; |
| | | import Icon from '@/components/Icon/Icon.vue'; |
| | | import { GetEnum } from '/@/api/tigerapi/system'; |
| | | import { useLocale } from '/@/locales/useLocale'; |
| | | |
| | | const { getLocale } = useLocale(); |
| | | export const columns: BasicColumn[] = [ |
| | | { |
| | | title: '菜单名称', |
| | |
| | | dataIndex: 'orderNo', |
| | | width: 100, |
| | | customRender: ({ record }) => { |
| | | return h("h1", null, record.orderNo); //渲染单元格数据,h是返回一个“虚拟节点 (virtual node)” |
| | | return h('h1', null, record.orderNo); //渲染单元格数据,h是返回一个“虚拟节点 (virtual node)” |
| | | }, |
| | | }, |
| | | { |
| | |
| | | title: '创建时间', |
| | | dataIndex: 'createTime', |
| | | }, |
| | | { |
| | | title: '按钮类型', |
| | | dataIndex: 'btnType', |
| | | ifShow: false, |
| | | }, |
| | | { |
| | | title: '执行方法', |
| | | dataIndex: 'doMethod', |
| | | ifShow: false, |
| | | }, |
| | | ]; |
| | | |
| | | const isDir = (type: string) => type === '0'; |
| | |
| | | component: 'Input', |
| | | colProps: { span: 8 }, |
| | | }, |
| | | { |
| | | field: 'status', |
| | | label: '状态', |
| | | component: 'Select', |
| | | componentProps: { |
| | | options: [ |
| | | { label: '启用', value: '1' }, |
| | | { label: '停用', value: '0' }, |
| | | ], |
| | | }, |
| | | colProps: { span: 8 }, |
| | | }, |
| | | // { |
| | | // field: 'status', |
| | | // label: '状态', |
| | | // component: 'Select', |
| | | // componentProps: { |
| | | // options: [ |
| | | // { label: '启用', value: '1' }, |
| | | // { label: '停用', value: '0' }, |
| | | // ], |
| | | // }, |
| | | // colProps: { span: 8 }, |
| | | // }, |
| | | ]; |
| | | |
| | | export const formSchema: FormSchema[] = [ |
| | |
| | | label: '图标', |
| | | component: 'IconPicker', |
| | | required: ({ values }) => isDir(values.func_type), |
| | | ifShow: ({ values }) => !isButton(values.func_type), |
| | | ifShow: ({ values }) => true, //!isButton(values.func_type), |
| | | }, |
| | | |
| | | { |
| | |
| | | ifShow: ({ values }) => isMenu(values.func_type), |
| | | }, |
| | | { |
| | | field: 'btnType', |
| | | label: '按钮类型', |
| | | component: 'ApiSelect', |
| | | defaultValue: 0, |
| | | componentProps: { |
| | | api: GetEnum, |
| | | params: { name: 'SYS_MENU+BUTTON_TYPEs' }, |
| | | resultField: 'Data', |
| | | labelField: unref(getLocale) == 'zh_CN' ? 'Desc' : 'Name', |
| | | valueField: 'Value', |
| | | placeholder: '请选择按钮类型', |
| | | }, |
| | | ifShow: ({ values }) => isButton(values.func_type), |
| | | }, |
| | | { |
| | | field: 'doMethod', |
| | | label: '执行方法名', |
| | | component: 'Input', |
| | | ifShow: ({ values }) => isButton(values.func_type), |
| | | }, |
| | | { |
| | | field: 'func_code', |
| | | label: '权限标识', |
| | | component: 'Input', |
| | | dynamicDisabled:true, |
| | | dynamicDisabled: true, |
| | | ifShow: ({ values }) => !isDir(values.func_type), |
| | | }, |
| | | { |
| | | field: 'func_group', |
| | | label: '功能组', |
| | | component: 'Input', |
| | | defaultValue: '', |
| | | }, |
| | | { |
| | | field: 'status', |
| | |
| | | }, |
| | | ifShow: ({ values }) => isMenu(values.func_type), |
| | | }, |
| | | |
| | | { |
| | | field: 'show', |
| | | label: '是否显示', |