mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-19 08:50:58 +00:00
feat: 添加任务列表框架
This commit is contained in:
+38
-1
@@ -34,6 +34,23 @@
|
|||||||
<template v-slot:append>
|
<template v-slot:append>
|
||||||
<div>
|
<div>
|
||||||
<v-list density="compact" nav>
|
<v-list density="compact" nav>
|
||||||
|
<!-- <v-list-item id="system-tasks-list-item" title="系统任务" prepend-icon="mdi-align-horizontal-left" v-tooltip="系统任务" @click="showTaskDialog" v-bind="props">
|
||||||
|
<v-dialog activator="parent" max-width="500" persistent v-model="taskDialogShow">
|
||||||
|
<template v-slot:default="{ isActive }">
|
||||||
|
</template>
|
||||||
|
</v-dialog>
|
||||||
|
</v-list-item> -->
|
||||||
|
<v-dialog max-width="500" persistent v-model="taskDialogShow">
|
||||||
|
<template v-slot:activator="{ props: activatorProps }">
|
||||||
|
<v-list-item id="system-tasks-list-item" title="系统任务" prepend-icon="mdi-align-horizontal-left" v-tooltip="任务列表" v-bind="activatorProps">
|
||||||
|
</v-list-item>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-slot:default="{ isActive }">
|
||||||
|
<TaskDialog :dialog="{ show: isActive }" @close="closeTaskDialog" />
|
||||||
|
</template>
|
||||||
|
</v-dialog>
|
||||||
|
|
||||||
<v-list-item id="about-list-item" title="系统信息" prepend-icon="mdi-cog-outline" v-tooltip="系统信息">
|
<v-list-item id="about-list-item" title="系统信息" prepend-icon="mdi-cog-outline" v-tooltip="系统信息">
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</v-list>
|
</v-list>
|
||||||
@@ -52,6 +69,8 @@
|
|||||||
import { getCurrentInstance } from 'vue'
|
import { getCurrentInstance } from 'vue'
|
||||||
import {provide, ref, watch} from 'vue';
|
import {provide, ref, watch} from 'vue';
|
||||||
|
|
||||||
|
import TaskDialog from '@/components/TaskDialog.vue'
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance()
|
const { proxy } = getCurrentInstance()
|
||||||
|
|
||||||
const snackbar = ref(false);
|
const snackbar = ref(false);
|
||||||
@@ -84,6 +103,15 @@ function info(content) {
|
|||||||
text.value = content;
|
text.value = content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const taskDialogShow = ref(false)
|
||||||
|
|
||||||
|
function showTaskDialog() {
|
||||||
|
taskDialogShow.value = true
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeTaskDialog() {
|
||||||
|
taskDialogShow.value = false
|
||||||
|
}
|
||||||
|
|
||||||
provide('snackbar', {success, error, warning, info, location, timeout});
|
provide('snackbar', {success, error, warning, info, location, timeout});
|
||||||
</script>
|
</script>
|
||||||
@@ -141,4 +169,13 @@ provide('snackbar', {success, error, warning, info, location, timeout});
|
|||||||
#about-list-item:active {
|
#about-list-item:active {
|
||||||
background-color: #ddd;
|
background-color: #ddd;
|
||||||
}
|
}
|
||||||
</style>
|
|
||||||
|
#system-tasks-list-item:hover {
|
||||||
|
cursor: pointer;
|
||||||
|
background-color: #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
#system-tasks-list-item:active {
|
||||||
|
background-color: #ddd;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
<template>
|
||||||
|
<v-card prepend-icon="mdi-align-horizontal-left" text="用户发起的任务列表" title="任务列表">
|
||||||
|
<v-list id="plugin-orchestration-list">
|
||||||
|
<draggable v-model="plugins" item-key="name" group="plugins" @start="drag = true"
|
||||||
|
id="plugin-orchestration-draggable"
|
||||||
|
@end="drag = false">
|
||||||
|
<template #item="{ element }">
|
||||||
|
<div class="plugin-orchestration-item">
|
||||||
|
<div class="plugin-orchestration-item-title">
|
||||||
|
<div class="plugin-orchestration-item-author">
|
||||||
|
{{ element.author }} /
|
||||||
|
</div>
|
||||||
|
<div class="plugin-orchestration-item-name">
|
||||||
|
{{ element.name }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="plugin-orchestration-item-action">
|
||||||
|
<v-icon>mdi-drag</v-icon>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</draggable>
|
||||||
|
</v-list>
|
||||||
|
|
||||||
|
<template v-slot:actions>
|
||||||
|
<v-btn class="ml-auto" text="关闭" prepend-icon="mdi-close" @click="close"></v-btn>
|
||||||
|
</template>
|
||||||
|
</v-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
defineProps({
|
||||||
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits(['close'])
|
||||||
|
|
||||||
|
import { ref } from 'vue'
|
||||||
|
|
||||||
|
import { inject } from 'vue'
|
||||||
|
|
||||||
|
const snackbar = inject('snackbar')
|
||||||
|
|
||||||
|
const close = () => {
|
||||||
|
emit('close')
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user