Commit a1c51994 by yzh

feat:完成任务信息静态页面

parent 79046fce
...@@ -14,12 +14,10 @@ ...@@ -14,12 +14,10 @@
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
/> />
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from 'vue' import { computed } from 'vue'
defineOptions({ name: 'Pagination' }) defineOptions({ name: 'Pagination' })
const props = defineProps({ const props = defineProps({
// 总条目数 // 总条目数
total: { total: {
......
<template> <template>
<div> <div>
<span>关键词搜索</span> <span>关键词搜索:</span>
<el-input v-model="input2" style="width: 240px" placeholder="Search" :prefix-icon="Search" /> <el-input v-model="input2" style="width: 240px" placeholder="Search" :prefix-icon="Search" />
</div> </div>
</template> </template>
<script> <script setup lang="ts">
const props = defineProps({
to: {
type: String,
required: true
}
})
</script> </script>
\ No newline at end of file
...@@ -26,9 +26,7 @@ const logout = async () => { ...@@ -26,9 +26,7 @@ const logout = async () => {
<template> <template>
<div class="navbar"> <div class="navbar">
<hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> <hamburger :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
<breadcrumb class="breadcrumb-container" /> <breadcrumb class="breadcrumb-container" />
<div class="right-menu"> <div class="right-menu">
<el-dropdown class="avatar-container" trigger="click"> <el-dropdown class="avatar-container" trigger="click">
<div class="avatar-wrapper"> <div class="avatar-wrapper">
......
...@@ -208,6 +208,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [ ...@@ -208,6 +208,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [
{ {
path: "/os-status", path: "/os-status",
redirect: "/os-status/list",
component: Layout, component: Layout,
children: [ children: [
{ {
...@@ -221,6 +222,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [ ...@@ -221,6 +222,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [
{ {
path: "/os-taskInformation", path: "/os-taskInformation",
redirect: "/os-taskInformation/list",
component: Layout, component: Layout,
children: [ children: [
{ {
...@@ -234,6 +236,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [ ...@@ -234,6 +236,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [
{ {
path: "/os-taskRecord", path: "/os-taskRecord",
redirect: "/os-taskRecord/list",
component: Layout, component: Layout,
children: [ children: [
{ {
...@@ -247,6 +250,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [ ...@@ -247,6 +250,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [
{ {
path: "/os-dataDisplay", path: "/os-dataDisplay",
redirect: "/os-dataDisplay/list",
component: Layout, component: Layout,
children: [ children: [
{ {
...@@ -260,6 +264,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [ ...@@ -260,6 +264,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [
{ {
path: "/os-preprocessingRecord", path: "/os-preprocessingRecord",
redirect: "/os-preprocessingRecord/list",
component: Layout, component: Layout,
children: [ children: [
{ {
...@@ -273,6 +278,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [ ...@@ -273,6 +278,7 @@ export const constantRoutes: Array<RouteRecordRaw> = [
{ {
path: "/os-system", path: "/os-system",
redirect: "/os-system/list",
component: Layout, component: Layout,
children: [ children: [
{ {
......
...@@ -26,15 +26,12 @@ const resetData = (id: string) => { ...@@ -26,15 +26,12 @@ const resetData = (id: string) => {
@on-init="handleSelectScrapydServerInit" @on-init="handleSelectScrapydServerInit"
@change="resetData" @change="resetData"
/> />
<div class="mt-md"> <div class="mt-md">
<home-data-info <home-data-info
:key="scrapydServerId" :key="scrapydServerId"
:scrapyd-server-id="scrapydServerId" :scrapyd-server-id="scrapydServerId"
/> />
<home-system-info /> <home-system-info />
<!-- <home-config /> --> <!-- <home-config /> -->
</div> </div>
</div> </div>
......
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
@success="fetchJobList" @success="fetchJobList"
@on-init="handleToolInit" @on-init="handleToolInit"
/> />
<JobTable <JobTable
:data="jobList" :data="jobList"
:loading="loading" :loading="loading"
......
<template>
<div class="text-left p-10">
<el-form inline>
<el-form-item label="目标选择:">
<el-select v-model="taskValue" placeholder=" " style="width: 140px">
<el-option v-for="item in taskOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="分类选择:">
<el-select v-model="errorValue" placeholder=" " style="width: 140px">
<el-option v-for="item in taskOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="关键词搜索:">
<el-input v-model="searchInput" style="width: 240px" placeholder="Search" :prefix-icon="Search" />
</el-form-item>
<el-form-item label="时间:">
<el-date-picker v-model="timeValue" type="datetimerange" range-separator="-" start-placeholder="开始时间"
end-placeholder="结束时间" />
</el-form-item>
<el-form-item>
<el-button type="primary">查询</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary">批量导出</el-button>
<el-button type="danger">批量删除</el-button>
</el-form-item>
</el-form>
</div>
<el-table :data="tableData" style="width: 100%" border>
<el-table-column type="selection" width="55" />
<el-table-column property="name" label="序号" width="60" />
<el-table-column property="name" label="目标名称" width="160" show-overflow-tooltip />
<el-table-column property="name" label="标题" width="160" show-overflow-tooltip />
<el-table-column property="name" label="关键字" width="160" show-overflow-tooltip />
<el-table-column property="name" label="数据分类" width="160" show-overflow-tooltip />
<el-table-column property="name" label="数据时间" width="220" show-overflow-tooltip />
<el-table-column property="name" label="记录时间" width="220" show-overflow-tooltip />
<el-table-column label="操作">
<template #default="scope">
<el-button type="primary" plain @click="handleDetails(scope.row)">
编辑
</el-button>
<el-button type="success" plain @click="handleDetails(scope.row)">
详情
</el-button>
<el-button type="danger" plain @click="handleConfirm(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination w-full flex flex-row-reverse pr-4 m-t-4">
<Pagination :total="pageObj.total" v-model:page="pageObj.pageNo" v-model:limit="pageObj.pageSize"
@pagination="getData" />
<!-- <el-pagination background v-model:current-page="currentPage4" v-model:page-size="pageSize4"
:page-sizes="[10, 20, 50, 100]" :size="paginationSize" :disabled="disabled"
layout="total, sizes, prev, pager, next, jumper" :total="400" @size-change="handleSizeChange"
@current-change="handleCurrentChange" /> -->
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import Pagination from '@/components/pagination/index.vue'
import { Search } from '@element-plus/icons-vue'
const errorValue = ref('')
const taskValue = ref('')
const timeValue = ref('')
const searchInput = ref('')
const taskOptions = [
{
value: 'task1',
label: 'sk网',
},
{
value: 'task2',
label: 'nasa网',
},
{
value: 'task3',
label: '网',
},
]
const tableData = ref([
{
name: '1',
address: 'sk网',
address1: '成功',
address2: '100',
address3: '0',
address4: '无',
address5: '10s',
address6: '2023-05-13 10:00:00',
}
])
const pageObj = ref({
total: 10,
pageSize: 10,
pageNo: 1
})
const paginationSize = ref('default')
const disabled = ref(false)
const background = ref(false)
const currentPage4 = ref(4)
const pageSize4 = ref(10)
const handleSizeChange = (val: number) => {
}
const handleCurrentChange = (val: number) => {
}
const handleDetails = (row: any) => {
console.log(row);
}
const handleConfirm = (row: any) => {
console.log(row);
}
const getData = () => {
console.log('getData');
}
</script>
<style scoped>
.el-button:focus {
outline: none;
}
</style>
<template>
<div class="text-left p-10">
<el-form inline>
<el-form-item label="目标选择:">
<el-select v-model="taskValue" placeholder=" " style="width: 200px">
<el-option v-for="item in taskOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="预处理结果选择:">
<el-select v-model="errorValue" placeholder=" " style="width: 200px">
<el-option v-for="item in taskOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="时间:">
<el-date-picker v-model="timeValue" type="datetimerange" range-separator="-" start-placeholder="开始时间"
end-placeholder="结束时间" />
</el-form-item>
<el-form-item>
<el-button type="primary">查询</el-button>
</el-form-item>
<el-form-item>
<el-button type="danger">批量处理</el-button>
</el-form-item>
</el-form>
</div>
<el-table :data="tableData" style="width: 100%" border>
<el-table-column type="selection" width="55" />
<el-table-column property="name" label="序号" width="60" />
<el-table-column property="name" label="目标名称" width="160" show-overflow-tooltip />
<el-table-column property="name" label="标题" width="160" show-overflow-tooltip />
<el-table-column property="name" label="关键字" width="160" show-overflow-tooltip />
<el-table-column property="name" label="数据分类" width="160" show-overflow-tooltip />
<el-table-column property="name" label="数据时间" width="220" show-overflow-tooltip />
<el-table-column property="name" label="记录时间" width="220" show-overflow-tooltip />
<el-table-column label="操作">
<template #default="scope">
<el-button type="primary" @click="handleDetails(scope.row)">
编辑
</el-button>
<el-button type="success" @click="handleDetails(scope.row)">
详情
</el-button>
<el-button type="danger" @click="handleConfirm(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination w-full flex flex-row-reverse pr-4 m-t-4">
<Pagination :total="pageObj.total" v-model:page="pageObj.pageNo" v-model:limit="pageObj.pageSize"
@pagination="getData" />
<!-- <el-pagination background v-model:current-page="currentPage4" v-model:page-size="pageSize4"
:page-sizes="[10, 20, 50, 100]" :size="paginationSize" :disabled="disabled"
layout="total, sizes, prev, pager, next, jumper" :total="400" @size-change="handleSizeChange"
@current-change="handleCurrentChange" /> -->
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import Pagination from '@/components/pagination/index.vue'
const errorValue = ref('')
const taskValue = ref('')
const timeValue = ref('')
const searchInput = ref('')
const taskOptions = [
{
value: 'task1',
label: 'sk网',
},
{
value: 'task2',
label: 'nasa网',
},
{
value: 'task3',
label: '网',
},
]
const tableData = ref([
{
name: '1',
address: 'sk网',
address1: '成功',
address2: '100',
address3: '0',
address4: '无',
address5: '10s',
address6: '2023-05-13 10:00:00',
}
])
const pageObj = ref({
total: 10,
pageSize: 10,
pageNo: 1
})
const paginationSize = ref('default')
const disabled = ref(false)
const background = ref(false)
const currentPage4 = ref(4)
const pageSize4 = ref(10)
const handleSizeChange = (val: number) => {
}
const handleCurrentChange = (val: number) => {
}
const handleDetails = (row: any) => {
console.log(row);
}
const handleConfirm = (row: any) => {
console.log(row);
}
const getData = () => {
console.log('getData');
}
</script>
<style scoped></style>
...@@ -83,7 +83,7 @@ defineProps({ ...@@ -83,7 +83,7 @@ defineProps({
<style lang="scss" scoped> <style lang="scss" scoped>
.dataCard { .dataCard {
background: #eae6e6; background: #c6ebfc;
border: 1.5px solid rgb(193, 188, 188); border: 1.5px solid rgb(193, 188, 188);
width: 400px; width: 400px;
height: 14vh; height: 14vh;
......
...@@ -82,7 +82,7 @@ const options = [ ...@@ -82,7 +82,7 @@ const options = [
<style lang="scss" scoped> <style lang="scss" scoped>
.taskCard { .taskCard {
background: #eae6e6; background: #c6ebfc;
margin-bottom: 20px; margin-bottom: 20px;
border: 1.5px solid rgb(193, 188, 188); border: 1.5px solid rgb(193, 188, 188);
width: 400px; width: 400px;
......
<template>
<div class="text-left p-10">
<el-form inline>
<el-form-item label="角色选择:">
<el-select v-model="taskValue" placeholder=" " style="width: 200px">
<el-option v-for="item in taskOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary">创建用户</el-button>
</el-form-item>
<el-form-item>
<el-button type="danger">批量删除</el-button>
</el-form-item>
</el-form>
</div>
<el-table :data="tableData" style="width: 100%" border>
<el-table-column type="selection" width="55" />
<el-table-column property="name" label="序号" width="100" />
<el-table-column property="name" label="用户名" width="280" show-overflow-tooltip />
<el-table-column property="name" label="用户名称" width="280" show-overflow-tooltip />
<el-table-column property="name" label="角色" width="280" show-overflow-tooltip />
<el-table-column property="name" label="创建时间" width="280" show-overflow-tooltip />
<el-table-column label="操作">
<template #default="scope">
<el-button type="primary" @click="handleDetails(scope.row)">
编辑
</el-button>
<el-button type="success" @click="handleDetails(scope.row)">
详情
</el-button>
<el-button type="danger" @click="handleConfirm(scope.row)">
删除
</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination w-full flex flex-row-reverse pr-4 m-t-4">
<Pagination :total="pageObj.total" v-model:page="pageObj.pageNo" v-model:limit="pageObj.pageSize"
@pagination="getData" />
<!-- <el-pagination background v-model:current-page="currentPage4" v-model:page-size="pageSize4"
:page-sizes="[10, 20, 50, 100]" :size="paginationSize" :disabled="disabled"
layout="total, sizes, prev, pager, next, jumper" :total="400" @size-change="handleSizeChange"
@current-change="handleCurrentChange" /> -->
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import Pagination from '@/components/pagination/index.vue'
const errorValue = ref('')
const taskValue = ref('')
const timeValue = ref('')
const searchInput = ref('')
const taskOptions = [
{
value: 'task1',
label: 'sk网',
},
{
value: 'task2',
label: 'nasa网',
},
{
value: 'task3',
label: '网',
},
]
const tableData = ref([
{
name: '1',
address: 'sk网',
address1: '成功',
address2: '100',
address3: '0',
address4: '无',
address5: '10s',
address6: '2023-05-13 10:00:00',
}
])
const pageObj = ref({
total: 10,
pageSize: 10,
pageNo: 1
})
const paginationSize = ref('default')
const disabled = ref(false)
const background = ref(false)
const currentPage4 = ref(4)
const pageSize4 = ref(10)
const handleSizeChange = (val: number) => {
}
const handleCurrentChange = (val: number) => {
}
const handleDetails = (row: any) => {
console.log(row);
}
const handleConfirm = (row: any) => {
console.log(row);
}
const getData = () => {
console.log('getData');
}
</script>
<style scoped></style>
<!-- 任务执行统计卡片组件 -->
<template>
<div class="taskCard m-r-16 p-6" v-for="i in options" :key="i.value">
<div class="titleStyle">
<span>xx任务</span>
<span> 启用 </span>
<el-switch v-model="taskSwitch"/>
</div>
<div class="flex justify-center">
<!-- <el-form-item> -->
<el-button type="primary">编辑</el-button>
<el-button type="success">详情</el-button>
<el-button type="danger">删除</el-button>
<!-- </el-form-item> -->
</div>
<div class="wordStyle ">
<span>目标网站: {{ successTask }} ; </span>
<span> 执行频率: {{ successTask }} </span>
</div>
<div class="wordStyle">
<span>执行次数: {{ failTask }} 个; </span>
<span> 成功次数: {{ failTask }}</span>
</div>
<div class="wordStyle">
<span>失败次数: {{ failTask }} 个; </span>
<span> 异常记录: {{ unusualTask }}</span>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
defineProps({
successTask: {
type: String,
default: ''
},
failTask: {
type: String,
default: ''
},
unusualTask: {
type: String,
default: ''
}
})
const taskSwitch = ref(false)
const options = [
{
value: 'year',
label: '近一年',
},
{
value: 'month',
label: '近一月',
},
{
value: 'week',
label: '近一周',
},
{
value: 'day',
label: '近一日',
},
{
value: 'year',
label: '近一年',
},
{
value: 'month',
label: '近一月',
},
{
value: 'week',
label: '近一周',
},
{
value: 'day',
label: '近一日',
},
{
value: 'year',
label: '近一年',
},
]
</script>
<style lang="scss" scoped>
.taskCard {
background: #c6ebfc;
margin-bottom: 20px;
border: 1.5px solid rgb(255, 255, 255);
width: 400px;
font-size: 20px;
height: 15.5vh;
border-radius: 7px;
.titleStyle {
font-size: 22px;
margin-top: -5px;
}
.wordStyle {
font-size: 16px;
}
}
</style>
<template> <template>
111 <div class="text-left p-8">
<el-form inline>
<el-form-item label="关键词搜索:">
<el-input v-model="searchInput" style="width: 240px" placeholder="Search" :prefix-icon="Search" />
</el-form-item>
<el-form-item>
<el-button type="primary">创建任务</el-button>
</el-form-item>
</el-form>
</div>
<div class="flex flex-wrap m-t--2 justify-center">
<taskCard successTask="100" failTask="10" unusualTask="1" />
</div>
<div class="pagination w-full flex flex-row-reverse pr-4 m-t-4 ">
<Pagination :total="pageObj.total" v-model:page="pageObj.pageNo" v-model:limit="pageObj.pageSize"
@pagination="getData" />
</div>
</template> </template>
<script> <script setup lang="ts">
import { ref } from 'vue'
import { Search } from '@element-plus/icons-vue'
import Pagination from '@/components/pagination/index.vue'
import taskCard from './components/taskCard.vue'
const errorValue = ref('')
const taskValue = ref('')
const timeValue = ref('')
const searchInput = ref('')
const taskOptions = [
{
value: 'task1',
label: 'sk网',
},
{
value: 'task2',
label: 'nasa网',
},
{
value: 'task3',
label: '网',
},
]
const tableData = ref([
{
name: '1',
address: 'sk网',
address1: '成功',
address2: '100',
address3: '0',
address4: '无',
address5: '10s',
address6: '2023-05-13 10:00:00',
}
])
const pageObj = ref({
total: 10,
pageSize: 10,
pageNo: 1
})
const paginationSize = ref('default')
const disabled = ref(false)
const background = ref(false)
const currentPage4 = ref(4)
const pageSize4 = ref(10)
const handleSizeChange = (val: number) => {
}
const handleCurrentChange = (val: number) => {
}
const handleDetails = (row: any) => {
console.log(row);
}
const handleConfirm = (row: any) => {
console.log(row);
}
const getData = () => {
console.log('getData');
}
</script>
</script> <style scoped></style>
\ No newline at end of file
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue' import { ref } from 'vue'
import Pagination from '@/components/pagination/index.vue' import Pagination from '@/components/pagination/index.vue'
const errorValue = ref('') const errorValue = ref('')
const taskValue = ref('') const taskValue = ref('')
const timeValue = ref('') const timeValue = ref('')
......
<template> <template>
<div class="app-container"> <div class="app-container">
<schedule-tool @success="getData" /> <schedule-tool @success="getData" />
<div style="height: 20px"></div> <div style="height: 20px"></div>
<schedule-table <schedule-table
:data="list" :data="list"
@success="getData" @success="getData"
......
<template> <template>
<div class="app-container"> <div class="app-container">
<ScrapydServerTool @success="getData" /> <ScrapydServerTool @success="getData" />
<div style="height:20px"></div> <div style="height:20px"></div>
<ScrapydServerTable <ScrapydServerTable
:data="list" :data="list"
:loading="listLoading" :loading="listLoading"
@success="getData" @success="getData"
/> />
</div> </div>
</template> </template>
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
<span>爬虫统计数据</span> <span>爬虫统计数据</span>
</div> </div>
</template> </template>
<!-- 工具栏组件 --> <!-- 工具栏组件 -->
<stats-tool <stats-tool
v-model:scrapyd-server-id="scrapydServerId" v-model:scrapyd-server-id="scrapydServerId"
...@@ -17,14 +16,12 @@ ...@@ -17,14 +16,12 @@
@spider-change="handleSpiderChange" @spider-change="handleSpiderChange"
@success="handleSuccess" @success="handleSuccess"
/> />
<!-- 统计数据表格 --> <!-- 统计数据表格 -->
<stats-table <stats-table
:data="list" :data="list"
v-loading="listLoading" v-loading="listLoading"
@sort-change="handleSortChange" @sort-change="handleSortChange"
/> />
<!-- 分页控件 --> <!-- 分页控件 -->
<div class="pagination-container"> <div class="pagination-container">
<el-config-provider :locale="zhCn"> <el-config-provider :locale="zhCn">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment