용어집 수정정
This commit is contained in:
parent
44cec4cccd
commit
d2864f7ac0
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<li class="card p-5 mb-2">
|
<li class="card p-4 mb-2">
|
||||||
<DictWrite
|
<DictWrite
|
||||||
v-if="writeStore.isItemActive(item.WRDDICSEQ)"
|
v-if="writeStore.isItemActive(item.WRDDICSEQ)"
|
||||||
@close="writeStore.closeAll();"
|
@close="writeStore.closeAll();"
|
||||||
@ -16,9 +16,9 @@
|
|||||||
<div v-else>
|
<div v-else>
|
||||||
<div class="d-flex align-items-center justify-content-between">
|
<div class="d-flex align-items-center justify-content-between">
|
||||||
<div class="d-flex align-items-center">
|
<div class="d-flex align-items-center">
|
||||||
<span class="btn btn-primary pe-none m-1"
|
<span class="btn btn-primary pe-none m-2"
|
||||||
style="writing-mode: horizontal-tb;">{{ item.category }}</span>
|
style="writing-mode: horizontal-tb;">{{ item.category }}</span>
|
||||||
{{ item.WRDDICTTL }}
|
{{ item.WRDDICTTL }}
|
||||||
</div>
|
</div>
|
||||||
<EditBtn
|
<EditBtn
|
||||||
@click="toggleEdit"
|
@click="toggleEdit"
|
||||||
|
|||||||
@ -223,6 +223,7 @@ import { useRoute } from 'vue-router';
|
|||||||
sendWordRequest(category, wordData, newCodName);
|
sendWordRequest(category, wordData, newCodName);
|
||||||
};
|
};
|
||||||
const sendWordRequest = (category, wordData, data) => {
|
const sendWordRequest = (category, wordData, data) => {
|
||||||
|
|
||||||
const payload = {
|
const payload = {
|
||||||
WRDDICCAT: category,
|
WRDDICCAT: category,
|
||||||
WRDDICTTL: wordData.title,
|
WRDDICTTL: wordData.title,
|
||||||
@ -237,13 +238,15 @@ import { useRoute } from 'vue-router';
|
|||||||
writeButton.value.resetButton();
|
writeButton.value.resetButton();
|
||||||
}
|
}
|
||||||
selectedCategory.value = category;
|
selectedCategory.value = category;
|
||||||
|
const firstChar = getFirstCharacter(wordData.title[0]); // 첫 글자 변환
|
||||||
|
selectedAlphabet.value = firstChar;
|
||||||
|
|
||||||
getwordList(searchText.value, selectedAlphabet.value, selectedCategory.value);
|
getwordList(searchText.value, selectedAlphabet.value, selectedCategory.value);
|
||||||
getIndex();
|
getIndex();
|
||||||
if(res.data.data == '2'){
|
if(res.data.data == '2'){
|
||||||
const newCategory = { label: data, value: category };
|
const newCategory = { label: data, value: category };
|
||||||
cateList.value = [...cateList.value,newCategory];
|
cateList.value = [...cateList.value,newCategory];
|
||||||
}
|
}
|
||||||
selectedAlphabet.value = '';
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -285,6 +288,32 @@ import { useRoute } from 'vue-router';
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//초성 /알파벳 변환
|
||||||
|
const getFirstCharacter = (char) => {
|
||||||
|
const CHOSUNG_LIST = [
|
||||||
|
'ㄱ', 'ㄲ', 'ㄴ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㅁ', 'ㅂ', 'ㅃ', 'ㅅ',
|
||||||
|
'ㅆ', 'ㅇ', 'ㅈ', 'ㅉ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ'
|
||||||
|
];
|
||||||
|
|
||||||
|
if (!char || char.length === 0) return '';
|
||||||
|
|
||||||
|
const code = char.charCodeAt(0);
|
||||||
|
|
||||||
|
// 한글 범위 (가~힣) → 초성 변환
|
||||||
|
if (code >= 0xAC00 && code <= 0xD7A3) {
|
||||||
|
const index = Math.floor((code - 0xAC00) / (21 * 28));
|
||||||
|
return CHOSUNG_LIST[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 영어 소문자 → 대문자로 변환
|
||||||
|
if (char.match(/[a-zA-Z]/)) {
|
||||||
|
return char.toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 기타 문자 (숫자, 특수문자) 그대로 반환
|
||||||
|
return char;
|
||||||
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user