From d17727b7c1fa2e546e414490adc2b6cfec51ca17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A1=9C=E8=8F=AF?= Date: Tue, 14 Feb 2023 00:25:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=96=B0=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/index.vue | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index 2d383e0..2a25cf6 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -44,7 +44,7 @@ div(class="mt-[60px] grid grid-cols-1 lg:grid-cols-4 xl:grid-cols-5 text-white b p.font-bold Prompt p.text-gray-400 あなたのアイデアを素早く実現するためのフレームワークです。 textarea.mt-4.rounded-lg.h-32.w-full.px-4.py-2.bg-gray-500.bg-opacity-5.border.border-gray-500.border-opacity-20.text-gray-500( - v-model="imageCreate.prompt" type="text" class="focus:outline-none" + v-model="new_task.prompt" type="text" class="focus:outline-none" ) div div.flex.items-center.justify-between @@ -54,7 +54,7 @@ div(class="mt-[60px] grid grid-cols-1 lg:grid-cols-4 xl:grid-cols-5 text-white b div.slider.round div(v-show="imageCreate.exclude_on") textarea.mt-4.rounded-lg.h-32.w-full.px-4.py-2.bg-gray-500.bg-opacity-5.border.border-gray-500.border-opacity-20.text-gray-400( - v-model="imageCreate.exclude" type="text" class="focus:outline-none" + v-model="new_task.exclude" type="text" class="focus:outline-none" ) p.pt-2.text-gray-400 描述您不希望出现在图像中的细节, 例如颜色, 物体或是风景 div @@ -211,10 +211,8 @@ const views = ref({ }) const imageCreate = ref({ - filter_ctive: 0, + filter_ctive: 0, // 被操作的模型位置 filter_list: [0, 1, 2, 3, 4, 5, 6], - prompt: '渲染提示', // 渲染提示 - exclude: '排除', // 排除词汇 exclude_on: false, // 排除开关 models_show: false, // 模型列表开关 // 输入: @@ -237,7 +235,9 @@ const imageCreate = ref({ // 新任务表单 const new_task = ref({ - model: 'None', + model: 'None', // 选择的模型 + prompt: '渲染提示', // 渲染提示词 + exclude: '排除', // 排除词汇 }) @@ -300,6 +300,26 @@ const ModelsSelect = (index, model) => { imageCreate.value.models_show = false } +// 提交新任务 +const TaskSubmit = () => { + console.log(new_task.value) + tasks.value.push(new_task.value) + fetch('/api/task', { + method: 'POST', + headers: {'Content-Type': 'application/json'}, + body: JSON.stringify(new_task.value) + }) +} + +// 查询任务状态 +const TaskQuery = (tid) => { + console.log(tid) + fetch('/api/task/'+tid, { + method: 'GET', + headers: {'Content-Type': 'application/json'}, + }) +} +