From f0a62aacb5615e3e50df6023fd72534323945e77 Mon Sep 17 00:00:00 2001 From: "ex_zhangwenlei@exiot.cmcc" <15196725410@139.com> Date: Wed, 10 Jan 2024 00:52:34 +0800 Subject: [PATCH] feat: bb --- index.html | 2 +- public/人口登记表.xlsx | Bin 0 -> 10859 bytes src/components/DaiysuiTable/index.vue | 1 - src/components/PlayMusic/index.vue | 61 +-- src/hooks/useAudio.ts | 40 -- src/hooks/useElement.ts | 4 +- src/icons/sort-down.svg | 1 + src/icons/sort-up.svg | 1 + src/router/index.ts | 32 +- src/store/data.ts | 244 +++++------ src/store/globalConfig.ts | 22 +- src/store/personConfig.ts | 75 ++-- src/store/prizeConfig.ts | 2 +- src/utils/index.ts | 2 +- src/views/Config/Global/MusicConfig.vue | 22 +- src/views/Config/Person/PersonAll.vue | 47 ++- src/views/Config/Person/PersonAlready.vue | 25 +- src/views/Config/Prize/PrizeConfig.vue | 16 +- src/views/Home/index.vue | 467 ++++++++++++++++++---- tailwind.config.js | 2 +- vite.config.ts | 1 + 21 files changed, 694 insertions(+), 373 deletions(-) create mode 100644 public/人口登记表.xlsx delete mode 100644 src/hooks/useAudio.ts create mode 100644 src/icons/sort-down.svg create mode 100644 src/icons/sort-up.svg diff --git a/index.html b/index.html index 9efab2f..21ded49 100644 --- a/index.html +++ b/index.html @@ -1,5 +1,5 @@ - + diff --git a/public/人口登记表.xlsx b/public/人口登记表.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..7e883777e197b71725c4aa4cbda926ad734e0254 GIT binary patch literal 10859 zcmeHN1y>x|w#I4P9fG@iaCg_>?ry=|CBX?ngN5Mk?(Pzt4({$2UeDaQYi4ri{epX| zdsS7Rs&B9AI{Vvl_EwgIgu(=a0Rw=6fsulloMu@WfP;a>LxF)|fB_(M#T*^n%pKee z)xDg|UGC?Hvm8tUVOBgt!;cmjV4s~EdsR8aH$-I1@U5`01p~LTmIpP_fCJ5lB|1es zLo3}s6gAh;-i{Q{qHaxN%-LAe`WReoG0H&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`~^LP-{7#NW?zGGn=dX#ma?u zAS?mqY&1C{(&gRXTWKgS=?;ln1dG!2f4smALv`roJZ$LMGp}UzUFI5yseJdWc*3Wk}Zsj`cslPj~Sql@_;{U`q`T!5^wZ=#`6 zF9~KpP~jOF>5Q>Ts3oC6Zti%Pl4`=rm)xn56I&K+;bcW_rQAL3BEbh)Xrh@^pHLm| zq`M_=1}_gz1kFliSk#gIy1`(89g}CWe%t&jshE_LRRVCmpoc|8+p{_a{0PBGg~WOg zq!bfAy)5n~u+gm)Z{1M2Q#4j1^4Cmy`*DB}Z_r#KusoTX_nN>53aRrjRHNTmci1mM z6m%&EL!1y5!u59=plCJ=G1rZB6~hN`qVjuaFYhomJ( zNQKuV569b+S(qx~AYDpOeORO^;BaWFq|4u!IeLO2yqx71+NzRpqD-bXb{v8k)Q&mh zWNbgZpBcBo0cb_Xpq5R;TgyJo@9!s7vOKlT8$lDt1n+;!Im_?P8iOYOW>TCI#)CI1 zy95<1gww}aE+UjZ1be2@CYP)OoSz8t4iWM+u(k}` z$rZoBbQ?{u)g*S>7)Hm8amQLJ7&0v@zQq zE@i=+Htd!aAR@7z;w05WMCJr<3Ea=;lpS)=%=}BA!66tyvD!bk_5FMP{(bz1CO>7l zzYF+#1Jb{Nza3LSB>77_(yzc@n=<}{wt<#K|EM+oyG7$y@ZYQ1e?q~)y5N2X|39_u zU*-H-;`~$66(|Az{|cVJO8Ipy_fILxpru`qlwVhNe--d+Uj3&4Xi#MRw=DZt=&vF8 zpHQqf|APJ+kpC*-?|$`9JQ!FosPOwAUiMe`-)-Vw;n0+Sf&XD4mF1v8vkL|W5Bdax L9Qi!;Z@>Nzj`R#g literal 0 HcmV?d00001 diff --git a/src/components/DaiysuiTable/index.vue b/src/components/DaiysuiTable/index.vue index 923a24a..bbf3377 100644 --- a/src/components/DaiysuiTable/index.vue +++ b/src/components/DaiysuiTable/index.vue @@ -1,4 +1,3 @@ -import { mapActions } from 'pinia'; @@ -90,10 +101,10 @@ onUnmounted(() => { -
+
- + @click="playMusic(currentMusic.item)" @click.right.prevent="nextPlay"> +
diff --git a/src/hooks/useAudio.ts b/src/hooks/useAudio.ts deleted file mode 100644 index c8a295c..0000000 --- a/src/hooks/useAudio.ts +++ /dev/null @@ -1,40 +0,0 @@ -import {ref} from 'vue' - -export const useAudio = () => { - const audio = ref(new Audio) - const audioPaused=ref(true) - const setAudioSrc = (src: string) => { - audio.value.src = src - } - const play = () => { - audio.value.play() - setPaused(false) - } - const pause = () => { - audio.value.pause() - setPaused(true) - } - const setPaused=(paused:boolean)=>{ - audioPaused.value=paused - } - const stop = () => { - audio.value.pause() - audio.value.currentTime = 0 - } - const nextPlay = (src:string) => { - pause() - setAudioSrc(src) - play() - } - - return { - audio, - audioPaused, - play, - nextPlay, - setPaused, - pause, - stop, - setAudioSrc - } -} diff --git a/src/hooks/useElement.ts b/src/hooks/useElement.ts index ae2547e..7a3e0ab 100644 --- a/src/hooks/useElement.ts +++ b/src/hooks/useElement.ts @@ -1,7 +1,7 @@ import { rgba } from '@/utils/color' export const useElementStyle=(element:any,cardColor:string,cardSize:{width:number,height:number},textSize:number,mod:'default'|'lucky'='default')=>{ - element.style.backgroundColor = rgba(cardColor, Math.random() * 0.5 + 0.25) + element.style.backgroundColor = rgba(cardColor, mod=='default'?Math.random() * 0.5 + 0.25:0.8) element.style.border = `1px solid ${rgba(cardColor, 0.25)}` element.style.boxShadow = `0 0 12px ${rgba(cardColor, 0.5)}` element.style.width = `${cardSize.width}px`; @@ -34,8 +34,6 @@ export const useElementStyle=(element:any,cardColor:string,cardSize:{width:numbe } export const useElementPosition=(element:any,count:number,cardSize:{width:number,height:number},windowSize:{width:number,height:number},cardIndex:number)=>{ - const rowCount=Math.floor(windowSize.width/(cardSize.width+100)) - const colCount=Math.ceil(count/rowCount) const centerPosition={ x:0, y:windowSize.height/2-cardSize.height/2 diff --git a/src/icons/sort-down.svg b/src/icons/sort-down.svg new file mode 100644 index 0000000..6b35882 --- /dev/null +++ b/src/icons/sort-down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/icons/sort-up.svg b/src/icons/sort-up.svg new file mode 100644 index 0000000..713c017 --- /dev/null +++ b/src/icons/sort-up.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index d40c9e7..730cb73 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -2,16 +2,16 @@ import { createRouter, createWebHistory } from 'vue-router'; import Layout from '@/layout/index.vue'; import Home from '@/views/Home/index.vue'; export const configRoutes={ - path: '/config', + path: '/log-lottery/config', name: 'Config', component: () => import('@/views/Config/index.vue'), children: [ { path: '', - redirect: '/config/person', + redirect: '/log-lottery/config/person', }, { - path: '/config/person', + path: '/log-lottery/config/person', name: 'PersonConfig', component: () => import('@/views/Config/Person/PersonConfig.vue'), meta: { @@ -21,10 +21,10 @@ export const configRoutes={ children:[ { path:'', - redirect: '/config/person/all', + redirect: '/log-lottery/config/person/all', }, { - path:'/config/person/all', + path:'/log-lottery/config/person/all', name:'AllPersonConfig', component:()=>import('@/views/Config/Person/PersonAll.vue'), meta:{ @@ -33,7 +33,7 @@ export const configRoutes={ } }, { - path:'/config/person/already', + path:'/log-lottery/config/person/already', name:'AlreadyPerson', component:()=>import('@/views/Config/Person/PersonAlready.vue'), meta:{ @@ -53,7 +53,7 @@ export const configRoutes={ ] }, { - path: '/config/prize', + path: '/log-lottery/config/prize', name: 'PrizeConfig', component: () => import('@/views/Config/Prize/PrizeConfig.vue'), meta:{ @@ -62,16 +62,16 @@ export const configRoutes={ } }, { - path:'/config/global', + path:'/log-lottery/config/global', name:'GlobalConfig', - redirect: '/config/global/all', + redirect: '/log-lottery/config/global/all', meta:{ title:'全局配置', icon:'global' }, children:[ { - path:'/config/global/face', + path:'/log-lottery/config/global/face', name:'FaceConfig', component:()=>import('@/views/Config/Global/FaceConfig.vue'), meta:{ @@ -80,7 +80,7 @@ export const configRoutes={ } }, { - path:'/config/global/image', + path:'/log-lottery/config/global/image', name:'ImageConfig', component:()=>import('@/views/Config/Global/ImageConfig.vue'), meta:{ @@ -89,7 +89,7 @@ export const configRoutes={ } }, { - path:'/config/global/music', + path:'/log-lottery/config/global/music', name:'MusicConfig', component:()=>import('@/views/Config/Global/MusicConfig.vue'), meta:{ @@ -103,17 +103,17 @@ export const configRoutes={ } const routes = [ { - path: '/', + path: '/log-lottery', component: Layout, - redirect: '/home', + redirect: '/log-lottery/home', children: [ { - path: '/home', + path: '/log-lottery/home', name: 'Home', component: Home, }, { - path:'/demo', + path:'/log-lottery/demo', name:'Demo', component:()=>import('@/views/Demo/index.vue') }, diff --git a/src/store/data.ts b/src/store/data.ts index b13c6b5..d489191 100644 --- a/src/store/data.ts +++ b/src/store/data.ts @@ -1,175 +1,177 @@ import { IPrizeConfig } from '@/types/prizeConfig'; -export const defaultMusicList=[ +export const defaultPersonList = + [{ uid: 'U100156001', name: '朱厚熜', department: '皇室', identity: '万岁爷', x: 1, y: 1, id: 0, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156002', name: '朱载垕', department: '皇室', identity: '裕王', x: 2, y: 1, id: 1, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156003', name: '朱翊钧 ', department: '皇室', identity: '裕王世子', x: 3, y: 1, id: 2, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156004', name: '严嵩', department: '内阁', identity: '首辅', x: 4, y: 1, id: 3, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156005', name: '徐阶', department: '内阁', identity: '次辅、户部尚书', x: 5, y: 1, id: 4, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156006', name: '张居正', department: '内阁', identity: '阁臣、兵部侍郞', x: 6, y: 1, id: 5, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156007', name: '高拱', department: '内阁', identity: '阁臣、户部侍郞', x: 7, y: 1, id: 6, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156008', name: '严世蕃', department: '内阁', identity: '吏部侍郞', x: 8, y: 1, id: 7, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156009', name: '胡宗宪', department: '大臣', identity: '浙直总督', x: 9, y: 1, id: 8, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156010', name: '戚继光', department: '大臣', identity: '都督佥事', x: 10, y: 1, id: 9, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156011', name: '高瀚文', department: '大臣', identity: '杭州知府', x: 11, y: 1, id: 10, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156012', name: '赵贞吉', department: '大臣', identity: '江苏巡抚', x: 12, y: 1, id: 11, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156013', name: '海瑞', department: '大臣', identity: '淳安知县', x: 13, y: 1, id: 12, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156014', name: '何茂才', department: '大臣', identity: '浙江布政使兼按察使', x: 14, y: 1, id: 13, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156015', name: '郑泌昌', department: '大臣', identity: '浙江巡抚', x: 15, y: 1, id: 14, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156016', name: '王用汲', department: '大臣', identity: '建德知县', x: 16, y: 1, id: 15, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156017', name: '谭纶', department: '大臣', identity: '浙直总督府参军', x: 17, y: 1, id: 16, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156018', name: '朱七', department: '大臣', identity: '北镇抚司', x: 1, y: 2, id: 17, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156019', name: '罗龙文', department: '大臣', identity: '通政使司通政使', x: 2, y: 2, id: 18, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156020', name: '马宁远', department: '大臣', identity: '杭州知府', x: 3, y: 2, id: 19, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156021', name: '田有禄 ', department: '大臣', identity: '淳安县丞', x: 4, y: 2, id: 20, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156022', name: '周云逸', department: '大臣', identity: '钦天监监正', x: 5, y: 2, id: 21, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156023', name: '蒋千户', department: '大臣', identity: '浙江按察使司', x: 6, y: 2, id: 22, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156024', name: '徐千户', department: '大臣', identity: '浙江按察使司', x: 7, y: 2, id: 23, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156025', name: '王牢头 ', department: '大臣', identity: '牢头', x: 8, y: 2, id: 24, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156026', name: '赵班头', department: '大臣', identity: '班头', x: 9, y: 2, id: 25, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156027', name: '吕芳', department: '太监', identity: '掌印太监', x: 10, y: 2, id: 26, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156028', name: '杨金水', department: '太监', identity: '织造局', x: 11, y: 2, id: 27, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156029', name: '陈洪', department: '太监', identity: '首席秉笔太监', x: 12, y: 2, id: 28, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156030', name: '黄锦', department: '太监', identity: '秉笔太监', x: 13, y: 2, id: 29, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156031', name: '李玄', department: '太监', identity: '新安江河道监管', x: 14, y: 2, id: 30, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156032', name: '冯保', department: '太监', identity: '世子大伴', x: 15, y: 2, id: 31, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156033', name: '李时珍', department: '江湖', identity: '名医', x: 16, y: 2, id: 32, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156034', name: '沈一石 ', department: '江湖', identity: '商人', x: 17, y: 2, id: 33, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156035', name: '井上十四郎', department: '江湖', identity: '倭寇', x: 1, y: 3, id: 34, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }, { uid: 'U100156036', name: '芸娘', department: '江湖', x: 2, y: 3, id: 35, isWin: false, createTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', updateTime: 'Tue Jan 09 2024 23:20:07 GMT+0800 (China Standard Time)', prizeName: '', prizeTime: '' }] +export const defaultMusicList = [ { - id:'Geoff Knorr - China (The Industrial Era).ogg'+new Date().getTime().toString(), - name:'Geoff Knorr - China (The Industrial Era).ogg', - url:'https://24years.top/resource/audio/Geoff Knorr - China (The Industrial Era).ogg' + id: 'Geoff Knorr - China (The Industrial Era).ogg' + new Date().getTime().toString(), + name: 'Geoff Knorr - China (The Industrial Era).ogg', + url: 'https://24years.top/resource/audio/Geoff Knorr - China (The Industrial Era).ogg' }, { - id:'Geoff Knorr&Phill Boucher - China (The Atomic Era).ogg'+new Date().getTime().toString(), - name:'Geoff Knorr&Phill Boucher - China (The Atomic Era).ogg', - url:'https://24years.top/resource/audio/Geoff Knorr&Phill Boucher - China (The Atomic Era).ogg' + id: 'Geoff Knorr&Phill Boucher - China (The Atomic Era).ogg' + new Date().getTime().toString(), + name: 'Geoff Knorr&Phill Boucher - China (The Atomic Era).ogg', + url: 'https://24years.top/resource/audio/Geoff Knorr&Phill Boucher - China (The Atomic Era).ogg' }, { - id:'Radetzky March.mp3'+new Date().getTime().toString(), - name:'Radetzky March.mp3', - url:'https://24years.top/resource/audio/Radetzky March.mp3' + id: 'Radetzky March.mp3' + new Date().getTime().toString(), + name: 'Radetzky March.mp3', + url: 'https://24years.top/resource/audio/Radetzky March.mp3' }, { - id:'Shanghai.mp3'+new Date().getTime().toString(), - name:'Shanghai.mp3', - url:'https://24years.top/resource/audio/Shanghai.mp3' + id: 'Shanghai.mp3' + new Date().getTime().toString(), + name: 'Shanghai.mp3', + url: 'https://24years.top/resource/audio/Shanghai.mp3' }, { - id:'Waltz No.2.mp3'+new Date().getTime().toString(), - name:'Waltz No.2.mp3', - url:'https://24years.top/resource/audio/Waltz No.2.mp3' + id: 'Waltz No.2.mp3' + new Date().getTime().toString(), + name: 'Waltz No.2.mp3', + url: 'https://24years.top/resource/audio/Waltz No.2.mp3' }, { - id:'WildChinaTheme.mp3'+new Date().getTime().toString(), - name:'WildChinaTheme.mp3', - url:'https://24years.top/resource/audio/WildChinaTheme.mp3' + id: 'WildChinaTheme.mp3' + new Date().getTime().toString(), + name: 'WildChinaTheme.mp3', + url: 'https://24years.top/resource/audio/WildChinaTheme.mp3' }, { - id:'边程&房东的猫 - 美好事物-再遇少年.ogg'+new Date().getTime().toString(), - name:'边程&房东的猫 - 美好事物-再遇少年.ogg', - url:'https://24years.top/resource/audio/边程&房东的猫 - 美好事物-再遇少年.ogg' + id: '边程&房东的猫 - 美好事物-再遇少年.ogg' + new Date().getTime().toString(), + name: '边程&房东的猫 - 美好事物-再遇少年.ogg', + url: 'https://24years.top/resource/audio/边程&房东的猫 - 美好事物-再遇少年.ogg' }, { - id:'大乔小乔 - 相见难别亦难.ogg'+new Date().getTime().toString(), - name:'大乔小乔 - 相见难别亦难.ogg', - url:'https://24years.top/resource/audio/大乔小乔 - 相见难别亦难.ogg' + id: '大乔小乔 - 相见难别亦难.ogg' + new Date().getTime().toString(), + name: '大乔小乔 - 相见难别亦难.ogg', + url: 'https://24years.top/resource/audio/大乔小乔 - 相见难别亦难.ogg' }, { - id:'你要跳舞吗-新裤子.mp3'+new Date().getTime().toString(), - name:'你要跳舞吗-新裤子.mp3', - url:'https://24years.top/resource/audio/你要跳舞吗-新裤子.mp3' + id: '你要跳舞吗-新裤子.mp3' + new Date().getTime().toString(), + name: '你要跳舞吗-新裤子.mp3', + url: 'https://24years.top/resource/audio/你要跳舞吗-新裤子.mp3' }, { - id:'生命-声音玩具.mp3'+new Date().getTime().toString(), - name:'生命-声音玩具.mp3', - url:'https://24years.top/resource/audio/生命-声音玩具.mp3' + id: '生命-声音玩具.mp3' + new Date().getTime().toString(), + name: '生命-声音玩具.mp3', + url: 'https://24years.top/resource/audio/生命-声音玩具.mp3' }, { - id:'与非门 - Happy New Year.ogg'+new Date().getTime().toString(), - name:'与非门 - Happy New Year.ogg', - url:'https://24years.top/resource/audio/与非门 - Happy New Year.ogg' + id: '与非门 - Happy New Year.ogg' + new Date().getTime().toString(), + name: '与非门 - Happy New Year.ogg', + url: 'https://24years.top/resource/audio/与非门 - Happy New Year.ogg' }, ] -export const defaultPrizeList=[ +export const defaultPrizeList = [ { - id:'001', - name:'一等奖', - sort:1, - isAll:true, - count:1, - isUsedCount:0, - picture:{ - id:'0', - name:'一等奖', - url:'https://24years.top/resource/image/image1.png' - }, - desc:'一等奖', - isShow:true, - isUsed:false, - frequency:1, - }, - { - id:'002', - name:'二等奖', - sort:2, - isAll:true, - count:1, - isUsedCount:0, + id: '001', + name: '一等奖', + sort: 1, + isAll: true, + count: 1, + isUsedCount: 0, picture: { - id:'1', - name:'二等奖', - url:'https://24years.top/resource/image/image2.png' + id: '0', + name: '一等奖', + url: 'https://24years.top/resource/image/image1.png' }, - desc:'二等奖', - isShow:true, - isUsed:false, - frequency:1, + desc: '一等奖', + isShow: true, + isUsed: false, + frequency: 1, }, { - id:'003', - name:'三等奖', - sort:3, - isAll:true, - count:1, - isUsedCount:0, + id: '002', + name: '二等奖', + sort: 2, + isAll: true, + count: 1, + isUsedCount: 0, picture: { - id:'2', - name:'三等奖', - url:'https://24years.top/resource/image/image3.png' + id: '1', + name: '二等奖', + url: 'https://24years.top/resource/image/image2.png' }, - desc:'三等奖', - isShow:true, - isUsed:false, - frequency:1, + desc: '二等奖', + isShow: true, + isUsed: false, + frequency: 1, }, { - id:'004', - name:'超级大奖', - sort:4, - isAll:true, - count:1, - isUsedCount:0, + id: '003', + name: '三等奖', + sort: 3, + isAll: true, + count: 1, + isUsedCount: 0, picture: { - id:'3', - name:'超级奖', - url:'https://24years.top/resource/image/image4.png' + id: '2', + name: '三等奖', + url: 'https://24years.top/resource/image/image3.png' }, - desc:'超级大奖', - isShow:true, - isUsed:false, - frequency:1, + desc: '三等奖', + isShow: true, + isUsed: false, + frequency: 1, }, { - id:'005', - name:'特别奖', - sort:5, - isAll:true, - count:1, - isUsedCount:0, - picture:{ - id:'4', - name:'特别奖', - url:'https://24years.top/resource/image/image5.png' + id: '004', + name: '超级大奖', + sort: 4, + isAll: true, + count: 1, + isUsedCount: 0, + picture: { + id: '3', + name: '超级奖', + url: 'https://24years.top/resource/image/image4.png' }, - desc:'特别奖', - isShow:true, - isUsed:false, - frequency:1, + desc: '超级大奖', + isShow: true, + isUsed: false, + frequency: 1, + }, + { + id: '005', + name: '特别奖', + sort: 5, + isAll: true, + count: 1, + isUsedCount: 0, + picture: { + id: '4', + name: '特别奖', + url: 'https://24years.top/resource/image/image5.png' + }, + desc: '特别奖', + isShow: true, + isUsed: false, + frequency: 1, } ] -export const defaultImageList=[ +export const defaultImageList = [ { - id:'0', - name:'一等奖', - url:'https://24years.top/resource/image/image1.png' + id: '0', + name: '一等奖', + url: 'https://24years.top/resource/image/image1.png' }, { - id:'1', - name:'二等奖', - url:'https://24years.top/resource/image/image2.png' + id: '1', + name: '二等奖', + url: 'https://24years.top/resource/image/image2.png' }, { - id:'2', - name:'三等奖', - url:'https://24years.top/resource/image/image3.png' + id: '2', + name: '三等奖', + url: 'https://24years.top/resource/image/image3.png' }, { - id:'3', - name:'超级奖', - url:'https://24years.top/resource/image/image4.png' + id: '3', + name: '超级奖', + url: 'https://24years.top/resource/image/image4.png' }, { - id:'4', - name:'特别奖', - url:'https://24years.top/resource/image/image5.png' + id: '4', + name: '特别奖', + url: 'https://24years.top/resource/image/image5.png' } ] diff --git a/src/store/globalConfig.ts b/src/store/globalConfig.ts index 4f0d3e2..6cc0c86 100644 --- a/src/store/globalConfig.ts +++ b/src/store/globalConfig.ts @@ -20,7 +20,11 @@ export const useGlobalConfig = defineStore('global', { }, musicList: defaultMusicList, imageList:defaultImageList, - } + }, + currentMusic: { + item:defaultMusicList[0], + paused:true, + }, }; }, getters: { @@ -67,6 +71,10 @@ export const useGlobalConfig = defineStore('global', { getMusicList(state) { return state.globalConfig.musicList; }, + // 获取当前音乐 + getCurrentMusic(state) { + return state.currentMusic; + }, // 获取图片列表 getImageList(state) { return state.globalConfig.imageList; @@ -132,6 +140,13 @@ export const useGlobalConfig = defineStore('global', { } } }, + // 设置当前播放音乐 + setCurrentMusic(musicItem: any,paused:boolean=true) { + this.currentMusic={ + item:musicItem, + paused:paused, + } + }, // 重置音乐列表 resetMusicList() { this.globalConfig.musicList = defaultMusicList; @@ -189,6 +204,10 @@ export const useGlobalConfig = defineStore('global', { }, musicList: defaultMusicList, imageList:defaultImageList, + }, + this.currentMusic= { + item:defaultMusicList[0], + paused:true, } } }, @@ -199,6 +218,7 @@ export const useGlobalConfig = defineStore('global', { // 如果要存储在localStorage中 storage: localStorage, key: 'globalConfig', + paths: ['globalConfig'], }, ], }, diff --git a/src/store/personConfig.ts b/src/store/personConfig.ts index 57c34c9..ee52a7e 100644 --- a/src/store/personConfig.ts +++ b/src/store/personConfig.ts @@ -1,12 +1,14 @@ import { defineStore } from 'pinia'; import { IPersonConfig } from '@/types/personConfig'; import { IPrizeConfig } from '@/types/prizeConfig'; +import {defaultPersonList} from './data' export const usePersonConfig = defineStore('person', { state() { return { personConfig: { - alreadyPersonList: [] as IPersonConfig[], - notPersonList: [] as IPersonConfig[], + allPersonList: [] as IPersonConfig[], + // alreadyPersonList: [] as IPersonConfig[], + // notPersonList: [] as IPersonConfig[], tableRowCount: 12, showField: [] as any[] } @@ -17,17 +19,21 @@ export const usePersonConfig = defineStore('person', { getPersonConfig(state) { return state.personConfig; }, + // 获取全部人员名单 + getAllPersonList(state) { + return state.personConfig.allPersonList; + }, // 获取已中奖人员名单 getAlreadyPersonList(state) { - return state.personConfig.alreadyPersonList; + return state.personConfig.allPersonList.filter((item: IPersonConfig) => { + return item.isWin === true; + }); }, // 获取未中奖人员名单 getNotPersonList(state) { - return state.personConfig.notPersonList; - }, - // 获取所有人员名单 - getAllPersonList(state) { - return state.personConfig.alreadyPersonList.concat(state.personConfig.notPersonList); + return state.personConfig.allPersonList.filter((item: IPersonConfig) => { + return item.isWin === false; + }); }, // 获取table列数 getTableRowCount(state) { @@ -45,7 +51,7 @@ export const usePersonConfig = defineStore('person', { return } personList.forEach((item: IPersonConfig) => { - this.personConfig.notPersonList.push(item); + this.personConfig.allPersonList.push(item); }); }, // 添加已中奖人员 @@ -54,57 +60,58 @@ export const usePersonConfig = defineStore('person', { return } personList.forEach((person: IPersonConfig) => { - this.personConfig.notPersonList = this.personConfig.notPersonList.filter((item: IPersonConfig) => - item.id !== person.id) - if (prize != null) { - person.isWin = true - person.prizeName = prize.name - person.prizeTime = new Date().toString() - } - this.personConfig.alreadyPersonList.push(person); + this.personConfig.allPersonList.map((item: IPersonConfig) => { + if (item.id === person.id&&prize!=null) { + item.isWin = true + item.prizeName = prize.name + item.prizeTime = new Date().toString() + } + }); }); }, // 从已中奖移动到未中奖 moveAlreadyToNot(person: IPersonConfig) { if (person.id != undefined || person.id != null) { - this.personConfig.alreadyPersonList = this.personConfig.alreadyPersonList.filter((item: IPersonConfig) => item.id !== person.id); - person.isWin = false - person.prizeTime = '' - person.prizeName = '' - this.personConfig.notPersonList.push(person); + for(let i=0;i item.id !== person.id); - this.personConfig.notPersonList = this.personConfig.notPersonList.filter((item: IPersonConfig) => item.id !== person.id); + this.personConfig.allPersonList = this.personConfig.allPersonList.filter((item: IPersonConfig) => item.id !== person.id); } }, // 删除所有人员 deleteAllPerson() { - this.personConfig.alreadyPersonList = []; - this.personConfig.notPersonList = []; + this.personConfig.allPersonList = []; }, // 重置所有人员 resetPerson() { - this.personConfig.alreadyPersonList = []; - this.personConfig.notPersonList = []; + this.personConfig.allPersonList = []; }, // 重置已中奖人员 resetAlreadyPerson() { // 把已中奖人员合并到未中奖人员,要验证是否已存在 - if (this.personConfig.alreadyPersonList.length > 0) { - this.personConfig.notPersonList = this.personConfig.notPersonList.concat(this.personConfig.alreadyPersonList); - this.personConfig.alreadyPersonList = []; - } + this.personConfig.allPersonList.forEach((item: IPersonConfig) => { + item.isWin = false; + }); + }, + setDefaultPersonList() { + this.personConfig.allPersonList = defaultPersonList; }, // 重置所有配置 reset() { this.personConfig = { - alreadyPersonList: [] as IPersonConfig[], - notPersonList: [] as IPersonConfig[], + allPersonList: [] as IPersonConfig[], tableRowCount: 12, showField: [] as string[] } diff --git a/src/store/prizeConfig.ts b/src/store/prizeConfig.ts index edf20a7..9dada6b 100644 --- a/src/store/prizeConfig.ts +++ b/src/store/prizeConfig.ts @@ -33,7 +33,7 @@ export const usePrizeConfig = defineStore('prize', { }, // 获取奖品列表 getPrizeConfig(state) { - return state.prizeConfig.prizeList; +return state.prizeConfig.prizeList; }, // 根据id获取配置 getPrizeConfigById(state) { diff --git a/src/utils/index.ts b/src/utils/index.ts index b0a762b..9f87b22 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -1,5 +1,5 @@ // 筛选人员数据 -export const filterData = (tableData: any[],localRowCount: number) => { +export const filterData = (tableData: any[],localRowCount: number,startIndex=0) => { const dataLength = tableData.length let j = 0; for (let i = 0; i < dataLength; i++) { diff --git a/src/views/Config/Global/MusicConfig.vue b/src/views/Config/Global/MusicConfig.vue index 5134f98..c0dad67 100644 --- a/src/views/Config/Global/MusicConfig.vue +++ b/src/views/Config/Global/MusicConfig.vue @@ -13,29 +13,12 @@ const audioDbStore = localforage.createInstance({ const globalConfig = useStore().globalConfig const { getMusicList: localMusicList } = storeToRefs(globalConfig); -const audio = ref(new Audio()) const limitType = ref('audio/*') const localMusicListValue = ref(localMusicList) const play = async (item: any) => { - let audioUrl = '' - if (!item.url) { - return - } - if (item.url == 'Storage') { - audioUrl = await audioDbStore.getItem(item.name) as string - } - else { - audioUrl = item.url - } - audio.value.pause() - audio.value.src = audioUrl + globalConfig.setCurrentMusic(item,false) +} - audio.value.currentTime = 0 - audio.value.play() -} -const pausePlay = () => { - audio.value.pause() -} const deleteMusic = (item: any) => { globalConfig.removeMusic(item.id) audioDbStore.removeItem(item.name) @@ -96,7 +79,6 @@ onMounted(() => { :accept="limitType" /> 上传音乐 -
diff --git a/src/views/Config/Person/PersonAll.vue b/src/views/Config/Person/PersonAll.vue index 4363f5b..25c8a3a 100644 --- a/src/views/Config/Person/PersonAll.vue +++ b/src/views/Config/Person/PersonAll.vue @@ -1,17 +1,17 @@ @@ -125,6 +124,13 @@ watch(() => prizeList, () => {
+