liyu-pc-base 1.0.2
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/README.md +1 -0
- package/dist/SearchRender-4500beb0.js +39100 -0
- package/dist/api/api-model.js +32 -0
- package/dist/components/FormRender/utils.js +19 -0
- package/dist/components/index.js +2480 -0
- package/dist/components/remotePages/index.js +6851 -0
- package/dist/components/remotePages/utils.js +111 -0
- package/dist/index.js +28 -0
- package/dist/init-plugin-3dcd1452.js +144 -0
- package/dist/lodash-14d7cb6d.js +3679 -0
- package/dist/modal-tools-05a597e4.js +4271 -0
- package/dist/style.css +1 -0
- package/dist/utils/excel.js +93 -0
- package/dist/utils/function.js +251 -0
- package/dist/utils/hooks/useFetchData.js +89 -0
- package/dist/utils/hooks/useTableColumn.js +148 -0
- package/package.json +231 -0
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.my-card[data-v-25d1dc13],.my-card[data-v-52b515e0]{padding:20px;background-color:#f6f7f9}.card[data-v-8c25a993]{overflow:auto;max-height:300px;background:#f2f5f7}.condition-group[data-v-8c25a993]{padding:5px}.range[data-v-8c25a993]{margin-top:5px}.close-icon[data-v-8c25a993]{width:15px;margin-top:5px;margin-left:5px;color:red}.search-bar[data-v-8c25a993]{background:#f2f5f7;text-align:right}[data-v-8c25a993] .divider .ant-divider{margin:0}.cards[data-v-1f94c291] .ant-card-head{padding:0 8px;min-height:44px;background-color:#00000005}.num{display:inline-block}.dropdown{display:none}.table:hover .dropdown{display:inline-block}.table:hover .num{display:none}.collapses .ant-collapse-item .ant-collapse-content .ant-collapse-content-box{padding:0}*,:before,:after{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgba(0,0,0,0);--un-ring-shadow:0 0 rgba(0,0,0,0);--un-shadow-inset: ;--un-shadow:0 0 rgba(0,0,0,0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }::backdrop{--un-rotate:0;--un-rotate-x:0;--un-rotate-y:0;--un-rotate-z:0;--un-scale-x:1;--un-scale-y:1;--un-scale-z:1;--un-skew-x:0;--un-skew-y:0;--un-translate-x:0;--un-translate-y:0;--un-translate-z:0;--un-pan-x: ;--un-pan-y: ;--un-pinch-zoom: ;--un-scroll-snap-strictness:proximity;--un-ordinal: ;--un-slashed-zero: ;--un-numeric-figure: ;--un-numeric-spacing: ;--un-numeric-fraction: ;--un-border-spacing-x:0;--un-border-spacing-y:0;--un-ring-offset-shadow:0 0 rgba(0,0,0,0);--un-ring-shadow:0 0 rgba(0,0,0,0);--un-shadow-inset: ;--un-shadow:0 0 rgba(0,0,0,0);--un-ring-inset: ;--un-ring-offset-width:0px;--un-ring-offset-color:#fff;--un-ring-width:0px;--un-ring-color:rgba(147,197,253,.5);--un-blur: ;--un-brightness: ;--un-contrast: ;--un-drop-shadow: ;--un-grayscale: ;--un-hue-rotate: ;--un-invert: ;--un-saturate: ;--un-sepia: ;--un-backdrop-blur: ;--un-backdrop-brightness: ;--un-backdrop-contrast: ;--un-backdrop-grayscale: ;--un-backdrop-hue-rotate: ;--un-backdrop-invert: ;--un-backdrop-opacity: ;--un-backdrop-saturate: ;--un-backdrop-sepia: }.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.grid{display:grid}.block{display:block}.inline-block{display:inline-block}.hidden{display:none}.flex{display:flex}.table{display:table}.resize{resize:both}.break-all{word-break:break-all}.b,.border{border-width:1px}.px{padding-left:1rem;padding-right:1rem}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.attribute-table .ant-table-footer{padding:5px}.ant-calendar-picker[data-v-d71f8072]{width:100%!important}:root,:host{--w-e-textarea-bg-color: #fff;--w-e-textarea-color: #333;--w-e-textarea-border-color: #ccc;--w-e-textarea-slight-border-color: #e8e8e8;--w-e-textarea-slight-color: #d4d4d4;--w-e-textarea-slight-bg-color: #f5f2f0;--w-e-textarea-selected-border-color: #B4D5FF;--w-e-textarea-handler-bg-color: #4290f7;--w-e-toolbar-color: #595959;--w-e-toolbar-bg-color: #fff;--w-e-toolbar-active-color: #333;--w-e-toolbar-active-bg-color: #f1f1f1;--w-e-toolbar-disabled-color: #999;--w-e-toolbar-border-color: #e8e8e8;--w-e-modal-button-bg-color: #fafafa;--w-e-modal-button-border-color: #d9d9d9}.w-e-text-container *,.w-e-toolbar *{box-sizing:border-box;margin:0;outline:none;padding:0}.w-e-text-container blockquote,.w-e-text-container li,.w-e-text-container p,.w-e-text-container td,.w-e-text-container th,.w-e-toolbar *{line-height:1.5}.w-e-text-container{background-color:var(--w-e-textarea-bg-color);color:var(--w-e-textarea-color);height:100%;position:relative}.w-e-text-container .w-e-scroll{-webkit-overflow-scrolling:touch;height:100%}.w-e-text-container [data-slate-editor]{word-wrap:break-word;border-top:1px solid transparent;min-height:100%;outline:0;padding:0 10px;white-space:pre-wrap}.w-e-text-container [data-slate-editor] p{margin:15px 0}.w-e-text-container [data-slate-editor] h1,.w-e-text-container [data-slate-editor] h2,.w-e-text-container [data-slate-editor] h3,.w-e-text-container [data-slate-editor] h4,.w-e-text-container [data-slate-editor] h5{margin:20px 0}.w-e-text-container [data-slate-editor] img{cursor:default;display:inline!important;max-width:100%;min-height:20px;min-width:20px}.w-e-text-container [data-slate-editor] span{text-indent:0}.w-e-text-container [data-slate-editor] [data-selected=true]{box-shadow:0 0 0 2px var(--w-e-textarea-selected-border-color)}.w-e-text-placeholder{font-style:italic;left:10px;top:17px;width:90%}.w-e-max-length-info,.w-e-text-placeholder{color:var(--w-e-textarea-slight-color);pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.w-e-max-length-info{bottom:.5em;right:1em}.w-e-bar{background-color:var(--w-e-toolbar-bg-color);color:var(--w-e-toolbar-color);font-size:14px;padding:0 5px}.w-e-bar svg{fill:var(--w-e-toolbar-color);height:14px;width:14px}.w-e-bar-show{display:flex}.w-e-bar-hidden{display:none}.w-e-hover-bar{border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 5px #0000001f;position:absolute}.w-e-toolbar{flex-wrap:wrap;position:relative}.w-e-bar-divider{background-color:var(--w-e-toolbar-border-color);display:inline-flex;height:40px;margin:0 5px;width:1px}.w-e-bar-item{display:flex;height:40px;padding:4px;position:relative;text-align:center}.w-e-bar-item,.w-e-bar-item button{align-items:center;justify-content:center}.w-e-bar-item button{background:transparent;border:none;color:var(--w-e-toolbar-color);cursor:pointer;display:inline-flex;height:32px;overflow:hidden;padding:0 8px;white-space:nowrap}.w-e-bar-item button:hover{background-color:var(--w-e-toolbar-active-bg-color);color:var(--w-e-toolbar-active-color)}.w-e-bar-item button .title{margin-left:5px}.w-e-bar-item .active{background-color:var(--w-e-toolbar-active-bg-color);color:var(--w-e-toolbar-active-color)}.w-e-bar-item .disabled{color:var(--w-e-toolbar-disabled-color);cursor:not-allowed}.w-e-bar-item .disabled svg{fill:var(--w-e-toolbar-disabled-color)}.w-e-bar-item .disabled:hover{background-color:var(--w-e-toolbar-bg-color);color:var(--w-e-toolbar-disabled-color)}.w-e-bar-item .disabled:hover svg{fill:var(--w-e-toolbar-disabled-color)}.w-e-menu-tooltip-v5:before{background-color:var(--w-e-toolbar-active-color);border-radius:5px;color:var(--w-e-toolbar-bg-color);content:attr(data-tooltip);font-size:.75em;opacity:0;padding:5px 10px;position:absolute;text-align:center;top:40px;transition:opacity .6s;visibility:hidden;white-space:pre;z-index:1}.w-e-menu-tooltip-v5:after{border:5px solid transparent;border-bottom:5px solid var(--w-e-toolbar-active-color);content:"";opacity:0;position:absolute;top:30px;transition:opacity .6s;visibility:hidden}.w-e-menu-tooltip-v5:hover:after,.w-e-menu-tooltip-v5:hover:before{opacity:1;visibility:visible}.w-e-menu-tooltip-v5.tooltip-right:before{left:100%;top:10px}.w-e-menu-tooltip-v5.tooltip-right:after{border-bottom-color:transparent;border-left-color:transparent;border-right-color:var(--w-e-toolbar-active-color);border-top-color:transparent;left:100%;margin-left:-10px;top:16px}.w-e-bar-item-group .w-e-bar-item-menus-container{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 10px #0000001f;display:none;left:0;margin-top:40px;position:absolute;top:0;z-index:1}.w-e-bar-item-group:hover .w-e-bar-item-menus-container{display:block}.w-e-select-list{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 10px #0000001f;left:0;margin-top:40px;max-height:350px;min-width:100px;overflow-y:auto;position:absolute;top:0;z-index:1}.w-e-select-list ul{line-height:1;list-style:none}.w-e-select-list ul .selected{background-color:var(--w-e-toolbar-active-bg-color)}.w-e-select-list ul li{cursor:pointer;padding:7px 0 7px 25px;position:relative;text-align:left;white-space:nowrap}.w-e-select-list ul li:hover{background-color:var(--w-e-toolbar-active-bg-color)}.w-e-select-list ul li svg{left:0;margin-left:5px;margin-top:-7px;position:absolute;top:50%}.w-e-bar-bottom .w-e-select-list{bottom:0;margin-bottom:40px;margin-top:0;top:inherit}.w-e-drop-panel{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 10px #0000001f;margin-top:40px;min-width:200px;padding:10px;position:absolute;top:0;z-index:1}.w-e-bar-bottom .w-e-drop-panel{bottom:0;margin-bottom:40px;margin-top:0;top:inherit}.w-e-modal{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 10px #0000001f;color:var(--w-e-toolbar-color);font-size:14px;min-height:40px;min-width:100px;padding:20px 15px 0;position:absolute;text-align:left;z-index:1}.w-e-modal .btn-close{cursor:pointer;line-height:1;padding:5px;position:absolute;right:8px;top:7px}.w-e-modal .btn-close svg{fill:var(--w-e-toolbar-color);height:10px;width:10px}.w-e-modal .babel-container{display:block;margin-bottom:15px}.w-e-modal .babel-container span{display:block;margin-bottom:10px}.w-e-modal .button-container{margin-bottom:15px}.w-e-modal button{background-color:var(--w-e-modal-button-bg-color);border:1px solid var(--w-e-modal-button-border-color);border-radius:4px;color:var(--w-e-toolbar-color);cursor:pointer;font-weight:400;height:32px;padding:4.5px 15px;text-align:center;touch-action:manipulation;transition:all .3s cubic-bezier(.645,.045,.355,1);-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.w-e-modal input[type=number],.w-e-modal input[type=text],.w-e-modal textarea{font-feature-settings:"tnum";background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-modal-button-border-color);border-radius:4px;color:var(--w-e-toolbar-color);font-variant:tabular-nums;padding:4.5px 11px;transition:all .3s;width:100%}.w-e-modal textarea{min-height:60px}body .w-e-modal,body .w-e-modal *{box-sizing:border-box}.w-e-progress-bar{background-color:var(--w-e-textarea-handler-bg-color);height:1px;position:absolute;transition:width .3s;width:0}.w-e-full-screen-container{bottom:0!important;display:flex!important;flex-direction:column!important;height:100%!important;left:0!important;margin:0!important;padding:0!important;position:fixed;right:0!important;top:0!important;width:100%!important}.w-e-full-screen-container [data-w-e-textarea=true]{flex:1!important}.w-e-text-container [data-slate-editor] code{background-color:var(--w-e-textarea-slight-bg-color);border-radius:3px;font-family:monospace;padding:3px}.w-e-panel-content-color{list-style:none;text-align:left;width:230px}.w-e-panel-content-color li{border:1px solid var(--w-e-toolbar-bg-color);border-radius:3px;cursor:pointer;display:inline-block;padding:2px}.w-e-panel-content-color li:hover{border-color:var(--w-e-toolbar-color)}.w-e-panel-content-color li .color-block{border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;height:17px;width:17px}.w-e-panel-content-color .active{border-color:var(--w-e-toolbar-color)}.w-e-panel-content-color .clear{line-height:1.5;margin-bottom:5px;width:100%}.w-e-panel-content-color .clear svg{height:16px;margin-bottom:-4px;width:16px}.w-e-text-container [data-slate-editor] blockquote{background-color:var(--w-e-textarea-slight-bg-color);border-left:8px solid var(--w-e-textarea-selected-border-color);display:block;font-size:100%;line-height:1.5;margin:10px 0;padding:10px}.w-e-panel-content-emotion{font-size:20px;list-style:none;text-align:left;width:300px}.w-e-panel-content-emotion li{border-radius:3px;cursor:pointer;display:inline-block;padding:0 5px}.w-e-panel-content-emotion li:hover{background-color:var(--w-e-textarea-slight-bg-color)}.w-e-textarea-divider{border-radius:3px;margin:20px auto;padding:20px}.w-e-textarea-divider hr{background-color:var(--w-e-textarea-border-color);border:0;display:block;height:1px}.w-e-text-container [data-slate-editor] pre>code{background-color:var(--w-e-textarea-slight-bg-color);border:1px solid var(--w-e-textarea-slight-border-color);border-radius:4px;display:block;font-size:14px;padding:10px;text-indent:0}.w-e-text-container [data-slate-editor] .w-e-image-container{display:inline-block;margin:0 3px}.w-e-text-container [data-slate-editor] .w-e-image-container:hover{box-shadow:0 0 0 2px var(--w-e-textarea-selected-border-color)}.w-e-text-container [data-slate-editor] .w-e-selected-image-container{overflow:hidden;position:relative}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .w-e-image-dragger{background-color:var(--w-e-textarea-handler-bg-color);height:7px;position:absolute;width:7px}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .left-top{cursor:nwse-resize;left:0;top:0}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .right-top{cursor:nesw-resize;right:0;top:0}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .left-bottom{bottom:0;cursor:nesw-resize;left:0}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .right-bottom{bottom:0;cursor:nwse-resize;right:0}.w-e-text-container [data-slate-editor] .w-e-selected-image-container:hover,.w-e-text-container [contenteditable=false] .w-e-image-container:hover{box-shadow:none}.w-e-text-container [data-slate-editor] .table-container{border:1px dashed var(--w-e-textarea-border-color);border-radius:5px;margin-top:10px;overflow-x:auto;padding:10px;width:100%}.w-e-text-container [data-slate-editor] table{border-collapse:collapse}.w-e-text-container [data-slate-editor] table td,.w-e-text-container [data-slate-editor] table th{border:1px solid var(--w-e-textarea-border-color);line-height:1.5;min-width:30px;padding:3px 5px;text-align:left}.w-e-text-container [data-slate-editor] table th{background-color:var(--w-e-textarea-slight-bg-color);font-weight:700;text-align:center}.w-e-panel-content-table{background-color:var(--w-e-toolbar-bg-color)}.w-e-panel-content-table table{border-collapse:collapse}.w-e-panel-content-table td{border:1px solid var(--w-e-toolbar-border-color);cursor:pointer;height:15px;padding:3px 5px;width:20px}.w-e-panel-content-table td.active{background-color:var(--w-e-toolbar-active-bg-color)}.w-e-textarea-video-container{background-image:linear-gradient(45deg,#eee 25%,transparent 0,transparent 75%,#eee 0,#eee),linear-gradient(45deg,#eee 25%,#fff 0,#fff 75%,#eee 0,#eee);background-position:0 0,10px 10px;background-size:20px 20px;border:1px dashed var(--w-e-textarea-border-color);border-radius:5px;margin:10px auto 0;padding:10px 0;text-align:center}.w-e-text-container [data-slate-editor] pre>code{word-wrap:normal;font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;-webkit-hyphens:none;hyphens:none;line-height:1.5;margin:.5em 0;overflow:auto;padding:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4;text-align:left;text-shadow:0 1px #fff;white-space:pre;word-break:normal;word-spacing:normal}.w-e-text-container [data-slate-editor] pre>code .token.cdata,.w-e-text-container [data-slate-editor] pre>code .token.comment,.w-e-text-container [data-slate-editor] pre>code .token.doctype,.w-e-text-container [data-slate-editor] pre>code .token.prolog{color:#708090}.w-e-text-container [data-slate-editor] pre>code .token.punctuation{color:#999}.w-e-text-container [data-slate-editor] pre>code .token.namespace{opacity:.7}.w-e-text-container [data-slate-editor] pre>code .token.boolean,.w-e-text-container [data-slate-editor] pre>code .token.constant,.w-e-text-container [data-slate-editor] pre>code .token.deleted,.w-e-text-container [data-slate-editor] pre>code .token.number,.w-e-text-container [data-slate-editor] pre>code .token.property,.w-e-text-container [data-slate-editor] pre>code .token.symbol,.w-e-text-container [data-slate-editor] pre>code .token.tag{color:#905}.w-e-text-container [data-slate-editor] pre>code .token.attr-name,.w-e-text-container [data-slate-editor] pre>code .token.builtin,.w-e-text-container [data-slate-editor] pre>code .token.char,.w-e-text-container [data-slate-editor] pre>code .token.inserted,.w-e-text-container [data-slate-editor] pre>code .token.selector,.w-e-text-container [data-slate-editor] pre>code .token.string{color:#690}.w-e-text-container [data-slate-editor] pre>code .language-css .token.string,.w-e-text-container [data-slate-editor] pre>code .style .token.string,.w-e-text-container [data-slate-editor] pre>code .token.entity,.w-e-text-container [data-slate-editor] pre>code .token.operator,.w-e-text-container [data-slate-editor] pre>code .token.url{color:#9a6e3a}.w-e-text-container [data-slate-editor] pre>code .token.atrule,.w-e-text-container [data-slate-editor] pre>code .token.attr-value,.w-e-text-container [data-slate-editor] pre>code .token.keyword{color:#07a}.w-e-text-container [data-slate-editor] pre>code .token.class-name,.w-e-text-container [data-slate-editor] pre>code .token.function{color:#dd4a68}.w-e-text-container [data-slate-editor] pre>code .token.important,.w-e-text-container [data-slate-editor] pre>code .token.regex,.w-e-text-container [data-slate-editor] pre>code .token.variable{color:#e90}.w-e-text-container [data-slate-editor] pre>code .token.bold,.w-e-text-container [data-slate-editor] pre>code .token.important{font-weight:700}.w-e-text-container [data-slate-editor] pre>code .token.italic{font-style:italic}.w-e-text-container [data-slate-editor] pre>code .token.entity{cursor:help}.icon-select-container[data-v-c90a1b8f]{position:relative;height:600px;display:flex;flex-direction:column}.icon-select-container .search-bar[data-v-c90a1b8f]{position:sticky;top:0;z-index:1;padding:12px;background:#fff;border-bottom:1px solid #f0f0f0}.icon-select-container .icon-content[data-v-c90a1b8f]{flex:1;overflow-y:auto;padding:12px}.icon-select-container .icon-groups .icon-group[data-v-c90a1b8f]{margin-bottom:4px}.icon-select-container .icon-groups .icon-group .group-title[data-v-c90a1b8f]{font-size:16px;font-weight:500;margin-bottom:2px;color:#1f1f1f}.icon-select-container .icon-groups .icon-group .icon-grid[data-v-c90a1b8f]{display:grid;grid-template-columns:repeat(auto-fill,minmax(100px,1fr));gap:2px}.icon-select-container .icon-groups .icon-group .icon-grid .icon-item[data-v-c90a1b8f]{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:2px 20px;border-radius:4px;cursor:pointer;transition:all .3s}.icon-select-container .icon-groups .icon-group .icon-grid .icon-item[data-v-c90a1b8f]:hover{border-color:#1890ff;background-color:#e6f7ff}.icon-select-container .icon-groups .icon-group .icon-grid .icon-item.icon-selected[data-v-c90a1b8f]{border-color:#1890ff;background-color:#1677ff;color:#fff}.icon-select-container .icon-groups .icon-group .icon-grid .icon-item.icon-selected .icon-name[data-v-c90a1b8f]{color:#fff}.icon-select-container .icon-groups .icon-group .icon-grid .icon-item .anticon[data-v-c90a1b8f]{font-size:24px;margin-bottom:8px}.icon-select-container .icon-groups .icon-group .icon-grid .icon-item .icon-name[data-v-c90a1b8f]{font-size:12px;color:#666;text-align:center;word-break:break-all}.ant-calendar-picker[data-v-b6209cd7]{width:100%!important}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { utils as w, writeFile as y, SSF as _ } from "xlsx";
|
|
2
|
+
function b(a, l) {
|
|
3
|
+
return l && (a += 1462), (Date.parse(a) - new Date(Date.UTC(1899, 11, 30))) / (24 * 60 * 60 * 1e3);
|
|
4
|
+
}
|
|
5
|
+
async function v(a, l, g) {
|
|
6
|
+
return new Promise((d) => {
|
|
7
|
+
const r = {
|
|
8
|
+
s: {
|
|
9
|
+
c: 1e7,
|
|
10
|
+
r: 1e7
|
|
11
|
+
},
|
|
12
|
+
e: {
|
|
13
|
+
c: 0,
|
|
14
|
+
r: 0
|
|
15
|
+
}
|
|
16
|
+
}, f = 1e3, u = [];
|
|
17
|
+
for (let s = 0; s < a.length; s += f) {
|
|
18
|
+
const n = a.slice(s, s + f);
|
|
19
|
+
u.push(n);
|
|
20
|
+
}
|
|
21
|
+
async function x(s, n) {
|
|
22
|
+
return new Promise((m) => {
|
|
23
|
+
setTimeout(() => {
|
|
24
|
+
n === 0 && console.log("开始export_xlsx");
|
|
25
|
+
for (let i = 0; i !== s.length; ++i)
|
|
26
|
+
for (let t = 0; t !== s[i].length; ++t) {
|
|
27
|
+
const e = i + f * n;
|
|
28
|
+
r.s.r > e && (r.s.r = e), r.s.c > t && (r.s.c = t), r.e.r < e && (r.e.r = e), r.e.c < t && (r.e.c = t);
|
|
29
|
+
const o = {
|
|
30
|
+
v: s[i][t]
|
|
31
|
+
};
|
|
32
|
+
o.v != null && (w.encode_cell({
|
|
33
|
+
c: t,
|
|
34
|
+
r: e
|
|
35
|
+
}), typeof o.v == "number" ? o.t = "n" : typeof o.v == "boolean" ? o.t = "b" : o.v instanceof Date ? (o.t = "n", o.z = _._table[14], o.v = b(o.v)) : o.t = "s", console.log(e, t), w.sheet_add_aoa(l, [[o.v]], { origin: { r: e, c: t } }));
|
|
36
|
+
}
|
|
37
|
+
s.length = 0, g.value = Number((n / u.length * 100 * 0.95).toFixed(0)), console.log(`batch ${n + 1} done`), m(!0);
|
|
38
|
+
}, 10);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
async function S(s) {
|
|
42
|
+
for (let n = 0; n < s.length; n++)
|
|
43
|
+
await x(s[n], n);
|
|
44
|
+
r.s.c < 1e7 && (l["!ref"] = w.encode_range(r)), d(l);
|
|
45
|
+
}
|
|
46
|
+
S(u);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
class p {
|
|
50
|
+
constructor() {
|
|
51
|
+
if (this.SheetNames = [], this.Sheets = {}, !(this instanceof p))
|
|
52
|
+
return new p();
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
async function F(a) {
|
|
56
|
+
const {
|
|
57
|
+
multiHeader: l = [],
|
|
58
|
+
header: g,
|
|
59
|
+
data: d,
|
|
60
|
+
filename: r,
|
|
61
|
+
merges: f = [],
|
|
62
|
+
autoWidth: u = !0,
|
|
63
|
+
bookType: x = "xlsx",
|
|
64
|
+
percent: S
|
|
65
|
+
} = a || {}, s = r || "excel-list", n = d.slice();
|
|
66
|
+
if (l && l.length > 0)
|
|
67
|
+
for (let e = l.length - 1; e > -1; e--)
|
|
68
|
+
n.unshift(l[e]);
|
|
69
|
+
else
|
|
70
|
+
n.unshift(g);
|
|
71
|
+
const m = "SheetJS", i = new p(), t = w.aoa_to_sheet([[]]);
|
|
72
|
+
if (await v(n, t, S), f.length > 0 && (t["!merges"] || (t["!merges"] = []), f.forEach((e) => {
|
|
73
|
+
t["!merges"].push(e);
|
|
74
|
+
})), u) {
|
|
75
|
+
const e = n.map(
|
|
76
|
+
(h) => h.map((c) => c == null ? {
|
|
77
|
+
wch: 10
|
|
78
|
+
} : c.toString().charCodeAt(0) > 255 ? {
|
|
79
|
+
wch: c.toString().length * 2
|
|
80
|
+
} : {
|
|
81
|
+
wch: c.toString().length
|
|
82
|
+
})
|
|
83
|
+
), o = e[0];
|
|
84
|
+
for (let h = 1; h < e.length; h++)
|
|
85
|
+
for (let c = 0; c < e[h].length; c++)
|
|
86
|
+
o[c].wch < e[h][c].wch && (o[c].wch = e[h][c].wch);
|
|
87
|
+
t["!cols"] = o;
|
|
88
|
+
}
|
|
89
|
+
i.SheetNames.push(m), i.Sheets[m] = t, console.log("start write xlsx "), y(i, `${s}.${x}`);
|
|
90
|
+
}
|
|
91
|
+
export {
|
|
92
|
+
F as exportJsonToExcel
|
|
93
|
+
};
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { l as h } from "../lodash-14d7cb6d.js";
|
|
2
|
+
import { message as b } from "ant-design-vue";
|
|
3
|
+
import i from "moment";
|
|
4
|
+
const N = (e) => (e && (e = e.substring(0, 5)), e), M = (e) => (e && (e = e.substring(11, 16)), e), k = (e) => (e && (e = e.substring(11, 19)), e), A = (e) => (e && (e = e.substring(0, 7)), e), _ = (e) => e == "1900-01-01" ? "期初" : (e && (e = e.substring(0, 4) + "年" + e.substring(5, 7) + "月"), e), D = (e) => (e && (/* @__PURE__ */ new Date()).getFullYear().toString() == e.substring(0, 4) ? e = e.substring(5, 10) : e && (e = e.substring(0, 10)), e), j = (e) => (e && (e = e.substring(0, 10)), e), C = (e) => (e && (/* @__PURE__ */ new Date()).getFullYear().toString() == e.substring(0, 4) ? e = e.substring(5, 16) : e && (e = e.substring(0, 16)), e), E = (e) => (e && (/* @__PURE__ */ new Date()).getFullYear().toString() == e.substring(0, 4) ? e = e.substring(5, 19) : e && (e = e.substring(0, 19)), e), L = (e) => (e && (e = e.substring(0, 19)), e), O = (e) => h.isNumber(e) ? Number(e.toFixed(2)) == 0 ? 0 : e.toFixed(2) : "", T = (e) => h.isNumber(e) ? Number(e.toFixed(0)) == 0 ? 0 : e.toFixed(0) : "", Y = (e) => h.isNumber(e) ? Number(e.toFixed(3)) == 0 ? 0 : e.toFixed(3) : "", R = (e) => e.replace(/(^\s*)|(\s*$)/g, ""), B = (e) => h.isNumber(e) ? Number(e.toFixed(6)) == 0 ? 0 : e.toFixed(6) : "", q = (e) => {
|
|
5
|
+
let s = e;
|
|
6
|
+
if (e > 60) {
|
|
7
|
+
let n = e / 60;
|
|
8
|
+
if (s = Math.floor(n) + "分", n > 60) {
|
|
9
|
+
n = e / 60 % 60;
|
|
10
|
+
let t = e / 60 / 60;
|
|
11
|
+
if (s = Math.floor(t) + "小时" + Math.floor(n) + "分", t > 24) {
|
|
12
|
+
t = e / 60 / 60 % 24;
|
|
13
|
+
const u = e / 60 / 60 / 24;
|
|
14
|
+
s = Math.floor(u) + "天" + Math.floor(t) + "小时" + Math.floor(n) + "分";
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
} else
|
|
18
|
+
s = e + "秒";
|
|
19
|
+
return s;
|
|
20
|
+
}, V = (e) => {
|
|
21
|
+
const s = Math.floor(e / 1e3), n = Math.floor(s / 60), t = Math.floor(n / 60), u = s % 60, a = n % 60;
|
|
22
|
+
let g = "";
|
|
23
|
+
return t > 0 && (g += `${t.toString().padStart(2, "0")}:`), g += `${a.toString().padStart(2, "0")}:${u.toString().padStart(2, "0")}`, e % 1e3 !== 0 && (g += `.${e.toString().slice(-2)}`), g;
|
|
24
|
+
}, $ = (e, s) => {
|
|
25
|
+
const n = {};
|
|
26
|
+
for (const t in e)
|
|
27
|
+
s[e[t]] && (n[t] = s[e[t]]);
|
|
28
|
+
return n;
|
|
29
|
+
}, W = (e, s, n) => {
|
|
30
|
+
const t = {};
|
|
31
|
+
for (const u in e)
|
|
32
|
+
t[u] = s.filter((a) => n.includes(a.id)).map((a) => a[e[u]]);
|
|
33
|
+
return t;
|
|
34
|
+
}, m = (e, s) => {
|
|
35
|
+
const n = {};
|
|
36
|
+
for (const t in e)
|
|
37
|
+
s[e[t]] && (n[t] = s[e[t]].join(","));
|
|
38
|
+
return n;
|
|
39
|
+
}, P = (e) => Math.floor(e), G = ({ column: e, text: s }) => {
|
|
40
|
+
const n = [
|
|
41
|
+
"green",
|
|
42
|
+
"orange",
|
|
43
|
+
"red",
|
|
44
|
+
"pink",
|
|
45
|
+
"cyan",
|
|
46
|
+
"blue",
|
|
47
|
+
"purple",
|
|
48
|
+
"#f50",
|
|
49
|
+
"#2db7f5",
|
|
50
|
+
"#87d068",
|
|
51
|
+
"#108ee9"
|
|
52
|
+
], t = Object.keys(e).filter((u) => u.indexOf("field_") == 0).map((u) => u.replace("field_", "")).sort();
|
|
53
|
+
return n[t.indexOf(s.toString())];
|
|
54
|
+
}, J = (e) => {
|
|
55
|
+
const s = [], n = (t, u) => {
|
|
56
|
+
u.map((a) => {
|
|
57
|
+
t.parent_id == a.id ? (a.children == null && (a.children = []), a.children.push({
|
|
58
|
+
key: t.id,
|
|
59
|
+
value: t.id,
|
|
60
|
+
title: t.name,
|
|
61
|
+
...t,
|
|
62
|
+
children: []
|
|
63
|
+
})) : n(t, a.children);
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
return e.data.map((t) => {
|
|
67
|
+
t.parent_id ? n(t, s) : s.push({
|
|
68
|
+
key: t.id,
|
|
69
|
+
value: t.id,
|
|
70
|
+
title: t.name,
|
|
71
|
+
...t,
|
|
72
|
+
children: []
|
|
73
|
+
});
|
|
74
|
+
}), s;
|
|
75
|
+
}, K = (e) => {
|
|
76
|
+
const s = [], n = (t, u) => {
|
|
77
|
+
u.map((a) => {
|
|
78
|
+
t.parent_id == a.id ? ("children" in a || (a.children = []), a.children.push({
|
|
79
|
+
id: t.id,
|
|
80
|
+
name: t.name,
|
|
81
|
+
key: t.id
|
|
82
|
+
})) : a.children != null && a.children.length > 0 && n(t, a.children);
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
return s.push({
|
|
86
|
+
key: 999999,
|
|
87
|
+
name: "全部",
|
|
88
|
+
children: []
|
|
89
|
+
}), e.data.map((t) => {
|
|
90
|
+
t.parent_id ? n(t, s) : s.push({
|
|
91
|
+
id: t.id,
|
|
92
|
+
name: t.name,
|
|
93
|
+
key: t.id,
|
|
94
|
+
children: []
|
|
95
|
+
});
|
|
96
|
+
}), s.map((t) => {
|
|
97
|
+
t.children.length == 0 && delete t.children;
|
|
98
|
+
}), s;
|
|
99
|
+
}, U = (e) => e.length ? (e = e.map((n) => n && !Number.isNaN(Number(n)) ? Math.round(n * 1e4) : 0), e.reduce((n, t) => n + t, 0) / 1e4) : 0, z = (e) => {
|
|
100
|
+
let s = "", n = "复制成功";
|
|
101
|
+
e != null && e.message ? (s = e.val, n = e.message) : s = e;
|
|
102
|
+
const t = document.createElement("input");
|
|
103
|
+
t.setAttribute("readonly", "readonly"), t.setAttribute("value", s), document.body.appendChild(t), t.select(), document.execCommand("copy") && (document.execCommand("copy"), b.info(n)), document.body.removeChild(t);
|
|
104
|
+
}, H = (e) => {
|
|
105
|
+
const s = {};
|
|
106
|
+
return Object.keys(e).forEach((n) => {
|
|
107
|
+
e[n] !== null && e[n] !== "" && JSON.stringify(e[n]) !== "[]" && (s[n] = e[n]);
|
|
108
|
+
}), s;
|
|
109
|
+
}, p = (e) => e != null && e !== "", I = (e, s) => (s == "getPeriod" && (e.group_info.display_name = _(e.group_info.display_name)), e), Q = ({ record: e }) => {
|
|
110
|
+
var n;
|
|
111
|
+
const s = {
|
|
112
|
+
props: {}
|
|
113
|
+
};
|
|
114
|
+
return ((n = e == null ? void 0 : e.meta_data) == null ? void 0 : n.rowSpan) != null && (s.props.rowSpan = e.meta_data.rowSpan), s;
|
|
115
|
+
}, f = (e) => e === null || e == null || e === "", y = (e, s) => {
|
|
116
|
+
let n;
|
|
117
|
+
if (s == "int")
|
|
118
|
+
p(e) && e instanceof Array ? (n = [], e.forEach((t) => {
|
|
119
|
+
p(t) && typeof t == "string" ? n.push(Number(t)) : n.push(t);
|
|
120
|
+
})) : p(e) && typeof e == "string" ? n = Number(e) : n = e;
|
|
121
|
+
else if (["bool", "boolean"].includes(s)) {
|
|
122
|
+
n = [];
|
|
123
|
+
const t = ["true", "True", "TRUE", "1", 1, !0], u = ["false", "False", "FALSE", "0", 0, !1];
|
|
124
|
+
e.forEach((a) => {
|
|
125
|
+
t.includes(a) ? n.push(!0) : u.includes(a) ? n.push(!1) : n.push(a);
|
|
126
|
+
});
|
|
127
|
+
} else
|
|
128
|
+
n = e;
|
|
129
|
+
return n;
|
|
130
|
+
}, X = (e, s) => {
|
|
131
|
+
const n = {
|
|
132
|
+
between: "介于",
|
|
133
|
+
gt: "大于",
|
|
134
|
+
lt: "小于",
|
|
135
|
+
gte: "大于等于",
|
|
136
|
+
lte: "小于等于",
|
|
137
|
+
in: "包含",
|
|
138
|
+
eq: "等于",
|
|
139
|
+
contains: "包含",
|
|
140
|
+
icontains: "包含",
|
|
141
|
+
startswith: "开头",
|
|
142
|
+
notbetween: "不介于",
|
|
143
|
+
notin: "不包含",
|
|
144
|
+
notcontains: "不包含",
|
|
145
|
+
_eq: "选择",
|
|
146
|
+
not_eq: "不等于",
|
|
147
|
+
not_blank_not_null: "是否非空",
|
|
148
|
+
json_list_not_blank_not_null: "是否非空",
|
|
149
|
+
json_list_is_blank_is_null: "是否为空"
|
|
150
|
+
};
|
|
151
|
+
return e == "input" && s == "in" ? "等于" : n[s];
|
|
152
|
+
}, S = (e) => {
|
|
153
|
+
e.sort((s, n) => (s.order || 0) - (n.order || 0)), e.forEach((s) => {
|
|
154
|
+
s.children && S(s.children);
|
|
155
|
+
});
|
|
156
|
+
}, c = (e, s = "YYYY-MM-DD") => i(e, s, !0).isValid(), Z = ({
|
|
157
|
+
record: e,
|
|
158
|
+
conditions: s,
|
|
159
|
+
dataSource: n,
|
|
160
|
+
selectedRowKeys: t
|
|
161
|
+
}) => !s || s.length === 0 ? !0 : s.map((a) => !a || a.length === 0 ? !0 : a.map((d) => {
|
|
162
|
+
if (!d)
|
|
163
|
+
return !1;
|
|
164
|
+
let r = null;
|
|
165
|
+
t instanceof Array ? r = n.filter((l) => t.includes(l.id)).map((l) => l[l.flag]) : r = e[d.flag];
|
|
166
|
+
let o = y(d.value, d.type);
|
|
167
|
+
switch (o instanceof Array || (o = [o]), d.operator) {
|
|
168
|
+
case "lt":
|
|
169
|
+
return typeof o[0] == "number" ? !f(r) && r < o[0] : c(o[0]) ? !f(r) && i(r).isBefore(i(o[0])) : !1;
|
|
170
|
+
case "lte":
|
|
171
|
+
return typeof o[0] == "number" ? !f(r) && r <= o[0] : c(o[0]) ? !f(r) && (i(r).isBefore(i(o[0])) || i(r).isSame(i(o[0]))) : !1;
|
|
172
|
+
case "gt":
|
|
173
|
+
return typeof o[0] == "number" ? !f(r) && r > o[0] : c(o[0]) ? !f(r) && i(r).isAfter(i(o[0])) : !1;
|
|
174
|
+
case "gte":
|
|
175
|
+
return typeof o[0] == "number" ? !f(r) && r >= o[0] : c(o[0]) ? !f(r) && (i(r).isAfter(i(o[0])) || i(r).isSame(i(o[0]))) : !1;
|
|
176
|
+
case "between":
|
|
177
|
+
return typeof o[0] == "number" && typeof o[1] == "number" ? !f(r) && r >= o[0] && r <= o[1] : c(o[0]) && c(o[1]) ? !f(r) && (i(r).isAfter(i(o[0])) || i(r).isSame(i(o[0]))) && (i(r).isBefore(i(o[1])) || i(r).isSame(i(o[1]))) : !1;
|
|
178
|
+
case "notbetween":
|
|
179
|
+
return typeof o[0] == "number" && typeof o[1] == "number" ? !f(r) && (r < o[0] || r > o[1]) : c(o[0]) && c(o[1]) ? !f(r) && (i(r).isBefore(i(o[0])) || i(r).isAfter(i(o[1]))) : !1;
|
|
180
|
+
case "in":
|
|
181
|
+
return r instanceof Array ? o.some((l) => r.includes(l)) : o.some((l) => r == l);
|
|
182
|
+
case "notin":
|
|
183
|
+
return r instanceof Array ? !o.some((l) => r.includes(l)) : !o.some((l) => r == l);
|
|
184
|
+
case "eq":
|
|
185
|
+
return r === o[0];
|
|
186
|
+
case "not_eq":
|
|
187
|
+
return r !== o[0];
|
|
188
|
+
case "contains":
|
|
189
|
+
return r && r.toString().indexOf(o[0]) > -1;
|
|
190
|
+
case "icontains":
|
|
191
|
+
return r && r.toString().toLowerCase().indexOf(o[0].toLowerCase()) > -1;
|
|
192
|
+
case "notcontains":
|
|
193
|
+
return !r || r.toString().indexOf(o[0]) === -1;
|
|
194
|
+
case "noticontains":
|
|
195
|
+
return !r || r.toString().toLowerCase().indexOf(o[0].toLowerCase()) === -1;
|
|
196
|
+
case "startswith":
|
|
197
|
+
return r && r.toString().startsWith(o[0]);
|
|
198
|
+
case "istartswith":
|
|
199
|
+
return r && r.toString().toLowerCase().startsWith(o[0].toLowerCase());
|
|
200
|
+
case "notstartswith":
|
|
201
|
+
return !r || r.toString().startsWith(o[0]);
|
|
202
|
+
case "notistartswith":
|
|
203
|
+
return !r || r.toString().toLowerCase().startsWith(o[0].toLowerCase());
|
|
204
|
+
case "json_list_not_blank_not_null":
|
|
205
|
+
case "not_blank_not_null":
|
|
206
|
+
return r instanceof Array ? r.length !== 0 : !!r;
|
|
207
|
+
case "is_blank":
|
|
208
|
+
case "json_list_is_blank_is_null":
|
|
209
|
+
return r instanceof Array ? r.length === 0 : !r;
|
|
210
|
+
default:
|
|
211
|
+
return !1;
|
|
212
|
+
}
|
|
213
|
+
}).every((d) => d)).some((a) => a);
|
|
214
|
+
export {
|
|
215
|
+
Z as checkCondition,
|
|
216
|
+
y as convertValueByClassName,
|
|
217
|
+
z as copyValue,
|
|
218
|
+
U as countSum,
|
|
219
|
+
Q as customRenderMetaData,
|
|
220
|
+
H as filterNullAndEmptyKeys,
|
|
221
|
+
q as format_datetime_hh_mm,
|
|
222
|
+
V as format_ms_hh_mm,
|
|
223
|
+
D as getDate,
|
|
224
|
+
_ as getDateMonth,
|
|
225
|
+
C as getDateTime,
|
|
226
|
+
j as getFullDate,
|
|
227
|
+
E as getFullDateTime,
|
|
228
|
+
L as getFullYearDateTime,
|
|
229
|
+
A as getMonth,
|
|
230
|
+
$ as getObjList,
|
|
231
|
+
W as getObjListBySelectedRowKeys,
|
|
232
|
+
m as getRangePicker,
|
|
233
|
+
N as getTime,
|
|
234
|
+
M as getTime2,
|
|
235
|
+
k as getTime3,
|
|
236
|
+
P as getTon,
|
|
237
|
+
X as get_operator_type_map,
|
|
238
|
+
K as get_page_tree_data,
|
|
239
|
+
J as get_remote_tree_data,
|
|
240
|
+
G as get_tag_color_by_slots,
|
|
241
|
+
f as isEmpty,
|
|
242
|
+
p as isNotEmpty,
|
|
243
|
+
c as isValidDate,
|
|
244
|
+
S as nested_sort_list,
|
|
245
|
+
I as showGroupFormat,
|
|
246
|
+
T as toFixed0,
|
|
247
|
+
O as toFixed2,
|
|
248
|
+
Y as toFixed3,
|
|
249
|
+
B as toFixed6,
|
|
250
|
+
R as trim
|
|
251
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { reactive as g, isReactive as L, isRef as A, ref as j, watch as k, unref as x, onMounted as C } from "vue";
|
|
2
|
+
import { filterNullAndEmptyKeys as F } from "../function.js";
|
|
3
|
+
import { getApiData as H } from "../../api/api-model.js";
|
|
4
|
+
import "../../lodash-14d7cb6d.js";
|
|
5
|
+
import "ant-design-vue";
|
|
6
|
+
import "moment";
|
|
7
|
+
import "../../init-plugin-3dcd1452.js";
|
|
8
|
+
const h = {
|
|
9
|
+
stripe: !1,
|
|
10
|
+
loading: !1,
|
|
11
|
+
current: 1,
|
|
12
|
+
pageSize: 50,
|
|
13
|
+
total: 0,
|
|
14
|
+
dataSource: []
|
|
15
|
+
}, G = (s) => () => s().then((r) => {
|
|
16
|
+
const t = r;
|
|
17
|
+
return {
|
|
18
|
+
data: t,
|
|
19
|
+
total: t.length,
|
|
20
|
+
success: !0
|
|
21
|
+
};
|
|
22
|
+
}), J = (s, r = g({ ...h }), t, i, d, f, K) => {
|
|
23
|
+
const e = g({ ...h }), S = L(r) || A(r) ? r : j(r);
|
|
24
|
+
k(
|
|
25
|
+
S,
|
|
26
|
+
() => {
|
|
27
|
+
Object.assign(e, x(r));
|
|
28
|
+
},
|
|
29
|
+
{ immediate: !0 }
|
|
30
|
+
);
|
|
31
|
+
const _ = async (a = !1) => {
|
|
32
|
+
if (e.loading || e.init_request === !1) {
|
|
33
|
+
e.init_request = !0;
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
e.loading = !0;
|
|
37
|
+
const { pageSize: n = 50, current: v = 1 } = e;
|
|
38
|
+
try {
|
|
39
|
+
const l = (t == null ? void 0 : t.pagination) !== !1 ? {
|
|
40
|
+
current: v,
|
|
41
|
+
pageSize: n,
|
|
42
|
+
...e.requestParams
|
|
43
|
+
// ...filterNoValidValue(unref(mergeContext).requestParams),
|
|
44
|
+
} : void 0;
|
|
45
|
+
a || (e.dataSource = []), await H(l, s.replace("__tree", ""), s.includes("__tree")).then((c) => {
|
|
46
|
+
const u = c.data, o = c.columns, E = c.success, R = c.total;
|
|
47
|
+
if (E !== !1) {
|
|
48
|
+
const m = i ? i(u) : u;
|
|
49
|
+
d && f && o && f(d(u, o)), e.dataSource = [].concat(m), e.total = R, e.current = c.current, e.tableHead = c.table_head ? c.table_head : null, t != null && t.onLoad && (t == null || t.onLoad(m));
|
|
50
|
+
}
|
|
51
|
+
}).finally(() => {
|
|
52
|
+
e.loading = !1;
|
|
53
|
+
});
|
|
54
|
+
} catch (l) {
|
|
55
|
+
if (e.loading = !1, (t == null ? void 0 : t.onRequestError) === void 0)
|
|
56
|
+
throw new Error(l);
|
|
57
|
+
t.onRequestError(l);
|
|
58
|
+
}
|
|
59
|
+
}, w = () => {
|
|
60
|
+
}, z = () => {
|
|
61
|
+
}, b = (a = !1) => new Promise((n) => {
|
|
62
|
+
n(_(a));
|
|
63
|
+
}), q = (a) => {
|
|
64
|
+
a.current && (e.current = a.current), a.pageSize && (e.pageSize = a.pageSize), e.requestParams = F(a);
|
|
65
|
+
}, P = () => {
|
|
66
|
+
e.current = 1;
|
|
67
|
+
}, y = (a, n) => n % 2 === 1 && e.stripe && "ant-pro-table-row-striped";
|
|
68
|
+
return C(() => {
|
|
69
|
+
}), {
|
|
70
|
+
stripe: y,
|
|
71
|
+
cancel: w,
|
|
72
|
+
reset: z,
|
|
73
|
+
reload: b,
|
|
74
|
+
resetPageIndex: P,
|
|
75
|
+
setPageInfo: (a) => {
|
|
76
|
+
q({
|
|
77
|
+
current: e.current,
|
|
78
|
+
pageSize: e.pageSize,
|
|
79
|
+
...a
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
context: e
|
|
83
|
+
};
|
|
84
|
+
};
|
|
85
|
+
export {
|
|
86
|
+
h as defaultContext,
|
|
87
|
+
J as useFetchData,
|
|
88
|
+
G as wrap
|
|
89
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { ref as g, unref as i, reactive as A, watch as I, computed as J } from "vue";
|
|
2
|
+
import { debounce as N } from "lodash-es";
|
|
3
|
+
const q = (n, l = {}, T) => {
|
|
4
|
+
g(1);
|
|
5
|
+
const u = (e) => (e == null ? void 0 : e.key) ?? (Array.isArray(e.dataIndex) ? e.dataIndex.join("$$") : e.dataIndex), k = g([]);
|
|
6
|
+
let f = i(l.defaultCheckedList) ?? k.value.map((e) => e.key) ?? [];
|
|
7
|
+
const s = A({
|
|
8
|
+
checkAll: !1,
|
|
9
|
+
needRowIndex: !1,
|
|
10
|
+
checkedList: f,
|
|
11
|
+
indeterminate: !0,
|
|
12
|
+
tableWidth: l.tableWidth,
|
|
13
|
+
tableMinWidth: l.tableWidth
|
|
14
|
+
}), o = (e) => {
|
|
15
|
+
e && (k.value.map((a, c) => {
|
|
16
|
+
a.sort_num = c, e[a.key] && (e[a.key].index != null && (a.sort_num = e[a.key].index), e[a.key].checked !== !1 ? a.checked = !0 : a.checked = !1, e[a.key].width != null && (a.width = e[a.key].width), e[a.key].fixed != null ? a.fixed = e[a.key].fixed : a.fixed = void 0, e[a.key].autoHeight != null ? a.autoHeight = e[a.key].autoHeight : a.autoHeight = void 0, e[a.key].children != null && (a.children = JSON.parse(JSON.stringify(e[a.key].children))));
|
|
17
|
+
}), k.value = k.value.sort((a, c) => a.sort_num - c.sort_num), k.value.map((a) => {
|
|
18
|
+
a.checked !== !1 ? s.checkedList.includes(a.key) || (s.checkedList = [...s.checkedList, a.key]) : s.checkedList.includes(a.key) && (s.checkedList = s.checkedList.filter((c) => c !== a.key));
|
|
19
|
+
}));
|
|
20
|
+
};
|
|
21
|
+
I(
|
|
22
|
+
() => n,
|
|
23
|
+
() => {
|
|
24
|
+
k.value = i(n || []).slice().map((e) => ({ ...e, key: u(e) })), k.value.forEach((e) => {
|
|
25
|
+
e.checked !== !1 ? s.checkedList.includes(e.key) || (s.checkedList = [...s.checkedList, e.key]) : s.checkedList.includes(e.key) && (s.checkedList = s.checkedList.filter((a) => a !== e.key));
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
{ immediate: !0 }
|
|
29
|
+
);
|
|
30
|
+
const L = g(n), p = (e, a, c) => {
|
|
31
|
+
e != null && e.children && (e == null ? void 0 : e.children.length) > 0 ? e == null || e.children.map((t) => {
|
|
32
|
+
p(t, a, !0);
|
|
33
|
+
}) : a.push({
|
|
34
|
+
key: u(e),
|
|
35
|
+
label: e.title,
|
|
36
|
+
fixed: e.fixed == null ? !1 : e.fixed == !0 ? "left" : e.fixed,
|
|
37
|
+
checked: c || l.checkAll ? !0 : s.checkedList.includes(e.key),
|
|
38
|
+
width: e.width ? e.width : 150,
|
|
39
|
+
autoHeight: e.autoHeight ? e.autoHeight : !1
|
|
40
|
+
});
|
|
41
|
+
}, y = J(() => {
|
|
42
|
+
const e = [];
|
|
43
|
+
return k.value.forEach((a) => {
|
|
44
|
+
p(a, e, !1);
|
|
45
|
+
}), e;
|
|
46
|
+
}), H = () => {
|
|
47
|
+
L.value = k.value.slice().filter((e) => s.checkedList.includes(e.key)).map((e) => {
|
|
48
|
+
const a = {};
|
|
49
|
+
return Object.assign(a, { ...e }), a.children && a.children.length > 0 && (a.children = a.children.filter((c) => c.checked !== !1)), a;
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
I(
|
|
53
|
+
[() => s.checkedList, k],
|
|
54
|
+
() => {
|
|
55
|
+
s.checkAll = s.checkedList.length === k.value.length, s.indeterminate = !!s.checkedList.length && s.checkedList.length < k.value.length, H();
|
|
56
|
+
},
|
|
57
|
+
{ immediate: !0, deep: !0 }
|
|
58
|
+
);
|
|
59
|
+
const x = (e, a, c) => {
|
|
60
|
+
const t = e.target.checked;
|
|
61
|
+
c ? (k.value = k.value.map((d) => (d.key == a.key && d.children.map((h) => (h.dataIndex == c.key && (h.checked = t), h)), d)), c.checked = t) : (k.value = k.value.map((d) => (d.key == a.key && (d.checked = t), d)), t ? s.checkedList.includes(a.key) || (s.checkedList = [...s.checkedList, a.key]) : s.checkedList = s.checkedList.filter((d) => d !== a.key));
|
|
62
|
+
}, b = (e, a) => {
|
|
63
|
+
const c = e.target.value;
|
|
64
|
+
k.value = k.value.map((t) => (t.key == a.key && (t.fixed = c), t)), a.fixed = c;
|
|
65
|
+
}, E = (e, a, c) => {
|
|
66
|
+
c ? (k.value = k.value.map((t) => (t.key == a.key && t.children.map((d) => (d.dataIndex == c.key && (d.autoHeight = e), d)), t)), c.autoHeight = e) : (k.value = k.value.map((t) => (t.key == a.key && (t.autoHeight = e), t)), a.autoHeight = e);
|
|
67
|
+
}, O = (e) => {
|
|
68
|
+
const a = e.target.checked;
|
|
69
|
+
s.checkedList = a ? y.value.map((c) => c.key) : [];
|
|
70
|
+
}, S = () => {
|
|
71
|
+
s.checkedList = f, k.value = k.value.sort((e, a) => f.indexOf(e.key) - f.indexOf(a.key)).slice();
|
|
72
|
+
}, V = (e, a, c, t) => {
|
|
73
|
+
if (t) {
|
|
74
|
+
const d = t.children.slice(), h = d[e];
|
|
75
|
+
d.splice(e, 1), a === 0 ? d.unshift(h) : d.splice(a, 0, h), t.children = d, k.value = k.value.map((r) => (r.key == t.key && (r.children = d), r));
|
|
76
|
+
} else {
|
|
77
|
+
let d = 0, h = 0;
|
|
78
|
+
k.value.forEach((_, w) => {
|
|
79
|
+
c[e - 1].key == _.key && (d = w), c[a - 1].key == _.key && (h = w);
|
|
80
|
+
});
|
|
81
|
+
const r = k.value.slice(), C = r[d];
|
|
82
|
+
r.splice(d, 1), h === 0 ? r.unshift(C) : r.splice(h, 0, C), k.value = r;
|
|
83
|
+
}
|
|
84
|
+
}, W = N((e, a) => {
|
|
85
|
+
k.value.map((c) => {
|
|
86
|
+
c.key == a.key && (c.width = e);
|
|
87
|
+
});
|
|
88
|
+
}, 500), j = () => {
|
|
89
|
+
k.value.forEach((e) => {
|
|
90
|
+
if (e.key == "action") {
|
|
91
|
+
e.checked = v.checkAction;
|
|
92
|
+
const a = {
|
|
93
|
+
...e,
|
|
94
|
+
checked: v.checkAction
|
|
95
|
+
}, c = {};
|
|
96
|
+
c.target = a, x(c, a, null);
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
}, D = (e) => {
|
|
100
|
+
o(e);
|
|
101
|
+
}, v = A({
|
|
102
|
+
checkAction: y.value.filter((e) => e.key == "action" && e.checked).length > 0,
|
|
103
|
+
showCheckAction: y.value.filter((e) => e.key == "action").length > 0,
|
|
104
|
+
checkAll: !0,
|
|
105
|
+
is_column_config: !1
|
|
106
|
+
});
|
|
107
|
+
return {
|
|
108
|
+
dynamicColumns: L,
|
|
109
|
+
mergedColumns: k,
|
|
110
|
+
dynamicColumnItems: y,
|
|
111
|
+
state: s,
|
|
112
|
+
configState: v,
|
|
113
|
+
reset: S,
|
|
114
|
+
handleColumnAllClick: O,
|
|
115
|
+
handleColumnChange: x,
|
|
116
|
+
handleColumnFixedChange: b,
|
|
117
|
+
handleColumnAutoHeightChange: E,
|
|
118
|
+
move: V,
|
|
119
|
+
change_mode: o,
|
|
120
|
+
resizeColumn: W,
|
|
121
|
+
columnAction: j,
|
|
122
|
+
column_change: D,
|
|
123
|
+
replace_column: (e) => {
|
|
124
|
+
i(n || []).length = 0, e.forEach((a) => {
|
|
125
|
+
i(n || []).push(a);
|
|
126
|
+
}), k.value = i(n || []).slice().map((a) => {
|
|
127
|
+
const c = { ...a, key: u(a), checked: !0 };
|
|
128
|
+
return s.checkedList.length == 0 ? c.checked = !0 : c.checked = s.checkedList.includes(a.key), c;
|
|
129
|
+
}), k.value.forEach((a) => {
|
|
130
|
+
a.checked !== !1 ? s.checkedList.includes(a.key) || (s.checkedList = [...s.checkedList, a.key]) : s.checkedList.includes(a.key) || (s.checkedList = s.checkedList.filter((c) => c !== a.key));
|
|
131
|
+
});
|
|
132
|
+
},
|
|
133
|
+
handleFiltersSorterChange: (e, a, c) => {
|
|
134
|
+
k.value.forEach((t) => {
|
|
135
|
+
t != null && t.children && t.children.length > 0 ? t.children.forEach((d) => {
|
|
136
|
+
e != null && e[c(d.dataIndex)] && (e == null ? void 0 : e[c(d.dataIndex)].length) > 0 ? d.filteredValue = e[c(d.dataIndex)] : d.filteredValue = null, a && a.length > 0 ? d != null && d.sorter && (d.sortOrder = !1, a.forEach((h) => {
|
|
137
|
+
h.field == d.dataIndex && (d.sortOrder = h.order);
|
|
138
|
+
})) : d != null && d.sorter && (d.sortOrder = !1);
|
|
139
|
+
}) : (e != null && e[c(t.key)] && (e == null ? void 0 : e[c(t.key)].length) > 0 ? t.filteredValue = e[c(t.key)] : t.filteredValue = null, a && a.length > 0 ? t != null && t.sorter && (t.sortOrder = !1, a.forEach((d) => {
|
|
140
|
+
d.field == t.key && (t.sortOrder = d.order);
|
|
141
|
+
})) : t != null && t.sorter && (t.sortOrder = !1));
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
export {
|
|
147
|
+
q as useTableDynamicColumns
|
|
148
|
+
};
|