cloud-web-corejs 1.0.258 → 1.0.260
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 +32 -25
- package/src/components/VabUpload/fileLibraryDialog.vue +296 -0
- package/src/components/VabUpload/index.js +22 -2
- package/src/components/VabUpload/index.vue +242 -231
- package/src/components/VabUpload/mixins/fileLibraryDialog.js +1112 -0
- package/src/components/VabUpload/mixins.js +1971 -1829
- package/src/components/VabUpload/privateProfileDialog.vue +2 -2
- package/src/components/baseArea/index.vue +1628 -0
- package/src/components/baseInputExport/mixins.js +48 -31
- package/src/components/baseInputNumber/index.vue +9 -9
- package/src/components/baseTabs/index.vue +16 -8
- package/src/components/code-editor/async.js +29 -0
- package/src/components/code-editor/index.vue +93 -4
- package/src/components/errorMsg/index.js +10 -9
- package/src/components/errorMsg/mixins.js +25 -23
- package/src/components/excelExport/exportFieldDialog.vue +40 -18
- package/src/components/excelExport/index.js +62 -3
- package/src/components/excelExport/index.vue +2 -1
- package/src/components/excelExport/mixins.js +496 -340
- package/src/components/excelImport/index.js +69 -7
- package/src/components/excelImport/mixins.js +841 -9
- package/src/components/fileLibrary/categoryMoveDialog.vue +109 -109
- package/src/components/fileLibrary/fileHistoryDialog.vue +1 -1
- package/src/components/fileLibrary/fileObjAuthDialog.vue +297 -298
- package/src/components/fileLibrary/fileObjAuthEdit.vue +1 -1
- package/src/components/fileLibrary/filterDialog.vue +1 -1
- package/src/components/fileLibrary/index.vue +1109 -1110
- package/src/components/fileLibrary/mixins/indexMixins.js +10 -0
- package/src/components/fileLibrary/propertiesDialog.vue +190 -190
- package/src/components/fileLibrary/recycleBinDialog.vue +237 -236
- package/src/components/formOplog/mixins.js +85 -80
- package/src/components/hiprint/view/design/index.vue +7 -2
- package/src/components/jsonImport/exportUtil.js +106 -0
- package/src/components/jsonImport/index.js +75 -50
- package/src/components/jsonImport/mixins.js +350 -348
- package/src/components/langImport/mixins.js +502 -500
- package/src/components/micro-view-host/contract.js +66 -0
- package/src/components/micro-view-host/index.vue +148 -0
- package/src/components/mobile/file/index.vue +10 -0
- package/src/components/mobile/wf/mixins/wfModifyDialogMixin.js +51 -47
- package/src/components/obsUpload/index.vue +234 -231
- package/src/components/obsUpload/mixins.js +1542 -1476
- package/src/components/onlineTalk/talkUserDialog.vue +1 -1
- package/src/components/table/CellSlot.vue +12 -10
- package/src/components/table/config.js +74 -1
- package/src/components/table/index.js +1209 -1
- package/src/components/table/tableForm.vue +4 -2
- package/src/components/table/tableFormMixin.js +285 -1
- package/src/components/table/util/index.js +38 -40
- package/src/components/table/vxeFilter/index.js +153 -2
- package/src/components/table/vxeFilter/mixin.js +305 -3
- package/src/components/tempStorage/tempStorageDialog.vue +1 -1
- package/src/components/vb-tabs/x-tabs.vue +10 -5
- package/src/components/wf/addTaskUserdialog.vue +1 -1
- package/src/components/wf/mixins/setCandidateDialog.js +217 -217
- package/src/components/wf/mixins/setCandidateDialog2.js +252 -252
- package/src/components/wf/wf.js +2224 -2203
- package/src/components/wf/wfUtil.js +2 -1
- package/src/components/xform/docs/2026-08 /345/210/227/350/241/250/345/257/274/345/207/272/350/204/261/346/225/217/345/210/227/345/211/224/351/231/244/350/220/275/345/234/260/346/226/207/346/241/243.md" +173 -0
- package/src/components/xform/form-designer/designer.js +1 -0
- package/src/components/xform/form-designer/form-widget/container-widget/containerMixin.js +110 -1
- package/src/components/xform/form-designer/form-widget/container-widget/data-table-mixin.js +282 -1
- package/src/components/xform/form-designer/form-widget/field-widget/area-select-widget.vue +272 -0
- package/src/components/xform/form-designer/form-widget/field-widget/autocomplete-widget.vue +119 -0
- package/src/components/xform/form-designer/form-widget/field-widget/fieldMixin.js +14 -0
- package/src/components/xform/form-designer/form-widget/field-widget/form-item-wrapper.vue +18 -73
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/autocomplete-mixin.js +451 -0
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/date-limit-mixin.js +157 -0
- package/src/components/xform/form-designer/form-widget/field-widget/mixins/utc-transform-mixin.js +75 -0
- package/src/components/xform/form-designer/form-widget/field-widget/save_submit_wf_button-widget.vue +112 -0
- package/src/components/xform/form-designer/form-widget/field-widget/script-input-widget.vue +149 -0
- package/src/components/xform/form-designer/form-widget/indexMixin.js +179 -1
- package/src/components/xform/form-designer/indexMixin.js +823 -1
- package/src/components/xform/form-designer/refMixinDesign.js +27 -1
- package/src/components/xform/form-designer/setting-panel/action-button-config-dialog.vue +241 -0
- package/src/components/xform/form-designer/setting-panel/form-dynamicField-setting.vue +601 -0
- package/src/components/xform/form-designer/setting-panel/form-setting.vue +6 -0
- package/src/components/xform/form-designer/setting-panel/index.vue +314 -309
- package/src/components/xform/form-designer/setting-panel/indexMixin.js +324 -1
- package/src/components/xform/form-designer/setting-panel/property-editor/container-data-table/data-table-editor.vue +8 -7
- package/src/components/xform/form-designer/setting-panel/property-editor/container-list-h5/list-h5-editor.vue +8 -7
- package/src/components/xform/form-designer/setting-panel/property-editor/container-table/table-dynamicField-editor.vue +344 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/dropdownFlag-editor.vue +2 -2
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaDataType-editor.vue +25 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaMinLevel-editor.vue +50 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-area-select/areaName-editor.vue +20 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-autocomplete/autocomplete-vabSearchName-editor.vue +199 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-baseAttachment/baseAttachment-fileTypes-editor.vue +23 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-cascader/showAllLevels-editor.vue +21 -0
- 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/field-script-input/script-input-editor.vue +55 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/field-vabUpload/vabUpload-fileTypes-editor.vue +23 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/fileTypesEditorMixin.js +116 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/fileTypesSelect.vue +176 -0
- package/src/components/xform/form-designer/setting-panel/property-editor/textFlag-editor.vue +3 -3
- package/src/components/xform/form-designer/setting-panel/property-editor/utcTransformEnabled-editor.vue +19 -0
- package/src/components/xform/form-designer/setting-panel/widgetPropertyDialogMixin.js +186 -0
- package/src/components/xform/form-designer/toolbar-panel/indexMixin.js +566 -1
- package/src/components/xform/form-designer/widget-panel/indexMixin.js +290 -1
- package/src/components/xform/form-render/compareDelList.vue +83 -0
- package/src/components/xform/form-render/compareView.vue +76 -0
- package/src/components/xform/form-render/container-item/containerItemMixin.js +378 -1
- package/src/components/xform/form-render/container-item/data-table-mixin.js +35 -0
- package/src/components/xform/form-render/container-item/detail-item.vue +41 -0
- package/src/components/xform/form-render/container-item/dynamicFieldEngine.js +285 -0
- package/src/components/xform/form-render/container-item/dynamicFieldMixin.js +416 -0
- package/src/components/xform/form-render/container-item/list-h5-item.vue +12 -0
- package/src/components/xform/form-render/dynamicDialogRender.js +195 -1
- package/src/components/xform/form-render/dynamicDrawerRender.js +229 -0
- package/src/components/xform/form-render/formDynamicFieldMixin.js +131 -0
- package/src/components/xform/form-render/refMixin.js +29 -1
- package/src/components/xform/mixins/scriptHttp.js +172 -1
- package/src/components/xform/utils/dynamicSchemaUtil.js +361 -0
- package/src/components/xform/utils/tableCellValidateUtil.js +148 -0
- package/src/components/xform/utils/textMaskUtil.js +179 -0
- package/src/components/xform/utils/treeTableUtil.js +1265 -0
- package/src/components/xform/utils/util.js +1 -0
- package/src/components/xform/utils/validators.js +133 -1
- package/src/directive/LimitNumber/index.js +143 -124
- package/src/microRouter/index.js +447 -0
- package/src/mixins/tableTree/index.js +77 -14
- package/src/permission.js +132 -107
- package/src/public-path.js +38 -0
- package/src/router/index.js +3 -3
- package/src/store/modules/micro.js +57 -0
- package/src/store/modules/permission.js +535 -371
- package/src/store/modules/tagsView.js +38 -21
- package/src/store/modules/user.js +409 -370
- package/src/utils/aes.js +9 -3
- package/src/utils/auth.js +1 -1
- package/src/utils/componentDialog.js +162 -40
- package/src/utils/global.js +35 -34
- package/src/utils/index.js +579 -579
- package/src/utils/keepAlive.js +8 -4
- package/src/utils/lazyPlugin.js +66 -0
- package/src/utils/menuAdapter.js +277 -0
- package/src/utils/repeatOpen.js +48 -0
- package/src/utils/request.js +417 -395
- package/src/utils/resolveViewComponent.js +203 -0
- package/src/utils/vab.js +14 -3
- package/src/utils/validate.js +104 -106
- package/src/views/bd/setting/bd_attach_setting/dialog.vue +1 -1
- package/src/views/bd/setting/bd_attach_setting/list.vue +1 -1
- package/src/views/bd/setting/bd_company_env/dialog.vue +1 -1
- package/src/views/bd/setting/bd_company_env/list.vue +1 -1
- package/src/views/bd/setting/formVersion/ftHistoryDialog.vue +488 -489
- package/src/views/bd/setting/form_import_log/list.vue +1 -1
- package/src/views/bd/setting/form_script/dialog.vue +1 -1
- package/src/views/bd/setting/form_script/form_list.vue +174 -166
- package/src/views/bd/setting/form_script/list.vue +1 -1
- package/src/views/bd/setting/form_script/list1.vue +1 -1
- package/src/views/bd/setting/form_script/mixins/form_list.js +330 -322
- package/src/views/bd/setting/form_template/dialog.vue +1 -1
- package/src/views/bd/setting/form_template/formDesignerDialog.vue +172 -171
- package/src/views/bd/setting/form_template/ftHistoryDialog.vue +1 -1
- package/src/views/bd/setting/form_template/itemList.vue +1 -1
- package/src/views/bd/setting/form_template/list.vue +3 -3
- package/src/views/bd/setting/form_template/mixins/edit.js +3 -3
- package/src/views/bd/setting/form_template/mixins/list.js +3 -3
- package/src/views/bd/setting/form_template/mixins/list2.js +3 -3
- package/src/views/bd/setting/form_template/mixins/wf_list.js +3 -3
- package/src/views/bd/setting/form_template/wfObjConfigDialog.vue +253 -254
- package/src/views/bd/setting/form_template/wf_list.vue +3 -3
- package/src/views/bd/setting/logic_param/edit.vue +20 -20
- package/src/views/bd/setting/logic_param/list.vue +1 -1
- package/src/views/bd/setting/menu_kind/dialog.vue +1 -1
- package/src/views/bd/setting/menu_kind/list.vue +1 -1
- package/src/views/bd/setting/push_data/list.vue +1 -1
- package/src/views/bd/setting/push_data_h/list.vue +1 -1
- package/src/views/bd/setting/request_async_setting/list.vue +1 -1
- package/src/views/bd/setting/request_setting/list.vue +1 -1
- package/src/views/bd/setting/table_model/dialog.vue +1 -1
- package/src/views/bd/setting/table_model/list.vue +1 -1
- package/src/views/bd/setting/table_model/zdDialog.vue +1 -1
- package/src/views/user/access_log/list.vue +1 -1
- package/src/views/user/access_log/list2.vue +1 -1
- package/src/views/user/api_request/list.vue +1 -1
- package/src/views/user/area/dialog.vue +1 -1
- package/src/views/user/area/list.vue +1 -1
- package/src/views/user/bill_setting/list.vue +1 -1
- package/src/views/user/bill_setting/userDialog.vue +1 -1
- package/src/views/user/code_rules/list.vue +1 -1
- package/src/views/user/commMenu/index.vue +2 -2
- package/src/views/user/common_attribute/list.vue +2 -2
- package/src/views/user/common_script/list.vue +1 -1
- package/src/views/user/company_info/dialog.vue +1 -1
- package/src/views/user/country/dialog.vue +1 -1
- package/src/views/user/country/list.vue +1 -1
- package/src/views/user/data_type_setting/dialog.vue +1 -1
- package/src/views/user/extend_datasource/dialog.vue +4 -1
- package/src/views/user/extend_datasource/edit.vue +2 -1
- package/src/views/user/extend_datasource/list.vue +4 -1
- package/src/views/user/fieldTranslation/list.vue +1 -1
- package/src/views/user/field_values_invisible/list.vue +1 -1
- package/src/views/user/file_type/list.vue +1 -1
- package/src/views/user/file_view_area/list.vue +1 -1
- package/src/views/user/file_view_ins/list.vue +22 -1
- package/src/views/user/form/view/list.vue +64 -1
- package/src/views/user/groups/dialog.vue +1 -1
- package/src/views/user/groups/list.vue +1 -1
- package/src/views/user/home/default.vue +2 -2
- package/src/views/user/home/default2.vue +1158 -1148
- package/src/views/user/home/index.vue +3 -10
- package/src/views/user/lang_tag/dialog.vue +1 -1
- package/src/views/user/lang_tag/list.vue +1 -1
- package/src/views/user/language_setting/list.vue +1 -1
- package/src/views/user/login/default.vue +0 -8
- package/src/views/user/login/indexMixin.js +547 -556
- package/src/views/user/menu/list.vue +25 -2
- package/src/views/user/menuFallback/index.vue +123 -0
- package/src/views/user/mobile_menu/list.vue +1 -1
- package/src/views/user/notify_message/dialog.vue +22 -1
- package/src/views/user/notify_message/list.vue +1 -1
- package/src/views/user/notify_template/list.vue +1 -1
- package/src/views/user/notify_template/list2.vue +1 -1
- package/src/views/user/oplog/list.vue +1 -1
- package/src/views/user/outLink/form_view.vue +5 -14
- package/src/views/user/outLink/index.vue +6 -1
- package/src/views/user/outLink/view.vue +5 -13
- package/src/views/user/position/dialog.vue +1 -1
- package/src/views/user/position/list.vue +1 -1
- package/src/views/user/project_tag/dialog.vue +1 -1
- package/src/views/user/project_tag/list.vue +1 -1
- package/src/views/user/push_setting/list.vue +1 -1
- package/src/views/user/request_setting/list.vue +1 -1
- package/src/views/user/role/dialog.vue +1 -1
- package/src/views/user/role/list.vue +1 -1
- package/src/views/user/sale_org/dialog.vue +1 -1
- package/src/views/user/sale_org/list.vue +1 -1
- package/src/views/user/system_notice/list.vue +1 -1
- package/src/views/user/system_parameter/list.vue +1 -1
- package/src/views/user/user/dialog.vue +1 -1
- package/src/views/user/user/edit.vue +306 -159
- package/src/views/user/user/form_dialog.vue +1 -1
- package/src/views/user/user/form_list.vue +1 -1
- package/src/views/user/user/list.vue +2 -2
- package/src/views/user/user_log_classify/list.vue +1 -1
- package/src/views/user/wf/iframe/index.vue +6 -1
- package/src/views/user/wf/iframe/index2.vue +6 -1
- package/src/views/user/wf/wfReport/index.vue +12 -6
- package/src/views/user/wf/wf_auto_submit_data/list.vue +2 -2
- package/src/views/user/wf/wf_manage/list.vue +97 -24
- package/src/views/user/wf/wf_manage/list2.vue +875 -0
- package/src/views/user/wf/wf_manage/wfContentDialog.vue +23 -1
- package/src/views/user/wf/wf_obj_config/dialog.vue +1 -1
- package/src/views/user/wf/wf_obj_config/list.vue +1 -1
- package/src/views/user/wf/wf_obj_config/list_form.vue +1 -1
- package/src/views/user/wf/wf_transfer_setting/list.vue +1 -1
- package/src/views/user/workbench_menu/list.vue +1 -1
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/form-widget/field-widget/mixins/utc-transform-mixin.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { deepClone, isNilOrEmptyStr } from "../../../../utils/util";
|
|
2
|
+
import fieldMixin from "../fieldMixin";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
methods: {
|
|
6
|
+
isUtcTransformEnabled() {
|
|
7
|
+
return !!this.field?.options?.utcTransformEnabled;
|
|
8
|
+
},
|
|
9
|
+
transformUtcToLocalValue(value) {
|
|
10
|
+
if (isNilOrEmptyStr(value) || !this.isUtcTransformEnabled()) {
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
if (Array.isArray(value)) {
|
|
14
|
+
return value.map((item) => this.transformUtcToLocalSingle(item));
|
|
15
|
+
}
|
|
16
|
+
return this.transformUtcToLocalSingle(value);
|
|
17
|
+
},
|
|
18
|
+
transformUtcToLocalSingle(value) {
|
|
19
|
+
if (isNilOrEmptyStr(value)) {
|
|
20
|
+
return value;
|
|
21
|
+
}
|
|
22
|
+
const localValue = this.$utcToLocal(value);
|
|
23
|
+
if (!localValue) {
|
|
24
|
+
return localValue;
|
|
25
|
+
}
|
|
26
|
+
const widgetType = this.field?.type;
|
|
27
|
+
const options = this.field?.options || {};
|
|
28
|
+
if (widgetType === "time") {
|
|
29
|
+
const parts = String(localValue).split(" ");
|
|
30
|
+
return parts.length > 1 ? parts[1] : localValue;
|
|
31
|
+
}
|
|
32
|
+
if (widgetType === "time-range") {
|
|
33
|
+
return localValue;
|
|
34
|
+
}
|
|
35
|
+
const dateType = options.type;
|
|
36
|
+
const valueFormat = options.valueFormat || "";
|
|
37
|
+
if (widgetType === "date" || widgetType === "date-range") {
|
|
38
|
+
if (
|
|
39
|
+
dateType === "datetime"
|
|
40
|
+
|| (valueFormat && /[HhmSs]/.test(valueFormat))
|
|
41
|
+
) {
|
|
42
|
+
return localValue;
|
|
43
|
+
}
|
|
44
|
+
return String(localValue).split(" ")[0];
|
|
45
|
+
}
|
|
46
|
+
return localValue;
|
|
47
|
+
},
|
|
48
|
+
getUtcTransformedFieldValue() {
|
|
49
|
+
if (!this.isUtcTransformEnabled()) {
|
|
50
|
+
return this.fieldModel;
|
|
51
|
+
}
|
|
52
|
+
return this.transformUtcToLocalValue(this.fieldModel);
|
|
53
|
+
},
|
|
54
|
+
initFieldModel(flag) {
|
|
55
|
+
fieldMixin.methods.initFieldModel.call(this, flag);
|
|
56
|
+
// flag=true 来自 initValueWatchEvent;行数据已是本地时间,再转换会重复偏移并触发 watch 死循环
|
|
57
|
+
if (this.designState || !this.isUtcTransformEnabled() || flag) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const transformed = this.getUtcTransformedFieldValue();
|
|
61
|
+
if (transformed === this.fieldModel) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const currentData =
|
|
65
|
+
this.tableParam && this.tableParam.row
|
|
66
|
+
? this.tableParam.row
|
|
67
|
+
: this.formModel;
|
|
68
|
+
this.fieldModel = transformed;
|
|
69
|
+
this.oldFieldValue = deepClone(transformed);
|
|
70
|
+
if (transformed !== currentData[this.fieldKeyName]) {
|
|
71
|
+
this.syncUpdateFormModel(transformed);
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
};
|
package/src/components/xform/form-designer/form-widget/field-widget/save_submit_wf_button-widget.vue
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<static-content-wrapper
|
|
3
|
+
:designer="designer"
|
|
4
|
+
:field="field"
|
|
5
|
+
:design-state="designState"
|
|
6
|
+
:display-style="field.options.displayStyle"
|
|
7
|
+
:parent-widget="parentWidget"
|
|
8
|
+
:parent-list="parentList"
|
|
9
|
+
:index-of-parent-list="indexOfParentList"
|
|
10
|
+
:sub-form-row-index="subFormRowIndex"
|
|
11
|
+
:sub-form-col-index="subFormColIndex"
|
|
12
|
+
:sub-form-row-id="subFormRowId"
|
|
13
|
+
>
|
|
14
|
+
<el-button
|
|
15
|
+
v-show="isShow"
|
|
16
|
+
class="button-sty"
|
|
17
|
+
:type="field.options.type"
|
|
18
|
+
:size="field.options.size"
|
|
19
|
+
:plain="field.options.plain"
|
|
20
|
+
:round="field.options.round"
|
|
21
|
+
:circle="field.options.circle"
|
|
22
|
+
:icon="field.options.icon"
|
|
23
|
+
:disabled="!designState && field.options.disabled"
|
|
24
|
+
@click="clickHandle"
|
|
25
|
+
>
|
|
26
|
+
{{ getI18nLabel(field.options.label) }}
|
|
27
|
+
</el-button>
|
|
28
|
+
</static-content-wrapper>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
import StaticContentWrapper from "./static-content-wrapper";
|
|
33
|
+
import emitter from "../../../../../components/xform/utils/emitter";
|
|
34
|
+
import i18n from "../../../../../components/xform/utils/i18n";
|
|
35
|
+
import fieldMixin from "../../../../../components/xform/form-designer/form-widget/field-widget/fieldMixin";
|
|
36
|
+
|
|
37
|
+
export default {
|
|
38
|
+
name: "save_submit_wf_button-widget",
|
|
39
|
+
componentName: "FieldWidget",
|
|
40
|
+
mixins: [emitter, fieldMixin, i18n],
|
|
41
|
+
props: {
|
|
42
|
+
field: Object,
|
|
43
|
+
parentWidget: Object,
|
|
44
|
+
parentList: Array,
|
|
45
|
+
indexOfParentList: Number,
|
|
46
|
+
designer: Object,
|
|
47
|
+
designState: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false,
|
|
50
|
+
},
|
|
51
|
+
subFormRowIndex: {
|
|
52
|
+
type: Number,
|
|
53
|
+
default: -1,
|
|
54
|
+
},
|
|
55
|
+
subFormColIndex: {
|
|
56
|
+
type: Number,
|
|
57
|
+
default: -1,
|
|
58
|
+
},
|
|
59
|
+
subFormRowId: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: "",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
components: {
|
|
65
|
+
StaticContentWrapper,
|
|
66
|
+
},
|
|
67
|
+
inject: {
|
|
68
|
+
getHasWf: {
|
|
69
|
+
default: () => () => false,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
computed: {
|
|
73
|
+
isShow() {
|
|
74
|
+
if (this.designState) return true;
|
|
75
|
+
const formRef = this.getFormRef();
|
|
76
|
+
if (!formRef?.formConfig?.wfEnabled) return false;
|
|
77
|
+
if (this.isWfStarted(formRef)) return false;
|
|
78
|
+
return !this.field.options.hidden;
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
created() {
|
|
82
|
+
this.registerToRefList();
|
|
83
|
+
this.initEventHandler();
|
|
84
|
+
this.handleOnCreated();
|
|
85
|
+
},
|
|
86
|
+
mounted() {
|
|
87
|
+
this.handleOnMounted();
|
|
88
|
+
},
|
|
89
|
+
beforeDestroy() {
|
|
90
|
+
this.unregisterFromRefList();
|
|
91
|
+
},
|
|
92
|
+
methods: {
|
|
93
|
+
isWfStarted(formRef) {
|
|
94
|
+
const wfParam = formRef?.wfParam || {};
|
|
95
|
+
return !!(
|
|
96
|
+
wfParam.hasWf ||
|
|
97
|
+
formRef.hasWf ||
|
|
98
|
+
this.getHasWf() ||
|
|
99
|
+
wfParam.wfInfo?.procInstId
|
|
100
|
+
);
|
|
101
|
+
},
|
|
102
|
+
clickHandle() {
|
|
103
|
+
if (this.designState || this.field.options.disabled || !this.isShow) return;
|
|
104
|
+
this.saveAndSubmitWfHandle();
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
</script>
|
|
109
|
+
|
|
110
|
+
<style lang="scss" scoped>
|
|
111
|
+
@import "~@/styles/global.scss";
|
|
112
|
+
</style>
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<form-item-wrapper
|
|
3
|
+
:designer="designer"
|
|
4
|
+
:field="field"
|
|
5
|
+
:rules="rules"
|
|
6
|
+
:design-state="designState"
|
|
7
|
+
:parent-widget="parentWidget"
|
|
8
|
+
:parent-list="parentList"
|
|
9
|
+
:index-of-parent-list="indexOfParentList"
|
|
10
|
+
:sub-form-row-index="subFormRowIndex"
|
|
11
|
+
:sub-form-col-index="subFormColIndex"
|
|
12
|
+
:sub-form-row-id="subFormRowId"
|
|
13
|
+
>
|
|
14
|
+
<div v-if="designState" class="script-input-design-placeholder">
|
|
15
|
+
{{ getI18nLabel(field.options.placeholder) || "脚本输入框" }}
|
|
16
|
+
<span class="script-input-mode">({{ editorMode }})</span>
|
|
17
|
+
</div>
|
|
18
|
+
<template v-else-if="isReadMode">
|
|
19
|
+
<pre class="readonly-mode-field script-input-readonly">{{ fieldModel }}</pre>
|
|
20
|
+
</template>
|
|
21
|
+
<code-editor
|
|
22
|
+
v-else
|
|
23
|
+
v-model="fieldModel"
|
|
24
|
+
:mode="editorMode"
|
|
25
|
+
:readonly="field.options.readonly || field.options.disabled"
|
|
26
|
+
:height="editorHeight"
|
|
27
|
+
:min-lines="editorMinLines"
|
|
28
|
+
:max-lines="editorMaxLines"
|
|
29
|
+
:user-worker="userWorker"
|
|
30
|
+
:resize="!field.options.disabled && !field.options.readonly"
|
|
31
|
+
@input="onEditorInput"
|
|
32
|
+
/>
|
|
33
|
+
</form-item-wrapper>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<script>
|
|
37
|
+
import FormItemWrapper from "./form-item-wrapper";
|
|
38
|
+
import emitter from "../../../utils/emitter";
|
|
39
|
+
import i18n from "../../../utils/i18n";
|
|
40
|
+
import fieldMixin from "./fieldMixin";
|
|
41
|
+
import createCodeEditorAsyncComponent from "../../../../code-editor/async";
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
name: "script-input-widget",
|
|
45
|
+
componentName: "FieldWidget",
|
|
46
|
+
mixins: [emitter, fieldMixin, i18n],
|
|
47
|
+
props: {
|
|
48
|
+
field: Object,
|
|
49
|
+
parentWidget: Object,
|
|
50
|
+
parentList: Array,
|
|
51
|
+
indexOfParentList: Number,
|
|
52
|
+
designer: Object,
|
|
53
|
+
designState: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false,
|
|
56
|
+
},
|
|
57
|
+
subFormRowIndex: {
|
|
58
|
+
type: Number,
|
|
59
|
+
default: -1,
|
|
60
|
+
},
|
|
61
|
+
subFormColIndex: {
|
|
62
|
+
type: Number,
|
|
63
|
+
default: -1,
|
|
64
|
+
},
|
|
65
|
+
subFormRowId: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: "",
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
components: {
|
|
71
|
+
FormItemWrapper,
|
|
72
|
+
// 不依赖 src/index.js 的全局注册,避免宿主应用未注册时整块消失
|
|
73
|
+
CodeEditor: createCodeEditorAsyncComponent,
|
|
74
|
+
},
|
|
75
|
+
inject: ["refList", "globalOptionData", "globalModel"],
|
|
76
|
+
data() {
|
|
77
|
+
return {
|
|
78
|
+
oldFieldValue: null,
|
|
79
|
+
fieldModel: null,
|
|
80
|
+
rules: [],
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
computed: {
|
|
84
|
+
editorMode() {
|
|
85
|
+
return this.field.options.editorMode || "javascript";
|
|
86
|
+
},
|
|
87
|
+
editorHeight() {
|
|
88
|
+
return this.field.options.editorHeight || "200px";
|
|
89
|
+
},
|
|
90
|
+
editorMinLines() {
|
|
91
|
+
return this.field.options.editorMinLines || 8;
|
|
92
|
+
},
|
|
93
|
+
editorMaxLines() {
|
|
94
|
+
return this.field.options.editorMaxLines || 30;
|
|
95
|
+
},
|
|
96
|
+
userWorker() {
|
|
97
|
+
if (this.field.options.editorMode === "text") {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
return this.field.options.userWorker === true;
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
created() {
|
|
104
|
+
this.initFieldModel();
|
|
105
|
+
this.registerToRefList();
|
|
106
|
+
this.initEventHandler();
|
|
107
|
+
this.buildFieldRules();
|
|
108
|
+
this.handleOnCreated();
|
|
109
|
+
},
|
|
110
|
+
mounted() {
|
|
111
|
+
this.handleOnMounted();
|
|
112
|
+
},
|
|
113
|
+
beforeDestroy() {
|
|
114
|
+
this.unregisterFromRefList();
|
|
115
|
+
},
|
|
116
|
+
methods: {
|
|
117
|
+
onEditorInput(val) {
|
|
118
|
+
this.handleInputCustomEvent(val);
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
</script>
|
|
123
|
+
|
|
124
|
+
<style lang="scss" scoped>
|
|
125
|
+
@import "~@/styles/global.scss";
|
|
126
|
+
|
|
127
|
+
.script-input-design-placeholder {
|
|
128
|
+
min-height: 120px;
|
|
129
|
+
padding: 12px;
|
|
130
|
+
border: 1px dashed #c0c4cc;
|
|
131
|
+
border-radius: 4px;
|
|
132
|
+
color: #909399;
|
|
133
|
+
font-size: 13px;
|
|
134
|
+
background: #fafafa;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.script-input-mode {
|
|
138
|
+
margin-left: 6px;
|
|
139
|
+
color: #336699;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.script-input-readonly {
|
|
143
|
+
margin: 0;
|
|
144
|
+
white-space: pre-wrap;
|
|
145
|
+
word-break: break-all;
|
|
146
|
+
font-family: Consolas, Monaco, monospace;
|
|
147
|
+
font-size: 12px;
|
|
148
|
+
}
|
|
149
|
+
</style>
|