component_ryl_v3 1.1.14 → 1.1.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -27,9 +27,7 @@ Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://
|
|
|
27
27
|
* 暴露方法(通过 ref 调用)
|
|
28
28
|
{Function} getMenu() - 处理传入的导航菜单
|
|
29
29
|
{Function} setMenuActive(path) - 设置菜单选中状态,参数 path 为菜单路径
|
|
30
|
-
{
|
|
31
|
-
{Function} loadImg(content) - 等待图片加载完成后获取主容器高度,参数 content 为 HTML 内容
|
|
32
|
-
{Function} getMainHeight(flag) - 获取内容模块的滚动条状态,参数 flag 为是否跳过滚动条置顶
|
|
30
|
+
{Function} setNormal(value) - 判断是否在 content inner_content 类名上添加 normal 类名
|
|
33
31
|
|
|
34
32
|
|
|
35
33
|
# 询问窗口组件
|
|
@@ -162,3 +160,6 @@ Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://
|
|
|
162
160
|
<el-input v-model="inputMoney" v-money="{max:100,min:0}" placeholder="请输入"></el-input>
|
|
163
161
|
# 数字格式指令
|
|
164
162
|
<el-input v-model="inputNumber" v-number="{max:100,min:0}" placeholder="请输入"></el-input>
|
|
163
|
+
|
|
164
|
+
# 更新版本的信息
|
|
165
|
+
# 1.1.30 handHeader 组件布局更改,去掉了 getMainHeight 和 loadImg 方法,不需要了
|
package/dist/component_ryl_v3.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('@charset "UTF-8";*:not(svg),#app,html,body{margin:0;padding:0;font-family:Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Arial,sans-serif;font-size:12px}a{text-decoration:none;color:#5a5a5a}li{list-style:none}.flex{display:-webkit-flex;display:flex;display:-moz-box;display:-ms-flexbox}.flex_row{flex-direction:row}.flex_col{flex-direction:column}.initTextarea>.el-textarea__inner{resize:none}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent;border-radius:4px}::-webkit-scrollbar-thumb{background-color:transparent;border-radius:0}::-webkit-scrollbar-thumb:hover{background:#c2c2c2}::-webkit-scrollbar-corner{background:transparent}.common_show_scroll::-webkit-scrollbar-thumb{background:#c2c2c2}.tinymce-editor-JustOne *:not(h1,h2,h3,h4,h5,h6){font-size:inherit}.tinymce-editor-JustOne h1{font-size:32px}.tinymce-editor-JustOne h2{font-size:28px}.tinymce-editor-JustOne h3{font-size:24px}.tinymce-editor-JustOne h4{font-size:20px}.tinymce-editor-JustOne h5{font-size:16px}.tinymce-editor-JustOne h6{font-size:12px}.jddsDialog.el-dialog{border-radius:4px}.jddsDialog .el-dialog__title,.jddsDialog .zbt{font-size:16px;color:#272727;line-height:normal}.jddsDialog .el-dialog__body .el-form-item:last-child{margin-bottom:0}.jddsDialog .el-dialog__headerbtn{top:5px;right:0}.jddsDialog .btn{min-width:68px;height:32px;line-height:32px;border-radius:4px;padding:0}.jddsDialog .exit{font-size:14px}.jddsDialog .header-title{display:flex;align-items:center}.jddsDialog.el-dialog--center .header-title{justify-content:center}.JD_table.el-table:before{height:0!important}.JD_table.el-table{width:100%}.JD_table.el-table th,.JD_table.el-table th.el-table__cell{background-color:#eff2f580;padding:0;height:40px;line-height:40px;border-bottom:none!important}.JD_table.el-table th .cell,.JD_table.el-table th.el-table__cell .cell{font-weight:400;color:#999;text-align:left;white-space:nowrap}.JD_table.el-table td,.JD_table.el-table td.el-table__cell{padding:0;height:48px;line-height:48px}.JD_table.el-table td .cell,.JD_table.el-table td.el-table__cell .cell{line-height:normal}.el-table--group,.el-table--border{border:none!important}.el-table--group:after,.el-table--border:after{width:0!important}.el-table--border .el-table__cell,.el-table--border td{border-right:none!important}.el-table--border th.el-table__cell{border-right:1px solid #ebeef5!important}.el-table .cell{text-align:center!important}.el-table__header,.el-table__empty-block,.el-table__body{width:100%!important}.el-sub-menu__title{text-align:left!important}.el-sub-menu .el-menu-item{min-width:auto!important;padding-left:46px!important;position:relative}.el-sub-menu .el-menu-item:after{content:"";width:4px;height:4px;background:#7c878e;border-radius:50%;position:absolute;top:17px;left:26px}.el-sub-menu .el-menu .el-sub-menu .el-sub-menu__title{padding-left:46px!important}.el-sub-menu .el-menu .el-menu .el-menu-item{padding-left:60px!important}.el-sub-menu .el-menu .el-menu .el-menu-item:after{left:46px!important}.el-menu{border-right:none!important}.el-menu-item,.el-sub-menu__title{height:38px!important;line-height:38px!important;margin-top:2px}.el-menu-item *,.el-sub-menu__title *{vertical-align:middle}.el-submenu__title i.el-sub-menu__icon-arrow{color:#c0c5c7;font-weight:700}.el-message-box{width:400px!important}.initMsg_in{padding:20px 0!important}.initMsg_in .el-message-box__header{padding:0!important}.initMsg_in .el-message-box__header .el-message-box__headerbtn{display:none}.initMsg_in .el-message-box__header .el-message-box__status{font-size:50px!important}.initMsg_in .el-message-box__content{padding:20px 30px!important}.initMsg_in .el-message-box__content .el-message-box__message{letter-spacing:1px}.initMsg_in .el-message-box__btns{padding:0!important}.initMsg_in .el-message-box__btns button{min-width:100px;height:40px;border-radius:4px}.initMsg_in .el-message-box__btns button:nth-child(2){margin-left:20px!important}.defaultMsg_in .el-message-box__container{align-items:flex-start}.defaultMsg_in .el-message-box__title span{font-size:14px;font-weight:700}.defaultMsg_in .el-message-box__headerbtn{top:7px}.defaultMsg_in .el-message-box__status{top:0;transform:none;font-size:24px!important}.defaultMsg_in .el-message-box__btns button{min-width:68px;height:32px;border-radius:4px;border:none}.ieBro{position:fixed;padding:10px;z-index:9999;top:0;left:0;right:0;background:#fffade;border:1px solid #f9d878;justify-content:space-between}.ieBro span,.ieBro a{font-size:12px}.ieBro .color{text-decoration:underline}.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks):before{content:""!important}.mainMenu[data-v-e79ba81c]{display:inline-block;position:relative}.mainMenu .elbadge[data-v-e79ba81c]{color:red;font-style:normal}.mainMenu .elbadge.hot[data-v-e79ba81c]:after{display:inline-block;content:"";width:8px;height:8px;background-color:red;border-radius:100%;transform:scale(.9);position:absolute;top:10px;right:-10px}.mainMenu .elbadge.new[data-v-e79ba81c]:after{display:inline-block;content:"new";background-color:red;color:#fff;padding:0 4px 1px;line-height:16px;border-radius:4px;transform:scale(.9);position:absolute;top:6px;right:-32px}.mainMenu .elbadge.run[data-v-e79ba81c]{display:inline-block;color:#fff;background-color:red;min-width:20px;padding:0 2px;text-align:center;height:16px;line-height:16px;border-radius:4px;animation:changeRun 1.5s ease-in-out 0s infinite}.mainMenu .elbadge.num[data-v-e79ba81c]{display:inline-block;background-color:red;color:#fff;width:20px;text-align:center;height:16px;line-height:16px;border-radius:4px;transform:scale(.9);position:absolute;top:6px;right:-22px}.mainMenu .elbadge.num.nine[data-v-e79ba81c]{width:26px;right:-28px}.mainMenu .elbadge.num.nine em[data-v-e79ba81c]{position:relative;top:-4px}.el-menu-item span[data-v-e79ba81c],.el-sub-menu__title span[data-v-e79ba81c]{font-size:14px}.handHeaderContent{position:relative;z-index:999;height:100vh}.handHeaderContent .el-container.is-vertical{position:relative}.handHeaderContent .inner_header{padding:0;background:#fff;justify-content:space-between;align-items:center;height:50px!important}.handHeaderContent .inner_header .colSpan{width:60px;background-color:transparent;justify-content:center;align-items:center}.handHeaderContent .inner_header .colSpan .hide{width:16px;height:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAA2hJREFUeF7t3Vtu5DAMRFFlZ9nZzKwsS0ugTBswGnnYLkqkVddAkC+1Q9YBrXb68dJae28cth14AYBt9p+FA8A7fwCY5w8AALAJtDbAHsA6fjaB5vEDAADcB/A2wB7AO3+eBprnDwAAcB/A2gB7AOv4eRpoHv9/AK/2XTBuQAfAYdwBABiHv70gxLwF3uUzAbzz/9wEchh3AADG4bMHMA8fAABgD+BugD2AuQAAAMC8A+blMwEAYN4B8/IrTIC/rbX+w5HQgWwAW/AASAg/+0ZQD/1Pa+0fEyAp/cfnA2ScfQu/nxsAGQk8zplxCdiHD4DE8DMuAc/hKwB4LWMAnpkT4KvwVQBvAT2wfohZAL4LHwDJ/GYA+Cl8ACwO4LfwAbAwgCPhA2BRAEfDB8CCAM6ED4DFAJwNHwALAbgSPgAWAXA1fAAsAEAJHwA3B6CGD4AbA4gIHwA3BRAVPgBuCCAyfADcDEB0+AC4EYAR4SsAklu3xumP/jt4VPgASHZ0BMDI8AFQHMDo8AFQGMCM8AFQFMCs8AFQEMDM8AFQDMDs8AFQCEBG+AAoAiArfAAUAJAZPgAAwLuDMw1sdwIzpwBvD08UsL8VnIUAAEUA9D8jAwEACgHIQACAYgBmIwBAQQAzEQCgKIBZCABQGMAMBAAoDmA0AgDcAMBIBFcB9E8J40OiRDxHXhO4P8WI+wQAEENUlp8FMGISAEBJUFx7BUA0AgCIISrLrwKIRAAAJUFxrQIgCgEAxBCV5SqACAQAUBIU10YAUBEAQAxRWR4FQEEAACVBcW0kgKsIACCGqCyPBnAFAQCUBMW1IwCcRQAAMURl+SgAZxAAQElQXDsSwFEEABBDVJaPBnAEAQCUBMW1MwD8hgAAYojK8lkAfkKgAFBqZ23CF0dGfm0cAQZ0YOYE2P7cZwRXJ0BA+TxEBoDnywEAEh1mAdgjAIApgA3B/ndiKzxPnTkB9nuCvi/gSOhABQAJZXPKrQMAMLcAAACYd8C8fCYAAMw7YF4+EwAA5h0wL58JAADzDpiXzwQAgHkHzMtnAgDAvAPm5fcJ0D9sicO0Ax3Au2ntlP14VTAAjCkwAYzD76UDAADsAZwNMAGc0+cSYJ4+AADAJcDcAAAAwLMAZwNMAOf02QSapw8AAHAJMDcAAHMAH9uzwUGCPXdSAAAAAElFTkSuQmCC) no-repeat;background-size:contain;cursor:pointer;transition:all .2s}.handHeaderContent .inner_header .colSpan .hide.rotate{transform:rotate(180deg)}.handHeaderContent .inner_header .saasInfo .img{align-items:center;justify-content:center;height:50px;margin-right:20px;cursor:pointer}.handHeaderContent .inner_header .saasInfo .img:hover .dropDown{display:block}.handHeaderContent .inner_header .saasInfo .img img{width:33px;height:33px;border-radius:50%;margin-right:5px;border:1px solid #eff2f5}.handHeaderContent .dropDown{position:absolute;right:10px;top:50px;width:170px;background:#fff;box-shadow:0 0 4px #1919191a;border-radius:2px;display:none;z-index:999}.handHeaderContent .dropDown .san{display:inline-block;width:10px;height:10px;border:1px solid #fff;border-top-style:none;border-right-style:none;transform:rotate(135deg);position:absolute;top:-4px;right:38px;background:#fff}.handHeaderContent .dropDown .user{padding:11px;align-items:center;border-bottom:1px solid #f5f5f5}.handHeaderContent .dropDown .user span{line-height:normal;font-size:14px}.handHeaderContent .dropDown .exit{font-size:14px;line-height:39px;height:39px;border-top:1px solid #EFF2F5;text-align:center;padding:0;color:#5a5a5a}.handHeaderContent .aside{height:100%;transition:all .2s;overflow:overlay;z-index:999;position:relative}.handHeaderContent .aside .init-el-menu{padding-bottom:38px}.handHeaderContent .aside.hideMenu .el-tooltip{text-align:center}.handHeaderContent .aside.hideMenu .el-submenu__title{text-align:center!important}.handHeaderContent .aside.hideMenu i.iconfont{margin-right:0}.handHeaderContent .aside.hideMenu .deldom,.handHeaderContent .aside.hideMenu .el-submenu__icon-arrow{display:none}.handHeaderContent .aside i.iconfont{font-size:18px;display:inline-block;width:18px;margin-right:8px;color:#747c81}.handHeaderContent .main{padding:0;background-color:#eff2f5}.handHeaderContent .main.scroll{overflow-y:scroll}.handHeaderContent .main.scroll .inner_content,.handHeaderContent .main.scroll .inner_content.normal{height:auto}.handHeaderContent .main.scrollX{overflow-x:scroll}.handHeaderContent .main .content_mar{padding:18px}.handHeaderContent .main .inner_content{background-color:#fff;height:calc(100vh - 86px);border-radius:4px}.handHeaderContent .main .inner_content.normal{background-color:transparent}.handHeaderContent .inner_footer{color:#666;text-align:center;padding-top:18px;justify-content:center}@keyframes changeRun{0%{transform:translateY(0) scale(.9)}25%{transform:translateY(-6px) scale(.9)}50%{transform:translateY(0) scale(.9)}75%{transform:translateY(-2px) scale(.9)}to{transform:translateY(0) scale(.9)}}.initNoData[data-v-0b0e3718]{width:100%;align-items:center;justify-content:center}.initNoData .inner[data-v-0b0e3718]{text-align:center}.initNoData .inner p[data-v-0b0e3718]{color:#666;margin-top:12px;line-height:normal}.initPaging[data-v-1d8ef8c9] .el-select__placeholder{text-align:center}.previewFix[data-v-14d38dc6]{width:100%;height:100%;position:fixed;top:0;left:0;z-index:9999;background-color:#00000080;display:flex;justify-content:center;align-items:center}.previewFix img[data-v-14d38dc6]{max-width:98%;max-height:98%}.status_search[data-v-e6bbcf18]{display:inline-block}.status_search span[data-v-e6bbcf18]{min-width:40px;height:30px;padding:0 10px;display:inline-block;text-align:center;line-height:30px;border:1px solid #d9d9d9;border-right:1px solid transparent;cursor:pointer}.status_search span[data-v-e6bbcf18]:first-child{border-radius:2px 0 0 2px}.status_search span[data-v-e6bbcf18]:last-child{border-radius:0 2px 2px 0;border-right:1px solid #d9d9d9}.status_search .active[data-v-e6bbcf18]{background:#06f;color:#fff;border-color:#06f}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var e=document.createElement("style");e.appendChild(document.createTextNode('@charset "UTF-8";*:not(svg),#app,html,body{margin:0;padding:0;font-family:Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,微软雅黑,Arial,sans-serif;font-size:12px}a{text-decoration:none;color:#5a5a5a}li{list-style:none}.flex{display:-webkit-flex;display:flex;display:-moz-box;display:-ms-flexbox}.flex_row{flex-direction:row}.flex_col{flex-direction:column}.initTextarea>.el-textarea__inner{resize:none}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-track{background:transparent;border-radius:4px}::-webkit-scrollbar-thumb{background-color:transparent;border-radius:0}::-webkit-scrollbar-thumb:hover{background:#c2c2c2}::-webkit-scrollbar-corner{background:transparent}.common_show_scroll::-webkit-scrollbar-thumb{background:#c2c2c2}.tinymce-editor-JustOne *:not(h1,h2,h3,h4,h5,h6){font-size:inherit}.tinymce-editor-JustOne h1{font-size:32px}.tinymce-editor-JustOne h2{font-size:28px}.tinymce-editor-JustOne h3{font-size:24px}.tinymce-editor-JustOne h4{font-size:20px}.tinymce-editor-JustOne h5{font-size:16px}.tinymce-editor-JustOne h6{font-size:12px}.jddsDialog.el-dialog{border-radius:4px}.jddsDialog .el-dialog__title,.jddsDialog .zbt{font-size:16px;color:#272727;line-height:normal}.jddsDialog .el-dialog__body .el-form-item:last-child{margin-bottom:0}.jddsDialog .el-dialog__headerbtn{top:5px;right:0}.jddsDialog .btn{min-width:68px;height:32px;line-height:32px;border-radius:4px;padding:0}.jddsDialog .exit{font-size:14px}.jddsDialog .header-title{display:flex;align-items:center}.jddsDialog.el-dialog--center .header-title{justify-content:center}.JD_table.el-table:before{height:0!important}.JD_table.el-table{width:100%}.JD_table.el-table th,.JD_table.el-table th.el-table__cell{background-color:#eff2f580;padding:0;height:40px;line-height:40px;border-bottom:none!important}.JD_table.el-table th .cell,.JD_table.el-table th.el-table__cell .cell{font-weight:400;color:#999;text-align:left;white-space:nowrap}.JD_table.el-table td,.JD_table.el-table td.el-table__cell{padding:0;height:48px;line-height:48px}.JD_table.el-table td .cell,.JD_table.el-table td.el-table__cell .cell{line-height:normal}.el-table--group,.el-table--border{border:none!important}.el-table--group:after,.el-table--border:after{width:0!important}.el-table--border .el-table__cell,.el-table--border td{border-right:none!important}.el-table--border th.el-table__cell{border-right:1px solid #ebeef5!important}.el-table .cell{text-align:center!important}.el-table__header,.el-table__empty-block,.el-table__body{width:100%!important}.el-sub-menu__title{text-align:left!important}.el-sub-menu .el-menu-item{min-width:auto!important;padding-left:46px!important;position:relative}.el-sub-menu .el-menu-item:after{content:"";width:4px;height:4px;background:#7c878e;border-radius:50%;position:absolute;top:17px;left:26px}.el-sub-menu .el-menu .el-sub-menu .el-sub-menu__title{padding-left:46px!important}.el-sub-menu .el-menu .el-menu .el-menu-item{padding-left:60px!important}.el-sub-menu .el-menu .el-menu .el-menu-item:after{left:46px!important}.el-menu{border-right:none!important}.el-menu-item,.el-sub-menu__title{height:38px!important;line-height:38px!important;margin-top:2px}.el-menu-item *,.el-sub-menu__title *{vertical-align:middle}.el-submenu__title i.el-sub-menu__icon-arrow{color:#c0c5c7;font-weight:700}.el-message-box{width:400px!important}.initMsg_in{padding:20px 0!important}.initMsg_in .el-message-box__header{padding:0!important}.initMsg_in .el-message-box__header .el-message-box__headerbtn{display:none}.initMsg_in .el-message-box__header .el-message-box__status{font-size:50px!important}.initMsg_in .el-message-box__content{padding:20px 30px!important}.initMsg_in .el-message-box__content .el-message-box__message{letter-spacing:1px}.initMsg_in .el-message-box__btns{padding:0!important}.initMsg_in .el-message-box__btns button{min-width:100px;height:40px;border-radius:4px}.initMsg_in .el-message-box__btns button:nth-child(2){margin-left:20px!important}.defaultMsg_in .el-message-box__container{align-items:flex-start}.defaultMsg_in .el-message-box__title span{font-size:14px;font-weight:700}.defaultMsg_in .el-message-box__headerbtn{top:7px}.defaultMsg_in .el-message-box__status{top:0;transform:none;font-size:24px!important}.defaultMsg_in .el-message-box__btns button{min-width:68px;height:32px;border-radius:4px;border:none}.ieBro{position:fixed;padding:10px;z-index:9999;top:0;left:0;right:0;background:#fffade;border:1px solid #f9d878;justify-content:space-between}.ieBro span,.ieBro a{font-size:12px}.ieBro .color{text-decoration:underline}.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks):before{content:""!important}.mainMenu[data-v-e79ba81c]{display:inline-block;position:relative}.mainMenu .elbadge[data-v-e79ba81c]{color:red;font-style:normal}.mainMenu .elbadge.hot[data-v-e79ba81c]:after{display:inline-block;content:"";width:8px;height:8px;background-color:red;border-radius:100%;transform:scale(.9);position:absolute;top:10px;right:-10px}.mainMenu .elbadge.new[data-v-e79ba81c]:after{display:inline-block;content:"new";background-color:red;color:#fff;padding:0 4px 1px;line-height:16px;border-radius:4px;transform:scale(.9);position:absolute;top:6px;right:-32px}.mainMenu .elbadge.run[data-v-e79ba81c]{display:inline-block;color:#fff;background-color:red;min-width:20px;padding:0 2px;text-align:center;height:16px;line-height:16px;border-radius:4px;animation:changeRun 1.5s ease-in-out 0s infinite}.mainMenu .elbadge.num[data-v-e79ba81c]{display:inline-block;background-color:red;color:#fff;width:20px;text-align:center;height:16px;line-height:16px;border-radius:4px;transform:scale(.9);position:absolute;top:6px;right:-22px}.mainMenu .elbadge.num.nine[data-v-e79ba81c]{width:26px;right:-28px}.mainMenu .elbadge.num.nine em[data-v-e79ba81c]{position:relative;top:-4px}.el-menu-item span[data-v-e79ba81c],.el-sub-menu__title span[data-v-e79ba81c]{font-size:14px}.handHeaderContent{position:relative;z-index:999;height:100vh}.handHeaderContent .el-container.is-vertical{position:relative}.handHeaderContent .inner_header{padding:0;background:#fff;justify-content:space-between;align-items:center;height:50px!important}.handHeaderContent .inner_header .colSpan{width:60px;background-color:transparent;justify-content:center;align-items:center}.handHeaderContent .inner_header .colSpan .hide{width:16px;height:16px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAAAXNSR0IArs4c6QAAA2hJREFUeF7t3Vtu5DAMRFFlZ9nZzKwsS0ugTBswGnnYLkqkVddAkC+1Q9YBrXb68dJae28cth14AYBt9p+FA8A7fwCY5w8AALAJtDbAHsA6fjaB5vEDAADcB/A2wB7AO3+eBprnDwAAcB/A2gB7AOv4eRpoHv9/AK/2XTBuQAfAYdwBABiHv70gxLwF3uUzAbzz/9wEchh3AADG4bMHMA8fAABgD+BugD2AuQAAAMC8A+blMwEAYN4B8/IrTIC/rbX+w5HQgWwAW/AASAg/+0ZQD/1Pa+0fEyAp/cfnA2ScfQu/nxsAGQk8zplxCdiHD4DE8DMuAc/hKwB4LWMAnpkT4KvwVQBvAT2wfohZAL4LHwDJ/GYA+Cl8ACwO4LfwAbAwgCPhA2BRAEfDB8CCAM6ED4DFAJwNHwALAbgSPgAWAXA1fAAsAEAJHwA3B6CGD4AbA4gIHwA3BRAVPgBuCCAyfADcDEB0+AC4EYAR4SsAklu3xumP/jt4VPgASHZ0BMDI8AFQHMDo8AFQGMCM8AFQFMCs8AFQEMDM8AFQDMDs8AFQCEBG+AAoAiArfAAUAJAZPgAAwLuDMw1sdwIzpwBvD08UsL8VnIUAAEUA9D8jAwEACgHIQACAYgBmIwBAQQAzEQCgKIBZCABQGMAMBAAoDmA0AgDcAMBIBFcB9E8J40OiRDxHXhO4P8WI+wQAEENUlp8FMGISAEBJUFx7BUA0AgCIISrLrwKIRAAAJUFxrQIgCgEAxBCV5SqACAQAUBIU10YAUBEAQAxRWR4FQEEAACVBcW0kgKsIACCGqCyPBnAFAQCUBMW1IwCcRQAAMURl+SgAZxAAQElQXDsSwFEEABBDVJaPBnAEAQCUBMW1MwD8hgAAYojK8lkAfkKgAFBqZ23CF0dGfm0cAQZ0YOYE2P7cZwRXJ0BA+TxEBoDnywEAEh1mAdgjAIApgA3B/ndiKzxPnTkB9nuCvi/gSOhABQAJZXPKrQMAMLcAAACYd8C8fCYAAMw7YF4+EwAA5h0wL58JAADzDpiXzwQAgHkHzMtnAgDAvAPm5fcJ0D9sicO0Ax3Au2ntlP14VTAAjCkwAYzD76UDAADsAZwNMAGc0+cSYJ4+AADAJcDcAAAAwLMAZwNMAOf02QSapw8AAHAJMDcAAHMAH9uzwUGCPXdSAAAAAElFTkSuQmCC) no-repeat;background-size:contain;cursor:pointer;transition:all .2s}.handHeaderContent .inner_header .colSpan .hide.rotate{transform:rotate(180deg)}.handHeaderContent .inner_header .saasInfo .img{align-items:center;justify-content:center;height:50px;margin-right:20px;cursor:pointer}.handHeaderContent .inner_header .saasInfo .img:hover .dropDown{display:block}.handHeaderContent .inner_header .saasInfo .img img{width:33px;height:33px;border-radius:50%;margin-right:5px;border:1px solid #eff2f5}.handHeaderContent .dropDown{position:absolute;right:10px;top:50px;width:170px;background:#fff;box-shadow:0 0 4px #1919191a;border-radius:2px;display:none;z-index:999}.handHeaderContent .dropDown .san{display:inline-block;width:10px;height:10px;border:1px solid #fff;border-top-style:none;border-right-style:none;transform:rotate(135deg);position:absolute;top:-4px;right:38px;background:#fff}.handHeaderContent .dropDown .user{padding:11px;align-items:center;border-bottom:1px solid #f5f5f5}.handHeaderContent .dropDown .user span{line-height:normal;font-size:14px}.handHeaderContent .dropDown .exit{font-size:14px;line-height:39px;height:39px;border-top:1px solid #EFF2F5;text-align:center;padding:0;color:#5a5a5a}.handHeaderContent .aside{height:100%;transition:all .2s;overflow:overlay;z-index:999;position:relative}.handHeaderContent .aside .init-el-menu{padding-bottom:38px}.handHeaderContent .aside.hideMenu .el-tooltip{text-align:center}.handHeaderContent .aside.hideMenu .el-submenu__title{text-align:center!important}.handHeaderContent .aside.hideMenu i.iconfont{margin-right:0}.handHeaderContent .aside.hideMenu .deldom,.handHeaderContent .aside.hideMenu .el-submenu__icon-arrow{display:none}.handHeaderContent .aside i.iconfont{font-size:18px;display:inline-block;width:18px;margin-right:8px;color:#747c81}.handHeaderContent .main{padding:0;background-color:#eff2f5}.handHeaderContent .main.scrollX{overflow-x:scroll}.handHeaderContent .main .content_mar{padding:18px 18px 0;display:flex;flex-direction:column;height:calc(100vh - 18px)}.handHeaderContent .main .contentTop{flex-shrink:0}.handHeaderContent .main .inner_content{background-color:#fff;flex:1;border-radius:4px}.handHeaderContent .main .inner_content.normal{background-color:transparent}.handHeaderContent .inner_footer{flex-shrink:0;color:#666;text-align:center;padding:18px 0;justify-content:center}@keyframes changeRun{0%{transform:translateY(0) scale(.9)}25%{transform:translateY(-6px) scale(.9)}50%{transform:translateY(0) scale(.9)}75%{transform:translateY(-2px) scale(.9)}to{transform:translateY(0) scale(.9)}}.initNoData[data-v-0b0e3718]{width:100%;align-items:center;justify-content:center}.initNoData .inner[data-v-0b0e3718]{text-align:center}.initNoData .inner p[data-v-0b0e3718]{color:#666;margin-top:12px;line-height:normal}.initPaging[data-v-1d8ef8c9] .el-select__placeholder{text-align:center}.previewFix[data-v-14d38dc6]{width:100%;height:100%;position:fixed;top:0;left:0;z-index:9999;background-color:#00000080;display:flex;justify-content:center;align-items:center}.previewFix img[data-v-14d38dc6]{max-width:98%;max-height:98%}.status_search[data-v-e6bbcf18]{display:inline-block}.status_search span[data-v-e6bbcf18]{min-width:40px;height:30px;padding:0 10px;display:inline-block;text-align:center;line-height:30px;border:1px solid #d9d9d9;border-right:1px solid transparent;cursor:pointer}.status_search span[data-v-e6bbcf18]:first-child{border-radius:2px 0 0 2px}.status_search span[data-v-e6bbcf18]:last-child{border-radius:0 2px 2px 0;border-right:1px solid #d9d9d9}.status_search .active[data-v-e6bbcf18]{background:#06f;color:#fff;border-color:#06f}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
|
2
2
|
import { ref, watch, openBlock, createElementBlock, createVNode, unref, withCtx, renderSlot, Fragment, normalizeStyle, normalizeClass, createTextVNode, toDisplayString, createCommentVNode, createBlock, createElementVNode, resolveComponent, renderList, computed, onMounted, nextTick } from "vue";
|
|
3
3
|
import { ElDialog, ElButton, ElMenuItem, ElSubMenu, ElContainer, ElAside, ElMenu, ElMain, ElHeader, ElIcon, ElConfigProvider, ElPagination, ElMessageBox } from "element-plus";
|
|
4
4
|
import { ArrowDown } from "@element-plus/icons-vue";
|
|
@@ -201,7 +201,7 @@ const _hoisted_8$1 = {
|
|
|
201
201
|
key: 0,
|
|
202
202
|
class: "elbadge hot"
|
|
203
203
|
};
|
|
204
|
-
const _hoisted_9 = {
|
|
204
|
+
const _hoisted_9$1 = {
|
|
205
205
|
key: 1,
|
|
206
206
|
class: "elbadge new"
|
|
207
207
|
};
|
|
@@ -294,7 +294,7 @@ const _sfc_main$5 = {
|
|
|
294
294
|
!__props.hideMenu ? (openBlock(), createElementBlock("div", _hoisted_7$1, [
|
|
295
295
|
createElementVNode("span", null, toDisplayString(__props.item.meta.title), 1),
|
|
296
296
|
__props.item.tips && __props.item.tips.name === "hot" ? (openBlock(), createElementBlock("em", _hoisted_8$1)) : createCommentVNode("", true),
|
|
297
|
-
__props.item.tips && __props.item.tips.name === "new" ? (openBlock(), createElementBlock("em", _hoisted_9)) : createCommentVNode("", true),
|
|
297
|
+
__props.item.tips && __props.item.tips.name === "new" ? (openBlock(), createElementBlock("em", _hoisted_9$1)) : createCommentVNode("", true),
|
|
298
298
|
__props.item.tips && __props.item.tips.name === "run" ? (openBlock(), createElementBlock("em", _hoisted_10, toDisplayString(__props.item.tips.value), 1)) : createCommentVNode("", true),
|
|
299
299
|
__props.item.tips && __props.item.tips.name === "num" && Number(__props.item.tips.value) < 100 ? (openBlock(), createElementBlock("em", _hoisted_11, toDisplayString(__props.item.tips.value), 1)) : createCommentVNode("", true),
|
|
300
300
|
__props.item.tips && __props.item.tips.name === "num" && Number(__props.item.tips.value) >= 100 ? (openBlock(), createElementBlock("em", _hoisted_12, [..._cache[1] || (_cache[1] = [
|
|
@@ -354,7 +354,8 @@ const _hoisted_4 = { class: "img flex flex_row" };
|
|
|
354
354
|
const _hoisted_5 = { class: "dropDown" };
|
|
355
355
|
const _hoisted_6 = { class: "user flex flex_row" };
|
|
356
356
|
const _hoisted_7 = { class: "content_mar" };
|
|
357
|
-
const _hoisted_8 =
|
|
357
|
+
const _hoisted_8 = { class: "contentTop" };
|
|
358
|
+
const _hoisted_9 = ["innerHTML"];
|
|
358
359
|
const _sfc_main$4 = {
|
|
359
360
|
__name: "handHeader",
|
|
360
361
|
props: {
|
|
@@ -391,17 +392,14 @@ const _sfc_main$4 = {
|
|
|
391
392
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
392
393
|
const props = __props;
|
|
393
394
|
const emit = __emit;
|
|
394
|
-
const addClass = ref(false);
|
|
395
395
|
const isScrollX = ref(false);
|
|
396
396
|
const newMenuList = ref([]);
|
|
397
397
|
const defaultOpen = ref([]);
|
|
398
398
|
const isIE = ref(false);
|
|
399
399
|
const hideMenu = ref(false);
|
|
400
|
-
const showFooter = ref(false);
|
|
401
400
|
const isNormal = ref(false);
|
|
402
401
|
const minWidth = ref(props.contentWidth);
|
|
403
402
|
const localDefaultActive = ref(props.defaultActive);
|
|
404
|
-
const mainRef = ref(null);
|
|
405
403
|
const completeWidth = computed(() => {
|
|
406
404
|
return hideMenu.value ? "64px" : `${props.width}px`;
|
|
407
405
|
});
|
|
@@ -445,51 +443,6 @@ const _sfc_main$4 = {
|
|
|
445
443
|
}
|
|
446
444
|
}
|
|
447
445
|
};
|
|
448
|
-
const loadImg = (content) => {
|
|
449
|
-
let mulitImg = [];
|
|
450
|
-
if (content.includes("<img")) {
|
|
451
|
-
content.replace(
|
|
452
|
-
/<img [^>]*src=['"]([^'"]+)[^>]*>/gi,
|
|
453
|
-
(matcherStr, capture) => {
|
|
454
|
-
mulitImg.push(capture);
|
|
455
|
-
}
|
|
456
|
-
);
|
|
457
|
-
let promiseAll = [], img = [];
|
|
458
|
-
for (let i = 0; i < mulitImg.length; i++) {
|
|
459
|
-
promiseAll[i] = new Promise((resolve) => {
|
|
460
|
-
img[i] = new Image();
|
|
461
|
-
img[i].src = mulitImg[i];
|
|
462
|
-
img[i].onload = function() {
|
|
463
|
-
resolve(img[i]);
|
|
464
|
-
};
|
|
465
|
-
});
|
|
466
|
-
}
|
|
467
|
-
Promise.all(promiseAll).then(() => {
|
|
468
|
-
getMainHeight();
|
|
469
|
-
});
|
|
470
|
-
} else {
|
|
471
|
-
getMainHeight();
|
|
472
|
-
}
|
|
473
|
-
};
|
|
474
|
-
const getMainHeight = (flag) => {
|
|
475
|
-
addClass.value = false;
|
|
476
|
-
setTimeout(() => {
|
|
477
|
-
const mainContainer = document.querySelector(".main_container");
|
|
478
|
-
if (mainContainer) {
|
|
479
|
-
const innerContent = document.querySelector(".main_container .inner_content");
|
|
480
|
-
const contentDiv = document.querySelector(".main_container .inner_content>div");
|
|
481
|
-
if (innerContent && contentDiv) {
|
|
482
|
-
const mainHeight = innerContent.offsetHeight;
|
|
483
|
-
const conHeight = contentDiv.offsetHeight;
|
|
484
|
-
addClass.value = conHeight > mainHeight;
|
|
485
|
-
showFooter.value = true;
|
|
486
|
-
if (!flag && addClass.value && mainRef.value) {
|
|
487
|
-
mainRef.value.scrollTop = 0;
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
}, 0);
|
|
492
|
-
};
|
|
493
446
|
const setMinWidth = (width) => {
|
|
494
447
|
isScrollX.value = width < minWidth.value;
|
|
495
448
|
const innerHeader = document.querySelector(".main_container .inner_header");
|
|
@@ -516,6 +469,9 @@ const _sfc_main$4 = {
|
|
|
516
469
|
localDefaultActive.value = path;
|
|
517
470
|
});
|
|
518
471
|
};
|
|
472
|
+
const setNormal = (value) => {
|
|
473
|
+
isNormal.value = value;
|
|
474
|
+
};
|
|
519
475
|
const outSystem = () => {
|
|
520
476
|
emit("exitSystem");
|
|
521
477
|
};
|
|
@@ -530,23 +486,17 @@ const _sfc_main$4 = {
|
|
|
530
486
|
minWidth.value = windowWidth > minWidth.value ? minWidth.value - props.width : windowWidth - props.width;
|
|
531
487
|
browser();
|
|
532
488
|
nextTick(() => {
|
|
533
|
-
getMenu();
|
|
534
489
|
setMinWidth(mainDefalutWidth);
|
|
535
490
|
window.addEventListener("resize", debounce2(() => {
|
|
536
491
|
mainDefalutWidth = document.body.clientWidth - props.width;
|
|
537
492
|
setMinWidth(mainDefalutWidth);
|
|
538
|
-
setTimeout(() => {
|
|
539
|
-
getMainHeight();
|
|
540
|
-
}, 0);
|
|
541
493
|
}));
|
|
542
494
|
});
|
|
543
495
|
});
|
|
544
496
|
__expose({
|
|
545
|
-
isNormal,
|
|
546
497
|
getMenu,
|
|
547
498
|
setMenuActive,
|
|
548
|
-
|
|
549
|
-
getMainHeight
|
|
499
|
+
setNormal
|
|
550
500
|
});
|
|
551
501
|
return (_ctx, _cache) => {
|
|
552
502
|
return openBlock(), createBlock(unref(ElContainer), { class: "handHeaderContent" }, {
|
|
@@ -596,9 +546,7 @@ const _sfc_main$4 = {
|
|
|
596
546
|
_: 3
|
|
597
547
|
}, 8, ["class", "width"]),
|
|
598
548
|
createVNode(unref(ElMain), {
|
|
599
|
-
class: normalizeClass(["main main_container", {
|
|
600
|
-
ref_key: "mainRef",
|
|
601
|
-
ref: mainRef
|
|
549
|
+
class: normalizeClass(["main main_container", { scrollX: isScrollX.value }])
|
|
602
550
|
}, {
|
|
603
551
|
default: withCtx(() => [
|
|
604
552
|
createVNode(unref(ElHeader), { class: "header flex flex_row inner_header" }, {
|
|
@@ -649,6 +597,9 @@ const _sfc_main$4 = {
|
|
|
649
597
|
_: 3
|
|
650
598
|
}),
|
|
651
599
|
createElementVNode("div", _hoisted_7, [
|
|
600
|
+
createElementVNode("div", _hoisted_8, [
|
|
601
|
+
renderSlot(_ctx.$slots, "contentTop")
|
|
602
|
+
]),
|
|
652
603
|
createElementVNode("div", {
|
|
653
604
|
class: normalizeClass(["content inner_content", { normal: isNormal.value }])
|
|
654
605
|
}, [
|
|
@@ -656,11 +607,10 @@ const _sfc_main$4 = {
|
|
|
656
607
|
renderSlot(_ctx.$slots, "content")
|
|
657
608
|
])
|
|
658
609
|
], 2),
|
|
659
|
-
|
|
660
|
-
key: 0,
|
|
610
|
+
createElementVNode("div", {
|
|
661
611
|
class: "footer flex flex_col inner_footer",
|
|
662
612
|
innerHTML: __props.userInfo.copyRight
|
|
663
|
-
}, null, 8,
|
|
613
|
+
}, null, 8, _hoisted_9)
|
|
664
614
|
])
|
|
665
615
|
]),
|
|
666
616
|
_: 3
|
package/package.json
CHANGED
package/src/App.vue
CHANGED
|
@@ -32,6 +32,13 @@
|
|
|
32
32
|
<li>2</li>
|
|
33
33
|
</ul>
|
|
34
34
|
</template>
|
|
35
|
+
<template #contentTop>
|
|
36
|
+
<div class="ttt" style="background-color: red;margin-bottom:18px;">
|
|
37
|
+
<h6>内容展示区域头部</h6>
|
|
38
|
+
<h6>内容展示区域头部</h6>
|
|
39
|
+
<h6>内容展示区域头部</h6>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
35
42
|
<template #content>
|
|
36
43
|
<div class="lll">
|
|
37
44
|
<h6>Tab</h6>
|
|
@@ -43,7 +50,12 @@
|
|
|
43
50
|
<div>
|
|
44
51
|
<hand-paging :currentPage="handPagingRef.page" :total="handPagingRef.total" :pageSize="handPagingRef.pageSize" :size="handPagingRef.size" @page-change="handlePageChange" />
|
|
45
52
|
</div>
|
|
46
|
-
|
|
53
|
+
<div v-if="showImg">
|
|
54
|
+
<div v-for="(item,index) in 10" :key="index">
|
|
55
|
+
<p>{{index}}+ {{new Date().toLocaleString()}}</p>
|
|
56
|
+
<img src="https://v2-saas-1259468876.cos.ap-shanghai.myqcloud.com/system/admin/3c82217d4753dd50ccd9ae19d939f1b9.jpg" alt="" style="width:120px;height: 120px;">
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
47
59
|
<h6>空数据提示</h6>
|
|
48
60
|
<hand-no-data title="暂无数据" />
|
|
49
61
|
<h6>弹窗</h6>
|
|
@@ -229,9 +241,14 @@ const copyBack = (err, success) => {
|
|
|
229
241
|
//#endregion 自定义指令
|
|
230
242
|
//#region 菜单组件
|
|
231
243
|
const menuRef = ref(null)
|
|
244
|
+
|
|
245
|
+
const showImg = ref(false)
|
|
232
246
|
onMounted(() => {
|
|
233
|
-
menuRef.value.
|
|
234
|
-
menuRef.value.
|
|
247
|
+
menuRef.value.getMenu()
|
|
248
|
+
// menuRef.value.setNormal(true)
|
|
249
|
+
// setTimeout(() => {
|
|
250
|
+
// showImg.value = true
|
|
251
|
+
// }, 3000)
|
|
235
252
|
})
|
|
236
253
|
//#endregion 菜单组件
|
|
237
254
|
const inputNumber = ref('')
|
|
@@ -0,0 +1,565 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ElContainer class="handHeaderContent">
|
|
3
|
+
<!-- 左右两边分 -->
|
|
4
|
+
<div class="ieBro flex flex_row" v-if="isIE">
|
|
5
|
+
<span>
|
|
6
|
+
当前浏览器版本过低,使用效果可能欠佳,建议前往下载
|
|
7
|
+
<a href="http://chrome.wlxb49.cn/" target="_blank" class="color"
|
|
8
|
+
>谷歌浏览器</a
|
|
9
|
+
></span
|
|
10
|
+
>
|
|
11
|
+
<span>
|
|
12
|
+
<a href="javascript:;" @click="closeIETips">x</a>
|
|
13
|
+
</span>
|
|
14
|
+
</div>
|
|
15
|
+
<!-- el-aside -->
|
|
16
|
+
<ElAside class="aside" :class="{'hideMenu': hideMenu}" :width="completeWidth">
|
|
17
|
+
<!-- 侧边栏系统名称展示区域 -->
|
|
18
|
+
<slot name="headElseTitle"></slot>
|
|
19
|
+
<ElMenu
|
|
20
|
+
class="el-menu-vertical-demo init-el-menu"
|
|
21
|
+
:default-active="localDefaultActive"
|
|
22
|
+
router
|
|
23
|
+
:default-openeds="defaultOpen"
|
|
24
|
+
:collapse="hideMenu"
|
|
25
|
+
:collapse-transition="false"
|
|
26
|
+
>
|
|
27
|
+
<sidebar-item v-for="menu in newMenuList" :key="menu.path" :item="menu" :hideMenu="hideMenu" />
|
|
28
|
+
</ElMenu>
|
|
29
|
+
</ElAside>
|
|
30
|
+
<ElMain :class="['main main_container',{ scroll: addClass, scrollX: isScrollX}]" ref="mainRef">
|
|
31
|
+
<ElHeader class="header flex flex_row inner_header">
|
|
32
|
+
<div class="imLeft flex flex_row">
|
|
33
|
+
<template v-if="collapse">
|
|
34
|
+
<div class="colSpan flex flex_row" @click="toggleHide">
|
|
35
|
+
<i :class="['hide', { rotate: hideMenu }]"></i>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
<!-- 头部信息补充展示区域 -- 左边 -->
|
|
39
|
+
<slot name="headElseInfo"></slot>
|
|
40
|
+
</div>
|
|
41
|
+
<ul class="saasInfo flex flex_row">
|
|
42
|
+
<!-- 头部信息补充展示区域 -- 右边 -->
|
|
43
|
+
<slot name="headElseInfoRight"></slot>
|
|
44
|
+
<li class="img flex flex_row">
|
|
45
|
+
<img src="@/assets/img/portrait.jpg" alt />
|
|
46
|
+
<el-icon size="14"><ArrowDown /></el-icon>
|
|
47
|
+
<!-- 下拉框 -->
|
|
48
|
+
<div class="dropDown">
|
|
49
|
+
<em class="san"></em>
|
|
50
|
+
<div class="user flex flex_row">
|
|
51
|
+
<img src="@/assets/img/portrait.jpg" alt />
|
|
52
|
+
<span>{{ userInfo.name }}</span>
|
|
53
|
+
</div>
|
|
54
|
+
<!-- 头部信息操作展示区域 -->
|
|
55
|
+
<slot name="headElseHand"></slot>
|
|
56
|
+
<div class="exit" @click="outSystem">退出</div>
|
|
57
|
+
</div>
|
|
58
|
+
</li>
|
|
59
|
+
</ul>
|
|
60
|
+
</ElHeader>
|
|
61
|
+
<div class="content_mar">
|
|
62
|
+
<div class="content inner_content" :class="{ normal: isNormal }">
|
|
63
|
+
<!-- 内容展示区域 -->
|
|
64
|
+
<div>
|
|
65
|
+
<slot name="content"></slot>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
<div class="footer flex flex_col inner_footer" v-html="userInfo.copyRight" v-if="showFooter"></div>
|
|
69
|
+
</div>
|
|
70
|
+
</ElMain>
|
|
71
|
+
</ElContainer>
|
|
72
|
+
</template>
|
|
73
|
+
|
|
74
|
+
<script setup>
|
|
75
|
+
/**
|
|
76
|
+
* 头部布局组件
|
|
77
|
+
* 功能:包含侧边栏菜单、头部导航、用户信息和内容区域的完整布局
|
|
78
|
+
*/
|
|
79
|
+
|
|
80
|
+
// 导入Vue响应式API
|
|
81
|
+
import { ref, computed, onMounted, nextTick } from 'vue'
|
|
82
|
+
// 导入Element Plus组件
|
|
83
|
+
import { ElContainer, ElAside, ElMenu, ElMain, ElHeader ,ElIcon} from 'element-plus'
|
|
84
|
+
import { ArrowDown } from '@element-plus/icons-vue'
|
|
85
|
+
|
|
86
|
+
// 导入子组件
|
|
87
|
+
import sidebarItem from './sidebarItem.vue'
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* 组件属性定义
|
|
91
|
+
* @property {Object} menuList - 导航列表(包含name系统名称和list菜单列表)
|
|
92
|
+
* @property {string} defaultActive - 默认选中的菜单路径
|
|
93
|
+
* @property {boolean} collapse - 是否启用折叠功能
|
|
94
|
+
* @property {number} width - 侧边栏宽度
|
|
95
|
+
* @property {number} contentWidth - 内容模块宽度
|
|
96
|
+
* @property {Object} userInfo - 用户信息
|
|
97
|
+
* @property {boolean} showDefaltOpen - 是否默认展开所有菜单项
|
|
98
|
+
*/
|
|
99
|
+
const props = defineProps({
|
|
100
|
+
menuList: {
|
|
101
|
+
type: Object,
|
|
102
|
+
default: () => ({})
|
|
103
|
+
},
|
|
104
|
+
defaultActive: {
|
|
105
|
+
type: String,
|
|
106
|
+
default: "/"
|
|
107
|
+
},
|
|
108
|
+
collapse: {
|
|
109
|
+
type: Boolean,
|
|
110
|
+
default: false
|
|
111
|
+
},
|
|
112
|
+
width: {
|
|
113
|
+
type: Number,
|
|
114
|
+
default: 180
|
|
115
|
+
},
|
|
116
|
+
contentWidth: {
|
|
117
|
+
type: Number,
|
|
118
|
+
default: 1200
|
|
119
|
+
},
|
|
120
|
+
userInfo: {
|
|
121
|
+
type: Object,
|
|
122
|
+
default: () => ({})
|
|
123
|
+
},
|
|
124
|
+
showDefaltOpen: {
|
|
125
|
+
type: Boolean,
|
|
126
|
+
default: true
|
|
127
|
+
}
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* 事件定义
|
|
132
|
+
* @event toggleHide - 折叠/展开事件
|
|
133
|
+
* @event exitSystem - 退出系统事件
|
|
134
|
+
*/
|
|
135
|
+
const emit = defineEmits(['toggleHide', 'exitSystem'])
|
|
136
|
+
|
|
137
|
+
// 响应式数据定义
|
|
138
|
+
const addClass = ref(false) // 动态添加是否有滚动
|
|
139
|
+
const isScrollX = ref(false) // 判断是否出现横向滚动条
|
|
140
|
+
const newMenuList = ref([]) // 获取新的菜单
|
|
141
|
+
const defaultOpen = ref([]) // 默认打开的菜单
|
|
142
|
+
const isIE = ref(false) // 是否是ie浏览器
|
|
143
|
+
const hideMenu = ref(false) // 是否隐藏菜单
|
|
144
|
+
const showFooter = ref(false) // 效果展示优化
|
|
145
|
+
const isNormal = ref(false) // 是否需要透明背景
|
|
146
|
+
const minWidth = ref(props.contentWidth) // 内容模块的默认最小宽度
|
|
147
|
+
const localDefaultActive = ref(props.defaultActive) // 本地默认选中菜单
|
|
148
|
+
const mainRef = ref(null) // main容器引用
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* 收起和展开时 aside 的宽度
|
|
152
|
+
* @returns {string} 宽度值
|
|
153
|
+
*/
|
|
154
|
+
const completeWidth = computed(() => {
|
|
155
|
+
return hideMenu.value ? '64px' : `${props.width}px`
|
|
156
|
+
})
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* 主模块默认宽度
|
|
160
|
+
* @type {number}
|
|
161
|
+
*/
|
|
162
|
+
let mainDefalutWidth = document.body.clientWidth - props.width
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* 函数防抖
|
|
166
|
+
* @param {Function} fn - 需要防抖的函数
|
|
167
|
+
* @param {number} delay - 延迟时间(默认200ms)
|
|
168
|
+
* @returns {Function} 防抖后的函数
|
|
169
|
+
*/
|
|
170
|
+
const debounce = (fn, delay = 200) => {
|
|
171
|
+
let timer = null
|
|
172
|
+
return function () {
|
|
173
|
+
clearTimeout(timer)
|
|
174
|
+
timer = setTimeout(() => {
|
|
175
|
+
fn.apply(this, arguments)
|
|
176
|
+
}, delay)
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* 过滤隐藏的菜单项并递归处理子菜单
|
|
182
|
+
* @param {Array} datas - 菜单数据
|
|
183
|
+
* @returns {Array} 过滤后的菜单列表
|
|
184
|
+
*/
|
|
185
|
+
const getAllName = (datas) => {
|
|
186
|
+
return datas.filter(item => !item.hidden).map(item => {
|
|
187
|
+
item = Object.assign({}, item)
|
|
188
|
+
if (item.children) {
|
|
189
|
+
item.children = getAllName(item.children)
|
|
190
|
+
}
|
|
191
|
+
return item
|
|
192
|
+
})
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* 处理传入的导航菜单
|
|
197
|
+
*/
|
|
198
|
+
const getMenu = () => {
|
|
199
|
+
newMenuList.value = getAllName(props.menuList.list || [])
|
|
200
|
+
defaultOpen.value = []
|
|
201
|
+
getOpen()
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* 折叠/展开菜单
|
|
206
|
+
*/
|
|
207
|
+
const toggleHide = () => {
|
|
208
|
+
hideMenu.value = !hideMenu.value
|
|
209
|
+
defaultOpen.value = []
|
|
210
|
+
getOpen()
|
|
211
|
+
emit('toggleHide', hideMenu.value)
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* 获取默认打开的菜单项
|
|
216
|
+
* @param {Array} datas - 菜单数据(默认为newMenuList)
|
|
217
|
+
*/
|
|
218
|
+
const getOpen = (datas = newMenuList.value) => {
|
|
219
|
+
if (props.showDefaltOpen) {
|
|
220
|
+
for (const i in datas) {
|
|
221
|
+
defaultOpen.value.push(datas[i].path)
|
|
222
|
+
if (datas[i].children) {
|
|
223
|
+
getOpen(datas[i].children)
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* 等待图片加载完成后获取主容器高度
|
|
231
|
+
* @param {string} content - HTML内容
|
|
232
|
+
*/
|
|
233
|
+
const loadImg = (content) => {
|
|
234
|
+
let mulitImg = []
|
|
235
|
+
if (content.includes("<img")) {
|
|
236
|
+
content.replace(
|
|
237
|
+
/<img [^>]*src=['"]([^'"]+)[^>]*>/gi,
|
|
238
|
+
(matcherStr, capture) => {
|
|
239
|
+
mulitImg.push(capture)
|
|
240
|
+
}
|
|
241
|
+
)
|
|
242
|
+
let promiseAll = [], img = []
|
|
243
|
+
for (let i = 0; i < mulitImg.length; i++) {
|
|
244
|
+
promiseAll[i] = new Promise((resolve) => {
|
|
245
|
+
img[i] = new Image()
|
|
246
|
+
img[i].src = mulitImg[i]
|
|
247
|
+
img[i].onload = function () {
|
|
248
|
+
resolve(img[i])
|
|
249
|
+
}
|
|
250
|
+
})
|
|
251
|
+
}
|
|
252
|
+
Promise.all(promiseAll).then(() => {
|
|
253
|
+
getMainHeight()
|
|
254
|
+
})
|
|
255
|
+
} else {
|
|
256
|
+
getMainHeight()
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* 获取内容模块的滚动条状态
|
|
262
|
+
* @param {boolean} flag - 是否跳过滚动条置顶
|
|
263
|
+
*/
|
|
264
|
+
const getMainHeight = (flag) => {
|
|
265
|
+
addClass.value = false
|
|
266
|
+
setTimeout(() => {
|
|
267
|
+
const mainContainer = document.querySelector(".main_container")
|
|
268
|
+
if (mainContainer) {
|
|
269
|
+
const innerContent = document.querySelector(".main_container .inner_content")
|
|
270
|
+
const contentDiv = document.querySelector(".main_container .inner_content>div")
|
|
271
|
+
|
|
272
|
+
if (innerContent && contentDiv) {
|
|
273
|
+
const mainHeight = innerContent.offsetHeight
|
|
274
|
+
const conHeight = contentDiv.offsetHeight
|
|
275
|
+
|
|
276
|
+
addClass.value = conHeight > mainHeight
|
|
277
|
+
showFooter.value = true
|
|
278
|
+
|
|
279
|
+
if (!flag && addClass.value && mainRef.value) {
|
|
280
|
+
mainRef.value.scrollTop = 0
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}, 0)
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* 设置内容模块最小宽度
|
|
289
|
+
* @param {number} width - 当前窗口宽度
|
|
290
|
+
*/
|
|
291
|
+
const setMinWidth = (width) => {
|
|
292
|
+
isScrollX.value = width < minWidth.value
|
|
293
|
+
|
|
294
|
+
const innerHeader = document.querySelector(".main_container .inner_header")
|
|
295
|
+
const contentMar = document.querySelector(".main_container .content_mar")
|
|
296
|
+
|
|
297
|
+
if (isScrollX.value) {
|
|
298
|
+
if (innerHeader) {
|
|
299
|
+
innerHeader.setAttribute("style", `min-width:${minWidth.value}px;`)
|
|
300
|
+
}
|
|
301
|
+
if (contentMar) {
|
|
302
|
+
contentMar.setAttribute("style", `min-width:${minWidth.value - 36}px;`)
|
|
303
|
+
}
|
|
304
|
+
} else {
|
|
305
|
+
if (innerHeader) {
|
|
306
|
+
innerHeader.removeAttribute("style")
|
|
307
|
+
}
|
|
308
|
+
if (contentMar) {
|
|
309
|
+
contentMar.removeAttribute("style")
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* 设置菜单选中状态
|
|
316
|
+
* @param {string} path - 菜单路径
|
|
317
|
+
*/
|
|
318
|
+
const setMenuActive = (path) => {
|
|
319
|
+
localDefaultActive.value = ''
|
|
320
|
+
nextTick(() => {
|
|
321
|
+
localDefaultActive.value = path
|
|
322
|
+
})
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* 判断是否在 content inner_content 类名上添加 normal 类名
|
|
327
|
+
*/
|
|
328
|
+
const setNormal = (value) => {
|
|
329
|
+
isNormal.value = value
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* 退出系统
|
|
334
|
+
*/
|
|
335
|
+
const outSystem = () => {
|
|
336
|
+
emit('exitSystem')
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* 判断是否是 IE 浏览器
|
|
341
|
+
*/
|
|
342
|
+
const browser = () => {
|
|
343
|
+
isIE.value = !!window.ActiveXObject || "ActiveXObject" in window
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* 关闭 IE 提示
|
|
348
|
+
*/
|
|
349
|
+
const closeIETips = () => {
|
|
350
|
+
isIE.value = false
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* 组件挂载时初始化
|
|
355
|
+
*/
|
|
356
|
+
onMounted(() => {
|
|
357
|
+
const windowWidth = window.screen.availWidth
|
|
358
|
+
minWidth.value = windowWidth > minWidth.value ? (minWidth.value - props.width) : (windowWidth - props.width)
|
|
359
|
+
|
|
360
|
+
browser()
|
|
361
|
+
|
|
362
|
+
nextTick(() => {
|
|
363
|
+
getMenu()
|
|
364
|
+
setMinWidth(mainDefalutWidth)
|
|
365
|
+
// 监听窗口大小变化
|
|
366
|
+
window.addEventListener('resize', debounce(() => {
|
|
367
|
+
mainDefalutWidth = document.body.clientWidth - props.width
|
|
368
|
+
setMinWidth(mainDefalutWidth)
|
|
369
|
+
setTimeout(() => {
|
|
370
|
+
getMainHeight()
|
|
371
|
+
}, 0)
|
|
372
|
+
}))
|
|
373
|
+
})
|
|
374
|
+
})
|
|
375
|
+
|
|
376
|
+
/**
|
|
377
|
+
* 暴露方法给父组件调用
|
|
378
|
+
*/
|
|
379
|
+
defineExpose({
|
|
380
|
+
getMenu,
|
|
381
|
+
setMenuActive,
|
|
382
|
+
setNormal,
|
|
383
|
+
loadImg,
|
|
384
|
+
getMainHeight
|
|
385
|
+
})
|
|
386
|
+
</script>
|
|
387
|
+
|
|
388
|
+
<style lang="scss">
|
|
389
|
+
.handHeaderContent {
|
|
390
|
+
position: relative;
|
|
391
|
+
z-index: 999;
|
|
392
|
+
height: 100vh;
|
|
393
|
+
.el-container.is-vertical{
|
|
394
|
+
position: relative;
|
|
395
|
+
}
|
|
396
|
+
.inner_header {
|
|
397
|
+
padding: 0;
|
|
398
|
+
background: #fff;
|
|
399
|
+
justify-content: space-between;
|
|
400
|
+
align-items: center;
|
|
401
|
+
height: 50px !important;
|
|
402
|
+
.colSpan {
|
|
403
|
+
width: 60px;
|
|
404
|
+
background-color: transparent;
|
|
405
|
+
justify-content: center;
|
|
406
|
+
align-items: center;
|
|
407
|
+
.hide {
|
|
408
|
+
width: 16px;
|
|
409
|
+
height: 16px;
|
|
410
|
+
background: url("@/assets/img/hide.png") no-repeat;
|
|
411
|
+
background-size: contain;
|
|
412
|
+
cursor: pointer;
|
|
413
|
+
transition: all 0.2s;
|
|
414
|
+
&.rotate {
|
|
415
|
+
transform: rotateZ(180deg);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
.saasInfo {
|
|
420
|
+
.img {
|
|
421
|
+
align-items: center;
|
|
422
|
+
justify-content: center;
|
|
423
|
+
height: 50px;
|
|
424
|
+
margin-right: 20px;
|
|
425
|
+
cursor: pointer;
|
|
426
|
+
&:hover .dropDown {
|
|
427
|
+
display: block;
|
|
428
|
+
}
|
|
429
|
+
img {
|
|
430
|
+
width: 33px;
|
|
431
|
+
height: 33px;
|
|
432
|
+
border-radius: 50%;
|
|
433
|
+
margin-right: 5px;
|
|
434
|
+
border: 1px solid #eff2f5;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
.dropDown {
|
|
440
|
+
position: absolute;
|
|
441
|
+
right: 10px;
|
|
442
|
+
top: 50px;
|
|
443
|
+
width: 170px;
|
|
444
|
+
background: #ffffff;
|
|
445
|
+
box-shadow: 0px 0px 4px 0px rgba(25, 25, 25, 0.1);
|
|
446
|
+
border-radius: 2px;
|
|
447
|
+
display: none;
|
|
448
|
+
z-index: 999;
|
|
449
|
+
.san {
|
|
450
|
+
display: inline-block;
|
|
451
|
+
width: 10px;
|
|
452
|
+
height: 10px;
|
|
453
|
+
border: 1px solid #fff;
|
|
454
|
+
border-top-style: none;
|
|
455
|
+
border-right-style: none;
|
|
456
|
+
transform: rotate(135deg);
|
|
457
|
+
position: absolute;
|
|
458
|
+
top: -4px;
|
|
459
|
+
right: 38px;
|
|
460
|
+
background: #fff;
|
|
461
|
+
}
|
|
462
|
+
.user {
|
|
463
|
+
padding: 11px;
|
|
464
|
+
align-items: center;
|
|
465
|
+
border-bottom: 1px solid #f5f5f5;
|
|
466
|
+
span {
|
|
467
|
+
line-height: normal;
|
|
468
|
+
font-size: 14px;
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
.exit {
|
|
472
|
+
font-size: 14px;
|
|
473
|
+
line-height: 39px;
|
|
474
|
+
height: 39px;
|
|
475
|
+
border-top: 1px solid #EFF2F5;
|
|
476
|
+
text-align: center;
|
|
477
|
+
padding: 0;
|
|
478
|
+
color: #5a5a5a;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
.aside {
|
|
482
|
+
height: 100%;
|
|
483
|
+
transition: all .2s;
|
|
484
|
+
overflow: overlay;
|
|
485
|
+
// background-color: #0d1829;
|
|
486
|
+
z-index: 999;
|
|
487
|
+
position: relative;
|
|
488
|
+
.init-el-menu{
|
|
489
|
+
padding-bottom: 38px;
|
|
490
|
+
}
|
|
491
|
+
&.hideMenu{
|
|
492
|
+
.el-tooltip{
|
|
493
|
+
text-align: center;
|
|
494
|
+
}
|
|
495
|
+
.el-submenu__title{
|
|
496
|
+
text-align: center !important;
|
|
497
|
+
}
|
|
498
|
+
i.iconfont{
|
|
499
|
+
margin-right: 0;
|
|
500
|
+
}
|
|
501
|
+
.deldom,.el-submenu__icon-arrow{
|
|
502
|
+
display: none;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
i.iconfont {
|
|
506
|
+
font-size: 18px;
|
|
507
|
+
display: inline-block;
|
|
508
|
+
width: 18px;
|
|
509
|
+
margin-right: 8px;
|
|
510
|
+
color: #747C81;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
.main {
|
|
514
|
+
padding: 0;
|
|
515
|
+
background-color: #eff2f5;
|
|
516
|
+
&.scroll {
|
|
517
|
+
overflow-y: scroll;
|
|
518
|
+
.inner_content {
|
|
519
|
+
height: auto;
|
|
520
|
+
&.normal {
|
|
521
|
+
height: auto;
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
&.scrollX {
|
|
526
|
+
overflow-x: scroll;
|
|
527
|
+
}
|
|
528
|
+
.content_mar{
|
|
529
|
+
padding: 18px;
|
|
530
|
+
}
|
|
531
|
+
.inner_content {
|
|
532
|
+
background-color: #fff;
|
|
533
|
+
height: calc(100vh - 50px - 36px);
|
|
534
|
+
border-radius: 4px;
|
|
535
|
+
&.normal {
|
|
536
|
+
background-color: transparent;
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
.inner_footer {
|
|
541
|
+
color: #666666;
|
|
542
|
+
text-align: center;
|
|
543
|
+
padding-top: 18px;
|
|
544
|
+
justify-content: center;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
@keyframes changeRun {
|
|
549
|
+
0% {
|
|
550
|
+
transform: translateY(0) scale(.9);
|
|
551
|
+
}
|
|
552
|
+
25% {
|
|
553
|
+
transform: translateY(-6px) scale(.9);
|
|
554
|
+
}
|
|
555
|
+
50% {
|
|
556
|
+
transform: translateY(0) scale(.9);
|
|
557
|
+
}
|
|
558
|
+
75% {
|
|
559
|
+
transform: translateY(-2px) scale(.9);
|
|
560
|
+
}
|
|
561
|
+
100% {
|
|
562
|
+
transform: translateY(0) scale(.9);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
</style>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<sidebar-item v-for="menu in newMenuList" :key="menu.path" :item="menu" :hideMenu="hideMenu" />
|
|
28
28
|
</ElMenu>
|
|
29
29
|
</ElAside>
|
|
30
|
-
<ElMain :class="['main main_container',{
|
|
30
|
+
<ElMain :class="['main main_container',{ scrollX: isScrollX}]">
|
|
31
31
|
<ElHeader class="header flex flex_row inner_header">
|
|
32
32
|
<div class="imLeft flex flex_row">
|
|
33
33
|
<template v-if="collapse">
|
|
@@ -59,13 +59,17 @@
|
|
|
59
59
|
</ul>
|
|
60
60
|
</ElHeader>
|
|
61
61
|
<div class="content_mar">
|
|
62
|
+
<!-- 内容展示区域头部 -->
|
|
63
|
+
<div class="contentTop">
|
|
64
|
+
<slot name="contentTop"></slot>
|
|
65
|
+
</div>
|
|
62
66
|
<div class="content inner_content" :class="{ normal: isNormal }">
|
|
63
67
|
<!-- 内容展示区域 -->
|
|
64
68
|
<div>
|
|
65
69
|
<slot name="content"></slot>
|
|
66
70
|
</div>
|
|
67
71
|
</div>
|
|
68
|
-
<div class="footer flex flex_col inner_footer" v-html="userInfo.copyRight"
|
|
72
|
+
<div class="footer flex flex_col inner_footer" v-html="userInfo.copyRight"></div>
|
|
69
73
|
</div>
|
|
70
74
|
</ElMain>
|
|
71
75
|
</ElContainer>
|
|
@@ -135,17 +139,14 @@ const props = defineProps({
|
|
|
135
139
|
const emit = defineEmits(['toggleHide', 'exitSystem'])
|
|
136
140
|
|
|
137
141
|
// 响应式数据定义
|
|
138
|
-
const addClass = ref(false) // 动态添加是否有滚动
|
|
139
142
|
const isScrollX = ref(false) // 判断是否出现横向滚动条
|
|
140
143
|
const newMenuList = ref([]) // 获取新的菜单
|
|
141
144
|
const defaultOpen = ref([]) // 默认打开的菜单
|
|
142
145
|
const isIE = ref(false) // 是否是ie浏览器
|
|
143
146
|
const hideMenu = ref(false) // 是否隐藏菜单
|
|
144
|
-
const showFooter = ref(false) // 效果展示优化
|
|
145
147
|
const isNormal = ref(false) // 是否需要透明背景
|
|
146
148
|
const minWidth = ref(props.contentWidth) // 内容模块的默认最小宽度
|
|
147
149
|
const localDefaultActive = ref(props.defaultActive) // 本地默认选中菜单
|
|
148
|
-
const mainRef = ref(null) // main容器引用
|
|
149
150
|
|
|
150
151
|
/**
|
|
151
152
|
* 收起和展开时 aside 的宽度
|
|
@@ -226,64 +227,6 @@ const getOpen = (datas = newMenuList.value) => {
|
|
|
226
227
|
}
|
|
227
228
|
}
|
|
228
229
|
|
|
229
|
-
/**
|
|
230
|
-
* 等待图片加载完成后获取主容器高度
|
|
231
|
-
* @param {string} content - HTML内容
|
|
232
|
-
*/
|
|
233
|
-
const loadImg = (content) => {
|
|
234
|
-
let mulitImg = []
|
|
235
|
-
if (content.includes("<img")) {
|
|
236
|
-
content.replace(
|
|
237
|
-
/<img [^>]*src=['"]([^'"]+)[^>]*>/gi,
|
|
238
|
-
(matcherStr, capture) => {
|
|
239
|
-
mulitImg.push(capture)
|
|
240
|
-
}
|
|
241
|
-
)
|
|
242
|
-
let promiseAll = [], img = []
|
|
243
|
-
for (let i = 0; i < mulitImg.length; i++) {
|
|
244
|
-
promiseAll[i] = new Promise((resolve) => {
|
|
245
|
-
img[i] = new Image()
|
|
246
|
-
img[i].src = mulitImg[i]
|
|
247
|
-
img[i].onload = function () {
|
|
248
|
-
resolve(img[i])
|
|
249
|
-
}
|
|
250
|
-
})
|
|
251
|
-
}
|
|
252
|
-
Promise.all(promiseAll).then(() => {
|
|
253
|
-
getMainHeight()
|
|
254
|
-
})
|
|
255
|
-
} else {
|
|
256
|
-
getMainHeight()
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* 获取内容模块的滚动条状态
|
|
262
|
-
* @param {boolean} flag - 是否跳过滚动条置顶
|
|
263
|
-
*/
|
|
264
|
-
const getMainHeight = (flag) => {
|
|
265
|
-
addClass.value = false
|
|
266
|
-
setTimeout(() => {
|
|
267
|
-
const mainContainer = document.querySelector(".main_container")
|
|
268
|
-
if (mainContainer) {
|
|
269
|
-
const innerContent = document.querySelector(".main_container .inner_content")
|
|
270
|
-
const contentDiv = document.querySelector(".main_container .inner_content>div")
|
|
271
|
-
|
|
272
|
-
if (innerContent && contentDiv) {
|
|
273
|
-
const mainHeight = innerContent.offsetHeight
|
|
274
|
-
const conHeight = contentDiv.offsetHeight
|
|
275
|
-
|
|
276
|
-
addClass.value = conHeight > mainHeight
|
|
277
|
-
showFooter.value = true
|
|
278
|
-
|
|
279
|
-
if (!flag && addClass.value && mainRef.value) {
|
|
280
|
-
mainRef.value.scrollTop = 0
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
}, 0)
|
|
285
|
-
}
|
|
286
|
-
|
|
287
230
|
/**
|
|
288
231
|
* 设置内容模块最小宽度
|
|
289
232
|
* @param {number} width - 当前窗口宽度
|
|
@@ -322,6 +265,13 @@ const setMenuActive = (path) => {
|
|
|
322
265
|
})
|
|
323
266
|
}
|
|
324
267
|
|
|
268
|
+
/**
|
|
269
|
+
* 判断是否在 content inner_content 类名上添加 normal 类名
|
|
270
|
+
*/
|
|
271
|
+
const setNormal = (value) => {
|
|
272
|
+
isNormal.value = value
|
|
273
|
+
}
|
|
274
|
+
|
|
325
275
|
/**
|
|
326
276
|
* 退出系统
|
|
327
277
|
*/
|
|
@@ -353,15 +303,11 @@ onMounted(() => {
|
|
|
353
303
|
browser()
|
|
354
304
|
|
|
355
305
|
nextTick(() => {
|
|
356
|
-
getMenu()
|
|
357
306
|
setMinWidth(mainDefalutWidth)
|
|
358
307
|
// 监听窗口大小变化
|
|
359
308
|
window.addEventListener('resize', debounce(() => {
|
|
360
309
|
mainDefalutWidth = document.body.clientWidth - props.width
|
|
361
310
|
setMinWidth(mainDefalutWidth)
|
|
362
|
-
setTimeout(() => {
|
|
363
|
-
getMainHeight()
|
|
364
|
-
}, 0)
|
|
365
311
|
}))
|
|
366
312
|
})
|
|
367
313
|
})
|
|
@@ -370,11 +316,9 @@ onMounted(() => {
|
|
|
370
316
|
* 暴露方法给父组件调用
|
|
371
317
|
*/
|
|
372
318
|
defineExpose({
|
|
373
|
-
isNormal,
|
|
374
319
|
getMenu,
|
|
375
320
|
setMenuActive,
|
|
376
|
-
|
|
377
|
-
getMainHeight
|
|
321
|
+
setNormal
|
|
378
322
|
})
|
|
379
323
|
</script>
|
|
380
324
|
|
|
@@ -506,24 +450,22 @@ defineExpose({
|
|
|
506
450
|
.main {
|
|
507
451
|
padding: 0;
|
|
508
452
|
background-color: #eff2f5;
|
|
509
|
-
&.scroll {
|
|
510
|
-
overflow-y: scroll;
|
|
511
|
-
.inner_content {
|
|
512
|
-
height: auto;
|
|
513
|
-
&.normal {
|
|
514
|
-
height: auto;
|
|
515
|
-
}
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
453
|
&.scrollX {
|
|
519
454
|
overflow-x: scroll;
|
|
520
455
|
}
|
|
521
456
|
.content_mar{
|
|
522
|
-
padding: 18px;
|
|
457
|
+
padding: 18px 18px 0;
|
|
458
|
+
display: flex;
|
|
459
|
+
flex-direction: column;
|
|
460
|
+
height: calc(100vh - 18px);
|
|
461
|
+
}
|
|
462
|
+
.contentTop {
|
|
463
|
+
flex-shrink: 0;
|
|
523
464
|
}
|
|
524
465
|
.inner_content {
|
|
525
466
|
background-color: #fff;
|
|
526
|
-
|
|
467
|
+
flex: 1;
|
|
468
|
+
// overflow-y: auto;
|
|
527
469
|
border-radius: 4px;
|
|
528
470
|
&.normal {
|
|
529
471
|
background-color: transparent;
|
|
@@ -531,9 +473,10 @@ defineExpose({
|
|
|
531
473
|
}
|
|
532
474
|
}
|
|
533
475
|
.inner_footer {
|
|
476
|
+
flex-shrink: 0;
|
|
534
477
|
color: #666666;
|
|
535
478
|
text-align: center;
|
|
536
|
-
padding
|
|
479
|
+
padding: 18px 0;
|
|
537
480
|
justify-content: center;
|
|
538
481
|
}
|
|
539
482
|
}
|