fileChoose.html 7.1 KB

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