You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

127 lines
2.8 KiB
TypeScript

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';
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',
};
},
}
];