Confilct dev date 12 22 (#131)
* fix(home): 🐛 解决多次切换路由后页面卡顿的问题 #96 卸载路由时清除requestAnimationFrame * feat: ✨ 文件存储使用Blob格式 * style: 💄 修改部分类型any为具体类型 * feat: ✨ 界面设置中模块使用瀑布流布局 #96 * fix: 🐛 md文档更换文件夹解决控制台警告 * style: 💄 switch按钮改回使用daisyui组件 * refactor: ♻️ 所有人员列表提取tableColumn * style: 💄 奖项列表中的图片类型修复 * fix(globalConfig): 修复当前音乐项类型缺失问题 * feat: ✨ single person not done * feat: ✨ 可添加单人 #96 * build(.gitignore): 添加 auto-imports.d.ts 到忽略文件 * fix: 🐛 上传、下载excel文件时修复路径错误 打包成应用和网页端的baseUrl不一样,使用环境变量来表示 * fix: 🐛 导入人员列表时处理有值为空的情况 * style: 💄 改变toaster的组件 * fix: 🐛 上传文件、解析数据与存储/读取数据的处理 、
This commit is contained in:
@@ -32,7 +32,7 @@ export const useGlobalConfig = defineStore('global', {
|
||||
imageList: defaultImageList as IImage[],
|
||||
},
|
||||
currentMusic: {
|
||||
item: defaultMusicList[0],
|
||||
item: defaultMusicList[0] as IMusic,
|
||||
paused: true,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { IPersonConfig, IPrizeConfig } from '@/types/storeType'
|
||||
import dayjs from 'dayjs'
|
||||
import { defineStore } from 'pinia'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { computed, ref, toRaw, watch } from 'vue'
|
||||
import { computed, ref, toRaw } from 'vue'
|
||||
import { IndexDb } from '@/utils/dexie'
|
||||
import { defaultPersonList } from './data'
|
||||
import { usePrizeConfig } from './prizeConfig'
|
||||
@@ -10,13 +10,13 @@ import { usePrizeConfig } from './prizeConfig'
|
||||
// 获取IPersonConfig的key组成数组
|
||||
export const personListKey = Object.keys(defaultPersonList[0])
|
||||
export const usePersonConfig = defineStore('person', () => {
|
||||
const personDb = new IndexDb('person', ['allPersonList', 'alreadyPersonList'], 1, personListKey)
|
||||
const personDb = new IndexDb('person', ['allPersonList', 'alreadyPersonList'], 1, ['createTime'])
|
||||
// NOTE: state
|
||||
const personConfig = ref({
|
||||
allPersonList: [] as IPersonConfig[],
|
||||
alreadyPersonList: [] as IPersonConfig[],
|
||||
})
|
||||
personDb.getAllData('allPersonList').then((data) => {
|
||||
personDb.getDataSortedByDateTime('allPersonList', 'createTime').then((data) => {
|
||||
personConfig.value.allPersonList = data
|
||||
})
|
||||
personDb.getAllData('alreadyPersonList').then((data) => {
|
||||
@@ -51,7 +51,7 @@ export const usePersonConfig = defineStore('person', () => {
|
||||
return item.isWin === false
|
||||
}))
|
||||
// NOTE: action
|
||||
// 添加未中奖人员
|
||||
// 添加全部未中奖人员
|
||||
function addNotPersonList(personList: IPersonConfig[]) {
|
||||
if (personList.length <= 0) {
|
||||
return
|
||||
@@ -61,6 +61,20 @@ export const usePersonConfig = defineStore('person', () => {
|
||||
})
|
||||
personDb.setAllData('allPersonList', personList)
|
||||
}
|
||||
// 添加数据
|
||||
function addOnePerson(person: IPersonConfig[]) {
|
||||
if (person.length <= 0) {
|
||||
return
|
||||
}
|
||||
if (person.length > 1) {
|
||||
console.warn('只支持添加单个用户')
|
||||
return
|
||||
}
|
||||
person.forEach((item: IPersonConfig) => {
|
||||
personConfig.value.allPersonList.push(item)
|
||||
personDb.setData('allPersonList', item)
|
||||
})
|
||||
}
|
||||
// 添加已中奖人员
|
||||
function addAlreadyPersonList(personList: IPersonConfig[], prize: IPrizeConfig | null) {
|
||||
if (personList.length <= 0) {
|
||||
@@ -176,6 +190,7 @@ export const usePersonConfig = defineStore('person', () => {
|
||||
getAlreadyPersonDetail,
|
||||
getNotPersonList,
|
||||
addNotPersonList,
|
||||
addOnePerson,
|
||||
addAlreadyPersonList,
|
||||
moveAlreadyToNot,
|
||||
deletePerson,
|
||||
|
||||
Reference in New Issue
Block a user