75e4d4dd by zhangyongfeng

cleardata

1 parent 509663e8
...@@ -32,6 +32,7 @@ input { ...@@ -32,6 +32,7 @@ input {
32 } 32 }
33 body { 33 body {
34 overflow: hidden; 34 overflow: hidden;
35 padding: 0 !important;
35 } 36 }
36 .el-form-item { 37 .el-form-item {
37 margin-bottom: 5px !important; 38 margin-bottom: 5px !important;
...@@ -46,3 +47,8 @@ body { ...@@ -46,3 +47,8 @@ body {
46 -webkit-transform: translateY(-50%); 47 -webkit-transform: translateY(-50%);
47 transform: translateY(-50%); 48 transform: translateY(-50%);
48 } 49 }
50 ::-webkit-scrollbar {
51 width: 5px;
52 height: 5px;
53 background-color: #ccc;
54 }
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
3 :visible="visible" 3 :visible="visible"
4 :append-to-body="true" 4 :append-to-body="true"
5 width="400px" 5 width="400px"
6 :lock-scroll="true"
7 @close="$emit('update:visible', false)" 6 @close="$emit('update:visible', false)"
8 class="c-LotteryConfig" 7 class="c-LotteryConfig"
9 > 8 >
...@@ -19,30 +18,66 @@ ...@@ -19,30 +18,66 @@
19 >取消</el-button 18 >取消</el-button
20 > 19 >
21 </div> 20 </div>
22 <el-form ref="form" :model="form" label-width="100px" size="mini"> 21 <div class="container">
22 <el-form ref="form" :model="form" label-width="90px" size="mini">
23 <el-form-item label="抽奖标题"> 23 <el-form-item label="抽奖标题">
24 <el-input v-model="form.name"></el-input> 24 <el-input v-model="form.name"></el-input>
25 </el-form-item> 25 </el-form-item>
26 <el-form-item label="抽奖总人数"> 26 <el-form-item label="抽奖总人数">
27 <el-input type="number" v-model="form.number"></el-input> 27 <el-input
28 type="number"
29 v-model="form.number"
30 :min="1"
31 :step="1"
32 ></el-input>
28 </el-form-item> 33 </el-form-item>
29 <el-form-item label="特等奖人数"> 34 <el-form-item label="特等奖">
30 <el-input type="number" v-model="form.specialAward"></el-input> 35 <el-input
36 type="number"
37 v-model="form.specialAward"
38 :min="0"
39 :step="1"
40 ></el-input>
31 </el-form-item> 41 </el-form-item>
32 <el-form-item label="一等奖人数"> 42 <el-form-item label="一等奖">
33 <el-input type="number" v-model="form.firstPrize"></el-input> 43 <el-input
44 type="number"
45 v-model="form.firstPrize"
46 :min="0"
47 :step="1"
48 ></el-input>
34 </el-form-item> 49 </el-form-item>
35 <el-form-item label="二等奖人数"> 50 <el-form-item label="二等奖">
36 <el-input type="number" v-model="form.secondPrize"></el-input> 51 <el-input
52 type="number"
53 v-model="form.secondPrize"
54 :min="0"
55 :step="1"
56 ></el-input>
37 </el-form-item> 57 </el-form-item>
38 <el-form-item label="三等奖人数"> 58 <el-form-item label="三等奖">
39 <el-input type="number" v-model="form.thirdPrize"></el-input> 59 <el-input
60 type="number"
61 v-model="form.thirdPrize"
62 :min="0"
63 :step="1"
64 ></el-input>
40 </el-form-item> 65 </el-form-item>
41 <el-form-item label="四等奖人数"> 66 <el-form-item label="四等奖">
42 <el-input type="number" v-model="form.fourthPrize"></el-input> 67 <el-input
68 type="number"
69 v-model="form.fourthPrize"
70 :min="0"
71 :step="1"
72 ></el-input>
43 </el-form-item> 73 </el-form-item>
44 <el-form-item label="五等奖人数"> 74 <el-form-item label="五等奖">
45 <el-input type="number" v-model="form.fifthPrize"></el-input> 75 <el-input
76 type="number"
77 v-model="form.fifthPrize"
78 :min="0"
79 :step="1"
80 ></el-input>
46 </el-form-item> 81 </el-form-item>
47 82
48 <el-form-item 83 <el-form-item
...@@ -52,6 +87,8 @@ ...@@ -52,6 +87,8 @@
52 > 87 >
53 <el-input 88 <el-input
54 type="number" 89 type="number"
90 :min="0"
91 :step="1"
55 v-model="form[newitem.key]" 92 v-model="form[newitem.key]"
56 @change=" 93 @change="
57 val => { 94 val => {
...@@ -61,6 +98,7 @@ ...@@ -61,6 +98,7 @@
61 ></el-input> 98 ></el-input>
62 </el-form-item> 99 </el-form-item>
63 </el-form> 100 </el-form>
101 </div>
64 102
65 <el-dialog 103 <el-dialog
66 :visible.sync="showAddLottery" 104 :visible.sync="showAddLottery"
...@@ -146,7 +184,11 @@ export default { ...@@ -146,7 +184,11 @@ export default {
146 .c-LotteryConfig { 184 .c-LotteryConfig {
147 .el-dialog__body { 185 .el-dialog__body {
148 height: 340px; 186 height: 340px;
187 .container {
188 height: 100%;
149 overflow-y: auto; 189 overflow-y: auto;
190 padding: 0 10px;
191 }
150 } 192 }
151 } 193 }
152 .dialog-showAddLottery { 194 .dialog-showAddLottery {
......
...@@ -26,12 +26,14 @@ ...@@ -26,12 +26,14 @@
26 26
27 <el-form-item label=" " v-if="form.category"> 27 <el-form-item label=" " v-if="form.category">
28 <span> 28 <span>
29 <span class="colorred">{{ config[form.category] }}</span 29 &nbsp;
30 > 30 <span class="colorred">{{ config[form.category] }}</span>
31 &nbsp;
31 </span> 32 </span>
32 <span :style="{ marginLeft: '20px' }"> 33 <span :style="{ marginLeft: '20px' }">
33 剩余<span class="colorred">{{ remain }}</span 34 剩余&nbsp;
34 > 35 <span class="colorred">{{ remain }}</span>
36 &nbsp;
35 </span> 37 </span>
36 </el-form-item> 38 </el-form-item>
37 39
...@@ -133,13 +135,11 @@ export default { ...@@ -133,13 +135,11 @@ export default {
133 }) 135 })
134 .then(() => { 136 .then(() => {
135 clearData(); 137 clearData();
138 this.$store.commit('setClearStore');
136 this.$message({ 139 this.$message({
137 type: 'success', 140 type: 'success',
138 message: '重置成功!' 141 message: '重置成功!'
139 }); 142 });
140 setTimeout(() => {
141 window.location.reload();
142 }, 3000);
143 }) 143 })
144 .catch(() => { 144 .catch(() => {
145 this.$message({ 145 this.$message({
......
...@@ -58,21 +58,6 @@ export function conversionCategoryName(key) { ...@@ -58,21 +58,6 @@ export function conversionCategoryName(key) {
58 case 'fifthPrize': 58 case 'fifthPrize':
59 name = '五等奖'; 59 name = '五等奖';
60 break; 60 break;
61 case 'additionalPrize1':
62 name = '追加奖(1)';
63 break;
64 case 'additionalPrize2':
65 name = '追加奖(2)';
66 break;
67 case 'additionalPrize3':
68 name = '追加奖(3)';
69 break;
70 case 'additionalPrize4':
71 name = '追加奖(4)';
72 break;
73 case 'additionalPrize5':
74 name = '追加奖(5)';
75 break;
76 61
77 default: 62 default:
78 break; 63 break;
......
...@@ -27,6 +27,27 @@ export default new Vuex.Store({ ...@@ -27,6 +27,27 @@ export default new Vuex.Store({
27 newLottery: [] 27 newLottery: []
28 }, 28 },
29 mutations: { 29 mutations: {
30 setClearStore(state) {
31 state.config = {
32 name: '年会抽奖',
33 number: 70,
34 specialAward: 0,
35 firstPrize: 1,
36 secondPrize: 5,
37 thirdPrize: 8,
38 fourthPrize: 10,
39 fifthPrize: 20
40 };
41 state.result = {
42 specialAward: [],
43 firstPrize: [],
44 secondPrize: [],
45 thirdPrize: [],
46 fourthPrize: [],
47 fifthPrize: []
48 };
49 state.newLottery = [];
50 },
30 setConfig(state, config) { 51 setConfig(state, config) {
31 state.config = config; 52 state.config = config;
32 }, 53 },
......