king
2023-11-08 076c2b693da1d42cf3a468c0f3d631c1ed424285
src/menu/components/form/formaction/formconfig.jsx
@@ -4,7 +4,7 @@
 * @param {*} type           按钮类型,用于区分可选的打开方式
 */
export function getActionForm (card, functip, tableName, usefulFields, modules, anchors) {
export function getActionForm (card, functip, tableName, usefulFields, modules, anchors, uuid) {
  const appType = sessionStorage.getItem('appType')
  let viewType = sessionStorage.getItem('editMenuType') // 弹窗 popview
  let _type = '提交'
@@ -44,6 +44,72 @@
      menulist = []
    }
  }
  let linkButtons = []
  let filterComponent = (components) => {
    components.forEach(item => {
      if (item.type === 'tabs') {
        item.subtabs.forEach(tab => {
          filterComponent(tab.components)
        })
      } else if (item.type === 'group') {
        filterComponent(item.components)
      } else {
        item.action && item.action.forEach(cell => {
          if (cell.hidden === 'true' || cell.uuid === uuid) return
          if (!['exec', 'prompt', 'pop'].includes(cell.OpenType)) return
          linkButtons.push({
            value: cell.uuid,
            label: cell.label + '(' + item.name + ')'
          })
        })
        if (item.type === 'card' && item.subcards) {
          item.subcards.forEach(m => {
            if ((item.subtype === 'datacard' || item.subtype === 'dualdatacard') && m.$cardType !== 'extendCard') return
            m.elements.forEach(cell => {
              if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.uuid === uuid) return
              if (!['exec', 'prompt', 'pop'].includes(cell.OpenType)) return
              linkButtons.push({
                value: cell.uuid,
                label: cell.label + '(' + item.name + ')'
              })
            })
          })
        } else if (item.type === 'balcony') {
          item.elements.forEach(cell => {
            if (cell.eleType !== 'button' || cell.hidden === 'true' || cell.uuid === uuid) return
            if (!['exec', 'prompt', 'pop'].includes(cell.OpenType)) return
            linkButtons.push({
              value: cell.uuid,
              label: cell.label + '(' + item.name + ')'
            })
          })
        } else if (item.type === 'form') {
          item.subcards.forEach(group => {
            if(group.uuid === uuid) return
            if (item.subcards.length > 1) {
              linkButtons.push({
                value: group.uuid,
                label: group.subButton.label + '(' + item.name + '-' + group.setting.title + ')'
              })
            } else {
              linkButtons.push({
                value: group.uuid,
                label: group.subButton.label + '(' + item.name + ')'
              })
            }
          })
        }
      }
    })
  }
  filterComponent(window.GLOB.customMenu.components)
  let refresh = []
  if (viewType === 'popview') { // 弹窗标签
@@ -400,6 +466,16 @@
      options: anchors
    },
    {
      type: 'select',
      key: 'preButton',
      label: '前置按钮',
      tooltip: '当前按钮执行前,需要执行的按钮。',
      initVal: card.preButton || '',
      required: false,
      allowClear: true,
      options: linkButtons
    },
    {
      type: 'radio',
      key: 'reload',
      label: '上一页',