import { Spin } from 'antd'; import { WeaSwitch } from 'comsMobx'; import { WeaLocaleProvider, WeaAlertPage, WeaSearchGroup, WeaFormItem } from 'ecCom'; const getLabel = WeaLocaleProvider.getLabel; import '../style/index.less' // 渲染form表单: 一般对form的渲染都统一使用该方法 export const getSearchs = (form, condition, col, isCenter) => { const { isFormInit } = form; const formParams = form.getFormParams(); let group = []; isFormInit && condition && condition.map(c =>{ let items = []; c.items.map(fields => { items.push({ com:( ), colSpan:1, }) }); group.push( ) }); return group; } // 页面加载中效果处理 export const renderLoading = (loading) => (
) // 无权限处理 export const renderNoright = () => (
{getLabel(2012,'对不起,您暂时没有权限!')}
) // 暂无数据处理 export const renderNoData = () => (
暂无数据
) //对象非空判断 export const isEmpty = (obj) =>{ for(var n in obj){return false} return true; } export const calFormHeight = (groupLength, children) => { let childrenLength = 0; children.map(c => { if (c.colSpan != null) { childrenLength += c.colSpan == 2 ? 1 : 2; } else childrenLength += 1; }) let height = (childrenLength / 2 + childrenLength % 2) * 52 + 10; if (groupLength > 1) height += groupLength * 45; if (height > 300) return 300; return height; }