发布新版
This commit is contained in:
@@ -45,12 +45,14 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
.layui-hide{display: none !important;}
|
||||
|
||||
/** 图标字体 **/
|
||||
@font-face {font-family: 'layui-icon';
|
||||
src: url('../font/iconfont.eot?v=240');
|
||||
src: url('../font/iconfont.eot?v=240#iefix') format('embedded-opentype'),
|
||||
url('../font/iconfont.svg?v=240#iconfont') format('svg'),
|
||||
url('../font/iconfont.woff?v=240') format('woff'),
|
||||
url('../font/iconfont.ttf?v=240') format('truetype');
|
||||
@font-face {
|
||||
font-family: 'layui-icon';
|
||||
src: url('../font/iconfont.eot?v=250');
|
||||
src: url('../font/iconfont.eot?v=250#iefix') format('embedded-opentype'),
|
||||
url('../font/iconfont.woff2?v=250') format('woff2'),
|
||||
url('../font/iconfont.woff?v=250') format('woff'),
|
||||
url('../font/iconfont.ttf?v=250') format('truetype'),
|
||||
url('../font/iconfont.svg?v=250#layui-icon') format('svg');
|
||||
}
|
||||
|
||||
.layui-icon{
|
||||
@@ -209,8 +211,12 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
.layui-icon-screen-restore:before{content:"\e758";}
|
||||
.layui-icon-cols:before{content:"\e610";}
|
||||
.layui-icon-export:before{content:"\e67d";}
|
||||
.layui-icon-print:before {content:"\e66d";}
|
||||
.layui-icon-slider:before {content: "\e714";}
|
||||
.layui-icon-print:before{content:"\e66d";}
|
||||
.layui-icon-slider:before{content: "\e714";}
|
||||
|
||||
.layui-icon-addition:before{content: "\e624";}
|
||||
.layui-icon-subtraction:before{content: "\e67e";}
|
||||
.layui-icon-service:before{content: "\e626";}
|
||||
|
||||
/* 基本布局 */
|
||||
.layui-main{position: relative; width: 1140px; margin: 0 auto;}
|
||||
@@ -223,7 +229,7 @@ a cite{font-style: normal; *cursor:pointer;}
|
||||
/* 后台框架大布局 */.layui-layout-body{overflow: hidden;}
|
||||
.layui-layout-admin .layui-header{background-color: #23262E;}
|
||||
.layui-layout-admin .layui-side{top: 60px; width: 200px; overflow-x: hidden;}
|
||||
.layui-layout-admin .layui-body{top: 60px; bottom: 44px;}
|
||||
.layui-layout-admin .layui-body{position: fixed; top: 60px; bottom: 44px;}
|
||||
.layui-layout-admin .layui-main{width: auto; margin: 0 15px;}
|
||||
.layui-layout-admin .layui-footer{position: fixed; left: 200px; right: 0; bottom: 0; height: 44px; line-height: 44px; padding: 0 15px; background-color: #eee;}
|
||||
.layui-layout-admin .layui-logo{position: absolute; left: 0; top: 0; width: 200px; height: 100%; line-height: 60px; text-align: center; color: #009688; font-size: 16px;}
|
||||
@@ -813,6 +819,7 @@ hr, .layui-timeline-item:before{background-color: #e6e6e6;}
|
||||
.layui-table-view .layui-table td{padding: 5px 0; border-top: none; border-left: none;}
|
||||
.layui-table-view .layui-table th.layui-unselect .layui-table-cell span{cursor: pointer;}
|
||||
.layui-table-view .layui-table td{cursor: default;}
|
||||
.layui-table-view .layui-table td[data-edit="text"]{cursor: text;}
|
||||
.layui-table-view .layui-form-checkbox[lay-skin="primary"] i{width: 18px; height: 18px;}
|
||||
.layui-table-view .layui-form-radio{line-height: 0; padding: 0;}
|
||||
.layui-table-view .layui-form-radio>i{margin: 0; font-size: 20px;}
|
||||
@@ -922,22 +929,6 @@ body .layui-table-tips .layui-layer-content{background: none; padding: 0; box-sh
|
||||
.layui-upload-wrap{position: relative; display: inline-block; vertical-align: middle;}
|
||||
.layui-upload-wrap .layui-upload-file{display: block!important; position: absolute; left: 0; top: 0; z-index: 10; font-size: 100px; width: 100%; height: 100%; opacity: .01; filter: Alpha(opacity=1); cursor: pointer;}
|
||||
|
||||
/** 树组件(重写中) **/
|
||||
.layui-tree{line-height: 26px;}
|
||||
.layui-tree li{text-overflow: ellipsis; overflow:hidden; white-space: nowrap;}
|
||||
.layui-tree li a,
|
||||
.layui-tree li .layui-tree-spread{display: inline-block; vertical-align: top; height: 26px; *display: inline; *zoom:1; cursor: pointer;}
|
||||
.layui-tree li a{font-size: 0;}
|
||||
.layui-tree li a i{font-size: 16px;}
|
||||
.layui-tree li a cite{padding: 0 6px; font-size: 14px; font-style: normal;}
|
||||
.layui-tree li i{padding-left: 6px; color: #333; -moz-user-select: none;}
|
||||
.layui-tree li .layui-tree-check{font-size: 13px;}
|
||||
.layui-tree li .layui-tree-check:hover{color: #009E94;}
|
||||
.layui-tree li ul{display: none; margin-left: 20px;}
|
||||
.layui-tree li .layui-tree-enter{line-height: 24px; border: 1px dotted #000;}
|
||||
.layui-tree-drag{display: none; position: absolute; left: -666px; top: -666px; background-color: #f2f2f2; padding: 5px 10px; border: 1px dotted #000; white-space: nowrap}
|
||||
.layui-tree-drag i{padding-right: 5px;}
|
||||
|
||||
/** 导航菜单 **/
|
||||
.layui-nav{position: relative; padding: 0 20px; background-color: #393D49; color: #fff; border-radius: 2px; font-size: 0; box-sizing: border-box;}
|
||||
.layui-nav *{font-size: 14px;}
|
||||
@@ -1225,6 +1216,63 @@ body .layui-util-face .layui-layer-content{padding:0; background-color:#fff; co
|
||||
.layui-slider > span{margin-left: 8px;}
|
||||
}
|
||||
|
||||
/** 穿梭框 By star1029 **/
|
||||
.layui-transfer{display: inline-block; position: relative; width: 480px; height: 360px; background-color: #FFF; text-align: left;}
|
||||
.layui-transfer-left,.layui-transfer-right{display: inline-block; vertical-align: middle; position: relative; width: 200px; height: 340px; border: 1px solid #DDD;}
|
||||
.layui-transfer-topTitle{padding-left: 12px; height: 36px; border-bottom: 1px solid #DDD; line-height: 36px;}
|
||||
.layui-transfer-btn{display: inline-block; vertical-align: middle; width: 70px; height: 90px; text-align: center;}
|
||||
.layui-transfer-btn .layui-btn{margin-left: 0; padding: 0 10px; height: 30px; line-height: 30px; background-color: #5FB878; border-color: #5FB878;}
|
||||
.layui-transfer-btn .layui-btn i{margin-left: 4px; font-size: 14px; color: #FFF;}
|
||||
.layui-transfer-btn .layui-btn.layui-btn-disabled{background-color: #FBFBFB; border-color: #DDD;}
|
||||
.layui-transfer-btn .layui-btn.layui-btn-disabled i{color: #CCC;}
|
||||
.layui-transfer-btnRight{margin-bottom: 30px;}
|
||||
.layui-transfer-search{position: relative; height: 36px; line-height: 36px; border-bottom: 1px solid #DDD; text-align: center;}
|
||||
.layui-transfer-search .layui-input{display: inline-block; width: 88%; padding-left: 30px; height: 28px; line-height: 28px;}
|
||||
.layui-transfer-searchI{position: absolute; left: 20px;}
|
||||
.layui-transfer-data{height: 303px; overflow: auto;}
|
||||
.layui-transfer-data.short{height: 266px;}
|
||||
.layui-transfer-data li{position: relative; padding-left: 12px; height: 30px; line-height: 30px;}
|
||||
.layui-transfer-data .layui-form-checkbox[lay-skin="primary"]{width: 100%;}
|
||||
.layui-transfer-data li:hover{background-color: #EEE;}
|
||||
.layui-transfer-data::-webkit-scrollbar{width: 5px; background-color: #EEE;}
|
||||
.layui-transfer-data::-webkit-scrollbar-thumb{background-color: #DDD;}
|
||||
|
||||
/** 树组件 By star1029 **/
|
||||
.layui-tree{line-height: 22px;}
|
||||
.layui-tree-set{width: 100%; position: relative;}
|
||||
.layui-tree-pack{display: none; padding-left: 20px; position: relative;}
|
||||
.layui-tree-line .layui-tree-pack{padding-left: 27px;}
|
||||
.layui-tree-line .layui-tree-set .layui-tree-set:after{content: ''; position: absolute; top: 14px; left: -9px; width: 17px; height: 0; border-top: 1px dotted #c0c4cc;}
|
||||
.layui-tree-entry{position: relative; padding: 3px 0; height: 20px;}
|
||||
.layui-tree-entry:hover{background-color: #eee;}
|
||||
.layui-tree-line .layui-tree-entry:hover{background-color: rgba(0,0,0,0);}
|
||||
.layui-tree-line .layui-tree-entry:hover .layui-tree-txt{color: #999; text-decoration: underline; transition: 0.3s;}
|
||||
.layui-tree-main{cursor: pointer;}
|
||||
.layui-tree-line .layui-tree-set:before{content: ''; position: absolute; top: 0; left: -9px; width: 0; height: 100%; border-left: 1px dotted #c0c4cc;}
|
||||
.layui-tree-line .layui-tree-set.layui-tree-setLineShort:before{height: 13px;}
|
||||
.layui-tree-line .layui-tree-set.layui-tree-setHide:before{height: 0;}
|
||||
.layui-tree-iconClick{display: inline-block; vertical-align: middle; position: relative; height: 20px; line-height: 20px; margin: 0 10px; color: #c0c4cc;}
|
||||
.layui-tree-icon{height: 14px; line-height: 14px; width: 14px; text-align: center; border: 1px solid #c0c4cc;}
|
||||
.layui-tree-iconClick .layui-icon{font-size: 18px;}
|
||||
.layui-tree-icon .layui-icon{font-size: 12px; color: #666;}
|
||||
.layui-tree-iconArrow{padding: 0 5px;}
|
||||
.layui-tree-iconArrow:after{content: ''; position: absolute; left: 4px; top: 3px; z-index: 100; width: 0; height: 0; border-width: 5px; border-style: solid; border-color: transparent transparent transparent #c0c4cc; transition: 0.5s;}
|
||||
.layui-tree-iconArrow.hide:after{border-color: transparent;}
|
||||
.layui-tree-spread>.layui-tree-entry>.layui-tree-iconClick>.layui-tree-iconArrow:after{transform: rotate(90deg) translate(3px, 4px);}
|
||||
.layui-tree-txt{display: inline-block; vertical-align: middle; color: #555;}
|
||||
.layui-tree-search{margin-bottom: 15px; color: #666;}
|
||||
.layui-tree-btnGroup{display: none; position: absolute; top: 0; right: 0;}
|
||||
.layui-tree-btnGroup .layui-btn{padding: 0 7px; border: none; background-color: rgba(0,0,0,0);}
|
||||
.layui-tree-btnGroup .layui-btn:first-child{border: none;}
|
||||
.layui-tree-entry:hover .layui-tree-btnGroup{display: block;}
|
||||
.layui-tree-editInput{position: absolute; left: 30px; z-index: 99; height: 20px; line-height: 20px; border: none; background-color: rgba(0,0,0,0);}
|
||||
.layui-form .layui-tree-editInput{left: 58px;}
|
||||
.layui-tree-line .layui-tree-editInput{left: 38px;}
|
||||
.layui-tree-line.layui-form .layui-tree-editInput{left: 66px;}
|
||||
.layui-tree-emptyText{text-align: center; color: #999;}
|
||||
|
||||
|
||||
|
||||
|
||||
/** 动画 **/
|
||||
.layui-anim{-webkit-animation-duration: 0.3s; animation-duration: 0.3s; -webkit-animation-fill-mode: both; animation-fill-mode: both;}
|
||||
|
||||
Binary file not shown.
@@ -344,6 +344,9 @@ Created by iconfont
|
||||
<glyph glyph-name="rmb" unicode="" d="M511.998465 896C229.23338 896 0.004605 666.769178 0.004605 384.001023c0-282.773272 229.227752-512.001023 511.99386-512.001023 282.769178 0 511.994883 229.227752 511.994883 512.001023C1023.994372 666.769178 794.767644 896 511.998465 896zM511.998465-91.59690499999999c-262.660188 0-475.589742 212.930577-475.589742 475.597929 0 262.663258 212.929554 475.594859 475.589742 475.594859 262.663258 0 475.590765-212.9316 475.590765-475.594859C987.590254 121.33469500000001 774.662747-91.59690499999999 511.998465-91.59690499999999zM738.742652 301.137781L544.432155 301.137781l0 69.780273 194.310497 0c17.835204 0 32.249495 14.43885 32.249495 32.220842 0 17.784038-14.414291 32.19526-32.249495 32.19526L589.7462 435.334155l149.620669 209.579249c8.916067 15.397688 3.63069 35.099403-11.82021 43.988864-15.398712 8.891508-35.097356 3.629667-44.017516-11.793604L512.187777 437.098335 340.84334 677.108664c-8.864902 15.423271-28.617781 20.685111-44.016493 11.793604-15.395642-8.889461-20.685111-28.590152-11.82021-43.988864l149.622716-209.579249L285.628808 435.334155c-17.781992 0-32.245402-14.411221-32.245402-32.19526 0-17.781992 14.46341-32.220842 32.245402-32.220842l194.310497 0 0-69.780273L285.628808 301.137781c-17.781992 0-32.245402-14.413268-32.245402-32.19526s14.46341-32.220842 32.245402-32.220842l194.310497 0 0-132.435265c0-17.780969 14.46341-32.19526 32.248472-32.19526 17.835204 0 32.245402 14.414291 32.245402 32.19526L544.433178 236.72065499999997l194.310497 0c17.835204 0 32.249495 14.43885 32.249495 32.220842S756.577856 301.137781 738.742652 301.137781" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="addition" unicode="" d="M544 768L480 768 480 416 128 416 128 352 480 352 480 0 544 0 544 352 895.936 352 895.936 416 544 416Z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="home" unicode="" d="M824.084343-40.42033900000001H232.898863c-74.604138 0-85.85232 28.334325-85.852321 49.997718l-0.584307 5.314029V447.645552h48.806589v-402.916582c0-25.547863 13.548574-36.343743 37.629015-36.343743h568.020898c25.928532 0 27.978215 6.220678 27.978215 37.84391V447.585177l48.806589 0.118704c0.022513-14.346753 0-382.76666 0-433.098999 0-38.130436-12.726859-54.765301-51.858088-54.765301l-1.76111-0.25992zM1012.470921 493.103884C849.773422 615.120868 687.101505 737.137853 524.404006 859.153814c-6.207375 4.659113-18.433838 4.659113-24.641213 0C337.077573 737.137853 174.393377 615.120868 11.696902 493.103884c-24.856108-18.635429-0.572028-61.044308 24.642236-42.13361A15995638.709915 15995638.709915 0 0 1 512.025071 807.737794c0.988514-0.715291 1.644453-1.144056 2.823302-2.037403 18.040888-13.524015 36.057217-27.036773 54.073546-40.560788 58.291614-43.718711 116.583229-87.437421 174.874843-131.143852 81.33647-61.008492 162.696476-122.015961 244.033969-183.024454 25.212218-18.911722 49.496298 23.497157 24.64019 42.132587z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
@@ -452,6 +455,9 @@ Created by iconfont
|
||||
<glyph glyph-name="vercode" unicode="" d="M513.807059-128C351.171765-128 58.428235 126.19294100000002 54.211765 376.16941199999997V662.287059a93.364706 93.364706 0 0 0 81.317647 88.545882 570.428235 570.428235 0 0 1 163.237647 40.357647A393.336471 393.336471 0 0 1 446.945882 872.508235a101.797647 101.797647 0 0 0 120.470589 5.421177A629.458824 629.458824 0 0 1 716.8 792.395294a1255.303529 1255.303529 0 0 1 169.863529-38.550588 98.785882 98.785882 0 0 0 79.510589-90.955294 2911.171765 2911.171765 0 0 0-3.011765-291.538824C924.611765 49.09176500000001 672.828235-128 513.807059-128z m0 963.764706a39.152941 39.152941 0 0 1-24.696471-7.830588A438.512941 438.512941 0 0 0 319.247059 734.569412a608.376471 608.376471 0 0 0-180.705883-43.369412 33.731765 33.731765 0 0 1-24.094117-30.117647v-283.708235C118.663529 155.10588199999995 389.722353-67.76470600000005 513.807059-67.76470600000005s354.183529 148.178824 391.529412 444.536471c9.035294 175.887059 0 281.901176 0 283.105882a38.550588 38.550588 0 0 1-29.515295 33.731765 1287.830588 1287.830588 0 0 0-180.705882 41.562353A676.442353 676.442353 0 0 0 536.094118 829.741176a37.345882 37.345882 0 0 1-24.094118 6.02353zM784.865882 479.171765L487.905882 198.47529399999996a40.357647 40.357647 0 0 0-49.392941-4.818823l-7.830588 6.625882-161.430588 171.068235a40.357647 40.357647 0 1 0 60.235294 55.416471l133.722353-141.552941 267.444706 252.988235a40.357647 40.357647 0 1 0 55.41647-60.235294" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="service" unicode="" d="M895.44035 502.006246A31.340412 31.340412 0 0 1 895.44035 512.2398499999999 383.76015 383.76015 0 0 1 127.92005 512.2398499999999a31.340412 31.340412 0 0 1 0-10.233604 167.575265 167.575265 0 0 1-127.92005-159.900062V320.359775a168.854466 168.854466 0 0 1 140.712055-163.098064A351.140537 351.140537 0 0 1 401.029357-63.400375000000054h5.756402a95.940037 95.940037 0 1 1 0 63.960025 287.180512 287.180512 0 0 0-195.717677 156.062461h35.817614A40.294816 40.294816 0 0 1 287.820112 192.43972499999995V468.747033a40.294816 40.294816 0 0 1-40.934416 39.015615H191.880075A30.061212 30.061212 0 0 1 191.880075 512.2398499999999a319.800125 319.800125 0 0 0 639.60025 0 30.061212 30.061212 0 0 1 0-3.837601h-55.005622a40.294816 40.294816 0 0 1-40.934416-39.015616V192.43972499999995a40.294816 40.294816 0 0 1 40.934416-39.015615h72.274829A170.773267 170.773267 0 0 1 1023.3604 320.359775v21.746409a167.575265 167.575265 0 0 1-127.92005 159.900062zM496.329794 0.5596500000000333a31.980012 31.980012 0 1 0-31.980013-31.980012 31.980012 31.980012 0 0 0 31.980013 31.980012zM223.860087 220.582136h-49.249219A106.813242 106.813242 0 0 0 63.960025 320.359775v21.746409a106.813242 106.813242 0 0 0 110.650843 102.33604h49.249219zM959.400375 320.359775a106.813242 106.813242 0 0 0-110.650843-102.33604h-49.24922V444.442224h49.24922A106.813242 106.813242 0 0 0 959.400375 342.106184zM650.473454 750.171143l-23.665209 8.314803a31.980012 31.980012 0 0 1-19.827608-63.960025l18.548407-7.035602a31.980012 31.980012 0 1 1 24.94441 58.843223zM305.089319 674.698314A31.980012 31.980012 0 0 1 358.17614 640.1599 202.113679 202.113679 0 0 0 511.6802 716.91193a31.980012 31.980012 0 0 1 0 63.960025 263.515303 263.515303 0 0 1-206.590881-106.173641z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="cellphone" unicode="" d="M785.066667 896H238.933333a102.4 102.4 0 0 1-102.4-102.4v-819.2a102.4 102.4 0 0 1 102.4-102.4h546.133334a102.4 102.4 0 0 1 102.4 102.4V793.6a102.4 102.4 0 0 1-102.4 102.4zM238.933333 827.733333h546.133334a34.133333 34.133333 0 0 0 34.133333-34.133333v-648.533333H204.8V793.6a34.133333 34.133333 0 0 0 34.133333 34.133333z m546.133334-887.466666H238.933333a34.133333 34.133333 0 0 0-34.133333 34.133333v102.4h614.4v-102.4a34.133333 34.133333 0 0 0-34.133333-34.133333zM512 8.53333299999997m-34.133333 0a34.133333 34.133333 0 1 1 68.266666 0 34.133333 34.133333 0 1 1-68.266666 0ZM426.666667 725.333333h170.666666a17.066667 17.066667 0 0 1 0 34.133334h-170.666666a17.066667 17.066667 0 0 1 0-34.133334z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
@@ -467,6 +473,9 @@ Created by iconfont
|
||||
<glyph glyph-name="slider" unicode="" d="M228.7 683.9v-66.7H112v66.7h116.7z m333.2-266.6v-66.7H112v66.7h449.9zM295.4 150.60000000000002V84H112v66.7h183.4v-0.1z m116.6 600c9 0 16.8-3.3 23.5-9.9 6.5-6.5 9.9-14.5 9.9-23.5v-133.3c0-9-3.3-16.8-9.9-23.5-6.5-6.5-14.5-9.9-23.5-9.9H278.8c-9 0-16.8 3.3-23.5 9.9-6.5 6.5-9.9 14.3-9.9 23.5V717.1c0 9 3.3 16.8 9.9 23.5 6.5 6.5 14.3 9.9 23.5 9.9h133.3v0.1h-0.1z m66.7-533.3c9 0 16.8-3.3 23.5-9.9 6.5-6.5 9.9-14.5 9.9-23.5v-133.3c0-9-3.3-16.8-9.9-23.5-6.5-6.5-14.5-9.9-23.5-9.9H345.3c-9 0-16.8 3.3-23.5 9.9-6.5 6.5-9.9 14.5-9.9 23.5V183.89999999999998c0 9 3.3 16.8 9.9 23.5 6.5 6.5 14.3 9.9 23.5 9.9h133.4v0.1zM912 683.9v-66.7H462.1v66.7H912z m0-533.3V84H528.6v66.7h383.3v-0.1h0.1zM745.2 483.9c9 0 16.8-3.3 23.5-9.9 6.5-6.5 9.9-14.5 9.9-23.5v-133.3c0-9-3.3-16.8-9.9-23.5-6.5-6.5-14.5-9.9-23.5-9.9H612c-9 0-16.8 3.3-23.5 9.9-6.5 6.5-9.9 14.3-9.9 23.5V450.6c0 9 3.3 16.8 9.9 23.5 6.5 6.5 14.5 9.9 23.5 9.9l133.2-0.1zM912 417.3v-66.7H795.3v66.7H912z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
<glyph glyph-name="subtraction" unicode="" d="M785 348H239c-19.8 0-36 16.2-36 36s16.2 36 36 36h546c19.8 0 36-16.2 36-36s-16.2-36-36-36z" horiz-adv-x="1024" />
|
||||
|
||||
|
||||
|
||||
|
||||
</font>
|
||||
|
||||
|
Before Width: | Height: | Size: 274 KiB After Width: | Height: | Size: 276 KiB |
Binary file not shown.
Binary file not shown.
BIN
src/font/iconfont.woff2
Normal file
BIN
src/font/iconfont.woff2
Normal file
Binary file not shown.
@@ -163,6 +163,7 @@ layui.define('jquery', function(exports){
|
||||
,options = that.config;
|
||||
|
||||
if(!options.autoplay) return;
|
||||
clearInterval(that.timer);
|
||||
|
||||
that.timer = setInterval(function(){
|
||||
that.slide();
|
||||
|
||||
@@ -89,7 +89,7 @@ layui.define('layer', function(exports){
|
||||
itemElem[0].checked = value;
|
||||
} else if(type === 'radio') { //如果为单选框
|
||||
itemElem.each(function(){
|
||||
if(this.value === value ){
|
||||
if(this.value == value ){
|
||||
this.checked = true
|
||||
}
|
||||
});
|
||||
@@ -605,6 +605,10 @@ layui.define('layer', function(exports){
|
||||
var isTrue = isFn ? errorText = verify[thisVer](value, item) : !verify[thisVer][0].test(value);
|
||||
errorText = errorText || verify[thisVer][1];
|
||||
|
||||
if(thisVer === 'required'){
|
||||
errorText = othis.attr('lay-reqText') || errorText;
|
||||
}
|
||||
|
||||
//如果是必填项或者非空命中校验,则阻止提交,弹出提示
|
||||
if(isTrue){
|
||||
//提示层风格
|
||||
@@ -622,7 +626,14 @@ layui.define('layer', function(exports){
|
||||
} else {
|
||||
layer.msg(errorText, {icon: 5, shift: 6});
|
||||
}
|
||||
if(!device.android && !device.ios) item.focus(); //非移动设备自动定位焦点
|
||||
|
||||
//非移动设备自动定位焦点
|
||||
if(!device.android && !device.ios){
|
||||
setTimeout(function(){
|
||||
item.focus();
|
||||
}, 7);
|
||||
}
|
||||
|
||||
othis.addClass(DANGER);
|
||||
return stop = true;
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
}
|
||||
|
||||
return {
|
||||
reload: function(options){
|
||||
that.reload.call(that, options);
|
||||
reload: function(options, type){
|
||||
that.reload.call(that, options, type);
|
||||
}
|
||||
,setColsWidth: function(){
|
||||
that.setColsWidth.call(that);
|
||||
@@ -72,6 +72,17 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
return config || null;
|
||||
}
|
||||
|
||||
//解析自定义模板数据
|
||||
,parseTempData = function(item3, content, tplData, text){
|
||||
var str = item3.templet ? function(){
|
||||
return typeof item3.templet === 'function'
|
||||
? item3.templet(tplData)
|
||||
: laytpl($(item3.templet).html() || String(content) || '').render(tplData)
|
||||
}() : content;
|
||||
str = str || '';
|
||||
return text ? $('<div>'+ str +'</div>').text() : str;
|
||||
}
|
||||
|
||||
//字符常量
|
||||
,MOD_NAME = 'table', ELEM = '.layui-table', THIS = 'layui-this', SHOW = 'layui-show', HIDE = 'layui-hide', DISABLED = 'layui-disabled', NONE = 'layui-none'
|
||||
|
||||
@@ -627,11 +638,20 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
};
|
||||
|
||||
//表格完整重载
|
||||
Class.prototype.reload = function(options){
|
||||
var that = this;
|
||||
if(that.config.data && that.config.data.constructor === Array) delete that.config.data;
|
||||
that.config = $.extend({}, that.config, options);
|
||||
that.render();
|
||||
Class.prototype.reload = function(options, type){
|
||||
var that = this
|
||||
,optString = typeof options === 'string'
|
||||
,opts, typs;
|
||||
|
||||
opts = optString ? type : options;
|
||||
typs = optString ? options : type
|
||||
|
||||
opts = opts || {};
|
||||
|
||||
if(opts.data && opts.data.constructor === Array) delete that.config.data;
|
||||
that.config = $.extend(true, {}, that.config, opts);
|
||||
|
||||
typs === 'data' ? that.pullData(that.config.page.curr) : that.render();
|
||||
};
|
||||
|
||||
//页码
|
||||
@@ -701,7 +721,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
res[response.dataName] = options.data.concat().splice(startLimit, options.limit);
|
||||
res[response.countName] = options.data.length;
|
||||
|
||||
that.renderData(res, curr, options.data.length), sort();
|
||||
that.renderData(res, curr, (options.page && options.page.count) ? options.page : options.data.length), sort();
|
||||
that.setColsWidth();
|
||||
typeof options.done === 'function' && options.done(res, curr, res[response.countName]);
|
||||
}
|
||||
@@ -713,7 +733,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
table.eachCols(null, callback, that.config.cols);
|
||||
return that;
|
||||
};
|
||||
|
||||
|
||||
//数据渲染
|
||||
Class.prototype.renderData = function(res, curr, count, sort){
|
||||
var that = this
|
||||
@@ -728,7 +748,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
var thisCheckedRowIndex;
|
||||
if(!sort && that.sortKey){
|
||||
return that.sort(that.sortKey.field, that.sortKey.sort, true);
|
||||
}
|
||||
}
|
||||
layui.each(data, function(i1, item1){
|
||||
var tds = [], tds_fixed = [], tds_fixed_r = []
|
||||
,numbers = i1 + options.limit*(curr - 1) + 1; //序号
|
||||
@@ -800,11 +820,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
if(item3.toolbar){
|
||||
return laytpl($(item3.toolbar).html()||'').render(tplData);
|
||||
}
|
||||
return item3.templet ? function(){
|
||||
return typeof item3.templet === 'function'
|
||||
? item3.templet(tplData)
|
||||
: laytpl($(item3.templet).html() || String(content)).render(tplData)
|
||||
}() : content;
|
||||
return parseTempData(item3, content, tplData);
|
||||
}()
|
||||
,'</div></td>'].join('');
|
||||
|
||||
@@ -1045,7 +1061,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
if(hide){
|
||||
that.layInit && that.layInit.remove();
|
||||
delete that.layInit;
|
||||
that.layBox.find(ELEM_INIT).remove()
|
||||
that.layBox.find(ELEM_INIT).remove();
|
||||
} else {
|
||||
that.layInit = $(['<div class="layui-table-init">'
|
||||
,'<i class="layui-icon layui-icon-loading layui-icon"></i>'
|
||||
@@ -1317,12 +1333,13 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
,'a{color: #666; text-decoration:none;}'
|
||||
,'*.layui-hide{display: none}'
|
||||
,'</style>'].join('')
|
||||
,html = $(that.layHeader.html());
|
||||
,html = $(that.layHeader.html()); //输出表头
|
||||
|
||||
html.append(that.layMain.find('table').html());
|
||||
html.append(that.layMain.find('table').html()); //输出表体
|
||||
html.append(that.layTotal.find('table').html()) //输出合计行
|
||||
|
||||
html.find('th.layui-table-patch').remove();
|
||||
html.find('.layui-table-col-special').remove();
|
||||
html.find('th.layui-table-patch').remove(); //移除补丁
|
||||
html.find('.layui-table-col-special').remove(); //移除特殊列
|
||||
|
||||
printWin.document.write(style + html.prop('outerHTML'));
|
||||
printWin.document.close();
|
||||
@@ -1550,6 +1567,7 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
}).on('blur', '.'+ELEM_EDIT, function(){
|
||||
var templet
|
||||
,othis = $(this)
|
||||
,thisElem = this
|
||||
,field = othis.parent().data('field')
|
||||
,index = othis.parents('tr').eq(0).data('index')
|
||||
,data = table.cache[that.key][index];
|
||||
@@ -1562,10 +1580,10 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
return templet ? function(){
|
||||
return typeof templet === 'function'
|
||||
? templet(data)
|
||||
: laytpl($(templet).html() || this.value).render(data)
|
||||
: laytpl($(templet).html() || thisElem.value).render(data)
|
||||
}() : value;
|
||||
}(this.value));
|
||||
othis.parent().data('content', this.value);
|
||||
}(thisElem.value));
|
||||
othis.parent().data('content', thisElem.value);
|
||||
othis.remove();
|
||||
});
|
||||
|
||||
@@ -1851,13 +1869,13 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
i1 == 0 && dataTitle.push(item || '');
|
||||
});
|
||||
layui.each(table.clearCacheKey(item1), function(i2, item2){
|
||||
vals.push(item2);
|
||||
vals.push('"'+ (item2 || '') +'"');
|
||||
});
|
||||
} else {
|
||||
table.eachCols(id, function(i3, item3){
|
||||
if(item3.field && item3.type == 'normal' && !item3.hide){
|
||||
i1 == 0 && dataTitle.push(item3.title || '');
|
||||
vals.push(item1[item3.field]);
|
||||
vals.push('"'+ parseTempData(item3, item1[item3.field], item1, 'text') + '"');
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1890,14 +1908,14 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function(exports){
|
||||
};
|
||||
|
||||
//表格重载
|
||||
table.reload = function(id, options){
|
||||
options = options || {};
|
||||
|
||||
table.reload = function(id, options, type){
|
||||
var config = getThisTableConfig(id); //获取当前实例配置项
|
||||
if(!config) return;
|
||||
|
||||
if(options.data && options.data.constructor === Array) delete config.data;
|
||||
return table.render($.extend(true, {}, config, options));
|
||||
var that = thisTable.that[id];
|
||||
that.reload(options, type);
|
||||
|
||||
return thisTable.call(that);
|
||||
};
|
||||
|
||||
//核心入口
|
||||
|
||||
424
src/lay/modules/transfer.js
Normal file
424
src/lay/modules/transfer.js
Normal file
@@ -0,0 +1,424 @@
|
||||
/**
|
||||
|
||||
@Name:layui.transfer 穿梭框
|
||||
@Author:star1029
|
||||
@License:MIT
|
||||
|
||||
*/
|
||||
|
||||
layui.define('form', function(exports){
|
||||
"use strict";
|
||||
var form = layui.form
|
||||
,$ = layui.$
|
||||
|
||||
//外部接口
|
||||
,transfer = {
|
||||
config: {}
|
||||
,index: layui.transfer ? (layui.transfer.index + 10000) : 0
|
||||
|
||||
//设置全局项
|
||||
,set: function(options){
|
||||
var that = this;
|
||||
that.config = $.extend({}, that.config, options);
|
||||
return that;
|
||||
}
|
||||
|
||||
//事件监听
|
||||
,on: function(events, callback){
|
||||
return layui.onevent.call(this, MOD_NAME, events, callback);
|
||||
}
|
||||
}
|
||||
|
||||
//操作当前实例
|
||||
,thisTran = function(){
|
||||
var that = this
|
||||
,options = that.config;
|
||||
|
||||
return {
|
||||
getValue: function(){
|
||||
return that.getValue();
|
||||
}
|
||||
,config: options
|
||||
}
|
||||
}
|
||||
|
||||
//字符常量
|
||||
,MOD_NAME = 'transfer', ELEM_VIEW = 'layui-transfer', TRAN_LEFT = 'layui-transfer-left', TRAN_RIGHT = 'layui-transfer-right', TRAN_LEFT_LIST = 'layui-transfer-dataLeft'
|
||||
,TRAN_RIGHT_LIST = 'layui-transfer-dataRight' ,TRAN_BTN_LEFT = 'layui-transfer-btnLeft', TRAN_BTN_RIGHT = 'layui-transfer-btnRight', TRAN_BTN_DIS = 'layui-btn-disabled'
|
||||
|
||||
//构造器
|
||||
,Class = function(options){
|
||||
var that = this;
|
||||
that.index = ++transfer.index;
|
||||
that.config = $.extend({}, that.config, transfer.config, options);
|
||||
that.render();
|
||||
};
|
||||
|
||||
//默认配置
|
||||
Class.prototype.config = {
|
||||
title: ['列表一', '列表二']
|
||||
,data: [] //数据源
|
||||
,value: [] //选中的数据
|
||||
,showSearch: false //是否开启搜索
|
||||
,id: '' //唯一 ID 标识
|
||||
};
|
||||
|
||||
//穿梭框渲染
|
||||
Class.prototype.render = function(){
|
||||
var that = this
|
||||
,options = that.config
|
||||
,listLeft = '' ,listRight = '' , arr = [];
|
||||
|
||||
//格式转化
|
||||
if(typeof options.parseData == 'function'){
|
||||
layui.each(options.data, function(index, item){
|
||||
options.data[index] = options.parseData(item) || item;
|
||||
});
|
||||
};
|
||||
|
||||
//循环列表
|
||||
var num = 0 ,li = '',total1 = 0, total2 = 0;
|
||||
layui.each(options.data, function(index1, item1){
|
||||
num = 0;
|
||||
layui.each(options.value, function(index2, item2){
|
||||
if(item1.value == item2){
|
||||
num = 1;
|
||||
return true;
|
||||
};
|
||||
});
|
||||
li = '<li data-title="'+ item1.title +'"><input lay-skin="primary" type="checkbox" data-index="'+ index1 +'" name="'+ (num == 0 ? 'layTranLeftCheck' : 'layTranRightCheck') +'" title="'+ item1.title +'" value="'+ item1.value +'" class="layui-input" '+ (item1.disabled ? 'disabled' : '') +'></li>';
|
||||
if(num == 0){
|
||||
listLeft += li;
|
||||
total1 += item1.disabled ? 0 : 1;
|
||||
}else{
|
||||
listRight += li;
|
||||
total2 += item1.disabled ? 0 : 1;
|
||||
arr.push(index1);
|
||||
}
|
||||
});
|
||||
|
||||
var temp = ['<div class="layui-transfer layui-form" id="transfer-'+ options.id +'" lay-filter="LAY-Transfer-'+ that.index +'">'
|
||||
,'<div class="layui-transfer-left" data-total="'+ total1 +'">'
|
||||
,'<div class="layui-transfer-topTitle"><input lay-skin="primary" name="layTranLeftCheck" lay-filter="layTranLeftCheckAll" type="checkbox" class="layui-input" title="'+ options.title[0] +'"></div>'
|
||||
,function(){
|
||||
if(options.showSearch){
|
||||
return '<div class="layui-transfer-search"><input class="layui-input" placeholder="关键字搜索"><i class="layui-icon layui-icon-search layui-transfer-searchI"></i></div><ul class="layui-transfer-data layui-transfer-dataLeft short">';
|
||||
}else{
|
||||
return '<ul class="layui-transfer-data layui-transfer-dataLeft">';
|
||||
};
|
||||
return '';
|
||||
}()
|
||||
,listLeft + '</ul>'
|
||||
,'</div>'
|
||||
,'<div class="layui-transfer-btn">'
|
||||
,'<button class="layui-btn layui-btn-primary layui-transfer-btnRight layui-btn-disabled"><i class="layui-icon layui-icon-next"></i></button>'
|
||||
,'<button class="layui-btn layui-btn-primary layui-transfer-btnLeft layui-btn-disabled"><i class="layui-icon layui-icon-prev"></i></button></div>'
|
||||
,'<div class="layui-transfer-right" data-arr="'+ arr +'" data-total="'+ total2 +'">'
|
||||
,'<div class="layui-transfer-topTitle"><input lay-skin="primary" name="layTranRightCheck" lay-filter="layTranRightCheckAll" type="checkbox" class="layui-input" title="'+ options.title[1] +'"></div>'
|
||||
,function(){
|
||||
if(options.showSearch){
|
||||
return '<div class="layui-transfer-search"><input class="layui-input" placeholder="关键字搜索"><i class="layui-icon layui-icon-search layui-transfer-searchI"></i></div><ul class="layui-transfer-data layui-transfer-dataRight short">';
|
||||
}else{
|
||||
return '<ul class="layui-transfer-data layui-transfer-dataRight">';
|
||||
};
|
||||
return '';
|
||||
}()
|
||||
,listRight + '</ul>'
|
||||
,'</div>'
|
||||
,'</div>'].join('');
|
||||
|
||||
//开始插入替代元素
|
||||
var othis = $(options.elem)
|
||||
,hasRender = othis.next('.' + ELEM_VIEW);
|
||||
|
||||
//生成替代元素
|
||||
hasRender[0] && hasRender.remove(); //如果已经渲染,则Rerender
|
||||
|
||||
that.elemTemp = $(temp);
|
||||
|
||||
othis.html(that.elemTemp);
|
||||
that.event();
|
||||
form.render('checkbox', 'LAY-Transfer-' + that.index);
|
||||
};
|
||||
|
||||
Class.prototype.event = function(){
|
||||
var that = this
|
||||
,options = that.config
|
||||
,elem = that.elemTemp
|
||||
,listLeft = '', listRight = ''
|
||||
,checkTopLeft = elem.find('.'+ TRAN_LEFT).find('.layui-transfer-topTitle').find('input[name="layTranLeftCheck"]')
|
||||
,checkTopRight = elem.find('.'+ TRAN_RIGHT).find('.layui-transfer-topTitle').find('input[name="layTranRightCheck"]')
|
||||
,totalLeft = elem.find('.' + TRAN_LEFT).data('total')
|
||||
,totalRight = elem.find('.' + TRAN_RIGHT).data('total');
|
||||
|
||||
//左选项
|
||||
elem.on('click', 'input[name="layTranLeftCheck"]+', function(){
|
||||
var checkbox = $(this).prev()
|
||||
,checked = checkbox[0].checked
|
||||
,childs = elem.find('.'+ TRAN_LEFT_LIST).find('input[name="layTranLeftCheck"]')
|
||||
,isAll = checkbox.attr('lay-filter') == 'layTranLeftCheckAll';
|
||||
|
||||
if(checkbox[0].disabled) return;
|
||||
//如果是全选/全不选
|
||||
if(isAll){
|
||||
listLeft = '';
|
||||
//如果数据为零,不进行其他操作
|
||||
if(totalLeft == 0){
|
||||
checkbox[0].checked = false;
|
||||
}else{
|
||||
//同步子选项
|
||||
childs.each(function(i, item){
|
||||
if(!item.disabled){
|
||||
item.checked = checked;
|
||||
if(checked){
|
||||
listLeft += ($(childs[i]).data("index")) + ',';
|
||||
$(childs[i]).parent("li").addClass("selected");
|
||||
}else{
|
||||
$(childs[i]).parent("li").removeClass("selected");
|
||||
}
|
||||
};
|
||||
});
|
||||
//同步按钮状态
|
||||
if(checked){
|
||||
elem.find('.' + TRAN_BTN_RIGHT).removeClass(TRAN_BTN_DIS);
|
||||
}else{
|
||||
elem.find('.' + TRAN_BTN_RIGHT).addClass(TRAN_BTN_DIS);
|
||||
};
|
||||
}
|
||||
}else{
|
||||
var num = 1;
|
||||
//单个勾选
|
||||
if(checked){
|
||||
//判断是否全选
|
||||
childs.each(function(i, item){
|
||||
if(!item.disabled && !item.checked){
|
||||
num = 0;
|
||||
}
|
||||
});
|
||||
//如果全选,勾选全选按钮
|
||||
if(num == 1){
|
||||
checkTopLeft[0].checked = checked;
|
||||
};
|
||||
//加入列表
|
||||
listLeft += checkbox.data("index") + ',';
|
||||
checkbox.parent("li").addClass("selected");
|
||||
elem.find('.' + TRAN_BTN_RIGHT).removeClass(TRAN_BTN_DIS);
|
||||
}else{
|
||||
//如果全选状态,更改全选按钮
|
||||
if(checkTopLeft[0].checked){
|
||||
checkTopLeft[0].checked = false;
|
||||
};
|
||||
//移除
|
||||
checkbox.parent("li").removeClass("selected");
|
||||
listLeft = listLeft.replace(checkbox.data('index'),'');
|
||||
childs.each(function(i, item){
|
||||
if(item.checked){
|
||||
num = 0;
|
||||
}
|
||||
});
|
||||
//如果勾选项,更改按钮状态
|
||||
if(num == 1){
|
||||
elem.find('.' + TRAN_BTN_RIGHT).addClass(TRAN_BTN_DIS);
|
||||
};
|
||||
}
|
||||
};
|
||||
form.render('checkbox', 'LAY-Transfer-' + that.index);
|
||||
});
|
||||
|
||||
//右选项
|
||||
elem.on('click', 'input[name="layTranRightCheck"]+', function(){
|
||||
var checkbox = $(this).prev()
|
||||
,checked = checkbox[0].checked
|
||||
,childs = elem.find('.'+ TRAN_RIGHT_LIST).find('input[name="layTranRightCheck"]')
|
||||
,isAll = checkbox.attr('lay-filter') === 'layTranRightCheckAll';
|
||||
|
||||
if(checkbox[0].disabled) return;
|
||||
//如果是全选/全不选
|
||||
if(isAll){
|
||||
listRight = '';
|
||||
//如果数据为零,不进行其他操作
|
||||
if(totalRight == 0){
|
||||
checkbox[0].checked = false;
|
||||
}else{
|
||||
childs.each(function(i, item){
|
||||
if(!item.disabled){
|
||||
item.checked = checked;
|
||||
if(checked){
|
||||
listRight += ($(childs[i]).data("index")) + ',';
|
||||
$(childs[i]).parent("li").addClass("selected");
|
||||
}else{
|
||||
$(childs[i]).parent("li").removeClass("selected");
|
||||
}
|
||||
}
|
||||
});
|
||||
if(checked){
|
||||
elem.find('.' + TRAN_BTN_LEFT).removeClass(TRAN_BTN_DIS);
|
||||
}else{
|
||||
elem.find('.' + TRAN_BTN_LEFT).addClass(TRAN_BTN_DIS);
|
||||
}
|
||||
};
|
||||
form.render('checkbox', 'LAY-Transfer-' + that.index);
|
||||
}else{
|
||||
var num = 1;
|
||||
//单个勾选
|
||||
if(checked){
|
||||
//判断是否全选
|
||||
childs.each(function(i, item){
|
||||
if(!item.disabled && !item.checked){
|
||||
num = 0;
|
||||
}
|
||||
});
|
||||
//如果全选,勾选全选按钮
|
||||
if(num == 1){
|
||||
checkTopRight[0].checked = checked;
|
||||
};
|
||||
//加入列表
|
||||
listRight += checkbox.data("index") + ',';
|
||||
checkbox.parent("li").addClass("selected");
|
||||
elem.find('.' + TRAN_BTN_LEFT).removeClass(TRAN_BTN_DIS);
|
||||
}else{
|
||||
//如果全选状态,更改全选按钮
|
||||
if(checkTopRight[0].checked){
|
||||
checkTopRight[0].checked = false;
|
||||
};
|
||||
//移除
|
||||
checkbox.parent("li").removeClass("selected");
|
||||
listRight = listRight.replace(checkbox.data('index'),'');
|
||||
childs.each(function(i, item){
|
||||
if(item.checked){
|
||||
num = 0;
|
||||
}
|
||||
});
|
||||
//如果勾选项,更改按钮状态
|
||||
if(num == 1){
|
||||
elem.find('.' + TRAN_BTN_LEFT).addClass(TRAN_BTN_DIS);
|
||||
};
|
||||
}
|
||||
};
|
||||
form.render('checkbox', 'LAY-Transfer-' + that.index);
|
||||
});
|
||||
|
||||
//查找
|
||||
function searchVal(tran){
|
||||
var input = elem.find(tran).find('.layui-transfer-search')
|
||||
,val = input.children('input').val()
|
||||
,warp = input.next();
|
||||
|
||||
warp.children("li").each(function(){
|
||||
if($(this).data("title").indexOf(val) == -1){
|
||||
$(this).hide();
|
||||
}else{
|
||||
$(this).show();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
//添加到右边
|
||||
elem.on('click', '.'+TRAN_BTN_RIGHT, function(){
|
||||
var preList = '';
|
||||
//未选中则不操作
|
||||
if($(this).hasClass(TRAN_BTN_DIS)){
|
||||
return ;
|
||||
};
|
||||
//选项移除
|
||||
elem.find("."+ TRAN_LEFT_LIST).find("li").each(function(){
|
||||
if($(this).hasClass("selected")){
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
//选项插入
|
||||
var arr = elem.find('.' + TRAN_RIGHT).data('arr')
|
||||
,add = 0;
|
||||
layui.each(listLeft.split(','), function(index, num){
|
||||
if(!num) return;
|
||||
var data = options.data[num];
|
||||
preList += '<li data-title="'+ data.title +'"><input lay-skin="primary" type="checkbox" data-index="'+ num +'" name="layTranRightCheck" title="'+ data.title +'" value="'+ data.value +'" class="layui-input" '+ (data.disabled ? 'disabled' : '') +'></li>'
|
||||
arr += ',' + num;
|
||||
add++;
|
||||
});
|
||||
elem.find("."+ TRAN_RIGHT_LIST).append(preList);
|
||||
searchVal('.'+TRAN_RIGHT);
|
||||
//更新状态
|
||||
checkTopLeft[0].checked = false;
|
||||
checkTopRight[0].checked = false;
|
||||
$(this).addClass(TRAN_BTN_DIS);
|
||||
listLeft = '';
|
||||
//更改缓存数据
|
||||
totalRight = totalRight + add;
|
||||
totalLeft = totalLeft - add;
|
||||
elem.find('.' + TRAN_RIGHT).data('total', totalRight);
|
||||
elem.find('.' + TRAN_RIGHT).data('total', totalLeft);
|
||||
elem.find('.' + TRAN_RIGHT).data('arr', arr);
|
||||
form.render('checkbox', 'LAY-Transfer-' + that.index);
|
||||
options.onchange && options.onchange(that.getValue());
|
||||
});
|
||||
|
||||
//添加到左边
|
||||
elem.on('click', '.'+TRAN_BTN_LEFT, function(){
|
||||
var preList = '';
|
||||
if($(this).hasClass(TRAN_BTN_DIS)){
|
||||
return ;
|
||||
};
|
||||
//选项移除
|
||||
elem.find("."+ TRAN_RIGHT_LIST).find("li").each(function(){
|
||||
if($(this).hasClass("selected")){
|
||||
$(this).remove();
|
||||
}
|
||||
});
|
||||
//选项插入
|
||||
var arr = elem.find('.' + TRAN_RIGHT).data('arr')
|
||||
,add = 0;
|
||||
layui.each(listRight.split(','), function(index, num){
|
||||
if(!num) return;
|
||||
var data = options.data[num];
|
||||
preList += '<li data-title="'+ data.title +'"><input lay-skin="primary" type="checkbox" data-index="'+ num +'" name="layTranLeftCheck" title="'+ data.title +'" value="'+ data.value +'" class="layui-input" '+ (data.disabled ? 'disabled' : '') +'></li>'
|
||||
arr = arr.replace(num, '').replace(/(,)+/g,',');
|
||||
add++;
|
||||
});
|
||||
elem.find("."+ TRAN_LEFT_LIST).append(preList);
|
||||
searchVal('.'+TRAN_LEFT);
|
||||
//更新状态
|
||||
checkTopLeft[0].checked = false;
|
||||
checkTopRight[0].checked = false;
|
||||
$(this).addClass(TRAN_BTN_DIS);
|
||||
listRight = '';
|
||||
//更改缓存数据
|
||||
totalRight = totalRight - add;
|
||||
totalLeft = totalLeft + add;
|
||||
elem.find('.' + TRAN_RIGHT).data('total', totalRight);
|
||||
elem.find('.' + TRAN_RIGHT).data('total', totalLeft);
|
||||
elem.find('.' + TRAN_RIGHT).data('arr', arr);
|
||||
form.render('checkbox', 'LAY-Transfer-' + that.index);
|
||||
options.onchange && options.onchange(that.getValue());
|
||||
});
|
||||
|
||||
//搜索
|
||||
elem.find('.layui-transfer-search').on('keyup', 'input', function(){
|
||||
var outer = $(this).parent("div").parent("div");
|
||||
searchVal(outer);
|
||||
});
|
||||
};
|
||||
|
||||
//得到选中值
|
||||
Class.prototype.getValue = function(){
|
||||
var that = this
|
||||
,options = that.config
|
||||
,arr = that.elemTemp.find('.' + TRAN_RIGHT).data('arr')
|
||||
,data = [];
|
||||
|
||||
function sortNum(a,b){ return a - b };
|
||||
layui.each(arr.split(',').sort(sortNum), function(index, num){
|
||||
if(!num) return;
|
||||
data.push(options.data[num]);
|
||||
});
|
||||
return data;
|
||||
};
|
||||
|
||||
//核心入口
|
||||
transfer.render = function(options){
|
||||
var inst = new Class(options);
|
||||
return thisTran.call(inst);
|
||||
};
|
||||
|
||||
exports(MOD_NAME, transfer);
|
||||
})
|
||||
File diff suppressed because it is too large
Load Diff
@@ -38,6 +38,9 @@ layui.define('layer' , function(exports){
|
||||
upload: function(files){
|
||||
that.upload.call(that, files);
|
||||
}
|
||||
,reload: function(options){
|
||||
that.reload.call(that, options);
|
||||
}
|
||||
,config: that.config
|
||||
}
|
||||
}
|
||||
@@ -63,6 +66,7 @@ layui.define('layer' , function(exports){
|
||||
,bindAction: '' //手动上传触发的元素
|
||||
,url: '' //上传地址
|
||||
,field: 'file' //文件字段名
|
||||
,acceptMime: '' //筛选出的文件类型,默认为所有文件
|
||||
,method: 'post' //请求上传的 http 类型
|
||||
,data: {} //请求上传的额外参数
|
||||
,drag: true //是否允许拖拽上传
|
||||
@@ -403,6 +407,20 @@ layui.define('layer' , function(exports){
|
||||
send();
|
||||
};
|
||||
|
||||
//重置方法
|
||||
Class.prototype.reload = function(options){
|
||||
var that = this
|
||||
,options = that.config = $.extend({}, that.config, upload.config, options)
|
||||
,next = options.elem.next();
|
||||
|
||||
//更新文件域相关属性
|
||||
next.attr({
|
||||
name: options.name
|
||||
,accept: options.acceptMime
|
||||
,multiple: options.multiple
|
||||
});
|
||||
};
|
||||
|
||||
//事件处理
|
||||
Class.prototype.events = function(){
|
||||
var that = this
|
||||
|
||||
@@ -171,6 +171,16 @@ layui.define('jquery', function(exports){
|
||||
.replace(/</g, '<').replace(/>/g, '>')
|
||||
.replace(/'/g, ''').replace(/"/g, '"');
|
||||
}
|
||||
|
||||
//批量事件
|
||||
,event: function(attr, obj, eventType){
|
||||
obj = util.event[attr] = $.extend(true, util.event[attr], obj) || {};
|
||||
$('body').on(eventType || 'click', '*['+ attr +']', function(){
|
||||
var othis = $(this)
|
||||
,key = othis.attr(attr);
|
||||
obj[key] && obj[key].call(this, othis);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
//监听 DOM 尺寸变化,该创意来自:http://benalman.com/projects/jquery-resize-plugin/
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
}
|
||||
|
||||
,Layui = function(){
|
||||
this.v = '2.4.5'; //版本号
|
||||
this.v = '2.5.0'; //版本号
|
||||
}
|
||||
|
||||
//获取layui所在目录
|
||||
@@ -56,6 +56,7 @@
|
||||
,layedit: 'modules/layedit' //富文本编辑器
|
||||
,form: 'modules/form' //表单集
|
||||
,upload: 'modules/upload' //上传
|
||||
,transfer: 'modules/transfer' //上传
|
||||
,tree: 'modules/tree' //树结构
|
||||
,table: 'modules/table' //表格
|
||||
,element: 'modules/element' //常用元素操作
|
||||
@@ -98,7 +99,7 @@
|
||||
deps = []
|
||||
);
|
||||
|
||||
if(layui['layui.all'] || (!layui['layui.all'] && layui['layui.mobile'])){
|
||||
if((!layui['layui.all'] && layui['layui.mobile'])){
|
||||
return callback.call(that);
|
||||
}
|
||||
|
||||
@@ -154,7 +155,7 @@
|
||||
: ( typeof callback === 'function' && callback.apply(layui, exports) );
|
||||
}
|
||||
|
||||
//如果使用了 layui.all.js
|
||||
//如果引入了完整库(layui.all.js),内置的模块则不必再加载
|
||||
if(apps.length === 0
|
||||
|| (layui['layui.all'] && modules[item])
|
||||
|| (!layui['layui.all'] && layui['layui.mobile'] && modules[item])
|
||||
|
||||
Reference in New Issue
Block a user