From f32a45c69cff024ee7d23e9fff400a96fae6e855 Mon Sep 17 00:00:00 2001 From: Dang Date: Fri, 24 Jan 2025 15:03:55 +0900 Subject: [PATCH] =?UTF-8?q?=EC=9A=A9=EC=96=B4=EC=A7=91=20=EC=9E=91?= =?UTF-8?q?=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/category/CategoryBtn.vue | 49 +++++++ .../wordDict/DictAlphabetFilter.vue | 48 +++++++ src/components/wordDict/DictCard.vue | 50 +++++++ src/components/wordDict/DictWrite.vue | 21 +++ src/views/wordDict/wordDict.vue | 129 +++++------------- 5 files changed, 203 insertions(+), 94 deletions(-) create mode 100644 src/components/category/CategoryBtn.vue create mode 100644 src/components/wordDict/DictAlphabetFilter.vue create mode 100644 src/components/wordDict/DictCard.vue create mode 100644 src/components/wordDict/DictWrite.vue diff --git a/src/components/category/CategoryBtn.vue b/src/components/category/CategoryBtn.vue new file mode 100644 index 0000000..912348c --- /dev/null +++ b/src/components/category/CategoryBtn.vue @@ -0,0 +1,49 @@ + + + + + + \ No newline at end of file diff --git a/src/components/wordDict/DictAlphabetFilter.vue b/src/components/wordDict/DictAlphabetFilter.vue new file mode 100644 index 0000000..bdc0c15 --- /dev/null +++ b/src/components/wordDict/DictAlphabetFilter.vue @@ -0,0 +1,48 @@ + + + + + \ No newline at end of file diff --git a/src/components/wordDict/DictCard.vue b/src/components/wordDict/DictCard.vue new file mode 100644 index 0000000..9477747 --- /dev/null +++ b/src/components/wordDict/DictCard.vue @@ -0,0 +1,50 @@ + + + \ No newline at end of file diff --git a/src/components/wordDict/DictWrite.vue b/src/components/wordDict/DictWrite.vue new file mode 100644 index 0000000..441ffbe --- /dev/null +++ b/src/components/wordDict/DictWrite.vue @@ -0,0 +1,21 @@ + + + \ No newline at end of file diff --git a/src/views/wordDict/wordDict.vue b/src/views/wordDict/wordDict.vue index 4382d55..1ba0c77 100644 --- a/src/views/wordDict/wordDict.vue +++ b/src/views/wordDict/wordDict.vue @@ -15,47 +15,26 @@
단어 : {{ filteredList.length }} - +
+
- +
-
- +
+ +
+ + +
+
-
+
로딩 중...
@@ -63,48 +42,18 @@
{{ error }}
-
    -
  • -
    -
    - ({{ item.category }}) {{ item.WRDDICTTL }} -
    - -
    -

    {{ item.WRDDICCON }}

    -
    - 최초 작성자 - 최초 작성자 {{ item.author.name }} - 작성일 {{ new Date(item.author.createdAt).toLocaleString() }} -
    -
    - 최근 수정자 - 최근 수정자 {{ item.lastEditor.name }} - 수정일 {{ new Date(item.lastEditor.updatedAt).toLocaleString() }} -
    -
  • +
      +
    용어집의 용어가 없습니다.
- - -
-
- - - -
-
- -
-
- - -
-
@@ -116,35 +65,36 @@ import axios from '@api'; import SearchBar from '@c/search/SearchBar.vue'; import WriteButton from '@c/button/WriteBtn.vue'; - import QEditor from '@/components/editor/QEditor.vue'; - import FormInput from '@/components/input/FormInput.vue'; - import FormSelect from '@/components/input/FormSelect.vue'; + import CategoryBtn from '@/components/category/CategoryBtn.vue'; + import DictCard from '@/components/wordDict/DictCard.vue'; + import DictWrite from '@/components/wordDict/DictWrite.vue'; + import DictAlphabetFilter from '@/components/wordDict/DictAlphabetFilter.vue'; + - // /** 상세로 이동 */ - // const goDetail = idx => { - // router.push(`/board/get/${idx}`); - // }; + // 공통 + const loading = ref(false); + const error = ref(''); // 용어집 const wordList = ref([]); // 카테고리 const cateList = ref([]); - const loading = ref(false); - const error = ref(''); // 검색 const searchText = ref(''); - // 단어 및 카테고리 목록 통합 API 호출 + // 작성 + const isWriteVisible = ref(false); + + // 용어집 및 카테고리 목록 통합 API 호출 const fetchAllData = async () => { loading.value = true; error.value = ''; try { - // 단어 + // 용어집 const wordResponse = await axios.get('worddict/getWordList'); wordList.value = wordResponse.data.data.data; - console.log('단어 데이터:', wordList.value); - + console.log('용어집 데이터:', wordList.value); // 카테고리 const categoryResponse = await axios.get('worddict/getWordCategory'); cateList.value = categoryResponse.data.data; @@ -173,8 +123,10 @@ ) ); - - + // 작성 toggle + const toggleWriteForm = () => { + isWriteVisible.value = !isWriteVisible.value; + }; // `watchEffect`로 API 호출 watchEffect(() => { @@ -189,17 +141,6 @@ padding: 0 30px } -.word-list { - padding-left: 0; -} -.word-list li { - list-style: none; -} - -.word-list li ~ li { - margin-top: 20px; -} - .error { color: red; font-weight: bold;