Merge branch 'main' of http://192.168.0.251:3000/localnet/localhost-front
All checks were successful
LocalNet_front/pipeline/head This commit looks good

This commit is contained in:
yoon 2025-03-31 12:22:03 +09:00
commit 09fd2df838
8 changed files with 90 additions and 71 deletions

BIN
public/img/icons/Crown.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

View File

@ -1,5 +1,5 @@
<template>
<div class="row gx-2 mb-4">
<div class="row gx-2 mb-10 mt-1">
<div class="col-3">
<div class="ratio ratio-1x1">
<!-- 오전 반차 버튼 -->

View File

@ -3,7 +3,16 @@
<label :for="inputId" class="col-md-2 col-form-label">{{ title }}</label>
<div class="col-md-10">
<label :for="inputId" class="btn btn-label-primary">파일 선택</label>
<input class="form-control" type="file" style="display: none" :id="inputId" ref="fileInput" @change="changeHandler" multiple />
<input
class="form-control"
type="file"
style="display: none"
:id="inputId"
ref="fileInput"
:key="autoIncrement"
@change="changeHandler"
multiple
/>
<div v-if="showError" class="text-danger mt-1">
{{ errorMessage }}
</div>
@ -33,10 +42,14 @@
required: false,
},
});
//:key="autoIncrement" .
const inputId = computed(() => props.name || 'defaultFileInput');
const emits = defineEmits(['update:data', 'update:isValid']);
const autoIncrement = ref(props.autoIncrement);
const MAX_TOTAL_SIZE = 5 * 1024 * 1024; // 5MB
const MAX_FILE_COUNT = 5; //
const ALLOWED_FILE_TYPES = []; //

View File

@ -46,7 +46,7 @@ const myRemainingQuota = computed(() => {
return props.remainingVacationData?.[myUserId.value] ?? 0;
});
const isGiftButtonDisabled = computed(() => {
return myRemainingQuota.value <= 0;
return myRemainingQuota.value < 0;
});
//
const fetchSentVacationCount = async () => {

View File

@ -1,6 +1,5 @@
<template>
<div class="">
<ul class="row gx-2 mb-0 list-inline">
<ul class="row gx-2 mb-0 list-inline ">
<li
v-for="(user, index) in sortedUserList"
:key="index"
@ -10,7 +9,13 @@
data-bs-placement="top"
:aria-label="user.MEMBERSEQ"
>
<div class="ratio ratio-1x1 mb-0 profile-list">
<div class="ratio ratio-1x1 mb-0 profile-list position-relative">
<img
v-if="user.MEMBERSEQ === employeeId"
src="/img/icons/Crown.png"
alt="Crown"
class="start-50 translate-middle crown-icon"
/>
<img
class="rounded-circle profile-img"
:src="getUserProfileImage(user.MEMBERPRF)"
@ -25,7 +30,6 @@
</span>
</li>
</ul>
</div>
</template>
<script setup>
@ -95,4 +99,10 @@ borderStyle: "solid",
</script>
<style scoped>
.crown-icon {
width: 90%;
height: 70%;
z-index: 0;
top: -7%
}
</style>

View File

@ -1,6 +1,6 @@
<template>
<div class="card mb-6" :class="{'disabled-class': data.localVote.LOCVOTDDT && (topVoters.length == 1 || data.localVote.LOCVOTRES || voteResult == 0)}">
<div class="card-body" v-if="!data.localVote.LOCVOTDEL" >
<div class="card mb-6" >
<div class="card-body " :class="{'disabled-class': data.localVote.LOCVOTDDT && (topVoters.length == 1 || data.localVote.LOCVOTRES || voteResult == 0)}" v-if="!data.localVote.LOCVOTDEL" >
<h5 class="card-title mb-1">
<div class="list-unstyled users-list d-flex align-items-center gap-1">
<img

View File

@ -25,6 +25,7 @@
title="첨부파일"
name="files"
:is-alert="attachFilesAlert"
:key="autoIncrement"
@update:data="handleFileUpload"
@update:isValid="isFileValid = $event"
/>
@ -99,6 +100,7 @@
//
const title = ref('');
const content = ref('');
const autoIncrement = ref(0);
//
const titleAlert = ref(false);
@ -126,10 +128,10 @@
const originalFiles = ref([]);
const contentInitialized = ref(false);
//
const isFirstContentUpdate = ref(true);
const isFirstContentUpdate = ref(true);
//
const handleEditorDataUpdate = (data) => {
//
const handleEditorDataUpdate = data => {
content.value = data;
if (isFirstContentUpdate.value) {
@ -137,39 +139,15 @@ const handleEditorDataUpdate = (data) => {
isFirstContentUpdate.value = false;
contentInitialized.value = true;
}
};
};
function isDeltaChanged(current, original) {
const Delta = Quill.import('delta');
const currentDelta = new Delta(current || []);
const originalDelta = new Delta(original || []);
const diff = originalDelta.diff(currentDelta);
if (!diff || diff.ops.length === 0) return false;
//
const getPlainText = (delta) =>
(delta.ops || [])
function extractPlainText(delta) {
if (!delta || !Array.isArray(delta.ops)) return '';
return delta.ops
.filter(op => typeof op.insert === 'string')
.map(op => op.insert)
.join('');
const getImages = (delta) =>
(delta.ops || [])
.filter(op => typeof op.insert === 'object' && op.insert.image)
.map(op => op.insert.image);
const textCurrent = getPlainText(currentDelta);
const textOriginal = getPlainText(originalDelta);
const imgsCurrent = getImages(currentDelta);
const imgsOriginal = getImages(originalDelta);
const textEqual = textCurrent === textOriginal;
const imageEqual = JSON.stringify(imgsCurrent) === JSON.stringify(imgsOriginal);
return !(textEqual && imageEqual); // false
.map(op => op.insert.trim())
.join(' ')
.trim();
}
const isChanged = computed(() => {
@ -181,10 +159,12 @@ const handleEditorDataUpdate = (data) => {
delFileIdx.value.length > 0 || //
!isSameFiles(
attachFiles.value.filter(f => f.id), // (id )
originalFiles.value
originalFiles.value,
);
return isTitleChanged || isContentChanged || isFilesChanged ;
return isTitleChanged || isContentChanged || isFilesChanged;
});
watch(isChanged, val => {
console.log('🔄 isChanged changed:', val);
});
//
@ -195,10 +175,7 @@ const handleEditorDataUpdate = (data) => {
const sortedOriginal = [...original].sort((a, b) => a.id - b.id);
return sortedCurrent.every((file, idx) => {
return (
file.id === sortedOriginal[idx].id &&
file.name === sortedOriginal[idx].name
);
return file.id === sortedOriginal[idx].id && file.name === sortedOriginal[idx].name;
});
}
@ -235,6 +212,16 @@ const handleEditorDataUpdate = (data) => {
contentLoaded.value = true;
};
watch(
content,
val => {
if (contentLoaded.value && !originalPlainText.value) {
originalPlainText.value = extractPlainText(val);
}
},
{ immediate: true },
);
const handleUpdateEditorImg = item => {
editorUploadedImgList.value = item;
};
@ -305,6 +292,8 @@ const handleEditorDataUpdate = (data) => {
}
fileError.value = '';
attachFiles.value = [...attachFiles.value, ...validFiles].slice(0, maxFiles);
autoIncrement.value++;
};
const removeFile = (index, file) => {
@ -314,6 +303,7 @@ const handleEditorDataUpdate = (data) => {
if (attachFiles.value.length <= maxFiles) {
fileError.value = '';
}
autoIncrement.value++;
};
watch(attachFiles, () => {
@ -388,7 +378,6 @@ const handleEditorDataUpdate = (data) => {
onMounted(async () => {
if (currentBoardId.value) {
fetchBoardDetails();
} else {
console.error('잘못된 게시물 ID:', currentBoardId.value);
}

View File

@ -69,6 +69,7 @@
title="첨부파일"
name="files"
:is-alert="attachFilesAlert"
:key="autoIncrement"
@update:data="handleFileUpload"
@update:isValid="isFileValid = $event"
/>
@ -154,6 +155,8 @@
}
};
const autoIncrement = ref(0);
onMounted(() => {
fetchCategories();
});
@ -178,8 +181,11 @@
fileError.value = `최대 ${maxFiles}개의 파일만 업로드할 수 있습니다.`;
return;
}
fileError.value = '';
attachFiles.value = [...attachFiles.value, ...validFiles].slice(0, maxFiles);
autoIncrement.value++;
};
const removeFile = index => {
@ -187,6 +193,7 @@
if (attachFiles.value.length <= maxFiles) {
fileError.value = '';
}
autoIncrement.value++;
};
watch(attachFiles, () => {