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.
874 lines
23 KiB
874 lines
23 KiB
import { FormSchema } from '@/components/Form';
|
|
import { BasicColumn } from '@/components/Table';
|
|
import { useDictStore } from '@/store/modules/dict';
|
|
import { ref } from 'vue'
|
|
const dictStore = useDictStore();
|
|
|
|
const reformTasksDicts: Array<Object> = dictStore.selectDictArray("reformTasks")
|
|
const roomDicts: Array<Object> = dictStore.selectDictArray("superLeader")
|
|
import { getWorkPlaceTypeDict, getContactorDict, getUserDictByRoles } from '../initiatesProjects/initiatesProjects.api'
|
|
|
|
|
|
|
|
export const columns: BasicColumn[] = [
|
|
|
|
{
|
|
title: '项目编号',
|
|
width: 150,
|
|
dataIndex: 'id',
|
|
ifShow: false,
|
|
},
|
|
{
|
|
title: '项目名称',
|
|
dataIndex: 'projectName',
|
|
width: 300,
|
|
resizable: true,
|
|
align:'left',
|
|
slots: { customRender: 'projectName' },
|
|
},
|
|
{
|
|
title: '行政区划',
|
|
dataIndex: 'adminDivision',
|
|
resizable: true
|
|
},
|
|
{
|
|
title: '责任单位',
|
|
dataIndex: 'dutyWorkplace',
|
|
resizable: true
|
|
},
|
|
{
|
|
title: '单位属性',
|
|
dataIndex: 'workplaceProperties',
|
|
resizable: true
|
|
},
|
|
{
|
|
title: '改革所属项目',
|
|
dataIndex: 'reformName',
|
|
format: 'dict|reformTasks',
|
|
resizable: true
|
|
},
|
|
{
|
|
title: '上级指导处室',
|
|
dataIndex: 'superLeader',
|
|
format: 'dict|superLeader',
|
|
resizable: true
|
|
},
|
|
{
|
|
title: '项目状态',
|
|
dataIndex: 'stage',
|
|
format: 'dict|projectStage',
|
|
filters: 'dict|projectStage',
|
|
resizable: true
|
|
},
|
|
];
|
|
|
|
|
|
export const searchFormSchema: FormSchema[] = [
|
|
{
|
|
label: '项目名称',
|
|
field: 'projectName',
|
|
component: 'Input',
|
|
labelWidth: 'auto'
|
|
//colProps: { span: 6 },
|
|
},
|
|
{
|
|
label: '行政区划',
|
|
field: 'adminDivision',
|
|
component: 'Input',
|
|
labelWidth: 'auto'
|
|
//colProps: { span: 6 },
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '责任单位',
|
|
//字段
|
|
field: 'dutyWorkplace',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'Input',
|
|
labelWidth: 'auto'
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '单位属性',
|
|
//字段
|
|
field: 'workplaceProperties',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'Input',
|
|
labelWidth: 'auto'
|
|
},
|
|
{
|
|
field: 'reformName',
|
|
label: '改革所属项目',
|
|
component: 'DictSelect',
|
|
componentProps: {
|
|
dictType: 'reformTasks',
|
|
},
|
|
itemProps: { validateTrigger: 'blur' },
|
|
labelWidth: 'auto'
|
|
},
|
|
{
|
|
field: 'superLeader',
|
|
label: '上级指导室',
|
|
component: 'DictSelect',
|
|
componentProps: {
|
|
dictType: 'superLeader',
|
|
},
|
|
labelWidth: 'auto'
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
|
export const formSchemas: FormSchema[] = [
|
|
{
|
|
//标题名称
|
|
label: '项目id',
|
|
//字段
|
|
field: 'id',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'Input',
|
|
//标题宽度,支持数字和字符串
|
|
// labelWidth: 150,
|
|
// //标题长度,超过位数隐藏
|
|
// labelLength: 3,
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
ifShow: false,
|
|
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '项目名称',
|
|
//字段
|
|
field: 'projectName',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'Input',
|
|
//标题宽度,支持数字和字符串
|
|
// labelWidth: 150,
|
|
// //标题长度,超过位数隐藏
|
|
// labelLength: 3,
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
required: true,
|
|
},
|
|
{
|
|
label: '行政区划',
|
|
field: 'adminDivision',
|
|
//子标题名称(在主标题后面)
|
|
component: 'Input',
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
required: true,
|
|
},
|
|
// {
|
|
// label: '项目类型',
|
|
// field: 'projectType',
|
|
// component: 'Select',
|
|
// colProps: { span: 12 },
|
|
|
|
// //填写组件Select的属性
|
|
// componentProps: {
|
|
// options:projectTypeDict()
|
|
// },
|
|
// //默认值
|
|
// defaultValue: 1,
|
|
// required: true,
|
|
|
|
// },
|
|
{
|
|
label: '主要任务',
|
|
field: 'description',
|
|
//子标题名称(在主标题后面)
|
|
component: 'InputTextArea',
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 24 },
|
|
required: true,
|
|
},
|
|
|
|
{
|
|
//标题名称
|
|
label: '责任单位',
|
|
//字段
|
|
field: 'dutyWorkplace',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'Input',
|
|
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
required: true,
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '单位属性',
|
|
//字段
|
|
field: 'workplaceProperties',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'Input',
|
|
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
required: true,
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '建设周期(月)',
|
|
//字段
|
|
field: 'constructionPeriod',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'InputNumber',
|
|
componentProps: {
|
|
//数值精度
|
|
precision: 0,
|
|
//步数
|
|
step: 0.1,
|
|
min: 0,
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
required: true,
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '总投资(元)',
|
|
//字段
|
|
field: 'totalMoney',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'InputNumber',
|
|
componentProps: {
|
|
//带标签的 input,设置后置标签
|
|
addonBefore: '保留两位小数',
|
|
//数值精度
|
|
precision: 2,
|
|
//步数
|
|
step: 1,
|
|
min: 0,
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
required: true,
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '中央资金(元)',
|
|
//字段
|
|
field: 'centralMoney',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'InputNumber',
|
|
componentProps: {
|
|
//带标签的 input,设置后置标签
|
|
addonBefore: '保留两位小数',
|
|
//数值精度
|
|
precision: 2,
|
|
//步数
|
|
step: 1,
|
|
min: 0,
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
required: true,
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '省级资金(元)',
|
|
//字段
|
|
field: 'provincialMoney',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'InputNumber',
|
|
componentProps: {
|
|
//带标签的 input,设置后置标签
|
|
addonBefore: '保留两位小数',
|
|
//数值精度
|
|
precision: 2,
|
|
//步数
|
|
step: 1,
|
|
min: 0,
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
required: true,
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '市级资金(元)',
|
|
//字段
|
|
field: 'cityMoney',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'InputNumber',
|
|
componentProps: {
|
|
//带标签的 input,设置后置标签
|
|
addonBefore: '保留两位小数',
|
|
|
|
//数值精度
|
|
precision: 2,
|
|
//步数
|
|
step: 1,
|
|
min: 0,
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
required: true,
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '区县级资金(元)',
|
|
//字段
|
|
field: 'countyMoney',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'InputNumber',
|
|
componentProps: {
|
|
//带标签的 input,设置后置标签
|
|
addonBefore: '保留两位小数',
|
|
|
|
//数值精度
|
|
precision: 2,
|
|
//步数
|
|
step: 1,
|
|
min: 0,
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
required: true,
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '自筹资金(元)',
|
|
//字段
|
|
field: 'selfMoney',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'InputNumber',
|
|
componentProps: {
|
|
//带标签的 input,设置后置标签
|
|
addonBefore: '保留两位小数',
|
|
|
|
//数值精度
|
|
precision: 2,
|
|
//步数
|
|
step: 1,
|
|
min: 0,
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
required: true,
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '2023年支付(元)',
|
|
//字段
|
|
field: 'payamount2023Money',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'InputNumber',
|
|
componentProps: {
|
|
//带标签的 input,设置后置标签
|
|
addonBefore: '保留两位小数',
|
|
|
|
//数值精度
|
|
precision: 2,
|
|
//步数
|
|
step: 1,
|
|
min: 0,
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
required: true,
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '2024年支付(元)',
|
|
//字段
|
|
field: 'payamount2024Money',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'InputNumber',
|
|
componentProps: {
|
|
//带标签的 input,设置后置标签
|
|
addonBefore: '保留两位小数',
|
|
|
|
//数值精度
|
|
precision: 2,
|
|
//步数
|
|
step: 1,
|
|
min: 0,
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
required: true,
|
|
}, {
|
|
//标题名称
|
|
label: '2025年支付(元)',
|
|
//字段
|
|
field: 'payamount2025Money',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'InputNumber',
|
|
componentProps: {
|
|
//带标签的 input,设置后置标签
|
|
addonBefore: '保留两位小数',
|
|
|
|
//数值精度
|
|
precision: 2,
|
|
//步数
|
|
step: 1,
|
|
min: 0,
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
required: true,
|
|
},
|
|
|
|
{
|
|
field: 'reformName',
|
|
label: '改革所属项目',
|
|
component: 'DictSelect',
|
|
componentProps: {
|
|
dictType: 'reformTasks',
|
|
},
|
|
itemProps: { validateTrigger: 'blur' },
|
|
colProps: { span: 12 },
|
|
required: true,
|
|
},
|
|
{
|
|
field: 'superLeader',
|
|
label: '上级指导室',
|
|
required: true,
|
|
component: 'DictSelect',
|
|
componentProps: {
|
|
dictType: 'superLeader',
|
|
},
|
|
itemProps: { validateTrigger: 'blur' },
|
|
colProps: { span: 12 },
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '项目联系人',
|
|
//字段
|
|
field: 'projectContacts',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'ApiSelect',
|
|
componentProps: ({ formModel, formActionType }) => {
|
|
return {
|
|
//
|
|
api: () => getUserDictByRoles({ roles: "projectContact" }),
|
|
showSearch: true,
|
|
filterOption: (input: string, option: any) => { return option.label.toLowerCase().indexOf(input.toLowerCase()) >= 0 },
|
|
onChange: async (value, option) => {
|
|
// formModel.manageContactor = undefined; // reset city value
|
|
const { updateSchema, setFieldsValue } = formActionType;
|
|
if (option?.phone) {
|
|
setFieldsValue({ phone: option.phone })
|
|
}
|
|
},
|
|
};
|
|
},
|
|
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
required: true,
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '联系电话',
|
|
//字段
|
|
field: 'phone',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'Input',
|
|
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
dynamicDisabled: true,
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '管理单位',
|
|
//字段
|
|
field: 'manageOrg',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'ApiSelect',
|
|
componentProps: ({ formModel, formActionType }) => {
|
|
return {
|
|
//
|
|
api: () => getWorkPlaceTypeDict({ roleCode: "manageOrg" }),
|
|
params: {},
|
|
onChange: async (value) => {
|
|
// console.log(e)
|
|
let manageContactorDict = await getContactorDict({ workPlace: value, roleCode: "manageOrg" })
|
|
// formModel.manageContactor = undefined; // reset city value
|
|
const { updateSchema, setFieldsValue } = formActionType;
|
|
updateSchema({
|
|
field: 'manageContactor',
|
|
componentProps: {
|
|
options: manageContactorDict,
|
|
},
|
|
});
|
|
let ischange = true;
|
|
if (manageContactorDict?.length > 0) {
|
|
manageContactorDict.forEach(element => {
|
|
if (formModel.manageContactor == null || element.value == formModel.manageContactor) {
|
|
ischange = false
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
|
|
if (ischange) {
|
|
setFieldsValue({ manageContactor: "" })
|
|
}
|
|
},
|
|
};
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
},
|
|
|
|
{
|
|
//标题名称
|
|
label: '管理单位负责人',
|
|
//字段
|
|
field: 'manageContactor',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'Select',
|
|
componentProps: (({ formModel }) => {
|
|
return {
|
|
options: [],
|
|
}
|
|
|
|
}),
|
|
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '监管单位',
|
|
//字段
|
|
field: 'supervisor',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'ApiSelect',
|
|
componentProps: ({ formModel, formActionType }) => {
|
|
return {
|
|
//
|
|
api: () => getWorkPlaceTypeDict({ roleCode: "supervisor" }),
|
|
showSearch: true,
|
|
filterOption: (input: string, option: any) => { return option.value.toLowerCase().indexOf(input.toLowerCase()) >= 0 },
|
|
onChange: async (value) => {
|
|
let supervisorContactorDict = await getContactorDict({ workPlace: value, roleCode: "supervisor" })
|
|
// formModel.manageContactor = undefined; // reset city value
|
|
const { updateSchema, setFieldsValue } = formActionType;
|
|
updateSchema({
|
|
field: 'supervisorContactor',
|
|
componentProps: {
|
|
options: supervisorContactorDict,
|
|
},
|
|
});
|
|
let ischange = true;
|
|
if (supervisorContactorDict?.length > 0) {
|
|
supervisorContactorDict.forEach(element => {
|
|
if (formModel.supervisorContactor == null || element.value == formModel.supervisorContactor) {
|
|
ischange = false
|
|
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
if (ischange) {
|
|
setFieldsValue({ supervisorContactor: "" })
|
|
}
|
|
},
|
|
};
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '监管单位负责人',
|
|
//字段
|
|
field: 'supervisorContactor',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: [],
|
|
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
},
|
|
|
|
{
|
|
//标题名称
|
|
label: '承建单位',
|
|
//字段
|
|
field: 'contructor',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'ApiSelect',
|
|
componentProps: ({ formModel, formActionType }) => {
|
|
return {
|
|
//
|
|
api: () => getWorkPlaceTypeDict({ roleCode: "contructor" }),
|
|
onChange: async (value) => {
|
|
// console.log(e)
|
|
let contructorContactorDict = await getContactorDict({ workPlace: value, roleCode: "contructor" })
|
|
// formModel.manageContactor = undefined; // reset city value
|
|
const { updateSchema, setFieldsValue } = formActionType;
|
|
updateSchema({
|
|
field: 'contructorContactor',
|
|
componentProps: {
|
|
options: contructorContactorDict,
|
|
},
|
|
});
|
|
let ischange = true;
|
|
if (contructorContactorDict?.length > 0) {
|
|
contructorContactorDict.forEach(element => {
|
|
if (formModel.contructorContactor == null || element.value == formModel.contructorContactor) {
|
|
ischange = false
|
|
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
if (ischange) {
|
|
setFieldsValue({ contructorContactor: "" })
|
|
}
|
|
},
|
|
};
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '承建单位负责人',
|
|
//字段
|
|
field: 'contructorContactor',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: [],
|
|
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
},
|
|
// {
|
|
// //标题名称
|
|
// label: '建设单位',
|
|
// //字段
|
|
// field: 'owner',
|
|
// //组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
// component: 'ApiSelect',
|
|
// componentProps: ({ formModel, formActionType }) => {
|
|
|
|
// return {
|
|
// //
|
|
// api: () => getWorkPlaceTypeDict({ roleCode: "owner" }),
|
|
// onChange: async (value) => {
|
|
// // console.log(e)
|
|
// let ownerContactorDict = await getContactorDict({ workPlace: value, roleCode: "owner" })
|
|
// // formModel.manageContactor = undefined; // reset city value
|
|
// const { updateSchema, setFieldsValue } = formActionType;
|
|
// updateSchema({
|
|
// field: 'ownerContactor',
|
|
// componentProps: {
|
|
// options: ownerContactorDict,
|
|
// }
|
|
// });
|
|
// let ischange = true;
|
|
// if (ownerContactorDict?.length > 0) {
|
|
|
|
// ownerContactorDict.forEach(element => {
|
|
// if (formModel.ownerContactor == null || element.value == formModel.ownerContactor) {
|
|
// ischange = false
|
|
|
|
// return;
|
|
// }
|
|
// });
|
|
// }
|
|
|
|
// if (ischange) {
|
|
// setFieldsValue({ ownerContactor: "" })
|
|
// }
|
|
// },
|
|
// };
|
|
// },
|
|
// //一列占比总共24,比如一行显示2列
|
|
// colProps: { span: 12 },
|
|
// required: true,
|
|
// },
|
|
// {
|
|
// //标题名称
|
|
// label: '建设单位负责人',
|
|
// //字段
|
|
// field: 'ownerContactor',
|
|
// //组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
// component: 'Select',
|
|
// componentProps: {
|
|
// options: [],
|
|
|
|
// },
|
|
// //一列占比总共24,比如一行显示2列
|
|
// colProps: { span: 12 },
|
|
// // required: true,
|
|
// },
|
|
{
|
|
//标题名称
|
|
label: '监理单位',
|
|
//字段
|
|
field: 'controler',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'ApiSelect',
|
|
componentProps: ({ formModel, formActionType }) => {
|
|
|
|
return {
|
|
//
|
|
api: () => getWorkPlaceTypeDict({ roleCode: "controler" }),
|
|
onChange: async (value) => {
|
|
// console.log(e)
|
|
let controlerContactorDict = await getContactorDict({ workPlace: value, roleCode: "controler" })
|
|
// formModel.manageContactor = undefined; // reset city value
|
|
const { updateSchema, setFieldsValue } = formActionType;
|
|
updateSchema({
|
|
field: 'controlerContactor',
|
|
componentProps: {
|
|
options: controlerContactorDict,
|
|
}
|
|
});
|
|
let ischange = true;
|
|
if (controlerContactorDict?.length > 0) {
|
|
|
|
controlerContactorDict.forEach(element => {
|
|
if (formModel.controlerContactor == null || element.value == formModel.controlerContactor) {
|
|
ischange = false
|
|
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
if (ischange) {
|
|
setFieldsValue({ controlerContactor: "" })
|
|
}
|
|
},
|
|
};
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '监理单位负责人',
|
|
//字段
|
|
field: 'controlerContactor',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: [],
|
|
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '咨询单位',
|
|
//字段
|
|
field: 'consult',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'ApiSelect',
|
|
componentProps: ({ formModel, formActionType }) => {
|
|
|
|
return {
|
|
//
|
|
api: () => getWorkPlaceTypeDict({ roleCode: "consult" }),
|
|
onChange: async (value) => {
|
|
// console.log(e)
|
|
let consultContactoDict = await getContactorDict({ workPlace: value, roleCode: "consult" })
|
|
// formModel.manageContactor = undefined; // reset city value
|
|
const { updateSchema, setFieldsValue } = formActionType;
|
|
updateSchema({
|
|
field: 'consultContactor',
|
|
componentProps: {
|
|
options: consultContactoDict,
|
|
}
|
|
});
|
|
let ischange = true;
|
|
if (consultContactoDict?.length > 0) {
|
|
|
|
consultContactoDict.forEach(element => {
|
|
if (formModel.consultContactor == null || element.value == formModel.consultContactor) {
|
|
ischange = false
|
|
|
|
return;
|
|
}
|
|
});
|
|
}
|
|
if (ischange) {
|
|
setFieldsValue({ consultContactor: "" })
|
|
}
|
|
},
|
|
};
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '咨询单位负责人',
|
|
//字段
|
|
field: 'consultContactor',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'Select',
|
|
componentProps: {
|
|
options: [],
|
|
|
|
},
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
},
|
|
{
|
|
//标题名称
|
|
label: '项目状态',
|
|
//字段
|
|
field: 'stage',
|
|
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
|
|
component: 'Input',
|
|
|
|
//一列占比总共24,比如一行显示2列
|
|
colProps: { span: 12 },
|
|
ifShow: false
|
|
}
|
|
];
|
|
|
|
|
|
export const resourcetableColumns: BasicColumn[] = [
|
|
{
|
|
title: '文件名称',
|
|
dataIndex: 'documentName',
|
|
},
|
|
{
|
|
title: '文件大小',
|
|
dataIndex: 'size',
|
|
width: 100,
|
|
customRender: ({ record }) => {
|
|
let kbNum: number = record.size / 1024
|
|
if (kbNum < 1024) {
|
|
return kbNum.toFixed(2).toString() + "KB"
|
|
} else {
|
|
let mbNum: number = kbNum / 1024
|
|
return mbNum.toFixed(2).toString() + "MB"
|
|
}
|
|
|
|
},
|
|
},
|
|
{
|
|
title: '上传时间',
|
|
dataIndex: 'createDate',
|
|
},
|
|
{
|
|
title: '文件状态',
|
|
dataIndex: 'status',
|
|
customRender: ({ record }) => {
|
|
if (record.status == 1) {
|
|
return "有效"
|
|
} else {
|
|
return "历史文件"
|
|
}
|
|
},
|
|
}
|
|
]
|
|
|