fix: 兼容原有不含配置单次抽奖人数的数据
This commit is contained in:
@@ -174,7 +174,7 @@ onMounted(() => {
|
||||
<input type="file" class="" id="explore" style="display: none" @change="handleFileChange"
|
||||
:accept="limitType" />
|
||||
|
||||
<span class="btn btn-primary btn-sm">上传文件</span>
|
||||
<span class="btn btn-primary btn-sm">导入人员数据</span>
|
||||
</div>
|
||||
</label>
|
||||
<!-- <button class="btn btn-primary btn-sm">上传excel</button> -->
|
||||
|
||||
@@ -67,7 +67,7 @@ const selectPrize = (item: IPrizeConfig) => {
|
||||
const changePrizeStatus=(item:IPrizeConfig)=>{
|
||||
if(item.isUsed==true){
|
||||
item.isUsedCount=0;
|
||||
if(item.separateCount.countList.length){
|
||||
if(item.separateCount&&item.separateCount.countList.length){
|
||||
item.separateCount.countList.forEach((countItem:any)=>{
|
||||
countItem.isUsedCount=0;
|
||||
})
|
||||
@@ -75,7 +75,7 @@ const changePrizeStatus=(item:IPrizeConfig)=>{
|
||||
}
|
||||
else{
|
||||
item.isUsedCount=item.count;
|
||||
if(item.separateCount.countList.length){
|
||||
if(item.separateCount&&item.separateCount.countList.length){
|
||||
item.separateCount.countList.forEach((countItem:any)=>{
|
||||
countItem.isUsedCount=countItem.count;
|
||||
})
|
||||
@@ -206,7 +206,7 @@ watch(() => prizeList.value, (val: IPrizeConfig[]) => {
|
||||
</option>
|
||||
</select>
|
||||
</label>
|
||||
<label class="w-full max-w-xs mb-10 form-control">
|
||||
<label class="w-full max-w-xs mb-10 form-control" v-if="item.separateCount">
|
||||
<div class="label">
|
||||
<span class="label-text">单次抽取个数</span>
|
||||
</div>
|
||||
|
||||
@@ -408,7 +408,7 @@ const stopLottery = async () => {
|
||||
|
||||
let leftover = currentPrize.value.count - currentPrize.value.isUsedCount
|
||||
const customCount=currentPrize.value.separateCount
|
||||
if(customCount.enable&&customCount.countList.length>0){
|
||||
if(customCount&&customCount.enable&&customCount.countList.length>0){
|
||||
for(let i=0;i<customCount.countList.length;i++){
|
||||
if(customCount.countList[i].isUsedCount<customCount.countList[i].count){
|
||||
leftover=customCount.countList[i].count-customCount.countList[i].isUsedCount
|
||||
@@ -466,7 +466,7 @@ const continueLottery = async () => {
|
||||
}
|
||||
|
||||
const customCount=currentPrize.value.separateCount
|
||||
if(customCount.enable&&customCount.countList.length>0){
|
||||
if(customCount&&customCount.enable&&customCount.countList.length>0){
|
||||
for(let i=0;i<customCount.countList.length;i++){
|
||||
if(customCount.countList[i].isUsedCount<customCount.countList[i].count){
|
||||
customCount.countList[i].isUsedCount+= luckyCount.value
|
||||
|
||||
Reference in New Issue
Block a user