feat: 新增深色模式支持;修复已知问题;样式优化
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
<template>
|
||||
<router-view />
|
||||
<!-- <AppLayout>
|
||||
<router-view />
|
||||
</AppLayout> -->
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
// 开源版本 - 无需用户认证
|
||||
import AppLayout from '@/components/common/AppLayout.vue'
|
||||
</script>
|
||||
|
||||
<style>
|
||||
#app {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
min-height: 100vh;
|
||||
}
|
||||
</style>
|
||||
|
||||
17
web/src/assets/styles/element/index.scss
Normal file
17
web/src/assets/styles/element/index.scss
Normal file
@@ -0,0 +1,17 @@
|
||||
/*just override what you need*/
|
||||
@forward 'element-plus/theme-chalk/src/dark/var.scss' with (
|
||||
$bg-color: (
|
||||
'page': #0a0a0a,
|
||||
'': #141414,
|
||||
'overlay': #1d1e1f,
|
||||
),
|
||||
$fill-color: (
|
||||
'': #262727,
|
||||
'light': #1d1e1f,
|
||||
'lighter': #141414,
|
||||
'extra-light': #191919,
|
||||
'dark': #3a3a3a,
|
||||
'darker': #4a4a4a,
|
||||
'blank': #1a1a1a,
|
||||
)
|
||||
);
|
||||
File diff suppressed because it is too large
Load Diff
616
web/src/components/common/AIConfigDialog.vue
Normal file
616
web/src/components/common/AIConfigDialog.vue
Normal file
@@ -0,0 +1,616 @@
|
||||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:title="$t('aiConfig.title')"
|
||||
width="900px"
|
||||
:close-on-click-modal="false"
|
||||
destroy-on-close
|
||||
class="ai-config-dialog"
|
||||
>
|
||||
<!-- Dialog Header Actions -->
|
||||
<template #header>
|
||||
<div class="dialog-header">
|
||||
<span class="dialog-title">{{ $t('aiConfig.title') }}</span>
|
||||
<el-button type="primary" size="small" @click="showCreateDialog">
|
||||
<el-icon><Plus /></el-icon>
|
||||
<span>{{ $t('aiConfig.addConfig') }}</span>
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<!-- Tabs -->
|
||||
<el-tabs v-model="activeTab" @tab-change="handleTabChange" class="config-tabs">
|
||||
<el-tab-pane :label="$t('aiConfig.tabs.text')" name="text">
|
||||
<ConfigList
|
||||
:configs="configs"
|
||||
:loading="loading"
|
||||
:show-test-button="true"
|
||||
@edit="handleEdit"
|
||||
@delete="handleDelete"
|
||||
@toggle-active="handleToggleActive"
|
||||
@test="handleTest"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane :label="$t('aiConfig.tabs.image')" name="image">
|
||||
<ConfigList
|
||||
:configs="configs"
|
||||
:loading="loading"
|
||||
:show-test-button="false"
|
||||
@edit="handleEdit"
|
||||
@delete="handleDelete"
|
||||
@toggle-active="handleToggleActive"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
|
||||
<el-tab-pane :label="$t('aiConfig.tabs.video')" name="video">
|
||||
<ConfigList
|
||||
:configs="configs"
|
||||
:loading="loading"
|
||||
:show-test-button="false"
|
||||
@edit="handleEdit"
|
||||
@delete="handleDelete"
|
||||
@toggle-active="handleToggleActive"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<!-- Edit/Create Sub-Dialog -->
|
||||
<el-dialog
|
||||
v-model="editDialogVisible"
|
||||
:title="isEdit ? $t('aiConfig.editConfig') : $t('aiConfig.addConfig')"
|
||||
width="600px"
|
||||
:close-on-click-modal="false"
|
||||
append-to-body
|
||||
>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-form-item :label="$t('aiConfig.form.name')" prop="name">
|
||||
<el-input v-model="form.name" :placeholder="$t('aiConfig.form.namePlaceholder')" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('aiConfig.form.provider')" prop="provider">
|
||||
<el-select
|
||||
v-model="form.provider"
|
||||
:placeholder="$t('aiConfig.form.providerPlaceholder')"
|
||||
@change="handleProviderChange"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="provider in availableProviders"
|
||||
:key="provider.id"
|
||||
:label="provider.name"
|
||||
:value="provider.id"
|
||||
:disabled="provider.disabled"
|
||||
/>
|
||||
</el-select>
|
||||
<div class="form-tip">{{ $t('aiConfig.form.providerTip') }}</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('aiConfig.form.priority')" prop="priority">
|
||||
<el-input-number
|
||||
v-model="form.priority"
|
||||
:min="0"
|
||||
:max="100"
|
||||
:step="1"
|
||||
style="width: 100%"
|
||||
/>
|
||||
<div class="form-tip">{{ $t('aiConfig.form.priorityTip') }}</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('aiConfig.form.model')" prop="model">
|
||||
<el-select
|
||||
v-model="form.model"
|
||||
:placeholder="$t('aiConfig.form.modelPlaceholder')"
|
||||
multiple
|
||||
filterable
|
||||
allow-create
|
||||
default-first-option
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-option
|
||||
v-for="model in availableModels"
|
||||
:key="model"
|
||||
:label="model"
|
||||
:value="model"
|
||||
/>
|
||||
</el-select>
|
||||
<div class="form-tip">{{ $t('aiConfig.form.modelTip') }}</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('aiConfig.form.baseUrl')" prop="base_url">
|
||||
<el-input v-model="form.base_url" :placeholder="$t('aiConfig.form.baseUrlPlaceholder')" />
|
||||
<div class="form-tip">
|
||||
{{ $t('aiConfig.form.baseUrlTip') }}
|
||||
<br>
|
||||
{{ $t('aiConfig.form.fullEndpoint') }}: {{ fullEndpointExample }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('aiConfig.form.apiKey')" prop="api_key">
|
||||
<el-input
|
||||
v-model="form.api_key"
|
||||
type="password"
|
||||
show-password
|
||||
:placeholder="$t('aiConfig.form.apiKeyPlaceholder')"
|
||||
/>
|
||||
<div class="form-tip">{{ $t('aiConfig.form.apiKeyTip') }}</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="isEdit" :label="$t('aiConfig.form.isActive')">
|
||||
<el-switch v-model="form.is_active" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<el-button @click="editDialogVisible = false">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button v-if="form.service_type === 'text'" @click="testConnection" :loading="testing">{{ $t('aiConfig.actions.test') }}</el-button>
|
||||
<el-button type="primary" @click="handleSubmit" :loading="submitting">
|
||||
{{ isEdit ? $t('common.save') : $t('common.create') }}
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, computed, watch } from 'vue'
|
||||
import { ElMessage, ElMessageBox, type FormInstance, type FormRules } from 'element-plus'
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { aiAPI } from '@/api/ai'
|
||||
import type { AIServiceConfig, AIServiceType, CreateAIConfigRequest, UpdateAIConfigRequest } from '@/types/ai'
|
||||
import ConfigList from '@/views/settings/components/ConfigList.vue'
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:modelValue': [value: boolean]
|
||||
}>()
|
||||
|
||||
const visible = computed({
|
||||
get: () => props.modelValue,
|
||||
set: (val) => emit('update:modelValue', val)
|
||||
})
|
||||
|
||||
const activeTab = ref<AIServiceType>('text')
|
||||
const loading = ref(false)
|
||||
const configs = ref<AIServiceConfig[]>([])
|
||||
const editDialogVisible = ref(false)
|
||||
const isEdit = ref(false)
|
||||
const editingId = ref<number>()
|
||||
const formRef = ref<FormInstance>()
|
||||
const submitting = ref(false)
|
||||
const testing = ref(false)
|
||||
|
||||
const form = reactive<CreateAIConfigRequest & { is_active?: boolean, provider?: string }>({
|
||||
service_type: 'text',
|
||||
provider: '',
|
||||
name: '',
|
||||
base_url: '',
|
||||
api_key: '',
|
||||
model: [],
|
||||
priority: 0,
|
||||
is_active: true
|
||||
})
|
||||
|
||||
// Provider configs
|
||||
interface ProviderConfig {
|
||||
id: string
|
||||
name: string
|
||||
models: string[]
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
const providerConfigs: Record<AIServiceType, ProviderConfig[]> = {
|
||||
text: [
|
||||
{ id: 'openai', name: 'OpenAI', models: ['gpt-5.2', 'gemini-3-pro-preview'] },
|
||||
{
|
||||
id: 'chatfire',
|
||||
name: 'Chatfire',
|
||||
models: [
|
||||
'gpt-4o',
|
||||
'claude-sonnet-4-5-20250929',
|
||||
'doubao-seed-1-8-251228',
|
||||
'kimi-k2-thinking',
|
||||
'gemini-3-pro',
|
||||
'gemini-2.5-pro',
|
||||
'gemini-3-pro-preview'
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'gemini',
|
||||
name: 'Google Gemini',
|
||||
models: ['gemini-2.5-pro', 'gemini-3-pro-preview']
|
||||
}
|
||||
],
|
||||
image: [
|
||||
{
|
||||
id: 'volcengine',
|
||||
name: '火山引擎',
|
||||
models: ['doubao-seedream-4-5-251128', 'doubao-seedream-4-0-250828']
|
||||
},
|
||||
{
|
||||
id: 'chatfire',
|
||||
name: 'Chatfire',
|
||||
models: ['doubao-seedream-4-5-251128', 'nano-banana-pro']
|
||||
},
|
||||
{
|
||||
id: 'gemini',
|
||||
name: 'Google Gemini',
|
||||
models: ['gemini-3-pro-image-preview']
|
||||
},
|
||||
{ id: 'openai', name: 'OpenAI', models: ['dall-e-3', 'dall-e-2'] }
|
||||
],
|
||||
video: [
|
||||
{
|
||||
id: 'volces',
|
||||
name: '火山引擎',
|
||||
models: [
|
||||
'doubao-seedance-1-5-pro-251215',
|
||||
'doubao-seedance-1-0-lite-i2v-250428',
|
||||
'doubao-seedance-1-0-lite-t2v-250428',
|
||||
'doubao-seedance-1-0-pro-250528',
|
||||
'doubao-seedance-1-0-pro-fast-251015'
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'chatfire',
|
||||
name: 'Chatfire',
|
||||
models: [
|
||||
'doubao-seedance-1-5-pro-251215',
|
||||
'doubao-seedance-1-0-lite-i2v-250428',
|
||||
'doubao-seedance-1-0-lite-t2v-250428',
|
||||
'doubao-seedance-1-0-pro-250528',
|
||||
'doubao-seedance-1-0-pro-fast-251015',
|
||||
'sora',
|
||||
'sora-pro'
|
||||
]
|
||||
},
|
||||
{ id: 'openai', name: 'OpenAI', models: ['sora-2', 'sora-2-pro'] }
|
||||
]
|
||||
}
|
||||
|
||||
const availableProviders = computed(() => {
|
||||
return providerConfigs[form.service_type] || []
|
||||
})
|
||||
|
||||
const availableModels = computed(() => {
|
||||
if (!form.provider) return []
|
||||
const provider = availableProviders.value.find(p => p.id === form.provider)
|
||||
return provider?.models || []
|
||||
})
|
||||
|
||||
const fullEndpointExample = computed(() => {
|
||||
const baseUrl = form.base_url || 'https://api.example.com'
|
||||
const provider = form.provider
|
||||
const serviceType = form.service_type
|
||||
|
||||
let endpoint = ''
|
||||
|
||||
if (serviceType === 'text') {
|
||||
if (provider === 'gemini' || provider === 'google') {
|
||||
endpoint = '/v1beta/models/{model}:generateContent'
|
||||
} else {
|
||||
endpoint = '/chat/completions'
|
||||
}
|
||||
} else if (serviceType === 'image') {
|
||||
if (provider === 'gemini' || provider === 'google') {
|
||||
endpoint = '/v1beta/models/{model}:generateContent'
|
||||
} else {
|
||||
endpoint = '/images/generations'
|
||||
}
|
||||
} else if (serviceType === 'video') {
|
||||
if (provider === 'chatfire') {
|
||||
endpoint = '/video/generations'
|
||||
} else if (provider === 'doubao' || provider === 'volcengine' || provider === 'volces') {
|
||||
endpoint = '/contents/generations/tasks'
|
||||
} else if (provider === 'openai') {
|
||||
endpoint = '/videos'
|
||||
} else {
|
||||
endpoint = '/video/generations'
|
||||
}
|
||||
}
|
||||
|
||||
return baseUrl + endpoint
|
||||
})
|
||||
|
||||
const rules: FormRules = {
|
||||
name: [{ required: true, message: '请输入配置名称', trigger: 'blur' }],
|
||||
provider: [{ required: true, message: '请选择厂商', trigger: 'change' }],
|
||||
base_url: [
|
||||
{ required: true, message: '请输入 Base URL', trigger: 'blur' },
|
||||
{ type: 'url', message: '请输入正确的 URL 格式', trigger: 'blur' }
|
||||
],
|
||||
api_key: [{ required: true, message: '请输入 API Key', trigger: 'blur' }],
|
||||
model: [{
|
||||
required: true,
|
||||
message: '请至少选择一个模型',
|
||||
trigger: 'change',
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (Array.isArray(value) && value.length > 0) {
|
||||
callback()
|
||||
} else if (typeof value === 'string' && value.length > 0) {
|
||||
callback()
|
||||
} else {
|
||||
callback(new Error('请至少选择一个模型'))
|
||||
}
|
||||
}
|
||||
}]
|
||||
}
|
||||
|
||||
const loadConfigs = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
configs.value = await aiAPI.list(activeTab.value)
|
||||
} catch (error: any) {
|
||||
ElMessage.error(error.message || '加载失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const generateConfigName = (provider: string, serviceType: AIServiceType): string => {
|
||||
const providerNames: Record<string, string> = {
|
||||
'chatfire': 'ChatFire',
|
||||
'openai': 'OpenAI',
|
||||
'gemini': 'Gemini',
|
||||
'google': 'Google'
|
||||
}
|
||||
|
||||
const serviceNames: Record<AIServiceType, string> = {
|
||||
'text': '文本',
|
||||
'image': '图片',
|
||||
'video': '视频'
|
||||
}
|
||||
|
||||
const randomNum = Math.floor(Math.random() * 10000).toString().padStart(4, '0')
|
||||
const providerName = providerNames[provider] || provider
|
||||
const serviceName = serviceNames[serviceType] || serviceType
|
||||
|
||||
return `${providerName}-${serviceName}-${randomNum}`
|
||||
}
|
||||
|
||||
const showCreateDialog = () => {
|
||||
isEdit.value = false
|
||||
editingId.value = undefined
|
||||
resetForm()
|
||||
form.service_type = activeTab.value
|
||||
form.provider = 'chatfire'
|
||||
form.base_url = 'https://api.chatfire.site/v1'
|
||||
form.name = generateConfigName('chatfire', activeTab.value)
|
||||
editDialogVisible.value = true
|
||||
}
|
||||
|
||||
const handleEdit = (config: AIServiceConfig) => {
|
||||
isEdit.value = true
|
||||
editingId.value = config.id
|
||||
|
||||
Object.assign(form, {
|
||||
service_type: config.service_type,
|
||||
provider: config.provider || 'chatfire',
|
||||
name: config.name,
|
||||
base_url: config.base_url,
|
||||
api_key: config.api_key,
|
||||
model: Array.isArray(config.model) ? config.model : [config.model],
|
||||
priority: config.priority || 0,
|
||||
is_active: config.is_active
|
||||
})
|
||||
editDialogVisible.value = true
|
||||
}
|
||||
|
||||
const handleDelete = async (config: AIServiceConfig) => {
|
||||
try {
|
||||
await ElMessageBox.confirm('确定要删除该配置吗?', '警告', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
})
|
||||
|
||||
await aiAPI.delete(config.id)
|
||||
ElMessage.success('删除成功')
|
||||
loadConfigs()
|
||||
} catch (error: any) {
|
||||
if (error !== 'cancel') {
|
||||
ElMessage.error(error.message || '删除失败')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const handleToggleActive = async (config: AIServiceConfig) => {
|
||||
try {
|
||||
const newActiveState = !config.is_active
|
||||
await aiAPI.update(config.id, { is_active: newActiveState })
|
||||
ElMessage.success(newActiveState ? '已启用配置' : '已禁用配置')
|
||||
await loadConfigs()
|
||||
} catch (error: any) {
|
||||
ElMessage.error(error.message || '操作失败')
|
||||
}
|
||||
}
|
||||
|
||||
const testConnection = async () => {
|
||||
if (!formRef.value) return
|
||||
|
||||
const valid = await formRef.value.validate().catch(() => false)
|
||||
if (!valid) return
|
||||
|
||||
testing.value = true
|
||||
try {
|
||||
await aiAPI.testConnection({
|
||||
base_url: form.base_url,
|
||||
api_key: form.api_key,
|
||||
model: form.model,
|
||||
provider: form.provider
|
||||
})
|
||||
ElMessage.success('连接测试成功!')
|
||||
} catch (error: any) {
|
||||
ElMessage.error(error.message || '连接测试失败')
|
||||
} finally {
|
||||
testing.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleTest = async (config: AIServiceConfig) => {
|
||||
testing.value = true
|
||||
try {
|
||||
await aiAPI.testConnection({
|
||||
base_url: config.base_url,
|
||||
api_key: config.api_key,
|
||||
model: config.model,
|
||||
provider: config.provider
|
||||
})
|
||||
ElMessage.success('连接测试成功!')
|
||||
} catch (error: any) {
|
||||
ElMessage.error(error.message || '连接测试失败')
|
||||
} finally {
|
||||
testing.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const handleSubmit = async () => {
|
||||
if (!formRef.value) return
|
||||
|
||||
await formRef.value.validate(async (valid) => {
|
||||
if (!valid) return
|
||||
|
||||
submitting.value = true
|
||||
try {
|
||||
if (isEdit.value && editingId.value) {
|
||||
const updateData: UpdateAIConfigRequest = {
|
||||
name: form.name,
|
||||
provider: form.provider,
|
||||
base_url: form.base_url,
|
||||
api_key: form.api_key,
|
||||
model: form.model,
|
||||
priority: form.priority,
|
||||
is_active: form.is_active
|
||||
}
|
||||
await aiAPI.update(editingId.value, updateData)
|
||||
ElMessage.success('更新成功')
|
||||
} else {
|
||||
await aiAPI.create(form)
|
||||
ElMessage.success('创建成功')
|
||||
}
|
||||
|
||||
editDialogVisible.value = false
|
||||
loadConfigs()
|
||||
} catch (error: any) {
|
||||
ElMessage.error(error.message || '操作失败')
|
||||
} finally {
|
||||
submitting.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const handleTabChange = (tabName: string | number) => {
|
||||
activeTab.value = tabName as AIServiceType
|
||||
loadConfigs()
|
||||
}
|
||||
|
||||
const handleProviderChange = () => {
|
||||
form.model = []
|
||||
|
||||
if (form.provider === 'gemini' || form.provider === 'google') {
|
||||
form.base_url = 'https://api.chatfire.site'
|
||||
} else {
|
||||
form.base_url = 'https://api.chatfire.site/v1'
|
||||
}
|
||||
|
||||
if (!isEdit.value) {
|
||||
form.name = generateConfigName(form.provider, form.service_type)
|
||||
}
|
||||
}
|
||||
|
||||
const resetForm = () => {
|
||||
const serviceType = form.service_type || 'text'
|
||||
Object.assign(form, {
|
||||
service_type: serviceType,
|
||||
provider: '',
|
||||
name: '',
|
||||
base_url: '',
|
||||
api_key: '',
|
||||
model: [],
|
||||
priority: 0,
|
||||
is_active: true
|
||||
})
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
// Load configs when dialog opens
|
||||
watch(visible, (val) => {
|
||||
if (val) {
|
||||
loadConfigs()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ai-config-dialog :deep(.el-dialog__header) {
|
||||
padding: 16px 20px;
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.dialog-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding-right: 32px;
|
||||
}
|
||||
|
||||
.dialog-title {
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.ai-config-dialog :deep(.el-dialog__body) {
|
||||
padding: 20px;
|
||||
max-height: 60vh;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.config-tabs {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.form-tip {
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-muted);
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
/* Dark mode */
|
||||
.dark .ai-config-dialog :deep(.el-dialog) {
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.dark .ai-config-dialog :deep(.el-dialog__header) {
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.dark :deep(.el-form-item__label) {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.dark :deep(.el-input__wrapper) {
|
||||
background: var(--bg-secondary);
|
||||
box-shadow: 0 0 0 1px var(--border-primary) inset;
|
||||
}
|
||||
|
||||
.dark :deep(.el-input__inner) {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.dark :deep(.el-select .el-input__wrapper) {
|
||||
background: var(--bg-secondary);
|
||||
}
|
||||
</style>
|
||||
103
web/src/components/common/ActionButton.vue
Normal file
103
web/src/components/common/ActionButton.vue
Normal file
@@ -0,0 +1,103 @@
|
||||
<template>
|
||||
<!-- Minimalist action button with icon and optional tooltip -->
|
||||
<!-- 简约操作按钮,带图标和可选提示 -->
|
||||
<el-tooltip
|
||||
v-if="tooltip"
|
||||
:content="tooltip"
|
||||
placement="top"
|
||||
:show-after="500"
|
||||
>
|
||||
<button
|
||||
:class="['action-button', variant, { disabled }]"
|
||||
:disabled="disabled"
|
||||
@click="$emit('click')"
|
||||
>
|
||||
<el-icon :size="size">
|
||||
<component :is="icon" />
|
||||
</el-icon>
|
||||
</button>
|
||||
</el-tooltip>
|
||||
<button
|
||||
v-else
|
||||
:class="['action-button', variant, { disabled }]"
|
||||
:disabled="disabled"
|
||||
@click="$emit('click')"
|
||||
>
|
||||
<el-icon :size="size">
|
||||
<component :is="icon" />
|
||||
</el-icon>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { Component } from 'vue'
|
||||
|
||||
/**
|
||||
* ActionButton - Minimalist icon button for actions
|
||||
* 操作按钮 - 简约图标按钮用于各种操作
|
||||
*/
|
||||
withDefaults(defineProps<{
|
||||
icon: Component
|
||||
tooltip?: string
|
||||
variant?: 'default' | 'primary' | 'danger'
|
||||
size?: number
|
||||
disabled?: boolean
|
||||
}>(), {
|
||||
variant: 'default',
|
||||
size: 16,
|
||||
disabled: false
|
||||
})
|
||||
|
||||
defineEmits<{
|
||||
click: []
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.action-button {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0.5rem;
|
||||
border: none;
|
||||
border-radius: var(--radius-sm);
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-fast);
|
||||
}
|
||||
|
||||
.action-button:hover {
|
||||
background: var(--bg-card-hover);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.action-button:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 1px;
|
||||
}
|
||||
|
||||
.action-button.primary:hover {
|
||||
background: var(--accent-light);
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.action-button.danger:hover {
|
||||
background: #fef2f2;
|
||||
color: #ef4444;
|
||||
}
|
||||
|
||||
.dark .action-button.danger:hover {
|
||||
background: rgba(239, 68, 68, 0.15);
|
||||
}
|
||||
|
||||
.action-button.disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.action-button.disabled:hover {
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
</style>
|
||||
125
web/src/components/common/AppLayout.vue
Normal file
125
web/src/components/common/AppLayout.vue
Normal file
@@ -0,0 +1,125 @@
|
||||
<template>
|
||||
<div class="app-layout">
|
||||
<!-- Global Header -->
|
||||
<header class="app-header">
|
||||
<div class="header-content">
|
||||
<div class="header-left">
|
||||
<router-link to="/" class="logo">
|
||||
<span class="logo-text">🎬 AI Drama</span>
|
||||
</router-link>
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<LanguageSwitcher />
|
||||
<ThemeToggle />
|
||||
<el-button @click="showAIConfig = true" class="header-btn">
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span class="btn-text">{{ $t('drama.aiConfig') }}</span>
|
||||
</el-button>
|
||||
<!-- <el-button :icon="Setting" circle @click="showAIConfig = true" :title="$t('aiConfig.title')" /> -->
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Main Content -->
|
||||
<main class="app-main">
|
||||
<slot />
|
||||
</main>
|
||||
|
||||
<!-- AI Config Dialog -->
|
||||
<AIConfigDialog v-model="showAIConfig" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue'
|
||||
import { Setting } from '@element-plus/icons-vue'
|
||||
import ThemeToggle from './ThemeToggle.vue'
|
||||
import AIConfigDialog from './AIConfigDialog.vue'
|
||||
import LanguageSwitcher from '@/components/LanguageSwitcher.vue'
|
||||
|
||||
const showAIConfig = ref(false)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app-layout {
|
||||
min-height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.app-header {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
background: var(--bg-card);
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
backdrop-filter: blur(8px);
|
||||
}
|
||||
|
||||
.header-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 var(--space-4);
|
||||
height: 56px;
|
||||
max-width: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.header-btn {
|
||||
border-radius: var(--radius-lg);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.header-btn.primary {
|
||||
background: linear-gradient(135deg, var(--accent) 0%, #0284c7 100%);
|
||||
border: none;
|
||||
box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
|
||||
}
|
||||
|
||||
.header-btn.primary:hover {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
|
||||
}
|
||||
.header-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-4);
|
||||
}
|
||||
|
||||
.logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
text-decoration: none;
|
||||
color: var(--text-primary);
|
||||
font-weight: 700;
|
||||
font-size: 1.125rem;
|
||||
transition: opacity var(--transition-fast);
|
||||
}
|
||||
|
||||
.logo:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.logo-text {
|
||||
background: linear-gradient(135deg, var(--accent) 0%, #06b6d4 100%);
|
||||
-webkit-background-clip: text;
|
||||
-webkit-text-fill-color: transparent;
|
||||
background-clip: text;
|
||||
}
|
||||
|
||||
.header-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.app-main {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
/* Dark mode adjustments */
|
||||
.dark .app-header {
|
||||
background: rgba(26, 33, 41, 0.95);
|
||||
}
|
||||
</style>
|
||||
210
web/src/components/common/BaseCard.vue
Normal file
210
web/src/components/common/BaseCard.vue
Normal file
@@ -0,0 +1,210 @@
|
||||
<template>
|
||||
<!-- Base Card Component - Reusable card with modern design -->
|
||||
<!-- 基础卡片组件 - 现代设计的可复用卡片 -->
|
||||
<div
|
||||
:class="[
|
||||
'base-card',
|
||||
`variant-${variant}`,
|
||||
{ 'is-hoverable': hoverable, 'is-clickable': clickable }
|
||||
]"
|
||||
@click="clickable ? $emit('click') : undefined"
|
||||
:tabindex="clickable ? 0 : undefined"
|
||||
@keydown.enter="clickable ? $emit('click') : undefined"
|
||||
>
|
||||
<!-- Card Header / 卡片头部 -->
|
||||
<div v-if="$slots.header || title" class="card-header">
|
||||
<slot name="header">
|
||||
<div class="header-content">
|
||||
<div v-if="icon" class="header-icon">
|
||||
<el-icon :size="iconSize" :color="iconColor">
|
||||
<component :is="icon" />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="header-text">
|
||||
<h3 class="card-title">{{ title }}</h3>
|
||||
<p v-if="subtitle" class="card-subtitle">{{ subtitle }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="$slots.headerActions" class="header-actions">
|
||||
<slot name="headerActions"></slot>
|
||||
</div>
|
||||
</slot>
|
||||
</div>
|
||||
|
||||
<!-- Card Body / 卡片内容 -->
|
||||
<div :class="['card-body', { 'no-padding': noPadding }]">
|
||||
<slot></slot>
|
||||
</div>
|
||||
|
||||
<!-- Card Footer / 卡片底部 -->
|
||||
<div v-if="$slots.footer" class="card-footer">
|
||||
<slot name="footer"></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { Component } from 'vue'
|
||||
|
||||
/**
|
||||
* BaseCard - Reusable card component with modern design
|
||||
* 基础卡片组件 - 现代设计的可复用卡片
|
||||
*/
|
||||
withDefaults(defineProps<{
|
||||
title?: string
|
||||
subtitle?: string
|
||||
icon?: Component
|
||||
iconSize?: number
|
||||
iconColor?: string
|
||||
variant?: 'default' | 'elevated' | 'outlined' | 'ghost'
|
||||
hoverable?: boolean
|
||||
clickable?: boolean
|
||||
noPadding?: boolean
|
||||
}>(), {
|
||||
variant: 'default',
|
||||
iconSize: 20,
|
||||
hoverable: false,
|
||||
clickable: false,
|
||||
noPadding: false
|
||||
})
|
||||
|
||||
defineEmits<{
|
||||
click: []
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* Card Container / 卡片容器 */
|
||||
.base-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--bg-card);
|
||||
border-radius: var(--radius-xl);
|
||||
transition: all var(--transition-normal);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Variants / 变体样式 */
|
||||
.variant-default {
|
||||
border: 1px solid var(--border-primary);
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
.variant-elevated {
|
||||
border: none;
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.variant-outlined {
|
||||
border: 1px solid var(--border-primary);
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.variant-ghost {
|
||||
background: transparent;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
/* Hover & Clickable States / 悬停和可点击状态 */
|
||||
.is-hoverable:hover {
|
||||
box-shadow: var(--shadow-card-hover);
|
||||
border-color: var(--border-secondary);
|
||||
}
|
||||
|
||||
.is-clickable {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.is-clickable:hover {
|
||||
border-color: var(--accent);
|
||||
box-shadow: var(--shadow-glow);
|
||||
}
|
||||
|
||||
.is-clickable:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.is-clickable:active {
|
||||
transform: scale(0.995);
|
||||
}
|
||||
|
||||
/* Card Header / 卡片头部 */
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: var(--space-4) var(--space-5);
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
}
|
||||
|
||||
.header-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.header-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
background: var(--accent-light);
|
||||
border-radius: var(--radius-lg);
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.header-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.125rem;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.card-subtitle {
|
||||
margin: 0;
|
||||
font-size: 0.8125rem;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.header-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
/* Card Body / 卡片内容 */
|
||||
.card-body {
|
||||
padding: var(--space-5);
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.card-body.no-padding {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
/* Card Footer / 卡片底部 */
|
||||
.card-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-4) var(--space-5);
|
||||
border-top: 1px solid var(--border-primary);
|
||||
background: var(--bg-secondary);
|
||||
}
|
||||
|
||||
/* Dark mode adjustments / 深色模式调整 */
|
||||
.dark .card-footer {
|
||||
background: var(--bg-secondary);
|
||||
}
|
||||
</style>
|
||||
235
web/src/components/common/CreateDramaDialog.vue
Normal file
235
web/src/components/common/CreateDramaDialog.vue
Normal file
@@ -0,0 +1,235 @@
|
||||
<template>
|
||||
<!-- Create Drama Dialog / 创建短剧弹窗 -->
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:title="$t('drama.createNew')"
|
||||
width="520px"
|
||||
:close-on-click-modal="false"
|
||||
class="create-dialog"
|
||||
@closed="handleClosed"
|
||||
>
|
||||
<div class="dialog-desc">{{ $t('drama.createDesc') }}</div>
|
||||
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-position="top"
|
||||
class="create-form"
|
||||
@submit.prevent="handleSubmit"
|
||||
>
|
||||
<el-form-item :label="$t('drama.projectName')" prop="title" required>
|
||||
<el-input
|
||||
v-model="form.title"
|
||||
:placeholder="$t('drama.projectNamePlaceholder')"
|
||||
size="large"
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item :label="$t('drama.projectDesc')" prop="description">
|
||||
<el-input
|
||||
v-model="form.description"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
:placeholder="$t('drama.projectDescPlaceholder')"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
resize="none"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button size="large" @click="handleClose">
|
||||
{{ $t('common.cancel') }}
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="large"
|
||||
:loading="loading"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
<el-icon v-if="!loading"><Plus /></el-icon>
|
||||
{{ $t('drama.createNew') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, reactive, watch } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { dramaAPI } from '@/api/drama'
|
||||
import type { CreateDramaRequest } from '@/types/drama'
|
||||
|
||||
/**
|
||||
* CreateDramaDialog - Reusable dialog for creating new drama projects
|
||||
* 创建短剧弹窗 - 可复用的创建短剧项目弹窗
|
||||
*/
|
||||
const props = defineProps<{
|
||||
modelValue: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
'update:modelValue': [value: boolean]
|
||||
'created': [id: string]
|
||||
}>()
|
||||
|
||||
const router = useRouter()
|
||||
const formRef = ref<FormInstance>()
|
||||
const loading = ref(false)
|
||||
|
||||
// v-model binding / 双向绑定
|
||||
const visible = ref(props.modelValue)
|
||||
watch(() => props.modelValue, (val) => {
|
||||
visible.value = val
|
||||
})
|
||||
watch(visible, (val) => {
|
||||
emit('update:modelValue', val)
|
||||
})
|
||||
|
||||
// Form data / 表单数据
|
||||
const form = reactive<CreateDramaRequest>({
|
||||
title: '',
|
||||
description: ''
|
||||
})
|
||||
|
||||
// Validation rules / 验证规则
|
||||
const rules: FormRules = {
|
||||
title: [
|
||||
{ required: true, message: '请输入项目标题', trigger: 'blur' },
|
||||
{ min: 1, max: 100, message: '标题长度在 1 到 100 个字符', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
|
||||
// Reset form when dialog closes / 关闭时重置表单
|
||||
const handleClosed = () => {
|
||||
form.title = ''
|
||||
form.description = ''
|
||||
formRef.value?.resetFields()
|
||||
}
|
||||
|
||||
// Close dialog / 关闭弹窗
|
||||
const handleClose = () => {
|
||||
visible.value = false
|
||||
}
|
||||
|
||||
// Submit form / 提交表单
|
||||
const handleSubmit = async () => {
|
||||
if (!formRef.value) return
|
||||
|
||||
await formRef.value.validate(async (valid) => {
|
||||
if (valid) {
|
||||
loading.value = true
|
||||
try {
|
||||
const drama = await dramaAPI.create(form)
|
||||
ElMessage.success('创建成功')
|
||||
visible.value = false
|
||||
emit('created', drama.id)
|
||||
// Navigate to drama detail page / 跳转到短剧详情页
|
||||
router.push(`/dramas/${drama.id}`)
|
||||
} catch (error: any) {
|
||||
ElMessage.error(error.message || '创建失败')
|
||||
} finally {
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* ========================================
|
||||
Dialog Styles / 弹窗样式
|
||||
======================================== */
|
||||
.create-dialog :deep(.el-dialog) {
|
||||
border-radius: var(--radius-xl);
|
||||
}
|
||||
|
||||
.create-dialog :deep(.el-dialog__header) {
|
||||
padding: 1.25rem 1.5rem;
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.create-dialog :deep(.el-dialog__title) {
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.create-dialog :deep(.el-dialog__body) {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.dialog-desc {
|
||||
margin-bottom: 1.5rem;
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Form Styles / 表单样式
|
||||
======================================== */
|
||||
.create-form :deep(.el-form-item) {
|
||||
margin-bottom: 1.25rem;
|
||||
}
|
||||
|
||||
.create-form :deep(.el-form-item__label) {
|
||||
font-weight: 500;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.create-form :deep(.el-input__wrapper),
|
||||
.create-form :deep(.el-textarea__inner) {
|
||||
background: var(--bg-secondary);
|
||||
border-radius: var(--radius-md);
|
||||
box-shadow: 0 0 0 1px var(--border-primary) inset;
|
||||
transition: all var(--transition-fast);
|
||||
}
|
||||
|
||||
.create-form :deep(.el-input__wrapper:hover),
|
||||
.create-form :deep(.el-textarea__inner:hover) {
|
||||
box-shadow: 0 0 0 1px var(--border-secondary) inset;
|
||||
}
|
||||
|
||||
.create-form :deep(.el-input__wrapper.is-focus),
|
||||
.create-form :deep(.el-textarea__inner:focus) {
|
||||
box-shadow: 0 0 0 2px var(--accent) inset;
|
||||
}
|
||||
|
||||
.create-form :deep(.el-input__inner),
|
||||
.create-form :deep(.el-textarea__inner) {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.create-form :deep(.el-input__inner::placeholder),
|
||||
.create-form :deep(.el-textarea__inner::placeholder) {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.create-form :deep(.el-input__count) {
|
||||
color: var(--text-muted);
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Footer Styles / 底部样式
|
||||
======================================== */
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.dialog-footer .el-button {
|
||||
min-width: 100px;
|
||||
}
|
||||
</style>
|
||||
130
web/src/components/common/EmptyState.vue
Normal file
130
web/src/components/common/EmptyState.vue
Normal file
@@ -0,0 +1,130 @@
|
||||
<template>
|
||||
<!-- Empty State Component - Display when no data available -->
|
||||
<!-- 空状态组件 - 无数据时的展示 -->
|
||||
<div :class="['empty-state', `size-${size}`]">
|
||||
<div class="empty-icon" :class="{ 'has-animation': animated }">
|
||||
<el-icon :size="iconSize">
|
||||
<component :is="icon" />
|
||||
</el-icon>
|
||||
</div>
|
||||
<h3 class="empty-title">{{ title }}</h3>
|
||||
<p v-if="description" class="empty-description">{{ description }}</p>
|
||||
<div v-if="$slots.default" class="empty-actions">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, type Component } from 'vue'
|
||||
import { FolderOpened } from '@element-plus/icons-vue'
|
||||
|
||||
/**
|
||||
* EmptyState - Display when no data is available
|
||||
* 空状态组件 - 无数据时的占位展示
|
||||
*/
|
||||
const props = withDefaults(defineProps<{
|
||||
title: string
|
||||
description?: string
|
||||
icon?: Component
|
||||
size?: 'small' | 'medium' | 'large'
|
||||
animated?: boolean
|
||||
}>(), {
|
||||
icon: FolderOpened,
|
||||
size: 'medium',
|
||||
animated: true
|
||||
})
|
||||
|
||||
// Icon size based on component size / 根据组件尺寸设置图标大小
|
||||
const iconSize = computed(() => {
|
||||
const sizes = {
|
||||
small: 32,
|
||||
medium: 48,
|
||||
large: 64
|
||||
}
|
||||
return sizes[props.size]
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
padding: var(--space-8) var(--space-4);
|
||||
}
|
||||
|
||||
/* Size variants / 尺寸变体 */
|
||||
.size-small {
|
||||
padding: var(--space-6) var(--space-4);
|
||||
}
|
||||
|
||||
.size-small .empty-title {
|
||||
font-size: 0.9375rem;
|
||||
}
|
||||
|
||||
.size-small .empty-description {
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
.size-large {
|
||||
padding: var(--space-12) var(--space-6);
|
||||
}
|
||||
|
||||
.size-large .empty-title {
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
/* Icon / 图标 */
|
||||
.empty-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 5rem;
|
||||
height: 5rem;
|
||||
margin-bottom: var(--space-4);
|
||||
background: linear-gradient(135deg, var(--accent) 0%, #06b6d4 100%);
|
||||
border-radius: 50%;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.empty-icon.has-animation {
|
||||
animation: pulse-glow 3s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse-glow {
|
||||
0%, 100% {
|
||||
box-shadow: 0 0 20px rgba(14, 165, 233, 0.3);
|
||||
}
|
||||
50% {
|
||||
box-shadow: 0 0 40px rgba(14, 165, 233, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
/* Title / 标题 */
|
||||
.empty-title {
|
||||
margin: 0 0 var(--space-2) 0;
|
||||
font-size: 1.0625rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
/* Description / 描述 */
|
||||
.empty-description {
|
||||
margin: 0;
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-muted);
|
||||
max-width: 320px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/* Actions / 操作区 */
|
||||
.empty-actions {
|
||||
margin-top: var(--space-5);
|
||||
display: flex;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
</style>
|
||||
223
web/src/components/common/PageHeader.vue
Normal file
223
web/src/components/common/PageHeader.vue
Normal file
@@ -0,0 +1,223 @@
|
||||
<template>
|
||||
<!-- Page header component with title, subtitle and action buttons -->
|
||||
<!-- 页面头部组件,包含标题、副标题和操作按钮 -->
|
||||
<header :class="['page-header', { 'with-back': showBack, 'with-border': showBorder }]">
|
||||
<div class="header-content">
|
||||
<!-- Back button section / 返回按钮区域 -->
|
||||
<div v-if="showBack" class="header-nav">
|
||||
<button class="back-btn" @click="handleBack">
|
||||
<el-icon><ArrowLeft /></el-icon>
|
||||
<span>{{ backText }}</span>
|
||||
</button>
|
||||
<div class="nav-divider"></div>
|
||||
</div>
|
||||
|
||||
<!-- Title section / 标题区域 -->
|
||||
<div class="header-text">
|
||||
<div class="title-row">
|
||||
<div v-if="$slots.icon" class="title-icon">
|
||||
<slot name="icon"></slot>
|
||||
</div>
|
||||
<h1 class="header-title">{{ title }}
|
||||
|
||||
<p v-if="subtitle" class="header-subtitle">{{ subtitle }}</p>
|
||||
</h1>
|
||||
<slot name="badge"></slot>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Actions section / 操作区域 -->
|
||||
<div class="header-actions">
|
||||
<slot name="actions"></slot>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Extra content / 额外内容 -->
|
||||
<div v-if="$slots.extra" class="header-extra">
|
||||
<slot name="extra"></slot>
|
||||
</div>
|
||||
</header>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ArrowLeft } from '@element-plus/icons-vue'
|
||||
|
||||
/**
|
||||
* PageHeader - Reusable page header component
|
||||
* 页面头部组件 - 可复用的页面头部
|
||||
*/
|
||||
const props = withDefaults(defineProps<{
|
||||
title: string
|
||||
subtitle?: string
|
||||
showBack?: boolean
|
||||
backText?: string
|
||||
showBorder?: boolean
|
||||
}>(), {
|
||||
showBack: false,
|
||||
backText: '返回',
|
||||
showBorder: true
|
||||
})
|
||||
|
||||
const emit = defineEmits<{
|
||||
back: []
|
||||
}>()
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
// Handle back navigation / 处理返回导航
|
||||
const handleBack = () => {
|
||||
emit('back')
|
||||
router.back()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.page-header {
|
||||
margin-bottom: var(--space-3);
|
||||
}
|
||||
|
||||
.page-header.with-border {
|
||||
padding-bottom: var(--space-3);
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
}
|
||||
|
||||
.header-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.header-content {
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.page-header.with-back .header-content {
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
/* Navigation / 导航 */
|
||||
.header-nav {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-4);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
padding: 0.5rem 0.875rem;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-lg);
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-fast);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.back-btn:hover {
|
||||
background: var(--bg-card-hover);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--border-secondary);
|
||||
}
|
||||
|
||||
.back-btn:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
.nav-divider {
|
||||
width: 1px;
|
||||
height: 2rem;
|
||||
background: var(--border-primary);
|
||||
}
|
||||
|
||||
/* Title / 标题 */
|
||||
.header-text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.title-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-3);
|
||||
}
|
||||
|
||||
.title-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
background: linear-gradient(135deg, var(--accent) 0%, #06b6d4 100%);
|
||||
border-radius: var(--radius-lg);
|
||||
color: white;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.header-title {
|
||||
margin: 0;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
letter-spacing: -0.025em;
|
||||
line-height: 1.2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.header-title {
|
||||
font-size: 1.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.header-subtitle {
|
||||
margin: 0;
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-muted);
|
||||
font-weight: 500;
|
||||
max-width: 480px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
/* Actions / 操作 */
|
||||
.header-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: var(--space-2);
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.header-actions {
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
|
||||
/* Extra / 额外内容 */
|
||||
.header-extra {
|
||||
margin-top: var(--space-4);
|
||||
padding-top: var(--space-4);
|
||||
border-top: 1px solid var(--border-primary);
|
||||
}
|
||||
</style>
|
||||
224
web/src/components/common/ProjectCard.vue
Normal file
224
web/src/components/common/ProjectCard.vue
Normal file
@@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<!-- Project card component - Compact & refined design -->
|
||||
<!-- 项目卡片组件 - 紧凑精致设计 -->
|
||||
<article
|
||||
class="project-card"
|
||||
@click="$emit('click')"
|
||||
tabindex="0"
|
||||
@keydown.enter="$emit('click')"
|
||||
>
|
||||
<!-- Cover image section / 封面图片区域 -->
|
||||
<div class="card-cover">
|
||||
<img
|
||||
v-if="coverImage"
|
||||
:src="coverImage"
|
||||
:alt="title"
|
||||
class="cover-image"
|
||||
loading="lazy"
|
||||
/>
|
||||
<div v-else class="cover-placeholder">
|
||||
<el-icon :size="20" class="placeholder-icon">
|
||||
<Film />
|
||||
</el-icon>
|
||||
</div>
|
||||
<!-- Floating tag / 悬浮标签 -->
|
||||
<span v-if="tag" class="floating-tag">{{ tag }}</span>
|
||||
</div>
|
||||
|
||||
<!-- Card content / 卡片内容 -->
|
||||
<div class="card-body">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">{{ title }}</h3>
|
||||
<span class="meta-time">{{ formattedDate }}</span>
|
||||
</div>
|
||||
<p class="card-description">{{ description || '无描述' }}</p>
|
||||
|
||||
<!-- Actions / 操作区 -->
|
||||
<div class="card-actions" @click.stop>
|
||||
<slot name="actions"></slot>
|
||||
</div>
|
||||
</div>
|
||||
</article>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue'
|
||||
import { Film } from '@element-plus/icons-vue'
|
||||
|
||||
/**
|
||||
* ProjectCard - Reusable project/drama card component
|
||||
* 项目卡片组件 - 可复用的项目展示卡片
|
||||
*/
|
||||
const props = defineProps<{
|
||||
title: string
|
||||
description?: string
|
||||
coverImage?: string
|
||||
tag?: string
|
||||
updatedAt: string
|
||||
}>()
|
||||
|
||||
defineEmits<{
|
||||
click: []
|
||||
}>()
|
||||
|
||||
// Format date to relative time / 格式化日期为相对时间
|
||||
const formattedDate = computed(() => {
|
||||
const date = new Date(props.updatedAt)
|
||||
const now = new Date()
|
||||
const diff = now.getTime() - date.getTime()
|
||||
const days = Math.floor(diff / (1000 * 60 * 60 * 24))
|
||||
|
||||
if (days === 0) return '今天'
|
||||
if (days === 1) return '昨天'
|
||||
if (days < 7) return `${days}天前`
|
||||
return date.toLocaleDateString('zh-CN')
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/* Card Container / 卡片容器 */
|
||||
.project-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-lg);
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-normal);
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
.project-card:hover {
|
||||
border-color: var(--accent);
|
||||
box-shadow: var(--shadow-card-hover), 0 0 0 1px var(--accent);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.project-card:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* Cover Section / 封面区域 */
|
||||
.card-cover {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
aspect-ratio: 16 / 9;
|
||||
overflow: hidden;
|
||||
background: linear-gradient(135deg, var(--accent) 0%, #06b6d4 100%);
|
||||
}
|
||||
|
||||
.cover-image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform var(--transition-slow);
|
||||
}
|
||||
|
||||
.project-card:hover .cover-image {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.cover-placeholder {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.placeholder-icon {
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
|
||||
/* Floating tag / 悬浮标签 */
|
||||
.floating-tag {
|
||||
position: absolute;
|
||||
top: var(--space-2);
|
||||
left: var(--space-2);
|
||||
padding: 0.2rem 0.5rem;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
color: white;
|
||||
font-size: 0.625rem;
|
||||
font-weight: 600;
|
||||
border-radius: var(--radius-sm);
|
||||
backdrop-filter: blur(8px);
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
/* Body Section / 内容区域 */
|
||||
.card-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: var(--space-3);
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.card-title {
|
||||
margin: 0;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
flex: 1;
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.meta-time {
|
||||
font-size: 0.625rem;
|
||||
color: var(--text-muted);
|
||||
white-space: nowrap;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.card-description {
|
||||
margin: 0;
|
||||
font-size: 0.6875rem;
|
||||
color: var(--text-muted);
|
||||
line-height: 1.4;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* Actions / 操作区 */
|
||||
.card-actions {
|
||||
display: flex;
|
||||
gap: var(--space-1);
|
||||
align-items: center;
|
||||
margin-top: var(--space-1);
|
||||
padding-top: var(--space-2);
|
||||
border-top: 1px solid var(--border-primary);
|
||||
}
|
||||
|
||||
:deep(.action-button) {
|
||||
padding: 0.25rem !important;
|
||||
min-width: 1.5rem !important;
|
||||
height: 1.5rem !important;
|
||||
}
|
||||
|
||||
:deep(.action-button .el-icon) {
|
||||
font-size: 0.75rem !important;
|
||||
}
|
||||
|
||||
:deep(.action-button.primary:hover) {
|
||||
color: var(--accent);
|
||||
background: var(--accent-light);
|
||||
}
|
||||
|
||||
:deep(.action-button.danger:hover) {
|
||||
color: var(--error);
|
||||
background: var(--error-light);
|
||||
}
|
||||
</style>
|
||||
180
web/src/components/common/StatCard.vue
Normal file
180
web/src/components/common/StatCard.vue
Normal file
@@ -0,0 +1,180 @@
|
||||
<template>
|
||||
<!-- Stat Card Component - Display statistics with modern design -->
|
||||
<!-- 统计卡片组件 - 现代设计的统计数据展示 -->
|
||||
<div :class="['stat-card', `variant-${variant}`]">
|
||||
<div class="stat-icon" :style="{ background: iconBg }">
|
||||
<el-icon :size="24" :color="iconColor">
|
||||
<component :is="icon" />
|
||||
</el-icon>
|
||||
</div>
|
||||
<div class="stat-content">
|
||||
<span class="stat-label">{{ label }}</span>
|
||||
<div class="stat-value-row">
|
||||
<span class="stat-value" :style="{ color: valueColor }">{{ formattedValue }}</span>
|
||||
<span v-if="suffix" class="stat-suffix">{{ suffix }}</span>
|
||||
</div>
|
||||
<span v-if="description" class="stat-description">{{ description }}</span>
|
||||
</div>
|
||||
<div v-if="trend !== undefined" :class="['stat-trend', trendDirection]">
|
||||
<el-icon :size="14">
|
||||
<component :is="trendIcon" />
|
||||
</el-icon>
|
||||
<span>{{ Math.abs(trend) }}%</span>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, type Component } from 'vue'
|
||||
import { TrendCharts, ArrowUp, ArrowDown } from '@element-plus/icons-vue'
|
||||
|
||||
/**
|
||||
* StatCard - Display statistics with trend indicator
|
||||
* 统计卡片 - 带趋势指示器的统计数据展示
|
||||
*/
|
||||
const props = withDefaults(defineProps<{
|
||||
label: string
|
||||
value: number | string
|
||||
icon: Component
|
||||
iconColor?: string
|
||||
iconBg?: string
|
||||
valueColor?: string
|
||||
suffix?: string
|
||||
description?: string
|
||||
trend?: number
|
||||
variant?: 'default' | 'compact'
|
||||
}>(), {
|
||||
iconColor: 'var(--accent)',
|
||||
iconBg: 'var(--accent-light)',
|
||||
valueColor: 'var(--accent)',
|
||||
variant: 'default'
|
||||
})
|
||||
|
||||
// Format large numbers / 格式化大数字
|
||||
const formattedValue = computed(() => {
|
||||
if (typeof props.value === 'string') return props.value
|
||||
if (props.value >= 1000000) {
|
||||
return (props.value / 1000000).toFixed(1) + 'M'
|
||||
}
|
||||
if (props.value >= 1000) {
|
||||
return (props.value / 1000).toFixed(1) + 'K'
|
||||
}
|
||||
return props.value.toString()
|
||||
})
|
||||
|
||||
// Trend direction / 趋势方向
|
||||
const trendDirection = computed(() => {
|
||||
if (props.trend === undefined) return ''
|
||||
return props.trend >= 0 ? 'up' : 'down'
|
||||
})
|
||||
|
||||
// Trend icon / 趋势图标
|
||||
const trendIcon = computed(() => {
|
||||
if (props.trend === undefined) return TrendCharts
|
||||
return props.trend >= 0 ? ArrowUp : ArrowDown
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.stat-card {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: var(--space-3);
|
||||
padding: var(--space-3);
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-lg);
|
||||
transition: all var(--transition-normal);
|
||||
}
|
||||
|
||||
.stat-card:hover {
|
||||
border-color: var(--border-secondary);
|
||||
box-shadow: var(--shadow-card-hover);
|
||||
}
|
||||
|
||||
/* Compact variant / 紧凑变体 */
|
||||
.variant-compact {
|
||||
padding: var(--space-2);
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.variant-compact .stat-icon {
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
}
|
||||
|
||||
.variant-compact .stat-value {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
/* Icon / 图标 */
|
||||
.stat-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
border-radius: var(--radius-lg);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
/* Content / 内容 */
|
||||
.stat-content {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.125rem;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 500;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.stat-value-row {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: var(--space-1);
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 1.75rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: -0.02em;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.stat-suffix {
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.stat-description {
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-muted);
|
||||
margin-top: var(--space-1);
|
||||
}
|
||||
|
||||
/* Trend / 趋势 */
|
||||
.stat-trend {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem;
|
||||
padding: 0.25rem 0.5rem;
|
||||
border-radius: var(--radius-md);
|
||||
font-size: 0.75rem;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.stat-trend.up {
|
||||
background: var(--success-light);
|
||||
color: var(--success);
|
||||
}
|
||||
|
||||
.stat-trend.down {
|
||||
background: var(--error-light);
|
||||
color: var(--error);
|
||||
}
|
||||
</style>
|
||||
100
web/src/components/common/ThemeToggle.vue
Normal file
100
web/src/components/common/ThemeToggle.vue
Normal file
@@ -0,0 +1,100 @@
|
||||
<template>
|
||||
<!-- Theme toggle button for switching between light/dark mode -->
|
||||
<!-- 主题切换按钮,用于切换浅色/深色模式 -->
|
||||
<button
|
||||
class="theme-toggle"
|
||||
:aria-label="isDark ? '切换到浅色模式' : '切换到深色模式'"
|
||||
@click="toggleTheme"
|
||||
>
|
||||
<transition name="icon-fade" mode="out-in">
|
||||
<el-icon v-if="isDark" key="moon" :size="18">
|
||||
<Moon />
|
||||
</el-icon>
|
||||
<el-icon v-else key="sun" :size="18">
|
||||
<Sunny />
|
||||
</el-icon>
|
||||
</transition>
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { Moon, Sunny } from '@element-plus/icons-vue'
|
||||
|
||||
/**
|
||||
* ThemeToggle - Dark/Light mode toggle button
|
||||
* 主题切换按钮 - 深色/浅色模式切换
|
||||
*/
|
||||
const isDark = ref(false)
|
||||
|
||||
// Initialize theme from localStorage or system preference
|
||||
// 从 localStorage 或系统偏好初始化主题
|
||||
onMounted(() => {
|
||||
const savedTheme = localStorage.getItem('theme')
|
||||
if (savedTheme) {
|
||||
isDark.value = savedTheme === 'dark'
|
||||
} else {
|
||||
isDark.value = window.matchMedia('(prefers-color-scheme: dark)').matches
|
||||
}
|
||||
applyTheme()
|
||||
})
|
||||
|
||||
// Toggle between dark and light mode / 切换深色和浅色模式
|
||||
const toggleTheme = () => {
|
||||
isDark.value = !isDark.value
|
||||
applyTheme()
|
||||
localStorage.setItem('theme', isDark.value ? 'dark' : 'light')
|
||||
}
|
||||
|
||||
// Apply theme to document / 应用主题到文档
|
||||
const applyTheme = () => {
|
||||
if (isDark.value) {
|
||||
document.documentElement.classList.add('dark')
|
||||
} else {
|
||||
document.documentElement.classList.remove('dark')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.theme-toggle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 2.25rem;
|
||||
height: 2.25rem;
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--bg-card);
|
||||
color: var(--text-secondary);
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-fast);
|
||||
}
|
||||
|
||||
.theme-toggle:hover {
|
||||
background: var(--bg-card-hover);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--border-secondary);
|
||||
}
|
||||
|
||||
.theme-toggle:focus-visible {
|
||||
outline: 2px solid var(--accent);
|
||||
outline-offset: 2px;
|
||||
}
|
||||
|
||||
/* Icon transition / 图标过渡动画 */
|
||||
.icon-fade-enter-active,
|
||||
.icon-fade-leave-active {
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.icon-fade-enter-from {
|
||||
opacity: 0;
|
||||
transform: rotate(-90deg) scale(0.8);
|
||||
}
|
||||
|
||||
.icon-fade-leave-to {
|
||||
opacity: 0;
|
||||
transform: rotate(90deg) scale(0.8);
|
||||
}
|
||||
</style>
|
||||
22
web/src/components/common/index.ts
Normal file
22
web/src/components/common/index.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Common UI Components barrel export
|
||||
* 通用 UI 组件统一导出
|
||||
*/
|
||||
|
||||
// Layout Components / 布局组件
|
||||
export { default as PageHeader } from './PageHeader.vue'
|
||||
export { default as BaseCard } from './BaseCard.vue'
|
||||
export { default as StatCard } from './StatCard.vue'
|
||||
export { default as EmptyState } from './EmptyState.vue'
|
||||
|
||||
// Interactive Components / 交互组件
|
||||
export { default as ProjectCard } from './ProjectCard.vue'
|
||||
export { default as ThemeToggle } from './ThemeToggle.vue'
|
||||
export { default as ActionButton } from './ActionButton.vue'
|
||||
|
||||
// Dialog Components / 弹窗组件
|
||||
export { default as CreateDramaDialog } from './CreateDramaDialog.vue'
|
||||
export { default as AIConfigDialog } from './AIConfigDialog.vue'
|
||||
|
||||
// Layout Components / 布局组件
|
||||
export { default as AppLayout } from './AppLayout.vue'
|
||||
@@ -332,8 +332,11 @@
|
||||
<div class="param-section" v-if="currentShot">
|
||||
<div class="param-group">
|
||||
<label>视频预览</label>
|
||||
<div class="video-preview" v-if="currentShot.video_url">
|
||||
<video :src="currentShot.video_url" controls style="width: 100%;" />
|
||||
<div class="video-preview" v-if="currentShot.video_url" @click="toggleVideoPlay">
|
||||
<video ref="videoPlayerRef" :src="currentShot.video_url" style="width: 100%;" @ended="videoPlaying = false" />
|
||||
<div class="video-play-overlay" :class="{ hidden: videoPlaying }">
|
||||
<el-icon :size="48"><VideoPlay /></el-icon>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="video-placeholder">
|
||||
<el-icon><VideoCamera /></el-icon>
|
||||
@@ -443,6 +446,19 @@ const selectedCharacters = ref<string[]>([])
|
||||
const availableCharacters = ref<any[]>([])
|
||||
const backgroundPrompt = ref('')
|
||||
const backgroundsCache = ref<Background[]>([])
|
||||
const videoPlayerRef = ref<HTMLVideoElement | null>(null)
|
||||
const videoPlaying = ref(false)
|
||||
|
||||
const toggleVideoPlay = () => {
|
||||
if (!videoPlayerRef.value) return
|
||||
if (videoPlaying.value) {
|
||||
videoPlayerRef.value.pause()
|
||||
videoPlaying.value = false
|
||||
} else {
|
||||
videoPlayerRef.value.play()
|
||||
videoPlaying.value = true
|
||||
}
|
||||
}
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
@@ -752,22 +768,22 @@ watch(() => currentShot.value, () => {
|
||||
.storyboard-editor {
|
||||
display: flex;
|
||||
height: 100vh;
|
||||
background: #f5f7fa;
|
||||
color: #303133;
|
||||
background: var(--bg-primary);
|
||||
color: var(--text-primary);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.left-panel {
|
||||
width: 280px;
|
||||
flex-shrink: 0;
|
||||
background: #ffffff;
|
||||
background: var(--bg-card);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-right: 1px solid #e4e7ed;
|
||||
border-right: 1px solid var(--border-primary);
|
||||
|
||||
.panel-header {
|
||||
padding: 16px;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
@@ -782,7 +798,7 @@ watch(() => currentShot.value, () => {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -796,35 +812,35 @@ watch(() => currentShot.value, () => {
|
||||
gap: 12px;
|
||||
padding: 12px;
|
||||
margin-bottom: 8px;
|
||||
background: #f5f7fa;
|
||||
background: var(--bg-secondary);
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
border: 1px solid #e4e7ed;
|
||||
border: 1px solid var(--border-primary);
|
||||
|
||||
&:hover {
|
||||
background: #ecf5ff;
|
||||
border-color: #c6e2ff;
|
||||
background: var(--accent-light);
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: #ecf5ff;
|
||||
border-color: #409eff;
|
||||
box-shadow: 0 2px 8px rgba(64, 158, 255, 0.15);
|
||||
background: var(--accent-light);
|
||||
border-color: var(--accent);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
.scene-number {
|
||||
flex-shrink: 0;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
background: #409eff;
|
||||
background: var(--accent);
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: 600;
|
||||
font-size: 12px;
|
||||
color: #ffffff;
|
||||
color: var(--text-inverse);
|
||||
}
|
||||
|
||||
.scene-content {
|
||||
@@ -839,7 +855,7 @@ watch(() => currentShot.value, () => {
|
||||
|
||||
.time-location {
|
||||
font-size: 11px;
|
||||
color: #909399;
|
||||
color: var(--text-muted);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -848,7 +864,7 @@ watch(() => currentShot.value, () => {
|
||||
|
||||
.scene-desc {
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
color: var(--text-secondary);
|
||||
line-height: 1.4;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -864,8 +880,8 @@ watch(() => currentShot.value, () => {
|
||||
height: 40px;
|
||||
border-radius: 4px;
|
||||
overflow: hidden;
|
||||
background: #f0f2f5;
|
||||
border: 1px solid #dcdfe6;
|
||||
background: var(--bg-card-hover);
|
||||
border: 1px solid var(--border-primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -876,12 +892,12 @@ watch(() => currentShot.value, () => {
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #f5f7fa;
|
||||
background: var(--bg-primary);
|
||||
|
||||
.preview-header {
|
||||
padding: 12px 20px;
|
||||
background: #ffffff;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
background: var(--bg-card);
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
@@ -893,7 +909,7 @@ watch(() => currentShot.value, () => {
|
||||
|
||||
.shot-type {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -912,11 +928,11 @@ watch(() => currentShot.value, () => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #ffffff;
|
||||
background: var(--bg-card);
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
border: 1px solid #e4e7ed;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
|
||||
border: 1px solid var(--border-primary);
|
||||
box-shadow: var(--shadow-md);
|
||||
|
||||
.preview-image {
|
||||
width: 100%;
|
||||
@@ -933,7 +949,7 @@ watch(() => currentShot.value, () => {
|
||||
|
||||
.preview-placeholder {
|
||||
text-align: center;
|
||||
color: #909399;
|
||||
color: var(--text-muted);
|
||||
|
||||
p {
|
||||
margin-top: 12px;
|
||||
@@ -942,7 +958,7 @@ watch(() => currentShot.value, () => {
|
||||
|
||||
.hint {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
color: var(--text-muted);
|
||||
margin-top: 8px;
|
||||
}
|
||||
}
|
||||
@@ -959,15 +975,15 @@ watch(() => currentShot.value, () => {
|
||||
|
||||
.timeline-panel {
|
||||
height: 140px;
|
||||
background: #ffffff;
|
||||
border-top: 1px solid #e4e7ed;
|
||||
background: var(--bg-card);
|
||||
border-top: 1px solid var(--border-primary);
|
||||
|
||||
.timeline-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 8px 16px;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
|
||||
.timeline-tools {
|
||||
display: flex;
|
||||
@@ -976,7 +992,7 @@ watch(() => currentShot.value, () => {
|
||||
|
||||
.timecode {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
color: var(--text-muted);
|
||||
font-family: monospace;
|
||||
}
|
||||
}
|
||||
@@ -1000,22 +1016,22 @@ watch(() => currentShot.value, () => {
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
background: #f5f7fa;
|
||||
background: var(--bg-secondary);
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: #c0c4cc;
|
||||
background: var(--border-secondary);
|
||||
border-radius: 4px;
|
||||
|
||||
&:hover {
|
||||
background: #909399;
|
||||
background: var(--border-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.timeline-ruler {
|
||||
position: relative;
|
||||
height: 20px;
|
||||
border-bottom: 1px solid #dcdfe6;
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
min-width: max-content;
|
||||
|
||||
.ruler-mark {
|
||||
@@ -1027,13 +1043,13 @@ watch(() => currentShot.value, () => {
|
||||
display: block;
|
||||
width: 1px;
|
||||
height: 8px;
|
||||
background: #dcdfe6;
|
||||
background: var(--border-primary);
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 10px;
|
||||
color: #606266;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1050,21 +1066,21 @@ watch(() => currentShot.value, () => {
|
||||
flex-shrink: 0;
|
||||
width: 60px;
|
||||
height: 100%;
|
||||
background: #c6e2ff;
|
||||
background: var(--accent-light);
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
border: 1px solid #a0cfff;
|
||||
border: 1px solid var(--accent);
|
||||
|
||||
&:hover {
|
||||
background: #a0cfff;
|
||||
border-color: #79bbff;
|
||||
background: var(--accent);
|
||||
border-color: var(--accent-hover);
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: #409eff;
|
||||
border-color: #409eff;
|
||||
box-shadow: 0 2px 8px rgba(64, 158, 255, 0.3);
|
||||
background: var(--accent);
|
||||
border-color: var(--accent);
|
||||
box-shadow: var(--shadow-glow);
|
||||
}
|
||||
|
||||
.clip-content {
|
||||
@@ -1077,12 +1093,12 @@ watch(() => currentShot.value, () => {
|
||||
.clip-number {
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
}
|
||||
|
||||
&.active .clip-content .clip-number {
|
||||
color: #ffffff;
|
||||
color: var(--text-inverse);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1093,8 +1109,8 @@ watch(() => currentShot.value, () => {
|
||||
.right-panel {
|
||||
width: 420px;
|
||||
flex-shrink: 0;
|
||||
background: #ffffff;
|
||||
border-left: 1px solid #e4e7ed;
|
||||
background: var(--bg-card);
|
||||
border-left: 1px solid var(--border-primary);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
@@ -1106,8 +1122,8 @@ watch(() => currentShot.value, () => {
|
||||
|
||||
:deep(.el-tabs__header) {
|
||||
margin: 0;
|
||||
background: #ffffff;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
background: var(--bg-card);
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
flex-shrink: 0;
|
||||
padding: 0 8px;
|
||||
}
|
||||
@@ -1120,24 +1136,24 @@ watch(() => currentShot.value, () => {
|
||||
}
|
||||
|
||||
:deep(.el-tabs__item) {
|
||||
color: #606266;
|
||||
color: var(--text-secondary);
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
padding: 0 20px;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
color: #409eff;
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
color: #409eff;
|
||||
background: #ecf5ff;
|
||||
color: var(--accent);
|
||||
background: var(--accent-light);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-tabs__active-bar) {
|
||||
background: linear-gradient(90deg, #409eff 0%, #66b1ff 100%);
|
||||
background: linear-gradient(90deg, var(--accent) 0%, var(--accent-hover) 100%);
|
||||
height: 3px;
|
||||
}
|
||||
|
||||
@@ -1150,32 +1166,32 @@ watch(() => currentShot.value, () => {
|
||||
.section-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #409eff;
|
||||
color: var(--accent);
|
||||
margin: 12px 0 10px;
|
||||
padding: 6px 10px;
|
||||
background: #ecf5ff;
|
||||
background: var(--accent-light);
|
||||
border-radius: 6px;
|
||||
border-left: 3px solid #409eff;
|
||||
border-left: 3px solid var(--accent);
|
||||
}
|
||||
|
||||
.param-group {
|
||||
margin-bottom: 10px;
|
||||
padding: 10px;
|
||||
background: #f5f7fa;
|
||||
background: var(--bg-secondary);
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e4e7ed;
|
||||
border: 1px solid var(--border-primary);
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
background: #ecf5ff;
|
||||
border-color: #c6e2ff;
|
||||
box-shadow: 0 2px 8px rgba(64, 158, 255, 0.08);
|
||||
background: var(--accent-light);
|
||||
border-color: var(--accent);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
font-size: 12px;
|
||||
color: #606266;
|
||||
color: var(--text-secondary);
|
||||
margin-bottom: 6px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.3px;
|
||||
@@ -1208,29 +1224,29 @@ watch(() => currentShot.value, () => {
|
||||
.background-preview-small {
|
||||
width: 80px;
|
||||
height: 60px;
|
||||
background: #f0f2f5;
|
||||
background: var(--bg-secondary);
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
border: 1px solid #dcdfe6;
|
||||
border: 1px solid var(--border-primary);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.background-placeholder-small {
|
||||
width: 80px;
|
||||
height: 60px;
|
||||
background: #fafafa;
|
||||
background: var(--bg-primary);
|
||||
border-radius: 6px;
|
||||
border: 2px dashed #c0c4cc;
|
||||
border: 2px dashed var(--border-secondary);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #909399;
|
||||
color: var(--text-muted);
|
||||
flex-shrink: 0;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: #409eff;
|
||||
background: #ecf5ff;
|
||||
border-color: var(--accent);
|
||||
background: var(--accent-light);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1248,32 +1264,60 @@ watch(() => currentShot.value, () => {
|
||||
.video-preview {
|
||||
width: 100%;
|
||||
aspect-ratio: 2/1;
|
||||
background: #f0f2f5;
|
||||
background: var(--bg-secondary);
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
margin-bottom: 8px;
|
||||
border: 1px solid #dcdfe6;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
border: 1px solid var(--border-primary);
|
||||
box-shadow: var(--shadow-sm);
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.video-play-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
transition: opacity 0.3s ease;
|
||||
|
||||
.el-icon {
|
||||
color: white;
|
||||
filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
|
||||
}
|
||||
|
||||
&.hidden {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
.background-placeholder,
|
||||
.video-placeholder {
|
||||
width: 100%;
|
||||
aspect-ratio: 2/1;
|
||||
background: #fafafa;
|
||||
background: var(--bg-primary);
|
||||
border-radius: 6px;
|
||||
border: 2px dashed #c0c4cc;
|
||||
border: 2px dashed var(--border-secondary);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #909399;
|
||||
color: var(--text-muted);
|
||||
margin-bottom: 8px;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: #409eff;
|
||||
background: #ecf5ff;
|
||||
border-color: var(--accent);
|
||||
background: var(--accent-light);
|
||||
}
|
||||
|
||||
.el-icon {
|
||||
@@ -1322,12 +1366,12 @@ watch(() => currentShot.value, () => {
|
||||
.help-text {
|
||||
margin-top: 6px;
|
||||
font-size: 11px;
|
||||
color: #909399;
|
||||
color: var(--text-muted);
|
||||
line-height: 1.5;
|
||||
padding: 4px 8px;
|
||||
background: #ecf5ff;
|
||||
background: var(--accent-light);
|
||||
border-radius: 4px;
|
||||
border-left: 2px solid #409eff;
|
||||
border-left: 2px solid var(--accent);
|
||||
}
|
||||
|
||||
.character-list {
|
||||
@@ -1347,8 +1391,8 @@ watch(() => currentShot.value, () => {
|
||||
transform: translateY(-2px);
|
||||
|
||||
.avatar-wrapper {
|
||||
border-color: #409eff;
|
||||
box-shadow: 0 2px 8px rgba(64, 158, 255, 0.2);
|
||||
border-color: var(--accent);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1357,19 +1401,19 @@ watch(() => currentShot.value, () => {
|
||||
height: 50px;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
background: #f0f2f5;
|
||||
background: var(--bg-secondary);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #909399;
|
||||
border: 2px solid #c0c4cc;
|
||||
color: var(--text-muted);
|
||||
border: 2px solid var(--border-secondary);
|
||||
transition: all 0.3s ease;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.avatar-name {
|
||||
font-size: 11px;
|
||||
color: #606266;
|
||||
color: var(--text-secondary);
|
||||
text-align: center;
|
||||
max-width: 100%;
|
||||
overflow: hidden;
|
||||
@@ -1384,16 +1428,16 @@ watch(() => currentShot.value, () => {
|
||||
.composition-placeholder {
|
||||
width: 100%;
|
||||
aspect-ratio: 2/1;
|
||||
background: #fafafa;
|
||||
background: var(--bg-primary);
|
||||
border-radius: 6px;
|
||||
border: 2px dashed #c0c4cc;
|
||||
border: 2px dashed var(--border-secondary);
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 8px;
|
||||
color: #909399;
|
||||
color: var(--text-muted);
|
||||
|
||||
.el-icon {
|
||||
font-size: 32px;
|
||||
@@ -1406,7 +1450,7 @@ watch(() => currentShot.value, () => {
|
||||
|
||||
.hint {
|
||||
font-size: 10px;
|
||||
color: #909399;
|
||||
color: var(--text-muted);
|
||||
margin-top: 4px;
|
||||
}
|
||||
}
|
||||
@@ -1417,25 +1461,25 @@ watch(() => currentShot.value, () => {
|
||||
:deep(.el-input__wrapper),
|
||||
:deep(.el-textarea__inner),
|
||||
:deep(.el-select) {
|
||||
background-color: #ffffff;
|
||||
background-color: var(--bg-card);
|
||||
border-radius: 6px;
|
||||
border: 1px solid #dcdfe6;
|
||||
border: 1px solid var(--border-primary);
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
border-color: #c0c4cc;
|
||||
border-color: var(--border-secondary);
|
||||
}
|
||||
|
||||
&:focus,
|
||||
&.is-focus {
|
||||
border-color: #409eff;
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||
border-color: var(--accent);
|
||||
box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.el-input__inner),
|
||||
:deep(.el-textarea__inner) {
|
||||
color: #606266;
|
||||
color: var(--text-primary);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
@@ -1444,7 +1488,7 @@ watch(() => currentShot.value, () => {
|
||||
}
|
||||
|
||||
:deep(.el-divider) {
|
||||
border-color: #e4e7ed;
|
||||
border-color: var(--border-primary);
|
||||
margin: 12px 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<div class="editor-workspace">
|
||||
<!-- 预览区域 -->
|
||||
<div class="preview-panel">
|
||||
<div class="video-preview">
|
||||
<div class="video-preview" @click="togglePlay">
|
||||
<video
|
||||
ref="previewPlayer"
|
||||
:src="currentPreviewUrl"
|
||||
@@ -41,6 +41,10 @@
|
||||
:class="[`transition-${transitionState.type}`, { 'transition-in': transitionState.phase === 'in', 'transition-out': transitionState.phase === 'out' }]"
|
||||
:style="{ animationDuration: transitionState.duration + 's' }"
|
||||
></div>
|
||||
<!-- 播放/暂停图标覆盖层 -->
|
||||
<div class="video-play-overlay" :class="{ hidden: isPlaying }" v-if="currentPreviewUrl">
|
||||
<el-icon :size="64"><VideoPlay /></el-icon>
|
||||
</div>
|
||||
<div class="preview-overlay" v-if="!currentPreviewUrl">
|
||||
<el-empty :description="$t('video.dragToTimeline')" />
|
||||
</div>
|
||||
@@ -154,7 +158,18 @@
|
||||
@dragover.prevent
|
||||
@click="clickTimeline($event)"
|
||||
>
|
||||
<div class="track-label">{{ $t('video.videoTrack') }}</div>
|
||||
<div class="track-label">
|
||||
<span>{{ $t('video.videoTrack') }}</span>
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
@click.stop="clearAllClips"
|
||||
:disabled="timelineClips.length === 0"
|
||||
:title="$t('video.clearTrack')"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="track-clips">
|
||||
<!-- 视频片段 -->
|
||||
<div
|
||||
@@ -926,6 +941,17 @@ const removeClip = (clip: TimelineClip) => {
|
||||
}
|
||||
}
|
||||
|
||||
const clearAllClips = () => {
|
||||
if (timelineClips.value.length === 0) return
|
||||
|
||||
timelineClips.value = []
|
||||
audioClips.value = []
|
||||
selectedClipId.value = null
|
||||
selectedAudioClipId.value = null
|
||||
currentTime.value = 0
|
||||
ElMessage.success('已清空轨道')
|
||||
}
|
||||
|
||||
const updateClipOrders = () => {
|
||||
timelineClips.value.forEach((clip, index) => {
|
||||
clip.order = index
|
||||
@@ -1356,6 +1382,14 @@ const pauseTimeline = () => {
|
||||
}
|
||||
}
|
||||
|
||||
const togglePlay = () => {
|
||||
if (isPlaying.value) {
|
||||
pauseTimeline()
|
||||
} else {
|
||||
playTimeline()
|
||||
}
|
||||
}
|
||||
|
||||
// 键盘快捷键
|
||||
const handleKeyPress = (event: KeyboardEvent) => {
|
||||
// 如果在输入框中,不处理快捷键
|
||||
@@ -1665,16 +1699,16 @@ defineExpose({
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fafafa;
|
||||
color: #333;
|
||||
background: var(--bg-primary);
|
||||
color: var(--text-primary);
|
||||
|
||||
.editor-toolbar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 10px 16px;
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #e0e0e0;
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--border-primary);
|
||||
|
||||
.toolbar-left {
|
||||
display: flex;
|
||||
@@ -1684,7 +1718,7 @@ defineExpose({
|
||||
.time-display {
|
||||
font-family: 'Courier New', monospace;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
color: var(--text-secondary);
|
||||
min-width: 160px;
|
||||
}
|
||||
}
|
||||
@@ -1699,8 +1733,8 @@ defineExpose({
|
||||
flex: 0 0 500px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
border: 1px solid #e0e0e0;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-primary);
|
||||
|
||||
.video-preview {
|
||||
flex: 1;
|
||||
@@ -1725,7 +1759,35 @@ defineExpose({
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(245, 245, 245, 0.95);
|
||||
background: var(--bg-secondary);
|
||||
}
|
||||
|
||||
.video-play-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(0, 0, 0, 0.3);
|
||||
cursor: pointer;
|
||||
transition: opacity 0.3s ease;
|
||||
z-index: 5;
|
||||
|
||||
.el-icon {
|
||||
color: white;
|
||||
filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
|
||||
}
|
||||
|
||||
&.hidden {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
}
|
||||
}
|
||||
|
||||
.transition-overlay {
|
||||
@@ -1861,8 +1923,8 @@ defineExpose({
|
||||
|
||||
.preview-controls {
|
||||
padding: 12px 16px;
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #e0e0e0;
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--border-primary);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1870,7 +1932,7 @@ defineExpose({
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
background: var(--bg-card);
|
||||
overflow: hidden;
|
||||
|
||||
.library-header {
|
||||
@@ -1878,8 +1940,8 @@ defineExpose({
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 12px 16px;
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #e0e0e0;
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--border-primary);
|
||||
|
||||
.header-left {
|
||||
display: flex;
|
||||
@@ -1890,12 +1952,12 @@ defineExpose({
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
span {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1915,26 +1977,26 @@ defineExpose({
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-track {
|
||||
background: #f0f0f0;
|
||||
background: var(--bg-secondary);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: #d0d0d0;
|
||||
background: var(--border-secondary);
|
||||
border-radius: 4px;
|
||||
|
||||
&:hover {
|
||||
background: #c0c0c0;
|
||||
background: var(--border-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.media-item {
|
||||
position: relative;
|
||||
background: #f5f5f5;
|
||||
background: var(--bg-secondary);
|
||||
border-radius: 6px;
|
||||
overflow: hidden;
|
||||
cursor: move;
|
||||
border: 1px solid var(--el-border-color);
|
||||
border: 1px solid var(--border-primary);
|
||||
transition: all 0.3s;
|
||||
|
||||
&:hover {
|
||||
@@ -1960,7 +2022,7 @@ defineExpose({
|
||||
position: relative;
|
||||
width: 100%;
|
||||
aspect-ratio: 16/9;
|
||||
background: #f0f0f0;
|
||||
background: var(--bg-card-hover);
|
||||
cursor: pointer;
|
||||
|
||||
video {
|
||||
@@ -2017,13 +2079,13 @@ defineExpose({
|
||||
.media-title {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.media-desc {
|
||||
font-size: 11px;
|
||||
color: #999;
|
||||
color: var(--text-muted);
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -2038,16 +2100,16 @@ defineExpose({
|
||||
flex: 0 0 280px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: #fff;
|
||||
border: 1px solid #e0e0e0;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-primary);
|
||||
|
||||
.timeline-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 8px 12px;
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #e0e0e0;
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--border-primary);
|
||||
|
||||
.zoom-controls {
|
||||
display: flex;
|
||||
@@ -2056,7 +2118,7 @@ defineExpose({
|
||||
|
||||
.zoom-level {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
color: var(--text-muted);
|
||||
min-width: 50px;
|
||||
text-align: right;
|
||||
}
|
||||
@@ -2068,12 +2130,12 @@ defineExpose({
|
||||
position: relative;
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
background: #fafafa;
|
||||
background: var(--bg-primary);
|
||||
|
||||
.timeline-ruler {
|
||||
height: 30px;
|
||||
background: #fff;
|
||||
border: 1px solid #e0e0e0;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-primary);
|
||||
position: relative;
|
||||
|
||||
.ruler-tick {
|
||||
@@ -2083,11 +2145,11 @@ defineExpose({
|
||||
|
||||
.tick-mark {
|
||||
width: 1px;
|
||||
background: #d0d0d0;
|
||||
background: var(--border-secondary);
|
||||
|
||||
&.major {
|
||||
height: 20px;
|
||||
background: #b0b0b0;
|
||||
background: var(--border-primary);
|
||||
}
|
||||
|
||||
&.minor {
|
||||
@@ -2101,7 +2163,7 @@ defineExpose({
|
||||
top: 2px;
|
||||
left: 4px;
|
||||
font-size: 10px;
|
||||
color: #999;
|
||||
color: var(--text-muted);
|
||||
font-family: 'Courier New', monospace;
|
||||
}
|
||||
}
|
||||
@@ -2117,8 +2179,8 @@ defineExpose({
|
||||
.playhead-line {
|
||||
width: 2px;
|
||||
height: 100%;
|
||||
background: #3498db;
|
||||
box-shadow: 0 0 8px rgba(52, 152, 219, 0.6);
|
||||
background: var(--accent);
|
||||
box-shadow: 0 0 8px rgba(14, 165, 233, 0.6);
|
||||
}
|
||||
|
||||
.playhead-handle {
|
||||
@@ -2127,17 +2189,17 @@ defineExpose({
|
||||
left: -6px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
background: #3498db;
|
||||
background: var(--accent);
|
||||
border-radius: 50%;
|
||||
border: 2px solid #fff;
|
||||
border: 2px solid var(--bg-card);
|
||||
}
|
||||
}
|
||||
|
||||
.timeline-track {
|
||||
position: relative;
|
||||
height: 80px;
|
||||
background: #f5f5f5;
|
||||
border: 1px solid #e0e0e0;
|
||||
background: var(--bg-secondary);
|
||||
border: 1px solid var(--border-primary);
|
||||
|
||||
.track-label {
|
||||
position: absolute;
|
||||
@@ -2149,9 +2211,9 @@ defineExpose({
|
||||
align-items: center;
|
||||
padding-left: 12px;
|
||||
font-size: 12px;
|
||||
color: #666;
|
||||
background: #fff;
|
||||
border: 1px solid #e0e0e0;
|
||||
color: var(--text-secondary);
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-primary);
|
||||
z-index: 50;
|
||||
}
|
||||
|
||||
@@ -2164,7 +2226,7 @@ defineExpose({
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
bottom: 8px;
|
||||
background: #3a5f7d;
|
||||
background: var(--accent);
|
||||
border-radius: 4px;
|
||||
border: 2px solid transparent;
|
||||
cursor: move;
|
||||
@@ -2172,13 +2234,13 @@ defineExpose({
|
||||
overflow: hidden;
|
||||
|
||||
&:hover {
|
||||
border-color: #5a9fd4;
|
||||
box-shadow: 0 2px 8px rgba(90, 159, 212, 0.3);
|
||||
border-color: var(--accent-hover);
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
&.selected {
|
||||
border-color: #3498db;
|
||||
box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.3);
|
||||
border-color: var(--accent);
|
||||
box-shadow: var(--shadow-glow);
|
||||
}
|
||||
|
||||
.clip-content {
|
||||
@@ -2191,7 +2253,7 @@ defineExpose({
|
||||
.clip-thumbnail {
|
||||
width: 60px;
|
||||
height: 100%;
|
||||
background: #f0f0f0;
|
||||
background: var(--bg-card-hover);
|
||||
border-radius: 3px;
|
||||
overflow: hidden;
|
||||
flex-shrink: 0;
|
||||
@@ -2211,7 +2273,7 @@ defineExpose({
|
||||
.clip-title {
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
color: var(--text-inverse);
|
||||
margin-bottom: 2px;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
@@ -2220,7 +2282,8 @@ defineExpose({
|
||||
|
||||
.clip-duration {
|
||||
font-size: 10px;
|
||||
color: #666;
|
||||
color: var(--text-inverse);
|
||||
opacity: 0.8;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2263,7 +2326,7 @@ defineExpose({
|
||||
transition: opacity 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: #e74c3c;
|
||||
background: var(--error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2305,7 +2368,7 @@ defineExpose({
|
||||
top: 100%;
|
||||
margin-top: 4px;
|
||||
font-size: 10px;
|
||||
color: #666;
|
||||
color: var(--text-secondary);
|
||||
white-space: nowrap;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
padding: 2px 6px;
|
||||
@@ -2331,31 +2394,31 @@ defineExpose({
|
||||
padding-right: 8px;
|
||||
|
||||
.el-button {
|
||||
color: #999;
|
||||
color: var(--text-muted);
|
||||
|
||||
&:hover {
|
||||
color: #409eff;
|
||||
color: var(--accent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.audio-clip {
|
||||
background: #5d4a7a;
|
||||
background: #7c3aed;
|
||||
|
||||
&:hover {
|
||||
border-color: #8b6fb3;
|
||||
box-shadow: 0 2px 8px rgba(139, 111, 179, 0.3);
|
||||
border-color: #a78bfa;
|
||||
box-shadow: var(--shadow-md);
|
||||
}
|
||||
|
||||
&.selected {
|
||||
border-color: #9b59b6;
|
||||
box-shadow: 0 0 0 2px rgba(155, 89, 182, 0.3);
|
||||
border-color: #8b5cf6;
|
||||
box-shadow: var(--shadow-glow);
|
||||
}
|
||||
|
||||
.audio-waveform {
|
||||
width: 60px;
|
||||
height: 100%;
|
||||
background: linear-gradient(135deg, #8e44ad 0%, #3498db 100%);
|
||||
background: linear-gradient(135deg, #8b5cf6 0%, var(--accent) 100%);
|
||||
border-radius: 3px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -2384,7 +2447,7 @@ defineExpose({
|
||||
|
||||
.progress-message {
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
color: var(--text-secondary);
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
@@ -2392,7 +2455,7 @@ defineExpose({
|
||||
.progress-tips {
|
||||
margin-top: 20px;
|
||||
padding: 12px;
|
||||
background: #f5f7fa;
|
||||
background: var(--bg-secondary);
|
||||
border-radius: 6px;
|
||||
|
||||
p {
|
||||
@@ -2401,7 +2464,7 @@ defineExpose({
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-size: 13px;
|
||||
color: #606266;
|
||||
color: var(--text-secondary);
|
||||
|
||||
.el-icon {
|
||||
font-size: 16px;
|
||||
|
||||
@@ -52,7 +52,8 @@ export default {
|
||||
name: 'Name',
|
||||
description: 'Description',
|
||||
createdAt: 'Created At',
|
||||
updatedAt: 'Updated At'
|
||||
updatedAt: 'Updated At',
|
||||
perPage: 'Per Page'
|
||||
},
|
||||
settings: {
|
||||
title: 'Settings',
|
||||
@@ -110,13 +111,23 @@ export default {
|
||||
}
|
||||
},
|
||||
drama: {
|
||||
title: 'Drama Management',
|
||||
title: 'My Drama Projects',
|
||||
create: 'Create Project',
|
||||
totalProjects: 'Total {count} projects',
|
||||
createNew: 'Create New Project',
|
||||
aiConfig: 'AI Configuration',
|
||||
aiConfigTip: 'Please configure AI services before creating a project',
|
||||
empty: 'No projects yet, click the button above to create a new project',
|
||||
createNew: 'Create Project',
|
||||
createDesc: 'Fill in basic information to create your drama project',
|
||||
aiConfig: 'AI Config',
|
||||
aiConfigTip: 'Please configure AI service before creating a project',
|
||||
empty: 'No projects yet',
|
||||
emptyHint: 'Click "Create Project" button above to start your first drama',
|
||||
editProject: 'Edit Project',
|
||||
projectName: 'Project Name',
|
||||
projectNamePlaceholder: 'Enter project name',
|
||||
projectDesc: 'Project Description',
|
||||
projectDescPlaceholder: 'Enter project description (optional)',
|
||||
deleteConfirm: 'Are you sure you want to delete this project?',
|
||||
noCover: 'No cover',
|
||||
noDescription: 'No description',
|
||||
status: {
|
||||
draft: 'Draft',
|
||||
production: 'In Production',
|
||||
@@ -632,6 +643,7 @@ export default {
|
||||
dragToTimeline: 'Drag scenes to timeline to start editing',
|
||||
videoTrack: 'Video Track',
|
||||
audioTrack: 'Audio Track',
|
||||
clearTrack: 'Clear Track',
|
||||
soundAndMusic: 'Sound & Music',
|
||||
soundMusicInDev: 'Sound & Music feature in development',
|
||||
noMergeYet: 'No videos merged yet',
|
||||
|
||||
@@ -133,6 +133,15 @@ export default {
|
||||
aiConfig: 'AI配置',
|
||||
aiConfigTip: '请先配置 AI 服务后再创建项目',
|
||||
empty: '暂无项目,点击上方按钮创建新项目',
|
||||
emptyHint: '点击上方"创建新项目"按钮开始您的第一部短剧',
|
||||
editProject: '编辑项目',
|
||||
projectName: '项目名称',
|
||||
projectNamePlaceholder: '请输入项目名称',
|
||||
projectDesc: '项目描述',
|
||||
projectDescPlaceholder: '请输入项目描述(可选)',
|
||||
deleteConfirm: '确定要删除这个项目吗?',
|
||||
noCover: '暂无封面',
|
||||
noDescription: '暂无描述',
|
||||
status: {
|
||||
draft: '草稿',
|
||||
production: '制作中',
|
||||
@@ -533,6 +542,7 @@ export default {
|
||||
dragToTimeline: '将场景拖拽到时间线开始编辑',
|
||||
videoTrack: '视频轨道',
|
||||
audioTrack: '音频轨道',
|
||||
clearTrack: '清空轨道',
|
||||
soundAndMusic: '音效与配乐',
|
||||
soundMusicInDev: '音效与配乐功能开发中',
|
||||
noMergeYet: '还没有合成过视频',
|
||||
|
||||
@@ -2,6 +2,8 @@ import { createApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import ElementPlus from 'element-plus'
|
||||
import 'element-plus/dist/index.css'
|
||||
import './assets/styles/element/index.scss'
|
||||
|
||||
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
||||
|
||||
import App from './App.vue'
|
||||
|
||||
@@ -1,47 +1,64 @@
|
||||
<template>
|
||||
<div class="drama-create-container">
|
||||
<el-page-header @back="goBack" title="返回">
|
||||
<template #content>
|
||||
<h2>创建新项目</h2>
|
||||
</template>
|
||||
</el-page-header>
|
||||
<!-- Drama Create Page / 创建短剧页面 -->
|
||||
<div class="page-container">
|
||||
<div class="content-wrapper animate-fade-in">
|
||||
<!-- Header / 头部 -->
|
||||
<PageHeader
|
||||
title="创建新项目"
|
||||
subtitle="填写基本信息来创建你的短剧项目"
|
||||
:show-back="true"
|
||||
back-text="返回"
|
||||
:show-border="false"
|
||||
/>
|
||||
|
||||
<el-card class="form-card" shadow="never">
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
@submit.prevent="handleSubmit"
|
||||
>
|
||||
<el-form-item label="项目标题" prop="title" required>
|
||||
<el-input
|
||||
v-model="form.title"
|
||||
placeholder="请输入项目标题"
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- Form Card / 表单卡片 -->
|
||||
<div class="form-card">
|
||||
|
||||
<el-form-item label="项目描述" prop="description">
|
||||
<el-input
|
||||
v-model="form.description"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请输入项目描述(可选)"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form
|
||||
ref="formRef"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-position="top"
|
||||
class="create-form"
|
||||
@submit.prevent="handleSubmit"
|
||||
>
|
||||
<el-form-item label="项目标题" prop="title" required>
|
||||
<el-input
|
||||
v-model="form.title"
|
||||
placeholder="给你的短剧起个名字"
|
||||
size="large"
|
||||
maxlength="100"
|
||||
show-word-limit
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSubmit" :loading="loading">
|
||||
创建项目
|
||||
</el-button>
|
||||
<el-button @click="goBack">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
<el-form-item label="项目描述" prop="description">
|
||||
<el-input
|
||||
v-model="form.description"
|
||||
type="textarea"
|
||||
:rows="5"
|
||||
placeholder="简要描述你的短剧内容、风格或创意(可选)"
|
||||
maxlength="500"
|
||||
show-word-limit
|
||||
resize="none"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<div class="form-actions">
|
||||
<el-button size="large" @click="goBack">取消</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
size="large"
|
||||
:loading="loading"
|
||||
@click="handleSubmit"
|
||||
>
|
||||
<el-icon v-if="!loading"><Plus /></el-icon>
|
||||
创建项目
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -49,8 +66,10 @@
|
||||
import { ref, reactive } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessage, type FormInstance, type FormRules } from 'element-plus'
|
||||
import { ArrowLeft, Plus } from '@element-plus/icons-vue'
|
||||
import { dramaAPI } from '@/api/drama'
|
||||
import type { CreateDramaRequest } from '@/types/drama'
|
||||
import { PageHeader } from '@/components/common'
|
||||
|
||||
const router = useRouter()
|
||||
const formRef = ref<FormInstance>()
|
||||
@@ -68,6 +87,7 @@ const rules: FormRules = {
|
||||
]
|
||||
}
|
||||
|
||||
// Submit form / 提交表单
|
||||
const handleSubmit = async () => {
|
||||
if (!formRef.value) return
|
||||
|
||||
@@ -87,25 +107,69 @@ const handleSubmit = async () => {
|
||||
})
|
||||
}
|
||||
|
||||
// Go back / 返回上一页
|
||||
const goBack = () => {
|
||||
router.back()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drama-create-container {
|
||||
padding: 24px;
|
||||
max-width: 800px;
|
||||
/* ========================================
|
||||
Page Layout / 页面布局 - 紧凑边距
|
||||
======================================== */
|
||||
.page-container {
|
||||
min-height: 100vh;
|
||||
background-color: var(--bg-primary);
|
||||
padding: var(--space-2) var(--space-3);
|
||||
transition: background-color var(--transition-normal);
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.page-container {
|
||||
padding: var(--space-3) var(--space-4);
|
||||
}
|
||||
}
|
||||
|
||||
.content-wrapper {
|
||||
max-width: 640px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Form Card / 表单卡片
|
||||
======================================== */
|
||||
.form-card {
|
||||
margin-top: 24px;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-xl);
|
||||
overflow: hidden;
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
.form-tip {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
margin-top: 4px;
|
||||
/* ========================================
|
||||
Form Styles / 表单样式 - 紧凑内边距
|
||||
======================================== */
|
||||
.create-form {
|
||||
padding: var(--space-4);
|
||||
}
|
||||
|
||||
.create-form :deep(.el-form-item) {
|
||||
margin-bottom: var(--space-4);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Form Actions / 表单操作区
|
||||
======================================== */
|
||||
.form-actions {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: var(--space-3);
|
||||
padding-top: var(--space-4);
|
||||
border-top: 1px solid var(--border-primary);
|
||||
margin-top: var(--space-2);
|
||||
}
|
||||
|
||||
.form-actions .el-button {
|
||||
min-width: 100px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,123 +1,173 @@
|
||||
<template>
|
||||
<div class="drama-list-container">
|
||||
<div class="page-header-wrapper">
|
||||
<div class="page-header">
|
||||
<div>
|
||||
<h2>{{ $t('drama.title') }}</h2>
|
||||
<p class="subtitle">{{ $t('drama.totalProjects', { count: total }) }}</p>
|
||||
</div>
|
||||
<div style="display: flex; gap: 12px; align-items: center;">
|
||||
<!-- Drama List Page - Refactored with modern minimalist design -->
|
||||
<!-- 短剧列表页面 - 使用现代简约设计重构 -->
|
||||
<div class="page-container">
|
||||
<div class="content-wrapper animate-fade-in">
|
||||
<!-- Page Header / 页面头部 -->
|
||||
<PageHeader
|
||||
:title="$t('drama.title')"
|
||||
:subtitle="$t('drama.totalProjects', { count: total })"
|
||||
>
|
||||
<template #actions>
|
||||
<LanguageSwitcher />
|
||||
<el-alert
|
||||
type="info"
|
||||
:closable="false"
|
||||
show-icon
|
||||
style="padding: 8px 12px;"
|
||||
<ThemeToggle />
|
||||
<el-button @click="showAIConfig = true" class="header-btn">
|
||||
<el-icon><Setting /></el-icon>
|
||||
<span class="btn-text">{{ $t('drama.aiConfig') }}</span>
|
||||
</el-button>
|
||||
<el-button type="primary" @click="handleCreate" class="header-btn primary">
|
||||
<el-icon><Plus /></el-icon>
|
||||
<span class="btn-text">{{ $t('drama.createNew') }}</span>
|
||||
</el-button>
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<!-- Project Grid / 项目网格 -->
|
||||
<div v-loading="loading" class="projects-grid" :class="{ 'is-empty': !loading && dramas.length === 0 }">
|
||||
<!-- Empty state / 空状态 -->
|
||||
<EmptyState
|
||||
v-if="!loading && dramas.length === 0"
|
||||
:title="$t('drama.empty')"
|
||||
:description="$t('drama.emptyHint')"
|
||||
:icon="Film"
|
||||
>
|
||||
<el-button type="primary" @click="handleCreate">
|
||||
<el-icon><Plus /></el-icon>
|
||||
{{ $t('drama.createNew') }}
|
||||
</el-button>
|
||||
</EmptyState>
|
||||
|
||||
<!-- Project Cards / 项目卡片列表 -->
|
||||
<ProjectCard
|
||||
v-for="drama in dramas"
|
||||
:key="drama.id"
|
||||
:title="drama.title"
|
||||
:description="drama.description"
|
||||
:cover-image="drama.thumbnail"
|
||||
:tag="drama.genre"
|
||||
:updated-at="drama.updated_at"
|
||||
@click="viewDrama(drama.id)"
|
||||
>
|
||||
<template #actions>
|
||||
<ActionButton
|
||||
:icon="Edit"
|
||||
:tooltip="$t('common.edit')"
|
||||
variant="primary"
|
||||
@click="editDrama(drama.id)"
|
||||
/>
|
||||
<ActionButton
|
||||
:icon="View"
|
||||
:tooltip="$t('common.view')"
|
||||
@click="viewDrama(drama.id)"
|
||||
/>
|
||||
<el-popconfirm
|
||||
:title="$t('drama.deleteConfirm')"
|
||||
:confirm-button-text="$t('common.confirm')"
|
||||
:cancel-button-text="$t('common.cancel')"
|
||||
@confirm="deleteDrama(drama.id)"
|
||||
>
|
||||
<template #reference>
|
||||
<ActionButton
|
||||
:icon="Delete"
|
||||
:tooltip="$t('common.delete')"
|
||||
variant="danger"
|
||||
/>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</ProjectCard>
|
||||
</div>
|
||||
|
||||
<!-- Edit Dialog / 编辑对话框 -->
|
||||
<el-dialog
|
||||
v-model="editDialogVisible"
|
||||
:title="$t('drama.editProject')"
|
||||
width="520px"
|
||||
:close-on-click-modal="false"
|
||||
class="edit-dialog"
|
||||
>
|
||||
<el-form
|
||||
:model="editForm"
|
||||
label-position="top"
|
||||
v-loading="editLoading"
|
||||
class="edit-form"
|
||||
>
|
||||
<el-form-item :label="$t('drama.projectName')" required>
|
||||
<el-input
|
||||
v-model="editForm.title"
|
||||
:placeholder="$t('drama.projectNamePlaceholder')"
|
||||
size="large"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('drama.projectDesc')">
|
||||
<el-input
|
||||
v-model="editForm.description"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
:placeholder="$t('drama.projectDescPlaceholder')"
|
||||
resize="none"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button @click="editDialogVisible = false" size="large">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
@click="saveEdit"
|
||||
:loading="editLoading"
|
||||
size="large"
|
||||
>
|
||||
{{ $t('common.save') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- Create Drama Dialog / 创建短剧弹窗 -->
|
||||
<CreateDramaDialog
|
||||
v-model="createDialogVisible"
|
||||
@created="loadDramas"
|
||||
/>
|
||||
|
||||
<!-- AI Config Dialog / AI配置弹窗 -->
|
||||
<AIConfigDialog v-model="showAIConfig" />
|
||||
</div>
|
||||
|
||||
<!-- Sticky Pagination / 吸底分页器 -->
|
||||
<div v-if="total > 0" class="pagination-sticky">
|
||||
<div class="pagination-inner">
|
||||
<div class="pagination-info">
|
||||
<span class="pagination-total">{{ $t('drama.totalProjects', { count: total }) }}</span>
|
||||
</div>
|
||||
<div class="pagination-controls">
|
||||
<el-pagination
|
||||
v-model:current-page="queryParams.page"
|
||||
v-model:page-size="queryParams.page_size"
|
||||
:total="total"
|
||||
:page-sizes="[12, 24, 36, 48]"
|
||||
:pager-count="5"
|
||||
layout="prev, pager, next"
|
||||
@size-change="loadDramas"
|
||||
@current-change="loadDramas"
|
||||
/>
|
||||
</div>
|
||||
<div class="pagination-size">
|
||||
<span class="size-label">{{ $t('common.perPage') }}</span>
|
||||
<el-select
|
||||
v-model="queryParams.page_size"
|
||||
size="small"
|
||||
class="size-select"
|
||||
@change="loadDramas"
|
||||
>
|
||||
<template #title>
|
||||
<span style="font-size: 13px;">{{ $t('drama.aiConfigTip') }}</span>
|
||||
</template>
|
||||
</el-alert>
|
||||
<el-button type="warning" @click="goToAIConfig" :icon="Setting">{{ $t('drama.aiConfig') }}</el-button>
|
||||
<el-button type="primary" @click="handleCreate" :icon="Plus">{{ $t('drama.createNew') }}</el-button>
|
||||
<el-option :value="12" label="12" />
|
||||
<el-option :value="24" label="24" />
|
||||
<el-option :value="36" label="36" />
|
||||
<el-option :value="48" label="48" />
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-loading="loading" class="dramas-grid">
|
||||
<el-empty v-if="!loading && dramas.length === 0" :description="$t('drama.empty')" />
|
||||
|
||||
<el-card
|
||||
v-for="drama in dramas"
|
||||
:key="drama.id"
|
||||
class="drama-card"
|
||||
shadow="hover"
|
||||
@click="viewDrama(drama.id)"
|
||||
>
|
||||
<div class="drama-cover">
|
||||
<div class="cover-overlay"></div>
|
||||
<img v-if="drama.thumbnail" :src="drama.thumbnail" :alt="drama.title" />
|
||||
<div v-else class="cover-placeholder">
|
||||
<el-icon :size="64"><Film /></el-icon>
|
||||
<p>{{ $t('drama.noCover') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="drama-info">
|
||||
<div class="info-header">
|
||||
<h3 class="drama-title">{{ drama.title }}</h3>
|
||||
<el-tag v-if="drama.genre" class="genre-tag" size="small">{{ drama.genre }}</el-tag>
|
||||
</div>
|
||||
|
||||
<p class="drama-description">{{ drama.description || $t('drama.noDescription') }}</p>
|
||||
|
||||
<div class="drama-footer">
|
||||
<div class="meta-info">
|
||||
<span class="meta-item">
|
||||
<el-icon><Clock /></el-icon>
|
||||
{{ formatDate(drama.updated_at) }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="drama-actions" @click.stop>
|
||||
<el-button size="small" text @click="editDrama(drama.id)">
|
||||
<el-icon><Edit /></el-icon>
|
||||
</el-button>
|
||||
<el-button size="small" text type="primary" @click="viewDrama(drama.id)">
|
||||
<el-icon><View /></el-icon>
|
||||
</el-button>
|
||||
<el-popconfirm
|
||||
:title="$t('drama.deleteConfirm')"
|
||||
@confirm="deleteDrama(drama.id)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button size="small" text type="danger">
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</div>
|
||||
|
||||
<el-pagination
|
||||
v-if="total > 0"
|
||||
v-model:current-page="queryParams.page"
|
||||
v-model:page-size="queryParams.page_size"
|
||||
:total="total"
|
||||
:page-sizes="[12, 24, 36, 48]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@size-change="loadDramas"
|
||||
@current-change="loadDramas"
|
||||
/>
|
||||
|
||||
<!-- 编辑对话框 -->
|
||||
<el-dialog
|
||||
v-model="editDialogVisible"
|
||||
title="编辑项目"
|
||||
width="600px"
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form :model="editForm" label-width="80px" v-loading="editLoading">
|
||||
<el-form-item label="项目名称" required>
|
||||
<el-input v-model="editForm.title" placeholder="请输入项目名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目描述">
|
||||
<el-input
|
||||
v-model="editForm.description"
|
||||
type="textarea"
|
||||
:rows="4"
|
||||
placeholder="请输入项目描述"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="editDialogVisible = false">取消</el-button>
|
||||
<el-button type="primary" @click="saveEdit" :loading="editLoading">保存</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -125,9 +175,18 @@
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { Plus, Clock, Film, Setting } from '@element-plus/icons-vue'
|
||||
import {
|
||||
Plus,
|
||||
Film,
|
||||
Setting,
|
||||
Edit,
|
||||
View,
|
||||
Delete,
|
||||
InfoFilled
|
||||
} from '@element-plus/icons-vue'
|
||||
import { dramaAPI } from '@/api/drama'
|
||||
import type { Drama, DramaListQuery, DramaStatus } from '@/types/drama'
|
||||
import type { Drama, DramaListQuery } from '@/types/drama'
|
||||
import { PageHeader, ProjectCard, ThemeToggle, ActionButton, CreateDramaDialog, EmptyState, AIConfigDialog } from '@/components/common'
|
||||
import LanguageSwitcher from '@/components/LanguageSwitcher.vue'
|
||||
|
||||
const router = useRouter()
|
||||
@@ -140,6 +199,11 @@ const queryParams = ref<DramaListQuery>({
|
||||
page_size: 12
|
||||
})
|
||||
|
||||
// Create dialog state / 创建弹窗状态
|
||||
const createDialogVisible = ref(false)
|
||||
const showAIConfig = ref(false)
|
||||
|
||||
// Load drama list / 加载短剧列表
|
||||
const loadDramas = async () => {
|
||||
loading.value = true
|
||||
try {
|
||||
@@ -153,18 +217,11 @@ const loadDramas = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const handleCreate = () => {
|
||||
router.push('/dramas/create')
|
||||
}
|
||||
|
||||
const goToAIConfig = () => {
|
||||
router.push('/settings/ai-config')
|
||||
}
|
||||
|
||||
const viewDrama = (id: string) => {
|
||||
router.push(`/dramas/${id}`)
|
||||
}
|
||||
// Navigation handlers / 导航处理
|
||||
const handleCreate = () => createDialogVisible.value = true
|
||||
const viewDrama = (id: string) => router.push(`/dramas/${id}`)
|
||||
|
||||
// Edit dialog state / 编辑对话框状态
|
||||
const editDialogVisible = ref(false)
|
||||
const editLoading = ref(false)
|
||||
const editForm = ref({
|
||||
@@ -173,6 +230,7 @@ const editForm = ref({
|
||||
description: ''
|
||||
})
|
||||
|
||||
// Open edit dialog / 打开编辑对话框
|
||||
const editDrama = async (id: string) => {
|
||||
editLoading.value = true
|
||||
editDialogVisible.value = true
|
||||
@@ -191,6 +249,7 @@ const editDrama = async (id: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
// Save edit changes / 保存编辑更改
|
||||
const saveEdit = async () => {
|
||||
if (!editForm.value.title) {
|
||||
ElMessage.warning('请输入项目名称')
|
||||
@@ -213,6 +272,7 @@ const saveEdit = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
// Delete drama / 删除短剧
|
||||
const deleteDrama = async (id: string) => {
|
||||
try {
|
||||
await dramaAPI.delete(id)
|
||||
@@ -223,243 +283,228 @@ const deleteDrama = async (id: string) => {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const formatDate = (dateString: string) => {
|
||||
const date = new Date(dateString)
|
||||
const now = new Date()
|
||||
const diff = now.getTime() - date.getTime()
|
||||
const days = Math.floor(diff / (1000 * 60 * 60 * 24))
|
||||
|
||||
if (days === 0) return '今天'
|
||||
if (days === 1) return '昨天'
|
||||
if (days < 7) return `${days}天前`
|
||||
return date.toLocaleDateString()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadDramas()
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drama-list-container {
|
||||
/* ========================================
|
||||
Page Layout / 页面布局 - 紧凑边距
|
||||
======================================== */
|
||||
.page-container {
|
||||
min-height: 100vh;
|
||||
background: #f5f5f5;
|
||||
padding: 24px;
|
||||
max-width: 1400px;
|
||||
background: var(--bg-primary);
|
||||
padding: var(--space-2) var(--space-3);
|
||||
transition: background var(--transition-normal);
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.page-container {
|
||||
padding: var(--space-3) var(--space-4);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.page-container {
|
||||
padding: var(--space-4) var(--space-5);
|
||||
}
|
||||
}
|
||||
|
||||
.content-wrapper {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.page-header-wrapper {
|
||||
margin-bottom: 32px;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 24px 0;
|
||||
}
|
||||
|
||||
.page-header h2 {
|
||||
margin: 0 0 8px 0;
|
||||
font-size: 28px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
letter-spacing: -0.5px;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
margin: 0;
|
||||
color: #64748b;
|
||||
font-size: 15px;
|
||||
/* ========================================
|
||||
Header Buttons / 头部按钮
|
||||
======================================== */
|
||||
.header-btn {
|
||||
border-radius: var(--radius-lg);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.dramas-grid {
|
||||
.header-btn.primary {
|
||||
background: linear-gradient(135deg, var(--accent) 0%, #0284c7 100%);
|
||||
border: none;
|
||||
box-shadow: 0 4px 14px rgba(14, 165, 233, 0.35);
|
||||
}
|
||||
|
||||
.header-btn.primary:hover {
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.btn-text {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.header-btn {
|
||||
padding: 0.5rem 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Projects Grid / 项目网格 - 紧凑间距
|
||||
======================================== */
|
||||
.projects-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||
gap: 20px;
|
||||
margin-bottom: 32px;
|
||||
min-height: 400px;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: var(--space-2);
|
||||
margin-bottom: var(--space-4);
|
||||
min-height: 300px;
|
||||
padding-bottom: 4rem;
|
||||
}
|
||||
|
||||
.drama-card {
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
background: white;
|
||||
border: 1px solid #e8e8e8;
|
||||
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
|
||||
@media (min-width: 640px) {
|
||||
.projects-grid {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: var(--space-2);
|
||||
}
|
||||
}
|
||||
|
||||
.drama-card:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
border-color: #409eff;
|
||||
@media (min-width: 900px) {
|
||||
.projects-grid {
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: var(--space-3);
|
||||
}
|
||||
}
|
||||
|
||||
.drama-cover {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 180px;
|
||||
overflow: hidden;
|
||||
background: linear-gradient(135deg, #409eff 0%, #66b1ff 100%);
|
||||
@media (min-width: 1200px) {
|
||||
.projects-grid {
|
||||
grid-template-columns: repeat(5, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
.cover-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@media (min-width: 1500px) {
|
||||
.projects-grid {
|
||||
grid-template-columns: repeat(6, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
.projects-grid.is-empty {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Sticky Pagination / 吸底分页器
|
||||
======================================== */
|
||||
.pagination-sticky {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s ease;
|
||||
z-index: 1;
|
||||
z-index: 100;
|
||||
background: rgba(255, 255, 255, 0.85);
|
||||
backdrop-filter: blur(16px);
|
||||
border-top: 1px solid var(--border-primary);
|
||||
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.drama-card:hover .cover-overlay {
|
||||
opacity: 1;
|
||||
.dark .pagination-sticky {
|
||||
background: rgba(10, 15, 26, 0.9);
|
||||
border-top: 1px solid var(--border-primary);
|
||||
box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
.drama-cover img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
|
||||
}
|
||||
|
||||
.drama-card:hover .drama-cover img {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.cover-placeholder {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
.pagination-inner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
color: white;
|
||||
opacity: 0.8;
|
||||
justify-content: flex-end;
|
||||
margin: 0 auto;
|
||||
padding: var(--space-3) var(--space-4);
|
||||
gap: var(--space-4);
|
||||
}
|
||||
|
||||
.cover-placeholder p {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
@media (min-width: 768px) {
|
||||
.pagination-inner {
|
||||
padding: var(--space-3) var(--space-6);
|
||||
}
|
||||
}
|
||||
|
||||
.pagination-info {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.pagination-info {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.pagination-total {
|
||||
font-size: 0.8125rem;
|
||||
color: var(--text-muted);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.drama-info {
|
||||
padding: 20px;
|
||||
.pagination-controls {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.info-header {
|
||||
.pagination-size {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-bottom: 12px;
|
||||
gap: var(--space-2);
|
||||
}
|
||||
|
||||
.drama-title {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
.size-label {
|
||||
font-size: 0.8125rem;
|
||||
color: var(--text-muted);
|
||||
display: none;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.size-label {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
.size-select {
|
||||
width: 4.5rem;
|
||||
}
|
||||
|
||||
.size-select :deep(.el-input__wrapper) {
|
||||
height: 2rem;
|
||||
border-radius: var(--radius-md);
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Edit Dialog / 编辑对话框
|
||||
======================================== */
|
||||
.edit-dialog :deep(.el-dialog) {
|
||||
border-radius: var(--radius-xl);
|
||||
}
|
||||
|
||||
.edit-dialog :deep(.el-dialog__header) {
|
||||
padding: 1.25rem 1.5rem;
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
.edit-dialog :deep(.el-dialog__title) {
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
letter-spacing: -0.3px;
|
||||
flex: 1;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.genre-tag {
|
||||
background: #409eff;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
padding: 2px 8px;
|
||||
.edit-dialog :deep(.el-dialog__body) {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
.edit-form :deep(.el-form-item__label) {
|
||||
font-weight: 500;
|
||||
font-size: 11px;
|
||||
flex-shrink: 0;
|
||||
color: var(--text-primary);
|
||||
margin-bottom: 0.5rem;
|
||||
}
|
||||
|
||||
.drama-description {
|
||||
margin: 0 0 16px 0;
|
||||
font-size: 13px;
|
||||
color: #64748b;
|
||||
line-height: 1.6;
|
||||
height: 42px;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.drama-footer {
|
||||
.dialog-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding-top: 12px;
|
||||
border-top: 1px solid #e0e0e0;
|
||||
}
|
||||
|
||||
.meta-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.meta-item {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 5px;
|
||||
font-size: 12px;
|
||||
color: #94a3b8;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.meta-item .el-icon {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.drama-actions {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.drama-actions .el-button {
|
||||
padding: 6px;
|
||||
border-radius: 4px;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.drama-actions .el-button:hover {
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
.drama-actions .el-button.is-text[type="primary"]:hover {
|
||||
background: #ecf5ff;
|
||||
color: #409eff;
|
||||
}
|
||||
|
||||
.drama-actions .el-button.is-text[type="danger"]:hover {
|
||||
background: #fef0f0;
|
||||
color: #f56c6c;
|
||||
}
|
||||
|
||||
|
||||
.pagination {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-top: 32px;
|
||||
padding: 20px;
|
||||
background: #ffffff;
|
||||
border-radius: 12px;
|
||||
border: 1px solid #e4e7ed;
|
||||
justify-content: flex-end;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,61 +1,48 @@
|
||||
<template>
|
||||
<div class="drama-management">
|
||||
<div class="page-header">
|
||||
<div class="header-left">
|
||||
<el-button :icon="ArrowLeft" @click="router.back()">{{ $t('common.back') }}</el-button>
|
||||
<div class="drama-info">
|
||||
<h1>{{ drama?.title }}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="page-container">
|
||||
<div class="content-wrapper animate-fade-in">
|
||||
<!-- Page Header / 页面头部 -->
|
||||
<PageHeader
|
||||
:title="drama?.title || ''"
|
||||
:subtitle="drama?.description || $t('drama.management.overview')"
|
||||
:show-back="true"
|
||||
:back-text="$t('common.back')"
|
||||
/>
|
||||
|
||||
<el-tabs v-model="activeTab" class="management-tabs">
|
||||
<!-- Tabs / 标签页 -->
|
||||
<div class="tabs-wrapper">
|
||||
<el-tabs v-model="activeTab" class="management-tabs">
|
||||
<!-- 项目概览 -->
|
||||
<el-tab-pane :label="$t('drama.management.overview')" name="overview">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<el-icon :size="24" color="#409eff"><Document /></el-icon>
|
||||
<span>{{ $t('drama.management.episodeStats') }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="stat-content">
|
||||
<div class="stat-number">{{ episodesCount }}</div>
|
||||
<div class="stat-label">{{ $t('drama.management.episodesCreated') }}</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<el-icon :size="24" color="#67c23a"><User /></el-icon>
|
||||
<span>{{ $t('drama.management.characterStats') }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="stat-content">
|
||||
<div class="stat-number">{{ charactersCount }}</div>
|
||||
<div class="stat-label">{{ $t('drama.management.charactersCreated') }}</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover">
|
||||
<template #header>
|
||||
<div class="card-header">
|
||||
<el-icon :size="24" color="#e6a23c"><Picture /></el-icon>
|
||||
<span>{{ $t('drama.management.sceneStats') }}</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="stat-content">
|
||||
<div class="stat-number">{{ scenesCount }}</div>
|
||||
<div class="stat-label">{{ $t('drama.management.sceneLibraryCount') }}</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="stats-grid">
|
||||
<StatCard
|
||||
:label="$t('drama.management.episodeStats')"
|
||||
:value="episodesCount"
|
||||
:icon="Document"
|
||||
icon-color="var(--accent)"
|
||||
icon-bg="var(--accent-light)"
|
||||
value-color="var(--accent)"
|
||||
:description="$t('drama.management.episodesCreated')"
|
||||
/>
|
||||
<StatCard
|
||||
:label="$t('drama.management.characterStats')"
|
||||
:value="charactersCount"
|
||||
:icon="User"
|
||||
icon-color="var(--success)"
|
||||
icon-bg="var(--success-light)"
|
||||
value-color="var(--success)"
|
||||
:description="$t('drama.management.charactersCreated')"
|
||||
/>
|
||||
<StatCard
|
||||
:label="$t('drama.management.sceneStats')"
|
||||
:value="scenesCount"
|
||||
:icon="Picture"
|
||||
icon-color="var(--warning)"
|
||||
icon-bg="var(--warning-light)"
|
||||
value-color="var(--warning)"
|
||||
:description="$t('drama.management.sceneLibraryCount')"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<!-- 引导卡片:无章节时显示 -->
|
||||
<el-alert
|
||||
@@ -75,7 +62,7 @@
|
||||
|
||||
<el-card shadow="never" style="margin-top: 20px;">
|
||||
<template #header>
|
||||
<h3>{{ $t('drama.management.projectInfo') }}</h3>
|
||||
<h3 class="card-title">{{ $t('drama.management.projectInfo') }}</h3>
|
||||
</template>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item :label="$t('drama.management.projectName')">{{ drama?.title }}</el-descriptions-item>
|
||||
@@ -101,7 +88,7 @@
|
||||
style="margin-top: 40px;"
|
||||
>
|
||||
<template #image>
|
||||
<el-icon :size="80" color="#409eff"><Document /></el-icon>
|
||||
<el-icon :size="80" class="empty-icon"><Document /></el-icon>
|
||||
</template>
|
||||
<el-button type="primary" :icon="Plus" @click="createNewEpisode">
|
||||
{{ $t('drama.management.createFirstEpisode') }}
|
||||
@@ -205,9 +192,10 @@
|
||||
|
||||
<el-empty v-if="scenes.length === 0" :description="$t('drama.management.noScenes')" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
<!-- 添加角色对话框 -->
|
||||
<!-- 添加角色对话框 -->
|
||||
<el-dialog v-model="addCharacterDialogVisible" :title="$t('character.add')" width="600px">
|
||||
<el-form :model="newCharacter" label-width="100px">
|
||||
<el-form-item :label="$t('character.name')">
|
||||
@@ -251,6 +239,7 @@
|
||||
<el-button type="primary" @click="addScene">{{ $t('common.confirm') }}</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -261,6 +250,7 @@ import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { ArrowLeft, Document, User, Picture, Plus } from '@element-plus/icons-vue'
|
||||
import { dramaAPI } from '@/api/drama'
|
||||
import type { Drama } from '@/types/drama'
|
||||
import { PageHeader, StatCard, EmptyState } from '@/components/common'
|
||||
|
||||
const router = useRouter()
|
||||
const route = useRoute()
|
||||
@@ -547,93 +537,126 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.drama-management {
|
||||
padding: 20px;
|
||||
background: #f5f7fa;
|
||||
/* ========================================
|
||||
Page Layout / 页面布局 - 紧凑边距
|
||||
======================================== */
|
||||
.page-container {
|
||||
min-height: 100vh;
|
||||
background: var(--bg-primary);
|
||||
padding: var(--space-2) var(--space-3);
|
||||
transition: background var(--transition-normal);
|
||||
}
|
||||
|
||||
.page-header {
|
||||
background: white;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
margin-bottom: 20px;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
||||
@media (min-width: 768px) {
|
||||
.page-container {
|
||||
padding: var(--space-3) var(--space-4);
|
||||
}
|
||||
}
|
||||
|
||||
.header-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
@media (min-width: 1024px) {
|
||||
.page-container {
|
||||
padding: var(--space-4) var(--space-5);
|
||||
}
|
||||
}
|
||||
|
||||
.drama-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
.content-wrapper {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.drama-info h1 {
|
||||
margin: 0;
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
/* ========================================
|
||||
Stats Grid / 统计网格 - 紧凑间距
|
||||
======================================== */
|
||||
.stats-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(1, 1fr);
|
||||
gap: var(--space-2);
|
||||
margin-bottom: var(--space-3);
|
||||
}
|
||||
|
||||
.management-tabs {
|
||||
background: white;
|
||||
padding: 20px;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
||||
@media (min-width: 640px) {
|
||||
.stats-grid {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: var(--space-3);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.stats-grid {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Tabs Wrapper / 标签页容器 - 紧凑内边距
|
||||
======================================== */
|
||||
.tabs-wrapper {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: var(--space-3);
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.tabs-wrapper {
|
||||
padding: var(--space-4);
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Tab Header / 标签页头部
|
||||
======================================== */
|
||||
.tab-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
flex-direction: column;
|
||||
gap: var(--space-3);
|
||||
margin-bottom: var(--space-4);
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
.tab-header {
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
.tab-header h2 {
|
||||
margin: 0;
|
||||
font-size: 20px;
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
letter-spacing: -0.01em;
|
||||
}
|
||||
|
||||
.card-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.stat-content {
|
||||
text-align: center;
|
||||
padding: 20px 0;
|
||||
}
|
||||
|
||||
.stat-number {
|
||||
font-size: 36px;
|
||||
font-weight: 700;
|
||||
color: #409eff;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 14px;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Character & Scene Cards / 角色场景卡片
|
||||
======================================== */
|
||||
.character-card, .scene-card {
|
||||
margin-bottom: 16px;
|
||||
margin-bottom: var(--space-4);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-xl);
|
||||
overflow: hidden;
|
||||
transition: all var(--transition-normal);
|
||||
}
|
||||
|
||||
.character-card:hover, .scene-card:hover {
|
||||
border-color: var(--border-secondary);
|
||||
box-shadow: var(--shadow-card-hover);
|
||||
}
|
||||
|
||||
.character-card :deep(.el-card__body),
|
||||
.scene-card :deep(.el-card__body) {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.character-preview, .scene-preview {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 180px;
|
||||
background: linear-gradient(135deg, #f5f7fa 0%, #e8eaf0 100%);
|
||||
margin: -20px -20px 12px -20px;
|
||||
height: 160px;
|
||||
background: linear-gradient(135deg, var(--accent) 0%, #06b6d4 100%);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
@@ -641,37 +664,135 @@ onMounted(() => {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform var(--transition-normal);
|
||||
}
|
||||
|
||||
.character-card:hover .character-preview img,
|
||||
.scene-card:hover .scene-preview img {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.scene-placeholder {
|
||||
color: #c0c4cc;
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
}
|
||||
|
||||
.character-info, .scene-info {
|
||||
text-align: center;
|
||||
margin-bottom: 12px;
|
||||
padding: var(--space-4);
|
||||
}
|
||||
|
||||
.character-info h4, .scene-info h4 {
|
||||
margin: 0 0 8px 0;
|
||||
font-size: 16px;
|
||||
margin: 0 0 var(--space-2) 0;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.desc {
|
||||
font-size: 13px;
|
||||
color: #606266;
|
||||
margin: 8px 0;
|
||||
font-size: 0.8125rem;
|
||||
color: var(--text-muted);
|
||||
margin: var(--space-2) 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.character-actions, .scene-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
gap: var(--space-2);
|
||||
justify-content: center;
|
||||
padding: 0 var(--space-4) var(--space-4);
|
||||
}
|
||||
|
||||
.empty-icon {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Dark Mode / 深色模式
|
||||
======================================== */
|
||||
.dark .tabs-wrapper {
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.dark :deep(.el-card) {
|
||||
background: var(--bg-card);
|
||||
border-color: var(--border-primary);
|
||||
}
|
||||
|
||||
.dark :deep(.el-card__header) {
|
||||
background: var(--bg-secondary);
|
||||
border-color: var(--border-primary);
|
||||
}
|
||||
|
||||
.dark :deep(.el-table) {
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.dark :deep(.el-table th),
|
||||
.dark :deep(.el-table tr) {
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.dark :deep(.el-table td),
|
||||
.dark :deep(.el-table th) {
|
||||
border-color: var(--border-primary);
|
||||
}
|
||||
|
||||
.dark :deep(.el-descriptions) {
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.dark :deep(.el-descriptions__label) {
|
||||
background: var(--bg-secondary);
|
||||
color: var(--text-secondary);
|
||||
border-color: var(--border-primary);
|
||||
}
|
||||
|
||||
.dark :deep(.el-descriptions__content) {
|
||||
background: var(--bg-card);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--border-primary);
|
||||
}
|
||||
|
||||
.dark :deep(.el-descriptions__cell) {
|
||||
border-color: var(--border-primary);
|
||||
}
|
||||
|
||||
.card-title {
|
||||
margin: 0;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.dark :deep(.el-dialog) {
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.dark :deep(.el-dialog__header) {
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.dark :deep(.el-form-item__label) {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.dark :deep(.el-input__wrapper) {
|
||||
background: var(--bg-secondary);
|
||||
box-shadow: 0 0 0 1px var(--border-primary) inset;
|
||||
}
|
||||
|
||||
.dark :deep(.el-input__inner) {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.dark :deep(.el-textarea__inner) {
|
||||
background: var(--bg-secondary);
|
||||
color: var(--text-primary);
|
||||
box-shadow: 0 0 0 1px var(--border-primary) inset;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1327,12 +1327,17 @@ onMounted(() => {
|
||||
<style scoped>
|
||||
.workflow-container {
|
||||
min-height: 100vh;
|
||||
background: #f5f7fa;
|
||||
background: #f8fafc;
|
||||
transition: background var(--transition-normal);
|
||||
}
|
||||
|
||||
.dark .workflow-container {
|
||||
background: #0f172a;
|
||||
}
|
||||
|
||||
.workflow-header {
|
||||
background: #ffffff;
|
||||
border-bottom: 1px solid #e4e7ed;
|
||||
background: var(--bg-card);
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
padding: 10px 24px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
@@ -1352,20 +1357,20 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.back-btn {
|
||||
color: #606266;
|
||||
color: var(--text-secondary);
|
||||
padding: 0;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.back-btn:hover {
|
||||
color: #409eff;
|
||||
color: #0ea5e9;
|
||||
}
|
||||
|
||||
.drama-title {
|
||||
margin: 0;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
color: var(--text-primary);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,32 +1,39 @@
|
||||
<template>
|
||||
<div class="episode-workflow-container">
|
||||
<div class="workflow-header">
|
||||
<div class="header-left">
|
||||
<el-button :icon="ArrowLeft" @click="goBack">{{ $t('workflow.backToProject') }}</el-button>
|
||||
<h1>{{ $t('workflow.episodeProduction', { number: episodeNumber }) }}</h1>
|
||||
</div>
|
||||
<div class="steps-inline">
|
||||
<div class="custom-steps">
|
||||
<div class="step-item" :class="{ active: currentStep >= 0, current: currentStep === 0 }">
|
||||
<div class="step-circle">1</div>
|
||||
<span class="step-text">{{ $t('workflow.steps.content') }}</span>
|
||||
<div class="page-container">
|
||||
<div class="content-wrapper animate-fade-in">
|
||||
<header class="page-header">
|
||||
<div class="header-content">
|
||||
<div class="header-left">
|
||||
<button class="back-btn" @click="$router.back()">
|
||||
<el-icon><ArrowLeft /></el-icon>
|
||||
<span>{{ $t('workflow.backToProject') }}</span>
|
||||
</button>
|
||||
<div class="nav-divider"></div>
|
||||
<h1 class="header-title">{{ $t('workflow.episodeProduction', { number: episodeNumber }) }}</h1>
|
||||
</div>
|
||||
<el-icon class="step-arrow"><ArrowRight /></el-icon>
|
||||
<div class="step-item" :class="{ active: currentStep >= 1, current: currentStep === 1 }">
|
||||
<div class="step-circle">2</div>
|
||||
<span class="step-text">{{ $t('workflow.steps.generateImages') }}</span>
|
||||
<div class="header-center">
|
||||
<div class="custom-steps">
|
||||
<div class="step-item" :class="{ active: currentStep >= 0, current: currentStep === 0 }">
|
||||
<div class="step-circle">1</div>
|
||||
<span class="step-text">{{ $t('workflow.steps.content') }}</span>
|
||||
</div>
|
||||
<el-icon class="step-arrow"><ArrowRight /></el-icon>
|
||||
<div class="step-item" :class="{ active: currentStep >= 1, current: currentStep === 1 }">
|
||||
<div class="step-circle">2</div>
|
||||
<span class="step-text">{{ $t('workflow.steps.generateImages') }}</span>
|
||||
</div>
|
||||
<el-icon class="step-arrow"><ArrowRight /></el-icon>
|
||||
<div class="step-item" :class="{ active: currentStep >= 2, current: currentStep === 2 }">
|
||||
<div class="step-circle">3</div>
|
||||
<span class="step-text">{{ $t('workflow.steps.splitStoryboard') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-icon class="step-arrow"><ArrowRight /></el-icon>
|
||||
<div class="step-item" :class="{ active: currentStep >= 2, current: currentStep === 2 }">
|
||||
<div class="step-circle">3</div>
|
||||
<span class="step-text">{{ $t('workflow.steps.splitStoryboard') }}</span>
|
||||
<div class="header-right">
|
||||
<el-button :icon="Setting" circle @click="showModelConfigDialog" :title="$t('workflow.modelConfig')" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-right">
|
||||
<el-button :icon="Setting" circle @click="showModelConfigDialog" :title="$t('workflow.modelConfig')" />
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- 阶段 0: 章节内容 + 提取角色场景 -->
|
||||
<el-card v-show="currentStep === 0" shadow="never" class="stage-card stage-card-fullscreen">
|
||||
@@ -89,28 +96,28 @@
|
||||
|
||||
<!-- 角色列表 -->
|
||||
<div v-if="hasCharacters" style="margin-bottom: 16px;">
|
||||
<h4 style="margin-bottom: 8px; color: #606266;">{{ $t('workflow.extractedCharacters') }}:</h4>
|
||||
<h4 class="extracted-title">{{ $t('workflow.extractedCharacters') }}:</h4>
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 8px;">
|
||||
<el-tag
|
||||
v-for="char in currentEpisode?.characters"
|
||||
:key="char.id"
|
||||
type="info"
|
||||
>
|
||||
{{ char.name }} <span v-if="char.role" style="color: #909399; margin-left: 4px;">({{ char.role }})</span>
|
||||
{{ char.name }} <span v-if="char.role" class="secondary-text">({{ char.role }})</span>
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 场景列表 -->
|
||||
<div v-if="currentEpisode?.scenes && currentEpisode.scenes.length > 0">
|
||||
<h4 style="margin-bottom: 8px; color: #606266;">{{ $t('workflow.extractedScenes') }}:</h4>
|
||||
<h4 class="extracted-title">{{ $t('workflow.extractedScenes') }}:</h4>
|
||||
<div style="display: flex; flex-wrap: wrap; gap: 8px;">
|
||||
<el-tag
|
||||
v-for="scene in currentEpisode.scenes"
|
||||
:key="scene.id"
|
||||
type="warning"
|
||||
>
|
||||
{{ scene.location }} <span style="color: #909399; margin-left: 4px;">· {{ scene.time }}</span>
|
||||
{{ scene.location }} <span class="secondary-text">· {{ scene.time }}</span>
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
@@ -445,9 +452,19 @@
|
||||
{{ row.movement || '-' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('storyboard.table.location')" width="150" show-overflow-tooltip>
|
||||
<el-table-column :label="$t('storyboard.table.location')" width="150">
|
||||
<template #default="{ row }">
|
||||
{{ row.location || '-' }}
|
||||
<el-popover
|
||||
placement="right"
|
||||
:width="300"
|
||||
trigger="hover"
|
||||
:content="row.action || '-'"
|
||||
>
|
||||
<template #reference>
|
||||
<!-- 单行打点 -->
|
||||
<span class="overflow-tooltip">{{ row.location || '-' }}</span>
|
||||
</template>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('storyboard.table.character')" width="100">
|
||||
@@ -458,9 +475,19 @@
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('storyboard.table.action')" show-overflow-tooltip>
|
||||
<el-table-column :label="$t('storyboard.table.action')">
|
||||
<template #default="{ row }">
|
||||
{{ row.action || '-' }}
|
||||
<el-popover
|
||||
placement="right"
|
||||
:width="300"
|
||||
trigger="hover"
|
||||
:content="row.action || '-'"
|
||||
>
|
||||
<template #reference>
|
||||
<!-- 单行打点 -->
|
||||
<span class="overflow-tooltip">{{ row.action || '-' }}</span>
|
||||
</template>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('storyboard.table.duration')" width="80">
|
||||
@@ -522,7 +549,7 @@
|
||||
<span style="font-size: 12px;">{{ percentage }}%</span>
|
||||
</template>
|
||||
</el-progress>
|
||||
<div style="margin-top: 8px; font-size: 12px; color: #909399; text-align: center;">
|
||||
<div class="task-message">
|
||||
{{ taskMessage }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -708,7 +735,7 @@
|
||||
:value="model.modelName"
|
||||
/>
|
||||
</el-select>
|
||||
<div style="margin-top: 8px; font-size: 12px; color: #909399;">
|
||||
<div class="model-tip">
|
||||
{{ $t('workflow.textModelTip') }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
@@ -722,7 +749,7 @@
|
||||
:value="model.modelName"
|
||||
/>
|
||||
</el-select>
|
||||
<div style="margin-top: 8px; font-size: 12px; color: #909399;">
|
||||
<div class="model-tip">
|
||||
{{ $t('workflow.modelConfigTip') }}
|
||||
</div>
|
||||
</el-form-item>
|
||||
@@ -761,6 +788,7 @@
|
||||
</template>
|
||||
</el-upload>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -794,6 +822,7 @@ import { aiAPI } from '@/api/ai'
|
||||
import type { AIServiceConfig } from '@/types/ai'
|
||||
import { imageAPI } from '@/api/image'
|
||||
import type { Drama } from '@/types/drama'
|
||||
import PageHeader from '@/components/common/PageHeader.vue'
|
||||
|
||||
const route = useRoute()
|
||||
const router = useRouter()
|
||||
@@ -1715,53 +1744,108 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.episode-workflow-container {
|
||||
padding: 24px;
|
||||
background: #f5f7fa;
|
||||
/* ========================================
|
||||
Page Layout / 页面布局 - 紧凑边距
|
||||
======================================== */
|
||||
.page-container {
|
||||
min-height: 100vh;
|
||||
background: var(--bg-primary);
|
||||
padding: var(--space-2) var(--space-3);
|
||||
transition: background var(--transition-normal);
|
||||
}
|
||||
|
||||
.workflow-header {
|
||||
@media (min-width: 768px) {
|
||||
.page-container {
|
||||
padding: var(--space-3) var(--space-4);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.page-container {
|
||||
padding: var(--space-4) var(--space-5);
|
||||
}
|
||||
}
|
||||
|
||||
.content-wrapper {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Header styles matching PageHeader component */
|
||||
.page-header {
|
||||
margin-bottom: var(--space-3);
|
||||
padding-bottom: var(--space-3);
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
}
|
||||
|
||||
.header-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 24px;
|
||||
padding: 20px;
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
|
||||
justify-content: space-between;
|
||||
gap: var(--space-4);
|
||||
}
|
||||
|
||||
.header-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
flex-shrink: 0;
|
||||
.header-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--space-4);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
h1 {
|
||||
margin: 0;
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.back-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.375rem;
|
||||
padding: 0.5rem 0.875rem;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-lg);
|
||||
color: var(--text-secondary);
|
||||
font-size: 0.875rem;
|
||||
font-weight: 500;
|
||||
cursor: pointer;
|
||||
transition: all var(--transition-fast);
|
||||
white-space: nowrap;
|
||||
|
||||
&:hover {
|
||||
background: var(--bg-card-hover);
|
||||
color: var(--text-primary);
|
||||
border-color: var(--border-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
.steps-inline {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin: 0 20px;
|
||||
}
|
||||
.nav-divider {
|
||||
width: 1px;
|
||||
height: 2rem;
|
||||
background: var(--border-primary);
|
||||
}
|
||||
|
||||
.header-right {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.header-title {
|
||||
margin: 0;
|
||||
font-size: 1.5rem;
|
||||
font-weight: 700;
|
||||
color: var(--text-primary);
|
||||
letter-spacing: -0.025em;
|
||||
line-height: 1.2;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.header-center {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.header-right {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.workflow-card {
|
||||
margin-bottom: 24px;
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
|
||||
border: 1px solid #e8e8e8;
|
||||
margin-bottom: var(--space-4);
|
||||
background: var(--bg-card);
|
||||
border-radius: var(--radius-lg);
|
||||
box-shadow: var(--shadow-card);
|
||||
border: 1px solid var(--border-primary);
|
||||
|
||||
:deep(.el-card__body) {
|
||||
padding: 0;
|
||||
@@ -1779,29 +1863,29 @@ onMounted(() => {
|
||||
gap: 8px;
|
||||
padding: 8px 16px;
|
||||
border-radius: 20px;
|
||||
background: #f0f0f0;
|
||||
background: var(--bg-card-hover);
|
||||
transition: all 0.3s;
|
||||
|
||||
&.active {
|
||||
background: #e6f7ff;
|
||||
background: var(--accent-light);
|
||||
|
||||
.step-circle {
|
||||
background: #1890ff;
|
||||
color: white;
|
||||
background: var(--accent);
|
||||
color: var(--text-inverse);
|
||||
}
|
||||
}
|
||||
|
||||
&.current {
|
||||
background: #1890ff;
|
||||
color: white;
|
||||
background: var(--accent);
|
||||
color: var(--text-inverse);
|
||||
|
||||
.step-circle {
|
||||
background: white;
|
||||
color: #1890ff;
|
||||
background: var(--bg-card);
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.step-text {
|
||||
color: white;
|
||||
color: var(--text-inverse);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1812,8 +1896,8 @@ onMounted(() => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #d9d9d9;
|
||||
color: #666;
|
||||
background: var(--border-secondary);
|
||||
color: var(--text-secondary);
|
||||
font-weight: 600;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
@@ -1826,7 +1910,7 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.step-arrow {
|
||||
color: #d9d9d9;
|
||||
color: var(--border-secondary);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1858,7 +1942,7 @@ onMounted(() => {
|
||||
|
||||
p {
|
||||
margin: 0;
|
||||
color: #909399;
|
||||
color: var(--text-muted);
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
@@ -1867,7 +1951,7 @@ onMounted(() => {
|
||||
|
||||
.stage-body {
|
||||
padding: 32px;
|
||||
background: white;
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
@@ -1905,9 +1989,9 @@ onMounted(() => {
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
padding: 16px;
|
||||
background: #fafafa;
|
||||
background: var(--bg-secondary);
|
||||
border-radius: 8px;
|
||||
border: 1px solid #e8e8e8;
|
||||
border: 1px solid var(--border-primary);
|
||||
|
||||
.section-title {
|
||||
display: flex;
|
||||
@@ -1921,10 +2005,10 @@ onMounted(() => {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
color: var(--text-primary);
|
||||
|
||||
.el-icon {
|
||||
color: #409eff;
|
||||
color: var(--accent);
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
@@ -1947,18 +2031,41 @@ onMounted(() => {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.extracted-title {
|
||||
margin-bottom: 8px;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.secondary-text {
|
||||
color: var(--text-muted);
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.task-message {
|
||||
margin-top: 8px;
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.model-tip {
|
||||
margin-top: 8px;
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.fixed-card {
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
border: 1px solid #e8e8e8;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
border: 1px solid var(--border-primary);
|
||||
box-shadow: var(--shadow-card);
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
box-shadow: var(--shadow-card-hover);
|
||||
}
|
||||
|
||||
:deep(.el-card__body) {
|
||||
@@ -1970,8 +2077,8 @@ onMounted(() => {
|
||||
|
||||
.card-header {
|
||||
padding: 14px;
|
||||
background: #fafafa;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
background: var(--bg-secondary);
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
@@ -1984,7 +2091,7 @@ onMounted(() => {
|
||||
margin: 0 0 4px 0;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
color: var(--text-primary);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
@@ -2003,7 +2110,7 @@ onMounted(() => {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #f8f9fa;
|
||||
background: var(--bg-secondary);
|
||||
|
||||
.char-image,
|
||||
.scene-image {
|
||||
@@ -2025,12 +2132,12 @@ onMounted(() => {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #a0a0a0;
|
||||
color: var(--text-muted);
|
||||
padding: 20px;
|
||||
|
||||
&.generating {
|
||||
color: #e6a23c;
|
||||
background: #fdf6ec;
|
||||
color: var(--warning);
|
||||
background: var(--warning-light);
|
||||
|
||||
.rotating {
|
||||
animation: rotating 2s linear infinite;
|
||||
@@ -2038,8 +2145,8 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
&.failed {
|
||||
color: #f56c6c;
|
||||
background: #fef0f0;
|
||||
color: var(--error);
|
||||
background: var(--error-light);
|
||||
}
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
@@ -2057,8 +2164,8 @@ onMounted(() => {
|
||||
|
||||
.card-actions {
|
||||
padding: 10px;
|
||||
background: white;
|
||||
border-top: 1px solid #e8e8e8;
|
||||
background: var(--bg-card);
|
||||
border-top: 1px solid var(--border-primary);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
@@ -2099,9 +2206,9 @@ onMounted(() => {
|
||||
transition: all 0.3s;
|
||||
|
||||
&:hover {
|
||||
border-color: #409eff;
|
||||
border-color: var(--accent);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
||||
box-shadow: var(--shadow-lg);
|
||||
}
|
||||
|
||||
.el-image {
|
||||
@@ -2113,7 +2220,8 @@ onMounted(() => {
|
||||
padding: 8px;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
background: #f5f7fa;
|
||||
background: var(--bg-secondary);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2143,4 +2251,79 @@ onMounted(() => {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Dark Mode / 深色模式
|
||||
======================================== */
|
||||
:deep(.el-card) {
|
||||
background: var(--bg-card);
|
||||
border-color: var(--border-primary);
|
||||
}
|
||||
|
||||
:deep(.el-card__header) {
|
||||
background: var(--bg-secondary);
|
||||
border-color: var(--border-primary);
|
||||
}
|
||||
|
||||
:deep(.el-table) {
|
||||
--el-table-bg-color: var(--bg-card);
|
||||
--el-table-header-bg-color: var(--bg-secondary);
|
||||
--el-table-tr-bg-color: var(--bg-card);
|
||||
--el-table-row-hover-bg-color: var(--bg-card-hover);
|
||||
--el-table-border-color: var(--border-primary);
|
||||
--el-table-text-color: var(--text-primary);
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
:deep(.el-table th.el-table__cell),
|
||||
:deep(.el-table td.el-table__cell) {
|
||||
background: var(--bg-card);
|
||||
border-color: var(--border-primary);
|
||||
}
|
||||
|
||||
:deep(.el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell) {
|
||||
background: var(--bg-secondary);
|
||||
}
|
||||
|
||||
:deep(.el-table__header-wrapper th) {
|
||||
background: var(--bg-secondary) !important;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
:deep(.el-dialog) {
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
:deep(.el-dialog__header) {
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
:deep(.el-form-item__label) {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
:deep(.el-input__wrapper) {
|
||||
background: var(--bg-secondary);
|
||||
box-shadow: 0 0 0 1px var(--border-primary) inset;
|
||||
}
|
||||
|
||||
:deep(.el-input__inner) {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
:deep(.el-textarea__inner) {
|
||||
background: var(--bg-secondary);
|
||||
color: var(--text-primary);
|
||||
box-shadow: 0 0 0 1px var(--border-primary) inset;
|
||||
}
|
||||
|
||||
:deep(.el-select-dropdown) {
|
||||
background: var(--bg-elevated);
|
||||
border-color: var(--border-primary);
|
||||
}
|
||||
|
||||
:deep(.el-upload-dragger) {
|
||||
background: var(--bg-secondary);
|
||||
border-color: var(--border-primary);
|
||||
}
|
||||
</style>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,15 +1,24 @@
|
||||
<template>
|
||||
<div class="ai-config-container">
|
||||
<el-page-header @back="goBack" :title="$t('aiConfig.back')">
|
||||
<template #content>
|
||||
<div class="page-header">
|
||||
<h2>{{ $t('aiConfig.title') }}</h2>
|
||||
<el-button type="primary" @click="showCreateDialog" :icon="Plus">{{ $t('aiConfig.addConfig') }}</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-page-header>
|
||||
<div class="page-container">
|
||||
<div class="content-wrapper animate-fade-in">
|
||||
<!-- Page Header / 页面头部 -->
|
||||
<PageHeader
|
||||
:title="$t('aiConfig.title')"
|
||||
:subtitle="$t('aiConfig.subtitle') || '管理 AI 服务配置'"
|
||||
:show-back="true"
|
||||
:back-text="$t('common.back')"
|
||||
>
|
||||
<template #actions>
|
||||
<el-button type="primary" @click="showCreateDialog">
|
||||
<el-icon><Plus /></el-icon>
|
||||
<span>{{ $t('aiConfig.addConfig') }}</span>
|
||||
</el-button>
|
||||
</template>
|
||||
</PageHeader>
|
||||
|
||||
<el-tabs v-model="activeTab" @tab-change="handleTabChange">
|
||||
<!-- Tabs / 标签页 -->
|
||||
<div class="tabs-wrapper">
|
||||
<el-tabs v-model="activeTab" @tab-change="handleTabChange" class="config-tabs">
|
||||
<el-tab-pane :label="$t('aiConfig.tabs.text')" name="text">
|
||||
<ConfigList
|
||||
:configs="configs"
|
||||
@@ -43,9 +52,11 @@
|
||||
@toggle-active="handleToggleActive"
|
||||
/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-tabs>
|
||||
</div>
|
||||
|
||||
<el-dialog
|
||||
<!-- Edit/Create Dialog / 编辑创建弹窗 -->
|
||||
<el-dialog
|
||||
v-model="dialogVisible"
|
||||
:title="isEdit ? $t('aiConfig.editConfig') : $t('aiConfig.addConfig')"
|
||||
width="600px"
|
||||
@@ -144,6 +155,7 @@
|
||||
</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -151,8 +163,9 @@
|
||||
import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import { ElMessage, ElMessageBox, type FormInstance, type FormRules } from 'element-plus'
|
||||
import { Plus } from '@element-plus/icons-vue'
|
||||
import { Plus, ArrowLeft } from '@element-plus/icons-vue'
|
||||
import { aiAPI } from '@/api/ai'
|
||||
import { PageHeader } from '@/components/common'
|
||||
import type { AIServiceConfig, AIServiceType, CreateAIConfigRequest, UpdateAIConfigRequest } from '@/types/ai'
|
||||
import ConfigList from './components/ConfigList.vue'
|
||||
|
||||
@@ -578,43 +591,150 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ai-config-container {
|
||||
padding: 24px;
|
||||
/* ========================================
|
||||
Page Layout / 页面布局 - 紧凑边距
|
||||
======================================== */
|
||||
.page-container {
|
||||
min-height: 100vh;
|
||||
background: var(--bg-primary);
|
||||
padding: var(--space-2) var(--space-3);
|
||||
transition: background var(--transition-normal);
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.page-container {
|
||||
padding: var(--space-3) var(--space-4);
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.page-container {
|
||||
padding: var(--space-4) var(--space-5);
|
||||
}
|
||||
}
|
||||
|
||||
.content-wrapper {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
:deep(.el-page-header__header) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-bottom: 20px;
|
||||
/* ========================================
|
||||
Tabs / 标签页 - 紧凑内边距
|
||||
======================================== */
|
||||
.tabs-wrapper {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-primary);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: var(--space-3);
|
||||
box-shadow: var(--shadow-card);
|
||||
}
|
||||
|
||||
:deep(.el-page-header__left) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.page-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 24px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.page-header h2 {
|
||||
margin: 0;
|
||||
font-size: 24px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
flex: 1;
|
||||
@media (min-width: 768px) {
|
||||
.tabs-wrapper {
|
||||
padding: var(--space-4);
|
||||
}
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Form Tips / 表单提示
|
||||
======================================== */
|
||||
.form-tip {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
margin-top: 4px;
|
||||
font-size: 0.75rem;
|
||||
color: var(--text-muted);
|
||||
margin-top: 0.25rem;
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Dialog / 弹窗
|
||||
======================================== */
|
||||
:deep(.el-dialog) {
|
||||
border-radius: 0.75rem;
|
||||
}
|
||||
|
||||
:deep(.el-dialog__header) {
|
||||
padding: 1.25rem 1.5rem;
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
:deep(.el-dialog__title) {
|
||||
font-size: 1.125rem;
|
||||
font-weight: 600;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
:deep(.el-dialog__body) {
|
||||
padding: 1.5rem;
|
||||
}
|
||||
|
||||
:deep(.el-dialog__footer) {
|
||||
padding: 1rem 1.5rem;
|
||||
border-top: 1px solid var(--border-primary);
|
||||
}
|
||||
|
||||
/* ========================================
|
||||
Dark Mode / 深色模式
|
||||
======================================== */
|
||||
.dark .tabs-wrapper {
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.dark :deep(.el-dialog) {
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.dark :deep(.el-dialog__header) {
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.dark :deep(.el-dialog__body) {
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.dark :deep(.el-form-item__label) {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.dark :deep(.el-input__wrapper) {
|
||||
background: var(--bg-secondary);
|
||||
box-shadow: 0 0 0 1px var(--border-primary) inset;
|
||||
}
|
||||
|
||||
.dark :deep(.el-input__inner) {
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.dark :deep(.el-input__inner::placeholder) {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.dark :deep(.el-select .el-input__wrapper) {
|
||||
background: var(--bg-secondary);
|
||||
}
|
||||
|
||||
.dark :deep(.el-textarea__inner) {
|
||||
background: var(--bg-secondary);
|
||||
color: var(--text-primary);
|
||||
box-shadow: 0 0 0 1px var(--border-primary) inset;
|
||||
}
|
||||
|
||||
.dark :deep(.el-input-number) {
|
||||
background: var(--bg-secondary);
|
||||
}
|
||||
|
||||
.dark :deep(.el-switch__core) {
|
||||
background: var(--bg-secondary);
|
||||
border-color: var(--border-primary);
|
||||
}
|
||||
|
||||
.dark :deep(.el-button--default) {
|
||||
background: var(--bg-secondary);
|
||||
border-color: var(--border-primary);
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.dark :deep(.el-button--default:hover) {
|
||||
background: var(--bg-card-hover);
|
||||
border-color: var(--border-secondary);
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -125,74 +125,94 @@ const formatDate = (dateString: string) => {
|
||||
<style scoped>
|
||||
.config-list {
|
||||
display: grid;
|
||||
gap: 16px;
|
||||
gap: 1rem;
|
||||
min-height: 300px;
|
||||
}
|
||||
|
||||
.config-card {
|
||||
transition: all 0.3s;
|
||||
transition: all 0.2s ease;
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border-primary);
|
||||
}
|
||||
|
||||
.config-card :deep(.el-card__body) {
|
||||
padding: 1.25rem;
|
||||
}
|
||||
|
||||
.config-card:hover {
|
||||
transform: translateY(-2px);
|
||||
border-color: var(--border-secondary);
|
||||
}
|
||||
|
||||
.config-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 16px;
|
||||
padding-bottom: 12px;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
margin-bottom: 1rem;
|
||||
padding-bottom: 0.75rem;
|
||||
border-bottom: 1px solid var(--border-primary);
|
||||
}
|
||||
|
||||
.config-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.config-title h3 {
|
||||
margin: 0;
|
||||
font-size: 16px;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.config-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
gap: 0.5rem;
|
||||
}
|
||||
|
||||
.config-info {
|
||||
display: grid;
|
||||
gap: 12px;
|
||||
gap: 0.75rem;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.info-item label {
|
||||
min-width: 90px;
|
||||
color: #666;
|
||||
min-width: 5.5rem;
|
||||
color: var(--text-muted);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.info-item span {
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.url-text {
|
||||
color: #409eff;
|
||||
color: #0ea5e9 !important;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.api-key {
|
||||
font-family: monospace;
|
||||
color: #999;
|
||||
color: var(--text-muted) !important;
|
||||
}
|
||||
|
||||
.time-text {
|
||||
color: #999;
|
||||
font-size: 13px;
|
||||
color: var(--text-muted) !important;
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
/* Dark mode overrides */
|
||||
.dark .config-card {
|
||||
background: var(--bg-card);
|
||||
}
|
||||
|
||||
.dark .config-card :deep(.el-card__body) {
|
||||
background: transparent;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user