| | |
| | | key: 'link', |
| | | label: '链接', |
| | | initVal: card.link || '', |
| | | tooltip: '动态地址为绑定字段值。', |
| | | tooltip: '动态地址为绑定字段值。使用 动态-关联菜单 时,请在“链接地址”字段返回菜单ID。', |
| | | required: false, |
| | | options: [ |
| | | { value: '', text: '无' }, |
| | |
| | | this.setState({ |
| | | actvisible: true, |
| | | card: card, |
| | | formlist: getBaseTableActionForm(card, functip, cards, usefulFields, modules) |
| | | formlist: getBaseTableActionForm(card, functip, cards, usefulFields, modules, 'line') |
| | | }) |
| | | } else { |
| | | let anchors = MenuUtils.getAnchors(menu.components, cards.uuid) || [] |
| | |
| | | this.setState({ |
| | | actvisible: true, |
| | | card: card, |
| | | formlist: getActionForm(card, functip, cards, usefulFields, modules, anchors, side) |
| | | formlist: getActionForm(card, functip, cards, usefulFields, modules, anchors, side, 'line') |
| | | }) |
| | | } |
| | | } |
| | |
| | | let color = { primary: '#1890ff', yellow: '#c49f47', orange: 'orange', danger: '#ff4d4f', green: '#26C281', dgreen: '#32c5d2', purple: '#8E44AD', cyan: '#13c2c2', gray: '#666666', default: 'rgba(0, 0, 0, 0.65)' } |
| | | |
| | | this.actionFormRef.handleConfirm().then(res => { |
| | | if (res.width % 0.5) { |
| | | res.width = parseInt(res.width / 0.5) * 0.5 |
| | | } |
| | | if (res.width % 1) { |
| | | res.width = (res.width + '').replace(/.5/, 'x') |
| | | } |
| | | |
| | | let _elements = elements.map(cell => { |
| | | if (cell.uuid === res.uuid) { |
| | | res.eleType = cell.eleType || null |
| | |
| | | if (cell.OpenType !== 'form') { |
| | | res.style = {} |
| | | } |
| | | } else if (res.class !== cell.class || res.show !== cell.show || !res.style) { |
| | | // } else if (res.class !== cell.class || res.show !== cell.show || !res.style) { |
| | | } else if (res.class !== cell.class || !res.style) { |
| | | if (res.class) { |
| | | let cl = res.class.replace('border-', '') |
| | | let style = {} |
| | |
| | | field: 'condition', |
| | | label: '显示条件', |
| | | initval: setting.condition || 'false', |
| | | tooltip: '当选择“有”时,只有符合条件的数据才会展示。', |
| | | tooltip: '当选择“自定义”时,只有符合条件的数据才会展示。当选择“标题”时,只有首行才会展示', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '有'}, |
| | | {value: 'false', label: '无'}, |
| | | {value: 'false', label: '始终显示'}, |
| | | {value: 'true', label: '自定义'}, |
| | | {value: 'title', label: '标题'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'controlField', values: ['true']}, |
| | | {field: 'controlType', values: ['true']}, |
| | | {field: 'controlValue', values: ['true']}, |
| | | {field: 'click', values: ['true', 'false']}, |
| | | ] |
| | | }, |
| | | { |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'searchBtn', |
| | | label: '搜索按钮', |
| | | initval: wrap.searchBtn || 'hidden', |
| | | // tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'hidden', label: '隐藏'}, |
| | | {value: 'show', label: '显示'}, |
| | | ], |
| | | forbid: appType === 'mob' || isprint, |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'shifting', |
| | | label: '按钮偏移', |
| | | initval: wrap.shifting || 'false', |
| | |
| | | } |
| | | .ant-pagination { |
| | | text-align: right; |
| | | margin-top: 10px; |
| | | } |
| | | .mk-more { |
| | | text-align: center; |
| | |
| | | |
| | | const { TextArea } = Input |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | const CodeMirror = asyncComponent(() => import('@/templates/zshare/codemirror')) |
| | | const MKTable = asyncComponent(() => import('@/components/normalform/modalform/mkTable')) |
| | | const acTyOptions = { |
| | | pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'position', 'tipTitle', 'hoverTitle', 'hidden', 'preButton', 'formCache'], |
| | |
| | | let reRequired = {} |
| | | let reReadonly = {} |
| | | |
| | | if (openType === 'pop' || openType === 'prompt' || openType === 'exec') { |
| | | if (['pop', 'prompt', 'exec'].includes(openType)) { |
| | | let intertype = this.record.intertype |
| | | |
| | | reOptions.intertype = this.state.interTypeOptions |
| | |
| | | reRequired.linkmenu = true |
| | | reTooltip.linkmenu = '' |
| | | } else if (this.record.pageTemplate === 'billprint') { |
| | | shows.push('printTemp') |
| | | shows.push('printTemp', 'preHandle') |
| | | if (this.record.preHandle === 'true') { |
| | | shows.push('pre_func') |
| | | } |
| | | reOptions.Ot = requireOptions |
| | | } else if (this.record.pageTemplate === 'pay') { |
| | | reOptions.Ot = requireOptions.filter(op => op.value === 'requiredSgl') |
| | |
| | | reRequired.icon = true |
| | | } else { |
| | | reRequired.icon = false |
| | | if (['pop', 'prompt', 'exec', 'popview', 'tab', 'innerpage'].includes(openType)) { |
| | | shows.push('showName') |
| | | } |
| | | } |
| | | |
| | | return { |
| | |
| | | let className = '' |
| | | let content = null |
| | | let initVal = item.initVal || '' |
| | | let help = item.help || '' |
| | | let help = item.help || null |
| | | |
| | | if (item.type === 'splitLine') { |
| | | fields.push( |
| | |
| | | ] |
| | | |
| | | content = <KeyInterface type={item.key === 'exInterface' ? 'develop' : 'product'}/> |
| | | } else if (item.type === 'codemirror') { |
| | | span = 24 |
| | | className = 'codemirror' |
| | | rules = [ |
| | | { required: item.readonly ? false : item.required, message: '请输入' + item.label + '!' } |
| | | ] |
| | | |
| | | content = <CodeMirror mode="text/javascript" theme="cobalt"/> |
| | | } |
| | | |
| | | if (help && typeof(help) === 'function') { |
| | | help = help(this.record) |
| | | } |
| | | |
| | | if (help) { |
| | | fields.push( |
| | | <Col span={span} key={index}> |
| | | <Form.Item className={className} help={help} label={item.tooltip ? |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else { |
| | | fields.push( |
| | | <Col span={span} key={index}> |
| | | <Form.Item className={className} label={item.tooltip ? |
| | | <Tooltip placement="topLeft" overlayStyle={{maxWidth: item.tooltip.length > 25 ? 350 : 250 }} title={<span onClick={(e) => e.stopPropagation()}>{item.tooltip}</span>}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | {item.label} |
| | | </Tooltip> : item.label |
| | | }> |
| | | {getFieldDecorator(item.key, { |
| | | initialValue: initVal, |
| | | rules: rules |
| | | })(content)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | }) |
| | | |
| | | return fields |
| | |
| | | width: 86%; |
| | | } |
| | | } |
| | | .codemirror { |
| | | .ant-col-sm-7 { |
| | | width: 14%; |
| | | } |
| | | .ant-col-sm-17 { |
| | | width: 86%; |
| | | } |
| | | .ant-form-item-label { |
| | | opacity: 0; |
| | | } |
| | | } |
| | | .ant-radio-group { |
| | | white-space: nowrap; |
| | | .ant-radio-wrapper { |
| | |
| | | * @param {*} setting 组件配置 |
| | | * @param {*} usefulFields 存储过程可用的开始字段 |
| | | */ |
| | | export function getActionForm (card, functip, config, usefulFields, modules = [], anchors = [], side) { |
| | | export function getActionForm (card, functip, config, usefulFields, modules = [], anchors = [], side, position) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let viewType = sessionStorage.getItem('editMenuType') // 弹窗 popview |
| | | let setting = config.setting || {} |
| | |
| | | }] |
| | | } else if (card.formType === 'scan') { |
| | | card.formType = 'switch' |
| | | } |
| | | |
| | | let width = card.width || (card.width === 0 ? 0 : 12) |
| | | if (/x/.test(card.width)) { |
| | | width = +width.replace(/x/, '.5') |
| | | } |
| | | |
| | | let forms = [ |
| | |
| | | key: 'width', |
| | | min: 0, |
| | | max: 24, |
| | | precision: 0, |
| | | precision: 1, |
| | | label: '宽度', |
| | | initVal: card.width || (card.width === 0 ? 0 : 12), |
| | | tooltip: '栅格布局,每行等分为24列。为 0 时宽度自适应。', |
| | | initVal: width, |
| | | tooltip: '栅格布局,每行等分为24列。为 0 时宽度自适应。可设置半列即.5。', |
| | | forbid: type !== 'card', |
| | | required: true |
| | | }, |
| | |
| | | tooltip: '鼠标悬浮在按钮上方时的提示信息。', |
| | | forbid: appType === 'mob', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'showName', |
| | | label: '显示内容', |
| | | initVal: card.showName || '', |
| | | tooltip: '行级按钮可通过行信息控制按钮显示内容。', |
| | | required: false, |
| | | allowClear: true, |
| | | forbid: position !== 'line', |
| | | options: columns.map(item => ({ |
| | | value: item.field, |
| | | text: `${item.label}(${item.field})` |
| | | })) |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | options: modules |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'preHandle', |
| | | label: '自定义脚本', |
| | | initVal: card.preHandle || 'false', |
| | | // tooltip: '隐藏后按钮在页面中不显示,且不参与权限分配。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'false', |
| | | text: '禁用' |
| | | }, { |
| | | value: 'true', |
| | | text: '启用' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'codemirror', |
| | | key: 'pre_func', |
| | | label: '自定义脚本', |
| | | initVal: card.pre_func || '', |
| | | required: true, |
| | | } |
| | | ] |
| | | |
| | |
| | | * @param {*} setting 组件配置 |
| | | * @param {*} usefulFields 存储过程可用的开始字段 |
| | | */ |
| | | export function getBaseTableActionForm (card, functip, config, usefulFields, modules) { |
| | | export function getBaseTableActionForm (card, functip, config, usefulFields, modules, position) { |
| | | let viewType = sessionStorage.getItem('editMenuType') // 弹窗 popview |
| | | let setting = config.setting || {} |
| | | let columns = config.columns || [] |
| | |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'showName', |
| | | label: '显示内容', |
| | | initVal: card.showName || '', |
| | | tooltip: '行级按钮可通过行信息控制按钮显示内容。', |
| | | required: false, |
| | | allowClear: true, |
| | | forbid: position !== 'line', |
| | | options: columns.map(item => ({ |
| | | value: item.field, |
| | | text: `${item.label}(${item.field})` |
| | | })) |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'openTab', |
| | | label: '打开方式', |
| | |
| | | options: modules |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'preHandle', |
| | | label: '自定义脚本', |
| | | initVal: card.preHandle || 'false', |
| | | // tooltip: '隐藏后按钮在页面中不显示,且不参与权限分配。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'false', |
| | | text: '禁用' |
| | | }, { |
| | | value: 'true', |
| | | text: '启用' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'codemirror', |
| | | key: 'pre_func', |
| | | label: '自定义脚本', |
| | | initVal: card.pre_func || '', |
| | | required: true, |
| | | } |
| | | ] |
| | | |
| | |
| | | * @description 搜索条件编辑,获取搜索条件表单信息 |
| | | */ |
| | | handleSearch = (card) => { |
| | | const { config } = this.props |
| | | const { searchlist } = this.state |
| | | let linkableFields = [] |
| | | |
| | |
| | | }) |
| | | }) |
| | | |
| | | let columns = null |
| | | if (config.columns && config.columns.length) { |
| | | columns = config.columns.map(item => { |
| | | return {key: item.uuid, text: item.field, value: item.field, label: item.label} |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | | formlist: getSearchForm(card, linkableFields, [], 'header') |
| | | formlist: getSearchForm(card, linkableFields, columns, 'header') |
| | | }) |
| | | } |
| | | |
| | |
| | | label={<BgColorsOutlined title="边框颜色"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | {borposition === 'outer' ? <ColorSketch value={card.borderColor || ''} onChange={this.changeBorderColor} /> : null} |
| | | {borposition === 'left' ? <ColorSketch value={card.borderLeftColor || ''} onChange={this.changeBorderColor} /> : null} |
| | | {borposition === 'right' ? <ColorSketch value={card.borderRightColor || ''} onChange={this.changeBorderColor} /> : null} |
| | | {borposition === 'top' ? <ColorSketch value={card.borderTopColor || ''} onChange={this.changeBorderColor} /> : null} |
| | | {borposition === 'bottom' ? <ColorSketch value={card.borderBottomColor || ''} onChange={this.changeBorderColor} /> : null} |
| | | {borposition === 'outer' ? <ColorSketch allowClear={true} value={card.borderColor || ''} onChange={this.changeBorderColor} /> : null} |
| | | {borposition === 'left' ? <ColorSketch allowClear={true} value={card.borderLeftColor || ''} onChange={this.changeBorderColor} /> : null} |
| | | {borposition === 'right' ? <ColorSketch allowClear={true} value={card.borderRightColor || ''} onChange={this.changeBorderColor} /> : null} |
| | | {borposition === 'top' ? <ColorSketch allowClear={true} value={card.borderTopColor || ''} onChange={this.changeBorderColor} /> : null} |
| | | {borposition === 'bottom' ? <ColorSketch allowClear={true} value={card.borderBottomColor || ''} onChange={this.changeBorderColor} /> : null} |
| | | </Form.Item> |
| | | <Form.Item |
| | | colon={false} |
| | |
| | | |
| | | if (param.$searchkey) { |
| | | component.search = component.search.map(item => { |
| | | if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param.$searchkey === item.field) { |
| | | if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param.$searchkey === item.field.toLowerCase()) { |
| | | item.initval = param.$searchval |
| | | } |
| | | |
| | |
| | | |
| | | // 字段透视及必填标志 |
| | | config.search = config.search.map(item => { |
| | | if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param && param.$searchkey === item.field) { |
| | | if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param && param.$searchkey === item.field.toLowerCase()) { |
| | | item.initval = param.$searchval |
| | | } |
| | | return item |
| | |
| | | } |
| | | |
| | | if (card.field) { |
| | | __param.$searchkey = card.field |
| | | __param.$searchkey = card.field.toLowerCase() |
| | | __param.$searchval = data[card.field] || '' |
| | | } |
| | | |
| | |
| | | } else if (data.$$empty) { |
| | | _data = [] |
| | | } |
| | | let name = '' |
| | | if (card.showName) { |
| | | name = data[card.showName] || ' ' |
| | | } |
| | | |
| | | _style_ = _style_ || {} |
| | | if (card.wrapStyle) { |
| | |
| | | if (['exec', 'prompt', 'pop', 'form'].includes(card.OpenType)) { |
| | | MkButton = <NormalButton |
| | | btn={card} |
| | | name={name} |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | |
| | | } else if (card.OpenType === 'popview') { |
| | | MkButton = <PopupButton |
| | | btn={card} |
| | | name={name} |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | |
| | | } else if (card.OpenType === 'tab') { |
| | | MkButton = <TabButton |
| | | btn={card} |
| | | name={name} |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | |
| | | } else if (card.OpenType === 'innerpage') { |
| | | MkButton = <NewPageButton |
| | | btn={card} |
| | | name={name} |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={_disabled} |
| | |
| | | let className = 'mk-card ' |
| | | if (config.wrap.parity === 'true') { |
| | | if (index % 2 === 1) { |
| | | className += 'mk-parity-bg ' |
| | | className += 'mk-even-line ' |
| | | } else { |
| | | className += 'mk-odd-line ' |
| | | } |
| | | } |
| | | if (item.$disabled) { |
| | |
| | | } |
| | | } |
| | | } |
| | | .mk-parity-bg { |
| | | .mk-even-line { |
| | | .card-item-box { |
| | | background-color: var(--mk-sys-color1); |
| | | } |
| | | } |
| | | .mk-even-line:hover, .mk-odd-line:hover { |
| | | .card-item-box { |
| | | background-color: var(--mk-sys-color2); |
| | | } |
| | | } |
| | | } |
| | | .data-zoom.scale { |
| | | .card-row-list { |
| | |
| | | } |
| | | |
| | | state = { |
| | | BID: '', // 上级ID |
| | | config: null, // 图表配置信息 |
| | | loading: false, // 数据加载状态 |
| | | search: null, // 搜索条件 |
| | | pageIndex: 1, // 页码 |
| | | total: 0, // 总数 |
| | | data: null, // 数据 |
| | | BID: '', |
| | | config: null, |
| | | loading: false, |
| | | search: null, |
| | | pageIndex: 1, |
| | | total: 0, |
| | | data: null, |
| | | precards: [], |
| | | BData: '' |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | let precards = [] |
| | | _config.subcards = _config.subcards.filter(item => { |
| | | if (item.setting.condition === 'title') { |
| | | precards.push(item) |
| | | return false |
| | | } |
| | | return true |
| | | }) |
| | | |
| | | this.setState({ |
| | | BID: BID || '', |
| | | BData: BData || '', |
| | | data: _data, |
| | | config: _config, |
| | | search: _config.$searches |
| | | search: _config.$searches, |
| | | precards |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | getLines = (data) => { |
| | | getLines = (data, lindex) => { |
| | | const { config } = this.state |
| | | |
| | | let line = [] |
| | | |
| | | config.subcards.forEach((item, index) => { |
| | | let display = item.setting.condition !== 'true' |
| | | let type = '' |
| | | let className = '' |
| | | |
| | | if (!display && item.setting.controlField) { |
| | | let val = data[item.setting.controlField] |
| | |
| | | display = true |
| | | } |
| | | |
| | | type = 'mk_tb_' + val |
| | | className = 'mk_line_' + val |
| | | } |
| | | |
| | | if (!display) return |
| | | |
| | | if (config.wrap.parity === 'true') { |
| | | if (lindex % 2 === 1) { |
| | | className += ' mk-even-line' |
| | | } else { |
| | | className += ' mk-odd-line' |
| | | } |
| | | } |
| | | |
| | | line.push( |
| | | <Col key={index} className={type} span={24}> |
| | | <Col key={index} className={className} span={24}> |
| | | <div className="card-item-box" style={item.style} onClick={() => {this.openView(item, data)}}> |
| | | <CardCellComponent data={data} cards={config} cardCell={item} elements={item.elements}/> |
| | | </div> |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config, loading, data, BID, pageIndex, total, BData } = this.state |
| | | const { config, loading, data, BID, pageIndex, total, BData, precards } = this.state |
| | | |
| | | if (config.wrap.empty === 'hidden' && (!data || data.length === 0)) return null |
| | | |
| | |
| | | selectedData={[]} |
| | | /> : null |
| | | } |
| | | {data && data.length > 0 ? <Row className={'card-row-list' + (config.wrap.parity === 'true' ? ' mk-parity' : '')} style={{height: config.wrap.contentHeight}}> |
| | | {data.map(item => this.getLines(item))} |
| | | </Row> : null} |
| | | {data && data.length === 0 ? <div className="card-row-list" style={{height: config.wrap.contentHeight}}> |
| | | <Empty description={false}/> |
| | | </div> : null} |
| | | <Row className="card-row-list" 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}> |
| | | <CardCellComponent data={data && data[0] ? data[0] : {}} cards={config} cardCell={item} elements={item.elements}/> |
| | | </div> |
| | | </Col> |
| | | ))} |
| | | {data && data.length > 0 ? data.map((item, index) => this.getLines(item, index)) : null} |
| | | {data && data.length === 0 ? <Empty description={false}/> : null} |
| | | </Row> |
| | | {config.wrap.pagestyle === 'page' ? <Pagination size="small" current={pageIndex} total={total} onChange={this.changePageIndex} /> : null} |
| | | {config.wrap.pagestyle === 'more' && data && data.length > 0 ? <div className={'mk-more' + (config.setting.pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>查看更多<DownOutlined/></div> : null} |
| | | </div> |
| | |
| | | clear: both; |
| | | } |
| | | |
| | | .mk-parity { |
| | | >.ant-col:nth-child(even) { |
| | | .card-item-box { |
| | | background-color: var(--mk-sys-color1); |
| | | } |
| | | } |
| | | } |
| | | .card-row-list { |
| | | overflow-y: auto; |
| | | .card-item-box { |
| | |
| | | background-color: #ffffff; |
| | | transition: all 0.3s; |
| | | } |
| | | >.active >.card-item-box { |
| | | border-color: #1890ff!important; |
| | | box-shadow: 0 0 3px #1890ff; |
| | | .mk-even-line { |
| | | .card-item-box { |
| | | 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::-webkit-scrollbar { |
| | |
| | | |
| | | if (item.linkThdMenu) { |
| | | let __param = { |
| | | $searchkey: item.field, |
| | | $searchval: record[item.field] || '', |
| | | $BID: record.$$uuid |
| | | } |
| | | |
| | | if (item.field) { |
| | | __param.$searchkey = item.field.toLowerCase() |
| | | __param.$searchval = record[item.field] || '' |
| | | } |
| | | |
| | | if (item.linkThdMenu.urlFields) { |
| | | let lower = {} |
| | | Object.keys(record).forEach(key => { |
| | |
| | | |
| | | if (param.$searchkey) { |
| | | component.search = component.search.map(item => { |
| | | if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param.$searchkey === item.field) { |
| | | if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param.$searchkey === item.field.toLowerCase()) { |
| | | item.initval = param.$searchval |
| | | } |
| | | |
| | |
| | | config.components.forEach(component => { |
| | | if (component.type !== 'search') return |
| | | |
| | | if (param.$searchkey) { |
| | | component.search = component.search.map(item => { |
| | | if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param.$searchkey === item.field) { |
| | | item.initval = param.$searchval |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | |
| | | component.$searches = Utils.initMainSearch(component.search) |
| | | } |
| | | |
| | | window.GLOB.SearchBox.set(Tab.uuid, component.$searches) |
| | | |
| | | if (component.$s_req) { |
| | |
| | | btn: PropTypes.object, // 按钮 |
| | | selectedData: PropTypes.any, // 子表中选择数据 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | name: PropTypes.any |
| | | } |
| | | |
| | | state = { |
| | |
| | | |
| | | if (btn.pageTemplate === 'billprint') { |
| | | _name = '单据打印' |
| | | if (btn.preHandle === 'true' && btn.pre_func) { |
| | | MKEmitter.emit('queryModuleParam', btn.$menuId, (res) => { |
| | | let searches = {} |
| | | res.search && res.search.forEach(item => { |
| | | searches[item.key] = item.value |
| | | }) |
| | | |
| | | if (btn.Ot === 'requiredOnce') { |
| | | Id = data.map(item => item.$$uuid).filter(Boolean).join(',') |
| | | } |
| | | |
| | | if (btn.Ot === 'required') { |
| | | data.forEach(item => { |
| | | let _param = { id: item.$$uuid || '', tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM')} |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('btn', 'searches', 'data', 'param', 'systemType', btn.pre_func) |
| | | _param = func(btn, searches, [item], _param, window.GLOB.systemType) |
| | | } catch (e) { |
| | | console.warn(e) |
| | | } |
| | | |
| | | if (!_param) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到打印参数,自定义脚本错误!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify(_param)))) |
| | | }) |
| | | } else { |
| | | let _param = { id: Id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM')} |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('btn', 'searches', 'data', 'param', 'systemType', btn.pre_func) |
| | | _param = func(btn, searches, data, _param, window.GLOB.systemType) |
| | | } catch (e) { |
| | | console.warn(e) |
| | | } |
| | | |
| | | if (!_param) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到打印参数,自定义脚本错误!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify(_param)))) |
| | | } |
| | | }) |
| | | } else { |
| | | if (btn.Ot === 'required') { |
| | | data.forEach(item => { |
| | | let _id = item.$$uuid || '' |
| | |
| | | window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: Id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') })))) |
| | | } else { |
| | | window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: Id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') })))) |
| | | } |
| | | } |
| | | } else if (btn.pageTemplate === 'billprintTemp') { |
| | | let src = '#/menudesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({ MenuType: 'billPrint', MenuId: Id, MenuNo: MenuNo, MenuName: name || '打印', Remark: Remark }))) |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { btn } = this.props |
| | | const { btn, name } = this.props |
| | | const { disabled, hidden } = this.state |
| | | |
| | | if (hidden) return null |
| | |
| | | let className = '' |
| | | |
| | | if (btn.show === 'button') { |
| | | label = btn.label |
| | | label = name || btn.label |
| | | icon = btn.icon || '' |
| | | } else if (btn.show === 'link') { |
| | | label = <span>{btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> |
| | | label = <span>{name || btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> |
| | | icon = '' |
| | | } else if (btn.show === 'icon') { |
| | | icon = btn.icon || '' |
| | |
| | | columns: PropTypes.any, // 字段列 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | name: PropTypes.any |
| | | } |
| | | |
| | | state = { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { btn } = this.props |
| | | const { btn, name } = this.props |
| | | const { loadingNumber, loadingTotal, loading, disabled, hidden, check, count } = this.state |
| | | |
| | | if (hidden) return null |
| | |
| | | let className = '' |
| | | |
| | | if (btn.show === 'button') { |
| | | label = btn.label |
| | | label = name || btn.label |
| | | icon = btn.icon || '' |
| | | } else if (btn.show === 'link') { |
| | | label = <span>{btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> |
| | | label = <span>{name || btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> |
| | | icon = '' |
| | | } else if (btn.show === 'icon') { |
| | | icon = btn.icon || '' |
| | |
| | | btn: PropTypes.object, // 按钮 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | name: PropTypes.any |
| | | } |
| | | |
| | | state = { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { btn } = this.props |
| | | const { btn, name } = this.props |
| | | const { loading, disabled, hidden } = this.state |
| | | |
| | | if (hidden) return null |
| | |
| | | let className = '' |
| | | |
| | | if (btn.show === 'button') { |
| | | label = btn.label |
| | | label = name || btn.label |
| | | icon = btn.icon || '' |
| | | } else if (btn.show === 'link') { |
| | | label = <span>{btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> |
| | | label = <span>{name || btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> |
| | | icon = '' |
| | | } else if (btn.show === 'icon') { |
| | | icon = btn.icon || '' |
| | |
| | | btn: PropTypes.object, // 按钮 |
| | | selectedData: PropTypes.any, // 子表中选择数据 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | name: PropTypes.any |
| | | } |
| | | |
| | | state = { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { btn } = this.props |
| | | const { btn, name } = this.props |
| | | const { disabled, hidden } = this.state |
| | | |
| | | if (hidden) return null |
| | |
| | | let className = '' |
| | | |
| | | if (btn.show === 'button') { |
| | | label = btn.label |
| | | label = name || btn.label |
| | | icon = btn.icon || '' |
| | | } else if (btn.show === 'link') { |
| | | label = <span>{btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> |
| | | label = <span>{name || btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> |
| | | icon = '' |
| | | } else if (btn.show === 'icon') { |
| | | icon = btn.icon || '' |
| | |
| | | e.stopPropagation() |
| | | |
| | | let __param = { |
| | | $searchkey: item.field, |
| | | $searchval: record[item.field] || '', |
| | | $BID: record.$$uuid |
| | | } |
| | | |
| | | if (item.field) { |
| | | __param.$searchkey = item.field.toLowerCase() |
| | | __param.$searchval = record[item.field] || '' |
| | | } |
| | | |
| | | if (item.linkfields && item.linkfields.length > 0) { |
| | | item.linkfields.forEach(field => { |
| | | __param[field] = record[field] || '' |
| | |
| | | float: none; |
| | | vertical-align: top; |
| | | } |
| | | .ant-checkbox-wrapper { |
| | | color: rgba(0, 0, 0, 0.85); |
| | | white-space: nowrap; |
| | | } |
| | | .ant-form-item { |
| | | display: flex; |
| | | margin-bottom: 0px; |
| | |
| | | _setting.wrapperCol = {style: {width: (100 - _setting.labelwidth) + '%'}} |
| | | _setting.borderRadius = config.wrap.borderRadius |
| | | _setting.resetContrl = config.wrap.resetContrl || 'init' |
| | | |
| | | if (config.wrap.searchBtn === 'show') { |
| | | _setting.showBtn = true |
| | | } |
| | | } |
| | | |
| | | if (config.type === 'search') { |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (setting.showBtn) { |
| | | fields.push( |
| | | <Col className="mk-search-col search-button" key="actions"> |
| | | <Form.Item> |
| | | <Button type="primary" onClick={this.handleSubmit}> |
| | | 搜索 |
| | | </Button> |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } |
| | | |
| | | return fields |
| | |
| | | } |
| | | .ant-checkbox-wrapper { |
| | | color: rgba(0, 0, 0, 0.85); |
| | | white-space: nowrap; |
| | | } |
| | | .ant-form-item { |
| | | display: flex; |
| | |
| | | loading: false |
| | | }) |
| | | reject() |
| | | }, verify.scripts) |
| | | }, verify.scripts, 'submit') |
| | | }) |
| | | }) |
| | | } else if (activeKey === 'columns') { |
| | |
| | | loading: false |
| | | }) |
| | | reject() |
| | | }, verify.scripts) |
| | | }, verify.scripts, 'submit') |
| | | } |
| | | } else if (activeKey === 'scripts') { |
| | | this.setState({loading: true}) |
| | |
| | | loading: false |
| | | }) |
| | | reject() |
| | | }, verify.scripts) |
| | | }, verify.scripts, 'submit') |
| | | } else { |
| | | resolve(verify) |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | sqlverify = (_resolve, _reject, scripts) => { |
| | | sqlverify = (_resolve, _reject, scripts, type) => { |
| | | const { searches, verify, debugId } = this.state |
| | | |
| | | if (verify.dataType !== 'custom') { |
| | |
| | | this.setState({debugId: _debugId}) |
| | | _resolve() |
| | | } else { |
| | | if (type === 'submit') { |
| | | Modal.confirm({ |
| | | title: result.message, |
| | | okText: '知道了', |
| | | cancelText: '强制保存', |
| | | onOk: () => { |
| | | _reject() |
| | | }, |
| | | onCancel() { |
| | | _resolve() |
| | | } |
| | | }) |
| | | } else { |
| | | _reject() |
| | | Modal.error({ |
| | | title: result.message |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | |
| | |
| | | * @description 搜索条件编辑,获取搜索条件表单信息 |
| | | */ |
| | | handleSearch = (card) => { |
| | | const { config } = this.props |
| | | const { searchlist } = this.state |
| | | let linkableFields = [] |
| | | |
| | |
| | | }) |
| | | |
| | | let columns = null |
| | | if (this.props.config.type === 'table') { |
| | | columns = this.props.config.columns.map(item => { |
| | | if (config.columns && config.columns.length) { |
| | | columns = config.columns.map(item => { |
| | | return {key: item.uuid, text: item.field, value: item.field, label: item.label} |
| | | }) |
| | | } |