fix: 复原疑似被误处理的文件

This commit is contained in:
DLmaster361
2025-09-01 23:50:35 +08:00
parent e98ebe3e84
commit 42710ecf60
2 changed files with 23 additions and 62 deletions

View File

@@ -1,31 +1,25 @@
<template>
<!-- 加载状态 -->
<div v-if="loading" class="loading-container">
<a-spin size="large" tip="加载中,请稍候..." />
</div>
<!-- 主要内容 -->
<div class="scripts-header">
<div class="header-title">
<h1>脚本管理</h1>
</div>
<a-space size="middle">
<a-button type="primary" size="large" @click="handleAddScript" class="link">
<template #icon>
<PlusOutlined />
</template>
新建脚本
</a-button>
<a-button size="large" @click="handleRefresh" class="default">
<template #icon>
<ReloadOutlined />
</template>
刷新
</a-button>
</a-space>
<div class="scripts-header">
<div class="header-title">
<h1>脚本管理</h1>
</div>
<!-- 如果没有脚本显示占位符 -->
<div v-if="scripts.length === 0" class="placeholder-container">
<a-space size="middle">
<a-button type="primary" size="large" @click="handleAddScript" class="link">
<template #icon>
<PlusOutlined />
</template>
新建脚本
</a-button>
<a-button size="large" @click="handleRefresh" class="default">
<template #icon>
<ReloadOutlined />
</template>
刷新
</a-button>
</a-space>
</div>
<!-- 如果没有脚本显示占位符 -->
<div v-if="scripts.length === 0" class="placeholder-container">
<div class="placeholder-content">
<h2>当前没有脚本</h2>
<p>您还没有创建任何脚本点击下方的新建脚本按钮来创建您的第一个脚本</p>
@@ -601,22 +595,6 @@ const handleToggleUserStatus = async (user: User) => {
</script>
<style scoped>
.loading-container {
display: flex;
justify-content: center;
align-items: center;
min-height: 400px;
}
.scripts-main {
padding: 32px;
height: 100%;
display: flex;
flex-direction: column;
background: var(--ant-color-bg-layout);
min-height: 100vh;
}
.scripts-container {
padding: 32px;
height: 100%;
@@ -1033,7 +1011,7 @@ const handleToggleUserStatus = async (user: User) => {
/* 响应式设计 */
@media (max-width: 768px) {
.scripts-main {
.scripts-container {
padding: 16px;
}

View File

@@ -1047,7 +1047,6 @@ const getDefaultMAAUserData = () => ({
Status: true,
Mode: 'MAA',
InfrastMode: '默认',
InfrastPath: '',
Routine: true,
Annihilation: '当期',
Stage: '1-7',
@@ -1058,11 +1057,6 @@ const getDefaultMAAUserData = () => ({
Stage_Remain: '',
IfSkland: false,
SklandToken: '',
// 添加 General 脚本的属性以确保兼容性
IfScriptBeforeTask: false,
IfScriptAfterTask: false,
ScriptBeforeTask: '',
ScriptAfterTask: '',
},
Task: {
IfBase: true,
@@ -1114,7 +1108,6 @@ const getDefaultGeneralUserData = () => ({
ToAddress: '',
IfSendMail: false,
IfSendStatistic: false,
IfSendSixStar: false,
IfServerChan: false,
IfCompanyWebHookBot: false,
ServerChanKey: '',
@@ -1139,7 +1132,7 @@ const formData = reactive({
userName: '',
userId: '',
// 嵌套的实际数据
...getDefaultMAAUserData(),
...getDefaultUserData(),
})
// 表单验证规则
@@ -1194,20 +1187,10 @@ const loadScriptInfo = async () => {
scriptType.value = script.type // 设置脚本类型
// 重新初始化表单数据(根据脚本类型)
const defaultData =
scriptType.value === 'MAA' ? getDefaultMAAUserData() : getDefaultGeneralUserData()
// 清空现有数据并重新赋值
Object.keys(formData).forEach(key => {
if (key !== 'userName' && key !== 'userId') {
delete formData[key]
}
})
Object.assign(formData, {
userName: '',
userId: '',
...defaultData,
...getDefaultUserData(),
})
// 如果是编辑模式,加载用户数据