@vipl520/dk-ui 1.0.41 → 1.0.44
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/attributes.json +23 -3
- package/dist/index.css +1 -1
- package/dist/index.js +3634 -12985
- package/dist/index.min.js +4 -13
- package/dist/index.min.js.map +1 -1
- package/dist/index.min.mjs +4 -13
- package/dist/index.min.mjs.map +1 -1
- package/dist/index.mjs +785 -10135
- package/dist/tags.json +7 -2
- package/dist/web-types.json +71 -12
- package/es/animate-select/src/animate-select.vue2.mjs +5 -1
- package/es/animate-select/src/animate-select.vue2.mjs.map +1 -1
- package/es/api/attachment.mjs.map +1 -1
- package/es/attachment/src/attachment.vue2.mjs +7 -1
- package/es/attachment/src/attachment.vue2.mjs.map +1 -1
- package/es/attachment-dialog/index.d.ts +9 -0
- package/es/attachment-dialog/src/attachment-dialog.vue.d.ts +9 -0
- package/es/attachment-dialog/src/attachment-dialog.vue2.mjs +3 -2
- package/es/attachment-dialog/src/attachment-dialog.vue2.mjs.map +1 -1
- package/es/attachment-dialog/src/props.d.ts +4 -0
- package/es/attachment-dialog/src/props.mjs +4 -0
- package/es/attachment-dialog/src/props.mjs.map +1 -1
- package/es/audio-list-input/src/audio-list-input.vue2.mjs.map +1 -1
- package/es/box-size-input/src/box-size-input.vue2.mjs +60 -59
- package/es/box-size-input/src/box-size-input.vue2.mjs.map +1 -1
- package/es/box-size-input/style/index.css +1 -1
- package/es/box-size-input/style/index.scss +11 -4
- package/es/dialog/src/dialog.vue2.mjs +3 -1
- package/es/dialog/src/dialog.vue2.mjs.map +1 -1
- package/es/dialog/style/index.scss +1 -0
- package/es/file-input/src/file-input.vue2.mjs.map +1 -1
- package/es/file-list-input/src/file-list-input.vue2.mjs.map +1 -1
- package/es/file-list-input/style/index.css +1 -1
- package/es/file-list-input/style/index.scss +20 -16
- package/es/form/src/form.vue2.mjs.map +1 -1
- package/es/group/src/group.vue2.mjs +5 -13
- package/es/group/src/group.vue2.mjs.map +1 -1
- package/es/hot-area-input/src/component/hot-area-content.vue2.mjs.map +1 -1
- package/es/hot-area-input/src/hot-area-input.vue2.mjs.map +1 -1
- package/es/icon/src/icon.vue2.mjs.map +1 -1
- package/es/icon-input/src/icon-content.vue2.mjs +1 -1
- package/es/icon-input/src/icon-content.vue2.mjs.map +1 -1
- package/es/icon-input/src/icon-input.vue2.mjs.map +1 -1
- package/es/image-list-input/src/image-list-input.vue2.mjs.map +1 -1
- package/es/index.mjs +4 -9
- package/es/index.mjs.map +1 -1
- package/es/page-diy/index.mjs +0 -2
- package/es/page-diy/index.mjs.map +1 -1
- package/es/page-diy/src/components/DiyCloud.vue.mjs.map +1 -1
- package/es/page-diy/src/components/DragBox.vue.mjs +1 -1
- package/es/page-diy/src/components/DragBox.vue.mjs.map +1 -1
- package/es/page-diy/src/components/DragTool.vue.mjs +5 -1
- package/es/page-diy/src/components/DragTool.vue.mjs.map +1 -1
- package/es/page-diy/src/components/PreviewPhone.vue2.mjs.map +1 -1
- package/es/page-diy/src/components/forms/DkEventSelectInput.vue.mjs +11 -9
- package/es/page-diy/src/components/forms/DkEventSelectInput.vue.mjs.map +1 -1
- package/es/page-diy/src/config/base/dkSetting.mjs.map +1 -1
- package/es/page-diy/src/config/rule/min/common/DkMinBlank.mjs +9 -1
- package/es/page-diy/src/config/rule/min/common/DkMinBlank.mjs.map +1 -1
- package/es/page-diy/src/config/rule/min/common/DkMinHotArea.mjs +3 -1
- package/es/page-diy/src/config/rule/min/common/DkMinHotArea.mjs.map +1 -1
- package/es/page-diy/src/config/rule/min/common/DkMinTitle.mjs +36 -6
- package/es/page-diy/src/config/rule/min/common/DkMinTitle.mjs.map +1 -1
- package/es/page-diy/src/config/rule/min/common/DkMinVideo.mjs +6 -2
- package/es/page-diy/src/config/rule/min/common/DkMinVideo.mjs.map +1 -1
- package/es/page-diy/src/config/rule/min/common/index.mjs +8 -1
- package/es/page-diy/src/config/rule/min/common/index.mjs.map +1 -1
- package/es/page-diy/src/config/rule/web/common/DkPosterBtn.mjs +3 -1
- package/es/page-diy/src/config/rule/web/common/DkPosterBtn.mjs.map +1 -1
- package/es/page-diy/src/config/rule/web/common/DkViewBulletChat.mjs.map +1 -1
- package/es/page-diy/src/config/rule/web/common/DkViewDialog.mjs +7 -1
- package/es/page-diy/src/config/rule/web/common/DkViewDialog.mjs.map +1 -1
- package/es/page-diy/src/config/rule/web/common/DkViewVideo.mjs +9 -3
- package/es/page-diy/src/config/rule/web/common/DkViewVideo.mjs.map +1 -1
- package/es/page-diy/src/page-diy.vue.mjs +1 -2
- package/es/page-diy/src/page-diy.vue.mjs.map +1 -1
- package/es/page-diy/src/utils/eventData.mjs.map +1 -1
- package/es/page-diy/src/views/min/DkMinHotArea.vue.mjs +23 -6
- package/es/page-diy/src/views/min/DkMinHotArea.vue.mjs.map +1 -1
- package/es/page-diy/src/views/min/DkMinSwiperImage.vue.mjs.map +1 -1
- package/es/page-diy/src/views/min/DkMinTitle.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewBulletChat.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewCell.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewCommonBtn.vue.mjs +3 -1
- package/es/page-diy/src/views/web/DkViewCommonBtn.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewGridCellList.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewImage.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewMusic.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewNoticeBar.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewSwipe.vue.mjs.map +1 -1
- package/es/page-diy/src/views/web/DkViewTitle.vue.mjs.map +1 -1
- package/es/page-diy/style/dk-page-diy.css +1 -1
- package/es/page-diy/style/dk-page-diy.scss +1 -1
- package/es/page-diy/style/index.css +1 -1
- package/es/poster-input/src/component/poster.vue2.mjs.map +1 -1
- package/es/poster-input/src/component/views/DkPosterViewAvatar.vue2.mjs.map +1 -1
- package/es/poster-input/src/component/views/DkPosterViewImage.vue2.mjs +5 -2
- package/es/poster-input/src/component/views/DkPosterViewImage.vue2.mjs.map +1 -1
- package/es/poster-input/src/component/views/DkPosterViewName.vue2.mjs.map +1 -1
- package/es/poster-input/src/component/views/DkPosterViewQrcode.vue2.mjs.map +1 -1
- package/es/poster-input/src/component/views/DkPosterViewText.vue2.mjs.map +1 -1
- package/es/poster-input/src/component/views/quick-action.vue2.mjs.map +1 -1
- package/es/poster-input/src/poster-input.vue2.mjs.map +1 -1
- package/es/poster-input/style/index.scss +4 -2
- package/es/select/src/select.vue2.mjs +9 -1
- package/es/select/src/select.vue2.mjs.map +1 -1
- package/es/style-animation-input/src/props.mjs.map +1 -1
- package/es/style-animation-input/src/style-animation-input.vue2.mjs +1 -1
- package/es/style-animation-input/src/style-animation-input.vue2.mjs.map +1 -1
- package/es/style-background-input/index.d.ts +2 -1
- package/es/style-background-input/src/style-background-input.vue.d.ts +2 -1
- package/es/style-background-input/src/style-background-input.vue2.mjs +2 -1
- package/es/style-background-input/src/style-background-input.vue2.mjs.map +1 -1
- package/es/style-border-input/index.d.ts +2 -1
- package/es/style-border-input/src/style-border-input.vue.d.ts +2 -1
- package/es/style-border-input/src/style-border-input.vue2.mjs +56 -39
- package/es/style-border-input/src/style-border-input.vue2.mjs.map +1 -1
- package/es/style-border-input/style/index.css +1 -1
- package/es/style-box-input/index.d.ts +2 -1
- package/es/style-box-input/src/style-box-input.vue.d.ts +2 -1
- package/es/style-box-input/src/style-box-input.vue2.mjs +4 -7
- package/es/style-box-input/src/style-box-input.vue2.mjs.map +1 -1
- package/es/style-font-input/index.d.ts +2 -1
- package/es/style-font-input/src/style-font-input.vue.d.ts +2 -1
- package/es/style-font-input/src/style-font-input.vue2.mjs +10 -27
- package/es/style-font-input/src/style-font-input.vue2.mjs.map +1 -1
- package/es/style-input/src/style-input.vue2.mjs +10 -22
- package/es/style-input/src/style-input.vue2.mjs.map +1 -1
- package/es/style-number-input/src/style-number-input.vue2.mjs.map +1 -1
- package/es/style-position-input/src/style-position-input.vue2.mjs +4 -1
- package/es/style-position-input/src/style-position-input.vue2.mjs.map +1 -1
- package/es/style-shadow-input/index.d.ts +2 -1
- package/es/style-shadow-input/src/style-shadow-content.vue2.mjs +138 -153
- package/es/style-shadow-input/src/style-shadow-content.vue2.mjs.map +1 -1
- package/es/style-shadow-input/src/style-shadow-input.vue.d.ts +2 -1
- package/es/style-shadow-input/src/style-shadow-input.vue2.mjs +2 -1
- package/es/style-shadow-input/src/style-shadow-input.vue2.mjs.map +1 -1
- package/es/table/src/components/ComSearch.vue2.mjs.map +1 -1
- package/es/table/src/components/FieldRender.vue2.mjs.map +1 -1
- package/es/table/src/components/RecycleDialog.vue2.mjs +3 -1
- package/es/table/src/components/RecycleDialog.vue2.mjs.map +1 -1
- package/es/table/src/components/header.vue2.mjs +17 -3
- package/es/table/src/components/header.vue2.mjs.map +1 -1
- package/es/table/src/props.mjs +11 -1
- package/es/table/src/props.mjs.map +1 -1
- package/es/table/src/table.vue2.mjs +13 -3
- package/es/table/src/table.vue2.mjs.map +1 -1
- package/es/table/utils/dkTable.mjs +32 -11
- package/es/table/utils/dkTable.mjs.map +1 -1
- package/es/table/utils/dkTableApi.mjs.map +1 -1
- package/es/tiny-editor/src/tiny-editor.vue2.mjs +4 -2
- package/es/tiny-editor/src/tiny-editor.vue2.mjs.map +1 -1
- package/es/tiny-editor/style/index.css +1 -1
- package/es/tiny-editor/style/index.scss +6 -0
- package/es/video-list-input/src/video-list-input.vue2.mjs.map +1 -1
- package/lib/animate-select/src/animate-select.vue2.js +5 -1
- package/lib/animate-select/src/animate-select.vue2.js.map +1 -1
- package/lib/api/attachment.js.map +1 -1
- package/lib/attachment/src/attachment.vue2.js +7 -1
- package/lib/attachment/src/attachment.vue2.js.map +1 -1
- package/lib/attachment-dialog/index.d.ts +9 -0
- package/lib/attachment-dialog/src/attachment-dialog.vue.d.ts +9 -0
- package/lib/attachment-dialog/src/attachment-dialog.vue2.js +3 -2
- package/lib/attachment-dialog/src/attachment-dialog.vue2.js.map +1 -1
- package/lib/attachment-dialog/src/props.d.ts +4 -0
- package/lib/attachment-dialog/src/props.js +4 -0
- package/lib/attachment-dialog/src/props.js.map +1 -1
- package/lib/audio-list-input/src/audio-list-input.vue2.js.map +1 -1
- package/lib/box-size-input/src/box-size-input.vue2.js +59 -58
- package/lib/box-size-input/src/box-size-input.vue2.js.map +1 -1
- package/lib/box-size-input/style/index.css +1 -1
- package/lib/box-size-input/style/index.scss +11 -4
- package/lib/dialog/src/dialog.vue2.js +3 -1
- package/lib/dialog/src/dialog.vue2.js.map +1 -1
- package/lib/dialog/style/index.scss +1 -0
- package/lib/file-input/src/file-input.vue2.js.map +1 -1
- package/lib/file-list-input/src/file-list-input.vue2.js.map +1 -1
- package/lib/file-list-input/style/index.css +1 -1
- package/lib/file-list-input/style/index.scss +20 -16
- package/lib/form/src/form.vue2.js.map +1 -1
- package/lib/group/src/group.vue2.js +4 -12
- package/lib/group/src/group.vue2.js.map +1 -1
- package/lib/hot-area-input/src/component/hot-area-content.vue2.js.map +1 -1
- package/lib/hot-area-input/src/hot-area-input.vue2.js.map +1 -1
- package/lib/icon/src/icon.vue2.js.map +1 -1
- package/lib/icon-input/src/icon-content.vue2.js +1 -1
- package/lib/icon-input/src/icon-content.vue2.js.map +1 -1
- package/lib/icon-input/src/icon-input.vue2.js.map +1 -1
- package/lib/image-list-input/src/image-list-input.vue2.js.map +1 -1
- package/lib/index.js +4 -9
- package/lib/index.js.map +1 -1
- package/lib/page-diy/index.js +0 -2
- package/lib/page-diy/index.js.map +1 -1
- package/lib/page-diy/src/components/DiyCloud.vue.js.map +1 -1
- package/lib/page-diy/src/components/DragBox.vue.js +1 -1
- package/lib/page-diy/src/components/DragBox.vue.js.map +1 -1
- package/lib/page-diy/src/components/DragTool.vue.js +5 -1
- package/lib/page-diy/src/components/DragTool.vue.js.map +1 -1
- package/lib/page-diy/src/components/PreviewPhone.vue2.js.map +1 -1
- package/lib/page-diy/src/components/forms/DkEventSelectInput.vue.js +11 -9
- package/lib/page-diy/src/components/forms/DkEventSelectInput.vue.js.map +1 -1
- package/lib/page-diy/src/config/base/dkSetting.js.map +1 -1
- package/lib/page-diy/src/config/rule/min/common/DkMinBlank.js +9 -1
- package/lib/page-diy/src/config/rule/min/common/DkMinBlank.js.map +1 -1
- package/lib/page-diy/src/config/rule/min/common/DkMinHotArea.js +3 -1
- package/lib/page-diy/src/config/rule/min/common/DkMinHotArea.js.map +1 -1
- package/lib/page-diy/src/config/rule/min/common/DkMinTitle.js +36 -6
- package/lib/page-diy/src/config/rule/min/common/DkMinTitle.js.map +1 -1
- package/lib/page-diy/src/config/rule/min/common/DkMinVideo.js +6 -2
- package/lib/page-diy/src/config/rule/min/common/DkMinVideo.js.map +1 -1
- package/lib/page-diy/src/config/rule/min/common/index.js +8 -1
- package/lib/page-diy/src/config/rule/min/common/index.js.map +1 -1
- package/lib/page-diy/src/config/rule/web/common/DkPosterBtn.js +3 -1
- package/lib/page-diy/src/config/rule/web/common/DkPosterBtn.js.map +1 -1
- package/lib/page-diy/src/config/rule/web/common/DkViewBulletChat.js.map +1 -1
- package/lib/page-diy/src/config/rule/web/common/DkViewDialog.js +7 -1
- package/lib/page-diy/src/config/rule/web/common/DkViewDialog.js.map +1 -1
- package/lib/page-diy/src/config/rule/web/common/DkViewVideo.js +9 -3
- package/lib/page-diy/src/config/rule/web/common/DkViewVideo.js.map +1 -1
- package/lib/page-diy/src/page-diy.vue.js +1 -2
- package/lib/page-diy/src/page-diy.vue.js.map +1 -1
- package/lib/page-diy/src/utils/eventData.js.map +1 -1
- package/lib/page-diy/src/views/min/DkMinHotArea.vue.js +23 -6
- package/lib/page-diy/src/views/min/DkMinHotArea.vue.js.map +1 -1
- package/lib/page-diy/src/views/min/DkMinSwiperImage.vue.js.map +1 -1
- package/lib/page-diy/src/views/min/DkMinTitle.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewBulletChat.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewCell.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewCommonBtn.vue.js +3 -1
- package/lib/page-diy/src/views/web/DkViewCommonBtn.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewGridCellList.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewImage.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewMusic.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewNoticeBar.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewSwipe.vue.js.map +1 -1
- package/lib/page-diy/src/views/web/DkViewTitle.vue.js.map +1 -1
- package/lib/page-diy/style/dk-page-diy.css +1 -1
- package/lib/page-diy/style/dk-page-diy.scss +1 -1
- package/lib/page-diy/style/index.css +1 -1
- package/lib/poster-input/src/component/poster.vue2.js.map +1 -1
- package/lib/poster-input/src/component/views/DkPosterViewAvatar.vue2.js.map +1 -1
- package/lib/poster-input/src/component/views/DkPosterViewImage.vue2.js +5 -2
- package/lib/poster-input/src/component/views/DkPosterViewImage.vue2.js.map +1 -1
- package/lib/poster-input/src/component/views/DkPosterViewName.vue2.js.map +1 -1
- package/lib/poster-input/src/component/views/DkPosterViewQrcode.vue2.js.map +1 -1
- package/lib/poster-input/src/component/views/DkPosterViewText.vue2.js.map +1 -1
- package/lib/poster-input/src/component/views/quick-action.vue2.js.map +1 -1
- package/lib/poster-input/src/poster-input.vue2.js.map +1 -1
- package/lib/poster-input/style/index.scss +4 -2
- package/lib/select/src/select.vue2.js +9 -1
- package/lib/select/src/select.vue2.js.map +1 -1
- package/lib/style-animation-input/src/props.js.map +1 -1
- package/lib/style-animation-input/src/style-animation-input.vue2.js +1 -1
- package/lib/style-animation-input/src/style-animation-input.vue2.js.map +1 -1
- package/lib/style-background-input/index.d.ts +2 -1
- package/lib/style-background-input/src/style-background-input.vue.d.ts +2 -1
- package/lib/style-background-input/src/style-background-input.vue2.js +2 -1
- package/lib/style-background-input/src/style-background-input.vue2.js.map +1 -1
- package/lib/style-border-input/index.d.ts +2 -1
- package/lib/style-border-input/src/style-border-input.vue.d.ts +2 -1
- package/lib/style-border-input/src/style-border-input.vue2.js +56 -39
- package/lib/style-border-input/src/style-border-input.vue2.js.map +1 -1
- package/lib/style-border-input/style/index.css +1 -1
- package/lib/style-box-input/index.d.ts +2 -1
- package/lib/style-box-input/src/style-box-input.vue.d.ts +2 -1
- package/lib/style-box-input/src/style-box-input.vue2.js +4 -7
- package/lib/style-box-input/src/style-box-input.vue2.js.map +1 -1
- package/lib/style-font-input/index.d.ts +2 -1
- package/lib/style-font-input/src/style-font-input.vue.d.ts +2 -1
- package/lib/style-font-input/src/style-font-input.vue2.js +10 -27
- package/lib/style-font-input/src/style-font-input.vue2.js.map +1 -1
- package/lib/style-input/src/style-input.vue2.js +9 -21
- package/lib/style-input/src/style-input.vue2.js.map +1 -1
- package/lib/style-number-input/src/style-number-input.vue2.js.map +1 -1
- package/lib/style-position-input/src/style-position-input.vue2.js +4 -1
- package/lib/style-position-input/src/style-position-input.vue2.js.map +1 -1
- package/lib/style-shadow-input/index.d.ts +2 -1
- package/lib/style-shadow-input/src/style-shadow-content.vue2.js +138 -153
- package/lib/style-shadow-input/src/style-shadow-content.vue2.js.map +1 -1
- package/lib/style-shadow-input/src/style-shadow-input.vue.d.ts +2 -1
- package/lib/style-shadow-input/src/style-shadow-input.vue2.js +2 -1
- package/lib/style-shadow-input/src/style-shadow-input.vue2.js.map +1 -1
- package/lib/table/src/components/ComSearch.vue2.js.map +1 -1
- package/lib/table/src/components/FieldRender.vue2.js.map +1 -1
- package/lib/table/src/components/RecycleDialog.vue2.js +3 -1
- package/lib/table/src/components/RecycleDialog.vue2.js.map +1 -1
- package/lib/table/src/components/header.vue2.js +17 -3
- package/lib/table/src/components/header.vue2.js.map +1 -1
- package/lib/table/src/props.js +11 -1
- package/lib/table/src/props.js.map +1 -1
- package/lib/table/src/table.vue2.js +13 -3
- package/lib/table/src/table.vue2.js.map +1 -1
- package/lib/table/utils/dkTable.js +32 -11
- package/lib/table/utils/dkTable.js.map +1 -1
- package/lib/table/utils/dkTableApi.js.map +1 -1
- package/lib/tiny-editor/src/tiny-editor.vue2.js +4 -2
- package/lib/tiny-editor/src/tiny-editor.vue2.js.map +1 -1
- package/lib/tiny-editor/style/index.css +1 -1
- package/lib/tiny-editor/style/index.scss +6 -0
- package/lib/video-list-input/src/video-list-input.vue2.js.map +1 -1
- package/package.json +3 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"FieldRender.vue2.mjs","sources":["../../../../src/table/src/components/FieldRender.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkFieldRender',\n});\n</script>\n<template>\n <!--图标-->\n <div v-if=\"field.render == 'icon'\">\n <dk-icon v-if=\"fieldValue || field.default\" :icon=\"fieldValue ? fieldValue : field.default\" />\n <span v-else>-</span>\n </div>\n\n <!--开关-->\n <el-switch\n v-if=\"field.render == 'switch' && fieldValue !== ''\"\n :model-value=\"fieldValue.toString()\"\n :loading=\"row.loading\"\n inactive-value=\"0\"\n active-value=\"1\"\n size=\"small\"\n @change=\"onChangeField\"\n ></el-switch>\n\n <!-- 单图 -->\n <div v-if=\"field.render == 'image' && fieldValue\" class=\"ba-render-image\">\n <el-image\n :hide-on-click-modal=\"true\"\n :preview-teleported=\"true\"\n :preview-src-list=\"[fieldValue]\"\n :src=\"fieldValue\"\n fit=\"cover\"\n style=\"width: 50px; height: 50px\"\n ></el-image>\n </div>\n\n <!--多图片-->\n <div v-if=\"field.render == 'images'\" class=\"ba-render-image\">\n <template v-if=\"Array.isArray(fieldValue) && fieldValue.length\">\n <el-image\n v-for=\"(item, idx) in fieldValue\"\n :key=\"idx\"\n :initial-index=\"idx\"\n :preview-teleported=\"true\"\n :preview-src-list=\"fieldValue\"\n class=\"images-item\"\n :src=\"item\"\n style=\"width: 50px; height: 50px\"\n :hide-on-click-modal=\"true\"\n ></el-image>\n </template>\n </div>\n\n <div v-if=\"field.render == 'tag' && fieldValue !== ''\">\n <el-tag\n :type=\"getTagType(fieldValue, field.custom)\"\n :effect=\"field.effect ?? 'light'\"\n :size=\"field.size ?? 'default'\"\n >\n {{ field.replaceValue ? field.replaceValue[fieldValue] : fieldValue }}\n </el-tag>\n </div>\n\n <!-- tags -->\n <div v-if=\"field.render == 'tags'\">\n <template v-if=\"Array.isArray(fieldValue)\">\n <template v-for=\"(tag, idx) in fieldValue\" :key=\"idx\">\n <el-tag\n v-if=\"tag !== ''\"\n class=\"m-1px\"\n :type=\"getTagType(tag, field.custom)\"\n :effect=\"field.effect ?? 'light'\"\n :size=\"field.size ?? 'default'\"\n >\n {{ field.replaceValue ? field.replaceValue[tag] ?? tag : tag }}</el-tag\n >\n </template>\n </template>\n <template v-else>\n <el-tag\n v-if=\"fieldValue !== ''\"\n class=\"m-1px\"\n :type=\"getTagType(fieldValue, field.custom)\"\n :effect=\"field.effect ?? 'light'\"\n :size=\"field.size ?? 'default'\"\n >\n {{ field.replaceValue ? field.replaceValue[fieldValue] ?? fieldValue : fieldValue }}\n </el-tag>\n </template>\n </div>\n\n <!-- url -->\n <div v-if=\"field.render == 'url' && fieldValue\">\n <el-input :model-value=\"fieldValue\" placeholder=\"链接地址\">\n <template #append>\n <el-button\n @click=\"\n typeof field.click == 'function'\n ? field.click(row, field, fieldValue, column, index)\n : openUrl(fieldValue, field.target)\n \"\n >\n <dk-icon :color=\"'#606266'\" icon=\"Position\" />\n </el-button>\n </template>\n </el-input>\n </div>\n\n <!-- datetime -->\n <div v-if=\"field.render == 'datetime'\">\n {{ !fieldValue ? '-' : timeFormat(fieldValue, field.timeFormat ?? undefined) }}\n </div>\n\n <div v-if=\"field.render == 'time'\">\n {{ fieldValue }}\n </div>\n <div v-if=\"field.render == 'year'\">\n {{ fieldValue }}\n </div>\n <!-- color -->\n <div v-if=\"field.render == 'color'\">\n <div :style=\"{ background: fieldValue }\" class=\"dk-render-color\"></div>\n </div>\n\n <!-- 自定义组件/函数渲染 -->\n <component\n :is=\"field.customRender\"\n v-if=\"field.render == 'customRender'\"\n :render-row=\"row\"\n :render-field=\"field\"\n :render-value=\"fieldValue\"\n :render-column=\"column\"\n :render-index=\"index\"\n />\n\n <!-- 按钮组 -->\n <!-- 只对默认的编辑、删除、排序按钮进行鉴权,其他按钮请通过 display 属性控制按钮是否显示 -->\n <div v-if=\"field.render == 'buttons' && field.buttons\">\n <template v-for=\"(btn, idx) in field.buttons\" :key=\"idx\">\n <template v-if=\"btn.display ? btn.display(row, field) : true\">\n <!-- 常规按钮 未使用-->\n <el-button\n v-if=\"btn.render == 'basicButton'\"\n v-blur\n :class=\"btn.class\"\n class=\"table-operate\"\n :type=\"btn.type\"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.attr\"\n @click=\"onButtonClick(btn)\"\n >\n <dk-icon :icon=\"btn.icon\" />\n <div v-if=\"btn.text\" class=\"table-operate-text\">{{ btn.text }}</div>\n </el-button>\n\n <!-- 带提示信息的按钮 -->\n <el-tooltip\n v-if=\"btn.render == 'tipButton' && ((btn.name == 'edit' && DkTable.auth('edit')) || btn.name != 'edit')\"\n :disabled=\"!(btn.title && !btn.disabledTip)\"\n :content=\"btn.title ?? ''\"\n placement=\"top\"\n :hide-after=\"0\"\n :show-after=\"100\"\n >\n <el-button\n v-blur\n :class=\"btn.class\"\n class=\"table-operate\"\n :type=\"btn.type\"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.attr\"\n @click=\"onButtonClick(btn)\"\n >\n <dk-icon :icon=\"btn.icon\" />\n <div v-if=\"btn.text\" class=\"table-operate-text\">{{ btn.text }}</div>\n </el-button>\n </el-tooltip>\n\n <!-- 带确认框的按钮 -->\n <el-popconfirm\n v-if=\"\n btn.render == 'confirmButton' && ((btn.name == 'delete' && DkTable.auth('del')) || btn.name != 'delete')\n \"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.popconfirm\"\n :hide-after=\"0\"\n :show-after=\"100\"\n @confirm=\"onButtonClick(btn)\"\n >\n <template #reference>\n <div class=\"dk-tooltip-button\">\n <el-tooltip :disabled=\"!btn.title\" :content=\"btn.title ?? ''\" placement=\"top\">\n <el-button\n v-blur\n :class=\"btn.class\"\n class=\"table-operate\"\n :type=\"btn.type\"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.attr\"\n >\n <dk-icon :icon=\"btn.icon\" />\n <div v-if=\"btn.text\" class=\"table-operate-text\">\n {{ btn.text }}\n </div>\n </el-button>\n </el-tooltip>\n </div>\n </template>\n </el-popconfirm>\n\n <!-- 带提示的可拖拽按钮 -->\n <el-tooltip\n v-if=\"\n btn.render == 'moveButton' &&\n ((btn.name == 'weigh-sort' && DkTable.auth('sortable')) || btn.name != 'weigh-sort')\n \"\n :disabled=\"!(btn.title && !btn.disabledTip)\"\n :content=\"btn.title ?? ''\"\n :hide-after=\"0\"\n :show-after=\"100\"\n placement=\"top\"\n >\n <el-button\n :class=\"btn.class\"\n class=\"table-operate move-button\"\n :type=\"btn.type\"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.attr\"\n size=\"small\"\n >\n <dk-icon :icon=\"btn.icon\" />\n <div v-if=\"btn.text\" class=\"table-operate-text\">{{ btn.text }}</div>\n </el-button>\n </el-tooltip>\n </template>\n </template>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { inject, ref } from 'vue'\nimport type { TableColumnCtx, TagProps } from 'element-plus'\nimport { openUrl, timeFormat } from '@vipl520/utils'\nimport type dkTable from '../../utils/dkTable'\n\nconst DkTable = inject('DkTable') as dkTable\n\ninterface Props {\n row: TableRow\n field: TableColumn\n column: TableColumnCtx<TableRow>\n index: number\n}\nconst props = defineProps<Props>()\n\nconst fieldName: any = ref(props.field.prop)\nconst fieldValue = ref(props.row[fieldName.value] ?? '')\n\nif (fieldName.value && fieldName.value.indexOf('.') > -1) {\n const fieldNameArr = fieldName.value.split('.')\n const val: any = ref(props.row[fieldNameArr[0]])\n for (let index = 1; index < fieldNameArr.length; index++) {\n val.value = val.value ? val.value[fieldNameArr[index]] ?? '' : ''\n }\n fieldValue.value = val.value\n}\n\nconst getTagType = (value: string, custom: any): TagProps['type'] => {\n return custom && custom[value] ? custom[value] : ''\n}\n\nconst onChangeField = (value: any) => {\n DkTable.onTableAction('field-change', {\n ...props,\n value,\n })\n}\n\nconst onButtonClick = (btn: OptButton) => {\n if (typeof btn.click === 'function') {\n btn.click(props.row, props.field)\n return\n }\n DkTable.onTableAction(btn.name, props)\n}\n</script>\n<style scoped></style>\n"],"names":["__MACROS_defineComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,eAAA;AACR,CAAC,CAAA,CAAA;;;;;;;;;;;AAgPD,IAAM,MAAA,OAAA,GAAU,OAAO,SAAS,CAAA,CAAA;AAUhC,IAAA,MAAM,SAAiB,GAAA,GAAA,CAAI,KAAM,CAAA,KAAA,CAAM,IAAI,CAAA,CAAA;AAC3C,IAAA,MAAM,aAAa,GAAI,CAAA,KAAA,CAAM,IAAI,SAAU,CAAA,KAAK,KAAK,EAAE,CAAA,CAAA;AAEvD,IAAA,IAAI,UAAU,KAAS,IAAA,SAAA,CAAU,MAAM,OAAQ,CAAA,GAAG,IAAI,CAAI,CAAA,EAAA;AACxD,MAAA,MAAM,YAAe,GAAA,SAAA,CAAU,KAAM,CAAA,KAAA,CAAM,GAAG,CAAA,CAAA;AAC9C,MAAA,MAAM,MAAW,GAAI,CAAA,KAAA,CAAM,IAAI,YAAa,CAAA,CAAC,CAAC,CAAC,CAAA,CAAA;AAC/C,MAAA,KAAA,IAAS,KAAQ,GAAA,CAAA,EAAG,KAAQ,GAAA,YAAA,CAAa,QAAQ,KAAS,EAAA,EAAA;AACxD,QAAI,GAAA,CAAA,KAAA,GAAQ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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"FieldRender.vue2.mjs","sources":["../../../../src/table/src/components/FieldRender.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkFieldRender',\n});\n</script>\n<template>\n <!--图标-->\n <div v-if=\"field.render == 'icon'\">\n <dk-icon\n v-if=\"fieldValue || field.default\"\n :icon=\"fieldValue ? fieldValue : field.default\"\n />\n <span v-else>-</span>\n </div>\n\n <!--开关-->\n <el-switch\n v-if=\"field.render == 'switch' && fieldValue !== ''\"\n :model-value=\"fieldValue.toString()\"\n :loading=\"row.loading\"\n inactive-value=\"0\"\n active-value=\"1\"\n size=\"small\"\n @change=\"onChangeField\"\n ></el-switch>\n\n <!-- 单图 -->\n <div v-if=\"field.render == 'image' && fieldValue\" class=\"ba-render-image\">\n <el-image\n :hide-on-click-modal=\"true\"\n :preview-teleported=\"true\"\n :preview-src-list=\"[fieldValue]\"\n :src=\"fieldValue\"\n fit=\"cover\"\n style=\"width: 50px; height: 50px\"\n ></el-image>\n </div>\n\n <!--多图片-->\n <div v-if=\"field.render == 'images'\" class=\"ba-render-image\">\n <template v-if=\"Array.isArray(fieldValue) && fieldValue.length\">\n <el-image\n v-for=\"(item, idx) in fieldValue\"\n :key=\"idx\"\n :initial-index=\"idx\"\n :preview-teleported=\"true\"\n :preview-src-list=\"fieldValue\"\n class=\"images-item\"\n :src=\"item\"\n style=\"width: 50px; height: 50px\"\n :hide-on-click-modal=\"true\"\n ></el-image>\n </template>\n </div>\n\n <div v-if=\"field.render == 'tag' && fieldValue !== ''\">\n <el-tag\n :type=\"getTagType(fieldValue, field.custom)\"\n :effect=\"field.effect ?? 'light'\"\n :size=\"field.size ?? 'default'\"\n >\n {{ field.replaceValue ? field.replaceValue[fieldValue] : fieldValue }}\n </el-tag>\n </div>\n\n <!-- tags -->\n <div v-if=\"field.render == 'tags'\">\n <template v-if=\"Array.isArray(fieldValue)\">\n <template v-for=\"(tag, idx) in fieldValue\" :key=\"idx\">\n <el-tag\n v-if=\"tag !== ''\"\n class=\"m-1px\"\n :type=\"getTagType(tag, field.custom)\"\n :effect=\"field.effect ?? 'light'\"\n :size=\"field.size ?? 'default'\"\n >\n {{\n field.replaceValue ? field.replaceValue[tag] ?? tag : tag\n }}</el-tag\n >\n </template>\n </template>\n <template v-else>\n <el-tag\n v-if=\"fieldValue !== ''\"\n class=\"m-1px\"\n :type=\"getTagType(fieldValue, field.custom)\"\n :effect=\"field.effect ?? 'light'\"\n :size=\"field.size ?? 'default'\"\n >\n {{\n field.replaceValue\n ? field.replaceValue[fieldValue] ?? fieldValue\n : fieldValue\n }}\n </el-tag>\n </template>\n </div>\n\n <!-- url -->\n <div v-if=\"field.render == 'url' && fieldValue\">\n <el-input :model-value=\"fieldValue\" placeholder=\"链接地址\">\n <template #append>\n <el-button\n @click=\"\n typeof field.click == 'function'\n ? field.click(row, field, fieldValue, column, index)\n : openUrl(fieldValue, field.target)\n \"\n >\n <dk-icon :color=\"'#606266'\" icon=\"Position\" />\n </el-button>\n </template>\n </el-input>\n </div>\n\n <!-- datetime -->\n <div v-if=\"field.render == 'datetime'\">\n {{\n !fieldValue ? '-' : timeFormat(fieldValue, field.timeFormat ?? undefined)\n }}\n </div>\n\n <div v-if=\"field.render == 'time'\">\n {{ fieldValue }}\n </div>\n <div v-if=\"field.render == 'year'\">\n {{ fieldValue }}\n </div>\n <!-- color -->\n <div v-if=\"field.render == 'color'\">\n <div :style=\"{ background: fieldValue }\" class=\"dk-render-color\"></div>\n </div>\n\n <!-- 自定义组件/函数渲染 -->\n <component\n :is=\"field.customRender\"\n v-if=\"field.render == 'customRender'\"\n :render-row=\"row\"\n :render-field=\"field\"\n :render-value=\"fieldValue\"\n :render-column=\"column\"\n :render-index=\"index\"\n />\n\n <!-- 按钮组 -->\n <!-- 只对默认的编辑、删除、排序按钮进行鉴权,其他按钮请通过 display 属性控制按钮是否显示 -->\n <div v-if=\"field.render == 'buttons' && field.buttons\">\n <template v-for=\"(btn, idx) in field.buttons\" :key=\"idx\">\n <template v-if=\"btn.display ? btn.display(row, field) : true\">\n <!-- 常规按钮 未使用-->\n <el-button\n v-if=\"btn.render == 'basicButton'\"\n v-blur\n :class=\"btn.class\"\n class=\"table-operate\"\n :type=\"btn.type\"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.attr\"\n @click=\"onButtonClick(btn)\"\n >\n <dk-icon :icon=\"btn.icon\" />\n <div v-if=\"btn.text\" class=\"table-operate-text\">{{ btn.text }}</div>\n </el-button>\n\n <!-- 带提示信息的按钮 -->\n <el-tooltip\n v-if=\"\n btn.render == 'tipButton' &&\n ((btn.name == 'edit' && DkTable.auth('edit')) || btn.name != 'edit')\n \"\n :disabled=\"!(btn.title && !btn.disabledTip)\"\n :content=\"btn.title ?? ''\"\n placement=\"top\"\n :hide-after=\"0\"\n :show-after=\"100\"\n >\n <el-button\n v-blur\n :class=\"btn.class\"\n class=\"table-operate\"\n :type=\"btn.type\"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.attr\"\n @click=\"onButtonClick(btn)\"\n >\n <dk-icon :icon=\"btn.icon\" />\n <div v-if=\"btn.text\" class=\"table-operate-text\">{{ btn.text }}</div>\n </el-button>\n </el-tooltip>\n\n <!-- 带确认框的按钮 -->\n <el-popconfirm\n v-if=\"\n btn.render == 'confirmButton' &&\n ((btn.name == 'delete' && DkTable.auth('del')) ||\n btn.name != 'delete')\n \"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.popconfirm\"\n :hide-after=\"0\"\n :show-after=\"100\"\n @confirm=\"onButtonClick(btn)\"\n >\n <template #reference>\n <div class=\"dk-tooltip-button\">\n <el-tooltip\n :disabled=\"!btn.title\"\n :content=\"btn.title ?? ''\"\n placement=\"top\"\n >\n <el-button\n v-blur\n :class=\"btn.class\"\n class=\"table-operate\"\n :type=\"btn.type\"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.attr\"\n >\n <dk-icon :icon=\"btn.icon\" />\n <div v-if=\"btn.text\" class=\"table-operate-text\">\n {{ btn.text }}\n </div>\n </el-button>\n </el-tooltip>\n </div>\n </template>\n </el-popconfirm>\n\n <!-- 带提示的可拖拽按钮 -->\n <el-tooltip\n v-if=\"\n btn.render == 'moveButton' &&\n ((btn.name == 'weigh-sort' && DkTable.auth('sortable')) ||\n btn.name != 'weigh-sort')\n \"\n :disabled=\"!(btn.title && !btn.disabledTip)\"\n :content=\"btn.title ?? ''\"\n :hide-after=\"0\"\n :show-after=\"100\"\n placement=\"top\"\n >\n <el-button\n :class=\"btn.class\"\n class=\"table-operate move-button\"\n :type=\"btn.type\"\n :disabled=\"btn.disabled && btn.disabled(row, field)\"\n v-bind=\"btn.attr\"\n size=\"small\"\n >\n <dk-icon :icon=\"btn.icon\" />\n <div v-if=\"btn.text\" class=\"table-operate-text\">{{ btn.text }}</div>\n </el-button>\n </el-tooltip>\n </template>\n </template>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { inject, ref } from 'vue'\nimport type { TableColumnCtx, TagProps } from 'element-plus'\nimport { openUrl, timeFormat } from '@vipl520/utils'\nimport type dkTable from '../../utils/dkTable'\n\nconst DkTable = inject('DkTable') as dkTable\n\ninterface Props {\n row: TableRow\n field: TableColumn\n column: TableColumnCtx<TableRow>\n index: number\n}\nconst props = defineProps<Props>()\n\nconst fieldName: any = ref(props.field.prop)\nconst fieldValue = ref(props.row[fieldName.value] ?? '')\n\nif (fieldName.value && fieldName.value.indexOf('.') > -1) {\n const fieldNameArr = fieldName.value.split('.')\n const val: any = ref(props.row[fieldNameArr[0]])\n for (let index = 1; index < fieldNameArr.length; index++) {\n val.value = val.value ? val.value[fieldNameArr[index]] ?? '' : ''\n }\n fieldValue.value = val.value\n}\n\nconst getTagType = (value: string, custom: any): TagProps['type'] => {\n return custom && custom[value] ? custom[value] : ''\n}\n\nconst onChangeField = (value: any) => {\n DkTable.onTableAction('field-change', {\n ...props,\n value,\n })\n}\n\nconst onButtonClick = (btn: OptButton) => {\n if (typeof btn.click === 'function') {\n btn.click(props.row, props.field)\n return\n }\n DkTable.onTableAction(btn.name, props)\n}\n</script>\n<style scoped></style>\n"],"names":["__MACROS_defineComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,eAAA;AACR,CAAC,CAAA,CAAA;;;;;;;;;;;AAqQD,IAAM,MAAA,OAAA,GAAU,OAAO,SAAS,CAAA,CAAA;AAUhC,IAAA,MAAM,SAAiB,GAAA,GAAA,CAAI,KAAM,CAAA,KAAA,CAAM,IAAI,CAAA,CAAA;AAC3C,IAAA,MAAM,aAAa,GAAI,CAAA,KAAA,CAAM,IAAI,SAAU,CAAA,KAAK,KAAK,EAAE,CAAA,CAAA;AAEvD,IAAA,IAAI,UAAU,KAAS,IAAA,SAAA,CAAU,MAAM,OAAQ,CAAA,GAAG,IAAI,CAAI,CAAA,EAAA;AACxD,MAAA,MAAM,YAAe,GAAA,SAAA,CAAU,KAAM,CAAA,KAAA,CAAM,GAAG,CAAA,CAAA;AAC9C,MAAA,MAAM,MAAW,GAAI,CAAA,KAAA,CAAM,IAAI,YAAa,CAAA,CAAC,CAAC,CAAC,CAAA,CAAA;AAC/C,MAAA,KAAA,IAAS,KAAQ,GAAA,CAAA,EAAG,KAAQ,GAAA,YAAA,CAAa,QAAQ,KAAS,EAAA,EAAA;AACxD,QAAI,GAAA,CAAA,KAAA,GAAQ,IAAI,KAAQ,GAAA,GAAA,CAAI,MAAM,YAAa,CAAA,KAAK,CAAC,CAAA,IAAK,EAAK,GAAA,EAAA,CAAA;AAAA,OACjE;AACA,MAAA,UAAA,CAAW,QAAQ,GAA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ponent({
|
|
71
71
|
const destroySelect = () => {
|
72
72
|
destroy(getSelectionIds());
|
73
73
|
};
|
74
|
-
const enableBatchOpt = computed(
|
74
|
+
const enableBatchOpt = computed(
|
75
|
+
() => DkTable.recycleTable.selection.length > 0
|
76
|
+
);
|
75
77
|
return (_ctx, _cache) => {
|
76
78
|
const _component_dk_icon = resolveComponent("dk-icon");
|
77
79
|
const _component_el_button = resolveComponent("el-button");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"RecycleDialog.vue2.mjs","sources":["../../../../src/table/src/components/RecycleDialog.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'RecycleDialog',\n});\n</script>\n<template>\n <dk-dialog
|
1
|
+
{"version":3,"file":"RecycleDialog.vue2.mjs","sources":["../../../../src/table/src/components/RecycleDialog.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'RecycleDialog',\n});\n</script>\n<template>\n <dk-dialog\n v-model=\"DkTable.recycleTable.showDialog\"\n title=\"回收站\"\n width=\"1000px\"\n class=\"dk-table\"\n >\n <div class=\"dk-table-header\">\n <el-button\n class=\"table-header-operate\"\n type=\"info\"\n @click=\"DkTable.onTableHeaderAction('refreshRecycle')\"\n >\n <dk-icon icon=\"Refresh\"></dk-icon>\n </el-button>\n <el-button\n class=\"table-header-operate\"\n type=\"primary\"\n :disabled=\"!enableBatchOpt\"\n @click=\"restoreSelect()\"\n >\n <dk-icon icon=\"RefreshLeft\"></dk-icon>\n <span class=\"m-l-5px\">还原</span>\n </el-button>\n <el-button\n class=\"table-header-operate\"\n type=\"danger\"\n :disabled=\"!enableBatchOpt\"\n @click=\"destroySelect()\"\n >\n <dk-icon icon=\"CloseBold\"></dk-icon>\n <span class=\"m-l-5px\">销毁</span>\n </el-button>\n <el-popconfirm\n confirm-button-text=\"还原\"\n cancel-button-text=\"取消\"\n confirm-button-type=\"danger\"\n title=\"您确定要还原全部?\"\n @confirm=\"restore(null)\"\n >\n <template #reference>\n <div class=\"m-l-6px\">\n <el-button class=\"table-header-operate\" type=\"success\">\n <dk-icon icon=\"RefreshLeft\"></dk-icon>\n <span class=\"m-l-5px\">还原全部</span>\n </el-button>\n </div>\n </template>\n </el-popconfirm>\n <el-popconfirm\n confirm-button-text=\"清空\"\n cancel-button-text=\"取消\"\n confirm-button-type=\"danger\"\n title=\"您确定要清空全部?\"\n @confirm=\"destroy(null)\"\n >\n <template #reference>\n <div class=\"m-l-5px\">\n <el-button class=\"table-header-operate\" type=\"danger\">\n <dk-icon icon=\"CloseBold\"></dk-icon>\n <span class=\"m-l-5px\">清空全部</span>\n </el-button>\n </div>\n </template>\n </el-popconfirm>\n <div class=\"table-search\">\n <el-input\n v-model=\"DkTable.recycleTable.filter!.quickSearch\"\n placeholder=\"请输入\"\n prefix-icon=\"Search\"\n @input=\"debounce(onSearchInput, 500)()\"\n />\n </div>\n </div>\n <!--表格s-->\n <el-table\n v-loading=\"DkTable.recycleTable.loading\"\n :data=\"DkTable.recycleTable.data\"\n class=\"dk-data-table\"\n @selection-change=\"onSelectionChange\"\n >\n <el-table-column\n v-for=\"(item, key) in DkTable.recycleTable.column\"\n v-bind=\"{ ...item }\"\n :key=\"key\"\n ></el-table-column>\n <!-- </template>-->\n <el-table-column label=\"操作\" align=\"right\">\n <template #default=\"{ row }\">\n <el-button\n icon=\"RefreshLeft\"\n type=\"primary\"\n size=\"small\"\n @click=\"restore([row.id])\"\n >\n 还原\n </el-button>\n <el-button\n icon=\"CloseBold\"\n type=\"danger\"\n size=\"small\"\n @click=\"destroy([row.id])\"\n >\n 销毁\n </el-button>\n </template>\n </el-table-column>\n </el-table>\n <!--表格e-->\n </dk-dialog>\n</template>\n<script setup lang=\"ts\">\nimport { computed, inject } from 'vue'\nimport dkTable from '../../utils/dkTable'\nimport { debounce } from '@vipl520/utils'\n\n\nconst DkTable = inject('DkTable') as dkTable\n\nconst onSearchInput = () => {\n DkTable.onTableHeaderAction('quick-recycle-search', {\n keyword: DkTable.recycleTable.filter!.quickSearch,\n })\n}\n\n/*\n * 记录选择的项\n */\nconst onSelectionChange = (selection: TableRow[]) => {\n DkTable.onTableAction('selection-recycle-change', selection)\n}\n\n/**\n * 销毁\n */\nconst destroy = (ids: any) => {\n DkTable.api.destroy(ids).then((res) => {\n DkTable.onTableHeaderAction('refreshRecycle')\n })\n}\n\n/**\n * 还原\n */\nconst restore = (ids: any) => {\n DkTable.api.restore(ids).then((res) => {\n DkTable.onTableHeaderAction('refreshRecycle')\n })\n}\n\nconst getSelectionIds = () => {\n const ids: string[] = []\n DkTable.recycleTable.selection?.forEach((item) => {\n ids.push(item[DkTable.recycleTable.pk!])\n })\n return ids\n}\n\nconst restoreSelect = () => {\n restore(getSelectionIds())\n}\n\nconst destroySelect = () => {\n destroy(getSelectionIds())\n}\n\nconst enableBatchOpt = computed(\n () => DkTable.recycleTable.selection!.length > 0\n)\n</script>\n<style scoped></style>\n"],"names":["__MACROS_defineComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,eAAA;AACR,CAAC,CAAA,CAAA;;;;AAuHD,IAAM,MAAA,OAAA,GAAU,OAAO,SAAS,CAAA,CAAA;AAEhC,IAAA,MAAM,gBAAgB,MAAM;AAC1B,MAAA,OAAA,CAAQ,oBAAoB,sBAAwB,EAAA;AAAA,QAClD,OAAA,EAAS,OAAQ,CAAA,YAAA,CAAa,MAAQ,CAAA,WAAA;AAAA,OACvC,CAAA,CAAA;AAAA,KACH,CAAA;AAKA,IAAM,MAAA,iBAAA,GAAoB,CAAC,SAA0B,KAAA;AACnD,MAAQ,OAAA,CAAA,aAAA,CAAc,4BAA4B,SAAS,CAAA,CAAA;AAAA,KAC7D,CAAA;AAKA,IAAM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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -55,7 +55,16 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
55
55
|
},
|
56
56
|
buttons: {
|
57
57
|
default: () => {
|
58
|
-
return [
|
58
|
+
return [
|
59
|
+
"refresh",
|
60
|
+
"add",
|
61
|
+
"export_csv",
|
62
|
+
"edit",
|
63
|
+
"delete",
|
64
|
+
"comSearch",
|
65
|
+
"quickSearch",
|
66
|
+
"columnDisplay"
|
67
|
+
];
|
59
68
|
},
|
60
69
|
type: Array
|
61
70
|
},
|
@@ -71,7 +80,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
71
80
|
const columnDisplayArr = [];
|
72
81
|
let cachedTableData = {};
|
73
82
|
if (DkTable.url) {
|
74
|
-
cachedTableData = JSON.parse(
|
83
|
+
cachedTableData = JSON.parse(
|
84
|
+
storage.get(DkTable.url + "show_column") || "{}"
|
85
|
+
);
|
75
86
|
}
|
76
87
|
for (const item of DkTable.table.column) {
|
77
88
|
if (cachedTableData[item.prop] !== void 0) {
|
@@ -133,7 +144,10 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
133
144
|
1536
|
134
145
|
/* NEED_PATCH, DYNAMIC_SLOTS */
|
135
146
|
), [
|
136
|
-
[
|
147
|
+
[
|
148
|
+
vShow,
|
149
|
+
props.buttons.includes("comSearch") && unref(DkTable).table.showComSearch
|
150
|
+
]
|
137
151
|
])
|
138
152
|
]),
|
139
153
|
_: 3
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"header.vue2.mjs","sources":["../../../../src/table/src/components/header.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkTableHeader',\n});\n</script>\n<template>\n <el-collapse-transition>\n <ComSearch v-show=\"props.buttons.includes('comSearch') && DkTable.table.showComSearch\">\n <template v-for=\"(slot, idx) in $slots\" :key=\"idx\" #[idx]>\n <slot :name=\"idx\"></slot>\n </template>\n </ComSearch>\n </el-collapse-transition>\n <div class=\"dk-table-header\">\n <slot name=\"refreshPrepend\"></slot>\n <el-tooltip v-if=\"props.buttons.includes('refresh')\" content=\"刷新\" placement=\"top\">\n <el-button v-blur class=\"table-header-operate\" type=\"info\" @click=\"onAction('refresh', { loading: true })\">\n <dk-icon icon=\"Refresh\"></dk-icon>\n </el-button>\n </el-tooltip>\n <slot name=\"refreshAppend\"></slot>\n <el-tooltip v-if=\"props.buttons.includes('add') && DkTable.auth('add')\" content=\"新增\" placement=\"top\">\n <el-button v-blur class=\"table-header-operate\" type=\"primary\" @click=\"onAction('add')\">\n <dk-icon icon=\"typcn:plus\"></dk-icon>\n <span class=\"m-l-5px\">新增</span>\n </el-button>\n </el-tooltip>\n <slot name=\"AddButtonAppend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('export_csv') && DkTable.auth('export_csv')\"\n content=\"导出选中行\"\n placement=\"top\"\n >\n <el-button\n v-blur\n :disabled=\"!enableBatchOpt\"\n class=\"table-header-operate\"\n type=\"primary\"\n @click=\"onAction('export_csv')\"\n >\n <dk-icon icon=\"typcn:download\"></dk-icon>\n <span class=\"m-l-5px\">导出</span>\n </el-button>\n </el-tooltip>\n <slot name=\"ExportButtonAppend\"></slot>\n <el-tooltip v-if=\"props.buttons.includes('edit') && DkTable.auth('edit')\" content=\"编辑选中行\" placement=\"top\">\n <el-button\n v-blur\n :disabled=\"!enableBatchOpt\"\n class=\"table-header-operate\"\n type=\"primary\"\n @click=\"onAction('edit')\"\n >\n <dk-icon icon=\"typcn:edit\"></dk-icon>\n <span class=\"m-l-5px\">编辑</span>\n </el-button>\n </el-tooltip>\n <slot name=\"EditButtonAppend\"></slot>\n <el-popconfirm\n v-if=\"props.buttons.includes('delete') && DkTable.auth('del')\"\n confirm-button-text=\"删除\"\n cancel-button-text=\"取消\"\n confirm-button-type=\"danger\"\n title=\"您确定要删除所选记录吗?\"\n :disabled=\"!enableBatchOpt\"\n @confirm=\"onAction('delete')\"\n >\n <template #reference>\n <div class=\"m-l-5px\">\n <el-tooltip content=\"删除所选行\" placement=\"top\">\n <el-button v-blur :disabled=\"!enableBatchOpt\" class=\"table-header-operate\" type=\"danger\">\n <!-- <Icon name=\"fa fa-trash\" />-->\n <dk-icon icon=\"typcn:trash\"></dk-icon>\n <span class=\"m-l-5px\">删除</span>\n </el-button>\n </el-tooltip>\n </div>\n </template>\n </el-popconfirm>\n <slot name=\"DeleteButtonAppend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('unfold')\"\n :content=\"(DkTable.table.expandAll ? '收缩' : '展开') + '所有子菜单'\"\n placement=\"top\"\n >\n <el-button\n v-blur\n class=\"table-header-operate\"\n :type=\"DkTable.table.expandAll ? 'danger' : 'warning'\"\n @click=\"\n DkTable.onTableHeaderAction('unfold', {\n unfold: !DkTable.table.expandAll,\n })\n \"\n >\n <span class=\"table-header-operate-text\">\n {{ DkTable.table.expandAll ? '收缩所有' : '展开所有' }}\n </span>\n </el-button>\n </el-tooltip>\n <slot name=\"UnfoldButtonAppend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('recycle') && DkTable.auth('recycle')\"\n content=\"打开回收站\"\n placement=\"top\"\n >\n <el-button\n v-blur\n class=\"table-header-operate m-l-5px\"\n type=\"warning\"\n :loading=\"DkTable.recycleTable.showDialogLoading\"\n @click=\"onAction('recycle')\"\n >\n <span class=\"table-header-operate-text\"> 回收站 </span>\n </el-button>\n </el-tooltip>\n <slot name=\"RecycleButtonAppend\"></slot>\n <div class=\"table-search\">\n <div class=\"mr-1\">\n <el-input\n v-model=\"DkTable.table.filter!.quickSearch\"\n placeholder=\"请输入\"\n prefix-icon=\"Search\"\n :size=\"size\"\n @input=\"debounce(onSearchInput, 500)()\"\n />\n </div>\n <div class=\"table-search-button-group\">\n <el-dropdown v-if=\"props.buttons.includes('columnDisplay')\" :max-height=\"380\" :hide-on-click=\"false\">\n <el-button\n v-blur\n :size=\"size\"\n class=\"table-search-button-item\"\n :class=\"props.buttons.includes('comSearch') ? 'right-border' : ''\"\n >\n <dk-icon icon=\"Grid\"></dk-icon>\n </el-button>\n <template #dropdown>\n <el-dropdown-menu>\n <el-dropdown-item v-for=\"(item, idx) in columnDisplay\" :key=\"idx\">\n <el-checkbox\n v-if=\"item.prop\"\n :checked=\"!item.show\"\n :model-value=\"item.show\"\n :size=\"size\"\n :label=\"item.label\"\n @change=\"onChangeShowColumn($event, item.prop!)\"\n />\n </el-dropdown-item>\n </el-dropdown-menu>\n </template>\n </el-dropdown>\n <div>\n <el-tooltip\n v-if=\"props.buttons.includes('comSearch')\"\n :disabled=\"DkTable.table.showComSearch\"\n content=\"展开常规搜索\"\n placement=\"top\"\n >\n <el-button\n v-blur\n :size=\"size\"\n class=\"table-search-button-item\"\n @click=\"DkTable.table.showComSearch = !DkTable.table.showComSearch\"\n >\n <dk-icon icon=\"Search\"></dk-icon>\n </el-button>\n </el-tooltip>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { inject, computed } from 'vue'\nimport dkTable from '../../utils/dkTable'\nimport ComSearch from './ComSearch.vue'\nimport { debounce, storage } from '@vipl520/utils'\n\n\n\nconst DkTable = inject('DkTable') as dkTable\n\nconst props = defineProps({\n size: {\n default: 'small',\n type: String,\n },\n buttons: {\n default: () => {\n return ['refresh', 'add', 'export_csv', 'edit', 'delete', 'comSearch', 'quickSearch', 'columnDisplay']\n },\n type: Array,\n },\n quickSearchPlaceholder: {\n default: '快捷搜索',\n type: String,\n },\n})\n\nconst columnDisplay = computed(() => {\n const columnDisplayArr = []\n let cachedTableData: any = {}\n if (DkTable.url) {\n cachedTableData = JSON.parse(storage.get(DkTable.url + 'show_column') || '{}')\n }\n for (const item of DkTable.table.column) {\n if (cachedTableData[item.prop] !== undefined) {\n item.show = cachedTableData[item.prop]\n }\n // eslint-disable-next-line no-unused-expressions\n item.type === 'selection' || item.render === 'buttons' || item.enableColumnDisplayControl === false\n ? ''\n : columnDisplayArr.push(item)\n }\n return columnDisplayArr\n})\n\nconst enableBatchOpt = computed(() => DkTable.table.selection!.length > 0)\n\nconst onAction = (event: string, data: anyObj = {}) => {\n DkTable.onTableHeaderAction(event, data)\n}\n\nconst onSearchInput = () => {\n DkTable.onTableHeaderAction('quick-search', {\n keyword: DkTable.table.filter!.quickSearch,\n })\n}\n\nconst onChangeShowColumn = (value: string | number | boolean, field: string) => {\n DkTable.onTableHeaderAction('change-show-column', {\n field,\n value,\n })\n}\n</script>\n"],"names":["__MACROS_defineComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,eAAA;AACR,CAAC,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;AAkLD,IAAM,MAAA,OAAA,GAAU,OAAO,SAAS,CAAA,CAAA;AAmBhC,IAAM,MAAA,aAAA,GAAgB,SAAS,MAAM;AACnC,MAAA,MAAM,mBAAmB,EAAC,CAAA;AAC1B,MAAA,IAAI,kBAAuB,EAAC,CAAA;AAC5B,MAAA,IAAI,QAAQ,GAAK,EAAA;AACf,QAAkB,eAAA,GAAA,IAAA,CAAK,MAAM,OAAQ,CAAA,GAAA,CAAI,QAAQ,GAAM,GAAA,aAAa,KAAK,IAAI,CAAA,CAAA;AAAA,OAC/E;AACA,MAAW,KAAA,MAAA,IAAA,IAAQ,OAAQ,CAAA,KAAA,CAAM,MAAQ,EAAA;AACvC,QAAA,IAAI,eAAgB,CAAA,IAAA,CAAK,IAAI,CAAA,KAAM,KAAW,CAAA,EAAA;AAC5C,UAAK,IAAA,CAAA,IAAA,GAAO,eAAgB,CAAA,IAAA,CAAK,IAAI,CAAA,CAAA;AAAA,SACvC;AAEA,QAAK,IAAA,CAAA,IAAA,KAAS,WAAe,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;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"header.vue2.mjs","sources":["../../../../src/table/src/components/header.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkTableHeader',\n});\n</script>\n<template>\n <el-collapse-transition>\n <ComSearch\n v-show=\"\n props.buttons.includes('comSearch') && DkTable.table.showComSearch\n \"\n >\n <template v-for=\"(slot, idx) in $slots\" :key=\"idx\" #[idx]>\n <slot :name=\"idx\"></slot>\n </template>\n </ComSearch>\n </el-collapse-transition>\n <div class=\"dk-table-header\">\n <slot name=\"refreshPrepend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('refresh')\"\n content=\"刷新\"\n placement=\"top\"\n >\n <el-button\n v-blur\n class=\"table-header-operate\"\n type=\"info\"\n @click=\"onAction('refresh', { loading: true })\"\n >\n <dk-icon icon=\"Refresh\"></dk-icon>\n </el-button>\n </el-tooltip>\n <slot name=\"refreshAppend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('add') && DkTable.auth('add')\"\n content=\"新增\"\n placement=\"top\"\n >\n <el-button\n v-blur\n class=\"table-header-operate\"\n type=\"primary\"\n @click=\"onAction('add')\"\n >\n <dk-icon icon=\"typcn:plus\"></dk-icon>\n <span class=\"m-l-5px\">新增</span>\n </el-button>\n </el-tooltip>\n <slot name=\"AddButtonAppend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('export_csv') && DkTable.auth('export_csv')\"\n content=\"导出选中行\"\n placement=\"top\"\n >\n <el-button\n v-blur\n :disabled=\"!enableBatchOpt\"\n class=\"table-header-operate\"\n type=\"primary\"\n @click=\"onAction('export_csv')\"\n >\n <dk-icon icon=\"typcn:download\"></dk-icon>\n <span class=\"m-l-5px\">导出</span>\n </el-button>\n </el-tooltip>\n <slot name=\"ExportButtonAppend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('edit') && DkTable.auth('edit')\"\n content=\"编辑选中行\"\n placement=\"top\"\n >\n <el-button\n v-blur\n :disabled=\"!enableBatchOpt\"\n class=\"table-header-operate\"\n type=\"primary\"\n @click=\"onAction('edit')\"\n >\n <dk-icon icon=\"typcn:edit\"></dk-icon>\n <span class=\"m-l-5px\">编辑</span>\n </el-button>\n </el-tooltip>\n <slot name=\"EditButtonAppend\"></slot>\n <el-popconfirm\n v-if=\"props.buttons.includes('delete') && DkTable.auth('del')\"\n confirm-button-text=\"删除\"\n cancel-button-text=\"取消\"\n confirm-button-type=\"danger\"\n title=\"您确定要删除所选记录吗?\"\n :disabled=\"!enableBatchOpt\"\n @confirm=\"onAction('delete')\"\n >\n <template #reference>\n <div class=\"m-l-5px\">\n <el-tooltip content=\"删除所选行\" placement=\"top\">\n <el-button\n v-blur\n :disabled=\"!enableBatchOpt\"\n class=\"table-header-operate\"\n type=\"danger\"\n >\n <!-- <Icon name=\"fa fa-trash\" />-->\n <dk-icon icon=\"typcn:trash\"></dk-icon>\n <span class=\"m-l-5px\">删除</span>\n </el-button>\n </el-tooltip>\n </div>\n </template>\n </el-popconfirm>\n <slot name=\"DeleteButtonAppend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('unfold')\"\n :content=\"(DkTable.table.expandAll ? '收缩' : '展开') + '所有子菜单'\"\n placement=\"top\"\n >\n <el-button\n v-blur\n class=\"table-header-operate\"\n :type=\"DkTable.table.expandAll ? 'danger' : 'warning'\"\n @click=\"\n DkTable.onTableHeaderAction('unfold', {\n unfold: !DkTable.table.expandAll,\n })\n \"\n >\n <span class=\"table-header-operate-text\">\n {{ DkTable.table.expandAll ? '收缩所有' : '展开所有' }}\n </span>\n </el-button>\n </el-tooltip>\n <slot name=\"UnfoldButtonAppend\"></slot>\n <el-tooltip\n v-if=\"props.buttons.includes('recycle') && DkTable.auth('recycle')\"\n content=\"打开回收站\"\n placement=\"top\"\n >\n <el-button\n v-blur\n class=\"table-header-operate m-l-5px\"\n type=\"warning\"\n :loading=\"DkTable.recycleTable.showDialogLoading\"\n @click=\"onAction('recycle')\"\n >\n <span class=\"table-header-operate-text\"> 回收站 </span>\n </el-button>\n </el-tooltip>\n <slot name=\"RecycleButtonAppend\"></slot>\n <div class=\"table-search\">\n <div class=\"mr-1\">\n <el-input\n v-model=\"DkTable.table.filter!.quickSearch\"\n placeholder=\"请输入\"\n prefix-icon=\"Search\"\n :size=\"size\"\n @input=\"debounce(onSearchInput, 500)()\"\n />\n </div>\n <div class=\"table-search-button-group\">\n <el-dropdown\n v-if=\"props.buttons.includes('columnDisplay')\"\n :max-height=\"380\"\n :hide-on-click=\"false\"\n >\n <el-button\n v-blur\n :size=\"size\"\n class=\"table-search-button-item\"\n :class=\"props.buttons.includes('comSearch') ? 'right-border' : ''\"\n >\n <dk-icon icon=\"Grid\"></dk-icon>\n </el-button>\n <template #dropdown>\n <el-dropdown-menu>\n <el-dropdown-item v-for=\"(item, idx) in columnDisplay\" :key=\"idx\">\n <el-checkbox\n v-if=\"item.prop\"\n :checked=\"!item.show\"\n :model-value=\"item.show\"\n :size=\"size\"\n :label=\"item.label\"\n @change=\"onChangeShowColumn($event, item.prop!)\"\n />\n </el-dropdown-item>\n </el-dropdown-menu>\n </template>\n </el-dropdown>\n <div>\n <el-tooltip\n v-if=\"props.buttons.includes('comSearch')\"\n :disabled=\"DkTable.table.showComSearch\"\n content=\"展开常规搜索\"\n placement=\"top\"\n >\n <el-button\n v-blur\n :size=\"size\"\n class=\"table-search-button-item\"\n @click=\"\n DkTable.table.showComSearch = !DkTable.table.showComSearch\n \"\n >\n <dk-icon icon=\"Search\"></dk-icon>\n </el-button>\n </el-tooltip>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script setup lang=\"ts\">\nimport { inject, computed } from 'vue'\nimport dkTable from '../../utils/dkTable'\nimport ComSearch from './ComSearch.vue'\nimport { debounce, storage } from '@vipl520/utils'\n\n\n\nconst DkTable = inject('DkTable') as dkTable\n\nconst props = defineProps({\n size: {\n default: 'small',\n type: String,\n },\n buttons: {\n default: () => {\n return [\n 'refresh',\n 'add',\n 'export_csv',\n 'edit',\n 'delete',\n 'comSearch',\n 'quickSearch',\n 'columnDisplay',\n ]\n },\n type: Array,\n },\n quickSearchPlaceholder: {\n default: '快捷搜索',\n type: String,\n },\n})\n\nconst columnDisplay = computed(() => {\n const columnDisplayArr = []\n let cachedTableData: any = {}\n if (DkTable.url) {\n cachedTableData = JSON.parse(\n storage.get(DkTable.url + 'show_column') || '{}'\n )\n }\n for (const item of DkTable.table.column) {\n if (cachedTableData[item.prop] !== undefined) {\n item.show = cachedTableData[item.prop]\n }\n // eslint-disable-next-line no-unused-expressions\n item.type === 'selection' ||\n item.render === 'buttons' ||\n item.enableColumnDisplayControl === false\n ? ''\n : columnDisplayArr.push(item)\n }\n return columnDisplayArr\n})\n\nconst enableBatchOpt = computed(() => DkTable.table.selection!.length > 0)\n\nconst onAction = (event: string, data: anyObj = {}) => {\n DkTable.onTableHeaderAction(event, data)\n}\n\nconst onSearchInput = () => {\n DkTable.onTableHeaderAction('quick-search', {\n keyword: DkTable.table.filter!.quickSearch,\n })\n}\n\nconst onChangeShowColumn = (\n value: string | number | boolean,\n field: string\n) => {\n DkTable.onTableHeaderAction('change-show-column', {\n field,\n value,\n })\n}\n</script>\n"],"names":["__MACROS_defineComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,eAAA;AACR,CAAC,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuND,IAAM,MAAA,OAAA,GAAU,OAAO,SAAS,CAAA,CAAA;AA4BhC,IAAM,MAAA,aAAA,GAAgB,SAAS,MAAM;AACnC,MAAA,MAAM,mBAAmB,EAAC,CAAA;AAC1B,MAAA,IAAI,kBAAuB,EAAC,CAAA;AAC5B,MAAA,IAAI,QAAQ,GAAK,EAAA;AACf,QAAA,eAAA,G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,CAAA;AAAA,KACH,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/es/table/src/props.mjs
CHANGED
@@ -21,7 +21,17 @@ const tableProps = {
|
|
21
21
|
},
|
22
22
|
buttons: {
|
23
23
|
default: () => {
|
24
|
-
return [
|
24
|
+
return [
|
25
|
+
"refresh",
|
26
|
+
"add",
|
27
|
+
"export_csv",
|
28
|
+
"edit",
|
29
|
+
"delete",
|
30
|
+
"comSearch",
|
31
|
+
"quickSearch",
|
32
|
+
"columnDisplay",
|
33
|
+
"recycle"
|
34
|
+
];
|
25
35
|
},
|
26
36
|
type: Array
|
27
37
|
},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"props.mjs","sources":["../../../src/table/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n// import ElTableNext from 'el-table-next'\n\nexport const tableProps = {\n tableApi: {\n default: '',\n type: String,\n },\n cacheTable: {\n default: true,\n type: Boolean,\n },\n tableBefore: {\n default: () => {\n return {}\n },\n type: Object,\n },\n tableAfter: {\n default: () => {\n return {}\n },\n type: Object,\n },\n buttons: {\n default: () => {\n return ['refresh'
|
1
|
+
{"version":3,"file":"props.mjs","sources":["../../../src/table/src/props.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n// import ElTableNext from 'el-table-next'\n\nexport const tableProps = {\n tableApi: {\n default: '',\n type: String,\n },\n cacheTable: {\n default: true,\n type: Boolean,\n },\n tableBefore: {\n default: () => {\n return {}\n },\n type: Object,\n },\n tableAfter: {\n default: () => {\n return {}\n },\n type: Object,\n },\n buttons: {\n default: () => {\n return [\n 'refresh',\n 'add',\n 'export_csv',\n 'edit',\n 'delete',\n 'comSearch',\n 'quickSearch',\n 'columnDisplay',\n 'recycle',\n ]\n },\n type: Array,\n },\n hideButtons: {\n default: () => {\n return []\n },\n type: Array,\n },\n}\n\nexport type TableProps = ExtractPropTypes<typeof tableProps>\n"],"names":[],"mappings":"AAGO,MAAM,UAAa,GAAA;AAAA,EACxB,QAAU,EAAA;AAAA,IACR,OAAS,EAAA,EAAA;AAAA,IACT,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,UAAY,EAAA;AAAA,IACV,OAAS,EAAA,IAAA;AAAA,IACT,IAAM,EAAA,OAAA;AAAA,GACR;AAAA,EACA,WAAa,EAAA;AAAA,IACX,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,UAAY,EAAA;AAAA,IACV,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,MAAA;AAAA,GACR;AAAA,EACA,OAAS,EAAA;AAAA,IACP,SAAS,MAAM;AACb,MAAO,OAAA;AAAA,QACL,SAAA;AAAA,QACA,KAAA;AAAA,QACA,YAAA;AAAA,QACA,MAAA;AAAA,QACA,QAAA;AAAA,QACA,WAAA;AAAA,QACA,aAAA;AAAA,QACA,eAAA;AAAA,QACA,SAAA;AAAA,OACF,CAAA;AAAA,KACF;AAAA,IACA,IAAM,EAAA,KAAA;AAAA,GACR;AAAA,EACA,WAAa,EAAA;AAAA,IACX,SAAS,MAAM;AACb,MAAA,OAAO,EAAC,CAAA;AAAA,KACV;AAAA,IACA,IAAM,EAAA,KAAA;AAAA,GACR;AACF;;;;"}
|
@@ -17,7 +17,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
17
|
const props = __props;
|
18
18
|
const FormRef = ref();
|
19
19
|
const TableRef = ref();
|
20
|
-
const DkTable = new dkTable(
|
20
|
+
const DkTable = new dkTable(
|
21
|
+
props.tableApi,
|
22
|
+
props.tableBefore,
|
23
|
+
props.tableAfter
|
24
|
+
);
|
21
25
|
provide("DkTable", DkTable);
|
22
26
|
onMounted(() => {
|
23
27
|
DkTable.getTable(props.cacheTable)?.then(() => {
|
@@ -32,7 +36,11 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
32
36
|
DkTable.form.ref = FormRef.value;
|
33
37
|
});
|
34
38
|
const effectiveButtons = computed(() => {
|
35
|
-
return [
|
39
|
+
return [
|
40
|
+
...new Set(
|
41
|
+
props.buttons.filter((button) => !props.hideButtons.includes(button))
|
42
|
+
)
|
43
|
+
];
|
36
44
|
});
|
37
45
|
const onTableSizeChange = (val) => {
|
38
46
|
DkTable.onTableAction("page-size-change", { size: val });
|
@@ -72,7 +80,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
72
80
|
}
|
73
81
|
};
|
74
82
|
const onSelectAll = (selection) => {
|
75
|
-
if (isSelectAll(
|
83
|
+
if (isSelectAll(
|
84
|
+
selection.map((row) => row[DkTable.table.pk].toString())
|
85
|
+
)) {
|
76
86
|
selection.map((row) => {
|
77
87
|
if (row.children) {
|
78
88
|
selectChildren(row.children, true);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"table.vue2.mjs","sources":["../../../src/table/src/table.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkTable',\n});\n</script>\n<template>\n <div class=\"dk-table\">\n <!--顶部菜单-->\n <DkTableHeader size=\"default\" :buttons=\"effectiveButtons\">\n <template v-for=\"(slot, idx) in $slots\" :key=\"idx\" #[idx]>\n <slot :name=\"idx\"></slot>\n </template>\n </DkTableHeader>\n <!--表格-->\n <el-table\n ref=\"TableRef\"\n v-loading=\"DkTable.table.loading\"\n class=\"dk-data-table w100\"\n header-cell-class-name=\"table-header-cell\"\n :default-expand-all=\"DkTable.table.expandAll\"\n :data=\"DkTable.table.data\"\n :row-key=\"DkTable.table.pk\"\n stripe\n v-bind=\"$attrs\"\n @select-all=\"onSelectAll\"\n @select=\"onSelect\"\n @selection-change=\"onSelectionChange\"\n @sort-change=\"onSortChange\"\n @cell-dblclick=\"ondblclick\"\n >\n <slot name=\"columnPrepend\"></slot>\n <template v-for=\"(item, key) in DkTable.table.column\">\n <template v-if=\"item.show !== false\">\n <!-- 渲染为 slot -->\n <el-table-column v-if=\"item.slotName\" :key=\"key\" v-bind=\"{ ...item }\">\n <template #default=\"scope\">\n <slot :name=\"item.slotName\" v-bind=\"scope\">\n <dk-field-render\n :key=\"\n key +\n '-' +\n scope.$index +\n '-' +\n item.render +\n '-' +\n (item.prop ? '-' + item.prop + '-' + scope.row[item.prop] : '')\n \"\n :field=\"item\"\n :row=\"scope.row\"\n :column=\"scope.column\"\n :index=\"scope.$index\"\n />\n </slot>\n </template>\n </el-table-column>\n <el-table-column v-else :key=\"key + 'default'\" v-bind=\"{ ...item }\"></el-table-column>\n </template>\n </template>\n <slot name=\"columnAppend\"></slot>\n </el-table>\n\n <div class=\"table-pagination\">\n <el-pagination\n :current-page=\"DkTable.table.filter!.page\"\n :page-size=\"DkTable.table.filter!.limit\"\n :page-sizes=\"pageSizes\"\n background\n :layout=\"'sizes,total, ->, prev, pager, next, jumper'\"\n :total=\"DkTable.table.total\"\n @size-change=\"onTableSizeChange\"\n @current-change=\"onTableCurrentChange\"\n ></el-pagination>\n </div>\n </div>\n <dk-form ref=\"FormRef\" :is-dialog=\"true\" @submit=\"DkTable.onSubmit\">\n <template #buttons>\n <el-button type=\"primary\" :loading=\"DkTable.form.ref.buttonLoading\" @click=\"DkTable.form.ref.checkForm\">\n {{ DkTable.form.operateIds!.length > 0 ? '保存并编辑下一项' : '提交' }}\n </el-button>\n </template>\n </dk-form>\n <RecycleDialog></RecycleDialog>\n</template>\n\n<script lang=\"ts\" setup>\nimport { ref, onMounted, nextTick, provide, computed } from 'vue'\nimport { tableProps } from './props'\nimport DkTableClass from '../utils/dkTable'\nimport DkTableHeader from './components/header.vue'\nimport DkFieldRender from './components/FieldRender.vue'\nimport RecycleDialog from './components/RecycleDialog.vue'\n\n\n\nconst props = defineProps(tableProps)\nconst FormRef = ref()\n// 表格的Ref\nconst TableRef = ref()\n// 表格的对象\nconst DkTable = new DkTableClass(props.tableApi, props.tableBefore, props.tableAfter)\n\nprovide('DkTable', DkTable)\n// 获取表格信息\nonMounted(() => {\n DkTable.getTable(props.cacheTable)?.then(() => {\n DkTable.getIndex()?.then(() => {\n nextTick(() => {\n DkTable.dragSort()\n })\n })\n DkTable.initComSearch()\n })\n DkTable.table.ref = TableRef.value\n DkTable.form.ref = FormRef.value\n})\n\nconst effectiveButtons = computed(() => {\n return [...new Set(props.buttons.filter((button) => !props.hideButtons.includes(button)))]\n})\n\nconst onTableSizeChange = (val: number) => {\n DkTable.onTableAction('page-size-change', { size: val })\n}\n\nconst onTableCurrentChange = (val: number) => {\n DkTable.onTableAction('current-page-change', { page: val })\n}\n\n// 双击\nconst ondblclick = (row: any) => {\n DkTable.toggleForm('Edit', [row[DkTable.table.pk!]])\n}\n\nconst onSortChange = ({ order, prop }: { order: string; prop: string }) => {\n DkTable.onTableAction('sort-change', {\n prop,\n order: order ? (order == 'ascending' ? 'asc' : 'desc') : '',\n })\n}\n\nconst pageSizes = computed(() => {\n const defaultSizes = [10, 20, 50, 100]\n if (DkTable.table.filter!.limit) {\n if (!defaultSizes.includes(DkTable.table.filter!.limit)) {\n defaultSizes.push(DkTable.table.filter!.limit)\n }\n }\n return defaultSizes\n})\n\n/*\n * 手动选择时,同时选择子级\n */\nconst onSelect = (selection: TableRow[], row: TableRow) => {\n if (\n selection.some((item: TableRow) => {\n return row[DkTable.table.pk!] === item[DkTable.table.pk!]\n })\n ) {\n if (row.children) {\n selectChildren(row.children, true)\n }\n } else {\n if (row.children) {\n selectChildren(row.children, false)\n }\n }\n}\n\n/**\n /*\n * 全选和取消全选\n * 实现子级同时选择和取消选中\n */\nconst onSelectAll = (selection: TableRow[]) => {\n if (isSelectAll(selection.map((row: TableRow) => row[DkTable.table.pk!].toString()))) {\n // eslint-disable-next-line array-callback-return\n selection.map((row: TableRow) => {\n if (row.children) {\n selectChildren(row.children, true)\n }\n })\n } else {\n TableRef.value?.clearSelection()\n }\n}\n\n/*\n * 是否是全选操作\n * 只检查第一个元素是否被选择\n * 全选时:selectIds为所有元素的id\n * 取消全选时:selectIds为所有子元素的id\n */\nconst isSelectAll = (selectIds: string[]) => {\n const data = DkTable.table.data as TableRow[]\n // eslint-disable-next-line no-unreachable-loop\n for (const key in data) {\n return selectIds.includes(data[key][DkTable.table.pk!].toString())\n }\n return false\n}\n\n/*\n * 选择子项-递归\n */\nconst selectChildren = (children: TableRow[], type: boolean) => {\n // eslint-disable-next-line array-callback-return\n children.map((j: TableRow) => {\n toggleSelection(j, type)\n if (j.children) {\n selectChildren(j.children, type)\n }\n })\n}\n\n/*\n * 执行选择操作\n */\nconst toggleSelection = (row: TableRow, type: boolean) => {\n if (row) {\n nextTick(() => {\n TableRef.value?.toggleRowSelection(row, type)\n })\n }\n}\n\n/*\n * 记录选择的项\n */\nconst onSelectionChange = (selection: TableRow[]) => {\n DkTable.onTableAction('selection-change', selection)\n}\n\n/*\n * 设置折叠所有-递归\n */\nconst setUnFoldAll = (children: TableRow[], unfold: boolean) => {\n for (const key in children) {\n TableRef.value?.toggleRowExpansion(children[key], unfold)\n if (children[key].children) {\n setUnFoldAll(children[key].children!, unfold)\n }\n }\n}\n\n/*\n * 折叠所有\n */\nconst unFoldAll = (unfold: boolean) => {\n setUnFoldAll(DkTable.table.data!, unfold)\n}\n\nconst slotNames = computed(() => {\n const column = DkTable.table.column\n const slotNames = []\n for (let i = 0; i < column.length; i++) {\n if (column[i].slotName) {\n slotNames.push(column[i].slotName)\n }\n }\n return slotNames\n})\n\nonMounted(() => {\n // injectTablePrimaryMethods()\n})\n\ndefineExpose({\n DkTable,\n TableRef,\n FormRef,\n})\n</script>\n<style lang=\"scss\"></style>\n"],"names":["__MACROS_defineComponent","DkTableClass","slotNames"],"mappings":";;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,SAAA;AACR,CAAC,CAAA,CAAA;;;;;;AA4FD,IAAA,MAAM,UAAU,GAAI,EAAA,CAAA;AAEpB,IAAA,MAAM,WAAW,GAAI,EAAA,CAAA;AAErB,IAAM,MAAA,OAAA,GAAU,IAAIC,OAAa,CAAA,KAAA,CAAM,UAAU,KAAM,CAAA,WAAA,EAAa,MAAM,UAAU,CAAA,CAAA;AAEpF,IAAA,OAAA,CAAQ,WAAW,OAAO,CAAA,CAAA;AAE1B,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,OAAA,CAAQ,QAAS,CAAA,KAAA,CAAM,UAAU,CAAA,EAAG,KAAK,MAAM;AAC7C,QAAQ,OAAA,CAAA,QAAA,EAAY,EAAA,IAAA,CAAK,MAAM;AAC7B,UAAA,QAAA,CAAS,MAAM;AACb,YAAA,OAAA,CAAQ,QAAS,EAAA,CAAA;AAAA,WAClB,CAAA,CAAA;AAAA,SACF,CAAA,CAAA;AACD,QAAA,OAAA,CAAQ,aAAc,EAAA,CAAA;AAAA,OACvB,CAAA,CAAA;AACD,MAAQ,OAAA,CAAA,KAAA,CAAM,MAAM,QAAS,CAAA,KAAA,CAAA;AAC7B,MAAQ,OAAA,CAAA,IAAA,CAAK,MAAM,OAAQ,CAAA,KAAA,CAAA;AAAA,KAC5B,CAAA,CAAA;AAED,IAAM,MAAA,gBAAA,GAAmB,SAAS,MAAM;AACtC,MAAA,OAAO,CAAC,GAAG,IAAI,GAAI,CAAA,KAAA,CAAM,QAAQ,MA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AAG,CAAE,CAAA,QAAA,EAAW,MAAM,CAAA,CAAA;AAAA,SAC9C;AAAA,OACF;AAAA,KACF,CAAA;AAKA,IAAM,MAAA,SAAA,GAAY,CAAC,MAAoB,KAAA;AACrC,MAAa,YAAA,CAAA,OAAA,CAAQ,KAAM,CAAA,IAAA,EAAO,MAAM,CAAA,CAAA;AAAA,KAC1C,CAAA;AAEA,IAAM,MAAA,SAAA,GAAY,SAAS,MAAM;AAC/B,MAAM,MAAA,MAAA,GAAS,QAAQ,KAAM,CAAA,MAAA,CAAA;AAC7B,MAAA,MAAMC,aAAY,EAAC,CAAA;AACnB,MAAA,KAAA,IAAS,CAAI,GAAA,CAAA,EAAG,CAAI,GAAA,MAAA,CAAO,QAAQ,CAAK,EAAA,EAAA;AACtC,QAAI,IAAA,MAAA,CAAO,CAAC,CAAA,CAAE,QAAU,EAAA;AACtB,UAAAA,UAAU,CAAA,IAAA,CAAK,MAAO,CAAA,CAAC,EAAE,QAAQ,CAAA,CAAA;AAAA,SACnC;AAAA,OACF;AACA,MAAOA,OAAAA,UAAAA,CAAAA;AAAA,KACR,CAAA,CAAA;AAED,IAAA,SAAA,CAAU,MAAM;AAAA,KAEf,CAAA,CAAA;AAED,IAAa,QAAA,CAAA;AAAA,MACX,OAAA;AAAA,MACA,QAAA;AAAA,MACA,OAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
1
|
+
{"version":3,"file":"table.vue2.mjs","sources":["../../../src/table/src/table.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { defineComponent as __MACROS_defineComponent } from \"vue\";\nexport default /*#__PURE__*/ __MACROS_defineComponent({\n name: 'DkTable',\n});\n</script>\n<template>\n <div class=\"dk-table\">\n <!--顶部菜单-->\n <DkTableHeader size=\"default\" :buttons=\"effectiveButtons\">\n <template v-for=\"(slot, idx) in $slots\" :key=\"idx\" #[idx]>\n <slot :name=\"idx\"></slot>\n </template>\n </DkTableHeader>\n <!--表格-->\n <el-table\n ref=\"TableRef\"\n v-loading=\"DkTable.table.loading\"\n class=\"dk-data-table w100\"\n header-cell-class-name=\"table-header-cell\"\n :default-expand-all=\"DkTable.table.expandAll\"\n :data=\"DkTable.table.data\"\n :row-key=\"DkTable.table.pk\"\n stripe\n v-bind=\"$attrs\"\n @select-all=\"onSelectAll\"\n @select=\"onSelect\"\n @selection-change=\"onSelectionChange\"\n @sort-change=\"onSortChange\"\n @cell-dblclick=\"ondblclick\"\n >\n <slot name=\"columnPrepend\"></slot>\n <template v-for=\"(item, key) in DkTable.table.column\">\n <template v-if=\"item.show !== false\">\n <!-- 渲染为 slot -->\n <el-table-column v-if=\"item.slotName\" :key=\"key\" v-bind=\"{ ...item }\">\n <template #default=\"scope\">\n <slot :name=\"item.slotName\" v-bind=\"scope\">\n <dk-field-render\n :key=\"\n key +\n '-' +\n scope.$index +\n '-' +\n item.render +\n '-' +\n (item.prop\n ? '-' + item.prop + '-' + scope.row[item.prop]\n : '')\n \"\n :field=\"item\"\n :row=\"scope.row\"\n :column=\"scope.column\"\n :index=\"scope.$index\"\n />\n </slot>\n </template>\n </el-table-column>\n <el-table-column\n v-else\n :key=\"key + 'default'\"\n v-bind=\"{ ...item }\"\n ></el-table-column>\n </template>\n </template>\n <slot name=\"columnAppend\"></slot>\n </el-table>\n\n <div class=\"table-pagination\">\n <el-pagination\n :current-page=\"DkTable.table.filter!.page\"\n :page-size=\"DkTable.table.filter!.limit\"\n :page-sizes=\"pageSizes\"\n background\n :layout=\"'sizes,total, ->, prev, pager, next, jumper'\"\n :total=\"DkTable.table.total\"\n @size-change=\"onTableSizeChange\"\n @current-change=\"onTableCurrentChange\"\n ></el-pagination>\n </div>\n </div>\n <dk-form ref=\"FormRef\" :is-dialog=\"true\" @submit=\"DkTable.onSubmit\">\n <template #buttons>\n <el-button\n type=\"primary\"\n :loading=\"DkTable.form.ref.buttonLoading\"\n @click=\"DkTable.form.ref.checkForm\"\n >\n {{ DkTable.form.operateIds!.length > 0 ? '保存并编辑下一项' : '提交' }}\n </el-button>\n </template>\n </dk-form>\n <RecycleDialog></RecycleDialog>\n</template>\n\n<script lang=\"ts\" setup>\nimport { ref, onMounted, nextTick, provide, computed } from 'vue'\nimport { tableProps } from './props'\nimport DkTableClass from '../utils/dkTable'\nimport DkTableHeader from './components/header.vue'\nimport DkFieldRender from './components/FieldRender.vue'\nimport RecycleDialog from './components/RecycleDialog.vue'\n\n\n\nconst props = defineProps(tableProps)\nconst FormRef = ref()\n// 表格的Ref\nconst TableRef = ref()\n// 表格的对象\nconst DkTable = new DkTableClass(\n props.tableApi,\n props.tableBefore,\n props.tableAfter\n)\n\nprovide('DkTable', DkTable)\n// 获取表格信息\nonMounted(() => {\n DkTable.getTable(props.cacheTable)?.then(() => {\n DkTable.getIndex()?.then(() => {\n nextTick(() => {\n DkTable.dragSort()\n })\n })\n DkTable.initComSearch()\n })\n DkTable.table.ref = TableRef.value\n DkTable.form.ref = FormRef.value\n})\n\nconst effectiveButtons = computed(() => {\n return [\n ...new Set(\n props.buttons.filter((button) => !props.hideButtons.includes(button))\n ),\n ]\n})\n\nconst onTableSizeChange = (val: number) => {\n DkTable.onTableAction('page-size-change', { size: val })\n}\n\nconst onTableCurrentChange = (val: number) => {\n DkTable.onTableAction('current-page-change', { page: val })\n}\n\n// 双击\nconst ondblclick = (row: any) => {\n DkTable.toggleForm('Edit', [row[DkTable.table.pk!]])\n}\n\nconst onSortChange = ({ order, prop }: { order: string; prop: string }) => {\n DkTable.onTableAction('sort-change', {\n prop,\n order: order ? (order == 'ascending' ? 'asc' : 'desc') : '',\n })\n}\n\nconst pageSizes = computed(() => {\n const defaultSizes = [10, 20, 50, 100]\n if (DkTable.table.filter!.limit) {\n if (!defaultSizes.includes(DkTable.table.filter!.limit)) {\n defaultSizes.push(DkTable.table.filter!.limit)\n }\n }\n return defaultSizes\n})\n\n/*\n * 手动选择时,同时选择子级\n */\nconst onSelect = (selection: TableRow[], row: TableRow) => {\n if (\n selection.some((item: TableRow) => {\n return row[DkTable.table.pk!] === item[DkTable.table.pk!]\n })\n ) {\n if (row.children) {\n selectChildren(row.children, true)\n }\n } else {\n if (row.children) {\n selectChildren(row.children, false)\n }\n }\n}\n\n/**\n /*\n * 全选和取消全选\n * 实现子级同时选择和取消选中\n */\nconst onSelectAll = (selection: TableRow[]) => {\n if (\n isSelectAll(\n selection.map((row: TableRow) => row[DkTable.table.pk!].toString())\n )\n ) {\n // eslint-disable-next-line array-callback-return\n selection.map((row: TableRow) => {\n if (row.children) {\n selectChildren(row.children, true)\n }\n })\n } else {\n TableRef.value?.clearSelection()\n }\n}\n\n/*\n * 是否是全选操作\n * 只检查第一个元素是否被选择\n * 全选时:selectIds为所有元素的id\n * 取消全选时:selectIds为所有子元素的id\n */\nconst isSelectAll = (selectIds: string[]) => {\n const data = DkTable.table.data as TableRow[]\n // eslint-disable-next-line no-unreachable-loop\n for (const key in data) {\n return selectIds.includes(data[key][DkTable.table.pk!].toString())\n }\n return false\n}\n\n/*\n * 选择子项-递归\n */\nconst selectChildren = (children: TableRow[], type: boolean) => {\n // eslint-disable-next-line array-callback-return\n children.map((j: TableRow) => {\n toggleSelection(j, type)\n if (j.children) {\n selectChildren(j.children, type)\n }\n })\n}\n\n/*\n * 执行选择操作\n */\nconst toggleSelection = (row: TableRow, type: boolean) => {\n if (row) {\n nextTick(() => {\n TableRef.value?.toggleRowSelection(row, type)\n })\n }\n}\n\n/*\n * 记录选择的项\n */\nconst onSelectionChange = (selection: TableRow[]) => {\n DkTable.onTableAction('selection-change', selection)\n}\n\n/*\n * 设置折叠所有-递归\n */\nconst setUnFoldAll = (children: TableRow[], unfold: boolean) => {\n for (const key in children) {\n TableRef.value?.toggleRowExpansion(children[key], unfold)\n if (children[key].children) {\n setUnFoldAll(children[key].children!, unfold)\n }\n }\n}\n\n/*\n * 折叠所有\n */\nconst unFoldAll = (unfold: boolean) => {\n setUnFoldAll(DkTable.table.data!, unfold)\n}\n\nconst slotNames = computed(() => {\n const column = DkTable.table.column\n const slotNames = []\n for (let i = 0; i < column.length; i++) {\n if (column[i].slotName) {\n slotNames.push(column[i].slotName)\n }\n }\n return slotNames\n})\n\nonMounted(() => {\n // injectTablePrimaryMethods()\n})\n\ndefineExpose({\n DkTable,\n TableRef,\n FormRef,\n})\n</script>\n<style lang=\"scss\"></style>\n"],"names":["__MACROS_defineComponent","DkTableClass","slotNames"],"mappings":";;;;;;;;;AAEA,MAA6B,cAAAA,eAAyB,CAAA;AAAA,EACpD,IAAM,EAAA,SAAA;AACR,CAAC,CAAA,CAAA;;;;;;AAsGD,IAAA,MAAM,UAAU,GAAI,EAAA,CAAA;AAEpB,IAAA,MAAM,WAAW,GAAI,EAAA,CAAA;AAErB,IAAA,MAAM,UAAU,IAAIC,OAAA;AAAA,MAClB,KAAM,CAAA,QAAA;AAAA,MACN,KAAM,CAAA,WAAA;AAAA,MACN,KAAM,CAAA,UAAA;AAAA,KACR,CAAA;AAEA,IAAA,OAAA,CAAQ,WAAW,OAAO,CAAA,CAAA;AAE1B,IAAA,SAAA,CAAU,MAAM;AACd,MAAA,OAAA,CAAQ,QAAS,CAAA,KAAA,CAAM,UAAU,CAAA,EAAG,KAAK,MAAM;AAC7C,QAAQ,OAAA,CAAA,QAAA,EAAY,EAAA,IAAA,CAAK,MAAM;AAC7B,UAAA,QAAA,CAAS,MAAM;AACb,YAAA,OAAA,CAAQ,QAAS,EAAA,CAAA;AAAA,WAClB,CAAA,CAAA;AAAA,SACF,CAAA,CAAA;AACD,QAAA,OAAA,CAAQ,aAAc,EAAA,CAAA;AAAA,OACvB,CAAA,CAAA;AACD,MAAQ,OAAA,CAAA,KAAA,CAAM,MAAM,QAAS,CAAA,KAAA,CAAA;AAC7B,MAAQ,OAAA,CAAA,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;;;;;;;;;;;;;;;;;"}
|
@@ -136,7 +136,10 @@ class dkTable {
|
|
136
136
|
if (res.data.pk) {
|
137
137
|
this.table.pk = res.data.pk;
|
138
138
|
}
|
139
|
-
storage.set(
|
139
|
+
storage.set(
|
140
|
+
this.api.actionUrl.get("table") + "_table",
|
141
|
+
JSON.stringify(res.data)
|
142
|
+
);
|
140
143
|
this.runAfter("getTable", { res });
|
141
144
|
}).finally(() => {
|
142
145
|
this.table.columnLoading = false;
|
@@ -147,9 +150,7 @@ class dkTable {
|
|
147
150
|
* 显示回收站
|
148
151
|
*/
|
149
152
|
async showRecycle() {
|
150
|
-
if (!this.runBefore("
|
151
|
-
return;
|
152
|
-
if (!this.runBefore("getRecycleTable"))
|
153
|
+
if (!this.runBefore("showRecycleTable"))
|
153
154
|
return;
|
154
155
|
this.recycleTable.showDialogLoading = true;
|
155
156
|
if (this.recycleTable.column.length <= 0) {
|
@@ -355,7 +356,9 @@ class dkTable {
|
|
355
356
|
exportCsv = () => {
|
356
357
|
const header = this.table.column;
|
357
358
|
const headerMap = new Map(
|
358
|
-
header.filter(
|
359
|
+
header.filter(
|
360
|
+
(item) => item !== void 0 && item.label !== void 0 && item.export
|
361
|
+
).map((item) => [item.label, item.prop])
|
359
362
|
);
|
360
363
|
const headerLabels = Array.from(headerMap.keys());
|
361
364
|
function jsonToCsv(data) {
|
@@ -382,7 +385,10 @@ class dkTable {
|
|
382
385
|
}
|
383
386
|
function downloadCsv(csvContent, fileName) {
|
384
387
|
const link = document.createElement("a");
|
385
|
-
link.setAttribute(
|
388
|
+
link.setAttribute(
|
389
|
+
"href",
|
390
|
+
"data:text/csv;charset=utf-8," + encodeURIComponent(csvContent)
|
391
|
+
);
|
386
392
|
link.setAttribute("download", fileName + ".csv");
|
387
393
|
document.body.appendChild(link);
|
388
394
|
link.click();
|
@@ -426,7 +432,11 @@ class dkTable {
|
|
426
432
|
const buttonsKey = getArrayKey(this.table.column, "render", "buttons");
|
427
433
|
if (buttonsKey === false)
|
428
434
|
return;
|
429
|
-
const moveButton = getArrayKey(
|
435
|
+
const moveButton = getArrayKey(
|
436
|
+
this.table.column[buttonsKey]?.buttons,
|
437
|
+
"render",
|
438
|
+
"moveButton"
|
439
|
+
);
|
430
440
|
if (moveButton === false)
|
431
441
|
return;
|
432
442
|
if (!this.table.ref) {
|
@@ -435,7 +445,9 @@ class dkTable {
|
|
435
445
|
);
|
436
446
|
return;
|
437
447
|
}
|
438
|
-
const el = this.table.ref.$el.querySelector(
|
448
|
+
const el = this.table.ref.$el.querySelector(
|
449
|
+
".el-table__body-wrapper .el-table__body tbody"
|
450
|
+
);
|
439
451
|
const disabledTip = this.table.column[buttonsKey].buttons[moveButton].disabledTip;
|
440
452
|
Sortable.create(el, {
|
441
453
|
animation: 200,
|
@@ -446,8 +458,14 @@ class dkTable {
|
|
446
458
|
},
|
447
459
|
onEnd: (evt) => {
|
448
460
|
this.table.column[buttonsKey].buttons[moveButton].disabledTip = disabledTip;
|
449
|
-
const moveRow = findIndexRow(
|
450
|
-
|
461
|
+
const moveRow = findIndexRow(
|
462
|
+
this.table.data,
|
463
|
+
evt.oldIndex
|
464
|
+
);
|
465
|
+
const replaceRow = findIndexRow(
|
466
|
+
this.table.data,
|
467
|
+
evt.newIndex
|
468
|
+
);
|
451
469
|
if (this.table.dragSortLimitField && moveRow[this.table.dragSortLimitField] != replaceRow[this.table.dragSortLimitField]) {
|
452
470
|
this.onTableHeaderAction("refresh", {});
|
453
471
|
ElNotification({
|
@@ -605,7 +623,10 @@ class dkTable {
|
|
605
623
|
const range = queryProp.split(",");
|
606
624
|
if (field[key].render == "datetime") {
|
607
625
|
if (range && range.length >= 2) {
|
608
|
-
form[prop + "-default"] = [
|
626
|
+
form[prop + "-default"] = [
|
627
|
+
new Date(range[0]),
|
628
|
+
new Date(range[1])
|
629
|
+
];
|
609
630
|
}
|
610
631
|
} else {
|
611
632
|
form[prop + "-start"] = range[0] ?? "";
|