zmdms-webui 3.1.2 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/applayout/index.css +1 -1
- package/dist/es/applayoutheader/appLayoutHeader.d.ts +1 -0
- package/dist/es/applayoutheader/appLayoutHeader.js +2 -2
- package/dist/es/applayoutheader/tabs/index.js +5 -2
- package/dist/es/asyncdynamicsetting/asyncDynamicDrawer.js +281 -0
- package/dist/es/asyncdynamicsetting/asyncDynamicSetting.d.ts +6 -0
- package/dist/es/asyncdynamicsetting/asyncDynamicSetting.js +76 -0
- package/dist/es/asyncdynamicsetting/index.d.ts +5 -0
- package/dist/es/asyncdynamicsetting/index.js +8 -0
- package/dist/es/asyncdynamicsetting/interface.d.ts +74 -0
- package/dist/es/asyncdynamicsetting/moreConfig.js +47 -0
- package/dist/es/asyncdynamicsetting/storage/IStorageAdapter.d.ts +25 -0
- package/dist/es/asyncdynamicsetting/storage/index.js +21 -0
- package/dist/es/asyncdynamicsetting/storage/indexedDBAdapter.js +79 -0
- package/dist/es/asyncdynamicsetting/storage/localStorageAdapter.js +53 -0
- package/dist/es/asyncdynamicsetting/useAsyncDrawer.js +56 -0
- package/dist/es/asyncdynamicsetting/useAsyncDynamic.js +254 -0
- package/dist/es/asyncdynamicsetting/useSearch.js +98 -0
- package/dist/index.build.d.ts +3 -0
- package/dist/index.dark.css +1 -1
- package/dist/index.default.css +1 -1
- package/dist/index.es.js +3 -0
- package/dist/less/components/AppLayout/style/index.less +6 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.zmdms-container{background-color:#e9ecf3}.zmdms-container .zmdms-sider{background-color:#5b76f6;background-repeat:no-repeat;background-size:100% auto;background-size:cover;z-index:102}.zmdms-container .zmdms-content{background-color:#e9ecf3}.zmdms-container .zmdms-content--header{align-items:center;background:#fff;display:flex;height:48px;justify-content:space-between;line-height:48px;padding:0 0 0 10px}.zmdms-container .zmdms-content--header .ant-tabs{flex:1;margin-top:8px;width:calc(100% - 350px)}.zmdms-container .zmdms-content--header .ant-tabs .ant-tabs-tab>div{padding:0}.zmdms-container .zmdms-content--header .ant-tabs .ant-tabs-tab a{color:#768696;display:inline-block;padding:0 10px 0 20px}.zmdms-container .zmdms-content--header .ant-tabs .ant-tabs-nav{margin-bottom:0}.zmdms-container .zmdms-content--content{height:calc(100vh - 48px);position:relative}.zmdms-container .zmdms-content--header-info{color:#000000a6;display:flex;height:48px;max-width:350px}.zmdms-container .zmdms-content--header-info .full-screen{cursor:pointer;text-align:center;width:36px}.zmdms-container .zmdms-content--header-info .user-operation{align-items:center;cursor:pointer;display:flex;padding:0 12px}.zmdms-container .zmdms-content--header-info .user-operation:hover{background-color:#f7f7f7}.zmdms-container .zmdms-content--header-info .user-operation>span:last-child{color:#000000a6;display:inline-block;margin-left:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:70px}.zmdms-menu{display:flex;flex-direction:column;height:100vh}.zmdms-menu .zmdms-logo{align-items:center;display:block;display:flex;height:48px;padding:9px 0 5px}.zmdms-menu .zmdms-logo.zmdms-logo--line{position:relative;z-index:1000}.zmdms-menu .zmdms-logo.zmdms-logo--line:after{background:#505cbe;content:"";height:29px;position:absolute;right:-.5px;width:1px}.zmdms-menu .zmdms-logo>img{display:block;margin:0 auto;width:78px}.zmdms-menu .zmdms-menu--search{background-color:#5b8af666;position:relative}.zmdms-menu .zmdms-menu--search>input{background-color:#5b8af666;border:none;color:#fff;font-size:13px;height:36px;line-height:36px}.zmdms-menu .zmdms-menu--search>input::placeholder{color:#fff;font-size:13px}.zmdms-menu .zmdms-menu--search .zmdms-menu--search__icon{align-items:center;color:#fff;cursor:pointer;display:flex;font-size:16px;height:30px;justify-content:center;position:absolute;right:0;top:3px;width:30px}.zmdms-menu .zmdms-menu--main{background:#0000;border-right:none;flex:1;overflow-x:hidden;overflow-y:auto}.zmdms-menu .zmdms-menu--main.zmdms-menu--main-hide-bg .ant-menu-item-selected{background:#1566d2!important}.zmdms-menu .zmdms-menu--main.zmdms-menu--main-item-line .ant-menu-item{height:auto!important;line-height:20px!important;min-height:36px}.zmdms-menu .zmdms-menu--main.zmdms-menu--main-item-line .ant-menu-item .ant-menu-title-content{word-wrap:break-word;display:inline-block;height:auto!important;text-overflow:unset!important;white-space:pre-wrap;width:100%}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu,.zmdms-menu .zmdms-menu--main>.ant-menu-submenu.ant-menu-submenu-open>.ant-menu-submenu-title{color:#fff}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu>.ant-menu-submenu-title{align-items:center;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:#5b76f5;background-color:#5b8af666;color:#ffffffa6;display:flex;font-size:13px;height:36px;line-height:36px;margin:0;padding:0}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-submenu-arrow{color:#ffffffa6;right:6px}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-title-content{flex:none;width:88%}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu>.ant-menu-submenu-title:hover,.zmdms-menu .zmdms-menu--main>.ant-menu-submenu>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow{color:#fff}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu .ant-menu-sub.ant-menu-inline{background:#0000}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu .ant-menu-sub>.ant-menu-item{align-items:center;color:#ffffffa6;display:flex;font-size:13px;height:36px;line-height:36px;margin:0}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu .ant-menu-sub>.ant-menu-item a{color:inherit}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu .ant-menu-sub>.ant-menu-item:active{background:#0000}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu .ant-menu-sub>.ant-menu-item:hover{color:#fff}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu .ant-menu-sub>.ant-menu-item:not(:last-child){margin-bottom:0}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu .ant-menu-sub>.ant-menu-item.ant-menu-item-selected{background:#5b76f5;color:#fff;width:100%}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu .ant-menu-sub>.ant-menu-item.ant-menu-item-selected:after{border-right:none}.zmdms-menu .zmdms-menu--main::-webkit-scrollbar{height:4px;width:6px}.zmdms-menu .zmdms-menu--main::-webkit-scrollbar-track{background:#fff0;border-radius:4px}.zmdms-menu .zmdms-menu--main::-webkit-scrollbar-thumb{background:#5b76f6;border-radius:4px}.zmdms-menu .zmdms-menu--main::-webkit-scrollbar-thumb:hover{background:#5b76f6}.zmdms-menu .zmdms-menu--main>.ant-menu-item{align-items:center;color:#ffffffa6;display:flex;font-size:13px;height:36px;line-height:36px;margin:0}.zmdms-menu .zmdms-menu--main>.ant-menu-item a{color:inherit}.zmdms-menu .zmdms-menu--main>.ant-menu-item:active{background:#0000}.zmdms-menu .zmdms-menu--main>.ant-menu-item:hover{color:#fff}.zmdms-menu .zmdms-menu--main>.ant-menu-item:not(:last-child){margin-bottom:0}.zmdms-menu .zmdms-menu--main>.ant-menu-item.ant-menu-item-selected{background:#5b76f6;color:#fff;width:100%}.zmdms-menu .zmdms-menu--main>.ant-menu-item.ant-menu-item-selected:after{border-right:none}.zmdms-menu--sub{padding:0}.zmdms-menu--sub .ant-drawer-content{background:#0000;background-position:100%;background-repeat:no-repeat;background-size:cover;overflow:hidden}.zmdms-menu--sub .ant-drawer-content .ant-menu{background:#0000;color:#fff}.zmdms-menu--sub.ant-drawer-left>.ant-drawer-content-wrapper{left:-1px}.zmdms-menu--sub .ant-drawer-header{background:#0000;border-bottom:none;padding:0}.zmdms-menu--sub .ant-drawer-header .ant-drawer-header-title{align-items:center;color:#fff;display:flex;height:48px;justify-content:center}.zmdms-menu--sub .ant-drawer-header .ant-drawer-header-title .ant-drawer-title{align-items:center;color:#fff;display:flex;font-size:14px;justify-content:center}.zmdms-menu--sub .ant-drawer-header .ant-drawer-header-title .ant-drawer-title img{width:118px}.zmdms-menu--sub .ant-drawer-body{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#5b76f566;font-size:13px;overflow-x:hidden;padding:0}.zmdms-menu--sub .ant-drawer-body::-webkit-scrollbar{height:4px;width:6px}.zmdms-menu--sub .ant-drawer-body::-webkit-scrollbar-track{background:#fff0;border-radius:4px}.zmdms-menu--sub .ant-drawer-body::-webkit-scrollbar-thumb{background:#5b76f6;border-radius:4px}.zmdms-menu--sub .ant-drawer-body::-webkit-scrollbar-thumb:hover{background:#5b76f6}.zmdms-menu--sub .ant-drawer-body .ant-menu-submenu.ant-menu-submenu-inline{border-bottom:1px solid #8d9eff47;padding-bottom:0}.zmdms-menu--sub .ant-drawer-body .ant-menu-sub.ant-menu-inline{background:#0000;padding:0 10px}.zmdms-menu--sub .ant-drawer-body .ant-menu-item,.zmdms-menu--sub .ant-drawer-body .ant-menu-sub.ant-menu-inline>.ant-menu-item{align-items:center;border-radius:4px;color:#fff;display:flex;font-size:13px;height:30px;line-height:30px;margin:0}.zmdms-menu--sub .ant-drawer-body .ant-menu-item:not(:last-child),.zmdms-menu--sub .ant-drawer-body .ant-menu-sub.ant-menu-inline>.ant-menu-item:not(:last-child){margin-bottom:0}.zmdms-menu--sub .ant-drawer-body .ant-menu-item a,.zmdms-menu--sub .ant-drawer-body .ant-menu-sub.ant-menu-inline>.ant-menu-item a{color:#fff}.zmdms-menu--sub .ant-drawer-body .ant-menu-item:active,.zmdms-menu--sub .ant-drawer-body .ant-menu-sub.ant-menu-inline>.ant-menu-item:active{background:#0000}.zmdms-menu--sub .ant-drawer-body .ant-menu-item:last-child,.zmdms-menu--sub .ant-drawer-body .ant-menu-sub.ant-menu-inline>.ant-menu-item:last-child{margin-bottom:10px}.zmdms-menu--sub .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title,.zmdms-menu--sub .ant-drawer-body .ant-menu-submenu-title{color:#fff;font-size:13px;font-weight:700;height:30px;line-height:30px}.zmdms-menu--sub .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-submenu-arrow,.zmdms-menu--sub .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title:hover,.zmdms-menu--sub .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow,.zmdms-menu--sub .ant-drawer-body .ant-menu-submenu-title .ant-menu-submenu-arrow,.zmdms-menu--sub .ant-drawer-body .ant-menu-submenu-title:hover,.zmdms-menu--sub .ant-drawer-body .ant-menu-submenu-title:hover .ant-menu-submenu-arrow{color:#fff}.zmdms-menu--sub .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title:active,.zmdms-menu--sub .ant-drawer-body .ant-menu-submenu-title:active{background:#0000}.zmdms-menu--sub .ant-drawer-body .ant-menu-root>.ant-menu-item-only-child{margin-top:2px}.zmdms-menu--sub .ant-drawer-body .ant-menu-root>.ant-menu-item-only-child .ant-menu-title-content{font-weight:700}.zmdms-menu--sub .ant-drawer-body .ant-menu-item-selected{background-color:#5b76f5!important;color:#fff}.zmdms-menu--sub .ant-drawer-body .ant-menu-item-selected:after{border-right:none}.zmdms-menu--sub .ant-drawer-footer{align-items:center;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#5b76f566;border-top:1px solid #5670ea;display:flex;height:40px;justify-content:center;line-height:40px;padding:3px 10px}.zmdms-menu--sub .ant-drawer-footer .zt-btn-link{color:#fff}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-content,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-content .ant-menu{background:#fff}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-header{background:#fff;border-bottom:1px solid #ebf3fe}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body{-webkit-backdrop-filter:none;backdrop-filter:none;background:#fff}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body::-webkit-scrollbar{height:4px;width:6px}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body::-webkit-scrollbar-track{background:#fff;border-radius:4px}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body::-webkit-scrollbar-thumb{background:#8695a1;border-radius:4px}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body::-webkit-scrollbar-thumb:hover{background:#727e88}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-item,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-item a,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-sub.ant-menu-inline>.ant-menu-item,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-sub.ant-menu-inline>.ant-menu-item a{color:#000000d9}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-item a:hover,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-sub.ant-menu-inline>.ant-menu-item a:hover{color:#5b76f6}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-submenu-title{color:#000000a6;font-size:13px;font-weight:700;height:30px;line-height:30px}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-submenu-arrow,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-submenu-title .ant-menu-submenu-arrow{color:#000000d9}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title:hover,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-submenu-title:hover,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-submenu-title:hover .ant-menu-submenu-arrow{color:#5b76f6}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title:active,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-submenu-title:active{background:#0000}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-item-selected{background-color:#e6f7ff!important;color:#4285f4!important}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-footer{-webkit-backdrop-filter:none;backdrop-filter:none;background:none;border-top:1px solid #ebf3fe}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-footer .zt-btn-link{color:#4285f4!important}.zmdms-menu--sub.zmdms-menu--sub-item-line .ant-menu-item{height:auto!important;line-height:20px!important;min-height:30px}.zmdms-menu--sub.zmdms-menu--sub-item-line .ant-menu-item .ant-menu-title-content{word-wrap:break-word;display:inline-block;height:auto!important;text-overflow:unset!important;white-space:pre-wrap;width:100%}.logout-spin{background-color:#ffffffb3;bottom:0;left:0;padding-top:100px;position:fixed;right:0;top:0;z-index:1000}
|
|
1
|
+
.zmdms-container{background-color:#e9ecf3}.zmdms-container .zmdms-sider{background-color:#5b76f6;background-repeat:no-repeat;background-size:100% auto;background-size:cover;z-index:102}.zmdms-container .zmdms-content{background-color:#e9ecf3}.zmdms-container .zmdms-content--header{align-items:center;background:#fff;display:flex;height:48px;justify-content:space-between;line-height:48px;padding:0 0 0 10px}.zmdms-container .zmdms-content--header .ant-tabs{flex:1;margin-top:8px;width:calc(100% - 350px)}.zmdms-container .zmdms-content--header .ant-tabs .ant-tabs-tab>div{padding:0}.zmdms-container .zmdms-content--header .ant-tabs .ant-tabs-tab a{color:#768696;display:inline-block;padding:0 20px}.zmdms-container .zmdms-content--header .ant-tabs .ant-tabs-tab.ant-tabs-tab-with-remove a{padding:0 10px 0 20px}.zmdms-container .zmdms-content--header .ant-tabs .ant-tabs-nav{margin-bottom:0}.zmdms-container .zmdms-content--content{height:calc(100vh - 48px);position:relative}.zmdms-container .zmdms-content--header-info{color:#000000a6;display:flex;height:48px;max-width:350px}.zmdms-container .zmdms-content--header-info .full-screen{cursor:pointer;text-align:center;width:36px}.zmdms-container .zmdms-content--header-info .user-operation{align-items:center;cursor:pointer;display:flex;padding:0 12px}.zmdms-container .zmdms-content--header-info .user-operation:hover{background-color:#f7f7f7}.zmdms-container .zmdms-content--header-info .user-operation>span:last-child{color:#000000a6;display:inline-block;margin-left:8px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:70px}.zmdms-menu{display:flex;flex-direction:column;height:100vh}.zmdms-menu .zmdms-logo{align-items:center;display:block;display:flex;height:48px;padding:9px 0 5px}.zmdms-menu .zmdms-logo.zmdms-logo--line{position:relative;z-index:1000}.zmdms-menu .zmdms-logo.zmdms-logo--line:after{background:#505cbe;content:"";height:29px;position:absolute;right:-.5px;width:1px}.zmdms-menu .zmdms-logo>img{display:block;margin:0 auto;width:78px}.zmdms-menu .zmdms-menu--search{background-color:#5b8af666;position:relative}.zmdms-menu .zmdms-menu--search>input{background-color:#5b8af666;border:none;color:#fff;font-size:13px;height:36px;line-height:36px}.zmdms-menu .zmdms-menu--search>input::placeholder{color:#fff;font-size:13px}.zmdms-menu .zmdms-menu--search .zmdms-menu--search__icon{align-items:center;color:#fff;cursor:pointer;display:flex;font-size:16px;height:30px;justify-content:center;position:absolute;right:0;top:3px;width:30px}.zmdms-menu .zmdms-menu--main{background:#0000;border-right:none;flex:1;overflow-x:hidden;overflow-y:auto}.zmdms-menu .zmdms-menu--main.zmdms-menu--main-hide-bg .ant-menu-item-selected{background:#1566d2!important}.zmdms-menu .zmdms-menu--main.zmdms-menu--main-item-line .ant-menu-item{height:auto!important;line-height:20px!important;min-height:36px}.zmdms-menu .zmdms-menu--main.zmdms-menu--main-item-line .ant-menu-item .ant-menu-title-content{word-wrap:break-word;display:inline-block;height:auto!important;text-overflow:unset!important;white-space:pre-wrap;width:100%}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu,.zmdms-menu .zmdms-menu--main>.ant-menu-submenu.ant-menu-submenu-open>.ant-menu-submenu-title{color:#fff}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu>.ant-menu-submenu-title{align-items:center;-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);background-color:#5b76f5;background-color:#5b8af666;color:#ffffffa6;display:flex;font-size:13px;height:36px;line-height:36px;margin:0;padding:0}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-submenu-arrow{color:#ffffffa6;right:6px}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-title-content{flex:none;width:88%}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu>.ant-menu-submenu-title:hover,.zmdms-menu .zmdms-menu--main>.ant-menu-submenu>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow{color:#fff}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu .ant-menu-sub.ant-menu-inline{background:#0000}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu .ant-menu-sub>.ant-menu-item{align-items:center;color:#ffffffa6;display:flex;font-size:13px;height:36px;line-height:36px;margin:0}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu .ant-menu-sub>.ant-menu-item a{color:inherit}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu .ant-menu-sub>.ant-menu-item:active{background:#0000}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu .ant-menu-sub>.ant-menu-item:hover{color:#fff}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu .ant-menu-sub>.ant-menu-item:not(:last-child){margin-bottom:0}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu .ant-menu-sub>.ant-menu-item.ant-menu-item-selected{background:#5b76f5;color:#fff;width:100%}.zmdms-menu .zmdms-menu--main>.ant-menu-submenu .ant-menu-sub>.ant-menu-item.ant-menu-item-selected:after{border-right:none}.zmdms-menu .zmdms-menu--main::-webkit-scrollbar{height:4px;width:6px}.zmdms-menu .zmdms-menu--main::-webkit-scrollbar-track{background:#fff0;border-radius:4px}.zmdms-menu .zmdms-menu--main::-webkit-scrollbar-thumb{background:#5b76f6;border-radius:4px}.zmdms-menu .zmdms-menu--main::-webkit-scrollbar-thumb:hover{background:#5b76f6}.zmdms-menu .zmdms-menu--main>.ant-menu-item{align-items:center;color:#ffffffa6;display:flex;font-size:13px;height:36px;line-height:36px;margin:0}.zmdms-menu .zmdms-menu--main>.ant-menu-item a{color:inherit}.zmdms-menu .zmdms-menu--main>.ant-menu-item:active{background:#0000}.zmdms-menu .zmdms-menu--main>.ant-menu-item:hover{color:#fff}.zmdms-menu .zmdms-menu--main>.ant-menu-item:not(:last-child){margin-bottom:0}.zmdms-menu .zmdms-menu--main>.ant-menu-item.ant-menu-item-selected{background:#5b76f6;color:#fff;width:100%}.zmdms-menu .zmdms-menu--main>.ant-menu-item.ant-menu-item-selected:after{border-right:none}.zmdms-menu--sub{padding:0}.zmdms-menu--sub .ant-drawer-content{background:#0000;background-position:100%;background-repeat:no-repeat;background-size:cover;overflow:hidden}.zmdms-menu--sub .ant-drawer-content .ant-menu{background:#0000;color:#fff}.zmdms-menu--sub.ant-drawer-left>.ant-drawer-content-wrapper{left:-1px}.zmdms-menu--sub .ant-drawer-header{background:#0000;border-bottom:none;padding:0}.zmdms-menu--sub .ant-drawer-header .ant-drawer-header-title{align-items:center;color:#fff;display:flex;height:48px;justify-content:center}.zmdms-menu--sub .ant-drawer-header .ant-drawer-header-title .ant-drawer-title{align-items:center;color:#fff;display:flex;font-size:14px;justify-content:center}.zmdms-menu--sub .ant-drawer-header .ant-drawer-header-title .ant-drawer-title img{width:118px}.zmdms-menu--sub .ant-drawer-body{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#5b76f566;font-size:13px;overflow-x:hidden;padding:0}.zmdms-menu--sub .ant-drawer-body::-webkit-scrollbar{height:4px;width:6px}.zmdms-menu--sub .ant-drawer-body::-webkit-scrollbar-track{background:#fff0;border-radius:4px}.zmdms-menu--sub .ant-drawer-body::-webkit-scrollbar-thumb{background:#5b76f6;border-radius:4px}.zmdms-menu--sub .ant-drawer-body::-webkit-scrollbar-thumb:hover{background:#5b76f6}.zmdms-menu--sub .ant-drawer-body .ant-menu-submenu.ant-menu-submenu-inline{border-bottom:1px solid #8d9eff47;padding-bottom:0}.zmdms-menu--sub .ant-drawer-body .ant-menu-sub.ant-menu-inline{background:#0000;padding:0 10px}.zmdms-menu--sub .ant-drawer-body .ant-menu-item,.zmdms-menu--sub .ant-drawer-body .ant-menu-sub.ant-menu-inline>.ant-menu-item{align-items:center;border-radius:4px;color:#fff;display:flex;font-size:13px;height:30px;line-height:30px;margin:0}.zmdms-menu--sub .ant-drawer-body .ant-menu-item:not(:last-child),.zmdms-menu--sub .ant-drawer-body .ant-menu-sub.ant-menu-inline>.ant-menu-item:not(:last-child){margin-bottom:0}.zmdms-menu--sub .ant-drawer-body .ant-menu-item a,.zmdms-menu--sub .ant-drawer-body .ant-menu-sub.ant-menu-inline>.ant-menu-item a{color:#fff}.zmdms-menu--sub .ant-drawer-body .ant-menu-item:active,.zmdms-menu--sub .ant-drawer-body .ant-menu-sub.ant-menu-inline>.ant-menu-item:active{background:#0000}.zmdms-menu--sub .ant-drawer-body .ant-menu-item:last-child,.zmdms-menu--sub .ant-drawer-body .ant-menu-sub.ant-menu-inline>.ant-menu-item:last-child{margin-bottom:10px}.zmdms-menu--sub .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title,.zmdms-menu--sub .ant-drawer-body .ant-menu-submenu-title{color:#fff;font-size:13px;font-weight:700;height:30px;line-height:30px}.zmdms-menu--sub .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-submenu-arrow,.zmdms-menu--sub .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title:hover,.zmdms-menu--sub .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow,.zmdms-menu--sub .ant-drawer-body .ant-menu-submenu-title .ant-menu-submenu-arrow,.zmdms-menu--sub .ant-drawer-body .ant-menu-submenu-title:hover,.zmdms-menu--sub .ant-drawer-body .ant-menu-submenu-title:hover .ant-menu-submenu-arrow{color:#fff}.zmdms-menu--sub .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title:active,.zmdms-menu--sub .ant-drawer-body .ant-menu-submenu-title:active{background:#0000}.zmdms-menu--sub .ant-drawer-body .ant-menu-root>.ant-menu-item-only-child{margin-top:2px}.zmdms-menu--sub .ant-drawer-body .ant-menu-root>.ant-menu-item-only-child .ant-menu-title-content{font-weight:700}.zmdms-menu--sub .ant-drawer-body .ant-menu-item-selected{background-color:#5b76f5!important;color:#fff}.zmdms-menu--sub .ant-drawer-body .ant-menu-item-selected:after{border-right:none}.zmdms-menu--sub .ant-drawer-footer{align-items:center;-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background:#5b76f566;border-top:1px solid #5670ea;display:flex;height:40px;justify-content:center;line-height:40px;padding:3px 10px}.zmdms-menu--sub .ant-drawer-footer .zt-btn-link{color:#fff}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-content,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-content .ant-menu{background:#fff}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-header{background:#fff;border-bottom:1px solid #ebf3fe}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body{-webkit-backdrop-filter:none;backdrop-filter:none;background:#fff}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body::-webkit-scrollbar{height:4px;width:6px}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body::-webkit-scrollbar-track{background:#fff;border-radius:4px}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body::-webkit-scrollbar-thumb{background:#8695a1;border-radius:4px}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body::-webkit-scrollbar-thumb:hover{background:#727e88}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-item,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-item a,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-sub.ant-menu-inline>.ant-menu-item,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-sub.ant-menu-inline>.ant-menu-item a{color:#000000d9}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-item a:hover,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-sub.ant-menu-inline>.ant-menu-item a:hover{color:#5b76f6}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-submenu-title{color:#000000a6;font-size:13px;font-weight:700;height:30px;line-height:30px}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title .ant-menu-submenu-arrow,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-submenu-title .ant-menu-submenu-arrow{color:#000000d9}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title:hover,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title:hover .ant-menu-submenu-arrow,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-submenu-title:hover,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-submenu-title:hover .ant-menu-submenu-arrow{color:#5b76f6}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-inline>.ant-menu-submenu>.ant-menu-submenu-title:active,.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-submenu-title:active{background:#0000}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-body .ant-menu-item-selected{background-color:#e6f7ff!important;color:#4285f4!important}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-footer{-webkit-backdrop-filter:none;backdrop-filter:none;background:none;border-top:1px solid #ebf3fe}.zmdms-menu--sub.zmdms-menu--sub-hide-bg .ant-drawer-footer .zt-btn-link{color:#4285f4!important}.zmdms-menu--sub.zmdms-menu--sub-item-line .ant-menu-item{height:auto!important;line-height:20px!important;min-height:30px}.zmdms-menu--sub.zmdms-menu--sub-item-line .ant-menu-item .ant-menu-title-content{word-wrap:break-word;display:inline-block;height:auto!important;text-overflow:unset!important;white-space:pre-wrap;width:100%}.logout-spin{background-color:#ffffffb3;bottom:0;left:0;padding-top:100px;position:fixed;right:0;top:0;z-index:1000}
|
|
@@ -7,9 +7,9 @@ import { LayoutHeaderContext } from './LayoutHeaderContext.js';
|
|
|
7
7
|
import { Layout } from 'antd';
|
|
8
8
|
|
|
9
9
|
var AppLayoutHeader = function (_a) {
|
|
10
|
-
var tabs = _a.tabs, activeTab = _a.activeTab, deleteTabHandle = _a.deleteTabHandle, deleteTabsHandle = _a.deleteTabsHandle, setActiveTab = _a.setActiveTab, logout = _a.logout, userInfo = _a.userInfo, updatePassword = _a.updatePassword, isSaveState = _a.isSaveState, selfRender = _a.selfRender, userDetail = _a.userDetail, userInfoCanEdit = _a.userInfoCanEdit, updateUserInfo = _a.updateUserInfo, isNewUpdatePwd = _a.isNewUpdatePwd, preRender = _a.preRender;
|
|
10
|
+
var tabs = _a.tabs, activeTab = _a.activeTab, deleteTabHandle = _a.deleteTabHandle, deleteTabsHandle = _a.deleteTabsHandle, setActiveTab = _a.setActiveTab, logout = _a.logout, userInfo = _a.userInfo, updatePassword = _a.updatePassword, isSaveState = _a.isSaveState, selfRender = _a.selfRender, userDetail = _a.userDetail, userInfoCanEdit = _a.userInfoCanEdit, updateUserInfo = _a.updateUserInfo, isNewUpdatePwd = _a.isNewUpdatePwd, preRender = _a.preRender, unCloseTabsKey = _a.unCloseTabsKey;
|
|
11
11
|
// console.log("layout-header- rerender");
|
|
12
|
-
return (jsx(Layout.Header, __assign({ className: "zmdms-content--header" }, { children: jsxs(LayoutHeaderContext.Provider, __assign({ value: { userInfo: userInfo } }, { children: [jsx(TabsCom, { tabs: tabs, activeTab: activeTab, deleteTabHandle: deleteTabHandle, deleteTabsHandle: deleteTabsHandle, setActiveTab: setActiveTab, isSaveState: isSaveState }), preRender, jsx(SettingCom, { logout: logout, updatePassword: updatePassword, userDetail: userDetail, userInfoCanEdit: userInfoCanEdit, updateUserInfo: updateUserInfo, isNewUpdatePwd: isNewUpdatePwd }), selfRender] })) })));
|
|
12
|
+
return (jsx(Layout.Header, __assign({ className: "zmdms-content--header" }, { children: jsxs(LayoutHeaderContext.Provider, __assign({ value: { userInfo: userInfo } }, { children: [jsx(TabsCom, { tabs: tabs, activeTab: activeTab, deleteTabHandle: deleteTabHandle, deleteTabsHandle: deleteTabsHandle, setActiveTab: setActiveTab, isSaveState: isSaveState, unCloseTabsKey: unCloseTabsKey }), preRender, jsx(SettingCom, { logout: logout, updatePassword: updatePassword, userDetail: userDetail, userInfoCanEdit: userInfoCanEdit, updateUserInfo: updateUserInfo, isNewUpdatePwd: isNewUpdatePwd }), selfRender] })) })));
|
|
13
13
|
};
|
|
14
14
|
AppLayoutHeader.displayName = "ZTXK_WEBUI_AppLayoutHeader";
|
|
15
15
|
var AppLayoutHeader$1 = memo(AppLayoutHeader);
|
|
@@ -7,7 +7,7 @@ import MemoTabs from '../../tabs/tabs.js';
|
|
|
7
7
|
import { Dropdown } from 'antd';
|
|
8
8
|
|
|
9
9
|
var TabsCom = function (_a) {
|
|
10
|
-
var tabs = _a.tabs, activeTab = _a.activeTab, deleteTabHandle = _a.deleteTabHandle, setActiveTab = _a.setActiveTab, deleteTabsHandle = _a.deleteTabsHandle, isSaveState = _a.isSaveState;
|
|
10
|
+
var tabs = _a.tabs, activeTab = _a.activeTab, deleteTabHandle = _a.deleteTabHandle, setActiveTab = _a.setActiveTab, deleteTabsHandle = _a.deleteTabsHandle, isSaveState = _a.isSaveState, unCloseTabsKey = _a.unCloseTabsKey;
|
|
11
11
|
// 点击页签的回调
|
|
12
12
|
var onTabClick = function (key) {
|
|
13
13
|
setActiveTab(key);
|
|
@@ -111,9 +111,12 @@ var TabsCom = function (_a) {
|
|
|
111
111
|
onRightClickHandle(e.key, tab);
|
|
112
112
|
},
|
|
113
113
|
} }, { children: jsx(Link, __assign({ to: tab.path, state: isSaveState ? tab.state : undefined }, { children: tab.label })) }))),
|
|
114
|
+
closable: unCloseTabsKey
|
|
115
|
+
? !(unCloseTabsKey === null || unCloseTabsKey === void 0 ? void 0 : unCloseTabsKey.includes(tab.key))
|
|
116
|
+
: tab.closable,
|
|
114
117
|
};
|
|
115
118
|
});
|
|
116
|
-
}, [tabs, items, onRightClickHandle, isSaveState]);
|
|
119
|
+
}, [tabs, items, onRightClickHandle, isSaveState, unCloseTabsKey]);
|
|
117
120
|
// 点击关闭回调
|
|
118
121
|
var onEdit = function (key) {
|
|
119
122
|
remove(key);
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
import { __assign, __spreadArray } from '../_virtual/_tslib.js';
|
|
2
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
+
import { memo, forwardRef, useMemo, useImperativeHandle, useCallback } from 'react';
|
|
4
|
+
import update from '../node_modules/immutability-helper/index.js';
|
|
5
|
+
import { useAsyncDynamic } from './useAsyncDynamic.js';
|
|
6
|
+
import { useAsyncDrawer } from './useAsyncDrawer.js';
|
|
7
|
+
import MoreConfig from './moreConfig.js';
|
|
8
|
+
import useSearch from './useSearch.js';
|
|
9
|
+
import '../config/ZtxkContext.js';
|
|
10
|
+
import useBaseContext from '../config/useBaseContext.js';
|
|
11
|
+
import '../config/MyStorage.js';
|
|
12
|
+
import { useLatest } from 'ahooks';
|
|
13
|
+
import { createStorageAdapter } from './storage/index.js';
|
|
14
|
+
import myMessage from '../message/index.js';
|
|
15
|
+
import Input from '../input/input.js';
|
|
16
|
+
import ButtonCom from '../button/button.js';
|
|
17
|
+
import Sortable from '../sortable/sortable.js';
|
|
18
|
+
import { Drawer, Checkbox } from 'antd';
|
|
19
|
+
import SettingOutlined from '../node_modules/@ant-design/icons/es/icons/SettingOutlined.js';
|
|
20
|
+
|
|
21
|
+
// 工具函数,排序分区
|
|
22
|
+
var sortDynamicListByType = function (list) {
|
|
23
|
+
var dimensionList = list.filter(function (item) { return item.isDimension; });
|
|
24
|
+
var fieldList = list.filter(function (item) { return !item.isDimension; });
|
|
25
|
+
var leftList = fieldList.filter(function (item) { return item.fixed === "left"; });
|
|
26
|
+
var middleList = fieldList.filter(function (item) { return !item.fixed; });
|
|
27
|
+
var rightList = fieldList.filter(function (item) { return item.fixed === "right"; });
|
|
28
|
+
return __spreadArray(__spreadArray(__spreadArray(__spreadArray([], dimensionList, true), leftList, true), middleList, true), rightList, true);
|
|
29
|
+
};
|
|
30
|
+
var AsyncDynamicDrawer = function (props, ref) {
|
|
31
|
+
var list = props.list, dynamicKey = props.dynamicKey, parentDynamicKey = props.parentDynamicKey, _a = props.title, title = _a === void 0 ? "自定义配置" : _a, onCurrentListChange = props.onCurrentListChange, isMore = props.isMore, isFixed = props.isFixed, isDimensionDynamic = props.isDimensionDynamic, isSearch = props.isSearch, storageConfig = props.storageConfig;
|
|
32
|
+
var enableDynamicColumnSearch = useBaseContext().enableDynamicColumnSearch;
|
|
33
|
+
// 是否开启搜索功能
|
|
34
|
+
var isDynamicColumnSearchEnabled = enableDynamicColumnSearch
|
|
35
|
+
? isSearch !== false
|
|
36
|
+
: !!isSearch;
|
|
37
|
+
// 创建存储适配器
|
|
38
|
+
var adapter = useMemo(function () { return createStorageAdapter(storageConfig); }, [storageConfig]);
|
|
39
|
+
// 使用异步动态配置 hook
|
|
40
|
+
var _b = useAsyncDynamic(dynamicKey, parentDynamicKey, list, adapter), currentDynamicList = _b.currentDynamicList, setCurrentDynamicList = _b.setCurrentDynamicList, tempDynamicList = _b.tempDynamicList, setTempDynamicList = _b.setTempDynamicList, isReady = _b.isReady;
|
|
41
|
+
var _c = useAsyncDrawer(currentDynamicList, setCurrentDynamicList, dynamicKey, parentDynamicKey, setTempDynamicList, list, onCurrentListChange, adapter), visible = _c.visible, setVisible = _c.setVisible, onClose = _c.onClose, onReset = _c.onReset, onSure = _c.onSure;
|
|
42
|
+
// 向外部暴露方法
|
|
43
|
+
useImperativeHandle(ref, function () {
|
|
44
|
+
return {
|
|
45
|
+
setVisible: setVisible,
|
|
46
|
+
onSure: onSure,
|
|
47
|
+
onReset: onReset,
|
|
48
|
+
isReady: function () { return isReady; },
|
|
49
|
+
};
|
|
50
|
+
}, [isReady, setVisible, onSure, onReset]);
|
|
51
|
+
// 根据item的checked 获取当前选中项
|
|
52
|
+
var checkedValues = useMemo(function () {
|
|
53
|
+
var _checkedValues = [];
|
|
54
|
+
tempDynamicList.forEach(function (item) {
|
|
55
|
+
if (item.checked) {
|
|
56
|
+
_checkedValues.push(item.key);
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
return _checkedValues;
|
|
60
|
+
}, [tempDynamicList]);
|
|
61
|
+
var _d = useSearch(tempDynamicList, checkedValues, isDimensionDynamic), onSearchHandle = _d.onSearchHandle, onCheckBtn = _d.onCheckBtn, filterDynamicColumns = _d.filterDynamicColumns;
|
|
62
|
+
var filterDynamicColumnsRef = useLatest(filterDynamicColumns);
|
|
63
|
+
// 根据isDimension分区
|
|
64
|
+
var _e = useMemo(function () {
|
|
65
|
+
var dynamicList = tempDynamicList;
|
|
66
|
+
if (filterDynamicColumns) {
|
|
67
|
+
dynamicList = tempDynamicList.filter(function (item) {
|
|
68
|
+
return filterDynamicColumns.find(function (i) { return i.key === item.key; });
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
var dimensionList = dynamicList.filter(function (item) { return item.isDimension; });
|
|
72
|
+
var fieldList = dynamicList.filter(function (item) { return !item.isDimension; });
|
|
73
|
+
return { dimensionList: dimensionList, fieldList: fieldList };
|
|
74
|
+
}, [tempDynamicList, filterDynamicColumns]), dimensionList = _e.dimensionList, fieldList = _e.fieldList;
|
|
75
|
+
// 排序优先级判断
|
|
76
|
+
var isDimensionPriority = useCallback(function (dragIndex, hoverIndex) {
|
|
77
|
+
var isUp = dragIndex < hoverIndex;
|
|
78
|
+
var startIndex = isUp ? dragIndex : hoverIndex;
|
|
79
|
+
var endIndex = isUp ? hoverIndex : dragIndex;
|
|
80
|
+
var oldItem = tempDynamicList[startIndex];
|
|
81
|
+
var dragItem = tempDynamicList[endIndex];
|
|
82
|
+
var oldGroup = oldItem === null || oldItem === void 0 ? void 0 : oldItem.dimensionGroup;
|
|
83
|
+
var dragGroup = dragItem === null || dragItem === void 0 ? void 0 : dragItem.dimensionGroup;
|
|
84
|
+
if (oldGroup !== dragGroup) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
if ((oldItem === null || oldItem === void 0 ? void 0 : oldItem.dimensionPriority) !== undefined &&
|
|
88
|
+
(dragItem === null || dragItem === void 0 ? void 0 : dragItem.dimensionPriority) !== undefined) {
|
|
89
|
+
if ((oldItem === null || oldItem === void 0 ? void 0 : oldItem.dimensionPriority) < (dragItem === null || dragItem === void 0 ? void 0 : dragItem.dimensionPriority)) {
|
|
90
|
+
myMessage.warning("".concat(dragItem === null || dragItem === void 0 ? void 0 : dragItem.label, "\u4E0D\u80FD\u6392\u5E8F\u5230").concat(oldItem === null || oldItem === void 0 ? void 0 : oldItem.label).concat(isUp ? "前面" : "后面"));
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return true;
|
|
95
|
+
}, [tempDynamicList]);
|
|
96
|
+
// 拖拽
|
|
97
|
+
var onMoveItem = useCallback(function (dragIndex, hoverIndex) {
|
|
98
|
+
if (filterDynamicColumnsRef.current) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
if (!isDimensionPriority(dragIndex, hoverIndex)) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
setTempDynamicList(function (preDynamicList) {
|
|
105
|
+
var dragCard = preDynamicList[dragIndex];
|
|
106
|
+
var currentList = update(preDynamicList, {
|
|
107
|
+
$splice: [
|
|
108
|
+
[dragIndex, 1],
|
|
109
|
+
[hoverIndex, 0, dragCard],
|
|
110
|
+
],
|
|
111
|
+
});
|
|
112
|
+
return sortDynamicListByType(currentList);
|
|
113
|
+
});
|
|
114
|
+
}, [setTempDynamicList, isDimensionPriority, filterDynamicColumnsRef]);
|
|
115
|
+
// 子元素拖拽
|
|
116
|
+
var onChildMoveItem = useCallback(function (pIndex, pKey) {
|
|
117
|
+
return function (dragIndex, hoverIndex) {
|
|
118
|
+
if (filterDynamicColumnsRef.current) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
setTempDynamicList(function (preDynamicList) {
|
|
122
|
+
var newDynamicList = preDynamicList.map(function (item) { return (__assign({}, item)); }) || [];
|
|
123
|
+
var changeCList = newDynamicList[pIndex].children || [];
|
|
124
|
+
var dragCard = changeCList[dragIndex];
|
|
125
|
+
var currentList = update(changeCList, {
|
|
126
|
+
$splice: [
|
|
127
|
+
[dragIndex, 1],
|
|
128
|
+
[hoverIndex, 0, dragCard],
|
|
129
|
+
],
|
|
130
|
+
});
|
|
131
|
+
newDynamicList[pIndex].children = currentList;
|
|
132
|
+
var leftList = newDynamicList.filter(function (item) { return item.fixed === "left"; });
|
|
133
|
+
var middleList = newDynamicList.filter(function (item) { return !item.fixed; });
|
|
134
|
+
var rightList = newDynamicList.filter(function (item) { return item.fixed === "right"; });
|
|
135
|
+
return __spreadArray(__spreadArray(__spreadArray([], leftList, true), middleList, true), rightList, true);
|
|
136
|
+
});
|
|
137
|
+
};
|
|
138
|
+
}, [setTempDynamicList, filterDynamicColumnsRef]);
|
|
139
|
+
// 确认
|
|
140
|
+
var onSureHandle = function () {
|
|
141
|
+
onSure && onSure(tempDynamicList);
|
|
142
|
+
};
|
|
143
|
+
var onCheckboxChange = function (checkedValues) {
|
|
144
|
+
var prevCheckedKeys = new Set(checkedValues.filter(function (key) {
|
|
145
|
+
var item = tempDynamicList.find(function (d) { return d.key === key; });
|
|
146
|
+
return item && item.checked;
|
|
147
|
+
}));
|
|
148
|
+
var currentCheckedKeys = new Set(checkedValues);
|
|
149
|
+
var changedKey = null;
|
|
150
|
+
var isChecked = false;
|
|
151
|
+
for (var _i = 0, checkedValues_1 = checkedValues; _i < checkedValues_1.length; _i++) {
|
|
152
|
+
var key = checkedValues_1[_i];
|
|
153
|
+
if (!prevCheckedKeys.has(key)) {
|
|
154
|
+
changedKey = key;
|
|
155
|
+
isChecked = true;
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (!changedKey) {
|
|
160
|
+
for (var _a = 0, tempDynamicList_1 = tempDynamicList; _a < tempDynamicList_1.length; _a++) {
|
|
161
|
+
var item = tempDynamicList_1[_a];
|
|
162
|
+
if (item.checked && !currentCheckedKeys.has(item.key)) {
|
|
163
|
+
changedKey = item.key;
|
|
164
|
+
isChecked = false;
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
var exclusiveMap = {};
|
|
170
|
+
tempDynamicList.forEach(function (item) {
|
|
171
|
+
var key = item.key;
|
|
172
|
+
var exclusiveKeys = (item.dimensionExclusive || "")
|
|
173
|
+
.split(",")
|
|
174
|
+
.map(function (k) { return k.trim(); })
|
|
175
|
+
.filter(Boolean);
|
|
176
|
+
exclusiveMap[key] = new Set(__spreadArray([key], exclusiveKeys, true));
|
|
177
|
+
});
|
|
178
|
+
var hasConflict = false;
|
|
179
|
+
for (var i = 0; i < checkedValues.length; i++) {
|
|
180
|
+
for (var j = i + 1; j < checkedValues.length; j++) {
|
|
181
|
+
var keyA = checkedValues[i];
|
|
182
|
+
var keyB = checkedValues[j];
|
|
183
|
+
if (exclusiveMap[keyA] && exclusiveMap[keyA].has(keyB)) {
|
|
184
|
+
hasConflict = true;
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (hasConflict)
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
if (hasConflict) {
|
|
192
|
+
myMessage.warning("所选项存在互斥关系,不能同时勾选!");
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
var newDynamicList = tempDynamicList.map(function (item) {
|
|
196
|
+
var isItemChecked = checkedValues.includes(item.key);
|
|
197
|
+
var newItem = __assign(__assign({}, item), { checked: isItemChecked });
|
|
198
|
+
if (item.key === changedKey &&
|
|
199
|
+
item.children &&
|
|
200
|
+
item.children.length > 0) {
|
|
201
|
+
newItem.children = item.children.map(function (child) { return (__assign(__assign({}, child), { checked: isChecked })); });
|
|
202
|
+
}
|
|
203
|
+
else if (item.children && item.children.length > 0) {
|
|
204
|
+
newItem.children = item.children.map(function (child) { return (__assign({}, child)); });
|
|
205
|
+
}
|
|
206
|
+
return newItem;
|
|
207
|
+
});
|
|
208
|
+
setTempDynamicList(newDynamicList);
|
|
209
|
+
};
|
|
210
|
+
var onChildCheckboxChange = function (checkedValues, pIndex) {
|
|
211
|
+
var _a, _b;
|
|
212
|
+
var newDynamicList = tempDynamicList.map(function (item) { return (__assign({}, item)); }) || [];
|
|
213
|
+
var changeCList = ((_b = (_a = newDynamicList[pIndex].children) === null || _a === void 0 ? void 0 : _a.map) === null || _b === void 0 ? void 0 : _b.call(_a, function (item) { return (__assign({}, item)); })) ||
|
|
214
|
+
[];
|
|
215
|
+
changeCList.forEach(function (item) {
|
|
216
|
+
if (!checkedValues.find(function (value) { return value === item.key; })) {
|
|
217
|
+
item.checked = false;
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
item.checked = true;
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
newDynamicList[pIndex].children = changeCList;
|
|
224
|
+
var someChildrenChecked = changeCList.some(function (child) { return child.checked; });
|
|
225
|
+
if (someChildrenChecked) {
|
|
226
|
+
newDynamicList[pIndex].checked = true;
|
|
227
|
+
}
|
|
228
|
+
else {
|
|
229
|
+
newDynamicList[pIndex].checked = false;
|
|
230
|
+
}
|
|
231
|
+
setTempDynamicList(sortDynamicListByType(newDynamicList));
|
|
232
|
+
};
|
|
233
|
+
var onMoreChange = function (key, result) {
|
|
234
|
+
var newDynamicList = tempDynamicList.map(function (item) { return (__assign({}, item)); }) || [];
|
|
235
|
+
var currentIndex = newDynamicList.findIndex(function (item) { return key === item.key; });
|
|
236
|
+
var currentItem = newDynamicList[currentIndex];
|
|
237
|
+
if (currentItem.fixed === result.fixed &&
|
|
238
|
+
currentItem.isDimensionSum === result.isDimensionSum) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
currentItem.fixed = result.fixed;
|
|
242
|
+
currentItem.isDimensionSum = result.isDimensionSum;
|
|
243
|
+
setTempDynamicList(sortDynamicListByType(newDynamicList));
|
|
244
|
+
};
|
|
245
|
+
// 渲染区块
|
|
246
|
+
var renderSection = function (list, indexOffset, title) {
|
|
247
|
+
if (indexOffset === void 0) { indexOffset = 0; }
|
|
248
|
+
if (!list.length)
|
|
249
|
+
return null;
|
|
250
|
+
return (jsxs("div", { children: [title && jsx("div", __assign({ className: "dynamic-drawer-section-title" }, { children: title })), list.map(function (item, index) {
|
|
251
|
+
var key = item.key, disabled = item.disabled, label = item.label, fixed = item.fixed, children = item.children, isDimensionSum = item.isDimensionSum, isDimension = item.isDimension;
|
|
252
|
+
var childrenCheckedValues = [];
|
|
253
|
+
var isIndeterminate = false;
|
|
254
|
+
if (Array.isArray(children) && children.length > 0) {
|
|
255
|
+
children.forEach(function (item) {
|
|
256
|
+
if (item.checked) {
|
|
257
|
+
childrenCheckedValues.push(item.key);
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
var hasChecked = childrenCheckedValues.length > 0;
|
|
261
|
+
var allChecked = childrenCheckedValues.length === children.length;
|
|
262
|
+
isIndeterminate = hasChecked && !allChecked;
|
|
263
|
+
}
|
|
264
|
+
return (jsxs(Sortable.Item, __assign({ type: "search-drawer", index: indexOffset + index, id: key, onMoveItem: onMoveItem, className: "zt-sortable-new" }, { children: [jsxs("div", __assign({ className: "zt-sortable--item dynamic-drawer-card" }, { children: [jsx(Checkbox, __assign({ value: key, disabled: disabled, indeterminate: isIndeterminate }, { children: label || key })), isMore && (!children || children.length === 0) && (jsx(MoreConfig, { fixed: fixed || "", isDimensionSum: isDimensionSum, onChange: function (result) {
|
|
265
|
+
onMoreChange(key, result);
|
|
266
|
+
}, isSum: isDimension, isFixed: isFixed }))] })), Array.isArray(children) && children.length > 0 ? (jsx("div", __assign({ className: "zt-sortable--children dynamic-drawer-children", style: { marginLeft: 32, marginBottom: 8 } }, { children: jsx(Checkbox.Group, __assign({ value: childrenCheckedValues, onChange: function (checkedValues) {
|
|
267
|
+
onChildCheckboxChange(checkedValues, tempDynamicList.indexOf(item));
|
|
268
|
+
} }, { children: children.map(function (cItem, cIndex) {
|
|
269
|
+
var cKey = cItem.key, cLabel = cItem.label, cDisabled = cItem.disabled;
|
|
270
|
+
return (jsx(Sortable.Item, __assign({ id: key, type: "search-drawer-".concat(key), index: cIndex, onMoveItem: onChildMoveItem(tempDynamicList.indexOf(item), key), className: "zt-sortable-new" }, { children: jsx("div", __assign({ className: "dynamic-drawer-card dynamic-drawer-child-card" }, { children: jsx(Checkbox, __assign({ value: cKey, disabled: cDisabled }, { children: cLabel || cKey })) })) }), cKey));
|
|
271
|
+
}) })) }))) : null] }), key));
|
|
272
|
+
})] }));
|
|
273
|
+
};
|
|
274
|
+
/**底部按钮 */
|
|
275
|
+
var renderFooter = function () { return (jsxs(Fragment, { children: [jsx(ButtonCom, __assign({ type: "default", onClick: onClose }, { children: "\u53D6\u6D88" })), jsx(ButtonCom, __assign({ type: "default", onClick: onReset }, { children: "\u91CD\u7F6E" })), jsx(ButtonCom, __assign({ type: "primary", onClick: onSureHandle }, { children: "\u786E\u5B9A" }))] })); };
|
|
276
|
+
return (jsx(Drawer, __assign({ className: "dynamic-drawer", title: jsxs("div", { children: [jsx(SettingOutlined, { style: { fontSize: 16 } }), jsxs("span", __assign({ className: "search-drawer--title-text" }, { children: [title, jsx("span", { children: "\uFF08\u62D6\u62FD\u6392\u5E8F\uFF09" })] }))] }), width: 300, placement: "right", open: visible, closable: false, maskClosable: false, footer: renderFooter() }, { children: jsxs("div", __assign({ className: "search-drawer--filter" }, { children: [isDynamicColumnSearchEnabled ? (jsxs("div", __assign({ className: "search-drawer--filter-input" }, { children: [jsx(Input.Search, { placeholder: "\u641C\u7D22", onSearch: onSearchHandle }), jsx(ButtonCom, __assign({ type: "default", className: "selector-all", loading: false, onClick: function () { return onCheckBtn("all", onCheckboxChange); } }, { children: "\u5168\u9009" })), jsx(ButtonCom, __assign({ type: "default", className: "selector-inverse", loading: false, onClick: function () { return onCheckBtn("inverse", onCheckboxChange); } }, { children: "\u53CD\u9009" }))] }))) : null, jsx(Checkbox.Group, __assign({ value: checkedValues, onChange: onCheckboxChange }, { children: jsxs(Sortable, { children: [isDimensionDynamic && renderSection(dimensionList, 0, "维度配置"), renderSection(fieldList, dimensionList.length, isDimensionDynamic ? "字段配置" : undefined)] }) }))] })) })));
|
|
277
|
+
};
|
|
278
|
+
AsyncDynamicDrawer.displayName = "ZTXK_WEBUI_AsyncDynamicDrawer";
|
|
279
|
+
var AsyncDynamicDrawer$1 = memo(forwardRef(AsyncDynamicDrawer));
|
|
280
|
+
|
|
281
|
+
export { AsyncDynamicDrawer$1 as default };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { IAsyncDynamicSettingProps, IRef } from './interface.js';
|
|
3
|
+
|
|
4
|
+
declare const _default: React__default.MemoExoticComponent<React__default.ForwardRefExoticComponent<IAsyncDynamicSettingProps & React__default.RefAttributes<IRef>>>;
|
|
5
|
+
|
|
6
|
+
export { _default as default };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { __assign } from '../_virtual/_tslib.js';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React__default, { memo, forwardRef, useState, useRef, useImperativeHandle } from 'react';
|
|
4
|
+
import AsyncDynamicDrawer from './asyncDynamicDrawer.js';
|
|
5
|
+
import { createStorageAdapter } from './storage/index.js';
|
|
6
|
+
import { getCurrentDynamicItems } from './useAsyncDynamic.js';
|
|
7
|
+
import SettingOutlined from '../node_modules/@ant-design/icons/es/icons/SettingOutlined.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* AsyncDynamicSetting 组件
|
|
11
|
+
* 支持使用 localStorage 或 IndexedDB 存储动态配置
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```tsx
|
|
15
|
+
* // 使用 localStorage (默认)
|
|
16
|
+
* <AsyncDynamicSetting
|
|
17
|
+
* parentDynamicKey="parent_key"
|
|
18
|
+
* dynamicKey="child_key"
|
|
19
|
+
* defaultList={list}
|
|
20
|
+
* onCurrentListChange={handleChange}
|
|
21
|
+
* />
|
|
22
|
+
*
|
|
23
|
+
* // 使用 IndexedDB
|
|
24
|
+
* <AsyncDynamicSetting
|
|
25
|
+
* parentDynamicKey="parent_key"
|
|
26
|
+
* dynamicKey="child_key"
|
|
27
|
+
* defaultList={list}
|
|
28
|
+
* storageConfig={{ type: 'indexedDB' }}
|
|
29
|
+
* onCurrentListChange={handleChange}
|
|
30
|
+
* onStorageReady={(ready) => console.log('Ready:', ready)}
|
|
31
|
+
* />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
var AsyncDynamicSetting = function (props, ref) {
|
|
35
|
+
var dynamicKey = props.dynamicKey, parentDynamicKey = props.parentDynamicKey, defaultList = props.defaultList, children = props.children, title = props.title, onCurrentListChange = props.onCurrentListChange, hiddenOperationIcon = props.hiddenOperationIcon, isMore = props.isMore, isFixed = props.isFixed, isDimensionDynamic = props.isDimensionDynamic, storageConfig = props.storageConfig, onStorageReady = props.onStorageReady;
|
|
36
|
+
// 内部初始list
|
|
37
|
+
var _a = useState(defaultList), list = _a[0], setList = _a[1];
|
|
38
|
+
var drawerRef = useRef({});
|
|
39
|
+
// 创建存储适配器
|
|
40
|
+
var adapter = React__default.useMemo(function () { return createStorageAdapter(storageConfig); }, [storageConfig]);
|
|
41
|
+
useImperativeHandle(ref, function () {
|
|
42
|
+
return {
|
|
43
|
+
// 获取当前列配置信息
|
|
44
|
+
getCurrentDynamicList: function (list) {
|
|
45
|
+
return getCurrentDynamicItems(adapter, dynamicKey, parentDynamicKey, list);
|
|
46
|
+
},
|
|
47
|
+
// 重置list
|
|
48
|
+
setList: setList,
|
|
49
|
+
// 开启动态列配置
|
|
50
|
+
setVisible: function (visible) {
|
|
51
|
+
var _a;
|
|
52
|
+
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.setVisible(visible);
|
|
53
|
+
},
|
|
54
|
+
// 外部更新数据
|
|
55
|
+
updateList: function (list) {
|
|
56
|
+
var _a;
|
|
57
|
+
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.onSure(list);
|
|
58
|
+
},
|
|
59
|
+
// 重置数据
|
|
60
|
+
resetList: function () {
|
|
61
|
+
var _a;
|
|
62
|
+
(_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.onReset();
|
|
63
|
+
},
|
|
64
|
+
// 判断是否已准备就绪
|
|
65
|
+
isReady: function () {
|
|
66
|
+
var _a, _b, _c;
|
|
67
|
+
return (_c = (_b = (_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.isReady) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : false;
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
}, [adapter, dynamicKey, parentDynamicKey]);
|
|
71
|
+
return Array.isArray(list) && list.length > 0 ? (jsxs("div", __assign({ className: "ztxk-dynamic-setting" }, { children: [hiddenOperationIcon ? null : (jsx("div", __assign({ onClick: function () { var _a; return (_a = drawerRef.current) === null || _a === void 0 ? void 0 : _a.setVisible(true); } }, { children: children ? (children) : (jsx(SettingOutlined, { style: { fontSize: 18, color: "#768696" } })) }))), jsx(AsyncDynamicDrawer, { list: list, dynamicKey: dynamicKey, parentDynamicKey: parentDynamicKey, ref: drawerRef, title: title, onCurrentListChange: onCurrentListChange, isFixed: isFixed, isMore: isMore, isDimensionDynamic: isDimensionDynamic, storageConfig: storageConfig, onStorageReady: onStorageReady })] }))) : null;
|
|
72
|
+
};
|
|
73
|
+
AsyncDynamicSetting.displayName = "ZTXK_WEBUI_AsyncDynamicSetting";
|
|
74
|
+
var AsyncDynamicSetting$1 = memo(forwardRef(AsyncDynamicSetting));
|
|
75
|
+
|
|
76
|
+
export { AsyncDynamicSetting$1 as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import AsyncDynamicSetting from './asyncDynamicSetting.js';
|
|
2
|
+
export { createStorageAdapter } from './storage/index.js';
|
|
3
|
+
export { LocalStorageAdapter } from './storage/localStorageAdapter.js';
|
|
4
|
+
export { IndexedDBAdapter } from './storage/indexedDBAdapter.js';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
export { AsyncDynamicSetting as default };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
interface IDynamicItem {
|
|
4
|
+
key: string;
|
|
5
|
+
label?: React__default.ReactNode;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
checked?: boolean;
|
|
8
|
+
children?: IDynamicItem[];
|
|
9
|
+
indexs?: number[];
|
|
10
|
+
filter?: IFilter;
|
|
11
|
+
isDimension?: boolean;
|
|
12
|
+
dimensionPriority?: number;
|
|
13
|
+
/** 维度优先级分组,同组内遵循 dimensionPriority,跨组不比较 */
|
|
14
|
+
dimensionGroup?: string;
|
|
15
|
+
dimensionExclusive?: string;
|
|
16
|
+
isDimensionSum?: boolean;
|
|
17
|
+
[props: string]: any;
|
|
18
|
+
}
|
|
19
|
+
interface IFilter {
|
|
20
|
+
input?: string;
|
|
21
|
+
checkbox?: React__default.Key[];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 存储类型
|
|
25
|
+
*/
|
|
26
|
+
type StorageType = "localStorage" | "indexedDB";
|
|
27
|
+
/**
|
|
28
|
+
* 存储配置
|
|
29
|
+
*/
|
|
30
|
+
interface IStorageConfig {
|
|
31
|
+
/** 存储类型 */
|
|
32
|
+
type: StorageType;
|
|
33
|
+
/** IndexedDB 数据库名称 (仅当 type='indexedDB' 时有效) */
|
|
34
|
+
dbName?: string;
|
|
35
|
+
/** IndexedDB 存储名称 (仅当 type='indexedDB' 时有效) */
|
|
36
|
+
storeName?: string;
|
|
37
|
+
}
|
|
38
|
+
interface IAsyncDynamicSettingProps {
|
|
39
|
+
parentDynamicKey: string;
|
|
40
|
+
dynamicKey: string;
|
|
41
|
+
defaultList: IDynamicItem[];
|
|
42
|
+
onCurrentListChange?: (currentList: IDynamicItem[]) => void;
|
|
43
|
+
children?: JSX.Element;
|
|
44
|
+
title?: string;
|
|
45
|
+
hiddenOperationIcon?: boolean;
|
|
46
|
+
isMore?: boolean;
|
|
47
|
+
isFixed?: boolean;
|
|
48
|
+
isDimensionDynamic?: boolean;
|
|
49
|
+
storageConfig?: IStorageConfig;
|
|
50
|
+
onStorageReady?: (isReady: boolean) => void;
|
|
51
|
+
}
|
|
52
|
+
interface IAsyncDynamicDrawerProps {
|
|
53
|
+
list: IDynamicItem[];
|
|
54
|
+
onCurrentListChange?: (currentList: IDynamicItem[]) => void;
|
|
55
|
+
dynamicKey: string;
|
|
56
|
+
parentDynamicKey: string;
|
|
57
|
+
title?: string;
|
|
58
|
+
isMore?: boolean;
|
|
59
|
+
isFixed?: boolean;
|
|
60
|
+
isDimensionDynamic?: boolean;
|
|
61
|
+
isSearch?: boolean;
|
|
62
|
+
storageConfig?: IStorageConfig;
|
|
63
|
+
onStorageReady?: (isReady: boolean) => void;
|
|
64
|
+
}
|
|
65
|
+
interface IRef {
|
|
66
|
+
getCurrentDynamicList: (list: IDynamicItem[]) => Promise<IDynamicItem[]>;
|
|
67
|
+
setList: React__default.Dispatch<React__default.SetStateAction<IDynamicItem[]>>;
|
|
68
|
+
setVisible: (v: boolean) => void;
|
|
69
|
+
updateList: (list: any) => void;
|
|
70
|
+
resetList: () => void;
|
|
71
|
+
isReady?: () => boolean;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export { IAsyncDynamicDrawerProps, IAsyncDynamicSettingProps, IDynamicItem, IFilter, IRef, IStorageConfig, StorageType };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { __assign } from '../_virtual/_tslib.js';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { memo, useState } from 'react';
|
|
4
|
+
import { useLatest } from 'ahooks';
|
|
5
|
+
import { Radio, Switch, Dropdown } from 'antd';
|
|
6
|
+
import MenuOutlined from '../node_modules/@ant-design/icons/es/icons/MenuOutlined.js';
|
|
7
|
+
|
|
8
|
+
var MoreConfig = function (_a) {
|
|
9
|
+
var fixed = _a.fixed, onChange = _a.onChange, isFixed = _a.isFixed, isSum = _a.isSum, isDimensionSum = _a.isDimensionSum;
|
|
10
|
+
var onChangeLastestRef = useLatest(onChange);
|
|
11
|
+
var _b = useState(false), open = _b[0], setOpen = _b[1];
|
|
12
|
+
var _c = useState(fixed), fixedValue = _c[0], setFixedValue = _c[1];
|
|
13
|
+
var onFixedChange = function (e) {
|
|
14
|
+
setFixedValue(e.target.value);
|
|
15
|
+
};
|
|
16
|
+
var _d = useState(isDimensionSum || false), sumChecked = _d[0], setSumChecked = _d[1];
|
|
17
|
+
var onSumChange = function (checked) {
|
|
18
|
+
setSumChecked(checked);
|
|
19
|
+
};
|
|
20
|
+
var fixedItem = {
|
|
21
|
+
label: (jsxs("div", { children: ["\u56FA\u5B9A\uFF1A", jsxs(Radio.Group, __assign({ name: "dynamic-fixed", value: fixedValue, onChange: onFixedChange, optionType: "button", buttonStyle: "solid" }, { children: [jsx(Radio, __assign({ value: "left" }, { children: "\u5DE6" })), jsx(Radio, __assign({ value: "right" }, { children: "\u53F3" })), jsx(Radio, __assign({ value: "" }, { children: "\u65E0" }))] }))] })),
|
|
22
|
+
key: "0",
|
|
23
|
+
};
|
|
24
|
+
var items = [];
|
|
25
|
+
if (isFixed) {
|
|
26
|
+
items.push(fixedItem);
|
|
27
|
+
}
|
|
28
|
+
if (isSum) {
|
|
29
|
+
items.push({
|
|
30
|
+
label: (jsxs("div", { children: ["\u5408\u8BA1\uFF1A", jsx(Switch, { checked: sumChecked, onChange: onSumChange })] })),
|
|
31
|
+
key: "1",
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return (jsx(Dropdown, __assign({ menu: { items: items }, trigger: ["click"], open: open, onOpenChange: function (open) {
|
|
35
|
+
setOpen(open);
|
|
36
|
+
if (!open) {
|
|
37
|
+
onChangeLastestRef.current &&
|
|
38
|
+
onChangeLastestRef.current({
|
|
39
|
+
fixed: fixedValue,
|
|
40
|
+
isDimensionSum: sumChecked,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}, placement: "bottomLeft", arrow: true, overlayClassName: "ztxk-dynamic--more--drop" }, { children: jsx(MenuOutlined, { className: "ztxk-dynamic--more" }) })));
|
|
44
|
+
};
|
|
45
|
+
var MoreConfig$1 = memo(MoreConfig);
|
|
46
|
+
|
|
47
|
+
export { MoreConfig$1 as default };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 异步存储适配器接口
|
|
3
|
+
* 统一使用异步 API,无论底层是 localStorage 还是 IndexedDB
|
|
4
|
+
*/
|
|
5
|
+
interface IStorageAdapter {
|
|
6
|
+
/**
|
|
7
|
+
* 获取存储项
|
|
8
|
+
* @param key 存储键
|
|
9
|
+
* @returns 存储的值,如果不存在则返回 null
|
|
10
|
+
*/
|
|
11
|
+
getItem(key: string): Promise<string | null>;
|
|
12
|
+
/**
|
|
13
|
+
* 设置存储项
|
|
14
|
+
* @param key 存储键
|
|
15
|
+
* @param value 要存储的值
|
|
16
|
+
*/
|
|
17
|
+
setItem(key: string, value: string): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* 移除存储项
|
|
20
|
+
* @param key 存储键
|
|
21
|
+
*/
|
|
22
|
+
removeItem(key: string): Promise<void>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export { IStorageAdapter };
|