add 订阅历史
This commit is contained in:
parent
637e2799f2
commit
c0c122e9ca
@ -53,7 +53,7 @@ router.post("/addSubscribe", async (ctx) => {
|
||||
* 获取订阅列表
|
||||
*/
|
||||
router.get("/getSubscribe", async (ctx) => {
|
||||
ctx.body = await getSub()
|
||||
ctx.body = await getSub(ctx.query.state)
|
||||
})
|
||||
|
||||
/**
|
||||
|
@ -13,8 +13,8 @@ async function addSub(info){
|
||||
}
|
||||
|
||||
// 获取所有订阅 (不包括已完成)
|
||||
async function getSub(){
|
||||
let sql = `select * from VideoInfo where enable=1`
|
||||
async function getSub(state){
|
||||
let sql = `select * from VideoInfo where enable=${state}`
|
||||
let list = await getAll(sql)
|
||||
return list
|
||||
}
|
||||
|
@ -28,8 +28,12 @@ export async function addSubscribe(data) {
|
||||
return await base.post("/videoInfo/addSubscribe", data)
|
||||
}
|
||||
|
||||
export async function getSubscribe(){
|
||||
return await base.get("/videoInfo/getSubscribe")
|
||||
export async function getSubscribe(state){
|
||||
return await base.get("/videoInfo/getSubscribe",{
|
||||
params:{
|
||||
state
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,10 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-radio-group v-model="labelPosition" label="label position">
|
||||
<el-radio-button label="1">订阅中</el-radio-button>
|
||||
<el-radio-button label="2">已完成</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div class="list">
|
||||
<div class="item" v-for="i in list">
|
||||
<el-card :body-style="{ padding: '0px' }">
|
||||
@ -17,13 +23,18 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {onMounted, ref} from "vue";
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import { delSubscribe, getSubscribe } from '../../api/Video.js'
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
|
||||
const list = ref<any>([])
|
||||
const labelPosition = ref("1")
|
||||
watch(labelPosition, async () => {
|
||||
const res = await getSubscribe(labelPosition.value)
|
||||
list.value = res.data
|
||||
})
|
||||
onMounted(async () => {
|
||||
const res = await getSubscribe()
|
||||
const res = await getSubscribe(labelPosition.value)
|
||||
list.value = res.data
|
||||
})
|
||||
function del(id) {
|
||||
|
Loading…
Reference in New Issue
Block a user