king
2022-10-18 a8507cc8c42d17d4fb854594dbf1e084d61912ac
src/utils/utils-custom.js
@@ -463,6 +463,10 @@
          return cell
        })
      } else if (['card', 'carousel', 'timeline'].includes(item.type) || (item.type === 'table' && item.subtype === 'tablecard')) {
        if (item.wrap.datatype === 'public' && uuids[item.wrap.publicId]) {
          item.wrap.publicId = uuids[item.wrap.publicId]
        }
        item.subcards.forEach(card => {
          card.uuid = this.getuuid()
@@ -503,6 +507,9 @@
          }
        })
      } else if (item.type === 'balcony') {
        if (item.wrap.datatype === 'public' && uuids[item.wrap.publicId]) {
          item.wrap.publicId = uuids[item.wrap.publicId]
        }
        if (item.elements) {
          item.elements = item.elements.map(cell => {
            cell.uuid = this.getuuid()
@@ -693,17 +700,15 @@
  }
  /**
   * @description 数据源名称,用于统一查询
   * @return {String}  name
   * @description 组件名加后缀
   */
  static getdataName () {
  static getSignName () {
    let name = []
    let _options = 'abcdefghigklmnopqrstuvwxyz'
    for (let i = 0; i < 6; i++) {
    for (let i = 0; i < 3; i++) {
      name.push(_options.substr(Math.floor(Math.random() * 26), 1))
    }
    name.splice(3, 0, new Date().getTime())
    return name.join('')
    return (Math.floor(Math.random()*10) + name.join('')).toUpperCase()
  }
  /**
@@ -721,12 +726,8 @@
    item.uuid = _uuid
    if (item.dataName) {
      item.dataName = this.getdataName()
    }
    // 重置组件名称
    let sign = this.getdataName().toUpperCase().substr(-4)
    let sign = this.getSignName()
    if (item.plot) { // 图表
      item.plot.name = item.plot.name + sign
      item.name = item.plot.name