Skip to content

Commit 56bf832

Browse files
authored
Merge pull request #153 from LOG1997/dev
Dev
2 parents dafb736 + f37412b commit 56bf832

File tree

5 files changed

+149
-152
lines changed

5 files changed

+149
-152
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ or
3030
<https://log1997.github.io/log-lottery/>
3131

3232
开发仓促,若以上网站内容存在bug还请宽容。
33-
如果想要访问2025年12月31日前的版本,请前往:<https://lottery.to2026.xyz/log-lottery>
33+
如果想要访问2025年12月31日前的版本,请前往:<https://to2026.xyz/log-lottery>
3434

3535
## TODO
3636

src/components/DaiysuiTable/index.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,10 @@ const actionsColumns = computed<any[]>(() => {
3030

3131
<template>
3232
<div class="overflow-x-auto">
33-
<table class="table min-w-[600px]">
33+
<table class="table min-w-150">
3434
<!-- head -->
3535
<thead>
3636
<tr>
37-
<th />
3837
<th v-for="(item, index) in dataColumns" :key="index">
3938
{{ item.label }}
4039
</th>

src/locales/modules/table.ts

Lines changed: 100 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,108 @@
1-
import { reset } from 'canvas-confetti'
2-
import { time } from 'zod/v4/core/regexes.cjs'
3-
41
export const tableEn = {
5-
// field block name
6-
abilitySetting: 'Ability Setting',
7-
dataSetting: 'Data Setting',
8-
layoutSetting: 'Layout Setting',
9-
patternSetting: 'Pattern Setting',
10-
textSetting: 'Text Setting',
11-
themeSetting: 'Theme Setting',
12-
// person configuration
13-
number: 'Number',
14-
name: 'Name',
15-
prizeName: 'Name',
16-
department: 'Department',
17-
identity: 'Identity',
18-
isLucky: 'Is Lucky',
19-
operation: 'Operation',
20-
setLuckyNumber: 'Set Lucky Number',
21-
luckyPeopleNumber: 'Lucky People Number',
22-
detail: 'Detail',
23-
noneData: 'No Data',
24-
// prize configuration
25-
fullParticipation: 'FullParticipation',
26-
numberParticipants: 'NumberParticipants',
27-
isDone: 'is Done',
28-
image: 'Image',
29-
onceNumber: 'Once Number',
30-
time: 'Time',
31-
// view setting
32-
title: 'Main Title',
33-
columnNumber: 'Column Number',
34-
theme: 'Theme',
35-
language: 'Language',
36-
cardColor: 'Card Color',
37-
winnerColor: 'Winner Color',
38-
textColor: 'Text Color',
39-
cardWidth: 'Card Width',
40-
cardHeight: 'Card Height',
41-
textSize: 'Text Size',
42-
highlightColor: 'HighLight Color',
43-
alwaysDisplay: 'Always Display Prize List',
44-
avatarDisplay: 'Show avatars or not',
45-
selectPicture: 'Select a Picture',
46-
backgroundImage: 'Select Background Image',
47-
timedStop: 'Timed Stop',
48-
playWinMusic: 'Play Win Music',
49-
resetAllData: 'Reset All Data',
50-
globalFont: 'Global Font',
51-
titleFont: 'Title Font',
52-
syncGlobalFont: 'Sync Global Font',
2+
// field block name
3+
abilitySetting: 'Ability Setting',
4+
dataSetting: 'Data Setting',
5+
layoutSetting: 'Layout Setting',
6+
patternSetting: 'Pattern Setting',
7+
textSetting: 'Text Setting',
8+
themeSetting: 'Theme Setting',
9+
// person configuration
10+
number: 'Number',
11+
name: 'Name',
12+
prizeName: 'Name',
13+
department: 'Department',
14+
avatar: 'Avatar',
15+
identity: 'Identity',
16+
isLucky: 'Is Lucky',
17+
operation: 'Operation',
18+
setLuckyNumber: 'Set Lucky Number',
19+
luckyPeopleNumber: 'Lucky People Number',
20+
detail: 'Detail',
21+
noneData: 'No Data',
22+
// prize configuration
23+
fullParticipation: 'FullParticipation',
24+
numberParticipants: 'NumberParticipants',
25+
isDone: 'is Done',
26+
image: 'Image',
27+
onceNumber: 'Once Number',
28+
time: 'Time',
29+
// view setting
30+
title: 'Main Title',
31+
columnNumber: 'Column Number',
32+
theme: 'Theme',
33+
language: 'Language',
34+
cardColor: 'Card Color',
35+
winnerColor: 'Winner Color',
36+
textColor: 'Text Color',
37+
cardWidth: 'Card Width',
38+
cardHeight: 'Card Height',
39+
textSize: 'Text Size',
40+
highlightColor: 'HighLight Color',
41+
alwaysDisplay: 'Always Display Prize List',
42+
avatarDisplay: 'Show avatars or not',
43+
selectPicture: 'Select a Picture',
44+
backgroundImage: 'Select Background Image',
45+
timedStop: 'Timed Stop',
46+
playWinMusic: 'Play Win Music',
47+
resetAllData: 'Reset All Data',
48+
globalFont: 'Global Font',
49+
titleFont: 'Title Font',
50+
syncGlobalFont: 'Sync Global Font',
5351
}
5452

5553
export const tableZhCn = {
56-
// field block name
57-
abilitySetting: '功能设置',
58-
dataSetting: '数据设置',
59-
layoutSetting: '布局设置',
60-
patternSetting: '图案设置',
61-
textSetting: '文字设置',
62-
themeSetting: '主题设置',
63-
// person configuration
64-
number: '编号',
65-
name: '姓名',
66-
prizeName: '名称',
67-
department: '部门',
68-
identity: '身份',
69-
isLucky: '是否中奖',
70-
operation: '操作',
71-
setLuckyNumber: '设置中奖人数',
72-
luckyPeopleNumber: '中奖人数',
73-
detail: '详细信息',
74-
noneData: '暂无数据',
75-
// prize configuration
76-
fullParticipation: '可重复',
77-
numberParticipants: '抽奖人数',
78-
isDone: '已抽取',
79-
image: '图片',
80-
onceNumber: '单次抽取个数',
81-
time: '时间',
82-
// view setting
83-
title: '主标题',
84-
columnNumber: '列数',
85-
theme: '主题',
86-
language: '语言',
87-
cardColor: '卡片颜色',
88-
winnerColor: '中奖卡片颜色',
89-
textColor: '文字颜色',
90-
cardWidth: '卡片宽度',
91-
cardHeight: '卡片高度',
92-
textSize: '文字大小',
93-
highlightColor: '高亮颜色',
94-
alwaysDisplay: '常显奖项列表',
95-
avatarDisplay: '是否显示头像',
96-
selectPicture: '选择一张图片',
97-
backgroundImage: '选择背景图片',
98-
timedStop: '定时停止',
99-
playWinMusic: '播放中奖音乐',
100-
resetAllData: '重置数据',
101-
globalFont: '全局字体',
102-
titleFont: '标题字体',
103-
syncGlobalFont: '同步全局字体',
54+
// field block name
55+
abilitySetting: '功能设置',
56+
dataSetting: '数据设置',
57+
layoutSetting: '布局设置',
58+
patternSetting: '图案设置',
59+
textSetting: '文字设置',
60+
themeSetting: '主题设置',
61+
// person configuration
62+
number: '编号',
63+
name: '姓名',
64+
prizeName: '名称',
65+
department: '部门',
66+
avatar: '头像',
67+
identity: '身份',
68+
isLucky: '是否中奖',
69+
operation: '操作',
70+
setLuckyNumber: '设置中奖人数',
71+
luckyPeopleNumber: '中奖人数',
72+
detail: '详细信息',
73+
noneData: '暂无数据',
74+
// prize configuration
75+
fullParticipation: '可重复',
76+
numberParticipants: '抽奖人数',
77+
isDone: '已抽取',
78+
image: '图片',
79+
onceNumber: '单次抽取个数',
80+
time: '时间',
81+
// view setting
82+
title: '主标题',
83+
columnNumber: '列数',
84+
theme: '主题',
85+
language: '语言',
86+
cardColor: '卡片颜色',
87+
winnerColor: '中奖卡片颜色',
88+
textColor: '文字颜色',
89+
cardWidth: '卡片宽度',
90+
cardHeight: '卡片高度',
91+
textSize: '文字大小',
92+
highlightColor: '高亮颜色',
93+
alwaysDisplay: '常显奖项列表',
94+
avatarDisplay: '是否显示头像',
95+
selectPicture: '选择一张图片',
96+
backgroundImage: '选择背景图片',
97+
timedStop: '定时停止',
98+
playWinMusic: '播放中奖音乐',
99+
resetAllData: '重置数据',
100+
globalFont: '全局字体',
101+
titleFont: '标题字体',
102+
syncGlobalFont: '同步全局字体',
104103
}
105104

106105
export const table = {
107-
en: tableEn,
108-
zhCn: tableZhCn,
106+
en: tableEn,
107+
zhCn: tableZhCn,
109108
}

src/views/Config/Person/PersonAll/components/SinglePerson.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@ const singlePersonData = defineModel<any>('singlePersonData', { required: true }
1414
<form class="fieldset rounded-box w-xs p-4" @submit="(e) => addOnePerson(addOnePersonDrawerRef, e)">
1515
<label class="fieldset">
1616
<span class="label">{{ t('table.number') }}</span>
17-
<input v-model="singlePersonData.uid" type="text" class="input validator" :placeholder="t('placeHolder.number')">
17+
<input v-model="singlePersonData.uid" type="text" class="input validator" :placeholder="t('table.number')">
1818
</label>
1919
<fieldset class="fieldset">
2020
<label class="label" required>{{ t('table.name') }}<span class="text-red-500">*</span></label>
21-
<input v-model="singlePersonData.name" type="text" class="input validator" :placeholder="t('placeHolder.name')" required minlength="1">
21+
<input v-model="singlePersonData.name" type="text" class="input validator" :placeholder="t('table.name')" required minlength="1">
2222
<p class="validator-hint hidden">
2323
{{ t('error.personNameEmpty') }}
2424
</p>
2525
</fieldset>
2626
<label class="fieldset">
2727
<span class="label">{{ t('table.department') }}</span>
28-
<input v-model="singlePersonData.department" type="text" class="input validator" :placeholder="t('placeHolder.department')">
28+
<input v-model="singlePersonData.department" type="text" class="input validator" :placeholder="t('table.department')">
2929
</label>
3030
<label class="fieldset">
3131
<span class="label">{{ t('table.avatar') }}</span>
32-
<input v-model="singlePersonData.avatar" type="text" class="input validator" :placeholder="t('placeHolder.avatar')">
32+
<input v-model="singlePersonData.avatar" type="text" class="input validator" :placeholder="t('table.avatar')">
3333
</label>
3434
<label class="fieldset">
3535
<span class="label">{{ t('table.identity') }}</span>
36-
<input v-model="singlePersonData.identity" type="text" class="input validator" :placeholder="t('placeHolder.identity')">
36+
<input v-model="singlePersonData.identity" type="text" class="input validator" :placeholder="t('table.identity')">
3737
</label>
3838
<button class="btn btn-neutral mt-4" type="submit">
39-
{{ t('button.submit') }}
39+
{{ t('button.confirm') }}
4040
</button>
4141
<button class="btn btn-ghost mt-1" type="reset" @click="addOnePersonDrawerRef.closeDrawer()">
4242
{{ t('button.cancel') }}
Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,59 @@
11
import * as XLSX from 'xlsx'
2-
import i18n from '@/locales/i18n'
32
import { addOtherInfo } from '@/utils'
43
// 定义消息类型
54
interface WorkerMessage {
6-
type: 'start' | 'stop' | 'reset'
7-
data: any
8-
templateData: any
5+
type: 'start' | 'stop' | 'reset'
6+
data: any
7+
templateData: any
98
}
109

1110
let allData: any[] = []
1211

1312
function headersEqual(template: string[], actual: string[]): boolean {
14-
return template.length >= actual.length
15-
&& actual.some(item => template.includes(item))
13+
return template.length >= actual.length
14+
&& actual.some(item => template.includes(item))
1615
}
1716
// 接收主线程消息
1817
globalThis.onmessage = async (e: MessageEvent<WorkerMessage>) => {
19-
switch (e.data.type) {
20-
case 'start':
21-
{
22-
const fileData = e.data.data
23-
const templateData = e.data.templateData
18+
switch (e.data.type) {
19+
case 'start':
20+
{
21+
const fileData = e.data.data
22+
const templateData = e.data.templateData
2423

25-
const workBook = XLSX.read(fileData, { type: 'binary', cellDates: true })
26-
const workSheet = workBook.Sheets[workBook.SheetNames[0]]
27-
const excelData: object[] = XLSX.utils.sheet_to_json(workSheet)
24+
const workBook = XLSX.read(fileData, { type: 'binary', cellDates: true })
25+
const workSheet = workBook.Sheets[workBook.SheetNames[0]]
26+
const excelData: object[] = XLSX.utils.sheet_to_json(workSheet)
2827

29-
const templateWorkBook = XLSX.read(templateData, { type: 'array', cellDates: true })
30-
const templateWorkSheet = templateWorkBook.Sheets[templateWorkBook.SheetNames[0]]
31-
const templateExcelData: object[] = XLSX.utils.sheet_to_json(templateWorkSheet)
28+
const templateWorkBook = XLSX.read(templateData, { type: 'array', cellDates: true })
29+
const templateWorkSheet = templateWorkBook.Sheets[templateWorkBook.SheetNames[0]]
30+
const templateExcelData: object[] = XLSX.utils.sheet_to_json(templateWorkSheet)
3231

33-
const templateHeader = Object.keys(templateExcelData[0])
34-
const header = Object.keys(excelData[0])
32+
const templateHeader = Object.keys(templateExcelData[0])
33+
const header = Object.keys(excelData[0])
3534

36-
if (!headersEqual(templateHeader, header)) {
37-
globalThis.postMessage({
38-
type: 'error',
39-
data: null,
40-
message: 'not right template',
41-
})
42-
return
43-
}
44-
allData = addOtherInfo(excelData)
45-
globalThis.postMessage({
46-
type: 'done',
47-
data: allData,
48-
message: '读取完成',
49-
})
50-
break
35+
if (!headersEqual(templateHeader, header)) {
36+
globalThis.postMessage({
37+
type: 'error',
38+
data: null,
39+
message: 'not right template',
40+
})
41+
return
42+
}
43+
allData = addOtherInfo(excelData)
44+
globalThis.postMessage({
45+
type: 'done',
46+
data: allData,
47+
message: '读取完成',
48+
})
49+
break
50+
}
51+
default:
52+
globalThis.postMessage({
53+
type: 'fail',
54+
data: null,
55+
message: '读取失败',
56+
})
57+
break
5158
}
52-
default:
53-
globalThis.postMessage({
54-
type: 'fail',
55-
data: null,
56-
message: '读取失败',
57-
})
58-
break
59-
}
6059
}

0 commit comments

Comments
 (0)