湖州项目前端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
2.1 KiB

9 months ago
import { FormSchema } from '@/components/Form';
import { BasicColumn } from '@/components/Table';
import { useDictStore } from '@/store/modules/dict';
import { getDutyWorkplaceList, getadminDivisionList } from './countStatistics.api';
import { get } from 'sortablejs';
let dutyWorkplaceOption=[]
let adminDivisionOption=[]
async function getDutyWorkplaceOptions() {
let list = await getDutyWorkplaceList();
let uniqueList = [...new Set(list)];
9 months ago
let res= uniqueList.map(item => {
return {
label: item,
value: item
}
})
console.log("wwres",res)
return res
}
async function getadminDivisionOptions() {
let list = await getadminDivisionList();
let uniqueList = [...new Set(list)];
let res= uniqueList.map(item => {
return {
label: item,
value: item
}
})
console.log("wres",res)
return res
}
9 months ago
export const countStatisticsColumns: BasicColumn[] = [
{
title: '责任单位',
width: 150,
dataIndex: 'dutyWorkplace',
9 months ago
},
{
title: '行政区划',
dataIndex: 'adminDivision',
9 months ago
width: 150,
},
{
title: '已提交稿件数量',
dataIndex: 'countNumber',
9 months ago
width: 150,
sorter: true,
}
];
export const searchFormSchema: FormSchema[] = [
{
label: '责任单位',
field: 'dutyWorkplace',
9 months ago
component: 'Input',
colProps: { span: 6 },
},
{
label: '行政区划',
field: 'adminDivision',
9 months ago
component: 'Input',
colProps: { span: 6 },
},
]
export const countStatisticsFormSchema: FormSchema[] = [
{label:"id",
field: 'id',
component: 'Input',
show:false,
},
9 months ago
{
label: '责任单位',
field: 'dutyWorkplace',
required: true,
component: 'Select',
componentProps: {
options:await getDutyWorkplaceOptions()
},
9 months ago
colProps: { span:12},
},
{
label: '行政区划',
field: 'adminDivision',
required: true,
component: 'Select',
9 months ago
componentProps: {
options:await getadminDivisionOptions()
9 months ago
},
colProps: { span:12 },
},
{
label: '已提交稿件数量',
field: 'countNumber',
component: 'InputNumber',
9 months ago
required: true,
colProps: { span: 12 },
}
];