cloud-web-corejs 1.0.54-dev.651 → 1.0.54-dev.653
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/package.json +1 -1
- package/src/components/xform/form-designer/form-widget/field-widget/date-widget.vue +27 -14
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +135 -32
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js +157 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/buttonIcon-editor.vue +14 -15
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +1 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/edit-tree-button-group-config-dialog.vue +1 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/field-button/icon-editor.vue +14 -15
- package/src/components/xform/form-designer/setting-panel/property-editor/field-date/date-dateLimit-editor.vue +157 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/labelIconClass-editor.vue +18 -17
- package/src/components/xform/form-designer/setting-panel/property-editor/labelIconPosition-editor.vue +26 -26
- package/src/components/xform/form-designer/setting-panel/property-editor/labelTooltip-editor.vue +12 -14
- package/src/components/xform/form-designer/setting-panel/property-editor/prefixIcon-editor.vue +14 -15
- package/src/components/xform/form-designer/setting-panel/property-editor/suffixIcon-editor.vue +14 -15
- package/src/components/xform/form-designer/setting-panel/propertyRegister.js +208 -194
- package/src/components/xform/form-designer/widget-panel/widgetsConfig.js +5 -0
- package/src/components/xform/icon-picker/icons.json +284 -0
- package/src/components/xform/icon-picker/index.vue +145 -0
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
:format="field.options.format" :value-format="field.options.valueFormat"
|
|
11
11
|
:placeholder="getI18nLabel(field.options.placeholder || '选择日期')"
|
|
12
12
|
@focus="handleFocusCustomEvent" @blur="handleBlurCustomEvent"
|
|
13
|
-
@change="
|
|
13
|
+
@change="handleDateChangeEvent"
|
|
14
14
|
:picker-options="pickerOptions"
|
|
15
15
|
>
|
|
16
16
|
</el-date-picker>
|
|
@@ -25,11 +25,12 @@ import FormItemWrapper from './form-item-wrapper'
|
|
|
25
25
|
import emitter from '../../../../../components/xform/utils/emitter'
|
|
26
26
|
import i18n from "../../../../../components/xform/utils/i18n";
|
|
27
27
|
import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
|
|
28
|
+
import dateLimitMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin";
|
|
28
29
|
|
|
29
30
|
export default {
|
|
30
31
|
name: "date-widget",
|
|
31
32
|
componentName: 'FieldWidget', //必须固定为FieldWidget,用于接收父级组件的broadcast事件
|
|
32
|
-
mixins: [emitter, fieldMixin, i18n],
|
|
33
|
+
mixins: [emitter, fieldMixin, i18n, dateLimitMixin],
|
|
33
34
|
props: {
|
|
34
35
|
field: Object,
|
|
35
36
|
parentWidget: Object,
|
|
@@ -73,6 +74,20 @@ export default {
|
|
|
73
74
|
return this.fieldModel ? this.fieldModel : ''
|
|
74
75
|
},
|
|
75
76
|
},
|
|
77
|
+
watch: {
|
|
78
|
+
"field.options.limitStartField"() {
|
|
79
|
+
this.initDateLimitPickerOptions();
|
|
80
|
+
},
|
|
81
|
+
"field.options.limitEndField"() {
|
|
82
|
+
this.initDateLimitPickerOptions();
|
|
83
|
+
},
|
|
84
|
+
"field.options.minDate"() {
|
|
85
|
+
this.initDateLimitPickerOptions();
|
|
86
|
+
},
|
|
87
|
+
"field.options.maxDate"() {
|
|
88
|
+
this.initDateLimitPickerOptions();
|
|
89
|
+
},
|
|
90
|
+
},
|
|
76
91
|
beforeCreate() {
|
|
77
92
|
/* 这里不能访问方法和属性!! */
|
|
78
93
|
},
|
|
@@ -86,19 +101,12 @@ export default {
|
|
|
86
101
|
this.buildFieldRules()
|
|
87
102
|
|
|
88
103
|
this.handleOnCreated()
|
|
89
|
-
|
|
90
|
-
if(['year','month','date'].includes(this.field.options.type)){
|
|
91
|
-
this.pickerOptions.shortcuts = [{
|
|
92
|
-
text: this.$t1('此刻'),
|
|
93
|
-
onClick(picker) {
|
|
94
|
-
picker.$emit('pick', new Date());
|
|
95
|
-
}
|
|
96
|
-
}]
|
|
97
|
-
}
|
|
104
|
+
this.initDateLimitPickerOptions()
|
|
98
105
|
},
|
|
99
106
|
|
|
100
107
|
mounted() {
|
|
101
108
|
this.handleOnMounted()
|
|
109
|
+
this.initDateLimitWatch()
|
|
102
110
|
},
|
|
103
111
|
|
|
104
112
|
beforeDestroy() {
|
|
@@ -106,11 +114,16 @@ export default {
|
|
|
106
114
|
},
|
|
107
115
|
|
|
108
116
|
methods: {
|
|
117
|
+
handleDateChangeEvent(value) {
|
|
118
|
+
if (this.isDateLimitViolated(value)) {
|
|
119
|
+
this.$message.warning(this.getDateLimitViolationMessage());
|
|
120
|
+
this.fieldModel = this.oldFieldValue;
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
this.handleChangeEvent(value);
|
|
124
|
+
},
|
|
109
125
|
setNow() {
|
|
110
126
|
this.$refs.fieldEditor.panel.changeToNow()
|
|
111
|
-
/*this.selectedDate = new Date();
|
|
112
|
-
// 可选:点击后自动关闭弹窗
|
|
113
|
-
this.$refs.datePicker.pickerVisible = false;*/
|
|
114
127
|
}
|
|
115
128
|
}
|
|
116
129
|
}
|
|
@@ -22,20 +22,33 @@
|
|
|
22
22
|
</template>
|
|
23
23
|
<template
|
|
24
24
|
v-else-if="
|
|
25
|
-
field.options.widgetTextFlag === 3 &&
|
|
25
|
+
field.options.widgetTextFlag === 3 &&
|
|
26
|
+
field.options.widgetTextLinkConfig
|
|
26
27
|
"
|
|
27
28
|
>
|
|
28
29
|
<div class="ellipsis">
|
|
29
|
-
<a
|
|
30
|
+
<a
|
|
31
|
+
class="a-link"
|
|
32
|
+
:class="getWidgetClass()"
|
|
33
|
+
@click.native="handleClick"
|
|
34
|
+
>
|
|
30
35
|
<span>
|
|
31
36
|
<i
|
|
32
|
-
:class="
|
|
33
|
-
|
|
37
|
+
:class="
|
|
38
|
+
field.options.widgetTextLinkConfig.options.prefixIcon
|
|
39
|
+
"
|
|
40
|
+
v-if="
|
|
41
|
+
!!field.options.widgetTextLinkConfig.options.prefixIcon
|
|
42
|
+
"
|
|
34
43
|
></i>
|
|
35
44
|
<span>{{ getWidgetValue() }}</span>
|
|
36
45
|
<i
|
|
37
|
-
:class="
|
|
38
|
-
|
|
46
|
+
:class="
|
|
47
|
+
field.options.widgetTextLinkConfig.options.suffixIcon
|
|
48
|
+
"
|
|
49
|
+
v-if="
|
|
50
|
+
!!field.options.widgetTextLinkConfig.options.suffixIcon
|
|
51
|
+
"
|
|
39
52
|
></i>
|
|
40
53
|
</span>
|
|
41
54
|
</a>
|
|
@@ -48,10 +61,12 @@
|
|
|
48
61
|
</template>
|
|
49
62
|
<template v-else>
|
|
50
63
|
<el-form-item
|
|
51
|
-
v-if="
|
|
64
|
+
v-if="
|
|
65
|
+
!!field.formItemFlag &&
|
|
66
|
+
(!field.options.hidden || designState === true)
|
|
67
|
+
"
|
|
52
68
|
:label="label"
|
|
53
69
|
:label-width="labelWidth"
|
|
54
|
-
:title="field.options.labelTooltip"
|
|
55
70
|
:rules="getRules()"
|
|
56
71
|
:prop="getPropName()"
|
|
57
72
|
:class="[
|
|
@@ -66,31 +81,46 @@
|
|
|
66
81
|
v-if="!!field.options.labelIconClass"
|
|
67
82
|
slot="label"
|
|
68
83
|
class="custom-label"
|
|
69
|
-
:style="{ color: field.options.labelColor }"
|
|
70
84
|
>
|
|
71
85
|
<template v-if="field.options.labelIconPosition === 'front'">
|
|
72
86
|
<template v-if="!!field.options.labelTooltip">
|
|
73
|
-
<el-tooltip
|
|
87
|
+
<el-tooltip
|
|
88
|
+
:content="field.options.labelTooltip"
|
|
89
|
+
effect="light"
|
|
90
|
+
>
|
|
74
91
|
<i :class="field.options.labelIconClass"></i></el-tooltip
|
|
75
|
-
|
|
92
|
+
><span :style="{ color: field.options.labelColor }">{{
|
|
93
|
+
label
|
|
94
|
+
}}</span></template
|
|
76
95
|
>
|
|
77
96
|
<template v-else>
|
|
78
|
-
<i :class="field.options.labelIconClass"></i
|
|
97
|
+
<i :class="field.options.labelIconClass"></i
|
|
98
|
+
><span :style="{ color: field.options.labelColor }">{{
|
|
99
|
+
label
|
|
100
|
+
}}</span></template
|
|
79
101
|
>
|
|
80
102
|
</template>
|
|
81
103
|
<template v-else-if="field.options.labelIconPosition === 'rear'">
|
|
82
104
|
<template v-if="!!field.options.labelTooltip">
|
|
83
|
-
{{
|
|
84
|
-
|
|
105
|
+
<span :style="{ color: field.options.labelColor }">{{
|
|
106
|
+
label
|
|
107
|
+
}}</span
|
|
108
|
+
><el-tooltip
|
|
109
|
+
:content="field.options.labelTooltip"
|
|
110
|
+
effect="light"
|
|
111
|
+
>
|
|
85
112
|
<i :class="field.options.labelIconClass"></i></el-tooltip
|
|
86
113
|
></template>
|
|
87
114
|
<template v-else>
|
|
88
|
-
|
|
115
|
+
<span :style="{ color: field.options.labelColor }">{{
|
|
116
|
+
label
|
|
117
|
+
}}</span
|
|
118
|
+
><i :class="field.options.labelIconClass"></i
|
|
89
119
|
></template>
|
|
90
120
|
</template>
|
|
91
121
|
</span>
|
|
92
122
|
<span
|
|
93
|
-
v-if="!!field.options.labelColor"
|
|
123
|
+
v-else-if="!!field.options.labelColor"
|
|
94
124
|
slot="label"
|
|
95
125
|
:style="{ color: field.options.labelColor }"
|
|
96
126
|
>
|
|
@@ -101,20 +131,29 @@
|
|
|
101
131
|
</template>
|
|
102
132
|
<template
|
|
103
133
|
v-else-if="
|
|
104
|
-
field.options.widgetTextFlag === 3 &&
|
|
134
|
+
field.options.widgetTextFlag === 3 &&
|
|
135
|
+
field.options.widgetTextLinkConfig
|
|
105
136
|
"
|
|
106
137
|
>
|
|
107
138
|
<div class="ellipsis">
|
|
108
139
|
<a class="a-link" :class="getWidgetClass()" @click="handleClick">
|
|
109
140
|
<span>
|
|
110
141
|
<i
|
|
111
|
-
:class="
|
|
112
|
-
|
|
142
|
+
:class="
|
|
143
|
+
field.options.widgetTextLinkConfig.options.prefixIcon
|
|
144
|
+
"
|
|
145
|
+
v-if="
|
|
146
|
+
!!field.options.widgetTextLinkConfig.options.prefixIcon
|
|
147
|
+
"
|
|
113
148
|
></i>
|
|
114
149
|
<span>{{ getWidgetValue() }}</span>
|
|
115
150
|
<i
|
|
116
|
-
:class="
|
|
117
|
-
|
|
151
|
+
:class="
|
|
152
|
+
field.options.widgetTextLinkConfig.options.suffixIcon
|
|
153
|
+
"
|
|
154
|
+
v-if="
|
|
155
|
+
!!field.options.widgetTextLinkConfig.options.suffixIcon
|
|
156
|
+
"
|
|
118
157
|
></i>
|
|
119
158
|
</span>
|
|
120
159
|
</a>
|
|
@@ -330,7 +369,10 @@ export default {
|
|
|
330
369
|
}
|
|
331
370
|
|
|
332
371
|
this.$nextTick(() => {
|
|
333
|
-
const l = getSubFormNameByFieldId(
|
|
372
|
+
const l = getSubFormNameByFieldId(
|
|
373
|
+
this.designer.widgetList,
|
|
374
|
+
selectedId
|
|
375
|
+
);
|
|
334
376
|
this.parentList.splice(this.indexOfParentList, 1);
|
|
335
377
|
//if (!!nextSelected) {
|
|
336
378
|
this.designer.setSelected(nextSelected);
|
|
@@ -342,7 +384,9 @@ export default {
|
|
|
342
384
|
}
|
|
343
385
|
},
|
|
344
386
|
getIsFormItemUnabled() {
|
|
345
|
-
return
|
|
387
|
+
return (
|
|
388
|
+
this.field.type == "vabUpload" || this.field.type == "baseAttachment"
|
|
389
|
+
);
|
|
346
390
|
},
|
|
347
391
|
getRules() {
|
|
348
392
|
if (this.getIsFormItemUnabled()) {
|
|
@@ -351,15 +395,26 @@ export default {
|
|
|
351
395
|
return this.rules;
|
|
352
396
|
},
|
|
353
397
|
getPropName() {
|
|
354
|
-
if (this.getIsFormItemUnabled()) {
|
|
398
|
+
if (this.formItemProp === "false" || this.getIsFormItemUnabled()) {
|
|
355
399
|
return null;
|
|
356
400
|
}
|
|
357
|
-
if (this.formItemProp) {
|
|
358
|
-
|
|
401
|
+
// if (this.formItemProp) {
|
|
402
|
+
// return this.formItemProp;
|
|
403
|
+
// }
|
|
404
|
+
if (this.tableParam && !this.tableParam.$table?.$parent?.$parent) {
|
|
405
|
+
if (this.formItemProp) {
|
|
406
|
+
return this.formItemProp;
|
|
407
|
+
}
|
|
408
|
+
return null;
|
|
409
|
+
}
|
|
410
|
+
if (this.tableParam && !!this.tableParam.$table?.$parent?.$parent) {
|
|
411
|
+
return this.getColumnProp(this.field, this.tableParam);
|
|
359
412
|
}
|
|
360
413
|
let o = this.field.options.name;
|
|
361
414
|
let propName =
|
|
362
|
-
((o =
|
|
415
|
+
((o =
|
|
416
|
+
(this.field.options.keyNameEnabled && this.field.options.keyName) ||
|
|
417
|
+
o),
|
|
363
418
|
this.subFormItemFlag && !this.designState
|
|
364
419
|
? this.subFormName + "." + this.subFormRowIndex + "." + o
|
|
365
420
|
: this.getObjectFieldFlag() && !this.designState
|
|
@@ -368,6 +423,46 @@ export default {
|
|
|
368
423
|
|
|
369
424
|
return propName;
|
|
370
425
|
},
|
|
426
|
+
getFieldKeyName(widget) {
|
|
427
|
+
let o = widget.options.name;
|
|
428
|
+
return (widget.options.keyNameEnabled && widget.options.keyName) || o;
|
|
429
|
+
},
|
|
430
|
+
isVabsearchFlagWidget(widget) {
|
|
431
|
+
let type = widget?.type;
|
|
432
|
+
return (
|
|
433
|
+
type === "vabsearch" ||
|
|
434
|
+
type === "singerSearch" ||
|
|
435
|
+
type === "multiSearch"
|
|
436
|
+
);
|
|
437
|
+
},
|
|
438
|
+
getColumnProp(rowWidget, obj) {
|
|
439
|
+
let required = rowWidget.options.required || false;
|
|
440
|
+
|
|
441
|
+
let tableRef = obj.$table.$parent.$parent;
|
|
442
|
+
let tableWidget = tableRef.widget;
|
|
443
|
+
let fieldKeyName = this.getFieldKeyName(tableWidget);
|
|
444
|
+
let property = this.getFieldKeyName(rowWidget);
|
|
445
|
+
if (this.isVabsearchFlagWidget(rowWidget)) {
|
|
446
|
+
property = rowWidget.options.vabSearchName || property;
|
|
447
|
+
}
|
|
448
|
+
let rowIndex = Math.max(obj.rowIndex, 0);
|
|
449
|
+
|
|
450
|
+
let isTreeTable = tableWidget.options.isTreeTable || false;
|
|
451
|
+
if (isTreeTable) {
|
|
452
|
+
rowIndex = tableRef
|
|
453
|
+
.getValue()
|
|
454
|
+
.findIndex((item) => item._X_ROW_KEY === obj.row._X_ROW_KEY);
|
|
455
|
+
if (rowIndex < 0) {
|
|
456
|
+
return "false";
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
let propName = fieldKeyName + "." + rowIndex + "." + property;
|
|
461
|
+
if (!required) {
|
|
462
|
+
propName = "false";
|
|
463
|
+
}
|
|
464
|
+
return propName;
|
|
465
|
+
},
|
|
371
466
|
getI18nLabel(label, path, param) {
|
|
372
467
|
return !this.designState && label ? this.$t2(label, path, param) : label;
|
|
373
468
|
},
|
|
@@ -509,7 +604,8 @@ export default {
|
|
|
509
604
|
: [];
|
|
510
605
|
|
|
511
606
|
let flag1 = !item.serveName || item.serveName == bdService;
|
|
512
|
-
let flag2 =
|
|
607
|
+
let flag2 =
|
|
608
|
+
!companyCodes.length || companyCodes.includes(companyCode);
|
|
513
609
|
// let flag3 = !loginAccounts.length || loginAccounts.includes(loginAccount)
|
|
514
610
|
// let flag4 = this.compareToList(saleOrgCodes, saleOrgCodeList)
|
|
515
611
|
if (flag1 && flag2) {
|
|
@@ -543,13 +639,16 @@ export default {
|
|
|
543
639
|
isShowWidget() {
|
|
544
640
|
let widgetTextFlag = this.field.options.widgetTextFlag;
|
|
545
641
|
return (
|
|
546
|
-
widgetTextFlag === undefined ||
|
|
642
|
+
widgetTextFlag === undefined ||
|
|
643
|
+
widgetTextFlag === null ||
|
|
644
|
+
widgetTextFlag === 0
|
|
547
645
|
);
|
|
548
646
|
},
|
|
549
647
|
getShowValue() {
|
|
550
648
|
let widgetTextFlag = this.field.options.widgetTextFlag;
|
|
551
649
|
let fieldModel = this.$parent.fieldModel;
|
|
552
|
-
if (this.$parent.fieldModelLabel)
|
|
650
|
+
if (this.$parent.fieldModelLabel)
|
|
651
|
+
fieldModel = this.$parent.fieldModelLabel();
|
|
553
652
|
let showValue = fieldModel;
|
|
554
653
|
if (widgetTextFlag == 2) {
|
|
555
654
|
showValue = this.getProcessText(showValue, this.encryptFormula);
|
|
@@ -568,13 +667,17 @@ export default {
|
|
|
568
667
|
handleClick(event) {
|
|
569
668
|
if (this.field.options.disabled) return;
|
|
570
669
|
this.$parent.handleButtonWidgetClick(event, true);
|
|
571
|
-
if (
|
|
670
|
+
if (
|
|
671
|
+
!this.designState &&
|
|
672
|
+
this.field.options.widgetTextLinkConfig?.options.href
|
|
673
|
+
) {
|
|
572
674
|
window.open(this.field.options.widgetTextLinkConfig?.options.href);
|
|
573
675
|
}
|
|
574
676
|
},
|
|
575
677
|
getWidgetValue() {
|
|
576
678
|
let fieldModel = this.$parent.fieldModel;
|
|
577
|
-
if (this.$parent.fieldModelLabel)
|
|
679
|
+
if (this.$parent.fieldModelLabel)
|
|
680
|
+
fieldModel = this.$parent.fieldModelLabel();
|
|
578
681
|
return fieldModel;
|
|
579
682
|
},
|
|
580
683
|
},
|
package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js
ADDED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
methods: {
|
|
3
|
+
getDateLimitOptions() {
|
|
4
|
+
return this.field.options || {};
|
|
5
|
+
},
|
|
6
|
+
initDateLimitPickerOptions() {
|
|
7
|
+
const pickerOptions = { ...(this.pickerOptions || {}) };
|
|
8
|
+
if (["year", "month", "date", "datetime"].includes(this.field.options.type)) {
|
|
9
|
+
if (!pickerOptions.shortcuts) {
|
|
10
|
+
pickerOptions.shortcuts = [
|
|
11
|
+
{
|
|
12
|
+
text: this.$t1("此刻"),
|
|
13
|
+
onClick(picker) {
|
|
14
|
+
picker.$emit("pick", new Date());
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
pickerOptions.disabledDate = (time) => this.isDateLimitDisabled(time);
|
|
21
|
+
this.pickerOptions = pickerOptions;
|
|
22
|
+
},
|
|
23
|
+
initDateLimitWatch() {
|
|
24
|
+
if (this.designState) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const { limitStartField, limitEndField } = this.getDateLimitOptions();
|
|
28
|
+
if (limitStartField) {
|
|
29
|
+
this.$watch(
|
|
30
|
+
() => this.getDateLimitLinkedValue(limitStartField),
|
|
31
|
+
() => {
|
|
32
|
+
this.initDateLimitPickerOptions();
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
if (limitEndField) {
|
|
37
|
+
this.$watch(
|
|
38
|
+
() => this.getDateLimitLinkedValue(limitEndField),
|
|
39
|
+
() => {
|
|
40
|
+
this.initDateLimitPickerOptions();
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
getDateLimitDataSource() {
|
|
46
|
+
return this.tableParam && this.tableParam.row
|
|
47
|
+
? this.tableParam.row
|
|
48
|
+
: this.formModel;
|
|
49
|
+
},
|
|
50
|
+
getDateLimitLinkedValue(fieldName) {
|
|
51
|
+
if (!fieldName) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
const dataSource = this.getDateLimitDataSource();
|
|
55
|
+
return dataSource ? dataSource[fieldName] : null;
|
|
56
|
+
},
|
|
57
|
+
parseDateLimitValue(val) {
|
|
58
|
+
if (val === null || val === undefined || val === "") {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const date = new Date(String(val).replace(/-/g, "/"));
|
|
62
|
+
return isNaN(date.getTime()) ? null : date.getTime();
|
|
63
|
+
},
|
|
64
|
+
normalizeDateLimitDayTime(time, isEnd) {
|
|
65
|
+
const date = new Date(time);
|
|
66
|
+
if (this.field.options.type === "datetime") {
|
|
67
|
+
return date.getTime();
|
|
68
|
+
}
|
|
69
|
+
date.setHours(isEnd ? 23 : 0, isEnd ? 59 : 0, isEnd ? 59 : 0, isEnd ? 999 : 0);
|
|
70
|
+
return date.getTime();
|
|
71
|
+
},
|
|
72
|
+
isDateLimitDisabled(time) {
|
|
73
|
+
const options = this.getDateLimitOptions();
|
|
74
|
+
const currentTime = time.getTime();
|
|
75
|
+
|
|
76
|
+
const minDate = this.parseDateLimitValue(options.minDate);
|
|
77
|
+
if (minDate !== null && currentTime < this.normalizeDateLimitDayTime(minDate, false)) {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const maxDate = this.parseDateLimitValue(options.maxDate);
|
|
82
|
+
if (maxDate !== null && currentTime > this.normalizeDateLimitDayTime(maxDate, true)) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (options.limitStartField) {
|
|
87
|
+
const startTime = this.parseDateLimitValue(
|
|
88
|
+
this.getDateLimitLinkedValue(options.limitStartField)
|
|
89
|
+
);
|
|
90
|
+
if (startTime !== null && currentTime < this.normalizeDateLimitDayTime(startTime, false)) {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (options.limitEndField) {
|
|
96
|
+
const endTime = this.parseDateLimitValue(
|
|
97
|
+
this.getDateLimitLinkedValue(options.limitEndField)
|
|
98
|
+
);
|
|
99
|
+
if (endTime !== null && currentTime > this.normalizeDateLimitDayTime(endTime, true)) {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return false;
|
|
105
|
+
},
|
|
106
|
+
isDateLimitViolated(value) {
|
|
107
|
+
if (value === null || value === undefined || value === "") {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
const currentTime = this.parseDateLimitValue(value);
|
|
111
|
+
if (currentTime === null) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const options = this.getDateLimitOptions();
|
|
116
|
+
const minDate = this.parseDateLimitValue(options.minDate);
|
|
117
|
+
if (minDate !== null && currentTime < this.normalizeDateLimitDayTime(minDate, false)) {
|
|
118
|
+
return true;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const maxDate = this.parseDateLimitValue(options.maxDate);
|
|
122
|
+
if (maxDate !== null && currentTime > this.normalizeDateLimitDayTime(maxDate, true)) {
|
|
123
|
+
return true;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (options.limitStartField) {
|
|
127
|
+
const startTime = this.parseDateLimitValue(
|
|
128
|
+
this.getDateLimitLinkedValue(options.limitStartField)
|
|
129
|
+
);
|
|
130
|
+
if (startTime !== null && currentTime < this.normalizeDateLimitDayTime(startTime, false)) {
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (options.limitEndField) {
|
|
136
|
+
const endTime = this.parseDateLimitValue(
|
|
137
|
+
this.getDateLimitLinkedValue(options.limitEndField)
|
|
138
|
+
);
|
|
139
|
+
if (endTime !== null && currentTime > this.normalizeDateLimitDayTime(endTime, true)) {
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return false;
|
|
145
|
+
},
|
|
146
|
+
getDateLimitViolationMessage() {
|
|
147
|
+
const options = this.getDateLimitOptions();
|
|
148
|
+
if (options.limitEndField && !options.limitStartField) {
|
|
149
|
+
return "开始时间不能大于结束时间";
|
|
150
|
+
}
|
|
151
|
+
if (options.limitStartField && !options.limitEndField) {
|
|
152
|
+
return "结束时间不能小于开始时间";
|
|
153
|
+
}
|
|
154
|
+
return "日期超出允许范围";
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
};
|
package/src/components/xform/form-designer/setting-panel/property-editor/buttonIcon-editor.vue
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-form-item :label="i18nt('designer.setting.appendButtonIcon')">
|
|
3
|
-
<
|
|
3
|
+
<icon-picker v-model="optionModel.buttonIcon"></icon-picker>
|
|
4
4
|
</el-form-item>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
8
|
+
import i18n from "@base/components/xform/utils/i18n";
|
|
9
|
+
import IconPicker from "@base/components/xform/icon-picker/index.vue";
|
|
10
|
+
export default {
|
|
11
|
+
name: "buttonIcon-editor",
|
|
12
|
+
components: { IconPicker },
|
|
13
|
+
mixins: [i18n],
|
|
14
|
+
props: {
|
|
15
|
+
designer: Object,
|
|
16
|
+
selectedWidget: Object,
|
|
17
|
+
optionModel: Object,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
19
20
|
</script>
|
|
20
21
|
|
|
21
|
-
<style scoped>
|
|
22
|
-
|
|
23
|
-
</style>
|
|
22
|
+
<style scoped></style>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
@close="handleClose"
|
|
14
14
|
>
|
|
15
15
|
<div class="cont">
|
|
16
|
-
<el-form label-width="
|
|
16
|
+
<el-form label-width="166px" class="edit-tree-button-group-form">
|
|
17
17
|
<el-form-item label="新增按钮唯一名称">
|
|
18
18
|
<el-input
|
|
19
19
|
v-model="row.rowAddAuthName"
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<el-form-item :label="i18nt('designer.setting.buttonIcon')">
|
|
3
|
-
<
|
|
3
|
+
<icon-picker v-model="optionModel.icon"></icon-picker>
|
|
4
4
|
</el-form-item>
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
8
|
+
import i18n from "@base/components/xform/utils/i18n";
|
|
9
|
+
import IconPicker from "@base/components/xform/icon-picker/index.vue";
|
|
10
|
+
export default {
|
|
11
|
+
name: "icon-editor",
|
|
12
|
+
components: { IconPicker },
|
|
13
|
+
mixins: [i18n],
|
|
14
|
+
props: {
|
|
15
|
+
designer: Object,
|
|
16
|
+
selectedWidget: Object,
|
|
17
|
+
optionModel: Object,
|
|
18
|
+
},
|
|
19
|
+
};
|
|
19
20
|
</script>
|
|
20
21
|
|
|
21
|
-
<style scoped>
|
|
22
|
-
|
|
23
|
-
</style>
|
|
22
|
+
<style scoped></style>
|