| | |
| | | "display": "standalone", |
| | | "theme_color": "#000000", |
| | | "background_color": "#ffffff", |
| | | "mk_version": "20250502" |
| | | "mk_version": "20250605" |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | mkFormSubmit = (btnId, callback, formId) => { |
| | | mkFormSubmit = (btnId, callback, formId, errId) => { |
| | | const { group } = this.state |
| | | |
| | | if (group.uuid !== btnId) return |
| | | |
| | | this.formRef.handleConfirm(formId).then(res => { |
| | | this.formRef.handleConfirm(formId, errId).then(res => { |
| | | MKEmitter.emit('triggerFormSubmit', {menuId: btnId, form: res}) |
| | | }, () => { |
| | | callback && callback() |
| | |
| | | data={data} |
| | | action={group} |
| | | unload={config.setting.supModule && !BID} |
| | | inputSubmit={(id) => this.mkFormSubmit(group.uuid, null, id)} |
| | | inputSubmit={(id, errId) => this.mkFormSubmit(group.uuid, null, id, errId)} |
| | | wrappedComponentRef={(inst) => this.formRef = inst} |
| | | /> : null} |
| | | {data ? <div className={'mk-form-action ' + (group.$button || '')}> |
| | |
| | | } else if (component.wrap && component.wrap.datatype === 'static') { |
| | | component.format = '' |
| | | component.setting = component.setting || {} |
| | | component.setting.useMSearch = false |
| | | component.setting.useMSearch = component.wrap.useMSearch === 'true' |
| | | component.setting.sync = 'false' |
| | | |
| | | return component |
| | |
| | | } else if (component.wrap && component.wrap.datatype === 'static') { |
| | | component.format = '' |
| | | component.setting = component.setting || {} |
| | | component.setting.useMSearch = false |
| | | component.setting.useMSearch = component.wrap.useMSearch === 'true' |
| | | component.setting.sync = 'false' |
| | | |
| | | return component |
| | |
| | | * @description 获取所有菜单节点,形成权限树 |
| | | */ |
| | | getAllMenuList = async () => { |
| | | const { selectRoleId, mainMenus } = this.state |
| | | const { mainMenus } = this.state |
| | | |
| | | let param = { |
| | | func: 's_rolemenu_get_FunMenu', |
| | | RoleID: selectRoleId, |
| | | RoleID: '', |
| | | SelectedType: '', |
| | | version: 1 |
| | | } |
| | |
| | | loadingTree: false, |
| | | menuTrees: _tree, |
| | | menuOpenKeys: _openKeys |
| | | }, () => { |
| | | if (this.state.selectRoleId) { |
| | | this.getSelectMenuList() |
| | | } |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | |
| | | delete result.message |
| | | delete result.status |
| | | |
| | | param = { |
| | | ...outParam, |
| | | ...result, |
| | | func: btn.callbackFunc |
| | | } |
| | | param = {} |
| | | |
| | | Object.keys(outParam).forEach(key => { |
| | | param[key.toLowerCase()] = outParam[key] |
| | | }) |
| | | Object.keys(result).forEach(key => { |
| | | param[key.toLowerCase()] = result[key] |
| | | }) |
| | | |
| | | param.func = btn.callbackFunc |
| | | |
| | | if (window.GLOB.mkHS) { |
| | | if (btn.callbackFunc === 's_sVersion_Local_add' && window.GLOB.forcedUpdate) { // special 传输号添加回调处理 |
| | |
| | | if (focusField) { |
| | | MKEmitter.emit('resetFocus', btn.uuid, focusField) |
| | | } |
| | | window.GLOB.errFocusId = '' |
| | | |
| | | this.setState({ |
| | | loadingNumber: '', |
| | |
| | | loadingTotal: '', |
| | | }) |
| | | |
| | | if (btnconfig && btnconfig.setting && btnconfig.setting.errFocus) { |
| | | if (window.GLOB.errFocusId && (btnconfig || btn.OpenType === 'formSubmit')) { |
| | | MKEmitter.emit('mkFC', 'focus', window.GLOB.errFocusId) |
| | | |
| | | window.GLOB.errFocusId = '' |
| | | } else if (btnconfig && btnconfig.setting && btnconfig.setting.errFocus) { |
| | | MKEmitter.emit('mkFC', 'focus', btnconfig.setting.errFocus) |
| | | } |
| | | |
| | |
| | | |
| | | if (item.enter === 'tab' || item.enter === 'sub') { |
| | | item.tabUuid = '' |
| | | if (item.enter === 'sub' && item.errTabField) { |
| | | if (item.errTabField === 'origin') { |
| | | item.errTabUuid = item.uuid |
| | | } else if (fieldMap.has(item.errTabField)) { |
| | | item.errTabUuid = fieldMap.get(item.errTabField).uuid |
| | | } |
| | | } |
| | | if (item.tabField && fieldMap.has(item.tabField)) { |
| | | item.tabUuid = fieldMap.get(item.tabField).uuid |
| | | } else if (item.enter === 'tab') { |
| | |
| | | return fields |
| | | } |
| | | |
| | | handleConfirm = (formId) => { |
| | | handleConfirm = (formId, errId) => { |
| | | const { action } = this.props |
| | | const { formlist, send_type, timestamp, n_id } = this.state |
| | | |
| | | window.GLOB.errFocusId = '' |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | |
| | | }) |
| | | |
| | | this.submitId = formId || '' |
| | | window.GLOB.errFocusId = errId || '' |
| | | |
| | | if (locals) { |
| | | sessionStorage.setItem('local_' + action.uuid, JSON.stringify(locals)) |
| | |
| | | config.tabUuid && MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | if (config.linkFields || config.subFields || config.controlFields) { |
| | | setTimeout(() => { |
| | | this.props.onSubmit(config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid, config.errTabUuid) |
| | | }, 1000) |
| | | } else { |
| | | this.props.onSubmit(config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid, config.errTabUuid) |
| | | } |
| | | } |
| | | }) |
| | |
| | | MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | } else if (config.enter === 'sub') { |
| | | config.tabUuid && MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid, config.errTabUuid) |
| | | } |
| | | }, 50) |
| | | } |
| | |
| | | MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | } else { |
| | | MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid, config.errTabUuid) |
| | | } |
| | | } |
| | | |
| | |
| | | MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | } else { |
| | | MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid, config.errTabUuid) |
| | | } |
| | | } |
| | | |
| | |
| | | config.tabUuid && MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | if (config.subFields) { |
| | | setTimeout(() => { |
| | | this.props.onSubmit(config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid, config.errTabUuid) |
| | | }, 1000) |
| | | } else { |
| | | this.props.onSubmit(config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid, config.errTabUuid) |
| | | } |
| | | } |
| | | }) |
| | |
| | | config.tabUuid && MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | if (config.linkFields || config.subFields || config.controlFields) { |
| | | setTimeout(() => { |
| | | this.props.onSubmit(config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid, config.errTabUuid) |
| | | }, 1000) |
| | | } else { |
| | | this.props.onSubmit(config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid, config.errTabUuid) |
| | | } |
| | | } |
| | | }) |
| | |
| | | config.tabUuid && MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | if (config.linkFields || config.subFields || config.controlFields) { |
| | | setTimeout(() => { |
| | | this.props.onSubmit(config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid, config.errTabUuid) |
| | | }, 1000) |
| | | } else { |
| | | this.props.onSubmit(config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid, config.errTabUuid) |
| | | } |
| | | } |
| | | }) |
| | |
| | | MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | } else { |
| | | config.tabUuid && MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid, config.errTabUuid) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | val = val.replace(/(^\s+$)|\t+|\v+/ig, '') |
| | | |
| | | if (col.interception !== 'false') { |
| | | val = val.replace(/^\s+|\s+$/g, '') |
| | | } |
| | | |
| | | if (!val && col.required === 'true') { // 必填校验 |
| | | errors.push(_position + '内容不可为空') |
| | | } else if (col.limit && val.length > col.limit) { // 长度校验 |