ocpview-plus 1.2.0 → 1.2.2
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.
- package/README.md +3 -0
- package/dist/ocpviewplus.min.esm.js +14 -106
- package/dist/ocpviewplus.min.js +2 -2
- package/package.json +1 -1
- package/src/components/datebox/datebox.vue +11 -11
- package/src/components/form/baseform.vue +35 -36
- package/src/components/grid/basegrid.vue +60 -65
- package/src/components/masterplate/base.vue +11 -3
- package/src/components/masterplate/listdetails.vue +1 -142
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<template>
|
|
1
|
+
<template>
|
|
2
2
|
<div v-show="myConfig.visible">
|
|
3
3
|
<DatePicker ref="myControl" v-model="culValue" :options="options" :transfer="myConfig.transfer" :size="myConfig.size" :format="myConfig.format" :placeholder="myConfig.placeholder" :type="myConfig.vtype" clearable :disabled="myConfig.readOnly" @on-change="onChange" @on-open-change="onOpenChange" @keydown.enter.stop="_enterSetFatherValue" style="width:100%" />
|
|
4
4
|
</div>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
props:{
|
|
28
28
|
fatherValue: {
|
|
29
|
-
type: [String, Date],
|
|
29
|
+
type: [String, Date],
|
|
30
30
|
default: null
|
|
31
31
|
}
|
|
32
32
|
},
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
} else {
|
|
47
47
|
this.culValue = new Date(this.value);
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
|
|
50
50
|
});
|
|
51
51
|
},
|
|
52
52
|
watchCustomFatherValue() {
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
this.culValue = new Date(this.value);
|
|
55
55
|
} else{
|
|
56
56
|
this.culValue = null;
|
|
57
|
-
}
|
|
57
|
+
}
|
|
58
58
|
},
|
|
59
59
|
onChange(e) {
|
|
60
60
|
this.value = e;
|
|
@@ -71,12 +71,12 @@
|
|
|
71
71
|
para.value = '';
|
|
72
72
|
} else {
|
|
73
73
|
if (this.myConfig.vtype ==='month') {
|
|
74
|
-
para.value = this.$Method.formatDate(this.culValue,'yyyy-MM-dd');
|
|
74
|
+
para.value = this.$Method.formatDate(this.culValue,'yyyy-MM-dd');
|
|
75
75
|
} else {
|
|
76
76
|
if (this.myConfig.format === 'MM-dd') {
|
|
77
|
-
para.value = this.$Method.formatDate(this.culValue,'
|
|
77
|
+
para.value = this.$Method.formatDate(this.culValue,'MM-dd');
|
|
78
78
|
} else {
|
|
79
|
-
para.value = this.$Method.formatDate(this.culValue,this.myConfig.format);
|
|
79
|
+
para.value = this.$Method.formatDate(this.culValue,this.myConfig.format);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
}
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
disabledDate(date) {
|
|
86
86
|
if (this.myConfig.disabledDate) {
|
|
87
87
|
return this.myConfig.disabledDate(date);
|
|
88
|
-
}
|
|
88
|
+
}
|
|
89
89
|
return false;
|
|
90
90
|
},
|
|
91
91
|
customInit() {
|
|
@@ -116,14 +116,14 @@
|
|
|
116
116
|
_enterSetFatherValue() {
|
|
117
117
|
if (this.value === this.oldValue) {
|
|
118
118
|
if (this.$parent.enterKeyDown) {
|
|
119
|
-
this.$parent.enterKeyDown();
|
|
119
|
+
this.$parent.enterKeyDown();
|
|
120
120
|
}
|
|
121
121
|
} else {
|
|
122
122
|
this.isEnter = true;
|
|
123
123
|
this.setFatherValue();
|
|
124
124
|
}
|
|
125
|
-
|
|
125
|
+
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
|
-
</script>
|
|
129
|
+
</script>
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
} else {
|
|
40
40
|
span = this.myConfig.itemSpan * Number(el.colNum);
|
|
41
41
|
}
|
|
42
|
-
}
|
|
42
|
+
}
|
|
43
43
|
}
|
|
44
44
|
if (span > 24) {
|
|
45
45
|
span = 24;
|
|
@@ -47,7 +47,6 @@
|
|
|
47
47
|
return span;
|
|
48
48
|
},
|
|
49
49
|
initFormItem(el) {
|
|
50
|
-
// el.label = el.label + "::";
|
|
51
50
|
el.status = true;
|
|
52
51
|
// 处理事件
|
|
53
52
|
if (el.valueChanged) {
|
|
@@ -88,7 +87,7 @@
|
|
|
88
87
|
el.data = this.dictData[dictkey];
|
|
89
88
|
}
|
|
90
89
|
}
|
|
91
|
-
}
|
|
90
|
+
}
|
|
92
91
|
// 处理共同属性
|
|
93
92
|
this.setFormItemCommonPro(el);
|
|
94
93
|
return el;
|
|
@@ -109,16 +108,16 @@
|
|
|
109
108
|
this.items.push(item);
|
|
110
109
|
});
|
|
111
110
|
}
|
|
112
|
-
|
|
111
|
+
|
|
113
112
|
if (this.customInit){
|
|
114
113
|
this.customInit();
|
|
115
114
|
}
|
|
116
115
|
Object.assign(this.form , this.initForm);
|
|
117
|
-
Object.assign(this.oldForm , this.form);
|
|
116
|
+
Object.assign(this.oldForm , this.form);
|
|
118
117
|
},
|
|
119
|
-
|
|
118
|
+
|
|
120
119
|
setData(obj) {
|
|
121
|
-
if (obj) {
|
|
120
|
+
if (obj) {
|
|
122
121
|
this.$refs.form.resetFields();
|
|
123
122
|
if (obj.flag === 'I') {
|
|
124
123
|
this.form = Object.assign({}, this.initForm, obj);
|
|
@@ -149,7 +148,7 @@
|
|
|
149
148
|
}
|
|
150
149
|
this.oldForm = this.$Method.copy(this.form);
|
|
151
150
|
}
|
|
152
|
-
},
|
|
151
|
+
},
|
|
153
152
|
isChange () {
|
|
154
153
|
if (JSON.stringify(this.form) !== JSON.stringify(this.oldForm)) {
|
|
155
154
|
return true;
|
|
@@ -172,12 +171,12 @@
|
|
|
172
171
|
}
|
|
173
172
|
if (obj.sname) {
|
|
174
173
|
temp[obj.sname] = obj.svalue;
|
|
175
|
-
}
|
|
174
|
+
}
|
|
176
175
|
if (obj.ename) {
|
|
177
176
|
temp[obj.ename] = obj.evalue;
|
|
178
|
-
}
|
|
177
|
+
}
|
|
179
178
|
this.form = Object.assign({}, this.form, temp);
|
|
180
|
-
this.$emit('inputValue', obj);
|
|
179
|
+
this.$emit('inputValue', obj);
|
|
181
180
|
},
|
|
182
181
|
validatorIsNull(rule, value, callbacks) {
|
|
183
182
|
if (this.isArrayFn(this.form[rule.field])) {
|
|
@@ -271,8 +270,8 @@
|
|
|
271
270
|
}
|
|
272
271
|
});
|
|
273
272
|
}
|
|
274
|
-
|
|
275
|
-
|
|
273
|
+
|
|
274
|
+
|
|
276
275
|
},
|
|
277
276
|
isError() {
|
|
278
277
|
return this.errorFlag;
|
|
@@ -293,7 +292,7 @@
|
|
|
293
292
|
trigger = 'change';
|
|
294
293
|
break;
|
|
295
294
|
}
|
|
296
|
-
return trigger;
|
|
295
|
+
return trigger;
|
|
297
296
|
},
|
|
298
297
|
getValue(name) {
|
|
299
298
|
return this.form[name];
|
|
@@ -343,7 +342,7 @@
|
|
|
343
342
|
} else {
|
|
344
343
|
this.setReadOnly(name,value);
|
|
345
344
|
}
|
|
346
|
-
|
|
345
|
+
|
|
347
346
|
});
|
|
348
347
|
},
|
|
349
348
|
setPro(name,value) {
|
|
@@ -373,7 +372,7 @@
|
|
|
373
372
|
if (el.type === 'PopTagBox' ){
|
|
374
373
|
let updateData = [];
|
|
375
374
|
let oldData = this.oldForm[el.name];
|
|
376
|
-
let newData = this.$Method.copy(form[el.name]);
|
|
375
|
+
let newData = this.$Method.copy(form[el.name]);
|
|
377
376
|
if (oldData && oldData.length > 0) {
|
|
378
377
|
oldData.forEach(el2 =>{
|
|
379
378
|
if (el2.ph_key) {
|
|
@@ -400,13 +399,13 @@
|
|
|
400
399
|
updateData.push(el);
|
|
401
400
|
});
|
|
402
401
|
}
|
|
403
|
-
form[el.name] = updateData;
|
|
402
|
+
form[el.name] = updateData;
|
|
404
403
|
}
|
|
405
|
-
|
|
404
|
+
|
|
406
405
|
});
|
|
407
406
|
}
|
|
408
407
|
return form;
|
|
409
|
-
|
|
408
|
+
|
|
410
409
|
},
|
|
411
410
|
setCommonRequired(name,value,config) {
|
|
412
411
|
let ename = '';
|
|
@@ -418,26 +417,26 @@
|
|
|
418
417
|
if (value === true) {
|
|
419
418
|
this.formRules[ename] = [{
|
|
420
419
|
required: true,
|
|
421
|
-
validator: this.validatorIsNull,
|
|
422
|
-
trigger: this.getTrigger(config.type)
|
|
420
|
+
validator: this.validatorIsNull,
|
|
421
|
+
trigger: this.getTrigger(config.type)
|
|
423
422
|
}];
|
|
424
|
-
}
|
|
423
|
+
}
|
|
425
424
|
} else {
|
|
426
425
|
if (!value) {
|
|
427
426
|
delete this.formRules[ename];
|
|
428
427
|
}
|
|
429
428
|
}
|
|
430
429
|
}
|
|
431
|
-
|
|
430
|
+
|
|
432
431
|
if (this.formRules[name] === undefined) {
|
|
433
432
|
if (value === true) {
|
|
434
433
|
this.formRules[name] = [{
|
|
435
434
|
required: true,
|
|
436
|
-
validator: this.validatorIsNull,
|
|
437
|
-
trigger: this.getTrigger(config.type)
|
|
435
|
+
validator: this.validatorIsNull,
|
|
436
|
+
trigger: this.getTrigger(config.type)
|
|
438
437
|
}];
|
|
439
438
|
return true;
|
|
440
|
-
}
|
|
439
|
+
}
|
|
441
440
|
} else {
|
|
442
441
|
if (!value) {
|
|
443
442
|
delete this.formRules[name];
|
|
@@ -458,7 +457,7 @@
|
|
|
458
457
|
this.items[index].status = true;
|
|
459
458
|
});
|
|
460
459
|
}
|
|
461
|
-
|
|
460
|
+
|
|
462
461
|
}
|
|
463
462
|
},
|
|
464
463
|
updateCommonConfig(name, config) {
|
|
@@ -502,7 +501,7 @@
|
|
|
502
501
|
this.$refs[obj[index].name][0].reset();
|
|
503
502
|
}
|
|
504
503
|
this.updateConfigReset(index+1,obj);
|
|
505
|
-
});
|
|
504
|
+
});
|
|
506
505
|
});
|
|
507
506
|
} else {
|
|
508
507
|
this.$nextTick(() => {
|
|
@@ -511,9 +510,9 @@
|
|
|
511
510
|
if (this.$refs[obj[index].name] && this.$refs[obj[index].name].length > 0) {
|
|
512
511
|
this.$refs[obj[index].name][0].reset();
|
|
513
512
|
}
|
|
514
|
-
});
|
|
513
|
+
});
|
|
515
514
|
});
|
|
516
|
-
|
|
515
|
+
|
|
517
516
|
}
|
|
518
517
|
},
|
|
519
518
|
updateItemsConfig(obj) {
|
|
@@ -525,11 +524,11 @@
|
|
|
525
524
|
updateConfig.push(temp);
|
|
526
525
|
}
|
|
527
526
|
});
|
|
528
|
-
|
|
527
|
+
|
|
529
528
|
if (updateConfig.length > 0) {
|
|
530
529
|
this.updateConfigReset(0,updateConfig);
|
|
531
530
|
}
|
|
532
|
-
|
|
531
|
+
|
|
533
532
|
}
|
|
534
533
|
},
|
|
535
534
|
clearData() {
|
|
@@ -581,7 +580,7 @@
|
|
|
581
580
|
let min = '';
|
|
582
581
|
if (el.min !== undefined) {
|
|
583
582
|
min = el.min;
|
|
584
|
-
}
|
|
583
|
+
}
|
|
585
584
|
if (el.smin !== undefined) {
|
|
586
585
|
min = el.smin;
|
|
587
586
|
}
|
|
@@ -608,8 +607,8 @@
|
|
|
608
607
|
if (this.formRules[name] === undefined) {
|
|
609
608
|
this.formRules[name] = [{
|
|
610
609
|
required: true,
|
|
611
|
-
validator: this.validatorIsNull,
|
|
612
|
-
trigger: this.getTrigger(el.type)
|
|
610
|
+
validator: this.validatorIsNull,
|
|
611
|
+
trigger: this.getTrigger(el.type)
|
|
613
612
|
}];
|
|
614
613
|
}
|
|
615
614
|
} else {
|
|
@@ -675,4 +674,4 @@
|
|
|
675
674
|
},
|
|
676
675
|
}
|
|
677
676
|
};
|
|
678
|
-
</script>
|
|
677
|
+
</script>
|