mirror of
https://github.com/Cp0204/quark-auto-save.git
synced 2026-01-18 19:00:44 +08:00
Compare commits
No commits in common. "9363ab7b95c0957feb635cfa288859549cd954fd" and "f9730f2994a43a71e61859dccbeef18515fa572f" have entirely different histories.
9363ab7b95
...
f9730f2994
@ -8065,12 +8065,6 @@ div:has(> .collapse:not(.show)):has(+ .row.title[title^="资源搜索"]) {
|
|||||||
margin-bottom: 8px;
|
margin-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 创建与编辑任务模态框:插件配置与下方分割线间距 16px */
|
|
||||||
#createTaskModal .form-group .jsoneditor,
|
|
||||||
#createTaskModal .form-group .jsoneditor-vue {
|
|
||||||
margin-bottom: 16px !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 海报视图资源失效警告按钮样式 */
|
/* 海报视图资源失效警告按钮样式 */
|
||||||
.discovery-warning-btn {
|
.discovery-warning-btn {
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|||||||
@ -2640,7 +2640,7 @@
|
|||||||
<div class="form-group row" v-if="Object.keys(getAvailablePlugins(formData.plugins)).length" :title="getCreateTaskPluginConfigTitle()">
|
<div class="form-group row" v-if="Object.keys(getAvailablePlugins(formData.plugins)).length" :title="getCreateTaskPluginConfigTitle()">
|
||||||
<label class="col-sm-2 col-form-label">插件配置</label>
|
<label class="col-sm-2 col-form-label">插件配置</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<v-jsoneditor v-model="createTask.taskData.addition" :options="{mode:'tree'}" :plus="false" height="162px" :disabled="isPluginConfigDisabled(createTask.taskData)"></v-jsoneditor>
|
<v-jsoneditor v-model="createTask.taskData.addition" :options="{mode:'tree'}" :plus="false" height="162px" style="margin-bottom: -8px;" :disabled="isPluginConfigDisabled(createTask.taskData)"></v-jsoneditor>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -2654,9 +2654,6 @@
|
|||||||
<button type="button" class="btn btn-primary" :disabled="createTask.loading" @click="confirmEditTask">
|
<button type="button" class="btn btn-primary" :disabled="createTask.loading" @click="confirmEditTask">
|
||||||
保存
|
保存
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-primary" :disabled="createTask.loading" @click="confirmEditAndRunTask" style="margin-left: 4px;">
|
|
||||||
保存并运行任务
|
|
||||||
</button>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<button type="button" class="btn btn-primary" :disabled="createTask.loading" @click="confirmCreateTask">
|
<button type="button" class="btn btn-primary" :disabled="createTask.loading" @click="confirmCreateTask">
|
||||||
@ -11786,13 +11783,6 @@
|
|||||||
createTaskFromDiscovery(item) {
|
createTaskFromDiscovery(item) {
|
||||||
// 从影视发现页面创建任务
|
// 从影视发现页面创建任务
|
||||||
try {
|
try {
|
||||||
// 强制切换为创建模式并重置表单
|
|
||||||
this.createTask.isEditMode = false;
|
|
||||||
this.createTask.editTaskIndex = null;
|
|
||||||
this.createTask.error = null;
|
|
||||||
// 使用 newTask 的完整结构初始化,再由智能填充覆盖
|
|
||||||
this.createTask.taskData = { ...this.newTask };
|
|
||||||
|
|
||||||
// 存储影视作品数据,并提取年份信息
|
// 存储影视作品数据,并提取年份信息
|
||||||
const movieData = { ...item };
|
const movieData = { ...item };
|
||||||
// 如果没有year字段,尝试从card_subtitle中提取
|
// 如果没有year字段,尝试从card_subtitle中提取
|
||||||
@ -12637,72 +12627,6 @@
|
|||||||
this.createTask.loading = false;
|
this.createTask.loading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
confirmEditAndRunTask() {
|
|
||||||
// 确认编辑任务并立即运行
|
|
||||||
if (this.createTask.loading) return;
|
|
||||||
|
|
||||||
// 复用与编辑验证相同的逻辑
|
|
||||||
if (!this.createTask.taskData.taskname.trim()) {
|
|
||||||
this.createTask.error = '任务名称不能为空';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.createTask.taskData.shareurl.trim()) {
|
|
||||||
this.createTask.error = '分享链接不能为空';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!this.createTask.taskData.savepath.trim()) {
|
|
||||||
this.createTask.error = '保存路径不能为空';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
this.createTask.loading = true;
|
|
||||||
this.createTask.error = null;
|
|
||||||
|
|
||||||
// 更新任务数据
|
|
||||||
const updatedTask = { ...this.createTask.taskData };
|
|
||||||
|
|
||||||
// 应用全局插件配置
|
|
||||||
this.applyGlobalPluginConfig(updatedTask);
|
|
||||||
|
|
||||||
// 处理命名模式
|
|
||||||
if (updatedTask.use_sequence_naming) {
|
|
||||||
updatedTask.pattern = updatedTask.sequence_naming;
|
|
||||||
} else if (updatedTask.use_episode_naming) {
|
|
||||||
updatedTask.pattern = updatedTask.episode_naming;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新任务列表中的任务
|
|
||||||
if (this.createTask.editTaskIndex !== null && this.formData.tasklist && this.formData.tasklist[this.createTask.editTaskIndex]) {
|
|
||||||
this.$set(this.formData.tasklist, this.createTask.editTaskIndex, updatedTask);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 保存配置
|
|
||||||
axios.post('/update', this.formData)
|
|
||||||
.then(response => {
|
|
||||||
if (response.data.success) {
|
|
||||||
this.configModified = false;
|
|
||||||
this.showToast('任务编辑成功并开始运行', 'success');
|
|
||||||
this.fetchUserInfo();
|
|
||||||
this.updateTasklistMetadata();
|
|
||||||
const taskIndex = this.createTask.editTaskIndex;
|
|
||||||
this.createTask.loading = false;
|
|
||||||
this.cancelCreateTask();
|
|
||||||
// 稍后运行任务,保证模态框关闭完成
|
|
||||||
setTimeout(() => {
|
|
||||||
if (taskIndex !== null && taskIndex >= 0) {
|
|
||||||
this.runScriptNow(taskIndex);
|
|
||||||
}
|
|
||||||
}, 300);
|
|
||||||
} else {
|
|
||||||
alert(response.data.message);
|
|
||||||
this.createTask.loading = false;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch(error => {
|
|
||||||
alert("保存失败: " + (error.response?.data?.message || error.message || "未知错误"));
|
|
||||||
this.createTask.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
confirmCreateAndRunTask() {
|
confirmCreateAndRunTask() {
|
||||||
// 确认创建并运行任务
|
// 确认创建并运行任务
|
||||||
if (this.createTask.loading) return;
|
if (this.createTask.loading) return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user