king
2024-06-21 2bccb9ec7bdefe23292a22bc153463cfa1479a49
src/tabviews/zshare/topSearch/index.jsx
@@ -67,6 +67,7 @@
      _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
@@ -188,20 +189,21 @@
        // 数据源查询语句
        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)
            }
  
            // 测试系统单个请求
@@ -209,13 +211,20 @@
              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`)
              }
            }
          }
@@ -601,11 +610,11 @@
          }
          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
@@ -620,7 +629,7 @@
            
            map.set(_item.ParentID + _item.Value, 0)
          } else {
            _item.$value = cell[item.cardValField]
            _item.$value = cell[item.cardValField] + ''
            _item = {..._item, ...cell}
            if (item.urlField) {
@@ -721,7 +730,7 @@
      const _rules = [
        {
          required: item.required,
          message: item.label + '不可为空!'
          message: item.label + (window.GLOB.dict['not_empty'] || '不可为空!')
        }
      ]
@@ -782,13 +791,13 @@
            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>
@@ -798,7 +807,7 @@
        <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>
@@ -884,7 +893,7 @@
      
            notification.warning({
              top: 92,
              message: '请输入' + labels.join('、') + ' !',
              message: (window.GLOB.dict['input_tip'] || '请输入') + labels.join('、') + ' !',
              duration: 3
            })
            return
@@ -1116,7 +1125,7 @@
    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">
@@ -1132,7 +1141,7 @@
          </Row> : null}
        </Form>
        {setting.advanceType === 'modal' ? <Modal
          title="高级搜索"
          title={window.GLOB.dict['adv_search'] || '高级搜索'}
          maskClosable={false}
          visible={visible}
          width={setting.advWidth}
@@ -1148,7 +1157,7 @@
          />
        </Modal> : null}
        {setting.advanceType === 'drawer' ? <Drawer
          title="高级搜索"
          title={window.GLOB.dict['adv_search'] || '高级搜索'}
          className="mk-search-drawer"
          width={setting.advWidth}
          height={setting.advHeight}