From e8edfdadb561cd83bf6e1c3e00d55b8cc2aee6d5 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 17 十月 2022 17:57:34 +0800 Subject: [PATCH] 2022-10-17 --- src/utils/utils-custom.js | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index fa7a65b..e667b47 100644 --- a/src/utils/utils-custom.js +++ b/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 -- Gitblit v1.8.0