Bläddra i källkod

帮助中心 知识列表按detno

ouxq 8 år sedan
förälder
incheckning
b019c7a1cc
3 ändrade filer med 37 tillägg och 2 borttagningar
  1. 7 0
      assets/scss/help.css
  2. 15 1
      components/help/left.vue
  3. 15 1
      pages/help/helpList/_id.vue

+ 7 - 0
assets/scss/help.css

@@ -247,3 +247,10 @@
   position: relative;
   top: -2px;
 }
+.el-tree-node__children .el-tree-node__label{
+  font-size: 12px;
+}
+.el-tree-node__children .el-tree-node__content{
+  height: 26px;
+  line-height: 26px;
+}

+ 15 - 1
components/help/left.vue

@@ -15,6 +15,20 @@
   </div>
 </template>
 <script>
+  // 升序
+  function compare (propertyName) {
+    return function (object1, object2) {
+      var value1 = object1[propertyName]
+      var value2 = object2[propertyName]
+      if (value1 > value2) {
+        return 1
+      } else if (value1 < value2) {
+        return -1
+      } else {
+        return 0
+      }
+    }
+  }
   export default {
     name: 'left',
     data () {
@@ -27,7 +41,7 @@
     },
     computed: {
       helps () {
-        return this.$store.state.help.snapsho.data
+        return this.$store.state.help.snapsho.data.sort(compare('detno'))
       }
     },
     methods: {

+ 15 - 1
pages/help/helpList/_id.vue

@@ -35,6 +35,20 @@
 </div>
 </template>
 <script>
+  // 升序
+  function compare (propertyName) {
+    return function (object1, object2) {
+      var value1 = object1[propertyName]
+      var value2 = object2[propertyName]
+      if (value1 > value2) {
+        return 1
+      } else if (value1 < value2) {
+        return -1
+      } else {
+        return 0
+      }
+    }
+  }
   import { left, helpHeader } from '~components/help'
   export default {
     name: 'help',
@@ -54,7 +68,7 @@
         return this.$store.state.help.title.data
       },
       helpList () {
-        return this.$store.state.help.helplist.data
+        return this.$store.state.help.helplist.data.sort(compare('detno'))
       }
     }
   }