改进 显示
This commit is contained in:
parent
1ea0db0f3b
commit
1ff1d114ec
@ -1,6 +1,5 @@
|
|||||||
.gitignore
|
.gitignore
|
||||||
.npmignore
|
.npmignore
|
||||||
.openapi-generator-ignore
|
|
||||||
api.ts
|
api.ts
|
||||||
base.ts
|
base.ts
|
||||||
common.ts
|
common.ts
|
||||||
|
@ -157,6 +157,18 @@ export interface ModelSpiderPublic {
|
|||||||
* @interface SpiderAllSpidersResponse
|
* @interface SpiderAllSpidersResponse
|
||||||
*/
|
*/
|
||||||
export interface SpiderAllSpidersResponse {
|
export interface SpiderAllSpidersResponse {
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof SpiderAllSpidersResponse
|
||||||
|
*/
|
||||||
|
'Count'?: number;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @type {number}
|
||||||
|
* @memberof SpiderAllSpidersResponse
|
||||||
|
*/
|
||||||
|
'Limit'?: number;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @type {number}
|
* @type {number}
|
||||||
@ -175,12 +187,6 @@ export interface SpiderAllSpidersResponse {
|
|||||||
* @memberof SpiderAllSpidersResponse
|
* @memberof SpiderAllSpidersResponse
|
||||||
*/
|
*/
|
||||||
'Total'?: number;
|
'Total'?: number;
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @type {number}
|
|
||||||
* @memberof SpiderAllSpidersResponse
|
|
||||||
*/
|
|
||||||
'TotalPages'?: number;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -242,6 +242,12 @@
|
|||||||
"spider.allSpidersResponse": {
|
"spider.allSpidersResponse": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
"Count": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
|
"Limit": {
|
||||||
|
"type": "integer"
|
||||||
|
},
|
||||||
"Page": {
|
"Page": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
},
|
||||||
@ -253,9 +259,6 @@
|
|||||||
},
|
},
|
||||||
"Total": {
|
"Total": {
|
||||||
"type": "integer"
|
"type": "integer"
|
||||||
},
|
|
||||||
"TotalPages": {
|
|
||||||
"type": "integer"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -19,14 +19,21 @@
|
|||||||
rounded="lg"
|
rounded="lg"
|
||||||
prepend-icon="mdi-home"
|
prepend-icon="mdi-home"
|
||||||
title="首页"
|
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>
|
||||||
|
|
||||||
<v-list-item
|
<v-list-item
|
||||||
rounded="lg"
|
rounded="lg"
|
||||||
prepend-icon="mdi-account"
|
prepend-icon="mdi-account"
|
||||||
:title="userStore.access_token ? '注销' : '登录'"
|
:title="userStore.access_token ? '注销' : '登录'"
|
||||||
:to="route_names.login"
|
:to="route('login')"
|
||||||
></v-list-item>
|
></v-list-item>
|
||||||
</v-list>
|
</v-list>
|
||||||
</v-navigation-drawer>
|
</v-navigation-drawer>
|
||||||
@ -47,15 +54,11 @@ const userStore = useUserStore()
|
|||||||
|
|
||||||
const drawer = ref(false);
|
const drawer = ref(false);
|
||||||
|
|
||||||
|
function route(name: string) {
|
||||||
const route_names = ref({
|
return {
|
||||||
"home": {
|
name: name
|
||||||
name: "home"
|
|
||||||
},
|
|
||||||
"login": {
|
|
||||||
name: "login"
|
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,6 +25,18 @@ const routes = [
|
|||||||
component: () => import("@/views/auth/Login.vue"),
|
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({
|
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