프로젝트 목록
This commit is contained in:
parent
e81127ee8a
commit
ec5f5e5e12
@ -29,7 +29,7 @@
|
|||||||
<i class="bx bxs-map"></i>
|
<i class="bx bxs-map"></i>
|
||||||
<div class="ms-2">주소</div>
|
<div class="ms-2">주소</div>
|
||||||
<div class="ms-12">{{ address }}</div>
|
<div class="ms-12">{{ address }}</div>
|
||||||
<button type="button" class="btn ms-auto text-white zindex-5" :style="`background-color: ${projctCol} !important;`" @click="openModal">log</button>
|
<button type="button" class="btn ms-auto text-white" :style="`background-color: ${projctCol} !important;`" @click.stop="openModal">log</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -85,11 +85,15 @@
|
|||||||
import FormInput from '@c/input/FormInput.vue';
|
import FormInput from '@c/input/FormInput.vue';
|
||||||
import FormSelect from '@c/input/FormSelect.vue';
|
import FormSelect from '@c/input/FormSelect.vue';
|
||||||
import commonApi from '@/common/commonApi';
|
import commonApi from '@/common/commonApi';
|
||||||
import ArrInput from '../input/ArrInput.vue';
|
import ArrInput from '../input/ArrInput.vue';
|
||||||
|
import { useUserInfoStore } from '@/stores/useUserInfoStore';
|
||||||
|
|
||||||
const projectList = ref([]);
|
const projectList = ref([]);
|
||||||
const isModalOpen = ref(false);
|
const isModalOpen = ref(false);
|
||||||
|
|
||||||
|
const userStore = useUserInfoStore();
|
||||||
|
const user = ref(null);
|
||||||
|
|
||||||
const nameAlert = ref(false);
|
const nameAlert = ref(false);
|
||||||
const selectedProject = ref({
|
const selectedProject = ref({
|
||||||
PROJCTNAM: '',
|
PROJCTNAM: '',
|
||||||
@ -109,16 +113,21 @@ import ArrInput from '../input/ArrInput.vue';
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(async () => {
|
||||||
getProjectList();
|
getProjectList();
|
||||||
|
|
||||||
|
await userStore.userInfo(); // 로그인한 사용자 정보
|
||||||
|
user.value = userStore.user;
|
||||||
});
|
});
|
||||||
|
|
||||||
// 프로젝트 목록 불러오기
|
// 프로젝트 목록 불러오기
|
||||||
const getProjectList = () => {
|
const getProjectList = () => {
|
||||||
$api.get('project/select').then(res => {
|
$api.get('project/select').then(res => {
|
||||||
projectList.value = res.data.data.projectList;
|
projectList.value = res.data.data.projectList;
|
||||||
|
console.log(projectList.value);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const openModal = (post) => {
|
const openModal = (post) => {
|
||||||
isModalOpen.value = true;
|
isModalOpen.value = true;
|
||||||
@ -147,9 +156,26 @@ import ArrInput from '../input/ArrInput.vue';
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
console.log(projectList.PROJCTSEQ)
|
||||||
|
|
||||||
const handleSubmit = () => {
|
const handleSubmit = () => {
|
||||||
|
$api.patch('project/update', {
|
||||||
console.log(selectedProject.value);
|
projctSeq: projectList.PROJCTSEQ,
|
||||||
|
projctNam: selectedProject.value.PROJCTNAM,
|
||||||
|
projctCol: selectedProject.value.projctcolor,
|
||||||
|
projctArr: selectedProject.value.PROJCTARR,
|
||||||
|
projctDtl: selectedProject.value.PROJCTDTL,
|
||||||
|
projctZip: selectedProject.value.PROJCTZIP,
|
||||||
|
projctStr: selectedProject.value.PROJCTSTR,
|
||||||
|
projctEnd: selectedProject.value.PROJCTEND,
|
||||||
|
projctDes: selectedProject.value.PROJCTDES,
|
||||||
|
projctUmb: user.value.name,
|
||||||
|
}).then(res => {
|
||||||
|
if (res.status === 200) {
|
||||||
|
toastStore.onToast('수정이 완료 되었습니다.', 's');
|
||||||
|
closeModal();
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
})
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<SearchBar />
|
<SearchBar />
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<CategoryBtn :lists="yearCategory" />
|
<CategoryBtn :lists="yearCategory" v-model:selectedCategory="selectedCategory" />
|
||||||
<WriteBtn class="mt-2 ms-auto" @click="openModal" />
|
<WriteBtn class="mt-2 ms-auto" @click="openModal" />
|
||||||
<CenterModal :display="isModalOpen" @close="closeModal">
|
<CenterModal :display="isModalOpen" @close="closeModal">
|
||||||
<template #title> 프로젝트 등록 </template>
|
<template #title> 프로젝트 등록 </template>
|
||||||
@ -142,11 +142,11 @@
|
|||||||
|
|
||||||
$api.post('project/insert', {
|
$api.post('project/insert', {
|
||||||
projctNam: name.value,
|
projctNam: name.value,
|
||||||
projctCol: String(color.value),
|
projctCol: color.value,
|
||||||
projctStr: startDay.value,
|
projctStr: startDay.value,
|
||||||
projctEnd: endDay.value || null,
|
projctEnd: endDay.value || null,
|
||||||
projctDes: description.value || null,
|
projctDes: description.value || null,
|
||||||
projctAdd: address.value,
|
projctArr: address.value,
|
||||||
projctDtl: detailAddress.value,
|
projctDtl: detailAddress.value,
|
||||||
projctZip: postcode.value,
|
projctZip: postcode.value,
|
||||||
projctCmb: user.value.name,
|
projctCmb: user.value.name,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user