el-plus-crud 0.0.12 → 0.0.13
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/CHANGELOG.md +2 -0
- package/README.md +115 -3
- package/dist/el-plus-crud.mjs +6968 -6968
- package/dist/el-plus-crud.umd.js +27 -27
- package/dist/style.css +1 -1
- package/lib/components/el-plus-form/ElPlusFormDialog.vue +107 -107
- package/lib/components/el-plus-form/components/ElPlusFormAutocomplete.vue +49 -49
- package/lib/components/el-plus-form/components/ElPlusFormBtns.vue +133 -133
- package/lib/components/el-plus-form/components/ElPlusFormCascaderPanel.vue +51 -51
- package/lib/components/el-plus-form/components/ElPlusFormCheckbox.vue +42 -42
- package/lib/components/el-plus-form/components/ElPlusFormCheckboxButton.vue +42 -42
- package/lib/components/el-plus-form/components/ElPlusFormColor.vue +38 -38
- package/lib/components/el-plus-form/components/ElPlusFormDaterange.vue +44 -44
- package/lib/components/el-plus-form/components/ElPlusFormDatetime.vue +38 -38
- package/lib/components/el-plus-form/components/ElPlusFormImage.vue +113 -113
- package/lib/components/el-plus-form/components/ElPlusFormNbinput.vue +51 -51
- package/lib/components/el-plus-form/components/ElPlusFormRadio.vue +42 -42
- package/lib/components/el-plus-form/components/ElPlusFormRate.vue +38 -38
- package/lib/components/el-plus-form/components/ElPlusFormSlider.vue +38 -38
- package/lib/components/el-plus-form/components/ElPlusFormStatus.vue +67 -67
- package/lib/components/el-plus-form/components/ElPlusFormSwitch.vue +38 -38
- package/lib/components/el-plus-form/components/ElPlusFormTag.vue +78 -78
- package/lib/components/el-plus-form/components/ElPlusFormTransfer.vue +44 -44
- package/lib/components/el-plus-form/components/ElPlusFormTree.vue +53 -53
- package/lib/components/el-plus-form/components/ElPlusFormTreeSelect.vue +36 -36
- package/lib/components/el-plus-form/components/ElPlusFormUpload.vue +2 -0
- package/lib/components/el-plus-form/components/index.ts +17 -17
- package/lib/components/el-plus-form/data/file.ts +74 -74
- package/lib/components/el-plus-form/mixins/index.ts +113 -113
- package/lib/components/el-plus-form/util/validate.ts +310 -310
- package/lib/components-list.ts +66 -66
- package/package.json +1 -1
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.ElPlusFormArea-panel[data-v-a9653fd0],.ElPlusFormAutocomplete-panel[data-v-de84b568],.el-plus-form-btn-group{display:flex}.el-plus-form-btn-group .group-menu-btn{margin-left:10px}.ElPlusFormCascader-panel[data-v-ab6b4aed],.ElPlusFormCascaderPanel-panel[data-v-298c9c68],.ElPlusFormCheckbox-panel[data-v-1fad6d4e],.ElPlusFormCheckboxButton-panel[data-v-393cd84d],.ElPlusFormColor-panel[data-v-6e010f98],.ElPlusFormDate-panel[data-v-7295d086],.el-plusF-form-daterange-panel[data-v-21a80cbc],.ElPlusFormDatetime-panel[data-v-831e254a]{display:flex}.file-icons-panel[data-v-e0d1255f]{width:100%}.file-icons-panel .file-list[data-v-e0d1255f]{width:100%;display:flex;flex-direction:column}.file-icons-panel .file-list .file-item[data-v-e0d1255f]{display:flex;flex-direction:row;align-items:center;width:100%;height:28px;line-height:28px;padding-left:10px;background:#f5f7fa;margin-bottom:10px;cursor:pointer;font-size:13px;font-weight:400;color:#303133}.file-icons-panel .file-list .file-item[data-v-e0d1255f]:hover{background:#e7e8eb;color:#1890ff}.file-icons-panel .file-list .file-item .file-name[data-v-e0d1255f]{margin-left:10px}.file-icons-panel .card-list[data-v-e0d1255f]{width:100%;display:flex;flex-direction:row}.file-icons-panel .card-list .file-item[data-v-e0d1255f]{display:flex;flex-direction:column;align-items:center}.file-icons-panel .card-list .file-item .file-name[data-v-e0d1255f]{margin-top:10px}.ele-form-file{width:100%;display:flex;justify-content:center;margin-top:10px}.ele-form-file .form-file-list{display:flex;flex-direction:column;width:100%}.ele-form-file .no-img-tip{width:100%;color:#999;padding-left:20px}.ele-form-image{display:flex;flex-wrap:wrap}.ele-form-image .no-img-tip{color:#999}.ele-form-image .el-image{margin-left:10px;margin-bottom:10px}.ele-form-image .el-image{border-radius:5px;margin-bottom:10px}.ele-form-image .el-image .el-image__error{font-size:12px;line-height:13px}.el-plus-form-link[data-v-e9e128a8]{width:100%}.el-plus-form-link .items-panel[data-v-e9e128a8] .el-input__inner{cursor:pointer}.el-plus-form-link[data-v-e9e128a8] .el-tag__close{display:none!important}.form-link-dialog{width:100%;display:flex;box-sizing:border-box}.form-link-dialog .panel-left{min-width:60%;height:500px;display:flex;flex-direction:column}.form-link-dialog .panel-left .dept-breadcrumb{width:100%;padding:0 10px;margin-bottom:20px;cursor:pointer}.form-link-dialog .panel-right{min-width:40%;max-width:40%;margin-left:20px;border-left:1px var(--el-border-color) var(--el-border-style);padding:20px;display:flex;overflow:hidden;flex-direction:column}.form-link-dialog .panel-right .right-title{width:100%;font-size:14px;color:#999;margin-bottom:20px}.form-link-dialog .panel-right .tag-list{width:100%;height:400px;overflow:hidden}.form-link-dialog .panel-right .tag-list .tag-item .el-tag__content{max-width:100px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.form-link-dialog .panel-right .btn-panel{width:100%;min-height:50px;padding-top:10px;display:flex;justify-content:center}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none}input[type=number]{-moz-appearance:textfield}.ElPlusFormNumber-panel[data-v-9e51e72b]{width:100%!important;max-width:100%}.ElPlusFormNumber-panel[data-v-9e51e72b] .el-input__wrapper input{text-align:left!important}.el-plus-form-quick-input{width:100%;display:flex;align-items:center;margin-top:10px}.el-plus-form-quick-input .el-tag{margin-right:10px}.ElPlusFormRadio-panel[data-v-8d4a5a8c],.ElPlusFormRate-panel[data-v-d813a6a7]{display:flex}.el-plus-form-select-options{width:100%;display:flex;justify-content:space-between;align-items:center}.el-plus-form-select-options>div{color:#aaa;max-width:40%;font-size:12px;word-break:break-all}.el-select-dropdown__item{height:auto;white-space:break-spaces}.ElPlusFormSlider-panel[data-v-c8429f7c]{display:flex}.ElPlusFormStatus-panel[data-v-940f4af6]{display:flex;line-height:25px;align-items:center}.ElPlusFormStatus-panel i[data-v-940f4af6]{display:inline-block;min-width:10px;min-height:10px;border-radius:50%;margin-right:5px}.ElPlusFormStatus-panel .status-danger[data-v-940f4af6]{background:#f56c6c}.ElPlusFormStatus-panel .status-success[data-v-940f4af6]{background:#67c23a}.ElPlusFormStatus-panel .status-warning[data-v-940f4af6]{background:#e6a23c}.ElPlusFormStatus-panel .status-info[data-v-940f4af6]{background:#909399}.ele-form-text[data-v-07e15a42]{color:#606266;word-break:break-all;display:flex;align-items:center}.ele-form-text-click[data-v-07e15a42]{color:#1890ff;cursor:pointer}.ele-form-transfer[data-v-31ae19d3]{line-height:1}.el-plus-form-tree[data-v-a734400f]{width:100%}.ele-form-upload-image{width:100%;display:flex}.ele-form-upload-image .ele-image-upload{display:flex;justify-content:flex-start;width:100%}.ele-form-upload-image .upload-panel-icon{margin:auto}.ele-form-upload-image .upload-disabled .el-upload--picture-card{cursor:not-allowed!important}.ele-form-upload-image .el-icon-close-tip{display:none!important}.ele-form-upload-image .el-upload--picture-card{margin-bottom:12px}.ele-form-upload-image .over-limit .el-upload--picture-card{display:none!important}.ele-form-upload-image .el-upload--picture-card,.ele-form-upload-image .el-upload-list--picture-card .el-upload-list__item{width:100px!important;height:100px!important;border:none!important}.ele-form-upload-image .el-upload-dragger{display:flex;padding:0!important;min-height:100px}.ele-form-upload-image .el-upload-dragger .el-upload__text{font-size:12px!important;color:#999}.ele-form-upload-image .el-upload-dragger .el-upload__text2{font-size:16px;color:#303133;line-height:22px;margin-top:16px;margin-bottom:16px}.ele-form-upload-image .el-progress-circle{width:90px!important;height:90px!important;margin:auto}.ele-form-upload-image .el-upload-list--picture-card .el-upload-list__item-thumbnail{object-fit:cover!important}.ele-form-upload-image .el-icon--close-tip{display:none!important}.ele-form-upload-file .ele-image-upload{flex-direction:column}.ele-form-upload-file .el-upload-list__item{margin:0!important}.ele-form-upload-file .el-form-item--default .el-form-item__content,.ele-form-upload-file .el-upload-list__item-name{line-height:20px!important;font-size:12px!important}.el-plus-form-panel .el-plus-form--inline .el-plus-form-btns{width:auto}.el-plus-form-panel .el-form--inline .el-form-item{margin-right:12px!important}.el-plus-form-panel .el-plus-form-col--break{clear:both}.el-plus-form-panel .el-plus-form-tip{color:#909399;line-height:1.5em;margin-top:3px}.el-plus-form-panel .el-plus-form-tip code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}.el-plus-form-panel .el-plus-form-column-panel>.el-form-item--default{margin-bottom:18px!important}.el-plus-form-panel .el-plus-form-column-panel>.el-form-item--default>.el-form-item__label{line-height:40px;margin-bottom:0}.el-plus-table-edit-column[data-v-76fa7ef7]{margin:0 10px;display:inline-block}.el-plus-table-edit-column .select-panel[data-v-76fa7ef7]{width:100%;height:30px;padding:0 10px;border-bottom:1px solid #eee;margin-bottom:10px}.el-plus-table-header-info .el-plus-table-header-form{display:flex;flex-wrap:wrap;align-items:center}.el-plus-table-header-info .el-plus-table-header-form .el-form{display:flex;justify-content:flex-start;flex-wrap:wrap}.el-plus-table-header-info .el-plus-table-header-form .el-form .el-form-item{margin-bottom:16px!important}.el-plus-table-header-info .el-plus-table-header-form .el-form .el-form-item .el-form-item__label{width:auto!important}.el-plus-table-header-info .el-plus-table-header-form .el-form .waterfall-panel{width:auto!important;align-items:center}.el-plus-table-header-info .el-plus-table-header-form .el-form .table-header-form-btns{white-space:nowrap;display:flex;flex-wrap:wrap;align-items:center}.el-plus-table-header-info .el-plus-table-header-form .el-form .table-header-form-btns>*{margin-bottom:16px}.el-plus-table-header-info .el-plus-table-header-form .el-plus-table-header-btns{display:flex;align-items:center;flex-wrap:wrap}.el-plus-table-header-info .el-plus-table-header-form .el-plus-table-header-btns .el-plus-table-header-btn{height:40px;display:flex;align-items:center;margin-right:10px}.el-plus-table-header-info[data-v-6ce69554]{width:100%}.el-plus-table-column-item[data-v-53e27808]{width:100%;display:flex}.el-plus-table-column-item[data-v-53e27808] .ele-form-text{display:inline-block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.el-plus-table-column-row[data-v-53e27808]{flex-direction:row}.el-plus-table-column-row>div[data-v-53e27808]{margin-right:10px}.el-plus-table-column-row>div[data-v-53e27808]:last-child{margin:0}.el-plus-table-column-column[data-v-53e27808]{flex-direction:row}.el-plus-table-column-column>div[data-v-53e27808]{margin-bottom:10px}.el-plus-table-column-column>div[data-v-53e27808]:last-child{margin:0}.el-plus-table-content{background-color:#fff;border-radius:5px;padding:10px;width:100%;max-height:100%;overflow:hidden;display:flex;flex-direction:column;position:relative}.el-plus-table-content .th-required{position:relative}.el-plus-table-content .th-required:before{content:"*";position:absolute;left:-10px;font-size:16px;top:2px;color:#ff3b30;font-weight:700}.el-plus-table-content .select-items{display:flex;flex-wrap:wrap;align-items:center}.el-plus-table-content .select-items .title{font-size:18px;font-weight:700;margin-right:20px}.el-plus-table-content .select-items .select-item{margin:5px 10px 5px 0}.el-plus-table-content .select-items .select-item:last-child{margin-right:0}.el-plus-table-content .table-tabs-panel{margin-bottom:16px}.el-plus-table-content .summary-row{width:100%;background-color:var(--el-table-row-hover-bg-color);color:var(--el-table-text-color);padding:16px 20px;line-height:24px;height:40px;display:flex;position:relative}.el-plus-table-content .summary-row .summary-item{display:flex;align-items:center;margin-right:30px}.el-plus-table-content .summary-row .summary-item>span{margin-right:20px}.el-plus-table-content .el-plus-table-main{width:100%;flex:1;max-height:100%;display:flex;flex-direction:column}.el-plus-table-content .el-plus-table-main .el-table .cell{display:flex;align-items:center}.el-plus-table-content .pager-statistic{width:100%;position:fixed;height:32px;line-height:32px;bottom:0;text-align:right;min-width:900px}.el-plus-table-content .pager-statistic .statistic-item{display:inline-block}.el-plus-table-content .el-cascader__label{width:300px!important}.el-plus-table-content .bottom-page-static-info{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;min-height:41px;margin-top:10px}.el-plus-table-content .bottom-page-static-info .page-info{margin-right:30px}.el-plus-table-content .common-list-export-excel{background:#20a0ff;text-decoration:none;color:#fff;font-size:12px;height:29px;line-height:30px;display:block;margin-top:5px;border-radius:3px;padding:0 10px}.el-plus-table-content .common-list-export-excel:hover{background:#58b6ff}.el-plus-table-content .el-table__empty-block{height:auto!important}
|
|
1
|
+
@charset "UTF-8";.ElPlusFormArea-panel[data-v-a9653fd0],.ElPlusFormAutocomplete-panel[data-v-9a2a6259],.el-plus-form-btn-group{display:flex}.el-plus-form-btn-group .group-menu-btn{margin-left:10px}.ElPlusFormCascader-panel[data-v-ab6b4aed],.ElPlusFormCascaderPanel-panel[data-v-2c8fbcd6],.ElPlusFormCheckbox-panel[data-v-d9495439],.ElPlusFormCheckboxButton-panel[data-v-01d22bc6],.ElPlusFormColor-panel[data-v-b0687872],.ElPlusFormDate-panel[data-v-7295d086],.el-plusF-form-daterange-panel[data-v-2f54b570],.ElPlusFormDatetime-panel[data-v-e8947510]{display:flex}.file-icons-panel[data-v-e0d1255f]{width:100%}.file-icons-panel .file-list[data-v-e0d1255f]{width:100%;display:flex;flex-direction:column}.file-icons-panel .file-list .file-item[data-v-e0d1255f]{display:flex;flex-direction:row;align-items:center;width:100%;height:28px;line-height:28px;padding-left:10px;background:#f5f7fa;margin-bottom:10px;cursor:pointer;font-size:13px;font-weight:400;color:#303133}.file-icons-panel .file-list .file-item[data-v-e0d1255f]:hover{background:#e7e8eb;color:#1890ff}.file-icons-panel .file-list .file-item .file-name[data-v-e0d1255f]{margin-left:10px}.file-icons-panel .card-list[data-v-e0d1255f]{width:100%;display:flex;flex-direction:row}.file-icons-panel .card-list .file-item[data-v-e0d1255f]{display:flex;flex-direction:column;align-items:center}.file-icons-panel .card-list .file-item .file-name[data-v-e0d1255f]{margin-top:10px}.ele-form-file{width:100%;display:flex;justify-content:center;margin-top:10px}.ele-form-file .form-file-list{display:flex;flex-direction:column;width:100%}.ele-form-file .no-img-tip{width:100%;color:#999;padding-left:20px}.ele-form-image{display:flex;flex-wrap:wrap}.ele-form-image .no-img-tip{color:#999}.ele-form-image .el-image{margin-left:10px;margin-bottom:10px}.ele-form-image .el-image{border-radius:5px;margin-bottom:10px}.ele-form-image .el-image .el-image__error{font-size:12px;line-height:13px}.el-plus-form-link[data-v-e9e128a8]{width:100%}.el-plus-form-link .items-panel[data-v-e9e128a8] .el-input__inner{cursor:pointer}.el-plus-form-link[data-v-e9e128a8] .el-tag__close{display:none!important}.form-link-dialog{width:100%;display:flex;box-sizing:border-box}.form-link-dialog .panel-left{min-width:60%;height:500px;display:flex;flex-direction:column}.form-link-dialog .panel-left .dept-breadcrumb{width:100%;padding:0 10px;margin-bottom:20px;cursor:pointer}.form-link-dialog .panel-right{min-width:40%;max-width:40%;margin-left:20px;border-left:1px var(--el-border-color) var(--el-border-style);padding:20px;display:flex;overflow:hidden;flex-direction:column}.form-link-dialog .panel-right .right-title{width:100%;font-size:14px;color:#999;margin-bottom:20px}.form-link-dialog .panel-right .tag-list{width:100%;height:400px;overflow:hidden}.form-link-dialog .panel-right .tag-list .tag-item .el-tag__content{max-width:100px;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.form-link-dialog .panel-right .btn-panel{width:100%;min-height:50px;padding-top:10px;display:flex;justify-content:center}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none}input[type=number]{-moz-appearance:textfield}.ElPlusFormNumber-panel[data-v-9e51e72b]{width:100%!important;max-width:100%}.ElPlusFormNumber-panel[data-v-9e51e72b] .el-input__wrapper input{text-align:left!important}.el-plus-form-quick-input{width:100%;display:flex;align-items:center;margin-top:10px}.el-plus-form-quick-input .el-tag{margin-right:10px}.ElPlusFormRadio-panel[data-v-2d59dd3c],.ElPlusFormRate-panel[data-v-c585734a]{display:flex}.el-plus-form-select-options{width:100%;display:flex;justify-content:space-between;align-items:center}.el-plus-form-select-options>div{color:#aaa;max-width:40%;font-size:12px;word-break:break-all}.el-select-dropdown__item{height:auto;white-space:break-spaces}.ElPlusFormSlider-panel[data-v-b3d36458]{display:flex}.ElPlusFormStatus-panel[data-v-87ed9e56]{display:flex;line-height:25px;align-items:center}.ElPlusFormStatus-panel i[data-v-87ed9e56]{display:inline-block;min-width:10px;min-height:10px;border-radius:50%;margin-right:5px}.ElPlusFormStatus-panel .status-danger[data-v-87ed9e56]{background:#f56c6c}.ElPlusFormStatus-panel .status-success[data-v-87ed9e56]{background:#67c23a}.ElPlusFormStatus-panel .status-warning[data-v-87ed9e56]{background:#e6a23c}.ElPlusFormStatus-panel .status-info[data-v-87ed9e56]{background:#909399}.ele-form-text[data-v-07e15a42]{color:#606266;word-break:break-all;display:flex;align-items:center}.ele-form-text-click[data-v-07e15a42]{color:#1890ff;cursor:pointer}.ele-form-transfer[data-v-6262dcef]{line-height:1}.el-plus-form-tree[data-v-4aa78551]{width:100%}.ele-form-upload-image{width:100%;display:flex}.ele-form-upload-image .ele-image-upload{display:flex;justify-content:flex-start;width:100%}.ele-form-upload-image .upload-panel-icon{margin:auto}.ele-form-upload-image .upload-disabled .el-upload--picture-card{cursor:not-allowed!important}.ele-form-upload-image .el-icon-close-tip{display:none!important}.ele-form-upload-image .el-upload--picture-card{margin-bottom:12px}.ele-form-upload-image .over-limit .el-upload--picture-card{display:none!important}.ele-form-upload-image .el-upload--picture-card,.ele-form-upload-image .el-upload-list--picture-card .el-upload-list__item{width:100px!important;height:100px!important;border:none!important}.ele-form-upload-image .el-upload-dragger{display:flex;padding:0!important;min-height:100px}.ele-form-upload-image .el-upload-dragger .el-upload__text{font-size:12px!important;color:#999}.ele-form-upload-image .el-upload-dragger .el-upload__text2{font-size:16px;color:#303133;line-height:22px;margin-top:16px;margin-bottom:16px}.ele-form-upload-image .el-progress-circle{width:90px!important;height:90px!important;margin:auto}.ele-form-upload-image .el-upload-list--picture-card .el-upload-list__item-thumbnail{object-fit:cover!important}.ele-form-upload-image .el-icon--close-tip{display:none!important}.ele-form-upload-file .ele-image-upload{flex-direction:column}.ele-form-upload-file .el-upload-list__item{margin:0!important}.ele-form-upload-file .el-form-item--default .el-form-item__content,.ele-form-upload-file .el-upload-list__item-name{line-height:20px!important;font-size:12px!important}.el-plus-form-panel .el-plus-form--inline .el-plus-form-btns{width:auto}.el-plus-form-panel .el-form--inline .el-form-item{margin-right:12px!important}.el-plus-form-panel .el-plus-form-col--break{clear:both}.el-plus-form-panel .el-plus-form-tip{color:#909399;line-height:1.5em;margin-top:3px}.el-plus-form-panel .el-plus-form-tip code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}.el-plus-form-panel .el-plus-form-column-panel>.el-form-item--default{margin-bottom:18px!important}.el-plus-form-panel .el-plus-form-column-panel>.el-form-item--default>.el-form-item__label{line-height:40px;margin-bottom:0}.el-plus-table-edit-column[data-v-76fa7ef7]{margin:0 10px;display:inline-block}.el-plus-table-edit-column .select-panel[data-v-76fa7ef7]{width:100%;height:30px;padding:0 10px;border-bottom:1px solid #eee;margin-bottom:10px}.el-plus-table-header-info .el-plus-table-header-form{display:flex;flex-wrap:wrap;align-items:center}.el-plus-table-header-info .el-plus-table-header-form .el-form{display:flex;justify-content:flex-start;flex-wrap:wrap}.el-plus-table-header-info .el-plus-table-header-form .el-form .el-form-item{margin-bottom:16px!important}.el-plus-table-header-info .el-plus-table-header-form .el-form .el-form-item .el-form-item__label{width:auto!important}.el-plus-table-header-info .el-plus-table-header-form .el-form .waterfall-panel{width:auto!important;align-items:center}.el-plus-table-header-info .el-plus-table-header-form .el-form .table-header-form-btns{white-space:nowrap;display:flex;flex-wrap:wrap;align-items:center}.el-plus-table-header-info .el-plus-table-header-form .el-form .table-header-form-btns>*{margin-bottom:16px}.el-plus-table-header-info .el-plus-table-header-form .el-plus-table-header-btns{display:flex;align-items:center;flex-wrap:wrap}.el-plus-table-header-info .el-plus-table-header-form .el-plus-table-header-btns .el-plus-table-header-btn{height:40px;display:flex;align-items:center;margin-right:10px}.el-plus-table-header-info[data-v-6ce69554]{width:100%}.el-plus-table-column-item[data-v-53e27808]{width:100%;display:flex}.el-plus-table-column-item[data-v-53e27808] .ele-form-text{display:inline-block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.el-plus-table-column-row[data-v-53e27808]{flex-direction:row}.el-plus-table-column-row>div[data-v-53e27808]{margin-right:10px}.el-plus-table-column-row>div[data-v-53e27808]:last-child{margin:0}.el-plus-table-column-column[data-v-53e27808]{flex-direction:row}.el-plus-table-column-column>div[data-v-53e27808]{margin-bottom:10px}.el-plus-table-column-column>div[data-v-53e27808]:last-child{margin:0}.el-plus-table-content{background-color:#fff;border-radius:5px;padding:10px;width:100%;max-height:100%;overflow:hidden;display:flex;flex-direction:column;position:relative}.el-plus-table-content .th-required{position:relative}.el-plus-table-content .th-required:before{content:"*";position:absolute;left:-10px;font-size:16px;top:2px;color:#ff3b30;font-weight:700}.el-plus-table-content .select-items{display:flex;flex-wrap:wrap;align-items:center}.el-plus-table-content .select-items .title{font-size:18px;font-weight:700;margin-right:20px}.el-plus-table-content .select-items .select-item{margin:5px 10px 5px 0}.el-plus-table-content .select-items .select-item:last-child{margin-right:0}.el-plus-table-content .table-tabs-panel{margin-bottom:16px}.el-plus-table-content .summary-row{width:100%;background-color:var(--el-table-row-hover-bg-color);color:var(--el-table-text-color);padding:16px 20px;line-height:24px;height:40px;display:flex;position:relative}.el-plus-table-content .summary-row .summary-item{display:flex;align-items:center;margin-right:30px}.el-plus-table-content .summary-row .summary-item>span{margin-right:20px}.el-plus-table-content .el-plus-table-main{width:100%;flex:1;max-height:100%;display:flex;flex-direction:column}.el-plus-table-content .el-plus-table-main .el-table .cell{display:flex;align-items:center}.el-plus-table-content .pager-statistic{width:100%;position:fixed;height:32px;line-height:32px;bottom:0;text-align:right;min-width:900px}.el-plus-table-content .pager-statistic .statistic-item{display:inline-block}.el-plus-table-content .el-cascader__label{width:300px!important}.el-plus-table-content .bottom-page-static-info{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;min-height:41px;margin-top:10px}.el-plus-table-content .bottom-page-static-info .page-info{margin-right:30px}.el-plus-table-content .common-list-export-excel{background:#20a0ff;text-decoration:none;color:#fff;font-size:12px;height:29px;line-height:30px;display:block;margin-top:5px;border-radius:3px;padding:0 10px}.el-plus-table-content .common-list-export-excel:hover{background:#58b6ff}.el-plus-table-content .el-table__empty-block{height:auto!important}
|
|
@@ -1,107 +1,107 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-dialog class="el-plus-form-dialog" v-model="currentShow" :title="props.title" v-bind="dialogAttrs" destroy-on-close>
|
|
3
|
-
<!-- title 插槽 -->
|
|
4
|
-
<template #header>
|
|
5
|
-
<slot name="header" />
|
|
6
|
-
</template>
|
|
7
|
-
<ElPlusForm ref="refElPlusDialogForm" style="padding: 20px" :isDialog="true" v-model="currentValue" v-bind="attrs" :success="dialogSuccess" @cancel="close">
|
|
8
|
-
<template #top>
|
|
9
|
-
<slot name="top" />
|
|
10
|
-
</template>
|
|
11
|
-
<template #default>
|
|
12
|
-
<slot name="default" />
|
|
13
|
-
</template>
|
|
14
|
-
</ElPlusForm>
|
|
15
|
-
</el-dialog>
|
|
16
|
-
</template>
|
|
17
|
-
<script lang="ts">
|
|
18
|
-
export default {
|
|
19
|
-
name: 'ElPlusFormDialog',
|
|
20
|
-
inheritAttrs: false,
|
|
21
|
-
customOptions: {}
|
|
22
|
-
}
|
|
23
|
-
</script>
|
|
24
|
-
<script lang="ts" setup>
|
|
25
|
-
import { ref, computed, useAttrs, nextTick } from 'vue'
|
|
26
|
-
import ElPlusForm from './ElPlusForm.vue'
|
|
27
|
-
import { ElMessage } from 'element-plus'
|
|
28
|
-
|
|
29
|
-
const emits = defineEmits(['update:show', 'update:modelValue'])
|
|
30
|
-
const props = withDefaults(defineProps<{ modelValue?: { [key: string]: any } | {}; show?: boolean; title?: string; tableRef?: any; success?: Function; successTip?: string }>(), {
|
|
31
|
-
title: '',
|
|
32
|
-
modelValue: () => {
|
|
33
|
-
return {}
|
|
34
|
-
},
|
|
35
|
-
show: false,
|
|
36
|
-
successTip: '操作成功!'
|
|
37
|
-
})
|
|
38
|
-
|
|
39
|
-
// 重新定义当前值
|
|
40
|
-
const currentValue = computed({
|
|
41
|
-
get: () => props.modelValue,
|
|
42
|
-
set(val: any) {
|
|
43
|
-
emits('update:modelValue', val)
|
|
44
|
-
}
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
// 是否显示弹框
|
|
48
|
-
const currentShow = computed({
|
|
49
|
-
get() {
|
|
50
|
-
// 打开时,清空一下校验
|
|
51
|
-
if (props.show) {
|
|
52
|
-
nextTick(() => {
|
|
53
|
-
setTimeout(() => {
|
|
54
|
-
refElPlusDialogForm.value?.clearValid()
|
|
55
|
-
}, 10)
|
|
56
|
-
})
|
|
57
|
-
}
|
|
58
|
-
return props.show
|
|
59
|
-
},
|
|
60
|
-
set(val: boolean) {
|
|
61
|
-
val ? open() : close()
|
|
62
|
-
}
|
|
63
|
-
})
|
|
64
|
-
const refElPlusDialogForm = ref(null as any)
|
|
65
|
-
|
|
66
|
-
// 合并属性
|
|
67
|
-
const { width, top, modal, appendToBody, showClose, draggable, closeOnClickModal, ...attrs } = Object.assign({ width: '700px', draggable: true, top: '15vh', closeOnClickModal: false, showCancel: true }, useAttrs())
|
|
68
|
-
// 弹框属性
|
|
69
|
-
const dialogAttrs = { width, top, modal, appendToBody, showClose, draggable, closeOnClickModal }
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* 这里重新定义一下成功事件
|
|
73
|
-
* @param formBack
|
|
74
|
-
*/
|
|
75
|
-
function dialogSuccess(formBack: IFormBack) {
|
|
76
|
-
if (props.success) {
|
|
77
|
-
props.success(formBack)
|
|
78
|
-
} else {
|
|
79
|
-
if (props.tableRef) {
|
|
80
|
-
ElMessage.success(props.successTip)
|
|
81
|
-
props.tableRef.reload()
|
|
82
|
-
close()
|
|
83
|
-
setTimeout(() => {
|
|
84
|
-
formBack.callback()
|
|
85
|
-
}, 200)
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* 打开弹框
|
|
92
|
-
*/
|
|
93
|
-
function open() {
|
|
94
|
-
emits('update:show', true)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* 关闭弹框
|
|
99
|
-
*/
|
|
100
|
-
function close() {
|
|
101
|
-
emits('update:show', false)
|
|
102
|
-
// 这里清空一下表单
|
|
103
|
-
refElPlusDialogForm.value?.clear()
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
defineExpose({ open, close })
|
|
107
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<el-dialog class="el-plus-form-dialog" v-model="currentShow" :title="props.title" v-bind="dialogAttrs" destroy-on-close>
|
|
3
|
+
<!-- title 插槽 -->
|
|
4
|
+
<template #header>
|
|
5
|
+
<slot name="header" />
|
|
6
|
+
</template>
|
|
7
|
+
<ElPlusForm ref="refElPlusDialogForm" style="padding: 20px" :isDialog="true" v-model="currentValue" v-bind="attrs" :success="dialogSuccess" @cancel="close">
|
|
8
|
+
<template #top>
|
|
9
|
+
<slot name="top" />
|
|
10
|
+
</template>
|
|
11
|
+
<template #default>
|
|
12
|
+
<slot name="default" />
|
|
13
|
+
</template>
|
|
14
|
+
</ElPlusForm>
|
|
15
|
+
</el-dialog>
|
|
16
|
+
</template>
|
|
17
|
+
<script lang="ts">
|
|
18
|
+
export default {
|
|
19
|
+
name: 'ElPlusFormDialog',
|
|
20
|
+
inheritAttrs: false,
|
|
21
|
+
customOptions: {}
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
<script lang="ts" setup>
|
|
25
|
+
import { ref, computed, useAttrs, nextTick } from 'vue'
|
|
26
|
+
import ElPlusForm from './ElPlusForm.vue'
|
|
27
|
+
import { ElMessage } from 'element-plus'
|
|
28
|
+
|
|
29
|
+
const emits = defineEmits(['update:show', 'update:modelValue'])
|
|
30
|
+
const props = withDefaults(defineProps<{ modelValue?: { [key: string]: any } | {}; show?: boolean; title?: string; tableRef?: any; success?: Function; successTip?: string }>(), {
|
|
31
|
+
title: '',
|
|
32
|
+
modelValue: () => {
|
|
33
|
+
return {}
|
|
34
|
+
},
|
|
35
|
+
show: false,
|
|
36
|
+
successTip: '操作成功!'
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
// 重新定义当前值
|
|
40
|
+
const currentValue = computed({
|
|
41
|
+
get: () => props.modelValue,
|
|
42
|
+
set(val: any) {
|
|
43
|
+
emits('update:modelValue', val)
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
// 是否显示弹框
|
|
48
|
+
const currentShow = computed({
|
|
49
|
+
get() {
|
|
50
|
+
// 打开时,清空一下校验
|
|
51
|
+
if (props.show) {
|
|
52
|
+
nextTick(() => {
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
refElPlusDialogForm.value?.clearValid()
|
|
55
|
+
}, 10)
|
|
56
|
+
})
|
|
57
|
+
}
|
|
58
|
+
return props.show
|
|
59
|
+
},
|
|
60
|
+
set(val: boolean) {
|
|
61
|
+
val ? open() : close()
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
const refElPlusDialogForm = ref(null as any)
|
|
65
|
+
|
|
66
|
+
// 合并属性
|
|
67
|
+
const { width, top, modal, appendToBody, showClose, draggable, closeOnClickModal, ...attrs } = Object.assign({ width: '700px', draggable: true, top: '15vh', closeOnClickModal: false, showCancel: true }, useAttrs())
|
|
68
|
+
// 弹框属性
|
|
69
|
+
const dialogAttrs = { width, top, modal, appendToBody, showClose, draggable, closeOnClickModal }
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* 这里重新定义一下成功事件
|
|
73
|
+
* @param formBack
|
|
74
|
+
*/
|
|
75
|
+
function dialogSuccess(formBack: IFormBack) {
|
|
76
|
+
if (props.success) {
|
|
77
|
+
props.success(formBack)
|
|
78
|
+
} else {
|
|
79
|
+
if (props.tableRef) {
|
|
80
|
+
ElMessage.success(props.successTip)
|
|
81
|
+
props.tableRef.reload()
|
|
82
|
+
close()
|
|
83
|
+
setTimeout(() => {
|
|
84
|
+
formBack.callback()
|
|
85
|
+
}, 200)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* 打开弹框
|
|
92
|
+
*/
|
|
93
|
+
function open() {
|
|
94
|
+
emits('update:show', true)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* 关闭弹框
|
|
99
|
+
*/
|
|
100
|
+
function close() {
|
|
101
|
+
emits('update:show', false)
|
|
102
|
+
// 这里清空一下表单
|
|
103
|
+
refElPlusDialogForm.value?.clear()
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
defineExpose({ open, close })
|
|
107
|
+
</script>
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-autocomplete class="ElPlusFormAutocomplete-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue">
|
|
3
|
-
<!-- 作用域插槽 -->
|
|
4
|
-
<template #default="data">
|
|
5
|
-
<slot :data="data" />
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<!-- 非作用域插槽 -->
|
|
9
|
-
<template v-for="(item, key, index) in slots" #[key]="data" :key="index">
|
|
10
|
-
<slot :name="key" :data="data" />
|
|
11
|
-
</template>
|
|
12
|
-
</el-autocomplete>
|
|
13
|
-
</template>
|
|
14
|
-
<script lang="ts">
|
|
15
|
-
export default {
|
|
16
|
-
name: 'ElPlusFormAutocomplete',
|
|
17
|
-
inheritAttrs: false,
|
|
18
|
-
typeName: 'autocomplete',
|
|
19
|
-
customOptions: {}
|
|
20
|
-
}
|
|
21
|
-
</script>
|
|
22
|
-
<script lang="ts" setup>
|
|
23
|
-
import { ref, useAttrs, useSlots, onBeforeMount } from 'vue'
|
|
24
|
-
import { getAttrs, getEvents } from '../mixins'
|
|
25
|
-
|
|
26
|
-
const props = defineProps<{
|
|
27
|
-
modelValue?: string | number | '' | null
|
|
28
|
-
field: string
|
|
29
|
-
desc: { [key: string]: any }
|
|
30
|
-
formData: { [key: string]: any }
|
|
31
|
-
}>()
|
|
32
|
-
|
|
33
|
-
const emits = defineEmits(['update:modelValue'])
|
|
34
|
-
const currentValue = ref(props.modelValue)
|
|
35
|
-
emits('update:modelValue', currentValue)
|
|
36
|
-
|
|
37
|
-
const slots = ref(Object.assign({}, useSlots(), props.desc.slots))
|
|
38
|
-
const attrs = ref({} as any)
|
|
39
|
-
const onEvents = ref(getEvents(props))
|
|
40
|
-
|
|
41
|
-
onBeforeMount(async () => {
|
|
42
|
-
attrs.value = await getAttrs(props, { autocomplete: 'new-password', ...useAttrs() })
|
|
43
|
-
})
|
|
44
|
-
</script>
|
|
45
|
-
<style lang="scss" scoped>
|
|
46
|
-
.ElPlusFormAutocomplete-panel {
|
|
47
|
-
display: flex;
|
|
48
|
-
}
|
|
49
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<el-autocomplete class="ElPlusFormAutocomplete-panel" v-bind="attrs" v-on="onEvents" v-model="currentValue">
|
|
3
|
+
<!-- 作用域插槽 -->
|
|
4
|
+
<template #default="data">
|
|
5
|
+
<slot :data="data" />
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<!-- 非作用域插槽 -->
|
|
9
|
+
<template v-for="(item, key, index) in slots" #[key]="data" :key="index">
|
|
10
|
+
<slot :name="key" :data="data" />
|
|
11
|
+
</template>
|
|
12
|
+
</el-autocomplete>
|
|
13
|
+
</template>
|
|
14
|
+
<script lang="ts">
|
|
15
|
+
export default {
|
|
16
|
+
name: 'ElPlusFormAutocomplete',
|
|
17
|
+
inheritAttrs: false,
|
|
18
|
+
typeName: 'autocomplete',
|
|
19
|
+
customOptions: {}
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
<script lang="ts" setup>
|
|
23
|
+
import { ref, useAttrs, useSlots, onBeforeMount } from 'vue'
|
|
24
|
+
import { getAttrs, getEvents } from '../mixins'
|
|
25
|
+
|
|
26
|
+
const props = defineProps<{
|
|
27
|
+
modelValue?: string | number | '' | null
|
|
28
|
+
field: string
|
|
29
|
+
desc: { [key: string]: any }
|
|
30
|
+
formData: { [key: string]: any }
|
|
31
|
+
}>()
|
|
32
|
+
|
|
33
|
+
const emits = defineEmits(['update:modelValue'])
|
|
34
|
+
const currentValue = ref(props.modelValue)
|
|
35
|
+
emits('update:modelValue', currentValue)
|
|
36
|
+
|
|
37
|
+
const slots = ref(Object.assign({}, useSlots(), props.desc.slots))
|
|
38
|
+
const attrs = ref({} as any)
|
|
39
|
+
const onEvents = ref(getEvents(props))
|
|
40
|
+
|
|
41
|
+
onBeforeMount(async () => {
|
|
42
|
+
attrs.value = await getAttrs(props, { autocomplete: 'new-password', ...useAttrs() })
|
|
43
|
+
})
|
|
44
|
+
</script>
|
|
45
|
+
<style lang="scss" scoped>
|
|
46
|
+
.ElPlusFormAutocomplete-panel {
|
|
47
|
+
display: flex;
|
|
48
|
+
}
|
|
49
|
+
</style>
|
|
@@ -1,133 +1,133 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="el-plus-form-btn-group" :style="{ 'justify-content': getAlignItems }">
|
|
3
|
-
<template v-for="(item, i) in localBtnList" :key="i + (item.label || item.title || '')">
|
|
4
|
-
<ElPlusFormBtn type="primary" :field="field" :desc="item || {}" :formData="formData" :plain="(item && item.plain) ?? desc.plain ?? true" :text="desc.text" :rowIndex="rowIndex" />
|
|
5
|
-
</template>
|
|
6
|
-
<template v-if="limitList && limitList.length > 0">
|
|
7
|
-
<el-dropdown class="group-menu-btn" :size="desc.size || 'small'">
|
|
8
|
-
<el-button type="primary" :size="desc.size || 'small'" :plain="desc.plain ?? true"> 更多<i class="ele-ArrowDown el-icon--right" /> </el-button>
|
|
9
|
-
<template #dropdown>
|
|
10
|
-
<el-dropdown-menu>
|
|
11
|
-
<el-dropdown-item v-for="(item, i) in limitList" :key="i + (item.label || item.title)" v-on="handelEvelt(item)">
|
|
12
|
-
{{ item.label || item.title }}
|
|
13
|
-
</el-dropdown-item>
|
|
14
|
-
</el-dropdown-menu>
|
|
15
|
-
</template>
|
|
16
|
-
</el-dropdown>
|
|
17
|
-
</template>
|
|
18
|
-
</div>
|
|
19
|
-
</template>
|
|
20
|
-
<script lang="ts">
|
|
21
|
-
export default {
|
|
22
|
-
name: 'ElPlusFormBtns',
|
|
23
|
-
inheritAttrs: false,
|
|
24
|
-
typeName: 'btns',
|
|
25
|
-
customOptions: {}
|
|
26
|
-
}
|
|
27
|
-
</script>
|
|
28
|
-
<script lang="ts" setup>
|
|
29
|
-
import { ref, computed, watch, onMounted } from 'vue'
|
|
30
|
-
import ElPlusFormBtn from './ElPlusFormBtn.vue'
|
|
31
|
-
import { ElMessageBox } from 'element-plus'
|
|
32
|
-
|
|
33
|
-
const props = defineProps<{
|
|
34
|
-
field: string
|
|
35
|
-
rowIndex?: number
|
|
36
|
-
desc: { [key: string]: any }
|
|
37
|
-
formData: { [key: string]: any }
|
|
38
|
-
}>()
|
|
39
|
-
|
|
40
|
-
const localBtnList = ref([] as any[])
|
|
41
|
-
const limitList = ref([] as any[])
|
|
42
|
-
|
|
43
|
-
const getAlignItems = computed(() => {
|
|
44
|
-
switch (props.desc.align) {
|
|
45
|
-
case 'right':
|
|
46
|
-
return 'flex-end'
|
|
47
|
-
case 'center':
|
|
48
|
-
return 'center'
|
|
49
|
-
case undefined:
|
|
50
|
-
case 'left':
|
|
51
|
-
return 'flex-start'
|
|
52
|
-
default:
|
|
53
|
-
return 'flex-start'
|
|
54
|
-
}
|
|
55
|
-
})
|
|
56
|
-
|
|
57
|
-
const handelEvelt = computed(() => {
|
|
58
|
-
return (item: any) => {
|
|
59
|
-
const events = {} as any
|
|
60
|
-
if (item && item.on) {
|
|
61
|
-
for (const key in item.on) {
|
|
62
|
-
if (key === 'click' && item.confirm) {
|
|
63
|
-
events[key] = function () {
|
|
64
|
-
ElMessageBox.confirm(item.confirm, '提示', {
|
|
65
|
-
type: 'warning'
|
|
66
|
-
}).then(() => {
|
|
67
|
-
item.on[key]({ row: props.formData, field: props.field, rowIndex: props.rowIndex } as IBtnBack)
|
|
68
|
-
})
|
|
69
|
-
}
|
|
70
|
-
} else {
|
|
71
|
-
events[key] = function () {
|
|
72
|
-
item.on[key]({ row: props.formData, field: props.field, rowIndex: props.rowIndex } as IBtnBack)
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return events
|
|
78
|
-
}
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
// 初始化
|
|
82
|
-
const initBtnList = () => {
|
|
83
|
-
const tempList = [] as any[]
|
|
84
|
-
if (props.desc.btns.length > 0) {
|
|
85
|
-
props.desc.btns.map((item: any) => {
|
|
86
|
-
if (handelItemVIf(item)) {
|
|
87
|
-
tempList.push(item)
|
|
88
|
-
}
|
|
89
|
-
})
|
|
90
|
-
}
|
|
91
|
-
localBtnList.value = tempList
|
|
92
|
-
const limit = props.desc.limit || 3
|
|
93
|
-
if (localBtnList.value.length > limit) {
|
|
94
|
-
limitList.value = localBtnList.value.splice(limit - 1)
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
// 执行一次vif的处理
|
|
98
|
-
const handelItemVIf = (formItem: any): Boolean => {
|
|
99
|
-
if (typeof formItem.vif === 'function') {
|
|
100
|
-
return Boolean(runFnGetData(formItem.vif))
|
|
101
|
-
} else if (typeof formItem.vif === 'boolean') {
|
|
102
|
-
return formItem.vif
|
|
103
|
-
}
|
|
104
|
-
return true
|
|
105
|
-
}
|
|
106
|
-
// 执行函数,获取相关数据
|
|
107
|
-
const runFnGetData = (fn: Function) => {
|
|
108
|
-
return fn(props.formData)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
watch(
|
|
112
|
-
() => props.desc,
|
|
113
|
-
() => initBtnList()
|
|
114
|
-
)
|
|
115
|
-
watch(
|
|
116
|
-
() => props.formData,
|
|
117
|
-
() => initBtnList()
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
onMounted(() => {
|
|
121
|
-
initBtnList()
|
|
122
|
-
})
|
|
123
|
-
</script>
|
|
124
|
-
|
|
125
|
-
<style lang="scss">
|
|
126
|
-
.el-plus-form-btn-group {
|
|
127
|
-
display: flex;
|
|
128
|
-
|
|
129
|
-
.group-menu-btn {
|
|
130
|
-
margin-left: 10px;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="el-plus-form-btn-group" :style="{ 'justify-content': getAlignItems }">
|
|
3
|
+
<template v-for="(item, i) in localBtnList" :key="i + (item.label || item.title || '')">
|
|
4
|
+
<ElPlusFormBtn type="primary" :field="field" :desc="item || {}" :formData="formData" :plain="(item && item.plain) ?? desc.plain ?? true" :text="desc.text" :rowIndex="rowIndex" />
|
|
5
|
+
</template>
|
|
6
|
+
<template v-if="limitList && limitList.length > 0">
|
|
7
|
+
<el-dropdown class="group-menu-btn" :size="desc.size || 'small'">
|
|
8
|
+
<el-button type="primary" :size="desc.size || 'small'" :plain="desc.plain ?? true"> 更多<i class="ele-ArrowDown el-icon--right" /> </el-button>
|
|
9
|
+
<template #dropdown>
|
|
10
|
+
<el-dropdown-menu>
|
|
11
|
+
<el-dropdown-item v-for="(item, i) in limitList" :key="i + (item.label || item.title)" v-on="handelEvelt(item)">
|
|
12
|
+
{{ item.label || item.title }}
|
|
13
|
+
</el-dropdown-item>
|
|
14
|
+
</el-dropdown-menu>
|
|
15
|
+
</template>
|
|
16
|
+
</el-dropdown>
|
|
17
|
+
</template>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
<script lang="ts">
|
|
21
|
+
export default {
|
|
22
|
+
name: 'ElPlusFormBtns',
|
|
23
|
+
inheritAttrs: false,
|
|
24
|
+
typeName: 'btns',
|
|
25
|
+
customOptions: {}
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
<script lang="ts" setup>
|
|
29
|
+
import { ref, computed, watch, onMounted } from 'vue'
|
|
30
|
+
import ElPlusFormBtn from './ElPlusFormBtn.vue'
|
|
31
|
+
import { ElMessageBox } from 'element-plus'
|
|
32
|
+
|
|
33
|
+
const props = defineProps<{
|
|
34
|
+
field: string
|
|
35
|
+
rowIndex?: number
|
|
36
|
+
desc: { [key: string]: any }
|
|
37
|
+
formData: { [key: string]: any }
|
|
38
|
+
}>()
|
|
39
|
+
|
|
40
|
+
const localBtnList = ref([] as any[])
|
|
41
|
+
const limitList = ref([] as any[])
|
|
42
|
+
|
|
43
|
+
const getAlignItems = computed(() => {
|
|
44
|
+
switch (props.desc.align) {
|
|
45
|
+
case 'right':
|
|
46
|
+
return 'flex-end'
|
|
47
|
+
case 'center':
|
|
48
|
+
return 'center'
|
|
49
|
+
case undefined:
|
|
50
|
+
case 'left':
|
|
51
|
+
return 'flex-start'
|
|
52
|
+
default:
|
|
53
|
+
return 'flex-start'
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
const handelEvelt = computed(() => {
|
|
58
|
+
return (item: any) => {
|
|
59
|
+
const events = {} as any
|
|
60
|
+
if (item && item.on) {
|
|
61
|
+
for (const key in item.on) {
|
|
62
|
+
if (key === 'click' && item.confirm) {
|
|
63
|
+
events[key] = function () {
|
|
64
|
+
ElMessageBox.confirm(item.confirm, '提示', {
|
|
65
|
+
type: 'warning'
|
|
66
|
+
}).then(() => {
|
|
67
|
+
item.on[key]({ row: props.formData, field: props.field, rowIndex: props.rowIndex } as IBtnBack)
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
events[key] = function () {
|
|
72
|
+
item.on[key]({ row: props.formData, field: props.field, rowIndex: props.rowIndex } as IBtnBack)
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return events
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
// 初始化
|
|
82
|
+
const initBtnList = () => {
|
|
83
|
+
const tempList = [] as any[]
|
|
84
|
+
if (props.desc.btns.length > 0) {
|
|
85
|
+
props.desc.btns.map((item: any) => {
|
|
86
|
+
if (handelItemVIf(item)) {
|
|
87
|
+
tempList.push(item)
|
|
88
|
+
}
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
localBtnList.value = tempList
|
|
92
|
+
const limit = props.desc.limit || 3
|
|
93
|
+
if (localBtnList.value.length > limit) {
|
|
94
|
+
limitList.value = localBtnList.value.splice(limit - 1)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// 执行一次vif的处理
|
|
98
|
+
const handelItemVIf = (formItem: any): Boolean => {
|
|
99
|
+
if (typeof formItem.vif === 'function') {
|
|
100
|
+
return Boolean(runFnGetData(formItem.vif))
|
|
101
|
+
} else if (typeof formItem.vif === 'boolean') {
|
|
102
|
+
return formItem.vif
|
|
103
|
+
}
|
|
104
|
+
return true
|
|
105
|
+
}
|
|
106
|
+
// 执行函数,获取相关数据
|
|
107
|
+
const runFnGetData = (fn: Function) => {
|
|
108
|
+
return fn(props.formData)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
watch(
|
|
112
|
+
() => props.desc,
|
|
113
|
+
() => initBtnList()
|
|
114
|
+
)
|
|
115
|
+
watch(
|
|
116
|
+
() => props.formData,
|
|
117
|
+
() => initBtnList()
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
onMounted(() => {
|
|
121
|
+
initBtnList()
|
|
122
|
+
})
|
|
123
|
+
</script>
|
|
124
|
+
|
|
125
|
+
<style lang="scss">
|
|
126
|
+
.el-plus-form-btn-group {
|
|
127
|
+
display: flex;
|
|
128
|
+
|
|
129
|
+
.group-menu-btn {
|
|
130
|
+
margin-left: 10px;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
</style>
|