提交 96732657 authored 作者: 王绍森's avatar 王绍森

修改

上级 4004a61e
import React from 'react';
import PageTypeMatching from '@/highOrderComponent/PageTypeMatching';
import { deepCopy } from '@/baseComponent/utils';
import { getInfo } from '@/highOrderComponent/Service';
const pageSetting = {
type: 'listTab', // 页面类型
tabList: {
tab1: {
key: 0,
name: '待审核',
listConfig: {
selectRows: true, // 是否可以行选择,
paging: true, // 是否可以分页,
searchArea: true, // 是否拥有 搜索区dom,
buttonArea: true, // 是否拥有 按钮区,
},
},
tab2: {
name: '已审核',
key: 1,
listConfig: {
selectRows: true, // 是否可以行选择,
paging: true, // 是否可以分页,
searchArea: true, // 是否拥有 搜索区dom,
buttonArea: true, // 是否拥有 按钮区,
},
},
},
};
const pageButton = {
tab1: [],
tab2: [],
};
export default function AuditPage({ appId }) {
const tab1 = {
search: {
getInfo: (params, url) => getInfo(params, url, { method: 'GET' }),
url: '/common/assigneeTasks',
field: {
appId: {
required: true,
defaultValue: appId,
},
},
condition: [
{
key: 'startTime',
endKey: 'endTime',
name: '创建时间',
type: 'rangePicker',
format: 'YYYY-MM-DD',
},
{
key: 'department',
name: '扣分部门',
type: 'select',
},
],
nameSpan: { big: 8, small: 9 },
fileSpan: { big: 4, small: 3 },
},
tableRowKey: 'id',
columns: [
{
dataIndex: 'insYear',
title: '年度',
},
{
dataIndex: 'totalScore',
title: '扣分分值',
},
{
dataIndex: 'departName',
title: '扣分部门',
},
{
dataIndex: 'reason',
title: '扣分原因',
},
{
dataIndex: 'recorderDate',
title: '时间',
},
{
dataIndex: 'auditStatus',
title: '状态',
render: text => {
switch (text) {
case 4:
return '进行中';
case 5:
return '完成扣分';
case 1:
return '已完成';
case 2:
return <span style={{ color: 'red' }}>进行中</span>;
case 0:
return <span style={{ color: '#1998f0' }}>进行中</span>;
default:
return '';
}
},
},
{
dataIndex: 'operation',
title: '操作',
renderConfig: {
type: 'component',
render: args => {
return null;
},
},
},
],
};
const pageSearch = {
tab1,
tab2: (deepCopy(tab1).search.url = '/common/assigneeDTasks'),
};
return (
<PageTypeMatching pageSetting={pageSetting} pageButton={pageButton} pageSearch={pageSearch} />
);
}
import moment from 'moment';
import React from 'react';
import { Icon } from 'antd';
import { deepCopy, isJSON, } from '@/baseComponent/utils';
import { Link, hashHistory } from 'dva/router';
import { truncate } from 'lodash';
import Detail from './Detail';
const giveProps = ({ auditStatus, unitId, options }) => {
const tab1 = {
search: {
url: '/InstructorDepartApi/getInstitutionPage',
field: {
auditStatus:{
required: true,
defaultValue: auditStatus,
},
flowNode: {
required: true,
defaultValue: 'depart_audit', // 学院分管领导
},
},
beforeGetPage: (data) => {
if(data.institutionId){
data.unitId = data.institutionId;
}
return data;
},
responseCallBack: ({ rows, ...rest }) => {
return {
rows: rows.map(record => {
let { reason } = record;
if (reason && isJSON(reason)) {
const parsed = JSON.parse(reason);
reason = parsed.reason;
const { attachment, remark, isPublish } = parsed;
return {
...record,
reason,
attachment: attachment || [],
remark,
isPublish: !!isPublish,
};
}
return { ...record, reason };
}),
...rest,
};
},
condition: [
{
key: 'startTime',
endKey: 'endTime',
name: '创建时间',
type: 'rangePicker',
format: 'YYYY-MM-DD',
},
{
key: 'department',
name: '扣分部门',
type: 'select',
options,
}
],
nameSpan: { big: 8, small: 9 },
fileSpan: { big: 4, small: 3 },
},
tableRowKey: 'id',
columns: [
{
dataIndex: 'insYear',
title: '年度',
},
{
dataIndex: 'totalScore',
title: '扣分分值',
},
{
dataIndex: 'departName',
title: '扣分部门',
},
{
dataIndex: 'reason',
title: '扣分原因',
render: (text) => {
return truncate(text,{
length: 30,
omission: '...',
});
},
},
{
dataIndex: 'recorderDate',
title: '时间',
render: (text) => {
return text ? moment(text).format('YYYY-MM-DD HH:mm') : '';
}
},
{
dataIndex: 'auditStatus',
title: '状态',
render: (text) => {
switch (text) {
case 4:
return '进行中';
case 5:
return '完成扣分';
case 1:
return '已完成';
case 2:
return (
<span
style={{color: 'red'}}
>
进行中
</span>);
case 0:
return (<span
style={{color: '#1998f0'}}
>
进行中
</span>);
default:
return '';
}
},
},
{
dataIndex: 'operation',
title: '操作',
renderConfig: {
type: 'component',
render: (args)=> {
return (
<Detail
{...args}
unitId={unitId}
/>);
},
},
}
],
};
const tab2 = deepCopy(tab1);
//const tab3 = deepCopy(tab1);
const pageSearch = {
tab1,
tab2,
//tab3,
};
return pageSearch;
};
export default giveProps;
/**
* 入口文件
* 传入Id
* 移动端或web端识别值
* form
* 通过ID生成表单
*/
import React, { useEffect, useState } from 'react';
import RenderForm from '../RenderForm';
import { fetchTemplateById } from '../../Services';
function Entrance({ id, get = 'web', form }) {
const [data, setData] = useState(null);
useEffect(() => {
fetchTemplateById(id).then(res => {
if (res) {
setData(res);
}
});
}, []);
console.log('data', typeof data);
console.log('data', data);
return data ? <RenderForm get={get} postData={data} form={form} /> : null;
}
export default Entrance
......@@ -14,6 +14,9 @@ import { uaaRequest } from './one_stop_public/utils/request';
export const fetchTemplateByCode = code =>
uaaRequest('/UnifiedServicePatternApi/getDetail', { code });
export const fetchTemplateById = id => uaaRequest('/UnifiedAppApi/getDetail', { id });
/**
* 查询表格中某条数据
* @param {String} dataObjId 元数据id
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论