feat: 实现剧本创作与拆解前端工作台
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { DialogTrigger } from 'reka-ui'
|
||||
import { AppDialog } from '../../components/ui'
|
||||
|
||||
/** 耗费模型额度或覆盖结果的动作必须经过明确确认。 */
|
||||
const props = defineProps<{
|
||||
label: string
|
||||
description: string
|
||||
disabled?: boolean
|
||||
acknowledgement?: boolean
|
||||
primary?: boolean
|
||||
}>()
|
||||
const emit = defineEmits<{ confirm: [] }>()
|
||||
const open = ref(false)
|
||||
const acknowledged = ref(false)
|
||||
|
||||
/** 发出事件后关闭弹窗,操作状态由项目级锁负责。 */
|
||||
function confirm() {
|
||||
if (props.disabled || (props.acknowledgement && !acknowledged.value)) return
|
||||
emit('confirm')
|
||||
open.value = false
|
||||
acknowledged.value = false
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<AppDialog v-model:open="open" :title="label" :description="description">
|
||||
<template #trigger
|
||||
><DialogTrigger
|
||||
class="button"
|
||||
:class="primary ? 'button-primary' : 'button-secondary'"
|
||||
:disabled="disabled"
|
||||
>{{ label }}</DialogTrigger
|
||||
></template
|
||||
>
|
||||
<p class="mt-5 text-sm leading-6 text-muted">
|
||||
此操作会提交到真实后端,可能调用模型并产生费用。请勿在其他页面或终端同时启动相同工作流。
|
||||
</p>
|
||||
<label v-if="acknowledgement" class="mt-5 flex items-start gap-3 text-sm leading-6"
|
||||
><input
|
||||
v-model="acknowledged"
|
||||
class="mt-1 accent-accent"
|
||||
type="checkbox"
|
||||
/>我已确认后台任务停止,当前没有同项目的生成或拆解任务在运行。</label
|
||||
>
|
||||
<div class="dialog-footer mt-6">
|
||||
<button class="button button-secondary" @click="open = false">取消</button
|
||||
><button
|
||||
class="button button-primary"
|
||||
:disabled="disabled || (acknowledgement && !acknowledged)"
|
||||
@click="confirm"
|
||||
>
|
||||
确认{{ label }}
|
||||
</button>
|
||||
</div>
|
||||
</AppDialog>
|
||||
</template>
|
||||
Reference in New Issue
Block a user