king
2025-04-23 b48528b1a1a88e289fc0b7ad52f2da213a3f9dfe
src/tabviews/basetable/index.jsx
@@ -17,6 +17,7 @@
const FlowFloat = asyncComponent(() => import('@/tabviews/zshare/flowFloat'))
const SettingComponent = asyncComponent(() => import('@/tabviews/zshare/settingcomponent'))
const TableNodes = asyncComponent(() => import('@/tabviews/zshare/tablenodes'))
const DeepSeek = asyncComponent(() => import('@/tabviews/zshare/deepseek'))
const AutoMatic = asyncComponent(() => import('@/tabviews/zshare/automatic'))
const DebugTable = asyncComponent(() => import('@/tabviews/debugtable'))
@@ -39,7 +40,8 @@
    userConfig: null,     // 用户自定义设置
    visible: false,       // 标签页控制
    shortcuts: null,      // 快捷键
    autoMatic: null
    autoMatic: null,
    noParam: false
  }
  /**
@@ -47,6 +49,7 @@
   */
  async loadconfig () {
    const { MenuID, MenuName, param } = this.props
    const { noParam } = this.state
    let _param = {
      func: 'sPC_Get_LongParam',
@@ -164,12 +167,25 @@
      let skip = window.GLOB.mkHS
      let urlparam = {} // url参数
      if (param) {
        Object.keys(param).forEach(key => {
          if (/^\$/.test(key)) {
            urlparam[key] = param[key]
          } else {
            urlparam[key.toLowerCase()] = param[key]
          }
        if (!noParam) {
          Object.keys(param).forEach(key => {
            if (/^\$/.test(key)) {
              urlparam[key] = param[key]
            } else {
              urlparam[key.toLowerCase()] = param[key]
            }
          })
        } else {
          urlparam.$BID = param.$BID
        }
      }
      if (config.urlFields && config.urlFields.length) {
        config.urlFields.forEach(field => {
          let key = field.toLowerCase()
          if (urlparam[key] !== undefined) return
          urlparam[key] = ''
        })
      }
@@ -179,7 +195,7 @@
        let keys = Object.keys(urlparam)
        config.allSqls.forEach(item => {
          item.id = md5(window.GLOB.appkey + item.v_id)
          if (item.type === 'datasource' || item.type === 'excelOut') {
          if (['datasource', 'interface', 'excelOut'].includes(item.type)) {
            item.urlkeys = keys
            item.urlparam = urlparam
            if (config.flow_code) {
@@ -206,7 +222,7 @@
      }
      if (config.urlFields) {
        config.urlFields.forEach(field => {
          let val = `'${urlparam[field.toLowerCase()] || ''}'`
          let val = `'${urlparam[field.toLowerCase()]}'`
          regs.push({
            reg: new RegExp('@' + field + '@', 'ig'),
            value: val
@@ -372,8 +388,9 @@
      Utils.initSearchVal(item)
      if (urlparam.$searchkey) {
        let reg = new RegExp('(^|,)' + urlparam.$searchkey + '($|,)', 'ig')
        item.search.forEach(cell => {
          if (urlparam.$searchkey === cell.field.toLowerCase() && ['text', 'select', 'link', 'checkcard'].includes(cell.type)) {
          if (reg.test(cell.field) && ['text', 'select', 'link', 'checkcard'].includes(cell.type)) {
            cell.initval = urlparam.$searchval
          }
        })
@@ -554,12 +571,20 @@
        }
        if (/#position-inner/.test(script)) {
          cell.$innerScript = script
          if (window.backend && window.GLOB.CacheData.has('sql_' + cell.uuid) && !/\$backend/.test(script)) {
            window.GLOB.CacheData.delete('sql_' + cell.uuid)
          }
        }
        if (/#position-outer/.test(script)) {
          cell.$outerScript = script
        }
        if (/#position-callback/.test(script)) {
          cell.$callbackScript = script
          if (window.backend && window.GLOB.CacheData.has('sql_back_' + cell.uuid) && !/\$backend/.test(script)) {
            window.GLOB.CacheData.delete('sql_back_' + cell.uuid)
          }
        }
      }
    }
@@ -572,6 +597,7 @@
        }
      } else if (cell.syncComponentId === 'multiComponent') {
        let ids = cell.syncComponents.map(m => {
          if (Array.isArray(m)) return m.pop() || ''
          return m.syncComId.pop() || ''
        })
@@ -666,9 +692,6 @@
      if (!component.setting.execute) {
        component.setting.dataresource = ''
      }
      if (/\s/.test(component.setting.dataresource)) {
        component.setting.dataresource = '(' + component.setting.dataresource + ') tb'
      }
  
      if (sessionStorage.getItem('dataM') === 'true') { // 数据权限
        component.setting.dataresource = component.setting.dataresource.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'')
@@ -688,8 +711,17 @@
      component.setting.customScript = _customScript // 整理后自定义脚本
      component.setting.tailScript = _tailScript     // 后置自定义脚本
      component.setting.custompage = false
      component.setting.custompage = /@pageSize@|@orderBy@|@mk_total/i.test(component.setting.dataresource + component.setting.customScript)
      if (/order\s+by\s+sort_id\s*$/i.test(component.setting.dataresource)) {
        component.setting.custompage = true
      } else if (/@pageSize@|@orderBy@|@mk_total/i.test(component.setting.dataresource + component.setting.customScript)) {
        component.setting.custompage = true
      }
      if (/\s/.test(component.setting.dataresource)) {
        component.setting.dataresource = '(' + component.setting.dataresource + ') tb'
      }
      if (!component.setting.execute || component.setting.custompage) {
        component.forbidLine = true
@@ -702,12 +734,12 @@
    })
  }
  reloadMenuView = (menuId) => {
  reloadMenuView = (menuId, clear) => {
    const { MenuID } = this.props
    if (MenuID !== menuId) return
    this.reloadview()
    this.reloadview(clear)
  }
  resetActiveMenu = (menuId) => {
@@ -769,7 +801,7 @@
    })
  }
  reloadview = () => {
  reloadview = (clear) => {
    window.GLOB.CacheData.delete(this.props.MenuID)
    if (this.state.config) {
      this.deleteCache(this.state.config.components)
@@ -781,6 +813,7 @@
      viewlost: false,      // 页面丢失:1、未获取到配置-页面丢失;2、页面未启用
      config: null,         // 页面配置信息,包括组件等
      shortcuts: null,
      noParam: clear === true
    }, () => {
      this.loadconfig()
    })
@@ -832,6 +865,7 @@
          {config.process === 'true' ? <FlowFloat config={config}/> : null}
          <SettingComponent config={config} shortcuts={shortcuts || []}/>
          <TableNodes config={config} />
          <DeepSeek/>
        </div>
      </div>
    )