jufubao-admin-library 1.1.11 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -44,6 +44,39 @@
|
|
|
44
44
|
</div> -->
|
|
45
45
|
</el-form-item>
|
|
46
46
|
</el-form>
|
|
47
|
+
</template>
|
|
48
|
+
<template slot="time">
|
|
49
|
+
<el-form-item label="">
|
|
50
|
+
<div class="time_pick" v-for="(item,index) in handTimeOptions" :key="index" style="margin-bottom:5px">
|
|
51
|
+
<el-select
|
|
52
|
+
v-model="item.start"
|
|
53
|
+
placeholder="开始时间"
|
|
54
|
+
clearable
|
|
55
|
+
>
|
|
56
|
+
<el-option
|
|
57
|
+
:key="item.value"
|
|
58
|
+
v-for="item in timeList"
|
|
59
|
+
:label="item.label"
|
|
60
|
+
:value="item.value"
|
|
61
|
+
></el-option>
|
|
62
|
+
</el-select>
|
|
63
|
+
<span class="dis_in_mar10">至</span>
|
|
64
|
+
<el-select
|
|
65
|
+
v-model="item.end"
|
|
66
|
+
placeholder="结束时间"
|
|
67
|
+
clearable
|
|
68
|
+
>
|
|
69
|
+
<el-option
|
|
70
|
+
:key="item.value"
|
|
71
|
+
v-for="item in timeList"
|
|
72
|
+
:label="item.label"
|
|
73
|
+
:value="item.value"
|
|
74
|
+
></el-option>
|
|
75
|
+
</el-select>
|
|
76
|
+
<i v-if="(index + 1) === handTimeOptions.length" class="el-icon-circle-plus ml5" @click="add(item)" ></i>
|
|
77
|
+
<i v-if="handTimeOptions.length > 1" class="el-icon-remove ml5" @click="remove(index)"></i>
|
|
78
|
+
</div>
|
|
79
|
+
</el-form-item>
|
|
47
80
|
</template>
|
|
48
81
|
</xd-base-dynamic-field>
|
|
49
82
|
<div class="adjust-btn" style="margin-left: 140px">
|
|
@@ -92,6 +125,81 @@
|
|
|
92
125
|
{ required: true, message: '请选择标签', trigger: 'change' }
|
|
93
126
|
],
|
|
94
127
|
},
|
|
128
|
+
valueFormat: 'HH',
|
|
129
|
+
pickerOptions: { start: '01',end:'00',step:'01' },
|
|
130
|
+
handTimeOptions:[{start:'',end:''}],
|
|
131
|
+
timeList:[
|
|
132
|
+
{
|
|
133
|
+
lebel:'1',
|
|
134
|
+
value:'1',
|
|
135
|
+
},{
|
|
136
|
+
lebel:'2',
|
|
137
|
+
value:'2',
|
|
138
|
+
},{
|
|
139
|
+
lebel:'3',
|
|
140
|
+
value:'3',
|
|
141
|
+
},{
|
|
142
|
+
lebel:'4',
|
|
143
|
+
value:'4',
|
|
144
|
+
},{
|
|
145
|
+
lebel:'5',
|
|
146
|
+
value:'5',
|
|
147
|
+
},{
|
|
148
|
+
lebel:'6',
|
|
149
|
+
value:'6',
|
|
150
|
+
},{
|
|
151
|
+
lebel:'7',
|
|
152
|
+
value:'7',
|
|
153
|
+
},{
|
|
154
|
+
lebel:'8',
|
|
155
|
+
value:'8',
|
|
156
|
+
},{
|
|
157
|
+
lebel:'9',
|
|
158
|
+
value:'9',
|
|
159
|
+
},{
|
|
160
|
+
lebel:'10',
|
|
161
|
+
value:'10',
|
|
162
|
+
},{
|
|
163
|
+
lebel:'11',
|
|
164
|
+
value:'11',
|
|
165
|
+
},{
|
|
166
|
+
lebel:'12',
|
|
167
|
+
value:'12',
|
|
168
|
+
},{
|
|
169
|
+
lebel:'13',
|
|
170
|
+
value:'13',
|
|
171
|
+
},{
|
|
172
|
+
lebel:'14',
|
|
173
|
+
value:'14',
|
|
174
|
+
},{
|
|
175
|
+
lebel:'15',
|
|
176
|
+
value:'15',
|
|
177
|
+
},{
|
|
178
|
+
lebel:'16',
|
|
179
|
+
value:'16',
|
|
180
|
+
},{
|
|
181
|
+
lebel:'17',
|
|
182
|
+
value:'17',
|
|
183
|
+
},{
|
|
184
|
+
lebel:'18',
|
|
185
|
+
value:'18',
|
|
186
|
+
},{
|
|
187
|
+
lebel:'19',
|
|
188
|
+
value:'19',
|
|
189
|
+
},{
|
|
190
|
+
lebel:'20',
|
|
191
|
+
value:'20',
|
|
192
|
+
},{
|
|
193
|
+
lebel:'21',
|
|
194
|
+
value:'21',
|
|
195
|
+
},{
|
|
196
|
+
lebel:'22',
|
|
197
|
+
value:'22',
|
|
198
|
+
},{
|
|
199
|
+
lebel:'23',
|
|
200
|
+
value:'23',
|
|
201
|
+
},
|
|
202
|
+
]
|
|
95
203
|
}
|
|
96
204
|
},
|
|
97
205
|
computed: {
|
|
@@ -138,6 +246,13 @@
|
|
|
138
246
|
//电影
|
|
139
247
|
if(this.isMovie) {
|
|
140
248
|
formData = this.setMovieForm(res.data)
|
|
249
|
+
if(res.data.valid_week_hours){
|
|
250
|
+
if(!JSON.parse(res.data.valid_week_hours).length){
|
|
251
|
+
this.handTimeOptions = [{start:'',end:''}]
|
|
252
|
+
}else{
|
|
253
|
+
this.handTimeOptions = JSON.parse(res.data.valid_week_hours)
|
|
254
|
+
}
|
|
255
|
+
}
|
|
141
256
|
}
|
|
142
257
|
|
|
143
258
|
//非电影初始化
|
|
@@ -299,6 +414,25 @@
|
|
|
299
414
|
.then(() => {
|
|
300
415
|
const {select_policy_id} = this;
|
|
301
416
|
let postData = this.getSectionParams();
|
|
417
|
+
if(this.handTimeOptions.length){
|
|
418
|
+
let noData = [];
|
|
419
|
+
for(let i=0;i<this.handTimeOptions.length;i++){
|
|
420
|
+
if((!this.handTimeOptions[i]['start']&&this.handTimeOptions[i]['end'])||(this.handTimeOptions[i]['start']&&!this.handTimeOptions[i]['end'])){
|
|
421
|
+
this.$message.error('请选择时间')
|
|
422
|
+
return
|
|
423
|
+
}
|
|
424
|
+
if(this.handTimeOptions[i]['end']<this.handTimeOptions[i]['start']){
|
|
425
|
+
this.$message.error('开始时间不能大于结束时间')
|
|
426
|
+
return
|
|
427
|
+
}
|
|
428
|
+
if(this.handTimeOptions[i]['start']&&this.handTimeOptions[i]['end']){
|
|
429
|
+
postData.valid_week_hours = JSON.stringify(this.handTimeOptions)
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
if(this.handTimeOptions.length==1&&!this.handTimeOptions[0]['start']&&!this.handTimeOptions[0]['end']){
|
|
433
|
+
postData.valid_week_hours = JSON.stringify(noData)
|
|
434
|
+
}
|
|
435
|
+
}
|
|
302
436
|
|
|
303
437
|
let fn = 'createRole';
|
|
304
438
|
let params = {
|
|
@@ -353,7 +487,23 @@
|
|
|
353
487
|
|
|
354
488
|
handleBack(){
|
|
355
489
|
this.$router.back()
|
|
356
|
-
}
|
|
490
|
+
},
|
|
491
|
+
|
|
492
|
+
add(item) {
|
|
493
|
+
console.log(item,this.handTimeOptions,'this.handTimeOptions')
|
|
494
|
+
if(!item.start||!item.end){
|
|
495
|
+
this.$message.error('请选择时间')
|
|
496
|
+
return
|
|
497
|
+
}
|
|
498
|
+
if(this.handTimeOptions.length>=10){
|
|
499
|
+
this.$message.error('最多支持设置10条')
|
|
500
|
+
return
|
|
501
|
+
}
|
|
502
|
+
this.handTimeOptions.push({start:'',end:''});
|
|
503
|
+
},
|
|
504
|
+
remove(index) {
|
|
505
|
+
this.handTimeOptions.splice(index, 1);
|
|
506
|
+
},
|
|
357
507
|
|
|
358
508
|
}
|
|
359
509
|
}
|
|
@@ -420,4 +570,20 @@
|
|
|
420
570
|
.mr10{
|
|
421
571
|
margin-right: 10px;
|
|
422
572
|
}
|
|
573
|
+
.el-icon-circle-plus {
|
|
574
|
+
font-size: 22px;
|
|
575
|
+
color: #42B983;
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
.el-icon-remove {
|
|
579
|
+
font-size: 22px;
|
|
580
|
+
color: #F56C6C;
|
|
581
|
+
}
|
|
582
|
+
.dis_in_mar10{
|
|
583
|
+
display: inline-block;
|
|
584
|
+
margin: 0 10px;
|
|
585
|
+
}
|
|
586
|
+
.ml5{
|
|
587
|
+
margin-left: 5px;
|
|
588
|
+
}
|
|
423
589
|
</style>
|
|
@@ -30,7 +30,16 @@ export default {
|
|
|
30
30
|
if (n && n !== o) {
|
|
31
31
|
this.initForm(this.listValue)
|
|
32
32
|
}
|
|
33
|
-
}
|
|
33
|
+
},
|
|
34
|
+
'listValue.valid_weeks': {
|
|
35
|
+
handler (n, o) {
|
|
36
|
+
console.log(n,o,'pppppp')
|
|
37
|
+
if (n && JSON.stringify(n) !== JSON.stringify(o)) {
|
|
38
|
+
console.log(n, o, 'pppp')
|
|
39
|
+
this.initForm(this.listValue)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
34
43
|
},
|
|
35
44
|
data () {
|
|
36
45
|
return {
|
|
@@ -692,6 +701,11 @@ export default {
|
|
|
692
701
|
{ "label": "星期日", "value": 0 }
|
|
693
702
|
]
|
|
694
703
|
},
|
|
704
|
+
params.valid_weeks && params.valid_weeks.length&&{
|
|
705
|
+
lebel: '',
|
|
706
|
+
ele: 'slot',
|
|
707
|
+
slot:'time'
|
|
708
|
+
},
|
|
695
709
|
{
|
|
696
710
|
label: '按价格:',
|
|
697
711
|
ele: 'xd-input-range',
|