提交 b7e22edf authored 作者: 钟是志's avatar 钟是志

评奖评优增加汇总页面

上级 41c0930b
...@@ -2,15 +2,10 @@ import React, { Component, Fragment } from 'react'; ...@@ -2,15 +2,10 @@ import React, { Component, Fragment } from 'react';
import SearchDom from '@/highOrderComponent/SearchDom'; import SearchDom from '@/highOrderComponent/SearchDom';
import ButtonListDom from '../ButtonListDom'; import ButtonListDom from '../ButtonListDom';
import Shell from '@/baseComponent/Shell'; import Shell from '@/baseComponent/Shell';
import ColumnsRender from '@/highOrderComponent/ColumnsRender';
import * as services from '@/highOrderComponent/Service';
import StandardTable from '@/components/StandardTable'; import StandardTable from '@/components/StandardTable';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { deepCopy } from '@/baseComponent/utils'; import { deepCopy } from '@/baseComponent/utils';
import { date, format, text } from '../../config';
import moment from 'moment';
import { handleAudit } from '../publicApiService'; import { handleAudit } from '../publicApiService';
import { Tooltip } from 'antd';
import { handleColumns } from '@/webPublic/FormInsertDiy/AffairPage/destruction'; import { handleColumns } from '@/webPublic/FormInsertDiy/AffairPage/destruction';
export default class List extends Component { export default class List extends Component {
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* *
* */ * */
import { message } from 'antd';
import React, { } from 'react'; import React, { } from 'react';
import * as service from '../publicApiService'; import * as service from '../publicApiService';
import AuditPage from './AuditPage'; import AuditPage from './AuditPage';
......
...@@ -314,9 +314,11 @@ export function handleColumns(columns){ ...@@ -314,9 +314,11 @@ export function handleColumns(columns){
if (item.dataType) { if (item.dataType) {
if (text.indexOf(item.dataType) > -1) { // 文本类型字段 if (text.indexOf(item.dataType) > -1) { // 文本类型字段
item.render = (text) => { item.render = (text) => {
if(isJSON(text)){
text = JSON.parse(text);
}
if(item.extendType === 'file' && typeof text === 'string'){ if(item.extendType === 'file' && typeof text === 'string'){
let url = text.includes('http') ? text : config.sqlFormsServer + text; let url = text.includes('http') ? text : config.sqlFormsServer + text;
console.log(url);
return <a href={url} target={'_blank'}>点击查看</a>; return <a href={url} target={'_blank'}>点击查看</a>;
} }
else if (typeof text === 'string' && text.length > 20) { else if (typeof text === 'string' && text.length > 20) {
...@@ -327,14 +329,22 @@ export function handleColumns(columns){ ...@@ -327,14 +329,22 @@ export function handleColumns(columns){
<span key={text}>{newTitle}</span> <span key={text}>{newTitle}</span>
</Tooltip> </Tooltip>
); );
} else if (item.extendType === 'file' && } else if (item.extendType === 'file' && text &&
typeof text === 'object' && Array.isArray(text.files) && text.files.length) { typeof text === 'object' && Array.isArray(text.files) && text.files.length) {
let url = text.files[0].path.includes('http') ? console.log(text);
text.files[0].path : return text.files.map((file,index)=>{
config.sqlFormsServer + text.files[0].path; let url = file.path.includes('http') ?
return <a href={url} target={'_blank'}> file.path :
点击查看 config.sqlFormsServer + file.path;
</a>; return <a href={url}
target={'_blank'}
key={file.name}
style={{marginRight: '10px'}}
>
{file.name}
</a>;
});
} else { } else {
return text; return text;
} }
......
...@@ -7,6 +7,7 @@ const ExportAndDetail = (props) => { ...@@ -7,6 +7,7 @@ const ExportAndDetail = (props) => {
add: false, // 新增 add: false, // 新增
delete: false, // 删除 delete: false, // 删除
detail: true, // 详情 detail: true, // 详情
auditDetail: true, // 审核详情
exportUtil: true, // 导出 exportUtil: true, // 导出
importUtil: false, // 导入 importUtil: false, // 导入
}; };
......
import React, { Fragment } from 'react'; import React, { Fragment } from 'react';
import { Divider, message, Modal, Popconfirm } from 'antd'; import { Divider, message, Modal, Popconfirm } from 'antd';
import moment from 'moment'; import moment from 'moment';
import router from 'umi/router';
import ExportInfo from '../Export/index'; import ExportInfo from '../Export/index';
import { text, number, date, getFormArrayConfig } from '../config/index'; import { date, getFormArrayConfig } from '../config/index';
import { handleColumns } from '../AffairPage/destruction';
import ButtonDiy from '@/baseComponent/ButtonDiy'; import ButtonDiy from '@/baseComponent/ButtonDiy';
import Shell from '../Shell'; import Shell from '../Shell';
import FormArray from '../AffairPage/component/FormArray'; import FormArray from '../AffairPage/component/FormArray';
...@@ -11,7 +11,9 @@ import Edit from '../Edit/index'; ...@@ -11,7 +11,9 @@ import Edit from '../Edit/index';
// import ImportUtil from '../ImportUtil/ImportUtil'; // import ImportUtil from '../ImportUtil/ImportUtil';
import SearchDom from '@/highOrderComponent/SearchDom'; import SearchDom from '@/highOrderComponent/SearchDom';
import StandardTable from '@/components/StandardTable'; import StandardTable from '@/components/StandardTable';
import { getHead, fetchData, deleteItem, add } from './services'; import { getHead, fetchData, deleteItem, add, getDetailId } from './services';
import router from 'umi/router';
const getValue = obj => const getValue = obj =>
Object.keys(obj) Object.keys(obj)
...@@ -77,30 +79,76 @@ class FormList extends React.Component { ...@@ -77,30 +79,76 @@ class FormList extends React.Component {
this.columns = []; this.columns = [];
} }
// 渲染值 // 渲染值
componentDidMount() { componentDidMount() {
this.getTableHead();
}
getTableHead = () => {
const { objId, Authority } = this.props; const { objId, Authority } = this.props;
getHead({ dataObjId: objId }, datas => { getHead({ dataObjId: objId }, datas => {
if (!datas) return; if (!datas) return;
this.setState({ formItem: datas }); datas = datas.filter((x) => {
let i = 0; return x.isHidden !== true;
for (let t in datas) { });
if (i < 10) { for (let item of datas) {
let column = {}; item.extendType = item.extendTypeId;
column.title = datas[t].title; item.dataIndex = item.name;
column.dataIndex = datas[t].name; item.dataType = item.type;
if (date.includes(datas[t].type)) { if (item.isPrimaryKey) {
column.render = val => val && moment(val).format('YYYY-MM-DD HH:mm:ss');
}
this.columns.push(column);
i++;
}
if (datas[t].isPrimaryKey) {
this.setState({ this.setState({
primaryKey: datas[t].name, primaryKey: item.name,
}); });
} }
} }
datas = handleColumns(datas);
if (Authority && Authority.auditDetail) {
datas.push(
{
dataIndex: 'operation',
title: '操作',
fixed: datas.length > 12 ? 'right' : false,
render: (text, record) => {
return (<a onClick={()=>{this.getIdByCode(record.process_biz_key)}}>
流程审核详情
</a> );
/*return (<Link to={
{
pathname: './Detail',
state: {
record: {
id: record.process_biz_key,
},
},
}}>
详情
</Link>);*/
},
},
);
}
this.columns = datas;
this.setState({ formItem: datas });
/* let i = 0;
for (let t in datas) {
/!* if (i < 10) {
let column = {};
column.title = datas[t].title;
column.dataIndex = datas[t].name;
if (date.includes(datas[t].type)) {
column.render = val => val && moment(val).format('YYYY-MM-DD HH:mm:ss');
}
this.columns.push(column);
i++;
}*!/
if (datas[t].isPrimaryKey) {
}
}*/
let searchConfig = []; let searchConfig = [];
for (let item of datas) { for (let item of datas) {
if (item.isShowQuery) { if (item.isShowQuery) {
...@@ -131,7 +179,18 @@ class FormList extends React.Component { ...@@ -131,7 +179,18 @@ class FormList extends React.Component {
this.columns.push(opt);*/ this.columns.push(opt);*/
this.getPage(); this.getPage();
}); });
} };
getIdByCode = (code) => {
getDetailId({code},res=>{
router.push({
pathname: './Detail',
state: {
record: {id: res.id},
}
});
})
};
modify = record => { modify = record => {
const { formItem } = this.state; const { formItem } = this.state;
......
...@@ -7,6 +7,13 @@ export const getHead = (payload, callback) => { ...@@ -7,6 +7,13 @@ export const getHead = (payload, callback) => {
}); });
}; };
export const getDetailId = (payload, callback) => {
uaaRequest('/UnifiedAppFormApi/getDetailByCode', payload).then(res => {
if (!res) return;
if (callback) callback(res);
});
};
export const fetchData = (payload, callback) => { export const fetchData = (payload, callback) => {
uaaRequest('/DataObjApi/getFormDataPage', payload).then(res => { uaaRequest('/DataObjApi/getFormDataPage', payload).then(res => {
if (!res) return; if (!res) return;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论