| | |
| | | const { value, options } = this.state |
| | | |
| | | return ( |
| | | <Checkbox.Group defaultValue={value} onChange={this.onChange}> |
| | | <Checkbox.Group style={{whiteSpace: 'nowrap'}} defaultValue={value} onChange={this.onChange}> |
| | | {options.map(option => <Checkbox key={option.value} title={option.label} disabled={option.disabled} value={option.value}>{option.label}</Checkbox>)} |
| | | </Checkbox.Group> |
| | | ) |
| | |
| | | key: 'copyable', |
| | | label: '可复制', |
| | | initVal: card.copyable || 'false', |
| | | tooltip: '元素是否可复制,复制内容包括前缀与后缀。', |
| | | tooltip: '元素是否可复制,复制内容不包括前缀与后缀。', |
| | | required: false, |
| | | options: [ |
| | | { value: 'true', text: '是' }, |
| | |
| | | } |
| | | } else if (element.eleType === 'picture') { |
| | | options = ['border', 'margin'] |
| | | } else if (element.eleType === 'text') { |
| | | options[0] = 'font2' |
| | | } else if (element.eleType === 'slider') { |
| | | options = ['padding', 'margin'] |
| | | } else if (element.eleType === 'splitline') { |
| | |
| | | }) |
| | | } |
| | | |
| | | getVerify = (card) => { |
| | | const { cards } = this.props |
| | | const { dict } = this.state |
| | | |
| | | if (!card) return null |
| | | |
| | | if (['pop', 'prompt', 'exec'].includes(card.OpenType)) { |
| | | return <VerifyCard |
| | | card={card} |
| | | dict={dict} |
| | | config={cards} |
| | | columns={cards.columns} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> |
| | | } else if (card.OpenType === 'excelIn') { |
| | | return <VerifyExcelIn |
| | | card={card} |
| | | dict={dict} |
| | | columns={cards.columns} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> |
| | | } else if (card.OpenType === 'excelOut') { |
| | | return <VerifyExcelOut |
| | | card={card} |
| | | dict={dict} |
| | | config={cards} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> |
| | | } else if (card.OpenType === 'funcbutton' && card.funcType === 'print') { |
| | | return <VerifyPrint |
| | | card={card} |
| | | dict={dict} |
| | | columns={cards.columns} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { cards, cardCell } = this.props |
| | | const { elements, visible, actvisible, profVisible, card, dict, record } = this.state |
| | |
| | | }} |
| | | destroyOnClose |
| | | > |
| | | {card && !card.execMode && card.OpenType !== 'excelIn' && card.OpenType !== 'excelOut' ? |
| | | <VerifyCard |
| | | card={card} |
| | | dict={dict} |
| | | config={cards} |
| | | columns={cards.columns} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> : null |
| | | } |
| | | {card && card.execMode ? |
| | | <VerifyPrint |
| | | card={card} |
| | | dict={dict} |
| | | columns={cards.columns} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> : null |
| | | } |
| | | {card && card.OpenType === 'excelIn' ? |
| | | <VerifyExcelIn |
| | | card={card} |
| | | dict={dict} |
| | | columns={cards.columns} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> : null |
| | | } |
| | | {card && card.OpenType === 'excelOut' ? |
| | | <VerifyExcelOut |
| | | card={card} |
| | | dict={dict} |
| | | config={cards} |
| | | wrappedComponentRef={(inst) => this.verifyRef = inst} |
| | | /> : null |
| | | } |
| | | {this.getVerify(card)} |
| | | </Modal> |
| | | </div> |
| | | </div> |
| | |
| | | box-shadow: 0px 0px 2px #1890ff; |
| | | } |
| | | } |
| | | .model-table-action-verify-modal { |
| | | .ant-modal { |
| | | top: 50px; |
| | | padding-bottom: 5px; |
| | | .ant-modal-body { |
| | | max-height: calc(100vh - 190px); |
| | | min-height: calc(100vh - 300px); |
| | | overflow-y: auto; |
| | | .ant-empty { |
| | | margin: 5vh 8px; |
| | | } |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar { |
| | | width: 7px; |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar-thumb { |
| | | border-radius: 5px; |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); |
| | | background: rgba(0, 0, 0, 0.13); |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | } |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader } from 'antd' |
| | | import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Checkbox } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import { formRule } from '@/utils/option.js' |
| | | |
| | |
| | | shows.push('reload') |
| | | } else if (_funcType === 'megvii') { |
| | | shows.push('subFunc', 'progress') |
| | | } else if (_funcType === 'pay') { |
| | | shows.push('payType') |
| | | } |
| | | } |
| | | |
| | |
| | | content = <Radio.Group onChange={(e) => {this.optionChange(item.key, e.target.value)}}> |
| | | {item.options.map(option => <Radio key={option.value} value={option.value}>{option.text}</Radio>)} |
| | | </Radio.Group> |
| | | } else if (item.type === 'checkbox') { |
| | | rules = [ |
| | | { required: item.required, message: dict['form.required.select'] + item.label + '!' } |
| | | ] |
| | | |
| | | content = <Checkbox.Group> |
| | | {item.options.map(option => <Checkbox key={option.value} value={option.value}>{option.text}</Checkbox>)} |
| | | </Checkbox.Group> |
| | | } else if (item.type === 'cascader') { |
| | | initVal = item.initVal || [] |
| | | rules = [ |
| | |
| | | opentypes = opentypes.filter(item => ['pop', 'prompt', 'exec', 'innerpage', 'funcbutton'].includes(item.value)) |
| | | funTypes = [ |
| | | { value: 'scan', text: '扫码' }, |
| | | { value: 'pay', text: '支付' }, |
| | | { value: 'logout', text: '退出' }, |
| | | { value: 'mkBinding', text: '开通扫码登录' }, |
| | | { value: 'mkUnBinding', text: '用户解绑' }, |
| | |
| | | required: true, |
| | | }, |
| | | { |
| | | type: 'checkbox', |
| | | key: 'payType', |
| | | label: '支付方式', |
| | | initVal: card.payType || [], |
| | | required: true, |
| | | options: [{ |
| | | value: 'wxpay', |
| | | text: '微信' |
| | | }, { |
| | | value: 'alipay', |
| | | text: '支付宝' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'procMode', |
| | | label: '参数处理', |
| | |
| | | ArrowLeftOutlined, |
| | | ArrowRightOutlined, |
| | | SwapOutlined, |
| | | EnterOutlined, |
| | | } from '@ant-design/icons' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | |
| | | |
| | | state = { |
| | | card: null, |
| | | fonts: null, |
| | | comIds: [], |
| | | backgroundImage: '', |
| | | options: [], |
| | |
| | | if (style.backgroundImage && /^url/ig.test(style.backgroundImage)) { |
| | | backgroundImage = style.backgroundImage.replace(/^url\(/ig, '').replace(/\)$/ig, '') |
| | | } |
| | | let fonts = null |
| | | if (options.includes('font')) { |
| | | fonts = ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'color', 'fontStyle', 'textAlign', 'textDecoration'] |
| | | } else if (options.includes('font1')) { |
| | | fonts = ['fontSize', 'fontWeight', 'color'] |
| | | if (options[0] === 'font1') { |
| | | options[0] = 'font' |
| | | } |
| | | } else if (options.includes('font2')) { |
| | | fonts = ['fontSize', 'fontWeight', 'lineHeight', 'letterSpacing', 'color', 'fontStyle', 'textAlign', 'textDecoration', 'textIndent', 'wordBreak'] |
| | | if (options[0] === 'font2') { |
| | | options[0] = 'font' |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | | fonts: fonts, |
| | | comIds: comIds, |
| | | card: fromJS(style).toJS(), |
| | | options: options, |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description 首行缩进 |
| | | */ |
| | | changeTextIndent = (val) => { |
| | | let value = parseFloat(val) |
| | | |
| | | if (isNaN(value) || value < 0 || value > 100) return |
| | | |
| | | this.updateStyle({textIndent: `${value}px`}) |
| | | } |
| | | |
| | | /** |
| | | * @description 修改字体粗细 |
| | | */ |
| | | boldChange = (val) => { |
| | | this.updateStyle({fontWeight: val}) |
| | | } |
| | | |
| | | /** |
| | | * @description 自动换行 |
| | | */ |
| | | wordBreakChange = (val) => { |
| | | this.updateStyle({wordBreak: val}) |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | render () { |
| | | const { card, options, backgroundImage, borposition } = this.state |
| | | const { card, options, backgroundImage, borposition, fonts } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | </Panel> : null} |
| | | {options.includes('font') ? <Panel header="字体" key="font"> |
| | | <Col span={12}> |
| | | {fonts ? <Panel header="字体" key="font"> |
| | | {fonts.includes('fontSize') ? <Col span={12}> |
| | | <Form.Item colon={false} label={<FontSizeOutlined title="字体大小"/>}> |
| | | <InputNumber defaultValue={card.fontSize || 14} min={12} max={300} precision={0} onChange={this.changeFontSize} /> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | </Col> : null} |
| | | {fonts.includes('fontWeight') ? <Col span={12}> |
| | | <Form.Item colon={false} label={<BoldOutlined title="字体粗细"/>}> |
| | | <Select defaultValue={card.fontWeight || 'normal'} onChange={this.boldChange}> |
| | | <Option value="normal">normal</Option> |
| | |
| | | <Option value="900">900</Option> |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | </Col> : null} |
| | | {fonts.includes('lineHeight') ? <Col span={12}> |
| | | <Form.Item colon={false} label={<LineHeightOutlined title="行高"/>}> |
| | | <InputNumber defaultValue={card.lineHeight || 1.5} min={1} max={10} precision={1} onChange={this.changeLineHeight} /> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | </Col> : null} |
| | | {fonts.includes('letterSpacing') ? <Col span={12}> |
| | | <Form.Item colon={false} label={<ColumnWidthOutlined title="字间距"/>}> |
| | | <InputNumber defaultValue={card.letterSpacing || 0} min={0} max={100} precision={0} onChange={this.changeLetterSpacing}/> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | </Col> : null} |
| | | {fonts.includes('textIndent') ? <Col span={12}> |
| | | <Form.Item colon={false} label={<AlignRightOutlined title="首行缩进"/>}> |
| | | <InputNumber defaultValue={card.textIndent || 0} min={0} max={100} precision={0} onChange={this.changeTextIndent}/> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {fonts.includes('wordBreak') ? <Col span={12}> |
| | | <Form.Item colon={false} label={<EnterOutlined title="自动换行"/>}> |
| | | <Select defaultValue={card.wordBreak || 'normal'} onChange={this.wordBreakChange}> |
| | | <Option value="normal">normal</Option> |
| | | <Option value="break-all">break-all</Option> |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {fonts.includes('color') ? <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<FontColorsOutlined title="字体颜色"/>} |
| | |
| | | > |
| | | <ColorSketch value={card.color || 'rgba(0, 0, 0, 0.85)'} onChange={this.changeFontColor} /> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | </Col> : null} |
| | | {fonts.includes('fontStyle') ? <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={' '} |
| | |
| | | <Radio.Button value="oblique" style={{fontStyle: 'oblique'}}><span title="倾斜">B</span></Radio.Button> |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | </Col> : null} |
| | | {fonts.includes('textAlign') ? <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={' '} |
| | |
| | | <Radio.Button value="right"><AlignRightOutlined title="右对齐"/></Radio.Button> |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | </Col> : null} |
| | | {fonts.includes('textDecoration') ? <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={' '} |
| | |
| | | <Radio.Button value="overline" style={{textDecoration: 'overline'}}><span title="上划线">O</span></Radio.Button> |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> |
| | | </Panel> : null} |
| | | {options.includes('font1') ? <Panel header="字体" key="font1"> |
| | | <Col span={12}> |
| | | <Form.Item colon={false} label={<FontSizeOutlined title="字体大小"/>}> |
| | | <InputNumber defaultValue={card.fontSize || 14} min={12} max={300} precision={0} onChange={this.changeFontSize} /> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item colon={false} label={<BoldOutlined title="字体粗细"/>}> |
| | | <Select defaultValue={card.fontWeight || 'normal'} onChange={this.boldChange}> |
| | | <Option value="normal">normal</Option> |
| | | <Option value="bold">bold</Option> |
| | | <Option value="bolder">bolder</Option> |
| | | <Option value="lighter">lighter</Option> |
| | | <Option value="100">100</Option> |
| | | <Option value="200">200</Option> |
| | | <Option value="300">300</Option> |
| | | <Option value="400">400</Option> |
| | | <Option value="500">500</Option> |
| | | <Option value="600">600</Option> |
| | | <Option value="700">700</Option> |
| | | <Option value="800">800</Option> |
| | | <Option value="900">900</Option> |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<FontColorsOutlined title="字体颜色"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <ColorSketch value={card.color || 'rgba(0, 0, 0, 0.85)'} onChange={this.changeFontColor} /> |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | </Panel> : null} |
| | | {options.includes('background') || options.includes('backgroundColor') ? <Panel header="背景" key="background"> |
| | | <Col span={24}> |
| | |
| | | color: #000; |
| | | font-weight: normal; |
| | | font-size: 14px; |
| | | |
| | | * { |
| | | font-weight: inherit; |
| | | } |
| | | |
| | | .ant-form-item-control-wrapper::after { |
| | | content: ''; |
| | | position: absolute; |
| | |
| | | <div className="normal-topbar-edit-box" style={card.style} onClick={this.clickComponent} id={card.uuid}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <NormalForm title="导航栏设置" width={850} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <NormalForm title="导航栏设置" width={900} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <EditOutlined style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="topbar" card={card}/> |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'menuPosition', |
| | | label: '菜单位置', |
| | | initval: wrap.menuPosition || 'right', |
| | | tooltip: '自定义菜单的位置。注:菜单位于左侧时会显示头像,且返回功能被禁用。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'left', label: '左侧'}, |
| | | {value: 'right', label: '右侧'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'back', values: ['right']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'mode', |
| | | label: '弹框背景', |
| | | initval: wrap.mode || 'dark', |
| | | required: false, |
| | | options: [ |
| | | {value: 'light', label: '白色'}, |
| | | {value: 'dark', label: '黑色'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'checkbox', |
| | | field: 'funs', |
| | | label: '扩展功能', |
| | |
| | | {field: 'reload', values: ['back']}, |
| | | {field: 'linkmenu', values: ['scan']}, |
| | | ], |
| | | span: 24 |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'mode', |
| | | label: '弹框背景', |
| | | initval: wrap.mode || 'dark', |
| | | tooltip: '当存在扩展功能或自定义菜单时,展示对应信息弹窗的背景颜色。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'light', label: '白色'}, |
| | | {value: 'dark', label: '黑色'}, |
| | | ] |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | |
| | | options: menulist |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'menuPosition', |
| | | label: '自定义菜单位置', |
| | | initval: wrap.menuPosition || 'right', |
| | | tooltip: '自定义菜单的位置。注:菜单位于左侧时会显示头像,且返回功能被禁用。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'left', label: '左侧'}, |
| | | {value: 'right', label: '右侧'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'table', |
| | | field: 'menus', |
| | | label: '自定义菜单', |
| | |
| | | } |
| | | |
| | | if (val !== '') { |
| | | let orival = val |
| | | if (card.fixStyle === 'alone') { |
| | | let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight} |
| | | if (card.copyable === 'true') { |
| | | val = <><span style={_s}>{card.prefix || ''}</span><Paragraph copyable={{ text: `${card.prefix || ''}${val}${card.postfix || ''}` }}>{val}</Paragraph><span style={_s}>{card.postfix || ''}</span></> |
| | | } else { |
| | | val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> |
| | | } |
| | | } else if (card.copyable === 'true') { |
| | | val = `${card.prefix || ''}${val}${card.postfix || ''}` |
| | | val = <Paragraph copyable={{ text: val }}>{val}</Paragraph> |
| | | val = <><span style={_s}>{card.prefix || ''}</span>{val}<span style={_s}>{card.postfix || ''}</span></> |
| | | } else { |
| | | val = `${card.prefix || ''}${val}${card.postfix || ''}` |
| | | } |
| | | if (card.copyable === 'true') { |
| | | val = <Paragraph copyable={{ text: orival }}>{val}</Paragraph> |
| | | } |
| | | } |
| | | |
| | | if (card.marks) { |
| | |
| | | border-radius: 50%; |
| | | overflow: visible; |
| | | } |
| | | span { |
| | | text-indent: 0px; |
| | | } |
| | | } |
| | | .ant-mk-text:not(.line1):not(.line) { |
| | | word-break: break-word; |