master
yutent 2023-03-09 19:27:42 +08:00
parent 03f69e50e6
commit e350297a44
3 changed files with 23 additions and 8 deletions

View File

@ -2,10 +2,10 @@
"name": "jscdn.ink", "name": "jscdn.ink",
"type": "module", "type": "module",
"scripts": { "scripts": {
"start": "vue-live dev", "start": "fite dev",
"build": "vue-live build" "build": "fite build"
}, },
"devDependencies": { "devDependencies": {
"@bytedo/vue-live": "^0.1.4" "fite": "^0.3.3"
} }
} }

View File

@ -61,6 +61,7 @@ export default {
mounted() { mounted() {
this.$store.searchShow = true this.$store.searchShow = true
console.log(this.$route.query)
} }
} }
</script> </script>

View File

@ -15,7 +15,9 @@
</div> </div>
<wc-table class="list" :thead="thead"> <wc-table class="list" :thead="thead">
<wc-tr v-for="it of list" :key="it.id"> <wc-tr v-for="it of list" :key="it.id">
<wc-td align="center">{{ it.id }}</wc-td> <wc-td align="center">
<router-link :to="'/?name=' + it.id">{{ it.id }}</router-link>
</wc-td>
<wc-td align="center">{{ it.author }}</wc-td> <wc-td align="center">{{ it.author }}</wc-td>
<wc-td align="center">{{ it.latest || '-' }}</wc-td> <wc-td align="center">{{ it.latest || '-' }}</wc-td>
<wc-td align="center">{{ it.latest ? it.sync_date : '-' }}</wc-td> <wc-td align="center">{{ it.latest ? it.sync_date : '-' }}</wc-td>
@ -54,6 +56,7 @@
class="pager" class="pager"
layout="prev,pages,next" layout="prev,pages,next"
red red
@page-change="pageChanged"
:total="total" :total="total"
:page="page" :page="page"
/> />
@ -138,13 +141,24 @@ export default {
this.$list = r.data.map( this.$list = r.data.map(
it => ((it.sync_date = new Date(it.sync_date).format('Y/m/d')), it) it => ((it.sync_date = new Date(it.sync_date).format('Y/m/d')), it)
) )
this.list = this.$list.filter(it => this.fetchPage()
this.onlyShowWaited ? it.stat === 1 : true this.total = this.$list.length
)
this.total = this.list.length
}) })
}, },
fetchPage() {
let start = (this.page - 1) * 20
let end = start + 20
this.list = this.$list
.filter(it => (this.onlyShowWaited ? it.stat === 1 : true))
.slice(start, end)
},
pageChanged(ev) {
this.page = ev.detail
this.fetchPage()
},
search() { search() {
let filter = this.filter.trim() let filter = this.filter.trim()
let onlyShowWaited = this.onlyShowWaited let onlyShowWaited = this.onlyShowWaited