This commit is contained in:
2023-06-12 15:20:45 +08:00
commit 029557a5c0
30 changed files with 2551 additions and 0 deletions

24
view/src/.gitignore vendored Normal file
View File

@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
node_modules
dist
dist-ssr
*.local
# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

13
view/src/App.vue Normal file
View File

@@ -0,0 +1,13 @@
<script setup>
</script>
<template>
<router-view></router-view>
</template>
<style scoped>
*{
padding: 0;
margin: 0;
}
</style>

1
view/src/assets/vue.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>

After

Width:  |  Height:  |  Size: 496 B

View File

@@ -0,0 +1,40 @@
<script setup>
import { ref } from 'vue'
defineProps({
msg: String,
})
const count = ref(0)
</script>
<template>
<h1>{{ msg }}</h1>
<div class="card">
<button type="button" @click="count++">count is {{ count }}</button>
<p>
Edit
<code>components/HelloWorld.vue</code> to test HMR
</p>
</div>
<p>
Check out
<a href="https://vuejs.org/guide/quick-start.html#local" target="_blank"
>create-vue</a
>, the official Vue + Vite starter
</p>
<p>
Install
<a href="https://github.com/vuejs/language-tools" target="_blank">Volar</a>
in your IDE for a better DX
</p>
<p class="read-the-docs">Click on the Vite and Vue logos to learn more</p>
</template>
<style scoped>
.read-the-docs {
color: #888;
}
</style>

8
view/src/main.js Normal file
View File

@@ -0,0 +1,8 @@
import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import { router } from './router'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
createApp(App).use(router).use(ElementPlus).mount('#app')

95
view/src/page/index.vue Normal file
View File

@@ -0,0 +1,95 @@
<template>
<div class="url">
<el-form-item label="视频地址">
<div style="display: flex;width: 100%;">
<el-input style="width: 100%;" v-model="form.name" />
<el-button style="flex-shrink: 0;margin: 0 10px;" @click="getlist" type="primary">获取</el-button>
</div>
</el-form-item>
<el-form-item label="第几集开始">
<div style="display: flex;">
<el-input v-model="form.start" />
<el-button style="flex-shrink: 0;margin: 0 10px;" @click="setlist" type="primary">设置</el-button>
<el-button style="flex-shrink: 0;margin: 0 10px;" @click="dow" type="primary">下载</el-button>
</div>
</el-form-item>
<el-table ref="table" :data="tableData" style="width: 100%">
<el-table-column type="selection" width="55" />
<el-table-column label="title" prop="title">
</el-table-column>
<el-table-column label="url" prop="url" />
</el-table>
<el-dialog :fullscreen="true" :close-on-click-modal="false" :close-on-press-escape="false" v-model="dialogVisible" :show-close="false" title="Tips" width="30%" >
<div style="width: 100%;height: 100%;overflow-y: auto;">
<div v-for="i in msg">{{ i }}</div>
</div>
</el-dialog>
</div>
</template>
<script setup>
import { ref } from 'vue';
import { ElLoading,ElMessage } from 'element-plus'
const dialogVisible = ref(false)
const form = ref({
name: "https://v.qq.com/x/cover/mzc002007vp35qj.html",
start: 1
})
const tableData = ref([])
const table = ref()
function getlist() {
let load = ElLoading.service()
window.getlist(form.value.name).then((res) => {
console.log(res)
tableData.value = res
load.close()
})
}
function setlist() {
table.value.clearSelection()
for (let i = form.value.start - 1; i < tableData.value.length; i++) {
console.log(i)
table.value.toggleRowSelection(tableData.value[i], undefined)
}
}
function handleSelectionChange(i) {
console.log(i)
}
const msg = ref([])
function log(res,i,end) {
console.log(end)
if(end){
res()
}else{
msg.value.unshift(i)
}
}
function down(info) {
return new Promise((res) => {
const callback = log.bind(this,res)
window.dowload(info,callback)
})
}
async function dow() {
dialogVisible.value = true
let list = table.value.getSelectionRows()
for(let i of list){
await down(i)
}
dialogVisible.value = false
ElMessage({
showClose: true,
message: '下载完成',
type: 'success',
duration:0
})
}
</script>
<style lang="scss" scoped>
.url {}
</style>

13
view/src/router/index.js Normal file
View File

@@ -0,0 +1,13 @@
import { createRouter,createWebHashHistory } from "vue-router";
const routes = [{
path:"/",
component:()=> import("../page/index.vue")
}]
export const router = createRouter({
history: createWebHashHistory(),
routes
})

0
view/src/style.css Normal file
View File