Commit 4894f7b8 by zhangyongfeng

Increase the total number of configurable draws

parent d1c9d488
......@@ -4,6 +4,11 @@
## 使用说明
### 配置建议
- 本程序理论支持配置百万级别人数,超过 10 万以上时初始化会比较耗时,初始化后可以正常抽奖。
- 如果人数较多,不建议导入名单或照片,按号码抽奖即可。
### 抽奖配置
- 设置抽奖总人数、奖项及每个奖项的人数,默认包含两个奖项,如果不想抽取默认的奖项,可以设置该奖项数量为 0
......
......@@ -16,8 +16,7 @@
<a
href="javascript:void(0);"
:style="{
color:
!running && allresult.includes(item.key) ? '#ff2200' : '#fff'
color: '#fff'
}"
>
{{ item.name ? item.name : item.key }}
......@@ -173,17 +172,20 @@ export default {
return allresult;
},
datas() {
const datas = [];
for (let index = 1; index <= this.config.number; index++) {
const listData = this.list.find(d => d.key === index);
const photo = this.photos.find(d => d.id === index);
datas.push({
key: index,
const { number } = this.config;
const nums = number >= 1500 ? 500 : this.config.number;
const configNum = number > 1500 ? Math.floor(number / 3) : number;
const randomShowNums = luckydrawHandler(configNum, [], nums);
const randomShowDatas = randomShowNums.map(item => {
const listData = this.list.find(d => d.key === item);
const photo = this.photos.find(d => d.id === item);
return {
key: item * (number > 1500 ? 3 : 1),
name: listData ? listData.name : '',
photo: photo ? photo.value : ''
};
});
}
return datas;
return randomShowDatas;
},
categoryName() {
return conversionCategoryName(this.category);
......
......@@ -92,7 +92,8 @@ export default {
return this.$store.state.config;
},
set(val) {
this.$store.commit('setConfig', val);
// this.$store.commit('setConfig', val);
return val;
}
},
storeNewLottery() {
......@@ -108,6 +109,7 @@ export default {
methods: {
onSubmit() {
setData(configField, this.form);
this.$store.commit('setConfig', this.form);
this.$emit('update:visible', false);
this.$message({
......
......@@ -61,6 +61,10 @@ export default {
margin: 0 auto;
position: relative;
overflow: hidden;
.el-carousel {
width: 80vw;
margin: 0 auto;
}
.item {
text-align: center;
color: #fff;
......
......@@ -111,7 +111,7 @@ export default {
</script>
<style lang="scss">
.c-Result {
.el-dialog__body{
.el-dialog__body {
max-height: 500px;
overflow-y: auto;
}
......@@ -127,9 +127,9 @@ export default {
}
.card {
display: inline-block;
width: 40px;
height: 40px;
line-height: 40px;
// width: 40px;
padding: 0 5px;
line-height: 30px;
text-align: center;
font-size: 18px;
font-weight: bold;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment