left.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  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 data = this.baseUtils.deepCopy(this.$store.state.help.snapsho.data)
  41. let list = data.sort(compare('detno'))
  42. if (list) {
  43. for (let i = 0; i < list.length; i++) {
  44. list[i].children = list[i].children.sort(compare('detno'))
  45. }
  46. }
  47. return list
  48. }
  49. },
  50. methods: {
  51. openList (data) {
  52. if (data.level !== 1) {
  53. this.$router.push({ name: 'help-helpList-id', params: { id: data.id } })
  54. }
  55. }
  56. }
  57. }
  58. </script>
  59. <style scoped>
  60. .el-tree{
  61. border: none;
  62. min-height: 300px;
  63. }
  64. .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content,.el-tree-node:hover{
  65. background: none !important;
  66. }
  67. .el-tree-node__content:hover{
  68. background: none !important;
  69. }
  70. .el-tree-node__content:hover span{
  71. color: #5078cb;
  72. }
  73. .el-pagination .el-pager li.active{
  74. background-color: #5078cb;
  75. border-color: #337ab7;
  76. }
  77. .el-tree-node__expand-icon{
  78. font-family: "iconfont" !important;
  79. font-size: 14px;
  80. font-style: normal;
  81. -webkit-font-smoothing: antialiased;
  82. width: inherit;
  83. height: inherit;
  84. border: inherit;
  85. font-weight: bold;
  86. text-shadow: -1px 0px 0 #333;
  87. margin-right: 3px !important;
  88. }
  89. .el-tree-node__content{
  90. line-height: 30px;
  91. height: 30px;
  92. }
  93. .el-tree-node__expand-icon.is-leaf{
  94. visibility: hidden;
  95. }
  96. .el-tree-node__expand-icon:before{
  97. content: "\E621";
  98. }
  99. .help-list{
  100. width: 200px;
  101. background: #fff;
  102. border: #e8e8e8 1px solid;
  103. }
  104. .help-list h2{
  105. background: #5078cb;
  106. line-height: 34px;
  107. height: 34px;
  108. color: #fff;
  109. font-size: 14px;
  110. text-align: center;
  111. margin: 0;
  112. }
  113. .help-list h2 a {
  114. color: #fff;
  115. }
  116. .help-list ul{
  117. width: 200px;
  118. display: inline-block;
  119. }
  120. .help-list li {
  121. position: relative;
  122. line-height: 33px;
  123. font-size: 14px;
  124. color: #333;
  125. float: left;
  126. width: 100%;
  127. padding-left: 10px;
  128. }
  129. .help-list li a {
  130. display: block;
  131. padding-left: 15px;
  132. text-decoration: none;
  133. color: #333;
  134. }
  135. .help-list li a:hover{
  136. color: #5078cb;
  137. cursor: pointer;
  138. }
  139. .help-list ul.list-body {
  140. /*display: none;*/
  141. color: #666;
  142. }
  143. .help-list ul.list-body.active {
  144. display: block;
  145. }
  146. .help-list ul.list-body li {
  147. float: none;
  148. background-image: none;
  149. min-height: 26px;
  150. line-height: 26px;
  151. font-size: 12px;
  152. }
  153. .help-list ul.list-body li a {
  154. padding-left: 15px;
  155. display: block;
  156. color: rgb(50,50,50);
  157. background: none;
  158. }
  159. .help-list ul.list-body li a:hover {
  160. color: #5078cb;
  161. cursor: pointer;
  162. }
  163. .help-list ul.list-body li a.cur,.help-list ul li a.cur{
  164. text-decoration: none;
  165. font-size: 14px;
  166. }
  167. .help-list .operate-icon {
  168. position: absolute;
  169. right: 20px;
  170. top: 1px;
  171. }
  172. .help-list li>ul>li>ul>li {
  173. padding-left: 30px;
  174. }
  175. </style>