Merge branch 'dev' into feature_person_limit
This commit is contained in:
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
. "$(dirname "$0")/h"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
. "$(dirname "$0")/h"
|
|
||||||
22
.husky/_/h
22
.husky/_/h
@@ -1,22 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
[ "$HUSKY" = "2" ] && set -x
|
|
||||||
n=$(basename "$0")
|
|
||||||
s=$(dirname "$(dirname "$0")")/$n
|
|
||||||
|
|
||||||
[ ! -f "$s" ] && exit 0
|
|
||||||
|
|
||||||
if [ -f "$HOME/.huskyrc" ]; then
|
|
||||||
echo "husky - '~/.huskyrc' is DEPRECATED, please move your code to ~/.config/husky/init.sh"
|
|
||||||
fi
|
|
||||||
i="${XDG_CONFIG_HOME:-$HOME/.config}/husky/init.sh"
|
|
||||||
[ -f "$i" ] && . "$i"
|
|
||||||
|
|
||||||
[ "${HUSKY-}" = "0" ] && exit 0
|
|
||||||
|
|
||||||
export PATH="node_modules/.bin:$PATH"
|
|
||||||
sh -e "$s" "$@"
|
|
||||||
c=$?
|
|
||||||
|
|
||||||
[ $c != 0 ] && echo "husky - $n script failed (code $c)"
|
|
||||||
[ $c = 127 ] && echo "husky - command not found in PATH=$PATH"
|
|
||||||
exit $c
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
echo "husky - DEPRECATED
|
|
||||||
|
|
||||||
Please remove the following two lines from $0:
|
|
||||||
|
|
||||||
#!/usr/bin/env sh
|
|
||||||
. \"\$(dirname -- \"\$0\")/_/husky.sh\"
|
|
||||||
|
|
||||||
They WILL FAIL in v10.0.0
|
|
||||||
"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
. "$(dirname "$0")/h"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
. "$(dirname "$0")/h"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
. "$(dirname "$0")/h"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
. "$(dirname "$0")/h"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
. "$(dirname "$0")/h"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
. "$(dirname "$0")/h"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
. "$(dirname "$0")/h"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
. "$(dirname "$0")/h"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
. "$(dirname "$0")/h"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
. "$(dirname "$0")/h"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
. "$(dirname "$0")/h"
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
#!/usr/bin/env sh
|
|
||||||
. "$(dirname "$0")/h"
|
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
<script setup lang='ts'>
|
<script setup lang='ts'>
|
||||||
import type { Separate } from '@/types/storeType'
|
import type { Separate } from '@/types/storeType'
|
||||||
import { onMounted, ref, toRefs, watch } from 'vue'
|
import { useVirtualList } from '@vueuse/core'
|
||||||
|
import { computed, onMounted, ref, toRefs, watch } from 'vue'
|
||||||
import { useI18n } from 'vue-i18n'
|
import { useI18n } from 'vue-i18n'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@@ -18,6 +19,27 @@ const { t } = useI18n()
|
|||||||
const separatedNumberRef = ref()
|
const separatedNumberRef = ref()
|
||||||
const { separatedNumber, totalNumber } = toRefs(props)
|
const { separatedNumber, totalNumber } = toRefs(props)
|
||||||
const scaleList = ref<number[]>([])
|
const scaleList = ref<number[]>([])
|
||||||
|
|
||||||
|
const ITEMS_PER_ROW = 10
|
||||||
|
const ROW_HEIGHT = 52
|
||||||
|
|
||||||
|
// Group numbers into rows for virtual list
|
||||||
|
const rows = computed(() => {
|
||||||
|
const result: number[][] = []
|
||||||
|
for (let i = 0; i < props.totalNumber; i += ITEMS_PER_ROW) {
|
||||||
|
const row: number[] = []
|
||||||
|
for (let j = i; j < Math.min(i + ITEMS_PER_ROW, props.totalNumber); j++) {
|
||||||
|
row.push(j + 1)
|
||||||
|
}
|
||||||
|
result.push(row)
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
})
|
||||||
|
|
||||||
|
const { list, containerProps, wrapperProps } = useVirtualList(rows, {
|
||||||
|
itemHeight: ROW_HEIGHT,
|
||||||
|
})
|
||||||
|
|
||||||
function editScale(item: number) {
|
function editScale(item: number) {
|
||||||
if (item === totalNumber.value) {
|
if (item === totalNumber.value) {
|
||||||
return
|
return
|
||||||
@@ -73,30 +95,40 @@ onMounted(() => {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<dialog id="my_modal_1" ref="separatedNumberRef" class="z-50 overflow-hidden border-none modal">
|
<dialog id="my_modal_1" ref="separatedNumberRef" class="z-50 overflow-hidden border-none modal">
|
||||||
<div class="overflow-hidden modal-box">
|
<div class="overflow-hidden modal-box max-h-[70vh] flex flex-col">
|
||||||
<h3 class="pb-6 text-lg font-bold">
|
<h3 class="pb-4 text-lg font-bold shrink-0">
|
||||||
{{ t('dialog.titleTip') }}
|
{{ t('dialog.titleTip') }}
|
||||||
</h3>
|
</h3>
|
||||||
<p class="pb-8">
|
<p class="pb-4 shrink-0">
|
||||||
{{ t('dialog.dialogSingleDrawLimit') }}
|
{{ t('dialog.dialogSingleDrawLimit') }}
|
||||||
</p>
|
</p>
|
||||||
<div class="flex justify-between px-3 text-center separated-number">
|
<!-- Virtual scrolling container -->
|
||||||
<div
|
<div
|
||||||
v-for="item in props.totalNumber" :key="item"
|
v-bind="containerProps"
|
||||||
class="relative flex flex-col items-center cursor-pointer"
|
class="flex-1 min-h-0 px-3 overflow-y-auto"
|
||||||
|
style="max-height: calc(70vh - 180px);"
|
||||||
|
>
|
||||||
|
<div v-bind="wrapperProps">
|
||||||
|
<div
|
||||||
|
v-for="{ data: row, index } in list"
|
||||||
|
:key="index"
|
||||||
|
class="grid grid-cols-10 gap-1 text-center pb-2"
|
||||||
|
:style="{ height: `${ROW_HEIGHT}px` }"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="absolute mb-12 text-center tooltip -top-5 hover:text-lg" :data-tip="t('tooltip.leftClick')"
|
v-for="item in row"
|
||||||
|
:key="item"
|
||||||
|
class="flex flex-col items-center justify-start cursor-pointer rounded hover:bg-base-200 transition-colors pt-1"
|
||||||
|
:data-tip="t('tooltip.leftClick')"
|
||||||
@click.left="editScale(item)"
|
@click.left="editScale(item)"
|
||||||
>
|
>
|
||||||
<span>{{ item }}</span>
|
<span>{{ item }}</span>
|
||||||
</div>
|
<span :class="scaleList.includes(item) ? 'text-red-500 font-extrabold' : ''" class="leading-none">|</span>
|
||||||
<div class="text-center" :class="scaleList.includes(item) ? 'text-red-500 font-extrabold' : ''">
|
|
||||||
|
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-action">
|
</div>
|
||||||
|
<div class="modal-action shrink-0">
|
||||||
<form method="dialog">
|
<form method="dialog">
|
||||||
<!-- if there is a button in form, it will close the modal -->
|
<!-- if there is a button in form, it will close the modal -->
|
||||||
<button class="btn" @click="clearData">
|
<button class="btn" @click="clearData">
|
||||||
|
|||||||
Reference in New Issue
Block a user