left.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  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 (propertyName) {
  20. return function (object1, object2) {
  21. let value1 = object1[propertyName]
  22. let value2 = object2[propertyName]
  23. if (value1 > value2) {
  24. return 1
  25. } else if (value1 < value2) {
  26. return -1
  27. } else {
  28. return 0
  29. }
  30. }
  31. }
  32. export default {
  33. name: 'left',
  34. data () {
  35. return {
  36. defaultProps: {
  37. children: 'children',
  38. label: 'item'
  39. }
  40. }
  41. },
  42. computed: {
  43. helps () {
  44. return this.$store.state.help.snapsho.data.sort(compare('detno'))
  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. @import "~element-ui/lib/theme-default/index.css";
  58. .el-tree{
  59. border: none;
  60. min-height: 300px;
  61. }
  62. .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content,.el-tree-node:hover{
  63. background: none !important;
  64. }
  65. .el-tree-node__content:hover{
  66. background: none !important;
  67. }
  68. .el-tree-node__content:hover span{
  69. color: #5078cb;
  70. }
  71. .el-pagination .el-pager li.active{
  72. background-color: #5078cb;
  73. border-color: #337ab7;
  74. }
  75. .el-tree-node__expand-icon{
  76. font-family: "iconfont" !important;
  77. font-size: 14px;
  78. font-style: normal;
  79. -webkit-font-smoothing: antialiased;
  80. width: inherit;
  81. height: inherit;
  82. border: inherit;
  83. font-weight: bold;
  84. text-shadow: -1px 0px 0 #333;
  85. margin-right: 3px !important;
  86. }
  87. .el-tree-node__content{
  88. line-height: 30px;
  89. height: 30px;
  90. }
  91. .el-tree-node__expand-icon.is-leaf{
  92. visibility: hidden;
  93. }
  94. .el-tree-node__expand-icon:before{
  95. content: "\E621";
  96. }
  97. .help-list{
  98. width: 200px;
  99. background: #fff;
  100. border: #e8e8e8 1px solid;
  101. }
  102. .help-list h2{
  103. background: #5078cb;
  104. line-height: 34px;
  105. height: 34px;
  106. color: #fff;
  107. font-size: 14px;
  108. text-align: center;
  109. margin: 0;
  110. }
  111. .help-list ul{
  112. width: 200px;
  113. display: inline-block;
  114. }
  115. .help-list li {
  116. position: relative;
  117. line-height: 33px;
  118. font-size: 14px;
  119. color: #333;
  120. float: left;
  121. width: 100%;
  122. padding-left: 10px;
  123. }
  124. .help-list li a {
  125. display: block;
  126. padding-left: 15px;
  127. text-decoration: none;
  128. color: #333;
  129. }
  130. .help-list li a:hover{
  131. color: #5078cb;
  132. cursor: pointer;
  133. }
  134. .help-list ul.list-body {
  135. /*display: none;*/
  136. color: #666;
  137. }
  138. .help-list ul.list-body.active {
  139. display: block;
  140. }
  141. .help-list ul.list-body li {
  142. float: none;
  143. background-image: none;
  144. min-height: 26px;
  145. line-height: 26px;
  146. font-size: 12px;
  147. }
  148. .help-list ul.list-body li a {
  149. padding-left: 15px;
  150. display: block;
  151. color: rgb(50,50,50);
  152. background: none;
  153. }
  154. .help-list ul.list-body li a:hover {
  155. color: #5078cb;
  156. cursor: pointer;
  157. }
  158. .help-list ul.list-body li a.cur,.help-list ul li a.cur{
  159. text-decoration: none;
  160. font-size: 14px;
  161. }
  162. .help-list .operate-icon {
  163. position: absolute;
  164. right: 20px;
  165. top: 1px;
  166. }
  167. .help-list li>ul>li>ul>li {
  168. padding-left: 30px;
  169. }
  170. </style>