From 6c66c9c2a6d0f7e7ccc65d4d9e478f1acb74d87e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 20 八月 2021 12:12:48 +0800 Subject: [PATCH] 2021-08-20 --- src/tabviews/zshare/actionList/normalbutton/index.jsx | 34 ++++++++++++++++++++++++++-------- 1 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index ff40ea8..8aac0c2 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -3,7 +3,7 @@ import moment from 'moment' import {connect} from 'react-redux' import { is, fromJS } from 'immutable' -import { Button, Modal, notification, message, Drawer } from 'antd' +import { Button, Modal, notification, message, Drawer, Icon } from 'antd' import Api from '@/api' import Utils, { getSysDefaultSql } from '@/utils/utils.js' @@ -70,9 +70,8 @@ componentDidMount () { const { position } = this.props - if (position === 'toolbar') { - MKEmitter.addListener('triggerBtnId', this.actionTrigger) - } else if (position === 'form') { + MKEmitter.addListener('triggerBtnId', this.actionTrigger) + if (position === 'form') { MKEmitter.addListener('triggerFormSubmit', this.actionSubmit) } MKEmitter.addListener('returnModuleParam', this.resetModuleParam) @@ -866,7 +865,7 @@ }) Api.directRequest(url, btn.method, param, btn.cross).then(res => { - if (typeof(res) !== 'object' || Array.isArray(res)) { + if (typeof(res) !== 'object') { let error = '鏈煡鐨勮繑鍥炵粨鏋滐紒' if (typeof(res) === 'string') { @@ -881,6 +880,9 @@ this.customCallbackRequest(params, result, record, _resolve) } else { + if (Array.isArray(res)) { + res = { data: res } + } res.mk_api_key = mkey this.customCallbackRequest(params, res, record, _resolve) } @@ -1721,7 +1723,7 @@ BData={this.props.BData} wrappedComponentRef={(inst) => this.formRef = inst} /> - <div style={{ position: 'absolute', right: 0, bottom: 0, width: '100%', borderTop: '1px solid #e9e9e9', padding: '10px 16px', background: '#fff', textAlign: 'right'}}> + <div style={{ position: 'absolute', zIndex: 1, right: 0, bottom: 0, width: '100%', borderTop: '1px solid #e9e9e9', padding: '10px 16px', background: '#fff', textAlign: 'right'}}> <Button onClick={this.handleCancel} style={{ marginRight: 8 }}> 鍙栨秷 </Button> @@ -1797,6 +1799,22 @@ {this.getModels()} </div> } else { // icon銆乼ext銆� all 鍗$墖 + let label = '' + let icon = '' + + if (show === 'button') { + label = btn.label + icon = btn.icon || '' + } else if (show === 'link') { + label = <span>{btn.label}{btn.icon ? <Icon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> + icon = '' + } else if (show === 'icon') { + icon = btn.icon || '' + // } else if (show === 'text') { + } else { + label = btn.label + } + return <div style={{display: 'inline-block'}} onClick={(e) => e.stopPropagation()}> <Button type="link" @@ -1804,9 +1822,9 @@ loading={loading} disabled={disabled} style={btn.style || style} - icon={show === 'text' ? '' : (btn.icon || '')} + icon={icon} onClick={() => {this.actionTrigger()}} - >{show === 'icon' && btn.icon ? '' : btn.label}</Button> + >{label}</Button> {this.getModels()} </div> } -- Gitblit v1.8.0