feat: reoede web to tailwindcss
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive } from 'vue'
|
||||
import { toast } from 'vue-sonner'
|
||||
import { request } from '@/api/api'
|
||||
import { generateBizUniqueID } from '@/util/uuid'
|
||||
import CronMessageForm from './CronMessageForm.vue'
|
||||
|
||||
interface Props {
|
||||
open: boolean
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'save', data: any): void
|
||||
(e: 'cancel'): void
|
||||
(e: 'update:open', value: boolean): void
|
||||
}
|
||||
|
||||
defineProps<Props>()
|
||||
const emit = defineEmits<Emits>()
|
||||
|
||||
defineOptions({
|
||||
name: 'AddCronMessages'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
name: '',
|
||||
cron_expression: '',
|
||||
title: '',
|
||||
content: '',
|
||||
task_id: '',
|
||||
url: ''
|
||||
})
|
||||
|
||||
// 加载状态
|
||||
const loading = ref(false)
|
||||
|
||||
// 提交表单
|
||||
const handleSubmit = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
let postData = {
|
||||
"name": formData.name,
|
||||
"id": generateBizUniqueID("C"),
|
||||
"title": formData.title,
|
||||
"content": formData.content,
|
||||
"cron": formData.cron_expression,
|
||||
"url": formData.url,
|
||||
"task_id": formData.task_id
|
||||
}
|
||||
|
||||
const rsp = await request.post('/cronmessages/addone', postData)
|
||||
if (rsp.data.code === 200) {
|
||||
toast.success(rsp.data.msg)
|
||||
setTimeout(() => {
|
||||
window.location.reload()
|
||||
}, 1000)
|
||||
} else {
|
||||
toast.success(rsp.data.msg)
|
||||
}
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 取消操作
|
||||
const handleCancel = () => {
|
||||
emit('cancel')
|
||||
emit('update:open', false)
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<CronMessageForm
|
||||
v-model="formData"
|
||||
mode="add"
|
||||
:loading="loading"
|
||||
@submit="handleSubmit"
|
||||
@cancel="handleCancel"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'AddCronMessages'
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,168 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, watch } from 'vue'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { Label } from '@/components/ui/label'
|
||||
import { Select, SelectContent, SelectGroup, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'
|
||||
import { Textarea } from '@/components/ui/textarea'
|
||||
import { request } from '@/api/api'
|
||||
|
||||
interface CronMessageFormData {
|
||||
id?: number
|
||||
name: string
|
||||
cron_expression: string
|
||||
title: string
|
||||
content: string
|
||||
task_id: string
|
||||
url: string
|
||||
}
|
||||
|
||||
interface Props {
|
||||
modelValue: CronMessageFormData
|
||||
mode: 'add' | 'edit'
|
||||
loading?: boolean
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'update:modelValue', value: CronMessageFormData): void
|
||||
(e: 'submit'): void
|
||||
(e: 'cancel'): void
|
||||
}
|
||||
|
||||
const props = withDefaults(defineProps<Props>(), {
|
||||
loading: false
|
||||
})
|
||||
const emit = defineEmits<Emits>()
|
||||
|
||||
defineOptions({
|
||||
name: 'CronMessageForm'
|
||||
})
|
||||
|
||||
// 本地表单数据
|
||||
const localFormData = reactive<CronMessageFormData>({ ...props.modelValue })
|
||||
|
||||
// 监听外部数据变化
|
||||
watch(() => props.modelValue, (newValue) => {
|
||||
Object.assign(localFormData, newValue)
|
||||
}, { deep: true })
|
||||
|
||||
// 监听本地数据变化,同步到外部
|
||||
watch(localFormData, (newValue) => {
|
||||
emit('update:modelValue', { ...newValue })
|
||||
}, { deep: true })
|
||||
|
||||
// 可用的发信任务列表
|
||||
const availableTasks = ref<Array<{ id: number, name: string }>>([])
|
||||
|
||||
// 常用的 Cron 表达式模板
|
||||
const cronTemplates = [
|
||||
{ label: '每分钟', value: '* * * * *' },
|
||||
{ label: '每5分钟', value: '*/5 * * * *' },
|
||||
{ label: '每小时', value: '0 * * * *' },
|
||||
{ label: '每天凌晨2点', value: '0 2 * * *' },
|
||||
{ label: '每周一凌晨2点', value: '0 2 * * 1' },
|
||||
{ label: '每月1号凌晨2点', value: '0 2 1 * *' }
|
||||
]
|
||||
|
||||
// 加载可用的发信任务
|
||||
const loadAvailableTasks = async () => {
|
||||
try {
|
||||
const rsp = await request.get('/sendtasks/list', { params: { page: 1, size: 100 } })
|
||||
availableTasks.value = rsp.data.data.lists.map((task: any) => ({
|
||||
id: task.id,
|
||||
name: task.name
|
||||
}))
|
||||
} catch (error) {
|
||||
console.error('加载发信任务失败:', error)
|
||||
}
|
||||
}
|
||||
|
||||
// 应用 Cron 模板
|
||||
const applyCronTemplate = (template: string) => {
|
||||
localFormData.cron_expression = template
|
||||
}
|
||||
|
||||
// 提交表单
|
||||
const handleSubmit = () => {
|
||||
emit('submit')
|
||||
}
|
||||
|
||||
// 取消操作
|
||||
const handleCancel = () => {
|
||||
emit('cancel')
|
||||
}
|
||||
|
||||
// 组件挂载时加载数据
|
||||
loadAvailableTasks()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="space-y-3">
|
||||
<div class="space-y-1">
|
||||
<Label for="name" class="text-sm">定时消息名称</Label>
|
||||
<Input id="name" v-model="localFormData.name" placeholder="请输入定时消息名称" class="h-8" />
|
||||
</div>
|
||||
|
||||
<div class="space-y-1">
|
||||
<Label for="task_id" class="text-sm">关联发信任务</Label>
|
||||
<Select v-model="localFormData.task_id">
|
||||
<SelectTrigger class="h-8">
|
||||
<SelectValue placeholder="选择要关联的发信任务" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
<SelectItem v-for="task in availableTasks" :key="task.id" :value="String(task.id)">
|
||||
{{ task.name }}
|
||||
</SelectItem>
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<div class="space-y-1">
|
||||
<Label for="cron_expression" class="text-sm">Cron表达式</Label>
|
||||
<Input id="cron_expression" v-model="localFormData.cron_expression" placeholder="请输入Cron表达式,如: 0 2 * * *" class="h-8" />
|
||||
<div class="text-xs text-gray-500">
|
||||
<p class="mb-1">常用模板:</p>
|
||||
<div class="flex flex-wrap gap-1">
|
||||
<Button v-for="template in cronTemplates" :key="template.value" size="sm" variant="outline"
|
||||
@click="applyCronTemplate(template.value)" class="h-6 px-2 text-xs">
|
||||
{{ template.label }}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="space-y-1">
|
||||
<Label for="title" class="text-sm">标题</Label>
|
||||
<Input id="title" v-model="localFormData.title" placeholder="请输入定时消息标题" class="h-8" />
|
||||
</div>
|
||||
|
||||
<div class="space-y-1">
|
||||
<Label for="content" class="text-sm">内容</Label>
|
||||
<Textarea id="content" v-model="localFormData.content" placeholder="请输入定时消息内容" rows="2" class="min-h-[60px] resize-none" />
|
||||
</div>
|
||||
|
||||
<div class="space-y-1">
|
||||
<Label for="url" class="text-sm">url(可选)</Label>
|
||||
<Input id="url" v-model="localFormData.url" placeholder="请输入定时消息描述" class="h-8" />
|
||||
</div>
|
||||
|
||||
<div class="flex justify-end space-x-2 pt-2">
|
||||
<Button variant="outline" @click="handleCancel" size="sm" :disabled="loading">
|
||||
取消
|
||||
</Button>
|
||||
<Button @click="handleSubmit" size="sm" :disabled="loading">
|
||||
{{ mode === 'add' ? '创建定时消息' : '更新定时消息' }}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CronMessageForm'
|
||||
})
|
||||
</script>
|
||||
@@ -0,0 +1,257 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, reactive, onMounted } from 'vue'
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Input } from '@/components/ui/input'
|
||||
import { Switch } from '@/components/ui/switch'
|
||||
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog'
|
||||
import EmptyTableState from '@/components/ui/EmptyTableState.vue'
|
||||
import Pagination from '@/components/ui/Pagination.vue'
|
||||
import AddCronMessages from './AddCronMessages.vue'
|
||||
import EditCronMessages from './EditCronMessages.vue'
|
||||
import { toast } from 'vue-sonner'
|
||||
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { request } from '@/api/api';
|
||||
// @ts-ignore
|
||||
import { getPageSize } from '@/util/pageUtils';
|
||||
|
||||
|
||||
interface CronMessageItem {
|
||||
id: string
|
||||
title: string
|
||||
name: string
|
||||
content: string
|
||||
cron: string
|
||||
cron_expression: string
|
||||
task_id: string
|
||||
task_name: string
|
||||
enable: number
|
||||
status: boolean
|
||||
created_on: string
|
||||
modified_on: string
|
||||
next_time?: string
|
||||
url: string
|
||||
}
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
let state = reactive({
|
||||
tableData: [] as CronMessageItem[],
|
||||
total: 0,
|
||||
currPage: 1,
|
||||
pageSize: getPageSize(),
|
||||
search: '',
|
||||
optionValue: '',
|
||||
})
|
||||
|
||||
// 状态过滤
|
||||
const selectedStatus = ref('all')
|
||||
|
||||
|
||||
// 新增定时消息 Dialog 状态
|
||||
const isAddCronMessageDialogOpen = ref(false)
|
||||
|
||||
// 编辑定时消息 Dialog 状态
|
||||
const isEditCronMessageDialogOpen = ref(false)
|
||||
const editCronMessageData = ref<CronMessageItem | null>(null)
|
||||
|
||||
// 处理保存新定时消息
|
||||
const handleSaveCronMessage = (_data: any) => {
|
||||
// 保存成功后刷新列表
|
||||
queryListDataWithStatus()
|
||||
}
|
||||
|
||||
// 总页数
|
||||
const totalPages = computed(() => Math.ceil(state.total / state.pageSize))
|
||||
|
||||
// 打开编辑定时消息Dialog
|
||||
const openEditCronMessageDialog = (cronMessage: CronMessageItem) => {
|
||||
editCronMessageData.value = cronMessage
|
||||
isEditCronMessageDialogOpen.value = true
|
||||
}
|
||||
|
||||
// 处理编辑定时消息保存
|
||||
const handleEditCronMessage = (_data: any) => {
|
||||
// 保存成功后刷新列表
|
||||
queryListDataWithStatus()
|
||||
}
|
||||
|
||||
// 处理查看日志
|
||||
const handleViewLogs = (cronMessage: CronMessageItem) => {
|
||||
// 跳转到定时消息日志页面,携带cronMessageId参数
|
||||
router.push(`/sendlogs?taskid=${cronMessage.task_id}`)
|
||||
}
|
||||
|
||||
// 切换状态
|
||||
const toggleStatus = async (cronMessage: CronMessageItem) => {
|
||||
const newStatus = !cronMessage.enable ? 1 : 0
|
||||
cronMessage.enable = newStatus
|
||||
const rsp = await request.post('/cronmessages/edit', cronMessage)
|
||||
if (rsp.data.code === 200) {
|
||||
cronMessage.enable = newStatus
|
||||
toast.success(rsp.data.msg)
|
||||
}
|
||||
}
|
||||
|
||||
const changePage = async (page: number) => {
|
||||
if (page >= 1 && page <= totalPages.value) {
|
||||
state.currPage = page
|
||||
await queryListDataWithStatus()
|
||||
}
|
||||
}
|
||||
|
||||
//触发过滤筛选
|
||||
const filterFunc = async () => {
|
||||
await queryListData(state.currPage, state.pageSize, state.search, state.optionValue);
|
||||
}
|
||||
|
||||
// 查询数据(包含状态过滤)
|
||||
const queryListDataWithStatus = async () => {
|
||||
const statusParam = selectedStatus.value === 'all' ? '' : selectedStatus.value;
|
||||
await queryListData(state.currPage, state.pageSize, state.search, '', '', statusParam);
|
||||
}
|
||||
|
||||
const queryListData = async (page: number, size: number, name = '', taskType = '', query = '', status = '') => {
|
||||
let params: any = { page: page, size: size, name: name, type: taskType, query: query };
|
||||
if (status !== '') {
|
||||
params.status = status;
|
||||
}
|
||||
const rsp = await request.get('/cronmessages/list', { params: params });
|
||||
state.tableData = await rsp.data.data.lists;
|
||||
state.total = await rsp.data.data.total;
|
||||
}
|
||||
|
||||
// 删除定时消息
|
||||
const handleDelete = async (id: string) => {
|
||||
const rsp = await request.post('/cronmessages/delete', { id: id });
|
||||
if (rsp.status == 200 && await rsp.data.code == 200) {
|
||||
toast.success(rsp.data.msg);
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
onMounted(async () => {
|
||||
// 初始化查询
|
||||
state.search = route.query.name?.toString() || '';
|
||||
await queryListData(
|
||||
1,
|
||||
state.pageSize,
|
||||
route.query.name?.toString() || '',
|
||||
route.query.task_type?.toString() || ''
|
||||
);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="p-6 w-full max-w-6xl mx-auto space-y-2">
|
||||
<div class="flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 sm:gap-4">
|
||||
<div class="flex flex-col sm:flex-row gap-2 sm:gap-4">
|
||||
<div class="flex-1 sm:flex-initial">
|
||||
<Input v-model="state.search" placeholder="搜索定时任务名称..." class="w-full sm:w-64" @keyup.enter="filterFunc"
|
||||
@blur="filterFunc" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex-shrink-0">
|
||||
<Dialog v-model:open="isAddCronMessageDialogOpen">
|
||||
<DialogTrigger as-child>
|
||||
<Button variant="default" class="w-full sm:w-auto bg-gray-800 hover:bg-gray-900">
|
||||
<svg class="w-4 h-4 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
|
||||
</svg>
|
||||
新增定时消息
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
|
||||
<DialogContent class="w-[500px] max-w-[90vw]">
|
||||
<DialogHeader>
|
||||
<DialogTitle>新增定时消息</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
<div class="px-4 pb-4">
|
||||
<AddCronMessages v-model:open="isAddCronMessageDialogOpen" @save="handleSaveCronMessage"
|
||||
@cancel="() => isAddCronMessageDialogOpen = false" />
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 表格 -->
|
||||
<Table>
|
||||
<TableHeader>
|
||||
<TableRow>
|
||||
<TableHead class="w-20">ID</TableHead>
|
||||
<TableHead>名称</TableHead>
|
||||
<TableHead>内容</TableHead>
|
||||
<TableHead>Cron表达式</TableHead>
|
||||
<TableHead>关联任务</TableHead>
|
||||
<TableHead>下次执行时间</TableHead>
|
||||
<TableHead>创建时间</TableHead>
|
||||
<TableHead class="text-center">操作</TableHead>
|
||||
</TableRow>
|
||||
</TableHeader>
|
||||
|
||||
<TableBody>
|
||||
<!-- 空数据展示 -->
|
||||
<TableRow v-if="state.tableData.length === 0">
|
||||
<TableCell colspan="8" class="text-center py-12">
|
||||
<EmptyTableState title="暂无定时消息" description="还没有配置任何定时消息,请先添加定时消息" />
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
|
||||
<!-- 数据行 -->
|
||||
<TableRow v-for="cronMessage in state.tableData" :key="cronMessage.id">
|
||||
<TableCell>{{ cronMessage.id }}</TableCell>
|
||||
<TableCell class="max-w-32 truncate" :title="cronMessage.title">{{ cronMessage.title }}</TableCell>
|
||||
<TableCell class="max-w-32 truncate" :title="cronMessage.content">{{ cronMessage.content }}</TableCell>
|
||||
<TableCell>
|
||||
<code class="bg-gray-100 px-2 py-1 rounded text-sm">{{ cronMessage.cron }}</code>
|
||||
</TableCell>
|
||||
<TableCell class="max-w-24 truncate" :title="cronMessage.task_id">{{ cronMessage.task_id }}</TableCell>
|
||||
<TableCell class="max-w-32 truncate" :title="cronMessage.next_time || '-'">{{ cronMessage.next_time || '-' }}
|
||||
</TableCell>
|
||||
<TableCell class="max-w-32 truncate" :title="cronMessage.created_on">{{ cronMessage.created_on }}</TableCell>
|
||||
<!-- <TableCell class="text-center">
|
||||
<Badge :class="cronMessage.status === 1 ? 'bg-green-100 text-green-700' : 'bg-red-100 text-red-600'">
|
||||
{{ getStatusText(cronMessage.status) }}
|
||||
</Badge>
|
||||
</TableCell> -->
|
||||
<TableCell class="text-center space-x-2">
|
||||
<Button size="sm" variant="outline" @click="handleViewLogs(cronMessage)">日志</Button>
|
||||
<Button size="sm" variant="outline" @click="openEditCronMessageDialog(cronMessage)">编辑</Button>
|
||||
<Button size="sm" variant="outline" class="text-red-500 border-red-300 hover:bg-red-50
|
||||
hover:border-red-400 hover:text-red-600 hover:shadow-md
|
||||
transition-all duration-200" @click="handleDelete(cronMessage.id)">删除</Button>
|
||||
<Switch :model-value="cronMessage.enable === 1" @update:model-value="toggleStatus(cronMessage)" />
|
||||
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
</TableBody>
|
||||
</Table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<Pagination :total="state.total" :current-page="state.currPage" :page-size="state.pageSize"
|
||||
@page-change="changePage" />
|
||||
|
||||
<!-- 编辑定时消息Dialog -->
|
||||
<Dialog v-model:open="isEditCronMessageDialogOpen">
|
||||
<DialogContent class="w-[500px] max-w-[90vw] max-h-[90vh] overflow-hidden flex flex-col">
|
||||
<DialogHeader class="flex-shrink-0">
|
||||
<DialogTitle>编辑定时消息</DialogTitle>
|
||||
</DialogHeader>
|
||||
|
||||
<div class="px-4 pb-4 flex-1 overflow-y-auto">
|
||||
<EditCronMessages v-model:open="isEditCronMessageDialogOpen" :cron-message="editCronMessageData"
|
||||
@save="handleEditCronMessage" />
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,120 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, watch } from 'vue'
|
||||
import { toast } from 'vue-sonner'
|
||||
import { request } from '@/api/api'
|
||||
import CronMessageForm from './CronMessageForm.vue'
|
||||
|
||||
interface CronMessageItem {
|
||||
id: string
|
||||
name: string
|
||||
title: string
|
||||
content: string
|
||||
cron: string
|
||||
url: string
|
||||
task_id: string
|
||||
enable: number
|
||||
status: boolean
|
||||
}
|
||||
|
||||
interface Props {
|
||||
open: boolean
|
||||
cronMessage: CronMessageItem | null
|
||||
}
|
||||
|
||||
interface Emits {
|
||||
(e: 'save', data: any): void
|
||||
(e: 'cancel'): void
|
||||
(e: 'update:open', value: boolean): void
|
||||
}
|
||||
|
||||
const props = defineProps<Props>()
|
||||
const emit = defineEmits<Emits>()
|
||||
|
||||
defineOptions({
|
||||
name: 'EditCronMessages'
|
||||
})
|
||||
|
||||
// 表单数据
|
||||
const formData = reactive({
|
||||
name: '',
|
||||
cron_expression: '',
|
||||
title: '',
|
||||
content: '',
|
||||
task_id: '',
|
||||
url: ''
|
||||
})
|
||||
|
||||
// 加载状态
|
||||
const loading = ref(false)
|
||||
|
||||
// 提交表单
|
||||
const handleSubmit = async () => {
|
||||
if (!props.cronMessage) return
|
||||
|
||||
loading.value = true
|
||||
try {
|
||||
let postData = {
|
||||
"name": formData.name,
|
||||
"id": props.cronMessage.id,
|
||||
"title": formData.title,
|
||||
"content": formData.content,
|
||||
"cron": formData.cron_expression,
|
||||
"url": formData.url,
|
||||
"task_id": formData.task_id,
|
||||
"enable": props.cronMessage.enable,
|
||||
}
|
||||
|
||||
const rsp = await request.post('/cronmessages/edit', postData)
|
||||
if (rsp.data.code === 200) {
|
||||
toast.success(rsp.data.msg)
|
||||
setTimeout(() => {
|
||||
window.location.reload()
|
||||
}, 1000)
|
||||
} else {
|
||||
toast.success(rsp.data.msg)
|
||||
}
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
// 取消操作
|
||||
const handleCancel = () => {
|
||||
emit('cancel')
|
||||
emit('update:open', false)
|
||||
}
|
||||
|
||||
// 监听 cronMessage 变化,更新表单数据
|
||||
watch(
|
||||
() => props.cronMessage,
|
||||
(newCronMessage) => {
|
||||
if (newCronMessage) {
|
||||
formData.name = newCronMessage.name
|
||||
formData.cron_expression = newCronMessage.cron
|
||||
formData.title = newCronMessage.title
|
||||
formData.content = newCronMessage.content
|
||||
formData.task_id = newCronMessage.task_id
|
||||
formData.url = newCronMessage.url
|
||||
}
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<CronMessageForm
|
||||
v-model="formData"
|
||||
mode="edit"
|
||||
:loading="loading"
|
||||
@submit="handleSubmit"
|
||||
@cancel="handleCancel"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'EditCronMessages'
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user