Commit 4da0d493 by yzh

feat:删除不要的

parent aafd1af0
...@@ -35,7 +35,6 @@ const alwaysShowRootMenu = computed(() => { ...@@ -35,7 +35,6 @@ const alwaysShowRootMenu = computed(() => {
// 解析路径 // 解析路径
const resolvePath = (routePath: string) => { const resolvePath = (routePath: string) => {
console.log(routePath,'222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222');
if (isExternal(routePath)) { if (isExternal(routePath)) {
return routePath return routePath
...@@ -81,8 +80,7 @@ const hasOneShowingChild = (children: MenuItem[] = [], parent: MenuItem): boolea ...@@ -81,8 +80,7 @@ const hasOneShowingChild = (children: MenuItem[] = [], parent: MenuItem): boolea
} }
onMounted(() => { onMounted(() => {
// console.log(props.item,'555555555555555555');
// console.log(onlyOneChild.value,'6666666666666666666666');
}) })
</script> </script>
......
...@@ -14,22 +14,8 @@ const settingsStore = useSettingsStore() ...@@ -14,22 +14,8 @@ const settingsStore = useSettingsStore()
const appStore = useAppStore() const appStore = useAppStore()
const { sidebar } = storeToRefs(appStore) const { sidebar } = storeToRefs(appStore)
const { sidebarLogo } = storeToRefs(settingsStore) const { sidebarLogo } = storeToRefs(settingsStore)
// 获取所有路由配置,而不仅仅是匹配的路由
// const routes = computed(() => {
// // 获取路由器中的所有路由
// return router.options.routes.filter(item => {
// // 过滤掉设置了hidden的路由
// // @ts-ignore - hidden 属性在实际路由对象中存在,但TypeScript类型定义中没有
// return !(item.hidden || (item.meta && item.meta.hidden))
// })
// })
const routes = computed(() => { const routes = computed(() => {
// 递归过滤路由,包括子路由 // 递归过滤路由,包括子路由
console.log(router.options.routes,'99999999999999999999999');
const filterHiddenRoutes = (routes: RouteRecordRaw[]): RouteRecordRaw[] => { const filterHiddenRoutes = (routes: RouteRecordRaw[]): RouteRecordRaw[] => {
return routes.filter((route: any) => { return routes.filter((route: any) => {
...@@ -64,9 +50,6 @@ const activeMenu = computed(() => { ...@@ -64,9 +50,6 @@ const activeMenu = computed(() => {
const isCollapse = computed(() => !sidebar.value.opened) const isCollapse = computed(() => !sidebar.value.opened)
onMounted(()=>{ onMounted(()=>{
console.log(sidebar.value,'88888888888888');
console.log(router.options.routes,'11111111111111111111111111111111111111111111');
console.log(isCollapse,'6666666666666');
}) })
</script> </script>
......
...@@ -220,30 +220,32 @@ export const constantRoutes: Array<RouteRecordRaw> = [ ...@@ -220,30 +220,32 @@ export const constantRoutes: Array<RouteRecordRaw> = [
] ]
} as unknown as RouteRecordRaw, } as unknown as RouteRecordRaw,
{ {
path: "/os-taskManager", path: "/os-taskInformation",
redirect: "/os-status/list", redirect: "/os-taskInformation/list",
component: Layout, component: Layout,
children: [ children: [
{ {
path: "list", path: "list",
name: "taskManager", name: "taskInformation",
component: () => import("@/views/os-taskManager/index.vue"), component: () => import("@/views/os-taskInformation/index.vue"),
meta: { title: "任务管理", icon: "Key" } meta: { title: "任务信息", icon: "Key" }
}, },
] ]
} as unknown as RouteRecordRaw, } as unknown as RouteRecordRaw,
{ {
path: "/os-taskInformation", path: "/os-taskManager",
redirect: "/os-taskInformation/list", redirect: "/os-status/list",
component: Layout, component: Layout,
children: [ children: [
{ {
path: "list", path: "list",
name: "taskInformation", name: "taskManager",
component: () => import("@/views/os-taskInformation/index.vue"), component: () => import("@/views/os-taskManager/index.vue"),
meta: { title: "任务信息", icon: "Key" } meta: { title: "任务执行记录", icon: "Key" }
}, },
] ]
} as unknown as RouteRecordRaw, } as unknown as RouteRecordRaw,
......
...@@ -53,10 +53,6 @@ ...@@ -53,10 +53,6 @@
<div class="pagination w-full flex flex-row-reverse pr-4 m-t-4"> <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 :total="pageObj.total" v-model:page="pageObj.pageNo" v-model:limit="pageObj.pageSize"
@pagination="getData" /> @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> </div>
...@@ -102,15 +98,6 @@ const pageObj = ref({ ...@@ -102,15 +98,6 @@ const pageObj = ref({
pageSize: 10, pageSize: 10,
pageNo: 1 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) => { const handleDetails = (row: any) => {
console.log(row); console.log(row);
} }
......
...@@ -49,10 +49,6 @@ ...@@ -49,10 +49,6 @@
<div class="pagination w-full flex flex-row-reverse pr-4 m-t-4"> <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 :total="pageObj.total" v-model:page="pageObj.pageNo" v-model:limit="pageObj.pageSize"
@pagination="getData" /> @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> </div>
...@@ -112,15 +108,6 @@ const pageObj = ref({ ...@@ -112,15 +108,6 @@ const pageObj = ref({
pageSize: 10, pageSize: 10,
pageNo: 1 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) => { const handleDetails = (row: any) => {
console.log(row); console.log(row);
} }
......
...@@ -38,10 +38,6 @@ ...@@ -38,10 +38,6 @@
<div class="pagination w-full flex flex-row-reverse pr-4 m-t-4"> <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 :total="pageObj.total" v-model:page="pageObj.pageNo" v-model:limit="pageObj.pageSize"
@pagination="getData" /> @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> </div>
...@@ -83,15 +79,6 @@ const pageObj = ref({ ...@@ -83,15 +79,6 @@ const pageObj = ref({
pageSize: 10, pageSize: 10,
pageNo: 1 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) => { const handleDetails = (row: any) => {
console.log(row); console.log(row);
} }
......
<!-- 任务执行统计卡片组件 --> <!-- 任务执行统计卡片组件 -->
<template> <template>
<div class="taskCard p-7" v-for="i in options" :key="i.value"> <div class="taskCard p-7" v-for="i in options" :key="i.value">
<div class="titleStyle"> <div class="flex justify-center">
<span>xx任务</span> <el-form-item>
<span> 启用 </span> <span class="titleStyle">任务名称</span>
<el-switch v-model="taskSwitch"/> </el-form-item>
</div> </div>
<div class="flex justify-center"> <div class="flex justify-center">
<!-- <el-form-item> --> <el-form-item>
<el-button type="primary">编辑</el-button> <el-button type="primary">编辑</el-button>
<el-button type="success">详情</el-button> <el-button type="success">执行记录</el-button>
<el-button type="danger">删除</el-button> <el-button type="danger">删除</el-button>
<!-- </el-form-item> --> </el-form-item>
</div> </div>
<div class="wordStyle "> <div class="wordStyle flex justify-center">
<span>目标网站: {{ successTask }} ; </span> <el-form-item>
<span> 执行频率: {{ successTask }} </span> <el-space>
<span class="wordStyle">启用/停止: </span>
<el-switch v-model="taskSwitch" />
<span class="wordStyle">执行频率: {{ successTask }} </span>
</el-space>
</el-form-item>
</div> </div>
<div class="wordStyle"> <div class="wordStyle flex justify-center">
<span>执行次数: {{ failTask }} 个; </span> <el-form-item>
<span> 成功次数: {{ failTask }}</span> <el-space>
<span class="wordStyle">执行次数: {{ failTask }} 个; </span>
<span class="wordStyle">成功次数: {{ failTask }}</span>
</el-space>
</el-form-item>
</div> </div>
<div class="wordStyle"> <div class="wordStyle flex justify-center">
<span>失败次数: {{ failTask }} 个; </span> <el-form-item>
<span> 异常记录: {{ unusualTask }}</span> <el-space>
<span class="wordStyle">失败次数: {{ failTask }} 个; </span>
<span class="wordStyle">异常记录: {{ unusualTask }}</span>
</el-space>
</el-form-item>
</div> </div>
</div> </div>
</template> </template>
...@@ -80,24 +93,25 @@ const options = [ ...@@ -80,24 +93,25 @@ const options = [
background-image: url("@/assets/picture/box2.png"); background-image: url("@/assets/picture/box2.png");
background-size: 100% 100%; background-size: 100% 100%;
background-repeat: no-repeat; background-repeat: no-repeat;
// background: #c6ebfc;
margin-bottom: 20px; margin-bottom: 20px;
// border: 1.5px solid rgb(255, 255, 255); width: 380px;
width: 350px;
font-size: 20px; font-size: 20px;
height: 100%; height: 100%;
border-radius: 7px; border-radius: 7px;
.titleStyle { .titleStyle {
font-size: 22px; font-size: 22px;
margin-top: -5px; margin-top: -5px;
color: #FFFFFF; color: #FFFFFF;
} }
.wordStyle { .wordStyle {
font-size: 16px; font-size: 16px;
color: #FFFFFF; color: #FFFFFF;
} }
} }
.el-button:focus { .el-button:focus {
outline: none; outline: none;
} }
......
<template> <template>
<div class="text-left p-6"> <div class="m-t-7">
<el-form inline> </div>
<el-form-item label="所属爬虫:"> <div class="text-left p-6 toolbarStyle">
<el-select v-model="taskValue" placeholder="请选择" style="width: 220px" /> <div class="formStyle">
</el-form-item> <el-form inline>
<el-form-item label="任务名称:"> <el-form-item>
<el-input v-model="taskValue" style="width: 220px" /> <el-text class="mx-1">所属爬虫:</el-text>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-space> <div>
<el-button type="primary">查询</el-button> <el-select v-model="taskValue" placeholder="请选择" style="width: 220px">
</el-space> <el-option v-for="item in taskOptions" :key="item.value" :label="item.label"
</el-form-item> :value="item.value" />
<el-form-item> </el-select>
<el-space> </div>
<el-button type="primary">新建任务</el-button> </el-form-item>
</el-space> <el-form-item>
</el-form-item> <el-text class="mx-1">任务名称:</el-text>
</el-form> </el-form-item>
<el-form-item>
<el-input v-model="taskValue" placeholder="请输入" style="width: 220px" />
</el-form-item>
<el-form-item>
<el-space>
<el-button type="primary">查询</el-button>
</el-space>
</el-form-item>
<el-form-item>
<el-space>
<el-button type="primary">新建任务</el-button>
</el-space>
</el-form-item>
</el-form>
</div>
</div> </div>
<div class="cardStyle"> <div class="cardStyle">
<taskCard successTask="100" failTask="10" unusualTask="1" /> <taskCard successTask="100" failTask="10" unusualTask="1" />
<div class="text-right"> <div class="pagination w-full flex flex-row-reverse pr-18 m-t-0">
<Pagination :total="pageObj.total" v-model:page="pageObj.pageNo" v-model:limit="pageObj.pageSize" <Pagination :total="pageObj.total" v-model:page="pageObj.pageNo" v-model:limit="pageObj.pageSize"
@pagination="getData" /> @pagination="getData" />
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
...@@ -73,35 +84,68 @@ const pageObj = ref({ ...@@ -73,35 +84,68 @@ const pageObj = ref({
pageSize: 10, pageSize: 10,
pageNo: 1 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 = () => { const getData = () => {
console.log('getData'); console.log('getData');
} }
</script> </script>
<style scoped> <style scoped>
.cardStyle{ .cardStyle {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-around; justify-content: space-around;
margin-top: 1.5%; margin-top: 1.5%;
padding: 10px; padding: 8px;
height: 25vh; height: 26vh;
}
.el-text {
color: #FFFFFF;
}
.toolbarStyle {
background-image: url("@/assets/picture/box3.png");
background-size: 100% 100%;
background-repeat: no-repeat;
}
.formStyle {
display: flex;
justify-content: space-around;
padding: 3px;
} }
</style> </style>
<style>
/* 修改el选择器的样式 */
.el-select__wrapper {
background-color: #1d5484;
box-shadow: none;
}
/* 删除el选择器选中时的边框 */
.is-hovering {
box-shadow: none !important;
}
/* 修改el输入框的样式 */
.el-input__wrapper {
background-color: #1d5484;
box-shadow: none;
}
/* 修改el下拉框的背景颜色 */
.el-select-dropdown {
background-color: #1d5484;
}
/* 修改el下拉框选项的字体颜色 */
.el-select-dropdown__item {
color: #FFFFFF;
}
/* 修改el下拉框选项选中时的文字颜色 */
.el-select-dropdown__item:hover{
color:#409eff;
}
</style>
\ No newline at end of file
<template> <template>
<div class="text-left p-10"> <div class="m-t-7">
<el-form inline> </div>
<el-form-item label="所属爬虫:"> <div class="text-left p-6 toolbarStyle">
<el-select v-model="taskValue" placeholder="请选择" style="width: 220px" /> <div class="formStyle">
</el-form-item> <el-form inline>
<el-form-item label="任务名称:"> <el-form-item>
<el-input v-model="taskValue" style="width: 220px" /> <el-text class="mx-1">任务名称:</el-text>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-space> <div>
<el-button type="primary">查询</el-button> <el-select v-model="taskValue" placeholder="请选择" style="width: 220px">
</el-space> <el-option v-for="item in taskOptions" :key="item.value" :label="item.label"
</el-form-item> :value="item.value" />
<el-form-item> </el-select>
<el-space> </div>
<el-button type="primary">新建任务</el-button> </el-form-item>
</el-space> <el-form-item>
</el-form-item> <el-text class="mx-1">时间:</el-text>
</el-form> </el-form-item>
<el-form-item>
<el-date-picker v-model="timeValue" type="datetimerange" start-placeholder="Start date"
end-placeholder="End date" format="YYYY-MM-DD HH:mm:ss" date-format="YYYY/MM/DD ddd"
time-format="A hh:mm:ss" />
</el-form-item>
<el-form-item>
<el-text class="mx-1">调度状态:</el-text>
</el-form-item>
<el-form-item>
<div>
<el-select v-model="taskValue" placeholder="请选择" style="width: 220px">
<el-option v-for="item in taskOptions" :key="item.value" :label="item.label"
:value="item.value" />
</el-select>
</div>
</el-form-item>
<el-form-item>
<el-space>
<el-button type="primary">查询</el-button>
</el-space>
</el-form-item>
</el-form>
</div>
</div>
<div class="m-t-8">
</div> </div>
<el-table :data="tableData" style="width: 100%" border> <el-table :data="tableData" style="width: 100%" border>
<el-table-column type="selection" width="40" /> <el-table-column type="selection" width="40" />
<el-table-column property="name" label="序号" width="55"/> <el-table-column property="name" label="序号" width="55" />
<el-table-column property="address" label="任务名称" show-overflow-tooltip /> <el-table-column property="address" label="任务名称" show-overflow-tooltip />
<el-table-column property="address" label="目标网址" show-overflow-tooltip /> <el-table-column property="address" label="目标网址" show-overflow-tooltip />
<el-table-column property="status" label="是否启用"> <el-table-column property="status" label="是否启用">
<template #default="scope"> <template #default="scope">
<el-switch <el-switch v-model="scope.row.status" @change="changeSwitch(scope.row)" />
v-model="scope.row.status"
@change="changeSwitch(scope.row)"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column property="address" label="执行频率" show-overflow-tooltip /> <el-table-column property="address" label="执行频率" show-overflow-tooltip />
<el-table-column property="address" label="执行次数" show-overflow-tooltip /> <el-table-column property="address" label="执行次数" show-overflow-tooltip />
<el-table-column property="address" label="成功次数" show-overflow-tooltip /> <el-table-column property="address" label="成功次数" show-overflow-tooltip />
<el-table-column property="address" label="失败次数" width="200" show-overflow-tooltip /> <el-table-column property="address" label="失败次数" width="200" show-overflow-tooltip />
<el-table-column property="address" label="异常记录" width="200" show-overflow-tooltip /> <el-table-column property="address" label="异常记录" width="200" show-overflow-tooltip />
<el-table-column label="操作" width="220"> <el-table-column label="操作" width="220">
...@@ -44,7 +68,7 @@ ...@@ -44,7 +68,7 @@
<el-button size="small" plain type="success" @click="handleDetails(scope.row)"> <el-button size="small" plain type="success" @click="handleDetails(scope.row)">
详情 详情
</el-button> </el-button>
<el-button size="small" plain type="danger" @click="handleConfirm(scope.row)"> <el-button size="small" plain type="danger" @click="handleConfirm(scope.row)">
删除 删除
</el-button> </el-button>
</template> </template>
...@@ -65,7 +89,6 @@ import Pagination from '@/components/pagination/index.vue' ...@@ -65,7 +89,6 @@ import Pagination from '@/components/pagination/index.vue'
import { Search } from '@element-plus/icons-vue' import { Search } from '@element-plus/icons-vue'
const searchInput = ref('') const searchInput = ref('')
const errorValue = ref('') const errorValue = ref('')
const taskValue = ref('') const taskValue = ref('')
const timeValue = ref('') const timeValue = ref('')
...@@ -107,7 +130,7 @@ const tableData = ref([ ...@@ -107,7 +130,7 @@ const tableData = ref([
address4: '无', address4: '无',
address5: '10s', address5: '10s',
address6: '2023-05-13 10:00:00', address6: '2023-05-13 10:00:00',
status:0 status: 0
} }
]) ])
const pageObj = ref({ const pageObj = ref({
...@@ -141,4 +164,60 @@ const getData = () => { ...@@ -141,4 +164,60 @@ const getData = () => {
} }
</script> </script>
<style scoped></style> <style scoped>
.toolbarStyle {
background-image: url("@/assets/picture/box3.png");
background-size: 100% 100%;
background-repeat: no-repeat;
}
.formStyle {
display: flex;
justify-content: space-around;
padding: 3px;
}
.el-text {
color: #FFFFFF;
}
</style>
<style>
/* 修改el选择器的样式 */
.el-select__wrapper {
background-color: #1d5484;
box-shadow: none;
}
/* 删除el选择器选中时的边框 */
.is-hovering {
box-shadow: none !important;
}
/* 修改el输入框的样式 */
.el-input__wrapper {
background-color: #1d5484;
box-shadow: none;
}
/* 修改el下拉框的背景颜色 */
.el-select-dropdown {
background-color: #1d5484;
}
/* 修改el下拉框选项的字体颜色 */
.el-select-dropdown__item {
color: #FFFFFF;
}
/* 修改el下拉框选项选中时的文字颜色 */
.el-select-dropdown__item:hover {
color: #409eff;
}
.el-date-picker__wrapper {
border: none;
}
</style>
\ No newline at end of file
...@@ -48,10 +48,7 @@ ...@@ -48,10 +48,7 @@
<div class="pagination w-full flex flex-row-reverse pr-4 m-t-4"> <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 :total="pageObj.total" v-model:page="pageObj.pageNo" v-model:limit="pageObj.pageSize"
@pagination="getData" /> @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> </div>
...@@ -110,15 +107,6 @@ const pageObj = ref({ ...@@ -110,15 +107,6 @@ const pageObj = ref({
pageSize: 10, pageSize: 10,
pageNo: 1 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) => { const handleDetails = (row: any) => {
console.log(row); console.log(row);
} }
......
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