left.vue 4.0 KB

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