@web-utils/component 2.7.30 → 2.7.31
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/dist/chunks/{config.7dec2bf2.js → config.75161c38.js} +29 -29
- package/dist/chunks/confirmable-mixin.851d6299.js +137 -0
- package/dist/chunks/dataformat.b8c8c01a.js +237 -0
- package/dist/chunks/detail.6135ade5.js +55 -0
- package/dist/chunks/dic.e57b75f2.js +215 -0
- package/dist/chunks/{event.fc358074.js → event.812c361c.js} +54 -23
- package/dist/chunks/{form-input-mixin.760cd65d.js → form-input-mixin.3e63b57f.js} +4 -4
- package/dist/chunks/{form-item-mixin.fa314b67.js → form-item-mixin.a56c101a.js} +44 -17
- package/dist/chunks/{form-pick-mixin.c4e0391b.js → form-pick-mixin.822300f3.js} +1 -1
- package/dist/chunks/{init.e0133910.js → init.38cbb3a2.js} +41 -21
- package/dist/chunks/{input-number-mixin.6849fa63.js → input-number-mixin.44b78389.js} +4 -4
- package/dist/chunks/{mixins.6a394a6c.js → mixins.e1939731.js} +3 -2
- package/dist/chunks/{packages.419bde01.js → packages.c4ea639d.js} +12 -6
- package/dist/chunks/{permission.07c49abf.js → permission.9c766972.js} +6 -1
- package/dist/chunks/slot.55598d0f.js +35 -0
- package/dist/chunks/{tab-mixin.9d568df9.js → tab-mixin.9d848bf6.js} +29 -11
- package/dist/chunks/util.b0d0b0ad.js +478 -0
- package/dist/chunks/{utils.d7f73f8d.js → utils.2a3ffac9.js} +89 -24
- package/dist/chunks/{utils.f44207f4.js → utils.a8891d2c.js} +9 -5
- package/dist/chunks/vueComponentNormalizer.9c6b8b3d.js +59 -0
- package/dist/components/address-input/index.js +30 -17
- package/dist/components/address-input/style.css +15 -1
- package/dist/components/affix/index.js +78 -28
- package/dist/components/affix/style.css +5 -1
- package/dist/components/aside-menu/index.js +14 -8
- package/dist/components/aside-menu/style.css +9 -1
- package/dist/components/avatar/index.js +33 -15
- package/dist/components/avatar/style.css +57 -1
- package/dist/components/awesome-button/index.js +45 -31
- package/dist/components/base.css +410 -1
- package/dist/components/capsule-tab/index.js +13 -7
- package/dist/components/capsule-tab/style.css +32 -1
- package/dist/components/card/index.js +33 -20
- package/dist/components/card/style.css +90 -1
- package/dist/components/carousel/index.js +18 -12
- package/dist/components/carousel/style.css +41 -1
- package/dist/components/chat/index.js +245 -139
- package/dist/components/chat/style.css +279 -1
- package/dist/components/chunk-file-uploader/index.js +63 -29
- package/dist/components/chunk-file-uploader/style.css +4 -1
- package/dist/components/chunk-file-uploader-button/index.js +15 -9
- package/dist/components/chunk-file-uploader-button/style.css +17 -1
- package/dist/components/chunk-file-uploader-drop/index.js +45 -27
- package/dist/components/chunk-file-uploader-drop/style.css +12 -1
- package/dist/components/chunk-file-uploader-file/index.js +150 -73
- package/dist/components/chunk-file-uploader-file/style.css +125 -1
- package/dist/components/chunk-file-uploader-files/index.js +15 -9
- package/dist/components/chunk-file-uploader-files/style.css +9 -1
- package/dist/components/chunk-file-uploader-list/index.js +16 -10
- package/dist/components/chunk-file-uploader-list/style.css +9 -1
- package/dist/components/chunk-file-uploader-un-support/index.js +18 -10
- package/dist/components/chunk-file-uploader-un-support/style.css +6 -1
- package/dist/components/code-mirror-editor/index.js +75 -47
- package/dist/components/code-mirror-editor/style.css +17 -1
- package/dist/components/color-picker/index.js +62 -39
- package/dist/components/column/index.js +54 -29
- package/dist/components/column-default/index.js +47 -33
- package/dist/components/column-dynamic/index.js +26 -19
- package/dist/components/column-menu/index.js +98 -86
- package/dist/components/column-slot/index.js +135 -75
- package/dist/components/comment/index.js +28 -15
- package/dist/components/comment/style.css +92 -1
- package/dist/components/confirm-button/index.js +7 -5
- package/dist/components/confirmable/index.js +5 -4
- package/dist/components/context-menu/index.js +54 -32
- package/dist/components/context-menu/style.css +88 -1
- package/dist/components/count-up/index.js +55 -38
- package/dist/components/custom-scrollbar/index.js +45 -21
- package/dist/components/data-box/index.js +22 -16
- package/dist/components/data-box/style.css +58 -1
- package/dist/components/data-card/index.js +21 -15
- package/dist/components/data-card/style.css +46 -1
- package/dist/components/data-cardtext/index.js +19 -13
- package/dist/components/data-cardtext/style.css +36 -1
- package/dist/components/data-display/index.js +22 -16
- package/dist/components/data-display/style.css +37 -1
- package/dist/components/data-icons/index.js +23 -17
- package/dist/components/data-icons/style.css +53 -1
- package/dist/components/data-imgtext/index.js +26 -20
- package/dist/components/data-imgtext/style.css +70 -1
- package/dist/components/data-operatext/index.js +20 -14
- package/dist/components/data-operatext/style.css +81 -1
- package/dist/components/data-panel/index.js +21 -15
- package/dist/components/data-panel/style.css +37 -1
- package/dist/components/data-pay/index.js +29 -23
- package/dist/components/data-pay/style.css +102 -1
- package/dist/components/data-price/index.js +19 -13
- package/dist/components/data-price/style.css +81 -1
- package/dist/components/data-progress/index.js +26 -20
- package/dist/components/data-progress/style.css +30 -1
- package/dist/components/data-rotate/index.js +21 -15
- package/dist/components/data-rotate/style.css +50 -1
- package/dist/components/data-table-picker/index.js +47 -28
- package/dist/components/data-tabs/index.js +22 -16
- package/dist/components/data-tabs/style.css +70 -1
- package/dist/components/dialog-column/index.js +46 -33
- package/dist/components/dialog-excel/index.js +102 -53
- package/dist/components/dialog-filter/index.js +64 -51
- package/dist/components/dialog-form/index.js +54 -34
- package/dist/components/dialog-form/style.css +10 -0
- package/dist/components/dynamic-table/index.js +66 -42
- package/dist/components/dynamic-table/style.css +30 -1
- package/dist/components/e-charts/index.js +127 -46
- package/dist/components/e-charts/style.css +10 -1
- package/dist/components/easy-popup/index.js +32 -14
- package/dist/components/easy-popup/style.css +18 -1
- package/dist/components/editable-progress/index.js +64 -31
- package/dist/components/editable-progress/style.css +37 -1
- package/dist/components/editable-tree/index.js +513 -287
- package/dist/components/editable-tree/style.css +82 -1
- package/dist/components/egd-collapse/index.js +25 -12
- package/dist/components/egd-collapse-item/index.js +41 -25
- package/dist/components/element-dialog/index.js +101 -48
- package/dist/components/element-dialog/style.css +88 -1
- package/dist/components/empty-view/index.js +13 -7
- package/dist/components/empty-view/style.css +17 -1
- package/dist/components/error-view/index.js +12 -6
- package/dist/components/error-view/style.css +17 -1
- package/dist/components/flex-column/index.js +39 -17
- package/dist/components/flex-item/index.js +59 -24
- package/dist/components/flex-row/index.js +39 -17
- package/dist/components/flex-scroller/index.js +13 -7
- package/dist/components/flex-scroller/style.css +20 -1
- package/dist/components/flow/index.js +116 -64
- package/dist/components/flow/style.css +44 -1
- package/dist/components/flow-node/index.js +29 -21
- package/dist/components/flow-viewer/index.js +97 -52
- package/dist/components/flow-viewer/style.css +19 -1
- package/dist/components/form-button/index.js +12 -8
- package/dist/components/form-cascader/index.js +55 -40
- package/dist/components/form-checkbox-group/index.js +90 -60
- package/dist/components/form-checkbox-group/style.css +51 -1
- package/dist/components/form-date-picker/index.js +113 -44
- package/dist/components/form-group/index.js +23 -17
- package/dist/components/form-group/style.css +76 -1
- package/dist/components/form-holder/index.js +41 -30
- package/dist/components/form-input/index.js +42 -31
- package/dist/components/form-input-email/index.js +47 -30
- package/dist/components/form-input-id-card/index.js +40 -29
- package/dist/components/form-input-number/index.js +50 -38
- package/dist/components/form-input-number/style.css +12 -1
- package/dist/components/form-input-phone-number/index.js +40 -29
- package/dist/components/form-input-time/index.js +40 -29
- package/dist/components/form-item/index.js +99 -47
- package/dist/components/form-item/style.css +11 -1
- package/dist/components/form-item-config-provider/index.js +9 -8
- package/dist/components/form-item-group/index.js +69 -43
- package/dist/components/form-item-group/style.css +30 -1
- package/dist/components/form-radio-group/index.js +77 -53
- package/dist/components/form-radio-group/style.css +53 -1
- package/dist/components/form-select/index.js +71 -51
- package/dist/components/form-switch/index.js +41 -30
- package/dist/components/form-temp/index.js +49 -29
- package/dist/components/form-textarea/index.js +45 -34
- package/dist/components/form-view/index.js +152 -81
- package/dist/components/form-view/style.css +158 -1
- package/dist/components/fy-array/index.js +51 -43
- package/dist/components/fy-array/style.css +18 -1
- package/dist/components/fy-article/index.js +24 -13
- package/dist/components/fy-article/style.css +40 -1
- package/dist/components/fy-cascader/index.js +39 -29
- package/dist/components/fy-checkbox/index.js +38 -27
- package/dist/components/fy-checkbox/style.css +15 -1
- package/dist/components/fy-code/index.js +19 -12
- package/dist/components/fy-curd/index.js +290 -152
- package/dist/components/fy-curd/style.css +239 -1
- package/dist/components/fy-date/index.js +24 -18
- package/dist/components/fy-date/style.css +21 -1
- package/dist/components/fy-dialog-form/index.js +127 -54
- package/dist/components/fy-draggable/index.js +196 -73
- package/dist/components/fy-draggable/style.css +136 -1
- package/dist/components/fy-dynamic/index.js +116 -73
- package/dist/components/fy-dynamic/style.css +35 -1
- package/dist/components/fy-empty/index.js +15 -9
- package/dist/components/fy-empty/style.css +24 -1
- package/dist/components/fy-form/index.js +399 -221
- package/dist/components/fy-form/style.css +79 -1
- package/dist/components/fy-form-design/index.js +2267 -1630
- package/dist/components/fy-form-design/style.css +578 -1
- package/dist/components/fy-form-menu/index.js +43 -35
- package/dist/components/fy-input/index.js +46 -35
- package/dist/components/fy-input-color/index.js +40 -33
- package/dist/components/fy-input-icon/index.js +58 -37
- package/dist/components/fy-input-icon/style.css +39 -1
- package/dist/components/fy-input-map/index.js +113 -68
- package/dist/components/fy-input-map/style.css +50 -1
- package/dist/components/fy-input-number/index.js +29 -24
- package/dist/components/fy-input-table/index.js +82 -48
- package/dist/components/fy-input-table/style.css +10 -1
- package/dist/components/fy-input-tree/index.js +104 -60
- package/dist/components/fy-input-tree/style.css +25 -1
- package/dist/components/fy-progress/index.js +15 -10
- package/dist/components/fy-radio/index.js +20 -14
- package/dist/components/fy-radio/style.css +12 -1
- package/dist/components/fy-rate/index.js +21 -15
- package/dist/components/fy-rate/style.css +9 -1
- package/dist/components/fy-select/index.js +73 -55
- package/dist/components/fy-select/style.css +25 -1
- package/dist/components/fy-slider/index.js +22 -17
- package/dist/components/fy-switch/index.js +17 -12
- package/dist/components/fy-tabs/index.js +20 -12
- package/dist/components/fy-tabs/style.css +6 -0
- package/dist/components/fy-time/index.js +29 -18
- package/dist/components/fy-title/index.js +16 -8
- package/dist/components/fy-title/style.css +11 -1
- package/dist/components/fy-tree/index.js +135 -72
- package/dist/components/fy-tree/style.css +46 -1
- package/dist/components/fy-u-editor/index.js +172 -67
- package/dist/components/fy-u-editor/style.css +15 -1
- package/dist/components/fy-upload/index.js +317 -148
- package/dist/components/fy-upload/style.css +60 -1
- package/dist/components/guide-steps/index.js +31 -17
- package/dist/components/guide-steps/style.css +34 -1
- package/dist/components/header-menu/index.js +86 -66
- package/dist/components/header-search/index.js +92 -60
- package/dist/components/highlight-j-s/index.js +28 -15
- package/dist/components/highlight-j-s/style.css +21 -1
- package/dist/components/icon-card/index.js +13 -7
- package/dist/components/icon-card/style.css +56 -1
- package/dist/components/icon-temp/index.js +12 -6
- package/dist/components/icon-temp/style.css +21 -1
- package/dist/components/iframe-window/index.js +20 -14
- package/dist/components/iframe-window/style.css +20 -1
- package/dist/components/image-cropper/index.js +69 -51
- package/dist/components/image-cropper/style.css +34 -1
- package/dist/components/image-preview/index.js +77 -46
- package/dist/components/image-preview/style.css +72 -1
- package/dist/components/image-viewer/index.js +40 -22
- package/dist/components/image-viewer/style.css +21 -1
- package/dist/components/input-number/index.js +122 -56
- package/dist/components/input-number/style.css +15 -1
- package/dist/components/input-number-range/index.js +32 -20
- package/dist/components/input-number-range/style.css +12 -1
- package/dist/components/keep-view-alive/index.js +68 -21
- package/dist/components/keyboard/index.js +217 -132
- package/dist/components/keyboard/style.css +547 -1
- package/dist/components/license/index.js +81 -35
- package/dist/components/loading-view/index.js +12 -6
- package/dist/components/loading-view/style.css +17 -1
- package/dist/components/login/index.js +91 -62
- package/dist/components/login/style.css +25 -1
- package/dist/components/name-avatar/index.js +32 -10
- package/dist/components/name-avatar/style.css +35 -1
- package/dist/components/nav-bar/index.js +21 -11
- package/dist/components/nav-bar/style.css +17 -1
- package/dist/components/not-implement/index.js +16 -8
- package/dist/components/not-implement/style.css +15 -1
- package/dist/components/notice/index.js +40 -27
- package/dist/components/notice/style.css +54 -1
- package/dist/components/page/index.js +13 -7
- package/dist/components/page/style.css +12 -1
- package/dist/components/page-header/index.js +15 -9
- package/dist/components/page-header/style.css +14 -1
- package/dist/components/page-index/index.js +62 -37
- package/dist/components/page-index/style.css +23 -1
- package/dist/components/page-index-top/index.js +53 -34
- package/dist/components/page-skeleton/index.js +15 -9
- package/dist/components/page-skeleton/style.css +23 -1
- package/dist/components/page-skeleton-new/index.js +15 -9
- package/dist/components/page-skeleton-new/style.css +42 -1
- package/dist/components/pageable-table/index.js +187 -106
- package/dist/components/pageable-table/style.css +72 -1
- package/dist/components/pageable-view/index.js +164 -80
- package/dist/components/pageable-view/style.css +69 -1
- package/dist/components/photo-swipe/index.js +92 -46
- package/dist/components/process-designer/index.js +961 -772
- package/dist/components/process-designer/style.css +1186 -1
- package/dist/components/properties-panel/index.js +1488 -1044
- package/dist/components/properties-panel/style.css +122 -1
- package/dist/components/queue/index.js +24 -12
- package/dist/components/record-video/index.js +53 -27
- package/dist/components/record-video/style.css +53 -1
- package/dist/components/resize-observer/index.js +52 -18
- package/dist/components/resize-observer/style.css +31 -1
- package/dist/components/search/index.js +41 -22
- package/dist/components/search/style.css +57 -1
- package/dist/components/search-popover/index.js +153 -91
- package/dist/components/search-popover/style.css +93 -1
- package/dist/components/sign/index.js +138 -35
- package/dist/components/sign/style.css +12 -1
- package/dist/components/sign-panel/index.js +96 -46
- package/dist/components/sign-panel/style.css +97 -1
- package/dist/components/skeleton/index.js +22 -12
- package/dist/components/skeleton/style.css +61 -1
- package/dist/components/split-pane/index.js +125 -60
- package/dist/components/split-pane/style.css +100 -1
- package/dist/components/stateful/index.js +8 -5
- package/dist/components/stateful/style.css +33 -1
- package/dist/components/static-pageable-table/index.js +22 -15
- package/dist/components/static-pageable-table/style.css +9 -1
- package/dist/components/swiper/index.js +127 -58
- package/dist/components/swiper/style.css +43 -1
- package/dist/components/tab/index.js +34 -16
- package/dist/components/tab/style.css +122 -1
- package/dist/components/tab-item/index.js +14 -9
- package/dist/components/table-column/index.js +26 -17
- package/dist/components/table-page/index.js +42 -23
- package/dist/components/table-view/index.js +162 -87
- package/dist/components/table-view/style.css +95 -1
- package/dist/components/tag-render/index.js +41 -22
- package/dist/components/tag-render/style.css +33 -1
- package/dist/components/text-ellipsis/index.js +48 -26
- package/dist/components/text-ellipsis/style.css +9 -1
- package/dist/components/tinymce-editor/index.js +80 -60
- package/dist/components/tinymce-editor/style.css +43 -1
- package/dist/components/tinymce-wrapper/index.js +77 -41
- package/dist/components/tinymce-wrapper/style.css +36 -1
- package/dist/components/toolbar/index.js +46 -25
- package/dist/components/toolbar/style.css +39 -1
- package/dist/components/toolbar-button/index.js +46 -35
- package/dist/components/toolbar-button/style.css +21 -1
- package/dist/components/trigger/index.js +15 -8
- package/dist/components/verify/index.js +15 -8
- package/dist/components/verify/style.css +15 -1
- package/dist/components/vue-tags-input/index.js +233 -113
- package/dist/components/vue-tags-input/style.css +688 -1
- package/dist/components/watermark/index.js +33 -14
- package/dist/components/watermark/style.css +11 -1
- package/dist/index.css +2434 -1750
- package/dist/index.es.js +15944 -9317
- package/package.json +4 -4
- package/web-types.json +1 -1
- package/dist/chunks/confirmable-mixin.35bd1934.js +0 -104
- package/dist/chunks/dataformat.9cc4428a.js +0 -158
- package/dist/chunks/detail.544c52b0.js +0 -29
- package/dist/chunks/dic.9de2fe5a.js +0 -135
- package/dist/chunks/slot.a7387ecc.js +0 -27
- package/dist/chunks/util.89913643.js +0 -261
- package/dist/chunks/vueComponentNormalizer.77ec6792.js +0 -32
- package/dist/components/fy-dialog-form/style.css +0 -1
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
var __async = (__this, __arguments, generator) =>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { d as detail } from "../../chunks/detail.6135ade5.js";
|
|
22
|
+
import { i as init } from "../../chunks/init.38cbb3a2.js";
|
|
23
|
+
import { s as setPx, d as deepClone, u as uploadFun, x as setAsVal, g as getAsVal, v as filterParams, D as DIC_PROPS, o as optVal, y as clearVal } from "../../chunks/util.b0d0b0ad.js";
|
|
24
|
+
import { b as calcCount, c as calcCascader, g as getComponent, a as getPlaceholder, f as formInitVal } from "../../chunks/dataformat.b8c8c01a.js";
|
|
25
|
+
import { s as sendDic } from "../../chunks/dic.e57b75f2.js";
|
|
26
|
+
import { p as packages } from "../../chunks/packages.c4ea639d.js";
|
|
23
27
|
import { isBlank } from "@web-utils/core";
|
|
24
|
-
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.
|
|
28
|
+
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.9c6b8b3d.js";
|
|
25
29
|
const mock = (column, dic, defaultForm, run) => {
|
|
26
30
|
if (!run)
|
|
27
31
|
return;
|
|
@@ -29,46 +33,67 @@ const mock = (column, dic, defaultForm, run) => {
|
|
|
29
33
|
packages.logs("mock");
|
|
30
34
|
return;
|
|
31
35
|
}
|
|
32
|
-
const
|
|
36
|
+
const mockjs = window.Mock;
|
|
37
|
+
const Random = (mockjs || {}).Random;
|
|
38
|
+
const form = {};
|
|
33
39
|
function createName({ en }) {
|
|
34
|
-
|
|
40
|
+
if (en) {
|
|
41
|
+
return Random.name(true);
|
|
42
|
+
}
|
|
43
|
+
return Random.cname();
|
|
35
44
|
}
|
|
36
45
|
function createNumber({ max, min, precision }) {
|
|
37
46
|
if (precision) {
|
|
38
|
-
const number = `${Random.float(min, max, precision)}
|
|
47
|
+
const number = `${Random.float(min, max, precision)}`;
|
|
48
|
+
const index = number.indexOf(".") + 1;
|
|
39
49
|
return Number(number.substring(0, index + precision));
|
|
40
|
-
} else
|
|
50
|
+
} else {
|
|
41
51
|
return Random.integer(min, max);
|
|
52
|
+
}
|
|
42
53
|
}
|
|
43
54
|
function createUrl({ header, footer }) {
|
|
44
55
|
let url = Random.url();
|
|
45
56
|
const index = url.indexOf("://");
|
|
46
|
-
|
|
57
|
+
if (header === false) {
|
|
58
|
+
url = url.substring(index + 3);
|
|
59
|
+
} else {
|
|
60
|
+
url = `http://${url.substring(index + 3)}`;
|
|
61
|
+
}
|
|
62
|
+
return url;
|
|
47
63
|
}
|
|
48
64
|
function createDatetime({ format, now }) {
|
|
49
|
-
|
|
65
|
+
if (now) {
|
|
66
|
+
return Random.now(format);
|
|
67
|
+
}
|
|
68
|
+
return Random.datetime(format);
|
|
50
69
|
}
|
|
51
70
|
function createText({ min, max }) {
|
|
52
71
|
return Random.csentence(min, max);
|
|
53
72
|
}
|
|
54
73
|
function createCounty() {
|
|
55
|
-
return Random.county(
|
|
74
|
+
return Random.county(true);
|
|
56
75
|
}
|
|
57
76
|
function createDic({ dic: dic2, props, columnType, multiple }) {
|
|
58
|
-
const value = props.value || "value"
|
|
77
|
+
const value = props.value || "value";
|
|
78
|
+
const len = dic2.length;
|
|
59
79
|
if (["checkbox"].includes(columnType) || multiple) {
|
|
60
80
|
const number = createNumber({
|
|
61
81
|
min: 1,
|
|
62
82
|
max: len
|
|
63
|
-
})
|
|
83
|
+
});
|
|
84
|
+
const result = [];
|
|
64
85
|
for (let i = 0; i < number; i++) {
|
|
65
|
-
let flag =
|
|
66
|
-
|
|
86
|
+
let flag = true;
|
|
87
|
+
while (flag) {
|
|
67
88
|
const numbers = createNumber({
|
|
68
89
|
min: 0,
|
|
69
90
|
max: len - 1
|
|
70
|
-
})
|
|
71
|
-
|
|
91
|
+
});
|
|
92
|
+
const values = dic2[numbers][value];
|
|
93
|
+
if (!result.includes(values)) {
|
|
94
|
+
result.push(values);
|
|
95
|
+
flag = false;
|
|
96
|
+
}
|
|
72
97
|
}
|
|
73
98
|
}
|
|
74
99
|
return result;
|
|
@@ -83,9 +108,13 @@ const mock = (column, dic, defaultForm, run) => {
|
|
|
83
108
|
function create() {
|
|
84
109
|
Object.keys(column).forEach((index) => {
|
|
85
110
|
const ele = column[index];
|
|
86
|
-
if (ele.mock && typeof ele.mock
|
|
111
|
+
if (ele.mock && typeof ele.mock === "object") {
|
|
87
112
|
const params = ele.mock;
|
|
88
|
-
|
|
113
|
+
params.dic = typeof ele.dicData === "string" ? dic[ele.dicData] : ele.dicData || [];
|
|
114
|
+
params.props = ele.props || {};
|
|
115
|
+
params.columnType = ele.type;
|
|
116
|
+
params.multiple = ele.multiple;
|
|
117
|
+
switch (params.type) {
|
|
89
118
|
case "name":
|
|
90
119
|
form[ele.prop] = createName(params);
|
|
91
120
|
break;
|
|
@@ -108,14 +137,18 @@ const mock = (column, dic, defaultForm, run) => {
|
|
|
108
137
|
form[ele.prop] = createDic(params);
|
|
109
138
|
break;
|
|
110
139
|
}
|
|
111
|
-
} else
|
|
112
|
-
|
|
140
|
+
} else if (ele.mock instanceof Function) {
|
|
141
|
+
form[ele.prop] = ele.mock(defaultForm);
|
|
142
|
+
}
|
|
113
143
|
});
|
|
114
144
|
}
|
|
115
|
-
|
|
145
|
+
create();
|
|
146
|
+
return form;
|
|
116
147
|
};
|
|
117
148
|
var render = function() {
|
|
118
|
-
var _vm = this
|
|
149
|
+
var _vm = this;
|
|
150
|
+
var _h = _vm.$createElement;
|
|
151
|
+
var _c = _vm._self._c || _h;
|
|
119
152
|
return _c("div", {
|
|
120
153
|
class: ["avue-form", {
|
|
121
154
|
"avue--detail": _vm.isDetail
|
|
@@ -127,14 +160,14 @@ var render = function() {
|
|
|
127
160
|
ref: "form",
|
|
128
161
|
attrs: {
|
|
129
162
|
"status-icon": _vm.parentOption.statusIcon,
|
|
130
|
-
model: _vm.form,
|
|
163
|
+
"model": _vm.form,
|
|
131
164
|
"label-suffix": _vm.labelSuffix,
|
|
132
|
-
size: _vm.$AVUE.formSize || _vm.controlSize,
|
|
165
|
+
"size": _vm.$AVUE.formSize || _vm.controlSize,
|
|
133
166
|
"label-position": _vm.parentOption.labelPosition,
|
|
134
167
|
"label-width": _vm.setPx(_vm.parentOption.labelWidth, _vm.labelWidth)
|
|
135
168
|
},
|
|
136
169
|
nativeOn: {
|
|
137
|
-
submit: function($event) {
|
|
170
|
+
"submit": function($event) {
|
|
138
171
|
$event.preventDefault();
|
|
139
172
|
}
|
|
140
173
|
}
|
|
@@ -143,39 +176,39 @@ var render = function() {
|
|
|
143
176
|
"avue-form__tabs": _vm.isTabs
|
|
144
177
|
},
|
|
145
178
|
attrs: {
|
|
146
|
-
span: 24
|
|
179
|
+
"span": 24
|
|
147
180
|
}
|
|
148
181
|
}, [_vm._l(_vm.columnOption, function(item, index) {
|
|
149
182
|
return _c("FormGroup", {
|
|
150
183
|
key: item.prop,
|
|
151
184
|
attrs: {
|
|
152
|
-
tabs: _vm.isTabs,
|
|
153
|
-
arrow: item.arrow,
|
|
154
|
-
collapse: item.collapse,
|
|
155
|
-
display: _vm.vaildDisplay(item),
|
|
156
|
-
icon: item.icon,
|
|
157
|
-
index,
|
|
158
|
-
header: !_vm.isTabs,
|
|
159
|
-
active: _vm.activeName,
|
|
160
|
-
label: item.label
|
|
185
|
+
"tabs": _vm.isTabs,
|
|
186
|
+
"arrow": item.arrow,
|
|
187
|
+
"collapse": item.collapse,
|
|
188
|
+
"display": _vm.vaildDisplay(item),
|
|
189
|
+
"icon": item.icon,
|
|
190
|
+
"index": index,
|
|
191
|
+
"header": !_vm.isTabs,
|
|
192
|
+
"active": _vm.activeName,
|
|
193
|
+
"label": item.label
|
|
161
194
|
},
|
|
162
195
|
on: {
|
|
163
|
-
change: _vm.handleGroupClick
|
|
196
|
+
"change": _vm.handleGroupClick
|
|
164
197
|
},
|
|
165
198
|
scopedSlots: _vm._u([_vm.getSlotName(item, "H", _vm.$scopedSlots) ? {
|
|
166
199
|
key: "header",
|
|
167
200
|
fn: function() {
|
|
168
201
|
return [_vm._t(_vm.getSlotName(item, "H"), null, {
|
|
169
|
-
column: item
|
|
202
|
+
"column": item
|
|
170
203
|
})];
|
|
171
204
|
},
|
|
172
|
-
proxy:
|
|
173
|
-
} : null], null,
|
|
205
|
+
proxy: true
|
|
206
|
+
} : null], null, true)
|
|
174
207
|
}, [_vm.isTabs && index === 1 ? _c("ElTabs", {
|
|
175
208
|
staticClass: "avue-form__tabs",
|
|
176
209
|
attrs: {
|
|
177
|
-
slot: "tabs",
|
|
178
|
-
type: _vm.tabsType
|
|
210
|
+
"slot": "tabs",
|
|
211
|
+
"type": _vm.tabsType
|
|
179
212
|
},
|
|
180
213
|
on: {
|
|
181
214
|
"tab-click": _vm.handleTabClick
|
|
@@ -192,15 +225,15 @@ var render = function() {
|
|
|
192
225
|
return [_vm.vaildDisplay(tabs) && sIndex !== 0 ? _c("ElTabPane", {
|
|
193
226
|
key: sIndex,
|
|
194
227
|
attrs: {
|
|
195
|
-
name: `${sIndex}`
|
|
228
|
+
"name": `${sIndex}`
|
|
196
229
|
}
|
|
197
230
|
}, [_c("span", {
|
|
198
231
|
attrs: {
|
|
199
|
-
slot: "label"
|
|
232
|
+
"slot": "label"
|
|
200
233
|
},
|
|
201
234
|
slot: "label"
|
|
202
235
|
}, [_vm.getSlotName(tabs, "H", _vm.$scopedSlots) ? _vm._t(_vm.getSlotName(tabs, "H"), null, {
|
|
203
|
-
column: _vm.column
|
|
236
|
+
"column": _vm.column
|
|
204
237
|
}) : [_c("i", {
|
|
205
238
|
class: tabs.icon
|
|
206
239
|
}, [_vm._v(" ")]), _vm._v(" " + _vm._s(tabs.label) + " ")]], 2)]) : _vm._e()];
|
|
@@ -212,7 +245,7 @@ var render = function() {
|
|
|
212
245
|
expression: "isGroupShow(item, index)"
|
|
213
246
|
}],
|
|
214
247
|
class: ["avue-form__group", {
|
|
215
|
-
"avue-form__group--flex": item.flex ===
|
|
248
|
+
"avue-form__group--flex": item.flex === false
|
|
216
249
|
}]
|
|
217
250
|
}, [_vm._l(item.column, function(column, cindex) {
|
|
218
251
|
return [_vm.vaildDisplay(column) ? _c("ElCol", {
|
|
@@ -225,20 +258,20 @@ var render = function() {
|
|
|
225
258
|
paddingRight: _vm.gutter
|
|
226
259
|
},
|
|
227
260
|
attrs: {
|
|
228
|
-
span: _vm.getSpan(column),
|
|
229
|
-
md: _vm.getSpan(column),
|
|
230
|
-
sm: column.smSpan || item.smSpan || 12,
|
|
231
|
-
xs: column.xsSpan || item.xmSpan || 24,
|
|
232
|
-
offset: column.offset || item.offset,
|
|
233
|
-
push: column.push || item.push,
|
|
234
|
-
pull: column.pull || item.pull
|
|
261
|
+
"span": _vm.getSpan(column),
|
|
262
|
+
"md": _vm.getSpan(column),
|
|
263
|
+
"sm": column.smSpan || item.smSpan || 12,
|
|
264
|
+
"xs": column.xsSpan || item.xmSpan || 24,
|
|
265
|
+
"offset": column.offset || item.offset,
|
|
266
|
+
"push": column.push || item.push,
|
|
267
|
+
"pull": column.pull || item.pull
|
|
235
268
|
}
|
|
236
269
|
}, [_c("ElFormItem", {
|
|
237
270
|
class: `avue-form__item--${column.labelPosition || item.labelPosition || ""}`,
|
|
238
271
|
attrs: {
|
|
239
|
-
prop: column.prop,
|
|
240
|
-
label: column.label,
|
|
241
|
-
rules: column.rules,
|
|
272
|
+
"prop": column.prop,
|
|
273
|
+
"label": column.label,
|
|
274
|
+
"rules": column.rules,
|
|
242
275
|
"label-position": column.labelPosition || item.labelPosition || _vm.parentOption.labelPosition,
|
|
243
276
|
"label-width": _vm.getLabelWidth(column, item)
|
|
244
277
|
},
|
|
@@ -246,37 +279,37 @@ var render = function() {
|
|
|
246
279
|
key: "label",
|
|
247
280
|
fn: function() {
|
|
248
281
|
return [_vm._t(_vm.getSlotName(column, "L"), null, {
|
|
249
|
-
column,
|
|
250
|
-
value: _vm.form[column.prop],
|
|
251
|
-
readonly: column.readonly || _vm.readonly,
|
|
252
|
-
disabled: _vm.getDisabled(column),
|
|
253
|
-
size: column.size || _vm.controlSize,
|
|
254
|
-
dic: _vm.DIC[column.prop]
|
|
282
|
+
"column": column,
|
|
283
|
+
"value": _vm.form[column.prop],
|
|
284
|
+
"readonly": column.readonly || _vm.readonly,
|
|
285
|
+
"disabled": _vm.getDisabled(column),
|
|
286
|
+
"size": column.size || _vm.controlSize,
|
|
287
|
+
"dic": _vm.DIC[column.prop]
|
|
255
288
|
})];
|
|
256
289
|
},
|
|
257
|
-
proxy:
|
|
290
|
+
proxy: true
|
|
258
291
|
} : column.labelTip ? {
|
|
259
292
|
key: "label",
|
|
260
293
|
fn: function() {
|
|
261
294
|
return [_c("ElTooltip", {
|
|
262
295
|
staticClass: "item",
|
|
263
296
|
attrs: {
|
|
264
|
-
effect: "dark",
|
|
265
|
-
placement: column.labelTipPlacement || "top-start"
|
|
297
|
+
"effect": "dark",
|
|
298
|
+
"placement": column.labelTipPlacement || "top-start"
|
|
266
299
|
}
|
|
267
300
|
}, [_c("div", {
|
|
268
301
|
attrs: {
|
|
269
|
-
slot: "content"
|
|
302
|
+
"slot": "content"
|
|
270
303
|
},
|
|
271
304
|
domProps: {
|
|
272
|
-
innerHTML: _vm._s(column.labelTip)
|
|
305
|
+
"innerHTML": _vm._s(column.labelTip)
|
|
273
306
|
},
|
|
274
307
|
slot: "content"
|
|
275
308
|
}), _c("i", {
|
|
276
309
|
staticClass: "el-icon-info"
|
|
277
310
|
})]), _c("span", [_vm._v(" " + _vm._s(column.label) + _vm._s(_vm.labelSuffix))])];
|
|
278
311
|
},
|
|
279
|
-
proxy:
|
|
312
|
+
proxy: true
|
|
280
313
|
} : null, _vm.getSlotName(column, "E", _vm.$scopedSlots) ? {
|
|
281
314
|
key: "error",
|
|
282
315
|
fn: function(scope) {
|
|
@@ -289,39 +322,39 @@ var render = function() {
|
|
|
289
322
|
dic: _vm.DIC[column.prop]
|
|
290
323
|
}))];
|
|
291
324
|
}
|
|
292
|
-
} : null], null,
|
|
325
|
+
} : null], null, true)
|
|
293
326
|
}, [_c(_vm.validTip(column) ? "div" : "elTooltip", {
|
|
294
327
|
tag: "Component",
|
|
295
328
|
attrs: {
|
|
296
|
-
disabled: _vm.validTip(column),
|
|
297
|
-
content: column.tip || _vm.getPlaceholder(column),
|
|
298
|
-
placement: column.tipPlacement
|
|
329
|
+
"disabled": _vm.validTip(column),
|
|
330
|
+
"content": column.tip || _vm.getPlaceholder(column),
|
|
331
|
+
"placement": column.tipPlacement
|
|
299
332
|
}
|
|
300
333
|
}, [_vm.$scopedSlots[column.prop] ? _vm._t(column.prop, null, {
|
|
301
|
-
value: _vm.form[column.prop],
|
|
302
|
-
column,
|
|
303
|
-
label: _vm.form[`$${column.prop}`],
|
|
304
|
-
size: column.size || _vm.controlSize,
|
|
305
|
-
readonly: _vm.readonly || column.readonly,
|
|
306
|
-
disabled: _vm.getDisabled(column),
|
|
307
|
-
dic: _vm.DIC[column.prop]
|
|
334
|
+
"value": _vm.form[column.prop],
|
|
335
|
+
"column": column,
|
|
336
|
+
"label": _vm.form[`$${column.prop}`],
|
|
337
|
+
"size": column.size || _vm.controlSize,
|
|
338
|
+
"readonly": _vm.readonly || column.readonly,
|
|
339
|
+
"disabled": _vm.getDisabled(column),
|
|
340
|
+
"dic": _vm.DIC[column.prop]
|
|
308
341
|
}) : _c("FormTemp", _vm._b({
|
|
309
342
|
ref: column.prop,
|
|
310
|
-
refInFor:
|
|
343
|
+
refInFor: true,
|
|
311
344
|
attrs: {
|
|
312
|
-
column,
|
|
313
|
-
dic: _vm.DIC[column.prop],
|
|
314
|
-
props: _vm.parentOption.props,
|
|
345
|
+
"column": column,
|
|
346
|
+
"dic": _vm.DIC[column.prop],
|
|
347
|
+
"props": _vm.parentOption.props,
|
|
315
348
|
"props-http": _vm.parentOption.propsHttp,
|
|
316
|
-
disabled: _vm.getDisabled(column),
|
|
317
|
-
readonly: column.readonly || _vm.readonly,
|
|
318
|
-
enter: _vm.parentOption.enter,
|
|
319
|
-
size: column.size || _vm.controlSize,
|
|
349
|
+
"disabled": _vm.getDisabled(column),
|
|
350
|
+
"readonly": column.readonly || _vm.readonly,
|
|
351
|
+
"enter": _vm.parentOption.enter,
|
|
352
|
+
"size": column.size || _vm.controlSize,
|
|
320
353
|
"column-slot": _vm.columnSlot
|
|
321
354
|
},
|
|
322
355
|
on: {
|
|
323
|
-
enter: _vm.submit,
|
|
324
|
-
change: function($event) {
|
|
356
|
+
"enter": _vm.submit,
|
|
357
|
+
"change": function($event) {
|
|
325
358
|
return _vm.propChange(item.column, column);
|
|
326
359
|
}
|
|
327
360
|
},
|
|
@@ -339,7 +372,7 @@ var render = function() {
|
|
|
339
372
|
return [_vm._t(ssItem, null, null, scope)];
|
|
340
373
|
}
|
|
341
374
|
};
|
|
342
|
-
})], null,
|
|
375
|
+
})], null, true),
|
|
343
376
|
model: {
|
|
344
377
|
value: _vm.form[column.prop],
|
|
345
378
|
callback: function($$v) {
|
|
@@ -347,7 +380,7 @@ var render = function() {
|
|
|
347
380
|
},
|
|
348
381
|
expression: "form[column.prop]"
|
|
349
382
|
}
|
|
350
|
-
}, "FormTemp", _vm.uploadFun(column),
|
|
383
|
+
}, "FormTemp", _vm.uploadFun(column), false))], 2)], 1)], 1) : _vm._e(), _vm.vaildDisplay(column) && column.row && column.span !== 24 && column.count ? _c("div", {
|
|
351
384
|
key: `line${cindex}`,
|
|
352
385
|
staticClass: "avue-form__line",
|
|
353
386
|
style: {
|
|
@@ -360,7 +393,7 @@ var render = function() {
|
|
|
360
393
|
fn: function(scope) {
|
|
361
394
|
return [_vm._t("menuForm", null, null, scope)];
|
|
362
395
|
}
|
|
363
|
-
}], null,
|
|
396
|
+
}], null, true)
|
|
364
397
|
}) : _vm._e()], 2)], 1);
|
|
365
398
|
}), !_vm.isDetail && _vm.isMenu ? _c("FyFormMenu", {
|
|
366
399
|
scopedSlots: _vm._u([{
|
|
@@ -368,9 +401,11 @@ var render = function() {
|
|
|
368
401
|
fn: function(scope) {
|
|
369
402
|
return [_vm._t("menuForm", null, null, scope)];
|
|
370
403
|
}
|
|
371
|
-
}], null,
|
|
404
|
+
}], null, true)
|
|
372
405
|
}) : _vm._e()], 2)], 1)], 1);
|
|
373
|
-
}
|
|
406
|
+
};
|
|
407
|
+
var staticRenderFns = [];
|
|
408
|
+
const FyForm_vue_vue_type_style_index_0_lang = "";
|
|
374
409
|
const __vue2_script = {
|
|
375
410
|
name: "FyForm",
|
|
376
411
|
mixins: [init],
|
|
@@ -388,29 +423,31 @@ const __vue2_script = {
|
|
|
388
423
|
uploadExceed: Function,
|
|
389
424
|
status: {
|
|
390
425
|
type: Boolean,
|
|
391
|
-
default:
|
|
426
|
+
default: false
|
|
392
427
|
},
|
|
393
428
|
isCrud: {
|
|
394
429
|
type: Boolean,
|
|
395
|
-
default:
|
|
430
|
+
default: false
|
|
396
431
|
},
|
|
397
432
|
value: {
|
|
398
433
|
type: Object,
|
|
399
|
-
required:
|
|
400
|
-
default: () =>
|
|
434
|
+
required: true,
|
|
435
|
+
default: () => {
|
|
436
|
+
return {};
|
|
437
|
+
}
|
|
401
438
|
}
|
|
402
439
|
},
|
|
403
440
|
data() {
|
|
404
441
|
return {
|
|
405
442
|
activeName: "",
|
|
406
443
|
labelWidth: 90,
|
|
407
|
-
allDisabled:
|
|
444
|
+
allDisabled: false,
|
|
408
445
|
optionIndex: [],
|
|
409
|
-
optionBox:
|
|
446
|
+
optionBox: false,
|
|
410
447
|
tableOption: {},
|
|
411
448
|
itemSpanDefault: 12,
|
|
412
449
|
form: {},
|
|
413
|
-
formCreate:
|
|
450
|
+
formCreate: false,
|
|
414
451
|
formList: [],
|
|
415
452
|
formBind: {}
|
|
416
453
|
};
|
|
@@ -426,10 +463,10 @@ const __vue2_script = {
|
|
|
426
463
|
return this.columnOption.length !== 1;
|
|
427
464
|
},
|
|
428
465
|
isDetail() {
|
|
429
|
-
return this.detail ===
|
|
466
|
+
return this.detail === true;
|
|
430
467
|
},
|
|
431
468
|
isTabs() {
|
|
432
|
-
return this.parentOption.tabs ===
|
|
469
|
+
return this.parentOption.tabs === true;
|
|
433
470
|
},
|
|
434
471
|
isAdd() {
|
|
435
472
|
return this.boxType === "add";
|
|
@@ -460,83 +497,110 @@ const __vue2_script = {
|
|
|
460
497
|
},
|
|
461
498
|
dynamicOption() {
|
|
462
499
|
const list = [];
|
|
463
|
-
|
|
464
|
-
ele.type === "dynamic" && this.vaildDisplay(ele)
|
|
465
|
-
|
|
500
|
+
this.propOption.forEach((ele) => {
|
|
501
|
+
if (ele.type === "dynamic" && this.vaildDisplay(ele)) {
|
|
502
|
+
list.push(ele);
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
return list;
|
|
466
506
|
},
|
|
467
507
|
propOption() {
|
|
468
508
|
const list = [];
|
|
469
|
-
|
|
470
|
-
option.display !==
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
509
|
+
this.columnOption.forEach((option) => {
|
|
510
|
+
if (option.display !== false) {
|
|
511
|
+
option.column.forEach((column) => {
|
|
512
|
+
list.push(column);
|
|
513
|
+
});
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
return list;
|
|
474
517
|
},
|
|
475
518
|
parentOption() {
|
|
476
519
|
return this.tableOption || {};
|
|
477
520
|
},
|
|
478
521
|
columnOption() {
|
|
479
|
-
const column = this.tableOption.column || []
|
|
480
|
-
|
|
481
|
-
|
|
522
|
+
const column = this.tableOption.column || [];
|
|
523
|
+
const group = deepClone(this.tableOption.group) || [];
|
|
524
|
+
const footer = this.tableOption.footer || [];
|
|
525
|
+
group.unshift({
|
|
526
|
+
header: false,
|
|
482
527
|
column
|
|
483
|
-
})
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
528
|
+
});
|
|
529
|
+
if (footer.length !== 0) {
|
|
530
|
+
group.push({
|
|
531
|
+
header: false,
|
|
532
|
+
column: footer
|
|
533
|
+
});
|
|
534
|
+
}
|
|
535
|
+
group.forEach((ele) => {
|
|
536
|
+
ele.column = ele.column || [];
|
|
537
|
+
ele.column.forEach((column2, cindex) => {
|
|
538
|
+
if (column2.display !== false && !this.isMobile) {
|
|
539
|
+
column2 = calcCount(column2, this.itemSpanDefault, cindex === 0);
|
|
540
|
+
}
|
|
541
|
+
});
|
|
542
|
+
ele.column = calcCascader(ele.column);
|
|
543
|
+
ele.column = ele.column.sort((a, b) => (b.order || 0) - (a.order || 0));
|
|
544
|
+
});
|
|
545
|
+
return group;
|
|
491
546
|
},
|
|
492
547
|
menuPosition: function() {
|
|
493
|
-
|
|
548
|
+
if (this.parentOption.menuPosition) {
|
|
549
|
+
return this.parentOption.menuPosition;
|
|
550
|
+
} else {
|
|
551
|
+
return "center";
|
|
552
|
+
}
|
|
494
553
|
},
|
|
495
554
|
boxType: function() {
|
|
496
555
|
return this.parentOption.boxType;
|
|
497
556
|
},
|
|
498
557
|
isPrint() {
|
|
499
|
-
return this.parentOption.printBtn ===
|
|
558
|
+
return this.parentOption.printBtn === true;
|
|
500
559
|
},
|
|
501
560
|
tabsActive() {
|
|
502
561
|
return this.tableOption.tabsActive || "1";
|
|
503
562
|
},
|
|
504
563
|
isMock() {
|
|
505
|
-
return this.parentOption.mockBtn ===
|
|
564
|
+
return this.parentOption.mockBtn === true;
|
|
506
565
|
}
|
|
507
566
|
},
|
|
508
567
|
watch: {
|
|
509
568
|
value: {
|
|
510
569
|
handler() {
|
|
511
|
-
this.formCreate
|
|
570
|
+
if (this.formCreate) {
|
|
571
|
+
this.setForm();
|
|
572
|
+
}
|
|
512
573
|
},
|
|
513
|
-
deep:
|
|
574
|
+
deep: true
|
|
514
575
|
},
|
|
515
576
|
form: {
|
|
516
577
|
handler() {
|
|
517
|
-
|
|
578
|
+
if (this.formCreate) {
|
|
579
|
+
this.setLabel();
|
|
580
|
+
this.setVal();
|
|
581
|
+
}
|
|
518
582
|
},
|
|
519
|
-
deep:
|
|
583
|
+
deep: true
|
|
520
584
|
},
|
|
521
585
|
tabsActive: {
|
|
522
586
|
handler() {
|
|
523
587
|
this.activeName = this.tabsActive;
|
|
524
588
|
},
|
|
525
|
-
immediate:
|
|
589
|
+
immediate: true
|
|
526
590
|
},
|
|
527
591
|
DIC: {
|
|
528
592
|
handler() {
|
|
529
593
|
this.setLabel();
|
|
530
594
|
},
|
|
531
|
-
deep:
|
|
532
|
-
immediate:
|
|
595
|
+
deep: true,
|
|
596
|
+
immediate: true
|
|
533
597
|
},
|
|
534
598
|
allDisabled: {
|
|
535
599
|
handler(val) {
|
|
536
600
|
this.$emit("update:status", val);
|
|
537
601
|
},
|
|
538
|
-
deep:
|
|
539
|
-
immediate:
|
|
602
|
+
deep: true,
|
|
603
|
+
immediate: true
|
|
540
604
|
}
|
|
541
605
|
},
|
|
542
606
|
mounted() {
|
|
@@ -564,42 +628,70 @@ const __vue2_script = {
|
|
|
564
628
|
return column.span || this.parentOption.span || this.itemSpanDefault;
|
|
565
629
|
},
|
|
566
630
|
isGroupShow(item, index) {
|
|
567
|
-
|
|
631
|
+
if (this.isTabs) {
|
|
632
|
+
return index == this.activeName || index == 0;
|
|
633
|
+
} else {
|
|
634
|
+
return true;
|
|
635
|
+
}
|
|
568
636
|
},
|
|
569
637
|
// 初始化表单
|
|
570
638
|
dataFormat() {
|
|
571
|
-
const formDefault = formInitVal(this.propOption).tableForm
|
|
639
|
+
const formDefault = formInitVal(this.propOption).tableForm;
|
|
640
|
+
const formValue = this.value;
|
|
641
|
+
const form = {};
|
|
572
642
|
Object.entries(Object.assign(formDefault, formValue)).forEach((ele) => {
|
|
573
|
-
const key = ele[0]
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
643
|
+
const key = ele[0];
|
|
644
|
+
const value = ele[1];
|
|
645
|
+
if (isBlank(formValue[key])) {
|
|
646
|
+
form[key] = value;
|
|
647
|
+
} else {
|
|
648
|
+
form[key] = formValue[key];
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
this.$set(this, "form", form);
|
|
652
|
+
this.setLabel();
|
|
653
|
+
this.setControl();
|
|
654
|
+
this.setVal();
|
|
655
|
+
setTimeout(() => {
|
|
656
|
+
this.formCreate = true;
|
|
657
|
+
this.clearValidate();
|
|
577
658
|
});
|
|
578
659
|
},
|
|
579
660
|
setControl() {
|
|
580
661
|
this.propOption.forEach((column) => {
|
|
581
|
-
const prop = column.prop
|
|
662
|
+
const prop = column.prop;
|
|
663
|
+
const bind = column.bind;
|
|
664
|
+
const control = column.control;
|
|
582
665
|
if (!this.formBind[prop]) {
|
|
583
666
|
const bindList = [];
|
|
584
667
|
if (bind) {
|
|
585
668
|
const formProp = this.$watch(`form.${prop}`, (n, o) => {
|
|
586
|
-
n != o
|
|
587
|
-
|
|
588
|
-
|
|
669
|
+
if (n != o)
|
|
670
|
+
setAsVal(this.form, bind, n);
|
|
671
|
+
});
|
|
672
|
+
const formDeep = this.$watch(`form.${bind}`, (n, o) => {
|
|
673
|
+
if (n != o)
|
|
674
|
+
this.$set(this.form, prop, n);
|
|
589
675
|
});
|
|
590
|
-
bindList.push(formProp)
|
|
676
|
+
bindList.push(formProp);
|
|
677
|
+
bindList.push(formDeep);
|
|
678
|
+
this.$set(this.form, prop, getAsVal(this.form, bind));
|
|
591
679
|
}
|
|
592
680
|
if (control) {
|
|
593
681
|
const callback = () => {
|
|
594
682
|
const controlList = control(this.form[column.prop], this.form) || {};
|
|
595
683
|
Object.keys(controlList).forEach((item) => {
|
|
596
684
|
const ele = Object.assign(this.objectOption[item] || {}, controlList[item]);
|
|
597
|
-
this.$set(this.objectOption, item, ele)
|
|
685
|
+
this.$set(this.objectOption, item, ele);
|
|
686
|
+
if (controlList[item].dicData)
|
|
687
|
+
this.DIC[item] = controlList[item].dicData;
|
|
598
688
|
});
|
|
599
|
-
}
|
|
689
|
+
};
|
|
690
|
+
const formControl = this.$watch(`form.${prop}`, () => {
|
|
600
691
|
callback();
|
|
601
692
|
});
|
|
602
|
-
bindList.push(formControl)
|
|
693
|
+
bindList.push(formControl);
|
|
694
|
+
callback();
|
|
603
695
|
}
|
|
604
696
|
this.formBind[prop] = bindList;
|
|
605
697
|
}
|
|
@@ -611,14 +703,29 @@ const __vue2_script = {
|
|
|
611
703
|
});
|
|
612
704
|
},
|
|
613
705
|
setVal() {
|
|
614
|
-
this.$emit("input", this.form)
|
|
706
|
+
this.$emit("input", this.form);
|
|
707
|
+
this.$emit("change", this.form);
|
|
615
708
|
},
|
|
616
709
|
setLabel() {
|
|
617
|
-
this.tableOption.filterNull ===
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
710
|
+
if (this.tableOption.filterNull === true) {
|
|
711
|
+
this.form = filterParams(this.form, [""], false);
|
|
712
|
+
}
|
|
713
|
+
if (this.tableOption.filterDic == true) {
|
|
714
|
+
this.form = filterParams(this.form, ["$"], false);
|
|
715
|
+
} else {
|
|
716
|
+
this.propOption.forEach((column) => {
|
|
717
|
+
let result;
|
|
718
|
+
const DIC = this.DIC[column.prop];
|
|
719
|
+
if (isBlank(DIC))
|
|
720
|
+
return;
|
|
721
|
+
result = detail(this.form, column, this.tableOption, DIC);
|
|
722
|
+
if (result) {
|
|
723
|
+
this.$set(this.form, `$${column.prop}`, result);
|
|
724
|
+
} else {
|
|
725
|
+
this.$delete(this.form, `$${column.prop}`);
|
|
726
|
+
}
|
|
727
|
+
});
|
|
728
|
+
}
|
|
622
729
|
},
|
|
623
730
|
handleGroupClick(activeNames) {
|
|
624
731
|
this.$emit("tab-click", activeNames);
|
|
@@ -628,7 +735,14 @@ const __vue2_script = {
|
|
|
628
735
|
},
|
|
629
736
|
getLabelWidth(column, item) {
|
|
630
737
|
let result;
|
|
631
|
-
|
|
738
|
+
if (!isBlank(column.labelWidth)) {
|
|
739
|
+
result = column.labelWidth;
|
|
740
|
+
} else if (!isBlank(item.labelWidth)) {
|
|
741
|
+
result = item.labelWidth;
|
|
742
|
+
} else {
|
|
743
|
+
result = this.parentOption.labelWidth;
|
|
744
|
+
}
|
|
745
|
+
return setPx(result, this.labelWidth);
|
|
632
746
|
},
|
|
633
747
|
// 对部分表单字段进行校验的方法
|
|
634
748
|
validateField(val) {
|
|
@@ -642,20 +756,36 @@ const __vue2_script = {
|
|
|
642
756
|
},
|
|
643
757
|
handleChange(list, column) {
|
|
644
758
|
this.$nextTick(() => {
|
|
645
|
-
const cascader = column.cascader
|
|
759
|
+
const cascader = column.cascader;
|
|
760
|
+
const str = cascader.join(",");
|
|
646
761
|
cascader.forEach((item) => {
|
|
647
|
-
const columnNextProp = item
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
762
|
+
const columnNextProp = item;
|
|
763
|
+
const value = this.form[column.prop];
|
|
764
|
+
const columnNext = this.findObject(list, columnNextProp);
|
|
765
|
+
if (isBlank(columnNext))
|
|
766
|
+
return;
|
|
767
|
+
if (this.formList.includes(str)) {
|
|
768
|
+
cascader.forEach((ele) => {
|
|
769
|
+
this.form[ele] = "";
|
|
770
|
+
this.$set(this.DIC, ele, []);
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
if (isBlank(cascader) || isBlank(value) || isBlank(columnNext)) {
|
|
774
|
+
return;
|
|
775
|
+
}
|
|
776
|
+
sendDic({
|
|
651
777
|
column: columnNext,
|
|
652
778
|
value,
|
|
653
779
|
form: this.form
|
|
654
780
|
}).then((res) => {
|
|
655
|
-
this.formList.includes(str)
|
|
781
|
+
if (!this.formList.includes(str))
|
|
782
|
+
this.formList.push(str);
|
|
656
783
|
const dic = res || [];
|
|
657
|
-
this.$set(this.DIC, columnNextProp, dic)
|
|
658
|
-
|
|
784
|
+
this.$set(this.DIC, columnNextProp, dic);
|
|
785
|
+
if (!isBlank(dic) && !isBlank(dic) && !isBlank(columnNext.cascaderIndex) && isBlank(this.form[columnNextProp])) {
|
|
786
|
+
this.form[columnNextProp] = dic[columnNext.cascaderIndex][(columnNext.props || {}).value || DIC_PROPS.value];
|
|
787
|
+
}
|
|
788
|
+
});
|
|
659
789
|
});
|
|
660
790
|
});
|
|
661
791
|
},
|
|
@@ -663,56 +793,80 @@ const __vue2_script = {
|
|
|
663
793
|
this.$Print(this.$el);
|
|
664
794
|
},
|
|
665
795
|
propChange(option, column) {
|
|
666
|
-
column.cascader
|
|
796
|
+
if (column.cascader)
|
|
797
|
+
this.handleChange(option, column);
|
|
667
798
|
},
|
|
668
799
|
handleMock() {
|
|
669
|
-
|
|
800
|
+
if (!this.isMock)
|
|
801
|
+
return;
|
|
802
|
+
this.columnOption.forEach((column) => {
|
|
670
803
|
const form = mock(column.column, this.DIC, this.form, this.isMock);
|
|
671
|
-
isBlank(form)
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
})
|
|
804
|
+
if (!isBlank(form)) {
|
|
805
|
+
Object.keys(form).forEach((ele) => {
|
|
806
|
+
this.form[ele] = form[ele];
|
|
807
|
+
});
|
|
808
|
+
}
|
|
809
|
+
});
|
|
810
|
+
this.$nextTick(() => {
|
|
811
|
+
this.clearValidate();
|
|
812
|
+
this.$emit("mock-change", this.form);
|
|
813
|
+
});
|
|
677
814
|
},
|
|
678
815
|
vaildDetail(column) {
|
|
679
816
|
let key;
|
|
680
817
|
if (this.detail)
|
|
681
|
-
return
|
|
682
|
-
if (!isBlank(column.detail))
|
|
818
|
+
return false;
|
|
819
|
+
if (!isBlank(column.detail)) {
|
|
683
820
|
key = "detail";
|
|
684
|
-
else if (this.isAdd)
|
|
821
|
+
} else if (this.isAdd) {
|
|
685
822
|
key = "addDetail";
|
|
686
|
-
else if (this.isEdit)
|
|
823
|
+
} else if (this.isEdit) {
|
|
687
824
|
key = "editDetail";
|
|
688
|
-
else if (this.isView)
|
|
689
|
-
return
|
|
690
|
-
|
|
825
|
+
} else if (this.isView) {
|
|
826
|
+
return false;
|
|
827
|
+
}
|
|
828
|
+
if (key)
|
|
829
|
+
return column[key] === true;
|
|
830
|
+
return false;
|
|
691
831
|
},
|
|
692
832
|
// 验证表单是否禁止
|
|
693
833
|
vaildDisabled(column) {
|
|
694
834
|
let key;
|
|
695
835
|
if (this.disabled)
|
|
696
|
-
return
|
|
697
|
-
if (!isBlank(column.disabled))
|
|
836
|
+
return true;
|
|
837
|
+
if (!isBlank(column.disabled)) {
|
|
698
838
|
key = "disabled";
|
|
699
|
-
else if (this.isAdd)
|
|
839
|
+
} else if (this.isAdd) {
|
|
700
840
|
key = "addDisabled";
|
|
701
|
-
else if (this.isEdit)
|
|
841
|
+
} else if (this.isEdit) {
|
|
702
842
|
key = "editDisabled";
|
|
703
|
-
else if (this.isView)
|
|
704
|
-
return
|
|
705
|
-
|
|
843
|
+
} else if (this.isView) {
|
|
844
|
+
return true;
|
|
845
|
+
}
|
|
846
|
+
if (key)
|
|
847
|
+
return column[key] === true;
|
|
848
|
+
return false;
|
|
706
849
|
},
|
|
707
850
|
// 验证表单是否显隐
|
|
708
851
|
vaildDisplay(column) {
|
|
709
852
|
let key;
|
|
710
|
-
|
|
853
|
+
if (!isBlank(column.display)) {
|
|
854
|
+
key = "display";
|
|
855
|
+
} else if (this.isAdd) {
|
|
856
|
+
key = "addDisplay";
|
|
857
|
+
} else if (this.isEdit) {
|
|
858
|
+
key = "editDisplay";
|
|
859
|
+
} else if (this.isView) {
|
|
860
|
+
key = "viewDisplay";
|
|
861
|
+
}
|
|
862
|
+
if (key)
|
|
863
|
+
return optVal(column[key], true);
|
|
864
|
+
return true;
|
|
711
865
|
},
|
|
712
866
|
clearValidate(list) {
|
|
713
867
|
return __async(this, null, function* () {
|
|
714
868
|
var _a;
|
|
715
|
-
(_a = this.$refs.form) == null
|
|
869
|
+
(_a = this.$refs.form) == null ? void 0 : _a.clearValidate(list);
|
|
716
870
|
});
|
|
717
871
|
},
|
|
718
872
|
validateCellForm() {
|
|
@@ -724,59 +878,83 @@ const __vue2_script = {
|
|
|
724
878
|
},
|
|
725
879
|
validate(callback) {
|
|
726
880
|
this.$refs.form.validate((valid, msg) => {
|
|
727
|
-
const dynamicList = []
|
|
881
|
+
const dynamicList = [];
|
|
882
|
+
const dynamicName = [];
|
|
883
|
+
const dynamicError = {};
|
|
728
884
|
this.dynamicOption.forEach((ele) => {
|
|
729
885
|
const isForm = ele.children.type === "form";
|
|
730
|
-
dynamicName.push(ele.prop)
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
886
|
+
dynamicName.push(ele.prop);
|
|
887
|
+
if (isForm) {
|
|
888
|
+
if (!isBlank(this.$refs[ele.prop][0].$refs.temp.$refs.main)) {
|
|
889
|
+
this.$refs[ele.prop][0].$refs.temp.$refs.main.forEach((ele2) => {
|
|
890
|
+
dynamicList.push(ele2.validateCellForm());
|
|
891
|
+
});
|
|
892
|
+
}
|
|
893
|
+
} else {
|
|
894
|
+
dynamicList.push(this.$refs[ele.prop][0].$refs.temp.$refs.main.validateCellForm());
|
|
895
|
+
}
|
|
896
|
+
});
|
|
897
|
+
Promise.all(dynamicList).then((res) => {
|
|
734
898
|
res.forEach((error, index) => {
|
|
735
|
-
isBlank(error)
|
|
899
|
+
if (!isBlank(error)) {
|
|
900
|
+
dynamicError[dynamicName[index]] = error;
|
|
901
|
+
}
|
|
736
902
|
});
|
|
737
903
|
const result = Object.assign(dynamicError, msg);
|
|
738
|
-
isBlank(result)
|
|
904
|
+
if (isBlank(result)) {
|
|
905
|
+
this.show();
|
|
906
|
+
callback(true, this.hide);
|
|
907
|
+
} else {
|
|
908
|
+
callback(false, this.hide, result);
|
|
909
|
+
}
|
|
739
910
|
});
|
|
740
911
|
});
|
|
741
912
|
},
|
|
742
|
-
resetForm(reset =
|
|
913
|
+
resetForm(reset = true) {
|
|
743
914
|
if (reset) {
|
|
744
915
|
const propList = this.propOption.map((ele) => ele.prop);
|
|
745
916
|
this.form = clearVal(this.form, propList, (this.tableOption.filterParams || []).concat([this.rowKey]));
|
|
746
917
|
}
|
|
747
918
|
this.$nextTick(() => {
|
|
748
|
-
this.clearValidate()
|
|
919
|
+
this.clearValidate();
|
|
920
|
+
this.$emit("reset-change");
|
|
749
921
|
});
|
|
750
922
|
},
|
|
751
923
|
resetFields() {
|
|
752
924
|
this.$refs.form.resetFields();
|
|
753
925
|
},
|
|
754
926
|
show() {
|
|
755
|
-
this.allDisabled =
|
|
927
|
+
this.allDisabled = true;
|
|
756
928
|
},
|
|
757
929
|
hide() {
|
|
758
|
-
this.allDisabled =
|
|
930
|
+
this.allDisabled = false;
|
|
759
931
|
},
|
|
760
932
|
submit() {
|
|
761
933
|
this.validate((valid, msg) => {
|
|
762
|
-
|
|
934
|
+
if (valid) {
|
|
935
|
+
this.$emit("submit", filterParams(this.form, ["$"]), this.hide);
|
|
936
|
+
} else {
|
|
937
|
+
this.$emit("error", msg);
|
|
938
|
+
}
|
|
763
939
|
});
|
|
764
940
|
}
|
|
765
941
|
}
|
|
766
|
-
}
|
|
942
|
+
};
|
|
943
|
+
const __cssModules = {};
|
|
767
944
|
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
768
945
|
__vue2_script,
|
|
769
946
|
render,
|
|
770
947
|
staticRenderFns,
|
|
771
|
-
|
|
948
|
+
false,
|
|
772
949
|
__vue2_injectStyles,
|
|
773
950
|
null,
|
|
774
951
|
null,
|
|
775
952
|
null
|
|
776
953
|
);
|
|
777
954
|
function __vue2_injectStyles(context) {
|
|
778
|
-
for (let o in __cssModules)
|
|
955
|
+
for (let o in __cssModules) {
|
|
779
956
|
this[o] = __cssModules[o];
|
|
957
|
+
}
|
|
780
958
|
}
|
|
781
959
|
const FyForm = /* @__PURE__ */ function() {
|
|
782
960
|
return __component__.exports;
|