|  | @@ -0,0 +1,72 @@
 | 
	
		
			
				|  |  | +import { PageContainer } from '@ant-design/pro-layout'
 | 
	
		
			
				|  |  | +import LeftMenu from './components/LeftMenu'
 | 
	
		
			
				|  |  | +import { useState } from 'react'
 | 
	
		
			
				|  |  | +import FormRender, { useForm } from 'form-render'
 | 
	
		
			
				|  |  | +import { Button } from 'antd'
 | 
	
		
			
				|  |  | +import { history } from 'umi'
 | 
	
		
			
				|  |  | +export enum BaseMenuEnum {
 | 
	
		
			
				|  |  | +  PROJECT = 1,
 | 
	
		
			
				|  |  | +  COMPANY = 2,
 | 
	
		
			
				|  |  | +  STAFF = 3
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const schema = {
 | 
	
		
			
				|  |  | +  type: 'object',
 | 
	
		
			
				|  |  | +  properties: {
 | 
	
		
			
				|  |  | +    input1: {
 | 
	
		
			
				|  |  | +      title: '简单输入框',
 | 
	
		
			
				|  |  | +      type: 'string',
 | 
	
		
			
				|  |  | +      required: true
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    select1: {
 | 
	
		
			
				|  |  | +      title: '单选',
 | 
	
		
			
				|  |  | +      type: 'string',
 | 
	
		
			
				|  |  | +      enum: ['a', 'b', 'c'],
 | 
	
		
			
				|  |  | +      enumNames: ['早', '中', '晚']
 | 
	
		
			
				|  |  | +    }
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +const Index = () => {
 | 
	
		
			
				|  |  | +  const form = useForm()
 | 
	
		
			
				|  |  | +  const [state, setState] = useState({
 | 
	
		
			
				|  |  | +    activeKey: BaseMenuEnum.PROJECT,
 | 
	
		
			
				|  |  | +    schema: {}
 | 
	
		
			
				|  |  | +  })
 | 
	
		
			
				|  |  | +  const menuOptions = [
 | 
	
		
			
				|  |  | +    { label: '项目信息', value: BaseMenuEnum.PROJECT },
 | 
	
		
			
				|  |  | +    { label: '企事业单位信息', value: BaseMenuEnum.COMPANY },
 | 
	
		
			
				|  |  | +    { label: '人员信息', value: BaseMenuEnum.STAFF }
 | 
	
		
			
				|  |  | +  ]
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +  const gotoDetail = key => {
 | 
	
		
			
				|  |  | +    history.push({
 | 
	
		
			
				|  |  | +      pathname: '/work-setting/schema/detail',
 | 
	
		
			
				|  |  | +      query: {
 | 
	
		
			
				|  |  | +        columnType: key
 | 
	
		
			
				|  |  | +      }
 | 
	
		
			
				|  |  | +    })
 | 
	
		
			
				|  |  | +  }
 | 
	
		
			
				|  |  | +  return (
 | 
	
		
			
				|  |  | +    <PageContainer title={false}>
 | 
	
		
			
				|  |  | +      <div className="h-full w-full flex flex-row">
 | 
	
		
			
				|  |  | +        <LeftMenu
 | 
	
		
			
				|  |  | +          title="基础数据类别"
 | 
	
		
			
				|  |  | +          options={menuOptions}
 | 
	
		
			
				|  |  | +          value={state.activeKey}
 | 
	
		
			
				|  |  | +          onChange={key => setState({ ...state, activeKey: key })}
 | 
	
		
			
				|  |  | +        />
 | 
	
		
			
				|  |  | +        <div className="w-max-3/4 ml-8 bg-white p-4 shadow-card relative ">
 | 
	
		
			
				|  |  | +          <div className="text-right">
 | 
	
		
			
				|  |  | +            <Button onClick={() => gotoDetail(state.activeKey)}>编辑</Button>
 | 
	
		
			
				|  |  | +          </div>
 | 
	
		
			
				|  |  | +          <div>
 | 
	
		
			
				|  |  | +            <FormRender form={form} schema={schema} />
 | 
	
		
			
				|  |  | +          </div>
 | 
	
		
			
				|  |  | +        </div>
 | 
	
		
			
				|  |  | +      </div>
 | 
	
		
			
				|  |  | +    </PageContainer>
 | 
	
		
			
				|  |  | +  )
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +export default Index
 |