feat: 优化用户界面和交互提示

This commit is contained in:
jxxghp
2025-02-25 21:06:43 +08:00
parent 661919f27a
commit bab46964ff
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -639,7 +639,7 @@ onMounted(fetchData)
<div class="w-auto"> <div class="w-auto">
<VSelect v-model="itemsPerPage" :items="pageRange" density="compact" variant="solo" flat /> <VSelect v-model="itemsPerPage" :items="pageRange" density="compact" variant="solo" flat />
</div> </div>
<div class="w-auto text-sm">{{ pageTip.begin }}-{{ pageTip.end }} / {{ totalItems }}</div> <div class="w-auto text-sm">{{ pageTip.begin }} - {{ pageTip.end }} / {{ totalItems }}</div>
<VPagination <VPagination
v-model="currentPage" v-model="currentPage"
show-first-last-page show-first-last-page
+9
View File
@@ -17,6 +17,9 @@ const isRefreshed = ref(false)
// 过滤关键字 // 过滤关键字
const filter = ref('') const filter = ref('')
// 加载中
const loading = ref(false)
// 新增对话框 // 新增对话框
const addDialog = ref(false) const addDialog = ref(false)
@@ -91,6 +94,7 @@ async function handleDelete(item: Workflow) {
// 开始任务 // 开始任务
async function handleEnable(item: Workflow) { async function handleEnable(item: Workflow) {
loading.value = true
try { try {
const result: { [key: string]: string } = await api.post(`workflow/${item.id}/start`) const result: { [key: string]: string } = await api.post(`workflow/${item.id}/start`)
if (result.success) { if (result.success) {
@@ -102,10 +106,12 @@ async function handleEnable(item: Workflow) {
} catch (error) { } catch (error) {
console.error(error) console.error(error)
} }
loading.value = false
} }
// 停用任务 // 停用任务
async function handlePause(item: Workflow) { async function handlePause(item: Workflow) {
loading.value = true
try { try {
const result: { [key: string]: string } = await api.post(`workflow/${item.id}/pause`) const result: { [key: string]: string } = await api.post(`workflow/${item.id}/pause`)
if (result.success) { if (result.success) {
@@ -117,10 +123,12 @@ async function handlePause(item: Workflow) {
} catch (error) { } catch (error) {
console.error(error) console.error(error)
} }
loading.value = false
} }
// 立即执行任务 // 立即执行任务
async function handleRun(item: Workflow) { async function handleRun(item: Workflow) {
loading.value = true
try { try {
const result: { [key: string]: string } = await api.post(`workflow/${item.id}/run`) const result: { [key: string]: string } = await api.post(`workflow/${item.id}/run`)
if (result.success) { if (result.success) {
@@ -132,6 +140,7 @@ async function handleRun(item: Workflow) {
} catch (error) { } catch (error) {
console.error(error) console.error(error)
} }
loading.value = false
} }
// 计算状态颜色 // 计算状态颜色