| | |
| | | import {BasicColumn} from '/@/components/Table'; |
| | | import {FormSchema} from '/@/components/Table'; |
| | | import {rules} from "/@/utils/helper/validator"; |
| | | |
| | | //列表数据 |
| | | export const columns: BasicColumn[] = [ |
| | |
| | | align:"center", |
| | | dataIndex: 'english' |
| | | }, |
| | | { |
| | | title: '药材分类', |
| | | align: 'center', |
| | | dataIndex: 'type_dictText', |
| | | }, |
| | | { |
| | | title: '药用部位', |
| | | align:"center", |
| | |
| | | align:"center", |
| | | dataIndex: 'usageTaboo' |
| | | }, |
| | | { |
| | | title: '租户id', |
| | | align:"center", |
| | | dataIndex: 'tenantId' |
| | | }, |
| | | // { |
| | | // title: '租户id', |
| | | // align:"center", |
| | | // dataIndex: 'tenantId' |
| | | // }, |
| | | ]; |
| | | //查询数据 |
| | | export const searchFormSchema: FormSchema[] = [ |
| | |
| | | component: 'JInput', |
| | | colProps: {span: 6}, |
| | | }, |
| | | { |
| | | label: "英文名", |
| | | field: 'english', |
| | | component: 'JInput', |
| | | colProps: {span: 6}, |
| | | }, |
| | | { |
| | | label: "产地分布", |
| | | field: 'origin', |
| | | component: 'JInput', |
| | | colProps: {span: 6}, |
| | | }, |
| | | { |
| | | label: "功效与作用", |
| | | field: 'efficacy', |
| | | component: 'JInput', |
| | | colProps: {span: 6}, |
| | | }, |
| | | // { |
| | | // label: "英文名", |
| | | // field: 'english', |
| | | // component: 'JInput', |
| | | // colProps: {span: 6}, |
| | | // }, |
| | | // { |
| | | // label: "产地分布", |
| | | // field: 'origin', |
| | | // component: 'JInput', |
| | | // colProps: {span: 6}, |
| | | // }, |
| | | // { |
| | | // label: "功效与作用", |
| | | // field: 'efficacy', |
| | | // component: 'JInput', |
| | | // colProps: {span: 6}, |
| | | // }, |
| | | { |
| | | label: '药材分类', |
| | | field: 'type', |
| | | component: 'JTreeSelect', |
| | | componentProps: { |
| | | dict: 'dry_herb_type,name,id', |
| | | pidField: 'pid', |
| | | hasChildField: 'has_child', |
| | | converIsLeafVal: 1, |
| | | }, |
| | | colProps: { span: 6 }, |
| | | }, |
| | | ]; |
| | | //表单数据 |
| | | export const formSchema: FormSchema[] = [ |
| | |
| | | label: '中药名', |
| | | field: 'name', |
| | | component: 'Input', |
| | | dynamicRules: ({ model, schema }) => { |
| | | return [{ required: true, message: '请输入药材名称!' }, { ...rules.duplicateCheckRule('dry_herb_info', 'name', model, schema)[0] }] |
| | | }, |
| | | }, |
| | | { |
| | | label: '拼音', |
| | | field: 'pinyin', |
| | | component: 'Input', |
| | | dynamicRules: ({ model, schema }) => { |
| | | return [{ required: true, message: '请输入药材拼音!' }, { ...rules.duplicateCheckRule('dry_herb_info', 'pinyin', model, schema)[0] }] |
| | | }, |
| | | }, |
| | | { |
| | | label: '别名', |
| | |
| | | label: '英文名', |
| | | field: 'english', |
| | | component: 'Input', |
| | | }, |
| | | { |
| | | label: '药材分类', |
| | | field: 'type', |
| | | component: 'JTreeSelect', |
| | | componentProps: { |
| | | dict: 'dry_herb_type,name,id', |
| | | pidField: 'pid', |
| | | hasChildField: 'has_child', |
| | | converIsLeafVal: 1, |
| | | }, |
| | | dynamicRules: ({ model, schema }) => { |
| | | return [{ required: true, message: '请输入药材分类!' }] |
| | | }, |
| | | }, |
| | | { |
| | | label: '药用部位', |
| | |
| | | field: 'usageTaboo', |
| | | component: 'Input', |
| | | }, |
| | | { |
| | | label: '租户id', |
| | | field: 'tenantId', |
| | | component: 'InputNumber', |
| | | }, |
| | | // { |
| | | // label: '租户id', |
| | | // field: 'tenantId', |
| | | // component: 'InputNumber', |
| | | // }, |
| | | // TODO 主键隐藏字段,目前写死为ID |
| | | { |
| | | label: '', |