king
2025-03-24 a8d8d2fdb83f21e76f90cb13ea91ad6e9bf98a9b
src/menu/datasource/index.jsx
@@ -93,13 +93,13 @@
    } else if (config.type === 'interface') {
      menu.components.forEach(item => {
        if (item.type !== 'search') return
        search = item.search
        search = item.search || []
      })
    } else {
      let filterComponent = (box, mainSearch) => {
        box.components.forEach(item => {
          if (item.type !== 'search') return
          mainSearch = item.search
          mainSearch = item.search || []
        })
        let has = false
        box.components.forEach(item => {
@@ -136,10 +136,10 @@
  }
  verifySubmit = () => {
    const { config } = this.props
    const { config, mainSearch } = this.props
    this.setState({loading: true})
    this.verifyRef.submitDataSource().then(res => {
    this.verifyRef.submitDataSource().then((res) => {
      let MenuType = sessionStorage.getItem('MenuType')
@@ -245,14 +245,19 @@
      //   })
      // }
      if (res.setting.interType === 'system' && res.setting.dataresource && res.setting.execute !== 'false' && sFields) {
        if (new RegExp(`@(${sFields})@`, 'ig').test(res.setting.dataresource)) {
          maxScript = 1000
      if (res.setting.interType === 'system' && res.setting.dataresource && res.setting.execute !== 'false') {
        res.setting.dataresource = res.setting.dataresource.replace(/\t+|\v+/g, ' ')
        if (sFields) {
          if (new RegExp(`@(${sFields})@`, 'ig').test(res.setting.dataresource)) {
            maxScript = 1000
          }
        }
      }
      res.scripts.forEach(item => {
        if (item.status === 'false') return
        item.sql = item.sql.replace(/\t+|\v+/g, ' ')
        if (/exec\s/ig.test(item.sql)) {
          useExec = true
@@ -334,6 +339,13 @@
          MKEmitter.emit('mkUpdateInter', {uuid: config.uuid, columns: res.columns}, {delay: 0})
        }, 150)
      }
      if (config.type === 'interface' && res.setting && res.setting.useMSearch === 'true' && mainSearch.length === 0) {
        Modal.warning({
          title: '数据源中使用了外部搜索,但搜索条件尚未添加!',
          centered: true
        })
      }
    }, () => {
      this.setState({loading: false})
    })
@@ -384,7 +396,7 @@
          width={'75vw'}
          maskClosable={false}
          okText="提交"
          onCancel={() => {this.setState({ visible: false, loading: false }) }}
          onCancel={this.cancel}
          footer={[
            config.subtype !== 'dualdatacard' && record.interType === 'inner' ? <CreateFunc key="create" getMsg={this.creatFunc}/> : null,
            <Button key="cancel" onClick={this.cancel}>取消</Button>,