LotteryConfig.vue
2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<template>
<el-dialog
:visible="visible"
:append-to-body="true"
title="抽奖配置"
width="400px"
:lock-scroll="true"
@close="$emit('update:visible', false)"
class="c-LotteryConfig"
>
<el-form ref="form" :model="form" label-width="100px" size="mini">
<el-form-item label="抽奖标题">
<el-input v-model="form.name"></el-input>
</el-form-item>
<el-form-item label="抽奖总人数">
<el-input v-model="form.number"></el-input>
</el-form-item>
<el-form-item label="特等奖人数">
<el-input v-model="form.specialAward"></el-input>
</el-form-item>
<el-form-item label="一等奖人数">
<el-input v-model="form.firstPrize"></el-input>
</el-form-item>
<el-form-item label="二等奖人数">
<el-input v-model="form.secondPrize"></el-input>
</el-form-item>
<el-form-item label="三等奖人数">
<el-input v-model="form.thirdPrize"></el-input>
</el-form-item>
<el-form-item label="四等奖人数">
<el-input v-model="form.fourthPrize"></el-input>
</el-form-item>
<el-form-item label="五等奖人数">
<el-input v-model="form.fifthPrize"></el-input>
</el-form-item>
<el-form-item label="追加奖(1)人数">
<el-input v-model="form.additionalPrize1"></el-input>
</el-form-item>
<el-form-item label="追加奖(2)人数">
<el-input v-model="form.additionalPrize2"></el-input>
</el-form-item>
<el-form-item label="追加奖(3)人数">
<el-input v-model="form.additionalPrize3"></el-input>
</el-form-item>
<el-form-item label="追加奖(4)人数">
<el-input v-model="form.additionalPrize4"></el-input>
</el-form-item>
<el-form-item label="追加奖(5)人数">
<el-input v-model="form.additionalPrize5"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">保存配置</el-button>
<el-button @click="$emit('update:visible', false)">取消</el-button>
</el-form-item>
</el-form>
</el-dialog>
</template>
<script>
import { setData, configField } from '@/helper/index';
export default {
name: 'LotteryConfig',
props: {
visible: Boolean
},
computed: {
form: {
get() {
return this.$store.state.config;
},
set(val) {
this.$store.commit('setConfig', val);
}
}
},
methods: {
onSubmit() {
setData(configField, this.form);
this.$emit('update:visible', false);
this.$emit('resetconfig');
this.$message({
message: '保存成功',
type: 'success'
});
}
}
};
</script>
<style lang="scss">
.c-LotteryConfig {
}
</style>