left.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <div class="help-list">
  3. <h2>
  4. <nuxt-link to="/help/home">帮助中心</nuxt-link>
  5. </h2>
  6. <!--<ul class="list-unstyled" style="margin-top: 10px;">
  7. <li v-for="nav01 in helps">
  8. <a :class="{'cur': nav01.isHide}" @click="toggleNav(nav01)"><span>{{nav01.item}}</span></a>
  9. <ul class="list-unstyled list-body" v-if="!nav01.isHide">
  10. <li v-for="nav02 in nav01.children">
  11. <nuxt-link :to="`/help/helpList/${nav02.id}`"><span v-text="nav02.item"></span></nuxt-link>
  12. </li>
  13. </ul>
  14. </li>
  15. </ul>-->
  16. <el-tree :data="helps" :props="defaultProps" :highlight-current="true" default-expand-all @node-click="openList"></el-tree>
  17. </div>
  18. </template>
  19. <script>
  20. // 升序
  21. function compare (property) {
  22. return function (a, b) {
  23. var value1 = a[property]
  24. var value2 = b[property]
  25. return value1 - value2
  26. }
  27. }
  28. export default {
  29. name: 'left',
  30. data () {
  31. return {
  32. defaultProps: {
  33. children: 'children',
  34. label: 'item'
  35. }
  36. }
  37. },
  38. computed: {
  39. helps () {
  40. let list = this.$store.state.help.snapsho.data.sort(compare('detno'))
  41. if (list) {
  42. for (let i = 0; i < list.length; i++) {
  43. list[i].children = list[i].children.sort(compare('detno'))
  44. }
  45. }
  46. return list
  47. }
  48. },
  49. methods: {
  50. openList (data) {
  51. if (data.level !== 1) {
  52. this.$router.push({ name: 'help-helpList-id', params: { id: data.id } })
  53. }
  54. }
  55. }
  56. }
  57. </script>
  58. <style scoped>
  59. .el-tree{
  60. border: none;
  61. min-height: 300px;
  62. }
  63. .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content,.el-tree-node:hover{
  64. background: none !important;
  65. }
  66. .el-tree-node__content:hover{
  67. background: none !important;
  68. }
  69. .el-tree-node__content:hover span{
  70. color: #5078cb;
  71. }
  72. .el-pagination .el-pager li.active{
  73. background-color: #5078cb;
  74. border-color: #337ab7;
  75. }
  76. .el-tree-node__expand-icon{
  77. font-family: "iconfont" !important;
  78. font-size: 14px;
  79. font-style: normal;
  80. -webkit-font-smoothing: antialiased;
  81. width: inherit;
  82. height: inherit;
  83. border: inherit;
  84. font-weight: bold;
  85. text-shadow: -1px 0px 0 #333;
  86. margin-right: 3px !important;
  87. }
  88. .el-tree-node__content{
  89. line-height: 30px;
  90. height: 30px;
  91. }
  92. .el-tree-node__expand-icon.is-leaf{
  93. visibility: hidden;
  94. }
  95. .el-tree-node__expand-icon:before{
  96. content: "\E621";
  97. }
  98. .help-list{
  99. width: 200px;
  100. background: #fff;
  101. border: #e8e8e8 1px solid;
  102. }
  103. .help-list h2{
  104. background: #5078cb;
  105. line-height: 34px;
  106. height: 34px;
  107. color: #fff;
  108. font-size: 14px;
  109. text-align: center;
  110. margin: 0;
  111. }
  112. .help-list h2 a {
  113. color: #fff;
  114. }
  115. .help-list ul{
  116. width: 200px;
  117. display: inline-block;
  118. }
  119. .help-list li {
  120. position: relative;
  121. line-height: 33px;
  122. font-size: 14px;
  123. color: #333;
  124. float: left;
  125. width: 100%;
  126. padding-left: 10px;
  127. }
  128. .help-list li a {
  129. display: block;
  130. padding-left: 15px;
  131. text-decoration: none;
  132. color: #333;
  133. }
  134. .help-list li a:hover{
  135. color: #5078cb;
  136. cursor: pointer;
  137. }
  138. .help-list ul.list-body {
  139. /*display: none;*/
  140. color: #666;
  141. }
  142. .help-list ul.list-body.active {
  143. display: block;
  144. }
  145. .help-list ul.list-body li {
  146. float: none;
  147. background-image: none;
  148. min-height: 26px;
  149. line-height: 26px;
  150. font-size: 12px;
  151. }
  152. .help-list ul.list-body li a {
  153. padding-left: 15px;
  154. display: block;
  155. color: rgb(50,50,50);
  156. background: none;
  157. }
  158. .help-list ul.list-body li a:hover {
  159. color: #5078cb;
  160. cursor: pointer;
  161. }
  162. .help-list ul.list-body li a.cur,.help-list ul li a.cur{
  163. text-decoration: none;
  164. font-size: 14px;
  165. }
  166. .help-list .operate-icon {
  167. position: absolute;
  168. right: 20px;
  169. top: 1px;
  170. }
  171. .help-list li>ul>li>ul>li {
  172. padding-left: 30px;
  173. }
  174. </style>