@@ -8,7 +8,7 @@ describe('getRandomElements', () => {
|
||||
const result = getRandomElements(sourceArray, 3)
|
||||
|
||||
expect(result).toHaveLength(3)
|
||||
result.forEach((element) => {
|
||||
result.forEach((element: any) => {
|
||||
expect(sourceArray).toContain(element)
|
||||
})
|
||||
})
|
||||
@@ -65,7 +65,7 @@ describe('getRandomElements', () => {
|
||||
const result = getRandomElements(sourceArray, 2)
|
||||
|
||||
expect(result).toHaveLength(2)
|
||||
result.forEach((element) => {
|
||||
result.forEach((element: any) => {
|
||||
expect(sourceArray).toContain(element)
|
||||
})
|
||||
})
|
||||
@@ -80,7 +80,7 @@ describe('getRandomElements', () => {
|
||||
const result = getRandomElements(sourceArray, 2)
|
||||
|
||||
expect(result).toHaveLength(2)
|
||||
result.forEach((element) => {
|
||||
result.forEach((element: any) => {
|
||||
expect(sourceArray).toContain(element)
|
||||
})
|
||||
})
|
||||
@@ -110,7 +110,7 @@ describe('getRandomElements', () => {
|
||||
// 多次调用并统计元素出现的次数
|
||||
for (let i = 0; i < times; i++) {
|
||||
const result = getRandomElements(sourceArray, count)
|
||||
result.forEach((element) => {
|
||||
result.forEach((element: any) => {
|
||||
const count = elementCounts.get(element) || 0
|
||||
elementCounts.set(element, count + 1)
|
||||
})
|
||||
|
||||
Binary file not shown.
@@ -30,11 +30,10 @@ const actionsColumns = computed<any[]>(() => {
|
||||
|
||||
<template>
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table min-w-[600px]">
|
||||
<table class="table min-w-150">
|
||||
<!-- head -->
|
||||
<thead>
|
||||
<tr>
|
||||
<th />
|
||||
<th v-for="(item, index) in dataColumns" :key="index">
|
||||
{{ item.label }}
|
||||
</th>
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import { reset } from 'canvas-confetti'
|
||||
import { time } from 'zod/v4/core/regexes.cjs'
|
||||
|
||||
export const tableEn = {
|
||||
// field block name
|
||||
abilitySetting: 'Ability Setting',
|
||||
@@ -14,6 +11,7 @@ export const tableEn = {
|
||||
name: 'Name',
|
||||
prizeName: 'Name',
|
||||
department: 'Department',
|
||||
avatar: 'Avatar',
|
||||
identity: 'Identity',
|
||||
isLucky: 'Is Lucky',
|
||||
operation: 'Operation',
|
||||
@@ -65,6 +63,7 @@ export const tableZhCn = {
|
||||
name: '姓名',
|
||||
prizeName: '名称',
|
||||
department: '部门',
|
||||
avatar: '头像',
|
||||
identity: '身份',
|
||||
isLucky: '是否中奖',
|
||||
operation: '操作',
|
||||
|
||||
@@ -14,29 +14,29 @@ const singlePersonData = defineModel<any>('singlePersonData', { required: true }
|
||||
<form class="fieldset rounded-box w-xs p-4" @submit="(e) => addOnePerson(addOnePersonDrawerRef, e)">
|
||||
<label class="fieldset">
|
||||
<span class="label">{{ t('table.number') }}</span>
|
||||
<input v-model="singlePersonData.uid" type="text" class="input validator" :placeholder="t('placeHolder.number')">
|
||||
<input v-model="singlePersonData.uid" type="text" class="input validator" :placeholder="t('table.number')">
|
||||
</label>
|
||||
<fieldset class="fieldset">
|
||||
<label class="label" required>{{ t('table.name') }}<span class="text-red-500">*</span></label>
|
||||
<input v-model="singlePersonData.name" type="text" class="input validator" :placeholder="t('placeHolder.name')" required minlength="1">
|
||||
<input v-model="singlePersonData.name" type="text" class="input validator" :placeholder="t('table.name')" required minlength="1">
|
||||
<p class="validator-hint hidden">
|
||||
{{ t('error.personNameEmpty') }}
|
||||
</p>
|
||||
</fieldset>
|
||||
<label class="fieldset">
|
||||
<span class="label">{{ t('table.department') }}</span>
|
||||
<input v-model="singlePersonData.department" type="text" class="input validator" :placeholder="t('placeHolder.department')">
|
||||
<input v-model="singlePersonData.department" type="text" class="input validator" :placeholder="t('table.department')">
|
||||
</label>
|
||||
<label class="fieldset">
|
||||
<span class="label">{{ t('table.avatar') }}</span>
|
||||
<input v-model="singlePersonData.avatar" type="text" class="input validator" :placeholder="t('placeHolder.avatar')">
|
||||
<input v-model="singlePersonData.avatar" type="text" class="input validator" :placeholder="t('table.avatar')">
|
||||
</label>
|
||||
<label class="fieldset">
|
||||
<span class="label">{{ t('table.identity') }}</span>
|
||||
<input v-model="singlePersonData.identity" type="text" class="input validator" :placeholder="t('placeHolder.identity')">
|
||||
<input v-model="singlePersonData.identity" type="text" class="input validator" :placeholder="t('table.identity')">
|
||||
</label>
|
||||
<button class="btn btn-neutral mt-4" type="submit">
|
||||
{{ t('button.submit') }}
|
||||
{{ t('button.confirm') }}
|
||||
</button>
|
||||
<button class="btn btn-ghost mt-1" type="reset" @click="addOnePersonDrawerRef.closeDrawer()">
|
||||
{{ t('button.cancel') }}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import * as XLSX from 'xlsx'
|
||||
import i18n from '@/locales/i18n'
|
||||
import { addOtherInfo } from '@/utils'
|
||||
// 定义消息类型
|
||||
interface WorkerMessage {
|
||||
|
||||
Reference in New Issue
Block a user