fix: 通用脚本用户添加额外展示项

This commit is contained in:
DLmaster361
2025-09-05 17:41:50 +08:00
parent f3e5a03a0f
commit c4cd53277f
11 changed files with 99 additions and 210 deletions

View File

@@ -3,15 +3,9 @@
<!-- 工具栏 -->
<a-card size="small" class="toolbar-card">
<a-row :gutter="[12, 12]" align="middle" justify="space-between" class="toolbar-grid">
<!-- 左侧刷新 + 选择器 -->
<!-- 左侧选择器 -->
<a-col :xs="24" :md="14">
<a-space :size="8" wrap>
<a-button @click="refreshLogs" :loading="loading" type="primary">
<template #icon>
<ReloadOutlined />
</template>
刷新日志
</a-button>
<a-select v-model:value="selectedLogFile" @change="onLogFileChange" style="width: 220px"
placeholder="选择日志文件">
@@ -105,7 +99,6 @@
import { ref, computed, onMounted, onUnmounted, nextTick } from 'vue'
import { message, Empty } from 'ant-design-vue'
import {
ReloadOutlined,
DeleteOutlined,
ClearOutlined,
FolderOpenOutlined,

View File

@@ -108,7 +108,7 @@
</a-tag>
</div>
<!-- 用户详细信息 - 只有MAA脚本才显示 -->
<!-- 用户详细信息 - MAA脚本用户 -->
<div v-if="script.type === 'MAA'" class="user-info-tags">
<!-- 剿灭模式 -->
<a-tag
@@ -138,16 +138,9 @@
<a-tag
v-if="user.Info.RemainedDay !== undefined && user.Info.RemainedDay !== null"
class="info-tag"
:color="
user.Info.RemainedDay < 1
? 'gold'
: user.Info.RemainedDay > 30
? 'green'
: 'orange'
"
:color="getRemainingDayColor(user.Info.RemainedDay)"
>
剩余天数:
{{ user.Info.RemainedDay < 1 ? '长期有效' : user.Info.RemainedDay + '天' }}
{{ getRemainingDayText(user.Info.RemainedDay) }}
</a-tag>
<!-- 基建模式 -->
@@ -211,6 +204,22 @@
剩余关卡: {{ user.Info.Stage_Remain }}
</a-tag>
<a-tag class="info-tag" color="magenta">
备注: {{ truncateText(user.Info.Notes) }}
</a-tag>
</div>
<!-- 用户详细信息 - 通用脚本用户 -->
<div v-if="script.type === 'General'" class="user-info-tags">
<!-- 剩余天数 -->
<a-tag
v-if="user.Info.RemainedDay !== undefined && user.Info.RemainedDay !== null"
class="info-tag"
:color="getRemainingDayColor(user.Info.RemainedDay)"
>
{{ getRemainingDayText(user.Info.RemainedDay) }}
</a-tag>
<a-tag class="info-tag" color="magenta">
备注: {{ truncateText(user.Info.Notes) }}
</a-tag>
@@ -282,11 +291,9 @@ import type { Script, User } from '../types/script'
import {
DeleteOutlined,
EditOutlined,
PlusOutlined,
SettingOutlined,
StopOutlined,
UserAddOutlined,
UserOutlined,
} from '@ant-design/icons-vue'
interface Props {
@@ -358,6 +365,23 @@ const truncateText = (text: string, maxLength: number = 10): string => {
if (!text) return ''
return text.length > maxLength ? text.substring(0, maxLength) + '...' : text
}
// 获取剩余天数的颜色
const getRemainingDayColor = (remainedDay: number): string => {
if (remainedDay === -1) return 'gold'
if (remainedDay === 0) return 'red'
if (remainedDay <= 3) return 'orange'
if (remainedDay <= 7) return 'yellow'
if (remainedDay <= 30) return 'blue'
return 'green'
}
// 获取剩余天数的显示文本
const getRemainingDayText = (remainedDay: number): string => {
if (remainedDay === -1) return '剩余天数: 长期有效'
if (remainedDay === 0) return '剩余天数: 已到期'
return `剩余天数: ${remainedDay}`
}
</script>
<style scoped>

View File

@@ -106,62 +106,57 @@ export function useScriptApi() {
id: userIndex.uid,
name: maaUserData.Info?.Name || `用户${userIndex.uid}`,
Info: {
Name: maaUserData.Info?.Name || `用户${userIndex.uid}`,
Id: maaUserData.Info?.Id || '',
Password: maaUserData.Info?.Password || '',
Server: maaUserData.Info?.Server || '官服',
MedicineNumb: maaUserData.Info?.MedicineNumb || 0,
RemainedDay: maaUserData.Info?.RemainedDay || -1,
SeriesNumb: maaUserData.Info?.SeriesNumb || '',
Notes: maaUserData.Info?.Notes || '',
Name: maaUserData.Info?.Name !== undefined ? maaUserData.Info.Name : `用户${userIndex.uid}`,
Id: maaUserData.Info?.Id !== undefined ? maaUserData.Info.Id : '',
Mode: maaUserData.Info?.Mode !== undefined ? maaUserData.Info.Mode : '简洁',
StageMode: maaUserData.Info?.StageMode !== undefined ? maaUserData.Info.StageMode : 'Fixed',
Server: maaUserData.Info?.Server !== undefined ? maaUserData.Info.Server : 'Official',
Status: maaUserData.Info?.Status !== undefined ? maaUserData.Info.Status : true,
Mode: maaUserData.Info?.Mode || 'MAA',
InfrastMode: maaUserData.Info?.InfrastMode || '默认',
RemainedDay: maaUserData.Info?.RemainedDay !== undefined ? maaUserData.Info.RemainedDay : -1,
Annihilation: maaUserData.Info?.Annihilation !== undefined ? maaUserData.Info.Annihilation : 'Annihilation',
Routine: maaUserData.Info?.Routine !== undefined ? maaUserData.Info.Routine : true,
Annihilation: maaUserData.Info?.Annihilation || '当期',
Stage: maaUserData.Info?.Stage || '1-7',
StageMode: maaUserData.Info?.StageMode || '刷完即停',
Stage_1: maaUserData.Info?.Stage_1 || '',
Stage_2: maaUserData.Info?.Stage_2 || '',
Stage_3: maaUserData.Info?.Stage_3 || '',
Stage_Remain: maaUserData.Info?.Stage_Remain || '',
IfSkland: maaUserData.Info?.IfSkland || false,
SklandToken: maaUserData.Info?.SklandToken || '',
InfrastMode: maaUserData.Info?.InfrastMode !== undefined ? maaUserData.Info.InfrastMode : 'Normal',
InfrastPath: maaUserData.Info?.InfrastPath !== undefined ? maaUserData.Info.InfrastPath : '',
Password: maaUserData.Info?.Password !== undefined ? maaUserData.Info.Password : '',
Notes: maaUserData.Info?.Notes !== undefined ? maaUserData.Info.Notes : '',
MedicineNumb: maaUserData.Info?.MedicineNumb !== undefined ? maaUserData.Info.MedicineNumb : 0,
SeriesNumb: maaUserData.Info?.SeriesNumb !== undefined ? maaUserData.Info.SeriesNumb : '0',
Stage: maaUserData.Info?.Stage !== undefined ? maaUserData.Info.Stage : '-',
Stage_1: maaUserData.Info?.Stage_1 !== undefined ? maaUserData.Info.Stage_1 : '-',
Stage_2: maaUserData.Info?.Stage_2 !== undefined ? maaUserData.Info.Stage_2 : '-',
Stage_3: maaUserData.Info?.Stage_3 !== undefined ? maaUserData.Info.Stage_3 : '-',
Stage_Remain: maaUserData.Info?.Stage_Remain !== undefined ? maaUserData.Info.Stage_Remain : '-',
IfSkland: maaUserData.Info?.IfSkland !== undefined ? maaUserData.Info.IfSkland : false,
SklandToken: maaUserData.Info?.SklandToken !== undefined ? maaUserData.Info.SklandToken : '',
},
Task: {
IfWakeUp: maaUserData.Task?.IfWakeUp !== undefined ? maaUserData.Task.IfWakeUp : true,
IfRecruiting: maaUserData.Task?.IfRecruiting !== undefined ? maaUserData.Task.IfRecruiting : true,
IfBase: maaUserData.Task?.IfBase !== undefined ? maaUserData.Task.IfBase : true,
IfCombat: maaUserData.Task?.IfCombat !== undefined ? maaUserData.Task.IfCombat : true,
IfMall: maaUserData.Task?.IfMall !== undefined ? maaUserData.Task.IfMall : true,
IfMission: maaUserData.Task?.IfMission !== undefined ? maaUserData.Task.IfMission : true,
IfRecruiting: maaUserData.Task?.IfRecruiting !== undefined ? maaUserData.Task.IfRecruiting : true,
IfReclamation: maaUserData.Task?.IfReclamation || false,
IfAutoRoguelike: maaUserData.Task?.IfAutoRoguelike || false,
IfWakeUp: maaUserData.Task?.IfWakeUp || false,
IfAutoRoguelike: maaUserData.Task?.IfAutoRoguelike !== undefined ? maaUserData.Task.IfAutoRoguelike : false,
IfReclamation: maaUserData.Task?.IfReclamation !== undefined ? maaUserData.Task.IfReclamation : false,
},
Notify: {
Enabled: maaUserData.Notify?.Enabled || false,
ToAddress: maaUserData.Notify?.ToAddress || '',
IfSendMail: maaUserData.Notify?.IfSendMail || false,
IfSendSixStar: maaUserData.Notify?.IfSendSixStar || false,
IfSendStatistic: maaUserData.Notify?.IfSendStatistic || false,
IfServerChan: maaUserData.Notify?.IfServerChan || false,
IfCompanyWebHookBot: maaUserData.Notify?.IfCompanyWebHookBot || false,
ServerChanKey: maaUserData.Notify?.ServerChanKey || '',
ServerChanChannel: maaUserData.Notify?.ServerChanChannel || '',
ServerChanTag: maaUserData.Notify?.ServerChanTag || '',
CompanyWebHookBotUrl: maaUserData.Notify?.CompanyWebHookBotUrl || '',
Enabled: maaUserData.Notify?.Enabled !== undefined ? maaUserData.Notify.Enabled : false,
IfSendStatistic: maaUserData.Notify?.IfSendStatistic !== undefined ? maaUserData.Notify.IfSendStatistic : false,
IfSendSixStar: maaUserData.Notify?.IfSendSixStar !== undefined ? maaUserData.Notify.IfSendSixStar : false,
IfSendMail: maaUserData.Notify?.IfSendMail !== undefined ? maaUserData.Notify.IfSendMail : false,
ToAddress: maaUserData.Notify?.ToAddress !== undefined ? maaUserData.Notify.ToAddress : '',
IfServerChan: maaUserData.Notify?.IfServerChan !== undefined ? maaUserData.Notify.IfServerChan : false,
ServerChanKey: maaUserData.Notify?.ServerChanKey !== undefined ? maaUserData.Notify.ServerChanKey : '',
IfCompanyWebHookBot: maaUserData.Notify?.IfCompanyWebHookBot !== undefined ? maaUserData.Notify.IfCompanyWebHookBot : false,
CompanyWebHookBotUrl: maaUserData.Notify?.CompanyWebHookBotUrl !== undefined ? maaUserData.Notify.CompanyWebHookBotUrl : '',
},
Data: {
CustomInfrastPlanIndex: maaUserData.Data?.CustomInfrastPlanIndex || '',
IfPassCheck: maaUserData.Data?.IfPassCheck || false,
LastAnnihilationDate: maaUserData.Data?.LastAnnihilationDate || '',
LastProxyDate: maaUserData.Data?.LastProxyDate || '',
LastSklandDate: maaUserData.Data?.LastSklandDate || '',
ProxyTimes: maaUserData.Data?.ProxyTimes || 0,
},
QFluentWidgets: {
ThemeColor: maaUserData.QFluentWidgets?.ThemeColor || 'blue',
ThemeMode: maaUserData.QFluentWidgets?.ThemeMode || 'system',
LastAnnihilationDate: maaUserData.Data?.LastAnnihilationDate !== undefined ? maaUserData.Data.LastAnnihilationDate : '',
LastProxyDate: maaUserData.Data?.LastProxyDate !== undefined ? maaUserData.Data.LastProxyDate : '',
LastSklandDate: maaUserData.Data?.LastSklandDate !== undefined ? maaUserData.Data.LastSklandDate : '',
CustomInfrastPlanIndex: maaUserData.Data?.CustomInfrastPlanIndex !== undefined ? maaUserData.Data.CustomInfrastPlanIndex : '',
IfPassCheck: maaUserData.Data?.IfPassCheck !== undefined ? maaUserData.Data.IfPassCheck : false,
ProxyTimes: maaUserData.Data?.ProxyTimes !== undefined ? maaUserData.Data.ProxyTimes : 0,
},
}
} else if (userIndex.type === 'GeneralUserConfig' && userData) {
@@ -170,62 +165,28 @@ export function useScriptApi() {
id: userIndex.uid,
name: generalUserData.Info?.Name || `用户${userIndex.uid}`,
Info: {
Name: generalUserData.Info?.Name || `用户${userIndex.uid}`,
Id: generalUserData.Info?.Id || '',
Password: generalUserData.Info?.Password || '',
Server: generalUserData.Info?.Server || '官服',
MedicineNumb: 0,
RemainedDay: -1,
SeriesNumb: '',
Notes: generalUserData.Info?.Notes || '',
Name: generalUserData.Info?.Name !== undefined ? generalUserData.Info.Name : `用户${userIndex.uid}`,
Status: generalUserData.Info?.Status !== undefined ? generalUserData.Info.Status : true,
Mode: 'General',
InfrastMode: '默认',
Routine: true,
Annihilation: '当期',
Stage: '1-7',
StageMode: '刷完即停',
Stage_1: '',
Stage_2: '',
Stage_3: '',
Stage_Remain: '',
IfSkland: false,
SklandToken: '',
},
Task: {
IfBase: true,
IfCombat: true,
IfMall: true,
IfMission: true,
IfRecruiting: true,
IfReclamation: false,
IfAutoRoguelike: false,
IfWakeUp: false,
RemainedDay: generalUserData.Info?.RemainedDay !== undefined ? generalUserData.Info.RemainedDay : -1,
IfScriptBeforeTask: generalUserData.Info?.IfScriptBeforeTask !== undefined ? generalUserData.Info.IfScriptBeforeTask : false,
ScriptBeforeTask: generalUserData.Info?.ScriptBeforeTask !== undefined ? generalUserData.Info.ScriptBeforeTask : '',
IfScriptAfterTask: generalUserData.Info?.IfScriptAfterTask !== undefined ? generalUserData.Info.IfScriptAfterTask : false,
ScriptAfterTask: generalUserData.Info?.ScriptAfterTask !== undefined ? generalUserData.Info.ScriptAfterTask : '',
Notes: generalUserData.Info?.Notes !== undefined ? generalUserData.Info.Notes : '',
},
Notify: {
Enabled: false,
ToAddress: '',
IfSendMail: false,
IfSendSixStar: false,
IfSendStatistic: false,
IfServerChan: false,
IfCompanyWebHookBot: false,
ServerChanKey: '',
ServerChanChannel: '',
ServerChanTag: '',
CompanyWebHookBotUrl: '',
Enabled: generalUserData.Notify?.Enabled !== undefined ? generalUserData.Notify.Enabled : false,
IfSendStatistic: generalUserData.Notify?.IfSendStatistic !== undefined ? generalUserData.Notify.IfSendStatistic : false,
IfSendMail: generalUserData.Notify?.IfSendMail !== undefined ? generalUserData.Notify.IfSendMail : false,
ToAddress: generalUserData.Notify?.ToAddress !== undefined ? generalUserData.Notify.ToAddress : '',
IfServerChan: generalUserData.Notify?.IfServerChan !== undefined ? generalUserData.Notify.IfServerChan : false,
ServerChanKey: generalUserData.Notify?.ServerChanKey !== undefined ? generalUserData.Notify.ServerChanKey : '',
IfCompanyWebHookBot: generalUserData.Notify?.IfCompanyWebHookBot !== undefined ? generalUserData.Notify.IfCompanyWebHookBot : false,
CompanyWebHookBotUrl: generalUserData.Notify?.CompanyWebHookBotUrl !== undefined ? generalUserData.Notify.CompanyWebHookBotUrl : '',
},
Data: {
CustomInfrastPlanIndex: '',
IfPassCheck: false,
LastAnnihilationDate: '',
LastProxyDate: '',
LastSklandDate: '',
ProxyTimes: 0,
},
QFluentWidgets: {
ThemeColor: 'blue',
ThemeMode: 'system',
LastProxyDate: generalUserData.Data?.LastProxyDate !== undefined ? generalUserData.Data.LastProxyDate : '',
ProxyTimes: generalUserData.Data?.ProxyTimes !== undefined ? generalUserData.Data.ProxyTimes : 0,
},
}
}

View File

@@ -72,7 +72,7 @@
/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-col :span="6">
<a-form-item name="status">
<template #label>
<a-tooltip title="是否启用该用户">
@@ -88,10 +88,7 @@
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
<a-col :span="6">
<a-form-item name="remainedDay">
<template #label>
<a-tooltip title="账号剩余的有效天数,「-1」表示无限">

View File

@@ -3,14 +3,6 @@
<div class="header-title">
<h1>历史记录</h1>
</div>
<a-space size="middle">
<a-button size="large" @click="handleRefresh" class="default">
<template #icon>
<ReloadOutlined />
</template>
刷新
</a-button>
</a-space>
</div>
<!-- 搜索筛选区域 -->
@@ -296,14 +288,6 @@
<template #extra>
<a-space>
<FileTextOutlined />
<a-button
type="link"
size="small"
@click="handleRefreshLog"
:loading="detailLoading"
>
刷新日志
</a-button>
</a-space>
</template>
<a-spin :spinning="detailLoading">
@@ -327,7 +311,6 @@
import { ref, reactive, onMounted, computed } from 'vue'
import { message } from 'ant-design-vue'
import {
ReloadOutlined,
SearchOutlined,
ClearOutlined,
HistoryOutlined,
@@ -527,11 +510,6 @@ const handleReset = () => {
activeKeys.value = []
}
// 刷新数据
const handleRefresh = () => {
handleSearch()
}
// 快捷时间选择处理
const handleQuickTimeSelect = (preset: (typeof timePresets)[0]) => {
currentPreset.value = preset.key
@@ -587,13 +565,6 @@ const loadUserLog = async (jsonFile: string) => {
}
}
// 刷新日志
const handleRefreshLog = async () => {
if (currentJsonFile.value) {
await loadUserLog(currentJsonFile.value)
}
}
// 获取日期状态颜色
const getDateStatusColor = (users: Record<string, HistoryData>) => {
const hasError = Object.values(users).some(

View File

@@ -33,14 +33,6 @@
class="activity-card"
:loading="loading"
>
<template #extra>
<a-button type="text" @click="refreshActivity" :loading="loading">
<template #icon>
<ReloadOutlined />
</template>
刷新
</a-button>
</template>
<div v-if="error" class="error-message">
<a-alert :message="error" type="error" show-icon closable @close="error = ''" />
@@ -251,7 +243,6 @@
import { ref, onMounted, computed } from 'vue'
import { message } from 'ant-design-vue'
import {
ReloadOutlined,
ClockCircleOutlined,
UserOutlined,
BellOutlined,
@@ -451,13 +442,6 @@ const fetchActivityData = async () => {
}
}
const refreshActivity = async () => {
await fetchActivityData()
if (error.value) {
message.error(error.value)
}
}
// 获取代理状态颜色
const getProxyStatusColor = () => {
const hasError = Object.values(proxyData.value).some(proxy => proxy.ErrorTimes > 0)

View File

@@ -331,7 +331,7 @@
</a-row>
<a-row :gutter="24">
<a-col :span="6">
<a-form-item name="remainedDay">
<a-form-item name="medicineNumb">
<template #label>
<a-tooltip title="吃理智药数量">
<span class="form-label">

View File

@@ -38,13 +38,6 @@
删除当前计划
</a-button>
</a-popconfirm>
<a-button size="large" @click="handleRefresh">
<template #icon>
<ReloadOutlined />
</template>
刷新
</a-button>
</a-space>
</div>
</div>
@@ -187,7 +180,7 @@
<script setup lang="ts">
import { computed, onMounted, ref, watch, nextTick } from 'vue'
import { message } from 'ant-design-vue'
import { PlusOutlined, ReloadOutlined, DeleteOutlined, EditOutlined } from '@ant-design/icons-vue'
import { PlusOutlined, DeleteOutlined, EditOutlined } from '@ant-design/icons-vue'
import { usePlanApi } from '../composables/usePlanApi'
// API 相关
@@ -691,14 +684,6 @@ const savePlanData = async () => {
}
}
// 刷新计划列表
const handleRefresh = async () => {
loading.value = true
await initPlans()
loading.value = false
// message.success('刷新成功')
}
// 自动保存功能
watch(
() => [currentPlanName.value, currentMode.value, tableData.value],

View File

@@ -38,13 +38,6 @@
删除当前队列
</a-button>
</a-popconfirm>
<a-button size="large" @click="handleRefresh">
<template #icon>
<ReloadOutlined />
</template>
刷新
</a-button>
</a-space>
</div>
</div>
@@ -211,7 +204,7 @@
<script setup lang="ts">
import { nextTick, onMounted, ref, watch } from 'vue'
import { message } from 'ant-design-vue'
import { DeleteOutlined, EditOutlined, PlusOutlined, ReloadOutlined, QuestionCircleOutlined } from '@ant-design/icons-vue'
import { DeleteOutlined, EditOutlined, PlusOutlined, QuestionCircleOutlined } from '@ant-design/icons-vue'
import { Service } from '@/api'
import TimeSetManager from '@/components/queue/TimeSetManager.vue'
import QueueItemManager from '@/components/queue/QueueItemManager.vue'
@@ -634,13 +627,6 @@ const saveQueueData = async () => {
}
}
// 刷新队列列表
const handleRefresh = async () => {
loading.value = true
await fetchQueues()
loading.value = false
}
// 自动保存功能
watch(
() => [

View File

@@ -16,12 +16,6 @@
</template>
新建脚本
</a-button>
<a-button size="large" @click="handleRefresh" class="default">
<template #icon>
<ReloadOutlined />
</template>
刷新
</a-button>
</a-space>
</div>
@@ -229,7 +223,6 @@ import {
FileSearchOutlined,
FileTextOutlined,
PlusOutlined,
ReloadOutlined,
SettingOutlined,
UserOutlined,
} from '@ant-design/icons-vue'
@@ -494,11 +487,6 @@ const handleDeleteUser = async (user: User) => {
}
}
const handleRefresh = () => {
loadScripts()
message.success('刷新成功')
}
const handleMAAConfig = async (script: Script) => {
try {
// 检查是否已有连接

View File

@@ -386,7 +386,7 @@
<a-row :gutter="24"></a-row>
<a-row :gutter="24">
<a-col :span="6">
<a-form-item name="remainedDay">
<a-form-item name="medicineNumb">
<template #label>
<a-tooltip title="吃理智药数量">
<span class="form-label">