vxe-table 4.23.4 → 4.23.6
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/all.esm.js +32459 -33908
- package/dist/style.css +4501 -1
- package/dist/style.mini.css +1 -0
- package/es/colgroup/index.d.ts +760 -0
- package/es/colgroup/index.js +16 -13
- package/es/column/index.d.ts +760 -0
- package/es/column/index.js +16 -13
- package/es/components.d.ts +9 -0
- package/es/components.js +29 -29
- package/es/grid/index.d.ts +2824 -0
- package/es/grid/index.js +14 -9
- package/es/grid/src/emits.d.ts +2 -0
- package/es/grid/src/emits.js +18 -15
- package/es/grid/src/grid.d.ts +556 -0
- package/es/grid/src/grid.js +1695 -1758
- package/es/grid/src/props.d.ts +200 -0
- package/es/grid/src/props.js +19 -6
- package/es/{vxe-grid/style.min.css → grid/style.mini.css} +1 -1
- package/es/index.d.ts +3 -0
- package/es/index.esm.js +6 -3
- package/es/index.js +6 -0
- package/es/locale/lang/ar-EG.d.ts +908 -2
- package/es/locale/lang/ar-EG.js +906 -903
- package/es/locale/lang/de-DE.d.ts +908 -2
- package/es/locale/lang/de-DE.js +906 -903
- package/es/locale/lang/en-US.d.ts +908 -2
- package/es/locale/lang/en-US.js +906 -903
- package/es/locale/lang/es-ES.d.ts +908 -2
- package/es/locale/lang/es-ES.js +906 -903
- package/es/locale/lang/fr-FR.d.ts +908 -2
- package/es/locale/lang/fr-FR.js +906 -903
- package/es/locale/lang/hu-HU.d.ts +908 -2
- package/es/locale/lang/hu-HU.js +906 -903
- package/es/locale/lang/hy-AM.d.ts +908 -2
- package/es/locale/lang/hy-AM.js +906 -903
- package/es/locale/lang/id-ID.d.ts +908 -2
- package/es/locale/lang/id-ID.js +906 -903
- package/es/locale/lang/it-IT.d.ts +908 -2
- package/es/locale/lang/it-IT.js +906 -903
- package/es/locale/lang/ja-JP.d.ts +908 -2
- package/es/locale/lang/ja-JP.js +906 -903
- package/es/locale/lang/ko-KR.d.ts +908 -2
- package/es/locale/lang/ko-KR.js +906 -903
- package/es/locale/lang/ms-MY.d.ts +908 -2
- package/es/locale/lang/ms-MY.js +906 -903
- package/es/locale/lang/nb-NO.d.ts +908 -2
- package/es/locale/lang/nb-NO.js +906 -903
- package/es/locale/lang/pt-BR.d.ts +908 -2
- package/es/locale/lang/pt-BR.js +906 -903
- package/es/locale/lang/ru-RU.d.ts +908 -2
- package/es/locale/lang/ru-RU.js +906 -903
- package/es/locale/lang/th-TH.d.ts +908 -2
- package/es/locale/lang/th-TH.js +906 -903
- package/es/locale/lang/ug-CN.d.ts +908 -2
- package/es/locale/lang/ug-CN.js +906 -903
- package/es/locale/lang/uk-UA.d.ts +908 -2
- package/es/locale/lang/uk-UA.js +906 -903
- package/es/locale/lang/uz-UZ.d.ts +908 -2
- package/es/locale/lang/uz-UZ.js +906 -903
- package/es/locale/lang/vi-VN.d.ts +908 -2
- package/es/locale/lang/vi-VN.js +906 -903
- package/es/locale/lang/zh-CHT.d.ts +908 -2
- package/es/locale/lang/zh-CHT.js +906 -903
- package/es/locale/lang/zh-CN.d.ts +908 -2
- package/es/locale/lang/zh-CN.js +906 -903
- package/es/locale/lang/zh-HK.d.ts +908 -2
- package/es/locale/lang/zh-HK.js +910 -2
- package/es/locale/lang/zh-MO.d.ts +908 -2
- package/es/locale/lang/zh-MO.js +910 -2
- package/es/locale/lang/zh-TC.d.ts +908 -0
- package/es/locale/lang/zh-TC.js +910 -2
- package/es/locale/lang/zh-TW.d.ts +908 -2
- package/es/locale/lang/zh-TW.js +910 -2
- package/es/table/index.d.ts +2672 -0
- package/es/table/index.js +16 -11
- package/es/table/module/custom/hook.d.ts +1 -0
- package/es/table/module/custom/hook.js +462 -483
- package/es/table/module/custom/panel.d.ts +17 -0
- package/es/table/module/custom/panel.js +1482 -1559
- package/es/table/module/edit/hook.d.ts +1 -0
- package/es/table/module/edit/hook.js +1008 -1078
- package/es/table/module/export/export-panel.d.ts +27 -0
- package/es/table/module/export/export-panel.js +523 -575
- package/es/table/module/export/hook.d.ts +1 -0
- package/es/table/module/export/hook.js +1805 -1884
- package/es/table/module/export/import-panel.d.ts +27 -0
- package/es/table/module/export/import-panel.js +244 -252
- package/es/table/module/export/util.d.ts +5 -0
- package/es/table/module/export/util.js +20 -17
- package/es/table/module/filter/hook.d.ts +1 -0
- package/es/table/module/filter/hook.js +472 -487
- package/es/table/module/filter/panel.d.ts +16 -0
- package/es/table/module/filter/panel.js +251 -275
- package/es/table/module/keyboard/hook.d.ts +1 -0
- package/es/table/module/keyboard/hook.js +445 -497
- package/es/table/module/menu/hook.d.ts +1 -0
- package/es/table/module/menu/hook.js +295 -315
- package/es/table/module/menu/panel.d.ts +2 -0
- package/es/table/module/menu/panel.js +164 -183
- package/es/table/module/validator/hook.d.ts +1 -0
- package/es/table/module/validator/hook.js +522 -571
- package/es/table/render/index.d.ts +1 -0
- package/es/table/render/index.js +1402 -1362
- package/es/table/src/body.d.ts +24 -0
- package/es/table/src/body.js +850 -865
- package/es/table/src/cell.d.ts +192 -0
- package/es/table/src/cell.js +1209 -1207
- package/es/table/src/column.d.ts +263 -0
- package/es/table/src/column.js +178 -174
- package/es/table/src/columnInfo.d.ts +13 -0
- package/es/table/src/columnInfo.js +202 -196
- package/es/table/src/emits.d.ts +2 -0
- package/es/table/src/emits.js +126 -119
- package/es/table/src/footer.d.ts +45 -0
- package/es/table/src/footer.js +336 -340
- package/es/table/src/group.d.ts +178 -0
- package/es/table/src/group.js +49 -46
- package/es/table/src/header.d.ts +26 -0
- package/es/table/src/header.js +517 -519
- package/es/table/src/props.d.ts +238 -0
- package/es/table/src/props.js +331 -328
- package/es/table/src/store.d.ts +6 -0
- package/es/table/src/store.js +9 -6
- package/es/table/src/table.d.ts +539 -0
- package/es/table/src/table.js +14064 -15041
- package/es/table/src/use/cell-view.d.ts +10 -0
- package/es/table/src/use/cell-view.js +36 -33
- package/es/table/src/use/index.d.ts +1 -0
- package/es/table/src/use/index.js +1 -1
- package/es/table/src/util.d.ts +74 -0
- package/es/table/src/util.js +1038 -1026
- package/es/table/style.css +1 -1
- package/es/table/style.mini.css +1 -0
- package/es/toolbar/index.d.ts +340 -0
- package/es/toolbar/index.js +14 -9
- package/es/toolbar/src/toolbar.d.ts +75 -0
- package/es/toolbar/src/toolbar.js +605 -613
- package/es/toolbar/{style.min.css → style.mini.css} +1 -1
- package/es/ui/index.d.ts +86 -0
- package/es/ui/index.js +457 -501
- package/es/ui/src/anime.d.ts +10 -0
- package/es/ui/src/anime.js +40 -40
- package/es/ui/src/comp.d.ts +2 -0
- package/es/ui/src/comp.js +5 -2
- package/es/ui/src/dom.d.ts +80 -0
- package/es/ui/src/dom.js +377 -380
- package/es/ui/src/log.d.ts +6 -0
- package/es/ui/src/log.js +18 -13
- package/es/ui/src/utils.d.ts +23 -0
- package/es/ui/src/utils.js +57 -53
- package/es/ui/src/vn.d.ts +7 -0
- package/es/ui/src/vn.js +49 -42
- package/es/v-x-e-table/index.d.ts +3 -0
- package/es/v-x-e-table/index.js +6 -3
- package/es/vxe-colgroup/index.d.ts +3 -0
- package/es/vxe-colgroup/index.js +6 -3
- package/es/vxe-column/index.d.ts +3 -0
- package/es/vxe-column/index.js +6 -3
- package/es/vxe-grid/index.d.ts +3 -0
- package/es/vxe-grid/index.js +6 -3
- package/{lib/grid/style/style.min.css → es/vxe-grid/style.mini.css} +1 -1
- package/es/vxe-table/index.d.ts +3 -0
- package/es/vxe-table/index.js +6 -3
- package/es/vxe-table/style.css +1 -1
- package/es/vxe-table/style.mini.css +1 -0
- package/es/vxe-toolbar/index.d.ts +3 -0
- package/es/vxe-toolbar/index.js +6 -3
- package/es/vxe-toolbar/{style.min.css → style.mini.css} +1 -1
- package/es/vxe-ui/index.d.ts +3 -0
- package/es/vxe-ui/index.js +6 -3
- package/lib/colgroup/index.js +44 -18
- package/lib/colgroup/style/index.js +1 -1
- package/lib/column/index.js +44 -18
- package/lib/column/style/index.js +1 -1
- package/lib/components.js +58 -92
- package/lib/grid/index.js +42 -14
- package/lib/grid/src/emits.js +37 -6
- package/lib/grid/src/grid.js +850 -1195
- package/lib/grid/src/props.js +27 -11
- package/lib/grid/style/index.js +1 -1
- package/lib/{vxe-grid/style/style.min.css → grid/style/style.mini.css} +1 -1
- package/lib/iconfont.1792977622800.ttf +0 -0
- package/lib/iconfont.1792977622800.woff +0 -0
- package/lib/iconfont.1792977622800.woff2 +0 -0
- package/lib/index.common.js +35 -19
- package/lib/index.js +37 -0
- package/lib/index.umd.js +30586 -24322
- package/lib/index.umd.min.js +3 -1
- package/lib/locale/ar-EG.umd.js +948 -0
- package/lib/locale/de-DE.umd.js +948 -0
- package/lib/locale/en-US.umd.js +948 -0
- package/lib/locale/es-ES.umd.js +948 -0
- package/lib/locale/fr-FR.umd.js +948 -0
- package/lib/locale/hu-HU.umd.js +948 -0
- package/lib/locale/hy-AM.umd.js +948 -0
- package/lib/locale/id-ID.umd.js +948 -0
- package/lib/locale/it-IT.umd.js +948 -0
- package/lib/locale/ja-JP.umd.js +948 -0
- package/lib/locale/ko-KR.umd.js +948 -0
- package/lib/locale/lang/ar-EG.js +681 -664
- package/lib/locale/lang/ar-EG.umd.js +913 -892
- package/lib/locale/lang/de-DE.js +681 -664
- package/lib/locale/lang/de-DE.umd.js +913 -892
- package/lib/locale/lang/en-US.js +678 -661
- package/lib/locale/lang/en-US.umd.js +913 -892
- package/lib/locale/lang/es-ES.js +681 -664
- package/lib/locale/lang/es-ES.umd.js +913 -892
- package/lib/locale/lang/fr-FR.js +654 -637
- package/lib/locale/lang/fr-FR.umd.js +913 -892
- package/lib/locale/lang/hu-HU.js +681 -664
- package/lib/locale/lang/hu-HU.umd.js +913 -892
- package/lib/locale/lang/hy-AM.js +681 -664
- package/lib/locale/lang/hy-AM.umd.js +913 -892
- package/lib/locale/lang/id-ID.js +681 -664
- package/lib/locale/lang/id-ID.umd.js +913 -892
- package/lib/locale/lang/it-IT.js +661 -644
- package/lib/locale/lang/it-IT.umd.js +912 -891
- package/lib/locale/lang/ja-JP.js +710 -693
- package/lib/locale/lang/ja-JP.umd.js +913 -892
- package/lib/locale/lang/ko-KR.js +681 -664
- package/lib/locale/lang/ko-KR.umd.js +913 -892
- package/lib/locale/lang/ms-MY.js +681 -664
- package/lib/locale/lang/ms-MY.umd.js +913 -892
- package/lib/locale/lang/nb-NO.js +681 -664
- package/lib/locale/lang/nb-NO.umd.js +913 -892
- package/lib/locale/lang/pt-BR.js +681 -664
- package/lib/locale/lang/pt-BR.umd.js +913 -892
- package/lib/locale/lang/ru-RU.js +690 -673
- package/lib/locale/lang/ru-RU.umd.js +913 -892
- package/lib/locale/lang/th-TH.js +681 -664
- package/lib/locale/lang/th-TH.umd.js +913 -892
- package/lib/locale/lang/ug-CN.js +681 -664
- package/lib/locale/lang/ug-CN.umd.js +913 -892
- package/lib/locale/lang/uk-UA.js +674 -657
- package/lib/locale/lang/uk-UA.umd.js +913 -892
- package/lib/locale/lang/uz-UZ.js +583 -566
- package/lib/locale/lang/uz-UZ.umd.js +908 -887
- package/lib/locale/lang/vi-VN.js +681 -664
- package/lib/locale/lang/vi-VN.umd.js +913 -892
- package/lib/locale/lang/zh-CHT.js +681 -664
- package/lib/locale/lang/zh-CHT.umd.js +913 -892
- package/lib/locale/lang/zh-CN.js +681 -664
- package/lib/locale/lang/zh-CN.umd.js +913 -892
- package/lib/locale/lang/zh-HK.js +928 -7
- package/lib/locale/lang/zh-HK.umd.js +945 -20
- package/lib/locale/lang/zh-MO.js +928 -7
- package/lib/locale/lang/zh-MO.umd.js +945 -20
- package/lib/locale/lang/zh-TC.js +928 -7
- package/lib/locale/lang/zh-TC.umd.js +948 -0
- package/lib/locale/lang/zh-TW.js +928 -7
- package/lib/locale/lang/zh-TW.umd.js +945 -20
- package/lib/locale/ms-MY.umd.js +948 -0
- package/lib/locale/nb-NO.umd.js +948 -0
- package/lib/locale/pt-BR.umd.js +948 -0
- package/lib/locale/ru-RU.umd.js +948 -0
- package/lib/locale/th-TH.umd.js +948 -0
- package/lib/locale/ug-CN.umd.js +948 -0
- package/lib/locale/uk-UA.umd.js +948 -0
- package/lib/locale/uz-UZ.umd.js +948 -0
- package/lib/locale/vi-VN.umd.js +948 -0
- package/lib/locale/zh-CHT.umd.js +948 -0
- package/lib/locale/zh-CN.umd.js +948 -0
- package/lib/locale/zh-HK.umd.js +948 -0
- package/lib/locale/zh-MO.umd.js +948 -0
- package/lib/locale/zh-TC.umd.js +948 -0
- package/lib/locale/zh-TW.umd.js +948 -0
- package/lib/style.css +4501 -1
- package/lib/style.mini.css +1 -0
- package/lib/table/index.js +45 -17
- package/lib/table/module/custom/hook.js +132 -252
- package/lib/table/module/custom/panel.js +919 -970
- package/lib/table/module/edit/hook.js +250 -620
- package/lib/table/module/export/export-panel.js +390 -347
- package/lib/table/module/export/hook.js +745 -1179
- package/lib/table/module/export/import-panel.js +170 -136
- package/lib/table/module/export/util.js +37 -14
- package/lib/table/module/filter/hook.js +127 -227
- package/lib/table/module/filter/panel.js +177 -208
- package/lib/table/module/keyboard/hook.js +93 -172
- package/lib/table/module/menu/hook.js +86 -165
- package/lib/table/module/menu/panel.js +176 -141
- package/lib/table/module/validator/hook.js +164 -271
- package/lib/table/render/index.js +700 -1147
- package/lib/table/src/body.js +426 -559
- package/lib/table/src/cell.js +619 -987
- package/lib/table/src/column.js +55 -30
- package/lib/table/src/columnInfo.js +88 -110
- package/lib/table/src/emits.js +145 -13
- package/lib/table/src/footer.js +181 -240
- package/lib/table/src/group.js +56 -34
- package/lib/table/src/header.js +292 -367
- package/lib/table/src/props.js +27 -12
- package/lib/table/src/store.js +25 -9
- package/lib/table/src/table.js +14179 -1019
- package/lib/table/src/use/cell-view.js +47 -37
- package/lib/table/src/use/index.js +17 -15
- package/lib/table/src/util.js +236 -337
- package/lib/table/style/index.js +1 -1
- package/lib/table/style/style.css +1 -1
- package/lib/table/style/style.mini.css +1 -0
- package/lib/toolbar/index.js +42 -14
- package/lib/toolbar/src/toolbar.js +271 -379
- package/lib/toolbar/style/index.js +1 -1
- package/lib/toolbar/style/{style.min.css → style.mini.css} +1 -1
- package/lib/ui/index.js +153 -195
- package/lib/ui/src/anime.js +49 -29
- package/lib/ui/src/comp.js +23 -6
- package/lib/ui/src/dom.js +114 -147
- package/lib/ui/src/log.js +34 -18
- package/lib/ui/src/utils.js +57 -45
- package/lib/ui/src/vn.js +60 -34
- package/lib/ui/style/index.js +1 -1
- package/lib/v-x-e-table/index.js +35 -19
- package/lib/vxe-colgroup/index.js +35 -19
- package/lib/vxe-colgroup/style/index.js +1 -1
- package/lib/vxe-column/index.js +35 -19
- package/lib/vxe-column/style/index.js +1 -1
- package/lib/vxe-grid/index.js +35 -19
- package/lib/vxe-grid/style/index.js +1 -1
- package/{es/grid/style.min.css → lib/vxe-grid/style/style.mini.css} +1 -1
- package/lib/vxe-table/index.js +35 -19
- package/lib/vxe-table/style/index.js +1 -1
- package/lib/vxe-table/style/style.css +1 -1
- package/lib/vxe-table/style/style.mini.css +1 -0
- package/lib/vxe-toolbar/index.js +35 -19
- package/lib/vxe-toolbar/style/index.js +1 -1
- package/lib/vxe-toolbar/style/{style.min.css → style.mini.css} +1 -1
- package/lib/vxe-ui/index.js +35 -19
- package/lib/vxe-ui/style/index.js +1 -1
- package/package.json +8 -4
- package/packages/locale/lang/zh-HK.ts +907 -3
- package/packages/locale/lang/zh-MO.ts +907 -3
- package/packages/locale/lang/zh-TC.ts +907 -3
- package/packages/locale/lang/zh-TW.ts +907 -3
- package/packages/table/module/edit/hook.ts +2 -2
- package/packages/table/src/table.ts +64 -28
- package/packages/ui/index.ts +1 -28
- package/dist/style.min.css +0 -1
- package/es/index.css +0 -1
- package/es/index.min.css +0 -1
- package/es/style.css +0 -1
- package/es/style.min.css +0 -1
- package/es/table/style.min.css +0 -1
- package/es/vxe-table/style.min.css +0 -1
- package/es/vxe-v-x-e-table/index.js +0 -3
- package/lib/colgroup/index.min.js +0 -1
- package/lib/column/index.min.js +0 -1
- package/lib/components.min.js +0 -1
- package/lib/grid/index.min.js +0 -1
- package/lib/grid/src/emits.min.js +0 -1
- package/lib/grid/src/grid.min.js +0 -1
- package/lib/grid/src/props.min.js +0 -1
- package/lib/index.css +0 -1
- package/lib/index.min.css +0 -1
- package/lib/locale/lang/ar-EG.d.ts +0 -2
- package/lib/locale/lang/ar-EG.min.js +0 -1
- package/lib/locale/lang/de-DE.d.ts +0 -2
- package/lib/locale/lang/de-DE.min.js +0 -1
- package/lib/locale/lang/en-US.d.ts +0 -2
- package/lib/locale/lang/en-US.min.js +0 -1
- package/lib/locale/lang/es-ES.d.ts +0 -2
- package/lib/locale/lang/es-ES.min.js +0 -1
- package/lib/locale/lang/fr-FR.d.ts +0 -2
- package/lib/locale/lang/fr-FR.min.js +0 -1
- package/lib/locale/lang/hu-HU.d.ts +0 -2
- package/lib/locale/lang/hu-HU.min.js +0 -1
- package/lib/locale/lang/hy-AM.d.ts +0 -2
- package/lib/locale/lang/hy-AM.min.js +0 -1
- package/lib/locale/lang/id-ID.d.ts +0 -2
- package/lib/locale/lang/id-ID.min.js +0 -1
- package/lib/locale/lang/it-IT.d.ts +0 -2
- package/lib/locale/lang/it-IT.min.js +0 -1
- package/lib/locale/lang/ja-JP.d.ts +0 -2
- package/lib/locale/lang/ja-JP.min.js +0 -1
- package/lib/locale/lang/ko-KR.d.ts +0 -2
- package/lib/locale/lang/ko-KR.min.js +0 -1
- package/lib/locale/lang/ms-MY.d.ts +0 -2
- package/lib/locale/lang/ms-MY.min.js +0 -1
- package/lib/locale/lang/nb-NO.d.ts +0 -2
- package/lib/locale/lang/nb-NO.min.js +0 -1
- package/lib/locale/lang/pt-BR.d.ts +0 -2
- package/lib/locale/lang/pt-BR.min.js +0 -1
- package/lib/locale/lang/ru-RU.d.ts +0 -2
- package/lib/locale/lang/ru-RU.min.js +0 -1
- package/lib/locale/lang/th-TH.d.ts +0 -2
- package/lib/locale/lang/th-TH.min.js +0 -1
- package/lib/locale/lang/ug-CN.d.ts +0 -2
- package/lib/locale/lang/ug-CN.min.js +0 -1
- package/lib/locale/lang/uk-UA.d.ts +0 -2
- package/lib/locale/lang/uk-UA.min.js +0 -1
- package/lib/locale/lang/uz-UZ.d.ts +0 -2
- package/lib/locale/lang/uz-UZ.min.js +0 -1
- package/lib/locale/lang/vi-VN.d.ts +0 -2
- package/lib/locale/lang/vi-VN.min.js +0 -1
- package/lib/locale/lang/zh-CHT.d.ts +0 -2
- package/lib/locale/lang/zh-CHT.min.js +0 -1
- package/lib/locale/lang/zh-CN.d.ts +0 -2
- package/lib/locale/lang/zh-CN.min.js +0 -1
- package/lib/locale/lang/zh-HK.d.ts +0 -2
- package/lib/locale/lang/zh-HK.min.js +0 -1
- package/lib/locale/lang/zh-MO.d.ts +0 -2
- package/lib/locale/lang/zh-MO.min.js +0 -1
- package/lib/locale/lang/zh-TC.min.js +0 -1
- package/lib/locale/lang/zh-TW.d.ts +0 -2
- package/lib/locale/lang/zh-TW.min.js +0 -1
- package/lib/style.min.css +0 -1
- package/lib/table/index.min.js +0 -1
- package/lib/table/module/custom/hook.min.js +0 -1
- package/lib/table/module/custom/panel.min.js +0 -1
- package/lib/table/module/edit/hook.min.js +0 -1
- package/lib/table/module/export/export-panel.min.js +0 -1
- package/lib/table/module/export/hook.min.js +0 -1
- package/lib/table/module/export/import-panel.min.js +0 -1
- package/lib/table/module/export/util.min.js +0 -1
- package/lib/table/module/filter/hook.min.js +0 -1
- package/lib/table/module/filter/panel.min.js +0 -1
- package/lib/table/module/keyboard/hook.min.js +0 -1
- package/lib/table/module/menu/hook.min.js +0 -1
- package/lib/table/module/menu/panel.min.js +0 -1
- package/lib/table/module/validator/hook.min.js +0 -1
- package/lib/table/render/index.min.js +0 -1
- package/lib/table/src/body.min.js +0 -1
- package/lib/table/src/cell.min.js +0 -1
- package/lib/table/src/column.min.js +0 -1
- package/lib/table/src/columnInfo.min.js +0 -1
- package/lib/table/src/emits.min.js +0 -1
- package/lib/table/src/footer.min.js +0 -1
- package/lib/table/src/group.min.js +0 -1
- package/lib/table/src/header.min.js +0 -1
- package/lib/table/src/props.min.js +0 -1
- package/lib/table/src/store.min.js +0 -1
- package/lib/table/src/table.min.js +0 -1
- package/lib/table/src/use/cell-view.min.js +0 -1
- package/lib/table/src/use/index.min.js +0 -1
- package/lib/table/src/util.min.js +0 -1
- package/lib/table/style/style.min.css +0 -1
- package/lib/toolbar/index.min.js +0 -1
- package/lib/toolbar/src/toolbar.min.js +0 -1
- package/lib/ui/index.min.js +0 -1
- package/lib/ui/src/anime.min.js +0 -1
- package/lib/ui/src/comp.min.js +0 -1
- package/lib/ui/src/dom.min.js +0 -1
- package/lib/ui/src/log.min.js +0 -1
- package/lib/ui/src/utils.min.js +0 -1
- package/lib/ui/src/vn.min.js +0 -1
- package/lib/ui/style/style.min.css +0 -0
- package/lib/v-x-e-table/index.min.js +0 -1
- package/lib/v-x-e-table/style/index.js +0 -1
- package/lib/v-x-e-table/style/style.css +0 -0
- package/lib/v-x-e-table/style/style.min.css +0 -0
- package/lib/vxe-colgroup/index.min.js +0 -1
- package/lib/vxe-colgroup/style/style.min.css +0 -0
- package/lib/vxe-column/index.min.js +0 -1
- package/lib/vxe-column/style/style.min.css +0 -0
- package/lib/vxe-grid/index.min.js +0 -1
- package/lib/vxe-table/index.min.js +0 -1
- package/lib/vxe-table/style/style.min.css +0 -1
- package/lib/vxe-toolbar/index.min.js +0 -1
- package/lib/vxe-ui/index.min.js +0 -1
- package/lib/vxe-ui/style/style.min.css +0 -0
- package/lib/vxe-v-x-e-table/index.js +0 -21
- package/lib/vxe-v-x-e-table/index.min.js +0 -1
- package/lib/vxe-v-x-e-table/style/index.js +0 -1
- package/lib/vxe-v-x-e-table/style/style.css +0 -0
- package/lib/vxe-v-x-e-table/style/style.min.css +0 -0
- /package/{es/iconfont.1792740941484.ttf → dist/iconfont.1792977622800.ttf} +0 -0
- /package/{es/iconfont.1792740941484.woff → dist/iconfont.1792977622800.woff} +0 -0
- /package/{es/iconfont.1792740941484.woff2 → dist/iconfont.1792977622800.woff2} +0 -0
- /package/es/colgroup/{style.min.css → style.mini.css} +0 -0
- /package/es/column/{style.min.css → style.mini.css} +0 -0
- /package/{lib/iconfont.1792740941484.ttf → es/iconfont.1792977622800.ttf} +0 -0
- /package/{lib/iconfont.1792740941484.woff → es/iconfont.1792977622800.woff} +0 -0
- /package/{lib/iconfont.1792740941484.woff2 → es/iconfont.1792977622800.woff2} +0 -0
- /package/es/ui/{style.min.css → style.mini.css} +0 -0
- /package/es/{v-x-e-table/style.css → vxe-colgroup/style.mini.css} +0 -0
- /package/es/{v-x-e-table/style.min.css → vxe-column/style.mini.css} +0 -0
- /package/es/{vxe-colgroup/style.min.css → vxe-ui/style.mini.css} +0 -0
- /package/{es/vxe-column/style.min.css → lib/colgroup/style/style.mini.css} +0 -0
- /package/{es/vxe-ui/style.min.css → lib/column/style/style.mini.css} +0 -0
- /package/{es/vxe-v-x-e-table/style.css → lib/ui/style/style.mini.css} +0 -0
- /package/{es/vxe-v-x-e-table/style.min.css → lib/vxe-colgroup/style/style.mini.css} +0 -0
- /package/lib/{colgroup/style/style.min.css → vxe-column/style/style.mini.css} +0 -0
- /package/lib/{column/style/style.min.css → vxe-ui/style/style.mini.css} +0 -0
package/lib/grid/src/grid.js
CHANGED
|
@@ -1,41 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty
|
|
4
|
-
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var grid_exports = {};
|
|
30
|
+
__export(grid_exports, {
|
|
31
|
+
default: () => grid_default
|
|
5
32
|
});
|
|
6
|
-
exports
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
const {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
} = (0, _log.createComponentLog)('grid');
|
|
26
|
-
const {
|
|
27
|
-
getConfig,
|
|
28
|
-
getI18n,
|
|
29
|
-
commands,
|
|
30
|
-
hooks,
|
|
31
|
-
useFns,
|
|
32
|
-
createEvent,
|
|
33
|
-
globalEvents,
|
|
34
|
-
GLOBAL_EVENT_KEYS,
|
|
35
|
-
renderEmptyElement
|
|
36
|
-
} = _ui.VxeUI;
|
|
37
|
-
const tableComponentPropKeys = Object.keys(_props2.tableProps);
|
|
38
|
-
const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadData', 'reloadData', 'reloadRow', 'loadColumn', 'reloadColumn', 'getRowNode', 'getColumnNode', 'getRowIndex', 'getVTRowIndex', 'getVMRowIndex', 'getColumnIndex', 'getVTColumnIndex', 'getVMColumnIndex', 'setRow', 'createData', 'createRow', 'revertData', 'clearData', 'isRemoveByRow', 'isInsertByRow', 'isUpdateByRow', 'getColumns', 'getColumnById', 'getColumnByField', 'getTableColumn', 'getFullColumns', 'getData', 'getCheckboxRecords', 'getParentRow', 'getTreeRowChildren', 'getTreeRowLevel', 'getTreeParentRow', 'getRowSeq', 'getRowById', 'getRowid', 'getTableData', 'getFullData', 'setColumnFixed', 'clearColumnFixed', 'setColumnWidth', 'getColumnWidth', 'recalcRowHeight', 'setRowHeightConf', 'getRowHeightConf', 'setRowHeight', 'getRowHeight', 'hideColumn', 'showColumn', 'resetColumn', 'refreshColumn', 'refreshScroll', 'recalculate', 'closeTooltip', 'isAllCheckboxChecked', 'isAllCheckboxIndeterminate', 'getCheckboxIndeterminateRecords', 'setCheckboxRow', 'setCheckboxRowKey', 'isCheckedByCheckboxRow', 'isCheckedByCheckboxRowKey', 'isIndeterminateByCheckboxRow', 'isIndeterminateByCheckboxRowKey', 'toggleCheckboxRow', 'setAllCheckboxRow', 'getRadioReserveRecord', 'clearRadioReserve', 'getCheckboxReserveRecords', 'clearCheckboxReserve', 'toggleAllCheckboxRow', 'clearCheckboxRow', 'setCurrentRow', 'isCheckedByRadioRow', 'isCheckedByRadioRowKey', 'setRadioRow', 'setRadioRowKey', 'clearCurrentRow', 'clearRadioRow', 'getCurrentRecord', 'getRadioRecord', 'getCurrentColumn', 'setCurrentColumn', 'clearCurrentColumn', 'setPendingRow', 'togglePendingRow', 'hasPendingByRow', 'isPendingByRow', 'getPendingRecords', 'clearPendingRow', 'setFilterByEvent', 'sort', 'setSort', 'setSortByEvent', 'clearSort', 'clearSortByEvent', 'isSort', 'getSortColumns', 'closeFilter', 'isFilter', 'clearFilterByEvent', 'isActiveFilterByColumn', 'isRowExpandLoaded', 'clearRowExpandLoaded', 'reloadRowExpand', 'reloadRowExpand', 'toggleRowExpand', 'setAllRowExpand', 'setRowExpand', 'isExpandByRow', 'isRowExpandByRow', 'clearRowExpand', 'clearRowExpandReserve', 'getRowExpandRecords', 'getTreeExpandRecords', 'isTreeExpandLoaded', 'clearTreeExpandLoaded', 'reloadTreeExpand', 'reloadTreeChilds', 'toggleTreeExpand', 'setAllTreeExpand', 'setTreeExpand', 'isTreeExpandByRow', 'clearTreeExpand', 'clearTreeExpandReserve', 'getScroll', 'getScrollData', 'scrollTo', 'scrollToStartRow', 'scrollToEndRow', 'scrollToRow', 'scrollToStartColumn', 'scrollToEndColumn', 'scrollToColumn', 'clearScroll', 'updateFooter', 'updateStatus', 'setMergeCells', 'removeInsertRow', 'removeMergeCells', 'getMergeCells', 'setMergeHeaderCells', 'removeMergeHeaderCells', 'getMergeHeaderCells', 'clearMergeHeaderCells', 'clearMergeCells', 'setMergeFooterItems', 'removeMergeFooterItems', 'getMergeFooterItems', 'clearMergeFooterItems', 'setCustomStoreData', 'getCustomStoreData', 'setRowGroupExpand', 'setRowGroupExpandByField', 'setAllRowGroupExpand', 'clearRowGroupExpand', 'isRowGroupExpandByRow', 'isRowGroupRecord', 'isAggregateRecord', 'isAggregateExpandByRow', 'getAggregateContentByRow', 'getAggregateRowChildren', 'setRowGroups', 'clearRowGroups', 'openTooltip', 'moveColumnTo', 'moveRowTo', 'getCellLabel', 'updateCellLabel', 'clearFormatterCache', 'getFooterCellLabel', 'updateFooterCellLabel', 'clearFooterFormatterCache', 'getUpdateCells', 'undo', 'redo', 'effectCellData', 'getCellElement', 'focus', 'blur', 'connect', 'connectToolbar'];
|
|
33
|
+
module.exports = __toCommonJS(grid_exports);
|
|
34
|
+
var import_vue = require("vue");
|
|
35
|
+
var import_comp = require("../../ui/src/comp");
|
|
36
|
+
var import_xe_utils = __toESM(require("xe-utils"));
|
|
37
|
+
var import_utils = require("../../ui/src/utils");
|
|
38
|
+
var import_dom = require("../../ui/src/dom");
|
|
39
|
+
var import_ui = require("../../ui");
|
|
40
|
+
var import_props = require("./props");
|
|
41
|
+
var import_emits = require("./emits");
|
|
42
|
+
var import_vn = require("../../ui/src/vn");
|
|
43
|
+
var import_log = require("../../ui/src/log");
|
|
44
|
+
var import_emits2 = require("../../table/src/emits");
|
|
45
|
+
var import_props2 = require("../../table/src/props");
|
|
46
|
+
var import_table = __toESM(require("../../table"));
|
|
47
|
+
var import_toolbar = __toESM(require("../../toolbar"));
|
|
48
|
+
const { warnLog, errLog } = (0, import_log.createComponentLog)("grid");
|
|
49
|
+
const { getConfig, getI18n, commands, hooks, useFns, createEvent, globalEvents, GLOBAL_EVENT_KEYS, renderEmptyElement } = import_ui.VxeUI;
|
|
50
|
+
const tableComponentPropKeys = Object.keys(import_props2.tableProps);
|
|
51
|
+
const tableComponentMethodKeys = ["clearAll", "syncData", "updateData", "loadData", "reloadData", "reloadRow", "loadColumn", "reloadColumn", "getRowNode", "getColumnNode", "getRowIndex", "getVTRowIndex", "getVMRowIndex", "getColumnIndex", "getVTColumnIndex", "getVMColumnIndex", "setRow", "createData", "createRow", "revertData", "clearData", "isRemoveByRow", "isInsertByRow", "isUpdateByRow", "getColumns", "getColumnById", "getColumnByField", "getTableColumn", "getFullColumns", "getData", "getCheckboxRecords", "getParentRow", "getTreeRowChildren", "getTreeRowLevel", "getTreeParentRow", "getRowSeq", "getRowById", "getRowid", "getTableData", "getFullData", "setColumnFixed", "clearColumnFixed", "setColumnWidth", "getColumnWidth", "recalcRowHeight", "setRowHeightConf", "getRowHeightConf", "setRowHeight", "getRowHeight", "hideColumn", "showColumn", "resetColumn", "refreshColumn", "refreshScroll", "recalculate", "closeTooltip", "isAllCheckboxChecked", "isAllCheckboxIndeterminate", "getCheckboxIndeterminateRecords", "setCheckboxRow", "setCheckboxRowKey", "isCheckedByCheckboxRow", "isCheckedByCheckboxRowKey", "isIndeterminateByCheckboxRow", "isIndeterminateByCheckboxRowKey", "toggleCheckboxRow", "setAllCheckboxRow", "getRadioReserveRecord", "clearRadioReserve", "getCheckboxReserveRecords", "clearCheckboxReserve", "toggleAllCheckboxRow", "clearCheckboxRow", "setCurrentRow", "isCheckedByRadioRow", "isCheckedByRadioRowKey", "setRadioRow", "setRadioRowKey", "clearCurrentRow", "clearRadioRow", "getCurrentRecord", "getRadioRecord", "getCurrentColumn", "setCurrentColumn", "clearCurrentColumn", "setPendingRow", "togglePendingRow", "hasPendingByRow", "isPendingByRow", "getPendingRecords", "clearPendingRow", "setFilterByEvent", "sort", "setSort", "setSortByEvent", "clearSort", "clearSortByEvent", "isSort", "getSortColumns", "closeFilter", "isFilter", "clearFilterByEvent", "isActiveFilterByColumn", "isRowExpandLoaded", "clearRowExpandLoaded", "reloadRowExpand", "reloadRowExpand", "toggleRowExpand", "setAllRowExpand", "setRowExpand", "isExpandByRow", "isRowExpandByRow", "clearRowExpand", "clearRowExpandReserve", "getRowExpandRecords", "getTreeExpandRecords", "isTreeExpandLoaded", "clearTreeExpandLoaded", "reloadTreeExpand", "reloadTreeChilds", "toggleTreeExpand", "setAllTreeExpand", "setTreeExpand", "isTreeExpandByRow", "clearTreeExpand", "clearTreeExpandReserve", "getScroll", "getScrollData", "scrollTo", "scrollToStartRow", "scrollToEndRow", "scrollToRow", "scrollToStartColumn", "scrollToEndColumn", "scrollToColumn", "clearScroll", "updateFooter", "updateStatus", "setMergeCells", "removeInsertRow", "removeMergeCells", "getMergeCells", "setMergeHeaderCells", "removeMergeHeaderCells", "getMergeHeaderCells", "clearMergeHeaderCells", "clearMergeCells", "setMergeFooterItems", "removeMergeFooterItems", "getMergeFooterItems", "clearMergeFooterItems", "setCustomStoreData", "getCustomStoreData", "setRowGroupExpand", "setRowGroupExpandByField", "setAllRowGroupExpand", "clearRowGroupExpand", "isRowGroupExpandByRow", "isRowGroupRecord", "isAggregateRecord", "isAggregateExpandByRow", "getAggregateContentByRow", "getAggregateRowChildren", "setRowGroups", "clearRowGroups", "openTooltip", "moveColumnTo", "moveRowTo", "getCellLabel", "updateCellLabel", "clearFormatterCache", "getFooterCellLabel", "updateFooterCellLabel", "clearFooterFormatterCache", "getUpdateCells", "undo", "redo", "effectCellData", "getCellElement", "focus", "blur", "connect", "connectToolbar"];
|
|
39
52
|
function createReactData() {
|
|
40
53
|
var _a;
|
|
41
54
|
return {
|
|
@@ -50,7 +63,7 @@ function createReactData() {
|
|
|
50
63
|
tZindex: 0,
|
|
51
64
|
tablePage: {
|
|
52
65
|
total: 0,
|
|
53
|
-
pageSize: ((_a = getConfig().pager)
|
|
66
|
+
pageSize: ((_a = getConfig().pager) == null ? void 0 : _a.pageSize) || 10,
|
|
54
67
|
currentPage: 1
|
|
55
68
|
}
|
|
56
69
|
};
|
|
@@ -60,42 +73,34 @@ function createInternalData() {
|
|
|
60
73
|
uFoot: false
|
|
61
74
|
};
|
|
62
75
|
}
|
|
63
|
-
var
|
|
64
|
-
name:
|
|
65
|
-
props:
|
|
66
|
-
emits:
|
|
76
|
+
var grid_default = (0, import_comp.defineVxeComponent)({
|
|
77
|
+
name: "VxeGrid",
|
|
78
|
+
props: import_props.gridProps,
|
|
79
|
+
emits: import_emits.gridEmits,
|
|
67
80
|
setup(props, context) {
|
|
68
|
-
const {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
const
|
|
76
|
-
const defaultLayouts = [['Form'], ['Toolbar', 'Top', 'Table', 'Bottom', 'Pager']];
|
|
77
|
-
const {
|
|
78
|
-
computeSize
|
|
79
|
-
} = useFns.useSize(props);
|
|
80
|
-
const {
|
|
81
|
-
computeIsVScrollbar
|
|
82
|
-
} = useFns.useVScrollbar(props);
|
|
83
|
-
const reactData = (0, _vue.reactive)(createReactData());
|
|
81
|
+
const { slots, emit } = context;
|
|
82
|
+
const xID = import_xe_utils.default.uniqueId();
|
|
83
|
+
const VxeUIFormComponent = import_ui.VxeUI.getComponent("VxeForm");
|
|
84
|
+
const VxeUIPagerComponent = import_ui.VxeUI.getComponent("VxePager");
|
|
85
|
+
const defaultLayouts = [["Form"], ["Toolbar", "Top", "Table", "Bottom", "Pager"]];
|
|
86
|
+
const { computeSize } = useFns.useSize(props);
|
|
87
|
+
const { computeIsVScrollbar } = useFns.useVScrollbar(props);
|
|
88
|
+
const reactData = (0, import_vue.reactive)(createReactData());
|
|
84
89
|
const internalData = createInternalData();
|
|
85
|
-
const refElem = (0,
|
|
86
|
-
const refTable = (0,
|
|
87
|
-
const refForm = (0,
|
|
88
|
-
const refToolbar = (0,
|
|
89
|
-
const refPager = (0,
|
|
90
|
-
const refPopupContainerElem = (0,
|
|
91
|
-
const refFormWrapper = (0,
|
|
92
|
-
const refToolbarWrapper = (0,
|
|
93
|
-
const refTopWrapper = (0,
|
|
94
|
-
const refBottomWrapper = (0,
|
|
95
|
-
const refPagerWrapper = (0,
|
|
96
|
-
const extendTableMethods = methodKeys => {
|
|
90
|
+
const refElem = (0, import_vue.ref)();
|
|
91
|
+
const refTable = (0, import_vue.ref)();
|
|
92
|
+
const refForm = (0, import_vue.ref)();
|
|
93
|
+
const refToolbar = (0, import_vue.ref)();
|
|
94
|
+
const refPager = (0, import_vue.ref)();
|
|
95
|
+
const refPopupContainerElem = (0, import_vue.ref)();
|
|
96
|
+
const refFormWrapper = (0, import_vue.ref)();
|
|
97
|
+
const refToolbarWrapper = (0, import_vue.ref)();
|
|
98
|
+
const refTopWrapper = (0, import_vue.ref)();
|
|
99
|
+
const refBottomWrapper = (0, import_vue.ref)();
|
|
100
|
+
const refPagerWrapper = (0, import_vue.ref)();
|
|
101
|
+
const extendTableMethods = (methodKeys) => {
|
|
97
102
|
const funcs = {};
|
|
98
|
-
methodKeys.forEach(name => {
|
|
103
|
+
methodKeys.forEach((name) => {
|
|
99
104
|
funcs[name] = (...args) => {
|
|
100
105
|
const $xeTable = refTable.value;
|
|
101
106
|
if ($xeTable && $xeTable[name]) {
|
|
@@ -106,7 +111,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
106
111
|
return funcs;
|
|
107
112
|
};
|
|
108
113
|
const gridExtendTableMethods = extendTableMethods(tableComponentMethodKeys);
|
|
109
|
-
tableComponentMethodKeys.forEach(name => {
|
|
114
|
+
tableComponentMethodKeys.forEach((name) => {
|
|
110
115
|
gridExtendTableMethods[name] = (...args) => {
|
|
111
116
|
const $xeTable = refTable.value;
|
|
112
117
|
if ($xeTable && $xeTable[name]) {
|
|
@@ -114,105 +119,82 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
114
119
|
}
|
|
115
120
|
};
|
|
116
121
|
});
|
|
117
|
-
const computeProxyOpts = (0,
|
|
118
|
-
return
|
|
122
|
+
const computeProxyOpts = (0, import_vue.computed)(() => {
|
|
123
|
+
return import_xe_utils.default.merge({}, import_xe_utils.default.clone(getConfig().grid.proxyConfig, true), props.proxyConfig);
|
|
119
124
|
});
|
|
120
|
-
const computeIsRespMsg = (0,
|
|
125
|
+
const computeIsRespMsg = (0, import_vue.computed)(() => {
|
|
121
126
|
const proxyOpts = computeProxyOpts.value;
|
|
122
|
-
return !!(
|
|
127
|
+
return !!(import_xe_utils.default.isBoolean(proxyOpts.message) ? proxyOpts.message : proxyOpts.showResponseMsg);
|
|
123
128
|
});
|
|
124
|
-
const computeIsActiveMsg = (0,
|
|
129
|
+
const computeIsActiveMsg = (0, import_vue.computed)(() => {
|
|
125
130
|
const proxyOpts = computeProxyOpts.value;
|
|
126
|
-
return
|
|
131
|
+
return import_xe_utils.default.isBoolean(proxyOpts.showActionMsg) ? proxyOpts.showActionMsg : !!proxyOpts.showActiveMsg;
|
|
127
132
|
});
|
|
128
|
-
const computePagerOpts = (0,
|
|
133
|
+
const computePagerOpts = (0, import_vue.computed)(() => {
|
|
129
134
|
return Object.assign({}, getConfig().grid.pagerConfig, props.pagerConfig);
|
|
130
135
|
});
|
|
131
|
-
const computePagerProps = (0,
|
|
136
|
+
const computePagerProps = (0, import_vue.computed)(() => {
|
|
132
137
|
const pagerOpts = computePagerOpts.value;
|
|
133
|
-
return Object.assign({}, pagerOpts, {
|
|
134
|
-
enabled: undefined,
|
|
135
|
-
slots: undefined
|
|
136
|
-
});
|
|
138
|
+
return Object.assign({}, pagerOpts, { enabled: void 0, slots: void 0 });
|
|
137
139
|
});
|
|
138
|
-
const computeFormOpts = (0,
|
|
140
|
+
const computeFormOpts = (0, import_vue.computed)(() => {
|
|
139
141
|
return Object.assign({}, getConfig().grid.formConfig, props.formConfig);
|
|
140
142
|
});
|
|
141
|
-
const computeToolbarOpts = (0,
|
|
143
|
+
const computeToolbarOpts = (0, import_vue.computed)(() => {
|
|
142
144
|
return Object.assign({}, getConfig().grid.toolbarConfig, props.toolbarConfig);
|
|
143
145
|
});
|
|
144
|
-
const computeZoomOpts = (0,
|
|
146
|
+
const computeZoomOpts = (0, import_vue.computed)(() => {
|
|
145
147
|
return Object.assign({}, getConfig().grid.zoomConfig, props.zoomConfig);
|
|
146
148
|
});
|
|
147
|
-
const computeStyles = (0,
|
|
148
|
-
const {
|
|
149
|
-
|
|
150
|
-
maxHeight
|
|
151
|
-
} = props;
|
|
152
|
-
const {
|
|
153
|
-
isZMax,
|
|
154
|
-
tZindex
|
|
155
|
-
} = reactData;
|
|
149
|
+
const computeStyles = (0, import_vue.computed)(() => {
|
|
150
|
+
const { height, maxHeight } = props;
|
|
151
|
+
const { isZMax, tZindex } = reactData;
|
|
156
152
|
const stys = {};
|
|
157
153
|
if (isZMax) {
|
|
158
154
|
stys.zIndex = tZindex;
|
|
159
155
|
} else {
|
|
160
156
|
if (height) {
|
|
161
|
-
stys.height = height ===
|
|
157
|
+
stys.height = height === "auto" || height === "100%" ? "100%" : (0, import_dom.toCssUnit)(height);
|
|
162
158
|
}
|
|
163
159
|
if (maxHeight) {
|
|
164
|
-
stys.maxHeight = maxHeight ===
|
|
160
|
+
stys.maxHeight = maxHeight === "auto" || maxHeight === "100%" ? "100%" : (0, import_dom.toCssUnit)(maxHeight);
|
|
165
161
|
}
|
|
166
162
|
}
|
|
167
163
|
return stys;
|
|
168
164
|
});
|
|
169
|
-
const computeTableExtendProps = (0,
|
|
165
|
+
const computeTableExtendProps = (0, import_vue.computed)(() => {
|
|
170
166
|
const rest = {};
|
|
171
|
-
tableComponentPropKeys.forEach(key => {
|
|
172
|
-
if (props[key] !==
|
|
167
|
+
tableComponentPropKeys.forEach((key) => {
|
|
168
|
+
if (props[key] !== void 0) {
|
|
173
169
|
rest[key] = props[key];
|
|
174
170
|
}
|
|
175
171
|
});
|
|
176
172
|
return rest;
|
|
177
173
|
});
|
|
178
|
-
const computeTableProps = (0,
|
|
179
|
-
const {
|
|
180
|
-
|
|
181
|
-
seqConfig,
|
|
182
|
-
pagerConfig,
|
|
183
|
-
editConfig,
|
|
184
|
-
proxyConfig
|
|
185
|
-
} = props;
|
|
186
|
-
const {
|
|
187
|
-
isZMax,
|
|
188
|
-
tablePage,
|
|
189
|
-
footerData
|
|
190
|
-
} = reactData;
|
|
174
|
+
const computeTableProps = (0, import_vue.computed)(() => {
|
|
175
|
+
const { showFooter, seqConfig, pagerConfig, editConfig, proxyConfig } = props;
|
|
176
|
+
const { isZMax, tablePage, footerData } = reactData;
|
|
191
177
|
const tableExtendProps = computeTableExtendProps.value;
|
|
192
178
|
const proxyOpts = computeProxyOpts.value;
|
|
193
179
|
const pagerOpts = computePagerOpts.value;
|
|
194
180
|
const isLoading = computeIsLoading.value;
|
|
195
181
|
const tProps = Object.assign({}, tableExtendProps);
|
|
196
182
|
if (showFooter && !tProps.footerData) {
|
|
197
|
-
// 如果未设置自己的标位数据,则使用代理的
|
|
198
183
|
tProps.footerData = footerData;
|
|
199
184
|
} else if (proxyOpts.footer && footerData.length) {
|
|
200
|
-
// 如果代理标为数据,且未请求到数据,则用自己的
|
|
201
185
|
tProps.footerData = footerData;
|
|
202
186
|
}
|
|
203
187
|
if (isZMax) {
|
|
204
188
|
if (tProps.maxHeight) {
|
|
205
|
-
tProps.maxHeight =
|
|
189
|
+
tProps.maxHeight = "100%";
|
|
206
190
|
} else {
|
|
207
|
-
tProps.height =
|
|
191
|
+
tProps.height = "100%";
|
|
208
192
|
}
|
|
209
193
|
}
|
|
210
|
-
if (proxyConfig && (0,
|
|
194
|
+
if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
|
|
211
195
|
tProps.loading = isLoading;
|
|
212
|
-
if (pagerConfig && proxyOpts.seq && (0,
|
|
213
|
-
tProps.seqConfig = Object.assign({}, seqConfig, {
|
|
214
|
-
startIndex: (tablePage.currentPage - 1) * tablePage.pageSize
|
|
215
|
-
});
|
|
196
|
+
if (pagerConfig && proxyOpts.seq && (0, import_utils.isEnableConf)(pagerOpts)) {
|
|
197
|
+
tProps.seqConfig = Object.assign({}, seqConfig, { startIndex: (tablePage.currentPage - 1) * tablePage.pageSize });
|
|
216
198
|
}
|
|
217
199
|
}
|
|
218
200
|
if (editConfig) {
|
|
@@ -220,10 +202,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
220
202
|
}
|
|
221
203
|
return tProps;
|
|
222
204
|
});
|
|
223
|
-
const computeCurrLayoutConf = (0,
|
|
224
|
-
const {
|
|
225
|
-
layouts
|
|
226
|
-
} = props;
|
|
205
|
+
const computeCurrLayoutConf = (0, import_vue.computed)(() => {
|
|
206
|
+
const { layouts } = props;
|
|
227
207
|
let confs = [];
|
|
228
208
|
if (layouts && layouts.length) {
|
|
229
209
|
confs = layouts;
|
|
@@ -234,7 +214,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
234
214
|
let bodyKeys = [];
|
|
235
215
|
let footKeys = [];
|
|
236
216
|
if (confs.length) {
|
|
237
|
-
if (
|
|
217
|
+
if (import_xe_utils.default.isArray(confs[0])) {
|
|
238
218
|
headKeys = confs[0];
|
|
239
219
|
bodyKeys = confs[1] || [];
|
|
240
220
|
footKeys = confs[2] || [];
|
|
@@ -248,37 +228,28 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
248
228
|
footKeys
|
|
249
229
|
};
|
|
250
230
|
});
|
|
251
|
-
const computeCustomCurrentPageFlag = (0,
|
|
231
|
+
const computeCustomCurrentPageFlag = (0, import_vue.computed)(() => {
|
|
252
232
|
const pagerOpts = computePagerOpts.value;
|
|
253
233
|
return pagerOpts.currentPage;
|
|
254
234
|
});
|
|
255
|
-
const computeCustomPageSizeFlag = (0,
|
|
235
|
+
const computeCustomPageSizeFlag = (0, import_vue.computed)(() => {
|
|
256
236
|
const pagerOpts = computePagerOpts.value;
|
|
257
237
|
return pagerOpts.pageSize;
|
|
258
238
|
});
|
|
259
|
-
const computeCustomTotalFlag = (0,
|
|
239
|
+
const computeCustomTotalFlag = (0, import_vue.computed)(() => {
|
|
260
240
|
const pagerOpts = computePagerOpts.value;
|
|
261
241
|
return pagerOpts.total;
|
|
262
242
|
});
|
|
263
|
-
const computePageCount = (0,
|
|
264
|
-
const {
|
|
265
|
-
tablePage
|
|
266
|
-
} = reactData;
|
|
243
|
+
const computePageCount = (0, import_vue.computed)(() => {
|
|
244
|
+
const { tablePage } = reactData;
|
|
267
245
|
return Math.max(Math.ceil(tablePage.total / tablePage.pageSize), 1);
|
|
268
246
|
});
|
|
269
|
-
const computeIsLoading = (0,
|
|
270
|
-
const {
|
|
271
|
-
|
|
272
|
-
proxyConfig
|
|
273
|
-
} = props;
|
|
274
|
-
const {
|
|
275
|
-
tableLoading
|
|
276
|
-
} = reactData;
|
|
247
|
+
const computeIsLoading = (0, import_vue.computed)(() => {
|
|
248
|
+
const { loading, proxyConfig } = props;
|
|
249
|
+
const { tableLoading } = reactData;
|
|
277
250
|
const proxyOpts = computeProxyOpts.value;
|
|
278
|
-
const {
|
|
279
|
-
|
|
280
|
-
} = proxyOpts;
|
|
281
|
-
return loading || tableLoading && showLoading && proxyConfig && (0, _utils.isEnableConf)(proxyOpts);
|
|
251
|
+
const { showLoading } = proxyOpts;
|
|
252
|
+
return loading || tableLoading && showLoading && proxyConfig && (0, import_utils.isEnableConf)(proxyOpts);
|
|
282
253
|
});
|
|
283
254
|
const refMaps = {
|
|
284
255
|
refElem,
|
|
@@ -299,7 +270,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
299
270
|
};
|
|
300
271
|
const $xeGrid = {
|
|
301
272
|
xID,
|
|
302
|
-
props
|
|
273
|
+
props,
|
|
303
274
|
context,
|
|
304
275
|
reactData,
|
|
305
276
|
internalData,
|
|
@@ -308,8 +279,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
308
279
|
};
|
|
309
280
|
const initToolbar = () => {
|
|
310
281
|
const toolbarOpts = computeToolbarOpts.value;
|
|
311
|
-
if (props.toolbarConfig && (0,
|
|
312
|
-
(0,
|
|
282
|
+
if (props.toolbarConfig && (0, import_utils.isEnableConf)(toolbarOpts)) {
|
|
283
|
+
(0, import_vue.nextTick)(() => {
|
|
313
284
|
const $xeTable = refTable.value;
|
|
314
285
|
const $xeToolbar = refToolbar.value;
|
|
315
286
|
if ($xeTable && $xeToolbar) {
|
|
@@ -319,35 +290,23 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
319
290
|
}
|
|
320
291
|
};
|
|
321
292
|
const getFormData = () => {
|
|
322
|
-
const {
|
|
323
|
-
|
|
324
|
-
} = props;
|
|
325
|
-
const {
|
|
326
|
-
formData
|
|
327
|
-
} = reactData;
|
|
293
|
+
const { proxyConfig } = props;
|
|
294
|
+
const { formData } = reactData;
|
|
328
295
|
const proxyOpts = computeProxyOpts.value;
|
|
329
296
|
const formOpts = computeFormOpts.value;
|
|
330
|
-
return proxyConfig && (0,
|
|
297
|
+
return proxyConfig && (0, import_utils.isEnableConf)(proxyOpts) && proxyOpts.form ? formData : formOpts.data;
|
|
331
298
|
};
|
|
332
|
-
const initPages = propKey => {
|
|
333
|
-
const {
|
|
334
|
-
|
|
335
|
-
} = reactData;
|
|
336
|
-
const {
|
|
337
|
-
pagerConfig
|
|
338
|
-
} = props;
|
|
299
|
+
const initPages = (propKey) => {
|
|
300
|
+
const { tablePage } = reactData;
|
|
301
|
+
const { pagerConfig } = props;
|
|
339
302
|
const pagerOpts = computePagerOpts.value;
|
|
340
|
-
if (pagerConfig && (0,
|
|
303
|
+
if (pagerConfig && (0, import_utils.isEnableConf)(pagerOpts)) {
|
|
341
304
|
if (propKey) {
|
|
342
305
|
if (pagerOpts[propKey]) {
|
|
343
|
-
tablePage[propKey] =
|
|
306
|
+
tablePage[propKey] = import_xe_utils.default.toNumber(pagerOpts[propKey]);
|
|
344
307
|
}
|
|
345
308
|
} else {
|
|
346
|
-
const {
|
|
347
|
-
currentPage,
|
|
348
|
-
pageSize,
|
|
349
|
-
total
|
|
350
|
-
} = pagerOpts;
|
|
309
|
+
const { currentPage, pageSize, total } = pagerOpts;
|
|
351
310
|
if (currentPage) {
|
|
352
311
|
tablePage.currentPage = currentPage;
|
|
353
312
|
}
|
|
@@ -360,7 +319,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
360
319
|
}
|
|
361
320
|
}
|
|
362
321
|
};
|
|
363
|
-
const triggerPendingEvent = code => {
|
|
322
|
+
const triggerPendingEvent = (code) => {
|
|
364
323
|
const isActiveMsg = computeIsActiveMsg.value;
|
|
365
324
|
const $xeTable = refTable.value;
|
|
366
325
|
const selectRecords = $xeTable ? $xeTable.getCheckboxRecords() : [];
|
|
@@ -371,12 +330,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
371
330
|
$xeGrid.clearCheckboxRow();
|
|
372
331
|
} else {
|
|
373
332
|
if (isActiveMsg) {
|
|
374
|
-
if (
|
|
375
|
-
|
|
376
|
-
id: code,
|
|
377
|
-
content: getI18n('vxe.grid.selectOneRecord'),
|
|
378
|
-
status: 'warning'
|
|
379
|
-
});
|
|
333
|
+
if (import_ui.VxeUI.modal) {
|
|
334
|
+
import_ui.VxeUI.modal.message({ id: code, content: getI18n("vxe.grid.selectOneRecord"), status: "warning" });
|
|
380
335
|
}
|
|
381
336
|
}
|
|
382
337
|
}
|
|
@@ -388,12 +343,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
388
343
|
const $xeTable = refTable.value;
|
|
389
344
|
let msg;
|
|
390
345
|
if (rest && messageProp) {
|
|
391
|
-
msg =
|
|
392
|
-
data: rest,
|
|
393
|
-
$table: $xeTable,
|
|
394
|
-
$grid: $xeGrid,
|
|
395
|
-
$gantt: null
|
|
396
|
-
}) : _xeUtils.default.get(rest, messageProp);
|
|
346
|
+
msg = import_xe_utils.default.isFunction(messageProp) ? messageProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null }) : import_xe_utils.default.get(rest, messageProp);
|
|
397
347
|
}
|
|
398
348
|
return msg || getI18n(defaultMsg);
|
|
399
349
|
};
|
|
@@ -402,24 +352,16 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
402
352
|
const selectRecords = $xeGrid.getCheckboxRecords();
|
|
403
353
|
if (isActiveMsg) {
|
|
404
354
|
if (selectRecords.length) {
|
|
405
|
-
if (
|
|
406
|
-
return
|
|
407
|
-
|
|
408
|
-
content: getI18n(alertKey),
|
|
409
|
-
escClosable: true
|
|
410
|
-
}).then(type => {
|
|
411
|
-
if (type === 'confirm') {
|
|
355
|
+
if (import_ui.VxeUI.modal) {
|
|
356
|
+
return import_ui.VxeUI.modal.confirm({ id: `cfm_${code}`, content: getI18n(alertKey), escClosable: true }).then((type) => {
|
|
357
|
+
if (type === "confirm") {
|
|
412
358
|
return callback();
|
|
413
359
|
}
|
|
414
360
|
});
|
|
415
361
|
}
|
|
416
362
|
} else {
|
|
417
|
-
if (
|
|
418
|
-
|
|
419
|
-
id: `msg_${code}`,
|
|
420
|
-
content: getI18n('vxe.grid.selectOneRecord'),
|
|
421
|
-
status: 'warning'
|
|
422
|
-
});
|
|
363
|
+
if (import_ui.VxeUI.modal) {
|
|
364
|
+
import_ui.VxeUI.modal.message({ id: `msg_${code}`, content: getI18n("vxe.grid.selectOneRecord"), status: "warning" });
|
|
423
365
|
}
|
|
424
366
|
}
|
|
425
367
|
} else {
|
|
@@ -429,166 +371,134 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
429
371
|
}
|
|
430
372
|
return Promise.resolve();
|
|
431
373
|
};
|
|
432
|
-
const pageChangeEvent = params => {
|
|
433
|
-
const {
|
|
434
|
-
|
|
435
|
-
} =
|
|
436
|
-
const {
|
|
437
|
-
tablePage
|
|
438
|
-
} = reactData;
|
|
439
|
-
const {
|
|
440
|
-
$event,
|
|
441
|
-
currentPage,
|
|
442
|
-
pageSize
|
|
443
|
-
} = params;
|
|
374
|
+
const pageChangeEvent = (params) => {
|
|
375
|
+
const { proxyConfig } = props;
|
|
376
|
+
const { tablePage } = reactData;
|
|
377
|
+
const { $event, currentPage, pageSize } = params;
|
|
444
378
|
const proxyOpts = computeProxyOpts.value;
|
|
445
379
|
tablePage.currentPage = currentPage;
|
|
446
380
|
tablePage.pageSize = pageSize;
|
|
447
|
-
$xeGrid.dispatchEvent(
|
|
448
|
-
if (proxyConfig && (0,
|
|
449
|
-
$xeGrid.commitProxy(
|
|
450
|
-
$xeGrid.dispatchEvent(
|
|
381
|
+
$xeGrid.dispatchEvent("page-change", params, $event);
|
|
382
|
+
if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
|
|
383
|
+
$xeGrid.commitProxy("query").then((rest) => {
|
|
384
|
+
$xeGrid.dispatchEvent("proxy-query", rest, $event);
|
|
451
385
|
});
|
|
452
386
|
}
|
|
453
387
|
};
|
|
454
|
-
const handleSortEvent = params => {
|
|
388
|
+
const handleSortEvent = (params) => {
|
|
455
389
|
const $xeTable = refTable.value;
|
|
456
|
-
const {
|
|
457
|
-
proxyConfig
|
|
458
|
-
} = props;
|
|
390
|
+
const { proxyConfig } = props;
|
|
459
391
|
if (!$xeTable) {
|
|
460
392
|
return;
|
|
461
393
|
}
|
|
462
|
-
const {
|
|
463
|
-
computeSortOpts
|
|
464
|
-
} = $xeTable.getComputeMaps();
|
|
394
|
+
const { computeSortOpts } = $xeTable.getComputeMaps();
|
|
465
395
|
const proxyOpts = computeProxyOpts.value;
|
|
466
396
|
const sortOpts = computeSortOpts.value;
|
|
467
|
-
// 如果是服务端排序
|
|
468
397
|
if (sortOpts.remote) {
|
|
469
398
|
reactData.sortData = params.sortList;
|
|
470
|
-
if (proxyConfig && (0,
|
|
399
|
+
if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
|
|
471
400
|
reactData.tablePage.currentPage = 1;
|
|
472
|
-
$xeGrid.commitProxy(
|
|
473
|
-
$xeGrid.dispatchEvent(
|
|
401
|
+
$xeGrid.commitProxy("query").then((rest) => {
|
|
402
|
+
$xeGrid.dispatchEvent("proxy-query", rest, params.$event);
|
|
474
403
|
});
|
|
475
404
|
}
|
|
476
405
|
}
|
|
477
406
|
};
|
|
478
|
-
const sortChangeEvent = params => {
|
|
407
|
+
const sortChangeEvent = (params) => {
|
|
479
408
|
handleSortEvent(params);
|
|
480
|
-
$xeGrid.dispatchEvent(
|
|
409
|
+
$xeGrid.dispatchEvent("sort-change", params, params.$event);
|
|
481
410
|
};
|
|
482
|
-
const clearAllSortEvent = params => {
|
|
411
|
+
const clearAllSortEvent = (params) => {
|
|
483
412
|
handleSortEvent(params);
|
|
484
|
-
$xeGrid.dispatchEvent(
|
|
413
|
+
$xeGrid.dispatchEvent("clear-all-sort", params, params.$event);
|
|
485
414
|
};
|
|
486
|
-
const handleFilterEvent = params => {
|
|
415
|
+
const handleFilterEvent = (params) => {
|
|
487
416
|
const $xeTable = refTable.value;
|
|
488
|
-
const {
|
|
489
|
-
proxyConfig
|
|
490
|
-
} = props;
|
|
417
|
+
const { proxyConfig } = props;
|
|
491
418
|
if (!$xeTable) {
|
|
492
419
|
return;
|
|
493
420
|
}
|
|
494
|
-
const {
|
|
495
|
-
computeFilterOpts
|
|
496
|
-
} = $xeTable.getComputeMaps();
|
|
421
|
+
const { computeFilterOpts } = $xeTable.getComputeMaps();
|
|
497
422
|
const proxyOpts = computeProxyOpts.value;
|
|
498
423
|
const filterOpts = computeFilterOpts.value;
|
|
499
|
-
// 如果是服务端过滤
|
|
500
424
|
if (filterOpts.remote) {
|
|
501
425
|
reactData.filterData = params.filterList;
|
|
502
|
-
if (proxyConfig && (0,
|
|
426
|
+
if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
|
|
503
427
|
reactData.tablePage.currentPage = 1;
|
|
504
428
|
internalData.uFoot = true;
|
|
505
|
-
$xeGrid.commitProxy(
|
|
506
|
-
$xeGrid.dispatchEvent(
|
|
429
|
+
$xeGrid.commitProxy("query").then((rest) => {
|
|
430
|
+
$xeGrid.dispatchEvent("proxy-query", rest, params.$event);
|
|
507
431
|
});
|
|
508
432
|
internalData.uFoot = false;
|
|
509
433
|
updateQueryFooter();
|
|
510
434
|
}
|
|
511
435
|
}
|
|
512
436
|
};
|
|
513
|
-
const filterChangeEvent = params => {
|
|
437
|
+
const filterChangeEvent = (params) => {
|
|
514
438
|
handleFilterEvent(params);
|
|
515
|
-
$xeGrid.dispatchEvent(
|
|
439
|
+
$xeGrid.dispatchEvent("filter-change", params, params.$event);
|
|
516
440
|
};
|
|
517
|
-
const clearAllFilterEvent = params => {
|
|
441
|
+
const clearAllFilterEvent = (params) => {
|
|
518
442
|
handleFilterEvent(params);
|
|
519
|
-
$xeGrid.dispatchEvent(
|
|
443
|
+
$xeGrid.dispatchEvent("clear-all-filter", params, params.$event);
|
|
520
444
|
};
|
|
521
|
-
const submitFormEvent = params => {
|
|
522
|
-
const {
|
|
523
|
-
proxyConfig
|
|
524
|
-
} = props;
|
|
445
|
+
const submitFormEvent = (params) => {
|
|
446
|
+
const { proxyConfig } = props;
|
|
525
447
|
const proxyOpts = computeProxyOpts.value;
|
|
526
448
|
const formOptions = proxyOpts.formOptions || {};
|
|
527
449
|
if (reactData.tableLoading) {
|
|
528
450
|
return;
|
|
529
451
|
}
|
|
530
|
-
if (proxyConfig && (0,
|
|
531
|
-
$xeGrid.dispatchEvent(
|
|
452
|
+
if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
|
|
453
|
+
$xeGrid.dispatchEvent("form-submit", params, params.$event);
|
|
532
454
|
internalData.uFoot = true;
|
|
533
|
-
$xeGrid.commitProxy(formOptions.submitMode ||
|
|
534
|
-
$xeGrid.dispatchEvent(
|
|
535
|
-
isReload: true
|
|
536
|
-
}), params.$event);
|
|
455
|
+
$xeGrid.commitProxy(formOptions.submitMode || "reload").then((rest) => {
|
|
456
|
+
$xeGrid.dispatchEvent("proxy-query", { ...rest, isReload: true }, params.$event);
|
|
537
457
|
});
|
|
538
458
|
internalData.uFoot = false;
|
|
539
459
|
updateQueryFooter();
|
|
540
460
|
} else {
|
|
541
|
-
$xeGrid.dispatchEvent(
|
|
461
|
+
$xeGrid.dispatchEvent("form-submit", params, params.$event);
|
|
542
462
|
}
|
|
543
463
|
};
|
|
544
|
-
const resetFormEvent = params => {
|
|
464
|
+
const resetFormEvent = (params) => {
|
|
545
465
|
const $xeTable = refTable.value;
|
|
546
|
-
const {
|
|
547
|
-
|
|
548
|
-
} = props;
|
|
549
|
-
const {
|
|
550
|
-
$event
|
|
551
|
-
} = params;
|
|
466
|
+
const { proxyConfig } = props;
|
|
467
|
+
const { $event } = params;
|
|
552
468
|
const proxyOpts = computeProxyOpts.value;
|
|
553
|
-
if (proxyConfig && (0,
|
|
469
|
+
if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
|
|
554
470
|
const formOptions = proxyOpts.formOptions || {};
|
|
555
|
-
$xeGrid.dispatchEvent(
|
|
471
|
+
$xeGrid.dispatchEvent("form-reset", params, $event);
|
|
556
472
|
if ($xeTable) {
|
|
557
473
|
$xeTable.clearScroll();
|
|
558
474
|
}
|
|
559
475
|
internalData.uFoot = true;
|
|
560
|
-
$xeGrid.commitProxy(formOptions.resetMode ===
|
|
561
|
-
$xeGrid.dispatchEvent(
|
|
562
|
-
isReload: true
|
|
563
|
-
}), $event);
|
|
476
|
+
$xeGrid.commitProxy(formOptions.resetMode === "reset_form" ? "query" : "reload").then((rest) => {
|
|
477
|
+
$xeGrid.dispatchEvent("proxy-query", { ...rest, isReload: true }, $event);
|
|
564
478
|
});
|
|
565
479
|
internalData.uFoot = false;
|
|
566
480
|
updateQueryFooter();
|
|
567
481
|
} else {
|
|
568
|
-
$xeGrid.dispatchEvent(
|
|
482
|
+
$xeGrid.dispatchEvent("form-reset", params, $event);
|
|
569
483
|
}
|
|
570
484
|
};
|
|
571
|
-
const submitInvalidEvent = params => {
|
|
572
|
-
$xeGrid.dispatchEvent(
|
|
485
|
+
const submitInvalidEvent = (params) => {
|
|
486
|
+
$xeGrid.dispatchEvent("form-submit-invalid", params, params.$event);
|
|
573
487
|
};
|
|
574
|
-
const collapseEvent = params => {
|
|
575
|
-
const {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
$xeGrid.dispatchEvent('form-toggle-collapse', params, $event);
|
|
579
|
-
$xeGrid.dispatchEvent('form-collapse', params, $event);
|
|
488
|
+
const collapseEvent = (params) => {
|
|
489
|
+
const { $event } = params;
|
|
490
|
+
$xeGrid.dispatchEvent("form-toggle-collapse", params, $event);
|
|
491
|
+
$xeGrid.dispatchEvent("form-collapse", params, $event);
|
|
580
492
|
};
|
|
581
|
-
const handleZoom = isMax => {
|
|
582
|
-
const {
|
|
583
|
-
isZMax
|
|
584
|
-
} = reactData;
|
|
493
|
+
const handleZoom = (isMax) => {
|
|
494
|
+
const { isZMax } = reactData;
|
|
585
495
|
if (isMax ? !isZMax : isZMax) {
|
|
586
496
|
reactData.isZMax = !isZMax;
|
|
587
|
-
if (reactData.tZindex < (0,
|
|
588
|
-
reactData.tZindex = (0,
|
|
497
|
+
if (reactData.tZindex < (0, import_utils.getLastZIndex)()) {
|
|
498
|
+
reactData.tZindex = (0, import_utils.nextZIndex)();
|
|
589
499
|
}
|
|
590
500
|
}
|
|
591
|
-
return (0,
|
|
501
|
+
return (0, import_vue.nextTick)().then(() => $xeGrid.recalculate(true)).then(() => {
|
|
592
502
|
setTimeout(() => $xeGrid.recalculate(true), 15);
|
|
593
503
|
return reactData.isZMax;
|
|
594
504
|
});
|
|
@@ -596,11 +506,11 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
596
506
|
const getFuncSlot = (optSlots, slotKey) => {
|
|
597
507
|
const funcSlot = optSlots[slotKey];
|
|
598
508
|
if (funcSlot) {
|
|
599
|
-
if (
|
|
509
|
+
if (import_xe_utils.default.isString(funcSlot)) {
|
|
600
510
|
if (slots[funcSlot]) {
|
|
601
511
|
return slots[funcSlot];
|
|
602
512
|
} else {
|
|
603
|
-
errLog(
|
|
513
|
+
errLog("vxe.error.notSlot", [funcSlot]);
|
|
604
514
|
}
|
|
605
515
|
} else {
|
|
606
516
|
return funcSlot;
|
|
@@ -608,15 +518,15 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
608
518
|
}
|
|
609
519
|
return null;
|
|
610
520
|
};
|
|
611
|
-
const getConfigSlot = slotConfigs => {
|
|
521
|
+
const getConfigSlot = (slotConfigs) => {
|
|
612
522
|
const slotConf = {};
|
|
613
|
-
|
|
523
|
+
import_xe_utils.default.objectMap(slotConfigs, (slotFunc, slotKey) => {
|
|
614
524
|
if (slotFunc) {
|
|
615
|
-
if (
|
|
525
|
+
if (import_xe_utils.default.isString(slotFunc)) {
|
|
616
526
|
if (slots[slotFunc]) {
|
|
617
527
|
slotConf[slotKey] = slots[slotFunc];
|
|
618
528
|
} else {
|
|
619
|
-
errLog(
|
|
529
|
+
errLog("vxe.error.notSlot", [slotFunc]);
|
|
620
530
|
}
|
|
621
531
|
} else {
|
|
622
532
|
slotConf[slotKey] = slotFunc;
|
|
@@ -625,26 +535,15 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
625
535
|
});
|
|
626
536
|
return slotConf;
|
|
627
537
|
};
|
|
628
|
-
/**
|
|
629
|
-
* 渲染表单
|
|
630
|
-
*/
|
|
631
538
|
const renderForm = () => {
|
|
632
|
-
const {
|
|
633
|
-
|
|
634
|
-
proxyConfig
|
|
635
|
-
} = props;
|
|
636
|
-
const {
|
|
637
|
-
formData
|
|
638
|
-
} = reactData;
|
|
539
|
+
const { formConfig, proxyConfig } = props;
|
|
540
|
+
const { formData } = reactData;
|
|
639
541
|
const proxyOpts = computeProxyOpts.value;
|
|
640
542
|
const formOpts = computeFormOpts.value;
|
|
641
|
-
if (formConfig && (0,
|
|
543
|
+
if (formConfig && (0, import_utils.isEnableConf)(formOpts) || slots.form) {
|
|
642
544
|
let slotVNs = [];
|
|
643
545
|
if (slots.form) {
|
|
644
|
-
slotVNs = slots.form({
|
|
645
|
-
$grid: $xeGrid,
|
|
646
|
-
$gantt: null
|
|
647
|
-
});
|
|
546
|
+
slotVNs = slots.form({ $grid: $xeGrid, $gantt: null });
|
|
648
547
|
} else {
|
|
649
548
|
if (formOpts.items) {
|
|
650
549
|
const formSlots = {};
|
|
@@ -652,19 +551,14 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
652
551
|
formOpts.inited = true;
|
|
653
552
|
const beforeItem = proxyOpts.beforeItem;
|
|
654
553
|
if (proxyOpts && beforeItem) {
|
|
655
|
-
formOpts.items.forEach(item => {
|
|
656
|
-
beforeItem({
|
|
657
|
-
$grid: $xeGrid,
|
|
658
|
-
$gantt: null,
|
|
659
|
-
item
|
|
660
|
-
});
|
|
554
|
+
formOpts.items.forEach((item) => {
|
|
555
|
+
beforeItem({ $grid: $xeGrid, $gantt: null, item });
|
|
661
556
|
});
|
|
662
557
|
}
|
|
663
558
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
if (func && !_xeUtils.default.isFunction(func)) {
|
|
559
|
+
formOpts.items.forEach((item) => {
|
|
560
|
+
import_xe_utils.default.each(item.slots, (func) => {
|
|
561
|
+
if (func && !import_xe_utils.default.isFunction(func)) {
|
|
668
562
|
if (slots[func]) {
|
|
669
563
|
formSlots[func] = slots[func];
|
|
670
564
|
}
|
|
@@ -672,53 +566,47 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
672
566
|
});
|
|
673
567
|
});
|
|
674
568
|
if (VxeUIFormComponent) {
|
|
675
|
-
slotVNs.push(
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
569
|
+
slotVNs.push(
|
|
570
|
+
(0, import_vue.h)(VxeUIFormComponent, {
|
|
571
|
+
ref: refForm,
|
|
572
|
+
...Object.assign({}, formOpts, {
|
|
573
|
+
data: proxyConfig && (0, import_utils.isEnableConf)(proxyOpts) && proxyOpts.form ? formData : formOpts.data
|
|
574
|
+
}),
|
|
575
|
+
onSubmit: submitFormEvent,
|
|
576
|
+
onReset: resetFormEvent,
|
|
577
|
+
onSubmitInvalid: submitInvalidEvent,
|
|
578
|
+
onCollapse: collapseEvent
|
|
579
|
+
}, formSlots)
|
|
580
|
+
);
|
|
685
581
|
}
|
|
686
582
|
}
|
|
687
583
|
}
|
|
688
|
-
return (0,
|
|
584
|
+
return (0, import_vue.h)("div", {
|
|
689
585
|
ref: refFormWrapper,
|
|
690
|
-
key:
|
|
691
|
-
class:
|
|
586
|
+
key: "form",
|
|
587
|
+
class: "vxe-grid--form-wrapper"
|
|
692
588
|
}, slotVNs);
|
|
693
589
|
}
|
|
694
590
|
return renderEmptyElement($xeGrid);
|
|
695
591
|
};
|
|
696
|
-
/**
|
|
697
|
-
* 渲染工具栏
|
|
698
|
-
*/
|
|
699
592
|
const renderToolbar = () => {
|
|
700
|
-
const {
|
|
701
|
-
toolbarConfig
|
|
702
|
-
} = props;
|
|
593
|
+
const { toolbarConfig } = props;
|
|
703
594
|
const toolbarOpts = computeToolbarOpts.value;
|
|
704
595
|
const toolbarSlot = slots.toolbar;
|
|
705
|
-
if (toolbarConfig && (0,
|
|
596
|
+
if (toolbarConfig && (0, import_utils.isEnableConf)(toolbarOpts) || toolbarSlot) {
|
|
706
597
|
let slotVNs = [];
|
|
707
598
|
if (toolbarSlot) {
|
|
708
|
-
slotVNs = toolbarSlot({
|
|
709
|
-
$grid: $xeGrid,
|
|
710
|
-
$gantt: null
|
|
711
|
-
});
|
|
599
|
+
slotVNs = toolbarSlot({ $grid: $xeGrid, $gantt: null });
|
|
712
600
|
} else {
|
|
713
601
|
const toolbarOptSlots = toolbarOpts.slots;
|
|
714
602
|
const toolbarSlots = {};
|
|
715
603
|
if (toolbarOptSlots) {
|
|
716
|
-
const buttonsSlot = getFuncSlot(toolbarOptSlots,
|
|
717
|
-
const buttonPrefixSlot = getFuncSlot(toolbarOptSlots,
|
|
718
|
-
const buttonSuffixSlot = getFuncSlot(toolbarOptSlots,
|
|
719
|
-
const toolsSlot = getFuncSlot(toolbarOptSlots,
|
|
720
|
-
const toolPrefixSlot = getFuncSlot(toolbarOptSlots,
|
|
721
|
-
const toolSuffixSlot = getFuncSlot(toolbarOptSlots,
|
|
604
|
+
const buttonsSlot = getFuncSlot(toolbarOptSlots, "buttons");
|
|
605
|
+
const buttonPrefixSlot = getFuncSlot(toolbarOptSlots, "buttonPrefix");
|
|
606
|
+
const buttonSuffixSlot = getFuncSlot(toolbarOptSlots, "buttonSuffix");
|
|
607
|
+
const toolsSlot = getFuncSlot(toolbarOptSlots, "tools");
|
|
608
|
+
const toolPrefixSlot = getFuncSlot(toolbarOptSlots, "toolPrefix");
|
|
609
|
+
const toolSuffixSlot = getFuncSlot(toolbarOptSlots, "toolSuffix");
|
|
722
610
|
if (buttonsSlot) {
|
|
723
611
|
toolbarSlots.buttons = buttonsSlot;
|
|
724
612
|
}
|
|
@@ -738,79 +626,64 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
738
626
|
toolbarSlots.toolSuffix = toolSuffixSlot;
|
|
739
627
|
}
|
|
740
628
|
}
|
|
741
|
-
slotVNs.push(
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
629
|
+
slotVNs.push(
|
|
630
|
+
(0, import_vue.h)(import_toolbar.default, {
|
|
631
|
+
ref: refToolbar,
|
|
632
|
+
...toolbarOpts,
|
|
633
|
+
slots: void 0
|
|
634
|
+
}, toolbarSlots)
|
|
635
|
+
);
|
|
746
636
|
}
|
|
747
|
-
return (0,
|
|
637
|
+
return (0, import_vue.h)("div", {
|
|
748
638
|
ref: refToolbarWrapper,
|
|
749
|
-
key:
|
|
750
|
-
class:
|
|
639
|
+
key: "toolbar",
|
|
640
|
+
class: "vxe-grid--toolbar-wrapper"
|
|
751
641
|
}, slotVNs);
|
|
752
642
|
}
|
|
753
643
|
return renderEmptyElement($xeGrid);
|
|
754
644
|
};
|
|
755
|
-
/**
|
|
756
|
-
* 渲染表格顶部区域
|
|
757
|
-
*/
|
|
758
645
|
const renderTop = () => {
|
|
759
646
|
const topSlot = slots.top;
|
|
760
647
|
if (topSlot) {
|
|
761
|
-
return (0,
|
|
648
|
+
return (0, import_vue.h)("div", {
|
|
762
649
|
ref: refTopWrapper,
|
|
763
|
-
key:
|
|
764
|
-
class:
|
|
765
|
-
}, topSlot({
|
|
766
|
-
$grid: $xeGrid,
|
|
767
|
-
$gantt: null
|
|
768
|
-
}));
|
|
650
|
+
key: "top",
|
|
651
|
+
class: "vxe-grid--top-wrapper"
|
|
652
|
+
}, topSlot({ $grid: $xeGrid, $gantt: null }));
|
|
769
653
|
}
|
|
770
654
|
return renderEmptyElement($xeGrid);
|
|
771
655
|
};
|
|
772
656
|
const renderTableLeft = () => {
|
|
773
657
|
const leftSlot = slots.left;
|
|
774
658
|
if (leftSlot) {
|
|
775
|
-
return (0,
|
|
776
|
-
class:
|
|
777
|
-
}, leftSlot({
|
|
778
|
-
$grid: $xeGrid,
|
|
779
|
-
$gantt: null
|
|
780
|
-
}));
|
|
659
|
+
return (0, import_vue.h)("div", {
|
|
660
|
+
class: "vxe-grid--left-wrapper"
|
|
661
|
+
}, leftSlot({ $grid: $xeGrid, $gantt: null }));
|
|
781
662
|
}
|
|
782
663
|
return renderEmptyElement($xeGrid);
|
|
783
664
|
};
|
|
784
665
|
const renderTableRight = () => {
|
|
785
666
|
const rightSlot = slots.right;
|
|
786
667
|
if (rightSlot) {
|
|
787
|
-
return (0,
|
|
788
|
-
class:
|
|
789
|
-
}, rightSlot({
|
|
790
|
-
$grid: $xeGrid,
|
|
791
|
-
$gantt: null
|
|
792
|
-
}));
|
|
668
|
+
return (0, import_vue.h)("div", {
|
|
669
|
+
class: "vxe-grid--right-wrapper"
|
|
670
|
+
}, rightSlot({ $grid: $xeGrid, $gantt: null }));
|
|
793
671
|
}
|
|
794
672
|
return renderEmptyElement($xeGrid);
|
|
795
673
|
};
|
|
796
|
-
/**
|
|
797
|
-
* 渲染表格
|
|
798
|
-
*/
|
|
799
674
|
const renderTable = () => {
|
|
800
|
-
const {
|
|
801
|
-
|
|
802
|
-
} = props;
|
|
803
|
-
const tableProps = computeTableProps.value;
|
|
675
|
+
const { proxyConfig } = props;
|
|
676
|
+
const tableProps2 = computeTableProps.value;
|
|
804
677
|
const proxyOpts = computeProxyOpts.value;
|
|
805
678
|
const tableOns = Object.assign({}, tableCompEvents);
|
|
806
679
|
const emptySlot = slots.empty;
|
|
807
680
|
const loadingSlot = slots.loading;
|
|
808
|
-
const rowDragIconSlot = slots.rowDragIcon || slots[
|
|
809
|
-
const columnDragIconSlot = slots.columnDragIcon || slots[
|
|
810
|
-
const headerTooltipSlot = slots.headerTooltip || slots[
|
|
681
|
+
const rowDragIconSlot = slots.rowDragIcon || slots["row-drag-icon"];
|
|
682
|
+
const columnDragIconSlot = slots.columnDragIcon || slots["column-drag-icon"];
|
|
683
|
+
const headerTooltipSlot = slots.headerTooltip || slots["header-tooltip"];
|
|
811
684
|
const tooltipSlot = slots.tooltip;
|
|
812
|
-
const footerTooltipSlot = slots.footerTooltip || slots[
|
|
813
|
-
if (proxyConfig && (0,
|
|
685
|
+
const footerTooltipSlot = slots.footerTooltip || slots["footer-tooltip"];
|
|
686
|
+
if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
|
|
814
687
|
if (proxyOpts.sort) {
|
|
815
688
|
tableOns.onSortChange = sortChangeEvent;
|
|
816
689
|
tableOns.onClearAllSort = clearAllSortEvent;
|
|
@@ -842,83 +715,81 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
842
715
|
if (footerTooltipSlot) {
|
|
843
716
|
slotObj.footerTooltip = footerTooltipSlot;
|
|
844
717
|
}
|
|
845
|
-
return (0,
|
|
846
|
-
class:
|
|
847
|
-
}, [
|
|
848
|
-
|
|
849
|
-
|
|
718
|
+
return (0, import_vue.h)("div", {
|
|
719
|
+
class: "vxe-grid--table-wrapper"
|
|
720
|
+
}, [
|
|
721
|
+
(0, import_vue.h)(import_table.default, {
|
|
722
|
+
ref: refTable,
|
|
723
|
+
...tableProps2,
|
|
724
|
+
...tableOns
|
|
725
|
+
}, slotObj)
|
|
726
|
+
]);
|
|
850
727
|
};
|
|
851
|
-
/**
|
|
852
|
-
* 渲染表格底部区域
|
|
853
|
-
*/
|
|
854
728
|
const renderBottom = () => {
|
|
855
729
|
if (slots.bottom) {
|
|
856
|
-
return (0,
|
|
730
|
+
return (0, import_vue.h)("div", {
|
|
857
731
|
ref: refBottomWrapper,
|
|
858
|
-
key:
|
|
859
|
-
class:
|
|
860
|
-
}, slots.bottom({
|
|
861
|
-
$grid: $xeGrid,
|
|
862
|
-
$gantt: null
|
|
863
|
-
}));
|
|
732
|
+
key: "bottom",
|
|
733
|
+
class: "vxe-grid--bottom-wrapper"
|
|
734
|
+
}, slots.bottom({ $grid: $xeGrid, $gantt: null }));
|
|
864
735
|
}
|
|
865
736
|
return renderEmptyElement($xeGrid);
|
|
866
737
|
};
|
|
867
|
-
/**
|
|
868
|
-
* 渲染分页
|
|
869
|
-
*/
|
|
870
738
|
const renderPager = () => {
|
|
871
|
-
const {
|
|
872
|
-
proxyConfig,
|
|
873
|
-
pagerConfig
|
|
874
|
-
} = props;
|
|
739
|
+
const { proxyConfig, pagerConfig } = props;
|
|
875
740
|
const proxyOpts = computeProxyOpts.value;
|
|
876
741
|
const pagerOpts = computePagerOpts.value;
|
|
877
742
|
const pagerProps = computePagerProps.value;
|
|
878
743
|
const pagerSlot = slots.pager;
|
|
879
|
-
if (pagerConfig && (0,
|
|
880
|
-
return (0,
|
|
744
|
+
if (pagerConfig && (0, import_utils.isEnableConf)(pagerOpts) || slots.pager) {
|
|
745
|
+
return (0, import_vue.h)("div", {
|
|
881
746
|
ref: refPagerWrapper,
|
|
882
|
-
key:
|
|
883
|
-
class:
|
|
884
|
-
}, pagerSlot ? pagerSlot({
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
747
|
+
key: "pager",
|
|
748
|
+
class: "vxe-grid--pager-wrapper"
|
|
749
|
+
}, pagerSlot ? pagerSlot({ $grid: $xeGrid, $gantt: null }) : [
|
|
750
|
+
VxeUIPagerComponent ? (0, import_vue.h)(VxeUIPagerComponent, {
|
|
751
|
+
ref: refPager,
|
|
752
|
+
...pagerProps,
|
|
753
|
+
...proxyConfig && (0, import_utils.isEnableConf)(proxyOpts) ? reactData.tablePage : {},
|
|
754
|
+
onPageChange: pageChangeEvent
|
|
755
|
+
}, getConfigSlot(pagerOpts.slots)) : renderEmptyElement($xeGrid)
|
|
756
|
+
]);
|
|
892
757
|
}
|
|
893
758
|
return renderEmptyElement($xeGrid);
|
|
894
759
|
};
|
|
895
|
-
const renderChildLayout = layoutKeys => {
|
|
760
|
+
const renderChildLayout = (layoutKeys) => {
|
|
896
761
|
const childVNs = [];
|
|
897
|
-
layoutKeys.forEach(key => {
|
|
762
|
+
layoutKeys.forEach((key) => {
|
|
898
763
|
switch (key) {
|
|
899
|
-
case
|
|
764
|
+
case "Form":
|
|
900
765
|
childVNs.push(renderForm());
|
|
901
766
|
break;
|
|
902
|
-
case
|
|
767
|
+
case "Toolbar":
|
|
903
768
|
childVNs.push(renderToolbar());
|
|
904
769
|
break;
|
|
905
|
-
case
|
|
770
|
+
case "Top":
|
|
906
771
|
childVNs.push(renderTop());
|
|
907
772
|
break;
|
|
908
|
-
case
|
|
909
|
-
childVNs.push(
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
773
|
+
case "Table":
|
|
774
|
+
childVNs.push(
|
|
775
|
+
(0, import_vue.h)("div", {
|
|
776
|
+
key: "table",
|
|
777
|
+
class: "vxe-grid--table-container"
|
|
778
|
+
}, [
|
|
779
|
+
renderTableLeft(),
|
|
780
|
+
renderTable(),
|
|
781
|
+
renderTableRight()
|
|
782
|
+
])
|
|
783
|
+
);
|
|
913
784
|
break;
|
|
914
|
-
case
|
|
785
|
+
case "Bottom":
|
|
915
786
|
childVNs.push(renderBottom());
|
|
916
787
|
break;
|
|
917
|
-
case
|
|
788
|
+
case "Pager":
|
|
918
789
|
childVNs.push(renderPager());
|
|
919
790
|
break;
|
|
920
791
|
default:
|
|
921
|
-
errLog(
|
|
792
|
+
errLog("vxe.error.notProp", [`layouts -> ${key}`]);
|
|
922
793
|
break;
|
|
923
794
|
}
|
|
924
795
|
});
|
|
@@ -926,61 +797,57 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
926
797
|
};
|
|
927
798
|
const renderLayout = () => {
|
|
928
799
|
const currLayoutConf = computeCurrLayoutConf.value;
|
|
929
|
-
const {
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
800
|
+
const { headKeys, bodyKeys, footKeys } = currLayoutConf;
|
|
801
|
+
const asideLeftSlot = slots.asideLeft || slots["aside-left"];
|
|
802
|
+
const asideRightSlot = slots.asideRight || slots["aside-right"];
|
|
803
|
+
return [
|
|
804
|
+
(0, import_vue.h)("div", {
|
|
805
|
+
class: "vxe-grid--layout-header-wrapper"
|
|
806
|
+
}, renderChildLayout(headKeys)),
|
|
807
|
+
(0, import_vue.h)("div", {
|
|
808
|
+
class: "vxe-grid--layout-body-wrapper"
|
|
809
|
+
}, [
|
|
810
|
+
asideLeftSlot ? (0, import_vue.h)("div", {
|
|
811
|
+
class: "vxe-grid--layout-aside-left-wrapper"
|
|
812
|
+
}, asideLeftSlot({})) : renderEmptyElement($xeGrid),
|
|
813
|
+
(0, import_vue.h)("div", {
|
|
814
|
+
class: "vxe-grid--layout-body-content-wrapper"
|
|
815
|
+
}, renderChildLayout(bodyKeys)),
|
|
816
|
+
asideRightSlot ? (0, import_vue.h)("div", {
|
|
817
|
+
class: "vxe-grid--layout-aside-right-wrapper"
|
|
818
|
+
}, asideRightSlot({})) : renderEmptyElement($xeGrid)
|
|
819
|
+
]),
|
|
820
|
+
(0, import_vue.h)("div", {
|
|
821
|
+
class: "vxe-grid--layout-footer-wrapper"
|
|
822
|
+
}, renderChildLayout(footKeys)),
|
|
823
|
+
(0, import_vue.h)("div", {
|
|
824
|
+
ref: refPopupContainerElem
|
|
825
|
+
})
|
|
826
|
+
];
|
|
951
827
|
};
|
|
952
828
|
const tableCompEvents = {};
|
|
953
|
-
|
|
954
|
-
const type =
|
|
829
|
+
import_emits2.tableEmits.forEach((name) => {
|
|
830
|
+
const type = import_xe_utils.default.camelCase(`on-${name}`);
|
|
955
831
|
tableCompEvents[type] = (...args) => emit(name, ...args);
|
|
956
832
|
});
|
|
957
833
|
const getDefaultFormData = () => {
|
|
958
834
|
const formOpts = computeFormOpts.value;
|
|
959
835
|
if (formOpts.items) {
|
|
960
836
|
const fData = {};
|
|
961
|
-
formOpts.items.forEach(item => {
|
|
962
|
-
const {
|
|
963
|
-
field,
|
|
964
|
-
itemRender
|
|
965
|
-
} = item;
|
|
837
|
+
formOpts.items.forEach((item) => {
|
|
838
|
+
const { field, itemRender } = item;
|
|
966
839
|
if (field) {
|
|
967
840
|
let itemValue = null;
|
|
968
841
|
if (itemRender) {
|
|
969
|
-
const {
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
} = itemRender;
|
|
974
|
-
if (_xeUtils.default.isFunction(defaultValue)) {
|
|
975
|
-
itemValue = defaultValue({
|
|
976
|
-
item
|
|
977
|
-
});
|
|
978
|
-
} else if (!_xeUtils.default.isUndefined(defaultValue)) {
|
|
842
|
+
const { startField, endField, defaultValue } = itemRender;
|
|
843
|
+
if (import_xe_utils.default.isFunction(defaultValue)) {
|
|
844
|
+
itemValue = defaultValue({ item });
|
|
845
|
+
} else if (!import_xe_utils.default.isUndefined(defaultValue)) {
|
|
979
846
|
itemValue = defaultValue;
|
|
980
847
|
}
|
|
981
848
|
if (startField && endField) {
|
|
982
|
-
|
|
983
|
-
|
|
849
|
+
import_xe_utils.default.set(fData, startField, null);
|
|
850
|
+
import_xe_utils.default.set(fData, endField, null);
|
|
984
851
|
}
|
|
985
852
|
}
|
|
986
853
|
fData[field] = itemValue;
|
|
@@ -991,32 +858,25 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
991
858
|
return {};
|
|
992
859
|
};
|
|
993
860
|
const initProxy = () => {
|
|
994
|
-
const {
|
|
995
|
-
|
|
996
|
-
formConfig
|
|
997
|
-
} = props;
|
|
998
|
-
const {
|
|
999
|
-
proxyInited
|
|
1000
|
-
} = reactData;
|
|
861
|
+
const { proxyConfig, formConfig } = props;
|
|
862
|
+
const { proxyInited } = reactData;
|
|
1001
863
|
const proxyOpts = computeProxyOpts.value;
|
|
1002
864
|
const formOpts = computeFormOpts.value;
|
|
1003
|
-
if (proxyConfig && (0,
|
|
1004
|
-
if (formConfig && (0,
|
|
865
|
+
if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts)) {
|
|
866
|
+
if (formConfig && (0, import_utils.isEnableConf)(formOpts) && proxyOpts.form && formOpts.items) {
|
|
1005
867
|
reactData.formData = getDefaultFormData();
|
|
1006
868
|
}
|
|
1007
869
|
if (!proxyInited) {
|
|
1008
870
|
reactData.proxyInited = true;
|
|
1009
871
|
if (proxyOpts.autoLoad !== false) {
|
|
1010
|
-
(0,
|
|
872
|
+
(0, import_vue.nextTick)().then(() => {
|
|
1011
873
|
internalData.uFoot = true;
|
|
1012
|
-
const rest = $xeGrid.commitProxy(
|
|
874
|
+
const rest = $xeGrid.commitProxy("initial");
|
|
1013
875
|
internalData.uFoot = false;
|
|
1014
876
|
updateQueryFooter();
|
|
1015
877
|
return rest;
|
|
1016
|
-
}).then(rest => {
|
|
1017
|
-
dispatchEvent(
|
|
1018
|
-
isInited: true
|
|
1019
|
-
}), new Event('initial'));
|
|
878
|
+
}).then((rest) => {
|
|
879
|
+
dispatchEvent("proxy-query", { ...rest, isInited: true }, new Event("initial"));
|
|
1020
880
|
});
|
|
1021
881
|
}
|
|
1022
882
|
}
|
|
@@ -1024,14 +884,12 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1024
884
|
};
|
|
1025
885
|
const updateQueryFooter = () => {
|
|
1026
886
|
const proxyOpts = computeProxyOpts.value;
|
|
1027
|
-
const {
|
|
1028
|
-
ajax
|
|
1029
|
-
} = proxyOpts;
|
|
887
|
+
const { ajax } = proxyOpts;
|
|
1030
888
|
if (ajax && ajax.queryFooter) {
|
|
1031
|
-
return $xeGrid.commitProxy(
|
|
889
|
+
return $xeGrid.commitProxy("queryFooter");
|
|
1032
890
|
}
|
|
1033
891
|
};
|
|
1034
|
-
const handleGlobalKeydownEvent = evnt => {
|
|
892
|
+
const handleGlobalKeydownEvent = (evnt) => {
|
|
1035
893
|
const zoomOpts = computeZoomOpts.value;
|
|
1036
894
|
const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
|
|
1037
895
|
if (isEsc && reactData.isZMax && zoomOpts.escRestore !== false) {
|
|
@@ -1039,10 +897,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1039
897
|
}
|
|
1040
898
|
};
|
|
1041
899
|
const dispatchEvent = (type, params, evnt) => {
|
|
1042
|
-
emit(type, createEvent(evnt, {
|
|
1043
|
-
$grid: $xeGrid,
|
|
1044
|
-
$gantt: null
|
|
1045
|
-
}, params));
|
|
900
|
+
emit(type, createEvent(evnt, { $grid: $xeGrid, $gantt: null }, params));
|
|
1046
901
|
};
|
|
1047
902
|
const gridMethods = {
|
|
1048
903
|
dispatchEvent,
|
|
@@ -1054,48 +909,25 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1054
909
|
* @param {String/Object} code 字符串或对象
|
|
1055
910
|
*/
|
|
1056
911
|
commitProxy(proxyTarget, ...args) {
|
|
1057
|
-
const {
|
|
1058
|
-
|
|
1059
|
-
proxyConfig,
|
|
1060
|
-
toolbarConfig,
|
|
1061
|
-
pagerConfig,
|
|
1062
|
-
editRules,
|
|
1063
|
-
validConfig
|
|
1064
|
-
} = props;
|
|
1065
|
-
const {
|
|
1066
|
-
tablePage
|
|
1067
|
-
} = reactData;
|
|
912
|
+
const { showFooter, proxyConfig, toolbarConfig, pagerConfig, editRules, validConfig } = props;
|
|
913
|
+
const { tablePage } = reactData;
|
|
1068
914
|
const isActiveMsg = computeIsActiveMsg.value;
|
|
1069
915
|
const isRespMsg = computeIsRespMsg.value;
|
|
1070
916
|
const proxyOpts = computeProxyOpts.value;
|
|
1071
917
|
const pagerOpts = computePagerOpts.value;
|
|
1072
918
|
const toolbarOpts = computeToolbarOpts.value;
|
|
1073
|
-
const {
|
|
1074
|
-
beforeQuery: oldBeforeQuery,
|
|
1075
|
-
afterQuery: oldAfterQuery,
|
|
1076
|
-
beforeQueryFooter: oldBeforeQueryFooter,
|
|
1077
|
-
afterQueryFooter: oldAfterQueryFooter,
|
|
1078
|
-
beforeDelete: oldBeforeDelete,
|
|
1079
|
-
afterDelete: oldAfterDelete,
|
|
1080
|
-
beforeSave: oldBeforeSave,
|
|
1081
|
-
afterSave: oldAfterSave,
|
|
1082
|
-
ajax = {}
|
|
1083
|
-
} = proxyOpts;
|
|
919
|
+
const { beforeQuery: oldBeforeQuery, afterQuery: oldAfterQuery, beforeQueryFooter: oldBeforeQueryFooter, afterQueryFooter: oldAfterQueryFooter, beforeDelete: oldBeforeDelete, afterDelete: oldAfterDelete, beforeSave: oldBeforeSave, afterSave: oldAfterSave, ajax = {} } = proxyOpts;
|
|
1084
920
|
const resConfigs = proxyOpts.response || proxyOpts.props || {};
|
|
1085
921
|
const $xeTable = refTable.value;
|
|
1086
922
|
if (!$xeTable) {
|
|
1087
|
-
return (0,
|
|
923
|
+
return (0, import_vue.nextTick)();
|
|
1088
924
|
}
|
|
1089
925
|
let formData = getFormData();
|
|
1090
926
|
let button = null;
|
|
1091
927
|
let code = null;
|
|
1092
|
-
if (
|
|
1093
|
-
const {
|
|
1094
|
-
|
|
1095
|
-
} = toolbarOpts;
|
|
1096
|
-
const matchObj = toolbarConfig && (0, _utils.isEnableConf)(toolbarOpts) && buttons ? _xeUtils.default.findTree(buttons, item => item.code === proxyTarget, {
|
|
1097
|
-
children: 'dropdowns'
|
|
1098
|
-
}) : null;
|
|
928
|
+
if (import_xe_utils.default.isString(proxyTarget)) {
|
|
929
|
+
const { buttons } = toolbarOpts;
|
|
930
|
+
const matchObj = toolbarConfig && (0, import_utils.isEnableConf)(toolbarOpts) && buttons ? import_xe_utils.default.findTree(buttons, (item) => item.code === proxyTarget, { children: "dropdowns" }) : null;
|
|
1099
931
|
button = matchObj ? matchObj.item : null;
|
|
1100
932
|
code = proxyTarget;
|
|
1101
933
|
} else {
|
|
@@ -1104,595 +936,469 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1104
936
|
}
|
|
1105
937
|
const btnParams = button ? button.params : null;
|
|
1106
938
|
switch (code) {
|
|
1107
|
-
case
|
|
939
|
+
case "insert":
|
|
1108
940
|
return $xeTable.insert({});
|
|
1109
|
-
case
|
|
1110
|
-
return $xeTable.insert({}).then(({
|
|
1111
|
-
row
|
|
1112
|
-
}) => $xeTable.setEditRow(row, true));
|
|
941
|
+
case "insert_edit":
|
|
942
|
+
return $xeTable.insert({}).then(({ row }) => $xeTable.setEditRow(row, true));
|
|
1113
943
|
// 已废弃
|
|
1114
|
-
case
|
|
1115
|
-
return $xeTable.insert({}).then(({
|
|
1116
|
-
row
|
|
1117
|
-
}) => $xeTable.setEditRow(row, true));
|
|
944
|
+
case "insert_actived":
|
|
945
|
+
return $xeTable.insert({}).then(({ row }) => $xeTable.setEditRow(row, true));
|
|
1118
946
|
// 已废弃
|
|
1119
|
-
case
|
|
947
|
+
case "mark_cancel":
|
|
1120
948
|
triggerPendingEvent(code);
|
|
1121
949
|
break;
|
|
1122
|
-
case
|
|
1123
|
-
return handleDeleteRow(code,
|
|
1124
|
-
case
|
|
950
|
+
case "remove":
|
|
951
|
+
return handleDeleteRow(code, "vxe.grid.removeSelectRecord", () => $xeTable.removeCheckboxRow());
|
|
952
|
+
case "import":
|
|
1125
953
|
$xeTable.importData(btnParams);
|
|
1126
954
|
break;
|
|
1127
|
-
case
|
|
955
|
+
case "open_import":
|
|
1128
956
|
$xeTable.openImport(btnParams);
|
|
1129
957
|
break;
|
|
1130
|
-
case
|
|
958
|
+
case "export":
|
|
1131
959
|
$xeTable.exportData(btnParams);
|
|
1132
960
|
break;
|
|
1133
|
-
case
|
|
961
|
+
case "open_export":
|
|
1134
962
|
$xeTable.openExport(btnParams);
|
|
1135
963
|
break;
|
|
1136
|
-
case
|
|
964
|
+
case "reset_custom":
|
|
1137
965
|
return $xeTable.resetCustom(true);
|
|
1138
|
-
case
|
|
1139
|
-
case
|
|
1140
|
-
case
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
966
|
+
case "initial":
|
|
967
|
+
case "reload":
|
|
968
|
+
case "query": {
|
|
969
|
+
const bqMethod = ajax.beforeQuery;
|
|
970
|
+
const qMethod = ajax.query;
|
|
971
|
+
const aqMethod = ajax.afterQuery;
|
|
972
|
+
const qsMethod = ajax.querySuccess;
|
|
973
|
+
const qeMethod = ajax.queryError;
|
|
974
|
+
if (qMethod) {
|
|
975
|
+
const isInited = code === "initial";
|
|
976
|
+
const isReload = code === "reload";
|
|
977
|
+
if (!isInited && reactData.tableLoading) {
|
|
978
|
+
return (0, import_vue.nextTick)();
|
|
979
|
+
}
|
|
980
|
+
let operPromise = null;
|
|
981
|
+
let sortList = [];
|
|
982
|
+
let filterList = [];
|
|
983
|
+
let pageParams = {};
|
|
984
|
+
if (pagerConfig) {
|
|
985
|
+
if (isInited || isReload) {
|
|
986
|
+
tablePage.currentPage = 1;
|
|
1152
987
|
}
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
let filterList = [];
|
|
1156
|
-
let pageParams = {};
|
|
1157
|
-
if (pagerConfig) {
|
|
1158
|
-
if (isInited || isReload) {
|
|
1159
|
-
// 重置分页
|
|
1160
|
-
tablePage.currentPage = 1;
|
|
1161
|
-
}
|
|
1162
|
-
if ((0, _utils.isEnableConf)(pagerOpts)) {
|
|
1163
|
-
pageParams = Object.assign({}, tablePage);
|
|
1164
|
-
}
|
|
988
|
+
if ((0, import_utils.isEnableConf)(pagerOpts)) {
|
|
989
|
+
pageParams = { ...tablePage };
|
|
1165
990
|
}
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
column.order = null;
|
|
1185
|
-
});
|
|
1186
|
-
// 如果使用默认排序
|
|
1187
|
-
if (defaultSort) {
|
|
1188
|
-
if (!_xeUtils.default.isArray(defaultSort)) {
|
|
1189
|
-
defaultSort = [defaultSort];
|
|
1190
|
-
}
|
|
1191
|
-
sortList = defaultSort.map(item => {
|
|
1192
|
-
const {
|
|
1193
|
-
field,
|
|
1194
|
-
order
|
|
1195
|
-
} = item;
|
|
1196
|
-
const colRest = fullColumnFieldData[field];
|
|
1197
|
-
if (colRest) {
|
|
1198
|
-
const column = colRest.column;
|
|
1199
|
-
if (column) {
|
|
1200
|
-
column.order = order;
|
|
1201
|
-
}
|
|
1202
|
-
}
|
|
1203
|
-
return {
|
|
1204
|
-
field,
|
|
1205
|
-
property: field,
|
|
1206
|
-
order
|
|
1207
|
-
};
|
|
1208
|
-
});
|
|
991
|
+
}
|
|
992
|
+
if (isInited) {
|
|
993
|
+
if (proxyConfig && (0, import_utils.isEnableConf)(proxyOpts) && proxyOpts.form) {
|
|
994
|
+
formData = getDefaultFormData();
|
|
995
|
+
reactData.formData = formData;
|
|
996
|
+
}
|
|
997
|
+
if ($xeTable) {
|
|
998
|
+
const tableInternalData = $xeTable.internalData;
|
|
999
|
+
const { tableFullColumn, fullColumnFieldData } = tableInternalData;
|
|
1000
|
+
const { computeSortOpts } = $xeTable.getComputeMaps();
|
|
1001
|
+
const sortOpts = computeSortOpts.value;
|
|
1002
|
+
let defaultSort = sortOpts.defaultSort;
|
|
1003
|
+
tableFullColumn.forEach((column) => {
|
|
1004
|
+
column.order = null;
|
|
1005
|
+
});
|
|
1006
|
+
if (defaultSort) {
|
|
1007
|
+
if (!import_xe_utils.default.isArray(defaultSort)) {
|
|
1008
|
+
defaultSort = [defaultSort];
|
|
1209
1009
|
}
|
|
1210
|
-
|
|
1010
|
+
sortList = defaultSort.map((item) => {
|
|
1011
|
+
const { field, order } = item;
|
|
1012
|
+
const colRest = fullColumnFieldData[field];
|
|
1013
|
+
if (colRest) {
|
|
1014
|
+
const column = colRest.column;
|
|
1015
|
+
if (column) {
|
|
1016
|
+
column.order = order;
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
return {
|
|
1020
|
+
field,
|
|
1021
|
+
property: field,
|
|
1022
|
+
order
|
|
1023
|
+
};
|
|
1024
|
+
});
|
|
1211
1025
|
}
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1026
|
+
filterList = $xeTable.getCheckedFilters();
|
|
1027
|
+
}
|
|
1028
|
+
} else {
|
|
1029
|
+
if ($xeTable) {
|
|
1030
|
+
if (isReload) {
|
|
1031
|
+
operPromise = $xeTable.clearAll();
|
|
1032
|
+
} else {
|
|
1033
|
+
sortList = $xeTable.getSortColumns();
|
|
1034
|
+
filterList = $xeTable.getCheckedFilters();
|
|
1220
1035
|
}
|
|
1221
1036
|
}
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
tablePage.
|
|
1263
|
-
tableData = (_xeUtils.default.isFunction(resultProp) ? resultProp(reParams) : _xeUtils.default.get(rest, resultProp || 'result')) || [];
|
|
1264
|
-
// 检验当前页码,不能超出当前最大页数
|
|
1265
|
-
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
|
|
1266
|
-
if (tablePage.currentPage > pageCount) {
|
|
1267
|
-
tablePage.currentPage = pageCount;
|
|
1268
|
-
}
|
|
1269
|
-
} else {
|
|
1270
|
-
if (_xeUtils.default.isArray(rest)) {
|
|
1271
|
-
tableData = rest;
|
|
1272
|
-
} else if (listProp) {
|
|
1273
|
-
tableData = (_xeUtils.default.isFunction(listProp) ? listProp(reParams) : _xeUtils.default.get(rest, listProp)) || [];
|
|
1274
|
-
}
|
|
1275
|
-
}
|
|
1276
|
-
if (showFooter) {
|
|
1277
|
-
const fdProp = resConfigs.footerData;
|
|
1278
|
-
const footerList = fdProp ? _xeUtils.default.isFunction(fdProp) ? fdProp(reParams) : _xeUtils.default.get(rest, fdProp) : [];
|
|
1279
|
-
if (_xeUtils.default.isArray(footerList)) {
|
|
1280
|
-
reactData.footerData = footerList;
|
|
1281
|
-
}
|
|
1037
|
+
}
|
|
1038
|
+
const commitParams = {
|
|
1039
|
+
$table: $xeTable,
|
|
1040
|
+
$grid: $xeGrid,
|
|
1041
|
+
$gantt: null,
|
|
1042
|
+
code,
|
|
1043
|
+
button,
|
|
1044
|
+
isInited,
|
|
1045
|
+
isReload,
|
|
1046
|
+
page: pageParams,
|
|
1047
|
+
sort: sortList.length ? sortList[0] : {},
|
|
1048
|
+
sorts: sortList,
|
|
1049
|
+
filters: filterList,
|
|
1050
|
+
form: formData,
|
|
1051
|
+
options: qMethod
|
|
1052
|
+
};
|
|
1053
|
+
const handleQuery = () => {
|
|
1054
|
+
reactData.sortData = sortList;
|
|
1055
|
+
reactData.filterData = filterList;
|
|
1056
|
+
reactData.tableLoading = true;
|
|
1057
|
+
return Promise.all([
|
|
1058
|
+
Promise.resolve((oldBeforeQuery || qMethod)(commitParams, ...args)),
|
|
1059
|
+
operPromise
|
|
1060
|
+
]).then(([rest]) => {
|
|
1061
|
+
reactData.tableLoading = false;
|
|
1062
|
+
if (aqMethod) {
|
|
1063
|
+
aqMethod({ ...commitParams, response: rest, status: "success" }, ...args);
|
|
1064
|
+
} else {
|
|
1065
|
+
let tableData = [];
|
|
1066
|
+
if (rest) {
|
|
1067
|
+
const listProp = resConfigs.list;
|
|
1068
|
+
const resultProp = resConfigs.result;
|
|
1069
|
+
const reParams = { data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null };
|
|
1070
|
+
if (pagerConfig && (0, import_utils.isEnableConf)(pagerOpts)) {
|
|
1071
|
+
const totalProp = resConfigs.total;
|
|
1072
|
+
const total = (import_xe_utils.default.isFunction(totalProp) ? totalProp(reParams) : import_xe_utils.default.get(rest, totalProp || "page.total")) || 0;
|
|
1073
|
+
tablePage.total = import_xe_utils.default.toNumber(total);
|
|
1074
|
+
tableData = (import_xe_utils.default.isFunction(resultProp) ? resultProp(reParams) : import_xe_utils.default.get(rest, resultProp || "result")) || [];
|
|
1075
|
+
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
|
|
1076
|
+
if (tablePage.currentPage > pageCount) {
|
|
1077
|
+
tablePage.currentPage = pageCount;
|
|
1282
1078
|
}
|
|
1283
|
-
}
|
|
1284
|
-
if ($xeTable) {
|
|
1285
|
-
$xeTable.loadData(tableData);
|
|
1286
1079
|
} else {
|
|
1287
|
-
(
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
});
|
|
1080
|
+
if (import_xe_utils.default.isArray(rest)) {
|
|
1081
|
+
tableData = rest;
|
|
1082
|
+
} else if (listProp) {
|
|
1083
|
+
tableData = (import_xe_utils.default.isFunction(listProp) ? listProp(reParams) : import_xe_utils.default.get(rest, listProp)) || [];
|
|
1084
|
+
}
|
|
1293
1085
|
}
|
|
1294
|
-
if (
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1086
|
+
if (showFooter) {
|
|
1087
|
+
const fdProp = resConfigs.footerData;
|
|
1088
|
+
const footerList = fdProp ? import_xe_utils.default.isFunction(fdProp) ? fdProp(reParams) : import_xe_utils.default.get(rest, fdProp) : [];
|
|
1089
|
+
if (import_xe_utils.default.isArray(footerList)) {
|
|
1090
|
+
reactData.footerData = footerList;
|
|
1091
|
+
}
|
|
1298
1092
|
}
|
|
1299
1093
|
}
|
|
1300
|
-
if (
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
reactData.tableLoading = false;
|
|
1310
|
-
if (aqMethod) {
|
|
1311
|
-
aqMethod(Object.assign(Object.assign({}, commitParams), {
|
|
1312
|
-
response: rest,
|
|
1313
|
-
status: 'error'
|
|
1314
|
-
}), ...args);
|
|
1315
|
-
}
|
|
1316
|
-
if (qeMethod) {
|
|
1317
|
-
qeMethod(Object.assign(Object.assign({}, commitParams), {
|
|
1318
|
-
response: rest
|
|
1319
|
-
}));
|
|
1094
|
+
if ($xeTable) {
|
|
1095
|
+
$xeTable.loadData(tableData);
|
|
1096
|
+
} else {
|
|
1097
|
+
(0, import_vue.nextTick)(() => {
|
|
1098
|
+
const $xeTable2 = refTable.value;
|
|
1099
|
+
if ($xeTable2) {
|
|
1100
|
+
$xeTable2.loadData(tableData);
|
|
1101
|
+
}
|
|
1102
|
+
});
|
|
1320
1103
|
}
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
};
|
|
1324
|
-
});
|
|
1325
|
-
};
|
|
1326
|
-
if (bqMethod) {
|
|
1327
|
-
return Promise.resolve(bqMethod(commitParams, ...args)).then(status => {
|
|
1328
|
-
if (status !== false) {
|
|
1329
|
-
return handleQuery();
|
|
1104
|
+
if (oldAfterQuery) {
|
|
1105
|
+
oldAfterQuery({ ...commitParams, response: rest }, ...args);
|
|
1330
1106
|
}
|
|
1331
|
-
}
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1107
|
+
}
|
|
1108
|
+
if (qsMethod) {
|
|
1109
|
+
qsMethod({ ...commitParams, response: rest });
|
|
1110
|
+
}
|
|
1111
|
+
return { status: true };
|
|
1112
|
+
}).catch((rest) => {
|
|
1113
|
+
reactData.tableLoading = false;
|
|
1114
|
+
if (aqMethod) {
|
|
1115
|
+
aqMethod({ ...commitParams, response: rest, status: "error" }, ...args);
|
|
1116
|
+
}
|
|
1117
|
+
if (qeMethod) {
|
|
1118
|
+
qeMethod({ ...commitParams, response: rest });
|
|
1119
|
+
}
|
|
1120
|
+
return { status: false };
|
|
1121
|
+
});
|
|
1122
|
+
};
|
|
1123
|
+
if (bqMethod) {
|
|
1124
|
+
return Promise.resolve(bqMethod(commitParams, ...args)).then((status) => {
|
|
1125
|
+
if (status !== false) {
|
|
1126
|
+
return handleQuery();
|
|
1127
|
+
}
|
|
1128
|
+
});
|
|
1336
1129
|
}
|
|
1337
|
-
|
|
1130
|
+
return handleQuery();
|
|
1131
|
+
} else {
|
|
1132
|
+
errLog("vxe.error.notFunc", ["proxy-config.ajax.query"]);
|
|
1338
1133
|
}
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
}
|
|
1134
|
+
break;
|
|
1135
|
+
}
|
|
1136
|
+
case "queryFooter":
|
|
1137
|
+
case "query_footer": {
|
|
1138
|
+
const bqfMethod = ajax.beforeQueryFooter;
|
|
1139
|
+
const qfMethod = ajax.queryFooter;
|
|
1140
|
+
const aqfMethod = ajax.afterQueryFooter;
|
|
1141
|
+
const qfSuccessMethod = ajax.queryFooterSuccess;
|
|
1142
|
+
const qfErrorMethod = ajax.queryFooterError;
|
|
1143
|
+
if (qfMethod) {
|
|
1144
|
+
let filterList = [];
|
|
1145
|
+
if ($xeTable) {
|
|
1146
|
+
filterList = $xeTable.getCheckedFilters();
|
|
1147
|
+
}
|
|
1148
|
+
let pageParams = {};
|
|
1149
|
+
if (pagerConfig) {
|
|
1150
|
+
if ((0, import_utils.isEnableConf)(pagerOpts)) {
|
|
1151
|
+
pageParams = { ...tablePage };
|
|
1357
1152
|
}
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
if (oldAfterQueryFooter) {
|
|
1379
|
-
oldAfterQueryFooter(Object.assign(Object.assign({}, commitParams), {
|
|
1380
|
-
response: rest
|
|
1381
|
-
}), ...args);
|
|
1382
|
-
}
|
|
1383
|
-
}
|
|
1384
|
-
if (qfSuccessMethod) {
|
|
1385
|
-
qfSuccessMethod(Object.assign(Object.assign({}, commitParams), {
|
|
1386
|
-
response: rest
|
|
1387
|
-
}));
|
|
1388
|
-
}
|
|
1389
|
-
return {
|
|
1390
|
-
status: true
|
|
1391
|
-
};
|
|
1392
|
-
}).catch(rest => {
|
|
1393
|
-
if (aqfMethod) {
|
|
1394
|
-
aqfMethod(Object.assign(Object.assign({}, commitParams), {
|
|
1395
|
-
response: rest,
|
|
1396
|
-
status: 'error'
|
|
1397
|
-
}), ...args);
|
|
1398
|
-
}
|
|
1399
|
-
if (qfErrorMethod) {
|
|
1400
|
-
qfErrorMethod(Object.assign(Object.assign({}, commitParams), {
|
|
1401
|
-
response: rest
|
|
1402
|
-
}));
|
|
1403
|
-
}
|
|
1404
|
-
return {
|
|
1405
|
-
status: false
|
|
1406
|
-
};
|
|
1407
|
-
});
|
|
1408
|
-
};
|
|
1409
|
-
if (bqfMethod) {
|
|
1410
|
-
return Promise.resolve(bqfMethod(commitParams, ...args)).then(status => {
|
|
1411
|
-
if (status !== false) {
|
|
1412
|
-
return handleQueryFooter();
|
|
1153
|
+
}
|
|
1154
|
+
const commitParams = {
|
|
1155
|
+
$table: $xeTable,
|
|
1156
|
+
$grid: $xeGrid,
|
|
1157
|
+
$gantt: null,
|
|
1158
|
+
code,
|
|
1159
|
+
button,
|
|
1160
|
+
page: pageParams,
|
|
1161
|
+
filters: filterList,
|
|
1162
|
+
form: formData,
|
|
1163
|
+
options: qfMethod
|
|
1164
|
+
};
|
|
1165
|
+
const handleQueryFooter = () => {
|
|
1166
|
+
return Promise.resolve((oldBeforeQueryFooter || qfMethod)(commitParams, ...args)).then((rest) => {
|
|
1167
|
+
if (aqfMethod) {
|
|
1168
|
+
aqfMethod({ ...commitParams, response: rest, status: "success" }, ...args);
|
|
1169
|
+
} else {
|
|
1170
|
+
reactData.footerData = import_xe_utils.default.isArray(rest) ? rest : [];
|
|
1171
|
+
if (oldAfterQueryFooter) {
|
|
1172
|
+
oldAfterQueryFooter({ ...commitParams, response: rest }, ...args);
|
|
1413
1173
|
}
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1174
|
+
}
|
|
1175
|
+
if (qfSuccessMethod) {
|
|
1176
|
+
qfSuccessMethod({ ...commitParams, response: rest });
|
|
1177
|
+
}
|
|
1178
|
+
return { status: true };
|
|
1179
|
+
}).catch((rest) => {
|
|
1180
|
+
if (aqfMethod) {
|
|
1181
|
+
aqfMethod({ ...commitParams, response: rest, status: "error" }, ...args);
|
|
1182
|
+
}
|
|
1183
|
+
if (qfErrorMethod) {
|
|
1184
|
+
qfErrorMethod({ ...commitParams, response: rest });
|
|
1185
|
+
}
|
|
1186
|
+
return { status: false };
|
|
1187
|
+
});
|
|
1188
|
+
};
|
|
1189
|
+
if (bqfMethod) {
|
|
1190
|
+
return Promise.resolve(bqfMethod(commitParams, ...args)).then((status) => {
|
|
1191
|
+
if (status !== false) {
|
|
1192
|
+
return handleQueryFooter();
|
|
1193
|
+
}
|
|
1194
|
+
});
|
|
1419
1195
|
}
|
|
1420
|
-
|
|
1196
|
+
return handleQueryFooter();
|
|
1197
|
+
} else {
|
|
1198
|
+
errLog("vxe.error.notFunc", ["proxy-config.ajax.queryFooter"]);
|
|
1421
1199
|
}
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
$xeTable.setPendingRow(removeRecords, false);
|
|
1461
|
-
if (isRespMsg) {
|
|
1462
|
-
if (_ui.VxeUI.modal) {
|
|
1463
|
-
_ui.VxeUI.modal.message({
|
|
1464
|
-
content: getRespMsg(rest, 'vxe.grid.delSuccess'),
|
|
1465
|
-
status: 'success'
|
|
1466
|
-
});
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
if (oldAfterDelete) {
|
|
1470
|
-
oldAfterDelete(Object.assign(Object.assign({}, commitParams), {
|
|
1471
|
-
response: rest
|
|
1472
|
-
}), ...args);
|
|
1473
|
-
} else {
|
|
1474
|
-
internalData.uFoot = true;
|
|
1475
|
-
$xeGrid.commitProxy('query');
|
|
1476
|
-
internalData.uFoot = false;
|
|
1477
|
-
updateQueryFooter();
|
|
1200
|
+
break;
|
|
1201
|
+
}
|
|
1202
|
+
case "delete": {
|
|
1203
|
+
const bdMethod = ajax.beforeDelete;
|
|
1204
|
+
const dMethod = ajax.delete;
|
|
1205
|
+
const adMethod = ajax.afterDelete;
|
|
1206
|
+
const deleteSuccessMethods = ajax.deleteSuccess;
|
|
1207
|
+
const deleteErrorMethods = ajax.deleteError;
|
|
1208
|
+
if (dMethod) {
|
|
1209
|
+
const selectRecords = $xeGrid.getCheckboxRecords();
|
|
1210
|
+
const removeRecords = selectRecords.filter((row) => !$xeTable.isInsertByRow(row));
|
|
1211
|
+
const body = { removeRecords };
|
|
1212
|
+
const commitParams = {
|
|
1213
|
+
$table: $xeTable,
|
|
1214
|
+
$grid: $xeGrid,
|
|
1215
|
+
$gantt: null,
|
|
1216
|
+
code,
|
|
1217
|
+
button,
|
|
1218
|
+
body,
|
|
1219
|
+
form: formData,
|
|
1220
|
+
options: dMethod
|
|
1221
|
+
};
|
|
1222
|
+
if (selectRecords.length) {
|
|
1223
|
+
return handleDeleteRow(code, "vxe.grid.deleteSelectRecord", () => {
|
|
1224
|
+
if (!removeRecords.length) {
|
|
1225
|
+
return $xeTable.remove(selectRecords);
|
|
1226
|
+
}
|
|
1227
|
+
const handleDelete = () => {
|
|
1228
|
+
reactData.tableLoading = true;
|
|
1229
|
+
return Promise.resolve((oldBeforeDelete || dMethod)(commitParams, ...args)).then((rest) => {
|
|
1230
|
+
reactData.tableLoading = false;
|
|
1231
|
+
if (adMethod) {
|
|
1232
|
+
adMethod({ ...commitParams, response: rest, status: "success" }, ...args);
|
|
1233
|
+
} else {
|
|
1234
|
+
$xeTable.setPendingRow(removeRecords, false);
|
|
1235
|
+
if (isRespMsg) {
|
|
1236
|
+
if (import_ui.VxeUI.modal) {
|
|
1237
|
+
import_ui.VxeUI.modal.message({ content: getRespMsg(rest, "vxe.grid.delSuccess"), status: "success" });
|
|
1478
1238
|
}
|
|
1479
1239
|
}
|
|
1480
|
-
if (
|
|
1481
|
-
|
|
1482
|
-
response: rest
|
|
1483
|
-
}));
|
|
1484
|
-
}
|
|
1485
|
-
return {
|
|
1486
|
-
status: true
|
|
1487
|
-
};
|
|
1488
|
-
}).catch(rest => {
|
|
1489
|
-
reactData.tableLoading = false;
|
|
1490
|
-
if (adMethod) {
|
|
1491
|
-
adMethod(Object.assign(Object.assign({}, commitParams), {
|
|
1492
|
-
response: rest,
|
|
1493
|
-
status: 'error'
|
|
1494
|
-
}), ...args);
|
|
1240
|
+
if (oldAfterDelete) {
|
|
1241
|
+
oldAfterDelete({ ...commitParams, response: rest }, ...args);
|
|
1495
1242
|
} else {
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
content: getRespMsg(rest, 'vxe.grid.operError'),
|
|
1501
|
-
status: 'error'
|
|
1502
|
-
});
|
|
1503
|
-
}
|
|
1504
|
-
}
|
|
1505
|
-
}
|
|
1506
|
-
if (deleteErrorMethods) {
|
|
1507
|
-
deleteErrorMethods(Object.assign(Object.assign({}, commitParams), {
|
|
1508
|
-
response: rest
|
|
1509
|
-
}));
|
|
1243
|
+
internalData.uFoot = true;
|
|
1244
|
+
$xeGrid.commitProxy("query");
|
|
1245
|
+
internalData.uFoot = false;
|
|
1246
|
+
updateQueryFooter();
|
|
1510
1247
|
}
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
};
|
|
1514
|
-
}
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1248
|
+
}
|
|
1249
|
+
if (deleteSuccessMethods) {
|
|
1250
|
+
deleteSuccessMethods({ ...commitParams, response: rest });
|
|
1251
|
+
}
|
|
1252
|
+
return { status: true };
|
|
1253
|
+
}).catch((rest) => {
|
|
1254
|
+
reactData.tableLoading = false;
|
|
1255
|
+
if (adMethod) {
|
|
1256
|
+
adMethod({ ...commitParams, response: rest, status: "error" }, ...args);
|
|
1257
|
+
} else {
|
|
1258
|
+
if (isRespMsg) {
|
|
1259
|
+
if (import_ui.VxeUI.modal) {
|
|
1260
|
+
import_ui.VxeUI.modal.message({ id: code, content: getRespMsg(rest, "vxe.grid.operError"), status: "error" });
|
|
1261
|
+
}
|
|
1520
1262
|
}
|
|
1521
|
-
}
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
}
|
|
1533
|
-
}
|
|
1263
|
+
}
|
|
1264
|
+
if (deleteErrorMethods) {
|
|
1265
|
+
deleteErrorMethods({ ...commitParams, response: rest });
|
|
1266
|
+
}
|
|
1267
|
+
return { status: false };
|
|
1268
|
+
});
|
|
1269
|
+
};
|
|
1270
|
+
if (bdMethod) {
|
|
1271
|
+
return Promise.resolve(bdMethod(commitParams, ...args)).then((status) => {
|
|
1272
|
+
if (status !== false) {
|
|
1273
|
+
return handleDelete();
|
|
1274
|
+
}
|
|
1275
|
+
});
|
|
1534
1276
|
}
|
|
1535
|
-
|
|
1277
|
+
return handleDelete();
|
|
1278
|
+
});
|
|
1536
1279
|
} else {
|
|
1537
|
-
|
|
1280
|
+
if (isActiveMsg) {
|
|
1281
|
+
if (import_ui.VxeUI.modal) {
|
|
1282
|
+
import_ui.VxeUI.modal.message({ id: code, content: getI18n("vxe.grid.selectOneRecord"), status: "warning" });
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1538
1285
|
}
|
|
1539
|
-
|
|
1286
|
+
} else {
|
|
1287
|
+
errLog("vxe.error.notFunc", ["proxy-config.ajax.delete"]);
|
|
1540
1288
|
}
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
if (editRules) {
|
|
1576
|
-
// 只校验新增和修改的数据
|
|
1577
|
-
restPromise = $xeTable[validConfig && validConfig.msgMode === 'full' ? 'fullValidate' : 'validate'](body.insertRecords.concat(updateRecords));
|
|
1289
|
+
break;
|
|
1290
|
+
}
|
|
1291
|
+
case "save": {
|
|
1292
|
+
const bSaveMethod = ajax.beforeSave;
|
|
1293
|
+
const sMethod = ajax.save;
|
|
1294
|
+
const aSaveMethod = ajax.afterSave;
|
|
1295
|
+
const sSuccessMethod = ajax.saveSuccess;
|
|
1296
|
+
const sErrorMethod = ajax.saveError;
|
|
1297
|
+
if (sMethod) {
|
|
1298
|
+
const body = $xeTable.getRecordset();
|
|
1299
|
+
const { insertRecords, removeRecords, updateRecords, pendingRecords } = body;
|
|
1300
|
+
const commitParams = {
|
|
1301
|
+
$table: $xeTable,
|
|
1302
|
+
$grid: $xeGrid,
|
|
1303
|
+
$gantt: null,
|
|
1304
|
+
code,
|
|
1305
|
+
button,
|
|
1306
|
+
body,
|
|
1307
|
+
form: formData,
|
|
1308
|
+
options: sMethod
|
|
1309
|
+
};
|
|
1310
|
+
if (insertRecords.length) {
|
|
1311
|
+
body.pendingRecords = pendingRecords.filter((row) => $xeTable.findRowIndexOf(insertRecords, row) === -1);
|
|
1312
|
+
}
|
|
1313
|
+
if (pendingRecords.length) {
|
|
1314
|
+
body.insertRecords = insertRecords.filter((row) => $xeTable.findRowIndexOf(pendingRecords, row) === -1);
|
|
1315
|
+
}
|
|
1316
|
+
let restPromise = Promise.resolve();
|
|
1317
|
+
if (editRules) {
|
|
1318
|
+
restPromise = $xeTable[validConfig && validConfig.msgMode === "full" ? "fullValidate" : "validate"](body.insertRecords.concat(updateRecords));
|
|
1319
|
+
}
|
|
1320
|
+
return restPromise.then((errMap) => {
|
|
1321
|
+
if (errMap) {
|
|
1322
|
+
return;
|
|
1578
1323
|
}
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
return
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
response: rest,
|
|
1592
|
-
status: 'success'
|
|
1593
|
-
}), ...args);
|
|
1594
|
-
} else {
|
|
1595
|
-
$xeTable.clearPendingRow();
|
|
1596
|
-
if (isRespMsg) {
|
|
1597
|
-
if (_ui.VxeUI.modal) {
|
|
1598
|
-
_ui.VxeUI.modal.message({
|
|
1599
|
-
content: getRespMsg(rest, 'vxe.grid.saveSuccess'),
|
|
1600
|
-
status: 'success'
|
|
1601
|
-
});
|
|
1602
|
-
}
|
|
1603
|
-
}
|
|
1604
|
-
if (oldAfterSave) {
|
|
1605
|
-
oldAfterSave(Object.assign(Object.assign({}, commitParams), {
|
|
1606
|
-
response: rest
|
|
1607
|
-
}), ...args);
|
|
1608
|
-
} else {
|
|
1609
|
-
internalData.uFoot = true;
|
|
1610
|
-
$xeGrid.commitProxy('query');
|
|
1611
|
-
internalData.uFoot = false;
|
|
1612
|
-
updateQueryFooter();
|
|
1324
|
+
if (body.insertRecords.length || removeRecords.length || updateRecords.length || body.pendingRecords.length) {
|
|
1325
|
+
const handleSave = () => {
|
|
1326
|
+
reactData.tableLoading = true;
|
|
1327
|
+
return Promise.resolve((oldBeforeSave || sMethod)(commitParams, ...args)).then((rest) => {
|
|
1328
|
+
reactData.tableLoading = false;
|
|
1329
|
+
if (aSaveMethod) {
|
|
1330
|
+
aSaveMethod({ ...commitParams, response: rest, status: "success" }, ...args);
|
|
1331
|
+
} else {
|
|
1332
|
+
$xeTable.clearPendingRow();
|
|
1333
|
+
if (isRespMsg) {
|
|
1334
|
+
if (import_ui.VxeUI.modal) {
|
|
1335
|
+
import_ui.VxeUI.modal.message({ content: getRespMsg(rest, "vxe.grid.saveSuccess"), status: "success" });
|
|
1613
1336
|
}
|
|
1614
1337
|
}
|
|
1615
|
-
if (
|
|
1616
|
-
|
|
1617
|
-
response: rest
|
|
1618
|
-
}));
|
|
1619
|
-
}
|
|
1620
|
-
return {
|
|
1621
|
-
status: true
|
|
1622
|
-
};
|
|
1623
|
-
}).catch(rest => {
|
|
1624
|
-
reactData.tableLoading = false;
|
|
1625
|
-
if (aSaveMethod) {
|
|
1626
|
-
aSaveMethod(Object.assign(Object.assign({}, commitParams), {
|
|
1627
|
-
response: rest,
|
|
1628
|
-
status: 'error'
|
|
1629
|
-
}), ...args);
|
|
1338
|
+
if (oldAfterSave) {
|
|
1339
|
+
oldAfterSave({ ...commitParams, response: rest }, ...args);
|
|
1630
1340
|
} else {
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
content: getRespMsg(rest, 'vxe.grid.operError'),
|
|
1636
|
-
status: 'error'
|
|
1637
|
-
});
|
|
1638
|
-
}
|
|
1639
|
-
}
|
|
1341
|
+
internalData.uFoot = true;
|
|
1342
|
+
$xeGrid.commitProxy("query");
|
|
1343
|
+
internalData.uFoot = false;
|
|
1344
|
+
updateQueryFooter();
|
|
1640
1345
|
}
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1346
|
+
}
|
|
1347
|
+
if (sSuccessMethod) {
|
|
1348
|
+
sSuccessMethod({ ...commitParams, response: rest });
|
|
1349
|
+
}
|
|
1350
|
+
return { status: true };
|
|
1351
|
+
}).catch((rest) => {
|
|
1352
|
+
reactData.tableLoading = false;
|
|
1353
|
+
if (aSaveMethod) {
|
|
1354
|
+
aSaveMethod({ ...commitParams, response: rest, status: "error" }, ...args);
|
|
1355
|
+
} else {
|
|
1356
|
+
if (isRespMsg) {
|
|
1357
|
+
if (import_ui.VxeUI.modal) {
|
|
1358
|
+
import_ui.VxeUI.modal.message({ id: code, content: getRespMsg(rest, "vxe.grid.operError"), status: "error" });
|
|
1359
|
+
}
|
|
1655
1360
|
}
|
|
1656
|
-
});
|
|
1657
|
-
}
|
|
1658
|
-
return handleSave();
|
|
1659
|
-
} else {
|
|
1660
|
-
if (isActiveMsg) {
|
|
1661
|
-
if (_ui.VxeUI.modal) {
|
|
1662
|
-
_ui.VxeUI.modal.message({
|
|
1663
|
-
id: code,
|
|
1664
|
-
content: getI18n('vxe.grid.dataUnchanged'),
|
|
1665
|
-
status: 'info'
|
|
1666
|
-
});
|
|
1667
1361
|
}
|
|
1668
|
-
|
|
1362
|
+
if (sErrorMethod) {
|
|
1363
|
+
sErrorMethod({ ...commitParams, response: rest });
|
|
1364
|
+
}
|
|
1365
|
+
return { status: false };
|
|
1366
|
+
});
|
|
1367
|
+
};
|
|
1368
|
+
if (bSaveMethod) {
|
|
1369
|
+
return Promise.resolve(bSaveMethod(commitParams, ...args)).then((status) => {
|
|
1370
|
+
if (status !== false) {
|
|
1371
|
+
return handleSave();
|
|
1372
|
+
}
|
|
1373
|
+
});
|
|
1669
1374
|
}
|
|
1670
|
-
|
|
1671
|
-
} else {
|
|
1672
|
-
errLog('vxe.error.notFunc', ['proxy-config.ajax.save']);
|
|
1673
|
-
}
|
|
1674
|
-
break;
|
|
1675
|
-
}
|
|
1676
|
-
default:
|
|
1677
|
-
{
|
|
1678
|
-
const gCommandOpts = commands.get(code);
|
|
1679
|
-
if (gCommandOpts) {
|
|
1680
|
-
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
1681
|
-
if (tCommandMethod) {
|
|
1682
|
-
tCommandMethod({
|
|
1683
|
-
code,
|
|
1684
|
-
button,
|
|
1685
|
-
$grid: $xeGrid,
|
|
1686
|
-
$table: $xeTable,
|
|
1687
|
-
$gantt: null
|
|
1688
|
-
}, ...args);
|
|
1375
|
+
return handleSave();
|
|
1689
1376
|
} else {
|
|
1690
|
-
|
|
1377
|
+
if (isActiveMsg) {
|
|
1378
|
+
if (import_ui.VxeUI.modal) {
|
|
1379
|
+
import_ui.VxeUI.modal.message({ id: code, content: getI18n("vxe.grid.dataUnchanged"), status: "info" });
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1691
1382
|
}
|
|
1383
|
+
});
|
|
1384
|
+
} else {
|
|
1385
|
+
errLog("vxe.error.notFunc", ["proxy-config.ajax.save"]);
|
|
1386
|
+
}
|
|
1387
|
+
break;
|
|
1388
|
+
}
|
|
1389
|
+
default: {
|
|
1390
|
+
const gCommandOpts = commands.get(code);
|
|
1391
|
+
if (gCommandOpts) {
|
|
1392
|
+
const tCommandMethod = gCommandOpts.tableCommandMethod || gCommandOpts.commandMethod;
|
|
1393
|
+
if (tCommandMethod) {
|
|
1394
|
+
tCommandMethod({ code, button, $grid: $xeGrid, $table: $xeTable, $gantt: null }, ...args);
|
|
1395
|
+
} else {
|
|
1396
|
+
errLog("vxe.error.notCommands", [code]);
|
|
1692
1397
|
}
|
|
1693
1398
|
}
|
|
1399
|
+
}
|
|
1694
1400
|
}
|
|
1695
|
-
return (0,
|
|
1401
|
+
return (0, import_vue.nextTick)();
|
|
1696
1402
|
},
|
|
1697
1403
|
getParams() {
|
|
1698
1404
|
return props.params;
|
|
@@ -1719,20 +1425,13 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1719
1425
|
*/
|
|
1720
1426
|
getFormItems(itemIndex) {
|
|
1721
1427
|
const formOpts = computeFormOpts.value;
|
|
1722
|
-
const {
|
|
1723
|
-
|
|
1724
|
-
} = props;
|
|
1725
|
-
const {
|
|
1726
|
-
items
|
|
1727
|
-
} = formOpts;
|
|
1428
|
+
const { formConfig } = props;
|
|
1429
|
+
const { items } = formOpts;
|
|
1728
1430
|
const itemList = [];
|
|
1729
|
-
|
|
1431
|
+
import_xe_utils.default.eachTree(formConfig && (0, import_utils.isEnableConf)(formOpts) && items ? items : [], (item) => {
|
|
1730
1432
|
itemList.push(item);
|
|
1731
|
-
}, {
|
|
1732
|
-
|
|
1733
|
-
});
|
|
1734
|
-
// errLog('vxe.error.delFunc', ['getFormItems', 'getFormFlatItems'])
|
|
1735
|
-
return _xeUtils.default.isUndefined(itemIndex) ? itemList : itemList[itemIndex];
|
|
1433
|
+
}, { children: "children" });
|
|
1434
|
+
return import_xe_utils.default.isUndefined(itemIndex) ? itemList : itemList[itemIndex];
|
|
1736
1435
|
},
|
|
1737
1436
|
getFormFlatItems() {
|
|
1738
1437
|
const $form = refForm.value;
|
|
@@ -1760,7 +1459,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1760
1459
|
if ($form) {
|
|
1761
1460
|
return $form.reset();
|
|
1762
1461
|
}
|
|
1763
|
-
return (0,
|
|
1462
|
+
return (0, import_vue.nextTick)();
|
|
1764
1463
|
},
|
|
1765
1464
|
validateForm() {
|
|
1766
1465
|
const $form = refForm.value;
|
|
@@ -1781,14 +1480,12 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1781
1480
|
if ($form) {
|
|
1782
1481
|
return $form.clearValidate(field);
|
|
1783
1482
|
}
|
|
1784
|
-
return (0,
|
|
1483
|
+
return (0, import_vue.nextTick)();
|
|
1785
1484
|
},
|
|
1786
1485
|
homePage() {
|
|
1787
|
-
const {
|
|
1788
|
-
tablePage
|
|
1789
|
-
} = reactData;
|
|
1486
|
+
const { tablePage } = reactData;
|
|
1790
1487
|
tablePage.currentPage = 1;
|
|
1791
|
-
return (0,
|
|
1488
|
+
return (0, import_vue.nextTick)();
|
|
1792
1489
|
},
|
|
1793
1490
|
homePageByEvent(evnt) {
|
|
1794
1491
|
const $pager = refPager.value;
|
|
@@ -1797,12 +1494,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1797
1494
|
}
|
|
1798
1495
|
},
|
|
1799
1496
|
endPage() {
|
|
1800
|
-
const {
|
|
1801
|
-
tablePage
|
|
1802
|
-
} = reactData;
|
|
1497
|
+
const { tablePage } = reactData;
|
|
1803
1498
|
const pageCount = computePageCount.value;
|
|
1804
1499
|
tablePage.currentPage = pageCount;
|
|
1805
|
-
return (0,
|
|
1500
|
+
return (0, import_vue.nextTick)();
|
|
1806
1501
|
},
|
|
1807
1502
|
endPageByEvent(evnt) {
|
|
1808
1503
|
const $pager = refPager.value;
|
|
@@ -1811,18 +1506,14 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1811
1506
|
}
|
|
1812
1507
|
},
|
|
1813
1508
|
getCurrentPage() {
|
|
1814
|
-
const {
|
|
1815
|
-
tablePage
|
|
1816
|
-
} = reactData;
|
|
1509
|
+
const { tablePage } = reactData;
|
|
1817
1510
|
return tablePage.currentPage;
|
|
1818
1511
|
},
|
|
1819
1512
|
setCurrentPage(currentPage) {
|
|
1820
|
-
const {
|
|
1821
|
-
tablePage
|
|
1822
|
-
} = reactData;
|
|
1513
|
+
const { tablePage } = reactData;
|
|
1823
1514
|
const pageCount = computePageCount.value;
|
|
1824
|
-
tablePage.currentPage = Math.min(pageCount, Math.max(1,
|
|
1825
|
-
return (0,
|
|
1515
|
+
tablePage.currentPage = Math.min(pageCount, Math.max(1, import_xe_utils.default.toNumber(currentPage)));
|
|
1516
|
+
return (0, import_vue.nextTick)();
|
|
1826
1517
|
},
|
|
1827
1518
|
setCurrentPageByEvent(evnt, currentPage) {
|
|
1828
1519
|
const $pager = refPager.value;
|
|
@@ -1831,17 +1522,13 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1831
1522
|
}
|
|
1832
1523
|
},
|
|
1833
1524
|
getPageSize() {
|
|
1834
|
-
const {
|
|
1835
|
-
tablePage
|
|
1836
|
-
} = reactData;
|
|
1525
|
+
const { tablePage } = reactData;
|
|
1837
1526
|
return tablePage.pageSize;
|
|
1838
1527
|
},
|
|
1839
1528
|
setPageSize(pageSize) {
|
|
1840
|
-
const {
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
tablePage.pageSize = Math.max(1, _xeUtils.default.toNumber(pageSize));
|
|
1844
|
-
return (0, _vue.nextTick)();
|
|
1529
|
+
const { tablePage } = reactData;
|
|
1530
|
+
tablePage.pageSize = Math.max(1, import_xe_utils.default.toNumber(pageSize));
|
|
1531
|
+
return (0, import_vue.nextTick)();
|
|
1845
1532
|
},
|
|
1846
1533
|
setPageSizeByEvent(evnt, pageSize) {
|
|
1847
1534
|
const $pager = refPager.value;
|
|
@@ -1852,9 +1539,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1852
1539
|
getProxyInfo() {
|
|
1853
1540
|
const $xeTable = refTable.value;
|
|
1854
1541
|
if (props.proxyConfig) {
|
|
1855
|
-
const {
|
|
1856
|
-
sortData
|
|
1857
|
-
} = reactData;
|
|
1542
|
+
const { sortData } = reactData;
|
|
1858
1543
|
return {
|
|
1859
1544
|
data: $xeTable ? $xeTable.getFullData() : [],
|
|
1860
1545
|
filter: reactData.filterData,
|
|
@@ -1868,14 +1553,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1868
1553
|
return null;
|
|
1869
1554
|
},
|
|
1870
1555
|
getCustomPagerData() {
|
|
1871
|
-
const {
|
|
1872
|
-
|
|
1873
|
-
} = props;
|
|
1874
|
-
const {
|
|
1875
|
-
tablePage
|
|
1876
|
-
} = reactData;
|
|
1556
|
+
const { pagerConfig } = props;
|
|
1557
|
+
const { tablePage } = reactData;
|
|
1877
1558
|
const pagerOpts = computePagerOpts.value;
|
|
1878
|
-
if (pagerConfig && (0,
|
|
1559
|
+
if (pagerConfig && (0, import_utils.isEnableConf)(pagerOpts)) {
|
|
1879
1560
|
return {
|
|
1880
1561
|
pSize: tablePage.pageSize
|
|
1881
1562
|
};
|
|
@@ -1905,11 +1586,11 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1905
1586
|
extendTableMethods,
|
|
1906
1587
|
callSlot(slotFunc, params) {
|
|
1907
1588
|
if (slotFunc) {
|
|
1908
|
-
if (
|
|
1589
|
+
if (import_xe_utils.default.isString(slotFunc)) {
|
|
1909
1590
|
slotFunc = slots[slotFunc] || null;
|
|
1910
1591
|
}
|
|
1911
|
-
if (
|
|
1912
|
-
return (0,
|
|
1592
|
+
if (import_xe_utils.default.isFunction(slotFunc)) {
|
|
1593
|
+
return (0, import_vn.getSlotVNs)(slotFunc(params));
|
|
1913
1594
|
}
|
|
1914
1595
|
}
|
|
1915
1596
|
return [];
|
|
@@ -1918,12 +1599,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1918
1599
|
* 获取需要排除的高度
|
|
1919
1600
|
*/
|
|
1920
1601
|
getExcludeHeight() {
|
|
1921
|
-
const {
|
|
1922
|
-
|
|
1923
|
-
} = props;
|
|
1924
|
-
const {
|
|
1925
|
-
isZMax
|
|
1926
|
-
} = reactData;
|
|
1602
|
+
const { height } = props;
|
|
1603
|
+
const { isZMax } = reactData;
|
|
1927
1604
|
const el = refElem.value;
|
|
1928
1605
|
if (el) {
|
|
1929
1606
|
const formWrapper = refFormWrapper.value;
|
|
@@ -1933,10 +1610,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1933
1610
|
const pagerWrapper = refPagerWrapper.value;
|
|
1934
1611
|
const parentEl = el.parentElement;
|
|
1935
1612
|
let parentPaddingSize = 0;
|
|
1936
|
-
if (parentEl && (height ===
|
|
1937
|
-
parentPaddingSize = isZMax ? 0 : (0,
|
|
1613
|
+
if (parentEl && (height === "100%" || height === "auto")) {
|
|
1614
|
+
parentPaddingSize = isZMax ? 0 : (0, import_dom.getPaddingTopBottomSize)(parentEl);
|
|
1938
1615
|
}
|
|
1939
|
-
return parentPaddingSize + (0,
|
|
1616
|
+
return parentPaddingSize + (0, import_dom.getPaddingTopBottomSize)(el) + (0, import_dom.getOffsetHeight)(formWrapper) + (0, import_dom.getOffsetHeight)(toolbarWrapper) + (0, import_dom.getOffsetHeight)(topWrapper) + (0, import_dom.getOffsetHeight)(bottomWrapper) + (0, import_dom.getOffsetHeight)(pagerWrapper);
|
|
1940
1617
|
}
|
|
1941
1618
|
return 0;
|
|
1942
1619
|
},
|
|
@@ -1946,8 +1623,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1946
1623
|
return null;
|
|
1947
1624
|
}
|
|
1948
1625
|
let parentEl = el.parentElement;
|
|
1949
|
-
|
|
1950
|
-
if (parentEl && (0, _dom.hasClass)(parentEl, 'vxe-scrollbar--view-inner')) {
|
|
1626
|
+
if (parentEl && (0, import_dom.hasClass)(parentEl, "vxe-scrollbar--view-inner")) {
|
|
1951
1627
|
parentEl = parentEl.parentElement;
|
|
1952
1628
|
}
|
|
1953
1629
|
return parentEl;
|
|
@@ -1956,24 +1632,20 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1956
1632
|
const el = refElem.value;
|
|
1957
1633
|
if (el) {
|
|
1958
1634
|
const parentEl = $xeGrid.getParentElem();
|
|
1959
|
-
return (reactData.isZMax ? (0,
|
|
1635
|
+
return (reactData.isZMax ? (0, import_dom.getDomNode)().visibleHeight : parentEl ? import_xe_utils.default.toNumber(getComputedStyle(parentEl).height) : 0) - gridPrivateMethods.getExcludeHeight();
|
|
1960
1636
|
}
|
|
1961
1637
|
return 0;
|
|
1962
1638
|
},
|
|
1963
1639
|
triggerToolbarCommitEvent(params, evnt) {
|
|
1964
|
-
const {
|
|
1965
|
-
code
|
|
1966
|
-
} = params;
|
|
1640
|
+
const { code } = params;
|
|
1967
1641
|
if (code) {
|
|
1968
|
-
const isUf = [
|
|
1642
|
+
const isUf = ["reload", "delete", "save"].includes(code);
|
|
1969
1643
|
if (isUf) {
|
|
1970
1644
|
internalData.uFoot = true;
|
|
1971
1645
|
}
|
|
1972
|
-
const rest = $xeGrid.commitProxy(params, evnt).then(
|
|
1973
|
-
if (
|
|
1974
|
-
$xeGrid.dispatchEvent(code ===
|
|
1975
|
-
isReload: code === 'reload'
|
|
1976
|
-
}), evnt);
|
|
1646
|
+
const rest = $xeGrid.commitProxy(params, evnt).then((rest2) => {
|
|
1647
|
+
if (rest2 && rest2.status && ["query", "reload", "delete", "save"].includes(code)) {
|
|
1648
|
+
$xeGrid.dispatchEvent(code === "delete" || code === "save" ? `proxy-${code}` : "proxy-query", { ...rest2, isReload: code === "reload" }, evnt);
|
|
1977
1649
|
}
|
|
1978
1650
|
});
|
|
1979
1651
|
internalData.uFoot = false;
|
|
@@ -1982,39 +1654,31 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1982
1654
|
}
|
|
1983
1655
|
return rest;
|
|
1984
1656
|
}
|
|
1985
|
-
return (0,
|
|
1657
|
+
return (0, import_vue.nextTick)();
|
|
1986
1658
|
},
|
|
1987
1659
|
triggerToolbarBtnEvent(button, evnt) {
|
|
1988
1660
|
$xeGrid.triggerToolbarCommitEvent(button, evnt);
|
|
1989
|
-
$xeGrid.dispatchEvent(
|
|
1990
|
-
code: button.code,
|
|
1991
|
-
button
|
|
1992
|
-
}, evnt);
|
|
1661
|
+
$xeGrid.dispatchEvent("toolbar-button-click", { code: button.code, button }, evnt);
|
|
1993
1662
|
},
|
|
1994
1663
|
triggerToolbarTolEvent(tool, evnt) {
|
|
1995
1664
|
$xeGrid.triggerToolbarCommitEvent(tool, evnt);
|
|
1996
|
-
$xeGrid.dispatchEvent(
|
|
1997
|
-
code: tool.code,
|
|
1998
|
-
tool
|
|
1999
|
-
}, evnt);
|
|
1665
|
+
$xeGrid.dispatchEvent("toolbar-tool-click", { code: tool.code, tool }, evnt);
|
|
2000
1666
|
},
|
|
2001
1667
|
triggerZoomEvent(evnt) {
|
|
2002
1668
|
$xeGrid.zoom();
|
|
2003
|
-
$xeGrid.dispatchEvent(
|
|
2004
|
-
type: reactData.isZMax ? 'max' : 'revert'
|
|
2005
|
-
}, evnt);
|
|
1669
|
+
$xeGrid.dispatchEvent("zoom", { type: reactData.isZMax ? "max" : "revert" }, evnt);
|
|
2006
1670
|
}
|
|
2007
1671
|
};
|
|
2008
1672
|
Object.assign($xeGrid, gridExtendTableMethods, gridMethods, gridPrivateMethods, {
|
|
2009
1673
|
// 检查插槽
|
|
2010
1674
|
loadColumn(columns) {
|
|
2011
1675
|
const $xeTable = refTable.value;
|
|
2012
|
-
|
|
1676
|
+
import_xe_utils.default.eachTree(columns, (column) => {
|
|
2013
1677
|
if (column.slots) {
|
|
2014
|
-
|
|
2015
|
-
if (func && !
|
|
1678
|
+
import_xe_utils.default.each(column.slots, (func) => {
|
|
1679
|
+
if (func && !import_xe_utils.default.isFunction(func)) {
|
|
2016
1680
|
if (!slots[func]) {
|
|
2017
|
-
errLog(
|
|
1681
|
+
errLog("vxe.error.notSlot", [func]);
|
|
2018
1682
|
}
|
|
2019
1683
|
}
|
|
2020
1684
|
});
|
|
@@ -2023,7 +1687,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
2023
1687
|
if ($xeTable) {
|
|
2024
1688
|
return $xeTable.loadColumn(columns);
|
|
2025
1689
|
}
|
|
2026
|
-
return (0,
|
|
1690
|
+
return (0, import_vue.nextTick)();
|
|
2027
1691
|
},
|
|
2028
1692
|
reloadColumn(columns) {
|
|
2029
1693
|
$xeGrid.clearAll();
|
|
@@ -2034,78 +1698,69 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
2034
1698
|
const vSize = computeSize.value;
|
|
2035
1699
|
const styles = computeStyles.value;
|
|
2036
1700
|
const isLoading = computeIsLoading.value;
|
|
2037
|
-
return (0,
|
|
1701
|
+
return (0, import_vue.h)("div", {
|
|
2038
1702
|
ref: refElem,
|
|
2039
|
-
class: [
|
|
1703
|
+
class: ["vxe-grid", {
|
|
2040
1704
|
[`size--${vSize}`]: vSize,
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
1705
|
+
"is--animat": !!props.animat,
|
|
1706
|
+
"is--round": props.round,
|
|
1707
|
+
"is--maximize": reactData.isZMax,
|
|
1708
|
+
"is--loading": isLoading
|
|
2045
1709
|
}],
|
|
2046
1710
|
style: styles
|
|
2047
1711
|
}, renderLayout());
|
|
2048
1712
|
};
|
|
2049
|
-
const columnFlag = (0,
|
|
2050
|
-
(0,
|
|
1713
|
+
const columnFlag = (0, import_vue.ref)(0);
|
|
1714
|
+
(0, import_vue.watch)(() => props.columns ? props.columns.length : -1, () => {
|
|
2051
1715
|
columnFlag.value++;
|
|
2052
1716
|
});
|
|
2053
|
-
(0,
|
|
1717
|
+
(0, import_vue.watch)(() => props.columns, () => {
|
|
2054
1718
|
columnFlag.value++;
|
|
2055
1719
|
});
|
|
2056
|
-
(0,
|
|
2057
|
-
(0,
|
|
1720
|
+
(0, import_vue.watch)(columnFlag, () => {
|
|
1721
|
+
(0, import_vue.nextTick)(() => $xeGrid.loadColumn(props.columns || []));
|
|
2058
1722
|
});
|
|
2059
|
-
(0,
|
|
1723
|
+
(0, import_vue.watch)(() => props.toolbarConfig, () => {
|
|
2060
1724
|
initToolbar();
|
|
2061
1725
|
});
|
|
2062
|
-
(0,
|
|
2063
|
-
initPages(
|
|
1726
|
+
(0, import_vue.watch)(computeCustomCurrentPageFlag, () => {
|
|
1727
|
+
initPages("currentPage");
|
|
2064
1728
|
});
|
|
2065
|
-
(0,
|
|
2066
|
-
initPages(
|
|
1729
|
+
(0, import_vue.watch)(computeCustomPageSizeFlag, () => {
|
|
1730
|
+
initPages("pageSize");
|
|
2067
1731
|
});
|
|
2068
|
-
(0,
|
|
2069
|
-
initPages(
|
|
1732
|
+
(0, import_vue.watch)(computeCustomTotalFlag, () => {
|
|
1733
|
+
initPages("total");
|
|
2070
1734
|
});
|
|
2071
|
-
(0,
|
|
1735
|
+
(0, import_vue.watch)(() => props.proxyConfig, () => {
|
|
2072
1736
|
initProxy();
|
|
2073
1737
|
});
|
|
2074
|
-
hooks.forEach(options => {
|
|
2075
|
-
const {
|
|
2076
|
-
setupGrid
|
|
2077
|
-
} = options;
|
|
1738
|
+
hooks.forEach((options) => {
|
|
1739
|
+
const { setupGrid } = options;
|
|
2078
1740
|
if (setupGrid) {
|
|
2079
1741
|
const hookRest = setupGrid($xeGrid);
|
|
2080
|
-
if (hookRest &&
|
|
1742
|
+
if (hookRest && import_xe_utils.default.isObject(hookRest)) {
|
|
2081
1743
|
Object.assign($xeGrid, hookRest);
|
|
2082
1744
|
}
|
|
2083
1745
|
}
|
|
2084
1746
|
});
|
|
2085
1747
|
initPages();
|
|
2086
|
-
(0,
|
|
2087
|
-
(0,
|
|
2088
|
-
const {
|
|
2089
|
-
columns
|
|
2090
|
-
} = props;
|
|
1748
|
+
(0, import_vue.onMounted)(() => {
|
|
1749
|
+
(0, import_vue.nextTick)(() => {
|
|
1750
|
+
const { columns } = props;
|
|
2091
1751
|
const proxyOpts = computeProxyOpts.value;
|
|
2092
1752
|
if (props.formConfig) {
|
|
2093
1753
|
if (!VxeUIFormComponent) {
|
|
2094
|
-
errLog(
|
|
1754
|
+
errLog("vxe.error.reqComp", ["vxe-form"]);
|
|
2095
1755
|
}
|
|
2096
1756
|
}
|
|
2097
1757
|
if (props.pagerConfig) {
|
|
2098
1758
|
if (!VxeUIPagerComponent) {
|
|
2099
|
-
errLog(
|
|
1759
|
+
errLog("vxe.error.reqComp", ["vxe-pager"]);
|
|
2100
1760
|
}
|
|
2101
1761
|
}
|
|
2102
|
-
// const { data, columns, proxyConfig } = props
|
|
2103
|
-
// const formOpts = computeFormOpts.value
|
|
2104
|
-
// if (isEnableConf(proxyConfig) && (data || (proxyOpts.form && formOpts.data))) {
|
|
2105
|
-
// errLog('vxe.error.errConflicts', ['[grid] data', 'proxy-config'])
|
|
2106
|
-
// }
|
|
2107
1762
|
if (proxyOpts.props) {
|
|
2108
|
-
warnLog(
|
|
1763
|
+
warnLog("vxe.error.delProp", ["proxy-config.props", "proxy-config.response"]);
|
|
2109
1764
|
}
|
|
2110
1765
|
if (columns && columns.length) {
|
|
2111
1766
|
$xeGrid.loadColumn(columns);
|
|
@@ -2113,19 +1768,19 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
2113
1768
|
initToolbar();
|
|
2114
1769
|
initProxy();
|
|
2115
1770
|
});
|
|
2116
|
-
globalEvents.on($xeGrid,
|
|
1771
|
+
globalEvents.on($xeGrid, "keydown", handleGlobalKeydownEvent);
|
|
2117
1772
|
});
|
|
2118
|
-
(0,
|
|
2119
|
-
globalEvents.off($xeGrid,
|
|
2120
|
-
|
|
2121
|
-
|
|
1773
|
+
(0, import_vue.onBeforeUnmount)(() => {
|
|
1774
|
+
globalEvents.off($xeGrid, "keydown");
|
|
1775
|
+
import_xe_utils.default.assign(reactData, createReactData());
|
|
1776
|
+
import_xe_utils.default.assign(internalData, createInternalData());
|
|
2122
1777
|
});
|
|
2123
1778
|
$xeGrid.renderVN = renderVN;
|
|
2124
|
-
(0,
|
|
2125
|
-
(0,
|
|
1779
|
+
(0, import_vue.provide)("$xeGrid", $xeGrid);
|
|
1780
|
+
(0, import_vue.provide)("$xeGantt", null);
|
|
2126
1781
|
return $xeGrid;
|
|
2127
1782
|
},
|
|
2128
1783
|
render() {
|
|
2129
1784
|
return this.renderVN();
|
|
2130
1785
|
}
|
|
2131
|
-
});
|
|
1786
|
+
});
|