Laitool v3.0.1-preview.1
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
// 系统相关设置
|
||||
export const useSoftwareStore = defineStore('software', {
|
||||
state: () => ({
|
||||
spin: {
|
||||
spinning: false,
|
||||
tip: '加载中...'
|
||||
},
|
||||
softWare: {
|
||||
theme: 'light', // 系统主题,亮或是暗
|
||||
reverse_display_show: false, // 一键反推界面显示(简单的表格模式还是表格任务模式)
|
||||
reverse_show_book_striped: false, // 是否显示斑马纹(反推界面)
|
||||
reverse_data_table_size: 'small' // 反推界面表格大小
|
||||
},
|
||||
show_logger: false, // 是否显示日志
|
||||
componentSize: [], // 组件尺寸(通用的选项)
|
||||
SoftColor: null // 按钮颜色
|
||||
}),
|
||||
getters: {
|
||||
// 获取一键反推界面显示数据
|
||||
GetReverseDispalayShow(state) {
|
||||
return state.softWare.reverse_display_show
|
||||
}
|
||||
},
|
||||
actions: {
|
||||
// 设置一键反推界面显示数据
|
||||
SetReverseDispalayShow(value) {
|
||||
this.softWare.reverse_display_show = value
|
||||
},
|
||||
|
||||
// 设置反推界面时候小说信息显示斑马纹
|
||||
SetReverseBookStripedShow(value) {
|
||||
this.softWare.reverse_show_book_striped = value
|
||||
},
|
||||
|
||||
// 修改软件主题
|
||||
SetSoftware(value) {
|
||||
this.softWare = Object.assign(this.softWare, value)
|
||||
},
|
||||
|
||||
// 获取组件尺寸(判断当前是不是存在,不存在的话到主线程拿)
|
||||
async GetComponentSize() {
|
||||
debugger
|
||||
if (this.componentSize.length == 0) {
|
||||
let res = await window.setting.GetComponentSize()
|
||||
this.componentSize = res.data
|
||||
}
|
||||
return this.componentSize
|
||||
},
|
||||
|
||||
//#region 保存到数据库的操作
|
||||
|
||||
// 将当前的software数据保存到数据库中
|
||||
async SaveSoftware() {
|
||||
// 保存数据
|
||||
return await window.setting.SaveSoftWareSetting(JSON.parse(JSON.stringify(this.softWare)))
|
||||
}
|
||||
|
||||
//#endregion
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user