CategoryProperty.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720
  1. <template>
  2. <div class="main-content container">
  3. <div class="selector" v-if="!kind.leaf">
  4. <div class="sl-wrap" >
  5. <div class="sl-key">
  6. <span>分类:</span>
  7. </div>
  8. <div class="sl-value">
  9. <ul class="list-inline">
  10. <li v-for="c in children" :title="c.nameCn">
  11. <nuxt-link :to="`/product/kind/${c.id}`">{{c.nameCn}}</nuxt-link>
  12. </li>
  13. </ul>
  14. </div>
  15. </div>
  16. </div>
  17. <div class="div-table" split-dropdown v-if="kind.leaf">
  18. <div class="div-table-left">
  19. <table class="table table-bordered">
  20. <thead >
  21. <tr>
  22. <td class="td-width dropdown">
  23. <span class="dropdown-toggle dropdown-back" data-toggle="dropdown">品牌<span class="fa fa-angle-down td-icon"></span></span>
  24. <ul class="dropdown-menu parameter-selection-ul" role="menu" aria-labelledby="dropdownMenu1">
  25. <!--orderBy:'nameCn'-->
  26. <li v-for="b in brands"><a @click="selectBrand(b)"><span>{{b.nameCn}}</span></a></li>
  27. </ul>
  28. </td>
  29. </tr>
  30. </thead>
  31. <tbody>
  32. <tr class="tr-brand">
  33. <td class="td-brand" style="vertical-align: middle;">
  34. <div class="sl-selected" v-if="selectedBrand.nameCn" @click="selectBrand()">
  35. <nuxt-link class="text-num">{{selectedBrand.nameCn}}</nuxt-link>
  36. <span><i class="fa fa-close"></i></span>
  37. </div>
  38. <div v-if="!selectedBrand.nameCn">
  39. 请选择品牌
  40. </div>
  41. </td>
  42. </tr>
  43. </tbody>
  44. </table>
  45. </div>
  46. <div class="div-table-right" dropdown-scroll>
  47. <table class="table table-bordered" style="table-layout:fixed;">
  48. <thead>
  49. <tr>
  50. <td v-for="pro in properties" class="td-width word-break" split-dropdown-trigger="pro.id">
  51. <span class="dropdown-toggle dropdown-back" data-toggle="dropdown"><span>{{pro.property.labelCn}}</span><span class="fa fa-angle-down td-icon"></span></span>
  52. </td>
  53. </tr>
  54. </thead>
  55. <tbody>
  56. <tr v-if="hasProperties" class="tr-properties">
  57. <td v-for="pro in properties" class="td-properties" style="vertical-align:middle;">
  58. <span class="sl-selected" v-if="pro.selected" @click="selectProperty(pro)">
  59. <a class="text-num">{{pro.selected.value}}</a>
  60. <span><i class="fa fa-close"></i></span>
  61. </span>
  62. </td>
  63. </tr>
  64. <tr class="properties-hint-tr" v-if="!hasProperties">
  65. <td :colspan="properties.length" class="properties-hint-td">
  66. <div>请选择筛选属性</div>
  67. </td>
  68. </tr>
  69. </tbody>
  70. </table>
  71. </div>
  72. <div>
  73. <div v-for="pro in properties" split-dropdown-toggle="pro.id" style="top: 40px !important">
  74. <ul class="parameter-selection-ul drop-down-list" role="menu" aria-labelledby="dropdownMenu1">
  75. <!--|orderBy:'value'-->
  76. <li v-for="v in pro.values"><a @click="selectPropertyValue(pro, value)" class="a-color"><span>{{v.value}}</span></a></li>
  77. </ul>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </template>
  83. <script>
  84. export default {
  85. layout: 'main',
  86. data () {
  87. return {
  88. hasProperties: false,
  89. selectedBrand: {
  90. nameCn: null
  91. }
  92. }
  93. },
  94. computed: {
  95. kind () {
  96. return this.$store.state.product.kind.kindsParentWithBother.data[this.$store.state.product.kind.kindsParentWithBother.data.length - 1]
  97. },
  98. children () {
  99. return this.$store.state.product.kind.children.data
  100. },
  101. properties () {
  102. return this.$store.state.product.kind.kindProperty.data
  103. },
  104. brands () {
  105. return this.$store.state.product.kind.brands.data
  106. }
  107. },
  108. methods: {
  109. selectBrand (item) {
  110. return null
  111. },
  112. selectProperty (item) {
  113. return null
  114. },
  115. selectPropertyValue (item, value) {
  116. return null
  117. }
  118. }
  119. }
  120. </script>
  121. <style scoped>
  122. .clear, .clr {
  123. clear: both;
  124. }
  125. /* breadcrumbs */
  126. .breadcrumbs {
  127. margin-top: 20px;
  128. }
  129. .breadcrumbs ul.list-unstyled.list-inline {
  130. margin-left: 0px;
  131. }
  132. .breadcrumbs ul.list-inline.list-unstyled li.crumb-item {
  133. position: relative;
  134. padding-left: 0px;
  135. padding-right: 0px;
  136. padding-bottom: 1px;
  137. height: 32px;
  138. line-height: 30px;
  139. background: #fff;
  140. border: solid 1px #6493ff;
  141. }
  142. .breadcrumbs ul li.crumb-item-angle {
  143. margin-left: -5px;
  144. }
  145. .breadcrumbs ul li.crumb-item>a {
  146. display: inline-block;
  147. width: 100%;
  148. height: 100%;
  149. padding-left: 15px;
  150. padding-right: 15px;
  151. cursor: pointer;
  152. text-decoration: none;
  153. color: #323232;
  154. font-size: 16px;
  155. }
  156. .breadcrumbs ul li.crumb-item:hover>a span,.breadcrumbs ul li.crumb-item:hover>a i{
  157. color: #5078cb;
  158. }
  159. .breadcrumbs ul li.crumb-item>a i{
  160. margin-right: 10px;
  161. }
  162. .breadcrumbs ul li.crumb-item:hover>a i{
  163. transform: rotate(-180deg);
  164. }
  165. .breadcrumbs ul li.crumb-item .angle {
  166. position: absolute;
  167. left: -6px;
  168. top: 50%;
  169. margin-top: -5px;
  170. height: 10px;
  171. width: 10px;
  172. border-bottom: 1px solid #6493ff;
  173. border-left: 1px solid #6493ff;
  174. background: white;
  175. transform: rotate(45deg);
  176. -ms-transform: rotate(45deg); /* IE 9 */
  177. -moz-transform: rotate(45deg); /* Firefox */
  178. -webkit-transform: rotate(45deg); /* Safari 和 Chrome */
  179. -o-transform: rotate(45deg); /* Opera */
  180. z-index: 14;
  181. }
  182. .breadcrumbs ul li.crumb-item .crumb-drop {
  183. position: absolute;
  184. display: none;
  185. left: -1px;
  186. top: 30px;
  187. border: #6493ff 1px solid;
  188. background: #fff;
  189. z-index: 100;
  190. width: 200px;
  191. }
  192. .breadcrumbs ul li.crumb-item .crumb-drop li {
  193. line-height: 20px;
  194. }
  195. .breadcrumbs ul li.crumb-item .crumb-drop li a{
  196. font-size: 12px;
  197. }
  198. li{
  199. list-style: none;
  200. }
  201. .breadcrumbs ul li.crumb-item:hover .crumb-drop {
  202. display: block;
  203. }
  204. .breadcrumbs ul li.crumb-item:hover>a {
  205. border-color: #f50;
  206. background: #ffffff;
  207. z-index: 101;
  208. }
  209. .breadcrumbs ul li.crumb-item a{
  210. color: #323232;
  211. }
  212. .breadcrumbs ul li.crumb-item a:hover{
  213. color: #5078cb;
  214. }
  215. .kind-count-line {
  216. line-height: 25px;
  217. height: 25px;
  218. color: #fff;
  219. font-weight: 600;
  220. background: #7bb4e1;
  221. }
  222. .kind-count-line .kind-count {
  223. display: inline-block;
  224. padding: 0 15px;
  225. background-color: #f39800;
  226. }
  227. /* sl_warp */
  228. .main-content .selector {
  229. color: #666;
  230. border: 1px solid #ddd;
  231. border-top: #6493ff 2px solid;
  232. margin-bottom: 30px;
  233. padding: 10px 0;
  234. }
  235. .main-content .sl-wrap {
  236. position: relative;
  237. line-height: 22px;
  238. padding: 5px 0;
  239. }
  240. .main-content .sl-wrap .sl-key {
  241. float: left;
  242. width: 100px;
  243. padding: 0 8px;
  244. }
  245. .main-content .sl-wrap .sl-key>span {
  246. color: #323232;
  247. font-size: 14px;
  248. }
  249. .main-content .sl-wrap .sl-value {
  250. margin-left: 110px;
  251. overflow-y: auto;
  252. }
  253. .main-content .sl-wrap .sl-value ul li a{
  254. color: #323232;
  255. font-size: 14px;
  256. }
  257. .main-content .sl-wrap .sl-value ul li a:hover{
  258. color: #5078cb;
  259. }
  260. .main-content .sl-wrap .sl-value .sl-selected {
  261. display: inline-block;
  262. position: relative;
  263. padding-left: 10px;
  264. padding-right: 30px;
  265. border: 1px solid #ccc;
  266. cursor: pointer;
  267. }
  268. .main-content .sl-wrap .sl-value .sl-selected a {
  269. color: #666;
  270. text-decoration: none;
  271. }
  272. .main-content .sl-wrap .sl-value .sl-selected:HOVER {
  273. border: 1px solid #f50;
  274. }
  275. .main-content .sl-wrap .sl-value .sl-selected:HOVER a {
  276. color: #f50;
  277. }
  278. .main-content .sl-wrap .sl-value .sl-selected span {
  279. display: inline-block;
  280. position: absolute;
  281. right: 0px;
  282. top: 0px;
  283. height: 100%;
  284. width: 20px;
  285. text-align: center;
  286. background: #ccc;
  287. color: #fff;
  288. }
  289. .main-content .sl-wrap .sl-value .sl-selected:HOVER span {
  290. background: #f50;
  291. }
  292. .main-content .sl-wrap .sl-value ul {
  293. margin-bottom: 0;
  294. }
  295. .main-content .sl-wrap .sl-value ul.list-inline li {
  296. width: 16.6666%;
  297. white-space:nowrap;
  298. overflow:hidden;
  299. text-overflow:ellipsis;
  300. }
  301. .main-content .sl-wrap .sl-value ul, .main-content .sl-set .sl-value ul{
  302. min-height: 25px;
  303. }
  304. .main-content .sl-wrap .sl-ext {
  305. position: absolute;
  306. top: 0px;
  307. right: 0px;
  308. width: 80px;
  309. }
  310. .main-content .sl-more {
  311. position: relative;
  312. top: -1px;
  313. line-height: 30px;
  314. text-align: center;
  315. border-top: 1px solid #DDD;
  316. }
  317. .main-content .sl-more a {
  318. position: relative;
  319. display: inline-block;
  320. margin-top: -1px;
  321. height: 30px;
  322. line-height: 30px;
  323. padding: 0 10px 0 10px;
  324. border-width: 1px;
  325. border-style: solid;
  326. border-color: #FFF #DDD #DDD;
  327. background: #fff;
  328. cursor: pointer;
  329. -webkit-transition: border-color .15s ease-in-out;
  330. -moz-transition: border-color .15s ease-in-out;
  331. transition: border-color .15s ease-in-out;
  332. }
  333. .main-content .sl-more:hover {
  334. border-top-color: #f39800;
  335. }
  336. .main-content .sl-more:hover a {
  337. color: #f39800;
  338. border-color: #FFF #f39800 #f39800;
  339. text-decoration: none;
  340. }
  341. .main-content .sl-more a:focus {
  342. text-decoration: none;
  343. color: #f39800;
  344. }
  345. .main-content .sl-set {
  346. position: relative;
  347. line-height: 30px;
  348. font-size: 14px;
  349. }
  350. .main-content .sl-set .sl-key {
  351. float: left;
  352. width: 100px;
  353. }
  354. .main-content .sl-set .sl-value {
  355. margin-left: 110px;
  356. }
  357. .main-content .content {
  358. position: relative;
  359. }
  360. .main-content .content .total {
  361. position: relative;
  362. margin-bottom: 10px;
  363. line-height: 30px;
  364. height: 30px;
  365. background: #7bb4e1;
  366. color: white;
  367. font-weight: 700;
  368. }
  369. .main-content .info {
  370. line-height: 24px;
  371. }
  372. .main-content .info .title {
  373. display: inline-block;
  374. width: 100px;
  375. font-family: 'microsoft yahei';
  376. font-weight: 600;
  377. }
  378. .main-content .info .content {
  379. font-size: 14px;
  380. }
  381. .main-content .operate {
  382. margin-bottom: 5px;
  383. }
  384. .main-content .operate .btn {
  385. width: 100px;
  386. text-align: left;
  387. }
  388. .main-content .content .view_all:hover {
  389. text-decoration: none;
  390. color: #f50;
  391. background: #f5f5f5
  392. }
  393. .table>tbody>tr>td, .table>tbody>tr>th, .table>tfoot>tr>td, .table>tfoot>tr>th,
  394. .table>thead>tr>td, .table>thead>tr>th {
  395. padding: 10px 5px;
  396. }
  397. .total-content {
  398. background-color: #f39800;
  399. padding-left: 10px;
  400. }
  401. .btnactive {
  402. background-color: #f39800;
  403. }
  404. .reserve {
  405. color: white;
  406. font-weight: 500;
  407. }
  408. .pagging .pagging-count {
  409. padding-left: 10px;
  410. padding-right: 10px;
  411. }
  412. .pagging .pagging-count:HOVER {
  413. background: #4D7BA5;
  414. cursor: pointer;
  415. }
  416. .pagging .pagging-count a {
  417. color: white !important;
  418. text-decoration: none !important;
  419. }
  420. .parameter-selection > div:first-child {
  421. display: inline-block;
  422. position: absolute;
  423. top: 50%;
  424. left: 8px;
  425. transform: translateY(-50%);
  426. }
  427. .parameter-selection div:last-child {
  428. display: inline-block;
  429. position: absolute;
  430. top: 50%;
  431. left: 40px;
  432. transform: translateY(-50%);
  433. }
  434. .div-table{
  435. width:1190px;
  436. height:120px;
  437. border-top: #6493ff 2px solid;
  438. }
  439. .div-table-left{
  440. width:135px;
  441. float:left;
  442. text-align: center;
  443. }
  444. .parameter-selection-ul{
  445. min-height: 80px;
  446. max-height: 176px;
  447. overflow: scroll;
  448. overflow-x:hidden;
  449. }
  450. .div-table-right{
  451. float:left;
  452. height:120px;
  453. width:1055px;
  454. overflow-x:auto;
  455. overflow-y:hidden;
  456. border:1px solid #DBDBDB;
  457. }
  458. .div-table-right .table{
  459. margin-bottom: 0;
  460. }
  461. .div-table-right table thead tr td{
  462. width: 140px;
  463. text-align: center;
  464. vertical-align: middle;
  465. padding: 0;
  466. }
  467. .text-hidden {
  468. text-overflow:ellipsis;
  469. overflow:hidden;
  470. white-space: nowrap;
  471. }
  472. .text-hidden:hover{
  473. overflow: visible;
  474. }
  475. .td-width{
  476. color: #323232;
  477. font-size: 14px;
  478. }
  479. .td-icon{
  480. font-size:18px;
  481. }
  482. .tr-brand{
  483. height:80px;
  484. vertical-align: middle;
  485. }
  486. .tr-properties{
  487. height:65px;
  488. }
  489. .td-brand,.td-properties{
  490. line-height: 20px;
  491. word-wrap : break-word;
  492. word-break : break-all;
  493. }
  494. thead tr {
  495. background: linear-gradient(rgb(93, 134, 220), rgb(12, 53, 136));
  496. color: #fff;
  497. height: 48px;
  498. }
  499. .table>thead>tr>th{
  500. padding:5px 5px;
  501. }
  502. .dropdown:hover>.dropdown-back {
  503. border-color: transparent;
  504. background-color: transparent;
  505. }
  506. /* scroll */
  507. ::-webkit-scrollbar {
  508. width: 10px;
  509. height: 10px;
  510. background: #ededed;
  511. }
  512. ::-webkit-scrollbar-thumb {
  513. background-color: #c1c1c1;
  514. border-radius: 5px;
  515. }
  516. ::-webkit-scrollbar-thumb:hover {
  517. background-color: #959595;
  518. }
  519. .container {
  520. position: relative;
  521. width: 1190px;
  522. }
  523. .main-content .wrap {
  524. position: relative;
  525. width: 500px;
  526. border: 1px solid #ccc;
  527. overflow-x: auto;
  528. }
  529. .table {
  530. display: table;
  531. table-layout: fixed;
  532. width: 100%;
  533. border-collapse: collapse;
  534. position: relative;
  535. left: 0px;
  536. }
  537. .tr, .th {
  538. display: table-row;
  539. }
  540. .th {
  541. font-weight: 600;
  542. }
  543. .td {
  544. display: table-cell;
  545. padding: 5px;
  546. width: 100px;
  547. text-align: center;
  548. border: 1px solid #ddd;
  549. }
  550. .dropdown-menu {
  551. display: none;
  552. position: absolute;
  553. top: 100%;
  554. background: #fff;
  555. text-align: center;
  556. cursor: pointer;
  557. }
  558. [split-dropdown] {
  559. position: relative;
  560. }
  561. [split-dropdown-toggle] {
  562. position: absolute;
  563. display: none;
  564. border: 1px solid #ccc;
  565. background: #fff;
  566. z-index: 100;
  567. top: 40px !important;
  568. }
  569. .drop-down-list{
  570. font-size: 14px;
  571. min-width: 100px;
  572. line-height: 1.75;
  573. background: #fff;
  574. text-align:center;
  575. padding: 5px 0;
  576. margin: 1px 0 0;
  577. }
  578. .drop-down-list a{
  579. padding: 0 10px;
  580. }
  581. .drop-down-list li:hover,.dropdown-menu li:hover a{
  582. background: #5078cb;
  583. }
  584. .drop-down-list li:hover a,.dropdown-menu li:hover a{
  585. color: #fff;
  586. }
  587. .a-color {
  588. color:black;
  589. cursor: pointer;
  590. }
  591. tr.properties-hint-tr {
  592. height: 65px;
  593. }
  594. tr.properties-hint-tr > td.properties-hint-td {
  595. vertical-align: middle;
  596. line-height: 20px;
  597. border-bottom: none;
  598. }
  599. tr.properties-hint-tr > td.properties-hint-td > div {
  600. /*position: relative;
  601. left: -25em;*/
  602. text-align: left;
  603. margin-left: 38em;
  604. }
  605. .word-break {
  606. word-break: break-word;
  607. }
  608. /*修改样式*/
  609. .breadcrumbs,.main-content{
  610. padding: 0;
  611. }
  612. .main-content .table-bordered{
  613. border-top: none;
  614. }
  615. .main-content .table-bordered thead tr{
  616. background: none;
  617. line-height: 40px;
  618. height: 40px;
  619. color: #323232;
  620. }
  621. .div-table-left table thead tr td,.div-table-right table thead tr td{
  622. border-bottom: none;
  623. }
  624. .div-table-left table tbody tr td,.div-table-right table tbody tr td{
  625. font-size: 12px;
  626. }
  627. .div-table-left table tr td{
  628. border-right: none;
  629. }
  630. .div-table-right table thead tr td:first-child{
  631. border-left: none;
  632. }
  633. .table-bordered{
  634. border: none;
  635. }
  636. .div-table-right table thead tr td:hover span{
  637. color: #5078cb;
  638. }
  639. .div-table-right table thead tr td:hover span.fa-angle-down{
  640. transform: rotate(-180deg);
  641. }
  642. .div-table-right table .td-properties{
  643. text-align: center;
  644. }
  645. .div-table-right table .td-properties i,.div-table-left table i{
  646. color: #5078cb;
  647. }
  648. .div-table-right table .td-properties{
  649. border-bottom: none;
  650. }
  651. .div-table-left .table{
  652. margin-bottom: 0;
  653. }
  654. .div-table-right tbody tr td:first-child{
  655. border-left: none;
  656. }
  657. .text-length-more{
  658. width: 100px;
  659. display: block;
  660. white-space: nowrap;
  661. overflow: hidden;
  662. text-overflow: ellipsis;
  663. float: left;
  664. }
  665. </style>