generated from VLADIMIR/template_frontend
fix
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import BeltBlock from './BeltBlock.vue';
|
||||
import MetalPlate from './MetalPlate.vue';
|
||||
import HeaderText from './HeaderText.vue';
|
||||
import { ref, type PropType } from 'vue';
|
||||
|
||||
import { Footsteps } from '@vicons/ionicons5'
|
||||
import { ContactMailRound } from '@vicons/material'
|
||||
import { Icon } from '@vicons/utils'
|
||||
import { type PropType,ref } from 'vue';
|
||||
|
||||
import BeltBlock from './BeltBlock.vue';
|
||||
import HeaderText from './HeaderText.vue';
|
||||
import MetalPlate from './MetalPlate.vue';
|
||||
|
||||
const code = ref('')
|
||||
|
||||
|
||||
@@ -1,16 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import { Settings, Play, Pause, Reset, Flag } from '@vicons/carbon'
|
||||
import { getAuthClient } from '@/api/auth_client';
|
||||
import { Flag, Pause, Play, Reset, Settings } from '@vicons/carbon'
|
||||
import { Icon } from '@vicons/utils'
|
||||
import { NButton, NTag } from 'naive-ui'
|
||||
import type { Application, Game, Team } from '@/api/generated/crabs/evening_detective_server';
|
||||
import { NCard, NInput, NModal, NSpace, NFlex, NText, NQrCode } from 'naive-ui'
|
||||
import HeaderMenu from '@/components/HeaderMenu.vue'
|
||||
import { NCard, NFlex, NInput, NModal, NQrCode, NSpace, NText } from 'naive-ui'
|
||||
import { useMessage } from 'naive-ui';
|
||||
import { ref } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
import { getAuthClient } from '@/api/auth_client';
|
||||
import type { Application, Game, Team } from '@/api/generated/crabs/evening_detective_server';
|
||||
import { getURL } from '@/api/generated/crabs/evening_detective_server/client';
|
||||
import HeaderMenu from '@/components/HeaderMenu.vue'
|
||||
import { useSimplePolling } from '@/composables/useSimplePolling';
|
||||
|
||||
const client = getAuthClient()
|
||||
@@ -237,11 +238,11 @@ async function finishGame() {
|
||||
|
||||
function parseDateWithoutTimezone(dateStr: string): Date {
|
||||
// Разбираем ISO строку: "2024-01-01T12:30:00"
|
||||
let [datePart, timePart] = dateStr.split('T');
|
||||
const [datePart, timePart] = dateStr.split('T');
|
||||
const [year, month, day] = datePart.split('-').map(Number);
|
||||
|
||||
timePart = timePart.split('.')[0]
|
||||
const [hours, minutes, seconds] = (timePart || '00:00:00').split(':').map(Number);
|
||||
const correctTimePart = timePart.split('.')[0]
|
||||
const [hours, minutes, seconds] = (correctTimePart || '00:00:00').split(':').map(Number);
|
||||
|
||||
// Создаем дату в UTC, чтобы избежать сдвига
|
||||
return new Date(Date.UTC(year, month - 1, day, hours, minutes, seconds || 0));
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { getAuthClient } from '@/api/auth_client';
|
||||
import type { Game } from '@/api/generated/crabs/evening_detective_server';
|
||||
import HeaderMenu from '@/components/HeaderMenu.vue'
|
||||
import { useMessage } from 'naive-ui';
|
||||
import { ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
import { getAuthClient } from '@/api/auth_client';
|
||||
import type { Game } from '@/api/generated/crabs/evening_detective_server';
|
||||
import HeaderMenu from '@/components/HeaderMenu.vue'
|
||||
|
||||
const client = getAuthClient()
|
||||
const message = useMessage()
|
||||
const router = useRouter()
|
||||
@@ -31,7 +32,7 @@ async function toGame(id: number) {
|
||||
<template>
|
||||
<div class="center-block-custom">
|
||||
<div class="width1200">
|
||||
<div v-for="game in games" class="game-block" @click="toGame(game.id!)">
|
||||
<div v-for="game in games" :key="game.id" class="game-block" @click="toGame(game.id!)">
|
||||
<div class="game-title">
|
||||
{{ game.name }}
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { NAlert } from 'naive-ui'
|
||||
import { ref } from 'vue'
|
||||
import { NCard, NFlex, NInput, NModal, NSpace, NText, NUpload, NUploadDragger, NAlert, NTag } from 'naive-ui'
|
||||
|
||||
import { getAuthClient } from '@/api/auth_client'
|
||||
import HeaderMenu from '@/components/HeaderMenu.vue'
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import { Key24Regular } from '@vicons/fluent'
|
||||
import { LockOutlined } from '@vicons/material'
|
||||
import MessagePaper from './MessagePaper.vue';
|
||||
import { Icon } from '@vicons/utils'
|
||||
import { NButton, NDynamicInput, NInput, NInputGroup, NSpace, NSwitch, NText, NUpload, NUploadDragger } from 'naive-ui'
|
||||
import type { PropType } from 'vue'
|
||||
|
||||
import type { Application, Door, Key, Place } from '@/api/generated/crabs/evening_detective_server'
|
||||
|
||||
import MessagePaper from './MessagePaper.vue';
|
||||
|
||||
const props = defineProps({
|
||||
newPlaceCode: {
|
||||
type: String,
|
||||
@@ -105,7 +106,7 @@ function onCreateKey(): Key {
|
||||
</div>
|
||||
|
||||
<div v-for="door in props.place?.doors" v-bind:key="door.code" class="door-block">
|
||||
{{ door.name }} <span v-for="key in door.keys" class="key-block">
|
||||
{{ door.name }} <span v-for="key in door.keys" :key="key.name" class="key-block">
|
||||
<Icon class="lock-icon">
|
||||
<LockOutlined />
|
||||
</Icon> {{ key.name }}
|
||||
@@ -172,22 +173,22 @@ function onCreateKey(): Key {
|
||||
<div v-if="mode == 'edit'" class="place-block">
|
||||
<n-space vertical>
|
||||
<n-input-group>
|
||||
<n-input :style="{ width: '20%' }" v-model:value="props.place.code" type="text" placeholder="Ы-1" />
|
||||
<n-input :style="{ width: '80%' }" v-model:value="props.place.name" type="text" placeholder="Дом №Ы" />
|
||||
<n-input :style="{ width: '20%' }" v-model:value="props.place!.code" type="text" placeholder="Ы-1" />
|
||||
<n-input :style="{ width: '80%' }" v-model:value="props.place!.name" type="text" placeholder="Дом №Ы" />
|
||||
</n-input-group>
|
||||
<n-input v-model:value="props.place.text" type="textarea" :autosize="{ minRows: 3 }"
|
||||
<n-input v-model:value="props.place!.text" type="textarea" :autosize="{ minRows: 3 }"
|
||||
placeholder="В начале было слово..." />
|
||||
|
||||
<p class="settings-header">Картинка</p>
|
||||
<div>
|
||||
<n-space>
|
||||
<n-space vertical>
|
||||
<img :src="props.place.image" class="message-edit-image">
|
||||
<n-button @click="props.place.image = '', props.place.fileList = null">Убрать картинку</n-button>
|
||||
<img :src="props.place!.image" class="message-edit-image">
|
||||
<n-button @click="props.place!.image = '', props.place!.fileList = null">Убрать картинку</n-button>
|
||||
</n-space>
|
||||
<n-space vertical>
|
||||
<n-input v-model:value="props.place.image" type="text" placeholder="Не задано" disabled />
|
||||
<n-upload directory-dnd :max="1" v-model:file-list="props.place.fileList">
|
||||
<n-input v-model:value="props.place!.image" type="text" placeholder="Не задано" disabled />
|
||||
<n-upload directory-dnd :max="1" v-model:file-list="props.place!.fileList">
|
||||
<n-upload-dragger>
|
||||
<n-text style="font-size: 16px">
|
||||
Щелкните или перетащите файл в эту область для загрузки
|
||||
@@ -199,7 +200,7 @@ function onCreateKey(): Key {
|
||||
</div>
|
||||
|
||||
<p class="settings-header">Видимость точки</p>
|
||||
<n-switch v-model:value="props.place.hidden">
|
||||
<n-switch v-model:value="props.place!.hidden">
|
||||
<template #checked>
|
||||
Скрытая точка
|
||||
</template>
|
||||
@@ -209,7 +210,7 @@ function onCreateKey(): Key {
|
||||
</n-switch>
|
||||
|
||||
Улики
|
||||
<n-dynamic-input v-model:value="props.place.applications" :on-create="onCreateApplication">
|
||||
<n-dynamic-input v-model:value="props.place!.applications" :on-create="onCreateApplication">
|
||||
<template #create-button-default> Добавить улику </template>
|
||||
<template #default="{ value }">
|
||||
<div style="display: flex; align-items: center; width: 100%">
|
||||
@@ -219,7 +220,7 @@ function onCreateKey(): Key {
|
||||
</n-dynamic-input>
|
||||
|
||||
Действия
|
||||
<n-dynamic-input v-model:value="props.place.doors" :on-create="onCreateDoor">
|
||||
<n-dynamic-input v-model:value="props.place!.doors" :on-create="onCreateDoor">
|
||||
<template #create-button-default> Добавить действие </template>
|
||||
<template #action="{ index, create, remove }">
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
@@ -254,7 +255,7 @@ function onCreateKey(): Key {
|
||||
</n-dynamic-input>
|
||||
|
||||
Получаемые ключи
|
||||
<n-dynamic-input v-model:value="props.place.keys" :on-create="onCreateKey">
|
||||
<n-dynamic-input v-model:value="props.place!.keys" :on-create="onCreateKey">
|
||||
<template #create-button-default> Добавить ключ </template>
|
||||
<template #default="{ value: key }">
|
||||
<div style="display: flex; align-items: center; width: 100%">
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
<script setup lang="ts">
|
||||
import { useMessage } from 'naive-ui'
|
||||
import { NTag } from 'naive-ui'
|
||||
import { ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
import { getAuthClient } from '@/api/auth_client'
|
||||
import type { Scenario } from '@/api/generated/crabs/evening_detective_server'
|
||||
import HeaderMenu from '@/components/HeaderMenu.vue'
|
||||
import { useMessage } from 'naive-ui'
|
||||
import { ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { NTag } from 'naive-ui'
|
||||
|
||||
const message = useMessage()
|
||||
const client = getAuthClient()
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { Settings } from '@vicons/carbon'
|
||||
import { Icon } from '@vicons/utils'
|
||||
import { NButton, type UploadFileInfo, useMessage } from 'naive-ui'
|
||||
import { NCard, NFlex, NInput, NModal, NSpace, NText, NUpload, NUploadDragger, NAlert, NTag } from 'naive-ui'
|
||||
import { NAlert, NCard, NFlex, NInput, NModal, NSpace, NTag,NText, NUpload, NUploadDragger } from 'naive-ui'
|
||||
import { ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { useMessage } from 'naive-ui'
|
||||
import { NButton, NCard, NInput, NModal, NTag, NFlex } from 'naive-ui'
|
||||
import { NButton, NCard, NFlex,NInput, NModal, NTag } from 'naive-ui'
|
||||
import { ref } from 'vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
<script setup lang="ts">
|
||||
import { getAuthClient } from '@/api/auth_client';
|
||||
import type { Game, Place, Story } from '@/api/generated/crabs/evening_detective_server';
|
||||
import HeaderMenu from '@/components/HeaderMenu.vue'
|
||||
import { NCard, NFlex, NInput, NModal, NSpace, NText, NUpload, NUploadDragger, NAlert, NTag, NButton } from 'naive-ui'
|
||||
import { NButton, NFlex } from 'naive-ui'
|
||||
import { useMessage } from 'naive-ui';
|
||||
import { nextTick, onMounted, ref } from 'vue';
|
||||
import { nextTick, ref } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import PlaceBlock from '@/components/PlaceBlock.vue'
|
||||
|
||||
import { getAuthClient } from '@/api/auth_client';
|
||||
import type { Game, Place } from '@/api/generated/crabs/evening_detective_server';
|
||||
import GameInputForm from '@/components/GameInputForm.vue'
|
||||
import HeaderMenu from '@/components/HeaderMenu.vue'
|
||||
import PlaceBlock from '@/components/PlaceBlock.vue'
|
||||
import { useSimplePolling } from '@/composables/useSimplePolling';
|
||||
import { useAuthStore } from '@/stores/auth';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user