SyuanYu 4 mesiacov pred
rodič
commit
fbe9264c3a

+ 9 - 3
frontend/src/views/main/KnowledgeGraph.vue

@@ -57,15 +57,21 @@ async function getStage() {
 // let insertLanguageVal = ref(null); // 新增語言
 
 // 新增關鍵字
-async function insertKw() {
+async function insertKw(type = "") {
   if (!regionsVal.value || !languageVal.value) {
     alert("請選擇要新增的地區及語言");
     return;
   }
 
   let email = localStorage.getItem("email");
+  let url;
 
-  let url = `https://cmm.ai:8083/insert_kw3?kw=${kwVal.value}&region=${regionsVal.value}&language=${languageVal.value}&email=${email}`;
+  // 新增層級
+  if (type === "stage") {
+    url = `https://cmm.ai:8083/insert_kw3_2?kw=${kwVal.value}&region=${regionsVal.value}&language=${languageVal.value}&email=${email}`;
+  } else {
+    url = `https://cmm.ai:8083/insert_kw3?kw=${kwVal.value}&region=${regionsVal.value}&language=${languageVal.value}&email=${email}`;
+  }
 
   try {
     let response = await axios.put(url);
@@ -347,7 +353,7 @@ const filteredStage = computed(() => {
 
             <v-btn
               v-if="showStageBtn"
-              @click="insertKw()"
+              @click="insertKw('stage')"
               variant="outlined"
               color="primary"
               size="small"