提交 f214c831 authored 作者: 徐立's avatar 徐立

暂存

上级 7fc3df49
......@@ -35,6 +35,7 @@ export default class index extends Component {
};
render() {
let { path, pathName, width, height } = this.props;
console.log(path, '????');
const { visible } = this.state;
let isShow =
pathName?.indexOf('.pdf') !== -1 ||
......
......@@ -16,7 +16,7 @@ import {
Tree,
Popconfirm,
Tooltip,
Spin
Spin,
} from 'antd';
import { connect } from 'dva';
import PageHeaderWrapper from './PageHeaderWrapper';
......@@ -30,11 +30,11 @@ import ExportCurrentInfo from '../../App/ExportCurrentInfo';
import StatisticsInfo from '../../App/StatisticsInfo';
import ImportUtil from '../../App/ImportUtil';
import SearchInfo from '../../App/SearchInfo';
import {Base16Encode} from "../../Base16/index";
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";
import { Base16Encode } from '../../Base16/index';
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 FormItem = Form.Item;
let AllWidth = 0; // 表格总长度
const { RangePicker } = DatePicker;
......@@ -83,21 +83,21 @@ const CreateForm = Form.create()(props => {
handleModalVisible,
formItem,
getItem,
isView
isView,
} = props;
//通过回调
const okHandle = () => {
form.validateFields((err, fieldsValue) => {
if (err) return;
if(isView){
if (isView) {
handleModalVisible();
return;
}
formItem.map((item, index) => {
if (item.type.indexOf('DATE') > -1) {
for (let d in fieldsValue) {
if (item.name === d&&fieldsValue[d]) {
if (item.name === d && fieldsValue[d]) {
fieldsValue[d] = fieldsValue[d].format('YYYY-MM-DD HH:mm:ss');
}
}
......@@ -107,44 +107,51 @@ const CreateForm = Form.create()(props => {
handleAdd(params, isAdd);
});
};
//需要获取动态表单
return (
<Modal
width="700px"
maskClosable={false}
destroyOnClose
title={isView?"查看详情":(isAdd ? '新增' : '编辑')}
title={isView ? '查看详情' : isAdd ? '新增' : '编辑'}
visible={modalVisible}
footer={isView?null:[
<Button key="back" onClick={() => handleModalVisible()}>
取消
</Button>,
<Button key="submit" type="primary" onClick={okHandle}>
确定
</Button>
]}
footer={
isView
? null
: [
<Button key="back" onClick={() => handleModalVisible()}>
取消
</Button>,
<Button key="submit" type="primary" onClick={okHandle}>
确定
</Button>,
]
}
onOk={okHandle}
onCancel={() => handleModalVisible()}
>
{formItem.map((item, index) => getItem(false,form, item, isAdd, formData, { span: 5 }, { span: 15 }))}
{formItem.map((item, index) =>
getItem(false, form, item, isAdd, formData, { span: 5 }, { span: 15 }),
)}
</Modal>
);
});
@connect(({ formList, loading }) => ({
formList, loading: loading.models.formList,
formList,
loading: loading.models.formList,
}))
@Form.create()
class TreeList extends React.Component {
constructor(props){
super(props)
const{json:{treeTitleName,treeKeyName}}=this.props
const root={}
root[treeTitleName]= '根目录'
root[treeKeyName]='0-0'
constructor(props) {
super(props);
const {
json: { treeTitleName, treeKeyName },
} = this.props;
const root = {};
root[treeTitleName] = '根目录';
root[treeKeyName] = '0-0';
this.state = {
data: {
list: [],
......@@ -152,76 +159,78 @@ class TreeList extends React.Component {
},
treeData: [root],
isReady: false,
parentName: "根节点",
parentName: '根节点',
parentId: null,
selects:[],
selects: [],
modalVisible: false,
formData: null,
formValues: {},
formItem: [],
objId: this.props.objId || (this.props.location?this.props.location.state.id:null),
objId: this.props.objId || (this.props.location ? this.props.location.state.id : null),
isAdd: false,
querys: [],
selectedRows: [],
primaryKey: null,
options: {},
isTable: true,
tableWidth:500,
rights:this.props.rights||[],
columnRights:[],
isReady:false,
groups:{},
showDiv:'',
showMobileDiv:'',
isView:false
tableWidth: 500,
rights: this.props.rights || [],
columnRights: [],
isReady: false,
groups: {},
showDiv: '',
showMobileDiv: '',
isView: false,
};
}
columns = [];
getOptions = () => {
const refIds = []
const refIds = [];
for (var i = 0; i < this.state.formItem.length; i++) {
if (this.state.formItem[i].referenceObjId != null && this.state.options[this.state.formItem[i].id + ''] == null) {
refIds.push(datas[t].id)
if (
this.state.formItem[i].referenceObjId != null &&
this.state.options[this.state.formItem[i].id + ''] == null
) {
refIds.push(datas[t].id);
}
}
if (refIds.length > 0) {
dispatch({
type: 'formList/getBatchOptions',
payload: { ids: refIds },
callback: (options) => {
this.setState({ options: { ...this.state.options, ...options } })
}
callback: options => {
this.setState({ options: { ...this.state.options, ...options } });
},
});
}
}
};
getList = (values, callback) => {
const {dispatch, json:{treeParentIdName}} = this.props;
const {
dispatch,
json: { treeParentIdName },
} = this.props;
if (!values) {
values = this.state.formValues
values = this.state.formValues;
}
dispatch({
type: 'formList/tree',
payload: {...values, parentIdName: treeParentIdName,dataObjId:this.state.objId},
callback: callback
payload: { ...values, parentIdName: treeParentIdName, dataObjId: this.state.objId },
callback: callback,
});
}
};
modify = record => {
// if (this.state.formItem.length < 10) {
this.getOptions()
this.setState({
formData: record,
modalVisible: true,
isAdd: false,
isView:false
});
// if (this.state.formItem.length < 10) {
this.getOptions();
this.setState({
formData: record,
modalVisible: true,
isAdd: false,
isView: false,
});
// } else {
// router.push({
// pathname: '/admin/ddl/dataObj/formEdit',
......@@ -236,16 +245,15 @@ class TreeList extends React.Component {
// }
};
view = record => {
// if (this.state.formItem.length < 10) {
this.getOptions()
this.setState({
formData: record,
modalVisible: true,
isAdd: false,
isView:true
});
// if (this.state.formItem.length < 10) {
this.getOptions();
this.setState({
formData: record,
modalVisible: true,
isAdd: false,
isView: true,
});
// } else {
// router.push({
// pathname: '/admin/ddl/dataObj/formEdit',
......@@ -260,7 +268,7 @@ class TreeList extends React.Component {
// }
};
isJSON = (str) => {
isJSON = str => {
if (typeof str == 'string') {
try {
var obj = JSON.parse(str);
......@@ -269,14 +277,13 @@ class TreeList extends React.Component {
} else {
return false;
}
} catch (e) {
console.log('error:' + str + '!!!' + e);
return false;
}
}
console.log('这不是个字符串')
}
console.log('这不是个字符串');
};
delete = record => {
//找出主键
......@@ -286,30 +293,29 @@ class TreeList extends React.Component {
type: 'formList/delete',
payload: {
keys: JSON.stringify(Keys),
objId: this.state.objId
objId: this.state.objId,
},
callback: () => {
this.getPage({parentId: this.state.parentId},null,null, (list) => {
const treeData = this.refesh(this.state.parentId, list, this.state.treeData)
this.getPage({ parentId: this.state.parentId }, null, null, list => {
const treeData = this.refesh(this.state.parentId, list, this.state.treeData);
this.setState({
modalVisible: false,
treeData
treeData,
});
})
});
},
});
};
viewProcess = record => {
const {dispatch}= this.props;
const { dispatch } = this.props;
dispatch({
type: 'formList/getAppId',
payload: {
code: record.process_biz_key,
},
callback: (data) => {
router.push({pathname: '/portal/serviceCentre/getdetail',state: {id:data.id}})
callback: data => {
router.push({ pathname: '/portal/serviceCentre/getdetail', state: { id: data.id } });
},
});
};
......@@ -317,72 +323,69 @@ class TreeList extends React.Component {
/**
* 宽度自适应函数
*/
resize = (e) => {
let scrollWidth = document.documentElement.clientWidth || document.body.clientWidth; //可使宽度
let showMobileDiv = scrollWidth-77
if(document.querySelector('#previewDiv')){ // 预览模式
resize = e => {
let scrollWidth = document.documentElement.clientWidth || document.body.clientWidth; //可使宽度
let showMobileDiv = scrollWidth - 77;
if (document.querySelector('#previewDiv')) {
// 预览模式
this.setState({
showMobileDiv:document.querySelector('#previewDiv').clientWidth-77
})
showMobileDiv: document.querySelector('#previewDiv').clientWidth - 77,
});
} else {
this.setState({
showMobileDiv,
})
});
}
}
};
//渲染值
componentDidMount() {
const { dispatch, isFormCom, isSelect, callback, valueName } = this.props;
const { dispatch, isFormCom, isSelect, callback, valueName } = this.props;
window.addEventListener('resize', this.resize);
if(this.props.objCode){
const { dispatch, objCode,sql} = this.props;
if (this.props.objCode) {
const { dispatch, objCode, sql } = this.props;
if(objCode==1||objCode=="1"){
if (objCode == 1 || objCode == '1') {
this.initColumn();
}else{
} else {
dispatch({
type: 'DataObj/findByCode',
payload: { objCode:this.props.objCode },
payload: { objCode: this.props.objCode },
callback: dataObj => {
this.setState({ objId: dataObj.id ,isTable: data.isTable},()=>{
this.setState({ objId: dataObj.id, isTable: data.isTable }, () => {
dispatch({
type: 'DataRight/getUserRight',
payload: { objId: this.state.objId },
callback: data => {
if(!this.props.rights){
if (!this.props.rights) {
this.setState({ rights: data });
}
dispatch({
type: 'DataRight/getUserColumnRight',
payload: { objId: this.state.objId },
callback: data => {
this.setState({ columnRights: data });
this.initColumn();
}
},
});
}
},
});
});
},
});
}
}else{
} else {
dispatch({
type: 'formList/getObjDetail',
payload: { id: this.state.objId },
callback: data => {
this.setState({ isTable: data.isTable });
}
},
});
dispatch({
type: 'DataRight/getUserRight',
payload: { objId: this.state.objId },
callback: data => {
if(!this.props.rights){
if (!this.props.rights) {
this.setState({ rights: data });
}
dispatch({
......@@ -391,257 +394,252 @@ class TreeList extends React.Component {
callback: data => {
this.setState({ columnRights: data });
this.initColumn();
}
},
});
}
},
});
}
}
/**
* 移除监听器
*/
componentWillUnmount(){
window.removeEventListener('resize',this.resize);
componentWillUnmount() {
window.removeEventListener('resize', this.resize);
}
custom=this.props.value?Base16Encode(JSON.stringify(this.props.value)):null
componentWillReceiveProps(nextProps){
const b = nextProps.value||{}
const a = this.props.value||{}
if(JSON.stringify(a)!=JSON.stringify(b)){
const params = {
pageNo: 1,
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
if(JSON.stringify(x)!=JSON.stringify(y)){
custom = this.props.value ? Base16Encode(JSON.stringify(this.props.value)) : null;
componentWillReceiveProps(nextProps) {
const b = nextProps.value || {};
const a = this.props.value || {};
if (JSON.stringify(a) != JSON.stringify(b)) {
const params = {
pageNo: 1,
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.setState({selects:x})
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;
if (JSON.stringify(x) != JSON.stringify(y)) {
this.setState({ selects: x });
}
}
initColumn = () =>{
initColumn = () => {
const { dispatch, isFormCom, isSelect, callback, valueName } = this.props;
const { dispatch, isFormCom, isSelect, callback, valueName } = this.props;
const {rights,columnRights} = this.state;
if(this.props.value&&this.props.value.columns){
this.columns=this.props.value.columns
const { rights, columnRights } = this.state;
if (this.props.value && this.props.value.columns) {
this.columns = this.props.value.columns;
this.getPage();
return
return;
}
if(this.props.objCode==1||this.props.objCode=="1"){
}else{
if (this.props.objCode == 1 || this.props.objCode == '1') {
} else {
dispatch({
type: 'formList/getHead',
payload: { dataObjId: this.state.objId },
callback: datas => {
const querys = []
const refIds = []
const groups ={};
const querys = [];
const refIds = [];
const groups = {};
if (datas) {
this.state.formItem = datas;
let i = 0;
for (let t in datas) {
if (datas[t].isPrimaryKey) this.state.primaryKey = datas[t].name;
if(datas[t].isHidden){
continue
if (datas[t].isHidden) {
continue;
}
let column = {};
column.title = datas[t].title;
column.dataIndex = datas[t].name;
column.width = datas[t].width;
if(i==0) column.fixed='left';
if (i == 0) column.fixed = 'left';
if(columnRights.length>0&&!columnRights.includes(datas[t].id)){
continue;
if (columnRights.length > 0 && !columnRights.includes(datas[t].id)) {
continue;
}
if (data.includes(datas[t].type)) {
column.render =( val) =>{
if(val == null){
column.render = val => {
if (val == null) {
return val;
}
if(datas[t].dataFormatStrWeb!=null){
return moment(val).format(datas[t].dataFormatStrWeb);
}else {
if (datas[t].dataFormatStrWeb != null) {
return moment(val).format(datas[t].dataFormatStrWeb);
} else {
return moment(val).format('YYYY-MM-DD HH:mm:ss');
}
}
}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)){
};
} 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>
}
)}
let xx = (
<ul>
{files.map((f, index2) => {
return (
<li key={index2}>
<FilePreview path={queryApiActionPath() + f.path} pathName={f.name} />
</li>
);
})}
</ul>
)
);
return xx;
}else {
} 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
};
} 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
);
}
this.setState({tableWidth:((datas.length-1)*200)})
this.setState({ tableWidth: (datas.length - 1) * 200 });
this.columns.push(column);
if (datas[t].isShowQuery) {
querys.push(datas[t])
querys.push(datas[t]);
if (datas[t].referenceObjId != null) {
refIds.push(datas[t].id)
refIds.push(datas[t].id);
}
if(datas[t].isGroupQuery!=null){
if (datas[t].isGroupQuery != null) {
dispatch({
type: 'formList/getGroupList',
payload: { columnId: datas[t].id },
callback: (gourp) => {
callback: gourp => {
groups[datas[t].id] = gourp;
this.setState({ groups })
}
this.setState({ groups });
},
});
}
}
i++;
}
if (querys.length > 0) {
this.setState({ querys })
this.setState({ querys });
if (refIds.length > 0) {
dispatch({
type: 'formList/getBatchOptions',
payload: { ids: refIds },
callback: (options) => {
this.setState({ options })
}
callback: options => {
this.setState({ options });
},
});
}
}
this.getPage();
}
},
});
}
}
sqlBs16=Base16Encode(this.props.sql)
getPage = (params, values,callPage,callback) => {
if(this.columns==null||this.columns.length==0){
};
sqlBs16 = Base16Encode(this.props.sql);
getPage = (params, values, callPage, callback) => {
if (this.columns == null || this.columns.length == 0) {
return;
}
const { dispatch ,json:{treeParentIdName}} = this.props;
const {
dispatch,
json: { treeParentIdName },
} = this.props;
const pagination = this.state.data.pagination;
if (params == null) {
params = {
// pageNo: pagination.current ? pagination.current : 1,
// pageNo: pagination.current ? pagination.current : 1,
//pageSize: pagination.pageSize ? pagination.pageSize : (this.props.pageSize||10),
query: JSON.stringify(values!=null?values:this.state.formValues),
query: JSON.stringify(values != null ? values : this.state.formValues),
};
}
if(this.props.objCode&&(this.props.objCode=="1"||this.props.objCode==1)){
if(callPage){
callPage(params,(data)=>{
if(!this.state.isReady){
this.setState({data,isReady:true})
}else{
this.setState({data})
if (this.props.objCode && (this.props.objCode == '1' || this.props.objCode == 1)) {
if (callPage) {
callPage(params, data => {
if (!this.state.isReady) {
this.setState({ data, isReady: true });
} else {
this.setState({ data });
}
})
}else if(this.props.value&&this.props.value.getPage){
this.props.value.getPage(params,(data)=>{
if(!this.state.isReady){
this.setState({data,isReady:true})
}else{
this.setState({data})
});
} else if (this.props.value && this.props.value.getPage) {
this.props.value.getPage(params, data => {
if (!this.state.isReady) {
this.setState({ data, isReady: true });
} else {
this.setState({ data });
}
})
});
}
}else{
} else {
dispatch({
type: 'formList/tree',
payload: {
custom:this.custom,
custom: this.custom,
...params,
parentIdName: treeParentIdName,
sql:this.sqlBs16,
sql: this.sqlBs16,
dataObjId: this.state.objId,
},
callback:(list)=>{
const data={
list:list,
pagination:false
}
if(!this.state.isReady){
this.setState({data,parentId:params.parentId,isReady:true},()=>{
if(callback) callback(list)
})
}else{
this.setState({data,parentId:params.parentId},()=>{
if(callback) callback(list)
})
callback: list => {
const data = {
list: list,
pagination: false,
};
if (!this.state.isReady) {
this.setState({ data, parentId: params.parentId, isReady: true }, () => {
if (callback) callback(list);
});
} else {
this.setState({ data, parentId: params.parentId }, () => {
if (callback) callback(list);
});
}
}
},
});
}
};
handleStandardTableChange = (pagination, filtersArg, sorter) => {
const filters = Object.keys(filtersArg)
.reduce((obj, key) => {
const newObj = { ...obj };
newObj[key] = getValue(filtersArg[key]);
return newObj;
}, {});
const filters = Object.keys(filtersArg).reduce((obj, key) => {
const newObj = { ...obj };
newObj[key] = getValue(filtersArg[key]);
return newObj;
}, {});
const params = {
pageNo: pagination.current,
......@@ -656,11 +654,13 @@ class TreeList extends React.Component {
};
handleAdd = (fields, isAdd) => {
const {json:{treeParentIdName}}=this.props
const {
json: { treeParentIdName },
} = this.props;
let params = {
...fields,
};
params[treeParentIdName]=this.state.parentId
params[treeParentIdName] = this.state.parentId;
this.props.dispatch({
type: 'formList/add',
payload: {
......@@ -668,19 +668,18 @@ class TreeList extends React.Component {
objId: this.state.objId,
isAdd: isAdd,
isSelf: true,
isView:false
isView: false,
},
callback: () => {
message.success('操作成功');
this.getPage({parentId: this.state.parentId},null,null, (list) => {
const treeData = this.refesh(this.state.parentId, list, this.state.treeData)
this.getPage({ parentId: this.state.parentId }, null, null, list => {
const treeData = this.refesh(this.state.parentId, list, this.state.treeData);
this.setState({
modalVisible: false,
treeData
treeData,
});
})
});
},
});
};
......@@ -693,14 +692,14 @@ class TreeList extends React.Component {
};
add = () => {
// if (this.state.formItem.length < 10) {
this.getOptions()
this.setState({
modalVisible: true,
formData: {},
isAdd: true,
isView:false
});
// if (this.state.formItem.length < 10) {
this.getOptions();
this.setState({
modalVisible: true,
formData: {},
isAdd: true,
isView: false,
});
// } else {
// router.push({
// pathname: '/admin/ddl/dataObj/formEdit',
......@@ -710,8 +709,8 @@ class TreeList extends React.Component {
};
handleSelectRows = rows => {
if(this.props.onSelectRow){
this.props.onSelectRow(rows)
if (this.props.onSelectRow) {
this.props.onSelectRow(rows);
}
this.setState({
selectedRows: rows,
......@@ -730,8 +729,7 @@ class TreeList extends React.Component {
for (let i in columns) {
if (columns[i].isPrimaryKey) {
//key
Keys[columns[i].name] = selectedRows.map(row => row[columns[i].name])
.join(',');
Keys[columns[i].name] = selectedRows.map(row => row[columns[i].name]).join(',');
}
}
this.props.dispatch({
......@@ -739,7 +737,7 @@ class TreeList extends React.Component {
payload: {
keys: JSON.stringify(Keys),
objId: this.state.objId,
isSelf: true
isSelf: true,
},
callback: () => {
this.setState({
......@@ -753,26 +751,28 @@ class TreeList extends React.Component {
goBack = () => {
router.goBack();
};
handleSearch = (e) => {
handleSearch = e => {
e.preventDefault();
const { dispatch, form } = this.props;
const {formValues} = this.state;
const { formValues } = this.state;
form.validateFields((err, fieldsValue) => {
if (err) return;
const formItem = this.state.formItem
const formItem = this.state.formItem;
formItem.map((item, index) => {
if (item.type.indexOf('DATE') > -1) {
for (let d in fieldsValue) {
if (item.name === d && fieldsValue[d]) {
if(fieldsValue[d]!=null&&fieldsValue[d].length>0){
fieldsValue[d]=[fieldsValue[d][0].format('YYYY-MM-DD HH:mm:ss'),fieldsValue[d][1].format('YYYY-MM-DD HH:mm:ss')];
}else {
fieldsValue[d]="";
if (fieldsValue[d] != null && fieldsValue[d].length > 0) {
fieldsValue[d] = [
fieldsValue[d][0].format('YYYY-MM-DD HH:mm:ss'),
fieldsValue[d][1].format('YYYY-MM-DD HH:mm:ss'),
];
} else {
fieldsValue[d] = '';
}
}
}
......@@ -780,103 +780,125 @@ class TreeList extends React.Component {
});
const values = {
...this.state.formValues,
...fieldsValue
...fieldsValue,
};
this.setState({
formValues: fieldsValue,
});
this.setState({
formValues: fieldsValue,
});
this.getPage(null, values)
this.getPage(null, values);
});
}
};
hanldeHighSearch=(e)=>{
hanldeHighSearch = e => {
const pagination = this.props.formList.data.pagination;
let params = {
pageNo: pagination.current ? pagination.current : 1,
pageSize: pagination.pageSize ? pagination.pageSize : (this.props.pageSize||10),
...e
}
this.setState({formValues:{...e,...this.state.formValues}})
this.getPage(params)
}
pageSize: pagination.pageSize ? pagination.pageSize : this.props.pageSize || 10,
...e,
};
this.setState({ formValues: { ...e, ...this.state.formValues } });
this.getPage(params);
};
handleFormReset = () => {
const { form, dispatch } = this.props;
form.resetFields();
this.setState({
formValues: {},
}, () => {
this.getPage()
});
}
getItem = (isQuery,form, item, isAdd, formData, labelCol, wrapperCol) => {
const {groups} =this.state;
this.setState(
{
formValues: {},
},
() => {
this.getPage();
},
);
};
getItem = (isQuery, form, item, isAdd, formData, labelCol, wrapperCol) => {
const { groups } = this.state;
if (item.isPrimaryKey) {
if (isAdd) {
return (<></>);
return <></>;
} else {
return (
<FormItem labelCol={labelCol} wrapperCol={wrapperCol} label={item.title} key={item.id}>
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(<Input style={{ width: '70%' }} readOnly={!isAdd} placeholder="请输入"/>)}
})(<Input style={{ width: '70%' }} readOnly={!isAdd} placeholder="请输入" />)}
</FormItem>
);
}
} else if (item.referenceObjId != null) {
const { options } = this.state
const ops = options[item.id + ''] || []
const { options } = this.state;
const ops = options[item.id + ''] || [];
return (
<FormItem labelCol={labelCol} wrapperCol={wrapperCol} label={item.title} key={item.id}>
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(<Select style={{ width: '70%' }} placeholder="请选择" allowClear>
{ops.map((r) => <Option value={r[item.referenceCodeName]}
key={r[item.referenceCodeName]}>{r[item.referenceNameName]}</Option>)}
</Select>)}
})(
<Select style={{ width: '70%' }} placeholder="请选择" allowClear>
{ops.map(r => (
<Option value={r[item.referenceCodeName]} key={r[item.referenceCodeName]}>
{r[item.referenceNameName]}
</Option>
))}
</Select>,
)}
</FormItem>
);
}else if(item.name.indexOf("process_status")>-1){
} else if (item.name.indexOf('process_status') > -1) {
return (
<FormItem labelCol={labelCol} wrapperCol={wrapperCol} label={item.title} key={item.id}>
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(<Select style={{ width: '70%' }} placeholder="请选择" allowClear>
<Option value={'0'} key={'0'}>审核通过</Option>
<Option value={'2'} key={'2'}>审核未通过</Option>
</Select>)}
})(
<Select style={{ width: '70%' }} placeholder="请选择" allowClear>
<Option value={'0'} key={'0'}>
审核通过
</Option>
<Option value={'2'} key={'2'}>
审核未通过
</Option>
</Select>,
)}
</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 />)}
} 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){ //如果是查询 并且是组合查询
);
} else if (isQuery && item.isGroupQuery != null && item.isGroupQuery) {
//如果是查询 并且是组合查询
const ops = groups[item.id + ''] || []
const ops = groups[item.id + ''] || [];
return (
<FormItem labelCol={labelCol} wrapperCol={wrapperCol} label={item.title} key={item.id}>
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(<Select style={{ width: '70%' }} placeholder="请选择" allowClear>
{ops.map((r) => <Option value={r.value}
key={r.value}>{r.value}</Option>)}
</Select>)}
})(
<Select style={{ width: '70%' }} placeholder="请选择" allowClear>
{ops.map(r => (
<Option value={r.value} key={r.value}>
{r.value}
</Option>
))}
</Select>,
)}
</FormItem>
);
} else if (text.indexOf(item.type) > -1) {
......@@ -885,7 +907,7 @@ class TreeList extends React.Component {
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(<Input style={{ width: '70%' }} placeholder="请输入"/>)}
})(<Input style={{ width: '70%' }} placeholder="请输入" />)}
</FormItem>
);
} else if (number.indexOf(item.type) > -1) {
......@@ -894,32 +916,37 @@ class TreeList extends React.Component {
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(<InputNumber placeholder="请输入" min={0}/>)}
})(<InputNumber placeholder="请输入" min={0} />)}
</FormItem>
);
} else if (isQuery&&data.indexOf(item.type) > -1) {
} else if (isQuery && data.indexOf(item.type) > -1) {
return (
<FormItem labelCol={labelCol} wrapperCol={wrapperCol} label={item.title} key={item.id}>
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? null : moment(formData[item.name]),
rules: [{ required: !item.isNull }],
})(
<RangePicker format={item.dataFormatStrWeb==null?"YYYY-MM-DD HH:mm:ss":item.dataFormatStrWeb}
style={{ width: '95%' }} />)}
<RangePicker
format={item.dataFormatStrWeb == null ? 'YYYY-MM-DD HH:mm:ss' : item.dataFormatStrWeb}
style={{ width: '95%' }}
/>,
)}
</FormItem>
);
}else if (data.indexOf(item.type) > -1) {
} else if (data.indexOf(item.type) > -1) {
return (
<FormItem labelCol={labelCol} wrapperCol={wrapperCol} label={item.title} key={item.id}>
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? moment() :(formData[item.name]?moment(formData[item.name]):null),
initialValue:
formData == null
? moment()
: formData[item.name]
? moment(formData[item.name])
: null,
rules: [{ required: !item.isNull }],
})(
<DatePicker
format={item.dataFormatStrWeb==null?"YYYY-MM-DD HH:mm:ss":item.dataFormatStrWeb}
format={item.dataFormatStrWeb == null ? 'YYYY-MM-DD HH:mm:ss' : item.dataFormatStrWeb}
style={{ width: '100%' }}
placeholder="请输入"
/>,
......@@ -932,41 +959,44 @@ class TreeList extends React.Component {
{form.getFieldDecorator(item.name, {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(<Input style={{ width: '70%' }} placeholder="请输入"/>)}
})(<Input style={{ width: '70%' }} placeholder="请输入" />)}
</FormItem>
);
}
}
};
renderForm() {
const {
form,
get,
} = this.props;
const { querys } = this.state
const { form, get } = this.props;
const { querys } = this.state;
if (querys.length == 0) {
return '';
}
return (
<Form layout="inline">
<Row style={{padding:"15px"}}>
{querys.map((item) =>
<Col style={{height:58}} span={get==='mobile'?24:8} key={item.id}>
{this.getItem(true,form, {
...item,
isNull: true
}, true)}
<Row style={{ padding: '15px' }}>
{querys.map(item => (
<Col style={{ height: 58 }} span={get === 'mobile' ? 24 : 8} key={item.id}>
{this.getItem(
true,
form,
{
...item,
isNull: true,
},
true,
)}
</Col>
)}
<Col span={get==='mobile'?24:8}
style={{
textAlign:get==='mobile'?'right':'',
paddingRight: get==='mobile'?12:''
}}
>
))}
<Col
span={get === 'mobile' ? 24 : 8}
style={{
textAlign: get === 'mobile' ? 'right' : '',
paddingRight: get === 'mobile' ? 12 : '',
}}
>
<span className={styles.submitButtons}>
<Button type="primary" loading={this.props.loading} onClick={this.handleSearch}>
查询
......@@ -985,38 +1015,36 @@ class TreeList extends React.Component {
}
onSelect = (selectedKeys, info) => {
if (info.selectedNodes.length > 0) {
const parentId = selectedKeys[0] != "0-0" ? selectedKeys[0] : null
this.setState({parentName: info.selectedNodes[0].props.title, parentId})
this.getPage({parentId: parentId})
const parentId = selectedKeys[0] != '0-0' ? selectedKeys[0] : null;
this.setState({ parentName: info.selectedNodes[0].props.title, parentId });
this.getPage({ parentId: parentId });
}
}
onLoadData = (treeNode) => {
return new Promise((resolve) => {
};
onLoadData = treeNode => {
return new Promise(resolve => {
if (treeNode.props.childs) {
resolve();
return;
}
const parentId = treeNode.props.eventKey != "0-0" ? treeNode.props.eventKey : null
this.getList({parentId: parentId}, (list) => {
const parentId = treeNode.props.eventKey != '0-0' ? treeNode.props.eventKey : null;
this.getList({ parentId: parentId }, list => {
treeNode.props.dataRef.childs = list;
this.setState({
treeData: [...this.state.treeData]
treeData: [...this.state.treeData],
});
resolve();
})
});
});
}
};
renderTreeNodes = (list) => {
const{json:{treeTitleName,treeKeyName}}=this.props
return list.map((item) => {
item.title=item[treeTitleName]
item.key = item[treeKeyName]
renderTreeNodes = list => {
const {
json: { treeTitleName, treeKeyName },
} = this.props;
return list.map(item => {
item.title = item[treeTitleName];
item.key = item[treeKeyName];
if (item.childs) {
return (
<TreeNode title={item[treeTitleName]} key={item.key} dataRef={item}>
......@@ -1024,42 +1052,35 @@ class TreeList extends React.Component {
</TreeNode>
);
}
return <TreeNode {...item} dataRef={item}/>;
})
}
return <TreeNode {...item} dataRef={item} />;
});
};
refesh = (parentId, list, data) => {
if (parentId == null) {
data[0].childs = list
return data
data[0].childs = list;
return data;
}
for (var i = 0; i < data.length; i++) {
if (data[i].key == parentId) {
data[i].childs = list
data[i].childs = list;
break;
} else {
if (data[i].childs) {
this.refesh(parentId, list, data[i].childs)
this.refesh(parentId, list, data[i].childs);
}
}
}
return data
}
return data;
};
render() {
const {
modalVisible,
selectedRows,
querys,
tableWidth,
rights ,
data,
isReady,
} = this.state;
if(!isReady){
return <div style={{width:20,margin:"auto"}}><Spin/></div>
const { modalVisible, selectedRows, querys, tableWidth, rights, data, isReady } = this.state;
if (!isReady) {
return (
<div style={{ width: 20, margin: 'auto' }}>
<Spin />
</div>
);
}
const {
isFormCom,
......@@ -1069,22 +1090,20 @@ class TreeList extends React.Component {
valueName,
notShowBack,
istableCom, // 是否有模板设计器调用
value:{btns},
json:{treeSpan},
loading
value: { btns },
json: { treeSpan },
loading,
} = this.props;
const {
showMobileDiv,
isView
} = this.state
const { showMobileDiv, isView } = this.state;
let scrollWidth = document.documentElement.clientWidth || document.body.clientWidth; //可使宽度
let isMobile = scrollWidth < 1200
if(document.querySelector('#previewDiv')){
isMobile = true
let scrollWidth = document.documentElement.clientWidth || document.body.clientWidth; //可使宽度
let isMobile = scrollWidth < 1200;
if (document.querySelector('#previewDiv')) {
isMobile = true;
}
let showDiv = document.querySelector('#mobelDiv')&&document.querySelector('#mobelDiv')?.parentNode.clientWidth
let showDiv =
document.querySelector('#mobelDiv') &&
document.querySelector('#mobelDiv')?.parentNode.clientWidth;
const parentMethods = {
handleAdd: this.handleAdd,
handleModalVisible: this.handleModalVisible,
......@@ -1092,212 +1111,288 @@ class TreeList extends React.Component {
formItem: this.state.formItem,
isAdd: this.state.isAdd,
getItem: this.getItem,
isView:isView,
isView: isView,
};
if(!isSelect&&!rights.includes('edit')&&!rights.includes('delete')&&!rights.includes("view")&&!rights.includes("viewProcess")){
}else{
let width=0;
if(rights && rights.includes('viewProcess')){
width=width+75;
if (
!isSelect &&
!rights.includes('edit') &&
!rights.includes('delete') &&
!rights.includes('view') &&
!rights.includes('viewProcess')
) {
} else {
let width = 0;
if (rights && rights.includes('viewProcess')) {
width = width + 75;
}
if(rights && rights.includes('view')){
width=width+75;
if (rights && rights.includes('view')) {
width = width + 75;
}
if(rights && rights.includes('edit')){
width=width+40;
if (rights && rights.includes('edit')) {
width = width + 40;
}
if(rights && rights.includes('delete')){
width=width+40;
if (rights && rights.includes('delete')) {
width = width + 40;
}
const column = {
title: '操作',
fixed: 'right',
width: width,
render: (text, record) => {
return <Fragment>
<div style={{textAlign:'center'}}>
{isSelect ? this.state.selects.includes(record[valueName]) ? <><span>已选择</span><Divider
type="vertical"/></> : <><a
onClick={callback.bind(this, record, this.columns)}>选择</a><Divider
type="vertical"/></> : ''}
{rights && !rights.includes('view') ? '' : <><a
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('delete') ? '' : <> <Popconfirm
title="确定删除该数据?"
onConfirm={this.delete.bind(this, record)}
okText="确定"
cancelText="取消"
>
<a>删除</a>
</Popconfirm></>}
</div>
</Fragment>
}
}
if(this.columns.length>0&&this.columns[this.columns.length-1].title=="操作"){
this.columns[this.columns.length-1]=column;
}else{
return (
<Fragment>
<div style={{ textAlign: 'center' }}>
{isSelect ? (
this.state.selects.includes(record[valueName]) ? (
<>
<span>已选择</span>
<Divider type="vertical" />
</>
) : (
<>
<a onClick={callback.bind(this, record, this.columns)}>选择</a>
<Divider type="vertical" />
</>
)
) : (
''
)}
{rights && !rights.includes('view') ? (
''
) : (
<>
<a 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('delete') ? (
''
) : (
<>
{' '}
<Popconfirm
title="确定删除该数据?"
onConfirm={this.delete.bind(this, record)}
okText="确定"
cancelText="取消"
>
<a>删除</a>
</Popconfirm>
</>
)}
</div>
</Fragment>
);
},
};
if (this.columns.length > 0 && this.columns[this.columns.length - 1].title == '操作') {
this.columns[this.columns.length - 1] = column;
} else {
this.columns.push(column);
}
}
if(this.columns){
/**
* 计算总长度
*/
AllWidth = 0
this.columns = this.columns.map((item,index) => {
if(isEmpty(item)){
return item
}
if(index === this.columns.length-1&&this.columns[this.columns.length-1].title !== '操作'){
AllWidth+=150
item.width = ''
return item
}
let width = item.width?item.width:150
if(!item.width){
item.width = 150
}
AllWidth += width
return item
})
if(!isEmpty(this.columns[this.columns.length-1])
&&this.columns[this.columns.length-1].title === '操作'
){
this.columns[this.columns.length-2].width = ''
AllWidth+=100
}
}
const xxxx = <>
<Row gutter={16}>
<Col span={treeSpan}>
<Card bordered={false} style={{minHeight: 500}}>
<Tree showLine defaultExpandedKeys={["0-0"]} onSelect={this.onSelect} loadData={this.onLoadData}>
{this.renderTreeNodes(this.state.treeData)}
</Tree>
</Card>
</Col>
<Col span={24-treeSpan}>
<Card bordered={false} bodyStyle={{padding:0}}>
<div className={styles.tableList}>
<div className={styles.tableListForm}>{this.renderForm()}</div>
<div className={styles.tableListOperator}>
{notShowBack ? notShowBack : <Button icon="rollback" type="primary" onClick={this.goBack}>
返回
</Button>}
{btns&&btns.before&&btns.before.length>0?btns.before.map((r)=><Button {...r}/>):""}
{rights && !rights.includes('add') ? '' :
<Button icon="plus" type="primary" onClick={this.add}>
新建
</Button>}
{rights && !rights.includes('searchData') ? '' :<SearchInfo hanldeHighSearch={this.hanldeHighSearch} objId = {this.state.objId}/>}
{rights && !rights.includes('importData') ? '' : <ImportUtil objId={this.state.objId}/>}
{rights && !rights.includes('exportCurrent') ? '' : <ExportCurrentInfo objId={this.state.objId}
query={JSON.stringify(this.state.formValues)}
custom={this.props.value?Base16Encode(JSON.stringify(this.props.value)):null}
sql={Base16Encode(this.props.sql)}
/>}
{rights && !rights.includes('exportData') ? '' : <ExportInfo objId={this.state.objId}/>}
{rights && !rights.includes('statistics') ? '' :
<StatisticsInfo objId={this.state.objId}/>}
{rights && !rights.includes('delete') ? '' : selectedRows.length > 0 && (
<span>
<Popconfirm
title="确定删除该数据?"
onConfirm={this.batchDelete}
okText="确定"
cancelText="取消"
>
<Button>批量删除</Button></Popconfirm>
</span>
)}
{btns&&btns.before&&btns.before.length>0?btns.before.map((r)=><Button {...r} loading={loading}/>):""}
</div>
{
(!istableCom)||(this.props.value&&this.props.value.columns)?
<StandardTable
showHeader={this.props.showHeader!=null?this.props.showHeader:true}
noSelectRow={this.props.onSelectRow==null&&( rights==null|| !rights.includes('delete')) }
rowKey="id"
data={data}
isHiddenPage={this.props.isHiddenPage!=null?this.props.isHiddenPage:false}
columns={this.columns}
scroll={this.props.value&&this.props.value.columns?{}:{ x: AllWidth }}
selectedRows={selectedRows}
onSelectRow={this.handleSelectRows}
onChange={this.handleStandardTableChange}
loading={this.props.loading}
/>
:
<div
id='mobelDiv'
style={{
overflow:'hidden',
width: isMobile?showMobileDiv:showDiv,
height: '100%'
}}
if (this.columns) {
/**
* 计算总长度
*/
AllWidth = 0;
this.columns = this.columns.map((item, index) => {
if (isEmpty(item)) {
return item;
}
if (
index === this.columns.length - 1 &&
this.columns[this.columns.length - 1].title !== '操作'
) {
AllWidth += 150;
item.width = '';
return item;
}
let width = item.width ? item.width : 150;
if (!item.width) {
item.width = 150;
}
AllWidth += width;
return item;
});
if (
!isEmpty(this.columns[this.columns.length - 1]) &&
this.columns[this.columns.length - 1].title === '操作'
) {
this.columns[this.columns.length - 2].width = '';
AllWidth += 100;
}
}
const xxxx = (
<>
<Row gutter={16}>
<Col span={treeSpan}>
<Card bordered={false} style={{ minHeight: 500 }}>
<Tree
showLine
defaultExpandedKeys={['0-0']}
onSelect={this.onSelect}
loadData={this.onLoadData}
>
<div
>
{
get==='mobile'?
<div>手机端,请将手机横屏查看</div>
:null
}
{
showDiv&&<StandardTable
showHeader={this.props.showHeader!=null?this.props.showHeader:true}
noSelectRow={this.props.onSelectRow==null&&( rights==null|| !rights.includes('delete')) }
{this.renderTreeNodes(this.state.treeData)}
</Tree>
</Card>
</Col>
<Col span={24 - treeSpan}>
<Card bordered={false} bodyStyle={{ padding: 0 }}>
<div className={styles.tableList}>
<div className={styles.tableListForm}>{this.renderForm()}</div>
<div className={styles.tableListOperator}>
{notShowBack ? (
notShowBack
) : (
<Button icon="rollback" type="primary" onClick={this.goBack}>
返回
</Button>
)}
{btns && btns.before && btns.before.length > 0
? btns.before.map(r => <Button {...r} />)
: ''}
{rights && !rights.includes('add') ? (
''
) : (
<Button icon="plus" type="primary" onClick={this.add}>
新建
</Button>
)}
{rights && !rights.includes('searchData') ? (
''
) : (
<SearchInfo hanldeHighSearch={this.hanldeHighSearch} objId={this.state.objId} />
)}
{rights && !rights.includes('importData') ? (
''
) : (
<ImportUtil objId={this.state.objId} />
)}
{rights && !rights.includes('exportCurrent') ? (
''
) : (
<ExportCurrentInfo
objId={this.state.objId}
query={JSON.stringify(this.state.formValues)}
custom={
this.props.value ? Base16Encode(JSON.stringify(this.props.value)) : null
}
sql={Base16Encode(this.props.sql)}
/>
)}
{rights && !rights.includes('exportData') ? (
''
) : (
<ExportInfo objId={this.state.objId} />
)}
{rights && !rights.includes('statistics') ? (
''
) : (
<StatisticsInfo objId={this.state.objId} />
)}
{rights && !rights.includes('delete')
? ''
: selectedRows.length > 0 && (
<span>
<Popconfirm
title="确定删除该数据?"
onConfirm={this.batchDelete}
okText="确定"
cancelText="取消"
>
<Button>批量删除</Button>
</Popconfirm>
</span>
)}
{btns && btns.before && btns.before.length > 0
? btns.before.map(r => <Button {...r} loading={loading} />)
: ''}
</div>
{!istableCom || (this.props.value && this.props.value.columns) ? (
<StandardTable
showHeader={this.props.showHeader != null ? this.props.showHeader : true}
noSelectRow={
this.props.onSelectRow == null &&
(rights == null || !rights.includes('delete'))
}
rowKey="id"
data={data}
isHiddenPage={this.props.isHiddenPage != null ? this.props.isHiddenPage : false}
columns={this.columns}
scroll={this.props.value&&this.props.value.columns?{}:{ x: AllWidth }}
scroll={this.props.value && this.props.value.columns ? {} : { x: AllWidth }}
selectedRows={selectedRows}
isHiddenPage={this.props.isHiddenPage!=null?this.props.isHiddenPage:false}
onSelectRow={this.handleSelectRows}
onChange={this.handleStandardTableChange}
loading={this.props.loading}
/>
}
) : (
<div
id="mobelDiv"
style={{
overflow: 'hidden',
width: isMobile ? showMobileDiv : showDiv,
height: '100%',
}}
>
<div>
{get === 'mobile' ? <div>手机端,请将手机横屏查看</div> : null}
{showDiv && (
<StandardTable
showHeader={this.props.showHeader != null ? this.props.showHeader : true}
noSelectRow={
this.props.onSelectRow == null &&
(rights == null || !rights.includes('delete'))
}
rowKey="id"
data={data}
columns={this.columns}
scroll={
this.props.value && this.props.value.columns ? {} : { x: AllWidth }
}
selectedRows={selectedRows}
isHiddenPage={
this.props.isHiddenPage != null ? this.props.isHiddenPage : false
}
onSelectRow={this.handleSelectRows}
onChange={this.handleStandardTableChange}
loading={this.props.loading}
/>
)}
</div>
</div>
)}
</div>
</div>
}
</div>
</Card></Col></Row>
<CreateForm {...parentMethods} modalVisible={modalVisible}/></>
</Card>
</Col>
</Row>
<CreateForm {...parentMethods} modalVisible={modalVisible} />
</>
);
if (isFormCom) {
return xxxx
return xxxx;
}
return (
<PageHeaderWrapper title="">
{xxxx}
</PageHeaderWrapper>
);
return <PageHeaderWrapper title="">{xxxx}</PageHeaderWrapper>;
}
}
......
......@@ -104,9 +104,7 @@ const CreateForm = Form.create()(props => {
//处理日期何时入库问题
try {
fieldsValue[d] = fieldsValue[d].format('YYYY-MM-DD HH:mm:ss');
}catch (e) {
}
} catch (e) {}
break;
}
}
......@@ -154,9 +152,11 @@ const CreateForm = Form.create()(props => {
);
});
@connect(({ formList,DataColumn,DataObj, loading }) => ({
formList,DataColumn,DataObj,
loading: loading.models.formList||loading.models.DataColumn||loading.models.DataObj,
@connect(({ formList, DataColumn, DataObj, loading }) => ({
formList,
DataColumn,
DataObj,
loading: loading.models.formList || loading.models.DataColumn || loading.models.DataObj,
}))
@Form.create()
class FormList extends React.Component {
......@@ -192,26 +192,26 @@ class FormList extends React.Component {
columns = [];
checkList = []; // 复选框内容
getOptions = () => {
const refIds = []
const refIds = [];
for (var i = 0; i < this.state.formItem.length; i++) {
if (this.state.formItem[i].referenceObjId != null && this.state.options[this.state.formItem[i].id + ''] == null) {
refIds.push(this.state.formItem[i].id)
if (
this.state.formItem[i].referenceObjId != null &&
this.state.options[this.state.formItem[i].id + ''] == null
) {
refIds.push(this.state.formItem[i].id);
}
}
if (refIds.length > 0) {
this.props.dispatch({
this.props.dispatch({
type: 'formList/getBatchOptions',
payload: { ids: refIds },
callback: (options) => {
this.setState({ options: { ...this.state.options, ...options } })
}
callback: options => {
this.setState({ options: { ...this.state.options, ...options } });
},
});
}
}
};
modify = record => {
// if (this.state.formItem.length < 10) {
this.getOptions();
......@@ -299,9 +299,11 @@ class FormList extends React.Component {
code: record.process_biz_key,
},
callback: data => {
const domainName = sessionStorage.getItem('domainName') ? sessionStorage.getItem('domainName') : '';
const domainName = sessionStorage.getItem('domainName')
? sessionStorage.getItem('domainName')
: '';
window.open(domainName+"/portal/serviceCentre/getdetail?id="+data.id, '_blank');
window.open(domainName + '/portal/serviceCentre/getdetail?id=' + data.id, '_blank');
//router.push({ pathname: '/portal/serviceCentre/getdetail', state: { id: data.id } });
},
});
......@@ -437,14 +439,13 @@ class FormList extends React.Component {
// 表头筛选逻辑
Array.isArray(this.props.value.columns) &&
this.props.value.columns.map(item => {
if(item.dataIndex!=null){
if (item.dataIndex != null) {
cacheList.push({
label: item.title,
value: item.dataIndex,
});
cacheChecked.push(item.dataIndex);
}
});
this.checkList = cacheList;
......@@ -515,13 +516,13 @@ class FormList extends React.Component {
let cacheChecked = [];
// 表头筛选逻辑
datas.map(item => {
if(item.name!=null){
cacheList.push({
label: item.title,
value: item.name,
});
cacheChecked.push(item.name);
}
if (item.name != null) {
cacheList.push({
label: item.title,
value: item.name,
});
cacheChecked.push(item.name);
}
});
this.checkList = cacheList;
this.setState({
......@@ -741,7 +742,7 @@ class FormList extends React.Component {
this.setState({
modalVisible: this.state.modalVisible ? false : true,
formData: {},
isView:false
isView: false,
});
};
......@@ -839,7 +840,7 @@ class FormList extends React.Component {
this.setState({
formValues: fieldsValue,
});
const params = {
const params = {
pageNo: 1,
pageSize: this.props.pageSize || 10,
query: JSON.stringify(values),
......@@ -907,14 +908,19 @@ class FormList extends React.Component {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(
<Select disabled={isView} style={{ width: '70%' }}
optionFilterProp="children"
showSearch
filterOption={(input, option) =>
option
? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
: false
} placeholder="请选择" allowClear>
<Select
disabled={isView}
style={{ width: '70%' }}
optionFilterProp="children"
showSearch
filterOption={(input, option) =>
option
? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
: false
}
placeholder="请选择"
allowClear
>
{ops.map(r => (
<Option value={r[item.referenceCodeName]} key={r[item.referenceCodeName]}>
{r[item.referenceNameName]}
......@@ -968,15 +974,19 @@ class FormList extends React.Component {
initialValue: formData == null ? '' : formData[item.name],
rules: [{ required: !item.isNull }],
})(
<Select disabled={isView} style={{ width: 200 }} placeholder="请选择"
optionFilterProp="children"
showSearch
filterOption={(input, option) =>
option
? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
: false
}
allowClear>
<Select
disabled={isView}
style={{ width: 200 }}
placeholder="请选择"
optionFilterProp="children"
showSearch
filterOption={(input, option) =>
option
? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
: false
}
allowClear
>
{ops.map(r => (
<Option value={r.value} key={r.value}>
{r.value}
......@@ -1203,7 +1213,7 @@ class FormList extends React.Component {
render: (text, record) => {
return (
<Fragment>
<div style={{ textAlign: 'center',"padding-left":"0px","padding-right":"0px"}}>
<div style={{ textAlign: 'center', 'padding-left': '0px', 'padding-right': '0px' }}>
{isSelect ? (
this.state.selects.includes(record[valueName]) ? (
<>
......@@ -1238,7 +1248,7 @@ class FormList extends React.Component {
{rights && rights.includes('viewProcess') && record.process_biz_key ? (
<>
<a onClick={this.viewProcess.bind(this, record)}>流程详情</a>
{rights.includes('delete') ?<Divider type="vertical" />:""}
{rights.includes('delete') ? <Divider type="vertical" /> : ''}
</>
) : (
''
......
......@@ -160,7 +160,6 @@ export default class tableCom extends Component {
};
showModal = (fk, title, data, modalProps) => {
const { dispatch } = this.props;
dispatch({
type: 'DataColumn/showModal',
payload: { isShowModal: true },
......@@ -415,9 +414,9 @@ export default class tableCom extends Component {
onFilter: (value, record) =>
record[dataIndex]
? record[dataIndex]
.toString()
.toLowerCase()
.includes(value.toLowerCase())
.toString()
.toLowerCase()
.includes(value.toLowerCase())
: '',
onFilterDropdownVisibleChange: visible => {
if (visible) {
......@@ -490,7 +489,7 @@ export default class tableCom extends Component {
if (this.count.length > 10) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:存在循环风险,1秒内执行超过10次,现已停止执行,请检查,`,
1}列:存在循环风险,1秒内执行超过10次,现已停止执行,请检查,`,
);
return;
......@@ -512,9 +511,9 @@ export default class tableCom extends Component {
this.props.fatherCode != null
? bindObj
? {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: bindObj;
if (this.props.fatherCode == null && dataColumn == null)
......@@ -754,7 +753,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -810,7 +809,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
//message.error(`页面${this.props.formKey}第${this.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误${e}`, 10)
......@@ -824,7 +823,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -836,7 +835,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -885,7 +884,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -898,7 +897,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -910,7 +909,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -961,7 +960,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -974,7 +973,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -986,7 +985,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -1041,7 +1040,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -1054,7 +1053,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -1066,7 +1065,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -1184,7 +1183,7 @@ export default class tableCom extends Component {
} catch {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,函数内部错误,`,
1}列:公式配置有误,函数内部错误,`,
e,
);
}
......@@ -1194,7 +1193,7 @@ export default class tableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,暂存失败,`,
1}列:公式配置有误,暂存失败,`,
e,
);
}
......@@ -1221,9 +1220,9 @@ export default class tableCom extends Component {
this.props.fatherCode != null
? bindObj
? {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: bindObj;
if (this.props.fatherCode == null && dataColumn == null)
......@@ -1424,7 +1423,7 @@ export default class tableCom extends Component {
taskAssignee,
userId,
j,
isPreview
isPreview,
} = this.props;
const { options, labels, selectDis, modalCode, modalTitle, modalInit, modalProps } = this.state;
......@@ -1604,8 +1603,8 @@ export default class tableCom extends Component {
{get === 'mobile' ? <br /> : ''}
</span>
) : (
''
);
''
);
break;
case 'UploadCom':
......@@ -1664,7 +1663,8 @@ export default class tableCom extends Component {
) {
if (obj && obj.defaultValues && obj.defaultValues[formKey]) {
return (
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}
......@@ -1675,7 +1675,8 @@ export default class tableCom extends Component {
} else {
return (
<>
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}
......@@ -1752,8 +1753,8 @@ export default class tableCom extends Component {
</span>
</>
) : (
''
)}
''
)}
</Col>
<Col
span={json.wrapperSpan}
......@@ -1820,9 +1821,9 @@ export default class tableCom extends Component {
this.props.fatherCode != null
? bindObj
? {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: bindObj;
......@@ -1835,18 +1836,18 @@ export default class tableCom extends Component {
var title = json.label || (dataColumn && dataColumn.title);
var initValue;
const objinit = { ...init, ...obj }
const objinit = { ...init, ...obj };
if (objinit != null) {
if (this.props.fatherCode != null) {
initValue = objinit[this.props.index] != null
? objinit[this.props.index][bindObj ? bindObj.base52 : this.props.uuid]
: null;
initValue =
objinit[this.props.index] != null
? objinit[this.props.index][bindObj ? bindObj.base52 : this.props.uuid]
: null;
} else {
initValue = objinit[dataColumn.base52];
}
} else {
if (json.initialValue != null) {
try {
initValue = JSON.parse(json.initialValue);
......@@ -1856,7 +1857,6 @@ export default class tableCom extends Component {
}
}
if (!isEdit) {
if (this.props.fatherCode) {
if (bindObj != null) {
......@@ -1932,18 +1932,18 @@ export default class tableCom extends Component {
<span>
{labels != null
? labels.map((r, i) =>
i == 0 ? (
typeof r == 'string' ? (
<span>{r}</span>
) : (
i == 0 ? (
typeof r == 'string' ? (
<span>{r}</span>
) : (
Object.values(r)
)
) : typeof r == 'string' ? (
<span style={{ marginLeft: 12 }}>{r}</span>
) : (
',' + Object.values(r)
),
)
) : typeof r == 'string' ? (
<span style={{ marginLeft: 12 }}>{r}</span>
) : (
',' + Object.values(r)
),
)
: ''}
</span>
);
......@@ -2021,8 +2021,8 @@ export default class tableCom extends Component {
<span>
{obj[dataColumn.base52]
? moment(+new Date(obj[dataColumn.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)
: ''}
</span>
);
......@@ -2136,11 +2136,11 @@ export default class tableCom extends Component {
height={json.height}
/>
) : (
<img
src={config.httpServer + obj[dataColumn.base52]}
style={{ width: json.width, height: json.height }}
/>
);
<img
src={config.httpServer + obj[dataColumn.base52]}
style={{ width: json.width, height: json.height }}
/>
);
}
break;
......@@ -2149,10 +2149,10 @@ export default class tableCom extends Component {
<img
src={config.httpServer + obj[dataColumn.base52]}
style={{
marginLeft:5,
marginLeft: 5,
width:
get === 'mobile'
? (document.documentElement.clientWidth - 10 || document.body.clientWidth - 10)
? document.documentElement.clientWidth - 10 || document.body.clientWidth - 10
: json.width,
height: get === 'mobile' ? '' : json.height,
}}
......@@ -2356,7 +2356,7 @@ export default class tableCom extends Component {
}
>
{(json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel)
(json.isMobileLabel == null && json.isLabel)
? title
: ''}
</MobileList.Item>
......@@ -2402,7 +2402,8 @@ export default class tableCom extends Component {
title
) {
cm = (
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
......@@ -2443,7 +2444,8 @@ export default class tableCom extends Component {
title
) {
cm = (
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
......@@ -2474,7 +2476,8 @@ export default class tableCom extends Component {
title
) {
cm = (
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
......@@ -2509,7 +2512,8 @@ export default class tableCom extends Component {
title
) {
cm = (
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
......@@ -2550,25 +2554,25 @@ export default class tableCom extends Component {
getPopupContainer={
this.props.isDynamic && document.querySelector('#dynamic_div')
? () => {
return document.querySelector('#dynamic_div');
}
return document.querySelector('#dynamic_div');
}
: ''
}
onFocus={() => {
get === 'mobile' // 移动端取消输入键盘弹出
? setTimeout(() => {
if (document.querySelectorAll(`.ant-select-search__field`).length > 0) {
let ary = [...document.querySelectorAll(`.ant-select-search__field`)];
ary.map(item => {
item.setAttribute('readonly', 'readonly');
// setTimeout(() => {
// ary.map(arr => {
// arr.removeAttribute('readonly');
// })
// });
});
}
})
if (document.querySelectorAll(`.ant-select-search__field`).length > 0) {
let ary = [...document.querySelectorAll(`.ant-select-search__field`)];
ary.map(item => {
item.setAttribute('readonly', 'readonly');
// setTimeout(() => {
// ary.map(arr => {
// arr.removeAttribute('readonly');
// })
// });
});
}
})
: null;
}}
filterOption={(input, option) =>
......@@ -2579,10 +2583,10 @@ export default class tableCom extends Component {
>
{options
? options.map(r => (
<Option key={r.value} value={r.value}>
{r.label}
</Option>
))
<Option key={r.value} value={r.value}>
{r.label}
</Option>
))
: ''}
</Select>,
);
......@@ -2593,7 +2597,8 @@ export default class tableCom extends Component {
title
) {
cm = (
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
......@@ -2614,22 +2619,22 @@ export default class tableCom extends Component {
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
validator: (rule, value, callback) => {
if (
(Object.keys(value).length == 0 ||
Object.keys(value.selects).length == 0) &&
required != null &&
required
) {
var errors = [];
errors.push(new Error('请选择至少一个', rule.field));
}
callback(errors);
{
validator: (rule, value, callback) => {
if (
(Object.keys(value).length == 0 ||
Object.keys(value.selects).length == 0) &&
required != null &&
required
) {
var errors = [];
errors.push(new Error('请选择至少一个', rule.field));
}
callback(errors);
},
required: required,
},
required: required,
},
],
],
})(
<TableSelect
get={get}
......@@ -2647,7 +2652,8 @@ export default class tableCom extends Component {
title
) {
cm = (
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
......@@ -2696,7 +2702,8 @@ export default class tableCom extends Component {
title
) {
cm = (
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
......@@ -2743,21 +2750,21 @@ export default class tableCom extends Component {
onOpenChange={
get === 'mobile'
? () => {
// 取消唤起移动端小键盘
setTimeout(() => {
if (document.querySelector('.ant-calendar-input ')) {
document
.querySelector('.ant-calendar-input ')
.setAttribute('readonly', 'readonly');
setTimeout(() => {
// 取消唤起移动端小键盘
setTimeout(() => {
if (document.querySelector('.ant-calendar-input ')) {
document
.querySelector('.ant-calendar-input ')
.removeAttribute('readonly');
});
}
});
}
: () => { }
.setAttribute('readonly', 'readonly');
setTimeout(() => {
document
.querySelector('.ant-calendar-input ')
.removeAttribute('readonly');
});
}
});
}
: () => {}
}
format={json.format ? json.format : 'YYYY-MM-DD HH:mm:ss'}
/>,
......@@ -2769,7 +2776,8 @@ export default class tableCom extends Component {
title
) {
cm = (
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
......@@ -2809,7 +2817,8 @@ export default class tableCom extends Component {
title
) {
cm = (
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
......@@ -2834,7 +2843,8 @@ export default class tableCom extends Component {
title
) {
cm = (
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
......@@ -2867,7 +2877,8 @@ export default class tableCom extends Component {
title
) {
cm = (
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
......@@ -2908,7 +2919,8 @@ export default class tableCom extends Component {
title
) {
cm = (
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
......@@ -2933,7 +2945,8 @@ export default class tableCom extends Component {
title
) {
cm = (
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
......@@ -2954,7 +2967,7 @@ export default class tableCom extends Component {
<Signature
width={
get === 'mobile'
? (document.documentElement.clientWidth - 10 || document.body.clientWidth - 10)
? document.documentElement.clientWidth - 10 || document.body.clientWidth - 10
: json.width
}
height={json.height}
......@@ -2967,7 +2980,8 @@ export default class tableCom extends Component {
title
) {
cm = (
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
......@@ -3037,8 +3051,8 @@ export default class tableCom extends Component {
/>
</FormModal>
) : (
''
)}
''
)}
<Card.Header title={<span style={{ fontSize: 14 }}>{title}:</span>} />
<Card.Body>{cm}</Card.Body>
</Card>
......@@ -3116,8 +3130,8 @@ export default class tableCom extends Component {
/>
</FormModal>
) : (
''
)}
''
)}
</Row>
);
} else {
......@@ -3150,8 +3164,8 @@ export default class tableCom extends Component {
/>
</FormModal>
) : (
''
)}
''
)}
<Form.Item
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
......@@ -3192,8 +3206,8 @@ export default class tableCom extends Component {
/>
</FormModal>
) : (
''
)}
''
)}
{cm}
</>
);
......@@ -3228,27 +3242,32 @@ export default class tableCom extends Component {
/>
</FormModal>
) : (
''
)}
''
)}
{json.isMobileLabel && !isEdit && get == 'mobile' ? (
<MobileItem isPreview={isPreview}
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</MobileItem>
) : (
isEdit && get == 'web' ? (json.isLabel ? <Form.Item
) : isEdit && get == 'web' ? (
json.isLabel ? (
<Form.Item
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</Form.Item> : <Form.Item>{cm}</Form.Item>) : cm
)}
</Form.Item>
) : (
<Form.Item>{cm}</Form.Item>
)
) : (
cm
)}
</>
);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论