left.vue 3.8 KB

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