|
@@ -20,7 +20,7 @@
|
|
|
<h4 v-text="nav01.item"></h4>
|
|
|
<div class="row">
|
|
|
<div v-for="nav02 in nav01.children">
|
|
|
- <em></em><nuxt-link :to="`/help/helpList/${nav02.id}`" v-text="nav02.item"></nuxt-link>
|
|
|
+ <em></em><a @click="goToUrl(nav02.id)" v-text="nav02.item"></a>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -33,14 +33,14 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-// 升序
|
|
|
-// function compare (property) {
|
|
|
-// return function (a, b) {
|
|
|
-// var value1 = a[property]
|
|
|
-// var value2 = b[property]
|
|
|
-// return value1 - value2
|
|
|
-// }
|
|
|
-// }
|
|
|
+ // 升序
|
|
|
+ function compare (property) {
|
|
|
+ return function (a, b) {
|
|
|
+ var value1 = a[property]
|
|
|
+ var value2 = b[property]
|
|
|
+ return value1 - value2
|
|
|
+ }
|
|
|
+ }
|
|
|
function sortBy (arr, property) {
|
|
|
for (let i = 0; i < arr.length; i++) {
|
|
|
for (let j = i; j < arr.length; j++) {
|
|
@@ -77,6 +77,18 @@
|
|
|
}
|
|
|
return list
|
|
|
}
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ goToUrl (id) {
|
|
|
+ this.$http.get('/api/help-service/issues', {params: {navId: id}}).then(res => {
|
|
|
+ let helpList = res.data || res.data.sort(compare('detno'))
|
|
|
+ if(helpList && helpList.length === 1) {
|
|
|
+ this.$router.push(`/help/helpDetail/${helpList[0].num}`)
|
|
|
+ } else {
|
|
|
+ this.$router.push(`/help/helpList/${id}`)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|