import {Modal} from 'antd'; import {WeaSearchGroup, WeaFormItem} from 'ecCom'; import {WeaSwitch} from 'comsMobx'; import {WeaLocaleProvider} from 'ecCom'; const getLabel = WeaLocaleProvider.getLabel; //表单验证 export const onCheck = (form, func) => { form.validateForm().then(f=>{ if(f.isValid){ func && typeof func == 'function' && func(); }else{ f.showErrors(); } }); } export const setModal = (content) => { Modal.warning({ title: getLabel(15172,'系统提示'), content: content, }); } //信息确认 export const doConfirm = (content, func) => {//确认信息, 方法, 方法参数 Modal.confirm({ title: `${getLabel(131329,'信息确认')}`, content: content, okText: `${getLabel(826,'确定')}`, cancelText:`${getLabel(31129,'取消')}`, onOk: () => func && func(), }) } //用于获取高级搜索中的表单控件 export const getSearchs = (form, datas, needTigger = true, col=1, onEnterSearch) => { const {isFormInit} = form; let group = []; const formParams = form.getFormParams(); isFormInit && datas && datas.map((c, _index) =>{ let items = []; c.items.map(fields => { items.push({ com:( { typeof onEnterSearch === 'function' && onEnterSearch(); }}/> ), colSpan:1 }) }); if(needTigger){ group.push() }else { group.push() } }); return group; }