| | |
| | | } else if (card.show === 'icon') { |
| | | btnElement = (<Button style={_style} type="link"><MkIcon type={card.icon}/>{warning}</Button>) |
| | | } else if (card.show === 'link') { |
| | | btnElement = (<Button style={_style} type="link">{card.label}{card.icon ? <MkIcon type={card.icon}/> : null}{warning}</Button>) |
| | | btnElement = (<Button style={_style} type="link">{card.showName || card.label}{card.icon ? <MkIcon type={card.icon}/> : null}{warning}</Button>) |
| | | } else { |
| | | btnElement = (<Button style={_style}>{card.icon ? <MkIcon type={card.icon}/> : null}{card.label}{warning}</Button>) |
| | | btnElement = (<Button style={_style}>{card.icon ? <MkIcon type={card.icon}/> : null}{card.showName || card.label}{warning}</Button>) |
| | | } |
| | | |
| | | let _style_ = null |
| | | let _style_ = {opacity: isDragging ? 0.3 : 1, ...card.wrapStyle} |
| | | |
| | | if (card.style && card.style.clear === 'left') { |
| | | _style_ = {clear: 'left'} |
| | | _style_.clear = 'left' |
| | | } else if (card.style && card.style.clear === 'right') { |
| | | _style_ = {float: 'right'} |
| | | _style_.float = 'right' |
| | | } |
| | | |
| | | let className = card.width || 0 |
| | |
| | | </div> |
| | | } trigger="hover"> |
| | | <div ref={node => drag(drop(node))} style={_style_} className={'ant-col card-button-cell ant-col-' + className} onDoubleClick={(e) => {e.stopPropagation(); doubleClickCard(id)}}> |
| | | <div style={{opacity: isDragging ? 0.3 : 1, ...card.wrapStyle}}> |
| | | {btnElement} |
| | | </div> |
| | | </div> |
| | | </Popover> |
| | | ) |
| | |
| | | |
| | | const { TextArea } = Input |
| | | const ColorSketch = asyncComponent(() => import('@/mob/colorsketch')) |
| | | const CodeMirror = asyncComponent(() => import('@/templates/zshare/codemirror')) |
| | | const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent')) |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | |
| | |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'textarea') { |
| | | if (item.key === 'formula') { |
| | | fields.push( |
| | | <Col span={24} className="textarea" key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | | <Tooltip placement="topLeft" title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | | { |
| | | required: item.readonly ? false : !!item.required, |
| | | message: '请输入' + item.label + '!' |
| | | } |
| | | ] |
| | | })(<TextArea autoSize={{minRows: 2}} disabled={item.readonly} placeholder={item.placeholder || ''} />)} |
| | | </Form.Item> |
| | | <Popover overlayClassName="formula-fields" placement="topLeft" title="" content={<div>{item.fields}</div>} trigger="click"> |
| | | <span className="formula-icon">字段集</span> |
| | | </Popover> |
| | | </Col> |
| | | ) |
| | | } else { |
| | | fields.push( |
| | | <Col span={24} className="textarea" key={index}> |
| | | <Form.Item label={item.tooltip ? |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | } else if (item.type === 'number') { |
| | | fields.push( |
| | | <Col span={12} key={index}> |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'codemirror') { |
| | | fields.push( |
| | | <Col span={24} key={index} className="textarea"> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" overlayStyle={{width: 500, maxWidth: 500}} title={item.tooltip}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: item.initVal || '', |
| | | rules: [ |
| | | { |
| | | required: !!item.required, |
| | | message: '请输入' + item.label + '!' |
| | | } |
| | | ] |
| | | })( |
| | | <CodeMirror mode="text/javascript"/> |
| | | )} |
| | | </Form.Item> |
| | | <Popover overlayClassName="formula-fields" placement="topLeft" title="" content={<div>{item.fields}</div>} trigger="click"> |
| | | <span className="formula-icon">字段集</span> |
| | | </Popover> |
| | | </Col> |
| | | ) |
| | | } |
| | | }) |
| | | return fields |
| | |
| | | .ant-form-item-control-wrapper { |
| | | width: 85.8%; |
| | | } |
| | | .CodeMirror { |
| | | height: 200px; |
| | | } |
| | | |
| | | .formula-icon { |
| | | position: absolute; |
| | | bottom: 5px; |
| | | top: -18px; |
| | | right: 15px; |
| | | cursor: pointer; |
| | | font-size: 12px; |
| | |
| | | { value: 'YYYY-MM', text: 'YYYY-MM' }, |
| | | { value: 'YYYY-MM-DD HH:mm', text: 'YYYY-MM-DD HH:mm' }, |
| | | { value: 'YYYY-MM-DD HH:mm:ss', text: 'YYYY-MM-DD HH:mm:ss' }, |
| | | { value: 'YYYY年MM月DD日', text: 'YYYY年MM月DD日' }, |
| | | ] |
| | | }, |
| | | { |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | | type: 'codemirror', |
| | | key: 'formula', |
| | | label: '公式', |
| | | initVal: card.formula || '', |
| | | tooltip: '执行时会使用查询到的数据替换相应的字段,展示获得的结果,在不使用解析时换行符或空格会替换为页面元素。可使用JS的一些语法,如:三元表达式 @field1@ > @field2@ ? 0 : 1;Math对象,取绝对值 Math.abs(@field@)、四舍五入 Math.round(@field@)等', |
| | | tooltip: '执行时会使用查询到的数据替换相应的字段,展示获得的结果,在不使用解析时换行符或空格会替换为页面元素。可使用JS的一些语法,如:三元表达式 @field1@ > @field2@ ? 0 : 1;Math对象,取绝对值 Math.abs(@field@)、四舍五入 Math.round(@field@)等。注:会替换公式中的@username@、@fullName@、@bid@。', |
| | | placeholder: '例如:@price@ * @number@', |
| | | required: true |
| | | }, |
| | |
| | | |
| | | .card-button-cell { |
| | | float: left; |
| | | text-align: center; |
| | | button { |
| | | box-shadow: none; |
| | | } |
| | |
| | | background-position: center center; |
| | | height: auto; |
| | | min-height: 28px; |
| | | text-align: center; |
| | | text-align: inherit; |
| | | border-width: 0; |
| | | padding: 0; |
| | | overflow: hidden; |
| | |
| | | updateWrap = (res) => { |
| | | const { card } = this.state |
| | | |
| | | if (res.interaction) { |
| | | if (res.interaction.includes('scale')) { |
| | | res.scale = 'true' |
| | | } |
| | | if (res.interaction.includes('parity')) { |
| | | res.parity = 'true' |
| | | } |
| | | if (res.interaction.includes('hover')) { |
| | | res.hover = 'true' |
| | | } |
| | | delete res.interaction |
| | | } |
| | | |
| | | let _card = {...card, wrap: res} |
| | | |
| | | if (res.supNodes) { |
| | |
| | | <PlusOutlined className="plus" title="添加卡片" onClick={() => this.addCard()}/> |
| | | {appType !== 'mob' ? <PlusCircleOutlined className="plus" title="添加搜索" onClick={() => this.addSearch()}/> : null} |
| | | <PlusSquareOutlined className="plus" title="添加按钮" onClick={() => this.addButton()}/> |
| | | <NormalForm title="数据卡设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <NormalForm title="数据卡设置" width={850} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <EditOutlined style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="datacard" card={card}/> |
| | |
| | | } |
| | | } |
| | | |
| | | let interaction = [] |
| | | let interOptions = [] |
| | | |
| | | if (wrap.scale === 'true') { |
| | | interaction.push('scale') |
| | | } |
| | | if (wrap.parity === 'true') { |
| | | interaction.push('parity') |
| | | } |
| | | if (wrap.hover === 'true') { |
| | | interaction.push('hover') |
| | | } |
| | | |
| | | if (subtype === 'datacard') { |
| | | interOptions = [ |
| | | {value: 'parity', label: '奇偶异色'}, |
| | | ] |
| | | if (appType !== 'mob') { |
| | | interOptions.push( |
| | | {value: 'hover', label: '悬浮变色'}, |
| | | {value: 'scale', label: '悬浮放大'} |
| | | ) |
| | | } |
| | | } else if (subtype === 'propcard' && appType !== 'mob') { |
| | | interOptions = [ |
| | | {value: 'scale', label: '悬浮放大'} |
| | | ] |
| | | } else if (subtype === 'tablecard') { |
| | | interOptions = [ |
| | | {value: 'parity', label: '奇偶异色'}, |
| | | ] |
| | | if (appType !== 'mob') { |
| | | interOptions.push( |
| | | {value: 'hover', label: '悬浮变色'} |
| | | ) |
| | | } |
| | | } |
| | | |
| | | if (interaction.length && interOptions.length) { |
| | | interaction = interaction.filter(m => interOptions.findIndex(cell => cell.value === m) > -1) |
| | | } |
| | | |
| | | // let interItem = null |
| | | |
| | | // if (interOptions.length === 1) { |
| | | // interItem = { |
| | | // type: 'radio', |
| | | // field: interOptions[0].value, |
| | | // label: interOptions[0].label, |
| | | // initval: interaction.length === 1 ? 'true' : 'false', |
| | | // required: false, |
| | | // options: [ |
| | | // {value: 'true', label: '启用'}, |
| | | // {value: 'false', label: '禁用'} |
| | | // ] |
| | | // } |
| | | // } else { |
| | | // interItem = { |
| | | // type: 'checkbox', |
| | | // field: 'interaction', |
| | | // label: '交互效果', |
| | | // initval: interaction, |
| | | // required: false, |
| | | // options: interOptions, |
| | | // forbid: interOptions.length === 0 |
| | | // } |
| | | // } |
| | | |
| | | const cardWrapForm = [ |
| | | { |
| | | type: 'text', |
| | |
| | | ], |
| | | forbid: subtype !== 'datacard' || appType === 'mob' |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | | // field: 'scale', |
| | | // label: '放大效果', |
| | | // initval: wrap.scale || 'false', |
| | | // tooltip: '鼠标悬浮于卡片上方时,卡片放大1.05倍。', |
| | | // required: false, |
| | | // options: [ |
| | | // {value: 'false', label: '无'}, |
| | | // {value: 'true', label: '有'}, |
| | | // ], |
| | | // forbid: subtype === 'tablecard' || appType === 'mob' |
| | | // }, |
| | | { |
| | | type: 'radio', |
| | | field: 'scale', |
| | | label: '放大效果', |
| | | initval: wrap.scale || 'false', |
| | | tooltip: '鼠标悬浮于卡片上方时,卡片放大1.05倍。', |
| | | type: 'checkbox', |
| | | field: 'interaction', |
| | | label: '交互效果', |
| | | initval: interaction, |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'true', label: '有'}, |
| | | ], |
| | | forbid: subtype === 'tablecard' || appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'parity', |
| | | label: '奇偶背景', |
| | | initval: wrap.parity || 'false', |
| | | tooltip: '偶数行会添加背景色。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'true', label: '有'}, |
| | | ], |
| | | forbid: subtype === 'propcard' |
| | | options: interOptions, |
| | | forbid: interOptions.length === 0 |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | tooltip: '数据卡右上角会显示收起开关。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'true', label: '有'}, |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'parity', |
| | | label: '奇偶背景', |
| | | label: '奇偶异色', |
| | | initval: wrap.parity || 'false', |
| | | tooltip: '偶数行会添加背景色。', |
| | | tooltip: '子表偶数行会添加背景色。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'true', label: '有'}, |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | }, |
| | | { |
| | |
| | | updateWrap = (res) => { |
| | | const { card } = this.state |
| | | |
| | | if (res.interaction) { |
| | | if (res.interaction.includes('scale')) { |
| | | res.scale = 'true' |
| | | } |
| | | delete res.interaction |
| | | } |
| | | |
| | | let _card = {...card, wrap: res} |
| | | |
| | | if (res.datatype === 'static') { |
| | |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | | if (res.interaction) { |
| | | if (res.interaction.includes('parity')) { |
| | | res.parity = 'true' |
| | | } |
| | | if (res.interaction.includes('hover')) { |
| | | res.hover = 'true' |
| | | } |
| | | delete res.interaction |
| | | } |
| | | this.updateComponent({...this.state.card, wrap: res}) |
| | | } |
| | | |
| | |
| | | { required: item.readonly ? false : item.required, message: '请输入' + item.label + '!' } |
| | | ] |
| | | |
| | | content = <CodeMirror mode="text/javascript" theme="cobalt"/> |
| | | content = <CodeMirror mode="text/javascript"/> |
| | | } |
| | | |
| | | if (help && typeof(help) === 'function') { |
| | |
| | | tooltip: '执行成功后的返回值。系统函数可指定返回的变量(以@符开头,返回id时可使用@id@);自定义函数可指定返回字段(如id)。', |
| | | initVal: card.output || '', |
| | | required: false, |
| | | forbid: viewType === 'popview' |
| | | // forbid: viewType === 'popview' |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | tooltip: '执行成功后的返回值。系统函数可指定返回的变量(以@符开头,返回id时可使用@id@);自定义函数可指定返回字段(如id)。', |
| | | initVal: card.output || '', |
| | | required: false, |
| | | forbid: viewType === 'popview' |
| | | // forbid: viewType === 'popview' |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'parity', |
| | | label: '奇偶异色', |
| | | initval: wrap.parity || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'bordered', |
| | | label: '边框', |
| | | initval: wrap.bordered || 'true', |
| | |
| | | initval: wrap.actionfixed !== 'true' ? 'false' : 'true', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ] |
| | | }, |
| | | { |
| | |
| | | {value: 'small', label: '小'}, |
| | | {value: 'mini', label: '迷你'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'selected', |
| | | label: '数据选中', |
| | | initval: wrap.selected || 'false', |
| | | tooltip: '初始化:数据加载时选中首行数据,仅执行一次。数据加载:每次数据加载时均选中首行(当按钮执行完成并返回主键值时,默认选中主键值对应行)。选中标记:返回数据中存在 selected 字段,且值为 true 的数据被选中。注:启用无人值守时无效。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'init', label: '初始化'}, |
| | | {value: 'always', label: '数据加载'}, |
| | | {value: 'sign', label: '选中标记'} |
| | | ], |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | |
| | | ] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'btnlimit', |
| | | label: '按钮限制', |
| | | initval: wrap.btnlimit || '', |
| | | tooltip: '按钮数量限制,超出的按钮会在更多中下拉显示,注:更多中的按钮不要绑定双击事件。', |
| | | min: 3, |
| | | max: 3000, |
| | | precision: 0, |
| | | required: false |
| | | type: 'select', |
| | | field: 'selected', |
| | | label: '数据选中', |
| | | initval: wrap.selected || 'false', |
| | | tooltip: '初始化:数据加载时选中首行数据,仅执行一次。数据加载:每次数据加载时均选中首行(当按钮执行完成并返回主键值时,默认选中主键值对应行)。选中标记:返回数据中存在 selected 字段,且值为 true 的数据被选中。注:启用无人值守时无效。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'init', label: '初始化'}, |
| | | {value: 'always', label: '数据加载'}, |
| | | {value: 'sign', label: '选中标记'} |
| | | ], |
| | | }, |
| | | { |
| | | type: 'number', |
| | |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'btnlimit', |
| | | label: '按钮限制', |
| | | initval: wrap.btnlimit || '', |
| | | tooltip: '按钮数量限制,超出的按钮会在更多中下拉显示,注:更多中的按钮不要绑定双击事件。', |
| | | min: 3, |
| | | max: 3000, |
| | | precision: 0, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'maxPageSize', |
| | | label: '每页最大数', |
| | | initval: wrap.maxPageSize || '', |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'parity', |
| | | label: '奇偶异色', |
| | | initval: wrap.parity || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'bordered', |
| | | label: '边框', |
| | | initval: wrap.bordered || 'true', |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'parity', |
| | | label: '奇偶异色', |
| | | initval: wrap.parity || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'bordered', |
| | | label: '边框', |
| | | initval: wrap.bordered || 'true', |
| | |
| | | ] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'selected', |
| | | label: '数据选中', |
| | | initval: wrap.selected || 'false', |
| | | tooltip: '初始化:数据加载时选中首行数据,仅执行一次。数据加载:每次数据加载时均选中首行(当按钮执行完成并返回主键值时,默认选中主键值对应行)。选中标记:返回数据中存在 selected 字段,且值为 true 的数据被选中。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'init', label: '初始化'}, |
| | | {value: 'always', label: '数据加载'}, |
| | | {value: 'sign', label: '选中标记'} |
| | | ], |
| | | }, |
| | | { |
| | | type: 'color', |
| | | field: 'borderColor', |
| | | label: '边框颜色', |
| | |
| | | ] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'btnlimit', |
| | | label: '按钮限制', |
| | | initval: wrap.btnlimit || '', |
| | | tooltip: '按钮数量限制,超出的按钮会在更多中下拉显示,注:更多中的按钮不要绑定双击事件。', |
| | | min: 3, |
| | | max: 3000, |
| | | precision: 0, |
| | | type: 'select', |
| | | field: 'selected', |
| | | label: '数据选中', |
| | | initval: wrap.selected || 'false', |
| | | tooltip: '初始化:数据加载时选中首行数据,仅执行一次。数据加载:每次数据加载时均选中首行(当按钮执行完成并返回主键值时,默认选中主键值对应行)。选中标记:返回数据中存在 selected 字段,且值为 true 的数据被选中。', |
| | | required: false, |
| | | forbid: appType !== '' || isprint |
| | | options: [ |
| | | {value: 'false', label: '无'}, |
| | | {value: 'init', label: '初始化'}, |
| | | {value: 'always', label: '数据加载'}, |
| | | {value: 'sign', label: '选中标记'} |
| | | ], |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'btnlimit', |
| | | label: '按钮限制', |
| | | initval: wrap.btnlimit || '', |
| | | tooltip: '按钮数量限制,超出的按钮会在更多中下拉显示,注:更多中的按钮不要绑定双击事件。', |
| | | min: 3, |
| | | max: 3000, |
| | | precision: 0, |
| | | required: false, |
| | | forbid: appType !== '' || isprint |
| | | }, |
| | | { |
| | | type: 'number', |
| | | field: 'maxPageSize', |
| | | label: '每页最大数', |
| | | initval: wrap.maxPageSize || '', |
| | |
| | | label={<SwapOutlined title="对齐"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} defaultValue={card.float || 'left'} onChange={(e) => this.changeNormalStyle(e.target.value, 'float')}> |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} defaultValue={card.float || (type === 'mk-button' ? 'center' : 'left')} onChange={(e) => this.changeNormalStyle(e.target.value, 'float')}> |
| | | <Radio value="left">左</Radio> |
| | | <Radio value="center">居中</Radio> |
| | | <Radio value="right">右</Radio> |
| | |
| | | _data = [data] |
| | | } |
| | | |
| | | let _val = card.formula |
| | | if (/@username@|@fullName@|@bid@/ig.test(_val)) { |
| | | _val = _val.replace(/@username@/ig, sessionStorage.getItem('User_Name') || '').replace(/@fullName@/ig, sessionStorage.getItem('Full_Name') || '').replace(/@bid@/ig, data.$$BID || '') |
| | | } |
| | | |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('data', card.formula) |
| | | let func = new Function('data', _val) |
| | | val = func(_data) |
| | | } catch (e) { |
| | | console.warn(e) |
| | |
| | | val = '' |
| | | } else if (data) { |
| | | let _val = card.formula |
| | | if (/@username@|@fullName@|@bid@/ig.test(_val)) { |
| | | _val = _val.replace(/@username@/ig, sessionStorage.getItem('User_Name') || '').replace(/@fullName@/ig, sessionStorage.getItem('Full_Name') || '').replace(/@bid@/ig, data.$$BID || '') |
| | | } |
| | | Object.keys(data).forEach(key => { |
| | | let reg = new RegExp('@' + key + '@', 'ig') |
| | | _val = _val.replace(reg, data[key]) |
| | |
| | | background-size: cover; |
| | | } |
| | | .mk-cell-btn { |
| | | text-align: center; |
| | | min-height: 0px; |
| | | > div {width: 100%;max-width: 100%;} |
| | | button:not(.ant-switch) { |
| | |
| | | min-height: 28px; |
| | | padding: 0; |
| | | overflow: hidden; |
| | | text-align: inherit; |
| | | } |
| | | .ant-checkbox-wrapper:not(.square) { |
| | | .ant-checkbox-inner, .ant-checkbox-checked::after { |
| | |
| | | _config.wrap.scale = _config.wrap.scale === 'true' ? 'scale' : '' |
| | | _config.wrap.layout = (_config.wrap.layout || 'grid') + '-layout float-' + (_config.wrap.cardFloat || 'left') |
| | | |
| | | _config.wrap.wrapClass = `${_config.wrap.selStyle} ${_config.wrap.cardType || ''} ${_config.wrap.scale}` |
| | | _config.wrap.wrapClass = `${_config.wrap.selStyle} ${_config.wrap.cardType || ''} ${_config.wrap.scale} ${config.wrap.hover === 'true' ? 'mk-hover' : ''}` |
| | | |
| | | if (_config.wrap.shifting === 'true') { |
| | | _config.wrap.shifting = 'shifting' |
| | |
| | | if (config.wrap.parity === 'true') { |
| | | if (index % 2 === 1) { |
| | | className += 'mk-even-line ' |
| | | } else { |
| | | className += 'mk-odd-line ' |
| | | } |
| | | } |
| | | if (item.$disabled) { |
| | |
| | | } |
| | | .mk-even-line { |
| | | .card-item-box { |
| | | background-color: #fafafa; |
| | | } |
| | | } |
| | | } |
| | | .data-zoom.mk-hover { |
| | | .mk-card { |
| | | .card-item-box:hover { |
| | | background-color: var(--mk-sys-color1); |
| | | } |
| | | } |
| | | .mk-even-line:hover, .mk-odd-line:hover { |
| | | .card-item-box { |
| | | background-color: var(--mk-sys-color2); |
| | | } |
| | | } |
| | | } |
| | |
| | | >.card-row-list { |
| | | >.ant-col:not(.extend-card) { |
| | | .card-item-box:hover { |
| | | background-color: var(--mk-sys-color2); |
| | | background-color: var(--mk-sys-color1); |
| | | } |
| | | } |
| | | } |
| | | .sub-card-wrap.mk-parity-bg { |
| | | .ant-col:nth-child(even){ |
| | | .card-item-box:not(:hover) { |
| | | background-color: var(--mk-sys-color1); |
| | | background-color: #fafafa; |
| | | } |
| | | } |
| | | } |
| | |
| | | .sub-card-wrap.mk-parity-bg { |
| | | .ant-col:nth-child(even){ |
| | | .card-item-box { |
| | | background-color: var(--mk-sys-color1); |
| | | background-color: #fafafa; |
| | | } |
| | | } |
| | | } |
| | |
| | | if (config.wrap.parity === 'true') { |
| | | if (lindex % 2 === 1) { |
| | | className += ' mk-even-line' |
| | | } else { |
| | | className += ' mk-odd-line' |
| | | } |
| | | } |
| | | |
| | |
| | | selectedData={[]} |
| | | /> : null |
| | | } |
| | | <Row className="card-row-list" style={{height: config.wrap.contentHeight}}> |
| | | <Row className={`card-row-list ${config.wrap.hover === 'true' ? 'mk-hover' : ''}`} style={{height: config.wrap.contentHeight}}> |
| | | {precards.map((item, index) => ( |
| | | <Col key={index} className="extend-card" span={24}> |
| | | <div className="card-item-box" style={item.style}> |
| | |
| | | } |
| | | .mk-even-line { |
| | | .card-item-box { |
| | | background-color: #fafafa; |
| | | } |
| | | } |
| | | } |
| | | .card-row-list.mk-hover { |
| | | >.ant-col:not(.extend-card) { |
| | | .card-item-box:hover { |
| | | background-color: var(--mk-sys-color1); |
| | | } |
| | | } |
| | | .mk-even-line:hover, .mk-odd-line:hover { |
| | | .card-item-box { |
| | | background-color: var(--mk-sys-color2); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | return ( |
| | | <div className={`normal-custom-table ${setting.tableHeader || ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || 'middle'} table-col-${columns.length} ${fixed}`} style={style}> |
| | | <div className={`normal-custom-table ${setting.tableHeader || ''} ${setting.parity === 'true' ? 'mk-parity' : ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || 'middle'} table-col-${columns.length} ${fixed}`} style={style}> |
| | | {(setting.tableType === 'radio' || setting.tableType === 'checkbox') && data && data.length > 0 ? |
| | | <Switch title="收起" className="main-pickup" checkedChildren="开" unCheckedChildren="关" checked={pickup} onChange={this.pickupChange} /> : null |
| | | } |
| | |
| | | color: var(--mk-table-color); |
| | | } |
| | | } |
| | | .normal-custom-table.mk-parity { |
| | | .ant-table-tbody tr:nth-child(even) { |
| | | background: #fafafa; |
| | | } |
| | | } |
| | | .normal-custom-table:not(.ghost) { |
| | | .ant-table-small > .ant-table-content .ant-table-thead > tr > th { |
| | | background-color: #fafafa!important; |
| | |
| | | .ant-input-search-button { |
| | | height: 28px; |
| | | } |
| | | .ant-form-explain { |
| | | display: none; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | {setting.hasSubmit && edData.length > 0 ? <div className="edit-custom-table-btn-wrap" style={submit.wrapStyle}> |
| | | <Button style={submit.style} onClick={() => setTimeout(() => {this.submit()}, 10)} loading={loading} className="submit-table" type="link">提交</Button> |
| | | </div> : null} |
| | | <div className={`edit-custom-table ${setting.tableHeader || ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || ''} mk-edit-${setting.editType || 'simple'}`} style={style}> |
| | | <div className={`edit-custom-table ${setting.tableHeader || ''} ${setting.parity === 'true' ? 'mk-parity' : ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || ''} mk-edit-${setting.editType || 'simple'}`} style={style}> |
| | | <Table |
| | | rowKey="$$uuid" |
| | | components={components} |
| | |
| | | // } |
| | | // } |
| | | } |
| | | .edit-custom-table.mk-parity { |
| | | .ant-table-tbody tr:nth-child(even) { |
| | | background: #fafafa; |
| | | } |
| | | } |
| | | .edit-custom-table.mk-edit-simple { |
| | | table tbody tr td { |
| | | min-height: 32px; |
| | |
| | | console.warn(e) |
| | | } |
| | | |
| | | if (!_param) { |
| | | if (!_param || _param.error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到打印参数,自定义脚本错误!', |
| | | message: _param ? _param.error : '未获取到打印参数,自定义脚本错误!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | console.warn(e) |
| | | } |
| | | |
| | | if (!_param) { |
| | | if (!_param || _param.error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到打印参数,自定义脚本错误!', |
| | | message: _param ? _param.error : '未获取到打印参数,自定义脚本错误!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | |
| | | if (!id) return |
| | | |
| | | if (btn.verify.preHandle === 'true' && btn.verify.pre_func && /#position-print/.test(btn.verify.pre_func)) { |
| | | MKEmitter.emit('queryModuleParam', btn.$menuId, (res) => { |
| | | let searches = {} |
| | | res.search && res.search.forEach(item => { |
| | | searches[item.key] = item.value |
| | | }) |
| | | let _param = { id: id || '', tempId: btn.verify.printTempId, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM')} |
| | | |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('btn', 'searches', 'param', 'systemType', btn.verify.pre_func) |
| | | _param = func(btn, searches, _param, window.GLOB.systemType) |
| | | } catch (e) { |
| | | console.warn(e) |
| | | } |
| | | |
| | | if (!_param || _param.error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: _param ? _param.error : '未获取到打印参数,自定义脚本错误!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify(_param)))) |
| | | }) |
| | | } else { |
| | | setTimeout(() => { |
| | | window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: id, tempId: btn.verify.printTempId, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') })))) |
| | | }, 500) |
| | | }, 200) |
| | | } |
| | | } |
| | | |
| | | sendWxMessage = (verify, id) => { |
| | |
| | | type={type} |
| | | id={'button' + btn.uuid} |
| | | title={disabled ? (btn.reason || '') : (btn.show === 'icon' ? btn.label : '')} |
| | | loading={loading} |
| | | loading={loading && !name} |
| | | disabled={disabled} |
| | | style={btn.style} |
| | | icon={icon} |
| | |
| | | } |
| | | |
| | | let isDataM = sessionStorage.getItem('dataM') === 'true' |
| | | let custompage = /@pageSize@|@orderBy@/i.test(_dataresource + _customScript + _tailScript) |
| | | let regoptions = [ |
| | | { reg: /@orderBy@/ig, value: btn.verify.setting.order }, |
| | | { reg: /@pageSize@/ig, value: '9999' }, |
| | | { reg: /@pageIndex@/ig, value: '1'}, |
| | | { reg: /@ID@/ig, value: `'${ID}'`}, |
| | | { reg: /@BID@/ig, value: `'${BID || ''}'`}, |
| | | { reg: /@LoginUID@/ig, value: `'${sessionStorage.getItem('LoginUID') || ''}'`}, |
| | |
| | | let LText = '' |
| | | |
| | | if (_dataresource) { |
| | | if (custompage) { |
| | | LText = `/*system_query*/select ${arrFields} from ${_dataresource} ` |
| | | } else { |
| | | LText = `/*system_query*/select ${arrFields} from (select ${arrFields} ,ROW_NUMBER() over(order by ${btn.verify.setting.order}) as rows from ${_dataresource}) tmptable order by tmptable.rows ` |
| | | } |
| | | } |
| | | |
| | | if (_customScript) { |
| | | if (LText) { |
| | |
| | | import Utils from '@/utils/utils.js' |
| | | import { checkSQL, getSearchFields } from '@/utils/utils-custom.js' |
| | | import CodeMirror from '@/templates/zshare/codemirror' |
| | | import MKEmitter from '@/utils/events.js' |
| | | // import './index.scss' |
| | | |
| | | class CustomForm extends Component { |
| | |
| | | loading: false, |
| | | editItem: null |
| | | }) |
| | | if (values.uuid) { |
| | | MKEmitter.emit('editLineId', values.uuid) |
| | | } |
| | | this.props.form.setFieldsValue({ |
| | | sql: ' ' |
| | | }) |
| | |
| | | <Form.Item label="可用字段"> |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>, |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并赋值。'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip> |
| | | {usefulfields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'搜索条件,请按照@xxx@格式使用。'}>, {usefulfields}</Tooltip> : null} |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'排序、分页以及搜索条件变量,请按照@xxx@格式使用。'}>, orderBy, pageSize, pageIndex{usefulfields ? ', ' + usefulfields : ''}</Tooltip> |
| | | {linefields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'表单及行变量,系统会定义变量并赋值。'}>, {linefields}</Tooltip> : null} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | _dataresource = '(' + _dataresource + ') tb' |
| | | } |
| | | |
| | | let custompage = /@pageSize@|@orderBy@/i.test(_dataresource + _customScript) |
| | | |
| | | // 正则替换 |
| | | let regoptions = [{ |
| | | reg: new RegExp('@orderBy@', 'ig'), |
| | | value: setting.order || '' |
| | | }, { |
| | | reg: new RegExp('@pageSize@', 'ig'), |
| | | value: 10 |
| | | }, { |
| | | reg: new RegExp('@pageIndex@', 'ig'), |
| | | value: 1 |
| | | }, { |
| | | reg: /@datam@/ig, |
| | | value: `''` |
| | | }, { |
| | |
| | | |
| | | // 数据源处理, 存在显示列时 |
| | | if (_dataresource) { |
| | | if (setting.order) { |
| | | _dataresource = `/*system_query*/select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${setting.order}) as rows from ${_dataresource}) tmptable order by tmptable.rows` |
| | | } else { |
| | | if (custompage || !setting.order) { |
| | | _dataresource = `/*system_query*/select ${arr_field} from ${_dataresource}` |
| | | } else { |
| | | _dataresource = `/*system_query*/select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${setting.order}) as rows from ${_dataresource}) tmptable order by tmptable.rows` |
| | | } |
| | | } |
| | | |
| | |
| | | return cols.filter(item => { |
| | | if (item.Hide === 'true') return false |
| | | |
| | | item.IsSort = 'false' |
| | | |
| | | if (item.type === 'number') { |
| | | if (typeof(item.decimal) === 'number') { |
| | | item.round = Math.pow(10, item.decimal) |
| | |
| | | if (cell.marks && cell.marks.length === 0) { |
| | | cell.marks = null |
| | | } |
| | | if (cell.anchors && cell.anchors.length === 0) { |
| | | cell.anchors = null |
| | | } |
| | | |
| | | if (['text', 'number', 'formula'].includes(cell.eleType)) { |
| | | cell.innerHeight = cell.innerHeight || 'auto' |
| | |
| | | if (menu) { |
| | | menu = fromJS(menu).toJS() |
| | | menu.param = {} |
| | | menu.param.$searchkey = 'PrintTempNO' |
| | | menu.param.$searchkey = 'printtempno' |
| | | menu.param.$searchval = temp |
| | | setTimeout(() => { |
| | | MKEmitter.emit('modifyTabs', menu) |
| | |
| | | if (menu) { |
| | | menu = fromJS(menu).toJS() |
| | | menu.param = {} |
| | | menu.param.$searchkey = 'PrintTempNO' |
| | | menu.param.$searchkey = 'printtempno' |
| | | menu.param.$searchval = tabTemp |
| | | setTimeout(() => { |
| | | MKEmitter.emit('modifyTabs', menu) |