diff --git a/frontend/src/components/ScriptTable.vue b/frontend/src/components/ScriptTable.vue
index 6a830cf..61d4f42 100644
--- a/frontend/src/components/ScriptTable.vue
+++ b/frontend/src/components/ScriptTable.vue
@@ -171,10 +171,45 @@
基建: {{ user.Info.InfrastMode === 'Normal' ? '普通' : '自定义' }}
-
-
- 关卡: {{ user.Info.Stage === '-' ? '未选择' : user.Info.Stage }}
-
+
+
+
+
+ 模式:
+ {{ props.currentPlanData.Info.Mode === 'ALL' ? '全局' : '周计划' }}
+
+
+
+
+
+ {{ stageInfo.label }}: {{ stageInfo.value }}
+
+
+
+
+
+ 关卡: 计划表未配置
+
+
+
+
+
+
+ 关卡: {{ getDisplayStage(user.Info.Stage) }}
+
+
+ currentPlanData?: Record | null
}
interface Emits {
@@ -419,6 +455,12 @@ const getRemainingDayColor = (remainedDay: number): string => {
return 'green'
}
+// 获取关卡标签颜色
+const getStageTagColor = (stage: string): string => {
+ if (stage === '1-7') return 'green' // 使用计划表配置用绿色
+ return 'blue' // 自定义关卡用蓝色
+}
+
// 获取剩余天数的显示文本
const getRemainingDayText = (remainedDay: number): string => {
if (remainedDay === -1) return '剩余天数: 长期有效'
@@ -426,6 +468,102 @@ const getRemainingDayText = (remainedDay: number): string => {
return `剩余天数: ${remainedDay}天`
}
+// 获取关卡的显示文本
+const getDisplayStage = (stage: string): string => {
+ if (stage === '-') return '未选择'
+
+ // 如果是默认值且有计划表数据,显示计划表中的实际关卡
+ if (stage === '1-7' && props.currentPlanData) {
+ const planStage = getCurrentPlanStage()
+ if (planStage && planStage !== '-') {
+ return planStage
+ }
+ return '使用计划表配置'
+ }
+
+ return stage
+}
+
+// 从计划表获取当前关卡
+const getCurrentPlanStage = (): string => {
+ if (!props.currentPlanData) return ''
+
+ // 根据当前时间确定使用哪个时间段的配置
+ const planMode = props.currentPlanData.Info?.Mode || 'ALL'
+ let timeKey = 'ALL'
+
+ if (planMode === 'Weekly') {
+ // 如果是周模式,根据当前星期几获取对应配置
+ const today = new Date().getDay() // 0=Sunday, 1=Monday, ...
+ const dayMap = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
+ timeKey = dayMap[today]
+ }
+
+ // 从计划表获取关卡配置
+ const timeConfig = props.currentPlanData[timeKey]
+ if (!timeConfig) return ''
+
+ // 获取主要关卡
+ if (timeConfig.Stage && timeConfig.Stage !== '-') {
+ return timeConfig.Stage
+ }
+
+ // 如果主要关卡为空,尝试获取第一个备选关卡
+ const backupStages = [timeConfig.Stage_1, timeConfig.Stage_2, timeConfig.Stage_3]
+ for (const stage of backupStages) {
+ if (stage && stage !== '-') {
+ return stage
+ }
+ }
+
+ return ''
+}
+
+// 从计划表获取所有配置的关卡
+const getAllPlanStages = (): Array<{ label: string; value: string }> => {
+ if (!props.currentPlanData) return []
+
+ // 根据当前时间确定使用哪个时间段的配置
+ const planMode = props.currentPlanData.Info?.Mode || 'ALL'
+ let timeKey = 'ALL'
+
+ if (planMode === 'Weekly') {
+ // 如果是周模式,根据当前星期几获取对应配置
+ const today = new Date().getDay() // 0=Sunday, 1=Monday, ...
+ const dayMap = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']
+ timeKey = dayMap[today]
+ }
+
+ // 从计划表获取关卡配置
+ const timeConfig = props.currentPlanData[timeKey]
+ if (!timeConfig) return []
+
+ const stages: Array<{ label: string; value: string }> = []
+
+ // 主关卡
+ if (timeConfig.Stage && timeConfig.Stage !== '-') {
+ stages.push({ label: '关卡', value: timeConfig.Stage })
+ }
+
+ // 备选关卡
+ if (timeConfig.Stage_1 && timeConfig.Stage_1 !== '-') {
+ stages.push({ label: '关卡1', value: timeConfig.Stage_1 })
+ }
+ if (timeConfig.Stage_2 && timeConfig.Stage_2 !== '-') {
+ stages.push({ label: '关卡2', value: timeConfig.Stage_2 })
+ }
+ if (timeConfig.Stage_3 && timeConfig.Stage_3 !== '-') {
+ stages.push({ label: '关卡3', value: timeConfig.Stage_3 })
+ }
+
+ // 剩余关卡
+ if (timeConfig.Stage_Remain && timeConfig.Stage_Remain !== '-') {
+ stages.push({ label: '剩余关卡', value: timeConfig.Stage_Remain })
+ }
+
+ return stages
+}
+
// 处理脚本拖拽结束
const onScriptDragEnd = async () => {
try {
diff --git a/frontend/src/views/Scripts.vue b/frontend/src/views/Scripts.vue
index d677de8..04b0375 100644
--- a/frontend/src/views/Scripts.vue
+++ b/frontend/src/views/Scripts.vue
@@ -56,6 +56,7 @@
([])
// 增加:标记是否已经完成过一次脚本列表加载(成功或失败都算一次)
const loadedOnce = ref(false)
+// 当前计划表数据
+const currentPlanData = ref | null>(null)
const typeSelectVisible = ref(false)
const generalModeSelectVisible = ref(false)
const templateSelectVisible = ref(false)
@@ -312,6 +317,7 @@ const filteredTemplates = computed(() => {
onMounted(() => {
loadScripts()
+ loadCurrentPlan()
})
const loadScripts = async () => {
@@ -336,6 +342,21 @@ const loadScripts = async () => {
}
}
+// 加载当前计划表数据
+const loadCurrentPlan = async () => {
+ try {
+ const response = await getPlans()
+ if (response.data && response.index && response.index.length > 0) {
+ // 获取第一个计划表的数据
+ const firstPlanId = response.index[0].uid
+ currentPlanData.value = response.data[firstPlanId] || null
+ }
+ } catch (error) {
+ console.error('加载计划表数据失败:', error)
+ // 不显示错误消息,因为计划表数据是可选的
+ }
+}
+
const handleAddScript = () => {
selectedType.value = 'MAA'
typeSelectVisible.value = true