Merge branch 'main' into dev

This commit is contained in:
ex_zhangwenlei@exiot.cmcc
2024-11-26 10:47:28 +08:00
8 changed files with 153 additions and 158 deletions

2
.gitignore vendored
View File

@@ -6,7 +6,7 @@ yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
.pnpm-lock.yaml
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

View File

@@ -12,39 +12,34 @@
log-lottery是一个可配置可定制化的抽奖应用炫酷3D球体可用于年会抽奖等活动支持奖品、人员、界面、图片音乐配置。
> 因原域名到期,现将原域名 (https://24years.top/log-lottery)
迁移到 (https://1kw20.fun/log-lottery) 。
> 因原域名到期,现将原域名 (<https://24years.top/log-lottery>)
迁移到 (<https://1kw20.fun/log-lottery>) 。
如果进入到新域名遇到图片无法访问的情况,请到【全局配置】-【界面配置】菜单中点击【重置所有数据】按钮进行更新
## 要求
使用PC端最新版Chrome或Edge浏览器。
访问地址:
https://1kw20.fun/log-lottery
<https://1kw20.fun/log-lottery>
or
https://log1997.github.io/log-lottery/
## 功能描述
- 🕍 炫酷3D球体年会抽奖必备开箱即用
- 🧿 持久化存储,数据不丢失
- 🎁 奖品奖项配置
- 👱 抽奖名单设置管理
- 🛞 界面信息自定义
- 🎼 播放背景音乐
- 💾 图片、背景音乐管理,使用本地存储,有默认资源可直接使用
- 🖼️ excel表格导入人员名单、抽奖结果使用excel导出
- 🎈 可增加临时抽奖
<https://log1997.github.io/log-lottery/>
## TODO
- [x] 🕍 炫酷3D球体年会抽奖必备开箱即用
- [x] 💾 本地持久化存储
- [x] 🎁 奖品奖项配置
- [x] 👱 抽奖名单设置管理
- [x] 🎼 播放背景音乐
- [x] 🖼️ excel表格导入人员名单、抽奖结果使用excel导出
- [x] 🎈 可增加临时抽奖
- [x] 🧨 国际化多语言
- [ ] 添加docker构建部署和镜像
- [ ] 国际化多语言
- [ ] 更换背景图片
...
需要更多功能请留言
@@ -124,7 +119,7 @@ pnpm dev
pnpm build
```
> 项目思路来源于 https://github.com/moshang-xc/lottery
> 项目思路来源于 <https://github.com/moshang-xc/lottery>
## License

View File

@@ -16,23 +16,23 @@
},
"dependencies": {
"@tweenjs/tween.js": "^23.1.2",
"@vueuse/core": "^10.11.0",
"axios": "^1.7.2",
"@vueuse/core": "^11.3.0",
"axios": "^1.7.8",
"canvas-confetti": "^1.9.3",
"dayjs": "^1.11.11",
"github-markdown-css": "^5.6.1",
"dayjs": "^1.11.13",
"github-markdown-css": "^5.8.0",
"localforage": "^1.10.0",
"markdown-it": "^14.1.0",
"pinia": "^2.1.7",
"pinia": "^2.2.6",
"pinia-plugin-persist": "^1.0.0",
"sparticles": "^1.3.1",
"theme-change": "^2.5.0",
"three": "^0.166.0",
"three-css3d": "^1.0.6",
"vue": "^3.4.31",
"vue-dompurify-html": "^5.1.0",
"vue": "^3.5.13",
"vue-dompurify-html": "^5.2.0",
"vue-i18n": "^10.0.4",
"vue-router": "^4.4.0",
"vue-router": "^4.5.0",
"vue-toast-notification": "^3",
"vue3-colorpicker": "^2.3.0",
"xlsx": "^0.18.5",
@@ -42,44 +42,44 @@
"@antfu/eslint-config": "^3.9.2",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.15.0",
"@iconify-json/ep": "^1.1.15",
"@iconify-json/fluent": "^1.1.58",
"@tailwindcss/typography": "^0.5.13",
"@iconify-json/ep": "^1.2.1",
"@iconify-json/fluent": "^1.2.8",
"@tailwindcss/typography": "^0.5.15",
"@testing-library/vue": "^8.1.0",
"@types/canvas-confetti": "^1.6.4",
"@types/markdown-it": "^14.1.1",
"@types/node": "^20.14.9",
"@types/markdown-it": "^14.1.2",
"@types/node": "^22.9.4",
"@types/three": "^0.166.0",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@vitejs/plugin-vue": "^5.0.5",
"@vitest/ui": "^1.6.0",
"@typescript-eslint/eslint-plugin": "^8.16.0",
"@typescript-eslint/parser": "^8.16.0",
"@vitejs/plugin-vue": "^5.2.0",
"@vitest/ui": "^2.1.5",
"@vue/test-utils": "^2.4.6",
"autoprefixer": "^10.4.19",
"daisyui": "^4.12.10",
"eslint": "^9.6.0",
"eslint-plugin-vue": "^9.26.0",
"autoprefixer": "^10.4.20",
"daisyui": "^4.12.14",
"eslint": "^9.15.0",
"eslint-plugin-vue": "^9.31.0",
"globals": "^15.12.0",
"happy-dom": "^14.12.3",
"husky": "^9.0.11",
"jsdom": "^24.1.0",
"happy-dom": "^15.11.6",
"husky": "^9.1.7",
"jsdom": "^25.0.1",
"path": "^0.12.7",
"postcss": "^8.4.39",
"postcss": "^8.4.49",
"rollup-plugin-visualizer": "^5.12.0",
"sass": "^1.77.6",
"sass-loader": "^14.2.1",
"tailwindcss": "^3.4.4",
"terser": "^5.31.1",
"typescript": "^5.5.3",
"unplugin-auto-import": "^0.17.6",
"unplugin-icons": "^0.19.0",
"unplugin-vue-components": "^0.27.2",
"vite": "^5.3.2",
"sass": "^1.81.0",
"sass-loader": "^16.0.3",
"tailwindcss": "^3.4.15",
"terser": "^5.36.0",
"typescript": "5.5.3",
"unplugin-auto-import": "^0.18.5",
"unplugin-icons": "^0.20.1",
"unplugin-vue-components": "^0.27.4",
"vite": "^5.4.11",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-inspect": "^0.8.4",
"vite-plugin-inspect": "^0.8.8",
"vite-plugin-svg-icons": "^2.0.1",
"vite-plugin-vue-devtools": "^7.3.5",
"vitest": "^1.6.0",
"vue-tsc": "^2.0.24"
"vite-plugin-vue-devtools": "^7.6.4",
"vitest": "^2.1.5",
"vue-tsc": "^2.1.10"
}
}

View File

@@ -3,6 +3,7 @@
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
// biome-ignore lint: disable
export {}
declare global {

View File

@@ -45,7 +45,6 @@ function addCount() {
</template>
<style scoped lang="scss">
// @import "@/style/global.scss";
.read-the-docs {
color: #888;
}

View File

@@ -233,7 +233,7 @@ watch(() => prizeList.value, (val: IPrizeConfig[]) => {
<span class="label-text">{{ t('table.image') }}</span>
</div>
<select v-model="item.picture" class="w-full max-w-xs select select-warning select-sm">
<option v-if="item.picture.id" :value="{ id: '', name: '', url: '' }"><span></span></option>
<option v-if="item.picture.id" :value="{ id: '', name: '', url: '' }"></option>
<option disabled selected>{{ t('table.selectPicture') }}</option>
<option v-for="picItem in localImageList" :key="picItem.id" :value="picItem">{{ picItem.name }}
</option>

View File

@@ -172,7 +172,7 @@ onMounted(() => {
<span class="label-text">{{ t('table.image') }}</span>
</div>
<select v-model="temporaryPrize.picture" class="flex-1 w-12 select select-warning select-sm">
<option v-if="temporaryPrize.picture.id" :value="{ id: '', name: '', url: '' }"><span></span>
<option v-if="temporaryPrize.picture.id" :value="{ id: '', name: '', url: '' }">
</option>
<option disabled selected>{{ t('table.selectPicture') }}</option>
<option v-for="picItem in localImageList" :key="picItem.id" class="w-auto" :value="picItem">{{

View File

@@ -41,104 +41,104 @@ export default defineConfig(({ mode }) => {
brotliSize: true, // 从源代码中收集 brotli 大小并将其显示在图表中
}),
createSvgIconsPlugin({
// 指定需要缓存的图标文件夹
iconDirs: [path.resolve(process.cwd(), 'src/icons')],
// 指定symbolId格式
symbolId: 'icon-[dir]-[name]',
}),
AutoImport({
resolvers: [
// 自动导入图标组件
IconsResolver({
prefix: 'Icon',
}),
createSvgIconsPlugin({
// 指定需要缓存的图标文件夹
iconDirs: [path.resolve(process.cwd(), 'src/icons')],
// 指定symbolId格式
symbolId: 'icon-[dir]-[name]',
}),
AutoImport({
resolvers: [
// 自动导入图标组件
IconsResolver({
prefix: 'Icon',
}),
],
dts: path.resolve(path.resolve(__dirname, 'src'), 'auto-imports.d.ts'),
}),
Components({
resolvers: [
// 自动注册图标组件
IconsResolver({
enabledCollections: ['ep'],
}),
],
dts: path.resolve(path.resolve(__dirname, 'src'), 'components.d.ts'),
}),
Icons({
autoInstall: true,
}),
],
dts: path.resolve(path.resolve(__dirname, 'src'), 'auto-imports.d.ts'),
}),
Components({
resolvers: [
// 自动注册图标组件
IconsResolver({
enabledCollections: ['ep'],
}),
],
dts: path.resolve(path.resolve(__dirname, 'src'), 'components.d.ts'),
}),
Icons({
autoInstall: true,
}),
],
css: {
preprocessorOptions: {
scss: {
additionalData: '@import "@/style/global.scss";',
css: {
preprocessorOptions: {
scss: {
additionalData: '@use "@/style/global.scss" as *;',
},
},
// postcss: {
// plugins: [
// require('tailwindcss'),
// require('autoprefixer'),
// ]
// }
},
},
// postcss: {
// plugins: [
// require('tailwindcss'),
// require('autoprefixer'),
// ]
// }
},
server: {
host: 'localhost',
port: 6719,
proxy: {
'/api': {
target: env.VITE_BASE_URL,
// 是否跨域
changeOrigin: true,
// 路径重写
rewrite: path => path.replace(/^\/api/, ''),
server: {
host: 'localhost',
port: 6719,
proxy: {
'/api': {
target: env.VITE_BASE_URL,
// 是否跨域
changeOrigin: true,
// 路径重写
rewrite: (path) => path.replace(/^\/api/, ''),
},
},
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
build: {
minify: 'terser',
terserOptions: {
compress: {
// 生产环境时移除console
drop_console: true,
drop_debugger: true,
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
},
// 关闭文件计算
reportCompressedSize: false,
// 关闭生成map文件 可以达到缩小打包体积
sourcemap: false, // 这个生产环境一定要关闭,不然打包的产物会很大
rollupOptions: {
output: {
chunkFileNames: `js/${chunkName}-[hash].js`, // 引入文件名的名称
entryFileNames: `js/${chunkName}-[hash].js`, // 包的入口文件名称
assetFileNames: `[ext]/${chunkName}-[hash].[ext]`, // 资源文件像 字体,图片等
manualChunks(id: any): string {
if (id.includes('node_modules')) {
return id
.toString()
.split('node_modules/')[1]
.split('/')[0]
.toString()
}
},
build: {
minify: 'terser',
terserOptions: {
compress: {
//生产环境时移除console
drop_console: true,
drop_debugger: true,
},
},
// 关闭文件计算
reportCompressedSize: false,
// 关闭生成map文件 可以达到缩小打包体积
sourcemap: false, // 这个生产环境一定要关闭,不然打包的产物会很大
rollupOptions: {
output: {
chunkFileNames: `js/${chunkName}-[hash].js`, // 引入文件名的名称
entryFileNames: `js/${chunkName}-[hash].js`, // 包的入口文件名称
assetFileNames: `[ext]/${chunkName}-[hash].[ext]`, // 资源文件像 字体,图片等
manualChunks(id: any): string {
if (id.includes('node_modules')) {
return id
.toString()
.split('node_modules/')[1]
.split('/')[0]
.toString();
}
},
},
},
},
},
},
// 使用这个必须在上面加/// <reference types="vitest" /> 不然会有类型报错
test: {
globals: true, // --> 0.8.1+ 请修改成globals
environment: 'jsdom',
// include: ['**/__tests__/**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
// passWithNoTests: true,
transformMode: {
web: [/\.[jt]sx$/],
},
},
}
})
// 使用这个必须在上面加/// <reference types="vitest" /> 不然会有类型报错
test: {
globals: true, // --> 0.8.1+ 请修改成globals
environment: 'jsdom',
// include: ['**/__tests__/**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
// passWithNoTests: true,
transformMode: {
web: [/\.[jt]sx$/],
},
},
};
});