| | |
| | | if (openType === 'pop') { |
| | | shows.push('extBtn') |
| | | if (this.record.extBtn === 'true') { |
| | | shows.push('extLabel', 'extValue') |
| | | shows.push('extLabel', 'extStyle', 'confLabel', 'confStyle', 'extValue') |
| | | } |
| | | } |
| | | } else if (openType === 'form') { |
| | |
| | | import React from 'react' |
| | | import { btnClasses } from '@/utils/option.js' |
| | | import { btnClasses, modalClasses } from '@/utils/option.js' |
| | | |
| | | /** |
| | | * @description 获取按钮表单配置信息 |
| | |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'extValue', |
| | | label: '扩展值', |
| | | initVal: card.extValue || '', |
| | | required: true, |
| | | readonly: false, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'extLabel', |
| | | label: '扩展名称', |
| | | initVal: card.extLabel || '', |
| | |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'extStyle', |
| | | label: '扩展样式', |
| | | initVal: card.extStyle || '', |
| | | required: false, |
| | | options: modalClasses, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'extValue', |
| | | label: '扩展值', |
| | | initVal: card.extValue || '', |
| | | required: true, |
| | | key: 'confLabel', |
| | | label: '确定名称', |
| | | initVal: card.confLabel || '', |
| | | required: false, |
| | | readonly: false, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'confStyle', |
| | | label: '确定样式', |
| | | initVal: card.confStyle || '', |
| | | required: false, |
| | | options: modalClasses, |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'extValue', |
| | | label: '扩展值', |
| | | initVal: card.extValue || '', |
| | | required: true, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'extLabel', |
| | | label: '扩展名称', |
| | | initVal: card.extLabel || '', |
| | |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'extStyle', |
| | | label: '扩展样式', |
| | | initVal: card.extStyle || '', |
| | | required: false, |
| | | options: modalClasses |
| | | }, |
| | | { |
| | | type: 'text', |
| | | key: 'extValue', |
| | | label: '扩展值', |
| | | initVal: card.extValue || '', |
| | | required: true, |
| | | key: 'confLabel', |
| | | label: '确定名称', |
| | | initVal: card.confLabel || '', |
| | | required: false, |
| | | readonly: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'confStyle', |
| | | label: '确定样式', |
| | | initVal: card.confStyle || '', |
| | | required: false, |
| | | options: modalClasses |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'execType', |
| | | label: '请求方式', |
| | |
| | | </div> |
| | | </div> |
| | | <div className="ant-modal-footer"> |
| | | <div> |
| | | {btn.extBtn === 'true' ? <div> |
| | | <button type="button" className="ant-btn"> |
| | | <span>取消</span> |
| | | </button> |
| | | <button type="button" className={'ant-btn extend-btn ' + (btn.extStyle || '')}> |
| | | <span>{btn.extLabel}</span> |
| | | </button> |
| | | <button type="button" className={'ant-btn confirm-btn ' + (btn.confStyle || '')}> |
| | | <span>{btn.confLabel || '确定'}</span> |
| | | </button> |
| | | </div> : <div> |
| | | <button type="button" className="ant-btn"> |
| | | <span>取消</span> |
| | | </button> |
| | | <button type="button" className="ant-btn ant-btn-primary"> |
| | | <span>确定</span> |
| | | </button> |
| | | </div> |
| | | </div>} |
| | | <div className="action-mask"></div> |
| | | </div> |
| | | </div> |
| | |
| | | .ant-modal-footer { |
| | | position: relative; |
| | | button { |
| | | opacity: 0.3; |
| | | opacity: 0.5; |
| | | } |
| | | .extend-btn { |
| | | color: var(--mk-sys-color)!important; |
| | | border-color: var(--mk-sys-color)!important; |
| | | background-color: #ffffff!important; |
| | | } |
| | | .confirm-btn { |
| | | background-color: var(--mk-sys-color)!important; |
| | | border-color: var(--mk-sys-color)!important; |
| | | color: #ffffff!important; |
| | | } |
| | | |
| | | .extend-btn.primary, .confirm-btn.primary { |
| | | background-color: #1890ff!important; |
| | | border-color: #1890ff!important; |
| | | color: #ffffff!important; |
| | | } |
| | | .extend-btn.yellow, .confirm-btn.yellow { |
| | | background-color: #fadb14!important; |
| | | border-color: #fadb14!important; |
| | | color: #ffffff!important; |
| | | } |
| | | .extend-btn.orange, .confirm-btn.orange { |
| | | background-color: #fa8c16!important; |
| | | border-color: #fa8c16!important; |
| | | color: #ffffff!important; |
| | | } |
| | | .extend-btn.danger, .confirm-btn.danger { |
| | | background-color: #f5222d!important; |
| | | border-color: #f5222d!important; |
| | | color: #ffffff!important; |
| | | } |
| | | .extend-btn.green, .confirm-btn.green { |
| | | background-color: #52c41a!important; |
| | | border-color: #52c41a!important; |
| | | color: #ffffff!important; |
| | | } |
| | | .extend-btn.purple, .confirm-btn.purple { |
| | | background-color: #722ed1!important; |
| | | border-color: #722ed1!important; |
| | | color: #ffffff!important; |
| | | } |
| | | |
| | | .extend-btn.border-primary, .confirm-btn.border-primary { |
| | | color: #1890ff!important; |
| | | border-color: #1890ff!important; |
| | | background-color: #ffffff!important; |
| | | } |
| | | .extend-btn.border-yellow, .confirm-btn.border-yellow { |
| | | color: #fadb14!important; |
| | | border-color: #fadb14!important; |
| | | background-color: #ffffff!important; |
| | | } |
| | | .extend-btn.border-orange, .confirm-btn.border-orange { |
| | | color: #fa8c16!important; |
| | | border-color: #fa8c16!important; |
| | | background-color: #ffffff!important; |
| | | } |
| | | .extend-btn.border-danger, .confirm-btn.border-danger { |
| | | color: #f5222d!important; |
| | | border-color: #f5222d!important; |
| | | background-color: #ffffff!important; |
| | | } |
| | | .extend-btn.border-green, .confirm-btn.border-green { |
| | | color: #52c41a!important; |
| | | border-color: #52c41a!important; |
| | | background-color: #ffffff!important; |
| | | } |
| | | .extend-btn.border-purple, .confirm-btn.border-purple { |
| | | color: #722ed1!important; |
| | | border-color: #722ed1!important; |
| | | background-color: #ffffff!important; |
| | | } |
| | | } |
| | | .action-mask { |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MkIcon from '@/components/mk-icon' |
| | | import MkCounter from './mkcounter' |
| | | // import './index.scss' |
| | | |
| | | import './index.scss' |
| | | |
| | | const MutilForm = asyncSpinComponent(() => import('@/tabviews/zshare/mutilform')) |
| | | const { confirm } = Modal |
| | |
| | | <Button onClick={this.handleCancel} style={{ marginRight: 8 }}> |
| | | {dict['cancel'] || '取消'} |
| | | </Button> |
| | | {btn.extBtn === 'true' ? <Button style={{color: 'var(--mk-sys-color)', borderColor: 'var(--mk-sys-color)'}} disabled={confirmLoading && submitType !== btn.extValue} loading={confirmLoading && submitType === btn.extValue} onClick={() => this.handleOk(btn.extValue)}>{btn.extLabel}</Button> : null} |
| | | {btn.extBtn === 'true' ? <Button type="primary" disabled={confirmLoading && submitType !== ''} loading={confirmLoading && submitType === ''} onClick={() => this.handleOk()}>{dict['ok'] || '确定'}</Button> : null} |
| | | {btn.extBtn === 'true' ? <Button className={'extend-btn ' + (btn.extStyle || '')} disabled={confirmLoading && submitType !== btn.extValue} loading={confirmLoading && submitType === btn.extValue} onClick={() => this.handleOk(btn.extValue)}>{btn.extLabel}</Button> : null} |
| | | {btn.extBtn === 'true' ? <Button className={'confirm-btn ' + (btn.confStyle || '')} disabled={confirmLoading && submitType !== ''} loading={confirmLoading && submitType === ''} onClick={() => this.handleOk()}>{btn.confLabel || dict['ok'] || '确定'}</Button> : null} |
| | | {btn.extBtn !== 'true' ? <Button type="primary" loading={confirmLoading} onClick={() => this.handleOk()}>{dict['ok'] || '确定'}</Button> : null} |
| | | </div>} |
| | | </Drawer> |
| | |
| | | onCancel={this.handleCancel} |
| | | footer={[ |
| | | <Button key="cancel" onClick={this.handleCancel}>{dict['cancel'] || '取消'}</Button>, |
| | | btn.extBtn === 'true' ? <Button key="extend" style={{color: 'var(--mk-sys-color)', borderColor: 'var(--mk-sys-color)'}} disabled={confirmLoading && submitType !== btn.extValue} loading={confirmLoading && submitType === btn.extValue} onClick={() => this.handleOk(btn.extValue)}>{btn.extLabel}</Button> : null, |
| | | btn.extBtn === 'true' ? <Button key="confirm" type="primary" disabled={confirmLoading && submitType !== ''} loading={confirmLoading && submitType === ''} onClick={() => this.handleOk()}>{dict['ok'] || '确定'}</Button> : null, |
| | | btn.extBtn === 'true' ? <Button key="extend" className={'extend-btn ' + (btn.extStyle || '')} disabled={confirmLoading && submitType !== btn.extValue} loading={confirmLoading && submitType === btn.extValue} onClick={() => this.handleOk(btn.extValue)}>{btn.extLabel}</Button> : null, |
| | | btn.extBtn === 'true' ? <Button key="confirm" className={'confirm-btn ' + (btn.confStyle || '')} disabled={confirmLoading && submitType !== ''} loading={confirmLoading && submitType === ''} onClick={() => this.handleOk()}>{btn.confLabel || dict['ok'] || '确定'}</Button> : null, |
| | | btn.extBtn !== 'true' ? <Button key="confirm" type="primary" loading={confirmLoading} onClick={() => this.handleOk()}>{dict['ok'] || '确定'}</Button> : null |
| | | ]} |
| | | destroyOnClose |
| | |
| | | .extend-btn { |
| | | color: var(--mk-sys-color)!important; |
| | | border-color: var(--mk-sys-color)!important; |
| | | background-color: #ffffff!important; |
| | | } |
| | | .confirm-btn { |
| | | background-color: var(--mk-sys-color)!important; |
| | | border-color: var(--mk-sys-color)!important; |
| | | color: #ffffff!important; |
| | | } |
| | | |
| | | .extend-btn.primary, .confirm-btn.primary { |
| | | background-color: #1890ff!important; |
| | | border-color: #1890ff!important; |
| | | color: #ffffff!important; |
| | | } |
| | | .extend-btn.yellow, .confirm-btn.yellow { |
| | | background-color: #fadb14!important; |
| | | border-color: #fadb14!important; |
| | | color: #ffffff!important; |
| | | } |
| | | .extend-btn.orange, .confirm-btn.orange { |
| | | background-color: #fa8c16!important; |
| | | border-color: #fa8c16!important; |
| | | color: #ffffff!important; |
| | | } |
| | | .extend-btn.danger, .confirm-btn.danger { |
| | | background-color: #f5222d!important; |
| | | border-color: #f5222d!important; |
| | | color: #ffffff!important; |
| | | } |
| | | .extend-btn.green, .confirm-btn.green { |
| | | background-color: #52c41a!important; |
| | | border-color: #52c41a!important; |
| | | color: #ffffff!important; |
| | | } |
| | | .extend-btn.purple, .confirm-btn.purple { |
| | | background-color: #722ed1!important; |
| | | border-color: #722ed1!important; |
| | | color: #ffffff!important; |
| | | } |
| | | |
| | | .extend-btn.border-primary, .confirm-btn.border-primary { |
| | | color: #1890ff!important; |
| | | border-color: #1890ff!important; |
| | | background-color: #ffffff!important; |
| | | } |
| | | .extend-btn.border-yellow, .confirm-btn.border-yellow { |
| | | color: #fadb14!important; |
| | | border-color: #fadb14!important; |
| | | background-color: #ffffff!important; |
| | | } |
| | | .extend-btn.border-orange, .confirm-btn.border-orange { |
| | | color: #fa8c16!important; |
| | | border-color: #fa8c16!important; |
| | | background-color: #ffffff!important; |
| | | } |
| | | .extend-btn.border-danger, .confirm-btn.border-danger { |
| | | color: #f5222d!important; |
| | | border-color: #f5222d!important; |
| | | background-color: #ffffff!important; |
| | | } |
| | | .extend-btn.border-green, .confirm-btn.border-green { |
| | | color: #52c41a!important; |
| | | border-color: #52c41a!important; |
| | | background-color: #ffffff!important; |
| | | } |
| | | .extend-btn.border-purple, .confirm-btn.border-purple { |
| | | color: #722ed1!important; |
| | | border-color: #722ed1!important; |
| | | background-color: #ffffff!important; |
| | | } |
| | |
| | | text: '白底紫框' |
| | | }] |
| | | |
| | | // 按钮颜色集 |
| | | export const modalClasses = [{ |
| | | value: 'primary', |
| | | text: '蓝色' |
| | | }, { |
| | | value: 'yellow', |
| | | text: '黄色' |
| | | }, { |
| | | value: 'orange', |
| | | text: '橙色' |
| | | }, { |
| | | value: 'danger', |
| | | text: '红色' |
| | | }, { |
| | | value: 'green', |
| | | text: '绿色' |
| | | }, { |
| | | value: 'purple', |
| | | text: '紫色' |
| | | }, { |
| | | value: 'border-primary', |
| | | text: '白底蓝框' |
| | | }, { |
| | | value: 'border-yellow', |
| | | text: '白底黄框' |
| | | }, { |
| | | value: 'border-orange', |
| | | text: '白底橙框' |
| | | }, { |
| | | value: 'border-danger', |
| | | text: '白底红框' |
| | | }, { |
| | | value: 'border-green', |
| | | text: '白底绿框' |
| | | }, { |
| | | value: 'border-purple', |
| | | text: '白底紫框' |
| | | }] |
| | | |
| | | export const calendarColors = [ |
| | | {name: 'red', value: '#d0021b'}, |
| | | {name: 'orange', value: '#f5a623'}, |