| | |
| | | _setting.wrapperCol = {style: {width: (100 - _setting.labelwidth) + '%'}} |
| | | _setting.borderRadius = config.wrap.borderRadius |
| | | _setting.resetContrl = config.wrap.resetContrl || 'init' |
| | | _setting.size = config.wrap.searchSize || '' |
| | | |
| | | if (config.wrap.searchBtn === 'show') { |
| | | _setting.showBtn = true |
| | |
| | | // 数据源查询语句 |
| | | if (item.resourceType === '1' && item.dataSource) { |
| | | let _option = Utils.getSelectQueryOptions(item) |
| | | let _declare = `Declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) select @mk_departmentcode='${sessionStorage.getItem('departmentcode') || ''}',@mk_organization='${sessionStorage.getItem('organization') || ''}',@mk_user_type='${sessionStorage.getItem('mk_user_type') || ''}'\n` |
| | | |
| | | let exec = true |
| | | if (item.checkBid) { |
| | | item.sql = _option.sql |
| | | item.sql = _declare + _option.sql |
| | | item.arr_field = _option.field |
| | | |
| | | exec = !!BID |
| | | } |
| | | |
| | | if (exec) { |
| | | _option.sql = _option.sql.replace(/@BID@/ig, `'${BID || ''}'`) |
| | | let _sql = _option.sql.replace(/@BID@/ig, `'${BID || ''}'`) |
| | | |
| | | if (window.GLOB.debugger === true) { |
| | | console.info(_option.sql) |
| | | console.info(_declare + _sql) |
| | | } |
| | | |
| | | // 测试系统单个请求 |
| | |
| | | deForms.push({ |
| | | ...item, |
| | | arr_field: _option.field, |
| | | data_sql: Utils.formatOptions(_option.sql, window.GLOB.execType) |
| | | data_sql: Utils.formatOptions(_declare + _sql, window.GLOB.execType) |
| | | }) |
| | | } else { // 合并请求,区分本地及系统 |
| | | _sql = _sql.replace(/%/ig, ' mpercent ') |
| | | if (item.database === 'sso') { |
| | | mainItems.push(`select '${item.field}' as obj_name,'${_option.field}' as arr_field,'${window.btoa(window.encodeURIComponent(_option.sql.replace(/%/ig, ' mpercent ')))}' as LText`) |
| | | if (mainItems.length === 0) { |
| | | _sql = _declare + _sql |
| | | } |
| | | mainItems.push(`select '${item.field}' as obj_name,'${_option.field}' as arr_field,'${window.btoa(window.encodeURIComponent(_sql))}' as LText`) |
| | | } else { |
| | | localItems.push(`select '${item.field}' as obj_name,'${_option.field}' as arr_field,'${window.btoa(window.encodeURIComponent(_option.sql.replace(/%/ig, ' mpercent ')))}' as LText`) |
| | | if (localItems.length === 0) { |
| | | _sql = _declare + _sql |
| | | } |
| | | localItems.push(`select '${item.field}' as obj_name,'${_option.field}' as arr_field,'${window.btoa(window.encodeURIComponent(_sql))}' as LText`) |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | if (item.linkField) { |
| | | _item.ParentID = cell[item.linkField] |
| | | _item.ParentID = cell[item.linkField] + '' |
| | | } |
| | | |
| | | if (item.type !== 'checkcard') { |
| | | _item.Value = cell[item.valueField] |
| | | _item.Value = cell[item.valueField] + '' |
| | | _item.Text = cell[item.valueText] + '' |
| | | |
| | | if (map.has(_item.ParentID + _item.Value)) return |
| | |
| | | |
| | | map.set(_item.ParentID + _item.Value, 0) |
| | | } else { |
| | | _item.$value = cell[item.cardValField] |
| | | _item.$value = cell[item.cardValField] + '' |
| | | _item = {..._item, ...cell} |
| | | |
| | | if (item.urlField) { |
| | |
| | | const _rules = [ |
| | | { |
| | | required: item.required, |
| | | message: item.label + '不可为空!' |
| | | message: item.label + (window.GLOB.dict['not_empty'] || '不可为空!') |
| | | } |
| | | ] |
| | | |
| | |
| | | wrapperCol={setting.wrapperCol} |
| | | > |
| | | {setting.show ? <Button style={style} type="primary" onClick={this.handleSubmit}> |
| | | 搜索 |
| | | {window.GLOB.dict['search'] || '搜索'} |
| | | </Button> : null} |
| | | {setting.show ? <Button style={{ marginLeft: 8, ...style }} onClick={this.handleReset}> |
| | | 重置 |
| | | {window.GLOB.dict['reset'] || '重置'} |
| | | </Button> : null} |
| | | {setting.showAdv ? <Button className={visible ? 'visible' : ''} type="link" onClick={this.handleAdvance}> |
| | | 高级{setting.advanceType === 'pulldown' ? <DownOutlined /> : null} |
| | | {window.GLOB.dict['senior'] || '高级'}{setting.advanceType === 'pulldown' ? <DownOutlined /> : null} |
| | | </Button> : null} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | <Col className="mk-search-col search-button" key="actions"> |
| | | <Form.Item> |
| | | <Button type="primary" onClick={this.handleSubmit}> |
| | | 搜索 |
| | | {window.GLOB.dict['search'] || '搜索'} |
| | | </Button> |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请输入' + labels.join('、') + ' !', |
| | | message: (window.GLOB.dict['input_tip'] || '请输入') + labels.join('、') + ' !', |
| | | duration: 3 |
| | | }) |
| | | return |
| | |
| | | |
| | | return ( |
| | | <> |
| | | <Form {...formItemLayout} className={`mk-search-wrap mk-float-${setting.float}`} style={setting.style}> |
| | | <Form {...formItemLayout} className={`mk-search-wrap mk-float-${setting.float} mk-size-${setting.size}`} style={setting.style}> |
| | | <Row gutter={24}>{this.getFields()}</Row> |
| | | {advanceValues.length && (setting.advanceType !== 'pulldown' || (setting.advanceType === 'pulldown' && !visible)) ? <Row gutter={24}> |
| | | <div className="advanced-list"> |
| | |
| | | </Row> : null} |
| | | </Form> |
| | | {setting.advanceType === 'modal' ? <Modal |
| | | title="高级搜索" |
| | | title={window.GLOB.dict['adv_search'] || '高级搜索'} |
| | | maskClosable={false} |
| | | visible={visible} |
| | | width={setting.advWidth} |
| | |
| | | /> |
| | | </Modal> : null} |
| | | {setting.advanceType === 'drawer' ? <Drawer |
| | | title="高级搜索" |
| | | title={window.GLOB.dict['adv_search'] || '高级搜索'} |
| | | className="mk-search-drawer" |
| | | width={setting.advWidth} |
| | | height={setting.advHeight} |