import { BasicColumn, FormSchema } from '@/components/Table'; import { h } from 'vue'; import { Tag } from 'ant-design-vue'; import { getChildrenTree } from '@/api/demo/system'; import { getLoad } from '@/api/sys/sysDataItemDetail'; import { SubjectKeyList } from '../../util'; export const code = '100002' export const subjectKey = SubjectKeyList[code]; export const columns: BasicColumn[] = [ { title: '原始线索编号', dataIndex: 'original_case_no', width: 200, }, { title: '线索编号', dataIndex: 'case_no', width: 200, }, { title: '线索描述', dataIndex: 'case_description', width: 300, }, { title: '线索类型', dataIndex: 'typename', }, { title: '县', dataIndex: 'countyname', }, { title: '镇', dataIndex: 'streetname', }, { title: '判读人', dataIndex: 'identification_user', }, { title: '判读时间', dataIndex: 'createtime', }, { title: '状态', dataIndex: 'checkstatus', customRender: ({ record }) => { const { checkstatus } = record; if(checkstatus == '待审核'){ return h(Tag, { color: 'yellow' }, () => checkstatus); }else if(checkstatus == '已审核'){ return h(Tag, { color: 'green' }, () => checkstatus); } return h(Tag, {}, () => checkstatus); } }, ]; export const searchFormSchema: FormSchema[] = [ { field: 'originalCaseNo', label: '原始线索编号', component: 'Input', colProps: { span: 5 }, componentProps: { placeholder: '请输入原始编号', }, }, { field: 'caseNo', label: '线索编号', component: 'Input', colProps: { span: 5 }, componentProps: { placeholder: '请输入线索编号', }, }, { field: 'typename', label:'线索类型', component: 'ApiSelect', colProps: { span: 4 }, componentProps: ({formModel}) => { return { api: getLoad, params: { code: 'kctubanleixing' }, // 接口参数 resultField: 'result', labelField: 'itemName', valueField: 'itemValue', }; }, }, { field: 'countyid', label:'县/区', component: 'ApiSelect', colProps: { span: 4 }, componentProps: ({ tableAction, formModel }) => { return { api: getChildrenTree, params: { parentId: 371300 }, // 接口参数 resultField: 'result', labelField: 'name', valueField: 'id', onChange: () => { formModel.streetid = ''; }, }; }, }, { field: 'streetid', label:'乡镇/街道', component: 'ApiSelect', colProps: { span: 4 }, componentProps: ({ formModel }) => { return { api: formModel.countyid && getChildrenTree, params: { parentId: formModel.countyid }, // 接口参数 resultField: 'result', labelField: 'name', valueField: 'id', }; }, }, { field: 'nowStatus', label: '状态', component: 'Select', colProps: { span: 4 }, componentProps: { options: [ { label: '待审核', value: '待审核'}, { label: '复提', value: '复提'}, ], }, defaultValue: '待审核', }, ]; export const dictionary = { _input_39: 'case_no', _input_15: 'typename', _input_16: 'case_description', _input_3: 'countyid', _input_10: 'streetid', _input_ca1c543fcf014e6abdcb6d329d796cee: 'communityid', _input_43: 'area', _input_18fd0953784b4c35b9219bd6defaf376: 'gengdi_area', _input_42fed651e58c4b5daf9868ff6a0da3b0: 'shengtaibaohuhongxian_area', _input_520d1d8068f4492ea8c42ce9bb61b3cf: 'nongyongdi_area', _input_039dd978de5c4176b2913eae5ba60844: 'yongjiujibennongtian_area', _input_17: 'remark', _input_4: 'lng', _input_14: 'lat', _input_44: 'identification_time', _image_upload_369: 'casepic', }