改进 显示
This commit is contained in:
parent
1ea0db0f3b
commit
1ff1d114ec
@ -1,6 +1,5 @@
|
||||
.gitignore
|
||||
.npmignore
|
||||
.openapi-generator-ignore
|
||||
api.ts
|
||||
base.ts
|
||||
common.ts
|
||||
|
@ -157,6 +157,18 @@ export interface ModelSpiderPublic {
|
||||
* @interface SpiderAllSpidersResponse
|
||||
*/
|
||||
export interface SpiderAllSpidersResponse {
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof SpiderAllSpidersResponse
|
||||
*/
|
||||
'Count'?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof SpiderAllSpidersResponse
|
||||
*/
|
||||
'Limit'?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
@ -175,12 +187,6 @@ export interface SpiderAllSpidersResponse {
|
||||
* @memberof SpiderAllSpidersResponse
|
||||
*/
|
||||
'Total'?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof SpiderAllSpidersResponse
|
||||
*/
|
||||
'TotalPages'?: number;
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
@ -242,6 +242,12 @@
|
||||
"spider.allSpidersResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"Count": {
|
||||
"type": "integer"
|
||||
},
|
||||
"Limit": {
|
||||
"type": "integer"
|
||||
},
|
||||
"Page": {
|
||||
"type": "integer"
|
||||
},
|
||||
@ -253,9 +259,6 @@
|
||||
},
|
||||
"Total": {
|
||||
"type": "integer"
|
||||
},
|
||||
"TotalPages": {
|
||||
"type": "integer"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -19,14 +19,21 @@
|
||||
rounded="lg"
|
||||
prepend-icon="mdi-home"
|
||||
title="首页"
|
||||
:to="route_names.home"
|
||||
:to="route('home')"
|
||||
></v-list-item>
|
||||
|
||||
<v-list-item
|
||||
rounded="lg"
|
||||
prepend-icon="mdi-home"
|
||||
title="蜘蛛"
|
||||
:to="route('spiders.index')"
|
||||
></v-list-item>
|
||||
|
||||
<v-list-item
|
||||
rounded="lg"
|
||||
prepend-icon="mdi-account"
|
||||
:title="userStore.access_token ? '注销' : '登录'"
|
||||
:to="route_names.login"
|
||||
:to="route('login')"
|
||||
></v-list-item>
|
||||
</v-list>
|
||||
</v-navigation-drawer>
|
||||
@ -47,15 +54,11 @@ const userStore = useUserStore()
|
||||
|
||||
const drawer = ref(false);
|
||||
|
||||
|
||||
const route_names = ref({
|
||||
"home": {
|
||||
name: "home"
|
||||
},
|
||||
"login": {
|
||||
name: "login"
|
||||
function route(name: string) {
|
||||
return {
|
||||
name: name
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -25,6 +25,18 @@ const routes = [
|
||||
component: () => import("@/views/auth/Login.vue"),
|
||||
},
|
||||
|
||||
{
|
||||
path: "/spiders",
|
||||
name: "spiders.index",
|
||||
meta: {
|
||||
auth: false,
|
||||
},
|
||||
// route level code-splitting
|
||||
// this generates a separate chunk (Home-[hash].js) for this route
|
||||
// which is lazy-loaded when the route is visited.
|
||||
component: () => import("@/views/spiders/List.vue"),
|
||||
},
|
||||
|
||||
];
|
||||
|
||||
const router = createRouter({
|
||||
|
77
src/views/spiders/List.vue
Normal file
77
src/views/spiders/List.vue
Normal file
@ -0,0 +1,77 @@
|
||||
<template>
|
||||
<h1>蜘蛛</h1>
|
||||
<p>蜘蛛将不定期的查询网页。</p>
|
||||
|
||||
<v-card class="mt-3">
|
||||
<v-list>
|
||||
<v-list-item
|
||||
v-for="item in spiders.Spiders"
|
||||
:key="item.Id"
|
||||
>
|
||||
|
||||
|
||||
<template v-slot:append="{ isActive }">
|
||||
<v-list-item-action end>
|
||||
<v-btn rounded="xl" @click.stop="console.log(isActive)">
|
||||
<v-icon>mdi-check</v-icon>
|
||||
</v-btn>
|
||||
</v-list-item-action>
|
||||
</template>
|
||||
|
||||
<v-list-item-title>{{ item.Name }}</v-list-item-title>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-card>
|
||||
|
||||
<div class="text-center">
|
||||
<v-container>
|
||||
<v-row justify="center">
|
||||
<v-col cols="8">
|
||||
<v-container class="max-width">
|
||||
<v-pagination
|
||||
v-model="page"
|
||||
class="my-4"
|
||||
:length="spiders.Total"
|
||||
:disabled="loading"
|
||||
@update:model-value="load"
|
||||
></v-pagination>
|
||||
</v-container>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {theSpiderApi} from "@/plugins/api";
|
||||
|
||||
|
||||
|
||||
const page = ref(1);
|
||||
const spiders = ref({});
|
||||
const loading = ref(false);
|
||||
|
||||
const load = () => {
|
||||
|
||||
|
||||
theSpiderApi
|
||||
.apiSpidersGet({
|
||||
params: {
|
||||
page: page.value,
|
||||
},
|
||||
})
|
||||
.then((r) => {
|
||||
spiders.value = r.data;
|
||||
page.value = r.data.Page;
|
||||
console.log(r.data.spider);
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
|
||||
});
|
||||
};
|
||||
|
||||
load()
|
||||
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user