fileChoose.html 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <!-- fileChoose -->
  2. <div class="file-choose-dialog">
  3. <!-- 顶部工具栏 -->
  4. <div class="file-choose-top-bar">
  5. <div class="file-choose-top-text">当前位置:<span id="fc-current-position">/</span></div>
  6. <div class="file-choose-top-btn-group">
  7. <button id="fc-btn-back" class="layui-btn layui-btn-sm layui-btn-primary">
  8. <i class="layui-icon">&#xe65c;</i>上级
  9. </button>
  10. <button id="fc-btn-refresh" class="layui-btn layui-btn-sm layui-btn-primary">
  11. <i class="layui-icon">&#xe669;</i>刷新
  12. </button>
  13. <button id="fc-btn-upload" class="layui-btn layui-btn-sm layui-btn-normal" style="margin-right: 0;">
  14. <i class="layui-icon">&#xe681;</i>上传
  15. </button>
  16. </div>
  17. </div>
  18. <!-- 文件列表 -->
  19. <div id="file-choose-list" class="file-choose-list"></div>
  20. <!-- // 页脚-->
  21. <div id="file-choose-page" style="position: absolute;bottom: 0; z-index: 10;background: #ffffff"></div>
  22. <!-- 加载动画 -->
  23. <div class="file-choose-loading-group">
  24. <div class="file-choose-loading">
  25. <span></span><span></span><span></span><span></span>
  26. </div>
  27. </div>
  28. <!-- 底部工具栏 -->
  29. <div class="file-choose-bottom-bar">
  30. <button id="fc-btn-ok-sel" class="layui-btn layui-btn-sm layui-btn-normal">完成选择</button>
  31. </div>
  32. </div>
  33. <style>
  34. /** fileChoose */
  35. .file-choose-dialog {
  36. position: relative;
  37. background: #fff;
  38. height: 100%;
  39. }
  40. /** 顶部工具栏 */
  41. .file-choose-dialog .file-choose-top-bar {
  42. position: relative;
  43. white-space: nowrap;
  44. overflow: auto;
  45. text-align: right;
  46. padding: 5px 12px;
  47. background-color: #fff;
  48. z-index: 1;
  49. }
  50. .file-choose-dialog .file-choose-top-bar .layui-btn {
  51. padding: 0 6px;
  52. margin-left: 5px;
  53. }
  54. .file-choose-dialog .file-choose-top-bar .layui-btn .layui-icon {
  55. font-size: 14px !important;
  56. }
  57. .file-choose-dialog .file-choose-top-text {
  58. padding: 7px 15px 0 0;
  59. display: inline-block;
  60. float: left;
  61. }
  62. .file-choose-dialog .file-choose-top-btn-group {
  63. display: inline-block;
  64. }
  65. /** 底部工具栏 */
  66. .file-choose-dialog .file-choose-bottom-bar {
  67. position: absolute;
  68. left: 0;
  69. right: 0;
  70. bottom: 0;
  71. border-top: 1px solid #eee;
  72. padding: 8px 12px;
  73. text-align: right;
  74. background-color: #fff;
  75. }
  76. .file-choose-dialog.hide-bottom .file-choose-bottom-bar {
  77. display: none;
  78. }
  79. /** 文件列表 */
  80. .file-choose-dialog .file-choose-list, .file-choose-loading-group {
  81. position: absolute;
  82. top: 40px;
  83. bottom: 48px;
  84. left: 0;
  85. right: 0;
  86. overflow: auto;
  87. padding: 5px 8px;
  88. }
  89. .file-choose-dialog.hide-bottom .file-choose-list, .file-choose-dialog.hide-bottom .file-choose-loading-group {
  90. bottom: 0;
  91. }
  92. /* 文件列表item */
  93. .file-choose-dialog .file-choose-list-item {
  94. position: relative;
  95. display: inline-block;
  96. vertical-align: top;
  97. padding: 8px 8px;
  98. margin: 5px 0;
  99. cursor: pointer;
  100. }
  101. .file-choose-dialog .file-choose-list-item:hover {
  102. background-color: #F7F7F7;
  103. }
  104. /* 文件列表图片 */
  105. .file-choose-dialog .file-choose-list-item-img {
  106. width: 90px;
  107. height: 90px;
  108. background-repeat: no-repeat;
  109. background-position: center;
  110. background-size: cover;
  111. border-radius: 3px;
  112. overflow: hidden;
  113. position: relative;
  114. background-color: #eee;
  115. }
  116. .file-choose-dialog .file-choose-list-item-img.img-icon {
  117. background-size: inherit;
  118. background-color: transparent;
  119. }
  120. .file-choose-dialog .file-choose-list-item.active .file-choose-list-item-img:after {
  121. content: "";
  122. position: absolute;
  123. left: 0;
  124. top: 0;
  125. bottom: 0;
  126. right: 0;
  127. background: rgba(0, 0, 0, 0.3);
  128. }
  129. /* 文件列表名称 */
  130. .file-choose-dialog .file-choose-list-item-name {
  131. width: 90px;
  132. overflow: hidden;
  133. text-overflow: ellipsis;
  134. white-space: nowrap;
  135. color: #333;
  136. font-size: 12px;
  137. text-align: center;
  138. margin-top: 12px;
  139. }
  140. /* 文件列表复选框 */
  141. .file-choose-dialog .file-choose-list-item-ck {
  142. position: absolute;
  143. right: 8px;
  144. top: 8px;
  145. }
  146. .file-choose-dialog .file-choose-list-item-ck .layui-form-checkbox {
  147. padding: 0;
  148. }
  149. /* 文件列表操作菜单 */
  150. .file-choose-dialog .file-choose-oper-menu {
  151. background-color: #fff;
  152. position: absolute;
  153. left: 8px;
  154. top: 8px;
  155. border-radius: 2px;
  156. box-shadow: 0px 0px 10px rgba(0, 0, 0, .15);
  157. transition: all .3s;
  158. overflow: hidden;
  159. transform: scale(0);
  160. transform-origin: left top;
  161. visibility: hidden;
  162. }
  163. .file-choose-dialog .file-choose-oper-menu.show {
  164. transform: scale(1);
  165. visibility: visible;
  166. }
  167. /* 文件列表操作菜单item */
  168. .file-choose-dialog .file-choose-oper-menu-item {
  169. color: #555;
  170. padding: 6px 5px;
  171. font-size: 14px;
  172. min-width: 70px;
  173. text-align: center;
  174. cursor: pointer;
  175. display: block;
  176. }
  177. .file-choose-dialog .file-choose-oper-menu-item:hover {
  178. background-color: #eee;
  179. }
  180. /** 文件列表为空时样式 */
  181. .file-choose-dialog .file-choose-empty {
  182. text-align: center;
  183. color: #999;
  184. padding: 50px 0;
  185. }
  186. .file-choose-dialog .file-choose-empty .layui-icon {
  187. font-size: 60px;
  188. display: block;
  189. margin-bottom: 8px;
  190. }
  191. /** 加载动画 */
  192. .file-choose-dialog .file-choose-loading-group {
  193. background-color: #fff;
  194. }
  195. .file-choose-dialog .file-choose-loading {
  196. position: absolute;
  197. left: 50%;
  198. top: 50%;
  199. -webkit-transform: translate(-50%, -50%);
  200. transform: translate(-50%, -50%);
  201. }
  202. .file-choose-dialog .file-choose-loading span {
  203. display: inline-block;
  204. width: 5px;
  205. height: 0px;
  206. margin: 0 2px;
  207. vertical-align: bottom;
  208. background-color: #1E9FFF;
  209. animation: fcl-signal-load 1s infinite;
  210. -webkit-animation: fcl-signal-load 1s infinite;
  211. }
  212. .file-choose-dialog .file-choose-loading span:nth-child(2) {
  213. animation-delay: 0.05s;
  214. -webkit-animation-delay: 0.05s;
  215. }
  216. .file-choose-dialog .file-choose-loading span:nth-child(3) {
  217. animation-delay: 0.1s;
  218. -webkit-animation-delay: 0.1s;
  219. }
  220. .file-choose-dialog .file-choose-loading span:nth-child(4) {
  221. animation-delay: 0.15s;
  222. -webkit-animation-delay: 0.15s;
  223. }
  224. @keyframes fcl-signal-load {
  225. 0% {
  226. height: 0px;
  227. }
  228. 50% {
  229. height: 15px;
  230. }
  231. 100% {
  232. height: 0px;
  233. }
  234. }
  235. @-webkit-keyframes fcl-signal-load {
  236. 0% {
  237. height: 0px;
  238. }
  239. 50% {
  240. height: 15px;
  241. }
  242. 100% {
  243. height: 0px;
  244. }
  245. }
  246. </style>