Merge branch 'main' into login
This commit is contained in:
commit
3e0987657c
2
.env.dev
2
.env.dev
@ -1,6 +1,6 @@
|
|||||||
VITE_DOMAIN = https://192.168.0.251:5173/
|
VITE_DOMAIN = https://192.168.0.251:5173/
|
||||||
# VITE_LOGIN_URL = http://localhost:10325/ms/
|
# 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_API_URL = https://192.168.0.251:10325/api/
|
||||||
VITE_TEST_URL = https://192.168.0.251:10325/test/
|
VITE_TEST_URL = https://192.168.0.251:10325/test/
|
||||||
VITE_KAKAO_MAP_KEY=6f092e8f45ee81186bb6d8408f66a492
|
VITE_KAKAO_MAP_KEY=6f092e8f45ee81186bb6d8408f66a492
|
||||||
@ -1,6 +1,6 @@
|
|||||||
VITE_DOMAIN = http://localhost:5173/
|
VITE_DOMAIN = http://localhost:5173/
|
||||||
# VITE_LOGIN_URL = http://localhost:10325/ms/
|
# 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_API_URL = http://localhost:10325/api/
|
||||||
VITE_TEST_URL = http://localhost:10325/test/
|
VITE_TEST_URL = http://localhost:10325/test/
|
||||||
VITE_KAKAO_MAP_KEY=6f092e8f45ee81186bb6d8408f66a492
|
VITE_KAKAO_MAP_KEY=6f092e8f45ee81186bb6d8408f66a492
|
||||||
@ -7,12 +7,6 @@
|
|||||||
//-----------------
|
//-----------------
|
||||||
let menu, animate;
|
let menu, animate;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
var menu, animate;
|
|
||||||
(function () {
|
|
||||||
// Initialize menu
|
|
||||||
//-----------------
|
|
||||||
=======
|
|
||||||
let layoutMenuEl = document.querySelectorAll('#layout-menu');
|
let layoutMenuEl = document.querySelectorAll('#layout-menu');
|
||||||
layoutMenuEl.forEach(function (element) {
|
layoutMenuEl.forEach(function (element) {
|
||||||
menu = new Menu(element, {
|
menu = new Menu(element, {
|
||||||
@ -23,7 +17,6 @@ var menu, animate;
|
|||||||
window.Helpers.scrollToActive((animate = false));
|
window.Helpers.scrollToActive((animate = false));
|
||||||
window.Helpers.mainMenu = menu;
|
window.Helpers.mainMenu = menu;
|
||||||
});
|
});
|
||||||
>>>>>>> board-comment
|
|
||||||
|
|
||||||
// Initialize menu togglers and bind click on each
|
// Initialize menu togglers and bind click on each
|
||||||
let menuToggler = document.querySelectorAll('.layout-menu-toggle');
|
let menuToggler = document.querySelectorAll('.layout-menu-toggle');
|
||||||
|
|||||||
@ -310,6 +310,18 @@ const closeEditModal = () => {
|
|||||||
isEditModalOpen.value = false;
|
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 = () => {
|
const handleUpdate = () => {
|
||||||
nameAlert.value = selectedProject.value.PROJCTNAM.trim() === '';
|
nameAlert.value = selectedProject.value.PROJCTNAM.trim() === '';
|
||||||
@ -318,6 +330,11 @@ const handleUpdate = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!hasChanges.value) {
|
||||||
|
toastStore.onToast('변경된 내용이 없습니다.', 'e');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$api.patch('project/update', {
|
$api.patch('project/update', {
|
||||||
projctSeq: selectedProject.value.PROJCTSEQ,
|
projctSeq: selectedProject.value.PROJCTSEQ,
|
||||||
projctNam: selectedProject.value.PROJCTNAM,
|
projctNam: selectedProject.value.PROJCTNAM,
|
||||||
@ -336,7 +353,6 @@ const handleUpdate = () => {
|
|||||||
closeEditModal();
|
closeEditModal();
|
||||||
// 상위 컴포넌트에 업데이트 알림
|
// 상위 컴포넌트에 업데이트 알림
|
||||||
emit('update');
|
emit('update');
|
||||||
window.location.reload()
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<ul class="list-unstyled users-list d-flex align-items-center gap-1">
|
<ul class="list-unstyled users-list d-flex align-items-center gap-1">
|
||||||
<li
|
<li
|
||||||
v-for="(user, index) in userList"
|
v-for="(user, index) in sortedUserList"
|
||||||
:key="index"
|
:key="index"
|
||||||
class="avatar pull-up"
|
class="avatar pull-up"
|
||||||
:class="{ 'opacity-100': isUserDisabled(user) }"
|
:class="{ 'opacity-100': isUserDisabled(user) }"
|
||||||
@ -25,7 +25,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { onMounted, ref, nextTick } from 'vue';
|
import { onMounted, ref, nextTick, computed } from 'vue';
|
||||||
import { useUserStore } from '@s/userList';
|
import { useUserStore } from '@s/userList';
|
||||||
import $api from '@api';
|
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 () => {
|
const fetchProjectParticipation = async () => {
|
||||||
if (props.projctSeq) {
|
if (props.projctSeq) {
|
||||||
@ -79,25 +92,31 @@ const isUserDisabled = (user) => {
|
|||||||
|
|
||||||
// 클릭 시 활성화/비활성화 및 DB 업데이트
|
// 클릭 시 활성화/비활성화 및 DB 업데이트
|
||||||
const toggleDisable = async (index) => {
|
const toggleDisable = async (index) => {
|
||||||
const user = userList.value[index];
|
const user = sortedUserList.value[index];
|
||||||
if (user) {
|
if (user) {
|
||||||
const newParticipationStatus = props.projctSeq
|
const newParticipationStatus = props.projctSeq
|
||||||
? user.PROJCTYON === '1'
|
? user.PROJCTYON === '1'
|
||||||
: !user.disabled;
|
: !user.disabled;
|
||||||
|
|
||||||
if (props.projctSeq) {
|
if (props.projctSeq) {
|
||||||
const response = await $api.patch('project/updateYon', {
|
const response = await $api.patch('project/updateYon', {
|
||||||
memberSeq: user.MEMBERSEQ,
|
memberSeq: user.MEMBERSEQ,
|
||||||
projctSeq: props.projctSeq,
|
projctSeq: props.projctSeq,
|
||||||
projctYon: newParticipationStatus ? '0' : '1'
|
projctYon: newParticipationStatus ? '0' : '1'
|
||||||
});
|
});
|
||||||
|
|
||||||
if (response.status === 200) {
|
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 {
|
} else {
|
||||||
user.disabled = newParticipationStatus;
|
// 원래 userList에서 해당 사용자를 찾아 업데이트
|
||||||
emitUserListUpdate();
|
const originalIndex = userList.value.findIndex(u => u.MEMBERSEQ === user.MEMBERSEQ);
|
||||||
|
if (originalIndex !== -1) {
|
||||||
|
userList.value[originalIndex].disabled = newParticipationStatus;
|
||||||
|
emitUserListUpdate();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -32,17 +32,17 @@
|
|||||||
|
|
||||||
window.isDarkStyle = window.Helpers.isDarkStyle();
|
window.isDarkStyle = window.Helpers.isDarkStyle();
|
||||||
|
|
||||||
const loadScript = src => {
|
const loadScript = src => {
|
||||||
const script = document.createElement('script');
|
const script = document.createElement('script');
|
||||||
script.src = src;
|
script.src = src;
|
||||||
script.type = 'text/javascript';
|
script.type = 'text/javascript';
|
||||||
script.async = true;
|
script.async = true;
|
||||||
document.body.appendChild(script);
|
document.body.appendChild(script);
|
||||||
};
|
};
|
||||||
nextTick(async () => {
|
nextTick(async () => {
|
||||||
await wait(200);
|
await wait(200);
|
||||||
loadScript('/vendor/js/menu.js');
|
loadScript('/vendor/js/menu.js');
|
||||||
// loadScript('/js/main.js');
|
loadScript('/js/main.js');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<style></style>
|
<style></style>
|
||||||
|
|||||||
@ -241,7 +241,7 @@
|
|||||||
|
|
||||||
const user = ref(null);
|
const user = ref(null);
|
||||||
//const baseUrl = $api.defaults.baseURL.replace(/api\/$/, '');
|
//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 authStore = useAuthStore();
|
||||||
const userStore = useUserInfoStore();
|
const userStore = useUserInfoStore();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user