Merge branch 'main' into login

This commit is contained in:
yoon 2025-02-28 10:36:24 +09:00
commit 3e0987657c
7 changed files with 59 additions and 31 deletions

View File

@ -1,6 +1,6 @@
VITE_DOMAIN = https://192.168.0.251:5173/
# VITE_LOGIN_URL = http://localhost:10325/ms/
# VITE_FILE_URL = http://localhost:10325/ms/
VITE_SERVER = httpS://192.168.0.251:10325/
VITE_API_URL = https://192.168.0.251:10325/api/
VITE_TEST_URL = https://192.168.0.251:10325/test/
VITE_KAKAO_MAP_KEY=6f092e8f45ee81186bb6d8408f66a492

View File

@ -1,6 +1,6 @@
VITE_DOMAIN = http://localhost:5173/
# VITE_LOGIN_URL = http://localhost:10325/ms/
# VITE_FILE_URL = http://localhost:10325/ms/
VITE_SERVER = http://localhost:10325/
VITE_API_URL = http://localhost:10325/api/
VITE_TEST_URL = http://localhost:10325/test/
VITE_KAKAO_MAP_KEY=6f092e8f45ee81186bb6d8408f66a492

View File

@ -7,12 +7,6 @@
//-----------------
let menu, animate;
<<<<<<< HEAD
var menu, animate;
(function () {
// Initialize menu
//-----------------
=======
let layoutMenuEl = document.querySelectorAll('#layout-menu');
layoutMenuEl.forEach(function (element) {
menu = new Menu(element, {
@ -23,7 +17,6 @@ var menu, animate;
window.Helpers.scrollToActive((animate = false));
window.Helpers.mainMenu = menu;
});
>>>>>>> board-comment
// Initialize menu togglers and bind click on each
let menuToggler = document.querySelectorAll('.layout-menu-toggle');

View File

@ -310,6 +310,18 @@ const closeEditModal = () => {
isEditModalOpen.value = false;
};
//
const hasChanges = computed(() => {
return selectedProject.value.PROJCTNAM !== props.title ||
selectedProject.value.PROJCTSTR !== props.strdate ||
selectedProject.value.PROJCTEND !== props.enddate ||
selectedProject.value.PROJCTZIP !== props.addressZip ||
selectedProject.value.PROJCTARR !== props.address ||
selectedProject.value.PROJCTDTL !== props.addressdtail ||
selectedProject.value.PROJCTDES !== props.description ||
selectedProject.value.PROJCTCOL !== props.projctCol;
});
//
const handleUpdate = () => {
nameAlert.value = selectedProject.value.PROJCTNAM.trim() === '';
@ -318,6 +330,11 @@ const handleUpdate = () => {
return;
}
if (!hasChanges.value) {
toastStore.onToast('변경된 내용이 없습니다.', 'e');
return;
}
$api.patch('project/update', {
projctSeq: selectedProject.value.PROJCTSEQ,
projctNam: selectedProject.value.PROJCTNAM,
@ -336,7 +353,6 @@ const handleUpdate = () => {
closeEditModal();
//
emit('update');
window.location.reload()
}
});
};

View File

@ -1,7 +1,7 @@
<template>
<ul class="list-unstyled users-list d-flex align-items-center gap-1">
<li
v-for="(user, index) in userList"
v-for="(user, index) in sortedUserList"
:key="index"
class="avatar pull-up"
:class="{ 'opacity-100': isUserDisabled(user) }"
@ -25,7 +25,7 @@
</template>
<script setup>
import { onMounted, ref, nextTick } from 'vue';
import { onMounted, ref, nextTick, computed } from 'vue';
import { useUserStore } from '@s/userList';
import $api from '@api';
@ -41,6 +41,19 @@ const props = defineProps({
}
});
// computed
const sortedUserList = computed(() => {
return [...userList.value].sort((a, b) => {
const aDisabled = isUserDisabled(a);
const bDisabled = isUserDisabled(b);
//
if (!aDisabled && bDisabled) return -1;
if (aDisabled && !bDisabled) return 1;
return 0;
});
});
//
const fetchProjectParticipation = async () => {
if (props.projctSeq) {
@ -79,27 +92,33 @@ const isUserDisabled = (user) => {
// / DB
const toggleDisable = async (index) => {
const user = userList.value[index];
const user = sortedUserList.value[index];
if (user) {
const newParticipationStatus = props.projctSeq
? user.PROJCTYON === '1'
: !user.disabled;
if (props.projctSeq) {
const response = await $api.patch('project/updateYon', {
memberSeq: user.MEMBERSEQ,
projctSeq: props.projctSeq,
projctYon: newParticipationStatus ? '0' : '1'
});
if (response.status === 200) {
user.PROJCTYON = newParticipationStatus ? '0' : '1';
// userList
const originalIndex = userList.value.findIndex(u => u.MEMBERSEQ === user.MEMBERSEQ);
if (originalIndex !== -1) {
userList.value[originalIndex].PROJCTYON = newParticipationStatus ? '0' : '1';
}
}
} else {
user.disabled = newParticipationStatus;
// userList
const originalIndex = userList.value.findIndex(u => u.MEMBERSEQ === user.MEMBERSEQ);
if (originalIndex !== -1) {
userList.value[originalIndex].disabled = newParticipationStatus;
emitUserListUpdate();
}
}
}
};
// emit

View File

@ -42,7 +42,7 @@ const loadScript = src => {
nextTick(async () => {
await wait(200);
loadScript('/vendor/js/menu.js');
// loadScript('/js/main.js');
loadScript('/js/main.js');
});
</script>
<style></style>

View File

@ -241,7 +241,7 @@
const user = ref(null);
//const baseUrl = $api.defaults.baseURL.replace(/api\/$/, '');
const baseUrl = import.meta.env.BASE_URL;
const baseUrl = import.meta.env.VITE_SERVER;
const authStore = useAuthStore();
const userStore = useUserInfoStore();