feat: 头像国际化更新和同步的冲突解决

This commit is contained in:
hujinbin
2025-01-15 20:18:24 +08:00
parent bfd2a1535c
commit 6e0bdcba31
8 changed files with 58 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ const prizeConfig = useStore().prizeConfig
const { getAllPersonList: allPersonList, getNotPersonList: notPersonList, getNotThisPrizePersonList: notThisPrizePersonList,
} = storeToRefs(personConfig)
const { getCurrentPrize: currentPrize } = storeToRefs(prizeConfig)
const { getTopTitle: topTitle, getCardColor: cardColor, getPatterColor: patternColor, getPatternList: patternList, getTextColor: textColor, getLuckyColor: luckyColor, getCardSize: cardSize, getTextSize: textSize, getRowCount: rowCount, getBackground: homeBackground } = storeToRefs(globalConfig)
const { getTopTitle: topTitle, getCardColor: cardColor, getPatterColor: patternColor, getPatternList: patternList, getTextColor: textColor, getLuckyColor: luckyColor, getCardSize: cardSize, getTextSize: textSize, getRowCount: rowCount, getBackground: homeBackground, getIsShowAvatar: isShowAvatar } = storeToRefs(globalConfig)
const tableData = ref<any[]>([])
const currentStatus = ref(0) // 0为初始状态 1为抽奖准备状态2为抽奖中状态3为抽奖结束状态
const ballRotationY = ref(0)
@@ -119,18 +119,30 @@ function init() {
const number = document.createElement('div')
number.className = 'card-id'
number.textContent = tableData.value[i].uid
if(isShowAvatar.value) number.style.display = 'none'
element.appendChild(number)
const symbol = document.createElement('div')
symbol.className = 'card-name'
symbol.textContent = tableData.value[i].name
if(isShowAvatar.value) symbol.className = 'card-name card-avatar-name'
element.appendChild(symbol)
const detail = document.createElement('div')
detail.className = 'card-detail'
detail.innerHTML = `${tableData.value[i].department}<br/>${tableData.value[i].identity}`
if(isShowAvatar.value) detail.style.display = 'none'
element.appendChild(detail)
const avatar = document.createElement('img');
avatar.className = 'card-avatar';
avatar.src = tableData.value[i].avatar;
avatar.alt = 'avatar';
avatar.style.width = '140px';
avatar.style.height = '140px';
if(!isShowAvatar.value) avatar.style.display = 'none'
element.appendChild(avatar);
element = useElementStyle(element, tableData.value[i], i, patternList.value, patternColor.value, cardColor.value, cardSize.value, textSize.value)
const object = new CSS3DObject(element)
object.position.x = Math.random() * 4000 - 2000