CaiYuanYiTiHua/src/views/demo/statistical/patchsummary/patchsummary.data.ts

214 lines
4.4 KiB
TypeScript

import { BasicColumn, FormSchema } from '@/components/Table';
import { getChildrenTree } from '@/api/demo/system';
const getYearList = () => {
const num = 10;
const currentYear = new Date().getFullYear();
// 存储年份数据的数组
const list: any = [];
// 获取当前年份
// year.value = Number(`${currentYear}`);
list.push({
value: Number(`${currentYear}`),
label: Number(`${currentYear}`),
});
// 获取后面几年的数据
for (let i = 1; i <= num; i++) {
list.push({
value: Number(`${currentYear - i}`),
label: Number(`${currentYear - i}`),
});
}
return list;
};
export const columns: BasicColumn[] = [
{
title: '图斑来源',
dataIndex: 'tubanlaiyuan',
},
{
title: '区县',
dataIndex: 'countyname',
},
{
title: '乡镇',
dataIndex: 'streetname',
},
{
title: '图斑编号',
dataIndex: 'caseno',
width: 200,
},
{
title: '下发时间',
dataIndex: 'identificationtime',
},
{
title: '图斑面积',
dataIndex: 'area',
},
{
title: '耕地面积',
dataIndex: 'gengdiarea',
},
{
title: '判定结果',
dataIndex: 'isillegal',
},
{
title: '当前状态',
dataIndex: 'handlestatusname',
},
{
title: '项目名称',
dataIndex: 'xiangmumc',
},
{
title: '项目主体',
dataIndex: 'xiangmuzhuti',
},
{
title: '实际用途',
dataIndex: 'actualuseto',
},
{
title: '违法类型',
dataIndex: 'weifaleixing',
},
{
title: '整改措施',
dataIndex: 'measurename',
},
];
export const searchFormSchema: FormSchema[] = [
{
field: 'year',
component: 'Select',
colProps: { span: 4 },
label: '年份',
componentProps: {
options: getYearList(),
},
},
{
field: 'tubanlaiyuan',
label: '图斑来源',
component: 'Select',
colProps: { span: 4 },
componentProps: {
options: [
{
label: '全域巡查',
value: '全域巡查',
},
{
label: '卫片下发',
value: '卫片下发',
},
],
},
},
{
field: 'picihao',
label: '批次',
component: 'Input',
colProps: { span: 4 },
},
{
field: 'isBuildName',
label: '标注类型',
component: 'Select',
colProps: { span: 4 },
componentProps: {
options: [
{ label: '在建', value: '在建' },
{ label: '已建成', value: '已建成' },
{ label: '持续变化', value: '持续变化' },
],
},
},
{
field: 'isIllegal',
label: '判定结果',
component: 'Select',
colProps: { span: 4 },
componentProps: {
options: [
{ label: '合法', value: 0 },
{ label: '违法', value: 1 },
{ label: '其他', value: 2 },
],
},
},
{
field: 'nowStatus',
label: '当前状态',
component: 'Select',
componentProps: {
options: [
{ label: '待接收', value: '待接收' },
{ label: '待填报', value: '待填报' },
{ label: '待整改', value: '待整改' },
{ label: '市级审核', value: '市级审核' },
{ label: '县级审核', value: '县级审核' },
{ label: '已归档', value: '已归档' },
],
},
colProps: { span: 4 },
},
{
field: 'measureName',
label: '整改措施',
component: 'Select',
colProps: { span: 4 },
componentProps: {
options: [
{ label: '拆除复耕', value: '0' },
{ label: '补办手续', value: '1' },
],
},
},
{
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: getChildrenTree,
params: { parentId: formModel.countyid },
// 接口参数
resultField: 'result',
labelField: 'name',
valueField: 'id',
};
},
},
{
field: 'caseNo',
label: '图斑编号',
component: 'Input',
colProps: { span: 4 },
},
];