补充页面内容

This commit is contained in:
2026-02-11 19:51:32 +08:00
parent 50ddf01e7c
commit 53820a4654
30 changed files with 5915 additions and 259 deletions

View File

@@ -1,22 +1,192 @@
<template>
<AdminLayout currentPage="dev-config-cron">
<view class="page">
<view class="header">
<text class="title">定时任务</text>
</view>
<view class="content">
<text class="tip">TODO: 定时任务</text>
<view class="admin-page">
<view class="admin-sections">
<!-- 顶部通知 -->
<view class="admin-card alert-card">
<view class="alert-content">
<text class="alert-title">启动定时任务两种方式:</text>
<text class="alert-desc">1、使用命令行启动php think timer start --d; 如果更改了执行周期、编辑是否开启、删除定时任务需要重新启动下定时任务确保生效;</text>
<text class="alert-desc">2、使用接口触发定时任务建议每分钟调用一次接口地址 https://v5.crmeb.net/api/crontab/run</text>
</view>
</view>
<!-- 操作卡片 -->
<view class="admin-card content-card">
<view class="tabs-row">
<view class="tab-item active"><text>系统任务</text></view>
<view class="tab-item"><text>自定义任务</text></view>
</view>
<!-- 表格 -->
<view class="table-container list-table mt-16">
<view class="table-header">
<view class="col col-title"><text>标题</text></view>
<view class="col col-desc"><text>任务说明</text></view>
<view class="col col-cycle"><text>执行周期</text></view>
<view class="col col-status"><text>是否开启</text></view>
<view class="col col-ops"><text>操作</text></view>
</view>
<view class="table-body">
<view v-for="item in dataList" :key="item.id" class="table-row">
<view class="col col-title"><text>{{ item.title }}</text></view>
<view class="col col-desc"><text>{{ item.desc }}</text></view>
<view class="col col-cycle"><text>{{ item.cycle }}</text></view>
<view class="col col-status">
<switch :checked="item.status" color="#1890ff" scale="0.8" />
</view>
<view class="col col-ops">
<text class="op-link" @click="onEdit(item)">编辑</text>
</view>
</view>
</view>
</view>
<!-- 分页 -->
<view class="pagination">
<text class="page-info">共 10 条 15条/页</text>
</view>
</view>
</view>
</view>
</AdminLayout>
</template>
<script setup lang="uts">
import AdminLayout from '@/layouts/admin/AdminLayout.uvue'
</script>
<style scoped>
.page { padding: 16px; }
.title { font-size: 18px; font-weight: 600; }
.tip { color: #999; margin-top: 8px; display: block; }
</style>
<script setup lang="uts">
import { ref } from 'vue'
const dataList = ref([
{ id: 1, title: '自动开具/冲红电子发票', desc: '每隔10分钟执行自动开具/冲红电子发票', cycle: '每隔10分钟执行一次', status: true },
{ id: 2, title: '清除昨日海报', desc: '每天0时30分0秒执行一次清除昨日海报', cycle: '每天0时30分0秒执行一次', status: true },
{ id: 3, title: '订单商品自动好评', desc: '每隔5分钟执行订单到期商品好评', cycle: '每隔5分钟执行一次', status: true },
{ id: 4, title: '预售商品到期自动下架', desc: '每隔5分钟执行预售商品到期下架', cycle: '每隔5分钟执行一次', status: true },
{ id: 5, title: '订单自动收货', desc: '每隔5分钟执行订单到期自动收货', cycle: '每隔5分钟执行一次', status: true },
{ id: 6, title: '自动更新直播间状态', desc: '每隔3分钟执行更新直播间状态', cycle: '每隔3分钟执行一次', status: true },
{ id: 7, title: '自动更新直播商品状态', desc: '每隔3分钟执行更新直播商品状态', cycle: '每隔3分钟执行一次', status: true },
{ id: 8, title: '到期自动解绑上级', desc: '每隔1分钟执行到期的绑定关系的解除', cycle: '每隔1分钟执行一次', status: true },
{ id: 9, title: '拼团到期订单处理', desc: '每隔1分钟拼团到期后的操作', cycle: '每隔1分钟执行一次', status: true },
{ id: 10, title: '未支付自动取消订单', desc: '每隔30秒执行自动取消到期未支付的订单', cycle: '每隔30秒执行一次', status: true }
])
function onEdit(item: any) {
uni.showToast({ title: '编辑: ' + item.title, icon: 'none' })
}
</script>
<style scoped lang="scss">
.admin-page {
padding: 20px;
background-color: #f5f7f9;
min-height: 100vh;
}
.admin-card {
background-color: #fff;
border-radius: 4px;
padding: 20px;
margin-bottom: 20px;
}
.alert-card {
background-color: #fffbe6;
border: 1px solid #ffe58f;
}
.alert-content {
padding: 8px;
}
.alert-title {
font-size: 14px;
color: #faad14;
margin-bottom: 8px;
font-weight: bold;
}
.alert-desc {
font-size: 13px;
color: #faad14;
line-height: 20px;
margin-bottom: 4px;
}
.tabs-row {
display: flex;
flex-direction: row;
border-bottom: 1px solid #f0f0f0;
margin-bottom: 24px;
}
.tab-item {
padding: 12px 20px;
font-size: 14px;
color: #333;
cursor: pointer;
position: relative;
}
.tab-item.active {
color: #1890ff;
}
.tab-item.active::after {
content: '';
position: absolute;
bottom: -1px;
left: 0;
right: 0;
height: 2px;
background-color: #1890ff;
}
.table-container {
width: 100%;
border: 1px solid #f0f0f0;
}
.table-header {
display: flex;
flex-direction: row;
background-color: #fafafa;
border-bottom: 1px solid #f0f0f0;
}
.table-row {
display: flex;
flex-direction: row;
border-bottom: 1px solid #f0f0f0;
}
.col {
padding: 12px 16px;
display: flex;
align-items: center;
font-size: 14px;
color: #333;
}
.col-title { flex: 2; }
.col-desc { flex: 3; }
.col-cycle { flex: 2; }
.col-status { width: 100px; justify-content: center; }
.col-ops { width: 80px; justify-content: center; }
.op-link {
color: #1890ff;
cursor: pointer;
}
.pagination {
margin-top: 20px;
display: flex;
justify-content: flex-end;
}
.page-info {
font-size: 14px;
color: #999;
}
.mt-16 { margin-top: 16px; }
</style>