king
2024-02-04 0bbaa727cdfc65622e33e91c4bf694c83f184535
src/templates/treepageconfig/updatetable/index.jsx
@@ -149,7 +149,11 @@
    let _tbs = []
    if (config.tabgroups && config.tabgroups.length > 0) {
      config.tabgroups.forEach((m, i) => {
        if (!m.sublist || m.sublist.length === 0) return
        if (!m.sublist) return
        m.sublist = m.sublist.filter(c => !!c.linkTab)
        if (m.sublist.length === 0) return
        let tabs = {
          uuid: Utils.getuuid(),
@@ -179,7 +183,7 @@
              }
            }
            let tab = { uuid: Utils.getuuid(), controlVal: level, label: n.label, icon: n.icon, permission: 'false', components: [
            let tab = { uuid: Utils.getuuid(), controlVal: level, label: n.label, icon: n.icon, permission: 'true', components: [
              {
                uuid: Utils.getuuid(),
                linkTab: n.linkTab,
@@ -206,7 +210,7 @@
      let defers = _tbs.map((item, i) => {
        return new Promise((resolve) => {
          setTimeout(() => {
            Api.getSystemConfig({
            Api.getCloudConfig({
              func: 'sPC_Get_LongParam',
              MenuID: item.linkTab
            }).then(res => {
@@ -247,11 +251,28 @@
          }
        })
        let supIds = []
        _config.components = _config.components.map(item => {
          if (item.type === 'tabs') {
            item.subtabs = item.subtabs.map(tab => {
              tab.components[0] = this.getTable(menus[tab.components[0].linkTab], tab.components[0], errors, formActions, popActions, oldtabs)
              supIds.push([item.uuid, tab.uuid, tab.components[0].uuid])
              return tab
            })
          }
          return item
        })
        _config.components = _config.components.map(item => {
          if (item.type === 'tabs') {
            item.subtabs = item.subtabs.map(tab => {
              if (tab.components[0].setting.supModule && tab.components[0].setting.supModule.length === 1) {
                supIds.forEach(ids => {
                  if (ids[2] === tab.components[0].setting.supModule[0]) {
                    tab.components[0].setting.supModule = ids
                  }
                })
              }
              return tab
            })
          }
@@ -270,7 +291,7 @@
      let defers = popActions.map((item, i) => {
        return new Promise((resolve) => {
          setTimeout(() => {
            Api.getSystemConfig({
            Api.getCloudConfig({
              func: 'sPC_Get_LongParam',
              MenuID: item.linkTab
            }).then(res => {
@@ -450,7 +471,7 @@
      let defers = formActions.map((item, i) => {
        return new Promise((resolve) => {
          setTimeout(() => {
            Api.getSystemConfig({
            Api.getCloudConfig({
              func: 'sPC_Get_LongParam',
              MenuID: item.origin
            }).then(res => {
@@ -762,17 +783,17 @@
      debug_md5: key,
      debug_url: url,
      debug_list: window.btoa(tbs),
      LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(config)))
      LongParam: window.btoa(window.encodeURIComponent(JSON.stringify(config))),
      LText: ''
    }
    param.LText = Utils.formatOptions(param.LText)
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    param.secretkey = Utils.encrypt(param.LText, param.timestamp)
    param.secretkey = Utils.encrypt('', param.timestamp)
    let save = false
    new Promise(resolve => {
      Api.getSystemConfig(param).then(res => {
      Api.getCloudConfig(param).then(res => {
        resolve(res)
      })
    }).then(res => { // 删除原菜单
@@ -783,7 +804,7 @@
      if (this.delButtons.length === 0) return res
      return Api.getSystemConfig({
      return Api.getCloudConfig({
        func: 'sPC_MainMenu_Del',
        up_type: 'Y',
        MenuID: this.delButtons.join(',')
@@ -833,7 +854,7 @@
      action: [],
      subtype: 'normaltable',
      setting: { useMSearch: 'false', sync: 'false', onload: 'true' },
      wrap: {},
      wrap: {name: newCon.name},
      style: {},
      headerStyle: {},
      columns: [],
@@ -862,7 +883,11 @@
    let lineMarks = []
    config.columns.forEach(col => {
      if (col.type === 'colspan') {
        _colspan.push(...col.subfield.split(', '))
        if (col.subfield) {
          _colspan.push(...col.subfield.split(', '))
        } else if (col.sublist && col.sublist.length > 0) {
          _colspan.push(...col.sublist)
        }
      }
      if (!col.field) return
@@ -933,7 +958,7 @@
        if (_colspan.includes(col.field)) {
          _col.Hide = 'true'
        }
        _col.uuid = Utils.getuuid()
        _card.cols.push(_col)
      }
@@ -944,14 +969,20 @@
          label: col.label,
          marks: [],
          isSub: false,
          uuid: col.uuid,
          uuid: Utils.getuuid(),
          blacklist: []
        }
        let _subs = []
        if (col.subfield) {
          _subs = col.subfield.split(', ')
        } else if (col.sublist) {
          _subs = col.sublist
        }
        if (col.unfold === 'true') {
          ucol.type = 'colspan'
          ucol.subcols = []
          col.subfield.split(', ').forEach(sub => {
          _subs.forEach(sub => {
            if (_cols[sub]) {
              let _col = fromJS(_cols[sub]).toJS()
              _col.Hide = 'false'
@@ -971,7 +1002,7 @@
          ucol.elements = []
          ucol.style = {paddingTop: '12px', paddingLeft: '8px', paddingBottom: '12px', paddingRight: '8px'}
          col.subfield.split(', ').forEach(sub => {
          _subs.forEach(sub => {
            if (_cols[sub]) {
              let _col = {
                copyable: 'false',
@@ -1166,7 +1197,7 @@
      })
    }
    let sets = ['tableName', 'interType', 'sysInterface', 'innerFunc', 'interface', 'proInterface', 'outerFunc', 'dataresource', ['queryType', 'query'], 'primaryKey', 'order', 'execute', ['laypage', 'true'], ['pageSize', 10], ['onload', 'true']]
    let sets = ['tableName', 'interType', 'sysInterface', 'innerFunc', 'interface', 'proInterface', 'outerFunc', 'dataresource', ['queryType', 'query'], 'primaryKey', 'order', ['laypage', 'true'], ['pageSize', 10], ['onload', 'true']]
    let wraps = ['tableType', ['bordered', 'true'], 'actionfixed', ['size', 'middle'], ['selected', 'false'], ['tableMode', 'compatible'], ['mask', 'show'], ['borderColor', '#e8e8e8'], 'height', 'controlField', 'controlVal']
    _card.scripts = config.setting.scripts || []
@@ -1199,6 +1230,8 @@
      _card.wrap.doubleClick = ''
    }
    _card.setting.execute = config.setting.default || 'true'
    _card.errors = []
    let columns = _card.columns.map(c => c.field)
    if (_card.setting.interType === 'system' && _card.setting.execute !== 'false' && !_card.setting.dataresource) {