[폴더, 파일 구조 정리]
This commit is contained in:
@@ -1,50 +1,50 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, defineExpose } from 'vue';
|
||||
import type { OptColumn, OptRow } from 'tui-grid/types/options';
|
||||
import type { TuiGridElement } from 'vue3-tui-grid';
|
||||
import type Grid from 'tui-grid';
|
||||
|
||||
interface TreeColumnOptions {
|
||||
name: string;
|
||||
useCascadingCheckbox?: boolean;
|
||||
}
|
||||
|
||||
const tuiGridRef = ref<TuiGridElement>();
|
||||
|
||||
const selectionUnit = "row"
|
||||
|
||||
const props = defineProps<{
|
||||
data: OptRow[];
|
||||
// editor: https://github.com/nhn/tui.grid/blob/master/packages/toast-ui.grid/docs/v4.0-migration-guide-kor.md
|
||||
columns: OptColumn[];
|
||||
treeColumnOptions?: TreeColumnOptions;
|
||||
rowHeaders?: string[];
|
||||
rowKey?: string;
|
||||
}>();
|
||||
|
||||
// grid api : https://nhn.github.io/tui.grid/latest/Grid
|
||||
// const ref = ref<InstanceType<typeof ToastGrid>>();
|
||||
// ref.value?.api()?.clear();
|
||||
// ref.value?.api()?.getModifiedRows();
|
||||
defineExpose({
|
||||
api: (): Grid | undefined => tuiGridRef.value?.gridInstance,
|
||||
clearGrid: () => clearGrid(),
|
||||
});
|
||||
|
||||
function clearGrid() {
|
||||
tuiGridRef.value?.gridInstance.clear();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<tui-grid
|
||||
ref="tuiGridRef"
|
||||
:data="props.data"
|
||||
:columns="props.columns"
|
||||
:treeColumnOptions="props.treeColumnOptions"
|
||||
:rowHeaders="props.rowHeaders"
|
||||
:rowKey="props.rowKey"
|
||||
:selectionUnit="selectionUnit"
|
||||
/>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref, defineExpose } from 'vue';
|
||||
import type { OptColumn, OptRow } from 'tui-grid/types/options';
|
||||
import type { TuiGridElement } from 'vue3-tui-grid';
|
||||
import type Grid from 'tui-grid';
|
||||
|
||||
interface TreeColumnOptions {
|
||||
name: string;
|
||||
useCascadingCheckbox?: boolean;
|
||||
}
|
||||
|
||||
const tuiGridRef = ref<TuiGridElement>();
|
||||
|
||||
const selectionUnit = "row"
|
||||
|
||||
const props = defineProps<{
|
||||
data: OptRow[];
|
||||
// editor: https://github.com/nhn/tui.grid/blob/master/packages/toast-ui.grid/docs/v4.0-migration-guide-kor.md
|
||||
columns: OptColumn[];
|
||||
treeColumnOptions?: TreeColumnOptions;
|
||||
rowHeaders?: string[];
|
||||
rowKey?: string;
|
||||
}>();
|
||||
|
||||
// grid api : https://nhn.github.io/tui.grid/latest/Grid
|
||||
// const ref = ref<InstanceType<typeof ToastGrid>>();
|
||||
// ref.value?.api()?.clear();
|
||||
// ref.value?.api()?.getModifiedRows();
|
||||
defineExpose({
|
||||
api: (): Grid | undefined => tuiGridRef.value?.gridInstance,
|
||||
clearGrid: () => clearGrid(),
|
||||
});
|
||||
|
||||
function clearGrid() {
|
||||
tuiGridRef.value?.gridInstance.clear();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<tui-grid
|
||||
ref="tuiGridRef"
|
||||
:data="props.data"
|
||||
:columns="props.columns"
|
||||
:treeColumnOptions="props.treeColumnOptions"
|
||||
:rowHeaders="props.rowHeaders"
|
||||
:rowKey="props.rowKey"
|
||||
:selectionUnit="selectionUnit"
|
||||
/>
|
||||
</template>
|
||||
@@ -1,28 +1,27 @@
|
||||
<template>
|
||||
<div v-if="show" class="popup-overlay" @click.self="show = false">
|
||||
<div class="popup-container">
|
||||
<slot></slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const show = defineModel('show', {type: Boolean, default:false});
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.popup-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0,0,0,0.5);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.popup-container {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div v-if="show" class="popup-overlay" @click.self="show = false">
|
||||
<div class="popup-container">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const show = defineModel("show", { type: Boolean, default: false });
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.popup-overlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.popup-container {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
@@ -15,7 +15,7 @@
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import BatchGraph from "~/components/BatchGraph.vue";
|
||||
import BatchGraph from "~/components/domain/culture-graph/BatchGraph.vue";
|
||||
const batchNames = ["배치 1", "배치 2", "배치 3", "배치 4"];
|
||||
const currentTab = ref(0);
|
||||
</script>
|
||||
@@ -1,95 +0,0 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<!-- 경로 -->
|
||||
<nav class="breadcrumb">{{ breadcrumb }}</nav>
|
||||
|
||||
<!-- 화면 명 + 버튼 영역 -->
|
||||
<header class="header">
|
||||
<h1 class="title">{{ pageTitle }}</h1>
|
||||
<div class="header-actions">
|
||||
<slot name="actions" />
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- 메인 콘텐츠 -->
|
||||
<main class="content">
|
||||
<slot />
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useRoute } from '#imports'
|
||||
|
||||
const route = useRoute()
|
||||
|
||||
// 경로(메뉴 경로)
|
||||
const breadcrumb = computed(() => route.path)
|
||||
|
||||
// 화면명(meta.title 값)
|
||||
const pageTitle = computed(() => route.meta.title || 'Untitled Page')
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
padding: 16px;
|
||||
background: #f9f9f9;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* 화면명과 버튼을 좌우 끝으로 배치 */
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 0;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.header-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
padding: 12px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
||||
}
|
||||
|
||||
/* 버튼 공통 스타일 */
|
||||
.header-actions ::v-deep button {
|
||||
background-color: #4CAF50;
|
||||
color: white;
|
||||
font-size: 14px;
|
||||
padding: 6px 12px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.header-actions ::v-deep button:hover {
|
||||
background-color: #45a049;
|
||||
}
|
||||
|
||||
.header-actions ::v-deep button:disabled {
|
||||
background-color: #ccc;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<!-- 사용자 정보 및 드롭다운 -->
|
||||
<div class="user-menu-wrapper">
|
||||
<div class="user-info" @click="toggleDropdown">
|
||||
<span class="user-name">{{ userStore.name }}</span>
|
||||
<span class="user-name">{{ userStore.user?.name }}</span>
|
||||
<div class="user-icon">
|
||||
<svg
|
||||
width="24"
|
||||
@@ -36,10 +36,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div v-show="showDropdown" class="user-dropdown">
|
||||
<div class="user-details">
|
||||
<p class="user-email">{{ userStore.user?.email }}</p>
|
||||
<p class="user-role">{{ userStore.isAdmin ? "관리자" : "사용자" }}</p>
|
||||
</div>
|
||||
<div class="dropdown-divider"></div>
|
||||
<button class="logout-btn" @click="logout">
|
||||
<svg
|
||||
@@ -61,12 +57,7 @@
|
||||
</header>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, computed, onMounted, onBeforeUnmount } from "vue";
|
||||
import { useUserStore } from "~/stores/user";
|
||||
import { usePermissionsStore } from "~/stores/permissions";
|
||||
|
||||
// defineModel 사용
|
||||
<script setup lang="ts">
|
||||
const modelValue = defineModel({ type: String, required: true });
|
||||
|
||||
const showDropdown = ref(false);
|
||||
@@ -84,7 +75,7 @@ const availableMenus = computed(() => {
|
||||
});
|
||||
|
||||
// 메뉴 클릭 핸들러
|
||||
function onMenuClick(menu) {
|
||||
function onMenuClick(menu: string) {
|
||||
modelValue.value = menu;
|
||||
}
|
||||
|
||||
@@ -92,9 +83,9 @@ function toggleDropdown() {
|
||||
showDropdown.value = !showDropdown.value;
|
||||
}
|
||||
|
||||
function handleClickOutside(event) {
|
||||
function handleClickOutside(event: MouseEvent) {
|
||||
const menu = document.querySelector(".user-menu-wrapper");
|
||||
if (menu && !menu.contains(event.target)) {
|
||||
if (menu && !menu.contains(event.target as Node)) {
|
||||
showDropdown.value = false;
|
||||
}
|
||||
}
|
||||
91
components/layout/wrapper/ContentsWrapper.vue
Normal file
91
components/layout/wrapper/ContentsWrapper.vue
Normal file
@@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<!-- 경로 -->
|
||||
<nav class="breadcrumb">{{ breadcrumb }}</nav>
|
||||
|
||||
<!-- 화면 명 + 버튼 영역 -->
|
||||
<header class="header">
|
||||
<h1 class="title">{{ pageTitle }}</h1>
|
||||
<div class="header-actions">
|
||||
<slot name="actions" />
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- 메인 콘텐츠 -->
|
||||
<main class="content">
|
||||
<slot />
|
||||
</main>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
const route = useRoute();
|
||||
|
||||
// 경로(메뉴 경로)
|
||||
const breadcrumb = computed(() => route.path);
|
||||
|
||||
// 화면명(meta.title 값)
|
||||
const pageTitle = computed(() => route.meta.title || "Untitled Page");
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.wrapper {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1rem;
|
||||
padding: 16px;
|
||||
background: #f9f9f9;
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
/* 화면명과 버튼을 좌우 끝으로 배치 */
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.title {
|
||||
margin: 0;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.header-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
padding: 12px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* 버튼 공통 스타일 */
|
||||
.header-actions ::v-deep button {
|
||||
background-color: #4caf50;
|
||||
color: white;
|
||||
font-size: 14px;
|
||||
padding: 6px 12px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.header-actions ::v-deep button:hover {
|
||||
background-color: #45a049;
|
||||
}
|
||||
|
||||
.header-actions ::v-deep button:disabled {
|
||||
background-color: #ccc;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
</style>
|
||||
@@ -1,81 +1,78 @@
|
||||
<template>
|
||||
<customPopup v-model:show="show">
|
||||
<div class="popup-content" :style="{ width, height }">
|
||||
<!-- Top -->
|
||||
<div class="popup-top">
|
||||
<slot name="top"></slot>
|
||||
</div>
|
||||
|
||||
<!-- Middle -->
|
||||
<div class="popup-middle">
|
||||
<slot name="middle"></slot>
|
||||
</div>
|
||||
|
||||
<!-- Bottom -->
|
||||
<div class="popup-bottom">
|
||||
<button class="popup-close" @click="show = false">닫기</button>
|
||||
<slot name="bottom"></slot>
|
||||
</div>
|
||||
</div>
|
||||
</customPopup>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
|
||||
defineProps<{
|
||||
width?: string
|
||||
height?: string
|
||||
}>()
|
||||
|
||||
// defineModel + 기본값 지정
|
||||
const show = defineModel('show', {type: Boolean, default:false});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.popup-content {
|
||||
background: white;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.popup-top {
|
||||
padding: 10px 20px;
|
||||
font-weight: bold;
|
||||
background: #f0f0f0;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
.popup-middle {
|
||||
flex: 1;
|
||||
padding: 20px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.popup-bottom {
|
||||
padding: 10px 20px;
|
||||
display: flex;
|
||||
justify-content: center; /* 중앙 정렬 */
|
||||
gap: 10px;
|
||||
background: #f9f9f9;
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
|
||||
/* ⭐️ bottom 슬롯 버튼 공통 스타일 */
|
||||
.popup-bottom ::v-deep(button) {
|
||||
padding: 8px 16px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
background: #007bff;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
.popup-bottom ::v-deep(button:hover) {
|
||||
background: #0056b3;
|
||||
}
|
||||
|
||||
.popup-close {
|
||||
background: #ddd !important;
|
||||
color: black !important;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<CommonPopup v-model:show="show">
|
||||
<div class="popup-content" :style="{ width, height }">
|
||||
<!-- Top -->
|
||||
<div class="popup-top">
|
||||
<slot name="top"></slot>
|
||||
</div>
|
||||
|
||||
<!-- Middle -->
|
||||
<div class="popup-middle">
|
||||
<slot name="middle"></slot>
|
||||
</div>
|
||||
|
||||
<!-- Bottom -->
|
||||
<div class="popup-bottom">
|
||||
<button class="popup-close" @click="show = false">닫기</button>
|
||||
<slot name="bottom"></slot>
|
||||
</div>
|
||||
</div>
|
||||
</CommonPopup>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
defineProps<{
|
||||
width?: string;
|
||||
height?: string;
|
||||
}>();
|
||||
|
||||
// defineModel + 기본값 지정
|
||||
const show = defineModel("show", { type: Boolean, default: false });
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.popup-content {
|
||||
background: white;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
.popup-top {
|
||||
padding: 10px 20px;
|
||||
font-weight: bold;
|
||||
background: #f0f0f0;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
.popup-middle {
|
||||
flex: 1;
|
||||
padding: 20px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.popup-bottom {
|
||||
padding: 10px 20px;
|
||||
display: flex;
|
||||
justify-content: center; /* 중앙 정렬 */
|
||||
gap: 10px;
|
||||
background: #f9f9f9;
|
||||
border-top: 1px solid #ddd;
|
||||
}
|
||||
|
||||
/* ⭐️ bottom 슬롯 버튼 공통 스타일 */
|
||||
.popup-bottom ::v-deep(button) {
|
||||
padding: 8px 16px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
background: #007bff;
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
.popup-bottom ::v-deep(button:hover) {
|
||||
background: #0056b3;
|
||||
}
|
||||
|
||||
.popup-close {
|
||||
background: #ddd !important;
|
||||
color: black !important;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user