提交 cb92eb5a authored 作者: chscls@163.com's avatar chscls@163.com

修改bug

上级 f5570902
......@@ -32,11 +32,15 @@ import SearchInfo from '../../App/SearchInfo';
import {Base16Encode} from "../../Base16/index";
import baseX from 'base-x'
import {isEmpty} from 'lodash'
import FilePreview from "@/webPublic/one_stop_public/filePreview";
import {queryApiActionPath} from "@/webPublic/one_stop_public/utils/queryConfig";
import UploadCom from "@/webPublic/one_stop_public/libs/UploadCom";
const BASE16 = '0123456789abcdef'
const bs16 = baseX(BASE16)
const FormItem = Form.Item;
let AllWidth = 0; // 表格总长度
const { RangePicker } = DatePicker;
const text = [
'BINARY',
'BIT',
......@@ -104,7 +108,7 @@ const CreateForm = Form.create()(props => {
handleAdd(params, isAdd);
});
};
console.log("isView",isView)
//需要获取动态表单
return (
<Modal
......@@ -232,6 +236,24 @@ class TreeList extends React.Component {
// }
};
isJSON = (str) => {
if (typeof str == 'string') {
try {
var obj = JSON.parse(str);
if (typeof obj == 'object' && obj) {
return true;
} else {
return false;
}
} catch (e) {
console.log('error:' + str + '!!!' + e);
return false;
}
}
console.log('这不是个字符串')
}
delete = record => {
//找出主键
let Keys = {};
......@@ -369,17 +391,16 @@ class TreeList extends React.Component {
pageSize: this.props.pageSize||10,
query: JSON.stringify(this.state.formValues),
};
if(nextProps.value.columns!=null&&nextProps.value.columns.length>0){
this.columns=nextProps.value.columns
}
this.custom=Base16Encode(JSON.stringify(b))
if( nextProps.value.getPage){
this.getPage(params,null,nextProps.value.getPage);
}else{
if(this.state.objId)this.getPage(params)
}
}
const x=nextProps.selects
const y = this.props.selects
......@@ -441,7 +462,27 @@ class TreeList extends React.Component {
}
}else if(datas[t].name.indexOf("process_status")>-1){
column.render=(val)=>val?(val==="0"?"审核通过":"审核未通过"):null
}else if(datas[t].extendTypeId&&datas[t].extendTypeId.indexOf("file")>-1){ //特殊处理附件
column.render =( val) =>{
if(this.isJSON(val)){
val = JSON.parse(val);
let files = val.files;
let xx =( <ul>
{files.map((f, index2) => {
return <li key={index2}><FilePreview
path={queryApiActionPath() + f.path}
pathName={f.name}
/></li>
}
)}
</ul>
)
return xx;
}else {
return val;
}
}
}else{
column.render=(val)=>val&&val.length>100? <Tooltip title={val} overlayStyle={{width:1000}}>
<span style={{width:column.width||200,display:"block", wordBreak:"keep-all",whiteSpace:"nowrap", overflow:"hidden", textOverflow:"ellipsis"}}>{val}</span>
</Tooltip>:val
......@@ -767,6 +808,17 @@ class TreeList extends React.Component {
</FormItem>
);
} else if(item.extendTypeId&&item.extendTypeId.indexOf("file")>-1){
//特殊处理附件 如果是查询就 跳过
if(isQuery) return ;
return (
<FormItem labelCol={labelCol} wrapperCol={wrapperCol} label={item.title} key={item.id}>
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : (formData[item.name]&&this.isJSON(formData[item.name])?JSON.parse(formData[item.name]):null),
rules: [{ required: !item.isNull }],
})(<UploadCom />)}
</FormItem>
);
} else if(isQuery&&item.isGroupQuery!=null&&item.isGroupQuery){ //如果是查询 并且是组合查询
const ops = groups[item.id + ''] || []
......@@ -845,7 +897,7 @@ class TreeList extends React.Component {
form,
get,
} = this.props;
console.log(get)
const { querys } = this.state
if (querys.length == 0) {
return '';
......@@ -962,7 +1014,7 @@ class TreeList extends React.Component {
onClick={this.view.bind(this, record)}>查看详情</a><Divider type="vertical"/></>}
{rights && !rights.includes('edit') ? '' : <><a
onClick={this.modify.bind(this, record)}>编辑</a><Divider type="vertical"/></>}
{rights &&rights.includes("viewProcess")&&record.process_biz_key?<><a onClick={this.viewProcess.bind(this, record)}>查看流程详情</a><Divider type="vertical"/></>:''}
{rights&&rights.includes("viewProcess")&&record.process_biz_key?<><a onClick={this.viewProcess.bind(this, record)}>查看流程详情</a><Divider type="vertical"/></>:''}
{rights && !rights.includes('delete') ? '' : <> <Popconfirm
title="确定删除该数据?"
onConfirm={this.delete.bind(this, record)}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论