CategoryNav.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. <template>
  2. <div class="breadcrumbs container">
  3. <ul class="list-unstyled list-inline">
  4. <li class="crumb-item">
  5. <nuxt-link :to="`/product/kind/home`">全部器件</nuxt-link><span class="arrow">> </span>
  6. </li>
  7. <li class="crumb-item crumb-item-angle" v-for="(k, index) in actives">
  8. <!-- <i class="angle"></i>-->
  9. <nuxt-link :to="`/product/kind/${k.id}`">
  10. <span :title="k.nameCn">{{k.nameCn | nameFilter}}</span> <i class="fa fa-angle-down td-icon"></i>
  11. </nuxt-link>
  12. <span v-if="index<actives.length-1" class="arrow">> </span>
  13. <div class="crumb-drop crumb-drop-angle" v-if="k.bothers">
  14. <div><i class="angle"></i></div>
  15. <ul class="list-unstyled list-inline" role="menu">
  16. <li v-for="(b, index) in k.bothers" :style="index == k.bothers.length-1?'border-right: none;': ''"><nuxt-link :to="`/product/kind/${b.id}`"><span>{{b.nameCn}}</span> </nuxt-link></li>
  17. </ul>
  18. </div>
  19. <i class="icon-glass"></i>
  20. </li>
  21. </ul>
  22. <div class="breadcrumbs-children" v-if="firstChildrenKinds.length">
  23. <div class="inline-block text-ellipse" v-for="item in firstChildrenKinds">
  24. <nuxt-link :to="`/product/kind/${item.id}`" class="item" :title="item.nameCn">{{item.nameCn}}</nuxt-link>
  25. </div>
  26. </div>
  27. </div>
  28. </template>
  29. <script>
  30. export default {
  31. filters: {
  32. nameFilter: function (title) {
  33. if (title === '') {
  34. return title
  35. }
  36. let len = 0
  37. let index = 0
  38. for (let i = 0; i < title.length; i++) {
  39. if (index === 0 && title.charAt(i).charCodeAt(0) > 255) {
  40. len = len + 2
  41. } else {
  42. len++
  43. }
  44. if (len > 20) {
  45. index = i
  46. break
  47. }
  48. }
  49. if (index > 0) {
  50. return title.substring(0, index) + '...'
  51. } else {
  52. return title
  53. }
  54. }
  55. },
  56. computed: {
  57. actives () {
  58. return this.$store.state.product.kind.kindsParentWithBother.data
  59. },
  60. firstChildrenKinds () {
  61. return this.$store.state.product.kind.firstChildren.data
  62. }
  63. }
  64. }
  65. </script>
  66. <style lang="scss" scoped>
  67. /* breadcrumbs */
  68. .breadcrumbs {
  69. margin-top: 20px;
  70. }
  71. .breadcrumbs ul.list-unstyled.list-inline {
  72. margin-left: 0px;
  73. margin-bottom: 10px;
  74. }
  75. .breadcrumbs ul.list-inline.list-unstyled li.crumb-item {
  76. position: relative;
  77. padding: 0;
  78. height: 30px;
  79. line-height: 30px;
  80. span{
  81. padding: 0;
  82. }
  83. }
  84. /* .breadcrumbs ul li.crumb-item-angle {
  85. margin-left: -5px;
  86. }*/
  87. .breadcrumbs ul li.crumb-item>a {
  88. border: 1px solid #ddd;
  89. display: inline-block;
  90. background: #fff;
  91. /* height: 30px;
  92. line-height: 30px;*/
  93. padding-left: 10px;
  94. padding-right: 10px;
  95. cursor: pointer;
  96. text-decoration: none;
  97. color: #666;
  98. font-size: 14px;
  99. }
  100. .breadcrumbs ul li.crumb-item:hover>a span,.breadcrumbs ul li.crumb-item:hover>a i{
  101. color: #0056d7;
  102. }
  103. /*.breadcrumbs ul li.crumb-item>a i{
  104. margin-right: 10px;
  105. }*/
  106. .breadcrumbs ul li.crumb-item:hover>a i{
  107. transform: rotate(-180deg);
  108. }
  109. .crumb-drop-angle div{
  110. width: 133px;
  111. height: 10px;
  112. display: none;
  113. }
  114. /* .crumb-drop-angle .angle {
  115. position: absolute;
  116. background-color: #404040;
  117. opacity: 0.6;
  118. left: 35px;
  119. top: 32px;
  120. height: 10px;
  121. width: 10px;
  122. transform: rotate(45deg);
  123. -ms-transform: rotate(45deg); !* IE 9 *!
  124. -moz-transform: rotate(45deg); !* Firefox *!
  125. -webkit-transform: rotate(45deg); !* Safari 和 Chrome *!
  126. -o-transform: rotate(45deg); !* Opera *!
  127. display: none;
  128. z-index: 98;
  129. }*/
  130. .crumb-drop-angle .angle{
  131. position: absolute;
  132. top: 29px;
  133. left: 30px;
  134. width: 0;
  135. height: 0;
  136. border-left: 5px solid transparent;
  137. border-right: 5px solid transparent;
  138. border-bottom: 7px solid #404040;
  139. z-index: 115;
  140. opacity: 0.9;
  141. }
  142. .breadcrumbs ul li.crumb-item .crumb-drop ul{
  143. padding: 15px 0px;
  144. position: absolute;
  145. top: 36px;
  146. display: none;
  147. z-index: 100;
  148. width: 403px;
  149. background-color: #404040;
  150. opacity: 0.9;
  151. max-height: 170px;
  152. overflow-y: auto;
  153. overflow-x: hidden;
  154. }
  155. /*滚动条样式*/
  156. .breadcrumbs ul li.crumb-item .crumb-drop ul::-webkit-scrollbar {/*滚动条整体样式*/
  157. width: 12px; /*高宽分别对应横竖滚动条的尺寸*/
  158. }
  159. .breadcrumbs ul li.crumb-item .crumb-drop ul::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
  160. border-radius: 3px;
  161. background: #606060;
  162. border-left: 1px solid #0d0c0f;
  163. border-right: 1px solid #0d0c0f;
  164. }
  165. .breadcrumbs ul li.crumb-item .crumb-drop ul::-webkit-scrollbar-track {/*滚动条里面轨道*/
  166. border-radius: 0;
  167. border: 1px solid #0d0c0f;
  168. background: #161618;
  169. }
  170. .breadcrumbs ul li.crumb-item .crumb-drop li {
  171. float: left;
  172. line-height: 20px;
  173. height: 20px;
  174. width: 133px;
  175. border-right: 1px dashed #fff;
  176. &:nth-child(3n){
  177. border-right: none;
  178. }
  179. }
  180. .breadcrumbs ul li.crumb-item .crumb-drop li a {
  181. display: inline-block;
  182. font-size: 14px;
  183. width: 100%;
  184. overflow: hidden;
  185. text-overflow:ellipsis;
  186. white-space: nowrap;
  187. color: #fff;
  188. padding-left: 10px;
  189. &:hover{
  190. color: rgba(255,255,255,0.5);
  191. border: none;
  192. span{
  193. color: rgba(255,255,255,0.5);
  194. text-decoration: underline;
  195. }
  196. }
  197. }
  198. li{
  199. list-style: none;
  200. }
  201. .breadcrumbs ul li.crumb-item:hover .crumb-drop {
  202. ul, div ,.angle{
  203. display: block;
  204. }
  205. }
  206. .breadcrumbs ul li.crumb-item:hover>a {
  207. border-color: #f50;
  208. background: #ffffff;
  209. z-index: 101;
  210. }
  211. .breadcrumbs ul li.crumb-item a{
  212. color: #323232;
  213. }
  214. .breadcrumbs ul li.crumb-item a:hover{
  215. color: #0056d7;
  216. border: 1px solid #0056d7;
  217. }
  218. /* sl_warp */
  219. .main-content .sl-wrap .sl-key>span {
  220. color: #323232;
  221. font-size: 14px;
  222. }
  223. .main-content .sl-wrap .sl-value ul li a{
  224. color: #323232;
  225. font-size: 14px;
  226. }
  227. .main-content .sl-wrap .sl-value ul li a:hover{
  228. color: #5078cb;
  229. }
  230. .main-content .sl-wrap .sl-value .sl-selected a {
  231. color: #666;
  232. text-decoration: none;
  233. }
  234. .main-content .sl-wrap .sl-value .sl-selected:HOVER a {
  235. color: #f50;
  236. }
  237. .main-content .sl-wrap .sl-value .sl-selected span {
  238. display: inline-block;
  239. position: absolute;
  240. right: 0px;
  241. top: 0px;
  242. height: 100%;
  243. width: 20px;
  244. text-align: center;
  245. background: #ccc;
  246. color: #fff;
  247. }
  248. .main-content .sl-wrap .sl-value .sl-selected:HOVER span {
  249. background: #f50;
  250. }
  251. .main-content .sl-wrap .sl-value ul {
  252. margin-bottom: 0;
  253. }
  254. .main-content .sl-wrap .sl-value ul.list-inline li {
  255. width: 16.6666%;
  256. white-space:nowrap;
  257. overflow:hidden;
  258. text-overflow:ellipsis;
  259. }
  260. .main-content .sl-wrap .sl-value ul, .main-content .sl-set .sl-value ul{
  261. min-height: 25px;
  262. }
  263. .main-content .sl-more a {
  264. position: relative;
  265. display: inline-block;
  266. margin-top: -1px;
  267. height: 30px;
  268. line-height: 30px;
  269. padding: 0 10px 0 10px;
  270. border-width: 1px;
  271. border-style: solid;
  272. border-color: #FFF #DDD #DDD;
  273. background: #fff;
  274. cursor: pointer;
  275. -webkit-transition: border-color .15s ease-in-out;
  276. -moz-transition: border-color .15s ease-in-out;
  277. transition: border-color .15s ease-in-out;
  278. }
  279. .main-content .sl-more:hover a {
  280. color: #f39800;
  281. border-color: #FFF #f39800 #f39800;
  282. text-decoration: none;
  283. }
  284. .main-content .sl-more a:focus {
  285. text-decoration: none;
  286. color: #f39800;
  287. }
  288. .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th,
  289. .table>thead>tr>td, .table>thead>tr>th {
  290. padding: 10px 5px;
  291. }
  292. .pagging .pagging-count a {
  293. color: white !important;
  294. text-decoration: none !important;
  295. }
  296. .parameter-selection > div:first-child {
  297. display: inline-block;
  298. position: absolute;
  299. top: 50%;
  300. left: 8px;
  301. transform: translateY(-50%);
  302. }
  303. .parameter-selection div:last-child {
  304. display: inline-block;
  305. position: absolute;
  306. top: 50%;
  307. left: 40px;
  308. transform: translateY(-50%);
  309. }
  310. .div-table-right table thead tr td{
  311. width: 140px;
  312. text-align: center;
  313. vertical-align: middle;
  314. padding: 0;
  315. }
  316. thead tr {
  317. /*background-image: url("static/img/product/th-tr-bg.png");
  318. background-repeat: repeat-x;*/
  319. background: linear-gradient(rgb(93, 134, 220), rgb(12, 53, 136));
  320. color: #fff;
  321. height: 48px;
  322. }
  323. .table>thead>tr>th{
  324. padding:5px 5px;
  325. }
  326. /* scroll */
  327. ::-webkit-scrollbar {
  328. width: 10px;
  329. height: 10px;
  330. background: #ededed;
  331. }
  332. ::-webkit-scrollbar-thumb {
  333. background-color: #c1c1c1;
  334. border-radius: 5px;
  335. }
  336. ::-webkit-scrollbar-thumb:hover {
  337. background-color: #959595;
  338. }
  339. .container {
  340. position: relative;
  341. width: 1190px;
  342. }
  343. [split-dropdown] {
  344. position: relative;
  345. }
  346. [split-dropdown-toggle] {
  347. position: absolute;
  348. display: none;
  349. border: 1px solid #ccc;
  350. background: #fff;
  351. z-index: 100;
  352. top: 40px !important;
  353. }
  354. .drop-down-list a{
  355. padding: 0 10px;
  356. }
  357. .drop-down-list li:hover,.dropdown-menu li:hover a{
  358. background: #5078cb;
  359. }
  360. .drop-down-list li:hover a,.dropdown-menu li:hover a{
  361. color: #fff;
  362. }
  363. tr.properties-hint-tr > td.properties-hint-td > div {
  364. /*position: relative;
  365. left: -25em;*/
  366. text-align: left;
  367. margin-left: 38em;
  368. }
  369. /*修改样式*/
  370. .main-content .table-bordered thead tr{
  371. background: none;
  372. line-height: 40px;
  373. height: 40px;
  374. color: #323232;
  375. }
  376. .div-table-left table thead tr td,.div-table-right table thead tr td{
  377. border-bottom: none;
  378. }
  379. .div-table-left table tbody tr td,.div-table-right table tbody tr td{
  380. font-size: 12px;
  381. }
  382. .div-table-left table tr td{
  383. border-right: none;
  384. }
  385. .div-table-right table thead tr td:first-child{
  386. border-left: none;
  387. }
  388. .table-bordered{
  389. border: none;
  390. }
  391. .div-table-right table thead tr td:hover span{
  392. color: #5078cb;
  393. }
  394. .td-icon{
  395. font-size: 20px;
  396. position: relative;
  397. top: 2px;
  398. margin-left: 4px;
  399. }
  400. .div-table-right table thead tr td:hover span.fa-angle-down{
  401. transform: rotate(-180deg);
  402. }
  403. .div-table-right table .td-properties{
  404. text-align: center;
  405. }
  406. .div-table-right table .td-properties i,.div-table-left table i{
  407. color: #5078cb;
  408. }
  409. .div-table-right table .td-properties{
  410. border-bottom: none;
  411. }
  412. .div-table-left .table{
  413. margin-bottom: 0;
  414. }
  415. .div-table-right tbody tr td:first-child{
  416. border-left: none;
  417. }
  418. .text-length-more{
  419. width: 100px;
  420. display: block;
  421. white-space: nowrap;
  422. overflow: hidden;
  423. text-overflow: ellipsis;
  424. float: left;
  425. }
  426. .breadcrumbs-children {
  427. padding: 20px 0;
  428. background: #fff;
  429. border: 1px solid #ddd;
  430. max-height: 135px;
  431. overflow-y: auto;
  432. .inline-block {
  433. width: 20%;
  434. text-align: center;
  435. padding: 0 5px;
  436. &:nth-child(n + 6) {
  437. margin-top: 20px;
  438. }
  439. .item {
  440. color: #666;
  441. &:hover {
  442. color: #f54802;
  443. }
  444. }
  445. }
  446. }
  447. .arrow {
  448. margin: 0 6px;
  449. }
  450. </style>