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

评奖评优增加汇总页面

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