Laitool v3.0.1-preview.1

This commit is contained in:
2024-08-03 12:46:12 +08:00
parent c8a46d59fb
commit 7312053a20
196 changed files with 19822 additions and 8733 deletions
-68
View File
@@ -1,68 +0,0 @@
import { defineStore } from "pinia";
export const usePromptStore = defineStore('prompt', {
state: () => ({
// 提示词排序
prompt_sort: [],
selectStyle: [],
suffix: null, // 后缀
prefix: null, // 前缀
image_generate_category: null, // 选择生图的分类(sd,mj,d3)
isInit: false
}),
getters: {
// 获取提示词排序
GetPromptSort() {
return this.prompt_sort;
},
// 获取选中的风格
GetSelectStyle() {
return this.selectStyle
},
// 获取前缀
GetPrefix() {
return this.prefix;
},
// 获取后缀
GetSuffix() {
return this.suffix;
},
// 获取生图分类
GetImageGenerateCategory() {
return this.image_generate_category;
}
},
actions: {
// 更新提示词排序
InitPromptSort(value) {
this.prompt_sort = value;
},
// 更新
UpdateSelectStyleSort(value) {
this.selectStyle = value;
},
// 更新前缀
UpdatePrefix(value) {
this.prefix = value;
},
// 更新后缀
UpdateSuffix(value) {
this.suffix = value;
},
// 更新生图分类
UpdateImageGenerateCategory(value) {
this.image_generate_category = value;
}
}
});
+65
View File
@@ -0,0 +1,65 @@
import { defineStore } from 'pinia'
export const usePromptStore = defineStore('prompt', {
state: () => ({
// 提示词排序
prompt_sort: [],
selectStyle: [],
suffix: null, // 后缀
prefix: null, // 前缀
image_generate_category: null, // 选择生图的分类(sd,mj,d3)
isInit: false
}),
getters: {
// 获取提示词排序
GetPromptSort() {
return this.prompt_sort
},
// 获取选中的风格
GetSelectStyle() {
return this.selectStyle
},
// 获取前缀
GetPrefix() {
return this.prefix
},
// 获取后缀
GetSuffix() {
return this.suffix
},
// 获取生图分类
GetImageGenerateCategory() {
return this.image_generate_category
}
},
actions: {
// 更新提示词排序
InitPromptSort(value) {
this.prompt_sort = value
},
// 更新
UpdateSelectStyleSort(value) {
this.selectStyle = value
},
// 更新前缀
UpdatePrefix(value) {
this.prefix = value
},
// 更新后缀
UpdateSuffix(value) {
this.suffix = value
},
// 更新生图分类
UpdateImageGenerateCategory(value) {
this.image_generate_category = value
}
}
})
@@ -1,7 +1,8 @@
import { messageDark, useMessage } from 'naive-ui'
import { defineStore } from 'pinia'
import { errorMessage, successMessage } from '../main/generalTools'
import { errorMessage, successMessage } from '../main/Public/generalTools'
import { BookTaskStatus } from '../define/enum/bookEnum'
import { Book } from '../model/book'
// 系统相关设置
export const useReverseManageStore = defineStore('reverseManage', {
@@ -18,9 +19,9 @@ export const useReverseManageStore = defineStore('reverseManage', {
audioPath: null,
imageFolder: null,
subtitlePosition: null
}, // 当前选中的小说
} as Book.SelectBook, // 当前选中的小说
bookTaskData: [], // 当前显示的所有小说任务数据
bookTaskData: [] as Book.SelectBookTask[], // 当前显示的所有小说任务数据
selectBookTask: {
no: null,
@@ -30,12 +31,18 @@ export const useReverseManageStore = defineStore('reverseManage', {
generateVideoPath: null,
srtPath: null,
audioPath: null,
draftSrtStyle: null, // 草稿字幕样式
backgroundMusic: null, // 背景音乐ID
friendlyReminder: null, // 友情提示
imageFolder: null,
styleList: null,
prefix: null,
status: BookTaskStatus.WAIT,
errorMsg: null
} // 当前选中的小说任务
} as Book.SelectBookTask// 当前选中的小说任务
,
selectBookTaskDetail: [] as Book.SelectBookTaskDetail[] // 当前选中的小说任务的详细数据
}),
getters: {
// 获取小说数据
@@ -55,6 +62,7 @@ export const useReverseManageStore = defineStore('reverseManage', {
async GetBookDataFromDB(condition) {
try {
debugger
//@ts-ignore
let res = await window.book.GetBookData(condition)
if (res.code == 0) {
throw new Error(res.message)
@@ -73,7 +81,7 @@ export const useReverseManageStore = defineStore('reverseManage', {
// 获取小说任务数据
async GetBookTaskDataFromDB(condition) {
try {
debugger
//@ts-ignore
let res = await window.book.GetBookTaskData(condition)
if (res.code == 0) {
throw new Error(res.message)
@@ -82,6 +90,24 @@ export const useReverseManageStore = defineStore('reverseManage', {
this.bookTaskData = res.data.bookTasks
this.selectBookTask = res.data.bookTasks[0]
} else {
this.bookTaskData = []
this.selectBookTask = {
no: null,
id: null,
bookId: null,
name: null,
generateVideoPath: null,
srtPath: null,
audioPath: null,
draftSrtStyle: null, // 草稿字幕样式
backgroundMusic: null, // 背景音乐ID
friendlyReminder: null, // 友情提示
imageFolder: null,
styleList: null,
prefix: null,
status: BookTaskStatus.WAIT,
errorMsg: null
} as Book.SelectBookTask
throw new Error('没有找到对应的子批次数据,请先创建')
}
return successMessage(true)
@@ -134,6 +160,7 @@ export const useReverseManageStore = defineStore('reverseManage', {
async SetBookType(value = false) {
try {
if (this.bookType.length <= 0 || value) {
//@ts-ignore
let _bookType = await book.GetBookType()
if (_bookType.code == 0) {
throw new Error(_bookType.message)
@@ -164,9 +191,11 @@ export const useReverseManageStore = defineStore('reverseManage', {
let save_res = null
if (book == null) {
// 保存this.selectBook
//@ts-ignore
save_res = await window.book.AddOrModifyBook({ ...this.selectBook })
} else {
// 保存传入的数据
//@ts-ignore
save_res = await window.book.AddOrModifyBook({ ...book })
}
debugger
-51
View File
@@ -1,51 +0,0 @@
import { defineStore } from 'pinia'
// 系统相关设置
export const useSettingStore = defineStore('setting', {
state: () => ({
actionRemoteMJ: {
id: null,
accountId: null,
channelId: null,
coreSize: 3,
guildId: null,
enable: true,
mjBotChannelId: null,
nijiBotChannelId: null,
queueSize: 10,
remark: null,
timeoutMinutes: 10,
userAgent:
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',
userToken: null,
createTime: null,
updateTime: null
}
}),
getters: {},
actions: {
/**
* 重置MJ代理模式的数据
*/
ResetActionRemoteMJ() {
this.actionRemoteMJ = {
id: null,
accountId: null,
channelId: null,
coreSize: 3,
guildId: null,
enable: true,
mjBotChannelId: null,
nijiBotChannelId: null,
queueSize: 10,
remark: null,
timeoutMinutes: 10,
userAgent:
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',
userToken: null,
createTime: null,
updateTime: null
}
}
}
})
+65
View File
@@ -0,0 +1,65 @@
import { defineStore } from 'pinia'
// 系统相关设置
export const useSettingStore = defineStore('setting', {
state: () => ({
actionRemoteMJ: {
id: undefined,
accountId: undefined,
channelId: undefined,
coreSize: 3,
guildId: undefined,
enable: true,
mjBotChannelId: undefined,
nijiBotChannelId: undefined,
queueSize: 10,
remark: undefined,
timeoutMinutes: 10,
userAgent:
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',
userToken: undefined,
createTime: undefined,
updateTime: undefined
} as MJSetting.ActionRemoteMJSetting,
// tts 配置
ttsSetting: {
selectModel: 'edge-tts',
edgeTTS: {
value: 'zh-CN-XiaoxiaoNeural',
gender: 'Female',
label: '晓晓',
lang: 'zh-CN',
saveSubtitles: true,
pitch: 0, // 语调
rate: 10, // 倍速
volumn: 0 // 音量
}
} as TTSSettingModel.TTSSetting
}),
getters: {},
actions: {
/**
* 重置MJ代理模式的数据
*/
ResetActionRemoteMJ() {
this.actionRemoteMJ = {
id: undefined,
accountId: undefined,
channelId: undefined,
coreSize: 3,
guildId: undefined,
enable: true,
mjBotChannelId: undefined,
nijiBotChannelId: undefined,
queueSize: 10,
remark: undefined,
timeoutMinutes: 10,
userAgent:
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36',
userToken: undefined,
createTime: undefined,
updateTime: undefined
} as MJSetting.ActionRemoteMJSetting
}
}
})
@@ -13,6 +13,7 @@ export const useSoftwareStore = defineStore('software', {
reverse_show_book_striped: false, // 是否显示斑马纹(反推界面)
reverse_data_table_size: 'small' // 反推界面表格大小
},
show_logger: false, // 是否显示日志
componentSize: [], // 组件尺寸(通用的选项)
SoftColor: null // 按钮颜色
}),