king
2025-01-01 d53b90757a6449d4a163cf46aabb5a6ed9d41203
src/utils/utils-custom.js
@@ -652,7 +652,7 @@
   */
  static resetBtn (btn, commonId) {
    if (btn.OpenType === 'pop' || (btn.OpenType === 'funcbutton' && btn.execMode === 'pop')) {
      if (btn.modal && btn.modal.fields.length > 0) {
      if (btn.modal && btn.modal.fields && btn.modal.fields.length > 0) {
        btn.modal.fields = btn.modal.fields.map(m => {
          m.uuid = this.getuuid()
          return m
@@ -684,6 +684,10 @@
        return md5(commonId + m)
      })
    }
    if (btn.OpenType === 'popview' && btn.config && btn.config.components) {
      btn.config.components = this.resetConfig(btn.config.components, commonId)
    }
  }
@@ -771,14 +775,7 @@
            if (cell.eleType === 'button') {
              cell.uuid = md5(commonId + cell.uuid)
              if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
                if (cell.modal && cell.modal.fields.length > 0) {
                  cell.modal.fields = cell.modal.fields.map(m => {
                    m.uuid = this.getuuid()
                    return m
                  })
                }
              }
              this.resetBtn(cell, commonId)
            } else {
              cell.uuid = this.getuuid()
            }
@@ -792,14 +789,8 @@
          card.backElements = card.backElements.map(cell => {
            if (cell.eleType === 'button') {
              cell.uuid = md5(commonId + cell.uuid)
              if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
                if (cell.modal && cell.modal.fields.length > 0) {
                  cell.modal.fields = cell.modal.fields.map(m => {
                    m.uuid = this.getuuid()
                    return m
                  })
                }
              }
              this.resetBtn(cell, commonId)
            } else {
              cell.uuid = this.getuuid()
            }
@@ -818,14 +809,8 @@
        item.elements = item.elements.map(cell => {
          if (cell.eleType === 'button') {
            cell.uuid = md5(commonId + cell.uuid)
            if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
              if (cell.modal && cell.modal.fields.length > 0) {
                cell.modal.fields = cell.modal.fields.map(m => {
                  m.uuid = this.getuuid()
                  return m
                })
              }
            }
            this.resetBtn(cell, commonId)
          } else {
            cell.uuid = this.getuuid()
          }
@@ -850,14 +835,7 @@
            col.elements = col.elements.map(cell => {
              cell.uuid = md5(commonId + cell.uuid)
              if (cell.eleType === 'button') {
                if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
                  if (cell.modal && cell.modal.fields.length > 0) {
                    cell.modal.fields = cell.modal.fields.map(m => {
                      m.uuid = this.getuuid()
                      return m
                    })
                  }
                }
                this.resetBtn(cell, commonId)
              }
              return cell
            })
@@ -902,14 +880,7 @@
      }
      item.action = item.action.map(cell => {
        cell.uuid = md5(commonId + cell.uuid)
        if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) {
          if (cell.modal && cell.modal.fields.length > 0) {
            cell.modal.fields = cell.modal.fields.map(m => {
              m.uuid = this.getuuid()
              return m
            })
          }
        }
        this.resetBtn(cell, commonId)
        return cell
      })
@@ -3331,7 +3302,7 @@
          } else if (form.type === 'popSelect') {
            let msg = getPopSelectSql(form)
        
            sqls.push({uuid: form.uuid, type: 'popSource', ...msg})
            sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'popSource', ...msg})
          }
        })
      }
@@ -3374,7 +3345,7 @@
            } else if (form.type === 'popSelect') {
              let msg = getPopSelectSql(form)
          
              sqls.push({uuid: form.uuid, type: 'popSource', ...msg})
              sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'popSource', ...msg})
            }
          })
        }
@@ -3414,7 +3385,9 @@
          })
        }
        filterComponent(cell.config.components, _mainSearch, '-' + cell.label, true)
        let label = (item.name ? '-' + item.name : '') + '-' + cell.label
        filterComponent(cell.config.components, _mainSearch, label, true)
      }
    }
  }
@@ -4707,7 +4680,7 @@
        } else if (['mk_address'].includes(s)) {
          decSql.push(`@mk_address nvarchar(100)`)
        } else if (['mk_deleted'].includes(s)) {
          secSql.push(`@mk_deleted int`)
          decSql.push(`@mk_deleted int`)
        } else {
          decSql.push(`@${s} nvarchar(50)`)
        }
@@ -6450,5 +6423,32 @@
  filterComponent(config.components, _mainSearch)
  let keys = sqls.map(item => item.uuid)
  if (keys.length > Array.from(new Set(keys)).length && !window.GLOB.syscheck) {
    if (window.backend) {
      let m = new Map()
      let n = new Map()
      sqls.forEach(item => {
        if (m.has(item.uuid)) {
          if (!n.has(item.uuid)) {
            window.mkInfo(m.get(item.uuid))
            n.set(item.uuid, true)
          }
          window.mkInfo(item)
        } else {
          m.set(item.uuid, item)
        }
      })
      notification.warning({
        top: 92,
        message: '存在重复的后端脚本ID!',
        duration: 5
      })
    }
    return []
  }
  return sqls
}