king
2024-06-21 2bccb9ec7bdefe23292a22bc153463cfa1479a49
src/utils/utils-custom.js
@@ -1799,23 +1799,31 @@
      if (!cell.modal || cell.modal.fields.length === 0) {
        errors.push({ level: 0, detail: `按钮“${cell.label}”中表单尚未添加`})
      }
    } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) {
      errors.push({ level: 0, detail: `按钮“${cell.label}”中导入列未设置!`})
    } else if (cell.OpenType === 'excelIn') {
      if (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0) {
        errors.push({ level: 0, detail: `按钮“${cell.label}”中导入列未设置!`})
      }
    } else if (cell.OpenType === 'excelOut') {
      if (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0) {
        errors.push({ level: 0, detail: `按钮“${cell.label}”中导出列未设置!`})
      } else if (cell.intertype === 'system' && cell.verify.dataType !== 'custom' && card.$c_ds && columns.length > 0) {
        let cols = []
        cell.verify.columns.forEach(col => {
          if (col.output === 'false' || col.Column === '$Index') return
          if (!columns.includes(col.Column)) {
            cols.push(col.Column)
      } else if (cell.intertype === 'system' && cell.verify.dataType !== 'custom') {
        if (!card.setting || card.setting.interType !== 'system') {
          errors.push({ level: 0, detail: `按钮“${cell.label}”需自定义导出数据源!`})
        } else if (card.type === 'balcony' || card.subtype === 'propcard') {
          errors.push({ level: 0, detail: `按钮“${cell.label}”需自定义导出数据源!`})
        } else if (card.$c_ds && columns.length > 0) {
          let cols = []
          cell.verify.columns.forEach(col => {
            if (col.output === 'false' || col.Column === '$Index') return
            if (!columns.includes(col.Column)) {
              cols.push(col.Column)
            }
          })
          if (cols.length) {
            errors.push({ level: 0, detail: `按钮“${cell.label}”中导出列(${cols.join('、')})在字段集中不存在!`})
          }
        })
        if (cols.length) {
          errors.push({ level: 0, detail: `按钮“${cell.label}”中导出列(${cols.join('、')})在字段集中不存在!`})
        }
      }
      }
    }
    if (['pop', 'prompt', 'exec'].includes(cell.OpenType) && cell.verify && !cell.output) {
@@ -1823,6 +1831,32 @@
        errors.push({ level: 0, detail: `按钮“${cell.label}”未设置返回值短信发送无效!`})
      } else if (cell.verify.emailEnable === 'true') {
        errors.push({ level: 0, detail: `按钮“${cell.label}”未设置返回值邮件发送无效!`})
      }
    }
    if (['exec', 'prompt', 'pop', 'form', 'formSubmit'].includes(cell.OpenType)) {
      if (cell.OpenType === 'form' && cell.formType === 'count_line') return
      if (cell.intertype === 'system') {
        if (cell.Ot === 'notRequired' && cell.verify && cell.verify.voucher && cell.verify.voucher.enabled) {
          errors.push({ level: 0, detail: `按钮“${cell.label}”使用了创建凭证函数,需要选择行!`})
        }
      } else if (cell.intertype === 'custom' || cell.intertype === 'outer') {
        if (cell.callbackType === 'script' && (!cell.verify || !cell.verify.cbScripts || !cell.verify.cbScripts.filter(item => item.status !== 'false').length === 0)) {
          errors.push({ level: 0, detail: `按钮“${cell.label}”使用了自定义脚本回调,回调脚本不可为空!`})
        } else if (cell.procMode === 'system' && cell.Ot === 'notRequired' && cell.verify && cell.verify.voucher && cell.verify.voucher.enabled) {
          errors.push({ level: 0, detail: `按钮“${cell.label}”使用了创建凭证函数,需要选择行!`})
        }
      }
    } else if (cell.OpenType === 'funcbutton' && cell.funcType === 'print') {
      if (!cell.verify || !cell.verify.printMode) {
        errors.push({ level: 0, detail: `按钮“${cell.label}”请完善验证信息!`})
      } else if (cell.intertype === 'system' && cell.verify.dataType === 'custom' && (!cell.verify.setting || cell.verify.columns.length === 0)) {
        errors.push({ level: 0, detail: `按钮“${cell.label}”使用了自定义打印数据,请设置数据源!`})
      }
    } else if (cell.OpenType === 'innerpage' || cell.OpenType === 'outerpage') {
      if (!cell.pageTemplate) {
        errors.push({ level: 0, detail: `按钮“${cell.label}”页面类型设置错误!`})
      }
    }
  }
@@ -2601,13 +2635,13 @@
          if (item.wrap.click === 'menu') {
            resetMenu(item.wrap)
          } else if (item.wrap.click === 'menus') {
            resetMenus(config.wrap)
            resetMenus(item.wrap)
          }
        } else if (item.plot && (item.plot.click === 'menu' || item.plot.click === 'menus')) {
          if (item.plot.click === 'menu') {
            resetMenu(item.plot)
          } else if (item.plot.click === 'menus') {
            resetMenus(config.plot)
            resetMenus(item.plot)
          }
        }
        if (item.setting && (!item.wrap || !item.wrap.datatype || item.wrap.datatype === 'dynamic')) {