@web-utils/component 2.7.29 → 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 +56 -115
- package/dist/components/dialog-form/style.css +10 -1
- 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 +71 -162
- package/dist/components/image-cropper/style.css +34 -1
- package/dist/components/image-preview/index.js +78 -170
- 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 +15982 -9409
- 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
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { p as packages } from "../../chunks/packages.
|
|
2
|
-
import { p as permission } from "../../chunks/permission.
|
|
3
|
-
import { i as init } from "../../chunks/init.
|
|
4
|
-
import { c as config } from "../../chunks/config.
|
|
5
|
-
import { c as calcCascader, t as translate, f as formInitVal } from "../../chunks/dataformat.
|
|
6
|
-
import { D as DIC_PROPS, s as setPx, o as optVal, d as deepClone } from "../../chunks/util.
|
|
1
|
+
import { p as packages } from "../../chunks/packages.c4ea639d.js";
|
|
2
|
+
import { p as permission } from "../../chunks/permission.9c766972.js";
|
|
3
|
+
import { i as init } from "../../chunks/init.38cbb3a2.js";
|
|
4
|
+
import { c as config } from "../../chunks/config.75161c38.js";
|
|
5
|
+
import { c as calcCascader, t as translate, f as formInitVal } from "../../chunks/dataformat.b8c8c01a.js";
|
|
6
|
+
import { D as DIC_PROPS, s as setPx, o as optVal, d as deepClone } from "../../chunks/util.b0d0b0ad.js";
|
|
7
7
|
import { isBlank } from "@web-utils/core";
|
|
8
|
-
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.
|
|
8
|
+
import { n as normalizeComponent } from "../../chunks/vueComponentNormalizer.9c6b8b3d.js";
|
|
9
9
|
var render = function() {
|
|
10
|
-
var _vm = this
|
|
10
|
+
var _vm = this;
|
|
11
|
+
var _h = _vm.$createElement;
|
|
12
|
+
var _c = _vm._self._c || _h;
|
|
11
13
|
return _c("div", {
|
|
12
14
|
staticClass: "avue-crud avue-crud--card"
|
|
13
15
|
}, [_vm.tableOption.title ? _c(_vm.tableOption.titleSize || "h2", {
|
|
@@ -32,8 +34,8 @@ var render = function() {
|
|
|
32
34
|
return [_vm._t(item, null, null, scope)];
|
|
33
35
|
}
|
|
34
36
|
};
|
|
35
|
-
})], null,
|
|
36
|
-
}), _vm.optVal(_vm.tableOption.header,
|
|
37
|
+
})], null, true)
|
|
38
|
+
}), _vm.optVal(_vm.tableOption.header, true) ? _c("HeaderMenu", {
|
|
37
39
|
ref: "headerMenu",
|
|
38
40
|
scopedSlots: _vm._u([{
|
|
39
41
|
key: "menuLeft",
|
|
@@ -45,7 +47,7 @@ var render = function() {
|
|
|
45
47
|
fn: function(scope) {
|
|
46
48
|
return [_vm._t("menuRight", null, null, scope)];
|
|
47
49
|
}
|
|
48
|
-
}], null,
|
|
50
|
+
}], null, true)
|
|
49
51
|
}) : _vm._e(), _vm.optVal(_vm.tableOption.tip, _vm.config.tip) && _vm.tableOption.selection ? _c("ElTag", {
|
|
50
52
|
staticClass: "avue-crud__tip"
|
|
51
53
|
}, [_c("span", {
|
|
@@ -60,20 +62,20 @@ var render = function() {
|
|
|
60
62
|
expression: "getPermission('selectClearBtn')"
|
|
61
63
|
}],
|
|
62
64
|
attrs: {
|
|
63
|
-
type: "text",
|
|
64
|
-
size: "small"
|
|
65
|
+
"type": "text",
|
|
66
|
+
"size": "small"
|
|
65
67
|
},
|
|
66
68
|
on: {
|
|
67
|
-
click: _vm.selectClear
|
|
69
|
+
"click": _vm.selectClear
|
|
68
70
|
}
|
|
69
71
|
}, [_vm._v(" 清 空 ")]) : _vm._e(), _vm._t("tip")], 2) : _vm._e(), _vm._t("header"), _c("ElForm", {
|
|
70
72
|
ref: "cellForm",
|
|
71
73
|
attrs: {
|
|
72
|
-
model: _vm.cellForm,
|
|
73
|
-
"show-message":
|
|
74
|
+
"model": _vm.cellForm,
|
|
75
|
+
"show-message": false
|
|
74
76
|
},
|
|
75
77
|
on: {
|
|
76
|
-
validate: _vm.handleValidate
|
|
78
|
+
"validate": _vm.handleValidate
|
|
77
79
|
}
|
|
78
80
|
}, [_c("ElTable", {
|
|
79
81
|
directives: [{
|
|
@@ -85,14 +87,14 @@ var render = function() {
|
|
|
85
87
|
key: _vm.reload,
|
|
86
88
|
ref: "table",
|
|
87
89
|
class: {
|
|
88
|
-
"avue-crud--indeterminate": _vm.optVal(_vm.tableOption.indeterminate,
|
|
90
|
+
"avue-crud--indeterminate": _vm.optVal(_vm.tableOption.indeterminate, false)
|
|
89
91
|
},
|
|
90
92
|
attrs: {
|
|
91
|
-
data: _vm.cellForm.list,
|
|
93
|
+
"data": _vm.cellForm.list,
|
|
92
94
|
"row-key": _vm.rowKey,
|
|
93
|
-
size: _vm.$AVUE.tableSize || _vm.controlSize,
|
|
94
|
-
lazy: _vm.optVal(_vm.tableOption.lazy,
|
|
95
|
-
load: _vm.treeLoad,
|
|
95
|
+
"size": _vm.$AVUE.tableSize || _vm.controlSize,
|
|
96
|
+
"lazy": _vm.optVal(_vm.tableOption.lazy, false),
|
|
97
|
+
"load": _vm.treeLoad,
|
|
96
98
|
"tree-props": _vm.treeProps,
|
|
97
99
|
"expand-row-keys": _vm.tableOption.expandRowKeys,
|
|
98
100
|
"default-expand-all": _vm.tableOption.defaultExpandAll,
|
|
@@ -100,19 +102,19 @@ var render = function() {
|
|
|
100
102
|
"show-summary": _vm.tableOption.showSummary,
|
|
101
103
|
"summary-method": _vm.tableSummaryMethod,
|
|
102
104
|
"span-method": _vm.tableSpanMethod,
|
|
103
|
-
stripe: _vm.tableOption.stripe,
|
|
105
|
+
"stripe": _vm.tableOption.stripe,
|
|
104
106
|
"show-header": _vm.tableOption.showHeader,
|
|
105
107
|
"default-sort": _vm.tableOption.defaultSort,
|
|
106
108
|
"row-class-name": _vm.rowClassName,
|
|
107
109
|
"cell-class-name": _vm.cellClassName,
|
|
108
110
|
"row-style": _vm.rowStyle,
|
|
109
111
|
"cell-style": _vm.cellStyle,
|
|
110
|
-
fit: _vm.tableOption.fit,
|
|
112
|
+
"fit": _vm.tableOption.fit,
|
|
111
113
|
"header-cell-class-name": _vm.headerCellClassName,
|
|
112
114
|
"max-height": _vm.isAutoHeight ? _vm.tableHeight : _vm.tableOption.maxHeight,
|
|
113
|
-
height: _vm.tableHeight,
|
|
114
|
-
width: _vm.setPx(_vm.tableOption.width, _vm.config.width),
|
|
115
|
-
border: _vm.tableOption.border
|
|
115
|
+
"height": _vm.tableHeight,
|
|
116
|
+
"width": _vm.setPx(_vm.tableOption.width, _vm.config.width),
|
|
117
|
+
"border": _vm.tableOption.border
|
|
116
118
|
},
|
|
117
119
|
on: {
|
|
118
120
|
"current-change": _vm.currentRowChange,
|
|
@@ -129,7 +131,7 @@ var render = function() {
|
|
|
129
131
|
"cell-dblclick": _vm.cellDblclick,
|
|
130
132
|
"filter-change": _vm.filterChange,
|
|
131
133
|
"selection-change": _vm.selectionChange,
|
|
132
|
-
select: _vm.select,
|
|
134
|
+
"select": _vm.select,
|
|
133
135
|
"select-all": _vm.selectAll,
|
|
134
136
|
"sort-change": _vm.sortChange
|
|
135
137
|
},
|
|
@@ -140,12 +142,12 @@ var render = function() {
|
|
|
140
142
|
staticClass: "avue-crud__empty",
|
|
141
143
|
attrs: {
|
|
142
144
|
"image-size": 100,
|
|
143
|
-
description: _vm.tableOption.emptyText
|
|
145
|
+
"description": _vm.tableOption.emptyText
|
|
144
146
|
}
|
|
145
147
|
})];
|
|
146
148
|
},
|
|
147
|
-
proxy:
|
|
148
|
-
}], null,
|
|
149
|
+
proxy: true
|
|
150
|
+
}], null, true)
|
|
149
151
|
}, [_c("Column", {
|
|
150
152
|
attrs: {
|
|
151
153
|
"column-option": _vm.columnOption
|
|
@@ -160,14 +162,14 @@ var render = function() {
|
|
|
160
162
|
fn: function(_ref) {
|
|
161
163
|
var row = _ref.row, index = _ref.index;
|
|
162
164
|
return [_vm._t("expand", null, {
|
|
163
|
-
row,
|
|
164
|
-
index
|
|
165
|
+
"row": row,
|
|
166
|
+
"index": index
|
|
165
167
|
})];
|
|
166
168
|
}
|
|
167
|
-
}], null,
|
|
169
|
+
}], null, true)
|
|
168
170
|
})];
|
|
169
171
|
},
|
|
170
|
-
proxy:
|
|
172
|
+
proxy: true
|
|
171
173
|
}, _vm._l(_vm.mainSlot, function(item) {
|
|
172
174
|
return {
|
|
173
175
|
key: item,
|
|
@@ -189,11 +191,11 @@ var render = function() {
|
|
|
189
191
|
fn: function(scope) {
|
|
190
192
|
return [_vm._t("menuBtn", null, null, scope)];
|
|
191
193
|
}
|
|
192
|
-
}], null,
|
|
194
|
+
}], null, true)
|
|
193
195
|
})];
|
|
194
196
|
},
|
|
195
|
-
proxy:
|
|
196
|
-
}], null,
|
|
197
|
+
proxy: true
|
|
198
|
+
}], null, true)
|
|
197
199
|
})], 1)], 1), _vm._t("footer"), _c("TablePage", {
|
|
198
200
|
ref: "tablePage"
|
|
199
201
|
}), _c("FyDialogForm", {
|
|
@@ -210,7 +212,7 @@ var render = function() {
|
|
|
210
212
|
fn: function(scope) {
|
|
211
213
|
return [_vm._t("menuForm", null, null, scope)];
|
|
212
214
|
}
|
|
213
|
-
}], null,
|
|
215
|
+
}], null, true)
|
|
214
216
|
}), _c("DialogColumn", {
|
|
215
217
|
ref: "dialogColumn"
|
|
216
218
|
}), _c("DialogExcel", {
|
|
@@ -218,7 +220,9 @@ var render = function() {
|
|
|
218
220
|
}), _c("DialogFilter", {
|
|
219
221
|
ref: "dialogFilter"
|
|
220
222
|
})], 2);
|
|
221
|
-
}
|
|
223
|
+
};
|
|
224
|
+
var staticRenderFns = [];
|
|
225
|
+
const FyCurd_vue_vue_type_style_index_0_lang = "";
|
|
222
226
|
const __vue2_script = {
|
|
223
227
|
name: "FyCurd",
|
|
224
228
|
directives: {
|
|
@@ -248,11 +252,15 @@ const __vue2_script = {
|
|
|
248
252
|
uploadExceed: Function,
|
|
249
253
|
permission: {
|
|
250
254
|
type: [Function, Object],
|
|
251
|
-
default: () =>
|
|
255
|
+
default: () => {
|
|
256
|
+
return {};
|
|
257
|
+
}
|
|
252
258
|
},
|
|
253
259
|
value: {
|
|
254
260
|
type: Object,
|
|
255
|
-
default: () =>
|
|
261
|
+
default: () => {
|
|
262
|
+
return {};
|
|
263
|
+
}
|
|
256
264
|
},
|
|
257
265
|
search: {
|
|
258
266
|
type: Object,
|
|
@@ -268,16 +276,18 @@ const __vue2_script = {
|
|
|
268
276
|
},
|
|
269
277
|
tableLoading: {
|
|
270
278
|
type: Boolean,
|
|
271
|
-
default:
|
|
279
|
+
default: false
|
|
272
280
|
},
|
|
273
281
|
disabled: {
|
|
274
282
|
type: Boolean,
|
|
275
|
-
default:
|
|
283
|
+
default: false
|
|
276
284
|
},
|
|
277
285
|
data: {
|
|
278
286
|
type: Array,
|
|
279
|
-
required:
|
|
280
|
-
default: () =>
|
|
287
|
+
required: true,
|
|
288
|
+
default: () => {
|
|
289
|
+
return [];
|
|
290
|
+
}
|
|
281
291
|
}
|
|
282
292
|
},
|
|
283
293
|
data() {
|
|
@@ -298,7 +308,7 @@ const __vue2_script = {
|
|
|
298
308
|
cascaderDicList: {},
|
|
299
309
|
cascaderFormList: {},
|
|
300
310
|
btnDisabledList: {},
|
|
301
|
-
btnDisabled:
|
|
311
|
+
btnDisabled: false,
|
|
302
312
|
default: {}
|
|
303
313
|
};
|
|
304
314
|
},
|
|
@@ -338,9 +348,11 @@ const __vue2_script = {
|
|
|
338
348
|
},
|
|
339
349
|
mainSlot() {
|
|
340
350
|
const result = [];
|
|
341
|
-
|
|
342
|
-
this.$scopedSlots[item.prop]
|
|
343
|
-
|
|
351
|
+
this.propOption.forEach((item) => {
|
|
352
|
+
if (this.$scopedSlots[item.prop])
|
|
353
|
+
result.push(item.prop);
|
|
354
|
+
});
|
|
355
|
+
return this.getSlotList(["Header", "Form"], this.$scopedSlots, this.propOption).concat(result);
|
|
344
356
|
},
|
|
345
357
|
calcHeight() {
|
|
346
358
|
return (this.tableOption.calcHeight || 0) + this.$AVUE.calcHeight;
|
|
@@ -348,26 +360,39 @@ const __vue2_script = {
|
|
|
348
360
|
propOption() {
|
|
349
361
|
let result = [];
|
|
350
362
|
function findProp(list = []) {
|
|
351
|
-
Array.isArray(list)
|
|
352
|
-
|
|
363
|
+
if (!Array.isArray(list))
|
|
364
|
+
return;
|
|
365
|
+
list.forEach((ele) => {
|
|
366
|
+
if (Array.isArray(ele.children))
|
|
367
|
+
findProp(ele.children);
|
|
368
|
+
else
|
|
369
|
+
result.push(ele);
|
|
353
370
|
});
|
|
354
371
|
}
|
|
355
|
-
|
|
372
|
+
findProp(this.columnOption);
|
|
373
|
+
result = calcCascader(result);
|
|
374
|
+
return result;
|
|
356
375
|
},
|
|
357
376
|
isShowSummary() {
|
|
358
377
|
return this.option.showSummary;
|
|
359
378
|
},
|
|
360
379
|
isHeader() {
|
|
361
|
-
let flag =
|
|
362
|
-
|
|
363
|
-
ele.children
|
|
364
|
-
|
|
380
|
+
let flag = false;
|
|
381
|
+
this.columnOption.forEach((ele) => {
|
|
382
|
+
if (ele.children) {
|
|
383
|
+
flag = true;
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
return flag;
|
|
365
387
|
},
|
|
366
388
|
isTree() {
|
|
367
|
-
let flag =
|
|
368
|
-
|
|
369
|
-
ele.children
|
|
370
|
-
|
|
389
|
+
let flag = false;
|
|
390
|
+
this.data.forEach((ele) => {
|
|
391
|
+
if (ele.children) {
|
|
392
|
+
flag = true;
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
return flag;
|
|
371
396
|
},
|
|
372
397
|
isCard() {
|
|
373
398
|
return this.option.card ? "always" : "never";
|
|
@@ -376,7 +401,7 @@ const __vue2_script = {
|
|
|
376
401
|
return this.parentOption.expandLevel || 0;
|
|
377
402
|
},
|
|
378
403
|
expandAll() {
|
|
379
|
-
return this.parentOption.expandAll ||
|
|
404
|
+
return this.parentOption.expandAll || false;
|
|
380
405
|
},
|
|
381
406
|
parentOption() {
|
|
382
407
|
return this.tableOption || {};
|
|
@@ -396,55 +421,74 @@ const __vue2_script = {
|
|
|
396
421
|
handler() {
|
|
397
422
|
this.tableForm = this.value;
|
|
398
423
|
},
|
|
399
|
-
immediate:
|
|
400
|
-
deep:
|
|
424
|
+
immediate: true,
|
|
425
|
+
deep: true
|
|
401
426
|
},
|
|
402
427
|
list: {
|
|
403
428
|
handler() {
|
|
404
429
|
this.cellForm.list = this.list;
|
|
405
430
|
},
|
|
406
|
-
deep:
|
|
431
|
+
deep: true
|
|
407
432
|
},
|
|
408
433
|
data: {
|
|
409
434
|
handler() {
|
|
410
435
|
this.dataInit();
|
|
411
436
|
},
|
|
412
|
-
deep:
|
|
437
|
+
deep: true
|
|
413
438
|
}
|
|
414
439
|
},
|
|
415
440
|
mounted() {
|
|
416
|
-
this.dataInit()
|
|
441
|
+
this.dataInit();
|
|
442
|
+
this.getTableHeight();
|
|
443
|
+
this.refreshTable();
|
|
417
444
|
},
|
|
418
445
|
methods: {
|
|
419
446
|
setPx,
|
|
420
447
|
optVal,
|
|
421
448
|
handleValidate(prop, valid, msg) {
|
|
422
|
-
|
|
449
|
+
if (!this.listError[prop])
|
|
450
|
+
this.$set(this.listError, prop, { valid: false, msg: "" });
|
|
451
|
+
this.listError[prop].valid = !valid;
|
|
452
|
+
this.listError[prop].msg = msg;
|
|
423
453
|
},
|
|
424
454
|
getPermission(key, row, index) {
|
|
425
|
-
|
|
455
|
+
if (typeof this.permission === "function") {
|
|
456
|
+
return this.permission(key, row, index);
|
|
457
|
+
} else if (!isBlank(this.permission[key])) {
|
|
458
|
+
return this.permission[key];
|
|
459
|
+
} else {
|
|
460
|
+
return true;
|
|
461
|
+
}
|
|
426
462
|
},
|
|
427
463
|
getTableHeight() {
|
|
428
|
-
this.isAutoHeight
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
464
|
+
if (this.isAutoHeight) {
|
|
465
|
+
this.$nextTick(() => {
|
|
466
|
+
const tableRef = this.$refs.table;
|
|
467
|
+
const tablePageRef = this.$refs.tablePage;
|
|
468
|
+
if (!tableRef)
|
|
469
|
+
return;
|
|
470
|
+
const tableStyle = tableRef.$el;
|
|
471
|
+
const pageStyle = tablePageRef.$el.offsetHeight || 20;
|
|
472
|
+
this.tableHeight = document.documentElement.clientHeight - tableStyle.offsetTop - pageStyle - this.calcHeight;
|
|
473
|
+
});
|
|
474
|
+
} else {
|
|
475
|
+
this.tableHeight = this.tableOption.height;
|
|
476
|
+
}
|
|
435
477
|
},
|
|
436
478
|
doLayout() {
|
|
437
479
|
this.$refs.table.doLayout();
|
|
438
480
|
},
|
|
439
481
|
refreshTable(callback) {
|
|
440
|
-
this.reload = Math.random()
|
|
482
|
+
this.reload = Math.random();
|
|
483
|
+
this.$nextTick(() => {
|
|
441
484
|
callback && callback();
|
|
442
485
|
});
|
|
443
486
|
},
|
|
444
487
|
// 树懒加载
|
|
445
488
|
treeLoad(tree, treeNode, resolve) {
|
|
446
489
|
this.$emit("tree-load", tree, treeNode, (data) => {
|
|
447
|
-
tree.children = data
|
|
490
|
+
tree.children = data;
|
|
491
|
+
resolve(data);
|
|
448
492
|
});
|
|
449
493
|
},
|
|
450
494
|
menuIcon(value) {
|
|
@@ -459,7 +503,8 @@ const __vue2_script = {
|
|
|
459
503
|
return this.$refs.dialogForm.$refs.tableForm.validateField(val);
|
|
460
504
|
},
|
|
461
505
|
selectClear() {
|
|
462
|
-
this.$emit("selection-clear", deepClone(this.tableSelect))
|
|
506
|
+
this.$emit("selection-clear", deepClone(this.tableSelect));
|
|
507
|
+
this.$refs.table.clearSelection();
|
|
463
508
|
},
|
|
464
509
|
toggleRowSelection(row, selected) {
|
|
465
510
|
this.$refs.table.toggleRowSelection(row, selected);
|
|
@@ -471,17 +516,27 @@ const __vue2_script = {
|
|
|
471
516
|
this.$refs.table.setCurrentRow(row);
|
|
472
517
|
},
|
|
473
518
|
dataInit() {
|
|
474
|
-
this.list = this.data
|
|
475
|
-
|
|
519
|
+
this.list = this.data;
|
|
520
|
+
this.list.forEach((ele, index) => {
|
|
521
|
+
if (ele.$cellEdit && !this.cascaderFormList[index]) {
|
|
522
|
+
this.cascaderFormList[index] = deepClone(ele);
|
|
523
|
+
}
|
|
524
|
+
this.$set(ele, "$cellEdit", ele.$cellEdit || false);
|
|
525
|
+
this.$set(ele, "$index", index);
|
|
476
526
|
});
|
|
477
527
|
},
|
|
478
528
|
// 拖动表头事件
|
|
479
529
|
headerDragend(newWidth, oldWidth, column, event) {
|
|
480
|
-
|
|
530
|
+
const obj = this.objectOption[column.property];
|
|
531
|
+
if (obj)
|
|
532
|
+
this.$set(this.objectOption[column.property], "width", newWidth);
|
|
533
|
+
this.$emit("header-dragend", newWidth, oldWidth, column, event);
|
|
481
534
|
},
|
|
482
535
|
headerSort(oldIndex, newIndex) {
|
|
483
|
-
const column = this.columnOption
|
|
484
|
-
column.splice(
|
|
536
|
+
const column = this.columnOption;
|
|
537
|
+
const targetRow = column.splice(oldIndex, 1)[0];
|
|
538
|
+
column.splice(newIndex, 0, targetRow);
|
|
539
|
+
this.refreshTable();
|
|
485
540
|
},
|
|
486
541
|
// 清除过滤器执行函数
|
|
487
542
|
clearFilter(name) {
|
|
@@ -501,13 +556,18 @@ const __vue2_script = {
|
|
|
501
556
|
},
|
|
502
557
|
// 选中实例
|
|
503
558
|
toggleSelection(rows) {
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
559
|
+
if (rows) {
|
|
560
|
+
rows.forEach((row) => {
|
|
561
|
+
this.$refs.table.toggleRowSelection(row);
|
|
562
|
+
});
|
|
563
|
+
} else {
|
|
564
|
+
this.$refs.table.clearSelection();
|
|
565
|
+
}
|
|
507
566
|
},
|
|
508
567
|
// 选择回调
|
|
509
568
|
selectionChange(val) {
|
|
510
|
-
this.tableSelect = val
|
|
569
|
+
this.tableSelect = val;
|
|
570
|
+
this.$emit("selection-change", this.tableSelect);
|
|
511
571
|
},
|
|
512
572
|
// 单个选择回调
|
|
513
573
|
select(selection, row) {
|
|
@@ -567,38 +627,71 @@ const __vue2_script = {
|
|
|
567
627
|
},
|
|
568
628
|
// 单元格新增
|
|
569
629
|
rowCellAdd(row = {}) {
|
|
570
|
-
const len = this.list.length
|
|
630
|
+
const len = this.list.length;
|
|
631
|
+
const formDefault = formInitVal(this.propOption).tableForm;
|
|
571
632
|
row = deepClone(
|
|
572
633
|
Object.assign(
|
|
573
634
|
{
|
|
574
|
-
$cellEdit:
|
|
635
|
+
$cellEdit: true,
|
|
575
636
|
$index: len
|
|
576
637
|
},
|
|
577
638
|
formDefault,
|
|
578
639
|
row
|
|
579
640
|
)
|
|
580
|
-
)
|
|
641
|
+
);
|
|
642
|
+
this.list.push(row);
|
|
581
643
|
},
|
|
582
644
|
// 行取消
|
|
583
645
|
rowCancel(row, index) {
|
|
584
|
-
isBlank(row[this.rowKey])
|
|
646
|
+
if (isBlank(row[this.rowKey])) {
|
|
647
|
+
this.list.splice(index, 1);
|
|
648
|
+
delete this.cascaderDIC[index];
|
|
649
|
+
} else {
|
|
650
|
+
this.cascaderFormList[index].$cellEdit = false;
|
|
651
|
+
this.$set(this.cascaderDIC, index, this.cascaderDicList[index]);
|
|
652
|
+
this.$set(this.list, index, this.cascaderFormList[index]);
|
|
653
|
+
}
|
|
654
|
+
delete this.cascaderDicList[index];
|
|
655
|
+
delete this.cascaderFormList[index];
|
|
656
|
+
this.cascaderIndexList.splice(this.cascaderIndexList.indexOf(index), 1);
|
|
585
657
|
},
|
|
586
658
|
// 行编辑点击
|
|
587
659
|
rowCell(row, index) {
|
|
588
|
-
row.$cellEdit
|
|
660
|
+
if (row.$cellEdit) {
|
|
661
|
+
this.rowCellUpdate(row, index);
|
|
662
|
+
} else {
|
|
663
|
+
this.rowCellEdit(row, index);
|
|
664
|
+
}
|
|
589
665
|
},
|
|
590
666
|
rowCellUpdate(row, index) {
|
|
591
667
|
row = deepClone(row);
|
|
592
|
-
const result = this.validateCellField(index)
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
this.
|
|
668
|
+
const result = this.validateCellField(index);
|
|
669
|
+
const done = () => {
|
|
670
|
+
this.btnDisabledList[index] = false;
|
|
671
|
+
this.btnDisabled = false;
|
|
672
|
+
this.list[index].$cellEdit = false;
|
|
673
|
+
this.cascaderIndexList.splice(this.cascaderIndexList.indexOf(index), 1);
|
|
674
|
+
delete this.cascaderFormList[index];
|
|
675
|
+
};
|
|
676
|
+
const loading = () => {
|
|
677
|
+
this.btnDisabledList[index] = false;
|
|
678
|
+
this.btnDisabled = false;
|
|
596
679
|
};
|
|
597
|
-
|
|
680
|
+
if (result) {
|
|
681
|
+
this.btnDisabledList[index] = true;
|
|
682
|
+
this.btnDisabled = true;
|
|
683
|
+
if (isBlank(row[this.rowKey])) {
|
|
684
|
+
this.$emit("row-save", row, done, loading);
|
|
685
|
+
} else {
|
|
686
|
+
this.$emit("row-update", row, index, done, loading);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
598
689
|
},
|
|
599
690
|
// 单元格编辑
|
|
600
691
|
rowCellEdit(row, index) {
|
|
601
|
-
row.$cellEdit =
|
|
692
|
+
row.$cellEdit = true;
|
|
693
|
+
this.cascaderFormList[index] = deepClone(row);
|
|
694
|
+
this.cascaderDicList[index] = deepClone(this.cascaderDIC[index]);
|
|
602
695
|
},
|
|
603
696
|
// 对部分表单字段进行校验
|
|
604
697
|
validateCellForm() {
|
|
@@ -609,12 +702,18 @@ const __vue2_script = {
|
|
|
609
702
|
});
|
|
610
703
|
},
|
|
611
704
|
validateCellField(index) {
|
|
612
|
-
let result =
|
|
613
|
-
for (const item of this.$refs.cellForm.fields)
|
|
614
|
-
if (item.prop.split(".")[1] == index
|
|
615
|
-
|
|
616
|
-
|
|
705
|
+
let result = true;
|
|
706
|
+
for (const item of this.$refs.cellForm.fields) {
|
|
707
|
+
if (item.prop.split(".")[1] == index) {
|
|
708
|
+
this.$refs.cellForm.validateField(item.prop, (error) => {
|
|
709
|
+
if (error) {
|
|
710
|
+
result = false;
|
|
711
|
+
}
|
|
712
|
+
});
|
|
713
|
+
}
|
|
714
|
+
if (!result)
|
|
617
715
|
break;
|
|
716
|
+
}
|
|
618
717
|
return result;
|
|
619
718
|
},
|
|
620
719
|
rowAdd() {
|
|
@@ -633,73 +732,104 @@ const __vue2_script = {
|
|
|
633
732
|
return this.$refs.dialogForm.$refs.tableForm.getPropRef(prop);
|
|
634
733
|
},
|
|
635
734
|
setVal() {
|
|
636
|
-
this.$emit("input", this.tableForm)
|
|
735
|
+
this.$emit("input", this.tableForm);
|
|
736
|
+
this.$emit("change", this.tableForm);
|
|
637
737
|
},
|
|
638
738
|
// 编辑
|
|
639
739
|
rowEdit(row, index) {
|
|
640
|
-
this.tableForm = deepClone(row)
|
|
740
|
+
this.tableForm = deepClone(row);
|
|
741
|
+
this.tableIndex = index;
|
|
742
|
+
this.setVal();
|
|
743
|
+
this.$refs.dialogForm.show("edit");
|
|
641
744
|
},
|
|
642
745
|
// 复制
|
|
643
746
|
rowCopy(row) {
|
|
644
|
-
this.tableForm = deepClone(row)
|
|
747
|
+
this.tableForm = deepClone(row);
|
|
748
|
+
delete this.tableForm[this.rowKey];
|
|
749
|
+
this.tableIndex = -1;
|
|
750
|
+
this.setVal();
|
|
751
|
+
this.$refs.dialogForm.show("add");
|
|
645
752
|
},
|
|
646
753
|
// 查看
|
|
647
754
|
rowView(row, index) {
|
|
648
|
-
this.tableForm = deepClone(row)
|
|
755
|
+
this.tableForm = deepClone(row);
|
|
756
|
+
this.tableIndex = index;
|
|
757
|
+
this.setVal();
|
|
758
|
+
this.$refs.dialogForm.show("view");
|
|
649
759
|
},
|
|
650
760
|
// 删除
|
|
651
761
|
rowDel(row, index) {
|
|
652
762
|
this.$emit("row-del", row, index, () => {
|
|
653
763
|
const { parentList, index: index2 } = this.findData(row[this.rowKey]);
|
|
654
|
-
|
|
764
|
+
if (parentList)
|
|
765
|
+
parentList.splice(index2, 1);
|
|
655
766
|
});
|
|
656
767
|
},
|
|
657
768
|
// 合并行
|
|
658
769
|
tableSpanMethod(param) {
|
|
659
|
-
if (typeof this.spanMethod
|
|
770
|
+
if (typeof this.spanMethod === "function")
|
|
660
771
|
return this.spanMethod(param);
|
|
661
772
|
},
|
|
662
773
|
// 合集统计逻辑
|
|
663
774
|
tableSummaryMethod(param) {
|
|
664
775
|
const sumsList = {};
|
|
665
|
-
if (typeof this.summaryMethod
|
|
776
|
+
if (typeof this.summaryMethod === "function") {
|
|
666
777
|
return this.summaryMethod(param);
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
778
|
+
}
|
|
779
|
+
const { columns, data } = param;
|
|
780
|
+
const sums = [];
|
|
781
|
+
if (columns.length > 0) {
|
|
782
|
+
columns.forEach((column, index) => {
|
|
783
|
+
const currItem = this.sumColumnList.find((item) => item.name === column.property);
|
|
784
|
+
if (currItem) {
|
|
785
|
+
const decimals = currItem.decimals || 2;
|
|
786
|
+
const label = currItem.label || "";
|
|
787
|
+
switch (currItem.type) {
|
|
788
|
+
case "count":
|
|
789
|
+
sums[index] = label + data.length;
|
|
790
|
+
break;
|
|
791
|
+
case "avg":
|
|
792
|
+
const avgValues = data.map((item) => Number(item[column.property]));
|
|
793
|
+
let nowindex = 1;
|
|
794
|
+
sums[index] = avgValues.reduce((perv, curr) => {
|
|
795
|
+
const value = Number(curr);
|
|
796
|
+
if (!isNaN(value)) {
|
|
797
|
+
return (perv * (nowindex - 1) + curr) / nowindex++;
|
|
798
|
+
} else {
|
|
799
|
+
return perv;
|
|
800
|
+
}
|
|
801
|
+
}, 0);
|
|
802
|
+
sums[index] = label + sums[index].toFixed(decimals);
|
|
803
|
+
break;
|
|
804
|
+
case "sum":
|
|
805
|
+
const values = data.map((item) => Number(item[column.property]));
|
|
806
|
+
sums[index] = values.reduce((perv, curr) => {
|
|
807
|
+
const value = Number(curr);
|
|
808
|
+
if (!isNaN(value)) {
|
|
809
|
+
return perv + curr;
|
|
810
|
+
} else {
|
|
811
|
+
return perv;
|
|
812
|
+
}
|
|
813
|
+
}, 0);
|
|
814
|
+
sums[index] = label + sums[index].toFixed(decimals);
|
|
815
|
+
break;
|
|
816
|
+
}
|
|
817
|
+
sumsList[column.property] = sums[index];
|
|
818
|
+
} else {
|
|
819
|
+
sums[index] = "";
|
|
691
820
|
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
this.sumsList = sumsList;
|
|
824
|
+
return sums;
|
|
696
825
|
},
|
|
697
826
|
tableDrop(type, el, callback) {
|
|
698
|
-
if (this.isSortable !==
|
|
699
|
-
if (type === "row" && !this.isRowSort)
|
|
827
|
+
if (this.isSortable !== true) {
|
|
828
|
+
if (type === "row" && !this.isRowSort) {
|
|
700
829
|
return;
|
|
701
|
-
if (type === "column" && !this.isColumnSort)
|
|
830
|
+
} else if (type === "column" && !this.isColumnSort) {
|
|
702
831
|
return;
|
|
832
|
+
}
|
|
703
833
|
}
|
|
704
834
|
if (!window.Sortable) {
|
|
705
835
|
packages.logs("Sortable");
|
|
@@ -717,31 +847,39 @@ const __vue2_script = {
|
|
|
717
847
|
let result = {};
|
|
718
848
|
const callback = (parentList, parent) => {
|
|
719
849
|
parentList.forEach((ele, index) => {
|
|
720
|
-
ele[this.rowKey] === id
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
850
|
+
if (ele[this.rowKey] === id) {
|
|
851
|
+
result = {
|
|
852
|
+
item: ele,
|
|
853
|
+
index,
|
|
854
|
+
parentList,
|
|
855
|
+
parent
|
|
856
|
+
};
|
|
857
|
+
}
|
|
858
|
+
if (ele[this.childrenKey]) {
|
|
859
|
+
callback(ele[this.childrenKey], ele);
|
|
860
|
+
}
|
|
726
861
|
});
|
|
727
862
|
};
|
|
728
|
-
|
|
863
|
+
callback(this.list);
|
|
864
|
+
return result;
|
|
729
865
|
}
|
|
730
866
|
}
|
|
731
|
-
}
|
|
867
|
+
};
|
|
868
|
+
const __cssModules = {};
|
|
732
869
|
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
733
870
|
__vue2_script,
|
|
734
871
|
render,
|
|
735
872
|
staticRenderFns,
|
|
736
|
-
|
|
873
|
+
false,
|
|
737
874
|
__vue2_injectStyles,
|
|
738
875
|
null,
|
|
739
876
|
null,
|
|
740
877
|
null
|
|
741
878
|
);
|
|
742
879
|
function __vue2_injectStyles(context) {
|
|
743
|
-
for (let o in __cssModules)
|
|
880
|
+
for (let o in __cssModules) {
|
|
744
881
|
this[o] = __cssModules[o];
|
|
882
|
+
}
|
|
745
883
|
}
|
|
746
884
|
const FyCurd = /* @__PURE__ */ function() {
|
|
747
885
|
return __component__.exports;
|