king
2024-08-13 7bd04b1c21a59e8d79325f247bdb1726507b51fb
src/utils/utils-custom.js
@@ -703,10 +703,6 @@
  * @return {String}  item 组件信息
  */
  static resetComponentConfig = (item, appType, commonId) => {
    if (item.type === 'navbar') {
      return item
    }
    if (item.subtype === 'tablecard') { // 兼容
      item.type = 'card'
    }
@@ -724,7 +720,22 @@
      item.name = item.setting.name
    }
    if (item.type === 'menubar') {
    if (item.columns) {
      item.columns = item.columns.map(cell => {
        cell.uuid = this.getuuid()
        return cell
      })
    }
    if (item.type === 'navbar') {
      if (appType === 'mob') {
        item.menus.forEach(menu => {
          menu.MenuID = this.getuuid()
        })
        item.wrap.MenuNo = item.wrap.MenuNo + sign
      }
      return item
    } else if (item.type === 'menubar') {
      item.subMenus = item.subMenus.map(cell => {
        cell.uuid = this.getuuid()
        return cell
@@ -923,12 +934,6 @@
      }
    } else if (item.search) {
      item.search = item.search.map(cell => {
        cell.uuid = this.getuuid()
        return cell
      })
    }
    if (item.columns) {
      item.columns = item.columns.map(cell => {
        cell.uuid = this.getuuid()
        return cell
      })
@@ -1799,23 +1804,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 +1836,38 @@
        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') {
      if (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.funcType === 'refund' || cell.funcType === 'pay') && cell.payMode === 'system' && (!cell.verify || !cell.verify.scripts || cell.verify.scripts.filter(item => item.status !== 'false').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}”页面类型设置错误!`})
      } else if (cell.pageTemplate === 'pay' && cell.payMode === 'system' && (!cell.verify || !cell.verify.scripts || cell.verify.scripts.filter(item => item.status !== 'false').length === 0)) {
        errors.push({ level: 0, detail: `按钮“${cell.label}”需添加自定义脚本!`})
      }
    }
  }
@@ -2013,6 +2058,13 @@
    notification.warning({
      top: 92,
      message: `end 后不可紧跟 begin。`,
      duration: 5
    })
    return false
  } else if (/\sdecimal\(8,/ig.test(sql)) {
    notification.warning({
      top: 92,
      message: `不可使用 decimal(8`,
      duration: 5
    })
    return false
@@ -2601,13 +2653,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')) {
@@ -2665,6 +2717,8 @@
        if (item.type === 'navbar') {
          item.uuid = item.uuid.slice(0, 24) + tail
        } else if (item.type === 'login') {
          item.wrap.linkmenu = item.wrap.linkmenu.slice(0, 24) + tail
        } else if (item.type === 'menubar') {
          item.subMenus = item.subMenus.map(cell => {
            if (cell.setting.name && menuDict[cell.setting.name]) {