king
2025-05-08 b6c698c8833836971184a0a9c2645a15f8174d37
src/menu/components/search/main-search/index.jsx
@@ -250,7 +250,7 @@
        return
      }
      if (['select', 'multiselect', 'link', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) {
      if (['select', 'multiselect', 'link', 'checkcard'].includes(res.type) && res.resourceType === '1' && res.database !== 'sso' && /\s/.test(res.dataSource)) {
        this.setState({
          sqlVerifing: true
        })
@@ -258,13 +258,8 @@
        let sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
        ${res.dataSource}`
        sql = sql.replace(/@\$|\$@/ig, '')
        let rduri = ''
        if (window.GLOB.mainSystemApi && res.database === 'sso') {
          rduri = window.GLOB.mainSystemApi
        }
        
        Api.sDebug(sql, rduri).then(result => {
        Api.sDebug(sql).then(result => {
          if (result.status || result.ErrCode === '-2') {
            this.setState({
              sqlVerifing: false,
@@ -294,15 +289,15 @@
   * @description 搜索条件删除
   */
  deleteElement = (cell) => {
    let _this = this
    let that = this
    confirm({
      content: `确定删除 - ${cell.label} ?`,
      onOk() {
        let _card = fromJS(_this.state.card).toJS()
        let _card = fromJS(that.state.card).toJS()
        _card.search = _card.search.filter(item => item.uuid !== cell.uuid)
        _this.updateComponent(_card)
        that.updateComponent(_card)
      },
      onCancel() {}
    })
@@ -320,6 +315,11 @@
      match: 'like',
      focus: true
    }
    if (card.search.length) {
      item.ratio = card.search[card.search.length - 1].ratio
    }
    card.search.push(item)
    this.setState({card}, () => {
@@ -344,6 +344,17 @@
    if (type === 'simple') {
      _card.search.push(item)
      this.updateComponent(_card)
      this.handleSearch(item)
    } else if (type === 'replace') {
      delete item.focus
      _card.search = _card.search.map(cell => {
        if (cell.field && cell.field.toLowerCase() === item.field.toLowerCase()) {
          return item
        }
        return cell
      })
      this.updateComponent(_card)
      this.handleSearch(item)
@@ -381,7 +392,7 @@
    let _style = resetStyle(card.style)
    return (
      <div className={`main-search-edit-list ${card.wrap.float} ${showField ? 'show-field' : ''}`} onClick={this.clickComponent} id={card.uuid} style={_style}>
      <div className={`main-search-edit-list ${card.wrap.float} ${showField ? 'show-field' : ''} mk-order-${card.wrap.searchSize || ''}`} onClick={this.clickComponent} id={card.uuid} style={_style}>
        <FieldsComponent config={card} type="search" />
        <Switch checkedChildren="开" size="small" unCheckedChildren="关" defaultChecked={showField} onChange={this.onFieldChange} />
        <DragElement
@@ -422,7 +433,7 @@
          title="搜索条件-编辑"
          wrapClassName="mk-scroll-modal"
          visible={visible}
          width={850}
          width={950}
          maskClosable={false}
          onOk={this.handleSubmit}
          confirmLoading={sqlVerifing}