CategoryNav.vue 11 KB

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