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.

622 lines
17 KiB

1 year ago
import { FormSchema } from '/@/components/Form';
import { BasicColumn } from '/@/components/Table';
1 year ago
import { getDictItemsByCode } from '/@/utils/dict/index';
import { UploadTypeEnum } from '/@/components/Form/src/jeecg/components/JUpload';
1 year ago
import { size } from 'lodash-es';
import { el } from 'element-plus/es/locale';
1 year ago
1 year ago
const projectTypeDicts:Array<Object> = getDictItemsByCode("projectType")
const approvalRsesults:Array<Object> = getDictItemsByCode("approvalResult")
1 year ago
import { getWorkPlaceTypeDict, getContactorDict,getUserInfoByid } from '../initiatesProjects/initiatesProjects.api'
let manageOrgDict = await getWorkPlaceTypeDict({ workPlaceType: "1" })
let supervisorDict = await getWorkPlaceTypeDict({ workPlaceType: "2" })
let contructorDict = await getWorkPlaceTypeDict({ workPlaceType: "4" })
let ownerDict = await getWorkPlaceTypeDict({ workPlaceType: "3" })
let controlerDict = await getWorkPlaceTypeDict({ workPlaceType: "6" })
let consultDict = await getWorkPlaceTypeDict({ workPlaceType: "5" })
1 year ago
function projectTypeDict(){
for(let i = 0;i<projectTypeDicts.length;i++){
projectTypeDicts[i].label=projectTypeDicts[i].text;
}
return projectTypeDicts
}
1 year ago
1 year ago
// function approvalRsesult(){
// for(let i = 0;i<approvalRsesults.length;i++){
// approvalRsesults[i].label=approvalRsesults[i].text;
// }
// return approvalRsesults
// }
1 year ago
export const columns: BasicColumn[] = [
{
title: '项目编号',
width: 150,
1 year ago
dataIndex: 'id',
1 year ago
},
{
title: '项目名称',
dataIndex: 'projectName',
width: 150,
},
{
title: '主要任务及标志性成果',
dataIndex: 'description',
width: 150,
},
{
title: '责任单位',
dataIndex: 'dutyWorkplace',
width: 100,
},
{
title: '联系电话',
width: 150,
dataIndex: 'phone',
},
];
export const searchFormSchema: FormSchema[] = [
{
label: '项目名称',
1 year ago
field: 'projectName',
1 year ago
component: 'Input',
//colProps: { span: 6 },
},
{
label: '项目编号',
1 year ago
field: 'projectId',
1 year ago
component: 'Input',
//colProps: { span: 6 },
}
];
1 year ago
export const uploadFileformSchemas: FormSchema[] = [
{
field: 'uploadFile',
component: 'JUpload',
1 year ago
helpMessage: '最多上传3个文件',
1 year ago
label: '上传文件',
1 year ago
componentProps: { maxCount: 3 },
1 year ago
},
{
field: 'uploadImage',
component: 'JUpload',
label: '上传图片',
helpMessage: '无限制上传',
componentProps: {
fileType: UploadTypeEnum.image,
},
},
]
export const formSchemas: FormSchema[] = [
1 year ago
{
//标题名称
label: '项目id',
//字段
field: 'id',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//标题宽度,支持数字和字符串
// labelWidth: 150,
// //标题长度,超过位数隐藏
// labelLength: 3,
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
ifShow:false
},
1 year ago
{
//标题名称
label: '项目名称',
//字段
field: 'projectName',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//标题宽度,支持数字和字符串
// labelWidth: 150,
// //标题长度,超过位数隐藏
// labelLength: 3,
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
{
label: '项目类型',
field: 'projectType',
component: 'Select',
colProps: { span: 12 },
//填写组件Select的属性
componentProps: {
options:projectTypeDict()
},
//默认值
defaultValue: 1,
1 year ago
required: true,
1 year ago
},
{
label: '主要任务',
field: 'description',
//子标题名称(在主标题后面)
component: 'InputTextArea',
//一列占比总共24,比如一行显示2列
colProps: { span: 24 },
1 year ago
required: true,
1 year ago
},
{
//标题名称
label: '责任单位',
//字段
field: 'dutyWorkplace',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
{
//标题名称
label: '建设年限',
//字段
field: 'constructionPeriod',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
{
//标题名称
label: '中央资金',
//字段
field: 'centralMoney',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
{
//标题名称
label: '省级资金',
//字段
field: 'provincialMoney',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
{
//标题名称
label: '市级资金',
//字段
field: 'cityMoney',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
{
//标题名称
label: '区县级资金',
//字段
field: 'countyMoney',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
{
//标题名称
label: '改革所属项目',
//字段
field: 'reformName',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
{
//标题名称
label: '上级指导室',
//字段
field: 'superLeader',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
{
//标题名称
label: '项目联系人',
//字段
field: 'projectContacts',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
{
//标题名称
label: '联系电话',
//字段
field: 'phone',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
{
//标题名称
1 year ago
label: '管理单位',
1 year ago
//字段
field: 'manageOrg',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
1 year ago
component: 'Select',
componentProps: ({ formModel, formActionType }) => {
console.log("formModel", formModel, "formActionType", formActionType)
return {
//
options: manageOrgDict,
onChange: async (value) => {
// console.log(e)
let manageContactorDict = await getContactorDict({ workPlace: value, workPlaceType: "1" })
// formModel.manageContactor = undefined; // reset city value
const { updateSchema, setFieldsValue } = formActionType;
updateSchema({
field: 'manageContactor',
componentProps: {
options: manageContactorDict,
},
});
setFieldsValue({ manageContactor: "" })
},
};
},
1 year ago
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
1 year ago
1 year ago
{
//标题名称
1 year ago
label: '管理单位负责人',
1 year ago
//字段
field: 'manageContactor',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
1 year ago
component: 'Select',
componentProps:(({formModel})=>{
console.log("formModel.manageContactor",formModel,formModel.manageContactor)
return {
options:[]
}
}),
1 year ago
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
{
//标题名称
1 year ago
label: '监管单位',
1 year ago
//字段
1 year ago
field: 'supervisor',
1 year ago
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
1 year ago
component: 'Select',
componentProps: ({ formModel, formActionType }) => {
console.log("formModel", formModel, "formActionType", formActionType)
return {
//
options: supervisorDict,
onChange: async (value) => {
// console.log(e)
let supervisorContactorDict = await getContactorDict({ workPlace: value, workPlaceType: "2" })
// formModel.manageContactor = undefined; // reset city value
const { updateSchema, setFieldsValue } = formActionType;
updateSchema({
field: 'supervisorContactor',
componentProps: {
options: supervisorContactorDict,
},
});
setFieldsValue({ supervisorContactor: "" })
},
};
},
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
required: true,
},
{
//标题名称
label: '监管单位负责人',
//字段
field: 'supervisorContactor',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Select',
componentProps: {
options: [],
1 year ago
1 year ago
},
1 year ago
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
1 year ago
1 year ago
{
//标题名称
1 year ago
label: '承建单位',
1 year ago
//字段
1 year ago
field: 'contructor',
1 year ago
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
1 year ago
component: 'Select',
componentProps: ({ formModel, formActionType }) => {
console.log("formModel", formModel, "formActionType", formActionType)
return {
//
options: contructorDict,
onChange: async (value) => {
// console.log(e)
let contructorContactorDict = await getContactorDict({ workPlace: value, workPlaceType: "4" })
// formModel.manageContactor = undefined; // reset city value
const { updateSchema, setFieldsValue } = formActionType;
updateSchema({
field: 'contructorContactor',
componentProps: {
options: contructorContactorDict,
},
});
setFieldsValue({ contructorContactor: "" })
},
};
},
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
required: true,
},
{
//标题名称
label: '承建单位负责人',
//字段
field: 'contructorContactor',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Select',
componentProps: {
options: [],
1 year ago
1 year ago
},
1 year ago
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
{
//标题名称
1 year ago
label: '建设单位',
1 year ago
//字段
field: 'owner',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
1 year ago
component: 'Select',
componentProps: ({ formModel, formActionType }) => {
console.log("formModel", formModel, "formActionType", formActionType)
return {
//
options: ownerDict,
onChange: async (value) => {
// console.log(e)
let ownerContactorDict = await getContactorDict({ workPlace: value, workPlaceType: "3" })
// formModel.manageContactor = undefined; // reset city value
const { updateSchema, setFieldsValue } = formActionType;
updateSchema({
field: 'ownerContactor',
componentProps: {
options: ownerContactorDict,
}
});
setFieldsValue({ ownerContactor: "" })
},
};
},
1 year ago
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
{
//标题名称
1 year ago
label: '建设单位负责人',
1 year ago
//字段
field: 'ownerContactor',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
1 year ago
component: 'Select',
componentProps: {
options: [],
1 year ago
1 year ago
},
1 year ago
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
required: true,
1 year ago
},
{
//标题名称
1 year ago
label: '监理单位',
1 year ago
//字段
1 year ago
field: 'controler',
1 year ago
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
1 year ago
component: 'Select',
componentProps: ({ formModel, formActionType }) => {
console.log("formModel", formModel, "formActionType", formActionType)
return {
//
options: controlerDict,
onChange: async (value) => {
// console.log(e)
let controlerContactorDict = await getContactorDict({ workPlace: value, workPlaceType: "6" })
// formModel.manageContactor = undefined; // reset city value
const { updateSchema, setFieldsValue } = formActionType;
updateSchema({
field: 'controlerContactor',
componentProps: {
options: controlerContactorDict,
}
});
setFieldsValue({ controlerContactor: "" })
},
};
},
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
},
{
//标题名称
label: '监理单位负责人',
//字段
field: 'controlerContactor',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Select',
componentProps: {
options: [],
1 year ago
1 year ago
},
1 year ago
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
},
{
//标题名称
1 year ago
label: '咨询单位',
1 year ago
//字段
1 year ago
field: 'consult',
1 year ago
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
1 year ago
component: 'Select',
componentProps: ({ formModel, formActionType }) => {
console.log("formModel", formModel, "formActionType", formActionType)
return {
//
options: consultDict,
onChange: async (value) => {
// console.log(e)
let consultContactoDict = await getContactorDict({ workPlace: value, workPlaceType: "5" })
// formModel.manageContactor = undefined; // reset city value
const { updateSchema, setFieldsValue } = formActionType;
updateSchema({
field: 'consultContactor',
componentProps: {
options: consultContactoDict,
}
});
setFieldsValue({ consultContactor: "" })
},
};
},
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
},
{
//标题名称
label: '咨询单位负责人',
//字段
field: 'consultContactor',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Select',
componentProps: {
options: [],
1 year ago
1 year ago
},
1 year ago
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
},
{
//标题名称
label: '项目状态',
//字段
field: 'status',
//组件 支持组件详见 components/Form/src/types/index.ts 中的 ComponentType
component: 'Input',
//一列占比总共24,比如一行显示2列
colProps: { span: 12 },
1 year ago
ifShow:false
1 year ago
}
];
1 year ago
export const approveStartProcessColumns: BasicColumn[] = [
1 year ago
{
title: '节点名称',
dataIndex: 'taskName',
},
{
title: '处理人',
dataIndex: 'operator',
width: 150,
},
{
title: '处理时间',
dataIndex: 'operateDate',
width: 150,
},
{
title: '审批状态',
dataIndex: 'approvalStatue',
width: 100,
customRender: ({ record }) => {
for(let i =0;i<approvalRsesults.length;i++){
if(record.approvalStatue==approvalRsesults[i].value){
return approvalRsesults[i].text
}
}
},
},
{
title: '审批意见',
dataIndex: 'comment',
width: 100,
}
];
1 year ago
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: 'createtime',
}
]