gi-component 0.0.3 → 0.0.5
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/gi.css +1 -1
- package/dist/index.d.ts +64 -10
- package/dist/index.es.js +156 -96
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/packages/components/edit-table/src/edit-table.vue +193 -207
- package/packages/components/edit-table/src/type.ts +71 -69
- package/packages/components/table/src/TableColumn.vue +42 -49
- package/packages/components/table/src/table.vue +89 -89
- package/packages/components/table/src/type.ts +22 -22
- package/packages/hooks/index.ts +1 -0
- package/packages/hooks/useTable.ts +90 -1
- package/packages/index.ts +1 -0
package/dist/gi.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.gi-card[data-v-c2f199fb]{background-color:var(--el-bg-color);display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box;--card-padding-x: var(--padding-x);--card-padding-x-small: var(--padding-x-small);--card-padding-y: var(--padding-y);--card-padding-y-small: var(--padding-y-small)}.gi-card--bordered[data-v-c2f199fb]{border:1px solid var(--el-border-color)}.gi-card-header[data-v-c2f199fb]{height:46px;padding:0 var(--card-padding-x);display:flex;justify-content:space-between;align-items:center;color:var(--el-text-color-primary);box-sizing:border-box;position:relative;flex-shrink:0}.gi-card-header__title[data-v-c2f199fb]{position:relative;line-height:1.3em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;font-weight:500;font-size:16px}.gi-card-header__extra[data-v-c2f199fb]{display:flex}.gi-card-header--bordered[data-v-c2f199fb]{border-bottom:1px solid var(--el-border-color)}.gi-card-body[data-v-c2f199fb]{padding:var(--card-padding-x);box-sizing:border-box;overflow:hidden;height:100%}.gi-card-footer[data-v-c2f199fb]{padding:var(--card-padding-y) var(--card-padding-x);border-top:1px solid var(--el-border-color);box-sizing:border-box}.gi-card--full .gi-card-body[data-v-c2f199fb]{flex:1;display:flex;flex-direction:column}.gi-card--inner .gi-card-header[data-v-c2f199fb],.gi-card--inner .gi-card-body[data-v-c2f199fb],.gi-card--inner .gi-card-footer[data-v-c2f199fb]{padding-left:0;padding-right:0}.gi-card--small .gi-card-header[data-v-c2f199fb]{height:36px;padding:0 var(--card-padding-x-small)}.gi-card--small .gi-card-header__title[data-v-c2f199fb]{font-size:14px}.gi-card--small .gi-card-body[data-v-c2f199fb]{padding:var(--card-padding-x-small)}.gi-card--small .gi-card-footer[data-v-c2f199fb]{padding:var(--card-padding-y-small) var(--card-padding-x-small)}[data-v-079a9f8e] .el-form-item{margin-bottom:0}[data-v-079a9f8e] .el-form-item .el-form-item__label{display:none}[data-v-079a9f8e] .column-required .cell{position:relative}[data-v-079a9f8e] .column-required .cell:after{content:"*";color:red;margin-left:2px}.gi-grid[data-v-4f2b02b0]{display:grid}[data-v-cd21cbfd] .el-button+.el-button{margin-left:0}[data-v-cd21cbfd] .el-select__wrapper{box-shadow:none;border:1px solid var(--el-border-color)}[data-v-cd21cbfd] .el-select__wrapper.is-focused{box-shadow:none;border-color:var(--el-color-primary)}[data-v-cd21cbfd] .el-select__wrapper.is-hovering:not(.is-focused){box-shadow:none;border-color:var(--el-border-color-hover)}.gi-input-group[data-v-cd21cbfd]{display:flex}.gi-input-group[data-v-cd21cbfd]>*:not(:last-child){margin-right:-1px}.gi-input-group[data-v-cd21cbfd]>*:first-child:last-child{border-radius:var(--el-border-radius-base)}.gi-input-group[data-v-cd21cbfd]>*:first-child:last-child .el-input__wrapper,.gi-input-group[data-v-cd21cbfd]>*:first-child:last-child .el-select__wrapper{border-radius:var(--el-border-radius-base)}.gi-input-group[data-v-cd21cbfd]>*:not(:first-child):not(:last-child){border-radius:0}.gi-input-group[data-v-cd21cbfd]>*:not(:first-child):not(:last-child) .el-input__wrapper{border-radius:0}.gi-input-group[data-v-cd21cbfd]>*:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.gi-input-group[data-v-cd21cbfd]>*:first-child .el-input__wrapper,.gi-input-group[data-v-cd21cbfd]>*:first-child .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.gi-input-group[data-v-cd21cbfd]>*:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.gi-input-group[data-v-cd21cbfd]>*:last-child .el-input__wrapper,.gi-input-group[data-v-cd21cbfd]>*:last-child .el-select__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.gi-input-group[data-v-cd21cbfd]>*:hover{z-index:1}.gi-input-group[data-v-cd21cbfd]>* .el-input__wrapper.is-focus,.gi-input-group[data-v-cd21cbfd]>* .el-select__wrapper.is-focused{z-index:2}[data-v-788824ed] .el-button{padding-right:12px;padding-left:12px}.el-form[data-v-c2aac7b9]{width:100%}[data-v-c2aac7b9] .el-form-item{align-items:center}[data-v-c2aac7b9] .el-form-item .el-form-item__label{height:inherit;line-height:inherit}[data-v-c2aac7b9] .hide-label .el-form-item__label{display:none}.gi-form-item__content[data-v-c2aac7b9]{width:100%;display:flex}.gi-form-item__component[data-v-c2aac7b9]{flex:1}.gi-form-item__tip[data-v-c2aac7b9]{line-height:1.5;color:var(--el-color-info-light-3)}.gi-form-item__extra[data-v-c2aac7b9]{margin-left:6px}.gi-form__search-btns[data-v-c2aac7b9],.gi-form--search[data-v-c2aac7b9] .el-form-item{margin-bottom:8px}[data-v-c2aac7b9] .w-full,[data-v-c2aac7b9] .w-full .el-date-editor{width:100%}.gi-split-button[data-v-097d86cb]{position:absolute;top:50%;transform:translateY(-50%);display:flex;justify-content:center;align-items:center;z-index:9;border:1px solid var(--el-border-color);background-color:var(--el-bg-color);box-sizing:border-box;cursor:pointer;transition:all .3s cubic-bezier(.4,0,.2,1);will-change:transform,background-color,border-color}.gi-split-button--disabled[data-v-097d86cb]{cursor:not-allowed;opacity:.6;pointer-events:none}.gi-split-button--default[data-v-097d86cb]{width:18px;height:40px;left:0;box-shadow:2px 0 6px #0000001a}.gi-split-button--circle[data-v-097d86cb]{width:24px;height:24px;border-radius:50%;left:-12px;overflow:hidden;box-shadow:0 4px 10px #0000001a}[data-v-ae1c9bf4] .el-splitter-bar__dragger-horizontal:before,[data-v-ae1c9bf4] .el-splitter-bar__dragger-horizontal:after{width:1px}.gi-page-layout[data-v-ae1c9bf4]{flex:1;width:100%;height:100%;display:flex;overflow:hidden;background-color:var(--el-bg-color)}.gi-page-layout--bordered[data-v-ae1c9bf4]{border:1px solid var(--el-border-color)}.gi-page-layout__left[data-v-ae1c9bf4]{width:100%;height:100%}.gi-page-layout__right[data-v-ae1c9bf4]{flex:1;height:100%;display:flex;flex-direction:column;overflow:hidden;position:relative}.gi-page-layout__header[data-v-ae1c9bf4]{padding:var(--padding-x);padding-bottom:0;border-bottom:1px solid var(--el-border-color);box-sizing:border-box}.gi-page-layout__tool[data-v-ae1c9bf4]{width:100%;padding:var(--padding-x);padding-bottom:0;display:flex;justify-content:end;align-items:center;box-sizing:border-box}.gi-page-layout__body[data-v-ae1c9bf4]{flex:1;padding:var(--padding-x);height:100%;display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box}.gi-page-layout__split[data-v-ae1c9bf4]{width:0;height:auto;position:relative}.gi-page-layout--has-header .gi-page-layout__tool[data-v-ae1c9bf4],.gi-page-layout--has-header .gi-page-layout__body[data-v-ae1c9bf4],.gi-page-layout--has-tool .gi-page-layout__body[data-v-ae1c9bf4]{padding-top:var(--padding-y)}.gi-page-layout--collapsing[data-v-ae1c9bf4] .el-splitter-panel{transition:flex-basis .3s}[data-v-a2fb9c9b] .el-pagination__rightwrapper{flex:auto}.gi-table[data-v-a2fb9c9b]{height:100%;overflow:hidden;display:flex;flex-direction:column}.gi-table[data-v-a2fb9c9b] .el-table{flex:1}.gi-table-pagination[data-v-a2fb9c9b]{margin-top:10px}[data-v-81f370ec] .el-tabs__nav-prev,[data-v-81f370ec] .el-tabs__nav-next{height:100%;display:flex;align-items:center;justify-content:center}.gi-tabs[data-v-81f370ec]{width:100%;padding:0 var(--padding-x);display:flex;align-items:center;border-bottom:1px solid var(--el-border-color);box-sizing:border-box;background-color:var(--el-bg-color)}.gi-tabs__default[data-v-81f370ec]{flex:1;overflow:hidden}.gi-tabs__default[data-v-81f370ec] .el-tabs__header{margin-bottom:0}.gi-tabs__default[data-v-81f370ec] .el-tabs__header .el-tabs__nav-wrap:after{display:none}.gi-tabs__default[data-v-81f370ec] .el-tabs__active-bar{bottom:1px}.gi-tabs__extra[data-v-81f370ec]{margin-left:10px;align-self:flex-start}[data-v-81f370ec] .el-tabs--card>.el-tabs__header{border-bottom:none}[data-v-81f370ec] .el-tabs--border-card{border-bottom:none}[data-v-81f370ec] .el-tabs--border-card>.el-tabs__content{display:none}[data-v-81f370ec] .el-tabs--border-card>.el-tabs__header{border-bottom:none}.gi-tabs--small[data-v-81f370ec]{padding:0 var(--padding-x-small)}.gi-tabs--small[data-v-81f370ec] .el-tabs{--el-tabs-header-height: 32px}.gi-tabs--small[data-v-81f370ec] .el-tabs .el-tabs__item{font-size:12px}.gi-tabs--inner[data-v-81f370ec]{padding:0}body{--padding: 14px;--margin: 14px;--padding-x: 14px;--padding-x-small: 10px;--padding-y: 10px;--padding-y-small: 6px}.gi-card-title .gi-card-header__title{padding-left:8px;position:relative}.gi-card-title .gi-card-header__title:before{content:"";width:4px;height:20px;position:absolute;left:0;top:50%;transform:translateY(-50%);background-color:var(--el-color-primary);border-radius:0 4px 4px 0}.gi-w-full{width:100%}.gi-h-full{height:100%}.gi-line-1{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.gi-line-2{line-clamp:2;-webkit-line-clamp:2}.gi-line-3{line-clamp:3;-webkit-line-clamp:3}.gi-line-4{line-clamp:4;-webkit-line-clamp:4}.gi-line-5{line-clamp:5;-webkit-line-clamp:5}.gi-line-2,.gi-line-3,.gi-line-4,.gi-line-5{overflow:hidden;word-break:break-all;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical}.gi-mt{margin-top:var(--margin)}.gi-mb{margin-bottom:var(--margin)}.gi-ml{margin-left:var(--margin)}.gi-mr{margin-right:var(--margin)}.gi-mx{margin-left:var(--margin);margin-right:var(--margin)}.gi-my{margin-top:var(--margin);margin-bottom:var(--margin)}.gi-m0{margin:0!important}.gi-pt{padding-top:var(--padding)}.gi-pb{padding-bottom:var(--padding)}.gi-pl{padding-left:var(--padding)}.gi-pr{padding-right:var(--padding)}.gi-px{padding-left:var(--padding);padding-right:var(--padding)}.gi-py{padding-top:var(--padding);padding-bottom:var(--padding)}.gi-p0,.el-dialog{padding:0!important}.el-dialog.is-fullscreen{overflow:hidden;display:inline-flex;flex-direction:column}.el-dialog.is-fullscreen .el-dialog__body{flex:1;overflow-y:auto}.el-dialog .el-dialog__header{height:48px;padding-left:var(--el-dialog-padding-primary);padding-bottom:0;display:flex;align-items:center;border-bottom:1px solid var(--el-border-color)}.el-dialog .el-dialog__body{padding:var(--el-dialog-padding-primary)}.el-dialog .el-dialog__footer{padding:12px var(--el-dialog-padding-primary);border-top:1px solid var(--el-border-color)}.el-dialog.gi-dialog--simple .el-dialog__header{border-bottom:none}.el-dialog.gi-dialog--simple .el-dialog__footer{border-top:none}
|
|
1
|
+
.gi-card[data-v-c2f199fb]{background-color:var(--el-bg-color);display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box;--card-padding-x: var(--padding-x);--card-padding-x-small: var(--padding-x-small);--card-padding-y: var(--padding-y);--card-padding-y-small: var(--padding-y-small)}.gi-card--bordered[data-v-c2f199fb]{border:1px solid var(--el-border-color)}.gi-card-header[data-v-c2f199fb]{height:46px;padding:0 var(--card-padding-x);display:flex;justify-content:space-between;align-items:center;color:var(--el-text-color-primary);box-sizing:border-box;position:relative;flex-shrink:0}.gi-card-header__title[data-v-c2f199fb]{position:relative;line-height:1.3em;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;box-sizing:border-box;font-weight:500;font-size:16px}.gi-card-header__extra[data-v-c2f199fb]{display:flex}.gi-card-header--bordered[data-v-c2f199fb]{border-bottom:1px solid var(--el-border-color)}.gi-card-body[data-v-c2f199fb]{padding:var(--card-padding-x);box-sizing:border-box;overflow:hidden;height:100%}.gi-card-footer[data-v-c2f199fb]{padding:var(--card-padding-y) var(--card-padding-x);border-top:1px solid var(--el-border-color);box-sizing:border-box}.gi-card--full .gi-card-body[data-v-c2f199fb]{flex:1;display:flex;flex-direction:column}.gi-card--inner .gi-card-header[data-v-c2f199fb],.gi-card--inner .gi-card-body[data-v-c2f199fb],.gi-card--inner .gi-card-footer[data-v-c2f199fb]{padding-left:0;padding-right:0}.gi-card--small .gi-card-header[data-v-c2f199fb]{height:36px;padding:0 var(--card-padding-x-small)}.gi-card--small .gi-card-header__title[data-v-c2f199fb]{font-size:14px}.gi-card--small .gi-card-body[data-v-c2f199fb]{padding:var(--card-padding-x-small)}.gi-card--small .gi-card-footer[data-v-c2f199fb]{padding:var(--card-padding-y-small) var(--card-padding-x-small)}[data-v-cd21cbfd] .el-button+.el-button{margin-left:0}[data-v-cd21cbfd] .el-select__wrapper{box-shadow:none;border:1px solid var(--el-border-color)}[data-v-cd21cbfd] .el-select__wrapper.is-focused{box-shadow:none;border-color:var(--el-color-primary)}[data-v-cd21cbfd] .el-select__wrapper.is-hovering:not(.is-focused){box-shadow:none;border-color:var(--el-border-color-hover)}.gi-input-group[data-v-cd21cbfd]{display:flex}.gi-input-group[data-v-cd21cbfd]>*:not(:last-child){margin-right:-1px}.gi-input-group[data-v-cd21cbfd]>*:first-child:last-child{border-radius:var(--el-border-radius-base)}.gi-input-group[data-v-cd21cbfd]>*:first-child:last-child .el-input__wrapper,.gi-input-group[data-v-cd21cbfd]>*:first-child:last-child .el-select__wrapper{border-radius:var(--el-border-radius-base)}.gi-input-group[data-v-cd21cbfd]>*:not(:first-child):not(:last-child){border-radius:0}.gi-input-group[data-v-cd21cbfd]>*:not(:first-child):not(:last-child) .el-input__wrapper{border-radius:0}.gi-input-group[data-v-cd21cbfd]>*:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.gi-input-group[data-v-cd21cbfd]>*:first-child .el-input__wrapper,.gi-input-group[data-v-cd21cbfd]>*:first-child .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.gi-input-group[data-v-cd21cbfd]>*:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.gi-input-group[data-v-cd21cbfd]>*:last-child .el-input__wrapper,.gi-input-group[data-v-cd21cbfd]>*:last-child .el-select__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.gi-input-group[data-v-cd21cbfd]>*:hover{z-index:1}.gi-input-group[data-v-cd21cbfd]>* .el-input__wrapper.is-focus,.gi-input-group[data-v-cd21cbfd]>* .el-select__wrapper.is-focused{z-index:2}[data-v-788824ed] .el-button{padding-right:12px;padding-left:12px}[data-v-411a7fe4] .el-form-item{margin-bottom:0}[data-v-411a7fe4] .el-form-item .el-form-item__label{display:none}[data-v-411a7fe4] .column-required .cell{position:relative}[data-v-411a7fe4] .column-required .cell:after{content:"*";color:red;margin-left:2px}.gi-grid[data-v-4f2b02b0]{display:grid}.el-form[data-v-c2aac7b9]{width:100%}[data-v-c2aac7b9] .el-form-item{align-items:center}[data-v-c2aac7b9] .el-form-item .el-form-item__label{height:inherit;line-height:inherit}[data-v-c2aac7b9] .hide-label .el-form-item__label{display:none}.gi-form-item__content[data-v-c2aac7b9]{width:100%;display:flex}.gi-form-item__component[data-v-c2aac7b9]{flex:1}.gi-form-item__tip[data-v-c2aac7b9]{line-height:1.5;color:var(--el-color-info-light-3)}.gi-form-item__extra[data-v-c2aac7b9]{margin-left:6px}.gi-form__search-btns[data-v-c2aac7b9],.gi-form--search[data-v-c2aac7b9] .el-form-item{margin-bottom:8px}[data-v-c2aac7b9] .w-full,[data-v-c2aac7b9] .w-full .el-date-editor{width:100%}.gi-split-button[data-v-097d86cb]{position:absolute;top:50%;transform:translateY(-50%);display:flex;justify-content:center;align-items:center;z-index:9;border:1px solid var(--el-border-color);background-color:var(--el-bg-color);box-sizing:border-box;cursor:pointer;transition:all .3s cubic-bezier(.4,0,.2,1);will-change:transform,background-color,border-color}.gi-split-button--disabled[data-v-097d86cb]{cursor:not-allowed;opacity:.6;pointer-events:none}.gi-split-button--default[data-v-097d86cb]{width:18px;height:40px;left:0;box-shadow:2px 0 6px #0000001a}.gi-split-button--circle[data-v-097d86cb]{width:24px;height:24px;border-radius:50%;left:-12px;overflow:hidden;box-shadow:0 4px 10px #0000001a}[data-v-ae1c9bf4] .el-splitter-bar__dragger-horizontal:before,[data-v-ae1c9bf4] .el-splitter-bar__dragger-horizontal:after{width:1px}.gi-page-layout[data-v-ae1c9bf4]{flex:1;width:100%;height:100%;display:flex;overflow:hidden;background-color:var(--el-bg-color)}.gi-page-layout--bordered[data-v-ae1c9bf4]{border:1px solid var(--el-border-color)}.gi-page-layout__left[data-v-ae1c9bf4]{width:100%;height:100%}.gi-page-layout__right[data-v-ae1c9bf4]{flex:1;height:100%;display:flex;flex-direction:column;overflow:hidden;position:relative}.gi-page-layout__header[data-v-ae1c9bf4]{padding:var(--padding-x);padding-bottom:0;border-bottom:1px solid var(--el-border-color);box-sizing:border-box}.gi-page-layout__tool[data-v-ae1c9bf4]{width:100%;padding:var(--padding-x);padding-bottom:0;display:flex;justify-content:end;align-items:center;box-sizing:border-box}.gi-page-layout__body[data-v-ae1c9bf4]{flex:1;padding:var(--padding-x);height:100%;display:flex;flex-direction:column;overflow:hidden;box-sizing:border-box}.gi-page-layout__split[data-v-ae1c9bf4]{width:0;height:auto;position:relative}.gi-page-layout--has-header .gi-page-layout__tool[data-v-ae1c9bf4],.gi-page-layout--has-header .gi-page-layout__body[data-v-ae1c9bf4],.gi-page-layout--has-tool .gi-page-layout__body[data-v-ae1c9bf4]{padding-top:var(--padding-y)}.gi-page-layout--collapsing[data-v-ae1c9bf4] .el-splitter-panel{transition:flex-basis .3s}[data-v-002f7dd8] .el-pagination__rightwrapper{flex:auto}.gi-table[data-v-002f7dd8]{height:100%;overflow:hidden;display:flex;flex-direction:column}.gi-table[data-v-002f7dd8] .el-table{flex:1}.gi-table-pagination[data-v-002f7dd8]{margin-top:10px}[data-v-81f370ec] .el-tabs__nav-prev,[data-v-81f370ec] .el-tabs__nav-next{height:100%;display:flex;align-items:center;justify-content:center}.gi-tabs[data-v-81f370ec]{width:100%;padding:0 var(--padding-x);display:flex;align-items:center;border-bottom:1px solid var(--el-border-color);box-sizing:border-box;background-color:var(--el-bg-color)}.gi-tabs__default[data-v-81f370ec]{flex:1;overflow:hidden}.gi-tabs__default[data-v-81f370ec] .el-tabs__header{margin-bottom:0}.gi-tabs__default[data-v-81f370ec] .el-tabs__header .el-tabs__nav-wrap:after{display:none}.gi-tabs__default[data-v-81f370ec] .el-tabs__active-bar{bottom:1px}.gi-tabs__extra[data-v-81f370ec]{margin-left:10px;align-self:flex-start}[data-v-81f370ec] .el-tabs--card>.el-tabs__header{border-bottom:none}[data-v-81f370ec] .el-tabs--border-card{border-bottom:none}[data-v-81f370ec] .el-tabs--border-card>.el-tabs__content{display:none}[data-v-81f370ec] .el-tabs--border-card>.el-tabs__header{border-bottom:none}.gi-tabs--small[data-v-81f370ec]{padding:0 var(--padding-x-small)}.gi-tabs--small[data-v-81f370ec] .el-tabs{--el-tabs-header-height: 32px}.gi-tabs--small[data-v-81f370ec] .el-tabs .el-tabs__item{font-size:12px}.gi-tabs--inner[data-v-81f370ec]{padding:0}body{--padding: 14px;--margin: 14px;--padding-x: 14px;--padding-x-small: 10px;--padding-y: 10px;--padding-y-small: 6px}.gi-card-title .gi-card-header__title{padding-left:8px;position:relative}.gi-card-title .gi-card-header__title:before{content:"";width:4px;height:20px;position:absolute;left:0;top:50%;transform:translateY(-50%);background-color:var(--el-color-primary);border-radius:0 4px 4px 0}.gi-w-full{width:100%}.gi-h-full{height:100%}.gi-line-1{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.gi-line-2{line-clamp:2;-webkit-line-clamp:2}.gi-line-3{line-clamp:3;-webkit-line-clamp:3}.gi-line-4{line-clamp:4;-webkit-line-clamp:4}.gi-line-5{line-clamp:5;-webkit-line-clamp:5}.gi-line-2,.gi-line-3,.gi-line-4,.gi-line-5{overflow:hidden;word-break:break-all;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical}.gi-mt{margin-top:var(--margin)}.gi-mb{margin-bottom:var(--margin)}.gi-ml{margin-left:var(--margin)}.gi-mr{margin-right:var(--margin)}.gi-mx{margin-left:var(--margin);margin-right:var(--margin)}.gi-my{margin-top:var(--margin);margin-bottom:var(--margin)}.gi-m0{margin:0!important}.gi-pt{padding-top:var(--padding)}.gi-pb{padding-bottom:var(--padding)}.gi-pl{padding-left:var(--padding)}.gi-pr{padding-right:var(--padding)}.gi-px{padding-left:var(--padding);padding-right:var(--padding)}.gi-py{padding-top:var(--padding);padding-bottom:var(--padding)}.gi-p0,.el-dialog{padding:0!important}.el-dialog.is-fullscreen{overflow:hidden;display:inline-flex;flex-direction:column}.el-dialog.is-fullscreen .el-dialog__body{flex:1;overflow-y:auto}.el-dialog .el-dialog__header{height:48px;padding-left:var(--el-dialog-padding-primary);padding-bottom:0;display:flex;align-items:center;border-bottom:1px solid var(--el-border-color)}.el-dialog .el-dialog__body{padding:var(--el-dialog-padding-primary)}.el-dialog .el-dialog__footer{padding:12px var(--el-dialog-padding-primary);border-top:1px solid var(--el-border-color)}.el-dialog.gi-dialog--simple .el-dialog__header{border-bottom:none}.el-dialog.gi-dialog--simple .el-dialog__footer{border-top:none}
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ import { PublicProps } from 'vue';
|
|
|
20
20
|
import { Ref } from 'vue';
|
|
21
21
|
import { Slots } from 'vue';
|
|
22
22
|
import { SplitterPanelProps } from 'element-plus';
|
|
23
|
-
import { TableColumnCtx } from 'element-plus';
|
|
24
23
|
import { TableColumnInstance } from 'element-plus';
|
|
25
24
|
import { TableProps as TableProps_2 } from 'element-plus';
|
|
26
25
|
import { TabPaneName } from 'element-plus';
|
|
@@ -257,6 +256,15 @@ declare type __VLS_WithTemplateSlots_6<T, S> = T & {
|
|
|
257
256
|
};
|
|
258
257
|
};
|
|
259
258
|
|
|
259
|
+
declare type Api<T> = (params: PaginationParams) => Promise<ApiResult<PageResult<T[]>>> | Promise<ApiResult<T[]>>;
|
|
260
|
+
|
|
261
|
+
declare interface ApiResult<T> {
|
|
262
|
+
code: number;
|
|
263
|
+
data: T;
|
|
264
|
+
message: string;
|
|
265
|
+
success: boolean;
|
|
266
|
+
}
|
|
267
|
+
|
|
260
268
|
declare interface ButtonProps extends Partial<Omit<ButtonProps_2, 'type'>> {
|
|
261
269
|
type?: 'add' | 'edit' | 'delete' | 'search' | 'reset' | 'upload' | 'download' | 'print' | '' | ButtonProps_2['type'];
|
|
262
270
|
}
|
|
@@ -272,7 +280,7 @@ declare interface CardProps {
|
|
|
272
280
|
inner?: boolean;
|
|
273
281
|
}
|
|
274
282
|
|
|
275
|
-
export declare type ColumnItemProps = El.InputProps & El.InputNumberProps & El.InputTagProps & El.
|
|
283
|
+
export declare type ColumnItemProps = El.InputProps & El.InputNumberProps & El.InputTagProps & El.SelectProps & El.SelectV2Props & El.TreeInstance['$props'] & El.CascaderProps & El.SliderProps & El.SwitchProps & El.RateProps & El.CheckboxGroupProps & El.CheckboxProps & El.RadioGroupProps & El.RadioProps & El.DatePickerProps & El.TimePickerDefaultProps & El.TimeSelectProps & El.ColorPickerProps & El.TransferProps & El.AutocompleteProps & El.UploadProps & InputSearchInstance['$props'];
|
|
276
284
|
|
|
277
285
|
export declare interface Config {
|
|
278
286
|
prefix?: string;
|
|
@@ -509,6 +517,8 @@ suffix: boolean;
|
|
|
509
517
|
|
|
510
518
|
declare const _default_9: __VLS_WithTemplateSlots_5<typeof __VLS_component_5, __VLS_TemplateResult_5["slots"]>;
|
|
511
519
|
|
|
520
|
+
declare type DefaultRow = Record<PropertyKey, any>;
|
|
521
|
+
|
|
512
522
|
declare interface DefOption {
|
|
513
523
|
queryParams: Record<string, any>;
|
|
514
524
|
}
|
|
@@ -553,18 +563,18 @@ export declare interface DialogReturnObject {
|
|
|
553
563
|
|
|
554
564
|
export declare interface EditTableColumnItem {
|
|
555
565
|
type?: EditTableColumnItemType;
|
|
556
|
-
|
|
557
|
-
|
|
566
|
+
label: string;
|
|
567
|
+
prop: string;
|
|
558
568
|
width?: number | string;
|
|
559
569
|
required?: boolean;
|
|
560
570
|
rules?: El.FormItemRule[];
|
|
561
|
-
|
|
571
|
+
componentProps?: ColumnItemProps;
|
|
562
572
|
columnProps?: El.TableColumnInstance['$props'];
|
|
563
573
|
formItemProps?: El.FormItemProps;
|
|
564
574
|
slotName?: string;
|
|
565
575
|
}
|
|
566
576
|
|
|
567
|
-
export declare type EditTableColumnItemType = 'input' | 'textarea' | 'input-number' | 'input-tag' | 'select' | 'select-v2' | 'tree-select' | 'cascader' | 'slider' | 'switch' | 'rate' | 'checkbox-group' | 'checkbox' | 'radio-group' | 'radio' | 'date-picker' | 'time-picker' | 'time-select' | 'color-picker' | 'transfer' | 'autocomplete' | 'upload' | 'slot' | '
|
|
577
|
+
export declare type EditTableColumnItemType = 'input' | 'textarea' | 'input-number' | 'input-tag' | 'select' | 'select-v2' | 'tree-select' | 'cascader' | 'slider' | 'switch' | 'rate' | 'checkbox-group' | 'checkbox' | 'radio-group' | 'radio' | 'date-picker' | 'time-picker' | 'time-select' | 'color-picker' | 'transfer' | 'autocomplete' | 'upload' | 'slot' | 'input-search';
|
|
568
578
|
|
|
569
579
|
export declare type EditTableInstance = InstanceType<typeof default_3>;
|
|
570
580
|
|
|
@@ -672,6 +682,12 @@ declare interface InputSearchProps {
|
|
|
672
682
|
|
|
673
683
|
declare const model: ModelRef<string | undefined, string, string | undefined, string | undefined>;
|
|
674
684
|
|
|
685
|
+
declare interface Options<T, U> {
|
|
686
|
+
onSuccess?: () => void;
|
|
687
|
+
immediate?: boolean;
|
|
688
|
+
rowKey?: keyof T;
|
|
689
|
+
}
|
|
690
|
+
|
|
675
691
|
declare interface PageLayoutProps {
|
|
676
692
|
size?: SplitterPanelProps['size'];
|
|
677
693
|
bordered?: boolean;
|
|
@@ -682,6 +698,16 @@ declare interface PageLayoutProps {
|
|
|
682
698
|
bodyStyle?: CSSProperties;
|
|
683
699
|
}
|
|
684
700
|
|
|
701
|
+
declare interface PageResult<T> {
|
|
702
|
+
list: T[];
|
|
703
|
+
total: number;
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
declare interface PaginationParams {
|
|
707
|
+
page: number;
|
|
708
|
+
size: number;
|
|
709
|
+
}
|
|
710
|
+
|
|
685
711
|
declare interface ResponsiveValue {
|
|
686
712
|
/**
|
|
687
713
|
* @zh >= 1600px 响应式配置
|
|
@@ -715,10 +741,15 @@ declare interface ResponsiveValue {
|
|
|
715
741
|
xs?: number;
|
|
716
742
|
}
|
|
717
743
|
|
|
718
|
-
export declare interface TableColumnItem extends Omit<TableColumnInstance['$props'], never> {
|
|
744
|
+
export declare interface TableColumnItem<T extends DefaultRow = DefaultRow> extends Omit<TableColumnInstance['$props'], never> {
|
|
719
745
|
slotName?: string;
|
|
720
746
|
children?: TableColumnItem[];
|
|
721
|
-
render?: (scope:
|
|
747
|
+
render?: (scope: {
|
|
748
|
+
$index: number;
|
|
749
|
+
cellIndex: number;
|
|
750
|
+
column: TableColumnItem<T>;
|
|
751
|
+
row: T;
|
|
752
|
+
}) => VNode | VNode[] | string;
|
|
722
753
|
}
|
|
723
754
|
|
|
724
755
|
export declare type TableInstance = InstanceType<typeof default_4>;
|
|
@@ -728,13 +759,15 @@ export declare interface TableProps extends ExtractPropTypes<TableProps_2<Record
|
|
|
728
759
|
pagination?: Partial<PaginationProps>;
|
|
729
760
|
}
|
|
730
761
|
|
|
731
|
-
declare type
|
|
762
|
+
export declare type TabsInstance = InstanceType<typeof _default_4>;
|
|
763
|
+
|
|
764
|
+
export declare type TabsOptionItem = {
|
|
732
765
|
label: string;
|
|
733
766
|
name: string;
|
|
734
767
|
disabled?: boolean;
|
|
735
768
|
};
|
|
736
769
|
|
|
737
|
-
declare interface TabsProps extends Partial<Pick<TabsProps_2, 'type' | 'stretch'>> {
|
|
770
|
+
export declare interface TabsProps extends Partial<Pick<TabsProps_2, 'type' | 'stretch'>> {
|
|
738
771
|
type?: TabsProps_2['type'];
|
|
739
772
|
options?: TabsOptionItem[];
|
|
740
773
|
size?: 'small' | 'medium';
|
|
@@ -745,6 +778,27 @@ export declare function useBemClass(): {
|
|
|
745
778
|
b: (name?: string) => string;
|
|
746
779
|
};
|
|
747
780
|
|
|
781
|
+
export declare function useTable<T extends U, U = T>(api: Api<T>, options: Options<T, U>): {
|
|
782
|
+
/** 表格数据 */
|
|
783
|
+
tableData: Ref<U[], U[]>;
|
|
784
|
+
/** 获取表格数据 */
|
|
785
|
+
getTableData: () => Promise<void>;
|
|
786
|
+
/** 分页数据 */
|
|
787
|
+
pagination: {
|
|
788
|
+
currentPage: number;
|
|
789
|
+
pageSize: number;
|
|
790
|
+
total: number;
|
|
791
|
+
onCurrentChange: (size: number) => void;
|
|
792
|
+
onSizeChange: (size: number) => void;
|
|
793
|
+
};
|
|
794
|
+
/** 加载状态 */
|
|
795
|
+
loading: Ref<boolean, boolean>;
|
|
796
|
+
/** 搜索 */
|
|
797
|
+
search: () => void;
|
|
798
|
+
/** 刷新 */
|
|
799
|
+
refresh: () => void;
|
|
800
|
+
};
|
|
801
|
+
|
|
748
802
|
declare const visible: ModelRef<boolean, string, boolean, boolean>;
|
|
749
803
|
|
|
750
804
|
export { }
|
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, createElementBlock, openBlock, createElementVNode, getCurrentInstance, useAttrs, computed, resolveComponent, createBlock, mergeProps, unref, withCtx, renderSlot, createTextVNode, toDisplayString, useSlots, normalizeClass, createCommentVNode, normalizeStyle, mergeModels, useModel,
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, createElementVNode, getCurrentInstance, ref, reactive, useAttrs, computed, resolveComponent, createBlock, mergeProps, unref, withCtx, renderSlot, createTextVNode, toDisplayString, useSlots, normalizeClass, createCommentVNode, normalizeStyle, mergeModels, useModel, createSlots, resolveDynamicComponent, createVNode, createApp, h, Fragment, renderList, watch, onMounted, onUpdated, onUnmounted, inject, toRefs, watchEffect, provide, toRaw, normalizeProps, guardReactiveProps, useTemplateRef } from "vue";
|
|
2
2
|
import * as El from "element-plus";
|
|
3
3
|
import El__default, { ElMessage } from "element-plus";
|
|
4
4
|
/*! Element Plus Icons Vue v2.3.2 */
|
|
@@ -194,6 +194,62 @@ function useBemClass() {
|
|
|
194
194
|
const b = (name = "") => `${prefix}-${name ? `${name}` : ""}`;
|
|
195
195
|
return { b };
|
|
196
196
|
}
|
|
197
|
+
function useTable(api, options) {
|
|
198
|
+
const { onSuccess, immediate = true, rowKey = "id" } = options || {};
|
|
199
|
+
const loading = ref(false);
|
|
200
|
+
const tableData = ref([]);
|
|
201
|
+
const pagination = reactive({
|
|
202
|
+
currentPage: 1,
|
|
203
|
+
pageSize: 20,
|
|
204
|
+
total: 0,
|
|
205
|
+
onCurrentChange: (size) => {
|
|
206
|
+
pagination.currentPage = size;
|
|
207
|
+
getTableData();
|
|
208
|
+
},
|
|
209
|
+
onSizeChange: (size) => {
|
|
210
|
+
pagination.pageSize = size;
|
|
211
|
+
getTableData();
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
function setTotal(total) {
|
|
215
|
+
pagination.total = total;
|
|
216
|
+
}
|
|
217
|
+
async function getTableData() {
|
|
218
|
+
try {
|
|
219
|
+
loading.value = true;
|
|
220
|
+
const res = await api({ page: pagination.currentPage, size: pagination.pageSize });
|
|
221
|
+
const data = !Array.isArray(res.data) ? res.data.list : res.data;
|
|
222
|
+
tableData.value = data;
|
|
223
|
+
const total = !Array.isArray(res.data) ? res.data.total : data.length;
|
|
224
|
+
setTotal(total);
|
|
225
|
+
onSuccess == null ? void 0 : onSuccess();
|
|
226
|
+
} finally {
|
|
227
|
+
loading.value = false;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
immediate && getTableData();
|
|
231
|
+
function search() {
|
|
232
|
+
pagination.currentPage = 1;
|
|
233
|
+
getTableData();
|
|
234
|
+
}
|
|
235
|
+
function refresh() {
|
|
236
|
+
getTableData();
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
/** 表格数据 */
|
|
240
|
+
tableData,
|
|
241
|
+
/** 获取表格数据 */
|
|
242
|
+
getTableData,
|
|
243
|
+
/** 分页数据 */
|
|
244
|
+
pagination,
|
|
245
|
+
/** 加载状态 */
|
|
246
|
+
loading,
|
|
247
|
+
/** 搜索 */
|
|
248
|
+
search,
|
|
249
|
+
/** 刷新 */
|
|
250
|
+
refresh
|
|
251
|
+
};
|
|
252
|
+
}
|
|
197
253
|
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
198
254
|
__name: "button",
|
|
199
255
|
props: {
|
|
@@ -559,8 +615,79 @@ function createDialog() {
|
|
|
559
615
|
return Dialog2;
|
|
560
616
|
}
|
|
561
617
|
const Dialog = createDialog();
|
|
562
|
-
const clearable = false;
|
|
563
618
|
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
619
|
+
__name: "input-group",
|
|
620
|
+
setup(__props) {
|
|
621
|
+
const { b } = useBemClass();
|
|
622
|
+
return (_ctx, _cache) => {
|
|
623
|
+
return openBlock(), createElementBlock("div", {
|
|
624
|
+
class: normalizeClass(unref(b)("input-group"))
|
|
625
|
+
}, [
|
|
626
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
627
|
+
], 2);
|
|
628
|
+
};
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
const InputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-cd21cbfd"]]);
|
|
632
|
+
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
633
|
+
__name: "input-search",
|
|
634
|
+
props: /* @__PURE__ */ mergeModels({
|
|
635
|
+
disabled: { type: Boolean, default: false },
|
|
636
|
+
readonly: { type: Boolean, default: false },
|
|
637
|
+
placeholder: { default: "请选择" },
|
|
638
|
+
disabledHideButton: { type: Boolean, default: false }
|
|
639
|
+
}, {
|
|
640
|
+
"modelValue": { type: String },
|
|
641
|
+
"modelModifiers": {}
|
|
642
|
+
}),
|
|
643
|
+
emits: /* @__PURE__ */ mergeModels(["search", "clear"], ["update:modelValue"]),
|
|
644
|
+
setup(__props, { emit: __emit }) {
|
|
645
|
+
const model = useModel(__props, "modelValue");
|
|
646
|
+
const props = __props;
|
|
647
|
+
const emit = __emit;
|
|
648
|
+
const { b } = useBemClass();
|
|
649
|
+
const showButton = computed(() => {
|
|
650
|
+
if (props.readonly) return false;
|
|
651
|
+
if (props.disabled) {
|
|
652
|
+
return !props.disabledHideButton;
|
|
653
|
+
}
|
|
654
|
+
return true;
|
|
655
|
+
});
|
|
656
|
+
return (_ctx, _cache) => {
|
|
657
|
+
const _component_el_input = resolveComponent("el-input");
|
|
658
|
+
const _component_el_button = resolveComponent("el-button");
|
|
659
|
+
return openBlock(), createBlock(InputGroup, {
|
|
660
|
+
class: normalizeClass(unref(b)("input-search"))
|
|
661
|
+
}, {
|
|
662
|
+
default: withCtx(() => [
|
|
663
|
+
createVNode(_component_el_input, {
|
|
664
|
+
modelValue: model.value,
|
|
665
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
666
|
+
disabled: props.disabled,
|
|
667
|
+
readonly: !props.disabled,
|
|
668
|
+
placeholder: props.placeholder
|
|
669
|
+
}, null, 8, ["modelValue", "disabled", "readonly", "placeholder"]),
|
|
670
|
+
showButton.value ? (openBlock(), createBlock(_component_el_button, {
|
|
671
|
+
key: 0,
|
|
672
|
+
icon: unref(search_default),
|
|
673
|
+
disabled: props.disabled,
|
|
674
|
+
onClick: _cache[1] || (_cache[1] = ($event) => emit("search"))
|
|
675
|
+
}, null, 8, ["icon", "disabled"])) : createCommentVNode("", true),
|
|
676
|
+
showButton.value ? (openBlock(), createBlock(_component_el_button, {
|
|
677
|
+
key: 1,
|
|
678
|
+
icon: unref(close_default),
|
|
679
|
+
disabled: props.disabled,
|
|
680
|
+
onClick: _cache[2] || (_cache[2] = ($event) => emit("clear"))
|
|
681
|
+
}, null, 8, ["icon", "disabled"])) : createCommentVNode("", true)
|
|
682
|
+
]),
|
|
683
|
+
_: 1
|
|
684
|
+
}, 8, ["class"]);
|
|
685
|
+
};
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
const InputSearch = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-788824ed"]]);
|
|
689
|
+
const clearable = false;
|
|
690
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
564
691
|
__name: "edit-table",
|
|
565
692
|
props: {
|
|
566
693
|
rowKey: { default: "id" },
|
|
@@ -594,7 +721,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
594
721
|
"color-picker": El.ElColorPicker,
|
|
595
722
|
transfer: El.ElTransfer,
|
|
596
723
|
autocomplete: El.ElAutocomplete,
|
|
597
|
-
upload: El.ElUpload
|
|
724
|
+
upload: El.ElUpload,
|
|
725
|
+
"input-search": InputSearch
|
|
598
726
|
};
|
|
599
727
|
const formRef = ref();
|
|
600
728
|
const form = computed(() => ({ tableData: props.data }));
|
|
@@ -635,15 +763,15 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
635
763
|
const getPlaceholder = (item) => {
|
|
636
764
|
if (!item.type) return void 0;
|
|
637
765
|
if (["input", "input-number", "input-tag"].includes(item.type)) {
|
|
638
|
-
return `请输入${item.
|
|
766
|
+
return `请输入${item.label}`;
|
|
639
767
|
}
|
|
640
768
|
if (["textarea"].includes(item.type)) {
|
|
641
|
-
return `请填写${item.
|
|
769
|
+
return `请填写${item.label}`;
|
|
642
770
|
}
|
|
643
|
-
if (["select", "select-v2", "tree-select", "cascader", "time-select"].includes(
|
|
771
|
+
if (["select", "select-v2", "tree-select", "cascader", "time-select", "input-search"].includes(
|
|
644
772
|
item.type
|
|
645
773
|
)) {
|
|
646
|
-
return `请选择${item.
|
|
774
|
+
return `请选择${item.label}`;
|
|
647
775
|
}
|
|
648
776
|
if (["date-picker"].includes(item.type)) {
|
|
649
777
|
return `请选择日期`;
|
|
@@ -658,14 +786,14 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
658
786
|
const defaultProps = STATIC_PROPS.get(item.type || "") || {};
|
|
659
787
|
defaultProps.placeholder = getPlaceholder(item);
|
|
660
788
|
if (item.type === "date-picker") {
|
|
661
|
-
defaultProps.valueFormat = ((_a = item == null ? void 0 : item.
|
|
789
|
+
defaultProps.valueFormat = ((_a = item == null ? void 0 : item.componentProps) == null ? void 0 : _a.type) === "datetime" ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
|
|
662
790
|
}
|
|
663
|
-
return { ...defaultProps, ...item.
|
|
791
|
+
return { ...defaultProps, ...item.componentProps };
|
|
664
792
|
}
|
|
665
793
|
function getFormItemRules(item) {
|
|
666
794
|
if (item.required) {
|
|
667
795
|
return [
|
|
668
|
-
{ required: true, message: `${item.
|
|
796
|
+
{ required: true, message: `${item.label}为必填项` },
|
|
669
797
|
...Array.isArray(item.rules) ? item.rules : []
|
|
670
798
|
];
|
|
671
799
|
}
|
|
@@ -699,17 +827,17 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
699
827
|
default: withCtx(() => [
|
|
700
828
|
(openBlock(true), createElementBlock(Fragment, null, renderList(props.columns, (column, index2) => {
|
|
701
829
|
return openBlock(), createBlock(_component_el_table_column, mergeProps({
|
|
702
|
-
key: column.
|
|
830
|
+
key: column.prop + index2,
|
|
703
831
|
width: column.width
|
|
704
832
|
}, { ref_for: true }, column.columnProps, {
|
|
705
|
-
prop: column.
|
|
706
|
-
label: column.
|
|
833
|
+
prop: column.prop,
|
|
834
|
+
label: column.label,
|
|
707
835
|
"label-class-name": getLabelClassName(column)
|
|
708
836
|
}), {
|
|
709
837
|
default: withCtx((scope) => [
|
|
710
838
|
createVNode(_component_el_form_item, mergeProps({ ref_for: true }, column.formItemProps, {
|
|
711
|
-
label: column.
|
|
712
|
-
prop: `tableData[${scope.$index}].${column.
|
|
839
|
+
label: column.label,
|
|
840
|
+
prop: `tableData[${scope.$index}].${column.prop}`,
|
|
713
841
|
rules: getFormItemRules(column)
|
|
714
842
|
}), {
|
|
715
843
|
default: withCtx(() => [
|
|
@@ -720,8 +848,8 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
720
848
|
key: 1,
|
|
721
849
|
ref_for: true
|
|
722
850
|
}, getComponentBindProps(column), {
|
|
723
|
-
modelValue: scope.row[column.
|
|
724
|
-
"onUpdate:modelValue": ($event) => scope.row[column.
|
|
851
|
+
modelValue: scope.row[column.prop],
|
|
852
|
+
"onUpdate:modelValue": ($event) => scope.row[column.prop] = $event,
|
|
725
853
|
class: "w-full",
|
|
726
854
|
disabled: isDisabled(scope)
|
|
727
855
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"]))
|
|
@@ -741,7 +869,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
741
869
|
};
|
|
742
870
|
}
|
|
743
871
|
});
|
|
744
|
-
const EditTable = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
872
|
+
const EditTable = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-411a7fe4"]]);
|
|
745
873
|
const GridContextInjectionKey = Symbol(
|
|
746
874
|
"GridContextInjectionKey"
|
|
747
875
|
);
|
|
@@ -996,7 +1124,7 @@ function getPrefixCls(name) {
|
|
|
996
1124
|
const { b } = useBemClass();
|
|
997
1125
|
return b(name);
|
|
998
1126
|
}
|
|
999
|
-
const _sfc_main$
|
|
1127
|
+
const _sfc_main$7 = defineComponent({
|
|
1000
1128
|
name: "GridItem",
|
|
1001
1129
|
props: {
|
|
1002
1130
|
/**
|
|
@@ -1114,8 +1242,8 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1114
1242
|
renderSlot(_ctx.$slots, "default", { overflow: _ctx.overflow })
|
|
1115
1243
|
], 6);
|
|
1116
1244
|
}
|
|
1117
|
-
const GridItem = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1118
|
-
const _sfc_main$
|
|
1245
|
+
const GridItem = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$1]]);
|
|
1246
|
+
const _sfc_main$6 = defineComponent({
|
|
1119
1247
|
name: "Grid",
|
|
1120
1248
|
props: {
|
|
1121
1249
|
/**
|
|
@@ -1229,78 +1357,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1229
1357
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1230
1358
|
], 6);
|
|
1231
1359
|
}
|
|
1232
|
-
const Grid = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
1233
|
-
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
1234
|
-
__name: "input-group",
|
|
1235
|
-
setup(__props) {
|
|
1236
|
-
const { b } = useBemClass();
|
|
1237
|
-
return (_ctx, _cache) => {
|
|
1238
|
-
return openBlock(), createElementBlock("div", {
|
|
1239
|
-
class: normalizeClass(unref(b)("input-group"))
|
|
1240
|
-
}, [
|
|
1241
|
-
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
1242
|
-
], 2);
|
|
1243
|
-
};
|
|
1244
|
-
}
|
|
1245
|
-
});
|
|
1246
|
-
const InputGroup = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-cd21cbfd"]]);
|
|
1247
|
-
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
1248
|
-
__name: "input-search",
|
|
1249
|
-
props: /* @__PURE__ */ mergeModels({
|
|
1250
|
-
disabled: { type: Boolean, default: false },
|
|
1251
|
-
readonly: { type: Boolean, default: false },
|
|
1252
|
-
placeholder: { default: "请选择" },
|
|
1253
|
-
disabledHideButton: { type: Boolean, default: false }
|
|
1254
|
-
}, {
|
|
1255
|
-
"modelValue": { type: String },
|
|
1256
|
-
"modelModifiers": {}
|
|
1257
|
-
}),
|
|
1258
|
-
emits: /* @__PURE__ */ mergeModels(["search", "clear"], ["update:modelValue"]),
|
|
1259
|
-
setup(__props, { emit: __emit }) {
|
|
1260
|
-
const model = useModel(__props, "modelValue");
|
|
1261
|
-
const props = __props;
|
|
1262
|
-
const emit = __emit;
|
|
1263
|
-
const { b } = useBemClass();
|
|
1264
|
-
const showButton = computed(() => {
|
|
1265
|
-
if (props.readonly) return false;
|
|
1266
|
-
if (props.disabled) {
|
|
1267
|
-
return !props.disabledHideButton;
|
|
1268
|
-
}
|
|
1269
|
-
return true;
|
|
1270
|
-
});
|
|
1271
|
-
return (_ctx, _cache) => {
|
|
1272
|
-
const _component_el_input = resolveComponent("el-input");
|
|
1273
|
-
const _component_el_button = resolveComponent("el-button");
|
|
1274
|
-
return openBlock(), createBlock(InputGroup, {
|
|
1275
|
-
class: normalizeClass(unref(b)("input-search"))
|
|
1276
|
-
}, {
|
|
1277
|
-
default: withCtx(() => [
|
|
1278
|
-
createVNode(_component_el_input, {
|
|
1279
|
-
modelValue: model.value,
|
|
1280
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => model.value = $event),
|
|
1281
|
-
disabled: props.disabled,
|
|
1282
|
-
readonly: !props.disabled,
|
|
1283
|
-
placeholder: props.placeholder
|
|
1284
|
-
}, null, 8, ["modelValue", "disabled", "readonly", "placeholder"]),
|
|
1285
|
-
showButton.value ? (openBlock(), createBlock(_component_el_button, {
|
|
1286
|
-
key: 0,
|
|
1287
|
-
icon: unref(search_default),
|
|
1288
|
-
disabled: props.disabled,
|
|
1289
|
-
onClick: _cache[1] || (_cache[1] = ($event) => emit("search"))
|
|
1290
|
-
}, null, 8, ["icon", "disabled"])) : createCommentVNode("", true),
|
|
1291
|
-
showButton.value ? (openBlock(), createBlock(_component_el_button, {
|
|
1292
|
-
key: 1,
|
|
1293
|
-
icon: unref(close_default),
|
|
1294
|
-
disabled: props.disabled,
|
|
1295
|
-
onClick: _cache[2] || (_cache[2] = ($event) => emit("clear"))
|
|
1296
|
-
}, null, 8, ["icon", "disabled"])) : createCommentVNode("", true)
|
|
1297
|
-
]),
|
|
1298
|
-
_: 1
|
|
1299
|
-
}, 8, ["class"]);
|
|
1300
|
-
};
|
|
1301
|
-
}
|
|
1302
|
-
});
|
|
1303
|
-
const InputSearch = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__scopeId", "data-v-788824ed"]]);
|
|
1360
|
+
const Grid = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render], ["__scopeId", "data-v-4f2b02b0"]]);
|
|
1304
1361
|
const _hoisted_1 = {
|
|
1305
1362
|
key: 0,
|
|
1306
1363
|
class: "w-full"
|
|
@@ -1927,7 +1984,9 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
1927
1984
|
_ctx.column.render ? {
|
|
1928
1985
|
name: "default",
|
|
1929
1986
|
fn: withCtx((scope) => [
|
|
1930
|
-
|
|
1987
|
+
typeof _ctx.column.render(scope) === "string" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
1988
|
+
createTextVNode(toDisplayString(_ctx.column.render(scope)), 1)
|
|
1989
|
+
], 64)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.column.render(scope)), { key: 1 }))
|
|
1931
1990
|
]),
|
|
1932
1991
|
key: "0"
|
|
1933
1992
|
} : _ctx.column.slotName ? {
|
|
@@ -2074,7 +2133,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
2074
2133
|
};
|
|
2075
2134
|
}
|
|
2076
2135
|
});
|
|
2077
|
-
const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-
|
|
2136
|
+
const Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-002f7dd8"]]);
|
|
2078
2137
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
2079
2138
|
__name: "tabs",
|
|
2080
2139
|
props: /* @__PURE__ */ mergeModels({
|
|
@@ -2245,6 +2304,7 @@ export {
|
|
|
2245
2304
|
createDialog,
|
|
2246
2305
|
createSelectDialog,
|
|
2247
2306
|
index as default,
|
|
2248
|
-
useBemClass
|
|
2307
|
+
useBemClass,
|
|
2308
|
+
useTable
|
|
2249
2309
|
};
|
|
2250
2310
|
//# sourceMappingURL=index.es.js.map
|