tm-table 1.1.11 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/vue2/tm-table.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.advanced-select[data-v-467dcdd3]{display:flex;max-width:305px}.advanced-select.hasField .select[data-v-467dcdd3]{width:206px;position:relative}.advanced-select.hasField .select[data-v-467dcdd3]:hover{z-index:1!important}.advanced-select.hasField[data-v-467dcdd3] .select--v2 .el-input__inner,.advanced-select.hasField[data-v-467dcdd3] .select--v3 .el-select__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.advanced-select .field-select[data-v-467dcdd3]{margin-right:-1px;width:100px;position:relative}.advanced-select .field-select[data-v-467dcdd3]:hover{z-index:1!important}.advanced-select[data-v-467dcdd3] .field-select--v2 .el-input__inner,.advanced-select[data-v-467dcdd3] .field-select--v3 .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.advanced-select .select[data-v-467dcdd3]{width:200px;flex-shrink:0}.advanced-select .select[data-v-467dcdd3] .el-tag--info{max-width:52%}.check-all-option[data-v-467dcdd3]{margin-top:-6px;padding:6px 20px;border-bottom:1px solid #ebeef5;cursor:default;position:sticky;top:0;z-index:1;background-color:#fff}.tm-icon[data-v-1c30ca93]{font-size:inherit;display:inline-block;height:1em;justify-content:center;line-height:1;position:relative;width:1em;fill:currentColor;color:inherit}.el-button .tm-icon{vertical-align:top}.el-table__row:hover .ellipsis-text-container .toolbar{display:flex;align-items:center;gap:2px}.el-table__row:hover .ellipsis-text-container .toolbar.multiline{display:block}.el-table__row:hover .ellipsis-text-container .toolbar .icon-item{flex-shrink:0}.el-table__row:hover .ellipsis-text-container .toolbar .icon-item:hover{color:var(--color-primary)!important}.ellipsis-text-container[data-v-0979131f]{text-align:left;display:inline-flex;vertical-align:top}.ellipsis-text-container .toolbar[data-v-0979131f]{display:none;max-width:30px}.ellipsis-text-container .toolbar .icon-item[data-v-0979131f]{cursor:pointer;margin-left:2px}.ellipsis-text-container .toolbar .icon-item[data-v-0979131f]:hover{opacity:.8}.ellipsis-text-container:hover .toolbar[data-v-0979131f]{display:flex;align-items:center;gap:2px}.ellipsis-text-container:hover .toolbar.multiline[data-v-0979131f]{display:block}.ellipsis-text-container:hover .toolbar .icon-item[data-v-0979131f]:hover{color:var(--color-primary)!important}.tm-advanced-input[data-v-6b474dac]{display:flex;align-items:center}.tm-advanced-input .left-select[data-v-6b474dac]{margin-right:-1px}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .left-select.el-select{margin-right:-1px;position:relative;z-index:2}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .left-select.el-select .el-input__inner{transition:0s;border-top-right-radius:0;border-bottom-right-radius:0}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input{position:relative;z-index:1}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input:focus-within,.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input:hover,.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input:focus{z-index:3}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input.has-label .el-input__inner{transition:0s;border-top-left-radius:0;border-bottom-left-radius:0}.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .left-select.el-select .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;position:relative;z-index:2;transition:0s}.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input .el-input__wrapper{position:relative;z-index:1;transition:0s}.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input .el-input__wrapper:focus-within,.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input .el-input__wrapper:hover,.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input .el-input__wrapper:focus{z-index:3}.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input.has-label .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.popover-content .popover-title[data-v-6b474dac]{font-weight:700;margin-bottom:5px}.popover-content .popover-subtitle[data-v-6b474dac]{font-size:12px;color:#909399;margin-top:0;margin-bottom:10px}.popover-content .popover-footer[data-v-6b474dac]{margin-top:10px;text-align:right}.tm-advanced-input--v3 .input-label[data-v-6b474dac]{border-right:none;color:var(--el-input-text-color, var(--el-text-color-regular))}.tm-advanced-input--v2 .input-label[data-v-6b474dac]{border-right:none;color:#606266}.input-label[data-v-6b474dac]{height:100%;flex-shrink:0;width:100px;font-size:12px;box-sizing:border-box;display:flex;align-items:center;line-height:12px;border-right:none;border-top-left-radius:4px;border-bottom-left-radius:4px;justify-content:flex-end;padding-right:4px}.tm-date-picker--v2[data-v-7d46d46b]{display:flex;align-items:center}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-select{margin-right:-1px;z-index:1}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-select .el-input__inner{border-top-right-radius:0;border-bottom-right-radius:0;transition:0s}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-date-editor.el-input__inner{border-top-left-radius:0!important;border-bottom-left-radius:0!important}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-date-editor{transition:0s}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-date-editor.is-active,.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-date-editor:hover{z-index:2}.tm-date-picker--v3[data-v-7d46d46b]{display:flex;align-items:center}.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-select{margin-right:-1px}.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-select .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;position:relative;z-index:2;transition:0s}.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor{position:relative;border-top-left-radius:0!important;border-bottom-left-radius:0!important;z-index:1;transition:0s}.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor.focus-within,.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor.focus,.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor.is-active,.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor:hover{z-index:2}.date-label[data-v-7d46d46b]{height:100%;flex-shrink:0;width:100px;font-size:12px;box-sizing:border-box;display:flex;align-items:center;line-height:12px;border-right:none;border-top-left-radius:4px;border-bottom-left-radius:4px;justify-content:flex-end;padding-right:4px;color:#606266}.tm-cascader--v2 .el-input--mini input{height:28px!important}.tm-cascader--v2 .el-cascader__tags .el-tag{margin:4px 0 4px 6px}.tm-cascader--v2 .el-cascader__tags .el-tag:first-child{max-width:90px}.tm-cascader--v2 .el-cascader__tags .el-tag:nth-child(2){max-width:48px}.tm-cascader--v2 .el-cascader__tags input{font-size:12px!important}.tm-cascader--v2 .el-cascader__tags .el-cascader__search-input{min-width:16px}.tm-cascader--v3 .el-cascader__tags{font-size:12px;flex-wrap:nowrap;align-items:center}.tm-cascader--v3 .el-cascader__tags .el-tag{padding:0 4px}.tm-cascader--v3 .el-cascader__tags .el-tag:first-child{max-width:90px}.tm-cascader--v3 .el-cascader__tags .el-tag:nth-child(2){max-width:48px}.tm-cascader--v3 .el-cascader__tags .el-cascader__search-input{min-width:16px}.el-cascader__collapse-tags{max-height:400px;max-width:400px;margin:0 -11px;padding:0 11px;overflow-y:auto;display:flex;flex-wrap:wrap;gap:4px}[data-v-61fed13d] .el-radio-button__inner{font-weight:400}.tm-radio[data-v-61fed13d]{width:200px;display:flex;width:100%}.tm-radio.wide-mode[data-v-61fed13d]{width:305px}.tm-radio--v2[data-v-61fed13d] .el-radio-group .el-radio-button{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tm-radio--v2[data-v-61fed13d] .el-radio-group .el-radio-button .el-radio-button__inner{padding:7px 5px;width:100%;display:inline-block;text-overflow:ellipsis;overflow:hidden;box-sizing:border-box;text-align:center}.tm-radio--v3[data-v-61fed13d] .el-radio-group .el-radio-button .el-radio-button__inner{width:100%}.tm-checkbox[data-v-b44866b1]{width:200px;display:flex;flex-direction:column}.tm-checkbox.wide-mode[data-v-b44866b1]{width:305px}.tm-checkbox--v2[data-v-b44866b1] .el-checkbox-group{display:flex;width:100%}.tm-checkbox--v2[data-v-b44866b1] .el-checkbox-group .el-checkbox-button{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tm-checkbox--v2[data-v-b44866b1] .el-checkbox-group .el-checkbox-button .el-checkbox-button__inner{padding:7px 5px;width:100%;display:inline-block;text-overflow:ellipsis;overflow:hidden;box-sizing:border-box;text-align:center}.tm-checkbox--v3[data-v-b44866b1] .el-checkbox-group .el-checkbox-button .el-checkbox-button__inner{width:100%}.tm-switch[data-v-9e7a342f]{display:flex;align-items:center}.tm-switch.narrow-container[data-v-9e7a342f]{width:95px}.tm-switch.medium-container[data-v-9e7a342f]{width:200px}.tm-switch.wide-container[data-v-9e7a342f]{width:305px}.tm-switch[data-v-9e7a342f] .el-switch .el-switch__core{flex-shrink:0}.table-search[data-v-4ec2388e]{--el-font-size-base: 12px}.table-search[data-v-4ec2388e] .el-select__wrapper,.table-search[data-v-4ec2388e] .el-switch__label{font-size:var(--el-font-size-base);font-weight:400}.table-search[data-v-4ec2388e] .el-radio-button__inner,.table-search[data-v-4ec2388e] .el-checkbox-button__inner{padding:9px 10px}.table-search[data-v-4ec2388e]{margin-bottom:10px;display:flex;flex-wrap:wrap;align-items:center}.table-search .search-content[data-v-4ec2388e]{flex:1;display:flex;align-items:center;flex-wrap:wrap;gap:10px}.table-search .search-actions[data-v-4ec2388e]{display:flex}.table-search .search-error-message[data-v-4ec2388e]{color:#f56c6c;font-size:12px;margin:5px 0}.table-search--v2 .search-form-item[data-v-4ec2388e]{height:28px}.table-search--v3 .search-form-item[data-v-4ec2388e]{height:24px}.tm-pagination[data-v-4dbdf6e7]{padding:10px 0;text-align:right;display:flex;flex-direction:row-reverse}.tm-table-menu[data-v-579dd2c3]{display:flex;justify-content:space-between;margin-bottom:10px}.tm-table-menu .left[data-v-579dd2c3]{flex:1;margin-right:10px;display:flex;flex-wrap:wrap;gap:4px 0}.tm-table-menu .right[data-v-579dd2c3]{flex-shrink:0}.column-config-popover{padding:0!important}.title[data-v-127cbd33]{display:flex;align-items:center;font-weight:700;color:#000;height:32px;padding-left:10px;padding-top:10px}.container[data-v-127cbd33]{height:500px;width:100%;display:flex;flex-direction:column;overflow:hidden}.container .main-container[data-v-127cbd33]{display:flex;flex:1;overflow:hidden;border-bottom:1px solid #dcdfe9}.container .main-container .left-content[data-v-127cbd33]{flex:2;border-right:1px solid #dcdfe9;display:flex;flex-direction:column}.container .main-container .left-content .option-list[data-v-127cbd33]{flex:1;overflow-y:auto}.container .main-container .right-content[data-v-127cbd33]{flex:1;overflow-y:auto;display:flex;flex-direction:column;overflow:hidden}.container .main-container .right-content .search-box[data-v-127cbd33]{display:flex;align-items:center;height:33px;border-bottom:1px solid #dcdfe9;box-sizing:border-box}.container .main-container .right-content .search-box[data-v-127cbd33] .el-input__inner{box-shadow:none;border:none}.container .main-container .right-content .search-box[data-v-127cbd33] .el-input__wrapper{box-shadow:none}.container .main-container .right-content .sort-list[data-v-127cbd33]{flex:1;overflow-y:auto}.container .main-container .right-content .sort-list .sort-item-wrapper[data-v-127cbd33]{position:relative;transition:background-color .2s}.container .main-container .right-content .sort-list .sort-item-wrapper[data-v-127cbd33]:hover{background-color:#e0eeff}.container .main-container .right-content .sort-list .sort-item-wrapper:hover .delete-button[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item-wrapper:hover .top-button[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item-wrapper:hover .left-fixed-btn[data-v-127cbd33]:not(.active-fixed),.container .main-container .right-content .sort-list .sort-item-wrapper:hover .right-fixed-btn[data-v-127cbd33]:not(.active-fixed){display:inline-block!important}.container .main-container .right-content .sort-list .sort-item-wrapper.no-drop-zone[data-v-127cbd33]{position:relative}.container .main-container .right-content .sort-list .sort-item-wrapper.no-drop-zone[data-v-127cbd33]:after{content:"";position:absolute;inset:0;background:#ff00001a;border:1px dashed #f56c6c;pointer-events:none}.container .main-container .right-content .sort-list .sort-item-wrapper.frozen[data-v-127cbd33]:hover,.container .main-container .right-content .sort-list .sort-item-wrapper.frozenRight[data-v-127cbd33]:hover{background-color:#e0eeff}.container .main-container .right-content .sort-list .sort-item[data-v-127cbd33]{display:flex;align-items:center;width:100%;height:32px;box-sizing:border-box;padding:0 8px;transition:.2s;user-select:none}.container .main-container .right-content .sort-list .sort-item .row-title[data-v-127cbd33]{cursor:grab;flex:1;margin-right:8px;display:flex;align-items:center;gap:4px}.container .main-container .right-content .sort-list .sort-item .operation-btns[data-v-127cbd33]{display:flex;align-items:center}.container .main-container .right-content .sort-list .sort-item .operation-btns .iconfont-button[data-v-127cbd33]{margin-left:3px;padding:0}.container .main-container .right-content .sort-list .sort-item .operation-btns .delete-button[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item .operation-btns .top-button[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item .operation-btns .left-fixed-btn[data-v-127cbd33]:not(.active-fixed),.container .main-container .right-content .sort-list .sort-item .operation-btns .right-fixed-btn[data-v-127cbd33]:not(.active-fixed){display:none}.container .main-container .right-content .sort-list .sort-item .operation-btns .left-fixed-btn.active-fixed[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item .operation-btns .right-fixed-btn.active-fixed[data-v-127cbd33]{display:inline-block;color:var(--el-color-primary)}.container .main-container .right-content .sort-list .sort-item .operation-btns .iconfont[data-v-127cbd33]{color:#aaa;font-size:14px}.container .main-container .right-content .sort-list .sort-item .operation-btns .iconfont[data-v-127cbd33]:hover{color:var(--el-color-primary)}.container .main-container .right-content .sort-list .sort-item .operation-btns .left-fixed-btn .el-icon-position[data-v-127cbd33]{transform:rotate(-90deg)}.container .main-container .right-content .sort-list .sort-item .operation-btns .left-fixed-btn:hover .el-icon-position[data-v-127cbd33]{color:var(--el-color-primary)}.container .main-container .right-content .sort-list .sort-item .operation-btns .right-fixed-btn .el-icon-position[data-v-127cbd33]{transform:rotate(90deg)}.container .main-container .right-content .sort-list .sort-item .operation-btns .right-fixed-btn:hover .el-icon-position[data-v-127cbd33]{color:var(--el-color-primary)}.container .footer[data-v-127cbd33]{padding:10px;box-sizing:border-box;display:flex;justify-content:space-between}.el-checkbox[data-v-127cbd33]{white-space:wrap;min-height:14px;height:auto;margin-top:10px;margin-left:10px;font-weight:400}.el-checkbox[data-v-127cbd33] .el-checkbox__label{width:70px;vertical-align:top}.blue-background-class[data-v-127cbd33]{background-color:#e0eeff!important;box-shadow:0 2px 8px #0000001a;z-index:1000}.sortable-drag[data-v-127cbd33]{opacity:.9;background-color:#e0eeff!important;box-shadow:0 2px 8px #0000001a}.tips[data-v-127cbd33]{color:#999;line-height:16px;font-size:12px;padding:8px}.tips span[data-v-127cbd33],.tips span span[data-v-127cbd33]{color:#999}.tm-table[data-v-8db1f265] .el-table .cell{word-break:keep-all;word-wrap:break-word}.icon-item[data-v-16643222]{cursor:pointer}.icon-item[data-v-16643222]:hover{opacity:.6}.tm-ellipsis-text[data-v-16643222]{position:relative;overflow:hidden}.tm-ellipsis-text .tm-ellipsis-text-wrapper[data-v-16643222]{width:100%}.tm-ellipsis-text .tm-ellipsis-text-wrapper .tm-ellipsis-line[data-v-16643222]{line-height:inherit;word-break:break-all;white-space:normal}.tm-ellipsis-text .tm-ellipsis-text-wrapper .tm-ellipsis-last-line[data-v-16643222]{display:flex;align-items:center;line-height:inherit}.tm-ellipsis-text .tm-ellipsis-text-wrapper .tm-ellipsis-last-line .tm-ellipsis-text-part[data-v-16643222]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.tm-ellipsis-text .tm-ellipsis-text-wrapper .tm-ellipsis-last-line .tm-ellipsis-toolbar-part[data-v-16643222]{flex-shrink:0;margin-left:4px;display:flex;align-items:center;line-height:inherit;font-size:inherit}.tm-ellipsis-measure[data-v-16643222]{position:absolute;left:-9999px;top:-9999px;visibility:hidden;pointer-events:none;z-index:-1}
|
|
1
|
+
@charset "UTF-8";.advanced-select[data-v-467dcdd3]{display:flex;max-width:305px}.advanced-select.hasField .select[data-v-467dcdd3]{width:206px;position:relative}.advanced-select.hasField .select[data-v-467dcdd3]:hover{z-index:1!important}.advanced-select.hasField[data-v-467dcdd3] .select--v2 .el-input__inner,.advanced-select.hasField[data-v-467dcdd3] .select--v3 .el-select__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.advanced-select .field-select[data-v-467dcdd3]{margin-right:-1px;width:100px;position:relative}.advanced-select .field-select[data-v-467dcdd3]:hover{z-index:1!important}.advanced-select[data-v-467dcdd3] .field-select--v2 .el-input__inner,.advanced-select[data-v-467dcdd3] .field-select--v3 .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.advanced-select .select[data-v-467dcdd3]{width:200px;flex-shrink:0}.advanced-select .select[data-v-467dcdd3] .el-tag--info{max-width:52%}.check-all-option[data-v-467dcdd3]{margin-top:-6px;padding:6px 20px;border-bottom:1px solid #ebeef5;cursor:default;position:sticky;top:0;z-index:1;background-color:#fff}.tm-icon[data-v-1c30ca93]{font-size:inherit;display:inline-block;height:1em;justify-content:center;line-height:1;position:relative;width:1em;fill:currentColor;color:inherit}.el-button .tm-icon{vertical-align:top}.el-table__row:hover .ellipsis-text-container .toolbar{display:flex;align-items:center;gap:2px}.el-table__row:hover .ellipsis-text-container .toolbar.multiline{display:block}.el-table__row:hover .ellipsis-text-container .toolbar .icon-item{flex-shrink:0}.el-table__row:hover .ellipsis-text-container .toolbar .icon-item:hover{color:var(--color-primary)!important}.ellipsis-text-container[data-v-0979131f]{text-align:left;display:inline-flex;vertical-align:top}.ellipsis-text-container .toolbar[data-v-0979131f]{display:none;max-width:30px}.ellipsis-text-container .toolbar .icon-item[data-v-0979131f]{cursor:pointer;margin-left:2px}.ellipsis-text-container .toolbar .icon-item[data-v-0979131f]:hover{opacity:.8}.ellipsis-text-container:hover .toolbar[data-v-0979131f]{display:flex;align-items:center;gap:2px}.ellipsis-text-container:hover .toolbar.multiline[data-v-0979131f]{display:block}.ellipsis-text-container:hover .toolbar .icon-item[data-v-0979131f]:hover{color:var(--color-primary)!important}.tm-advanced-input[data-v-6b474dac]{display:flex;align-items:center}.tm-advanced-input .left-select[data-v-6b474dac]{margin-right:-1px}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .left-select.el-select{margin-right:-1px;position:relative;z-index:2}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .left-select.el-select .el-input__inner{transition:0s;border-top-right-radius:0;border-bottom-right-radius:0}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input{position:relative;z-index:1}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input:focus-within,.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input:hover,.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input:focus{z-index:3}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input.has-label .el-input__inner{transition:0s;border-top-left-radius:0;border-bottom-left-radius:0}.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .left-select.el-select .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;position:relative;z-index:2;transition:0s}.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input .el-input__wrapper{position:relative;z-index:1;transition:0s}.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input .el-input__wrapper:focus-within,.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input .el-input__wrapper:hover,.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input .el-input__wrapper:focus{z-index:3}.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input.has-label .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.popover-content .popover-title[data-v-6b474dac]{font-weight:700;margin-bottom:5px}.popover-content .popover-subtitle[data-v-6b474dac]{font-size:12px;color:#909399;margin-top:0;margin-bottom:10px}.popover-content .popover-footer[data-v-6b474dac]{margin-top:10px;text-align:right}.tm-advanced-input--v3 .input-label[data-v-6b474dac]{border-right:none;color:var(--el-input-text-color, var(--el-text-color-regular))}.tm-advanced-input--v2 .input-label[data-v-6b474dac]{border-right:none;color:#606266}.input-label[data-v-6b474dac]{height:100%;flex-shrink:0;width:100px;font-size:12px;box-sizing:border-box;display:flex;align-items:center;line-height:12px;border-right:none;border-top-left-radius:4px;border-bottom-left-radius:4px;justify-content:flex-end;padding-right:4px}.tm-date-picker--v2[data-v-7d46d46b]{display:flex;align-items:center}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-select{margin-right:-1px;z-index:1}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-select .el-input__inner{border-top-right-radius:0;border-bottom-right-radius:0;transition:0s}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-date-editor.el-input__inner{border-top-left-radius:0!important;border-bottom-left-radius:0!important}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-date-editor{transition:0s}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-date-editor.is-active,.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-date-editor:hover{z-index:2}.tm-date-picker--v3[data-v-7d46d46b]{display:flex;align-items:center}.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-select{margin-right:-1px}.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-select .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;position:relative;z-index:2;transition:0s}.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor{position:relative;border-top-left-radius:0!important;border-bottom-left-radius:0!important;z-index:1;transition:0s}.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor.focus-within,.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor.focus,.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor.is-active,.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor:hover{z-index:2}.date-label[data-v-7d46d46b]{height:100%;flex-shrink:0;width:100px;font-size:12px;box-sizing:border-box;display:flex;align-items:center;line-height:12px;border-right:none;border-top-left-radius:4px;border-bottom-left-radius:4px;justify-content:flex-end;padding-right:4px;color:#606266}.tm-cascader--v2 .el-input--mini input{height:28px!important}.tm-cascader--v2 .el-cascader__tags .el-tag{margin:4px 0 4px 6px}.tm-cascader--v2 .el-cascader__tags .el-tag:first-child{max-width:90px}.tm-cascader--v2 .el-cascader__tags .el-tag:nth-child(2){max-width:48px}.tm-cascader--v2 .el-cascader__tags input{font-size:12px!important}.tm-cascader--v2 .el-cascader__tags .el-cascader__search-input{min-width:16px}.tm-cascader--v3 .el-cascader__tags{font-size:12px;flex-wrap:nowrap;align-items:center}.tm-cascader--v3 .el-cascader__tags .el-tag{padding:0 4px}.tm-cascader--v3 .el-cascader__tags .el-tag:first-child{max-width:90px}.tm-cascader--v3 .el-cascader__tags .el-tag:nth-child(2){max-width:48px}.tm-cascader--v3 .el-cascader__tags .el-cascader__search-input{min-width:16px}.el-cascader__collapse-tags{max-height:400px;max-width:400px;margin:0 -11px;padding:0 11px;overflow-y:auto;display:flex;flex-wrap:wrap;gap:4px}[data-v-61fed13d] .el-radio-button__inner{font-weight:400}.tm-radio[data-v-61fed13d]{width:200px;display:flex;width:100%}.tm-radio.wide-mode[data-v-61fed13d]{width:305px}.tm-radio--v2[data-v-61fed13d] .el-radio-group .el-radio-button{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tm-radio--v2[data-v-61fed13d] .el-radio-group .el-radio-button .el-radio-button__inner{padding:7px 5px;width:100%;display:inline-block;text-overflow:ellipsis;overflow:hidden;box-sizing:border-box;text-align:center}.tm-radio--v3[data-v-61fed13d] .el-radio-group .el-radio-button .el-radio-button__inner{width:100%}.tm-checkbox[data-v-b44866b1]{width:200px;display:flex;flex-direction:column}.tm-checkbox.wide-mode[data-v-b44866b1]{width:305px}.tm-checkbox--v2[data-v-b44866b1] .el-checkbox-group{display:flex;width:100%}.tm-checkbox--v2[data-v-b44866b1] .el-checkbox-group .el-checkbox-button{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tm-checkbox--v2[data-v-b44866b1] .el-checkbox-group .el-checkbox-button .el-checkbox-button__inner{padding:7px 5px;width:100%;display:inline-block;text-overflow:ellipsis;overflow:hidden;box-sizing:border-box;text-align:center}.tm-checkbox--v3[data-v-b44866b1] .el-checkbox-group .el-checkbox-button .el-checkbox-button__inner{width:100%}.tm-switch[data-v-9e7a342f]{display:flex;align-items:center}.tm-switch.narrow-container[data-v-9e7a342f]{width:95px}.tm-switch.medium-container[data-v-9e7a342f]{width:200px}.tm-switch.wide-container[data-v-9e7a342f]{width:305px}.tm-switch[data-v-9e7a342f] .el-switch .el-switch__core{flex-shrink:0}.table-search[data-v-54d5e2a2]{--el-font-size-base: 12px}.table-search[data-v-54d5e2a2] .el-select__wrapper,.table-search[data-v-54d5e2a2] .el-switch__label{font-size:var(--el-font-size-base);font-weight:400}.table-search[data-v-54d5e2a2] .el-radio-button__inner,.table-search[data-v-54d5e2a2] .el-checkbox-button__inner{padding:9px 10px}.table-search[data-v-54d5e2a2]{margin-bottom:10px;display:flex;flex-wrap:wrap;align-items:center}.table-search .search-content[data-v-54d5e2a2]{flex:1;display:flex;align-items:center;flex-wrap:wrap;gap:10px}.table-search .search-actions[data-v-54d5e2a2]{display:flex}.table-search .search-error-message[data-v-54d5e2a2]{color:#f56c6c;font-size:12px;margin:5px 0}.table-search--v2 .search-form-item[data-v-54d5e2a2]{height:28px}.table-search--v3 .search-form-item[data-v-54d5e2a2]{height:24px}.tm-pagination[data-v-4dbdf6e7]{padding:10px 0;text-align:right;display:flex;flex-direction:row-reverse}.tm-table-menu[data-v-579dd2c3]{display:flex;justify-content:space-between;margin-bottom:10px}.tm-table-menu .left[data-v-579dd2c3]{flex:1;margin-right:10px;display:flex;flex-wrap:wrap;gap:4px 0}.tm-table-menu .right[data-v-579dd2c3]{flex-shrink:0}.column-config-popover{padding:0!important}.title[data-v-127cbd33]{display:flex;align-items:center;font-weight:700;color:#000;height:32px;padding-left:10px;padding-top:10px}.container[data-v-127cbd33]{height:500px;width:100%;display:flex;flex-direction:column;overflow:hidden}.container .main-container[data-v-127cbd33]{display:flex;flex:1;overflow:hidden;border-bottom:1px solid #dcdfe9}.container .main-container .left-content[data-v-127cbd33]{flex:2;border-right:1px solid #dcdfe9;display:flex;flex-direction:column}.container .main-container .left-content .option-list[data-v-127cbd33]{flex:1;overflow-y:auto}.container .main-container .right-content[data-v-127cbd33]{flex:1;overflow-y:auto;display:flex;flex-direction:column;overflow:hidden}.container .main-container .right-content .search-box[data-v-127cbd33]{display:flex;align-items:center;height:33px;border-bottom:1px solid #dcdfe9;box-sizing:border-box}.container .main-container .right-content .search-box[data-v-127cbd33] .el-input__inner{box-shadow:none;border:none}.container .main-container .right-content .search-box[data-v-127cbd33] .el-input__wrapper{box-shadow:none}.container .main-container .right-content .sort-list[data-v-127cbd33]{flex:1;overflow-y:auto}.container .main-container .right-content .sort-list .sort-item-wrapper[data-v-127cbd33]{position:relative;transition:background-color .2s}.container .main-container .right-content .sort-list .sort-item-wrapper[data-v-127cbd33]:hover{background-color:#e0eeff}.container .main-container .right-content .sort-list .sort-item-wrapper:hover .delete-button[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item-wrapper:hover .top-button[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item-wrapper:hover .left-fixed-btn[data-v-127cbd33]:not(.active-fixed),.container .main-container .right-content .sort-list .sort-item-wrapper:hover .right-fixed-btn[data-v-127cbd33]:not(.active-fixed){display:inline-block!important}.container .main-container .right-content .sort-list .sort-item-wrapper.no-drop-zone[data-v-127cbd33]{position:relative}.container .main-container .right-content .sort-list .sort-item-wrapper.no-drop-zone[data-v-127cbd33]:after{content:"";position:absolute;inset:0;background:#ff00001a;border:1px dashed #f56c6c;pointer-events:none}.container .main-container .right-content .sort-list .sort-item-wrapper.frozen[data-v-127cbd33]:hover,.container .main-container .right-content .sort-list .sort-item-wrapper.frozenRight[data-v-127cbd33]:hover{background-color:#e0eeff}.container .main-container .right-content .sort-list .sort-item[data-v-127cbd33]{display:flex;align-items:center;width:100%;height:32px;box-sizing:border-box;padding:0 8px;transition:.2s;user-select:none}.container .main-container .right-content .sort-list .sort-item .row-title[data-v-127cbd33]{cursor:grab;flex:1;margin-right:8px;display:flex;align-items:center;gap:4px}.container .main-container .right-content .sort-list .sort-item .operation-btns[data-v-127cbd33]{display:flex;align-items:center}.container .main-container .right-content .sort-list .sort-item .operation-btns .iconfont-button[data-v-127cbd33]{margin-left:3px;padding:0}.container .main-container .right-content .sort-list .sort-item .operation-btns .delete-button[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item .operation-btns .top-button[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item .operation-btns .left-fixed-btn[data-v-127cbd33]:not(.active-fixed),.container .main-container .right-content .sort-list .sort-item .operation-btns .right-fixed-btn[data-v-127cbd33]:not(.active-fixed){display:none}.container .main-container .right-content .sort-list .sort-item .operation-btns .left-fixed-btn.active-fixed[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item .operation-btns .right-fixed-btn.active-fixed[data-v-127cbd33]{display:inline-block;color:var(--el-color-primary)}.container .main-container .right-content .sort-list .sort-item .operation-btns .iconfont[data-v-127cbd33]{color:#aaa;font-size:14px}.container .main-container .right-content .sort-list .sort-item .operation-btns .iconfont[data-v-127cbd33]:hover{color:var(--el-color-primary)}.container .main-container .right-content .sort-list .sort-item .operation-btns .left-fixed-btn .el-icon-position[data-v-127cbd33]{transform:rotate(-90deg)}.container .main-container .right-content .sort-list .sort-item .operation-btns .left-fixed-btn:hover .el-icon-position[data-v-127cbd33]{color:var(--el-color-primary)}.container .main-container .right-content .sort-list .sort-item .operation-btns .right-fixed-btn .el-icon-position[data-v-127cbd33]{transform:rotate(90deg)}.container .main-container .right-content .sort-list .sort-item .operation-btns .right-fixed-btn:hover .el-icon-position[data-v-127cbd33]{color:var(--el-color-primary)}.container .footer[data-v-127cbd33]{padding:10px;box-sizing:border-box;display:flex;justify-content:space-between}.el-checkbox[data-v-127cbd33]{white-space:wrap;min-height:14px;height:auto;margin-top:10px;margin-left:10px;font-weight:400}.el-checkbox[data-v-127cbd33] .el-checkbox__label{width:70px;vertical-align:top}.blue-background-class[data-v-127cbd33]{background-color:#e0eeff!important;box-shadow:0 2px 8px #0000001a;z-index:1000}.sortable-drag[data-v-127cbd33]{opacity:.9;background-color:#e0eeff!important;box-shadow:0 2px 8px #0000001a}.tips[data-v-127cbd33]{color:#999;line-height:16px;font-size:12px;padding:8px}.tips span[data-v-127cbd33],.tips span span[data-v-127cbd33]{color:#999}.tm-table[data-v-8db1f265] .el-table .cell{word-break:keep-all;word-wrap:break-word}.icon-item[data-v-16643222]{cursor:pointer}.icon-item[data-v-16643222]:hover{opacity:.6}.tm-ellipsis-text[data-v-16643222]{position:relative;overflow:hidden}.tm-ellipsis-text .tm-ellipsis-text-wrapper[data-v-16643222]{width:100%}.tm-ellipsis-text .tm-ellipsis-text-wrapper .tm-ellipsis-line[data-v-16643222]{line-height:inherit;word-break:break-all;white-space:normal}.tm-ellipsis-text .tm-ellipsis-text-wrapper .tm-ellipsis-last-line[data-v-16643222]{display:flex;align-items:center;line-height:inherit}.tm-ellipsis-text .tm-ellipsis-text-wrapper .tm-ellipsis-last-line .tm-ellipsis-text-part[data-v-16643222]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.tm-ellipsis-text .tm-ellipsis-text-wrapper .tm-ellipsis-last-line .tm-ellipsis-toolbar-part[data-v-16643222]{flex-shrink:0;margin-left:4px;display:flex;align-items:center;line-height:inherit;font-size:inherit}.tm-ellipsis-measure[data-v-16643222]{position:absolute;left:-9999px;top:-9999px;visibility:hidden;pointer-events:none;z-index:-1}
|
package/dist/vue2/tm-table.es.js
CHANGED
|
@@ -1568,7 +1568,7 @@ const mt = ft.exports, { t: gt } = b(), bt = !0, yt = !1, vt = [
|
|
|
1568
1568
|
},
|
|
1569
1569
|
hasDefaultSlot() {
|
|
1570
1570
|
const t = this.$slots.default;
|
|
1571
|
-
return t ? this.isVue2 ? !!t : t()[0].children.length > 0 : !1;
|
|
1571
|
+
return t ? this.isVue2 ? Array.isArray(t) ? t.some((e) => !e.data || !e.data.slot) : !!t : t()[0].children.length > 0 : !1;
|
|
1572
1572
|
},
|
|
1573
1573
|
handleUpdate(t, e, s) {
|
|
1574
1574
|
const i = this.getFieldValue(t, s);
|
|
@@ -1700,7 +1700,7 @@ var xt = function() {
|
|
|
1700
1700
|
_t,
|
|
1701
1701
|
!1,
|
|
1702
1702
|
null,
|
|
1703
|
-
"
|
|
1703
|
+
"54d5e2a2"
|
|
1704
1704
|
);
|
|
1705
1705
|
const U = St.exports, Tt = !0, $t = {
|
|
1706
1706
|
name: "TablePagination",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(r,d){typeof exports=="object"&&typeof module!="undefined"?d(exports,require("vue"),require("sortablejs")):typeof define=="function"&&define.amd?define(["exports","vue","sortablejs"],d):(r=typeof globalThis!="undefined"?globalThis:r||self,d(r.TmTable={},r.Vue,r.Sortable))})(this,function(r,d,u){"use strict";var ls=Object.defineProperty,ns=Object.defineProperties;var rs=Object.getOwnPropertyDescriptors;var F=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var q=(r,d,u)=>d in r?ls(r,d,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[d]=u,h=(r,d)=>{for(var u in d||(d={}))K.call(d,u)&&q(r,u,d[u]);if(F)for(var u of F(d))Q.call(d,u)&&q(r,u,d[u]);return r},_=(r,d)=>ns(r,rs(d));var G=(r,d)=>{var u={};for(var m in r)K.call(r,m)&&d.indexOf(m)<0&&(u[m]=r[m]);if(r!=null&&F)for(var m of F(r))d.indexOf(m)<0&&Q.call(r,m)&&(u[m]=r[m]);return u};const m=t=>t,v=()=>"mini",Y={today:"今天",yesterday:"昨天",last7days:"最近7天",last30days:"最近30天",thisMonth:"本月",lastMonth:"上月",checkAll:"全选",search:"搜索",query:"查询",reset:"重置",columnSetting:"列设置",refresh:"刷新",cancel:"取消",fixedLeft:"固定在左侧",fixedRight:"固定在右侧",top:"置顶",restoreDefault:"恢复默认",saveAndApply:"保存并应用",startDate:"开始日期",endDate:"结束日期",all:"全选",SelectableFields:"可选择字段",fixedColumns:"固定列",leftmost:"左侧最多",rightmost:"右侧最多",items:"项",accurateSearchTips:"每行一个,支持多个值",accurateSearchPlaceholder:"精确搜索,一行一项",selectPlaceholder:"请选择",clear:"清空",saveSuccess:"保存成功",cancelRightFixed:"取消右侧固定",rightFixed:"固定到右侧",cancelLeftFixed:"取消左侧固定",leftFixed:"固定到左侧",cancelTop:"取消置顶",copySuccess:"复制成功",copyFailed:"复制失败"},X={today:"Today",yesterday:"Yesterday",last7days:"Last 7 days",last30days:"Last 30 days",thisMonth:"This month",lastMonth:"Last month",checkAll:"Check all",search:"Search",query:"Search",reset:"Reset",columnSetting:"Column Setting",refresh:"Refresh",cancel:"Cancel",fixedLeft:"Fixed left",fixedRight:"Fixed right",top:"Top",restoreDefault:"Restore default",saveAndApply:"Save and apply",startDate:"Start date",endDate:"End date",all:"All",SelectableFields:"Fields",fixedColumns:"Fixed columns",leftmost:"Leftmost",rightmost:"Rightmost",items:"item(s)",accurateSearchTips:"One per line, supporting multiple values",accurateSearchPlaceholder:"Accurate search, one per line",selectPlaceholder:"Please select",clear:"Clear",saveSuccess:"Successfully saved",cancelRightFixed:"Cancel right fixed",rightFixed:"Fixed to right",cancelLeftFixed:"Cancel left fixed",leftFixed:"Fixed to left",cancelTop:"Cancel top",copySuccess:"Copy successfully",copyFailed:"Copy failed"};var j;const Z={"zh-CN":Y,"en-US":X};let x={value:"zh-CN"};{const t=require("vue");t.observable||(j=t.default)!=null&&j.observable?x=t.default.observable(x):x=new t({data(){return{currentLang:x}}}).$data.currentLang}const ee=t=>{var e;return((e=Z[x.value])==null?void 0:e[t])||t},$=t=>{x.value=t},y=()=>({t:ee,setLang:$,currentLang:x});function p(t,e,s,i,a,l,n,c){var o=typeof t=="function"?t.options:t;return e&&(o.render=e,o.staticRenderFns=s,o._compiled=!0),l&&(o._scopeId="data-v-"+l),{exports:t,options:o}}const te=!0,se=!1,k="value",ie="input",ae={name:"TmSelectFilter",props:{[k]:{type:[String,Number,Array],default:""},field:{type:[String,Number],default:""},options:{type:[Array,Function],default:()=>[]},labelOptions:{type:Array,default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value"})},filterable:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},showCheckAll:{type:Boolean,default:!0},placeholder:{type:String,default:""}},data(){return{t:y().t,isVue2:te,isVue3:se,getDefaultSize:v,optionsList:[],loading:!1,indeterminate:!1,checkAll:!1,activedSelect:""}},computed:{computedValue:{get(){return this[k]},set(t){this.$emit(ie,t),this.$emit("change",t)}},fieldValue:{get(){return this.field},set(t){this.$emit("field-change",t)}},propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}}},watch:{[k](t){!this.multiple||!this.showCheckAll||(t.length===0?(this.checkAll=!1,this.indeterminate=!1):t.length===this.optionsList.length?(this.checkAll=!0,this.indeterminate=!1):this.indeterminate=!0)}},created(){this.initOptions()},methods:{async initOptions(){if(Array.isArray(this.options))this.optionsList=this.options;else if(typeof this.options=="function")try{this.loading=!0;const t=await this.options();Array.isArray(t)&&(this.optionsList=t)}catch(t){console.error(t)}finally{this.loading=!1}},handleCheckAll(t){this.indeterminate=!1;let e=[];t&&(e=this.optionsList.map(s=>s[this.propMap.value])),this.computedValue=e},setActivedSelect(t){this.activedSelect=t}}};var le=function(){var e=this,s=e._self._c;return s("div",{staticClass:"advanced-select",class:{hasField:e.labelOptions&&e.labelOptions.length>0}},[e.labelOptions&&e.labelOptions.length>0?s("el-select",{staticClass:"field-select",class:`field-select--${e.isVue2?"v2":"v3"}`,style:`z-index:${e.activedSelect==="left"?2:0}`,attrs:{size:e.getDefaultSize()},on:{focus:function(i){return e.setActivedSelect("left")}},model:{value:e.fieldValue,callback:function(i){e.fieldValue=i},expression:"fieldValue"}},e._l(e.labelOptions,function(i){return s("el-option",{key:i.value,attrs:{label:i.label,value:i.value}})}),1):e._e(),s("el-select",e._g(e._b({ref:"select",staticClass:"select",class:`select--${e.isVue3?"v3":"v2"}`,style:`z-index:${e.activedSelect==="right"?2:0}`,attrs:{loading:e.loading},on:{focus:function(i){return e.setActivedSelect("right")}},scopedSlots:e._u([{key:"header",fn:function(){return[e.isVue3&&e.multiple&&e.showCheckAll?s("el-checkbox",{staticStyle:{width:"100%",height:"20px","padding-left":"10px"},attrs:{indeterminate:e.indeterminate,size:e.getDefaultSize()},on:{change:e.handleCheckAll},model:{value:e.checkAll,callback:function(i){e.checkAll=i},expression:"checkAll"}},[e._v(e._s(e.t("all")))]):e._e()]},proxy:!0}]),model:{value:e.computedValue,callback:function(i){e.computedValue=i},expression:"computedValue"}},"el-select",_(h({},e.$attrs),{size:e.getDefaultSize(),filterable:e.filterable,clearable:e.clearable,collapseTags:e.collapseTags,multiple:e.multiple,placeholder:e.placeholder,loading:e.loading}),!1),e.isVue2?e.$listeners:{}),[e.isVue2&&e.multiple&&e.showCheckAll?s("div",{staticClass:"check-all-option"},[s("el-checkbox",{staticStyle:{width:"100%"},attrs:{indeterminate:e.indeterminate,size:e.getDefaultSize()},on:{change:e.handleCheckAll},model:{value:e.checkAll,callback:function(i){e.checkAll=i},expression:"checkAll"}},[e._v(e._s(e.t("all")))])],1):e._e(),e._l(e.optionsList,function(i){return s("el-option",{key:i[e.propMap.value],attrs:{label:i[e.propMap.label],value:i[e.propMap.value],disabled:i.disabled}},[e._t("option",function(){return[e._v(e._s(i[e.propMap.label]))]},{item:i})],2)})],2)],1)},ne=[],re=p(ae,le,ne,!1,null,"467dcdd3");const z=re.exports,oe={name:"BaseIcon",props:{path:{type:String},size:{type:[String,Number]},color:{type:String}},methods:{handleClick(){this.$emit("click")}}};var ue=function(){var e=this,s=e._self._c;return s("i",{staticClass:"tm-icon",on:{click:e.handleClick}},[s("svg",{style:{color:e.color},attrs:{width:e.size,height:e.size,viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"}},[s("path",{attrs:{d:e.path}})])])},ce=[],de=p(oe,ue,ce,!1,null,"1c30ca93");const he=de.exports,b=Object.entries({menu:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z",more:"M76.92892277 192.94787572h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758118s-23.20379058-46.40758118-46.40758118-46.40758116H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758116s23.20379058 46.40758118 46.40758264 46.40758118zM941.27013031 465.59241882H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758118s23.20379058 46.40758118 46.40758264 46.40758118h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758118s-23.20379058-46.40758118-46.40758118-46.40758118zM941.27013031 825.25117589H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758118s23.20379058 46.40758118 46.40758264 46.40758264h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758264s-23.20379058-46.40758118-46.40758118-46.40758118z",refresh:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z",move:"M238.93333333 102.4a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0zM238.93333333 375.46666667a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m-409.6 273.06666666a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m-341.33333333 204.8a68.26666667 68.26666667 0 1 0 0 136.53333334 68.26666667 68.26666667 0 0 0 0-136.53333334z m341.33333333 68.26666667a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z","column-setting":"M436.05333334 18.36373333a109.22666667 109.22666667 0 0 1 109.22666666 0l345.56586667 199.54346667c33.792 19.52426667 54.61333333 55.56906667 54.61333333 94.54933333V580.26666667h-81.92V312.45653333a27.30666667 27.30666667 0 0 0-13.65333333-23.62026666L504.32 89.2928a27.30666667 27.30666667 0 0 0-27.30666666 0L131.44746667 288.83626667a27.30666667 27.30666667 0 0 0-13.65333333 23.62026666v399.08693334a27.30666667 27.30666667 0 0 0 13.65333333 23.62026666L477.01333334 934.7072a27.30666667 27.30666667 0 0 0 27.30666666 0l54.61333334-31.5392v94.54933333l-13.65333334 7.91893334a109.22666667 109.22666667 0 0 1-109.22666666 0l-345.56586667-199.54346667a109.22666667 109.22666667 0 0 1-54.61333333-94.54933333V312.45653333c0-38.98026667 20.82133333-75.09333333 54.61333333-94.54933333L436.05333334 18.36373333z","fixed-left":"M843.36363653 311.54545478l-53.18181827 1e-8-20.45454521 28.63636347-163.63636435 204.54545479-24.54545391 28.63636347 12.27272695 36.81818175c8.18181826 28.63636347 12.27272695 57.27272695 12.27272696 85.90909042 0 32.72727305-4.09090869 61.36363652-16.36363565 90-4.09090869 16.36363653-12.27272695 32.72727306-24.54545479 49.09090957l-163.63636347-163.63636347-40.90909131-40.90909132-12.27272695-12.27272695-163.63636348-163.63636347c28.63636347-16.36363653 61.36363652-28.63636347 94.09090869-32.72727305 45-8.18181826 90-4.09090869 134.99999999 8.18181826l36.81818175 12.27272695 28.63636347-24.54545391 204.54545479-163.63636435 28.63636347-16.36363564 0-32.72727305L712.45454521 184.72727305l130.90909132 126.81818173zM941.54545479 327.90909131c0-8.18181826-4.09090869-16.36363653-8.18181826-24.54545478L720.63636348 94.72727305c-12.27272695-16.36363653-36.81818174-12.27272695-49.09090869 4.0909087-20.45454521 28.63636347-28.63636347 65.45454521-28.63636348 98.18181825l0 4.09090869-204.54545478 163.63636436c-110.45454521-36.81818174-233.18181826-16.36363653-327.27272784 61.36363564-8.18181826 8.18181826-12.27272695 16.36363653-12.27272694 24.54545478 0 8.18181826 4.09090869 16.36363653 8.18181825 24.5454548l196.36363653 196.36363652-212.72727305 212.72727216c-4.09090869 4.09090869-8.18181826 12.27272695-8.18181826 20.4545461s4.09090869 16.36363653 8.18181826 20.4545452c12.27272695 12.27272695 32.72727306 12.27272695 45 1e-8L352.45454522 716.54545479l196.36363652 196.36363652c12.27272695 12.27272695 36.81818174 12.27272695 49.09090957-4.09090957C651.09090869 847.45454521 675.63636347 773.81818174 675.63636346 696.09090869c0-36.81818173-4.09090869-73.63636348-16.36363651-106.36363564l163.63636436-204.54545479c36.81818173 0 73.63636348-8.18181826 106.36363564-28.63636347C937.45454519 348.36363653 941.54545478 336.09090869 941.54545479 327.90909131z","fixed-right":"M311.54545479 180.63636347v53.18181827l28.63636347 20.45454521 204.54545479 163.63636436 28.63636347 24.5454539 36.81818174-12.27272695c28.63636347-8.18181826 57.27272695-12.27272695 85.90909043-12.27272695 32.72727305 0 61.36363652 4.09090869 90 16.36363564 16.36363653 4.09090869 32.72727305 12.27272695 49.09090957 24.54545479l-163.63636347 163.63636347-40.90909132 40.90909131-12.27272695 12.27272695-163.63636347 163.63636348c-16.36363653-28.63636347-28.63636347-61.36363652-32.72727305-94.09090869-8.18181826-45-4.09090869-90 8.18181826-135l12.27272695-36.81818174-24.5454539-28.63636347-163.63636436-204.54545479-16.36363564-28.63636347h-32.72727305H184.72727305l126.81818174-130.90909132zM327.90909131 82.45454521c-8.18181826 0-16.36363653 4.09090869-24.54545478 8.18181826L94.72727305 303.36363652c-16.36363653 12.27272695-12.27272695 36.81818174 4.09090869 49.09090869 28.63636347 20.45454521 65.45454521 28.63636347 98.18181826 28.63636348h4.09090869l163.63636436 204.54545478c-36.81818174 110.45454521-16.36363653 233.18181826 61.36363564 327.27272784 8.18181826 8.18181826 16.36363653 12.27272695 24.54545478 12.27272695 8.18181826 0 16.36363653-4.09090869 24.54545479-8.18181826l196.36363653-196.36363653 212.72727216 212.72727305c4.09090869 4.09090869 12.27272695 8.18181826 20.4545461 8.18181827s16.36363653-4.09090869 20.45454521-8.18181827c12.27272695-12.27272695 12.27272695-32.72727305 0-45L716.54545479 671.54545479l196.36363652-196.36363653c12.27272695-12.27272695 12.27272695-36.81818174-4.09090957-49.09090957C847.45454521 372.90909131 773.81818174 348.36363653 696.09090869 348.36363653c-36.81818174 0-73.63636348 4.09090869-106.36363564 16.36363652l-204.54545479-163.63636436c0-36.81818174-8.18181826-73.63636348-28.63636347-106.36363564C348.36363653 86.54545479 336.09090869 82.45454521 327.90909131 82.45454521z",upload:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248z",download:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z",delete:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32",copy:"M128 320v576h576V320zm-32-64h640a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V288a32 32 0 0 1 32-32M960 96v704a32 32 0 0 1-32 32h-96v-64h64V128H384v64h-64V96a32 32 0 0 1 32-32h576a32 32 0 0 1 32 32M256 672h320v64H256zm0-192h320v64H256z"}).reduce((t,[e,s])=>{const i=`${e}Icon`,a={name:i,props:{path:{type:String,default:s},size:{type:[String,Number]},color:{type:String}},render(l){return l(he,{props:this.$props,on:{click:()=>this.$emit("click")}})}};return a.install=l=>{l.component(i,a)},t[e]=a,t},{}),pe=b.menu,fe=b.refresh,me=b.move;b["column-setting"];const ge=b.more,be=b["fixed-left"],ve=b["fixed-right"],ye=b.upload,Ce=b.download,_e=b.delete,U=b.copy,{t:L}=y(),xe=!0,Se=!1,Te={name:"TmEllipsisText",components:{CopyIcon:U},props:{text:{type:String,required:!0},width:{type:[String,Number],default:"auto"},maxWidth:{type:[String,Number],default:"100%"},lines:{type:Number,default:1},showTooltip:{type:Boolean,default:!0},lineHeight:{type:[String,Number]},copyable:{type:Boolean,default:!1}},data(){return{isVue2:xe,isVue3:Se,isOverflow:!1,currentLines:1,resizeObserver:null}},computed:{tooltipDisabled(){return!this.showTooltip||!this.isOverflow},textStyle(){const t=typeof this.width=="number"?`${this.width}px`:this.width,e=typeof this.maxWidth=="number"?`${this.maxWidth}px`:this.maxWidth;return{width:t,maxWidth:e,lineHeight:this.lineHeight,display:"-webkit-inline-box",overflow:"hidden",WebkitBoxOrient:"vertical",WebkitLineClamp:this.lines}}},mounted(){this.checkOverflow(),this.setupResizeObserver()},beforeDestroy(){this.cleanupResizeObserver()},beforeUnmount(){this.cleanupResizeObserver()},watch:{text(){this.$nextTick(this.checkOverflow)}},methods:{checkOverflow(){this.$refs.textEl&&this.$nextTick(()=>{this.$nextTick(()=>{this.performOverflowCheck()})})},performOverflowCheck(){var f;const t=this.$refs.textEl;if(!t)return;const e=getComputedStyle(t);if(!e.width||e.width==="0px"){this.$nextTick(()=>{this.performOverflowCheck()});return}const s=t.scrollHeight,i=t.scrollWidth,a=t.clientHeight,l=t.clientWidth,n=1,c=s>a+n,o=i>l+n;if(c||o){this.isOverflow=!0;const C=parseFloat(e.lineHeight)||16;this.currentLines=Math.ceil(s/C)}else{const C=t.getBoundingClientRect(),T=(f=t.parentElement)==null?void 0:f.getBoundingClientRect();if(T){const as=C.height>T.height||C.width>T.width;this.isOverflow=as}else this.isOverflow=!1;this.currentLines=1}},setupResizeObserver(){window.ResizeObserver&&this.$nextTick(()=>{try{this.resizeObserver=new ResizeObserver(()=>{this.checkOverflow()});const t=this.$el;t&&t instanceof Element&&this.resizeObserver.observe(t)}catch(t){console.warn("Failed to setup ResizeObserver:",t)}})},cleanupResizeObserver(){if(this.resizeObserver)try{this.resizeObserver.disconnect()}catch(t){console.warn("Failed to disconnect ResizeObserver:",t)}finally{this.resizeObserver=null}},handleCopy(){navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(this.text).then(()=>{this.$message.success(L("copySuccess"))}).catch(()=>{this.fallbackCopy()}):this.fallbackCopy()},fallbackCopy(){const t=document.createElement("textarea");t.value=this.text,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),this.$message.success(L("copySuccess"))}catch(e){this.$message.error(L("copyFailed"))}document.body.removeChild(t)}}};var $e=function(){var e=this,s=e._self._c;return s("el-tooltip",e._b({attrs:{disabled:e.tooltipDisabled,content:e.text,effect:"dark",placement:"top"}},"el-tooltip",{[e.isVue2?"open-delay":"show-after"]:300},!1),[s("div",{staticClass:"ellipsis-text-container"},[s("div",{ref:"textEl",staticClass:"ellipsis-text",style:e.textStyle},[e._v(" "+e._s(e.text)+" ")]),s("div",{staticClass:"toolbar",class:{multiline:e.currentLines>1&&e.lines>1}},[e.copyable?s("CopyIcon",{staticClass:"icon-item",on:{click:e.handleCopy}}):e._e()],1)])])},we=[],Ve=p(Te,$e,we,!1,null,"0979131f");const S=Ve.exports,Fe=!0,ke=!1,ze={name:"TmAdvancedInputFilter",components:{MoreIcon:ge,EllipsisText:S},props:{label:{type:String,default:""},value:{type:String,default:""},field:{type:[String,Number],default:""},placeholder:{type:String,default:""},multiple:{type:Boolean,default:!1},labelOptions:{type:Array,default:()=>[]}},data(){return{t:y().t,isVue3:ke,isVue2:Fe,getDefaultSize:v,getCompatSize:m,exactValue:"",inputValue:"",isExactMode:!1,currentOptionMultiple:!1}},computed:{width(){return this.labelOptions&&this.labelOptions.length||this.label?"305px":"200px"},fieldValue:{get(){return this.field},set(t){this.$emit("field-change",t)}},shouldShowMultiple(){return this.currentOptionMultiple!==null?this.currentOptionMultiple:this.multiple},selectedOption(){return!this.labelOptions||!this.labelOptions.length||!this.field?null:this.labelOptions.find(t=>t.value===this.field)}},watch:{labelOptions:{handler(t){t&&t.length>0&&(this.field||this.$emit("field-change",t[0].value),this.updateCurrentOptionMultiple())},deep:!0,immediate:!0},field:{handler(){this.updateCurrentOptionMultiple()},immediate:!0},isExactMode(t){t?this.$emit("value-change",this.exactValue):this.$emit("value-change",this.inputValue)},exactValue(t){this.$emit("value-change",t)},inputValue(t){this.$emit("value-change",t)},value:{handler(t){this.isExactMode?this.exactValue=t:this.inputValue=t},immediate:!0}},methods:{handlePopoverClose(){document.activeElement&&document.activeElement.blur(),this.isExactMode=!1},handleVisibleChange(t){this.isExactMode=t},handlefieldChange(t){this.$emit("field-change",t),this.updateCurrentOptionMultiple()},updateCurrentOptionMultiple(){const t=this.selectedOption;t&&"multiple"in t?this.currentOptionMultiple=t.multiple:this.currentOptionMultiple=this.multiple},handleExactSearch(){this.$emit("value-change",this.exactValue),this.$emit("search",this.exactValue)},handleClear(){this.exactValue="",this.$emit("value-change","")},handleEnter(){this.$emit("search")}},created(){this.updateCurrentOptionMultiple()}};var Le=function(){var e=this,s=e._self._c;return s("div",{staticClass:"tm-advanced-input",class:`tm-advanced-input--${e.isVue3?"v3":"v2"}`,style:{width:e.width}},[e.labelOptions&&e.labelOptions.length?s("el-select",{staticClass:"left-select",staticStyle:{width:"100px","flex-shrink":"0"},attrs:{placeholder:e.t("selectPlaceholder"),size:e.getDefaultSize()},on:{change:e.handlefieldChange},model:{value:e.fieldValue,callback:function(i){e.fieldValue=i},expression:"fieldValue"}},e._l(e.labelOptions,function(i){return s("el-option",{key:i.value,attrs:{label:i.label,value:i.value}})}),1):e.label?s("div",{staticClass:"input-label"},[s("EllipsisText",{attrs:{text:e.label,lines:2}})],1):e._e(),s("el-input",{staticClass:"right-input",class:{"has-label":e.labelOptions&&e.labelOptions.length},attrs:{size:e.getDefaultSize(),placeholder:e.placeholder,clearable:""},nativeOn:{keyup:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.handleEnter.apply(null,arguments)}},model:{value:e.inputValue,callback:function(i){e.inputValue=i},expression:"inputValue"}},[e.shouldShowMultiple?s("el-popover",e._g(e._b({attrs:{slot:"append"},slot:"append",scopedSlots:e._u([{key:"reference",fn:function(){return[s("MoreIcon",{staticStyle:{cursor:"pointer"}})]},proxy:!0}],null,!1,1001141487)},"el-popover",{[e.isVue3?"visible":"value"]:e.isExactMode,placement:"bottom-end",width:260,trigger:"click"},!1),{[e.isVue3?"update:visible":"input"]:e.handleVisibleChange}),[s("div",{staticClass:"popover-content"},[s("p",{staticClass:"popover-subtitle"},[e._v(e._s(e.t("accurateSearchTips")))]),s("el-input",{staticStyle:{"font-size":"12px"},attrs:{size:e.getDefaultSize(),type:"textarea",rows:8,placeholder:e.t("accurateSearchPlaceholder")},model:{value:e.exactValue,callback:function(i){e.exactValue=i},expression:"exactValue"}}),s("div",{staticClass:"popover-footer"},[s("el-button",{staticStyle:{float:"left"},attrs:{size:e.getCompatSize("mini")},on:{click:e.handleClear}},[e._v(e._s(e.t("clear")))]),s("el-button",{attrs:{size:e.getCompatSize("mini")},on:{click:e.handlePopoverClose}},[e._v(e._s(e.t("cancel")))]),s("el-button",{attrs:{type:"primary",size:e.getCompatSize("mini")},on:{click:e.handleExactSearch}},[e._v(e._s(e.t("search")))])],1)],1)]):e._e()],1)],1)},Oe=[],De=p(ze,Le,Oe,!1,null,"6b474dac");const O=De.exports,{t:g}=y(),Me=!0,Ae=!1,Re="value",He={name:"TmAdvancedDateFilter",components:{EllipsisText:S},props:{value:{type:[Array,String,Date],default:()=>null},field:{type:[String,Number],default:""},start:{type:[String,Number],default:""},end:{type:[String,Number],default:""},size:{type:String,default:"mini"},labelOptions:{type:Array,default:()=>[]},label:{type:String,default:""},type:{type:String,default:"daterange",validator:t=>["date","daterange","datetime","datetimerange","year","month","dates","months","years","week","monthrange"].includes(t)},format:{type:String,default:""},startPlaceholder:{type:String,default:void 0},endPlaceholder:{type:String,default:void 0},placeholder:{type:String,default:void 0},rangeSeparator:{type:String,default:"-"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},align:{type:String,default:"left"},popperClass:{type:String,default:""},defaultValue:{type:[Date,Array],default:null},defaultTime:{type:[Date,String,Array],default:null},shortcuts:{type:Array,default:()=>[]},pastOnly:{type:Boolean,default:!1}},computed:{isRangeType(){return["daterange","datetimerange","monthrange"].includes(this.type)},computedStartPlaceholder(){if(this.isRangeType)return this.startPlaceholder!==void 0?this.startPlaceholder:g("startDate")},computedEndPlaceholder(){if(this.isRangeType)return this.endPlaceholder!==void 0?this.endPlaceholder:g("endDate")},computedDatePickerStyle(){const t=this.labelOptions&&this.labelOptions.length>0,e=this.label&&!this.isRangeType&&(!this.labelOptions||this.labelOptions.length===0);return t?"width: 206px":e?"width: 200px":"width: 306px"},computedFormat(){const t="yyyy";return this.format?this.format:this.type==="year"?t:this.type==="month"?`${t}-MM`:this.type==="date"?`${t}-MM-dd`:this.type==="dates"?`${t}-MM-dd`:this.type==="months"?`${t}-MM`:this.type==="years"?t:this.type==="week"?`${t}-MM-WW`:this.type==="datetime"?`${t}-MM-dd HH:mm:ss`:this.type==="datetimerange"?`${t}-MM-dd HH:mm:ss`:this.type==="daterange"?`${t}-MM-dd`:this.type==="monthrange"?`${t}-MM`:""},computedPickerOptions(){const t={};if(this.pastOnly&&(t.disabledDate=e=>e.getTime()>Date.now()),["daterange","datetimerange"].includes(this.type)){const e=this.type==="datetimerange";t.shortcuts=this.shortcuts.length>0?this.shortcuts:[{text:g("today"),onClick(s){const i=new Date,a=new Date;e&&(a.setHours(0,0,0,0),i.setHours(23,59,59,999)),s.$emit("pick",[a,i])}},{text:g("yesterday"),onClick(s){const i=new Date,a=new Date;a.setTime(a.getTime()-3600*1e3*24),i.setTime(i.getTime()-3600*1e3*24),e&&(a.setHours(0,0,0,0),i.setHours(23,59,59,999)),s.$emit("pick",[a,i])}},{text:g("last7days"),onClick(s){const i=new Date,a=new Date;a.setTime(a.getTime()-3600*1e3*24*7),e&&(a.setHours(0,0,0,0),i.setHours(23,59,59,999)),s.$emit("pick",[a,i])}},{text:g("last30days"),onClick(s){const i=new Date,a=new Date;a.setTime(a.getTime()-3600*1e3*24*30),e&&(a.setHours(0,0,0,0),i.setHours(23,59,59,999)),s.$emit("pick",[a,i])}},{text:g("thisMonth"),onClick(s){const i=new Date,a=new Date;a.setDate(1),e&&(a.setHours(0,0,0,0),i.setHours(23,59,59,999)),s.$emit("pick",[a,i])}},{text:g("lastMonth"),onClick(s){const i=new Date,a=new Date;a.setMonth(a.getMonth()-1),a.setDate(1),i.setDate(0),e&&(a.setHours(0,0,0,0),i.setHours(23,59,59,999)),s.$emit("pick",[a,i])}}]}return t},computedShortcuts(){if(!["daterange","datetimerange"].includes(this.type))return[];if(this.shortcuts&&this.shortcuts.length>0)return this.shortcuts;const t=this.type==="datetimerange";return[{text:g("today"),value:()=>{const e=new Date,s=new Date;return t&&(s.setHours(0,0,0,0),e.setHours(23,59,59,999)),[s,e]}},{text:g("yesterday"),value:()=>{const e=new Date,s=new Date;return s.setTime(s.getTime()-3600*1e3*24),e.setTime(e.getTime()-3600*1e3*24),t&&(s.setHours(0,0,0,0),e.setHours(23,59,59,999)),[s,e]}},{text:g("last7days"),value:()=>{const e=new Date,s=new Date;return s.setTime(s.getTime()-3600*1e3*24*7),t&&(s.setHours(0,0,0,0),e.setHours(23,59,59,999)),[s,e]}},{text:g("last30days"),value:()=>{const e=new Date,s=new Date;return s.setTime(s.getTime()-3600*1e3*24*30),t&&(s.setHours(0,0,0,0),e.setHours(23,59,59,999)),[s,e]}},{text:g("thisMonth"),value:()=>{const e=new Date,s=new Date;return s.setDate(1),t&&(s.setHours(0,0,0,0),e.setHours(23,59,59,999)),[s,e]}},{text:g("lastMonth"),value:()=>{const e=new Date,s=new Date;return s.setMonth(s.getMonth()-1),s.setDate(1),e.setDate(0),t&&(s.setHours(0,0,0,0),e.setHours(23,59,59,999)),[s,e]}}]},computedDisabledDate(){return this.pastOnly?t=>t.getTime()>Date.now():null},computedDefaultTime(){let t=this.defaultTime;if(this.type==="datetimerange"&&!this.defaultTime&&(t=["00:00:00","23:59:59"]),this.isVue2)return t;if(t){if(this.type==="datetimerange"&&Array.isArray(t))return t.map(e=>{if(typeof e=="string"){const s=new Date,[i,a,l]=e.split(":").map(Number);return new Date(s.getFullYear(),s.getMonth(),s.getDate(),i,a,l||0)}return e});if(this.type==="datetime"&&typeof t=="string"){const e=new Date,[s,i,a]=t.split(":").map(Number);return new Date(e.getFullYear(),e.getMonth(),e.getDate(),s,i,a||0)}return t}},dateValue(){return this.isRangeType?this.start||this.end?[this.start,this.end]:this.value:this.value},fieldValue:{get(){return this.field},set(t){this.$emit("field-change",t)}}},data(){return{t:g,isVue2:Me,isVue3:Ae,getDefaultSize:v,valueField:Re}},methods:{handleDateChange(t){this.isRangeType?(this.$emit("value-change",t),t&&Array.isArray(t)&&t.length===2?(this.$emit("start-change",t),this.$emit("end-change",t)):(this.$emit("start-change",[]),this.$emit("end-change",[]))):this.$emit("value-change",t)},handleBlur(t){this.$emit("blur",t)},handleFocus(t){this.$emit("focus",t)}},watch:{labelOptions:{handler(t){t&&t.length>0&&!this.field&&this.$emit("field-change",t[0].value)},deep:!0,immediate:!0}}};var Ee=function(){var e=this,s=e._self._c;return s("div",{staticClass:"tm-date-picker",class:[`tm-date-picker--${e.isVue3?"v3":"v2"}`,{"has-select":e.labelOptions&&e.labelOptions.length>0,"has-label":e.label&&!e.isRangeType&&(!e.labelOptions||e.labelOptions.length===0)}]},[e.labelOptions&&e.labelOptions.length>0?s("el-select",{staticStyle:{width:"100px"},attrs:{size:e.getDefaultSize()},model:{value:e.fieldValue,callback:function(i){e.fieldValue=i},expression:"fieldValue"}},e._l(e.labelOptions,function(i){return s("el-option",{key:i.value,attrs:{label:i.label,value:i.value}})}),1):e.label?s("div",{staticClass:"date-label"},[s("EllipsisText",{attrs:{text:e.label,lines:2}})],1):e._e(),e.isVue2?s("el-date-picker",{style:e.computedDatePickerStyle,attrs:{value:e.dateValue,type:e.type,size:e.getDefaultSize(),"range-separator":e.rangeSeparator,"start-placeholder":e.computedStartPlaceholder,"end-placeholder":e.computedEndPlaceholder,placeholder:e.placeholder,"picker-options":e.computedPickerOptions,format:e.computedFormat,"value-format":e.computedFormat,disabled:e.disabled,clearable:e.clearable,readonly:e.readonly,editable:e.editable,align:e.align,"popper-class":e.popperClass,"default-value":e.defaultValue,"default-time":e.computedDefaultTime},on:{input:e.handleDateChange,change:e.handleDateChange,blur:e.handleBlur,focus:e.handleFocus}}):s("el-date-picker",{style:e.computedDatePickerStyle,attrs:{"model-value":e.dateValue,type:e.type,size:e.getDefaultSize(),"range-separator":e.rangeSeparator,"start-placeholder":e.computedStartPlaceholder,"end-placeholder":e.computedEndPlaceholder,placeholder:e.placeholder,shortcuts:e.computedShortcuts,"disabled-date":e.computedDisabledDate,format:e.computedFormat,"value-format":e.computedFormat,disabled:e.disabled,clearable:e.clearable,readonly:e.readonly,editable:e.editable,teleported:!1,"popper-class":e.popperClass,"default-value":e.defaultValue,"default-time":e.computedDefaultTime},on:{"update:model-value":e.handleDateChange,change:e.handleDateChange,blur:e.handleBlur,focus:e.handleFocus}})],1)},Pe=[],Ie=p(He,Ee,Pe,!1,null,"7d46d46b");const D=Ie.exports,We=!0,Be={name:"TmCascaderFilter",props:{value:{type:[String,Number,Array],default:""},options:{type:[Array,Function],default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value",children:"children",expandTrigger:"hover"})},filterable:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!0},collapseTagsTooltip:{type:Boolean,default:!0},placeholder:{type:String,default:""}},data(){return{isVue2:We,getDefaultSize:v,selectedValue:this.value,optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value",children:this.props.children||"children"}},cascaderProps(){return _(h({},this.props),{expandTrigger:this.props.expandTrigger||"hover"})}},watch:{value:{immediate:!0,handler(t){this.selectedValue=t}},options:{immediate:!0,handler(t){this.initOptions(t)}},selectedValue(t){this.$emit("input",t),this.$emit("change",t)}},methods:{async initOptions(t){if(typeof t=="function")try{this.loading=!0;const e=await t();Array.isArray(e)&&(this.optionsList=e)}catch(e){console.error(e)}finally{this.loading=!1}else Array.isArray(t)&&(this.optionsList=t)}}};var Ne=function(){var e=this,s=e._self._c;return s("el-cascader",e._g(e._b({ref:"cascader",staticClass:"tm-cascader",class:`tm-cascader--${e.isVue2?"v2":"v3"}`,staticStyle:{width:"200px"},scopedSlots:e._u([{key:"default",fn:function({node:i,data:a}){return[e._t("default",function(){return[s("span",[e._v(e._s(a[e.propMap.label]))])]},{node:i,data:a})]}}],null,!0),model:{value:e.selectedValue,callback:function(i){e.selectedValue=i},expression:"selectedValue"}},"el-cascader",_(h({},e.$attrs),{size:e.getDefaultSize(),filterable:e.filterable,clearable:e.clearable,collapseTags:e.collapseTags,collapseTagsTooltip:e.collapseTagsTooltip,props:e.cascaderProps,placeholder:e.placeholder,options:e.optionsList,loading:e.loading}),!1),e.isVue2?e.$listeners:{}))},je=[],Ue=p(Be,Ne,je,!1,null,null);const M=Ue.exports,Je=!0,qe=!1,Ke={name:"TmRadioFilter",props:{value:{type:[String,Number],default:""},options:{type:[Array,Function],default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value"})},size:{type:String,default:"mini"},width:{type:[String,Number],default:200}},data(){return{isVue2:Je,isVue3:qe,getDefaultSize:v,selectedValue:this.value,optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}},hasWideOptions(){return this.optionsList.length>4},calculateItemWidth(){if(!this.optionsList.length)return{};const e=`${(this.hasWideOptions?305:200)/this.optionsList.length}px`;return{width:e,flex:`0 0 ${e}`}}},watch:{value:{immediate:!0,handler(t){this.selectedValue=t}},options:{immediate:!0,handler(t){this.$slots.default||this.initOptions(t)}},selectedValue(t){this.$emit("input",t),this.$emit("change",t)}},methods:{async initOptions(t){if(typeof t=="function")try{this.loading=!0;const e=await t();Array.isArray(e)&&(this.optionsList=e)}catch(e){console.error(e)}finally{this.loading=!1}else Array.isArray(t)&&(this.optionsList=t)}}};var Qe=function(){var e=this,s=e._self._c;return s("div",{staticClass:"tm-radio",class:{"wide-mode":e.hasWideOptions,"tm-radio--v3":e.isVue3,"tm-radio--v2":e.isVue2}},[s("el-radio-group",e._g(e._b({ref:"radioGroup",model:{value:e.selectedValue,callback:function(i){e.selectedValue=i},expression:"selectedValue"}},"el-radio-group",_(h({},e.$attrs),{size:e.getDefaultSize()}),!1),e.isVue2?e.$listeners:{}),[e.$slots.default?[e._t("default")]:e._l(e.optionsList,function(i){return s("el-radio-button",e._b({key:i[e.propMap.value]},"el-radio-button",{[e.isVue3?"value":"label"]:i[e.propMap.value],disabled:i.disabled,style:e.calculateItemWidth},!1),[e._t("option",function(){return[e._v(e._s(i[e.propMap.label]))]},{item:i})],2)})],2)],1)},Ge=[],Ye=p(Ke,Qe,Ge,!1,null,"61fed13d");const A=Ye.exports,Xe=!0,Ze=!1,et={name:"TmCheckboxFilter",props:{value:{type:Array,default:()=>[]},options:{type:[Array,Function],default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value"})},size:{type:String,default:"mini"},width:{type:[String,Number],default:200}},data(){return{isVue2:Xe,isVue3:Ze,getDefaultSize:v,selectedValue:this.value||[],optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}},hasWideOptions(){return this.optionsList.length>4},calculateItemWidth(){if(!this.optionsList.length)return{};const t=Math.ceil(this.optionsList.length/(this.hasWideOptions?6:4)),e=Math.ceil(this.optionsList.length/t),i=`${(this.hasWideOptions?305:200)/e}px`;return{width:i,flex:`0 0 ${i}`}}},watch:{value:{immediate:!0,handler(t){this.selectedValue=t||[]}},options:{immediate:!0,handler(t){this.$slots.default||this.initOptions(t)}},selectedValue(t){this.$emit("input",t),this.$emit("change",t)}},methods:{async initOptions(t){if(typeof t=="function")try{this.loading=!0;const e=await t();Array.isArray(e)&&(this.optionsList=e)}catch(e){console.error(e)}finally{this.loading=!1}else Array.isArray(t)&&(this.optionsList=t)}}};var tt=function(){var e=this,s=e._self._c;return s("div",{staticClass:"tm-checkbox",class:{"wide-mode":e.hasWideOptions,"tm-checkbox--v3":e.isVue3,"tm-checkbox--v2":e.isVue2}},[s("el-checkbox-group",e._g(e._b({ref:"checkboxGroup",model:{value:e.selectedValue,callback:function(i){e.selectedValue=i},expression:"selectedValue"}},"el-checkbox-group",_(h({},e.$attrs),{size:e.getDefaultSize()}),!1),e.isVue2?e.$listeners:{}),[e.$slots.default?[e._t("default")]:e._l(e.optionsList,function(i){return s("el-checkbox-button",e._b({key:i[e.propMap.value]},"el-checkbox-button",{[e.isVue3?"value":"label"]:i[e.propMap.value],disabled:i.disabled,style:e.calculateItemWidth},!1),[e._t("option",function(){return[e._v(e._s(i[e.propMap.label]))]},{item:i})],2)})],2)],1)},st=[],it=p(et,tt,st,!1,null,"b44866b1");const R=it.exports,at=!0,lt={name:"TmSwitchFilter",props:{value:{type:Boolean,default:!1},label:{type:String,default:""}},data(){return{isVue2:at,getDefaultSize:v,switchValue:this.value}},computed:{containerWidthClass(){const t=l=>{if(!l)return 0;let n=0;for(let c=0;c<l.length;c++){const o=l.charAt(c);n+=/[\u4e00-\u9fa5]/.test(o)?2:1}return n},e=t(this.$attrs["active-text"]),s=t(this.$attrs["inactive-text"]),i=t(this.$attrs.label),a=e+s+i;return a>20?"wide-container":a>6?"medium-container":"narrow-container"}},watch:{value:{immediate:!0,handler(t){this.switchValue=t}},switchValue(t){this.$emit("input",t),this.$emit("change",t)}}};var nt=function(){var e=this,s=e._self._c;return s("div",{staticClass:"tm-switch",class:e.containerWidthClass},[e.label?s("span",{staticClass:"switch-label"},[e._v(e._s(e.label))]):e._e(),s("el-switch",e._g(e._b({ref:"switch",attrs:{size:e.getDefaultSize()},model:{value:e.switchValue,callback:function(i){e.switchValue=i},expression:"switchValue"}},"el-switch",e.$attrs,!1),e.isVue2?e.$listeners:{}))],1)},rt=[],ot=p(lt,nt,rt,!1,null,"9e7a342f");const H=ot.exports;var ut=p({name:"DynamicSlot",props:{name:{type:String,required:!0},slotProps:{type:Object,default:()=>({})}},render(t){var a;const e=l=>{var n,c;if(!l)return null;{const o=(n=l.$scopedSlots)==null?void 0:n[this.name];if(o)return o(this.slotProps);const f=(c=l.$slots)==null?void 0:c[this.name];return f||null}},s=l=>{var n;return l?((n=l.$options)==null?void 0:n.name)==="TmTable":!1};let i=e(this.$parent);if(!i){let l=(a=this.$parent)==null?void 0:a.$parent;for(;l&&!i;){if(s(l)){i=e(l);break}l=l.$parent}}return i?Array.isArray(i)?i.length===1?i[0]:t("div",{style:{display:"contents"}},i):i:null}},null,null,!1,null,null);const ct=ut.exports,{t:dt}=y(),ht=!0,pt=!1,ft=["date","daterange","datetime","datetimerange","year","month","dates","months","years","week","monthrange"],mt={name:"TmTableSearch",components:{TmSelect:z,TmAdvancedInput:O,TmAdvancedDate:D,TmCascader:M,TmRadio:A,TmCheckbox:R,TmSwitch:H,DynamicSlot:ct},props:{disabled:{type:Boolean,default:!1},searchColumns:{type:Array,default:null},searchForm:{type:Object,default:()=>({})}},data(){return{t:dt,isVue2:ht,isVue3:pt,getCompatSize:m,getDefaultSize:v,DATE_TYPES:ft,defaultValues:{}}},computed:{computedSearchForm:{get(){return this.searchForm},set(t){this.$emit("update:search-form",t)}}},mounted(){this.initDefaultValues()},methods:{isDateType(t){return this.DATE_TYPES.includes(t)},hasDefaultSlot(){const t=this.$slots.default;return t?this.isVue2?!!t:t()[0].children.length>0:!1},handleUpdate(t,e,s){const i=this.getFieldValue(t,s);i&&this.$emit("update:search-form",_(h({},this.computedSearchForm),{[i]:e}))},handleUpdateDate(t,e){const s=e||[],i=this.getFieldValue(t,"start"),a=this.getFieldValue(t,"end"),l=this.getFieldValue(t,"value"),n={};i&&(n[i]=s[0]),a&&(n[a]=s[1]),l&&(n[l]=s),this.$emit("update:search-form",h(h({},this.computedSearchForm),n))},getFieldValue(t,e){if(typeof t=="string")return t;if(t.fields&&e in t.fields){const s=t.fields[e];if(typeof s=="string")return s;if(Array.isArray(s))return s[0];if(s&&typeof s=="object")return s.name}},getFieldDefault(t,e){if(t.fields&&e in t.fields){const s=t.fields[e];if(Array.isArray(s)&&s.length>1)return s[1];if(s&&typeof s=="object"&&"default"in s)return s.default}},hasSearchSlot(t){var i;const e=a=>{var l,n;return a?!!((l=a.$scopedSlots)!=null&&l[t]||(n=a.$slots)!=null&&n[t]):!1};if(e(this))return!0;let s=this.$parent;for(;s;){if(((i=s.$options)==null?void 0:i.name)==="TmTable"&&e(s))return!0;s=s.$parent}return!1},initDefaultValues(){if(!this.searchColumns||!this.searchColumns.length)return;const t={};this.searchColumns.forEach(e=>{if(typeof e=="string"||!e.fields)return;const s=this.getFieldValue(e,"value"),i=this.getFieldValue(e,"label");if(e.type==="input"&&e.labelOptions&&e.labelOptions.length>0){const l=e.labelOptions[0];if(i)if(i in this.computedSearchForm)t[i]=this.computedSearchForm[i];else{const n=this.getFieldDefault(e,"label");n!==void 0?t[i]=n:l&&l.value!==void 0&&(t[i]=l.value)}s&&!(s in this.computedSearchForm)&&(t[s]="")}else if(this.isDateType(e.type)&&e.labelOptions&&e.labelOptions.length>0){const l=e.labelOptions[0];if(s&&!(s in this.computedSearchForm)&&(t[s]=[]),i)if(i in this.computedSearchForm)t[i]=this.computedSearchForm[i];else{const n=this.getFieldDefault(e,"label");n!==void 0?t[i]=n:l&&l.value!==void 0&&(t[i]=l.value)}}else if(e.type==="select"&&e.labelOptions&&e.labelOptions.length>0){const l=e.labelOptions[0];if(s&&!(s in this.computedSearchForm)&&(t[s]=e.multiple?[]:""),i)if(i in this.computedSearchForm)t[i]=this.computedSearchForm[i];else{const n=this.getFieldDefault(e,"label");n!==void 0?t[i]=n:l&&l.value!==void 0&&(t[i]=l.value)}}const a=this.getFieldDefault(e,"value");if(s&&a!==void 0&&!(s in this.computedSearchForm)?this.isDateType(e.type)&&!Array.isArray(a)?t[s]=[]:e.type==="checkbox"&&!Array.isArray(a)?t[s]=a?[a]:[]:e.type==="switch"&&typeof a!="boolean"?t[s]=!!a:t[s]=a:s&&!(s in this.computedSearchForm)&&(e.type==="checkbox"?t[s]=[]:e.type==="switch"&&(t[s]=!1)),this.isDateType(e.type)){const l=this.getFieldValue(e,"start"),n=this.getFieldValue(e,"end"),c=this.getFieldDefault(e,"start"),o=this.getFieldDefault(e,"end");l&&c!==void 0&&!(l in this.computedSearchForm)&&(t[l]=c),n&&o!==void 0&&!(n in this.computedSearchForm)&&(t[n]=o)}}),this.defaultValues=t,this.$emit("update:search-form",h(h({},t),this.computedSearchForm))},getSearchForm(){return this.computedSearchForm},handleSearch(){setTimeout(()=>{this.$emit("search",this.computedSearchForm)})},handleReset(){this.$emit("update:search-form",h({},this.defaultValues)),this.$emit("reset")}}};var gt=function(){var e=this,s=e._self._c;return s("div",{staticClass:"table-search",class:`table-search--${e.isVue2?"v2":"v3"}`},[s("div",{staticClass:"search-content"},[e.hasDefaultSlot()?e._t("default"):e.searchColumns&&e.searchColumns.length?[e._l(e.searchColumns,function(i,a){return[typeof i=="string"?s("div",{key:`str-${i}-${a}`,staticClass:"search-item"},[s("dynamic-slot",{key:i,attrs:{name:`search-${i}`,"slot-props":{searchForm:e.searchForm}}})],1):s("div",{key:`obj-${a}`,staticClass:"search-item"},[i.fields?[e.hasSearchSlot(`search-${e.getFieldValue(i,"value")}`)?[s("dynamic-slot",{key:e.getFieldValue(i,"value"),attrs:{name:`search-${e.getFieldValue(i,"value")}`,"slot-props":{searchForm:e.searchForm,col:i}}})]:[s("div",{key:e.getFieldValue(i,"value")||`col-${a}`,staticStyle:{display:"flex"}},[i.type==="input"?s("tm-advanced-input",{attrs:{label:i.label,value:e.computedSearchForm[e.getFieldValue(i,"value")],field:e.computedSearchForm[e.getFieldValue(i,"label")],multiple:i.multiple,labelOptions:i.labelOptions,placeholder:i.placeholder},on:{"value-change":l=>e.handleUpdate(i,l,"value"),"field-change":l=>e.handleUpdate(i,l,"label"),search:e.handleSearch}}):e._e(),e.isDateType(i.type)?s("tm-advanced-date",{attrs:{type:i.type,label:i.label,value:e.computedSearchForm[e.getFieldValue(i,"value")],field:e.computedSearchForm[e.getFieldValue(i,"label")],start:e.computedSearchForm[e.getFieldValue(i,"start")],end:e.computedSearchForm[e.getFieldValue(i,"end")],labelOptions:i.labelOptions,"start-placeholder":i.startPlaceholder,"end-placeholder":i.endPlaceholder,placeholder:i.placeholder,"range-separator":i.rangeSeparator,disabled:i.disabled,clearable:i.clearable,readonly:i.readonly,editable:i.editable,align:i.align,"popper-class":i.popperClass,"default-value":i.defaultValue,"default-time":i.defaultTime,shortcuts:i.shortcuts,"past-only":i.pastOnly,format:i.format},on:{"field-change":l=>e.handleUpdate(i,l,"label"),"value-change":l=>e.handleUpdateDate(i,l),"start-change":l=>e.handleUpdateDate(i,l),"end-change":l=>e.handleUpdateDate(i,l)}}):e._e(),i.type==="select"?s("tm-select",{attrs:{label:i.label,field:e.computedSearchForm[e.getFieldValue(i,"label")],options:i.options,labelOptions:i.labelOptions,placeholder:i.placeholder,multiple:i.multiple,"show-check-all":i.checkAll},on:{"field-change":l=>e.handleUpdate(i,l,"label")},model:{value:e.computedSearchForm[e.getFieldValue(i,"value")],callback:function(l){e.$set(e.computedSearchForm,e.getFieldValue(i,"value"),l)},expression:"computedSearchForm[getFieldValue(col, 'value')]"}}):e._e(),i.type==="cascader"?s("tm-cascader",{attrs:{label:i.label,options:i.options,labelOptions:i.labelOptions,props:i.props,placeholder:i.placeholder,"show-check-all":i.checkAll},model:{value:e.computedSearchForm[e.getFieldValue(i,"value")],callback:function(l){e.$set(e.computedSearchForm,e.getFieldValue(i,"value"),l)},expression:"computedSearchForm[getFieldValue(col, 'value')]"}}):e._e(),i.type==="radio"?s("tm-radio",{attrs:{label:i.label,options:i.options,props:i.props},model:{value:e.computedSearchForm[e.getFieldValue(i,"value")],callback:function(l){e.$set(e.computedSearchForm,e.getFieldValue(i,"value"),l)},expression:"computedSearchForm[getFieldValue(col, 'value')]"}}):e._e(),i.type==="checkbox"?s("tm-checkbox",{attrs:{label:i.label,options:i.options,props:i.props},model:{value:e.computedSearchForm[e.getFieldValue(i,"value")],callback:function(l){e.$set(e.computedSearchForm,e.getFieldValue(i,"value"),l)},expression:"computedSearchForm[getFieldValue(col, 'value')]"}}):e._e(),i.type==="switch"?s("tm-switch",{attrs:{"active-text":i.activeText,"inactive-text":i.inactiveText,label:i.label,"active-color":i.activeColor,"inactive-color":i.inactiveColor},model:{value:e.computedSearchForm[e.getFieldValue(i,"value")],callback:function(l){e.$set(e.computedSearchForm,e.getFieldValue(i,"value"),l)},expression:"computedSearchForm[getFieldValue(col, 'value')]"}}):e._e()],1)]]:[s("div",{key:`error-${a}`,staticClass:"search-error-message"},[e._v(" 缺少 fields 配置,无法渲染此组件 ")])]],2)]})]:e._e(),s("div",{staticClass:"search-actions"},[s("el-button",{attrs:{type:"primary",size:e.getDefaultSize()},on:{click:e.handleSearch}},[e._v(e._s(e.t("query")))]),s("el-button",{attrs:{size:e.getDefaultSize()},on:{click:e.handleReset}},[e._v(e._s(e.t("reset")))])],1)],2)])},bt=[],vt=p(mt,gt,bt,!1,null,"4ec2388e");const E=vt.exports,yt=!0,Ct={name:"TablePagination",props:{current:{type:Number,default:1},small:{type:Boolean,default:!0},pageSize:{type:Number,default:20},total:{type:Number,default:0}},data(){return{isVue2:yt,getCompatSize:m}},methods:{handleSizeChange(t){this.$emit("size-change",t)},handleCurrentChange(t){this.$emit("current-change",t)}}};var _t=function(){var e=this,s=e._self._c;return s("div",{staticClass:"tm-pagination"},[s("el-pagination",e._g(e._b({staticStyle:{"text-align":"right"},attrs:{"current-page":e.current,"page-size":e.pageSize,total:e.total,"page-sizes":[10,20,50,100,300,500,1e3,2e3],size:e.getCompatSize("mini"),layout:"total, sizes, prev, pager, next, jumper"},on:{"size-change":e.handleSizeChange,"update:current-page":function(i){return e.$emit("update:current",i)},"update:page-size":function(i){return e.$emit("update:pageSize",i)},"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1),e.isVue2?e.$listeners:{}))],1)},xt=[],St=p(Ct,_t,xt,!1,null,"4dbdf6e7");const Tt=St.exports,$t={name:"TmTableMenu",props:{size:{type:String,default:"mini"}}};var wt=function(){var e=this,s=e._self._c;return s("div",{staticClass:"tm-table-menu",attrs:{size:"small",inline:""}},[s("div",{staticClass:"left"},[e._t("left")],2),s("div",{staticClass:"right"},[e._t("right")],2)])},Vt=[],Ft=p($t,wt,Vt,!1,null,"579dd2c3");const kt=Ft.exports,w=t=>t?t.data&&t.data.attrs||{}:{},P=(t,e)=>{t&&(t.data||(t.data={}),t.data.attrs||(t.data.attrs={}),typeof e=="object"&&Object.assign(t.data.attrs,e))},V={getTableConfig(t){try{const e=localStorage.getItem(`tm-table-config-${t}`);return Promise.resolve({data:{code:200,data:e}})}catch(e){return Promise.reject(e)}},setTableConfig(t){try{return localStorage.setItem(`tm-table-config-${t.key}`,t.info),Promise.resolve({data:{code:200,message:"success"}})}catch(e){return Promise.reject(e)}}},zt=t=>V.getTableConfig(t.key),Lt=t=>V.setTableConfig(t),Ot=t=>{t&&(typeof t.getTableConfig=="function"&&(V.getTableConfig=t.getTableConfig),typeof t.setTableConfig=="function"&&(V.setTableConfig=t.setTableConfig))},{t:Dt}=y(),Mt=!0,At=!1,Rt={formatter:(t,e,s,i)=>[void 0,null,""].includes(s)?"-":s},Ht={name:"TmColumnConfig",components:{MoveIcon:me,FixedLeftIcon:be,FixedRightIcon:ve,UploadIcon:ye,DownloadIcon:Ce,DeleteIcon:_e,MenuIcon:pe,tmEllipsisText:S},props:{columns:{type:Array,default:()=>[]},tableKey:{type:String,default:"",required:!0},defaultColumns:{type:Array,default:()=>[]},maxFixedLeftQuantity:{type:[Number,String],default:void 0},maxFixedRightQuantity:{type:[Number,String],default:void 0},ignoredColumnConfigTypes:{type:Array,default:()=>["selection"]}},data(){return{t:Dt,isVue2:Mt,isVue3:At,getDefaultSize:v,getCompatSize:m,buttonType:{type:"text"},afterOpenDelay:{"open-delay":300},popoverVisible:!1,keyWord:"",sortedTableColumns:[],tableColumns:[],defaultColumnsConfig:[],columnMap:{},processedColumns:[],placement:"bottom",isDraggingFrozen:!1,isDraggingFrozenRight:!1,sortable:null,isConfigLoaded:!1,columnsCopy:[]}},computed:{filteredSortedTableColumns(){return this.keyWord?this.sortedTableColumns.filter(t=>this.getColumnLabel(t.prop).includes(this.keyWord)):this.sortedTableColumns},showFixedLimitTips(){return this.maxFixedLeftQuantity!==void 0||this.maxFixedRightQuantity!==void 0},isThanMaxFrozen(){return this.maxFixedLeftQuantity===void 0?!1:this.sortedTableColumns.filter(t=>t.fixed==="left").length>=this.maxFixedLeftQuantity},isThanMaxRightFrozen(){return this.maxFixedRightQuantity===void 0?!1:this.sortedTableColumns.filter(t=>t.fixed==="right").length>=this.maxFixedRightQuantity},computedTableKey(){if(this.tableKey)return this.tableKey;if(this.$route&&this.$route.path)return this.$route.path.slice(1).replace(/\//g,"-");throw new Error("tableKey is required")}},watch:{popoverVisible(t){t||this.handlePopoverHide()},columns:{handler(t){t&&t.length>0&&!this.isConfigLoaded&&this.initializeColumnConfig()},immediate:!0},tableColumns:{handler(t){t!=null&&t.length&&(this.initSortedTableColumns(),this.crateSortable(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)))},deep:!0}},methods:{findLastIndex(t,e){for(let s=t.length-1;s>=0;s--)if(e(t[s],s,t))return s;return-1},getColumnLabel(t){return!t||!this.columnMap[t]?t||"":w(this.columnMap[t]).label||t},initializeColumnConfig(){this.defaultColumns&&this.defaultColumns.length>0?this.defaultColumnsConfig=this.defaultColumns:this.processOriginalColumns(),this.loadColumnConfig()},processOriginalColumns(){const t=this.columns||[];let e={};this.defaultColumnsConfig=t.filter(s=>{const i=w(s);return!(!i.prop||this.ignoredColumnConfigTypes.includes(i.type))}).map((s,i)=>{const a=w(s),l=h(h({},Rt),a);P(s,l),a.prop&&(e[a.prop]=s);const n=a.hasOwnProperty("visible")?a.visible!==!1:!0;return{prop:a.prop,fixed:a.fixed||"",sort:i,cancellable:a.hasOwnProperty("cancellable")?a.cancellable:!0,visible:n}}),this.columnMap=e},loadColumnConfig(){zt({key:this.computedTableKey}).then(t=>{var s;if(t.data.code!==200)return;let e=JSON.parse(((s=t.data)==null?void 0:s.data)||null)||{};e.columnsConfig&&JSON.stringify(this.defaultColumnsConfig)===JSON.stringify(e.defaultColumnsConfig)?this.tableColumns=e.columnsConfig.map(i=>h({},i)):this.tableColumns=this.defaultColumnsConfig.map(i=>h({},i)),this.processedColumns=this.applyColumnConfig(this.tableColumns),this.isConfigLoaded=!0,this.$emit("complete",{columns:this.processedColumns,isInitialLoad:!0})}).catch(()=>{this.tableColumns=this.defaultColumnsConfig.map(t=>h({},t)),this.processedColumns=this.applyColumnConfig(this.tableColumns),this.isConfigLoaded=!0,this.$emit("complete",{columns:this.processedColumns,isInitialLoad:!0})})},applyColumnConfig(t,e=!1){let s=this.columns.filter(a=>{const l=w(a);return this.ignoredColumnConfigTypes.includes(l.type)}),i=[];return[...t].sort((a,l)=>{const n=a.sort!==void 0?a.sort:1/0,c=l.sort!==void 0?l.sort:1/0;return n-c}).forEach(a=>{if(a.prop){let l=this.columnMap[a.prop];l&&(P(l,{fixed:a.fixed||void 0,visible:a.visible}),(!e&&a.visible||e)&&i.push(l))}}),s.forEach(a=>{P(a,{visible:!0})}),[...s,...i]},crateSortable(){const t=this.$refs.sortListRef;if(!t)return;this.sortable&&(this.sortable.destroy(),this.sortable=null);const e=new u(t,{ghostClass:"blue-background-class",animation:150,easing:"cubic-bezier(1, 0, 0, 1)",handle:".row-title",draggable:".sort-item-wrapper",fallbackOnBody:!1,preventOnFilter:!0,removeCloneOnHide:!0,group:"columns",dragClass:"sortable-drag",onStart:({item:s})=>{const i=s.getAttribute("data-prop"),a=this.sortedTableColumns.find(l=>l.prop===i);this.isDraggingFrozen=a&&a.fixed==="left",this.isDraggingFrozenRight=a&&a.fixed==="right",this.draggedItemIndex=Array.from(t.children).indexOf(s),s.classList.add("sortable-drag")},onMove:s=>{const{target:i,related:a}=s;if(!i||!a)return!1;const l=a?a.getAttribute("data-prop"):null,n=l?this.sortedTableColumns.find(f=>f.prop===l):null,c=n&&n.fixed==="left",o=n&&n.fixed==="right";return this.isDraggingFrozen&&!c||this.isDraggingFrozenRight&&!o||!this.isDraggingFrozen&&!this.isDraggingFrozenRight&&(c||o)?(i.classList.add("no-drop-zone"),!1):(document.querySelectorAll(".no-drop-zone").forEach(f=>{f.classList.remove("no-drop-zone")}),!0)},onEnd:({item:s,newIndex:i,oldIndex:a})=>{if(i===void 0||a===void 0||i<0||a<0||i>=this.sortedTableColumns.length||a>=this.sortedTableColumns.length)return;document.querySelectorAll(".no-drop-zone").forEach(T=>{T.classList.remove("no-drop-zone")}),s.classList.remove("sortable-drag");const l=this.sortedTableColumns[a],n=l.fixed==="left",c=l.fixed==="right",o=i>0?this.sortedTableColumns[i-1]:null,f=i<this.sortedTableColumns.length-1?this.sortedTableColumns[i+1]:null;let C=!1;if(n?(o&&o.fixed!=="left"||f&&f.fixed==="right")&&(C=!0):c?(o&&o.fixed!=="right"||f&&f.fixed!=="right")&&(C=!0):(o&&o.fixed==="right"||f&&f.fixed==="left")&&(C=!0),C){this.rollbackSort();return}this.updateSortAfterDrag()}});this.sortable=e},rollbackSort(){this.sortedTableColumns=JSON.parse(JSON.stringify(this.columnsCopy))},updateSortAfterDrag(){const t=this.$refs.sortListRef;if(!t)return;Array.from(t.children||[]).filter(s=>s&&s.dataset&&s.dataset.prop).map(s=>s.dataset.prop).forEach((s,i)=>{this.sortedTableColumns.some(a=>a.prop===s?(a.sort=i,!0):!1)}),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},init(){this.tableColumns=Array.isArray(this.tableColumns)?[...this.tableColumns]:Array.isArray(this.defaultColumnsConfig)?[...this.defaultColumnsConfig]:[],this.initSortedTableColumns()},initSortedTableColumns(){this.tableColumns.forEach((t,e)=>{t.sort===void 0&&(t.sort=e)}),this.sortedTableColumns=[...this.tableColumns].sort((t,e)=>t.fixed==="left"&&e.fixed!=="left"?-1:t.fixed!=="left"&&e.fixed==="left"||t.fixed==="right"&&e.fixed!=="right"?1:t.fixed!=="right"&&e.fixed==="right"?-1:t.sort-e.sort)},setPlacement(){const e=this.$refs.operationRef.$el.getBoundingClientRect();(window.innerHeight||document.documentElement.clientHeight)-(e.bottom-window.scrollY)>512?this.placement="bottom":this.placement="left"},handleVisibleChange(t){this.popoverVisible=t},handlePopoverShow(){this.setPlacement(),this.init(),(()=>{try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove)}catch(e){}})(),this.$nextTick(()=>{this.crateSortable()})},handlePopoverHide(){this.sortable&&(this.sortable.destroy(),this.sortable=null);try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove),typeof u!="undefined"&&u.utils&&(document.removeEventListener("mousemove",u.utils.throttleCall),document.removeEventListener("mouseup",u.utils.throttleCall))}catch(t){}},handleSelectAll(){const t=this.tableColumns.some(e=>!e.visible);this.tableColumns.forEach(e=>{e.cancellable&&(e.visible=t)})},handleRestoreDefault(){this.tableColumns=JSON.parse(JSON.stringify(this.defaultColumnsConfig)),this.sortedTableColumns=[...this.tableColumns].sort((t,e)=>t.sort-e.sort)},canMoveTop(t,e){if(e===0)return!1;if(t.fixed==="left"){const s=this.sortedTableColumns[e-1];return s&&s.fixed==="left"}if(!t.fixed){const s=this.sortedTableColumns[e-1];return s&&s.fixed==="left"?!1:s&&!s.fixed}return t.fixed==="right"},moveTop(t,e){const s=this.sortedTableColumns,i=t.prop;if(t.fixed==="right"&&(t.fixed=""),t.fixed==="left")s.unshift(s.splice(e,1)[0]);else{const a=this.findLastIndex(this.sortedTableColumns,l=>l.fixed==="left");s.splice(a+1,0,s.splice(e,1)[0])}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns),this.$nextTick(()=>{const a=this.$refs.sortListRef;if(a){const l=Array.from(a.children).find(n=>n.dataset&&n.dataset.prop===i);l&&l.scrollIntoView({behavior:"smooth",block:"nearest"})}})},frozenLeftHandle(t){const e=this.sortedTableColumns,s=e.splice(t,1)[0];if(s.fixed=s.fixed==="left"?"":"left",s.fixed==="left"){const i=this.findLastIndex(this.sortedTableColumns,a=>a.fixed==="left");e.splice(i+1,0,s)}else{const i=this.findLastIndex(this.sortedTableColumns,a=>a.fixed==="left");e.splice(i+1,0,s)}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},frozenRightHandle(t){const e=this.sortedTableColumns,s=e.splice(t,1)[0];if(s.fixed=s.fixed==="right"?"":"right",s.fixed==="right"){const i=e.findIndex(a=>a.fixed==="right");i===-1?e.push(s):e.splice(i,0,s)}else{const i=e.findIndex(a=>a.fixed==="right");i===-1?e.push(s):e.splice(i,0,s)}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},onSave(){var e;this.updateSortValues();const t=(e=this.tableColumns)==null?void 0:e.map(s=>{const i=this.sortedTableColumns.find(c=>c.prop===s.prop);i&&(s.sort=i.sort,s.fixed=i.fixed,s.visible=i.visible);const n=s,{label:a}=n;return G(n,["label"])});Lt({key:this.computedTableKey,info:JSON.stringify({columnsConfig:t,defaultColumnsConfig:this.defaultColumnsConfig})}).then(s=>{s.data.code===200&&(this.processedColumns=this.applyColumnConfig(t,!0),this.$emit("complete",{columns:this.processedColumns,isInitialLoad:!1}),this.$message.success(this.t("saveSuccess")),this.popoverVisible=!1)})},updateSortValues(){this.sortedTableColumns.forEach((t,e)=>{t.sort=e})}},mounted(){var t;(t=this.tableColumns)!=null&&t.length&&(this.initSortedTableColumns(),this.crateSortable(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)))},beforeDestroy(){this.sortable&&(this.sortable.destroy(),this.sortable=null);try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove),typeof u!="undefined"&&u.utils&&(document.removeEventListener("mousemove",u.utils.throttleCall),document.removeEventListener("mouseup",u.utils.throttleCall))}catch(t){}}};var Et=function(){var e=this,s=e._self._c;return s("el-popover",e._g(e._b({attrs:{"popper-class":"column-config-popover",width:680,"show-arrow":!1,placement:e.placement,trigger:"click"},on:{show:e.handlePopoverShow,hide:e.handlePopoverHide},scopedSlots:e._u([{key:"reference",fn:function(){return[s("div",{staticStyle:{display:"inline-block","margin-left":"10px"}},[s("el-tooltip",e._b({attrs:{content:e.t("columnSetting"),placement:"top"}},"el-tooltip",e.afterOpenDelay,!1),[s("el-button",{ref:"operationRef",attrs:{size:e.getDefaultSize(),circle:""}},[s("MenuIcon")],1)],1)],1)]},proxy:!0}])},"el-popover",{[e.isVue3?"visible":"value"]:e.popoverVisible},!1),{[e.isVue3?"update:visible":"input"]:e.handleVisibleChange}),[e.popoverVisible?s("div",{staticClass:"container"},[s("div",{staticClass:"main-container"},[s("div",{staticClass:"left-content"},[s("div",{staticClass:"title"},[s("span",[e._v(e._s(e.t("SelectableFields"))+"("+e._s(e.tableColumns.length)+")")]),s("el-button",e._b({staticStyle:{"margin-left":"10px"},on:{click:e.handleSelectAll}},"el-button",e.buttonType,!1),[e._v(e._s(e.t("all")))])],1),s("div",{staticClass:"option-list"},[s("div",{staticStyle:{height:"100%","overflow-y":"auto"}},[e._l(e.tableColumns,function(i,a){return[i.prop?s("div",{key:a+i.prop,staticStyle:{width:"110px",display:"inline-block"}},[s("el-checkbox",{staticClass:"el-checkbox",attrs:{disabled:!i.cancellable,label:i.prop,value:i.prop},model:{value:i.visible,callback:function(l){e.$set(i,"visible",l)},expression:"col.visible"}},[s("TmEllipsisText",{attrs:{width:"80px",text:e.getColumnLabel(i.prop)}})],1)],1):e._e()]})],2)])]),s("div",{staticClass:"right-content"},[s("div",{staticClass:"search-box"},[s("el-input",{staticClass:"search-input",attrs:{size:e.getCompatSize("small"),clearable:"",placeholder:e.t("search")},model:{value:e.keyWord,callback:function(i){e.keyWord=i},expression:"keyWord"}})],1),e.showFixedLimitTips?s("div",{staticClass:"tips"}):e._e(),s("div",{ref:"sortListRef",staticClass:"sort-list"},e._l(e.filteredSortedTableColumns,function(i,a){return s("div",{key:i.prop,staticClass:"sort-item-wrapper",class:[i.fixed==="left"?"frozen":"",i.fixed==="right"?"frozenRight":"",i.fixed?"":"noFrozen"],attrs:{"data-prop":i.prop}},[i.visible?s("div",{staticClass:"sort-item"},[s("div",{staticClass:"row-title"},[s("MoveIcon",{staticStyle:{"flex-shrink":"0"}}),s("TmEllipsisText",{attrs:{text:e.getColumnLabel(i.prop)}})],1),s("div",{staticClass:"operation-btns"},[i.cancellable?s("el-tooltip",e._b({attrs:{content:e.t("cancel"),placement:"top"}},"el-tooltip",e.afterOpenDelay,!1),[s("el-button",e._b({staticClass:"iconfont-button delete-button",attrs:{size:e.getCompatSize("mini")},on:{click:function(l){i.visible=!1}}},"el-button",e.buttonType,!1),[s("DeleteIcon")],1)],1):e._e(),e.canMoveTop(i,a)?s("el-tooltip",e._b({attrs:{content:e.t("top"),placement:"top"}},"el-tooltip",e.afterOpenDelay,!1),[s("el-button",e._b({staticClass:"iconfont-button top-button",attrs:{size:e.getCompatSize("mini")},on:{click:function(l){return e.moveTop(i,a)}}},"el-button",e.buttonType,!1),[s("UploadIcon")],1)],1):e._e(),i.fixed!=="right"?s("el-tooltip",e._b({attrs:{content:i.fixed==="left"?e.t("cancelLeftFixed"):e.t("leftFixed"),placement:"top"}},"el-tooltip",e.afterOpenDelay,!1),[s("el-button",e._b({staticClass:"iconfont-button left-fixed-btn",class:{"active-fixed":i.fixed==="left"},attrs:{size:e.getCompatSize("mini"),disabled:i.fixed!=="left"&&e.isThanMaxFrozen},on:{click:function(l){return e.frozenLeftHandle(a)}}},"el-button",e.buttonType,!1),[s("FixedLeftIcon")],1)],1):e._e(),i.fixed!=="left"?s("el-tooltip",e._b({attrs:{content:i.fixed==="right"?e.t("cancelRightFixed"):e.t("rightFixed"),placement:"top"}},"el-tooltip",e.afterOpenDelay,!1),[s("el-button",e._b({staticClass:"iconfont-button right-fixed-btn",class:{"active-fixed":i.fixed==="right"},attrs:{size:e.getCompatSize("mini"),disabled:i.fixed!=="right"&&e.isThanMaxRightFrozen},on:{click:function(l){return e.frozenRightHandle(a)}}},"el-button",e.buttonType,!1),[s("FixedRightIcon")],1)],1):e._e()],1)]):e._e()])}),0)])]),s("div",{staticClass:"footer"},[s("div",{staticClass:"footer-left"},[s("el-button",{attrs:{size:e.getCompatSize("mini")},on:{click:e.handleRestoreDefault}},[e._v(e._s(e.t("restoreDefault")))])],1),s("div",{staticClass:"footer-right"},[s("el-button",{attrs:{size:e.getCompatSize("mini")},on:{click:function(i){e.popoverVisible=!1}}},[e._v(e._s(e.t("cancel")))]),s("el-button",{attrs:{size:e.getCompatSize("mini"),type:"primary"},on:{click:e.onSave}},[e._v(e._s(e.t("saveAndApply")))])],1)])]):e._e()])},Pt=[],It=p(Ht,Et,Pt,!1,null,"127cbd33");const Wt=It.exports,Bt=!0,Nt=!1,jt={name:"TmTable",components:{TableSearch:E,TablePagination:Tt,TableMenu:kt,ColumnConfig:Wt,RefreshIcon:fe,ColumnRenderer:{props:["vnode"],render(){return this.$createElement(this.vnode.componentOptions.tag,this.vnode.data,this.vnode.children)}}},inheritAttrs:!1,props:{data:{type:[Array,Function],default:()=>[]},showSearch:{type:Boolean,default:!0},showMenu:{type:Boolean,default:!0},showPagination:{type:Boolean,default:!0},pagination:{type:Object,default:()=>({})},height:{type:[String,Number]},calcHeight:{type:Number,default:0},dataAdapter:{type:Function,default:null},columnSettingButton:{type:Boolean,default:!0},refreshButton:{type:Boolean,default:!0},tableKey:{type:String,default:""},firstLoad:{type:Boolean,default:!0},maxFixedLeftQuantity:{type:Number},maxFixedRightQuantity:{type:Number},border:{type:Boolean,default:!0},searchColumns:{type:Array,default:null},searchForm:{type:Object,default:()=>({})}},data(){return{getDefaultSize:v,getCompatSize:m,isVue3:Nt,isVue2:Bt,t:y().t,tableData:[],tableLoading:!1,columnsLoading:!1,tableReload:1,tableHeight:null,selectedRows:[],paginationInfo:{current:1,pageSize:20,total:void 0},originalColumns:[],displayColumns:[],isColumnConfigLoaded:!1,afterOpenDelay:{"open-delay":300}}},computed:{pageLoading(){return this.tableLoading||this.columnsLoading},computedTableKey(){if(this.tableKey)return this.tableKey;if(this.$route&&this.$route.path)return this.$route.path.slice(1).replace(/\//g,"-");throw new Error("tableKey is required")},computedShowPagination(){return this.showPagination&&typeof this.data=="function"}},watch:{data:{immediate:!0,handler(t){typeof t=="function"?!this.columnSettingButton||this.isColumnConfigLoaded&&!this.firstLoad?this.loadData():Array.isArray(t)&&(this.tableData=t):this.tableData=t}},height:{immediate:!0,handler(){this.getTableHeight()}}},created(){this.originalColumns=this.$slots.default||[],this.columnSettingButton?this.columnsLoading=!0:(this.displayColumns=this.originalColumns,this.isColumnConfigLoaded=!0)},mounted(){this.getTableHeight(),window.addEventListener("resize",this.getTableHeight)},beforeDestroy(){window.removeEventListener("resize",this.getTableHeight)},methods:{handleUpdateSearchForm(t){this.$emit("update:search-form",t)},handleColumnConfigComplete(t){Array.isArray(t.columns)?this.displayColumns=[...t.columns]:this.displayColumns=[...this.originalColumns],t.isInitialLoad?(this.isColumnConfigLoaded=!0,this.columnsLoading=!1,this.firstLoad&&typeof this.data=="function"&&this.loadData()):this.reloadTable()},isAutoHeight(){return this.height==="auto"},handleRefresh(){this.loadData()},async loadData(){if(Array.isArray(this.data))this.tableData=this.data;else if(typeof this.data=="function"){if(this.tableLoading)return;this.tableLoading=!0;try{const t=await this.data({paginationInfo:{pageSize:this.paginationInfo.pageSize,current:this.paginationInfo.current},params:this.searchForm}),{list:e,total:s,pageSize:i,current:a}=t;this.tableData=e;let l=h({},this.paginationInfo);s!==void 0&&(l.total=s),a!==void 0&&(l.current=a),i!==void 0&&(l.pageSize=i),this.paginationInfo=l}catch(t){}finally{this.tableLoading=!1}}},getTableHeight(){this.isAutoHeight()?this.$nextTick(()=>{const t=this.$refs.table,e=this.$refs.tmPagination;if(!t)return;const s=t.$el,i=e&&e.$el&&e.$el.offsetHeight||0;this.tableHeight=document.documentElement.clientHeight-s.offsetTop-i-this.calcHeight}):this.tableHeight=this.height,this.refreshTable()},search(){this.paginationInfo.current=1,this.loadData()},reset(){this.paginationInfo.current=1,this.$nextTick(()=>{this.loadData()})},handleSelectionChange(t){this.selectedRows=t,this.$emit("selection-change",t)},handleSizeChange(t){this.paginationInfo.pageSize=t,this.loadData(),this.$emit("size-change",t)},handleCurrentChange(t){this.paginationInfo.current=t,this.loadData(),this.$emit("current-change",t)},refreshTable(){this.$refs.table&&this.$refs.table.doLayout()},reloadTable(){this.tableReload++}}};var Ut=function(){var e=this,s=e._self._c;return s("div",{ref:"tablePage",staticClass:"tm-table"},[e.searchColumns&&e.searchColumns.length>0?s("table-search",{ref:"search",attrs:{disabled:e.pageLoading,"search-columns":e.searchColumns,"search-form":e.searchForm},on:{search:e.search,reset:e.reset,"update:search-form":e.handleUpdateSearchForm}},[e._t("search")],2):e._e(),e.showMenu?s("table-menu",{scopedSlots:e._u([{key:"left",fn:function(){return[e._t("menu-left")]},proxy:!0},{key:"right",fn:function(){return[e._t("menu-right"),e.refreshButton&&typeof e.data=="function"?s("el-tooltip",e._b({attrs:{content:e.t("refresh"),placement:"top"}},"el-tooltip",e.afterOpenDelay,!1),[s("el-button",{attrs:{circle:"",size:e.getDefaultSize()},on:{click:e.handleRefresh}},[s("RefreshIcon")],1)],1):e._e(),e.columnSettingButton?s("ColumnConfig",{attrs:{maxFixedLeftQuantity:e.maxFixedLeftQuantity,maxFixedRightQuantity:e.maxFixedRightQuantity,tableKey:e.computedTableKey,columns:e.originalColumns},on:{complete:e.handleColumnConfigComplete}}):e._e()]},proxy:!0}],null,!0)}):e._e(),s("el-table",e._g(e._b({directives:[{name:"loading",rawName:"v-loading",value:e.pageLoading,expression:"pageLoading"}],key:e.tableReload,ref:"table",attrs:{data:e.tableData,height:e.tableHeight,size:e.getCompatSize("mini")},on:{"selection-change":e.handleSelectionChange}},"el-table",_(h({},e.$attrs),{border:e.border}),!1),e.isVue2?e.$listeners:{}),e._l(e.displayColumns,function(i){return s("columnRenderer",{key:e.isVue3?i.id:i.data.attrs.prop,attrs:{vnode:i}})}),1),e.computedShowPagination?s("table-pagination",{ref:"tmPagination",attrs:{"page-size":e.paginationInfo.pageSize,current:e.paginationInfo.current,total:e.paginationInfo.total,disabled:e.tableLoading},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}}):e._e()],1)},Jt=[],qt=p(jt,Ut,Jt,!1,null,"8db1f265");const I=qt.exports,Kt=!0,Qt=!1,Gt={name:"TmTableColumn",inheritAttrs:!1,computed:{isVisible(){return this.$attrs.visible!==!1},slots(){return this.$scopedSlots}},data(){return{isVue2:Kt,isVue3:Qt}},created(){this.$parent&&this.$parent.$emit&&this.$parent.$emit("column-initialized",{prop:this.$attrs.prop,visible:this.$attrs.visible!==!1})}};var Yt=function(){var e=this,s=e._self._c;return e.isVisible?s("el-table-column",e._g(e._b({scopedSlots:e._u([e._l(e.slots,function(i,a){return{key:a,fn:function(l){return[e._t(a,null,null,l)]}}})],null,!0)},"el-table-column",e.$attrs,!1),e.isVue2?e.$listeners:{})):e._e()},Xt=[],Zt=p(Gt,Yt,Xt,!1,null,null);const W=Zt.exports,{t:B}=y(),es={name:"TmAdvancedEllipsisText",components:{CopyIcon:U},props:{rows:{type:Number,default:1},width:{type:String,default:"100%"},maxWidth:{type:String,default:""},showToolbar:{type:Boolean,default:!1},text:{type:String,default:""},showTooltip:{type:Boolean,default:!0},copyable:{type:Boolean,default:!1}},data(){return{isVue2:!0,originalText:"",isHovered:!1,lineHeight:0,containerWidth:0,resizeObserver:null,isCalculating:!1,frontLines:[],lastLineText:"",isLastLineEllipsis:!1,tableRowElement:null}},computed:{containerStyle(){const t={};return this.maxWidth?(t.maxWidth=this.maxWidth,t.width=this.width):t.width=this.width,t},hasToolbarSlot(){return this.$slots.toolbar?this.$slots.toolbar&&this.$slots.toolbar.length>0:!1},hasToolbarContent(){return this.copyable||this.hasToolbarSlot},shouldShowToolbar(){return this.showToolbar||this.isHovered&&this.hasToolbarContent}},mounted(){this.initComponent(),this.setupResizeObserver(),this.setupTableRowHover()},updated(){const t=this.getTextContent();t!==this.originalText&&(this.originalText=t,this.$nextTick(()=>{this.calculateLayout()}))},beforeDestroy(){this.cleanupResizeObserver(),this.cleanupTableRowHover()},beforeUnmount(){this.cleanupResizeObserver(),this.cleanupTableRowHover()},watch:{text:{handler(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLayout()})},immediate:!0},rows(){this.$nextTick(()=>{this.calculateLayout()})},shouldShowToolbar(){this.$nextTick(()=>{this.calculateLayout()})},"$slots.default":{handler(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLayout()})},deep:!0}},methods:{initComponent(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLineHeight(),this.$nextTick(()=>{this.calculateLayout()})})},handleCopy(){navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(this.originalText).then(()=>{this.$message.success(B("copySuccess"))}).catch(()=>{this.fallbackCopy()}):this.fallbackCopy()},fallbackCopy(){const t=document.createElement("textarea");t.value=this.originalText,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),this.$message.success(B("copySuccess"))}catch(e){this.$message.error(B("copyFailed"))}document.body.removeChild(t)},getTextContent(){return this.$slots.default?this.$slots.default.map(e=>e.text?e.text:e.children&&typeof e.children=="string"?e.children:e.children&&Array.isArray(e.children)?e.children.map(s=>s.text||"").join(""):"").join(""):this.text||""},calculateLineHeight(){const t=this.$refs.containerRef;if(!t)return;const e=window.getComputedStyle(t);this.containerWidth=t.offsetWidth;const s=this.$refs.measureRef;if(s){this.setMeasureElementStyle(s,{width:this.containerWidth+"px",wordBreak:"break-all",whiteSpace:"normal"}),s.textContent="测",s.offsetHeight;const i=s.offsetHeight;s.innerHTML="",this.lineHeight=i}else{const i=e.lineHeight;if(i&&i!=="normal")this.lineHeight=parseInt(i);else{const a=parseInt(e.fontSize);this.lineHeight=a*1.2}}},calculateLayout(){if(!this.isCalculating){if(!this.originalText||this.rows<=0){this.frontLines=[],this.lastLineText=this.originalText||"",this.isLastLineEllipsis=!1;return}this.isCalculating=!0,this.$nextTick(()=>{requestAnimationFrame(()=>{this.performLayoutCalculation()})})}},performLayoutCalculation(){const t=this.originalText;if(this.rows===1)this.frontLines=[],this.lastLineText=t,this.isLastLineEllipsis=this.checkIfTextOverflows(t);else{const e=this.lineHeight;if(this.getTextHeight(t)<=e)this.frontLines=[],this.lastLineText=t,this.isLastLineEllipsis=this.checkIfTextOverflows(t);else{const i=this.lineHeight*(this.rows-1),a=this.findTextForHeight(t,i);this.frontLines=this.splitTextToLines(a);const l=t.substring(a.length);this.lastLineText=l,this.isLastLineEllipsis=l.length>0&&this.checkIfTextOverflows(l)}}this.isCalculating=!1},findTextForHeight(t,e){if(this.getTextHeight(t)<=e)return t;let s=0,i=t.length,a="";for(;s<=i;){const l=Math.floor((s+i)/2),n=t.substring(0,l);this.getTextHeight(n)<=e?(a=n,s=l+1):i=l-1}return a},splitTextToLines(t){if(!t)return[];const e=[];let s=t;for(;s.length>0;){const i=this.findTextForHeight(s,this.lineHeight);if(i.length===0)break;e.push(i),s=s.substring(i.length)}return e},checkIfTextOverflows(t){if(!t)return!1;const e=this.getTextWidth(t),s=this.shouldShowToolbar&&this.hasToolbarContent?this.getToolbarWidth():0,i=this.containerWidth-s-5;return e>i},getToolbarWidth(){let t=0;return this.copyable&&(t+=20),this.hasToolbarSlot&&(t+=40),t},getTextHeight(t){return this.measureText(t,{width:this.containerWidth+"px",wordBreak:"break-all",whiteSpace:"normal"})},getTextWidth(t){return this.measureText(t,{whiteSpace:"nowrap"})},measureText(t,e={}){if(!this.$refs.containerRef||!this.$refs.measureRef)return 0;const s=this.$refs.measureRef,i=s.style.cssText;this.setMeasureElementStyle(s,e),s.textContent=t,s.offsetHeight;const a=e.whiteSpace==="nowrap"?s.offsetWidth:s.offsetHeight;return s.style.cssText=i,s.innerHTML="",a},setMeasureElementStyle(t,e={}){const s=window.getComputedStyle(this.$refs.containerRef);t.style.cssText="",t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.zIndex="-1",t.style.fontSize=s.fontSize,t.style.fontFamily=s.fontFamily,t.style.fontWeight=s.fontWeight,t.style.lineHeight=s.lineHeight,t.style.letterSpacing=s.letterSpacing,t.style.wordSpacing=s.wordSpacing,t.style.padding="0",t.style.margin="0",t.style.border="none",t.style.boxSizing="border-box",Object.entries(e).forEach(([i,a])=>{t.style[i]=a})},handleMouseEnter(){this.isHovered=!0},handleMouseLeave(){this.isHovered=!1},setupResizeObserver(){typeof ResizeObserver!="undefined"&&(this.resizeObserver=new ResizeObserver(t=>{const e=t[0];if(e){const s=e.contentRect.width;Math.abs(s-this.containerWidth)>1&&requestAnimationFrame(()=>{this.calculateLineHeight(),this.calculateLayout()})}}),this.$refs.containerRef&&this.resizeObserver.observe(this.$refs.containerRef))},cleanupResizeObserver(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},setupTableRowHover(){let t=this.$el;for(;t&&t!==document.body;){if(t.classList&&t.classList.contains("el-table__row")){this.tableRowElement=t;break}t=t.parentElement}this.tableRowElement&&(this.tableRowElement.addEventListener("mouseenter",this.handleMouseEnter),this.tableRowElement.addEventListener("mouseleave",this.handleMouseLeave))},cleanupTableRowHover(){this.tableRowElement&&(this.tableRowElement.removeEventListener("mouseenter",this.handleMouseEnter),this.tableRowElement.removeEventListener("mouseleave",this.handleMouseLeave),this.tableRowElement=null)}}};var ts=function(){var e=this,s=e._self._c;return s("div",{ref:"containerRef",staticClass:"tm-ellipsis-text",style:e.containerStyle,on:{mouseenter:e.handleMouseEnter,mouseleave:e.handleMouseLeave}},[e.showTooltip&&e.isLastLineEllipsis?s("el-tooltip",e._b({attrs:{content:e.originalText,disabled:!e.showTooltip||!e.isLastLineEllipsis,placement:"top"}},"el-tooltip",{[e.isVue2?"open-delay":"show-after"]:300},!1),[s("div",{staticClass:"tm-ellipsis-text-wrapper"},[e._l(e.frontLines,function(i,a){return s("div",{key:"front-"+a,staticClass:"tm-ellipsis-line",domProps:{innerHTML:e._s(i)}})}),s("div",{staticClass:"tm-ellipsis-last-line"},[s("div",{staticClass:"tm-ellipsis-text-part",domProps:{innerHTML:e._s(e.lastLineText)}}),e.shouldShowToolbar&&e.hasToolbarContent?s("div",{staticClass:"tm-ellipsis-toolbar-part"},[e.copyable?s("CopyIcon",{staticClass:"icon-item",on:{click:e.handleCopy}}):e._e(),e._t("toolbar")],2):e._e()])],2)]):s("div",{staticClass:"tm-ellipsis-text-wrapper"},[e._l(e.frontLines,function(i,a){return s("div",{key:"front-"+a,staticClass:"tm-ellipsis-line",domProps:{innerHTML:e._s(i)}})}),s("div",{staticClass:"tm-ellipsis-last-line"},[s("div",{staticClass:"tm-ellipsis-text-part",domProps:{innerHTML:e._s(e.lastLineText)}}),e.shouldShowToolbar&&e.hasToolbarContent?s("div",{staticClass:"tm-ellipsis-toolbar-part"},[e.copyable?s("CopyIcon",{staticClass:"icon-item",on:{click:e.handleCopy}}):e._e(),e._t("toolbar")],2):e._e()])],2),s("div",{ref:"measureRef",staticClass:"tm-ellipsis-measure"})],1)},ss=[],is=p(es,ts,ss,!1,null,"16643222");const N=is.exports,J={install:{install(t,e={}){[I,W,S,N].forEach(s=>t.component(s.name,s)),e.tableConfigProvider&&Ot(e.tableConfigProvider),e.lang&&$(e.lang||"zh-CN")}}.install,Table:I,Column:W,Search:E,Select:z,AdvancedInput:O,AdvancedDate:D,Cascader:M,Radio:A,Checkbox:R,Switch:H,EllipsisText:S,AdvancedEllipsisText:N,setLang:$,useLocale:y};typeof window!="undefined"&&window.Vue&&J.install(window.Vue),r.AdvancedDate=D,r.AdvancedEllipsisText=N,r.AdvancedInput=O,r.Cascader=M,r.Checkbox=R,r.Column=W,r.EllipsisText=S,r.Radio=A,r.Search=E,r.Select=z,r.Switch=H,r.Table=I,r.default=J,r.setLang=$,r.useLocale=y,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(r,d){typeof exports=="object"&&typeof module!="undefined"?d(exports,require("vue"),require("sortablejs")):typeof define=="function"&&define.amd?define(["exports","vue","sortablejs"],d):(r=typeof globalThis!="undefined"?globalThis:r||self,d(r.TmTable={},r.Vue,r.Sortable))})(this,function(r,d,u){"use strict";var ls=Object.defineProperty,ns=Object.defineProperties;var rs=Object.getOwnPropertyDescriptors;var F=Object.getOwnPropertySymbols;var K=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var q=(r,d,u)=>d in r?ls(r,d,{enumerable:!0,configurable:!0,writable:!0,value:u}):r[d]=u,h=(r,d)=>{for(var u in d||(d={}))K.call(d,u)&&q(r,u,d[u]);if(F)for(var u of F(d))Q.call(d,u)&&q(r,u,d[u]);return r},_=(r,d)=>ns(r,rs(d));var G=(r,d)=>{var u={};for(var m in r)K.call(r,m)&&d.indexOf(m)<0&&(u[m]=r[m]);if(r!=null&&F)for(var m of F(r))d.indexOf(m)<0&&Q.call(r,m)&&(u[m]=r[m]);return u};const m=t=>t,y=()=>"mini",Y={today:"今天",yesterday:"昨天",last7days:"最近7天",last30days:"最近30天",thisMonth:"本月",lastMonth:"上月",checkAll:"全选",search:"搜索",query:"查询",reset:"重置",columnSetting:"列设置",refresh:"刷新",cancel:"取消",fixedLeft:"固定在左侧",fixedRight:"固定在右侧",top:"置顶",restoreDefault:"恢复默认",saveAndApply:"保存并应用",startDate:"开始日期",endDate:"结束日期",all:"全选",SelectableFields:"可选择字段",fixedColumns:"固定列",leftmost:"左侧最多",rightmost:"右侧最多",items:"项",accurateSearchTips:"每行一个,支持多个值",accurateSearchPlaceholder:"精确搜索,一行一项",selectPlaceholder:"请选择",clear:"清空",saveSuccess:"保存成功",cancelRightFixed:"取消右侧固定",rightFixed:"固定到右侧",cancelLeftFixed:"取消左侧固定",leftFixed:"固定到左侧",cancelTop:"取消置顶",copySuccess:"复制成功",copyFailed:"复制失败"},X={today:"Today",yesterday:"Yesterday",last7days:"Last 7 days",last30days:"Last 30 days",thisMonth:"This month",lastMonth:"Last month",checkAll:"Check all",search:"Search",query:"Search",reset:"Reset",columnSetting:"Column Setting",refresh:"Refresh",cancel:"Cancel",fixedLeft:"Fixed left",fixedRight:"Fixed right",top:"Top",restoreDefault:"Restore default",saveAndApply:"Save and apply",startDate:"Start date",endDate:"End date",all:"All",SelectableFields:"Fields",fixedColumns:"Fixed columns",leftmost:"Leftmost",rightmost:"Rightmost",items:"item(s)",accurateSearchTips:"One per line, supporting multiple values",accurateSearchPlaceholder:"Accurate search, one per line",selectPlaceholder:"Please select",clear:"Clear",saveSuccess:"Successfully saved",cancelRightFixed:"Cancel right fixed",rightFixed:"Fixed to right",cancelLeftFixed:"Cancel left fixed",leftFixed:"Fixed to left",cancelTop:"Cancel top",copySuccess:"Copy successfully",copyFailed:"Copy failed"};var j;const Z={"zh-CN":Y,"en-US":X};let x={value:"zh-CN"};{const t=require("vue");t.observable||(j=t.default)!=null&&j.observable?x=t.default.observable(x):x=new t({data(){return{currentLang:x}}}).$data.currentLang}const ee=t=>{var e;return((e=Z[x.value])==null?void 0:e[t])||t},$=t=>{x.value=t},v=()=>({t:ee,setLang:$,currentLang:x});function p(t,e,s,i,a,l,n,c){var o=typeof t=="function"?t.options:t;return e&&(o.render=e,o.staticRenderFns=s,o._compiled=!0),l&&(o._scopeId="data-v-"+l),{exports:t,options:o}}const te=!0,se=!1,k="value",ie="input",ae={name:"TmSelectFilter",props:{[k]:{type:[String,Number,Array],default:""},field:{type:[String,Number],default:""},options:{type:[Array,Function],default:()=>[]},labelOptions:{type:Array,default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value"})},filterable:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},showCheckAll:{type:Boolean,default:!0},placeholder:{type:String,default:""}},data(){return{t:v().t,isVue2:te,isVue3:se,getDefaultSize:y,optionsList:[],loading:!1,indeterminate:!1,checkAll:!1,activedSelect:""}},computed:{computedValue:{get(){return this[k]},set(t){this.$emit(ie,t),this.$emit("change",t)}},fieldValue:{get(){return this.field},set(t){this.$emit("field-change",t)}},propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}}},watch:{[k](t){!this.multiple||!this.showCheckAll||(t.length===0?(this.checkAll=!1,this.indeterminate=!1):t.length===this.optionsList.length?(this.checkAll=!0,this.indeterminate=!1):this.indeterminate=!0)}},created(){this.initOptions()},methods:{async initOptions(){if(Array.isArray(this.options))this.optionsList=this.options;else if(typeof this.options=="function")try{this.loading=!0;const t=await this.options();Array.isArray(t)&&(this.optionsList=t)}catch(t){console.error(t)}finally{this.loading=!1}},handleCheckAll(t){this.indeterminate=!1;let e=[];t&&(e=this.optionsList.map(s=>s[this.propMap.value])),this.computedValue=e},setActivedSelect(t){this.activedSelect=t}}};var le=function(){var e=this,s=e._self._c;return s("div",{staticClass:"advanced-select",class:{hasField:e.labelOptions&&e.labelOptions.length>0}},[e.labelOptions&&e.labelOptions.length>0?s("el-select",{staticClass:"field-select",class:`field-select--${e.isVue2?"v2":"v3"}`,style:`z-index:${e.activedSelect==="left"?2:0}`,attrs:{size:e.getDefaultSize()},on:{focus:function(i){return e.setActivedSelect("left")}},model:{value:e.fieldValue,callback:function(i){e.fieldValue=i},expression:"fieldValue"}},e._l(e.labelOptions,function(i){return s("el-option",{key:i.value,attrs:{label:i.label,value:i.value}})}),1):e._e(),s("el-select",e._g(e._b({ref:"select",staticClass:"select",class:`select--${e.isVue3?"v3":"v2"}`,style:`z-index:${e.activedSelect==="right"?2:0}`,attrs:{loading:e.loading},on:{focus:function(i){return e.setActivedSelect("right")}},scopedSlots:e._u([{key:"header",fn:function(){return[e.isVue3&&e.multiple&&e.showCheckAll?s("el-checkbox",{staticStyle:{width:"100%",height:"20px","padding-left":"10px"},attrs:{indeterminate:e.indeterminate,size:e.getDefaultSize()},on:{change:e.handleCheckAll},model:{value:e.checkAll,callback:function(i){e.checkAll=i},expression:"checkAll"}},[e._v(e._s(e.t("all")))]):e._e()]},proxy:!0}]),model:{value:e.computedValue,callback:function(i){e.computedValue=i},expression:"computedValue"}},"el-select",_(h({},e.$attrs),{size:e.getDefaultSize(),filterable:e.filterable,clearable:e.clearable,collapseTags:e.collapseTags,multiple:e.multiple,placeholder:e.placeholder,loading:e.loading}),!1),e.isVue2?e.$listeners:{}),[e.isVue2&&e.multiple&&e.showCheckAll?s("div",{staticClass:"check-all-option"},[s("el-checkbox",{staticStyle:{width:"100%"},attrs:{indeterminate:e.indeterminate,size:e.getDefaultSize()},on:{change:e.handleCheckAll},model:{value:e.checkAll,callback:function(i){e.checkAll=i},expression:"checkAll"}},[e._v(e._s(e.t("all")))])],1):e._e(),e._l(e.optionsList,function(i){return s("el-option",{key:i[e.propMap.value],attrs:{label:i[e.propMap.label],value:i[e.propMap.value],disabled:i.disabled}},[e._t("option",function(){return[e._v(e._s(i[e.propMap.label]))]},{item:i})],2)})],2)],1)},ne=[],re=p(ae,le,ne,!1,null,"467dcdd3");const z=re.exports,oe={name:"BaseIcon",props:{path:{type:String},size:{type:[String,Number]},color:{type:String}},methods:{handleClick(){this.$emit("click")}}};var ue=function(){var e=this,s=e._self._c;return s("i",{staticClass:"tm-icon",on:{click:e.handleClick}},[s("svg",{style:{color:e.color},attrs:{width:e.size,height:e.size,viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"}},[s("path",{attrs:{d:e.path}})])])},ce=[],de=p(oe,ue,ce,!1,null,"1c30ca93");const he=de.exports,b=Object.entries({menu:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z",more:"M76.92892277 192.94787572h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758118s-23.20379058-46.40758118-46.40758118-46.40758116H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758116s23.20379058 46.40758118 46.40758264 46.40758118zM941.27013031 465.59241882H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758118s23.20379058 46.40758118 46.40758264 46.40758118h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758118s-23.20379058-46.40758118-46.40758118-46.40758118zM941.27013031 825.25117589H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758118s23.20379058 46.40758118 46.40758264 46.40758264h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758264s-23.20379058-46.40758118-46.40758118-46.40758118z",refresh:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z",move:"M238.93333333 102.4a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0zM238.93333333 375.46666667a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m-409.6 273.06666666a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m-341.33333333 204.8a68.26666667 68.26666667 0 1 0 0 136.53333334 68.26666667 68.26666667 0 0 0 0-136.53333334z m341.33333333 68.26666667a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z","column-setting":"M436.05333334 18.36373333a109.22666667 109.22666667 0 0 1 109.22666666 0l345.56586667 199.54346667c33.792 19.52426667 54.61333333 55.56906667 54.61333333 94.54933333V580.26666667h-81.92V312.45653333a27.30666667 27.30666667 0 0 0-13.65333333-23.62026666L504.32 89.2928a27.30666667 27.30666667 0 0 0-27.30666666 0L131.44746667 288.83626667a27.30666667 27.30666667 0 0 0-13.65333333 23.62026666v399.08693334a27.30666667 27.30666667 0 0 0 13.65333333 23.62026666L477.01333334 934.7072a27.30666667 27.30666667 0 0 0 27.30666666 0l54.61333334-31.5392v94.54933333l-13.65333334 7.91893334a109.22666667 109.22666667 0 0 1-109.22666666 0l-345.56586667-199.54346667a109.22666667 109.22666667 0 0 1-54.61333333-94.54933333V312.45653333c0-38.98026667 20.82133333-75.09333333 54.61333333-94.54933333L436.05333334 18.36373333z","fixed-left":"M843.36363653 311.54545478l-53.18181827 1e-8-20.45454521 28.63636347-163.63636435 204.54545479-24.54545391 28.63636347 12.27272695 36.81818175c8.18181826 28.63636347 12.27272695 57.27272695 12.27272696 85.90909042 0 32.72727305-4.09090869 61.36363652-16.36363565 90-4.09090869 16.36363653-12.27272695 32.72727306-24.54545479 49.09090957l-163.63636347-163.63636347-40.90909131-40.90909132-12.27272695-12.27272695-163.63636348-163.63636347c28.63636347-16.36363653 61.36363652-28.63636347 94.09090869-32.72727305 45-8.18181826 90-4.09090869 134.99999999 8.18181826l36.81818175 12.27272695 28.63636347-24.54545391 204.54545479-163.63636435 28.63636347-16.36363564 0-32.72727305L712.45454521 184.72727305l130.90909132 126.81818173zM941.54545479 327.90909131c0-8.18181826-4.09090869-16.36363653-8.18181826-24.54545478L720.63636348 94.72727305c-12.27272695-16.36363653-36.81818174-12.27272695-49.09090869 4.0909087-20.45454521 28.63636347-28.63636347 65.45454521-28.63636348 98.18181825l0 4.09090869-204.54545478 163.63636436c-110.45454521-36.81818174-233.18181826-16.36363653-327.27272784 61.36363564-8.18181826 8.18181826-12.27272695 16.36363653-12.27272694 24.54545478 0 8.18181826 4.09090869 16.36363653 8.18181825 24.5454548l196.36363653 196.36363652-212.72727305 212.72727216c-4.09090869 4.09090869-8.18181826 12.27272695-8.18181826 20.4545461s4.09090869 16.36363653 8.18181826 20.4545452c12.27272695 12.27272695 32.72727306 12.27272695 45 1e-8L352.45454522 716.54545479l196.36363652 196.36363652c12.27272695 12.27272695 36.81818174 12.27272695 49.09090957-4.09090957C651.09090869 847.45454521 675.63636347 773.81818174 675.63636346 696.09090869c0-36.81818173-4.09090869-73.63636348-16.36363651-106.36363564l163.63636436-204.54545479c36.81818173 0 73.63636348-8.18181826 106.36363564-28.63636347C937.45454519 348.36363653 941.54545478 336.09090869 941.54545479 327.90909131z","fixed-right":"M311.54545479 180.63636347v53.18181827l28.63636347 20.45454521 204.54545479 163.63636436 28.63636347 24.5454539 36.81818174-12.27272695c28.63636347-8.18181826 57.27272695-12.27272695 85.90909043-12.27272695 32.72727305 0 61.36363652 4.09090869 90 16.36363564 16.36363653 4.09090869 32.72727305 12.27272695 49.09090957 24.54545479l-163.63636347 163.63636347-40.90909132 40.90909131-12.27272695 12.27272695-163.63636347 163.63636348c-16.36363653-28.63636347-28.63636347-61.36363652-32.72727305-94.09090869-8.18181826-45-4.09090869-90 8.18181826-135l12.27272695-36.81818174-24.5454539-28.63636347-163.63636436-204.54545479-16.36363564-28.63636347h-32.72727305H184.72727305l126.81818174-130.90909132zM327.90909131 82.45454521c-8.18181826 0-16.36363653 4.09090869-24.54545478 8.18181826L94.72727305 303.36363652c-16.36363653 12.27272695-12.27272695 36.81818174 4.09090869 49.09090869 28.63636347 20.45454521 65.45454521 28.63636347 98.18181826 28.63636348h4.09090869l163.63636436 204.54545478c-36.81818174 110.45454521-16.36363653 233.18181826 61.36363564 327.27272784 8.18181826 8.18181826 16.36363653 12.27272695 24.54545478 12.27272695 8.18181826 0 16.36363653-4.09090869 24.54545479-8.18181826l196.36363653-196.36363653 212.72727216 212.72727305c4.09090869 4.09090869 12.27272695 8.18181826 20.4545461 8.18181827s16.36363653-4.09090869 20.45454521-8.18181827c12.27272695-12.27272695 12.27272695-32.72727305 0-45L716.54545479 671.54545479l196.36363652-196.36363653c12.27272695-12.27272695 12.27272695-36.81818174-4.09090957-49.09090957C847.45454521 372.90909131 773.81818174 348.36363653 696.09090869 348.36363653c-36.81818174 0-73.63636348 4.09090869-106.36363564 16.36363652l-204.54545479-163.63636436c0-36.81818174-8.18181826-73.63636348-28.63636347-106.36363564C348.36363653 86.54545479 336.09090869 82.45454521 327.90909131 82.45454521z",upload:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248z",download:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z",delete:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32",copy:"M128 320v576h576V320zm-32-64h640a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V288a32 32 0 0 1 32-32M960 96v704a32 32 0 0 1-32 32h-96v-64h64V128H384v64h-64V96a32 32 0 0 1 32-32h576a32 32 0 0 1 32 32M256 672h320v64H256zm0-192h320v64H256z"}).reduce((t,[e,s])=>{const i=`${e}Icon`,a={name:i,props:{path:{type:String,default:s},size:{type:[String,Number]},color:{type:String}},render(l){return l(he,{props:this.$props,on:{click:()=>this.$emit("click")}})}};return a.install=l=>{l.component(i,a)},t[e]=a,t},{}),pe=b.menu,fe=b.refresh,me=b.move;b["column-setting"];const ge=b.more,be=b["fixed-left"],ye=b["fixed-right"],ve=b.upload,Ce=b.download,_e=b.delete,U=b.copy,{t:L}=v(),xe=!0,Se=!1,Te={name:"TmEllipsisText",components:{CopyIcon:U},props:{text:{type:String,required:!0},width:{type:[String,Number],default:"auto"},maxWidth:{type:[String,Number],default:"100%"},lines:{type:Number,default:1},showTooltip:{type:Boolean,default:!0},lineHeight:{type:[String,Number]},copyable:{type:Boolean,default:!1}},data(){return{isVue2:xe,isVue3:Se,isOverflow:!1,currentLines:1,resizeObserver:null}},computed:{tooltipDisabled(){return!this.showTooltip||!this.isOverflow},textStyle(){const t=typeof this.width=="number"?`${this.width}px`:this.width,e=typeof this.maxWidth=="number"?`${this.maxWidth}px`:this.maxWidth;return{width:t,maxWidth:e,lineHeight:this.lineHeight,display:"-webkit-inline-box",overflow:"hidden",WebkitBoxOrient:"vertical",WebkitLineClamp:this.lines}}},mounted(){this.checkOverflow(),this.setupResizeObserver()},beforeDestroy(){this.cleanupResizeObserver()},beforeUnmount(){this.cleanupResizeObserver()},watch:{text(){this.$nextTick(this.checkOverflow)}},methods:{checkOverflow(){this.$refs.textEl&&this.$nextTick(()=>{this.$nextTick(()=>{this.performOverflowCheck()})})},performOverflowCheck(){var f;const t=this.$refs.textEl;if(!t)return;const e=getComputedStyle(t);if(!e.width||e.width==="0px"){this.$nextTick(()=>{this.performOverflowCheck()});return}const s=t.scrollHeight,i=t.scrollWidth,a=t.clientHeight,l=t.clientWidth,n=1,c=s>a+n,o=i>l+n;if(c||o){this.isOverflow=!0;const C=parseFloat(e.lineHeight)||16;this.currentLines=Math.ceil(s/C)}else{const C=t.getBoundingClientRect(),T=(f=t.parentElement)==null?void 0:f.getBoundingClientRect();if(T){const as=C.height>T.height||C.width>T.width;this.isOverflow=as}else this.isOverflow=!1;this.currentLines=1}},setupResizeObserver(){window.ResizeObserver&&this.$nextTick(()=>{try{this.resizeObserver=new ResizeObserver(()=>{this.checkOverflow()});const t=this.$el;t&&t instanceof Element&&this.resizeObserver.observe(t)}catch(t){console.warn("Failed to setup ResizeObserver:",t)}})},cleanupResizeObserver(){if(this.resizeObserver)try{this.resizeObserver.disconnect()}catch(t){console.warn("Failed to disconnect ResizeObserver:",t)}finally{this.resizeObserver=null}},handleCopy(){navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(this.text).then(()=>{this.$message.success(L("copySuccess"))}).catch(()=>{this.fallbackCopy()}):this.fallbackCopy()},fallbackCopy(){const t=document.createElement("textarea");t.value=this.text,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),this.$message.success(L("copySuccess"))}catch(e){this.$message.error(L("copyFailed"))}document.body.removeChild(t)}}};var $e=function(){var e=this,s=e._self._c;return s("el-tooltip",e._b({attrs:{disabled:e.tooltipDisabled,content:e.text,effect:"dark",placement:"top"}},"el-tooltip",{[e.isVue2?"open-delay":"show-after"]:300},!1),[s("div",{staticClass:"ellipsis-text-container"},[s("div",{ref:"textEl",staticClass:"ellipsis-text",style:e.textStyle},[e._v(" "+e._s(e.text)+" ")]),s("div",{staticClass:"toolbar",class:{multiline:e.currentLines>1&&e.lines>1}},[e.copyable?s("CopyIcon",{staticClass:"icon-item",on:{click:e.handleCopy}}):e._e()],1)])])},we=[],Ve=p(Te,$e,we,!1,null,"0979131f");const S=Ve.exports,Fe=!0,ke=!1,ze={name:"TmAdvancedInputFilter",components:{MoreIcon:ge,EllipsisText:S},props:{label:{type:String,default:""},value:{type:String,default:""},field:{type:[String,Number],default:""},placeholder:{type:String,default:""},multiple:{type:Boolean,default:!1},labelOptions:{type:Array,default:()=>[]}},data(){return{t:v().t,isVue3:ke,isVue2:Fe,getDefaultSize:y,getCompatSize:m,exactValue:"",inputValue:"",isExactMode:!1,currentOptionMultiple:!1}},computed:{width(){return this.labelOptions&&this.labelOptions.length||this.label?"305px":"200px"},fieldValue:{get(){return this.field},set(t){this.$emit("field-change",t)}},shouldShowMultiple(){return this.currentOptionMultiple!==null?this.currentOptionMultiple:this.multiple},selectedOption(){return!this.labelOptions||!this.labelOptions.length||!this.field?null:this.labelOptions.find(t=>t.value===this.field)}},watch:{labelOptions:{handler(t){t&&t.length>0&&(this.field||this.$emit("field-change",t[0].value),this.updateCurrentOptionMultiple())},deep:!0,immediate:!0},field:{handler(){this.updateCurrentOptionMultiple()},immediate:!0},isExactMode(t){t?this.$emit("value-change",this.exactValue):this.$emit("value-change",this.inputValue)},exactValue(t){this.$emit("value-change",t)},inputValue(t){this.$emit("value-change",t)},value:{handler(t){this.isExactMode?this.exactValue=t:this.inputValue=t},immediate:!0}},methods:{handlePopoverClose(){document.activeElement&&document.activeElement.blur(),this.isExactMode=!1},handleVisibleChange(t){this.isExactMode=t},handlefieldChange(t){this.$emit("field-change",t),this.updateCurrentOptionMultiple()},updateCurrentOptionMultiple(){const t=this.selectedOption;t&&"multiple"in t?this.currentOptionMultiple=t.multiple:this.currentOptionMultiple=this.multiple},handleExactSearch(){this.$emit("value-change",this.exactValue),this.$emit("search",this.exactValue)},handleClear(){this.exactValue="",this.$emit("value-change","")},handleEnter(){this.$emit("search")}},created(){this.updateCurrentOptionMultiple()}};var Le=function(){var e=this,s=e._self._c;return s("div",{staticClass:"tm-advanced-input",class:`tm-advanced-input--${e.isVue3?"v3":"v2"}`,style:{width:e.width}},[e.labelOptions&&e.labelOptions.length?s("el-select",{staticClass:"left-select",staticStyle:{width:"100px","flex-shrink":"0"},attrs:{placeholder:e.t("selectPlaceholder"),size:e.getDefaultSize()},on:{change:e.handlefieldChange},model:{value:e.fieldValue,callback:function(i){e.fieldValue=i},expression:"fieldValue"}},e._l(e.labelOptions,function(i){return s("el-option",{key:i.value,attrs:{label:i.label,value:i.value}})}),1):e.label?s("div",{staticClass:"input-label"},[s("EllipsisText",{attrs:{text:e.label,lines:2}})],1):e._e(),s("el-input",{staticClass:"right-input",class:{"has-label":e.labelOptions&&e.labelOptions.length},attrs:{size:e.getDefaultSize(),placeholder:e.placeholder,clearable:""},nativeOn:{keyup:function(i){return!i.type.indexOf("key")&&e._k(i.keyCode,"enter",13,i.key,"Enter")?null:e.handleEnter.apply(null,arguments)}},model:{value:e.inputValue,callback:function(i){e.inputValue=i},expression:"inputValue"}},[e.shouldShowMultiple?s("el-popover",e._g(e._b({attrs:{slot:"append"},slot:"append",scopedSlots:e._u([{key:"reference",fn:function(){return[s("MoreIcon",{staticStyle:{cursor:"pointer"}})]},proxy:!0}],null,!1,1001141487)},"el-popover",{[e.isVue3?"visible":"value"]:e.isExactMode,placement:"bottom-end",width:260,trigger:"click"},!1),{[e.isVue3?"update:visible":"input"]:e.handleVisibleChange}),[s("div",{staticClass:"popover-content"},[s("p",{staticClass:"popover-subtitle"},[e._v(e._s(e.t("accurateSearchTips")))]),s("el-input",{staticStyle:{"font-size":"12px"},attrs:{size:e.getDefaultSize(),type:"textarea",rows:8,placeholder:e.t("accurateSearchPlaceholder")},model:{value:e.exactValue,callback:function(i){e.exactValue=i},expression:"exactValue"}}),s("div",{staticClass:"popover-footer"},[s("el-button",{staticStyle:{float:"left"},attrs:{size:e.getCompatSize("mini")},on:{click:e.handleClear}},[e._v(e._s(e.t("clear")))]),s("el-button",{attrs:{size:e.getCompatSize("mini")},on:{click:e.handlePopoverClose}},[e._v(e._s(e.t("cancel")))]),s("el-button",{attrs:{type:"primary",size:e.getCompatSize("mini")},on:{click:e.handleExactSearch}},[e._v(e._s(e.t("search")))])],1)],1)]):e._e()],1)],1)},Oe=[],De=p(ze,Le,Oe,!1,null,"6b474dac");const O=De.exports,{t:g}=v(),Me=!0,Ae=!1,Re="value",He={name:"TmAdvancedDateFilter",components:{EllipsisText:S},props:{value:{type:[Array,String,Date],default:()=>null},field:{type:[String,Number],default:""},start:{type:[String,Number],default:""},end:{type:[String,Number],default:""},size:{type:String,default:"mini"},labelOptions:{type:Array,default:()=>[]},label:{type:String,default:""},type:{type:String,default:"daterange",validator:t=>["date","daterange","datetime","datetimerange","year","month","dates","months","years","week","monthrange"].includes(t)},format:{type:String,default:""},startPlaceholder:{type:String,default:void 0},endPlaceholder:{type:String,default:void 0},placeholder:{type:String,default:void 0},rangeSeparator:{type:String,default:"-"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},align:{type:String,default:"left"},popperClass:{type:String,default:""},defaultValue:{type:[Date,Array],default:null},defaultTime:{type:[Date,String,Array],default:null},shortcuts:{type:Array,default:()=>[]},pastOnly:{type:Boolean,default:!1}},computed:{isRangeType(){return["daterange","datetimerange","monthrange"].includes(this.type)},computedStartPlaceholder(){if(this.isRangeType)return this.startPlaceholder!==void 0?this.startPlaceholder:g("startDate")},computedEndPlaceholder(){if(this.isRangeType)return this.endPlaceholder!==void 0?this.endPlaceholder:g("endDate")},computedDatePickerStyle(){const t=this.labelOptions&&this.labelOptions.length>0,e=this.label&&!this.isRangeType&&(!this.labelOptions||this.labelOptions.length===0);return t?"width: 206px":e?"width: 200px":"width: 306px"},computedFormat(){const t="yyyy";return this.format?this.format:this.type==="year"?t:this.type==="month"?`${t}-MM`:this.type==="date"?`${t}-MM-dd`:this.type==="dates"?`${t}-MM-dd`:this.type==="months"?`${t}-MM`:this.type==="years"?t:this.type==="week"?`${t}-MM-WW`:this.type==="datetime"?`${t}-MM-dd HH:mm:ss`:this.type==="datetimerange"?`${t}-MM-dd HH:mm:ss`:this.type==="daterange"?`${t}-MM-dd`:this.type==="monthrange"?`${t}-MM`:""},computedPickerOptions(){const t={};if(this.pastOnly&&(t.disabledDate=e=>e.getTime()>Date.now()),["daterange","datetimerange"].includes(this.type)){const e=this.type==="datetimerange";t.shortcuts=this.shortcuts.length>0?this.shortcuts:[{text:g("today"),onClick(s){const i=new Date,a=new Date;e&&(a.setHours(0,0,0,0),i.setHours(23,59,59,999)),s.$emit("pick",[a,i])}},{text:g("yesterday"),onClick(s){const i=new Date,a=new Date;a.setTime(a.getTime()-3600*1e3*24),i.setTime(i.getTime()-3600*1e3*24),e&&(a.setHours(0,0,0,0),i.setHours(23,59,59,999)),s.$emit("pick",[a,i])}},{text:g("last7days"),onClick(s){const i=new Date,a=new Date;a.setTime(a.getTime()-3600*1e3*24*7),e&&(a.setHours(0,0,0,0),i.setHours(23,59,59,999)),s.$emit("pick",[a,i])}},{text:g("last30days"),onClick(s){const i=new Date,a=new Date;a.setTime(a.getTime()-3600*1e3*24*30),e&&(a.setHours(0,0,0,0),i.setHours(23,59,59,999)),s.$emit("pick",[a,i])}},{text:g("thisMonth"),onClick(s){const i=new Date,a=new Date;a.setDate(1),e&&(a.setHours(0,0,0,0),i.setHours(23,59,59,999)),s.$emit("pick",[a,i])}},{text:g("lastMonth"),onClick(s){const i=new Date,a=new Date;a.setMonth(a.getMonth()-1),a.setDate(1),i.setDate(0),e&&(a.setHours(0,0,0,0),i.setHours(23,59,59,999)),s.$emit("pick",[a,i])}}]}return t},computedShortcuts(){if(!["daterange","datetimerange"].includes(this.type))return[];if(this.shortcuts&&this.shortcuts.length>0)return this.shortcuts;const t=this.type==="datetimerange";return[{text:g("today"),value:()=>{const e=new Date,s=new Date;return t&&(s.setHours(0,0,0,0),e.setHours(23,59,59,999)),[s,e]}},{text:g("yesterday"),value:()=>{const e=new Date,s=new Date;return s.setTime(s.getTime()-3600*1e3*24),e.setTime(e.getTime()-3600*1e3*24),t&&(s.setHours(0,0,0,0),e.setHours(23,59,59,999)),[s,e]}},{text:g("last7days"),value:()=>{const e=new Date,s=new Date;return s.setTime(s.getTime()-3600*1e3*24*7),t&&(s.setHours(0,0,0,0),e.setHours(23,59,59,999)),[s,e]}},{text:g("last30days"),value:()=>{const e=new Date,s=new Date;return s.setTime(s.getTime()-3600*1e3*24*30),t&&(s.setHours(0,0,0,0),e.setHours(23,59,59,999)),[s,e]}},{text:g("thisMonth"),value:()=>{const e=new Date,s=new Date;return s.setDate(1),t&&(s.setHours(0,0,0,0),e.setHours(23,59,59,999)),[s,e]}},{text:g("lastMonth"),value:()=>{const e=new Date,s=new Date;return s.setMonth(s.getMonth()-1),s.setDate(1),e.setDate(0),t&&(s.setHours(0,0,0,0),e.setHours(23,59,59,999)),[s,e]}}]},computedDisabledDate(){return this.pastOnly?t=>t.getTime()>Date.now():null},computedDefaultTime(){let t=this.defaultTime;if(this.type==="datetimerange"&&!this.defaultTime&&(t=["00:00:00","23:59:59"]),this.isVue2)return t;if(t){if(this.type==="datetimerange"&&Array.isArray(t))return t.map(e=>{if(typeof e=="string"){const s=new Date,[i,a,l]=e.split(":").map(Number);return new Date(s.getFullYear(),s.getMonth(),s.getDate(),i,a,l||0)}return e});if(this.type==="datetime"&&typeof t=="string"){const e=new Date,[s,i,a]=t.split(":").map(Number);return new Date(e.getFullYear(),e.getMonth(),e.getDate(),s,i,a||0)}return t}},dateValue(){return this.isRangeType?this.start||this.end?[this.start,this.end]:this.value:this.value},fieldValue:{get(){return this.field},set(t){this.$emit("field-change",t)}}},data(){return{t:g,isVue2:Me,isVue3:Ae,getDefaultSize:y,valueField:Re}},methods:{handleDateChange(t){this.isRangeType?(this.$emit("value-change",t),t&&Array.isArray(t)&&t.length===2?(this.$emit("start-change",t),this.$emit("end-change",t)):(this.$emit("start-change",[]),this.$emit("end-change",[]))):this.$emit("value-change",t)},handleBlur(t){this.$emit("blur",t)},handleFocus(t){this.$emit("focus",t)}},watch:{labelOptions:{handler(t){t&&t.length>0&&!this.field&&this.$emit("field-change",t[0].value)},deep:!0,immediate:!0}}};var Ee=function(){var e=this,s=e._self._c;return s("div",{staticClass:"tm-date-picker",class:[`tm-date-picker--${e.isVue3?"v3":"v2"}`,{"has-select":e.labelOptions&&e.labelOptions.length>0,"has-label":e.label&&!e.isRangeType&&(!e.labelOptions||e.labelOptions.length===0)}]},[e.labelOptions&&e.labelOptions.length>0?s("el-select",{staticStyle:{width:"100px"},attrs:{size:e.getDefaultSize()},model:{value:e.fieldValue,callback:function(i){e.fieldValue=i},expression:"fieldValue"}},e._l(e.labelOptions,function(i){return s("el-option",{key:i.value,attrs:{label:i.label,value:i.value}})}),1):e.label?s("div",{staticClass:"date-label"},[s("EllipsisText",{attrs:{text:e.label,lines:2}})],1):e._e(),e.isVue2?s("el-date-picker",{style:e.computedDatePickerStyle,attrs:{value:e.dateValue,type:e.type,size:e.getDefaultSize(),"range-separator":e.rangeSeparator,"start-placeholder":e.computedStartPlaceholder,"end-placeholder":e.computedEndPlaceholder,placeholder:e.placeholder,"picker-options":e.computedPickerOptions,format:e.computedFormat,"value-format":e.computedFormat,disabled:e.disabled,clearable:e.clearable,readonly:e.readonly,editable:e.editable,align:e.align,"popper-class":e.popperClass,"default-value":e.defaultValue,"default-time":e.computedDefaultTime},on:{input:e.handleDateChange,change:e.handleDateChange,blur:e.handleBlur,focus:e.handleFocus}}):s("el-date-picker",{style:e.computedDatePickerStyle,attrs:{"model-value":e.dateValue,type:e.type,size:e.getDefaultSize(),"range-separator":e.rangeSeparator,"start-placeholder":e.computedStartPlaceholder,"end-placeholder":e.computedEndPlaceholder,placeholder:e.placeholder,shortcuts:e.computedShortcuts,"disabled-date":e.computedDisabledDate,format:e.computedFormat,"value-format":e.computedFormat,disabled:e.disabled,clearable:e.clearable,readonly:e.readonly,editable:e.editable,teleported:!1,"popper-class":e.popperClass,"default-value":e.defaultValue,"default-time":e.computedDefaultTime},on:{"update:model-value":e.handleDateChange,change:e.handleDateChange,blur:e.handleBlur,focus:e.handleFocus}})],1)},Pe=[],Ie=p(He,Ee,Pe,!1,null,"7d46d46b");const D=Ie.exports,We=!0,Be={name:"TmCascaderFilter",props:{value:{type:[String,Number,Array],default:""},options:{type:[Array,Function],default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value",children:"children",expandTrigger:"hover"})},filterable:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!0},collapseTagsTooltip:{type:Boolean,default:!0},placeholder:{type:String,default:""}},data(){return{isVue2:We,getDefaultSize:y,selectedValue:this.value,optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value",children:this.props.children||"children"}},cascaderProps(){return _(h({},this.props),{expandTrigger:this.props.expandTrigger||"hover"})}},watch:{value:{immediate:!0,handler(t){this.selectedValue=t}},options:{immediate:!0,handler(t){this.initOptions(t)}},selectedValue(t){this.$emit("input",t),this.$emit("change",t)}},methods:{async initOptions(t){if(typeof t=="function")try{this.loading=!0;const e=await t();Array.isArray(e)&&(this.optionsList=e)}catch(e){console.error(e)}finally{this.loading=!1}else Array.isArray(t)&&(this.optionsList=t)}}};var Ne=function(){var e=this,s=e._self._c;return s("el-cascader",e._g(e._b({ref:"cascader",staticClass:"tm-cascader",class:`tm-cascader--${e.isVue2?"v2":"v3"}`,staticStyle:{width:"200px"},scopedSlots:e._u([{key:"default",fn:function({node:i,data:a}){return[e._t("default",function(){return[s("span",[e._v(e._s(a[e.propMap.label]))])]},{node:i,data:a})]}}],null,!0),model:{value:e.selectedValue,callback:function(i){e.selectedValue=i},expression:"selectedValue"}},"el-cascader",_(h({},e.$attrs),{size:e.getDefaultSize(),filterable:e.filterable,clearable:e.clearable,collapseTags:e.collapseTags,collapseTagsTooltip:e.collapseTagsTooltip,props:e.cascaderProps,placeholder:e.placeholder,options:e.optionsList,loading:e.loading}),!1),e.isVue2?e.$listeners:{}))},je=[],Ue=p(Be,Ne,je,!1,null,null);const M=Ue.exports,Je=!0,qe=!1,Ke={name:"TmRadioFilter",props:{value:{type:[String,Number],default:""},options:{type:[Array,Function],default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value"})},size:{type:String,default:"mini"},width:{type:[String,Number],default:200}},data(){return{isVue2:Je,isVue3:qe,getDefaultSize:y,selectedValue:this.value,optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}},hasWideOptions(){return this.optionsList.length>4},calculateItemWidth(){if(!this.optionsList.length)return{};const e=`${(this.hasWideOptions?305:200)/this.optionsList.length}px`;return{width:e,flex:`0 0 ${e}`}}},watch:{value:{immediate:!0,handler(t){this.selectedValue=t}},options:{immediate:!0,handler(t){this.$slots.default||this.initOptions(t)}},selectedValue(t){this.$emit("input",t),this.$emit("change",t)}},methods:{async initOptions(t){if(typeof t=="function")try{this.loading=!0;const e=await t();Array.isArray(e)&&(this.optionsList=e)}catch(e){console.error(e)}finally{this.loading=!1}else Array.isArray(t)&&(this.optionsList=t)}}};var Qe=function(){var e=this,s=e._self._c;return s("div",{staticClass:"tm-radio",class:{"wide-mode":e.hasWideOptions,"tm-radio--v3":e.isVue3,"tm-radio--v2":e.isVue2}},[s("el-radio-group",e._g(e._b({ref:"radioGroup",model:{value:e.selectedValue,callback:function(i){e.selectedValue=i},expression:"selectedValue"}},"el-radio-group",_(h({},e.$attrs),{size:e.getDefaultSize()}),!1),e.isVue2?e.$listeners:{}),[e.$slots.default?[e._t("default")]:e._l(e.optionsList,function(i){return s("el-radio-button",e._b({key:i[e.propMap.value]},"el-radio-button",{[e.isVue3?"value":"label"]:i[e.propMap.value],disabled:i.disabled,style:e.calculateItemWidth},!1),[e._t("option",function(){return[e._v(e._s(i[e.propMap.label]))]},{item:i})],2)})],2)],1)},Ge=[],Ye=p(Ke,Qe,Ge,!1,null,"61fed13d");const A=Ye.exports,Xe=!0,Ze=!1,et={name:"TmCheckboxFilter",props:{value:{type:Array,default:()=>[]},options:{type:[Array,Function],default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value"})},size:{type:String,default:"mini"},width:{type:[String,Number],default:200}},data(){return{isVue2:Xe,isVue3:Ze,getDefaultSize:y,selectedValue:this.value||[],optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}},hasWideOptions(){return this.optionsList.length>4},calculateItemWidth(){if(!this.optionsList.length)return{};const t=Math.ceil(this.optionsList.length/(this.hasWideOptions?6:4)),e=Math.ceil(this.optionsList.length/t),i=`${(this.hasWideOptions?305:200)/e}px`;return{width:i,flex:`0 0 ${i}`}}},watch:{value:{immediate:!0,handler(t){this.selectedValue=t||[]}},options:{immediate:!0,handler(t){this.$slots.default||this.initOptions(t)}},selectedValue(t){this.$emit("input",t),this.$emit("change",t)}},methods:{async initOptions(t){if(typeof t=="function")try{this.loading=!0;const e=await t();Array.isArray(e)&&(this.optionsList=e)}catch(e){console.error(e)}finally{this.loading=!1}else Array.isArray(t)&&(this.optionsList=t)}}};var tt=function(){var e=this,s=e._self._c;return s("div",{staticClass:"tm-checkbox",class:{"wide-mode":e.hasWideOptions,"tm-checkbox--v3":e.isVue3,"tm-checkbox--v2":e.isVue2}},[s("el-checkbox-group",e._g(e._b({ref:"checkboxGroup",model:{value:e.selectedValue,callback:function(i){e.selectedValue=i},expression:"selectedValue"}},"el-checkbox-group",_(h({},e.$attrs),{size:e.getDefaultSize()}),!1),e.isVue2?e.$listeners:{}),[e.$slots.default?[e._t("default")]:e._l(e.optionsList,function(i){return s("el-checkbox-button",e._b({key:i[e.propMap.value]},"el-checkbox-button",{[e.isVue3?"value":"label"]:i[e.propMap.value],disabled:i.disabled,style:e.calculateItemWidth},!1),[e._t("option",function(){return[e._v(e._s(i[e.propMap.label]))]},{item:i})],2)})],2)],1)},st=[],it=p(et,tt,st,!1,null,"b44866b1");const R=it.exports,at=!0,lt={name:"TmSwitchFilter",props:{value:{type:Boolean,default:!1},label:{type:String,default:""}},data(){return{isVue2:at,getDefaultSize:y,switchValue:this.value}},computed:{containerWidthClass(){const t=l=>{if(!l)return 0;let n=0;for(let c=0;c<l.length;c++){const o=l.charAt(c);n+=/[\u4e00-\u9fa5]/.test(o)?2:1}return n},e=t(this.$attrs["active-text"]),s=t(this.$attrs["inactive-text"]),i=t(this.$attrs.label),a=e+s+i;return a>20?"wide-container":a>6?"medium-container":"narrow-container"}},watch:{value:{immediate:!0,handler(t){this.switchValue=t}},switchValue(t){this.$emit("input",t),this.$emit("change",t)}}};var nt=function(){var e=this,s=e._self._c;return s("div",{staticClass:"tm-switch",class:e.containerWidthClass},[e.label?s("span",{staticClass:"switch-label"},[e._v(e._s(e.label))]):e._e(),s("el-switch",e._g(e._b({ref:"switch",attrs:{size:e.getDefaultSize()},model:{value:e.switchValue,callback:function(i){e.switchValue=i},expression:"switchValue"}},"el-switch",e.$attrs,!1),e.isVue2?e.$listeners:{}))],1)},rt=[],ot=p(lt,nt,rt,!1,null,"9e7a342f");const H=ot.exports;var ut=p({name:"DynamicSlot",props:{name:{type:String,required:!0},slotProps:{type:Object,default:()=>({})}},render(t){var a;const e=l=>{var n,c;if(!l)return null;{const o=(n=l.$scopedSlots)==null?void 0:n[this.name];if(o)return o(this.slotProps);const f=(c=l.$slots)==null?void 0:c[this.name];return f||null}},s=l=>{var n;return l?((n=l.$options)==null?void 0:n.name)==="TmTable":!1};let i=e(this.$parent);if(!i){let l=(a=this.$parent)==null?void 0:a.$parent;for(;l&&!i;){if(s(l)){i=e(l);break}l=l.$parent}}return i?Array.isArray(i)?i.length===1?i[0]:t("div",{style:{display:"contents"}},i):i:null}},null,null,!1,null,null);const ct=ut.exports,{t:dt}=v(),ht=!0,pt=!1,ft=["date","daterange","datetime","datetimerange","year","month","dates","months","years","week","monthrange"],mt={name:"TmTableSearch",components:{TmSelect:z,TmAdvancedInput:O,TmAdvancedDate:D,TmCascader:M,TmRadio:A,TmCheckbox:R,TmSwitch:H,DynamicSlot:ct},props:{disabled:{type:Boolean,default:!1},searchColumns:{type:Array,default:null},searchForm:{type:Object,default:()=>({})}},data(){return{t:dt,isVue2:ht,isVue3:pt,getCompatSize:m,getDefaultSize:y,DATE_TYPES:ft,defaultValues:{}}},computed:{computedSearchForm:{get(){return this.searchForm},set(t){this.$emit("update:search-form",t)}}},mounted(){this.initDefaultValues()},methods:{isDateType(t){return this.DATE_TYPES.includes(t)},hasDefaultSlot(){const t=this.$slots.default;return t?this.isVue2?Array.isArray(t)?t.some(e=>!e.data||!e.data.slot):!!t:t()[0].children.length>0:!1},handleUpdate(t,e,s){const i=this.getFieldValue(t,s);i&&this.$emit("update:search-form",_(h({},this.computedSearchForm),{[i]:e}))},handleUpdateDate(t,e){const s=e||[],i=this.getFieldValue(t,"start"),a=this.getFieldValue(t,"end"),l=this.getFieldValue(t,"value"),n={};i&&(n[i]=s[0]),a&&(n[a]=s[1]),l&&(n[l]=s),this.$emit("update:search-form",h(h({},this.computedSearchForm),n))},getFieldValue(t,e){if(typeof t=="string")return t;if(t.fields&&e in t.fields){const s=t.fields[e];if(typeof s=="string")return s;if(Array.isArray(s))return s[0];if(s&&typeof s=="object")return s.name}},getFieldDefault(t,e){if(t.fields&&e in t.fields){const s=t.fields[e];if(Array.isArray(s)&&s.length>1)return s[1];if(s&&typeof s=="object"&&"default"in s)return s.default}},hasSearchSlot(t){var i;const e=a=>{var l,n;return a?!!((l=a.$scopedSlots)!=null&&l[t]||(n=a.$slots)!=null&&n[t]):!1};if(e(this))return!0;let s=this.$parent;for(;s;){if(((i=s.$options)==null?void 0:i.name)==="TmTable"&&e(s))return!0;s=s.$parent}return!1},initDefaultValues(){if(!this.searchColumns||!this.searchColumns.length)return;const t={};this.searchColumns.forEach(e=>{if(typeof e=="string"||!e.fields)return;const s=this.getFieldValue(e,"value"),i=this.getFieldValue(e,"label");if(e.type==="input"&&e.labelOptions&&e.labelOptions.length>0){const l=e.labelOptions[0];if(i)if(i in this.computedSearchForm)t[i]=this.computedSearchForm[i];else{const n=this.getFieldDefault(e,"label");n!==void 0?t[i]=n:l&&l.value!==void 0&&(t[i]=l.value)}s&&!(s in this.computedSearchForm)&&(t[s]="")}else if(this.isDateType(e.type)&&e.labelOptions&&e.labelOptions.length>0){const l=e.labelOptions[0];if(s&&!(s in this.computedSearchForm)&&(t[s]=[]),i)if(i in this.computedSearchForm)t[i]=this.computedSearchForm[i];else{const n=this.getFieldDefault(e,"label");n!==void 0?t[i]=n:l&&l.value!==void 0&&(t[i]=l.value)}}else if(e.type==="select"&&e.labelOptions&&e.labelOptions.length>0){const l=e.labelOptions[0];if(s&&!(s in this.computedSearchForm)&&(t[s]=e.multiple?[]:""),i)if(i in this.computedSearchForm)t[i]=this.computedSearchForm[i];else{const n=this.getFieldDefault(e,"label");n!==void 0?t[i]=n:l&&l.value!==void 0&&(t[i]=l.value)}}const a=this.getFieldDefault(e,"value");if(s&&a!==void 0&&!(s in this.computedSearchForm)?this.isDateType(e.type)&&!Array.isArray(a)?t[s]=[]:e.type==="checkbox"&&!Array.isArray(a)?t[s]=a?[a]:[]:e.type==="switch"&&typeof a!="boolean"?t[s]=!!a:t[s]=a:s&&!(s in this.computedSearchForm)&&(e.type==="checkbox"?t[s]=[]:e.type==="switch"&&(t[s]=!1)),this.isDateType(e.type)){const l=this.getFieldValue(e,"start"),n=this.getFieldValue(e,"end"),c=this.getFieldDefault(e,"start"),o=this.getFieldDefault(e,"end");l&&c!==void 0&&!(l in this.computedSearchForm)&&(t[l]=c),n&&o!==void 0&&!(n in this.computedSearchForm)&&(t[n]=o)}}),this.defaultValues=t,this.$emit("update:search-form",h(h({},t),this.computedSearchForm))},getSearchForm(){return this.computedSearchForm},handleSearch(){setTimeout(()=>{this.$emit("search",this.computedSearchForm)})},handleReset(){this.$emit("update:search-form",h({},this.defaultValues)),this.$emit("reset")}}};var gt=function(){var e=this,s=e._self._c;return s("div",{staticClass:"table-search",class:`table-search--${e.isVue2?"v2":"v3"}`},[s("div",{staticClass:"search-content"},[e.hasDefaultSlot()?e._t("default"):e.searchColumns&&e.searchColumns.length?[e._l(e.searchColumns,function(i,a){return[typeof i=="string"?s("div",{key:`str-${i}-${a}`,staticClass:"search-item"},[s("dynamic-slot",{key:i,attrs:{name:`search-${i}`,"slot-props":{searchForm:e.searchForm}}})],1):s("div",{key:`obj-${a}`,staticClass:"search-item"},[i.fields?[e.hasSearchSlot(`search-${e.getFieldValue(i,"value")}`)?[s("dynamic-slot",{key:e.getFieldValue(i,"value"),attrs:{name:`search-${e.getFieldValue(i,"value")}`,"slot-props":{searchForm:e.searchForm,col:i}}})]:[s("div",{key:e.getFieldValue(i,"value")||`col-${a}`,staticStyle:{display:"flex"}},[i.type==="input"?s("tm-advanced-input",{attrs:{label:i.label,value:e.computedSearchForm[e.getFieldValue(i,"value")],field:e.computedSearchForm[e.getFieldValue(i,"label")],multiple:i.multiple,labelOptions:i.labelOptions,placeholder:i.placeholder},on:{"value-change":l=>e.handleUpdate(i,l,"value"),"field-change":l=>e.handleUpdate(i,l,"label"),search:e.handleSearch}}):e._e(),e.isDateType(i.type)?s("tm-advanced-date",{attrs:{type:i.type,label:i.label,value:e.computedSearchForm[e.getFieldValue(i,"value")],field:e.computedSearchForm[e.getFieldValue(i,"label")],start:e.computedSearchForm[e.getFieldValue(i,"start")],end:e.computedSearchForm[e.getFieldValue(i,"end")],labelOptions:i.labelOptions,"start-placeholder":i.startPlaceholder,"end-placeholder":i.endPlaceholder,placeholder:i.placeholder,"range-separator":i.rangeSeparator,disabled:i.disabled,clearable:i.clearable,readonly:i.readonly,editable:i.editable,align:i.align,"popper-class":i.popperClass,"default-value":i.defaultValue,"default-time":i.defaultTime,shortcuts:i.shortcuts,"past-only":i.pastOnly,format:i.format},on:{"field-change":l=>e.handleUpdate(i,l,"label"),"value-change":l=>e.handleUpdateDate(i,l),"start-change":l=>e.handleUpdateDate(i,l),"end-change":l=>e.handleUpdateDate(i,l)}}):e._e(),i.type==="select"?s("tm-select",{attrs:{label:i.label,field:e.computedSearchForm[e.getFieldValue(i,"label")],options:i.options,labelOptions:i.labelOptions,placeholder:i.placeholder,multiple:i.multiple,"show-check-all":i.checkAll},on:{"field-change":l=>e.handleUpdate(i,l,"label")},model:{value:e.computedSearchForm[e.getFieldValue(i,"value")],callback:function(l){e.$set(e.computedSearchForm,e.getFieldValue(i,"value"),l)},expression:"computedSearchForm[getFieldValue(col, 'value')]"}}):e._e(),i.type==="cascader"?s("tm-cascader",{attrs:{label:i.label,options:i.options,labelOptions:i.labelOptions,props:i.props,placeholder:i.placeholder,"show-check-all":i.checkAll},model:{value:e.computedSearchForm[e.getFieldValue(i,"value")],callback:function(l){e.$set(e.computedSearchForm,e.getFieldValue(i,"value"),l)},expression:"computedSearchForm[getFieldValue(col, 'value')]"}}):e._e(),i.type==="radio"?s("tm-radio",{attrs:{label:i.label,options:i.options,props:i.props},model:{value:e.computedSearchForm[e.getFieldValue(i,"value")],callback:function(l){e.$set(e.computedSearchForm,e.getFieldValue(i,"value"),l)},expression:"computedSearchForm[getFieldValue(col, 'value')]"}}):e._e(),i.type==="checkbox"?s("tm-checkbox",{attrs:{label:i.label,options:i.options,props:i.props},model:{value:e.computedSearchForm[e.getFieldValue(i,"value")],callback:function(l){e.$set(e.computedSearchForm,e.getFieldValue(i,"value"),l)},expression:"computedSearchForm[getFieldValue(col, 'value')]"}}):e._e(),i.type==="switch"?s("tm-switch",{attrs:{"active-text":i.activeText,"inactive-text":i.inactiveText,label:i.label,"active-color":i.activeColor,"inactive-color":i.inactiveColor},model:{value:e.computedSearchForm[e.getFieldValue(i,"value")],callback:function(l){e.$set(e.computedSearchForm,e.getFieldValue(i,"value"),l)},expression:"computedSearchForm[getFieldValue(col, 'value')]"}}):e._e()],1)]]:[s("div",{key:`error-${a}`,staticClass:"search-error-message"},[e._v(" 缺少 fields 配置,无法渲染此组件 ")])]],2)]})]:e._e(),s("div",{staticClass:"search-actions"},[s("el-button",{attrs:{type:"primary",size:e.getDefaultSize()},on:{click:e.handleSearch}},[e._v(e._s(e.t("query")))]),s("el-button",{attrs:{size:e.getDefaultSize()},on:{click:e.handleReset}},[e._v(e._s(e.t("reset")))])],1)],2)])},bt=[],yt=p(mt,gt,bt,!1,null,"54d5e2a2");const E=yt.exports,vt=!0,Ct={name:"TablePagination",props:{current:{type:Number,default:1},small:{type:Boolean,default:!0},pageSize:{type:Number,default:20},total:{type:Number,default:0}},data(){return{isVue2:vt,getCompatSize:m}},methods:{handleSizeChange(t){this.$emit("size-change",t)},handleCurrentChange(t){this.$emit("current-change",t)}}};var _t=function(){var e=this,s=e._self._c;return s("div",{staticClass:"tm-pagination"},[s("el-pagination",e._g(e._b({staticStyle:{"text-align":"right"},attrs:{"current-page":e.current,"page-size":e.pageSize,total:e.total,"page-sizes":[10,20,50,100,300,500,1e3,2e3],size:e.getCompatSize("mini"),layout:"total, sizes, prev, pager, next, jumper"},on:{"size-change":e.handleSizeChange,"update:current-page":function(i){return e.$emit("update:current",i)},"update:page-size":function(i){return e.$emit("update:pageSize",i)},"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1),e.isVue2?e.$listeners:{}))],1)},xt=[],St=p(Ct,_t,xt,!1,null,"4dbdf6e7");const Tt=St.exports,$t={name:"TmTableMenu",props:{size:{type:String,default:"mini"}}};var wt=function(){var e=this,s=e._self._c;return s("div",{staticClass:"tm-table-menu",attrs:{size:"small",inline:""}},[s("div",{staticClass:"left"},[e._t("left")],2),s("div",{staticClass:"right"},[e._t("right")],2)])},Vt=[],Ft=p($t,wt,Vt,!1,null,"579dd2c3");const kt=Ft.exports,w=t=>t?t.data&&t.data.attrs||{}:{},P=(t,e)=>{t&&(t.data||(t.data={}),t.data.attrs||(t.data.attrs={}),typeof e=="object"&&Object.assign(t.data.attrs,e))},V={getTableConfig(t){try{const e=localStorage.getItem(`tm-table-config-${t}`);return Promise.resolve({data:{code:200,data:e}})}catch(e){return Promise.reject(e)}},setTableConfig(t){try{return localStorage.setItem(`tm-table-config-${t.key}`,t.info),Promise.resolve({data:{code:200,message:"success"}})}catch(e){return Promise.reject(e)}}},zt=t=>V.getTableConfig(t.key),Lt=t=>V.setTableConfig(t),Ot=t=>{t&&(typeof t.getTableConfig=="function"&&(V.getTableConfig=t.getTableConfig),typeof t.setTableConfig=="function"&&(V.setTableConfig=t.setTableConfig))},{t:Dt}=v(),Mt=!0,At=!1,Rt={formatter:(t,e,s,i)=>[void 0,null,""].includes(s)?"-":s},Ht={name:"TmColumnConfig",components:{MoveIcon:me,FixedLeftIcon:be,FixedRightIcon:ye,UploadIcon:ve,DownloadIcon:Ce,DeleteIcon:_e,MenuIcon:pe,tmEllipsisText:S},props:{columns:{type:Array,default:()=>[]},tableKey:{type:String,default:"",required:!0},defaultColumns:{type:Array,default:()=>[]},maxFixedLeftQuantity:{type:[Number,String],default:void 0},maxFixedRightQuantity:{type:[Number,String],default:void 0},ignoredColumnConfigTypes:{type:Array,default:()=>["selection"]}},data(){return{t:Dt,isVue2:Mt,isVue3:At,getDefaultSize:y,getCompatSize:m,buttonType:{type:"text"},afterOpenDelay:{"open-delay":300},popoverVisible:!1,keyWord:"",sortedTableColumns:[],tableColumns:[],defaultColumnsConfig:[],columnMap:{},processedColumns:[],placement:"bottom",isDraggingFrozen:!1,isDraggingFrozenRight:!1,sortable:null,isConfigLoaded:!1,columnsCopy:[]}},computed:{filteredSortedTableColumns(){return this.keyWord?this.sortedTableColumns.filter(t=>this.getColumnLabel(t.prop).includes(this.keyWord)):this.sortedTableColumns},showFixedLimitTips(){return this.maxFixedLeftQuantity!==void 0||this.maxFixedRightQuantity!==void 0},isThanMaxFrozen(){return this.maxFixedLeftQuantity===void 0?!1:this.sortedTableColumns.filter(t=>t.fixed==="left").length>=this.maxFixedLeftQuantity},isThanMaxRightFrozen(){return this.maxFixedRightQuantity===void 0?!1:this.sortedTableColumns.filter(t=>t.fixed==="right").length>=this.maxFixedRightQuantity},computedTableKey(){if(this.tableKey)return this.tableKey;if(this.$route&&this.$route.path)return this.$route.path.slice(1).replace(/\//g,"-");throw new Error("tableKey is required")}},watch:{popoverVisible(t){t||this.handlePopoverHide()},columns:{handler(t){t&&t.length>0&&!this.isConfigLoaded&&this.initializeColumnConfig()},immediate:!0},tableColumns:{handler(t){t!=null&&t.length&&(this.initSortedTableColumns(),this.crateSortable(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)))},deep:!0}},methods:{findLastIndex(t,e){for(let s=t.length-1;s>=0;s--)if(e(t[s],s,t))return s;return-1},getColumnLabel(t){return!t||!this.columnMap[t]?t||"":w(this.columnMap[t]).label||t},initializeColumnConfig(){this.defaultColumns&&this.defaultColumns.length>0?this.defaultColumnsConfig=this.defaultColumns:this.processOriginalColumns(),this.loadColumnConfig()},processOriginalColumns(){const t=this.columns||[];let e={};this.defaultColumnsConfig=t.filter(s=>{const i=w(s);return!(!i.prop||this.ignoredColumnConfigTypes.includes(i.type))}).map((s,i)=>{const a=w(s),l=h(h({},Rt),a);P(s,l),a.prop&&(e[a.prop]=s);const n=a.hasOwnProperty("visible")?a.visible!==!1:!0;return{prop:a.prop,fixed:a.fixed||"",sort:i,cancellable:a.hasOwnProperty("cancellable")?a.cancellable:!0,visible:n}}),this.columnMap=e},loadColumnConfig(){zt({key:this.computedTableKey}).then(t=>{var s;if(t.data.code!==200)return;let e=JSON.parse(((s=t.data)==null?void 0:s.data)||null)||{};e.columnsConfig&&JSON.stringify(this.defaultColumnsConfig)===JSON.stringify(e.defaultColumnsConfig)?this.tableColumns=e.columnsConfig.map(i=>h({},i)):this.tableColumns=this.defaultColumnsConfig.map(i=>h({},i)),this.processedColumns=this.applyColumnConfig(this.tableColumns),this.isConfigLoaded=!0,this.$emit("complete",{columns:this.processedColumns,isInitialLoad:!0})}).catch(()=>{this.tableColumns=this.defaultColumnsConfig.map(t=>h({},t)),this.processedColumns=this.applyColumnConfig(this.tableColumns),this.isConfigLoaded=!0,this.$emit("complete",{columns:this.processedColumns,isInitialLoad:!0})})},applyColumnConfig(t,e=!1){let s=this.columns.filter(a=>{const l=w(a);return this.ignoredColumnConfigTypes.includes(l.type)}),i=[];return[...t].sort((a,l)=>{const n=a.sort!==void 0?a.sort:1/0,c=l.sort!==void 0?l.sort:1/0;return n-c}).forEach(a=>{if(a.prop){let l=this.columnMap[a.prop];l&&(P(l,{fixed:a.fixed||void 0,visible:a.visible}),(!e&&a.visible||e)&&i.push(l))}}),s.forEach(a=>{P(a,{visible:!0})}),[...s,...i]},crateSortable(){const t=this.$refs.sortListRef;if(!t)return;this.sortable&&(this.sortable.destroy(),this.sortable=null);const e=new u(t,{ghostClass:"blue-background-class",animation:150,easing:"cubic-bezier(1, 0, 0, 1)",handle:".row-title",draggable:".sort-item-wrapper",fallbackOnBody:!1,preventOnFilter:!0,removeCloneOnHide:!0,group:"columns",dragClass:"sortable-drag",onStart:({item:s})=>{const i=s.getAttribute("data-prop"),a=this.sortedTableColumns.find(l=>l.prop===i);this.isDraggingFrozen=a&&a.fixed==="left",this.isDraggingFrozenRight=a&&a.fixed==="right",this.draggedItemIndex=Array.from(t.children).indexOf(s),s.classList.add("sortable-drag")},onMove:s=>{const{target:i,related:a}=s;if(!i||!a)return!1;const l=a?a.getAttribute("data-prop"):null,n=l?this.sortedTableColumns.find(f=>f.prop===l):null,c=n&&n.fixed==="left",o=n&&n.fixed==="right";return this.isDraggingFrozen&&!c||this.isDraggingFrozenRight&&!o||!this.isDraggingFrozen&&!this.isDraggingFrozenRight&&(c||o)?(i.classList.add("no-drop-zone"),!1):(document.querySelectorAll(".no-drop-zone").forEach(f=>{f.classList.remove("no-drop-zone")}),!0)},onEnd:({item:s,newIndex:i,oldIndex:a})=>{if(i===void 0||a===void 0||i<0||a<0||i>=this.sortedTableColumns.length||a>=this.sortedTableColumns.length)return;document.querySelectorAll(".no-drop-zone").forEach(T=>{T.classList.remove("no-drop-zone")}),s.classList.remove("sortable-drag");const l=this.sortedTableColumns[a],n=l.fixed==="left",c=l.fixed==="right",o=i>0?this.sortedTableColumns[i-1]:null,f=i<this.sortedTableColumns.length-1?this.sortedTableColumns[i+1]:null;let C=!1;if(n?(o&&o.fixed!=="left"||f&&f.fixed==="right")&&(C=!0):c?(o&&o.fixed!=="right"||f&&f.fixed!=="right")&&(C=!0):(o&&o.fixed==="right"||f&&f.fixed==="left")&&(C=!0),C){this.rollbackSort();return}this.updateSortAfterDrag()}});this.sortable=e},rollbackSort(){this.sortedTableColumns=JSON.parse(JSON.stringify(this.columnsCopy))},updateSortAfterDrag(){const t=this.$refs.sortListRef;if(!t)return;Array.from(t.children||[]).filter(s=>s&&s.dataset&&s.dataset.prop).map(s=>s.dataset.prop).forEach((s,i)=>{this.sortedTableColumns.some(a=>a.prop===s?(a.sort=i,!0):!1)}),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},init(){this.tableColumns=Array.isArray(this.tableColumns)?[...this.tableColumns]:Array.isArray(this.defaultColumnsConfig)?[...this.defaultColumnsConfig]:[],this.initSortedTableColumns()},initSortedTableColumns(){this.tableColumns.forEach((t,e)=>{t.sort===void 0&&(t.sort=e)}),this.sortedTableColumns=[...this.tableColumns].sort((t,e)=>t.fixed==="left"&&e.fixed!=="left"?-1:t.fixed!=="left"&&e.fixed==="left"||t.fixed==="right"&&e.fixed!=="right"?1:t.fixed!=="right"&&e.fixed==="right"?-1:t.sort-e.sort)},setPlacement(){const e=this.$refs.operationRef.$el.getBoundingClientRect();(window.innerHeight||document.documentElement.clientHeight)-(e.bottom-window.scrollY)>512?this.placement="bottom":this.placement="left"},handleVisibleChange(t){this.popoverVisible=t},handlePopoverShow(){this.setPlacement(),this.init(),(()=>{try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove)}catch(e){}})(),this.$nextTick(()=>{this.crateSortable()})},handlePopoverHide(){this.sortable&&(this.sortable.destroy(),this.sortable=null);try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove),typeof u!="undefined"&&u.utils&&(document.removeEventListener("mousemove",u.utils.throttleCall),document.removeEventListener("mouseup",u.utils.throttleCall))}catch(t){}},handleSelectAll(){const t=this.tableColumns.some(e=>!e.visible);this.tableColumns.forEach(e=>{e.cancellable&&(e.visible=t)})},handleRestoreDefault(){this.tableColumns=JSON.parse(JSON.stringify(this.defaultColumnsConfig)),this.sortedTableColumns=[...this.tableColumns].sort((t,e)=>t.sort-e.sort)},canMoveTop(t,e){if(e===0)return!1;if(t.fixed==="left"){const s=this.sortedTableColumns[e-1];return s&&s.fixed==="left"}if(!t.fixed){const s=this.sortedTableColumns[e-1];return s&&s.fixed==="left"?!1:s&&!s.fixed}return t.fixed==="right"},moveTop(t,e){const s=this.sortedTableColumns,i=t.prop;if(t.fixed==="right"&&(t.fixed=""),t.fixed==="left")s.unshift(s.splice(e,1)[0]);else{const a=this.findLastIndex(this.sortedTableColumns,l=>l.fixed==="left");s.splice(a+1,0,s.splice(e,1)[0])}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns),this.$nextTick(()=>{const a=this.$refs.sortListRef;if(a){const l=Array.from(a.children).find(n=>n.dataset&&n.dataset.prop===i);l&&l.scrollIntoView({behavior:"smooth",block:"nearest"})}})},frozenLeftHandle(t){const e=this.sortedTableColumns,s=e.splice(t,1)[0];if(s.fixed=s.fixed==="left"?"":"left",s.fixed==="left"){const i=this.findLastIndex(this.sortedTableColumns,a=>a.fixed==="left");e.splice(i+1,0,s)}else{const i=this.findLastIndex(this.sortedTableColumns,a=>a.fixed==="left");e.splice(i+1,0,s)}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},frozenRightHandle(t){const e=this.sortedTableColumns,s=e.splice(t,1)[0];if(s.fixed=s.fixed==="right"?"":"right",s.fixed==="right"){const i=e.findIndex(a=>a.fixed==="right");i===-1?e.push(s):e.splice(i,0,s)}else{const i=e.findIndex(a=>a.fixed==="right");i===-1?e.push(s):e.splice(i,0,s)}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},onSave(){var e;this.updateSortValues();const t=(e=this.tableColumns)==null?void 0:e.map(s=>{const i=this.sortedTableColumns.find(c=>c.prop===s.prop);i&&(s.sort=i.sort,s.fixed=i.fixed,s.visible=i.visible);const n=s,{label:a}=n;return G(n,["label"])});Lt({key:this.computedTableKey,info:JSON.stringify({columnsConfig:t,defaultColumnsConfig:this.defaultColumnsConfig})}).then(s=>{s.data.code===200&&(this.processedColumns=this.applyColumnConfig(t,!0),this.$emit("complete",{columns:this.processedColumns,isInitialLoad:!1}),this.$message.success(this.t("saveSuccess")),this.popoverVisible=!1)})},updateSortValues(){this.sortedTableColumns.forEach((t,e)=>{t.sort=e})}},mounted(){var t;(t=this.tableColumns)!=null&&t.length&&(this.initSortedTableColumns(),this.crateSortable(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)))},beforeDestroy(){this.sortable&&(this.sortable.destroy(),this.sortable=null);try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove),typeof u!="undefined"&&u.utils&&(document.removeEventListener("mousemove",u.utils.throttleCall),document.removeEventListener("mouseup",u.utils.throttleCall))}catch(t){}}};var Et=function(){var e=this,s=e._self._c;return s("el-popover",e._g(e._b({attrs:{"popper-class":"column-config-popover",width:680,"show-arrow":!1,placement:e.placement,trigger:"click"},on:{show:e.handlePopoverShow,hide:e.handlePopoverHide},scopedSlots:e._u([{key:"reference",fn:function(){return[s("div",{staticStyle:{display:"inline-block","margin-left":"10px"}},[s("el-tooltip",e._b({attrs:{content:e.t("columnSetting"),placement:"top"}},"el-tooltip",e.afterOpenDelay,!1),[s("el-button",{ref:"operationRef",attrs:{size:e.getDefaultSize(),circle:""}},[s("MenuIcon")],1)],1)],1)]},proxy:!0}])},"el-popover",{[e.isVue3?"visible":"value"]:e.popoverVisible},!1),{[e.isVue3?"update:visible":"input"]:e.handleVisibleChange}),[e.popoverVisible?s("div",{staticClass:"container"},[s("div",{staticClass:"main-container"},[s("div",{staticClass:"left-content"},[s("div",{staticClass:"title"},[s("span",[e._v(e._s(e.t("SelectableFields"))+"("+e._s(e.tableColumns.length)+")")]),s("el-button",e._b({staticStyle:{"margin-left":"10px"},on:{click:e.handleSelectAll}},"el-button",e.buttonType,!1),[e._v(e._s(e.t("all")))])],1),s("div",{staticClass:"option-list"},[s("div",{staticStyle:{height:"100%","overflow-y":"auto"}},[e._l(e.tableColumns,function(i,a){return[i.prop?s("div",{key:a+i.prop,staticStyle:{width:"110px",display:"inline-block"}},[s("el-checkbox",{staticClass:"el-checkbox",attrs:{disabled:!i.cancellable,label:i.prop,value:i.prop},model:{value:i.visible,callback:function(l){e.$set(i,"visible",l)},expression:"col.visible"}},[s("TmEllipsisText",{attrs:{width:"80px",text:e.getColumnLabel(i.prop)}})],1)],1):e._e()]})],2)])]),s("div",{staticClass:"right-content"},[s("div",{staticClass:"search-box"},[s("el-input",{staticClass:"search-input",attrs:{size:e.getCompatSize("small"),clearable:"",placeholder:e.t("search")},model:{value:e.keyWord,callback:function(i){e.keyWord=i},expression:"keyWord"}})],1),e.showFixedLimitTips?s("div",{staticClass:"tips"}):e._e(),s("div",{ref:"sortListRef",staticClass:"sort-list"},e._l(e.filteredSortedTableColumns,function(i,a){return s("div",{key:i.prop,staticClass:"sort-item-wrapper",class:[i.fixed==="left"?"frozen":"",i.fixed==="right"?"frozenRight":"",i.fixed?"":"noFrozen"],attrs:{"data-prop":i.prop}},[i.visible?s("div",{staticClass:"sort-item"},[s("div",{staticClass:"row-title"},[s("MoveIcon",{staticStyle:{"flex-shrink":"0"}}),s("TmEllipsisText",{attrs:{text:e.getColumnLabel(i.prop)}})],1),s("div",{staticClass:"operation-btns"},[i.cancellable?s("el-tooltip",e._b({attrs:{content:e.t("cancel"),placement:"top"}},"el-tooltip",e.afterOpenDelay,!1),[s("el-button",e._b({staticClass:"iconfont-button delete-button",attrs:{size:e.getCompatSize("mini")},on:{click:function(l){i.visible=!1}}},"el-button",e.buttonType,!1),[s("DeleteIcon")],1)],1):e._e(),e.canMoveTop(i,a)?s("el-tooltip",e._b({attrs:{content:e.t("top"),placement:"top"}},"el-tooltip",e.afterOpenDelay,!1),[s("el-button",e._b({staticClass:"iconfont-button top-button",attrs:{size:e.getCompatSize("mini")},on:{click:function(l){return e.moveTop(i,a)}}},"el-button",e.buttonType,!1),[s("UploadIcon")],1)],1):e._e(),i.fixed!=="right"?s("el-tooltip",e._b({attrs:{content:i.fixed==="left"?e.t("cancelLeftFixed"):e.t("leftFixed"),placement:"top"}},"el-tooltip",e.afterOpenDelay,!1),[s("el-button",e._b({staticClass:"iconfont-button left-fixed-btn",class:{"active-fixed":i.fixed==="left"},attrs:{size:e.getCompatSize("mini"),disabled:i.fixed!=="left"&&e.isThanMaxFrozen},on:{click:function(l){return e.frozenLeftHandle(a)}}},"el-button",e.buttonType,!1),[s("FixedLeftIcon")],1)],1):e._e(),i.fixed!=="left"?s("el-tooltip",e._b({attrs:{content:i.fixed==="right"?e.t("cancelRightFixed"):e.t("rightFixed"),placement:"top"}},"el-tooltip",e.afterOpenDelay,!1),[s("el-button",e._b({staticClass:"iconfont-button right-fixed-btn",class:{"active-fixed":i.fixed==="right"},attrs:{size:e.getCompatSize("mini"),disabled:i.fixed!=="right"&&e.isThanMaxRightFrozen},on:{click:function(l){return e.frozenRightHandle(a)}}},"el-button",e.buttonType,!1),[s("FixedRightIcon")],1)],1):e._e()],1)]):e._e()])}),0)])]),s("div",{staticClass:"footer"},[s("div",{staticClass:"footer-left"},[s("el-button",{attrs:{size:e.getCompatSize("mini")},on:{click:e.handleRestoreDefault}},[e._v(e._s(e.t("restoreDefault")))])],1),s("div",{staticClass:"footer-right"},[s("el-button",{attrs:{size:e.getCompatSize("mini")},on:{click:function(i){e.popoverVisible=!1}}},[e._v(e._s(e.t("cancel")))]),s("el-button",{attrs:{size:e.getCompatSize("mini"),type:"primary"},on:{click:e.onSave}},[e._v(e._s(e.t("saveAndApply")))])],1)])]):e._e()])},Pt=[],It=p(Ht,Et,Pt,!1,null,"127cbd33");const Wt=It.exports,Bt=!0,Nt=!1,jt={name:"TmTable",components:{TableSearch:E,TablePagination:Tt,TableMenu:kt,ColumnConfig:Wt,RefreshIcon:fe,ColumnRenderer:{props:["vnode"],render(){return this.$createElement(this.vnode.componentOptions.tag,this.vnode.data,this.vnode.children)}}},inheritAttrs:!1,props:{data:{type:[Array,Function],default:()=>[]},showSearch:{type:Boolean,default:!0},showMenu:{type:Boolean,default:!0},showPagination:{type:Boolean,default:!0},pagination:{type:Object,default:()=>({})},height:{type:[String,Number]},calcHeight:{type:Number,default:0},dataAdapter:{type:Function,default:null},columnSettingButton:{type:Boolean,default:!0},refreshButton:{type:Boolean,default:!0},tableKey:{type:String,default:""},firstLoad:{type:Boolean,default:!0},maxFixedLeftQuantity:{type:Number},maxFixedRightQuantity:{type:Number},border:{type:Boolean,default:!0},searchColumns:{type:Array,default:null},searchForm:{type:Object,default:()=>({})}},data(){return{getDefaultSize:y,getCompatSize:m,isVue3:Nt,isVue2:Bt,t:v().t,tableData:[],tableLoading:!1,columnsLoading:!1,tableReload:1,tableHeight:null,selectedRows:[],paginationInfo:{current:1,pageSize:20,total:void 0},originalColumns:[],displayColumns:[],isColumnConfigLoaded:!1,afterOpenDelay:{"open-delay":300}}},computed:{pageLoading(){return this.tableLoading||this.columnsLoading},computedTableKey(){if(this.tableKey)return this.tableKey;if(this.$route&&this.$route.path)return this.$route.path.slice(1).replace(/\//g,"-");throw new Error("tableKey is required")},computedShowPagination(){return this.showPagination&&typeof this.data=="function"}},watch:{data:{immediate:!0,handler(t){typeof t=="function"?!this.columnSettingButton||this.isColumnConfigLoaded&&!this.firstLoad?this.loadData():Array.isArray(t)&&(this.tableData=t):this.tableData=t}},height:{immediate:!0,handler(){this.getTableHeight()}}},created(){this.originalColumns=this.$slots.default||[],this.columnSettingButton?this.columnsLoading=!0:(this.displayColumns=this.originalColumns,this.isColumnConfigLoaded=!0)},mounted(){this.getTableHeight(),window.addEventListener("resize",this.getTableHeight)},beforeDestroy(){window.removeEventListener("resize",this.getTableHeight)},methods:{handleUpdateSearchForm(t){this.$emit("update:search-form",t)},handleColumnConfigComplete(t){Array.isArray(t.columns)?this.displayColumns=[...t.columns]:this.displayColumns=[...this.originalColumns],t.isInitialLoad?(this.isColumnConfigLoaded=!0,this.columnsLoading=!1,this.firstLoad&&typeof this.data=="function"&&this.loadData()):this.reloadTable()},isAutoHeight(){return this.height==="auto"},handleRefresh(){this.loadData()},async loadData(){if(Array.isArray(this.data))this.tableData=this.data;else if(typeof this.data=="function"){if(this.tableLoading)return;this.tableLoading=!0;try{const t=await this.data({paginationInfo:{pageSize:this.paginationInfo.pageSize,current:this.paginationInfo.current},params:this.searchForm}),{list:e,total:s,pageSize:i,current:a}=t;this.tableData=e;let l=h({},this.paginationInfo);s!==void 0&&(l.total=s),a!==void 0&&(l.current=a),i!==void 0&&(l.pageSize=i),this.paginationInfo=l}catch(t){}finally{this.tableLoading=!1}}},getTableHeight(){this.isAutoHeight()?this.$nextTick(()=>{const t=this.$refs.table,e=this.$refs.tmPagination;if(!t)return;const s=t.$el,i=e&&e.$el&&e.$el.offsetHeight||0;this.tableHeight=document.documentElement.clientHeight-s.offsetTop-i-this.calcHeight}):this.tableHeight=this.height,this.refreshTable()},search(){this.paginationInfo.current=1,this.loadData()},reset(){this.paginationInfo.current=1,this.$nextTick(()=>{this.loadData()})},handleSelectionChange(t){this.selectedRows=t,this.$emit("selection-change",t)},handleSizeChange(t){this.paginationInfo.pageSize=t,this.loadData(),this.$emit("size-change",t)},handleCurrentChange(t){this.paginationInfo.current=t,this.loadData(),this.$emit("current-change",t)},refreshTable(){this.$refs.table&&this.$refs.table.doLayout()},reloadTable(){this.tableReload++}}};var Ut=function(){var e=this,s=e._self._c;return s("div",{ref:"tablePage",staticClass:"tm-table"},[e.searchColumns&&e.searchColumns.length>0?s("table-search",{ref:"search",attrs:{disabled:e.pageLoading,"search-columns":e.searchColumns,"search-form":e.searchForm},on:{search:e.search,reset:e.reset,"update:search-form":e.handleUpdateSearchForm}},[e._t("search")],2):e._e(),e.showMenu?s("table-menu",{scopedSlots:e._u([{key:"left",fn:function(){return[e._t("menu-left")]},proxy:!0},{key:"right",fn:function(){return[e._t("menu-right"),e.refreshButton&&typeof e.data=="function"?s("el-tooltip",e._b({attrs:{content:e.t("refresh"),placement:"top"}},"el-tooltip",e.afterOpenDelay,!1),[s("el-button",{attrs:{circle:"",size:e.getDefaultSize()},on:{click:e.handleRefresh}},[s("RefreshIcon")],1)],1):e._e(),e.columnSettingButton?s("ColumnConfig",{attrs:{maxFixedLeftQuantity:e.maxFixedLeftQuantity,maxFixedRightQuantity:e.maxFixedRightQuantity,tableKey:e.computedTableKey,columns:e.originalColumns},on:{complete:e.handleColumnConfigComplete}}):e._e()]},proxy:!0}],null,!0)}):e._e(),s("el-table",e._g(e._b({directives:[{name:"loading",rawName:"v-loading",value:e.pageLoading,expression:"pageLoading"}],key:e.tableReload,ref:"table",attrs:{data:e.tableData,height:e.tableHeight,size:e.getCompatSize("mini")},on:{"selection-change":e.handleSelectionChange}},"el-table",_(h({},e.$attrs),{border:e.border}),!1),e.isVue2?e.$listeners:{}),e._l(e.displayColumns,function(i){return s("columnRenderer",{key:e.isVue3?i.id:i.data.attrs.prop,attrs:{vnode:i}})}),1),e.computedShowPagination?s("table-pagination",{ref:"tmPagination",attrs:{"page-size":e.paginationInfo.pageSize,current:e.paginationInfo.current,total:e.paginationInfo.total,disabled:e.tableLoading},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}}):e._e()],1)},Jt=[],qt=p(jt,Ut,Jt,!1,null,"8db1f265");const I=qt.exports,Kt=!0,Qt=!1,Gt={name:"TmTableColumn",inheritAttrs:!1,computed:{isVisible(){return this.$attrs.visible!==!1},slots(){return this.$scopedSlots}},data(){return{isVue2:Kt,isVue3:Qt}},created(){this.$parent&&this.$parent.$emit&&this.$parent.$emit("column-initialized",{prop:this.$attrs.prop,visible:this.$attrs.visible!==!1})}};var Yt=function(){var e=this,s=e._self._c;return e.isVisible?s("el-table-column",e._g(e._b({scopedSlots:e._u([e._l(e.slots,function(i,a){return{key:a,fn:function(l){return[e._t(a,null,null,l)]}}})],null,!0)},"el-table-column",e.$attrs,!1),e.isVue2?e.$listeners:{})):e._e()},Xt=[],Zt=p(Gt,Yt,Xt,!1,null,null);const W=Zt.exports,{t:B}=v(),es={name:"TmAdvancedEllipsisText",components:{CopyIcon:U},props:{rows:{type:Number,default:1},width:{type:String,default:"100%"},maxWidth:{type:String,default:""},showToolbar:{type:Boolean,default:!1},text:{type:String,default:""},showTooltip:{type:Boolean,default:!0},copyable:{type:Boolean,default:!1}},data(){return{isVue2:!0,originalText:"",isHovered:!1,lineHeight:0,containerWidth:0,resizeObserver:null,isCalculating:!1,frontLines:[],lastLineText:"",isLastLineEllipsis:!1,tableRowElement:null}},computed:{containerStyle(){const t={};return this.maxWidth?(t.maxWidth=this.maxWidth,t.width=this.width):t.width=this.width,t},hasToolbarSlot(){return this.$slots.toolbar?this.$slots.toolbar&&this.$slots.toolbar.length>0:!1},hasToolbarContent(){return this.copyable||this.hasToolbarSlot},shouldShowToolbar(){return this.showToolbar||this.isHovered&&this.hasToolbarContent}},mounted(){this.initComponent(),this.setupResizeObserver(),this.setupTableRowHover()},updated(){const t=this.getTextContent();t!==this.originalText&&(this.originalText=t,this.$nextTick(()=>{this.calculateLayout()}))},beforeDestroy(){this.cleanupResizeObserver(),this.cleanupTableRowHover()},beforeUnmount(){this.cleanupResizeObserver(),this.cleanupTableRowHover()},watch:{text:{handler(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLayout()})},immediate:!0},rows(){this.$nextTick(()=>{this.calculateLayout()})},shouldShowToolbar(){this.$nextTick(()=>{this.calculateLayout()})},"$slots.default":{handler(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLayout()})},deep:!0}},methods:{initComponent(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLineHeight(),this.$nextTick(()=>{this.calculateLayout()})})},handleCopy(){navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(this.originalText).then(()=>{this.$message.success(B("copySuccess"))}).catch(()=>{this.fallbackCopy()}):this.fallbackCopy()},fallbackCopy(){const t=document.createElement("textarea");t.value=this.originalText,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),this.$message.success(B("copySuccess"))}catch(e){this.$message.error(B("copyFailed"))}document.body.removeChild(t)},getTextContent(){return this.$slots.default?this.$slots.default.map(e=>e.text?e.text:e.children&&typeof e.children=="string"?e.children:e.children&&Array.isArray(e.children)?e.children.map(s=>s.text||"").join(""):"").join(""):this.text||""},calculateLineHeight(){const t=this.$refs.containerRef;if(!t)return;const e=window.getComputedStyle(t);this.containerWidth=t.offsetWidth;const s=this.$refs.measureRef;if(s){this.setMeasureElementStyle(s,{width:this.containerWidth+"px",wordBreak:"break-all",whiteSpace:"normal"}),s.textContent="测",s.offsetHeight;const i=s.offsetHeight;s.innerHTML="",this.lineHeight=i}else{const i=e.lineHeight;if(i&&i!=="normal")this.lineHeight=parseInt(i);else{const a=parseInt(e.fontSize);this.lineHeight=a*1.2}}},calculateLayout(){if(!this.isCalculating){if(!this.originalText||this.rows<=0){this.frontLines=[],this.lastLineText=this.originalText||"",this.isLastLineEllipsis=!1;return}this.isCalculating=!0,this.$nextTick(()=>{requestAnimationFrame(()=>{this.performLayoutCalculation()})})}},performLayoutCalculation(){const t=this.originalText;if(this.rows===1)this.frontLines=[],this.lastLineText=t,this.isLastLineEllipsis=this.checkIfTextOverflows(t);else{const e=this.lineHeight;if(this.getTextHeight(t)<=e)this.frontLines=[],this.lastLineText=t,this.isLastLineEllipsis=this.checkIfTextOverflows(t);else{const i=this.lineHeight*(this.rows-1),a=this.findTextForHeight(t,i);this.frontLines=this.splitTextToLines(a);const l=t.substring(a.length);this.lastLineText=l,this.isLastLineEllipsis=l.length>0&&this.checkIfTextOverflows(l)}}this.isCalculating=!1},findTextForHeight(t,e){if(this.getTextHeight(t)<=e)return t;let s=0,i=t.length,a="";for(;s<=i;){const l=Math.floor((s+i)/2),n=t.substring(0,l);this.getTextHeight(n)<=e?(a=n,s=l+1):i=l-1}return a},splitTextToLines(t){if(!t)return[];const e=[];let s=t;for(;s.length>0;){const i=this.findTextForHeight(s,this.lineHeight);if(i.length===0)break;e.push(i),s=s.substring(i.length)}return e},checkIfTextOverflows(t){if(!t)return!1;const e=this.getTextWidth(t),s=this.shouldShowToolbar&&this.hasToolbarContent?this.getToolbarWidth():0,i=this.containerWidth-s-5;return e>i},getToolbarWidth(){let t=0;return this.copyable&&(t+=20),this.hasToolbarSlot&&(t+=40),t},getTextHeight(t){return this.measureText(t,{width:this.containerWidth+"px",wordBreak:"break-all",whiteSpace:"normal"})},getTextWidth(t){return this.measureText(t,{whiteSpace:"nowrap"})},measureText(t,e={}){if(!this.$refs.containerRef||!this.$refs.measureRef)return 0;const s=this.$refs.measureRef,i=s.style.cssText;this.setMeasureElementStyle(s,e),s.textContent=t,s.offsetHeight;const a=e.whiteSpace==="nowrap"?s.offsetWidth:s.offsetHeight;return s.style.cssText=i,s.innerHTML="",a},setMeasureElementStyle(t,e={}){const s=window.getComputedStyle(this.$refs.containerRef);t.style.cssText="",t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.zIndex="-1",t.style.fontSize=s.fontSize,t.style.fontFamily=s.fontFamily,t.style.fontWeight=s.fontWeight,t.style.lineHeight=s.lineHeight,t.style.letterSpacing=s.letterSpacing,t.style.wordSpacing=s.wordSpacing,t.style.padding="0",t.style.margin="0",t.style.border="none",t.style.boxSizing="border-box",Object.entries(e).forEach(([i,a])=>{t.style[i]=a})},handleMouseEnter(){this.isHovered=!0},handleMouseLeave(){this.isHovered=!1},setupResizeObserver(){typeof ResizeObserver!="undefined"&&(this.resizeObserver=new ResizeObserver(t=>{const e=t[0];if(e){const s=e.contentRect.width;Math.abs(s-this.containerWidth)>1&&requestAnimationFrame(()=>{this.calculateLineHeight(),this.calculateLayout()})}}),this.$refs.containerRef&&this.resizeObserver.observe(this.$refs.containerRef))},cleanupResizeObserver(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},setupTableRowHover(){let t=this.$el;for(;t&&t!==document.body;){if(t.classList&&t.classList.contains("el-table__row")){this.tableRowElement=t;break}t=t.parentElement}this.tableRowElement&&(this.tableRowElement.addEventListener("mouseenter",this.handleMouseEnter),this.tableRowElement.addEventListener("mouseleave",this.handleMouseLeave))},cleanupTableRowHover(){this.tableRowElement&&(this.tableRowElement.removeEventListener("mouseenter",this.handleMouseEnter),this.tableRowElement.removeEventListener("mouseleave",this.handleMouseLeave),this.tableRowElement=null)}}};var ts=function(){var e=this,s=e._self._c;return s("div",{ref:"containerRef",staticClass:"tm-ellipsis-text",style:e.containerStyle,on:{mouseenter:e.handleMouseEnter,mouseleave:e.handleMouseLeave}},[e.showTooltip&&e.isLastLineEllipsis?s("el-tooltip",e._b({attrs:{content:e.originalText,disabled:!e.showTooltip||!e.isLastLineEllipsis,placement:"top"}},"el-tooltip",{[e.isVue2?"open-delay":"show-after"]:300},!1),[s("div",{staticClass:"tm-ellipsis-text-wrapper"},[e._l(e.frontLines,function(i,a){return s("div",{key:"front-"+a,staticClass:"tm-ellipsis-line",domProps:{innerHTML:e._s(i)}})}),s("div",{staticClass:"tm-ellipsis-last-line"},[s("div",{staticClass:"tm-ellipsis-text-part",domProps:{innerHTML:e._s(e.lastLineText)}}),e.shouldShowToolbar&&e.hasToolbarContent?s("div",{staticClass:"tm-ellipsis-toolbar-part"},[e.copyable?s("CopyIcon",{staticClass:"icon-item",on:{click:e.handleCopy}}):e._e(),e._t("toolbar")],2):e._e()])],2)]):s("div",{staticClass:"tm-ellipsis-text-wrapper"},[e._l(e.frontLines,function(i,a){return s("div",{key:"front-"+a,staticClass:"tm-ellipsis-line",domProps:{innerHTML:e._s(i)}})}),s("div",{staticClass:"tm-ellipsis-last-line"},[s("div",{staticClass:"tm-ellipsis-text-part",domProps:{innerHTML:e._s(e.lastLineText)}}),e.shouldShowToolbar&&e.hasToolbarContent?s("div",{staticClass:"tm-ellipsis-toolbar-part"},[e.copyable?s("CopyIcon",{staticClass:"icon-item",on:{click:e.handleCopy}}):e._e(),e._t("toolbar")],2):e._e()])],2),s("div",{ref:"measureRef",staticClass:"tm-ellipsis-measure"})],1)},ss=[],is=p(es,ts,ss,!1,null,"16643222");const N=is.exports,J={install:{install(t,e={}){[I,W,S,N].forEach(s=>t.component(s.name,s)),e.tableConfigProvider&&Ot(e.tableConfigProvider),e.lang&&$(e.lang||"zh-CN")}}.install,Table:I,Column:W,Search:E,Select:z,AdvancedInput:O,AdvancedDate:D,Cascader:M,Radio:A,Checkbox:R,Switch:H,EllipsisText:S,AdvancedEllipsisText:N,setLang:$,useLocale:v};typeof window!="undefined"&&window.Vue&&J.install(window.Vue),r.AdvancedDate=D,r.AdvancedEllipsisText=N,r.AdvancedInput=O,r.Cascader=M,r.Checkbox=R,r.Column=W,r.EllipsisText=S,r.Radio=A,r.Search=E,r.Select=z,r.Switch=H,r.Table=I,r.default=J,r.setLang=$,r.useLocale=v,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/vue3/tm-table.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.advanced-select[data-v-467dcdd3]{display:flex;max-width:305px}.advanced-select.hasField .select[data-v-467dcdd3]{width:206px;position:relative}.advanced-select.hasField .select[data-v-467dcdd3]:hover{z-index:1!important}.advanced-select.hasField[data-v-467dcdd3] .select--v2 .el-input__inner,.advanced-select.hasField[data-v-467dcdd3] .select--v3 .el-select__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.advanced-select .field-select[data-v-467dcdd3]{margin-right:-1px;width:100px;position:relative}.advanced-select .field-select[data-v-467dcdd3]:hover{z-index:1!important}.advanced-select[data-v-467dcdd3] .field-select--v2 .el-input__inner,.advanced-select[data-v-467dcdd3] .field-select--v3 .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.advanced-select .select[data-v-467dcdd3]{width:200px;flex-shrink:0}.advanced-select .select[data-v-467dcdd3] .el-tag--info{max-width:52%}.check-all-option[data-v-467dcdd3]{margin-top:-6px;padding:6px 20px;border-bottom:1px solid #ebeef5;cursor:default;position:sticky;top:0;z-index:1;background-color:#fff}.tm-icon[data-v-1c30ca93]{font-size:inherit;display:inline-block;height:1em;justify-content:center;line-height:1;position:relative;width:1em;fill:currentColor;color:inherit}.el-button .tm-icon{vertical-align:top}.el-table__row:hover .ellipsis-text-container .toolbar{display:flex;align-items:center;gap:2px}.el-table__row:hover .ellipsis-text-container .toolbar.multiline{display:block}.el-table__row:hover .ellipsis-text-container .toolbar .icon-item{flex-shrink:0}.el-table__row:hover .ellipsis-text-container .toolbar .icon-item:hover{color:var(--color-primary)!important}.ellipsis-text-container[data-v-0979131f]{text-align:left;display:inline-flex;vertical-align:top}.ellipsis-text-container .toolbar[data-v-0979131f]{display:none;max-width:30px}.ellipsis-text-container .toolbar .icon-item[data-v-0979131f]{cursor:pointer;margin-left:2px}.ellipsis-text-container .toolbar .icon-item[data-v-0979131f]:hover{opacity:.8}.ellipsis-text-container:hover .toolbar[data-v-0979131f]{display:flex;align-items:center;gap:2px}.ellipsis-text-container:hover .toolbar.multiline[data-v-0979131f]{display:block}.ellipsis-text-container:hover .toolbar .icon-item[data-v-0979131f]:hover{color:var(--color-primary)!important}.tm-advanced-input[data-v-6b474dac]{display:flex;align-items:center}.tm-advanced-input .left-select[data-v-6b474dac]{margin-right:-1px}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .left-select.el-select{margin-right:-1px;position:relative;z-index:2}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .left-select.el-select .el-input__inner{transition:0s;border-top-right-radius:0;border-bottom-right-radius:0}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input{position:relative;z-index:1}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input:focus-within,.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input:hover,.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input:focus{z-index:3}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input.has-label .el-input__inner{transition:0s;border-top-left-radius:0;border-bottom-left-radius:0}.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .left-select.el-select .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;position:relative;z-index:2;transition:0s}.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input .el-input__wrapper{position:relative;z-index:1;transition:0s}.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input .el-input__wrapper:focus-within,.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input .el-input__wrapper:hover,.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input .el-input__wrapper:focus{z-index:3}.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input.has-label .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.popover-content .popover-title[data-v-6b474dac]{font-weight:700;margin-bottom:5px}.popover-content .popover-subtitle[data-v-6b474dac]{font-size:12px;color:#909399;margin-top:0;margin-bottom:10px}.popover-content .popover-footer[data-v-6b474dac]{margin-top:10px;text-align:right}.tm-advanced-input--v3 .input-label[data-v-6b474dac]{border-right:none;color:var(--el-input-text-color, var(--el-text-color-regular))}.tm-advanced-input--v2 .input-label[data-v-6b474dac]{border-right:none;color:#606266}.input-label[data-v-6b474dac]{height:100%;flex-shrink:0;width:100px;font-size:12px;box-sizing:border-box;display:flex;align-items:center;line-height:12px;border-right:none;border-top-left-radius:4px;border-bottom-left-radius:4px;justify-content:flex-end;padding-right:4px}.tm-date-picker--v2[data-v-7d46d46b]{display:flex;align-items:center}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-select{margin-right:-1px;z-index:1}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-select .el-input__inner{border-top-right-radius:0;border-bottom-right-radius:0;transition:0s}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-date-editor.el-input__inner{border-top-left-radius:0!important;border-bottom-left-radius:0!important}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-date-editor{transition:0s}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-date-editor.is-active,.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-date-editor:hover{z-index:2}.tm-date-picker--v3[data-v-7d46d46b]{display:flex;align-items:center}.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-select{margin-right:-1px}.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-select .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;position:relative;z-index:2;transition:0s}.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor{position:relative;border-top-left-radius:0!important;border-bottom-left-radius:0!important;z-index:1;transition:0s}.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor.focus-within,.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor.focus,.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor.is-active,.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor:hover{z-index:2}.date-label[data-v-7d46d46b]{height:100%;flex-shrink:0;width:100px;font-size:12px;box-sizing:border-box;display:flex;align-items:center;line-height:12px;border-right:none;border-top-left-radius:4px;border-bottom-left-radius:4px;justify-content:flex-end;padding-right:4px;color:#606266}.tm-cascader--v2 .el-input--mini input{height:28px!important}.tm-cascader--v2 .el-cascader__tags .el-tag{margin:4px 0 4px 6px}.tm-cascader--v2 .el-cascader__tags .el-tag:first-child{max-width:90px}.tm-cascader--v2 .el-cascader__tags .el-tag:nth-child(2){max-width:48px}.tm-cascader--v2 .el-cascader__tags input{font-size:12px!important}.tm-cascader--v2 .el-cascader__tags .el-cascader__search-input{min-width:16px}.tm-cascader--v3 .el-cascader__tags{font-size:12px;flex-wrap:nowrap;align-items:center}.tm-cascader--v3 .el-cascader__tags .el-tag{padding:0 4px}.tm-cascader--v3 .el-cascader__tags .el-tag:first-child{max-width:90px}.tm-cascader--v3 .el-cascader__tags .el-tag:nth-child(2){max-width:48px}.tm-cascader--v3 .el-cascader__tags .el-cascader__search-input{min-width:16px}.el-cascader__collapse-tags{max-height:400px;max-width:400px;margin:0 -11px;padding:0 11px;overflow-y:auto;display:flex;flex-wrap:wrap;gap:4px}[data-v-61fed13d] .el-radio-button__inner{font-weight:400}.tm-radio[data-v-61fed13d]{width:200px;display:flex;width:100%}.tm-radio.wide-mode[data-v-61fed13d]{width:305px}.tm-radio--v2[data-v-61fed13d] .el-radio-group .el-radio-button{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tm-radio--v2[data-v-61fed13d] .el-radio-group .el-radio-button .el-radio-button__inner{padding:7px 5px;width:100%;display:inline-block;text-overflow:ellipsis;overflow:hidden;box-sizing:border-box;text-align:center}.tm-radio--v3[data-v-61fed13d] .el-radio-group .el-radio-button .el-radio-button__inner{width:100%}.tm-checkbox[data-v-b44866b1]{width:200px;display:flex;flex-direction:column}.tm-checkbox.wide-mode[data-v-b44866b1]{width:305px}.tm-checkbox--v2[data-v-b44866b1] .el-checkbox-group{display:flex;width:100%}.tm-checkbox--v2[data-v-b44866b1] .el-checkbox-group .el-checkbox-button{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tm-checkbox--v2[data-v-b44866b1] .el-checkbox-group .el-checkbox-button .el-checkbox-button__inner{padding:7px 5px;width:100%;display:inline-block;text-overflow:ellipsis;overflow:hidden;box-sizing:border-box;text-align:center}.tm-checkbox--v3[data-v-b44866b1] .el-checkbox-group .el-checkbox-button .el-checkbox-button__inner{width:100%}.tm-switch[data-v-9e7a342f]{display:flex;align-items:center}.tm-switch.narrow-container[data-v-9e7a342f]{width:95px}.tm-switch.medium-container[data-v-9e7a342f]{width:200px}.tm-switch.wide-container[data-v-9e7a342f]{width:305px}.tm-switch[data-v-9e7a342f] .el-switch .el-switch__core{flex-shrink:0}.table-search[data-v-4ec2388e]{--el-font-size-base: 12px}.table-search[data-v-4ec2388e] .el-select__wrapper,.table-search[data-v-4ec2388e] .el-switch__label{font-size:var(--el-font-size-base);font-weight:400}.table-search[data-v-4ec2388e] .el-radio-button__inner,.table-search[data-v-4ec2388e] .el-checkbox-button__inner{padding:9px 10px}.table-search[data-v-4ec2388e]{margin-bottom:10px;display:flex;flex-wrap:wrap;align-items:center}.table-search .search-content[data-v-4ec2388e]{flex:1;display:flex;align-items:center;flex-wrap:wrap;gap:10px}.table-search .search-actions[data-v-4ec2388e]{display:flex}.table-search .search-error-message[data-v-4ec2388e]{color:#f56c6c;font-size:12px;margin:5px 0}.table-search--v2 .search-form-item[data-v-4ec2388e]{height:28px}.table-search--v3 .search-form-item[data-v-4ec2388e]{height:24px}.tm-pagination[data-v-4dbdf6e7]{padding:10px 0;text-align:right;display:flex;flex-direction:row-reverse}.tm-table-menu[data-v-579dd2c3]{display:flex;justify-content:space-between;margin-bottom:10px}.tm-table-menu .left[data-v-579dd2c3]{flex:1;margin-right:10px;display:flex;flex-wrap:wrap;gap:4px 0}.tm-table-menu .right[data-v-579dd2c3]{flex-shrink:0}.column-config-popover{padding:0!important}.title[data-v-127cbd33]{display:flex;align-items:center;font-weight:700;color:#000;height:32px;padding-left:10px;padding-top:10px}.container[data-v-127cbd33]{height:500px;width:100%;display:flex;flex-direction:column;overflow:hidden}.container .main-container[data-v-127cbd33]{display:flex;flex:1;overflow:hidden;border-bottom:1px solid #dcdfe9}.container .main-container .left-content[data-v-127cbd33]{flex:2;border-right:1px solid #dcdfe9;display:flex;flex-direction:column}.container .main-container .left-content .option-list[data-v-127cbd33]{flex:1;overflow-y:auto}.container .main-container .right-content[data-v-127cbd33]{flex:1;overflow-y:auto;display:flex;flex-direction:column;overflow:hidden}.container .main-container .right-content .search-box[data-v-127cbd33]{display:flex;align-items:center;height:33px;border-bottom:1px solid #dcdfe9;box-sizing:border-box}.container .main-container .right-content .search-box[data-v-127cbd33] .el-input__inner{box-shadow:none;border:none}.container .main-container .right-content .search-box[data-v-127cbd33] .el-input__wrapper{box-shadow:none}.container .main-container .right-content .sort-list[data-v-127cbd33]{flex:1;overflow-y:auto}.container .main-container .right-content .sort-list .sort-item-wrapper[data-v-127cbd33]{position:relative;transition:background-color .2s}.container .main-container .right-content .sort-list .sort-item-wrapper[data-v-127cbd33]:hover{background-color:#e0eeff}.container .main-container .right-content .sort-list .sort-item-wrapper:hover .delete-button[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item-wrapper:hover .top-button[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item-wrapper:hover .left-fixed-btn[data-v-127cbd33]:not(.active-fixed),.container .main-container .right-content .sort-list .sort-item-wrapper:hover .right-fixed-btn[data-v-127cbd33]:not(.active-fixed){display:inline-block!important}.container .main-container .right-content .sort-list .sort-item-wrapper.no-drop-zone[data-v-127cbd33]{position:relative}.container .main-container .right-content .sort-list .sort-item-wrapper.no-drop-zone[data-v-127cbd33]:after{content:"";position:absolute;inset:0;background:#ff00001a;border:1px dashed #f56c6c;pointer-events:none}.container .main-container .right-content .sort-list .sort-item-wrapper.frozen[data-v-127cbd33]:hover,.container .main-container .right-content .sort-list .sort-item-wrapper.frozenRight[data-v-127cbd33]:hover{background-color:#e0eeff}.container .main-container .right-content .sort-list .sort-item[data-v-127cbd33]{display:flex;align-items:center;width:100%;height:32px;box-sizing:border-box;padding:0 8px;transition:.2s;user-select:none}.container .main-container .right-content .sort-list .sort-item .row-title[data-v-127cbd33]{cursor:grab;flex:1;margin-right:8px;display:flex;align-items:center;gap:4px}.container .main-container .right-content .sort-list .sort-item .operation-btns[data-v-127cbd33]{display:flex;align-items:center}.container .main-container .right-content .sort-list .sort-item .operation-btns .iconfont-button[data-v-127cbd33]{margin-left:3px;padding:0}.container .main-container .right-content .sort-list .sort-item .operation-btns .delete-button[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item .operation-btns .top-button[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item .operation-btns .left-fixed-btn[data-v-127cbd33]:not(.active-fixed),.container .main-container .right-content .sort-list .sort-item .operation-btns .right-fixed-btn[data-v-127cbd33]:not(.active-fixed){display:none}.container .main-container .right-content .sort-list .sort-item .operation-btns .left-fixed-btn.active-fixed[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item .operation-btns .right-fixed-btn.active-fixed[data-v-127cbd33]{display:inline-block;color:var(--el-color-primary)}.container .main-container .right-content .sort-list .sort-item .operation-btns .iconfont[data-v-127cbd33]{color:#aaa;font-size:14px}.container .main-container .right-content .sort-list .sort-item .operation-btns .iconfont[data-v-127cbd33]:hover{color:var(--el-color-primary)}.container .main-container .right-content .sort-list .sort-item .operation-btns .left-fixed-btn .el-icon-position[data-v-127cbd33]{transform:rotate(-90deg)}.container .main-container .right-content .sort-list .sort-item .operation-btns .left-fixed-btn:hover .el-icon-position[data-v-127cbd33]{color:var(--el-color-primary)}.container .main-container .right-content .sort-list .sort-item .operation-btns .right-fixed-btn .el-icon-position[data-v-127cbd33]{transform:rotate(90deg)}.container .main-container .right-content .sort-list .sort-item .operation-btns .right-fixed-btn:hover .el-icon-position[data-v-127cbd33]{color:var(--el-color-primary)}.container .footer[data-v-127cbd33]{padding:10px;box-sizing:border-box;display:flex;justify-content:space-between}.el-checkbox[data-v-127cbd33]{white-space:wrap;min-height:14px;height:auto;margin-top:10px;margin-left:10px;font-weight:400}.el-checkbox[data-v-127cbd33] .el-checkbox__label{width:70px;vertical-align:top}.blue-background-class[data-v-127cbd33]{background-color:#e0eeff!important;box-shadow:0 2px 8px #0000001a;z-index:1000}.sortable-drag[data-v-127cbd33]{opacity:.9;background-color:#e0eeff!important;box-shadow:0 2px 8px #0000001a}.tips[data-v-127cbd33]{color:#999;line-height:16px;font-size:12px;padding:8px}.tips span[data-v-127cbd33],.tips span span[data-v-127cbd33]{color:#999}.tm-table[data-v-8db1f265] .el-table .cell{word-break:keep-all;word-wrap:break-word}.icon-item[data-v-16643222]{cursor:pointer}.icon-item[data-v-16643222]:hover{opacity:.6}.tm-ellipsis-text[data-v-16643222]{position:relative;overflow:hidden}.tm-ellipsis-text .tm-ellipsis-text-wrapper[data-v-16643222]{width:100%}.tm-ellipsis-text .tm-ellipsis-text-wrapper .tm-ellipsis-line[data-v-16643222]{line-height:inherit;word-break:break-all;white-space:normal}.tm-ellipsis-text .tm-ellipsis-text-wrapper .tm-ellipsis-last-line[data-v-16643222]{display:flex;align-items:center;line-height:inherit}.tm-ellipsis-text .tm-ellipsis-text-wrapper .tm-ellipsis-last-line .tm-ellipsis-text-part[data-v-16643222]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.tm-ellipsis-text .tm-ellipsis-text-wrapper .tm-ellipsis-last-line .tm-ellipsis-toolbar-part[data-v-16643222]{flex-shrink:0;margin-left:4px;display:flex;align-items:center;line-height:inherit;font-size:inherit}.tm-ellipsis-measure[data-v-16643222]{position:absolute;left:-9999px;top:-9999px;visibility:hidden;pointer-events:none;z-index:-1}
|
|
1
|
+
@charset "UTF-8";.advanced-select[data-v-467dcdd3]{display:flex;max-width:305px}.advanced-select.hasField .select[data-v-467dcdd3]{width:206px;position:relative}.advanced-select.hasField .select[data-v-467dcdd3]:hover{z-index:1!important}.advanced-select.hasField[data-v-467dcdd3] .select--v2 .el-input__inner,.advanced-select.hasField[data-v-467dcdd3] .select--v3 .el-select__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.advanced-select .field-select[data-v-467dcdd3]{margin-right:-1px;width:100px;position:relative}.advanced-select .field-select[data-v-467dcdd3]:hover{z-index:1!important}.advanced-select[data-v-467dcdd3] .field-select--v2 .el-input__inner,.advanced-select[data-v-467dcdd3] .field-select--v3 .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.advanced-select .select[data-v-467dcdd3]{width:200px;flex-shrink:0}.advanced-select .select[data-v-467dcdd3] .el-tag--info{max-width:52%}.check-all-option[data-v-467dcdd3]{margin-top:-6px;padding:6px 20px;border-bottom:1px solid #ebeef5;cursor:default;position:sticky;top:0;z-index:1;background-color:#fff}.tm-icon[data-v-1c30ca93]{font-size:inherit;display:inline-block;height:1em;justify-content:center;line-height:1;position:relative;width:1em;fill:currentColor;color:inherit}.el-button .tm-icon{vertical-align:top}.el-table__row:hover .ellipsis-text-container .toolbar{display:flex;align-items:center;gap:2px}.el-table__row:hover .ellipsis-text-container .toolbar.multiline{display:block}.el-table__row:hover .ellipsis-text-container .toolbar .icon-item{flex-shrink:0}.el-table__row:hover .ellipsis-text-container .toolbar .icon-item:hover{color:var(--color-primary)!important}.ellipsis-text-container[data-v-0979131f]{text-align:left;display:inline-flex;vertical-align:top}.ellipsis-text-container .toolbar[data-v-0979131f]{display:none;max-width:30px}.ellipsis-text-container .toolbar .icon-item[data-v-0979131f]{cursor:pointer;margin-left:2px}.ellipsis-text-container .toolbar .icon-item[data-v-0979131f]:hover{opacity:.8}.ellipsis-text-container:hover .toolbar[data-v-0979131f]{display:flex;align-items:center;gap:2px}.ellipsis-text-container:hover .toolbar.multiline[data-v-0979131f]{display:block}.ellipsis-text-container:hover .toolbar .icon-item[data-v-0979131f]:hover{color:var(--color-primary)!important}.tm-advanced-input[data-v-6b474dac]{display:flex;align-items:center}.tm-advanced-input .left-select[data-v-6b474dac]{margin-right:-1px}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .left-select.el-select{margin-right:-1px;position:relative;z-index:2}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .left-select.el-select .el-input__inner{transition:0s;border-top-right-radius:0;border-bottom-right-radius:0}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input{position:relative;z-index:1}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input:focus-within,.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input:hover,.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input:focus{z-index:3}.tm-advanced-input.tm-advanced-input--v2[data-v-6b474dac] .right-input.el-input.has-label .el-input__inner{transition:0s;border-top-left-radius:0;border-bottom-left-radius:0}.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .left-select.el-select .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;position:relative;z-index:2;transition:0s}.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input .el-input__wrapper{position:relative;z-index:1;transition:0s}.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input .el-input__wrapper:focus-within,.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input .el-input__wrapper:hover,.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input .el-input__wrapper:focus{z-index:3}.tm-advanced-input.tm-advanced-input--v3[data-v-6b474dac] .right-input.el-input.has-label .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.popover-content .popover-title[data-v-6b474dac]{font-weight:700;margin-bottom:5px}.popover-content .popover-subtitle[data-v-6b474dac]{font-size:12px;color:#909399;margin-top:0;margin-bottom:10px}.popover-content .popover-footer[data-v-6b474dac]{margin-top:10px;text-align:right}.tm-advanced-input--v3 .input-label[data-v-6b474dac]{border-right:none;color:var(--el-input-text-color, var(--el-text-color-regular))}.tm-advanced-input--v2 .input-label[data-v-6b474dac]{border-right:none;color:#606266}.input-label[data-v-6b474dac]{height:100%;flex-shrink:0;width:100px;font-size:12px;box-sizing:border-box;display:flex;align-items:center;line-height:12px;border-right:none;border-top-left-radius:4px;border-bottom-left-radius:4px;justify-content:flex-end;padding-right:4px}.tm-date-picker--v2[data-v-7d46d46b]{display:flex;align-items:center}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-select{margin-right:-1px;z-index:1}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-select .el-input__inner{border-top-right-radius:0;border-bottom-right-radius:0;transition:0s}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-date-editor.el-input__inner{border-top-left-radius:0!important;border-bottom-left-radius:0!important}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-date-editor{transition:0s}.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-date-editor.is-active,.tm-date-picker--v2.has-select[data-v-7d46d46b] .el-date-editor:hover{z-index:2}.tm-date-picker--v3[data-v-7d46d46b]{display:flex;align-items:center}.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-select{margin-right:-1px}.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-select .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0;position:relative;z-index:2;transition:0s}.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor{position:relative;border-top-left-radius:0!important;border-bottom-left-radius:0!important;z-index:1;transition:0s}.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor.focus-within,.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor.focus,.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor.is-active,.tm-date-picker--v3.has-select[data-v-7d46d46b] .el-date-editor:hover{z-index:2}.date-label[data-v-7d46d46b]{height:100%;flex-shrink:0;width:100px;font-size:12px;box-sizing:border-box;display:flex;align-items:center;line-height:12px;border-right:none;border-top-left-radius:4px;border-bottom-left-radius:4px;justify-content:flex-end;padding-right:4px;color:#606266}.tm-cascader--v2 .el-input--mini input{height:28px!important}.tm-cascader--v2 .el-cascader__tags .el-tag{margin:4px 0 4px 6px}.tm-cascader--v2 .el-cascader__tags .el-tag:first-child{max-width:90px}.tm-cascader--v2 .el-cascader__tags .el-tag:nth-child(2){max-width:48px}.tm-cascader--v2 .el-cascader__tags input{font-size:12px!important}.tm-cascader--v2 .el-cascader__tags .el-cascader__search-input{min-width:16px}.tm-cascader--v3 .el-cascader__tags{font-size:12px;flex-wrap:nowrap;align-items:center}.tm-cascader--v3 .el-cascader__tags .el-tag{padding:0 4px}.tm-cascader--v3 .el-cascader__tags .el-tag:first-child{max-width:90px}.tm-cascader--v3 .el-cascader__tags .el-tag:nth-child(2){max-width:48px}.tm-cascader--v3 .el-cascader__tags .el-cascader__search-input{min-width:16px}.el-cascader__collapse-tags{max-height:400px;max-width:400px;margin:0 -11px;padding:0 11px;overflow-y:auto;display:flex;flex-wrap:wrap;gap:4px}[data-v-61fed13d] .el-radio-button__inner{font-weight:400}.tm-radio[data-v-61fed13d]{width:200px;display:flex;width:100%}.tm-radio.wide-mode[data-v-61fed13d]{width:305px}.tm-radio--v2[data-v-61fed13d] .el-radio-group .el-radio-button{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tm-radio--v2[data-v-61fed13d] .el-radio-group .el-radio-button .el-radio-button__inner{padding:7px 5px;width:100%;display:inline-block;text-overflow:ellipsis;overflow:hidden;box-sizing:border-box;text-align:center}.tm-radio--v3[data-v-61fed13d] .el-radio-group .el-radio-button .el-radio-button__inner{width:100%}.tm-checkbox[data-v-b44866b1]{width:200px;display:flex;flex-direction:column}.tm-checkbox.wide-mode[data-v-b44866b1]{width:305px}.tm-checkbox--v2[data-v-b44866b1] .el-checkbox-group{display:flex;width:100%}.tm-checkbox--v2[data-v-b44866b1] .el-checkbox-group .el-checkbox-button{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tm-checkbox--v2[data-v-b44866b1] .el-checkbox-group .el-checkbox-button .el-checkbox-button__inner{padding:7px 5px;width:100%;display:inline-block;text-overflow:ellipsis;overflow:hidden;box-sizing:border-box;text-align:center}.tm-checkbox--v3[data-v-b44866b1] .el-checkbox-group .el-checkbox-button .el-checkbox-button__inner{width:100%}.tm-switch[data-v-9e7a342f]{display:flex;align-items:center}.tm-switch.narrow-container[data-v-9e7a342f]{width:95px}.tm-switch.medium-container[data-v-9e7a342f]{width:200px}.tm-switch.wide-container[data-v-9e7a342f]{width:305px}.tm-switch[data-v-9e7a342f] .el-switch .el-switch__core{flex-shrink:0}.table-search[data-v-54d5e2a2]{--el-font-size-base: 12px}.table-search[data-v-54d5e2a2] .el-select__wrapper,.table-search[data-v-54d5e2a2] .el-switch__label{font-size:var(--el-font-size-base);font-weight:400}.table-search[data-v-54d5e2a2] .el-radio-button__inner,.table-search[data-v-54d5e2a2] .el-checkbox-button__inner{padding:9px 10px}.table-search[data-v-54d5e2a2]{margin-bottom:10px;display:flex;flex-wrap:wrap;align-items:center}.table-search .search-content[data-v-54d5e2a2]{flex:1;display:flex;align-items:center;flex-wrap:wrap;gap:10px}.table-search .search-actions[data-v-54d5e2a2]{display:flex}.table-search .search-error-message[data-v-54d5e2a2]{color:#f56c6c;font-size:12px;margin:5px 0}.table-search--v2 .search-form-item[data-v-54d5e2a2]{height:28px}.table-search--v3 .search-form-item[data-v-54d5e2a2]{height:24px}.tm-pagination[data-v-4dbdf6e7]{padding:10px 0;text-align:right;display:flex;flex-direction:row-reverse}.tm-table-menu[data-v-579dd2c3]{display:flex;justify-content:space-between;margin-bottom:10px}.tm-table-menu .left[data-v-579dd2c3]{flex:1;margin-right:10px;display:flex;flex-wrap:wrap;gap:4px 0}.tm-table-menu .right[data-v-579dd2c3]{flex-shrink:0}.column-config-popover{padding:0!important}.title[data-v-127cbd33]{display:flex;align-items:center;font-weight:700;color:#000;height:32px;padding-left:10px;padding-top:10px}.container[data-v-127cbd33]{height:500px;width:100%;display:flex;flex-direction:column;overflow:hidden}.container .main-container[data-v-127cbd33]{display:flex;flex:1;overflow:hidden;border-bottom:1px solid #dcdfe9}.container .main-container .left-content[data-v-127cbd33]{flex:2;border-right:1px solid #dcdfe9;display:flex;flex-direction:column}.container .main-container .left-content .option-list[data-v-127cbd33]{flex:1;overflow-y:auto}.container .main-container .right-content[data-v-127cbd33]{flex:1;overflow-y:auto;display:flex;flex-direction:column;overflow:hidden}.container .main-container .right-content .search-box[data-v-127cbd33]{display:flex;align-items:center;height:33px;border-bottom:1px solid #dcdfe9;box-sizing:border-box}.container .main-container .right-content .search-box[data-v-127cbd33] .el-input__inner{box-shadow:none;border:none}.container .main-container .right-content .search-box[data-v-127cbd33] .el-input__wrapper{box-shadow:none}.container .main-container .right-content .sort-list[data-v-127cbd33]{flex:1;overflow-y:auto}.container .main-container .right-content .sort-list .sort-item-wrapper[data-v-127cbd33]{position:relative;transition:background-color .2s}.container .main-container .right-content .sort-list .sort-item-wrapper[data-v-127cbd33]:hover{background-color:#e0eeff}.container .main-container .right-content .sort-list .sort-item-wrapper:hover .delete-button[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item-wrapper:hover .top-button[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item-wrapper:hover .left-fixed-btn[data-v-127cbd33]:not(.active-fixed),.container .main-container .right-content .sort-list .sort-item-wrapper:hover .right-fixed-btn[data-v-127cbd33]:not(.active-fixed){display:inline-block!important}.container .main-container .right-content .sort-list .sort-item-wrapper.no-drop-zone[data-v-127cbd33]{position:relative}.container .main-container .right-content .sort-list .sort-item-wrapper.no-drop-zone[data-v-127cbd33]:after{content:"";position:absolute;inset:0;background:#ff00001a;border:1px dashed #f56c6c;pointer-events:none}.container .main-container .right-content .sort-list .sort-item-wrapper.frozen[data-v-127cbd33]:hover,.container .main-container .right-content .sort-list .sort-item-wrapper.frozenRight[data-v-127cbd33]:hover{background-color:#e0eeff}.container .main-container .right-content .sort-list .sort-item[data-v-127cbd33]{display:flex;align-items:center;width:100%;height:32px;box-sizing:border-box;padding:0 8px;transition:.2s;user-select:none}.container .main-container .right-content .sort-list .sort-item .row-title[data-v-127cbd33]{cursor:grab;flex:1;margin-right:8px;display:flex;align-items:center;gap:4px}.container .main-container .right-content .sort-list .sort-item .operation-btns[data-v-127cbd33]{display:flex;align-items:center}.container .main-container .right-content .sort-list .sort-item .operation-btns .iconfont-button[data-v-127cbd33]{margin-left:3px;padding:0}.container .main-container .right-content .sort-list .sort-item .operation-btns .delete-button[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item .operation-btns .top-button[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item .operation-btns .left-fixed-btn[data-v-127cbd33]:not(.active-fixed),.container .main-container .right-content .sort-list .sort-item .operation-btns .right-fixed-btn[data-v-127cbd33]:not(.active-fixed){display:none}.container .main-container .right-content .sort-list .sort-item .operation-btns .left-fixed-btn.active-fixed[data-v-127cbd33],.container .main-container .right-content .sort-list .sort-item .operation-btns .right-fixed-btn.active-fixed[data-v-127cbd33]{display:inline-block;color:var(--el-color-primary)}.container .main-container .right-content .sort-list .sort-item .operation-btns .iconfont[data-v-127cbd33]{color:#aaa;font-size:14px}.container .main-container .right-content .sort-list .sort-item .operation-btns .iconfont[data-v-127cbd33]:hover{color:var(--el-color-primary)}.container .main-container .right-content .sort-list .sort-item .operation-btns .left-fixed-btn .el-icon-position[data-v-127cbd33]{transform:rotate(-90deg)}.container .main-container .right-content .sort-list .sort-item .operation-btns .left-fixed-btn:hover .el-icon-position[data-v-127cbd33]{color:var(--el-color-primary)}.container .main-container .right-content .sort-list .sort-item .operation-btns .right-fixed-btn .el-icon-position[data-v-127cbd33]{transform:rotate(90deg)}.container .main-container .right-content .sort-list .sort-item .operation-btns .right-fixed-btn:hover .el-icon-position[data-v-127cbd33]{color:var(--el-color-primary)}.container .footer[data-v-127cbd33]{padding:10px;box-sizing:border-box;display:flex;justify-content:space-between}.el-checkbox[data-v-127cbd33]{white-space:wrap;min-height:14px;height:auto;margin-top:10px;margin-left:10px;font-weight:400}.el-checkbox[data-v-127cbd33] .el-checkbox__label{width:70px;vertical-align:top}.blue-background-class[data-v-127cbd33]{background-color:#e0eeff!important;box-shadow:0 2px 8px #0000001a;z-index:1000}.sortable-drag[data-v-127cbd33]{opacity:.9;background-color:#e0eeff!important;box-shadow:0 2px 8px #0000001a}.tips[data-v-127cbd33]{color:#999;line-height:16px;font-size:12px;padding:8px}.tips span[data-v-127cbd33],.tips span span[data-v-127cbd33]{color:#999}.tm-table[data-v-8db1f265] .el-table .cell{word-break:keep-all;word-wrap:break-word}.icon-item[data-v-16643222]{cursor:pointer}.icon-item[data-v-16643222]:hover{opacity:.6}.tm-ellipsis-text[data-v-16643222]{position:relative;overflow:hidden}.tm-ellipsis-text .tm-ellipsis-text-wrapper[data-v-16643222]{width:100%}.tm-ellipsis-text .tm-ellipsis-text-wrapper .tm-ellipsis-line[data-v-16643222]{line-height:inherit;word-break:break-all;white-space:normal}.tm-ellipsis-text .tm-ellipsis-text-wrapper .tm-ellipsis-last-line[data-v-16643222]{display:flex;align-items:center;line-height:inherit}.tm-ellipsis-text .tm-ellipsis-text-wrapper .tm-ellipsis-last-line .tm-ellipsis-text-part[data-v-16643222]{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:break-all}.tm-ellipsis-text .tm-ellipsis-text-wrapper .tm-ellipsis-last-line .tm-ellipsis-toolbar-part[data-v-16643222]{flex-shrink:0;margin-left:4px;display:flex;align-items:center;line-height:inherit;font-size:inherit}.tm-ellipsis-measure[data-v-16643222]{position:absolute;left:-9999px;top:-9999px;visibility:hidden;pointer-events:none;z-index:-1}
|
package/dist/vue3/tm-table.es.js
CHANGED
|
@@ -1792,7 +1792,7 @@ const ge = /* @__PURE__ */ V(At, [["render", Rt], ["__scopeId", "data-v-9e7a342f
|
|
|
1792
1792
|
},
|
|
1793
1793
|
hasDefaultSlot() {
|
|
1794
1794
|
const e = this.$slots.default;
|
|
1795
|
-
return e ? this.isVue2 ? !!e : e()[0].children.length > 0 : !1;
|
|
1795
|
+
return e ? this.isVue2 ? Array.isArray(e) ? e.some((l) => !l.data || !l.data.slot) : !!e : e()[0].children.length > 0 : !1;
|
|
1796
1796
|
},
|
|
1797
1797
|
handleUpdate(e, l, t) {
|
|
1798
1798
|
const a = this.getFieldValue(e, t);
|
|
@@ -2054,7 +2054,7 @@ function Jt(e, l, t, a, i, s) {
|
|
|
2054
2054
|
])
|
|
2055
2055
|
], 2);
|
|
2056
2056
|
}
|
|
2057
|
-
const be = /* @__PURE__ */ V(Nt, [["render", Jt], ["__scopeId", "data-v-
|
|
2057
|
+
const be = /* @__PURE__ */ V(Nt, [["render", Jt], ["__scopeId", "data-v-54d5e2a2"]]), Kt = !1, Qt = {
|
|
2058
2058
|
name: "TablePagination",
|
|
2059
2059
|
props: {
|
|
2060
2060
|
current: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(u,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("sortablejs")):typeof define=="function"&&define.amd?define(["exports","vue","sortablejs"],e):(u=typeof globalThis!="undefined"?globalThis:u||self,e(u.TmTable={},u.Vue,u.Sortable))})(this,function(u,e,g){"use strict";var Tl=Object.defineProperty,wl=Object.defineProperties;var zl=Object.getOwnPropertyDescriptors;var R=Object.getOwnPropertySymbols;var se=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable;var ie=(u,e,g)=>e in u?Tl(u,e,{enumerable:!0,configurable:!0,writable:!0,value:g}):u[e]=g,b=(u,e)=>{for(var g in e||(e={}))se.call(e,g)&&ie(u,g,e[g]);if(R)for(var g of R(e))ne.call(e,g)&&ie(u,g,e[g]);return u},F=(u,e)=>wl(u,zl(e));var oe=(u,e)=>{var g={};for(var _ in u)se.call(u,_)&&e.indexOf(_)<0&&(g[_]=u[_]);if(u!=null&&R)for(var _ of R(u))e.indexOf(_)<0&&ne.call(u,_)&&(g[_]=u[_]);return g};const _={mini:"small",small:"small",default:"default",large:"large"},D=t=>_[t]||_.default,T=()=>"default",ae={"zh-CN":{today:"今天",yesterday:"昨天",last7days:"最近7天",last30days:"最近30天",thisMonth:"本月",lastMonth:"上月",checkAll:"全选",search:"搜索",query:"查询",reset:"重置",columnSetting:"列设置",refresh:"刷新",cancel:"取消",fixedLeft:"固定在左侧",fixedRight:"固定在右侧",top:"置顶",restoreDefault:"恢复默认",saveAndApply:"保存并应用",startDate:"开始日期",endDate:"结束日期",all:"全选",SelectableFields:"可选择字段",fixedColumns:"固定列",leftmost:"左侧最多",rightmost:"右侧最多",items:"项",accurateSearchTips:"每行一个,支持多个值",accurateSearchPlaceholder:"精确搜索,一行一项",selectPlaceholder:"请选择",clear:"清空",saveSuccess:"保存成功",cancelRightFixed:"取消右侧固定",rightFixed:"固定到右侧",cancelLeftFixed:"取消左侧固定",leftFixed:"固定到左侧",cancelTop:"取消置顶",copySuccess:"复制成功",copyFailed:"复制失败"},"en-US":{today:"Today",yesterday:"Yesterday",last7days:"Last 7 days",last30days:"Last 30 days",thisMonth:"This month",lastMonth:"Last month",checkAll:"Check all",search:"Search",query:"Search",reset:"Reset",columnSetting:"Column Setting",refresh:"Refresh",cancel:"Cancel",fixedLeft:"Fixed left",fixedRight:"Fixed right",top:"Top",restoreDefault:"Restore default",saveAndApply:"Save and apply",startDate:"Start date",endDate:"End date",all:"All",SelectableFields:"Fields",fixedColumns:"Fixed columns",leftmost:"Leftmost",rightmost:"Rightmost",items:"item(s)",accurateSearchTips:"One per line, supporting multiple values",accurateSearchPlaceholder:"Accurate search, one per line",selectPlaceholder:"Please select",clear:"Clear",saveSuccess:"Successfully saved",cancelRightFixed:"Cancel right fixed",rightFixed:"Fixed to right",cancelLeftFixed:"Cancel left fixed",leftFixed:"Fixed to left",cancelTop:"Cancel top",copySuccess:"Copy successfully",copyFailed:"Copy failed"}};let N={value:"zh-CN"};N=e.ref("zh-CN");const re=t=>{var i;return((i=ae[N.value])==null?void 0:i[t])||t},M=t=>{N.value=t},w=()=>({t:re,setLang:M,currentLang:N}),y=(t,i)=>{const l=t.__vccOpts||t;for(const[o,s]of i)l[o]=s;return l},ce=!1,de=!0,P="modelValue",he="update:modelValue",ue={name:"TmSelectFilter",props:{[P]:{type:[String,Number,Array],default:""},field:{type:[String,Number],default:""},options:{type:[Array,Function],default:()=>[]},labelOptions:{type:Array,default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value"})},filterable:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},showCheckAll:{type:Boolean,default:!0},placeholder:{type:String,default:""}},data(){return{t:w().t,isVue2:ce,isVue3:de,getDefaultSize:T,optionsList:[],loading:!1,indeterminate:!1,checkAll:!1,activedSelect:""}},computed:{computedValue:{get(){return this[P]},set(t){this.$emit(he,t),this.$emit("change",t)}},fieldValue:{get(){return this.field},set(t){this.$emit("field-change",t)}},propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}}},watch:{[P](t){!this.multiple||!this.showCheckAll||(t.length===0?(this.checkAll=!1,this.indeterminate=!1):t.length===this.optionsList.length?(this.checkAll=!0,this.indeterminate=!1):this.indeterminate=!0)}},created(){this.initOptions()},methods:{async initOptions(){if(Array.isArray(this.options))this.optionsList=this.options;else if(typeof this.options=="function")try{this.loading=!0;const t=await this.options();Array.isArray(t)&&(this.optionsList=t)}catch(t){console.error(t)}finally{this.loading=!1}},handleCheckAll(t){this.indeterminate=!1;let i=[];t&&(i=this.optionsList.map(l=>l[this.propMap.value])),this.computedValue=i},setActivedSelect(t){this.activedSelect=t}}},me={key:0,class:"check-all-option"};function pe(t,i,l,o,s,n){const a=e.resolveComponent("el-option"),d=e.resolveComponent("el-select"),c=e.resolveComponent("el-checkbox");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["advanced-select",{hasField:l.labelOptions&&l.labelOptions.length>0}])},[l.labelOptions&&l.labelOptions.length>0?(e.openBlock(),e.createBlock(d,{key:0,size:s.getDefaultSize(),class:e.normalizeClass(["field-select",`field-select--${s.isVue2?"v2":"v3"}`]),modelValue:n.fieldValue,"onUpdate:modelValue":i[0]||(i[0]=h=>n.fieldValue=h),onFocus:i[1]||(i[1]=h=>n.setActivedSelect("left")),style:e.normalizeStyle(`z-index:${s.activedSelect==="left"?2:0}`)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.labelOptions,h=>(e.openBlock(),e.createBlock(a,{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:1},8,["size","class","modelValue","style"])):e.createCommentVNode("",!0),e.createVNode(d,e.mergeProps({ref:"select",class:["select",`select--${s.isVue3?"v3":"v2"}`],onFocus:i[4]||(i[4]=h=>n.setActivedSelect("right")),style:`z-index:${s.activedSelect==="right"?2:0}`,modelValue:n.computedValue,"onUpdate:modelValue":i[5]||(i[5]=h=>n.computedValue=h)},F(b({},t.$attrs),{size:s.getDefaultSize(),filterable:l.filterable,clearable:l.clearable,collapseTags:l.collapseTags,multiple:l.multiple,placeholder:l.placeholder,loading:s.loading}),e.toHandlers(s.isVue2?t.$listeners:{}),{loading:s.loading}),{header:e.withCtx(()=>[s.isVue3&&l.multiple&&l.showCheckAll?(e.openBlock(),e.createBlock(c,{key:0,modelValue:s.checkAll,"onUpdate:modelValue":i[3]||(i[3]=h=>s.checkAll=h),indeterminate:s.indeterminate,size:s.getDefaultSize(),onChange:n.handleCheckAll,style:{width:"100%",height:"20px","padding-left":"10px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("all")),1)]),_:1},8,["modelValue","indeterminate","size","onChange"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[s.isVue2&&l.multiple&&l.showCheckAll?(e.openBlock(),e.createElementBlock("div",me,[e.createVNode(c,{style:{width:"100%"},modelValue:s.checkAll,"onUpdate:modelValue":i[2]||(i[2]=h=>s.checkAll=h),indeterminate:s.indeterminate,size:s.getDefaultSize(),onChange:n.handleCheckAll},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("all")),1)]),_:1},8,["modelValue","indeterminate","size","onChange"])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.optionsList,h=>(e.openBlock(),e.createBlock(a,{key:h[n.propMap.value],label:h[n.propMap.label],value:h[n.propMap.value],disabled:h.disabled},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"option",{item:h},()=>[e.createTextVNode(e.toDisplayString(h[n.propMap.label]),1)],!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:3},16,["class","style","modelValue","loading"])],2)}const I=y(ue,[["render",pe],["__scopeId","data-v-467dcdd3"]]),fe={name:"BaseIcon",props:{path:{type:String},size:{type:[String,Number]},color:{type:String}},methods:{handleClick(){}}},ge=["width","height"],be=["d"];function ye(t,i,l,o,s,n){return e.openBlock(),e.createElementBlock("i",{class:"tm-icon",onClick:i[0]||(i[0]=(...a)=>n.handleClick&&n.handleClick(...a))},[(e.openBlock(),e.createElementBlock("svg",{width:l.size,height:l.size,style:e.normalizeStyle({color:l.color}),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:l.path},null,8,be)],12,ge))])}const Ce=y(fe,[["render",ye],["__scopeId","data-v-1c30ca93"]]),S=Object.entries({menu:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z",more:"M76.92892277 192.94787572h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758118s-23.20379058-46.40758118-46.40758118-46.40758116H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758116s23.20379058 46.40758118 46.40758264 46.40758118zM941.27013031 465.59241882H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758118s23.20379058 46.40758118 46.40758264 46.40758118h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758118s-23.20379058-46.40758118-46.40758118-46.40758118zM941.27013031 825.25117589H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758118s23.20379058 46.40758118 46.40758264 46.40758264h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758264s-23.20379058-46.40758118-46.40758118-46.40758118z",refresh:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z",move:"M238.93333333 102.4a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0zM238.93333333 375.46666667a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m-409.6 273.06666666a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m-341.33333333 204.8a68.26666667 68.26666667 0 1 0 0 136.53333334 68.26666667 68.26666667 0 0 0 0-136.53333334z m341.33333333 68.26666667a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z","column-setting":"M436.05333334 18.36373333a109.22666667 109.22666667 0 0 1 109.22666666 0l345.56586667 199.54346667c33.792 19.52426667 54.61333333 55.56906667 54.61333333 94.54933333V580.26666667h-81.92V312.45653333a27.30666667 27.30666667 0 0 0-13.65333333-23.62026666L504.32 89.2928a27.30666667 27.30666667 0 0 0-27.30666666 0L131.44746667 288.83626667a27.30666667 27.30666667 0 0 0-13.65333333 23.62026666v399.08693334a27.30666667 27.30666667 0 0 0 13.65333333 23.62026666L477.01333334 934.7072a27.30666667 27.30666667 0 0 0 27.30666666 0l54.61333334-31.5392v94.54933333l-13.65333334 7.91893334a109.22666667 109.22666667 0 0 1-109.22666666 0l-345.56586667-199.54346667a109.22666667 109.22666667 0 0 1-54.61333333-94.54933333V312.45653333c0-38.98026667 20.82133333-75.09333333 54.61333333-94.54933333L436.05333334 18.36373333z","fixed-left":"M843.36363653 311.54545478l-53.18181827 1e-8-20.45454521 28.63636347-163.63636435 204.54545479-24.54545391 28.63636347 12.27272695 36.81818175c8.18181826 28.63636347 12.27272695 57.27272695 12.27272696 85.90909042 0 32.72727305-4.09090869 61.36363652-16.36363565 90-4.09090869 16.36363653-12.27272695 32.72727306-24.54545479 49.09090957l-163.63636347-163.63636347-40.90909131-40.90909132-12.27272695-12.27272695-163.63636348-163.63636347c28.63636347-16.36363653 61.36363652-28.63636347 94.09090869-32.72727305 45-8.18181826 90-4.09090869 134.99999999 8.18181826l36.81818175 12.27272695 28.63636347-24.54545391 204.54545479-163.63636435 28.63636347-16.36363564 0-32.72727305L712.45454521 184.72727305l130.90909132 126.81818173zM941.54545479 327.90909131c0-8.18181826-4.09090869-16.36363653-8.18181826-24.54545478L720.63636348 94.72727305c-12.27272695-16.36363653-36.81818174-12.27272695-49.09090869 4.0909087-20.45454521 28.63636347-28.63636347 65.45454521-28.63636348 98.18181825l0 4.09090869-204.54545478 163.63636436c-110.45454521-36.81818174-233.18181826-16.36363653-327.27272784 61.36363564-8.18181826 8.18181826-12.27272695 16.36363653-12.27272694 24.54545478 0 8.18181826 4.09090869 16.36363653 8.18181825 24.5454548l196.36363653 196.36363652-212.72727305 212.72727216c-4.09090869 4.09090869-8.18181826 12.27272695-8.18181826 20.4545461s4.09090869 16.36363653 8.18181826 20.4545452c12.27272695 12.27272695 32.72727306 12.27272695 45 1e-8L352.45454522 716.54545479l196.36363652 196.36363652c12.27272695 12.27272695 36.81818174 12.27272695 49.09090957-4.09090957C651.09090869 847.45454521 675.63636347 773.81818174 675.63636346 696.09090869c0-36.81818173-4.09090869-73.63636348-16.36363651-106.36363564l163.63636436-204.54545479c36.81818173 0 73.63636348-8.18181826 106.36363564-28.63636347C937.45454519 348.36363653 941.54545478 336.09090869 941.54545479 327.90909131z","fixed-right":"M311.54545479 180.63636347v53.18181827l28.63636347 20.45454521 204.54545479 163.63636436 28.63636347 24.5454539 36.81818174-12.27272695c28.63636347-8.18181826 57.27272695-12.27272695 85.90909043-12.27272695 32.72727305 0 61.36363652 4.09090869 90 16.36363564 16.36363653 4.09090869 32.72727305 12.27272695 49.09090957 24.54545479l-163.63636347 163.63636347-40.90909132 40.90909131-12.27272695 12.27272695-163.63636347 163.63636348c-16.36363653-28.63636347-28.63636347-61.36363652-32.72727305-94.09090869-8.18181826-45-4.09090869-90 8.18181826-135l12.27272695-36.81818174-24.5454539-28.63636347-163.63636436-204.54545479-16.36363564-28.63636347h-32.72727305H184.72727305l126.81818174-130.90909132zM327.90909131 82.45454521c-8.18181826 0-16.36363653 4.09090869-24.54545478 8.18181826L94.72727305 303.36363652c-16.36363653 12.27272695-12.27272695 36.81818174 4.09090869 49.09090869 28.63636347 20.45454521 65.45454521 28.63636347 98.18181826 28.63636348h4.09090869l163.63636436 204.54545478c-36.81818174 110.45454521-16.36363653 233.18181826 61.36363564 327.27272784 8.18181826 8.18181826 16.36363653 12.27272695 24.54545478 12.27272695 8.18181826 0 16.36363653-4.09090869 24.54545479-8.18181826l196.36363653-196.36363653 212.72727216 212.72727305c4.09090869 4.09090869 12.27272695 8.18181826 20.4545461 8.18181827s16.36363653-4.09090869 20.45454521-8.18181827c12.27272695-12.27272695 12.27272695-32.72727305 0-45L716.54545479 671.54545479l196.36363652-196.36363653c12.27272695-12.27272695 12.27272695-36.81818174-4.09090957-49.09090957C847.45454521 372.90909131 773.81818174 348.36363653 696.09090869 348.36363653c-36.81818174 0-73.63636348 4.09090869-106.36363564 16.36363652l-204.54545479-163.63636436c0-36.81818174-8.18181826-73.63636348-28.63636347-106.36363564C348.36363653 86.54545479 336.09090869 82.45454521 327.90909131 82.45454521z",upload:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248z",download:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z",delete:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32",copy:"M128 320v576h576V320zm-32-64h640a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V288a32 32 0 0 1 32-32M960 96v704a32 32 0 0 1-32 32h-96v-64h64V128H384v64h-64V96a32 32 0 0 1 32-32h576a32 32 0 0 1 32 32M256 672h320v64H256zm0-192h320v64H256z"}).reduce((t,[i,l])=>{const o=`${i}Icon`,s={name:o,props:{path:{type:String,default:l},size:{type:[String,Number]},color:{type:String}},render(n){return e.h(Ce,this.$props)}};return s.install=n=>{n.component(o,s)},t[i]=s,t},{}),ke=S.menu,Ve=S.refresh,xe=S.move;S["column-setting"];const _e=S.more,Se=S["fixed-left"],Te=S["fixed-right"],we=S.upload,ze=S.download,Fe=S.delete,te=S.copy,{t:v}=w(),Be=!1,Le=!0,Ee={name:"TmEllipsisText",components:{CopyIcon:te},props:{text:{type:String,required:!0},width:{type:[String,Number],default:"auto"},maxWidth:{type:[String,Number],default:"100%"},lines:{type:Number,default:1},showTooltip:{type:Boolean,default:!0},lineHeight:{type:[String,Number]},copyable:{type:Boolean,default:!1}},data(){return{isVue2:Be,isVue3:Le,isOverflow:!1,currentLines:1,resizeObserver:null}},computed:{tooltipDisabled(){return!this.showTooltip||!this.isOverflow},textStyle(){const t=typeof this.width=="number"?`${this.width}px`:this.width,i=typeof this.maxWidth=="number"?`${this.maxWidth}px`:this.maxWidth;return{width:t,maxWidth:i,lineHeight:this.lineHeight,display:"-webkit-inline-box",overflow:"hidden",WebkitBoxOrient:"vertical",WebkitLineClamp:this.lines}}},mounted(){this.checkOverflow(),this.setupResizeObserver()},beforeDestroy(){this.cleanupResizeObserver()},beforeUnmount(){this.cleanupResizeObserver()},watch:{text(){this.$nextTick(this.checkOverflow)}},methods:{checkOverflow(){this.$refs.textEl&&this.$nextTick(()=>{this.$nextTick(()=>{this.performOverflowCheck()})})},performOverflowCheck(){var h;const t=this.$refs.textEl;if(!t)return;const i=getComputedStyle(t);if(!i.width||i.width==="0px"){this.$nextTick(()=>{this.performOverflowCheck()});return}const l=t.scrollHeight,o=t.scrollWidth,s=t.clientHeight,n=t.clientWidth,a=1,d=l>s+a,c=o>n+a;if(d||c){this.isOverflow=!0;const p=parseFloat(i.lineHeight)||16;this.currentLines=Math.ceil(l/p)}else{const p=t.getBoundingClientRect(),V=(h=t.parentElement)==null?void 0:h.getBoundingClientRect();if(V){const x=p.height>V.height||p.width>V.width;this.isOverflow=x}else this.isOverflow=!1;this.currentLines=1}},setupResizeObserver(){window.ResizeObserver&&this.$nextTick(()=>{try{this.resizeObserver=new ResizeObserver(()=>{this.checkOverflow()});const t=this.$el;t&&t instanceof Element&&this.resizeObserver.observe(t)}catch(t){console.warn("Failed to setup ResizeObserver:",t)}})},cleanupResizeObserver(){if(this.resizeObserver)try{this.resizeObserver.disconnect()}catch(t){console.warn("Failed to disconnect ResizeObserver:",t)}finally{this.resizeObserver=null}},handleCopy(){navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(this.text).then(()=>{this.$message.success(v("copySuccess"))}).catch(()=>{this.fallbackCopy()}):this.fallbackCopy()},fallbackCopy(){const t=document.createElement("textarea");t.value=this.text,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),this.$message.success(v("copySuccess"))}catch(i){this.$message.error(v("copyFailed"))}document.body.removeChild(t)}}},De={class:"ellipsis-text-container"};function Oe(t,i,l,o,s,n){const a=e.resolveComponent("CopyIcon"),d=e.resolveComponent("el-tooltip");return e.openBlock(),e.createBlock(d,e.mergeProps({disabled:n.tooltipDisabled,content:l.text,effect:"dark",placement:"top"},{[s.isVue2?"open-delay":"show-after"]:300}),{default:e.withCtx(()=>[e.createElementVNode("div",De,[e.createElementVNode("div",{ref:"textEl",class:"ellipsis-text",style:e.normalizeStyle(n.textStyle)},e.toDisplayString(l.text),5),e.createElementVNode("div",{class:e.normalizeClass(["toolbar",{multiline:s.currentLines>1&&l.lines>1}])},[l.copyable?(e.openBlock(),e.createBlock(a,{key:0,class:"icon-item",onClick:n.handleCopy},null,8,["onClick"])):e.createCommentVNode("",!0)],2)])]),_:1},16,["disabled","content"])}const B=y(Ee,[["render",Oe],["__scopeId","data-v-0979131f"]]),Ne=!1,Me=!0,He={name:"TmAdvancedInputFilter",components:{MoreIcon:_e,EllipsisText:B},props:{label:{type:String,default:""},value:{type:String,default:""},field:{type:[String,Number],default:""},placeholder:{type:String,default:""},multiple:{type:Boolean,default:!1},labelOptions:{type:Array,default:()=>[]}},data(){return{t:w().t,isVue3:Me,isVue2:Ne,getDefaultSize:T,getCompatSize:D,exactValue:"",inputValue:"",isExactMode:!1,currentOptionMultiple:!1}},computed:{width(){return this.labelOptions&&this.labelOptions.length||this.label?"305px":"200px"},fieldValue:{get(){return this.field},set(t){this.$emit("field-change",t)}},shouldShowMultiple(){return this.currentOptionMultiple!==null?this.currentOptionMultiple:this.multiple},selectedOption(){return!this.labelOptions||!this.labelOptions.length||!this.field?null:this.labelOptions.find(t=>t.value===this.field)}},watch:{labelOptions:{handler(t){t&&t.length>0&&(this.field||this.$emit("field-change",t[0].value),this.updateCurrentOptionMultiple())},deep:!0,immediate:!0},field:{handler(){this.updateCurrentOptionMultiple()},immediate:!0},isExactMode(t){t?this.$emit("value-change",this.exactValue):this.$emit("value-change",this.inputValue)},exactValue(t){this.$emit("value-change",t)},inputValue(t){this.$emit("value-change",t)},value:{handler(t){this.isExactMode?this.exactValue=t:this.inputValue=t},immediate:!0}},methods:{handlePopoverClose(){document.activeElement&&document.activeElement.blur(),this.isExactMode=!1},handleVisibleChange(t){this.isExactMode=t},handlefieldChange(t){this.$emit("field-change",t),this.updateCurrentOptionMultiple()},updateCurrentOptionMultiple(){const t=this.selectedOption;t&&"multiple"in t?this.currentOptionMultiple=t.multiple:this.currentOptionMultiple=this.multiple},handleExactSearch(){this.$emit("value-change",this.exactValue),this.$emit("search",this.exactValue)},handleClear(){this.exactValue="",this.$emit("value-change","")},handleEnter(){this.$emit("search")}},created(){this.updateCurrentOptionMultiple()}},Ae={key:1,class:"input-label"},Re={class:"popover-content"},Pe={class:"popover-subtitle"},Ie={class:"popover-footer"};function ve(t,i,l,o,s,n){const a=e.resolveComponent("el-option"),d=e.resolveComponent("el-select"),c=e.resolveComponent("EllipsisText"),h=e.resolveComponent("el-input"),p=e.resolveComponent("el-button"),V=e.resolveComponent("MoreIcon"),x=e.resolveComponent("el-popover");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tm-advanced-input",`tm-advanced-input--${s.isVue3?"v3":"v2"}`]),style:e.normalizeStyle({width:n.width})},[l.labelOptions&&l.labelOptions.length?(e.openBlock(),e.createBlock(d,{key:0,modelValue:n.fieldValue,"onUpdate:modelValue":i[0]||(i[0]=k=>n.fieldValue=k),placeholder:s.t("selectPlaceholder"),style:{width:"100px","flex-shrink":"0"},size:s.getDefaultSize(),class:"left-select",onChange:n.handlefieldChange},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.labelOptions,k=>(e.openBlock(),e.createBlock(a,{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","size","onChange"])):l.label?(e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(c,{text:l.label,lines:2},null,8,["text"])])):e.createCommentVNode("",!0),e.createVNode(h,{modelValue:s.inputValue,"onUpdate:modelValue":i[2]||(i[2]=k=>s.inputValue=k),size:s.getDefaultSize(),placeholder:l.placeholder,onKeyup:e.withKeys(n.handleEnter,["enter","native"]),clearable:"",class:e.normalizeClass(["right-input",{"has-label":l.labelOptions&&l.labelOptions.length}])},{default:e.withCtx(()=>[n.shouldShowMultiple?(e.openBlock(),e.createBlock(x,e.mergeProps({key:0,slot:"append"},{[s.isVue3?"visible":"value"]:s.isExactMode,placement:"bottom-end",width:260,trigger:"click"},e.toHandlers({[s.isVue3?"update:visible":"input"]:n.handleVisibleChange})),{reference:e.withCtx(()=>[e.createVNode(V,{style:{cursor:"pointer"}})]),default:e.withCtx(()=>[e.createElementVNode("div",Re,[e.createElementVNode("p",Pe,e.toDisplayString(s.t("accurateSearchTips")),1),e.createVNode(h,{size:s.getDefaultSize(),type:"textarea",rows:8,modelValue:s.exactValue,"onUpdate:modelValue":i[1]||(i[1]=k=>s.exactValue=k),placeholder:s.t("accurateSearchPlaceholder"),style:{"font-size":"12px"}},null,8,["size","modelValue","placeholder"]),e.createElementVNode("div",Ie,[e.createVNode(p,{style:{float:"left"},size:s.getCompatSize("mini"),onClick:n.handleClear},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("clear")),1)]),_:1},8,["size","onClick"]),e.createVNode(p,{size:s.getCompatSize("mini"),onClick:n.handlePopoverClose},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("cancel")),1)]),_:1},8,["size","onClick"]),e.createVNode(p,{type:"primary",size:s.getCompatSize("mini"),onClick:n.handleExactSearch},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("search")),1)]),_:1},8,["size","onClick"])])])]),_:1},16)):e.createCommentVNode("",!0)]),_:1},8,["modelValue","size","placeholder","onKeyup","class"])],6)}const W=y(He,[["render",ve],["__scopeId","data-v-6b474dac"]]),{t:C}=w(),We=!1,Ue=!0,je="modelValue",Je={name:"TmAdvancedDateFilter",components:{EllipsisText:B},props:{value:{type:[Array,String,Date],default:()=>null},field:{type:[String,Number],default:""},start:{type:[String,Number],default:""},end:{type:[String,Number],default:""},size:{type:String,default:"mini"},labelOptions:{type:Array,default:()=>[]},label:{type:String,default:""},type:{type:String,default:"daterange",validator:t=>["date","daterange","datetime","datetimerange","year","month","dates","months","years","week","monthrange"].includes(t)},format:{type:String,default:""},startPlaceholder:{type:String,default:void 0},endPlaceholder:{type:String,default:void 0},placeholder:{type:String,default:void 0},rangeSeparator:{type:String,default:"-"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},align:{type:String,default:"left"},popperClass:{type:String,default:""},defaultValue:{type:[Date,Array],default:null},defaultTime:{type:[Date,String,Array],default:null},shortcuts:{type:Array,default:()=>[]},pastOnly:{type:Boolean,default:!1}},computed:{isRangeType(){return["daterange","datetimerange","monthrange"].includes(this.type)},computedStartPlaceholder(){if(this.isRangeType)return this.startPlaceholder!==void 0?this.startPlaceholder:C("startDate")},computedEndPlaceholder(){if(this.isRangeType)return this.endPlaceholder!==void 0?this.endPlaceholder:C("endDate")},computedDatePickerStyle(){const t=this.labelOptions&&this.labelOptions.length>0,i=this.label&&!this.isRangeType&&(!this.labelOptions||this.labelOptions.length===0);return t?"width: 206px":i?"width: 200px":"width: 306px"},computedFormat(){const t="YYYY";return this.format?this.format:this.type==="year"?t:this.type==="month"?`${t}-MM`:this.type==="date"?`${t}-MM-DD`:this.type==="dates"?`${t}-MM-DD`:this.type==="months"?`${t}-MM`:this.type==="years"?t:this.type==="week"?`${t}-MM-WW`:this.type==="datetime"?`${t}-MM-DD HH:mm:ss`:this.type==="datetimerange"?`${t}-MM-DD HH:mm:ss`:this.type==="daterange"?`${t}-MM-DD`:this.type==="monthrange"?`${t}-MM`:""},computedPickerOptions(){const t={};if(this.pastOnly&&(t.disabledDate=i=>i.getTime()>Date.now()),["daterange","datetimerange"].includes(this.type)){const i=this.type==="datetimerange";t.shortcuts=this.shortcuts.length>0?this.shortcuts:[{text:C("today"),onClick(l){const o=new Date,s=new Date;i&&(s.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[s,o])}},{text:C("yesterday"),onClick(l){const o=new Date,s=new Date;s.setTime(s.getTime()-3600*1e3*24),o.setTime(o.getTime()-3600*1e3*24),i&&(s.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[s,o])}},{text:C("last7days"),onClick(l){const o=new Date,s=new Date;s.setTime(s.getTime()-3600*1e3*24*7),i&&(s.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[s,o])}},{text:C("last30days"),onClick(l){const o=new Date,s=new Date;s.setTime(s.getTime()-3600*1e3*24*30),i&&(s.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[s,o])}},{text:C("thisMonth"),onClick(l){const o=new Date,s=new Date;s.setDate(1),i&&(s.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[s,o])}},{text:C("lastMonth"),onClick(l){const o=new Date,s=new Date;s.setMonth(s.getMonth()-1),s.setDate(1),o.setDate(0),i&&(s.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[s,o])}}]}return t},computedShortcuts(){if(!["daterange","datetimerange"].includes(this.type))return[];if(this.shortcuts&&this.shortcuts.length>0)return this.shortcuts;const t=this.type==="datetimerange";return[{text:C("today"),value:()=>{const i=new Date,l=new Date;return t&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("yesterday"),value:()=>{const i=new Date,l=new Date;return l.setTime(l.getTime()-3600*1e3*24),i.setTime(i.getTime()-3600*1e3*24),t&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("last7days"),value:()=>{const i=new Date,l=new Date;return l.setTime(l.getTime()-3600*1e3*24*7),t&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("last30days"),value:()=>{const i=new Date,l=new Date;return l.setTime(l.getTime()-3600*1e3*24*30),t&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("thisMonth"),value:()=>{const i=new Date,l=new Date;return l.setDate(1),t&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("lastMonth"),value:()=>{const i=new Date,l=new Date;return l.setMonth(l.getMonth()-1),l.setDate(1),i.setDate(0),t&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}}]},computedDisabledDate(){return this.pastOnly?t=>t.getTime()>Date.now():null},computedDefaultTime(){let t=this.defaultTime;if(this.type==="datetimerange"&&!this.defaultTime&&(t=["00:00:00","23:59:59"]),this.isVue2)return t;if(t){if(this.type==="datetimerange"&&Array.isArray(t))return t.map(i=>{if(typeof i=="string"){const l=new Date,[o,s,n]=i.split(":").map(Number);return new Date(l.getFullYear(),l.getMonth(),l.getDate(),o,s,n||0)}return i});if(this.type==="datetime"&&typeof t=="string"){const i=new Date,[l,o,s]=t.split(":").map(Number);return new Date(i.getFullYear(),i.getMonth(),i.getDate(),l,o,s||0)}return t}},dateValue(){return this.isRangeType?this.start||this.end?[this.start,this.end]:this.value:this.value},fieldValue:{get(){return this.field},set(t){this.$emit("field-change",t)}}},data(){return{t:C,isVue2:We,isVue3:Ue,getDefaultSize:T,valueField:je}},methods:{handleDateChange(t){this.isRangeType?(this.$emit("value-change",t),t&&Array.isArray(t)&&t.length===2?(this.$emit("start-change",t),this.$emit("end-change",t)):(this.$emit("start-change",[]),this.$emit("end-change",[]))):this.$emit("value-change",t)},handleBlur(t){this.$emit("blur",t)},handleFocus(t){this.$emit("focus",t)}},watch:{labelOptions:{handler(t){t&&t.length>0&&!this.field&&this.$emit("field-change",t[0].value)},deep:!0,immediate:!0}}},Ke={key:1,class:"date-label"};function Qe(t,i,l,o,s,n){const a=e.resolveComponent("el-option"),d=e.resolveComponent("el-select"),c=e.resolveComponent("EllipsisText"),h=e.resolveComponent("el-date-picker");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tm-date-picker",[`tm-date-picker--${s.isVue3?"v3":"v2"}`,{"has-select":l.labelOptions&&l.labelOptions.length>0,"has-label":l.label&&!n.isRangeType&&(!l.labelOptions||l.labelOptions.length===0)}]])},[l.labelOptions&&l.labelOptions.length>0?(e.openBlock(),e.createBlock(d,{key:0,modelValue:n.fieldValue,"onUpdate:modelValue":i[0]||(i[0]=p=>n.fieldValue=p),size:s.getDefaultSize(),style:{width:"100px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.labelOptions,p=>(e.openBlock(),e.createBlock(a,{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","size"])):l.label?(e.openBlock(),e.createElementBlock("div",Ke,[e.createVNode(c,{text:l.label,lines:2},null,8,["text"])])):e.createCommentVNode("",!0),s.isVue2?(e.openBlock(),e.createBlock(h,{key:2,value:n.dateValue,type:l.type,size:s.getDefaultSize(),"range-separator":l.rangeSeparator,"start-placeholder":n.computedStartPlaceholder,"end-placeholder":n.computedEndPlaceholder,placeholder:l.placeholder,"picker-options":n.computedPickerOptions,style:e.normalizeStyle(n.computedDatePickerStyle),format:n.computedFormat,"value-format":n.computedFormat,disabled:l.disabled,clearable:l.clearable,readonly:l.readonly,editable:l.editable,align:l.align,"popper-class":l.popperClass,"default-value":l.defaultValue,"default-time":n.computedDefaultTime,onInput:n.handleDateChange,onChange:n.handleDateChange,onBlur:n.handleBlur,onFocus:n.handleFocus},null,8,["value","type","size","range-separator","start-placeholder","end-placeholder","placeholder","picker-options","style","format","value-format","disabled","clearable","readonly","editable","align","popper-class","default-value","default-time","onInput","onChange","onBlur","onFocus"])):(e.openBlock(),e.createBlock(h,{key:3,"model-value":n.dateValue,type:l.type,size:s.getDefaultSize(),"range-separator":l.rangeSeparator,"start-placeholder":n.computedStartPlaceholder,"end-placeholder":n.computedEndPlaceholder,placeholder:l.placeholder,shortcuts:n.computedShortcuts,"disabled-date":n.computedDisabledDate,style:e.normalizeStyle(n.computedDatePickerStyle),format:n.computedFormat,"value-format":n.computedFormat,disabled:l.disabled,clearable:l.clearable,readonly:l.readonly,editable:l.editable,teleported:!1,"popper-class":l.popperClass,"default-value":l.defaultValue,"default-time":n.computedDefaultTime,"onUpdate:modelValue":n.handleDateChange,onChange:n.handleDateChange,onBlur:n.handleBlur,onFocus:n.handleFocus},null,8,["model-value","type","size","range-separator","start-placeholder","end-placeholder","placeholder","shortcuts","disabled-date","style","format","value-format","disabled","clearable","readonly","editable","popper-class","default-value","default-time","onUpdate:modelValue","onChange","onBlur","onFocus"]))],2)}const U=y(Je,[["render",Qe],["__scopeId","data-v-7d46d46b"]]),qe=!1,Ye={name:"TmCascaderFilter",props:{value:{type:[String,Number,Array],default:""},options:{type:[Array,Function],default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value",children:"children",expandTrigger:"hover"})},filterable:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!0},collapseTagsTooltip:{type:Boolean,default:!0},placeholder:{type:String,default:""}},data(){return{isVue2:qe,getDefaultSize:T,selectedValue:this.value,optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value",children:this.props.children||"children"}},cascaderProps(){return F(b({},this.props),{expandTrigger:this.props.expandTrigger||"hover"})}},watch:{value:{immediate:!0,handler(t){this.selectedValue=t}},options:{immediate:!0,handler(t){this.initOptions(t)}},selectedValue(t){this.$emit("input",t),this.$emit("change",t)}},methods:{async initOptions(t){if(typeof t=="function")try{this.loading=!0;const i=await t();Array.isArray(i)&&(this.optionsList=i)}catch(i){console.error(i)}finally{this.loading=!1}else Array.isArray(t)&&(this.optionsList=t)}}};function Ge(t,i,l,o,s,n){const a=e.resolveComponent("el-cascader");return e.openBlock(),e.createBlock(a,e.mergeProps({ref:"cascader",class:["tm-cascader",`tm-cascader--${s.isVue2?"v2":"v3"}`],modelValue:s.selectedValue,"onUpdate:modelValue":i[0]||(i[0]=d=>s.selectedValue=d),style:{width:"200px"}},F(b({},t.$attrs),{size:s.getDefaultSize(),filterable:l.filterable,clearable:l.clearable,collapseTags:l.collapseTags,collapseTagsTooltip:l.collapseTagsTooltip,props:n.cascaderProps,placeholder:l.placeholder,options:s.optionsList,loading:s.loading}),e.toHandlers(s.isVue2?t.$listeners:{})),{default:e.withCtx(({node:d,data:c})=>[e.renderSlot(t.$slots,"default",{node:d,data:c},()=>[e.createElementVNode("span",null,e.toDisplayString(c[n.propMap.label]),1)])]),_:3},16,["class","modelValue"])}const j=y(Ye,[["render",Ge]]),Xe=!1,Ze=!0,$e={name:"TmRadioFilter",props:{value:{type:[String,Number],default:""},options:{type:[Array,Function],default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value"})},size:{type:String,default:"mini"},width:{type:[String,Number],default:200}},data(){return{isVue2:Xe,isVue3:Ze,getDefaultSize:T,selectedValue:this.value,optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}},hasWideOptions(){return this.optionsList.length>4},calculateItemWidth(){if(!this.optionsList.length)return{};const i=`${(this.hasWideOptions?305:200)/this.optionsList.length}px`;return{width:i,flex:`0 0 ${i}`}}},watch:{value:{immediate:!0,handler(t){this.selectedValue=t}},options:{immediate:!0,handler(t){this.$slots.default||this.initOptions(t)}},selectedValue(t){this.$emit("input",t),this.$emit("change",t)}},methods:{async initOptions(t){if(typeof t=="function")try{this.loading=!0;const i=await t();Array.isArray(i)&&(this.optionsList=i)}catch(i){console.error(i)}finally{this.loading=!1}else Array.isArray(t)&&(this.optionsList=t)}}};function et(t,i,l,o,s,n){const a=e.resolveComponent("el-radio-button"),d=e.resolveComponent("el-radio-group");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tm-radio",{"wide-mode":n.hasWideOptions,"tm-radio--v3":s.isVue3,"tm-radio--v2":s.isVue2}])},[e.createVNode(d,e.mergeProps({ref:"radioGroup",modelValue:s.selectedValue,"onUpdate:modelValue":i[0]||(i[0]=c=>s.selectedValue=c)},F(b({},t.$attrs),{size:s.getDefaultSize()}),e.toHandlers(s.isVue2?t.$listeners:{})),{default:e.withCtx(()=>[t.$slots.default?e.renderSlot(t.$slots,"default",{key:0},void 0,!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(s.optionsList,c=>(e.openBlock(),e.createBlock(a,e.mergeProps({ref_for:!0},{[s.isVue3?"value":"label"]:c[n.propMap.value],disabled:c.disabled,style:n.calculateItemWidth},{key:c[n.propMap.value]}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"option",{item:c},()=>[e.createTextVNode(e.toDisplayString(c[n.propMap.label]),1)],!0)]),_:2},1040))),128))]),_:3},16,["modelValue"])],2)}const J=y($e,[["render",et],["__scopeId","data-v-61fed13d"]]),tt=!1,lt=!0,it={name:"TmCheckboxFilter",props:{value:{type:Array,default:()=>[]},options:{type:[Array,Function],default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value"})},size:{type:String,default:"mini"},width:{type:[String,Number],default:200}},data(){return{isVue2:tt,isVue3:lt,getDefaultSize:T,selectedValue:this.value||[],optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}},hasWideOptions(){return this.optionsList.length>4},calculateItemWidth(){if(!this.optionsList.length)return{};const t=Math.ceil(this.optionsList.length/(this.hasWideOptions?6:4)),i=Math.ceil(this.optionsList.length/t),o=`${(this.hasWideOptions?305:200)/i}px`;return{width:o,flex:`0 0 ${o}`}}},watch:{value:{immediate:!0,handler(t){this.selectedValue=t||[]}},options:{immediate:!0,handler(t){this.$slots.default||this.initOptions(t)}},selectedValue(t){this.$emit("input",t),this.$emit("change",t)}},methods:{async initOptions(t){if(typeof t=="function")try{this.loading=!0;const i=await t();Array.isArray(i)&&(this.optionsList=i)}catch(i){console.error(i)}finally{this.loading=!1}else Array.isArray(t)&&(this.optionsList=t)}}};function st(t,i,l,o,s,n){const a=e.resolveComponent("el-checkbox-button"),d=e.resolveComponent("el-checkbox-group");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tm-checkbox",{"wide-mode":n.hasWideOptions,"tm-checkbox--v3":s.isVue3,"tm-checkbox--v2":s.isVue2}])},[e.createVNode(d,e.mergeProps({ref:"checkboxGroup",modelValue:s.selectedValue,"onUpdate:modelValue":i[0]||(i[0]=c=>s.selectedValue=c)},F(b({},t.$attrs),{size:s.getDefaultSize()}),e.toHandlers(s.isVue2?t.$listeners:{})),{default:e.withCtx(()=>[t.$slots.default?e.renderSlot(t.$slots,"default",{key:0},void 0,!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(s.optionsList,c=>(e.openBlock(),e.createBlock(a,e.mergeProps({key:c[n.propMap.value]},{ref_for:!0},{[s.isVue3?"value":"label"]:c[n.propMap.value],disabled:c.disabled,style:n.calculateItemWidth}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"option",{item:c},()=>[e.createTextVNode(e.toDisplayString(c[n.propMap.label]),1)],!0)]),_:2},1040))),128))]),_:3},16,["modelValue"])],2)}const K=y(it,[["render",st],["__scopeId","data-v-b44866b1"]]),nt=!1,ot={name:"TmSwitchFilter",props:{value:{type:Boolean,default:!1},label:{type:String,default:""}},data(){return{isVue2:nt,getDefaultSize:T,switchValue:this.value}},computed:{containerWidthClass(){const t=n=>{if(!n)return 0;let a=0;for(let d=0;d<n.length;d++){const c=n.charAt(d);a+=/[\u4e00-\u9fa5]/.test(c)?2:1}return a},i=t(this.$attrs["active-text"]),l=t(this.$attrs["inactive-text"]),o=t(this.$attrs.label),s=i+l+o;return s>20?"wide-container":s>6?"medium-container":"narrow-container"}},watch:{value:{immediate:!0,handler(t){this.switchValue=t}},switchValue(t){this.$emit("input",t),this.$emit("change",t)}}},at={key:0,class:"switch-label"};function rt(t,i,l,o,s,n){const a=e.resolveComponent("el-switch");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tm-switch",n.containerWidthClass])},[l.label?(e.openBlock(),e.createElementBlock("span",at,e.toDisplayString(l.label),1)):e.createCommentVNode("",!0),e.createVNode(a,e.mergeProps({ref:"switch",modelValue:s.switchValue,"onUpdate:modelValue":i[0]||(i[0]=d=>s.switchValue=d)},t.$attrs,e.toHandlers(s.isVue2?t.$listeners:{}),{size:s.getDefaultSize()}),null,16,["modelValue","size"])],2)}const Q=y(ot,[["render",rt],["__scopeId","data-v-9e7a342f"]]),ct={name:"DynamicSlot",props:{name:{type:String,required:!0},slotProps:{type:Object,default:()=>({})}},render(t){var s;const i=n=>{var a;if(!n)return null;{const d=(a=n.$slots)==null?void 0:a[this.name];return d?d(this.slotProps):null}},l=n=>{var a,d,c,h;return n?((d=(a=n.$)==null?void 0:a.type)==null?void 0:d.name)==="TmTable"||((h=(c=n.$)==null?void 0:c.type)==null?void 0:h.__name)==="TmTable":!1};let o=i(this.$parent);if(!o){let n=(s=this.$parent)==null?void 0:s.$parent;for(;n&&!o;){if(l(n)){o=i(n);break}n=n.$parent}}return o||null}},{t:dt}=w(),ht=!1,ut=!0,mt=["date","daterange","datetime","datetimerange","year","month","dates","months","years","week","monthrange"],pt={name:"TmTableSearch",components:{TmSelect:I,TmAdvancedInput:W,TmAdvancedDate:U,TmCascader:j,TmRadio:J,TmCheckbox:K,TmSwitch:Q,DynamicSlot:ct},props:{disabled:{type:Boolean,default:!1},searchColumns:{type:Array,default:null},searchForm:{type:Object,default:()=>({})}},data(){return{t:dt,isVue2:ht,isVue3:ut,getCompatSize:D,getDefaultSize:T,DATE_TYPES:mt,defaultValues:{}}},computed:{computedSearchForm:{get(){return this.searchForm},set(t){this.$emit("update:search-form",t)}}},mounted(){this.initDefaultValues()},methods:{isDateType(t){return this.DATE_TYPES.includes(t)},hasDefaultSlot(){const t=this.$slots.default;return t?this.isVue2?!!t:t()[0].children.length>0:!1},handleUpdate(t,i,l){const o=this.getFieldValue(t,l);o&&this.$emit("update:search-form",F(b({},this.computedSearchForm),{[o]:i}))},handleUpdateDate(t,i){const l=i||[],o=this.getFieldValue(t,"start"),s=this.getFieldValue(t,"end"),n=this.getFieldValue(t,"value"),a={};o&&(a[o]=l[0]),s&&(a[s]=l[1]),n&&(a[n]=l),this.$emit("update:search-form",b(b({},this.computedSearchForm),a))},getFieldValue(t,i){if(typeof t=="string")return t;if(t.fields&&i in t.fields){const l=t.fields[i];if(typeof l=="string")return l;if(Array.isArray(l))return l[0];if(l&&typeof l=="object")return l.name}},getFieldDefault(t,i){if(t.fields&&i in t.fields){const l=t.fields[i];if(Array.isArray(l)&&l.length>1)return l[1];if(l&&typeof l=="object"&&"default"in l)return l.default}},hasSearchSlot(t){var o,s,n,a;const i=d=>{var c;return d?!!((c=d.$slots)!=null&&c[t]):!1};if(i(this))return!0;let l=this.$parent;for(;l;){if((((s=(o=l.$)==null?void 0:o.type)==null?void 0:s.name)==="TmTable"||((a=(n=l.$)==null?void 0:n.type)==null?void 0:a.__name)==="TmTable")&&i(l))return!0;l=l.$parent}return!1},initDefaultValues(){if(!this.searchColumns||!this.searchColumns.length)return;const t={};this.searchColumns.forEach(i=>{if(typeof i=="string"||!i.fields)return;const l=this.getFieldValue(i,"value"),o=this.getFieldValue(i,"label");if(i.type==="input"&&i.labelOptions&&i.labelOptions.length>0){const n=i.labelOptions[0];if(o)if(o in this.computedSearchForm)t[o]=this.computedSearchForm[o];else{const a=this.getFieldDefault(i,"label");a!==void 0?t[o]=a:n&&n.value!==void 0&&(t[o]=n.value)}l&&!(l in this.computedSearchForm)&&(t[l]="")}else if(this.isDateType(i.type)&&i.labelOptions&&i.labelOptions.length>0){const n=i.labelOptions[0];if(l&&!(l in this.computedSearchForm)&&(t[l]=[]),o)if(o in this.computedSearchForm)t[o]=this.computedSearchForm[o];else{const a=this.getFieldDefault(i,"label");a!==void 0?t[o]=a:n&&n.value!==void 0&&(t[o]=n.value)}}else if(i.type==="select"&&i.labelOptions&&i.labelOptions.length>0){const n=i.labelOptions[0];if(l&&!(l in this.computedSearchForm)&&(t[l]=i.multiple?[]:""),o)if(o in this.computedSearchForm)t[o]=this.computedSearchForm[o];else{const a=this.getFieldDefault(i,"label");a!==void 0?t[o]=a:n&&n.value!==void 0&&(t[o]=n.value)}}const s=this.getFieldDefault(i,"value");if(l&&s!==void 0&&!(l in this.computedSearchForm)?this.isDateType(i.type)&&!Array.isArray(s)?t[l]=[]:i.type==="checkbox"&&!Array.isArray(s)?t[l]=s?[s]:[]:i.type==="switch"&&typeof s!="boolean"?t[l]=!!s:t[l]=s:l&&!(l in this.computedSearchForm)&&(i.type==="checkbox"?t[l]=[]:i.type==="switch"&&(t[l]=!1)),this.isDateType(i.type)){const n=this.getFieldValue(i,"start"),a=this.getFieldValue(i,"end"),d=this.getFieldDefault(i,"start"),c=this.getFieldDefault(i,"end");n&&d!==void 0&&!(n in this.computedSearchForm)&&(t[n]=d),a&&c!==void 0&&!(a in this.computedSearchForm)&&(t[a]=c)}}),this.defaultValues=t,this.$emit("update:search-form",b(b({},t),this.computedSearchForm))},getSearchForm(){return this.computedSearchForm},handleSearch(){setTimeout(()=>{this.$emit("search",this.computedSearchForm)})},handleReset(){this.$emit("update:search-form",b({},this.defaultValues)),this.$emit("reset")}}},ft={class:"search-content"},gt={class:"search-actions"};function bt(t,i,l,o,s,n){const a=e.resolveComponent("dynamic-slot"),d=e.resolveComponent("tm-advanced-input"),c=e.resolveComponent("tm-advanced-date"),h=e.resolveComponent("tm-select"),p=e.resolveComponent("tm-cascader"),V=e.resolveComponent("tm-radio"),x=e.resolveComponent("tm-checkbox"),k=e.resolveComponent("tm-switch"),L=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["table-search",`table-search--${s.isVue2?"v2":"v3"}`])},[e.createElementVNode("div",ft,[n.hasDefaultSlot()?e.renderSlot(t.$slots,"default",{key:0},void 0,!0):l.searchColumns&&l.searchColumns.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(l.searchColumns,(r,z)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[typeof r=="string"?(e.openBlock(),e.createElementBlock("div",{key:`str-${r}-${z}`,class:"search-item"},[(e.openBlock(),e.createBlock(a,{name:`search-${r}`,"slot-props":{searchForm:l.searchForm},key:r},null,8,["name","slot-props"]))])):(e.openBlock(),e.createElementBlock("div",{key:`obj-${z}`,class:"search-item"},[r.fields?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.hasSearchSlot(`search-${n.getFieldValue(r,"value")}`)?(e.openBlock(),e.createBlock(a,{name:`search-${n.getFieldValue(r,"value")}`,"slot-props":{searchForm:l.searchForm,col:r},key:n.getFieldValue(r,"value")},null,8,["name","slot-props"])):(e.openBlock(),e.createElementBlock("div",{style:{display:"flex"},key:n.getFieldValue(r,"value")||`col-${z}`},[r.type==="input"?(e.openBlock(),e.createBlock(d,{key:0,label:r.label,value:n.computedSearchForm[n.getFieldValue(r,"value")],field:n.computedSearchForm[n.getFieldValue(r,"label")],onValueChange:f=>n.handleUpdate(r,f,"value"),onFieldChange:f=>n.handleUpdate(r,f,"label"),multiple:r.multiple,labelOptions:r.labelOptions,placeholder:r.placeholder,onSearch:n.handleSearch},null,8,["label","value","field","onValueChange","onFieldChange","multiple","labelOptions","placeholder","onSearch"])):e.createCommentVNode("",!0),n.isDateType(r.type)?(e.openBlock(),e.createBlock(c,{key:1,type:r.type,label:r.label,value:n.computedSearchForm[n.getFieldValue(r,"value")],field:n.computedSearchForm[n.getFieldValue(r,"label")],start:n.computedSearchForm[n.getFieldValue(r,"start")],end:n.computedSearchForm[n.getFieldValue(r,"end")],onFieldChange:f=>n.handleUpdate(r,f,"label"),onValueChange:f=>n.handleUpdateDate(r,f),onStartChange:f=>n.handleUpdateDate(r,f),onEndChange:f=>n.handleUpdateDate(r,f),labelOptions:r.labelOptions,"start-placeholder":r.startPlaceholder,"end-placeholder":r.endPlaceholder,placeholder:r.placeholder,"range-separator":r.rangeSeparator,disabled:r.disabled,clearable:r.clearable,readonly:r.readonly,editable:r.editable,align:r.align,"popper-class":r.popperClass,"default-value":r.defaultValue,"default-time":r.defaultTime,shortcuts:r.shortcuts,"past-only":r.pastOnly,format:r.format},null,8,["type","label","value","field","start","end","onFieldChange","onValueChange","onStartChange","onEndChange","labelOptions","start-placeholder","end-placeholder","placeholder","range-separator","disabled","clearable","readonly","editable","align","popper-class","default-value","default-time","shortcuts","past-only","format"])):e.createCommentVNode("",!0),r.type==="select"?(e.openBlock(),e.createBlock(h,{key:2,label:r.label,modelValue:n.computedSearchForm[n.getFieldValue(r,"value")],"onUpdate:modelValue":f=>n.computedSearchForm[n.getFieldValue(r,"value")]=f,field:n.computedSearchForm[n.getFieldValue(r,"label")],options:r.options,labelOptions:r.labelOptions,placeholder:r.placeholder,multiple:r.multiple,"show-check-all":r.checkAll,onFieldChange:f=>n.handleUpdate(r,f,"label")},null,8,["label","modelValue","onUpdate:modelValue","field","options","labelOptions","placeholder","multiple","show-check-all","onFieldChange"])):e.createCommentVNode("",!0),r.type==="cascader"?(e.openBlock(),e.createBlock(p,{key:3,modelValue:n.computedSearchForm[n.getFieldValue(r,"value")],"onUpdate:modelValue":f=>n.computedSearchForm[n.getFieldValue(r,"value")]=f,label:r.label,options:r.options,labelOptions:r.labelOptions,props:r.props,placeholder:r.placeholder,"show-check-all":r.checkAll},null,8,["modelValue","onUpdate:modelValue","label","options","labelOptions","props","placeholder","show-check-all"])):e.createCommentVNode("",!0),r.type==="radio"?(e.openBlock(),e.createBlock(V,{key:4,modelValue:n.computedSearchForm[n.getFieldValue(r,"value")],"onUpdate:modelValue":f=>n.computedSearchForm[n.getFieldValue(r,"value")]=f,label:r.label,options:r.options,props:r.props},null,8,["modelValue","onUpdate:modelValue","label","options","props"])):e.createCommentVNode("",!0),r.type==="checkbox"?(e.openBlock(),e.createBlock(x,{key:5,modelValue:n.computedSearchForm[n.getFieldValue(r,"value")],"onUpdate:modelValue":f=>n.computedSearchForm[n.getFieldValue(r,"value")]=f,label:r.label,options:r.options,props:r.props},null,8,["modelValue","onUpdate:modelValue","label","options","props"])):e.createCommentVNode("",!0),r.type==="switch"?(e.openBlock(),e.createBlock(k,{key:6,modelValue:n.computedSearchForm[n.getFieldValue(r,"value")],"onUpdate:modelValue":f=>n.computedSearchForm[n.getFieldValue(r,"value")]=f,"active-text":r.activeText,"inactive-text":r.inactiveText,label:r.label,"active-color":r.activeColor,"inactive-color":r.inactiveColor},null,8,["modelValue","onUpdate:modelValue","active-text","inactive-text","label","active-color","inactive-color"])):e.createCommentVNode("",!0)]))],64)):(e.openBlock(),e.createElementBlock("div",{key:`error-${z}`,class:"search-error-message"}," 缺少 fields 配置,无法渲染此组件 "))]))],64))),256)):e.createCommentVNode("",!0),e.createElementVNode("div",gt,[e.createVNode(L,{type:"primary",size:s.getDefaultSize(),onClick:n.handleSearch},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("query")),1)]),_:1},8,["size","onClick"]),e.createVNode(L,{size:s.getDefaultSize(),onClick:n.handleReset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("reset")),1)]),_:1},8,["size","onClick"])])])],2)}const q=y(pt,[["render",bt],["__scopeId","data-v-4ec2388e"]]),yt=!1,Ct={name:"TablePagination",props:{current:{type:Number,default:1},small:{type:Boolean,default:!0},pageSize:{type:Number,default:20},total:{type:Number,default:0}},data(){return{isVue2:yt,getCompatSize:D}},methods:{handleSizeChange(t){this.$emit("size-change",t)},handleCurrentChange(t){this.$emit("current-change",t)}}},kt={class:"tm-pagination"};function Vt(t,i,l,o,s,n){const a=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",kt,[e.createVNode(a,e.mergeProps(t.$attrs,e.toHandlers(s.isVue2?t.$listeners:{}),{style:{"text-align":"right"},"current-page":l.current,"page-size":l.pageSize,total:l.total,"page-sizes":[10,20,50,100,300,500,1e3,2e3],size:s.getCompatSize("mini"),layout:"total, sizes, prev, pager, next, jumper",onSizeChange:n.handleSizeChange,"onUpdate:currentPage":i[0]||(i[0]=d=>t.$emit("update:current",d)),"onUpdate:pageSize":i[1]||(i[1]=d=>t.$emit("update:pageSize",d)),onCurrentChange:n.handleCurrentChange}),null,16,["current-page","page-size","total","size","onSizeChange","onCurrentChange"])])}const xt=y(Ct,[["render",Vt],["__scopeId","data-v-4dbdf6e7"]]),_t={name:"TmTableMenu",props:{size:{type:String,default:"mini"}}},St={size:"small",class:"tm-table-menu",inline:""},Tt={class:"left"},wt={class:"right"};function zt(t,i,l,o,s,n){return e.openBlock(),e.createElementBlock("div",St,[e.createElementVNode("div",Tt,[e.renderSlot(t.$slots,"left",{},void 0,!0)]),e.createElementVNode("div",wt,[e.renderSlot(t.$slots,"right",{},void 0,!0)])])}const Ft=y(_t,[["render",zt],["__scopeId","data-v-579dd2c3"]]),H=t=>t?t.props||{}:{},Y=(t,i)=>{t&&(t.props||(t.props={}),typeof i=="object"&&Object.assign(t.props,i))},A={getTableConfig(t){try{const i=localStorage.getItem(`tm-table-config-${t}`);return Promise.resolve({data:{code:200,data:i}})}catch(i){return Promise.reject(i)}},setTableConfig(t){try{return localStorage.setItem(`tm-table-config-${t.key}`,t.info),Promise.resolve({data:{code:200,message:"success"}})}catch(i){return Promise.reject(i)}}},Bt=t=>A.getTableConfig(t.key),Lt=t=>A.setTableConfig(t),Et=t=>{t&&(typeof t.getTableConfig=="function"&&(A.getTableConfig=t.getTableConfig),typeof t.setTableConfig=="function"&&(A.setTableConfig=t.setTableConfig))},{t:Dt}=w(),Ot=!1,Nt=!0,Mt={formatter:(t,i,l,o)=>[void 0,null,""].includes(l)?"-":l},Ht={name:"TmColumnConfig",components:{MoveIcon:xe,FixedLeftIcon:Se,FixedRightIcon:Te,UploadIcon:we,DownloadIcon:ze,DeleteIcon:Fe,MenuIcon:ke,tmEllipsisText:B},props:{columns:{type:Array,default:()=>[]},tableKey:{type:String,default:"",required:!0},defaultColumns:{type:Array,default:()=>[]},maxFixedLeftQuantity:{type:[Number,String],default:void 0},maxFixedRightQuantity:{type:[Number,String],default:void 0},ignoredColumnConfigTypes:{type:Array,default:()=>["selection"]}},data(){return{t:Dt,isVue2:Ot,isVue3:Nt,getDefaultSize:T,getCompatSize:D,buttonType:{link:!0,type:"primary"},afterOpenDelay:{"show-after":300},popoverVisible:!1,keyWord:"",sortedTableColumns:[],tableColumns:[],defaultColumnsConfig:[],columnMap:{},processedColumns:[],placement:"bottom",isDraggingFrozen:!1,isDraggingFrozenRight:!1,sortable:null,isConfigLoaded:!1,columnsCopy:[]}},computed:{filteredSortedTableColumns(){return this.keyWord?this.sortedTableColumns.filter(t=>this.getColumnLabel(t.prop).includes(this.keyWord)):this.sortedTableColumns},showFixedLimitTips(){return this.maxFixedLeftQuantity!==void 0||this.maxFixedRightQuantity!==void 0},isThanMaxFrozen(){return this.maxFixedLeftQuantity===void 0?!1:this.sortedTableColumns.filter(t=>t.fixed==="left").length>=this.maxFixedLeftQuantity},isThanMaxRightFrozen(){return this.maxFixedRightQuantity===void 0?!1:this.sortedTableColumns.filter(t=>t.fixed==="right").length>=this.maxFixedRightQuantity},computedTableKey(){if(this.tableKey)return this.tableKey;if(this.$route&&this.$route.path)return this.$route.path.slice(1).replace(/\//g,"-");throw new Error("tableKey is required")}},watch:{popoverVisible(t){t||this.handlePopoverHide()},columns:{handler(t){t&&t.length>0&&!this.isConfigLoaded&&this.initializeColumnConfig()},immediate:!0},tableColumns:{handler(t){t!=null&&t.length&&(this.initSortedTableColumns(),this.crateSortable(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)))},deep:!0}},methods:{findLastIndex(t,i){for(let l=t.length-1;l>=0;l--)if(i(t[l],l,t))return l;return-1},getColumnLabel(t){return!t||!this.columnMap[t]?t||"":H(this.columnMap[t]).label||t},initializeColumnConfig(){this.defaultColumns&&this.defaultColumns.length>0?this.defaultColumnsConfig=this.defaultColumns:this.processOriginalColumns(),this.loadColumnConfig()},processOriginalColumns(){const t=this.columns||[];let i={};this.defaultColumnsConfig=t.filter(l=>{const o=H(l);return!(!o.prop||this.ignoredColumnConfigTypes.includes(o.type))}).map((l,o)=>{const s=H(l),n=b(b({},Mt),s);Y(l,n),s.prop&&(i[s.prop]=l);const a=s.hasOwnProperty("visible")?s.visible!==!1:!0;return{prop:s.prop,fixed:s.fixed||"",sort:o,cancellable:s.hasOwnProperty("cancellable")?s.cancellable:!0,visible:a}}),this.columnMap=i},loadColumnConfig(){Bt({key:this.computedTableKey}).then(t=>{var l;if(t.data.code!==200)return;let i=JSON.parse(((l=t.data)==null?void 0:l.data)||null)||{};i.columnsConfig&&JSON.stringify(this.defaultColumnsConfig)===JSON.stringify(i.defaultColumnsConfig)?this.tableColumns=i.columnsConfig.map(o=>b({},o)):this.tableColumns=this.defaultColumnsConfig.map(o=>b({},o)),this.processedColumns=this.applyColumnConfig(this.tableColumns),this.isConfigLoaded=!0,this.$emit("complete",{columns:this.processedColumns,isInitialLoad:!0})}).catch(()=>{this.tableColumns=this.defaultColumnsConfig.map(t=>b({},t)),this.processedColumns=this.applyColumnConfig(this.tableColumns),this.isConfigLoaded=!0,this.$emit("complete",{columns:this.processedColumns,isInitialLoad:!0})})},applyColumnConfig(t,i=!1){let l=this.columns.filter(s=>{const n=H(s);return this.ignoredColumnConfigTypes.includes(n.type)}),o=[];return[...t].sort((s,n)=>{const a=s.sort!==void 0?s.sort:1/0,d=n.sort!==void 0?n.sort:1/0;return a-d}).forEach(s=>{if(s.prop){let n=this.columnMap[s.prop];n&&(Y(n,{fixed:s.fixed||void 0,visible:s.visible}),(!i&&s.visible||i)&&o.push(n))}}),l.forEach(s=>{Y(s,{visible:!0})}),[...l,...o]},crateSortable(){const t=this.$refs.sortListRef;if(!t)return;this.sortable&&(this.sortable.destroy(),this.sortable=null);const i=new g(t,{ghostClass:"blue-background-class",animation:150,easing:"cubic-bezier(1, 0, 0, 1)",handle:".row-title",draggable:".sort-item-wrapper",fallbackOnBody:!1,preventOnFilter:!0,removeCloneOnHide:!0,group:"columns",dragClass:"sortable-drag",onStart:({item:l})=>{const o=l.getAttribute("data-prop"),s=this.sortedTableColumns.find(n=>n.prop===o);this.isDraggingFrozen=s&&s.fixed==="left",this.isDraggingFrozenRight=s&&s.fixed==="right",this.draggedItemIndex=Array.from(t.children).indexOf(l),l.classList.add("sortable-drag")},onMove:l=>{const{target:o,related:s}=l;if(!o||!s)return!1;const n=s?s.getAttribute("data-prop"):null,a=n?this.sortedTableColumns.find(h=>h.prop===n):null,d=a&&a.fixed==="left",c=a&&a.fixed==="right";return this.isDraggingFrozen&&!d||this.isDraggingFrozenRight&&!c||!this.isDraggingFrozen&&!this.isDraggingFrozenRight&&(d||c)?(o.classList.add("no-drop-zone"),!1):(document.querySelectorAll(".no-drop-zone").forEach(h=>{h.classList.remove("no-drop-zone")}),!0)},onEnd:({item:l,newIndex:o,oldIndex:s})=>{if(o===void 0||s===void 0||o<0||s<0||o>=this.sortedTableColumns.length||s>=this.sortedTableColumns.length)return;document.querySelectorAll(".no-drop-zone").forEach(V=>{V.classList.remove("no-drop-zone")}),l.classList.remove("sortable-drag");const n=this.sortedTableColumns[s],a=n.fixed==="left",d=n.fixed==="right",c=o>0?this.sortedTableColumns[o-1]:null,h=o<this.sortedTableColumns.length-1?this.sortedTableColumns[o+1]:null;let p=!1;if(a?(c&&c.fixed!=="left"||h&&h.fixed==="right")&&(p=!0):d?(c&&c.fixed!=="right"||h&&h.fixed!=="right")&&(p=!0):(c&&c.fixed==="right"||h&&h.fixed==="left")&&(p=!0),p){this.rollbackSort();return}this.updateSortAfterDrag()}});this.sortable=i},rollbackSort(){this.sortedTableColumns=JSON.parse(JSON.stringify(this.columnsCopy))},updateSortAfterDrag(){const t=this.$refs.sortListRef;if(!t)return;Array.from(t.children||[]).filter(l=>l&&l.dataset&&l.dataset.prop).map(l=>l.dataset.prop).forEach((l,o)=>{this.sortedTableColumns.some(s=>s.prop===l?(s.sort=o,!0):!1)}),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},init(){this.tableColumns=Array.isArray(this.tableColumns)?[...this.tableColumns]:Array.isArray(this.defaultColumnsConfig)?[...this.defaultColumnsConfig]:[],this.initSortedTableColumns()},initSortedTableColumns(){this.tableColumns.forEach((t,i)=>{t.sort===void 0&&(t.sort=i)}),this.sortedTableColumns=[...this.tableColumns].sort((t,i)=>t.fixed==="left"&&i.fixed!=="left"?-1:t.fixed!=="left"&&i.fixed==="left"||t.fixed==="right"&&i.fixed!=="right"?1:t.fixed!=="right"&&i.fixed==="right"?-1:t.sort-i.sort)},setPlacement(){const i=this.$refs.operationRef.$el.getBoundingClientRect();(window.innerHeight||document.documentElement.clientHeight)-(i.bottom-window.scrollY)>512?this.placement="bottom":this.placement="left"},handleVisibleChange(t){this.popoverVisible=t},handlePopoverShow(){this.setPlacement(),this.init(),(()=>{try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove)}catch(i){}})(),this.$nextTick(()=>{this.crateSortable()})},handlePopoverHide(){this.sortable&&(this.sortable.destroy(),this.sortable=null);try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove),typeof g!="undefined"&&g.utils&&(document.removeEventListener("mousemove",g.utils.throttleCall),document.removeEventListener("mouseup",g.utils.throttleCall))}catch(t){}},handleSelectAll(){const t=this.tableColumns.some(i=>!i.visible);this.tableColumns.forEach(i=>{i.cancellable&&(i.visible=t)})},handleRestoreDefault(){this.tableColumns=JSON.parse(JSON.stringify(this.defaultColumnsConfig)),this.sortedTableColumns=[...this.tableColumns].sort((t,i)=>t.sort-i.sort)},canMoveTop(t,i){if(i===0)return!1;if(t.fixed==="left"){const l=this.sortedTableColumns[i-1];return l&&l.fixed==="left"}if(!t.fixed){const l=this.sortedTableColumns[i-1];return l&&l.fixed==="left"?!1:l&&!l.fixed}return t.fixed==="right"},moveTop(t,i){const l=this.sortedTableColumns,o=t.prop;if(t.fixed==="right"&&(t.fixed=""),t.fixed==="left")l.unshift(l.splice(i,1)[0]);else{const s=this.findLastIndex(this.sortedTableColumns,n=>n.fixed==="left");l.splice(s+1,0,l.splice(i,1)[0])}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns),this.$nextTick(()=>{const s=this.$refs.sortListRef;if(s){const n=Array.from(s.children).find(a=>a.dataset&&a.dataset.prop===o);n&&n.scrollIntoView({behavior:"smooth",block:"nearest"})}})},frozenLeftHandle(t){const i=this.sortedTableColumns,l=i.splice(t,1)[0];if(l.fixed=l.fixed==="left"?"":"left",l.fixed==="left"){const o=this.findLastIndex(this.sortedTableColumns,s=>s.fixed==="left");i.splice(o+1,0,l)}else{const o=this.findLastIndex(this.sortedTableColumns,s=>s.fixed==="left");i.splice(o+1,0,l)}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},frozenRightHandle(t){const i=this.sortedTableColumns,l=i.splice(t,1)[0];if(l.fixed=l.fixed==="right"?"":"right",l.fixed==="right"){const o=i.findIndex(s=>s.fixed==="right");o===-1?i.push(l):i.splice(o,0,l)}else{const o=i.findIndex(s=>s.fixed==="right");o===-1?i.push(l):i.splice(o,0,l)}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},onSave(){var i;this.updateSortValues();const t=(i=this.tableColumns)==null?void 0:i.map(l=>{const o=this.sortedTableColumns.find(d=>d.prop===l.prop);o&&(l.sort=o.sort,l.fixed=o.fixed,l.visible=o.visible);const a=l,{label:s}=a;return oe(a,["label"])});Lt({key:this.computedTableKey,info:JSON.stringify({columnsConfig:t,defaultColumnsConfig:this.defaultColumnsConfig})}).then(l=>{l.data.code===200&&(this.processedColumns=this.applyColumnConfig(t,!0),this.$emit("complete",{columns:this.processedColumns,isInitialLoad:!1}),this.$message.success(this.t("saveSuccess")),this.popoverVisible=!1)})},updateSortValues(){this.sortedTableColumns.forEach((t,i)=>{t.sort=i})}},mounted(){var t;(t=this.tableColumns)!=null&&t.length&&(this.initSortedTableColumns(),this.crateSortable(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)))},beforeDestroy(){this.sortable&&(this.sortable.destroy(),this.sortable=null);try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove),typeof g!="undefined"&&g.utils&&(document.removeEventListener("mousemove",g.utils.throttleCall),document.removeEventListener("mouseup",g.utils.throttleCall))}catch(t){}}},At={key:0,class:"container"},Rt={class:"main-container"},Pt={class:"left-content"},It={class:"title"},vt={class:"option-list"},Wt={style:{height:"100%","overflow-y":"auto"}},Ut={class:"right-content"},jt={class:"search-box"},Jt={key:0,class:"tips"},Kt={class:"sort-list",ref:"sortListRef"},Qt=["data-prop"],qt={key:0,class:"sort-item"},Yt={class:"row-title"},Gt={class:"operation-btns"},Xt={class:"footer"},Zt={class:"footer-left"},$t={class:"footer-right"},el={style:{display:"inline-block","margin-left":"10px"}};function tl(t,i,l,o,s,n){const a=e.resolveComponent("el-button"),d=e.resolveComponent("TmEllipsisText"),c=e.resolveComponent("el-checkbox"),h=e.resolveComponent("el-input"),p=e.resolveComponent("MoveIcon"),V=e.resolveComponent("DeleteIcon"),x=e.resolveComponent("el-tooltip"),k=e.resolveComponent("UploadIcon"),L=e.resolveComponent("FixedLeftIcon"),r=e.resolveComponent("FixedRightIcon"),z=e.resolveComponent("MenuIcon"),f=e.resolveComponent("el-popover");return e.openBlock(),e.createBlock(f,e.mergeProps({"popper-class":"column-config-popover"},{[s.isVue3?"visible":"value"]:s.popoverVisible},e.toHandlers({[s.isVue3?"update:visible":"input"]:n.handleVisibleChange}),{width:680,"show-arrow":!1,placement:s.placement,trigger:"click",onShow:n.handlePopoverShow,onHide:n.handlePopoverHide}),{reference:e.withCtx(()=>[e.createElementVNode("div",el,[e.createVNode(x,e.mergeProps({content:s.t("columnSetting")},s.afterOpenDelay,{placement:"top"}),{default:e.withCtx(()=>[e.createVNode(a,{size:s.getDefaultSize(),ref:"operationRef",circle:""},{default:e.withCtx(()=>[e.createVNode(z)]),_:1},8,["size"])]),_:1},16,["content"])])]),default:e.withCtx(()=>[s.popoverVisible?(e.openBlock(),e.createElementBlock("div",At,[e.createElementVNode("div",Rt,[e.createElementVNode("div",Pt,[e.createElementVNode("div",It,[e.createElementVNode("span",null,e.toDisplayString(s.t("SelectableFields"))+"("+e.toDisplayString(s.tableColumns.length)+")",1),e.createVNode(a,e.mergeProps({style:{"margin-left":"10px"}},s.buttonType,{onClick:n.handleSelectAll}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("all")),1)]),_:1},16,["onClick"])]),e.createElementVNode("div",vt,[e.createElementVNode("div",Wt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.tableColumns,(m,E)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[m.prop?(e.openBlock(),e.createElementBlock("div",{style:{width:"110px",display:"inline-block"},key:E+m.prop},[e.createVNode(c,{disabled:!m.cancellable,class:"el-checkbox",modelValue:m.visible,"onUpdate:modelValue":O=>m.visible=O,label:m.prop,value:m.prop},{default:e.withCtx(()=>[e.createVNode(d,{width:"80px",text:n.getColumnLabel(m.prop)},null,8,["text"])]),_:2},1032,["disabled","modelValue","onUpdate:modelValue","label","value"])])):e.createCommentVNode("",!0)],64))),256))])])]),e.createElementVNode("div",Ut,[e.createElementVNode("div",jt,[e.createVNode(h,{size:s.getCompatSize("small"),class:"search-input",clearable:"",placeholder:s.t("search"),modelValue:s.keyWord,"onUpdate:modelValue":i[0]||(i[0]=m=>s.keyWord=m)},null,8,["size","placeholder","modelValue"])]),n.showFixedLimitTips?(e.openBlock(),e.createElementBlock("div",Jt)):e.createCommentVNode("",!0),e.createElementVNode("div",Kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.filteredSortedTableColumns,(m,E)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["sort-item-wrapper",[m.fixed==="left"?"frozen":"",m.fixed==="right"?"frozenRight":"",m.fixed?"":"noFrozen"]]),"data-prop":m.prop,key:m.prop},[m.visible?(e.openBlock(),e.createElementBlock("div",qt,[e.createElementVNode("div",Yt,[e.createVNode(p,{style:{"flex-shrink":"0"}}),e.createVNode(d,{text:n.getColumnLabel(m.prop)},null,8,["text"])]),e.createElementVNode("div",Gt,[m.cancellable?(e.openBlock(),e.createBlock(x,e.mergeProps({key:0,content:s.t("cancel"),placement:"top"},{ref_for:!0},s.afterOpenDelay),{default:e.withCtx(()=>[e.createVNode(a,e.mergeProps({ref_for:!0},s.buttonType,{size:s.getCompatSize("mini"),class:"iconfont-button delete-button",onClick:O=>m.visible=!1}),{default:e.withCtx(()=>[e.createVNode(V)]),_:2},1040,["size","onClick"])]),_:2},1040,["content"])):e.createCommentVNode("",!0),n.canMoveTop(m,E)?(e.openBlock(),e.createBlock(x,e.mergeProps({key:1,content:s.t("top"),placement:"top"},{ref_for:!0},s.afterOpenDelay),{default:e.withCtx(()=>[e.createVNode(a,e.mergeProps({ref_for:!0},s.buttonType,{size:s.getCompatSize("mini"),class:"iconfont-button top-button",onClick:O=>n.moveTop(m,E)}),{default:e.withCtx(()=>[e.createVNode(k)]),_:2},1040,["size","onClick"])]),_:2},1040,["content"])):e.createCommentVNode("",!0),m.fixed!=="right"?(e.openBlock(),e.createBlock(x,e.mergeProps({key:2,content:m.fixed==="left"?s.t("cancelLeftFixed"):s.t("leftFixed"),placement:"top"},{ref_for:!0},s.afterOpenDelay),{default:e.withCtx(()=>[e.createVNode(a,e.mergeProps({ref_for:!0},s.buttonType,{size:s.getCompatSize("mini"),class:["iconfont-button left-fixed-btn",{"active-fixed":m.fixed==="left"}],onClick:O=>n.frozenLeftHandle(E),disabled:m.fixed!=="left"&&n.isThanMaxFrozen}),{default:e.withCtx(()=>[e.createVNode(L)]),_:2},1040,["size","class","onClick","disabled"])]),_:2},1040,["content"])):e.createCommentVNode("",!0),m.fixed!=="left"?(e.openBlock(),e.createBlock(x,e.mergeProps({key:3,content:m.fixed==="right"?s.t("cancelRightFixed"):s.t("rightFixed"),placement:"top"},{ref_for:!0},s.afterOpenDelay),{default:e.withCtx(()=>[e.createVNode(a,e.mergeProps({ref_for:!0},s.buttonType,{size:s.getCompatSize("mini"),class:["iconfont-button right-fixed-btn",{"active-fixed":m.fixed==="right"}],onClick:O=>n.frozenRightHandle(E),disabled:m.fixed!=="right"&&n.isThanMaxRightFrozen}),{default:e.withCtx(()=>[e.createVNode(r)]),_:2},1040,["size","class","onClick","disabled"])]),_:2},1040,["content"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],10,Qt))),128))],512)])]),e.createElementVNode("div",Xt,[e.createElementVNode("div",Zt,[e.createVNode(a,{size:s.getCompatSize("mini"),onClick:n.handleRestoreDefault},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("restoreDefault")),1)]),_:1},8,["size","onClick"])]),e.createElementVNode("div",$t,[e.createVNode(a,{size:s.getCompatSize("mini"),onClick:i[1]||(i[1]=m=>s.popoverVisible=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("cancel")),1)]),_:1},8,["size"]),e.createVNode(a,{size:s.getCompatSize("mini"),type:"primary",onClick:n.onSave},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("saveAndApply")),1)]),_:1},8,["size","onClick"])])])])):e.createCommentVNode("",!0)]),_:1},16,["placement","onShow","onHide"])}const ll=y(Ht,[["render",tl],["__scopeId","data-v-127cbd33"]]),il=!1,sl=!0;function G(t){if(!Array.isArray(t))return t;const i=[];for(const l of t)if(l)if(typeof l.type=="symbol"&&l.children){let o=l.children;if(typeof o=="function")continue;if(Array.isArray(o)){const s=G(o);i.push(...s)}else{const s=G([o]);i.push(...s)}}else i.push(l);return i}const nl={name:"TmTable",components:{TableSearch:q,TablePagination:xt,TableMenu:Ft,ColumnConfig:ll,RefreshIcon:Ve,ColumnRenderer:{props:["vnode"],render(){return this.vnode}}},inheritAttrs:!1,props:{data:{type:[Array,Function],default:()=>[]},showSearch:{type:Boolean,default:!0},showMenu:{type:Boolean,default:!0},showPagination:{type:Boolean,default:!0},pagination:{type:Object,default:()=>({})},height:{type:[String,Number]},calcHeight:{type:Number,default:0},dataAdapter:{type:Function,default:null},columnSettingButton:{type:Boolean,default:!0},refreshButton:{type:Boolean,default:!0},tableKey:{type:String,default:""},firstLoad:{type:Boolean,default:!0},maxFixedLeftQuantity:{type:Number},maxFixedRightQuantity:{type:Number},border:{type:Boolean,default:!0},searchColumns:{type:Array,default:null},searchForm:{type:Object,default:()=>({})}},data(){return{getDefaultSize:T,getCompatSize:D,isVue3:sl,isVue2:il,t:w().t,tableData:[],tableLoading:!1,columnsLoading:!1,tableReload:1,tableHeight:null,selectedRows:[],paginationInfo:{current:1,pageSize:20,total:void 0},originalColumns:[],displayColumns:[],isColumnConfigLoaded:!1,afterOpenDelay:{"show-after":300}}},computed:{pageLoading(){return this.tableLoading||this.columnsLoading},computedTableKey(){if(this.tableKey)return this.tableKey;if(this.$route&&this.$route.path)return this.$route.path.slice(1).replace(/\//g,"-");throw new Error("tableKey is required")},computedShowPagination(){return this.showPagination&&typeof this.data=="function"}},watch:{data:{immediate:!0,handler(t){typeof t=="function"?!this.columnSettingButton||this.isColumnConfigLoaded&&!this.firstLoad?this.loadData():Array.isArray(t)&&(this.tableData=t):this.tableData=t}},height:{immediate:!0,handler(){this.getTableHeight()}}},created(){{const t=this.$slots.default();this.originalColumns=G(t)}this.columnSettingButton?this.columnsLoading=!0:(this.displayColumns=this.originalColumns,this.isColumnConfigLoaded=!0)},mounted(){this.getTableHeight(),window.addEventListener("resize",this.getTableHeight)},beforeDestroy(){window.removeEventListener("resize",this.getTableHeight)},methods:{handleUpdateSearchForm(t){this.$emit("update:search-form",t)},handleColumnConfigComplete(t){Array.isArray(t.columns)?this.displayColumns=[...t.columns]:this.displayColumns=[...this.originalColumns],t.isInitialLoad?(this.isColumnConfigLoaded=!0,this.columnsLoading=!1,this.firstLoad&&typeof this.data=="function"&&this.loadData()):this.reloadTable()},isAutoHeight(){return this.height==="auto"},handleRefresh(){this.loadData()},async loadData(){if(Array.isArray(this.data))this.tableData=this.data;else if(typeof this.data=="function"){if(this.tableLoading)return;this.tableLoading=!0;try{const t=await this.data({paginationInfo:{pageSize:this.paginationInfo.pageSize,current:this.paginationInfo.current},params:this.searchForm}),{list:i,total:l,pageSize:o,current:s}=t;this.tableData=i;let n=b({},this.paginationInfo);l!==void 0&&(n.total=l),s!==void 0&&(n.current=s),o!==void 0&&(n.pageSize=o),this.paginationInfo=n}catch(t){}finally{this.tableLoading=!1}}},getTableHeight(){this.isAutoHeight()?this.$nextTick(()=>{const t=this.$refs.table,i=this.$refs.tmPagination;if(!t)return;const l=t.$el,o=i&&i.$el&&i.$el.offsetHeight||0;this.tableHeight=document.documentElement.clientHeight-l.offsetTop-o-this.calcHeight}):this.tableHeight=this.height,this.refreshTable()},search(){this.paginationInfo.current=1,this.loadData()},reset(){this.paginationInfo.current=1,this.$nextTick(()=>{this.loadData()})},handleSelectionChange(t){this.selectedRows=t,this.$emit("selection-change",t)},handleSizeChange(t){this.paginationInfo.pageSize=t,this.loadData(),this.$emit("size-change",t)},handleCurrentChange(t){this.paginationInfo.current=t,this.loadData(),this.$emit("current-change",t)},refreshTable(){this.$refs.table&&this.$refs.table.doLayout()},reloadTable(){this.tableReload++}}},ol={class:"tm-table",ref:"tablePage"};function al(t,i,l,o,s,n){const a=e.resolveComponent("table-search"),d=e.resolveComponent("RefreshIcon"),c=e.resolveComponent("el-button"),h=e.resolveComponent("el-tooltip"),p=e.resolveComponent("ColumnConfig"),V=e.resolveComponent("table-menu"),x=e.resolveComponent("columnRenderer"),k=e.resolveComponent("el-table"),L=e.resolveComponent("table-pagination"),r=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",ol,[l.searchColumns&&l.searchColumns.length>0?(e.openBlock(),e.createBlock(a,{key:0,ref:"search",onSearch:n.search,onReset:n.reset,"onUpdate:searchForm":n.handleUpdateSearchForm,disabled:n.pageLoading,"search-columns":l.searchColumns,"search-form":l.searchForm},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"search",{},void 0,!0)]),_:3},8,["onSearch","onReset","onUpdate:searchForm","disabled","search-columns","search-form"])):e.createCommentVNode("",!0),l.showMenu?(e.openBlock(),e.createBlock(V,{key:1},{left:e.withCtx(()=>[e.renderSlot(t.$slots,"menu-left",{},void 0,!0)]),right:e.withCtx(()=>[e.renderSlot(t.$slots,"menu-right",{},void 0,!0),l.refreshButton&&typeof l.data=="function"?(e.openBlock(),e.createBlock(h,e.mergeProps({key:0,content:s.t("refresh"),placement:"top"},s.afterOpenDelay),{default:e.withCtx(()=>[e.createVNode(c,{onClick:n.handleRefresh,circle:"",size:s.getDefaultSize()},{default:e.withCtx(()=>[e.createVNode(d)]),_:1},8,["onClick","size"])]),_:1},16,["content"])):e.createCommentVNode("",!0),l.columnSettingButton?(e.openBlock(),e.createBlock(p,{key:1,maxFixedLeftQuantity:l.maxFixedLeftQuantity,maxFixedRightQuantity:l.maxFixedRightQuantity,tableKey:n.computedTableKey,columns:s.originalColumns,onComplete:n.handleColumnConfigComplete},null,8,["maxFixedLeftQuantity","maxFixedRightQuantity","tableKey","columns","onComplete"])):e.createCommentVNode("",!0)]),_:3})):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(k,e.mergeProps({ref:"table"},F(b({},t.$attrs),{border:l.border}),e.toHandlers(s.isVue2?t.$listeners:{}),{data:s.tableData,height:s.tableHeight,size:s.getCompatSize("mini"),onSelectionChange:n.handleSelectionChange,key:s.tableReload}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.displayColumns,z=>(e.openBlock(),e.createBlock(x,{vnode:z,key:s.isVue3?z.id:z.data.attrs.prop},null,8,["vnode"]))),128))]),_:1},16,["data","height","size","onSelectionChange"])),[[r,n.pageLoading]]),n.computedShowPagination?(e.openBlock(),e.createBlock(L,{key:2,ref:"tmPagination","page-size":s.paginationInfo.pageSize,current:s.paginationInfo.current,total:s.paginationInfo.total,disabled:s.tableLoading,onSizeChange:n.handleSizeChange,onCurrentChange:n.handleCurrentChange},null,8,["page-size","current","total","disabled","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)],512)}const X=y(nl,[["render",al],["__scopeId","data-v-8db1f265"]]),rl=!1,cl=!0,dl={name:"TmTableColumn",inheritAttrs:!1,computed:{isVisible(){return this.$attrs.visible!==!1},slots(){return this.$slots}},data(){return{isVue2:rl,isVue3:cl}},created(){this.$parent&&this.$parent.$emit&&this.$parent.$emit("column-initialized",{prop:this.$attrs.prop,visible:this.$attrs.visible!==!1})}};function hl(t,i,l,o,s,n){const a=e.resolveComponent("el-table-column");return n.isVisible?(e.openBlock(),e.createBlock(a,e.mergeProps({key:0},t.$attrs,e.toHandlers(s.isVue2?t.$listeners:{})),e.createSlots({_:2},[e.renderList(n.slots,(d,c)=>({name:c,fn:e.withCtx(h=>[e.renderSlot(t.$slots,c,e.normalizeProps(e.guardReactiveProps(h)))])}))]),1040)):e.createCommentVNode("",!0)}const Z=y(dl,[["render",hl]]),{t:$}=w(),ul={name:"TmAdvancedEllipsisText",components:{CopyIcon:te},props:{rows:{type:Number,default:1},width:{type:String,default:"100%"},maxWidth:{type:String,default:""},showToolbar:{type:Boolean,default:!1},text:{type:String,default:""},showTooltip:{type:Boolean,default:!0},copyable:{type:Boolean,default:!1}},data(){return{isVue2:!1,originalText:"",isHovered:!1,lineHeight:0,containerWidth:0,resizeObserver:null,isCalculating:!1,frontLines:[],lastLineText:"",isLastLineEllipsis:!1,tableRowElement:null}},computed:{containerStyle(){const t={};return this.maxWidth?(t.maxWidth=this.maxWidth,t.width=this.width):t.width=this.width,t},hasToolbarSlot(){return this.$slots.toolbar?this.$slots.toolbar&&this.$slots.toolbar().length>0:!1},hasToolbarContent(){return this.copyable||this.hasToolbarSlot},shouldShowToolbar(){return this.showToolbar||this.isHovered&&this.hasToolbarContent}},mounted(){this.initComponent(),this.setupResizeObserver(),this.setupTableRowHover()},updated(){const t=this.getTextContent();t!==this.originalText&&(this.originalText=t,this.$nextTick(()=>{this.calculateLayout()}))},beforeDestroy(){this.cleanupResizeObserver(),this.cleanupTableRowHover()},beforeUnmount(){this.cleanupResizeObserver(),this.cleanupTableRowHover()},watch:{text:{handler(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLayout()})},immediate:!0},rows(){this.$nextTick(()=>{this.calculateLayout()})},shouldShowToolbar(){this.$nextTick(()=>{this.calculateLayout()})},"$slots.default":{handler(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLayout()})},deep:!0}},methods:{initComponent(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLineHeight(),this.$nextTick(()=>{this.calculateLayout()})})},handleCopy(){navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(this.originalText).then(()=>{this.$message.success($("copySuccess"))}).catch(()=>{this.fallbackCopy()}):this.fallbackCopy()},fallbackCopy(){const t=document.createElement("textarea");t.value=this.originalText,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),this.$message.success($("copySuccess"))}catch(i){this.$message.error($("copyFailed"))}document.body.removeChild(t)},getTextContent(){if(this.$slots.default){const t=this.$slots.default;return t().map(i=>typeof i.children=="string"?i.children:Array.isArray(i.children)?i.children.map(l=>l.children||"").join(""):"").join("")}return this.text||""},calculateLineHeight(){const t=this.$refs.containerRef;if(!t)return;const i=window.getComputedStyle(t);this.containerWidth=t.offsetWidth;const l=this.$refs.measureRef;if(l){this.setMeasureElementStyle(l,{width:this.containerWidth+"px",wordBreak:"break-all",whiteSpace:"normal"}),l.textContent="测",l.offsetHeight;const o=l.offsetHeight;l.innerHTML="",this.lineHeight=o}else{const o=i.lineHeight;if(o&&o!=="normal")this.lineHeight=parseInt(o);else{const s=parseInt(i.fontSize);this.lineHeight=s*1.2}}},calculateLayout(){if(!this.isCalculating){if(!this.originalText||this.rows<=0){this.frontLines=[],this.lastLineText=this.originalText||"",this.isLastLineEllipsis=!1;return}this.isCalculating=!0,this.$nextTick(()=>{requestAnimationFrame(()=>{this.performLayoutCalculation()})})}},performLayoutCalculation(){const t=this.originalText;if(this.rows===1)this.frontLines=[],this.lastLineText=t,this.isLastLineEllipsis=this.checkIfTextOverflows(t);else{const i=this.lineHeight;if(this.getTextHeight(t)<=i)this.frontLines=[],this.lastLineText=t,this.isLastLineEllipsis=this.checkIfTextOverflows(t);else{const o=this.lineHeight*(this.rows-1),s=this.findTextForHeight(t,o);this.frontLines=this.splitTextToLines(s);const n=t.substring(s.length);this.lastLineText=n,this.isLastLineEllipsis=n.length>0&&this.checkIfTextOverflows(n)}}this.isCalculating=!1},findTextForHeight(t,i){if(this.getTextHeight(t)<=i)return t;let l=0,o=t.length,s="";for(;l<=o;){const n=Math.floor((l+o)/2),a=t.substring(0,n);this.getTextHeight(a)<=i?(s=a,l=n+1):o=n-1}return s},splitTextToLines(t){if(!t)return[];const i=[];let l=t;for(;l.length>0;){const o=this.findTextForHeight(l,this.lineHeight);if(o.length===0)break;i.push(o),l=l.substring(o.length)}return i},checkIfTextOverflows(t){if(!t)return!1;const i=this.getTextWidth(t),l=this.shouldShowToolbar&&this.hasToolbarContent?this.getToolbarWidth():0,o=this.containerWidth-l-5;return i>o},getToolbarWidth(){let t=0;return this.copyable&&(t+=20),this.hasToolbarSlot&&(t+=40),t},getTextHeight(t){return this.measureText(t,{width:this.containerWidth+"px",wordBreak:"break-all",whiteSpace:"normal"})},getTextWidth(t){return this.measureText(t,{whiteSpace:"nowrap"})},measureText(t,i={}){if(!this.$refs.containerRef||!this.$refs.measureRef)return 0;const l=this.$refs.measureRef,o=l.style.cssText;this.setMeasureElementStyle(l,i),l.textContent=t,l.offsetHeight;const s=i.whiteSpace==="nowrap"?l.offsetWidth:l.offsetHeight;return l.style.cssText=o,l.innerHTML="",s},setMeasureElementStyle(t,i={}){const l=window.getComputedStyle(this.$refs.containerRef);t.style.cssText="",t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.zIndex="-1",t.style.fontSize=l.fontSize,t.style.fontFamily=l.fontFamily,t.style.fontWeight=l.fontWeight,t.style.lineHeight=l.lineHeight,t.style.letterSpacing=l.letterSpacing,t.style.wordSpacing=l.wordSpacing,t.style.padding="0",t.style.margin="0",t.style.border="none",t.style.boxSizing="border-box",Object.entries(i).forEach(([o,s])=>{t.style[o]=s})},handleMouseEnter(){this.isHovered=!0},handleMouseLeave(){this.isHovered=!1},setupResizeObserver(){typeof ResizeObserver!="undefined"&&(this.resizeObserver=new ResizeObserver(t=>{const i=t[0];if(i){const l=i.contentRect.width;Math.abs(l-this.containerWidth)>1&&requestAnimationFrame(()=>{this.calculateLineHeight(),this.calculateLayout()})}}),this.$refs.containerRef&&this.resizeObserver.observe(this.$refs.containerRef))},cleanupResizeObserver(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},setupTableRowHover(){let t=this.$el;for(;t&&t!==document.body;){if(t.classList&&t.classList.contains("el-table__row")){this.tableRowElement=t;break}t=t.parentElement}this.tableRowElement&&(this.tableRowElement.addEventListener("mouseenter",this.handleMouseEnter),this.tableRowElement.addEventListener("mouseleave",this.handleMouseLeave))},cleanupTableRowHover(){this.tableRowElement&&(this.tableRowElement.removeEventListener("mouseenter",this.handleMouseEnter),this.tableRowElement.removeEventListener("mouseleave",this.handleMouseLeave),this.tableRowElement=null)}}},ml={class:"tm-ellipsis-text-wrapper"},pl=["innerHTML"],fl={class:"tm-ellipsis-last-line"},gl=["innerHTML"],bl={key:0,class:"tm-ellipsis-toolbar-part"},yl={key:1,class:"tm-ellipsis-text-wrapper"},Cl=["innerHTML"],kl={class:"tm-ellipsis-last-line"},Vl=["innerHTML"],xl={key:0,class:"tm-ellipsis-toolbar-part"},_l={ref:"measureRef",class:"tm-ellipsis-measure"};function Sl(t,i,l,o,s,n){const a=e.resolveComponent("CopyIcon"),d=e.resolveComponent("el-tooltip");return e.openBlock(),e.createElementBlock("div",{ref:"containerRef",style:e.normalizeStyle(n.containerStyle),class:"tm-ellipsis-text",onMouseenter:i[0]||(i[0]=(...c)=>n.handleMouseEnter&&n.handleMouseEnter(...c)),onMouseleave:i[1]||(i[1]=(...c)=>n.handleMouseLeave&&n.handleMouseLeave(...c))},[l.showTooltip&&s.isLastLineEllipsis?(e.openBlock(),e.createBlock(d,e.mergeProps({key:0,content:s.originalText,disabled:!l.showTooltip||!s.isLastLineEllipsis},{[s.isVue2?"open-delay":"show-after"]:300},{placement:"top"}),{default:e.withCtx(()=>[e.createElementVNode("div",ml,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.frontLines,(c,h)=>(e.openBlock(),e.createElementBlock("div",{key:"front-"+h,class:"tm-ellipsis-line",innerHTML:c},null,8,pl))),128)),e.createElementVNode("div",fl,[e.createElementVNode("div",{class:"tm-ellipsis-text-part",innerHTML:s.lastLineText},null,8,gl),n.shouldShowToolbar&&n.hasToolbarContent?(e.openBlock(),e.createElementBlock("div",bl,[l.copyable?(e.openBlock(),e.createBlock(a,{key:0,class:"icon-item",onClick:n.handleCopy},null,8,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"toolbar",{},void 0,!0)])):e.createCommentVNode("",!0)])])]),_:3},16,["content","disabled"])):(e.openBlock(),e.createElementBlock("div",yl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.frontLines,(c,h)=>(e.openBlock(),e.createElementBlock("div",{key:"front-"+h,class:"tm-ellipsis-line",innerHTML:c},null,8,Cl))),128)),e.createElementVNode("div",kl,[e.createElementVNode("div",{class:"tm-ellipsis-text-part",innerHTML:s.lastLineText},null,8,Vl),n.shouldShowToolbar&&n.hasToolbarContent?(e.openBlock(),e.createElementBlock("div",xl,[l.copyable?(e.openBlock(),e.createBlock(a,{key:0,class:"icon-item",onClick:n.handleCopy},null,8,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"toolbar",{},void 0,!0)])):e.createCommentVNode("",!0)])])),e.createElementVNode("div",_l,null,512)],36)}const ee=y(ul,[["render",Sl],["__scopeId","data-v-16643222"]]),le={install:{install(t,i={}){[X,Z,B,ee].forEach(l=>t.component(l.name,l)),i.tableConfigProvider&&Et(i.tableConfigProvider),i.lang&&M(i.lang||"zh-CN")}}.install,Table:X,Column:Z,Search:q,Select:I,AdvancedInput:W,AdvancedDate:U,Cascader:j,Radio:J,Checkbox:K,Switch:Q,EllipsisText:B,AdvancedEllipsisText:ee,setLang:M,useLocale:w};typeof window!="undefined"&&window.Vue&&le.install(window.Vue),u.AdvancedDate=U,u.AdvancedEllipsisText=ee,u.AdvancedInput=W,u.Cascader=j,u.Checkbox=K,u.Column=Z,u.EllipsisText=B,u.Radio=J,u.Search=q,u.Select=I,u.Switch=Q,u.Table=X,u.default=le,u.setLang=M,u.useLocale=w,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(u,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue"),require("sortablejs")):typeof define=="function"&&define.amd?define(["exports","vue","sortablejs"],e):(u=typeof globalThis!="undefined"?globalThis:u||self,e(u.TmTable={},u.Vue,u.Sortable))})(this,function(u,e,g){"use strict";var Tl=Object.defineProperty,wl=Object.defineProperties;var zl=Object.getOwnPropertyDescriptors;var R=Object.getOwnPropertySymbols;var se=Object.prototype.hasOwnProperty,ne=Object.prototype.propertyIsEnumerable;var ie=(u,e,g)=>e in u?Tl(u,e,{enumerable:!0,configurable:!0,writable:!0,value:g}):u[e]=g,b=(u,e)=>{for(var g in e||(e={}))se.call(e,g)&&ie(u,g,e[g]);if(R)for(var g of R(e))ne.call(e,g)&&ie(u,g,e[g]);return u},F=(u,e)=>wl(u,zl(e));var oe=(u,e)=>{var g={};for(var _ in u)se.call(u,_)&&e.indexOf(_)<0&&(g[_]=u[_]);if(u!=null&&R)for(var _ of R(u))e.indexOf(_)<0&&ne.call(u,_)&&(g[_]=u[_]);return g};const _={mini:"small",small:"small",default:"default",large:"large"},D=t=>_[t]||_.default,T=()=>"default",ae={"zh-CN":{today:"今天",yesterday:"昨天",last7days:"最近7天",last30days:"最近30天",thisMonth:"本月",lastMonth:"上月",checkAll:"全选",search:"搜索",query:"查询",reset:"重置",columnSetting:"列设置",refresh:"刷新",cancel:"取消",fixedLeft:"固定在左侧",fixedRight:"固定在右侧",top:"置顶",restoreDefault:"恢复默认",saveAndApply:"保存并应用",startDate:"开始日期",endDate:"结束日期",all:"全选",SelectableFields:"可选择字段",fixedColumns:"固定列",leftmost:"左侧最多",rightmost:"右侧最多",items:"项",accurateSearchTips:"每行一个,支持多个值",accurateSearchPlaceholder:"精确搜索,一行一项",selectPlaceholder:"请选择",clear:"清空",saveSuccess:"保存成功",cancelRightFixed:"取消右侧固定",rightFixed:"固定到右侧",cancelLeftFixed:"取消左侧固定",leftFixed:"固定到左侧",cancelTop:"取消置顶",copySuccess:"复制成功",copyFailed:"复制失败"},"en-US":{today:"Today",yesterday:"Yesterday",last7days:"Last 7 days",last30days:"Last 30 days",thisMonth:"This month",lastMonth:"Last month",checkAll:"Check all",search:"Search",query:"Search",reset:"Reset",columnSetting:"Column Setting",refresh:"Refresh",cancel:"Cancel",fixedLeft:"Fixed left",fixedRight:"Fixed right",top:"Top",restoreDefault:"Restore default",saveAndApply:"Save and apply",startDate:"Start date",endDate:"End date",all:"All",SelectableFields:"Fields",fixedColumns:"Fixed columns",leftmost:"Leftmost",rightmost:"Rightmost",items:"item(s)",accurateSearchTips:"One per line, supporting multiple values",accurateSearchPlaceholder:"Accurate search, one per line",selectPlaceholder:"Please select",clear:"Clear",saveSuccess:"Successfully saved",cancelRightFixed:"Cancel right fixed",rightFixed:"Fixed to right",cancelLeftFixed:"Cancel left fixed",leftFixed:"Fixed to left",cancelTop:"Cancel top",copySuccess:"Copy successfully",copyFailed:"Copy failed"}};let N={value:"zh-CN"};N=e.ref("zh-CN");const re=t=>{var i;return((i=ae[N.value])==null?void 0:i[t])||t},M=t=>{N.value=t},w=()=>({t:re,setLang:M,currentLang:N}),y=(t,i)=>{const l=t.__vccOpts||t;for(const[o,s]of i)l[o]=s;return l},ce=!1,de=!0,P="modelValue",he="update:modelValue",ue={name:"TmSelectFilter",props:{[P]:{type:[String,Number,Array],default:""},field:{type:[String,Number],default:""},options:{type:[Array,Function],default:()=>[]},labelOptions:{type:Array,default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value"})},filterable:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},showCheckAll:{type:Boolean,default:!0},placeholder:{type:String,default:""}},data(){return{t:w().t,isVue2:ce,isVue3:de,getDefaultSize:T,optionsList:[],loading:!1,indeterminate:!1,checkAll:!1,activedSelect:""}},computed:{computedValue:{get(){return this[P]},set(t){this.$emit(he,t),this.$emit("change",t)}},fieldValue:{get(){return this.field},set(t){this.$emit("field-change",t)}},propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}}},watch:{[P](t){!this.multiple||!this.showCheckAll||(t.length===0?(this.checkAll=!1,this.indeterminate=!1):t.length===this.optionsList.length?(this.checkAll=!0,this.indeterminate=!1):this.indeterminate=!0)}},created(){this.initOptions()},methods:{async initOptions(){if(Array.isArray(this.options))this.optionsList=this.options;else if(typeof this.options=="function")try{this.loading=!0;const t=await this.options();Array.isArray(t)&&(this.optionsList=t)}catch(t){console.error(t)}finally{this.loading=!1}},handleCheckAll(t){this.indeterminate=!1;let i=[];t&&(i=this.optionsList.map(l=>l[this.propMap.value])),this.computedValue=i},setActivedSelect(t){this.activedSelect=t}}},me={key:0,class:"check-all-option"};function pe(t,i,l,o,s,n){const a=e.resolveComponent("el-option"),d=e.resolveComponent("el-select"),c=e.resolveComponent("el-checkbox");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["advanced-select",{hasField:l.labelOptions&&l.labelOptions.length>0}])},[l.labelOptions&&l.labelOptions.length>0?(e.openBlock(),e.createBlock(d,{key:0,size:s.getDefaultSize(),class:e.normalizeClass(["field-select",`field-select--${s.isVue2?"v2":"v3"}`]),modelValue:n.fieldValue,"onUpdate:modelValue":i[0]||(i[0]=h=>n.fieldValue=h),onFocus:i[1]||(i[1]=h=>n.setActivedSelect("left")),style:e.normalizeStyle(`z-index:${s.activedSelect==="left"?2:0}`)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.labelOptions,h=>(e.openBlock(),e.createBlock(a,{key:h.value,label:h.label,value:h.value},null,8,["label","value"]))),128))]),_:1},8,["size","class","modelValue","style"])):e.createCommentVNode("",!0),e.createVNode(d,e.mergeProps({ref:"select",class:["select",`select--${s.isVue3?"v3":"v2"}`],onFocus:i[4]||(i[4]=h=>n.setActivedSelect("right")),style:`z-index:${s.activedSelect==="right"?2:0}`,modelValue:n.computedValue,"onUpdate:modelValue":i[5]||(i[5]=h=>n.computedValue=h)},F(b({},t.$attrs),{size:s.getDefaultSize(),filterable:l.filterable,clearable:l.clearable,collapseTags:l.collapseTags,multiple:l.multiple,placeholder:l.placeholder,loading:s.loading}),e.toHandlers(s.isVue2?t.$listeners:{}),{loading:s.loading}),{header:e.withCtx(()=>[s.isVue3&&l.multiple&&l.showCheckAll?(e.openBlock(),e.createBlock(c,{key:0,modelValue:s.checkAll,"onUpdate:modelValue":i[3]||(i[3]=h=>s.checkAll=h),indeterminate:s.indeterminate,size:s.getDefaultSize(),onChange:n.handleCheckAll,style:{width:"100%",height:"20px","padding-left":"10px"}},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("all")),1)]),_:1},8,["modelValue","indeterminate","size","onChange"])):e.createCommentVNode("",!0)]),default:e.withCtx(()=>[s.isVue2&&l.multiple&&l.showCheckAll?(e.openBlock(),e.createElementBlock("div",me,[e.createVNode(c,{style:{width:"100%"},modelValue:s.checkAll,"onUpdate:modelValue":i[2]||(i[2]=h=>s.checkAll=h),indeterminate:s.indeterminate,size:s.getDefaultSize(),onChange:n.handleCheckAll},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("all")),1)]),_:1},8,["modelValue","indeterminate","size","onChange"])])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.optionsList,h=>(e.openBlock(),e.createBlock(a,{key:h[n.propMap.value],label:h[n.propMap.label],value:h[n.propMap.value],disabled:h.disabled},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"option",{item:h},()=>[e.createTextVNode(e.toDisplayString(h[n.propMap.label]),1)],!0)]),_:2},1032,["label","value","disabled"]))),128))]),_:3},16,["class","style","modelValue","loading"])],2)}const I=y(ue,[["render",pe],["__scopeId","data-v-467dcdd3"]]),fe={name:"BaseIcon",props:{path:{type:String},size:{type:[String,Number]},color:{type:String}},methods:{handleClick(){}}},ge=["width","height"],be=["d"];function ye(t,i,l,o,s,n){return e.openBlock(),e.createElementBlock("i",{class:"tm-icon",onClick:i[0]||(i[0]=(...a)=>n.handleClick&&n.handleClick(...a))},[(e.openBlock(),e.createElementBlock("svg",{width:l.size,height:l.size,style:e.normalizeStyle({color:l.color}),viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[e.createElementVNode("path",{d:l.path},null,8,be)],12,ge))])}const Ce=y(fe,[["render",ye],["__scopeId","data-v-1c30ca93"]]),S=Object.entries({menu:"M160 448a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V160.064a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32V416a32 32 0 0 1-32 32zM160 896a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32zm448 0a32 32 0 0 1-32-32V608a32 32 0 0 1 32-32h255.936a32 32 0 0 1 32 32v256a32 32 0 0 1-32 32z",more:"M76.92892277 192.94787572h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758118s-23.20379058-46.40758118-46.40758118-46.40758116H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758116s23.20379058 46.40758118 46.40758264 46.40758118zM941.27013031 465.59241882H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758118s23.20379058 46.40758118 46.40758264 46.40758118h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758118s-23.20379058-46.40758118-46.40758118-46.40758118zM941.27013031 825.25117589H76.92892277c-29.00473897 0-46.40758264 17.40284367-46.40758264 46.40758118s23.20379058 46.40758118 46.40758264 46.40758264h864.34120754c23.20379058 0 46.40758118-17.40284367 46.40758118-46.40758264s-23.20379058-46.40758118-46.40758118-46.40758118z",refresh:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z",move:"M238.93333333 102.4a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0zM238.93333333 375.46666667a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m-409.6 273.06666666a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m409.6 0a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z m-341.33333333 204.8a68.26666667 68.26666667 0 1 0 0 136.53333334 68.26666667 68.26666667 0 0 0 0-136.53333334z m341.33333333 68.26666667a68.26666667 68.26666667 0 1 1 136.53333334 0 68.26666667 68.26666667 0 0 1-136.53333334 0z","column-setting":"M436.05333334 18.36373333a109.22666667 109.22666667 0 0 1 109.22666666 0l345.56586667 199.54346667c33.792 19.52426667 54.61333333 55.56906667 54.61333333 94.54933333V580.26666667h-81.92V312.45653333a27.30666667 27.30666667 0 0 0-13.65333333-23.62026666L504.32 89.2928a27.30666667 27.30666667 0 0 0-27.30666666 0L131.44746667 288.83626667a27.30666667 27.30666667 0 0 0-13.65333333 23.62026666v399.08693334a27.30666667 27.30666667 0 0 0 13.65333333 23.62026666L477.01333334 934.7072a27.30666667 27.30666667 0 0 0 27.30666666 0l54.61333334-31.5392v94.54933333l-13.65333334 7.91893334a109.22666667 109.22666667 0 0 1-109.22666666 0l-345.56586667-199.54346667a109.22666667 109.22666667 0 0 1-54.61333333-94.54933333V312.45653333c0-38.98026667 20.82133333-75.09333333 54.61333333-94.54933333L436.05333334 18.36373333z","fixed-left":"M843.36363653 311.54545478l-53.18181827 1e-8-20.45454521 28.63636347-163.63636435 204.54545479-24.54545391 28.63636347 12.27272695 36.81818175c8.18181826 28.63636347 12.27272695 57.27272695 12.27272696 85.90909042 0 32.72727305-4.09090869 61.36363652-16.36363565 90-4.09090869 16.36363653-12.27272695 32.72727306-24.54545479 49.09090957l-163.63636347-163.63636347-40.90909131-40.90909132-12.27272695-12.27272695-163.63636348-163.63636347c28.63636347-16.36363653 61.36363652-28.63636347 94.09090869-32.72727305 45-8.18181826 90-4.09090869 134.99999999 8.18181826l36.81818175 12.27272695 28.63636347-24.54545391 204.54545479-163.63636435 28.63636347-16.36363564 0-32.72727305L712.45454521 184.72727305l130.90909132 126.81818173zM941.54545479 327.90909131c0-8.18181826-4.09090869-16.36363653-8.18181826-24.54545478L720.63636348 94.72727305c-12.27272695-16.36363653-36.81818174-12.27272695-49.09090869 4.0909087-20.45454521 28.63636347-28.63636347 65.45454521-28.63636348 98.18181825l0 4.09090869-204.54545478 163.63636436c-110.45454521-36.81818174-233.18181826-16.36363653-327.27272784 61.36363564-8.18181826 8.18181826-12.27272695 16.36363653-12.27272694 24.54545478 0 8.18181826 4.09090869 16.36363653 8.18181825 24.5454548l196.36363653 196.36363652-212.72727305 212.72727216c-4.09090869 4.09090869-8.18181826 12.27272695-8.18181826 20.4545461s4.09090869 16.36363653 8.18181826 20.4545452c12.27272695 12.27272695 32.72727306 12.27272695 45 1e-8L352.45454522 716.54545479l196.36363652 196.36363652c12.27272695 12.27272695 36.81818174 12.27272695 49.09090957-4.09090957C651.09090869 847.45454521 675.63636347 773.81818174 675.63636346 696.09090869c0-36.81818173-4.09090869-73.63636348-16.36363651-106.36363564l163.63636436-204.54545479c36.81818173 0 73.63636348-8.18181826 106.36363564-28.63636347C937.45454519 348.36363653 941.54545478 336.09090869 941.54545479 327.90909131z","fixed-right":"M311.54545479 180.63636347v53.18181827l28.63636347 20.45454521 204.54545479 163.63636436 28.63636347 24.5454539 36.81818174-12.27272695c28.63636347-8.18181826 57.27272695-12.27272695 85.90909043-12.27272695 32.72727305 0 61.36363652 4.09090869 90 16.36363564 16.36363653 4.09090869 32.72727305 12.27272695 49.09090957 24.54545479l-163.63636347 163.63636347-40.90909132 40.90909131-12.27272695 12.27272695-163.63636347 163.63636348c-16.36363653-28.63636347-28.63636347-61.36363652-32.72727305-94.09090869-8.18181826-45-4.09090869-90 8.18181826-135l12.27272695-36.81818174-24.5454539-28.63636347-163.63636436-204.54545479-16.36363564-28.63636347h-32.72727305H184.72727305l126.81818174-130.90909132zM327.90909131 82.45454521c-8.18181826 0-16.36363653 4.09090869-24.54545478 8.18181826L94.72727305 303.36363652c-16.36363653 12.27272695-12.27272695 36.81818174 4.09090869 49.09090869 28.63636347 20.45454521 65.45454521 28.63636347 98.18181826 28.63636348h4.09090869l163.63636436 204.54545478c-36.81818174 110.45454521-16.36363653 233.18181826 61.36363564 327.27272784 8.18181826 8.18181826 16.36363653 12.27272695 24.54545478 12.27272695 8.18181826 0 16.36363653-4.09090869 24.54545479-8.18181826l196.36363653-196.36363653 212.72727216 212.72727305c4.09090869 4.09090869 12.27272695 8.18181826 20.4545461 8.18181827s16.36363653-4.09090869 20.45454521-8.18181827c12.27272695-12.27272695 12.27272695-32.72727305 0-45L716.54545479 671.54545479l196.36363652-196.36363653c12.27272695-12.27272695 12.27272695-36.81818174-4.09090957-49.09090957C847.45454521 372.90909131 773.81818174 348.36363653 696.09090869 348.36363653c-36.81818174 0-73.63636348 4.09090869-106.36363564 16.36363652l-204.54545479-163.63636436c0-36.81818174-8.18181826-73.63636348-28.63636347-106.36363564C348.36363653 86.54545479 336.09090869 82.45454521 327.90909131 82.45454521z",upload:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-578.304V704h-64V247.296L237.248 490.048 192 444.8 508.8 128l316.8 316.8-45.312 45.248z",download:"M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z",delete:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32",copy:"M128 320v576h576V320zm-32-64h640a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V288a32 32 0 0 1 32-32M960 96v704a32 32 0 0 1-32 32h-96v-64h64V128H384v64h-64V96a32 32 0 0 1 32-32h576a32 32 0 0 1 32 32M256 672h320v64H256zm0-192h320v64H256z"}).reduce((t,[i,l])=>{const o=`${i}Icon`,s={name:o,props:{path:{type:String,default:l},size:{type:[String,Number]},color:{type:String}},render(n){return e.h(Ce,this.$props)}};return s.install=n=>{n.component(o,s)},t[i]=s,t},{}),ke=S.menu,Ve=S.refresh,xe=S.move;S["column-setting"];const _e=S.more,Se=S["fixed-left"],Te=S["fixed-right"],we=S.upload,ze=S.download,Fe=S.delete,te=S.copy,{t:v}=w(),Be=!1,Le=!0,Ee={name:"TmEllipsisText",components:{CopyIcon:te},props:{text:{type:String,required:!0},width:{type:[String,Number],default:"auto"},maxWidth:{type:[String,Number],default:"100%"},lines:{type:Number,default:1},showTooltip:{type:Boolean,default:!0},lineHeight:{type:[String,Number]},copyable:{type:Boolean,default:!1}},data(){return{isVue2:Be,isVue3:Le,isOverflow:!1,currentLines:1,resizeObserver:null}},computed:{tooltipDisabled(){return!this.showTooltip||!this.isOverflow},textStyle(){const t=typeof this.width=="number"?`${this.width}px`:this.width,i=typeof this.maxWidth=="number"?`${this.maxWidth}px`:this.maxWidth;return{width:t,maxWidth:i,lineHeight:this.lineHeight,display:"-webkit-inline-box",overflow:"hidden",WebkitBoxOrient:"vertical",WebkitLineClamp:this.lines}}},mounted(){this.checkOverflow(),this.setupResizeObserver()},beforeDestroy(){this.cleanupResizeObserver()},beforeUnmount(){this.cleanupResizeObserver()},watch:{text(){this.$nextTick(this.checkOverflow)}},methods:{checkOverflow(){this.$refs.textEl&&this.$nextTick(()=>{this.$nextTick(()=>{this.performOverflowCheck()})})},performOverflowCheck(){var h;const t=this.$refs.textEl;if(!t)return;const i=getComputedStyle(t);if(!i.width||i.width==="0px"){this.$nextTick(()=>{this.performOverflowCheck()});return}const l=t.scrollHeight,o=t.scrollWidth,s=t.clientHeight,n=t.clientWidth,a=1,d=l>s+a,c=o>n+a;if(d||c){this.isOverflow=!0;const p=parseFloat(i.lineHeight)||16;this.currentLines=Math.ceil(l/p)}else{const p=t.getBoundingClientRect(),V=(h=t.parentElement)==null?void 0:h.getBoundingClientRect();if(V){const x=p.height>V.height||p.width>V.width;this.isOverflow=x}else this.isOverflow=!1;this.currentLines=1}},setupResizeObserver(){window.ResizeObserver&&this.$nextTick(()=>{try{this.resizeObserver=new ResizeObserver(()=>{this.checkOverflow()});const t=this.$el;t&&t instanceof Element&&this.resizeObserver.observe(t)}catch(t){console.warn("Failed to setup ResizeObserver:",t)}})},cleanupResizeObserver(){if(this.resizeObserver)try{this.resizeObserver.disconnect()}catch(t){console.warn("Failed to disconnect ResizeObserver:",t)}finally{this.resizeObserver=null}},handleCopy(){navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(this.text).then(()=>{this.$message.success(v("copySuccess"))}).catch(()=>{this.fallbackCopy()}):this.fallbackCopy()},fallbackCopy(){const t=document.createElement("textarea");t.value=this.text,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),this.$message.success(v("copySuccess"))}catch(i){this.$message.error(v("copyFailed"))}document.body.removeChild(t)}}},De={class:"ellipsis-text-container"};function Oe(t,i,l,o,s,n){const a=e.resolveComponent("CopyIcon"),d=e.resolveComponent("el-tooltip");return e.openBlock(),e.createBlock(d,e.mergeProps({disabled:n.tooltipDisabled,content:l.text,effect:"dark",placement:"top"},{[s.isVue2?"open-delay":"show-after"]:300}),{default:e.withCtx(()=>[e.createElementVNode("div",De,[e.createElementVNode("div",{ref:"textEl",class:"ellipsis-text",style:e.normalizeStyle(n.textStyle)},e.toDisplayString(l.text),5),e.createElementVNode("div",{class:e.normalizeClass(["toolbar",{multiline:s.currentLines>1&&l.lines>1}])},[l.copyable?(e.openBlock(),e.createBlock(a,{key:0,class:"icon-item",onClick:n.handleCopy},null,8,["onClick"])):e.createCommentVNode("",!0)],2)])]),_:1},16,["disabled","content"])}const B=y(Ee,[["render",Oe],["__scopeId","data-v-0979131f"]]),Ne=!1,Me=!0,He={name:"TmAdvancedInputFilter",components:{MoreIcon:_e,EllipsisText:B},props:{label:{type:String,default:""},value:{type:String,default:""},field:{type:[String,Number],default:""},placeholder:{type:String,default:""},multiple:{type:Boolean,default:!1},labelOptions:{type:Array,default:()=>[]}},data(){return{t:w().t,isVue3:Me,isVue2:Ne,getDefaultSize:T,getCompatSize:D,exactValue:"",inputValue:"",isExactMode:!1,currentOptionMultiple:!1}},computed:{width(){return this.labelOptions&&this.labelOptions.length||this.label?"305px":"200px"},fieldValue:{get(){return this.field},set(t){this.$emit("field-change",t)}},shouldShowMultiple(){return this.currentOptionMultiple!==null?this.currentOptionMultiple:this.multiple},selectedOption(){return!this.labelOptions||!this.labelOptions.length||!this.field?null:this.labelOptions.find(t=>t.value===this.field)}},watch:{labelOptions:{handler(t){t&&t.length>0&&(this.field||this.$emit("field-change",t[0].value),this.updateCurrentOptionMultiple())},deep:!0,immediate:!0},field:{handler(){this.updateCurrentOptionMultiple()},immediate:!0},isExactMode(t){t?this.$emit("value-change",this.exactValue):this.$emit("value-change",this.inputValue)},exactValue(t){this.$emit("value-change",t)},inputValue(t){this.$emit("value-change",t)},value:{handler(t){this.isExactMode?this.exactValue=t:this.inputValue=t},immediate:!0}},methods:{handlePopoverClose(){document.activeElement&&document.activeElement.blur(),this.isExactMode=!1},handleVisibleChange(t){this.isExactMode=t},handlefieldChange(t){this.$emit("field-change",t),this.updateCurrentOptionMultiple()},updateCurrentOptionMultiple(){const t=this.selectedOption;t&&"multiple"in t?this.currentOptionMultiple=t.multiple:this.currentOptionMultiple=this.multiple},handleExactSearch(){this.$emit("value-change",this.exactValue),this.$emit("search",this.exactValue)},handleClear(){this.exactValue="",this.$emit("value-change","")},handleEnter(){this.$emit("search")}},created(){this.updateCurrentOptionMultiple()}},Ae={key:1,class:"input-label"},Re={class:"popover-content"},Pe={class:"popover-subtitle"},Ie={class:"popover-footer"};function ve(t,i,l,o,s,n){const a=e.resolveComponent("el-option"),d=e.resolveComponent("el-select"),c=e.resolveComponent("EllipsisText"),h=e.resolveComponent("el-input"),p=e.resolveComponent("el-button"),V=e.resolveComponent("MoreIcon"),x=e.resolveComponent("el-popover");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tm-advanced-input",`tm-advanced-input--${s.isVue3?"v3":"v2"}`]),style:e.normalizeStyle({width:n.width})},[l.labelOptions&&l.labelOptions.length?(e.openBlock(),e.createBlock(d,{key:0,modelValue:n.fieldValue,"onUpdate:modelValue":i[0]||(i[0]=k=>n.fieldValue=k),placeholder:s.t("selectPlaceholder"),style:{width:"100px","flex-shrink":"0"},size:s.getDefaultSize(),class:"left-select",onChange:n.handlefieldChange},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.labelOptions,k=>(e.openBlock(),e.createBlock(a,{key:k.value,label:k.label,value:k.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","placeholder","size","onChange"])):l.label?(e.openBlock(),e.createElementBlock("div",Ae,[e.createVNode(c,{text:l.label,lines:2},null,8,["text"])])):e.createCommentVNode("",!0),e.createVNode(h,{modelValue:s.inputValue,"onUpdate:modelValue":i[2]||(i[2]=k=>s.inputValue=k),size:s.getDefaultSize(),placeholder:l.placeholder,onKeyup:e.withKeys(n.handleEnter,["enter","native"]),clearable:"",class:e.normalizeClass(["right-input",{"has-label":l.labelOptions&&l.labelOptions.length}])},{default:e.withCtx(()=>[n.shouldShowMultiple?(e.openBlock(),e.createBlock(x,e.mergeProps({key:0,slot:"append"},{[s.isVue3?"visible":"value"]:s.isExactMode,placement:"bottom-end",width:260,trigger:"click"},e.toHandlers({[s.isVue3?"update:visible":"input"]:n.handleVisibleChange})),{reference:e.withCtx(()=>[e.createVNode(V,{style:{cursor:"pointer"}})]),default:e.withCtx(()=>[e.createElementVNode("div",Re,[e.createElementVNode("p",Pe,e.toDisplayString(s.t("accurateSearchTips")),1),e.createVNode(h,{size:s.getDefaultSize(),type:"textarea",rows:8,modelValue:s.exactValue,"onUpdate:modelValue":i[1]||(i[1]=k=>s.exactValue=k),placeholder:s.t("accurateSearchPlaceholder"),style:{"font-size":"12px"}},null,8,["size","modelValue","placeholder"]),e.createElementVNode("div",Ie,[e.createVNode(p,{style:{float:"left"},size:s.getCompatSize("mini"),onClick:n.handleClear},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("clear")),1)]),_:1},8,["size","onClick"]),e.createVNode(p,{size:s.getCompatSize("mini"),onClick:n.handlePopoverClose},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("cancel")),1)]),_:1},8,["size","onClick"]),e.createVNode(p,{type:"primary",size:s.getCompatSize("mini"),onClick:n.handleExactSearch},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("search")),1)]),_:1},8,["size","onClick"])])])]),_:1},16)):e.createCommentVNode("",!0)]),_:1},8,["modelValue","size","placeholder","onKeyup","class"])],6)}const W=y(He,[["render",ve],["__scopeId","data-v-6b474dac"]]),{t:C}=w(),We=!1,Ue=!0,je="modelValue",Je={name:"TmAdvancedDateFilter",components:{EllipsisText:B},props:{value:{type:[Array,String,Date],default:()=>null},field:{type:[String,Number],default:""},start:{type:[String,Number],default:""},end:{type:[String,Number],default:""},size:{type:String,default:"mini"},labelOptions:{type:Array,default:()=>[]},label:{type:String,default:""},type:{type:String,default:"daterange",validator:t=>["date","daterange","datetime","datetimerange","year","month","dates","months","years","week","monthrange"].includes(t)},format:{type:String,default:""},startPlaceholder:{type:String,default:void 0},endPlaceholder:{type:String,default:void 0},placeholder:{type:String,default:void 0},rangeSeparator:{type:String,default:"-"},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},readonly:{type:Boolean,default:!1},editable:{type:Boolean,default:!0},align:{type:String,default:"left"},popperClass:{type:String,default:""},defaultValue:{type:[Date,Array],default:null},defaultTime:{type:[Date,String,Array],default:null},shortcuts:{type:Array,default:()=>[]},pastOnly:{type:Boolean,default:!1}},computed:{isRangeType(){return["daterange","datetimerange","monthrange"].includes(this.type)},computedStartPlaceholder(){if(this.isRangeType)return this.startPlaceholder!==void 0?this.startPlaceholder:C("startDate")},computedEndPlaceholder(){if(this.isRangeType)return this.endPlaceholder!==void 0?this.endPlaceholder:C("endDate")},computedDatePickerStyle(){const t=this.labelOptions&&this.labelOptions.length>0,i=this.label&&!this.isRangeType&&(!this.labelOptions||this.labelOptions.length===0);return t?"width: 206px":i?"width: 200px":"width: 306px"},computedFormat(){const t="YYYY";return this.format?this.format:this.type==="year"?t:this.type==="month"?`${t}-MM`:this.type==="date"?`${t}-MM-DD`:this.type==="dates"?`${t}-MM-DD`:this.type==="months"?`${t}-MM`:this.type==="years"?t:this.type==="week"?`${t}-MM-WW`:this.type==="datetime"?`${t}-MM-DD HH:mm:ss`:this.type==="datetimerange"?`${t}-MM-DD HH:mm:ss`:this.type==="daterange"?`${t}-MM-DD`:this.type==="monthrange"?`${t}-MM`:""},computedPickerOptions(){const t={};if(this.pastOnly&&(t.disabledDate=i=>i.getTime()>Date.now()),["daterange","datetimerange"].includes(this.type)){const i=this.type==="datetimerange";t.shortcuts=this.shortcuts.length>0?this.shortcuts:[{text:C("today"),onClick(l){const o=new Date,s=new Date;i&&(s.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[s,o])}},{text:C("yesterday"),onClick(l){const o=new Date,s=new Date;s.setTime(s.getTime()-3600*1e3*24),o.setTime(o.getTime()-3600*1e3*24),i&&(s.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[s,o])}},{text:C("last7days"),onClick(l){const o=new Date,s=new Date;s.setTime(s.getTime()-3600*1e3*24*7),i&&(s.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[s,o])}},{text:C("last30days"),onClick(l){const o=new Date,s=new Date;s.setTime(s.getTime()-3600*1e3*24*30),i&&(s.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[s,o])}},{text:C("thisMonth"),onClick(l){const o=new Date,s=new Date;s.setDate(1),i&&(s.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[s,o])}},{text:C("lastMonth"),onClick(l){const o=new Date,s=new Date;s.setMonth(s.getMonth()-1),s.setDate(1),o.setDate(0),i&&(s.setHours(0,0,0,0),o.setHours(23,59,59,999)),l.$emit("pick",[s,o])}}]}return t},computedShortcuts(){if(!["daterange","datetimerange"].includes(this.type))return[];if(this.shortcuts&&this.shortcuts.length>0)return this.shortcuts;const t=this.type==="datetimerange";return[{text:C("today"),value:()=>{const i=new Date,l=new Date;return t&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("yesterday"),value:()=>{const i=new Date,l=new Date;return l.setTime(l.getTime()-3600*1e3*24),i.setTime(i.getTime()-3600*1e3*24),t&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("last7days"),value:()=>{const i=new Date,l=new Date;return l.setTime(l.getTime()-3600*1e3*24*7),t&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("last30days"),value:()=>{const i=new Date,l=new Date;return l.setTime(l.getTime()-3600*1e3*24*30),t&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("thisMonth"),value:()=>{const i=new Date,l=new Date;return l.setDate(1),t&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}},{text:C("lastMonth"),value:()=>{const i=new Date,l=new Date;return l.setMonth(l.getMonth()-1),l.setDate(1),i.setDate(0),t&&(l.setHours(0,0,0,0),i.setHours(23,59,59,999)),[l,i]}}]},computedDisabledDate(){return this.pastOnly?t=>t.getTime()>Date.now():null},computedDefaultTime(){let t=this.defaultTime;if(this.type==="datetimerange"&&!this.defaultTime&&(t=["00:00:00","23:59:59"]),this.isVue2)return t;if(t){if(this.type==="datetimerange"&&Array.isArray(t))return t.map(i=>{if(typeof i=="string"){const l=new Date,[o,s,n]=i.split(":").map(Number);return new Date(l.getFullYear(),l.getMonth(),l.getDate(),o,s,n||0)}return i});if(this.type==="datetime"&&typeof t=="string"){const i=new Date,[l,o,s]=t.split(":").map(Number);return new Date(i.getFullYear(),i.getMonth(),i.getDate(),l,o,s||0)}return t}},dateValue(){return this.isRangeType?this.start||this.end?[this.start,this.end]:this.value:this.value},fieldValue:{get(){return this.field},set(t){this.$emit("field-change",t)}}},data(){return{t:C,isVue2:We,isVue3:Ue,getDefaultSize:T,valueField:je}},methods:{handleDateChange(t){this.isRangeType?(this.$emit("value-change",t),t&&Array.isArray(t)&&t.length===2?(this.$emit("start-change",t),this.$emit("end-change",t)):(this.$emit("start-change",[]),this.$emit("end-change",[]))):this.$emit("value-change",t)},handleBlur(t){this.$emit("blur",t)},handleFocus(t){this.$emit("focus",t)}},watch:{labelOptions:{handler(t){t&&t.length>0&&!this.field&&this.$emit("field-change",t[0].value)},deep:!0,immediate:!0}}},Ke={key:1,class:"date-label"};function Qe(t,i,l,o,s,n){const a=e.resolveComponent("el-option"),d=e.resolveComponent("el-select"),c=e.resolveComponent("EllipsisText"),h=e.resolveComponent("el-date-picker");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tm-date-picker",[`tm-date-picker--${s.isVue3?"v3":"v2"}`,{"has-select":l.labelOptions&&l.labelOptions.length>0,"has-label":l.label&&!n.isRangeType&&(!l.labelOptions||l.labelOptions.length===0)}]])},[l.labelOptions&&l.labelOptions.length>0?(e.openBlock(),e.createBlock(d,{key:0,modelValue:n.fieldValue,"onUpdate:modelValue":i[0]||(i[0]=p=>n.fieldValue=p),size:s.getDefaultSize(),style:{width:"100px"}},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.labelOptions,p=>(e.openBlock(),e.createBlock(a,{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue","size"])):l.label?(e.openBlock(),e.createElementBlock("div",Ke,[e.createVNode(c,{text:l.label,lines:2},null,8,["text"])])):e.createCommentVNode("",!0),s.isVue2?(e.openBlock(),e.createBlock(h,{key:2,value:n.dateValue,type:l.type,size:s.getDefaultSize(),"range-separator":l.rangeSeparator,"start-placeholder":n.computedStartPlaceholder,"end-placeholder":n.computedEndPlaceholder,placeholder:l.placeholder,"picker-options":n.computedPickerOptions,style:e.normalizeStyle(n.computedDatePickerStyle),format:n.computedFormat,"value-format":n.computedFormat,disabled:l.disabled,clearable:l.clearable,readonly:l.readonly,editable:l.editable,align:l.align,"popper-class":l.popperClass,"default-value":l.defaultValue,"default-time":n.computedDefaultTime,onInput:n.handleDateChange,onChange:n.handleDateChange,onBlur:n.handleBlur,onFocus:n.handleFocus},null,8,["value","type","size","range-separator","start-placeholder","end-placeholder","placeholder","picker-options","style","format","value-format","disabled","clearable","readonly","editable","align","popper-class","default-value","default-time","onInput","onChange","onBlur","onFocus"])):(e.openBlock(),e.createBlock(h,{key:3,"model-value":n.dateValue,type:l.type,size:s.getDefaultSize(),"range-separator":l.rangeSeparator,"start-placeholder":n.computedStartPlaceholder,"end-placeholder":n.computedEndPlaceholder,placeholder:l.placeholder,shortcuts:n.computedShortcuts,"disabled-date":n.computedDisabledDate,style:e.normalizeStyle(n.computedDatePickerStyle),format:n.computedFormat,"value-format":n.computedFormat,disabled:l.disabled,clearable:l.clearable,readonly:l.readonly,editable:l.editable,teleported:!1,"popper-class":l.popperClass,"default-value":l.defaultValue,"default-time":n.computedDefaultTime,"onUpdate:modelValue":n.handleDateChange,onChange:n.handleDateChange,onBlur:n.handleBlur,onFocus:n.handleFocus},null,8,["model-value","type","size","range-separator","start-placeholder","end-placeholder","placeholder","shortcuts","disabled-date","style","format","value-format","disabled","clearable","readonly","editable","popper-class","default-value","default-time","onUpdate:modelValue","onChange","onBlur","onFocus"]))],2)}const U=y(Je,[["render",Qe],["__scopeId","data-v-7d46d46b"]]),qe=!1,Ye={name:"TmCascaderFilter",props:{value:{type:[String,Number,Array],default:""},options:{type:[Array,Function],default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value",children:"children",expandTrigger:"hover"})},filterable:{type:Boolean,default:!0},clearable:{type:Boolean,default:!0},collapseTags:{type:Boolean,default:!0},collapseTagsTooltip:{type:Boolean,default:!0},placeholder:{type:String,default:""}},data(){return{isVue2:qe,getDefaultSize:T,selectedValue:this.value,optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value",children:this.props.children||"children"}},cascaderProps(){return F(b({},this.props),{expandTrigger:this.props.expandTrigger||"hover"})}},watch:{value:{immediate:!0,handler(t){this.selectedValue=t}},options:{immediate:!0,handler(t){this.initOptions(t)}},selectedValue(t){this.$emit("input",t),this.$emit("change",t)}},methods:{async initOptions(t){if(typeof t=="function")try{this.loading=!0;const i=await t();Array.isArray(i)&&(this.optionsList=i)}catch(i){console.error(i)}finally{this.loading=!1}else Array.isArray(t)&&(this.optionsList=t)}}};function Ge(t,i,l,o,s,n){const a=e.resolveComponent("el-cascader");return e.openBlock(),e.createBlock(a,e.mergeProps({ref:"cascader",class:["tm-cascader",`tm-cascader--${s.isVue2?"v2":"v3"}`],modelValue:s.selectedValue,"onUpdate:modelValue":i[0]||(i[0]=d=>s.selectedValue=d),style:{width:"200px"}},F(b({},t.$attrs),{size:s.getDefaultSize(),filterable:l.filterable,clearable:l.clearable,collapseTags:l.collapseTags,collapseTagsTooltip:l.collapseTagsTooltip,props:n.cascaderProps,placeholder:l.placeholder,options:s.optionsList,loading:s.loading}),e.toHandlers(s.isVue2?t.$listeners:{})),{default:e.withCtx(({node:d,data:c})=>[e.renderSlot(t.$slots,"default",{node:d,data:c},()=>[e.createElementVNode("span",null,e.toDisplayString(c[n.propMap.label]),1)])]),_:3},16,["class","modelValue"])}const j=y(Ye,[["render",Ge]]),Xe=!1,Ze=!0,$e={name:"TmRadioFilter",props:{value:{type:[String,Number],default:""},options:{type:[Array,Function],default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value"})},size:{type:String,default:"mini"},width:{type:[String,Number],default:200}},data(){return{isVue2:Xe,isVue3:Ze,getDefaultSize:T,selectedValue:this.value,optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}},hasWideOptions(){return this.optionsList.length>4},calculateItemWidth(){if(!this.optionsList.length)return{};const i=`${(this.hasWideOptions?305:200)/this.optionsList.length}px`;return{width:i,flex:`0 0 ${i}`}}},watch:{value:{immediate:!0,handler(t){this.selectedValue=t}},options:{immediate:!0,handler(t){this.$slots.default||this.initOptions(t)}},selectedValue(t){this.$emit("input",t),this.$emit("change",t)}},methods:{async initOptions(t){if(typeof t=="function")try{this.loading=!0;const i=await t();Array.isArray(i)&&(this.optionsList=i)}catch(i){console.error(i)}finally{this.loading=!1}else Array.isArray(t)&&(this.optionsList=t)}}};function et(t,i,l,o,s,n){const a=e.resolveComponent("el-radio-button"),d=e.resolveComponent("el-radio-group");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tm-radio",{"wide-mode":n.hasWideOptions,"tm-radio--v3":s.isVue3,"tm-radio--v2":s.isVue2}])},[e.createVNode(d,e.mergeProps({ref:"radioGroup",modelValue:s.selectedValue,"onUpdate:modelValue":i[0]||(i[0]=c=>s.selectedValue=c)},F(b({},t.$attrs),{size:s.getDefaultSize()}),e.toHandlers(s.isVue2?t.$listeners:{})),{default:e.withCtx(()=>[t.$slots.default?e.renderSlot(t.$slots,"default",{key:0},void 0,!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(s.optionsList,c=>(e.openBlock(),e.createBlock(a,e.mergeProps({ref_for:!0},{[s.isVue3?"value":"label"]:c[n.propMap.value],disabled:c.disabled,style:n.calculateItemWidth},{key:c[n.propMap.value]}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"option",{item:c},()=>[e.createTextVNode(e.toDisplayString(c[n.propMap.label]),1)],!0)]),_:2},1040))),128))]),_:3},16,["modelValue"])],2)}const J=y($e,[["render",et],["__scopeId","data-v-61fed13d"]]),tt=!1,lt=!0,it={name:"TmCheckboxFilter",props:{value:{type:Array,default:()=>[]},options:{type:[Array,Function],default:()=>[]},props:{type:Object,default:()=>({label:"label",value:"value"})},size:{type:String,default:"mini"},width:{type:[String,Number],default:200}},data(){return{isVue2:tt,isVue3:lt,getDefaultSize:T,selectedValue:this.value||[],optionsList:[],loading:!1}},computed:{propMap(){return{label:this.props.label||"label",value:this.props.value||"value"}},hasWideOptions(){return this.optionsList.length>4},calculateItemWidth(){if(!this.optionsList.length)return{};const t=Math.ceil(this.optionsList.length/(this.hasWideOptions?6:4)),i=Math.ceil(this.optionsList.length/t),o=`${(this.hasWideOptions?305:200)/i}px`;return{width:o,flex:`0 0 ${o}`}}},watch:{value:{immediate:!0,handler(t){this.selectedValue=t||[]}},options:{immediate:!0,handler(t){this.$slots.default||this.initOptions(t)}},selectedValue(t){this.$emit("input",t),this.$emit("change",t)}},methods:{async initOptions(t){if(typeof t=="function")try{this.loading=!0;const i=await t();Array.isArray(i)&&(this.optionsList=i)}catch(i){console.error(i)}finally{this.loading=!1}else Array.isArray(t)&&(this.optionsList=t)}}};function st(t,i,l,o,s,n){const a=e.resolveComponent("el-checkbox-button"),d=e.resolveComponent("el-checkbox-group");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tm-checkbox",{"wide-mode":n.hasWideOptions,"tm-checkbox--v3":s.isVue3,"tm-checkbox--v2":s.isVue2}])},[e.createVNode(d,e.mergeProps({ref:"checkboxGroup",modelValue:s.selectedValue,"onUpdate:modelValue":i[0]||(i[0]=c=>s.selectedValue=c)},F(b({},t.$attrs),{size:s.getDefaultSize()}),e.toHandlers(s.isVue2?t.$listeners:{})),{default:e.withCtx(()=>[t.$slots.default?e.renderSlot(t.$slots,"default",{key:0},void 0,!0):(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(s.optionsList,c=>(e.openBlock(),e.createBlock(a,e.mergeProps({key:c[n.propMap.value]},{ref_for:!0},{[s.isVue3?"value":"label"]:c[n.propMap.value],disabled:c.disabled,style:n.calculateItemWidth}),{default:e.withCtx(()=>[e.renderSlot(t.$slots,"option",{item:c},()=>[e.createTextVNode(e.toDisplayString(c[n.propMap.label]),1)],!0)]),_:2},1040))),128))]),_:3},16,["modelValue"])],2)}const K=y(it,[["render",st],["__scopeId","data-v-b44866b1"]]),nt=!1,ot={name:"TmSwitchFilter",props:{value:{type:Boolean,default:!1},label:{type:String,default:""}},data(){return{isVue2:nt,getDefaultSize:T,switchValue:this.value}},computed:{containerWidthClass(){const t=n=>{if(!n)return 0;let a=0;for(let d=0;d<n.length;d++){const c=n.charAt(d);a+=/[\u4e00-\u9fa5]/.test(c)?2:1}return a},i=t(this.$attrs["active-text"]),l=t(this.$attrs["inactive-text"]),o=t(this.$attrs.label),s=i+l+o;return s>20?"wide-container":s>6?"medium-container":"narrow-container"}},watch:{value:{immediate:!0,handler(t){this.switchValue=t}},switchValue(t){this.$emit("input",t),this.$emit("change",t)}}},at={key:0,class:"switch-label"};function rt(t,i,l,o,s,n){const a=e.resolveComponent("el-switch");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["tm-switch",n.containerWidthClass])},[l.label?(e.openBlock(),e.createElementBlock("span",at,e.toDisplayString(l.label),1)):e.createCommentVNode("",!0),e.createVNode(a,e.mergeProps({ref:"switch",modelValue:s.switchValue,"onUpdate:modelValue":i[0]||(i[0]=d=>s.switchValue=d)},t.$attrs,e.toHandlers(s.isVue2?t.$listeners:{}),{size:s.getDefaultSize()}),null,16,["modelValue","size"])],2)}const Q=y(ot,[["render",rt],["__scopeId","data-v-9e7a342f"]]),ct={name:"DynamicSlot",props:{name:{type:String,required:!0},slotProps:{type:Object,default:()=>({})}},render(t){var s;const i=n=>{var a;if(!n)return null;{const d=(a=n.$slots)==null?void 0:a[this.name];return d?d(this.slotProps):null}},l=n=>{var a,d,c,h;return n?((d=(a=n.$)==null?void 0:a.type)==null?void 0:d.name)==="TmTable"||((h=(c=n.$)==null?void 0:c.type)==null?void 0:h.__name)==="TmTable":!1};let o=i(this.$parent);if(!o){let n=(s=this.$parent)==null?void 0:s.$parent;for(;n&&!o;){if(l(n)){o=i(n);break}n=n.$parent}}return o||null}},{t:dt}=w(),ht=!1,ut=!0,mt=["date","daterange","datetime","datetimerange","year","month","dates","months","years","week","monthrange"],pt={name:"TmTableSearch",components:{TmSelect:I,TmAdvancedInput:W,TmAdvancedDate:U,TmCascader:j,TmRadio:J,TmCheckbox:K,TmSwitch:Q,DynamicSlot:ct},props:{disabled:{type:Boolean,default:!1},searchColumns:{type:Array,default:null},searchForm:{type:Object,default:()=>({})}},data(){return{t:dt,isVue2:ht,isVue3:ut,getCompatSize:D,getDefaultSize:T,DATE_TYPES:mt,defaultValues:{}}},computed:{computedSearchForm:{get(){return this.searchForm},set(t){this.$emit("update:search-form",t)}}},mounted(){this.initDefaultValues()},methods:{isDateType(t){return this.DATE_TYPES.includes(t)},hasDefaultSlot(){const t=this.$slots.default;return t?this.isVue2?Array.isArray(t)?t.some(i=>!i.data||!i.data.slot):!!t:t()[0].children.length>0:!1},handleUpdate(t,i,l){const o=this.getFieldValue(t,l);o&&this.$emit("update:search-form",F(b({},this.computedSearchForm),{[o]:i}))},handleUpdateDate(t,i){const l=i||[],o=this.getFieldValue(t,"start"),s=this.getFieldValue(t,"end"),n=this.getFieldValue(t,"value"),a={};o&&(a[o]=l[0]),s&&(a[s]=l[1]),n&&(a[n]=l),this.$emit("update:search-form",b(b({},this.computedSearchForm),a))},getFieldValue(t,i){if(typeof t=="string")return t;if(t.fields&&i in t.fields){const l=t.fields[i];if(typeof l=="string")return l;if(Array.isArray(l))return l[0];if(l&&typeof l=="object")return l.name}},getFieldDefault(t,i){if(t.fields&&i in t.fields){const l=t.fields[i];if(Array.isArray(l)&&l.length>1)return l[1];if(l&&typeof l=="object"&&"default"in l)return l.default}},hasSearchSlot(t){var o,s,n,a;const i=d=>{var c;return d?!!((c=d.$slots)!=null&&c[t]):!1};if(i(this))return!0;let l=this.$parent;for(;l;){if((((s=(o=l.$)==null?void 0:o.type)==null?void 0:s.name)==="TmTable"||((a=(n=l.$)==null?void 0:n.type)==null?void 0:a.__name)==="TmTable")&&i(l))return!0;l=l.$parent}return!1},initDefaultValues(){if(!this.searchColumns||!this.searchColumns.length)return;const t={};this.searchColumns.forEach(i=>{if(typeof i=="string"||!i.fields)return;const l=this.getFieldValue(i,"value"),o=this.getFieldValue(i,"label");if(i.type==="input"&&i.labelOptions&&i.labelOptions.length>0){const n=i.labelOptions[0];if(o)if(o in this.computedSearchForm)t[o]=this.computedSearchForm[o];else{const a=this.getFieldDefault(i,"label");a!==void 0?t[o]=a:n&&n.value!==void 0&&(t[o]=n.value)}l&&!(l in this.computedSearchForm)&&(t[l]="")}else if(this.isDateType(i.type)&&i.labelOptions&&i.labelOptions.length>0){const n=i.labelOptions[0];if(l&&!(l in this.computedSearchForm)&&(t[l]=[]),o)if(o in this.computedSearchForm)t[o]=this.computedSearchForm[o];else{const a=this.getFieldDefault(i,"label");a!==void 0?t[o]=a:n&&n.value!==void 0&&(t[o]=n.value)}}else if(i.type==="select"&&i.labelOptions&&i.labelOptions.length>0){const n=i.labelOptions[0];if(l&&!(l in this.computedSearchForm)&&(t[l]=i.multiple?[]:""),o)if(o in this.computedSearchForm)t[o]=this.computedSearchForm[o];else{const a=this.getFieldDefault(i,"label");a!==void 0?t[o]=a:n&&n.value!==void 0&&(t[o]=n.value)}}const s=this.getFieldDefault(i,"value");if(l&&s!==void 0&&!(l in this.computedSearchForm)?this.isDateType(i.type)&&!Array.isArray(s)?t[l]=[]:i.type==="checkbox"&&!Array.isArray(s)?t[l]=s?[s]:[]:i.type==="switch"&&typeof s!="boolean"?t[l]=!!s:t[l]=s:l&&!(l in this.computedSearchForm)&&(i.type==="checkbox"?t[l]=[]:i.type==="switch"&&(t[l]=!1)),this.isDateType(i.type)){const n=this.getFieldValue(i,"start"),a=this.getFieldValue(i,"end"),d=this.getFieldDefault(i,"start"),c=this.getFieldDefault(i,"end");n&&d!==void 0&&!(n in this.computedSearchForm)&&(t[n]=d),a&&c!==void 0&&!(a in this.computedSearchForm)&&(t[a]=c)}}),this.defaultValues=t,this.$emit("update:search-form",b(b({},t),this.computedSearchForm))},getSearchForm(){return this.computedSearchForm},handleSearch(){setTimeout(()=>{this.$emit("search",this.computedSearchForm)})},handleReset(){this.$emit("update:search-form",b({},this.defaultValues)),this.$emit("reset")}}},ft={class:"search-content"},gt={class:"search-actions"};function bt(t,i,l,o,s,n){const a=e.resolveComponent("dynamic-slot"),d=e.resolveComponent("tm-advanced-input"),c=e.resolveComponent("tm-advanced-date"),h=e.resolveComponent("tm-select"),p=e.resolveComponent("tm-cascader"),V=e.resolveComponent("tm-radio"),x=e.resolveComponent("tm-checkbox"),k=e.resolveComponent("tm-switch"),L=e.resolveComponent("el-button");return e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["table-search",`table-search--${s.isVue2?"v2":"v3"}`])},[e.createElementVNode("div",ft,[n.hasDefaultSlot()?e.renderSlot(t.$slots,"default",{key:0},void 0,!0):l.searchColumns&&l.searchColumns.length?(e.openBlock(!0),e.createElementBlock(e.Fragment,{key:1},e.renderList(l.searchColumns,(r,z)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[typeof r=="string"?(e.openBlock(),e.createElementBlock("div",{key:`str-${r}-${z}`,class:"search-item"},[(e.openBlock(),e.createBlock(a,{name:`search-${r}`,"slot-props":{searchForm:l.searchForm},key:r},null,8,["name","slot-props"]))])):(e.openBlock(),e.createElementBlock("div",{key:`obj-${z}`,class:"search-item"},[r.fields?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[n.hasSearchSlot(`search-${n.getFieldValue(r,"value")}`)?(e.openBlock(),e.createBlock(a,{name:`search-${n.getFieldValue(r,"value")}`,"slot-props":{searchForm:l.searchForm,col:r},key:n.getFieldValue(r,"value")},null,8,["name","slot-props"])):(e.openBlock(),e.createElementBlock("div",{style:{display:"flex"},key:n.getFieldValue(r,"value")||`col-${z}`},[r.type==="input"?(e.openBlock(),e.createBlock(d,{key:0,label:r.label,value:n.computedSearchForm[n.getFieldValue(r,"value")],field:n.computedSearchForm[n.getFieldValue(r,"label")],onValueChange:f=>n.handleUpdate(r,f,"value"),onFieldChange:f=>n.handleUpdate(r,f,"label"),multiple:r.multiple,labelOptions:r.labelOptions,placeholder:r.placeholder,onSearch:n.handleSearch},null,8,["label","value","field","onValueChange","onFieldChange","multiple","labelOptions","placeholder","onSearch"])):e.createCommentVNode("",!0),n.isDateType(r.type)?(e.openBlock(),e.createBlock(c,{key:1,type:r.type,label:r.label,value:n.computedSearchForm[n.getFieldValue(r,"value")],field:n.computedSearchForm[n.getFieldValue(r,"label")],start:n.computedSearchForm[n.getFieldValue(r,"start")],end:n.computedSearchForm[n.getFieldValue(r,"end")],onFieldChange:f=>n.handleUpdate(r,f,"label"),onValueChange:f=>n.handleUpdateDate(r,f),onStartChange:f=>n.handleUpdateDate(r,f),onEndChange:f=>n.handleUpdateDate(r,f),labelOptions:r.labelOptions,"start-placeholder":r.startPlaceholder,"end-placeholder":r.endPlaceholder,placeholder:r.placeholder,"range-separator":r.rangeSeparator,disabled:r.disabled,clearable:r.clearable,readonly:r.readonly,editable:r.editable,align:r.align,"popper-class":r.popperClass,"default-value":r.defaultValue,"default-time":r.defaultTime,shortcuts:r.shortcuts,"past-only":r.pastOnly,format:r.format},null,8,["type","label","value","field","start","end","onFieldChange","onValueChange","onStartChange","onEndChange","labelOptions","start-placeholder","end-placeholder","placeholder","range-separator","disabled","clearable","readonly","editable","align","popper-class","default-value","default-time","shortcuts","past-only","format"])):e.createCommentVNode("",!0),r.type==="select"?(e.openBlock(),e.createBlock(h,{key:2,label:r.label,modelValue:n.computedSearchForm[n.getFieldValue(r,"value")],"onUpdate:modelValue":f=>n.computedSearchForm[n.getFieldValue(r,"value")]=f,field:n.computedSearchForm[n.getFieldValue(r,"label")],options:r.options,labelOptions:r.labelOptions,placeholder:r.placeholder,multiple:r.multiple,"show-check-all":r.checkAll,onFieldChange:f=>n.handleUpdate(r,f,"label")},null,8,["label","modelValue","onUpdate:modelValue","field","options","labelOptions","placeholder","multiple","show-check-all","onFieldChange"])):e.createCommentVNode("",!0),r.type==="cascader"?(e.openBlock(),e.createBlock(p,{key:3,modelValue:n.computedSearchForm[n.getFieldValue(r,"value")],"onUpdate:modelValue":f=>n.computedSearchForm[n.getFieldValue(r,"value")]=f,label:r.label,options:r.options,labelOptions:r.labelOptions,props:r.props,placeholder:r.placeholder,"show-check-all":r.checkAll},null,8,["modelValue","onUpdate:modelValue","label","options","labelOptions","props","placeholder","show-check-all"])):e.createCommentVNode("",!0),r.type==="radio"?(e.openBlock(),e.createBlock(V,{key:4,modelValue:n.computedSearchForm[n.getFieldValue(r,"value")],"onUpdate:modelValue":f=>n.computedSearchForm[n.getFieldValue(r,"value")]=f,label:r.label,options:r.options,props:r.props},null,8,["modelValue","onUpdate:modelValue","label","options","props"])):e.createCommentVNode("",!0),r.type==="checkbox"?(e.openBlock(),e.createBlock(x,{key:5,modelValue:n.computedSearchForm[n.getFieldValue(r,"value")],"onUpdate:modelValue":f=>n.computedSearchForm[n.getFieldValue(r,"value")]=f,label:r.label,options:r.options,props:r.props},null,8,["modelValue","onUpdate:modelValue","label","options","props"])):e.createCommentVNode("",!0),r.type==="switch"?(e.openBlock(),e.createBlock(k,{key:6,modelValue:n.computedSearchForm[n.getFieldValue(r,"value")],"onUpdate:modelValue":f=>n.computedSearchForm[n.getFieldValue(r,"value")]=f,"active-text":r.activeText,"inactive-text":r.inactiveText,label:r.label,"active-color":r.activeColor,"inactive-color":r.inactiveColor},null,8,["modelValue","onUpdate:modelValue","active-text","inactive-text","label","active-color","inactive-color"])):e.createCommentVNode("",!0)]))],64)):(e.openBlock(),e.createElementBlock("div",{key:`error-${z}`,class:"search-error-message"}," 缺少 fields 配置,无法渲染此组件 "))]))],64))),256)):e.createCommentVNode("",!0),e.createElementVNode("div",gt,[e.createVNode(L,{type:"primary",size:s.getDefaultSize(),onClick:n.handleSearch},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("query")),1)]),_:1},8,["size","onClick"]),e.createVNode(L,{size:s.getDefaultSize(),onClick:n.handleReset},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("reset")),1)]),_:1},8,["size","onClick"])])])],2)}const q=y(pt,[["render",bt],["__scopeId","data-v-54d5e2a2"]]),yt=!1,Ct={name:"TablePagination",props:{current:{type:Number,default:1},small:{type:Boolean,default:!0},pageSize:{type:Number,default:20},total:{type:Number,default:0}},data(){return{isVue2:yt,getCompatSize:D}},methods:{handleSizeChange(t){this.$emit("size-change",t)},handleCurrentChange(t){this.$emit("current-change",t)}}},kt={class:"tm-pagination"};function Vt(t,i,l,o,s,n){const a=e.resolveComponent("el-pagination");return e.openBlock(),e.createElementBlock("div",kt,[e.createVNode(a,e.mergeProps(t.$attrs,e.toHandlers(s.isVue2?t.$listeners:{}),{style:{"text-align":"right"},"current-page":l.current,"page-size":l.pageSize,total:l.total,"page-sizes":[10,20,50,100,300,500,1e3,2e3],size:s.getCompatSize("mini"),layout:"total, sizes, prev, pager, next, jumper",onSizeChange:n.handleSizeChange,"onUpdate:currentPage":i[0]||(i[0]=d=>t.$emit("update:current",d)),"onUpdate:pageSize":i[1]||(i[1]=d=>t.$emit("update:pageSize",d)),onCurrentChange:n.handleCurrentChange}),null,16,["current-page","page-size","total","size","onSizeChange","onCurrentChange"])])}const xt=y(Ct,[["render",Vt],["__scopeId","data-v-4dbdf6e7"]]),_t={name:"TmTableMenu",props:{size:{type:String,default:"mini"}}},St={size:"small",class:"tm-table-menu",inline:""},Tt={class:"left"},wt={class:"right"};function zt(t,i,l,o,s,n){return e.openBlock(),e.createElementBlock("div",St,[e.createElementVNode("div",Tt,[e.renderSlot(t.$slots,"left",{},void 0,!0)]),e.createElementVNode("div",wt,[e.renderSlot(t.$slots,"right",{},void 0,!0)])])}const Ft=y(_t,[["render",zt],["__scopeId","data-v-579dd2c3"]]),H=t=>t?t.props||{}:{},Y=(t,i)=>{t&&(t.props||(t.props={}),typeof i=="object"&&Object.assign(t.props,i))},A={getTableConfig(t){try{const i=localStorage.getItem(`tm-table-config-${t}`);return Promise.resolve({data:{code:200,data:i}})}catch(i){return Promise.reject(i)}},setTableConfig(t){try{return localStorage.setItem(`tm-table-config-${t.key}`,t.info),Promise.resolve({data:{code:200,message:"success"}})}catch(i){return Promise.reject(i)}}},Bt=t=>A.getTableConfig(t.key),Lt=t=>A.setTableConfig(t),Et=t=>{t&&(typeof t.getTableConfig=="function"&&(A.getTableConfig=t.getTableConfig),typeof t.setTableConfig=="function"&&(A.setTableConfig=t.setTableConfig))},{t:Dt}=w(),Ot=!1,Nt=!0,Mt={formatter:(t,i,l,o)=>[void 0,null,""].includes(l)?"-":l},Ht={name:"TmColumnConfig",components:{MoveIcon:xe,FixedLeftIcon:Se,FixedRightIcon:Te,UploadIcon:we,DownloadIcon:ze,DeleteIcon:Fe,MenuIcon:ke,tmEllipsisText:B},props:{columns:{type:Array,default:()=>[]},tableKey:{type:String,default:"",required:!0},defaultColumns:{type:Array,default:()=>[]},maxFixedLeftQuantity:{type:[Number,String],default:void 0},maxFixedRightQuantity:{type:[Number,String],default:void 0},ignoredColumnConfigTypes:{type:Array,default:()=>["selection"]}},data(){return{t:Dt,isVue2:Ot,isVue3:Nt,getDefaultSize:T,getCompatSize:D,buttonType:{link:!0,type:"primary"},afterOpenDelay:{"show-after":300},popoverVisible:!1,keyWord:"",sortedTableColumns:[],tableColumns:[],defaultColumnsConfig:[],columnMap:{},processedColumns:[],placement:"bottom",isDraggingFrozen:!1,isDraggingFrozenRight:!1,sortable:null,isConfigLoaded:!1,columnsCopy:[]}},computed:{filteredSortedTableColumns(){return this.keyWord?this.sortedTableColumns.filter(t=>this.getColumnLabel(t.prop).includes(this.keyWord)):this.sortedTableColumns},showFixedLimitTips(){return this.maxFixedLeftQuantity!==void 0||this.maxFixedRightQuantity!==void 0},isThanMaxFrozen(){return this.maxFixedLeftQuantity===void 0?!1:this.sortedTableColumns.filter(t=>t.fixed==="left").length>=this.maxFixedLeftQuantity},isThanMaxRightFrozen(){return this.maxFixedRightQuantity===void 0?!1:this.sortedTableColumns.filter(t=>t.fixed==="right").length>=this.maxFixedRightQuantity},computedTableKey(){if(this.tableKey)return this.tableKey;if(this.$route&&this.$route.path)return this.$route.path.slice(1).replace(/\//g,"-");throw new Error("tableKey is required")}},watch:{popoverVisible(t){t||this.handlePopoverHide()},columns:{handler(t){t&&t.length>0&&!this.isConfigLoaded&&this.initializeColumnConfig()},immediate:!0},tableColumns:{handler(t){t!=null&&t.length&&(this.initSortedTableColumns(),this.crateSortable(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)))},deep:!0}},methods:{findLastIndex(t,i){for(let l=t.length-1;l>=0;l--)if(i(t[l],l,t))return l;return-1},getColumnLabel(t){return!t||!this.columnMap[t]?t||"":H(this.columnMap[t]).label||t},initializeColumnConfig(){this.defaultColumns&&this.defaultColumns.length>0?this.defaultColumnsConfig=this.defaultColumns:this.processOriginalColumns(),this.loadColumnConfig()},processOriginalColumns(){const t=this.columns||[];let i={};this.defaultColumnsConfig=t.filter(l=>{const o=H(l);return!(!o.prop||this.ignoredColumnConfigTypes.includes(o.type))}).map((l,o)=>{const s=H(l),n=b(b({},Mt),s);Y(l,n),s.prop&&(i[s.prop]=l);const a=s.hasOwnProperty("visible")?s.visible!==!1:!0;return{prop:s.prop,fixed:s.fixed||"",sort:o,cancellable:s.hasOwnProperty("cancellable")?s.cancellable:!0,visible:a}}),this.columnMap=i},loadColumnConfig(){Bt({key:this.computedTableKey}).then(t=>{var l;if(t.data.code!==200)return;let i=JSON.parse(((l=t.data)==null?void 0:l.data)||null)||{};i.columnsConfig&&JSON.stringify(this.defaultColumnsConfig)===JSON.stringify(i.defaultColumnsConfig)?this.tableColumns=i.columnsConfig.map(o=>b({},o)):this.tableColumns=this.defaultColumnsConfig.map(o=>b({},o)),this.processedColumns=this.applyColumnConfig(this.tableColumns),this.isConfigLoaded=!0,this.$emit("complete",{columns:this.processedColumns,isInitialLoad:!0})}).catch(()=>{this.tableColumns=this.defaultColumnsConfig.map(t=>b({},t)),this.processedColumns=this.applyColumnConfig(this.tableColumns),this.isConfigLoaded=!0,this.$emit("complete",{columns:this.processedColumns,isInitialLoad:!0})})},applyColumnConfig(t,i=!1){let l=this.columns.filter(s=>{const n=H(s);return this.ignoredColumnConfigTypes.includes(n.type)}),o=[];return[...t].sort((s,n)=>{const a=s.sort!==void 0?s.sort:1/0,d=n.sort!==void 0?n.sort:1/0;return a-d}).forEach(s=>{if(s.prop){let n=this.columnMap[s.prop];n&&(Y(n,{fixed:s.fixed||void 0,visible:s.visible}),(!i&&s.visible||i)&&o.push(n))}}),l.forEach(s=>{Y(s,{visible:!0})}),[...l,...o]},crateSortable(){const t=this.$refs.sortListRef;if(!t)return;this.sortable&&(this.sortable.destroy(),this.sortable=null);const i=new g(t,{ghostClass:"blue-background-class",animation:150,easing:"cubic-bezier(1, 0, 0, 1)",handle:".row-title",draggable:".sort-item-wrapper",fallbackOnBody:!1,preventOnFilter:!0,removeCloneOnHide:!0,group:"columns",dragClass:"sortable-drag",onStart:({item:l})=>{const o=l.getAttribute("data-prop"),s=this.sortedTableColumns.find(n=>n.prop===o);this.isDraggingFrozen=s&&s.fixed==="left",this.isDraggingFrozenRight=s&&s.fixed==="right",this.draggedItemIndex=Array.from(t.children).indexOf(l),l.classList.add("sortable-drag")},onMove:l=>{const{target:o,related:s}=l;if(!o||!s)return!1;const n=s?s.getAttribute("data-prop"):null,a=n?this.sortedTableColumns.find(h=>h.prop===n):null,d=a&&a.fixed==="left",c=a&&a.fixed==="right";return this.isDraggingFrozen&&!d||this.isDraggingFrozenRight&&!c||!this.isDraggingFrozen&&!this.isDraggingFrozenRight&&(d||c)?(o.classList.add("no-drop-zone"),!1):(document.querySelectorAll(".no-drop-zone").forEach(h=>{h.classList.remove("no-drop-zone")}),!0)},onEnd:({item:l,newIndex:o,oldIndex:s})=>{if(o===void 0||s===void 0||o<0||s<0||o>=this.sortedTableColumns.length||s>=this.sortedTableColumns.length)return;document.querySelectorAll(".no-drop-zone").forEach(V=>{V.classList.remove("no-drop-zone")}),l.classList.remove("sortable-drag");const n=this.sortedTableColumns[s],a=n.fixed==="left",d=n.fixed==="right",c=o>0?this.sortedTableColumns[o-1]:null,h=o<this.sortedTableColumns.length-1?this.sortedTableColumns[o+1]:null;let p=!1;if(a?(c&&c.fixed!=="left"||h&&h.fixed==="right")&&(p=!0):d?(c&&c.fixed!=="right"||h&&h.fixed!=="right")&&(p=!0):(c&&c.fixed==="right"||h&&h.fixed==="left")&&(p=!0),p){this.rollbackSort();return}this.updateSortAfterDrag()}});this.sortable=i},rollbackSort(){this.sortedTableColumns=JSON.parse(JSON.stringify(this.columnsCopy))},updateSortAfterDrag(){const t=this.$refs.sortListRef;if(!t)return;Array.from(t.children||[]).filter(l=>l&&l.dataset&&l.dataset.prop).map(l=>l.dataset.prop).forEach((l,o)=>{this.sortedTableColumns.some(s=>s.prop===l?(s.sort=o,!0):!1)}),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},init(){this.tableColumns=Array.isArray(this.tableColumns)?[...this.tableColumns]:Array.isArray(this.defaultColumnsConfig)?[...this.defaultColumnsConfig]:[],this.initSortedTableColumns()},initSortedTableColumns(){this.tableColumns.forEach((t,i)=>{t.sort===void 0&&(t.sort=i)}),this.sortedTableColumns=[...this.tableColumns].sort((t,i)=>t.fixed==="left"&&i.fixed!=="left"?-1:t.fixed!=="left"&&i.fixed==="left"||t.fixed==="right"&&i.fixed!=="right"?1:t.fixed!=="right"&&i.fixed==="right"?-1:t.sort-i.sort)},setPlacement(){const i=this.$refs.operationRef.$el.getBoundingClientRect();(window.innerHeight||document.documentElement.clientHeight)-(i.bottom-window.scrollY)>512?this.placement="bottom":this.placement="left"},handleVisibleChange(t){this.popoverVisible=t},handlePopoverShow(){this.setPlacement(),this.init(),(()=>{try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove)}catch(i){}})(),this.$nextTick(()=>{this.crateSortable()})},handlePopoverHide(){this.sortable&&(this.sortable.destroy(),this.sortable=null);try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove),typeof g!="undefined"&&g.utils&&(document.removeEventListener("mousemove",g.utils.throttleCall),document.removeEventListener("mouseup",g.utils.throttleCall))}catch(t){}},handleSelectAll(){const t=this.tableColumns.some(i=>!i.visible);this.tableColumns.forEach(i=>{i.cancellable&&(i.visible=t)})},handleRestoreDefault(){this.tableColumns=JSON.parse(JSON.stringify(this.defaultColumnsConfig)),this.sortedTableColumns=[...this.tableColumns].sort((t,i)=>t.sort-i.sort)},canMoveTop(t,i){if(i===0)return!1;if(t.fixed==="left"){const l=this.sortedTableColumns[i-1];return l&&l.fixed==="left"}if(!t.fixed){const l=this.sortedTableColumns[i-1];return l&&l.fixed==="left"?!1:l&&!l.fixed}return t.fixed==="right"},moveTop(t,i){const l=this.sortedTableColumns,o=t.prop;if(t.fixed==="right"&&(t.fixed=""),t.fixed==="left")l.unshift(l.splice(i,1)[0]);else{const s=this.findLastIndex(this.sortedTableColumns,n=>n.fixed==="left");l.splice(s+1,0,l.splice(i,1)[0])}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns),this.$nextTick(()=>{const s=this.$refs.sortListRef;if(s){const n=Array.from(s.children).find(a=>a.dataset&&a.dataset.prop===o);n&&n.scrollIntoView({behavior:"smooth",block:"nearest"})}})},frozenLeftHandle(t){const i=this.sortedTableColumns,l=i.splice(t,1)[0];if(l.fixed=l.fixed==="left"?"":"left",l.fixed==="left"){const o=this.findLastIndex(this.sortedTableColumns,s=>s.fixed==="left");i.splice(o+1,0,l)}else{const o=this.findLastIndex(this.sortedTableColumns,s=>s.fixed==="left");i.splice(o+1,0,l)}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},frozenRightHandle(t){const i=this.sortedTableColumns,l=i.splice(t,1)[0];if(l.fixed=l.fixed==="right"?"":"right",l.fixed==="right"){const o=i.findIndex(s=>s.fixed==="right");o===-1?i.push(l):i.splice(o,0,l)}else{const o=i.findIndex(s=>s.fixed==="right");o===-1?i.push(l):i.splice(o,0,l)}this.updateSortValues(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)),this.$emit("on-sort-change",this.sortedTableColumns)},onSave(){var i;this.updateSortValues();const t=(i=this.tableColumns)==null?void 0:i.map(l=>{const o=this.sortedTableColumns.find(d=>d.prop===l.prop);o&&(l.sort=o.sort,l.fixed=o.fixed,l.visible=o.visible);const a=l,{label:s}=a;return oe(a,["label"])});Lt({key:this.computedTableKey,info:JSON.stringify({columnsConfig:t,defaultColumnsConfig:this.defaultColumnsConfig})}).then(l=>{l.data.code===200&&(this.processedColumns=this.applyColumnConfig(t,!0),this.$emit("complete",{columns:this.processedColumns,isInitialLoad:!1}),this.$message.success(this.t("saveSuccess")),this.popoverVisible=!1)})},updateSortValues(){this.sortedTableColumns.forEach((t,i)=>{t.sort=i})}},mounted(){var t;(t=this.tableColumns)!=null&&t.length&&(this.initSortedTableColumns(),this.crateSortable(),this.columnsCopy=JSON.parse(JSON.stringify(this.sortedTableColumns)))},beforeDestroy(){this.sortable&&(this.sortable.destroy(),this.sortable=null);try{document.removeEventListener("mouseup",window.sortableGlobalMouseUp),document.removeEventListener("mousemove",window.sortableGlobalMouseMove),typeof g!="undefined"&&g.utils&&(document.removeEventListener("mousemove",g.utils.throttleCall),document.removeEventListener("mouseup",g.utils.throttleCall))}catch(t){}}},At={key:0,class:"container"},Rt={class:"main-container"},Pt={class:"left-content"},It={class:"title"},vt={class:"option-list"},Wt={style:{height:"100%","overflow-y":"auto"}},Ut={class:"right-content"},jt={class:"search-box"},Jt={key:0,class:"tips"},Kt={class:"sort-list",ref:"sortListRef"},Qt=["data-prop"],qt={key:0,class:"sort-item"},Yt={class:"row-title"},Gt={class:"operation-btns"},Xt={class:"footer"},Zt={class:"footer-left"},$t={class:"footer-right"},el={style:{display:"inline-block","margin-left":"10px"}};function tl(t,i,l,o,s,n){const a=e.resolveComponent("el-button"),d=e.resolveComponent("TmEllipsisText"),c=e.resolveComponent("el-checkbox"),h=e.resolveComponent("el-input"),p=e.resolveComponent("MoveIcon"),V=e.resolveComponent("DeleteIcon"),x=e.resolveComponent("el-tooltip"),k=e.resolveComponent("UploadIcon"),L=e.resolveComponent("FixedLeftIcon"),r=e.resolveComponent("FixedRightIcon"),z=e.resolveComponent("MenuIcon"),f=e.resolveComponent("el-popover");return e.openBlock(),e.createBlock(f,e.mergeProps({"popper-class":"column-config-popover"},{[s.isVue3?"visible":"value"]:s.popoverVisible},e.toHandlers({[s.isVue3?"update:visible":"input"]:n.handleVisibleChange}),{width:680,"show-arrow":!1,placement:s.placement,trigger:"click",onShow:n.handlePopoverShow,onHide:n.handlePopoverHide}),{reference:e.withCtx(()=>[e.createElementVNode("div",el,[e.createVNode(x,e.mergeProps({content:s.t("columnSetting")},s.afterOpenDelay,{placement:"top"}),{default:e.withCtx(()=>[e.createVNode(a,{size:s.getDefaultSize(),ref:"operationRef",circle:""},{default:e.withCtx(()=>[e.createVNode(z)]),_:1},8,["size"])]),_:1},16,["content"])])]),default:e.withCtx(()=>[s.popoverVisible?(e.openBlock(),e.createElementBlock("div",At,[e.createElementVNode("div",Rt,[e.createElementVNode("div",Pt,[e.createElementVNode("div",It,[e.createElementVNode("span",null,e.toDisplayString(s.t("SelectableFields"))+"("+e.toDisplayString(s.tableColumns.length)+")",1),e.createVNode(a,e.mergeProps({style:{"margin-left":"10px"}},s.buttonType,{onClick:n.handleSelectAll}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("all")),1)]),_:1},16,["onClick"])]),e.createElementVNode("div",vt,[e.createElementVNode("div",Wt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.tableColumns,(m,E)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[m.prop?(e.openBlock(),e.createElementBlock("div",{style:{width:"110px",display:"inline-block"},key:E+m.prop},[e.createVNode(c,{disabled:!m.cancellable,class:"el-checkbox",modelValue:m.visible,"onUpdate:modelValue":O=>m.visible=O,label:m.prop,value:m.prop},{default:e.withCtx(()=>[e.createVNode(d,{width:"80px",text:n.getColumnLabel(m.prop)},null,8,["text"])]),_:2},1032,["disabled","modelValue","onUpdate:modelValue","label","value"])])):e.createCommentVNode("",!0)],64))),256))])])]),e.createElementVNode("div",Ut,[e.createElementVNode("div",jt,[e.createVNode(h,{size:s.getCompatSize("small"),class:"search-input",clearable:"",placeholder:s.t("search"),modelValue:s.keyWord,"onUpdate:modelValue":i[0]||(i[0]=m=>s.keyWord=m)},null,8,["size","placeholder","modelValue"])]),n.showFixedLimitTips?(e.openBlock(),e.createElementBlock("div",Jt)):e.createCommentVNode("",!0),e.createElementVNode("div",Kt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.filteredSortedTableColumns,(m,E)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["sort-item-wrapper",[m.fixed==="left"?"frozen":"",m.fixed==="right"?"frozenRight":"",m.fixed?"":"noFrozen"]]),"data-prop":m.prop,key:m.prop},[m.visible?(e.openBlock(),e.createElementBlock("div",qt,[e.createElementVNode("div",Yt,[e.createVNode(p,{style:{"flex-shrink":"0"}}),e.createVNode(d,{text:n.getColumnLabel(m.prop)},null,8,["text"])]),e.createElementVNode("div",Gt,[m.cancellable?(e.openBlock(),e.createBlock(x,e.mergeProps({key:0,content:s.t("cancel"),placement:"top"},{ref_for:!0},s.afterOpenDelay),{default:e.withCtx(()=>[e.createVNode(a,e.mergeProps({ref_for:!0},s.buttonType,{size:s.getCompatSize("mini"),class:"iconfont-button delete-button",onClick:O=>m.visible=!1}),{default:e.withCtx(()=>[e.createVNode(V)]),_:2},1040,["size","onClick"])]),_:2},1040,["content"])):e.createCommentVNode("",!0),n.canMoveTop(m,E)?(e.openBlock(),e.createBlock(x,e.mergeProps({key:1,content:s.t("top"),placement:"top"},{ref_for:!0},s.afterOpenDelay),{default:e.withCtx(()=>[e.createVNode(a,e.mergeProps({ref_for:!0},s.buttonType,{size:s.getCompatSize("mini"),class:"iconfont-button top-button",onClick:O=>n.moveTop(m,E)}),{default:e.withCtx(()=>[e.createVNode(k)]),_:2},1040,["size","onClick"])]),_:2},1040,["content"])):e.createCommentVNode("",!0),m.fixed!=="right"?(e.openBlock(),e.createBlock(x,e.mergeProps({key:2,content:m.fixed==="left"?s.t("cancelLeftFixed"):s.t("leftFixed"),placement:"top"},{ref_for:!0},s.afterOpenDelay),{default:e.withCtx(()=>[e.createVNode(a,e.mergeProps({ref_for:!0},s.buttonType,{size:s.getCompatSize("mini"),class:["iconfont-button left-fixed-btn",{"active-fixed":m.fixed==="left"}],onClick:O=>n.frozenLeftHandle(E),disabled:m.fixed!=="left"&&n.isThanMaxFrozen}),{default:e.withCtx(()=>[e.createVNode(L)]),_:2},1040,["size","class","onClick","disabled"])]),_:2},1040,["content"])):e.createCommentVNode("",!0),m.fixed!=="left"?(e.openBlock(),e.createBlock(x,e.mergeProps({key:3,content:m.fixed==="right"?s.t("cancelRightFixed"):s.t("rightFixed"),placement:"top"},{ref_for:!0},s.afterOpenDelay),{default:e.withCtx(()=>[e.createVNode(a,e.mergeProps({ref_for:!0},s.buttonType,{size:s.getCompatSize("mini"),class:["iconfont-button right-fixed-btn",{"active-fixed":m.fixed==="right"}],onClick:O=>n.frozenRightHandle(E),disabled:m.fixed!=="right"&&n.isThanMaxRightFrozen}),{default:e.withCtx(()=>[e.createVNode(r)]),_:2},1040,["size","class","onClick","disabled"])]),_:2},1040,["content"])):e.createCommentVNode("",!0)])])):e.createCommentVNode("",!0)],10,Qt))),128))],512)])]),e.createElementVNode("div",Xt,[e.createElementVNode("div",Zt,[e.createVNode(a,{size:s.getCompatSize("mini"),onClick:n.handleRestoreDefault},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("restoreDefault")),1)]),_:1},8,["size","onClick"])]),e.createElementVNode("div",$t,[e.createVNode(a,{size:s.getCompatSize("mini"),onClick:i[1]||(i[1]=m=>s.popoverVisible=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("cancel")),1)]),_:1},8,["size"]),e.createVNode(a,{size:s.getCompatSize("mini"),type:"primary",onClick:n.onSave},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.t("saveAndApply")),1)]),_:1},8,["size","onClick"])])])])):e.createCommentVNode("",!0)]),_:1},16,["placement","onShow","onHide"])}const ll=y(Ht,[["render",tl],["__scopeId","data-v-127cbd33"]]),il=!1,sl=!0;function G(t){if(!Array.isArray(t))return t;const i=[];for(const l of t)if(l)if(typeof l.type=="symbol"&&l.children){let o=l.children;if(typeof o=="function")continue;if(Array.isArray(o)){const s=G(o);i.push(...s)}else{const s=G([o]);i.push(...s)}}else i.push(l);return i}const nl={name:"TmTable",components:{TableSearch:q,TablePagination:xt,TableMenu:Ft,ColumnConfig:ll,RefreshIcon:Ve,ColumnRenderer:{props:["vnode"],render(){return this.vnode}}},inheritAttrs:!1,props:{data:{type:[Array,Function],default:()=>[]},showSearch:{type:Boolean,default:!0},showMenu:{type:Boolean,default:!0},showPagination:{type:Boolean,default:!0},pagination:{type:Object,default:()=>({})},height:{type:[String,Number]},calcHeight:{type:Number,default:0},dataAdapter:{type:Function,default:null},columnSettingButton:{type:Boolean,default:!0},refreshButton:{type:Boolean,default:!0},tableKey:{type:String,default:""},firstLoad:{type:Boolean,default:!0},maxFixedLeftQuantity:{type:Number},maxFixedRightQuantity:{type:Number},border:{type:Boolean,default:!0},searchColumns:{type:Array,default:null},searchForm:{type:Object,default:()=>({})}},data(){return{getDefaultSize:T,getCompatSize:D,isVue3:sl,isVue2:il,t:w().t,tableData:[],tableLoading:!1,columnsLoading:!1,tableReload:1,tableHeight:null,selectedRows:[],paginationInfo:{current:1,pageSize:20,total:void 0},originalColumns:[],displayColumns:[],isColumnConfigLoaded:!1,afterOpenDelay:{"show-after":300}}},computed:{pageLoading(){return this.tableLoading||this.columnsLoading},computedTableKey(){if(this.tableKey)return this.tableKey;if(this.$route&&this.$route.path)return this.$route.path.slice(1).replace(/\//g,"-");throw new Error("tableKey is required")},computedShowPagination(){return this.showPagination&&typeof this.data=="function"}},watch:{data:{immediate:!0,handler(t){typeof t=="function"?!this.columnSettingButton||this.isColumnConfigLoaded&&!this.firstLoad?this.loadData():Array.isArray(t)&&(this.tableData=t):this.tableData=t}},height:{immediate:!0,handler(){this.getTableHeight()}}},created(){{const t=this.$slots.default();this.originalColumns=G(t)}this.columnSettingButton?this.columnsLoading=!0:(this.displayColumns=this.originalColumns,this.isColumnConfigLoaded=!0)},mounted(){this.getTableHeight(),window.addEventListener("resize",this.getTableHeight)},beforeDestroy(){window.removeEventListener("resize",this.getTableHeight)},methods:{handleUpdateSearchForm(t){this.$emit("update:search-form",t)},handleColumnConfigComplete(t){Array.isArray(t.columns)?this.displayColumns=[...t.columns]:this.displayColumns=[...this.originalColumns],t.isInitialLoad?(this.isColumnConfigLoaded=!0,this.columnsLoading=!1,this.firstLoad&&typeof this.data=="function"&&this.loadData()):this.reloadTable()},isAutoHeight(){return this.height==="auto"},handleRefresh(){this.loadData()},async loadData(){if(Array.isArray(this.data))this.tableData=this.data;else if(typeof this.data=="function"){if(this.tableLoading)return;this.tableLoading=!0;try{const t=await this.data({paginationInfo:{pageSize:this.paginationInfo.pageSize,current:this.paginationInfo.current},params:this.searchForm}),{list:i,total:l,pageSize:o,current:s}=t;this.tableData=i;let n=b({},this.paginationInfo);l!==void 0&&(n.total=l),s!==void 0&&(n.current=s),o!==void 0&&(n.pageSize=o),this.paginationInfo=n}catch(t){}finally{this.tableLoading=!1}}},getTableHeight(){this.isAutoHeight()?this.$nextTick(()=>{const t=this.$refs.table,i=this.$refs.tmPagination;if(!t)return;const l=t.$el,o=i&&i.$el&&i.$el.offsetHeight||0;this.tableHeight=document.documentElement.clientHeight-l.offsetTop-o-this.calcHeight}):this.tableHeight=this.height,this.refreshTable()},search(){this.paginationInfo.current=1,this.loadData()},reset(){this.paginationInfo.current=1,this.$nextTick(()=>{this.loadData()})},handleSelectionChange(t){this.selectedRows=t,this.$emit("selection-change",t)},handleSizeChange(t){this.paginationInfo.pageSize=t,this.loadData(),this.$emit("size-change",t)},handleCurrentChange(t){this.paginationInfo.current=t,this.loadData(),this.$emit("current-change",t)},refreshTable(){this.$refs.table&&this.$refs.table.doLayout()},reloadTable(){this.tableReload++}}},ol={class:"tm-table",ref:"tablePage"};function al(t,i,l,o,s,n){const a=e.resolveComponent("table-search"),d=e.resolveComponent("RefreshIcon"),c=e.resolveComponent("el-button"),h=e.resolveComponent("el-tooltip"),p=e.resolveComponent("ColumnConfig"),V=e.resolveComponent("table-menu"),x=e.resolveComponent("columnRenderer"),k=e.resolveComponent("el-table"),L=e.resolveComponent("table-pagination"),r=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",ol,[l.searchColumns&&l.searchColumns.length>0?(e.openBlock(),e.createBlock(a,{key:0,ref:"search",onSearch:n.search,onReset:n.reset,"onUpdate:searchForm":n.handleUpdateSearchForm,disabled:n.pageLoading,"search-columns":l.searchColumns,"search-form":l.searchForm},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"search",{},void 0,!0)]),_:3},8,["onSearch","onReset","onUpdate:searchForm","disabled","search-columns","search-form"])):e.createCommentVNode("",!0),l.showMenu?(e.openBlock(),e.createBlock(V,{key:1},{left:e.withCtx(()=>[e.renderSlot(t.$slots,"menu-left",{},void 0,!0)]),right:e.withCtx(()=>[e.renderSlot(t.$slots,"menu-right",{},void 0,!0),l.refreshButton&&typeof l.data=="function"?(e.openBlock(),e.createBlock(h,e.mergeProps({key:0,content:s.t("refresh"),placement:"top"},s.afterOpenDelay),{default:e.withCtx(()=>[e.createVNode(c,{onClick:n.handleRefresh,circle:"",size:s.getDefaultSize()},{default:e.withCtx(()=>[e.createVNode(d)]),_:1},8,["onClick","size"])]),_:1},16,["content"])):e.createCommentVNode("",!0),l.columnSettingButton?(e.openBlock(),e.createBlock(p,{key:1,maxFixedLeftQuantity:l.maxFixedLeftQuantity,maxFixedRightQuantity:l.maxFixedRightQuantity,tableKey:n.computedTableKey,columns:s.originalColumns,onComplete:n.handleColumnConfigComplete},null,8,["maxFixedLeftQuantity","maxFixedRightQuantity","tableKey","columns","onComplete"])):e.createCommentVNode("",!0)]),_:3})):e.createCommentVNode("",!0),e.withDirectives((e.openBlock(),e.createBlock(k,e.mergeProps({ref:"table"},F(b({},t.$attrs),{border:l.border}),e.toHandlers(s.isVue2?t.$listeners:{}),{data:s.tableData,height:s.tableHeight,size:s.getCompatSize("mini"),onSelectionChange:n.handleSelectionChange,key:s.tableReload}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.displayColumns,z=>(e.openBlock(),e.createBlock(x,{vnode:z,key:s.isVue3?z.id:z.data.attrs.prop},null,8,["vnode"]))),128))]),_:1},16,["data","height","size","onSelectionChange"])),[[r,n.pageLoading]]),n.computedShowPagination?(e.openBlock(),e.createBlock(L,{key:2,ref:"tmPagination","page-size":s.paginationInfo.pageSize,current:s.paginationInfo.current,total:s.paginationInfo.total,disabled:s.tableLoading,onSizeChange:n.handleSizeChange,onCurrentChange:n.handleCurrentChange},null,8,["page-size","current","total","disabled","onSizeChange","onCurrentChange"])):e.createCommentVNode("",!0)],512)}const X=y(nl,[["render",al],["__scopeId","data-v-8db1f265"]]),rl=!1,cl=!0,dl={name:"TmTableColumn",inheritAttrs:!1,computed:{isVisible(){return this.$attrs.visible!==!1},slots(){return this.$slots}},data(){return{isVue2:rl,isVue3:cl}},created(){this.$parent&&this.$parent.$emit&&this.$parent.$emit("column-initialized",{prop:this.$attrs.prop,visible:this.$attrs.visible!==!1})}};function hl(t,i,l,o,s,n){const a=e.resolveComponent("el-table-column");return n.isVisible?(e.openBlock(),e.createBlock(a,e.mergeProps({key:0},t.$attrs,e.toHandlers(s.isVue2?t.$listeners:{})),e.createSlots({_:2},[e.renderList(n.slots,(d,c)=>({name:c,fn:e.withCtx(h=>[e.renderSlot(t.$slots,c,e.normalizeProps(e.guardReactiveProps(h)))])}))]),1040)):e.createCommentVNode("",!0)}const Z=y(dl,[["render",hl]]),{t:$}=w(),ul={name:"TmAdvancedEllipsisText",components:{CopyIcon:te},props:{rows:{type:Number,default:1},width:{type:String,default:"100%"},maxWidth:{type:String,default:""},showToolbar:{type:Boolean,default:!1},text:{type:String,default:""},showTooltip:{type:Boolean,default:!0},copyable:{type:Boolean,default:!1}},data(){return{isVue2:!1,originalText:"",isHovered:!1,lineHeight:0,containerWidth:0,resizeObserver:null,isCalculating:!1,frontLines:[],lastLineText:"",isLastLineEllipsis:!1,tableRowElement:null}},computed:{containerStyle(){const t={};return this.maxWidth?(t.maxWidth=this.maxWidth,t.width=this.width):t.width=this.width,t},hasToolbarSlot(){return this.$slots.toolbar?this.$slots.toolbar&&this.$slots.toolbar().length>0:!1},hasToolbarContent(){return this.copyable||this.hasToolbarSlot},shouldShowToolbar(){return this.showToolbar||this.isHovered&&this.hasToolbarContent}},mounted(){this.initComponent(),this.setupResizeObserver(),this.setupTableRowHover()},updated(){const t=this.getTextContent();t!==this.originalText&&(this.originalText=t,this.$nextTick(()=>{this.calculateLayout()}))},beforeDestroy(){this.cleanupResizeObserver(),this.cleanupTableRowHover()},beforeUnmount(){this.cleanupResizeObserver(),this.cleanupTableRowHover()},watch:{text:{handler(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLayout()})},immediate:!0},rows(){this.$nextTick(()=>{this.calculateLayout()})},shouldShowToolbar(){this.$nextTick(()=>{this.calculateLayout()})},"$slots.default":{handler(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLayout()})},deep:!0}},methods:{initComponent(){this.$nextTick(()=>{this.originalText=this.getTextContent(),this.calculateLineHeight(),this.$nextTick(()=>{this.calculateLayout()})})},handleCopy(){navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(this.originalText).then(()=>{this.$message.success($("copySuccess"))}).catch(()=>{this.fallbackCopy()}):this.fallbackCopy()},fallbackCopy(){const t=document.createElement("textarea");t.value=this.originalText,t.style.position="fixed",t.style.left="-999999px",t.style.top="-999999px",document.body.appendChild(t),t.focus(),t.select();try{document.execCommand("copy"),this.$message.success($("copySuccess"))}catch(i){this.$message.error($("copyFailed"))}document.body.removeChild(t)},getTextContent(){if(this.$slots.default){const t=this.$slots.default;return t().map(i=>typeof i.children=="string"?i.children:Array.isArray(i.children)?i.children.map(l=>l.children||"").join(""):"").join("")}return this.text||""},calculateLineHeight(){const t=this.$refs.containerRef;if(!t)return;const i=window.getComputedStyle(t);this.containerWidth=t.offsetWidth;const l=this.$refs.measureRef;if(l){this.setMeasureElementStyle(l,{width:this.containerWidth+"px",wordBreak:"break-all",whiteSpace:"normal"}),l.textContent="测",l.offsetHeight;const o=l.offsetHeight;l.innerHTML="",this.lineHeight=o}else{const o=i.lineHeight;if(o&&o!=="normal")this.lineHeight=parseInt(o);else{const s=parseInt(i.fontSize);this.lineHeight=s*1.2}}},calculateLayout(){if(!this.isCalculating){if(!this.originalText||this.rows<=0){this.frontLines=[],this.lastLineText=this.originalText||"",this.isLastLineEllipsis=!1;return}this.isCalculating=!0,this.$nextTick(()=>{requestAnimationFrame(()=>{this.performLayoutCalculation()})})}},performLayoutCalculation(){const t=this.originalText;if(this.rows===1)this.frontLines=[],this.lastLineText=t,this.isLastLineEllipsis=this.checkIfTextOverflows(t);else{const i=this.lineHeight;if(this.getTextHeight(t)<=i)this.frontLines=[],this.lastLineText=t,this.isLastLineEllipsis=this.checkIfTextOverflows(t);else{const o=this.lineHeight*(this.rows-1),s=this.findTextForHeight(t,o);this.frontLines=this.splitTextToLines(s);const n=t.substring(s.length);this.lastLineText=n,this.isLastLineEllipsis=n.length>0&&this.checkIfTextOverflows(n)}}this.isCalculating=!1},findTextForHeight(t,i){if(this.getTextHeight(t)<=i)return t;let l=0,o=t.length,s="";for(;l<=o;){const n=Math.floor((l+o)/2),a=t.substring(0,n);this.getTextHeight(a)<=i?(s=a,l=n+1):o=n-1}return s},splitTextToLines(t){if(!t)return[];const i=[];let l=t;for(;l.length>0;){const o=this.findTextForHeight(l,this.lineHeight);if(o.length===0)break;i.push(o),l=l.substring(o.length)}return i},checkIfTextOverflows(t){if(!t)return!1;const i=this.getTextWidth(t),l=this.shouldShowToolbar&&this.hasToolbarContent?this.getToolbarWidth():0,o=this.containerWidth-l-5;return i>o},getToolbarWidth(){let t=0;return this.copyable&&(t+=20),this.hasToolbarSlot&&(t+=40),t},getTextHeight(t){return this.measureText(t,{width:this.containerWidth+"px",wordBreak:"break-all",whiteSpace:"normal"})},getTextWidth(t){return this.measureText(t,{whiteSpace:"nowrap"})},measureText(t,i={}){if(!this.$refs.containerRef||!this.$refs.measureRef)return 0;const l=this.$refs.measureRef,o=l.style.cssText;this.setMeasureElementStyle(l,i),l.textContent=t,l.offsetHeight;const s=i.whiteSpace==="nowrap"?l.offsetWidth:l.offsetHeight;return l.style.cssText=o,l.innerHTML="",s},setMeasureElementStyle(t,i={}){const l=window.getComputedStyle(this.$refs.containerRef);t.style.cssText="",t.style.position="absolute",t.style.left="-9999px",t.style.top="-9999px",t.style.visibility="hidden",t.style.pointerEvents="none",t.style.zIndex="-1",t.style.fontSize=l.fontSize,t.style.fontFamily=l.fontFamily,t.style.fontWeight=l.fontWeight,t.style.lineHeight=l.lineHeight,t.style.letterSpacing=l.letterSpacing,t.style.wordSpacing=l.wordSpacing,t.style.padding="0",t.style.margin="0",t.style.border="none",t.style.boxSizing="border-box",Object.entries(i).forEach(([o,s])=>{t.style[o]=s})},handleMouseEnter(){this.isHovered=!0},handleMouseLeave(){this.isHovered=!1},setupResizeObserver(){typeof ResizeObserver!="undefined"&&(this.resizeObserver=new ResizeObserver(t=>{const i=t[0];if(i){const l=i.contentRect.width;Math.abs(l-this.containerWidth)>1&&requestAnimationFrame(()=>{this.calculateLineHeight(),this.calculateLayout()})}}),this.$refs.containerRef&&this.resizeObserver.observe(this.$refs.containerRef))},cleanupResizeObserver(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)},setupTableRowHover(){let t=this.$el;for(;t&&t!==document.body;){if(t.classList&&t.classList.contains("el-table__row")){this.tableRowElement=t;break}t=t.parentElement}this.tableRowElement&&(this.tableRowElement.addEventListener("mouseenter",this.handleMouseEnter),this.tableRowElement.addEventListener("mouseleave",this.handleMouseLeave))},cleanupTableRowHover(){this.tableRowElement&&(this.tableRowElement.removeEventListener("mouseenter",this.handleMouseEnter),this.tableRowElement.removeEventListener("mouseleave",this.handleMouseLeave),this.tableRowElement=null)}}},ml={class:"tm-ellipsis-text-wrapper"},pl=["innerHTML"],fl={class:"tm-ellipsis-last-line"},gl=["innerHTML"],bl={key:0,class:"tm-ellipsis-toolbar-part"},yl={key:1,class:"tm-ellipsis-text-wrapper"},Cl=["innerHTML"],kl={class:"tm-ellipsis-last-line"},Vl=["innerHTML"],xl={key:0,class:"tm-ellipsis-toolbar-part"},_l={ref:"measureRef",class:"tm-ellipsis-measure"};function Sl(t,i,l,o,s,n){const a=e.resolveComponent("CopyIcon"),d=e.resolveComponent("el-tooltip");return e.openBlock(),e.createElementBlock("div",{ref:"containerRef",style:e.normalizeStyle(n.containerStyle),class:"tm-ellipsis-text",onMouseenter:i[0]||(i[0]=(...c)=>n.handleMouseEnter&&n.handleMouseEnter(...c)),onMouseleave:i[1]||(i[1]=(...c)=>n.handleMouseLeave&&n.handleMouseLeave(...c))},[l.showTooltip&&s.isLastLineEllipsis?(e.openBlock(),e.createBlock(d,e.mergeProps({key:0,content:s.originalText,disabled:!l.showTooltip||!s.isLastLineEllipsis},{[s.isVue2?"open-delay":"show-after"]:300},{placement:"top"}),{default:e.withCtx(()=>[e.createElementVNode("div",ml,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.frontLines,(c,h)=>(e.openBlock(),e.createElementBlock("div",{key:"front-"+h,class:"tm-ellipsis-line",innerHTML:c},null,8,pl))),128)),e.createElementVNode("div",fl,[e.createElementVNode("div",{class:"tm-ellipsis-text-part",innerHTML:s.lastLineText},null,8,gl),n.shouldShowToolbar&&n.hasToolbarContent?(e.openBlock(),e.createElementBlock("div",bl,[l.copyable?(e.openBlock(),e.createBlock(a,{key:0,class:"icon-item",onClick:n.handleCopy},null,8,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"toolbar",{},void 0,!0)])):e.createCommentVNode("",!0)])])]),_:3},16,["content","disabled"])):(e.openBlock(),e.createElementBlock("div",yl,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.frontLines,(c,h)=>(e.openBlock(),e.createElementBlock("div",{key:"front-"+h,class:"tm-ellipsis-line",innerHTML:c},null,8,Cl))),128)),e.createElementVNode("div",kl,[e.createElementVNode("div",{class:"tm-ellipsis-text-part",innerHTML:s.lastLineText},null,8,Vl),n.shouldShowToolbar&&n.hasToolbarContent?(e.openBlock(),e.createElementBlock("div",xl,[l.copyable?(e.openBlock(),e.createBlock(a,{key:0,class:"icon-item",onClick:n.handleCopy},null,8,["onClick"])):e.createCommentVNode("",!0),e.renderSlot(t.$slots,"toolbar",{},void 0,!0)])):e.createCommentVNode("",!0)])])),e.createElementVNode("div",_l,null,512)],36)}const ee=y(ul,[["render",Sl],["__scopeId","data-v-16643222"]]),le={install:{install(t,i={}){[X,Z,B,ee].forEach(l=>t.component(l.name,l)),i.tableConfigProvider&&Et(i.tableConfigProvider),i.lang&&M(i.lang||"zh-CN")}}.install,Table:X,Column:Z,Search:q,Select:I,AdvancedInput:W,AdvancedDate:U,Cascader:j,Radio:J,Checkbox:K,Switch:Q,EllipsisText:B,AdvancedEllipsisText:ee,setLang:M,useLocale:w};typeof window!="undefined"&&window.Vue&&le.install(window.Vue),u.AdvancedDate=U,u.AdvancedEllipsisText=ee,u.AdvancedInput=W,u.Cascader=j,u.Checkbox=K,u.Column=Z,u.EllipsisText=B,u.Radio=J,u.Search=q,u.Select=I,u.Switch=Q,u.Table=X,u.default=le,u.setLang=M,u.useLocale=w,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|