干燥机配套车间生产管理系统/云平台服务端
baoshiwei
2024-05-27 fa3ac93010bea3805438ee3ab0a182bfbf7423da
src/views/dry/dataDefine/DryEqpType.data.ts
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,65 @@
import { BasicColumn, FormSchema } from '/@/components/Table'
import { rules } from '/@/utils/helper/validator'
//列表数据
export const columns: BasicColumn[] = [
   {
      title: '编码',
      align: 'center',
      dataIndex: 'code',
   },
   {
      title: '名称',
      align: 'center',
      dataIndex: 'name',
   },
]
//查询数据
export const searchFormSchema: FormSchema[] = [
   {
      label: '编码',
      field: 'code',
      component: 'Input',
      colProps: { span: 6 },
   },
   {
      label: '名称',
      field: 'name',
      component: 'Input',
      colProps: { span: 6 },
   },
]
//表单数据
export const formSchema: FormSchema[] = [
   {
      label: '编码',
      field: 'code',
      component: 'Input',
      dynamicRules: ({ model, schema }) => {
         return [{ required: true, message: '请输入编码!' }, { ...rules.duplicateCheckRule('dry_eqp_type', 'code', model, schema)[0] }]
      },
   },
   {
      label: '名称',
      field: 'name',
      component: 'Input',
      dynamicRules: ({ model, schema }) => {
         return [{ required: true, message: '请输入名称!' }, { ...rules.duplicateCheckRule('dry_eqp_type', 'name', model, schema)[0] }]
      },
   },
   // TODO ä¸»é”®éšè—å­—段,目前写死为ID
   {
      label: '',
      field: 'id',
      component: 'Input',
      show: false,
   },
]
/**
 * æµç¨‹è¡¨å•调用这个方法获取formSchema
 * @param param
 */
export function getBpmFormSchema(_formData): FormSchema[] {
   // é»˜è®¤å’ŒåŽŸå§‹è¡¨å•ä¿æŒä¸€è‡´ å¦‚果流程中配置了权限数据,这里需要单独处理formSchema
   return formSchema
}