Commit 93d34f44 authored by liwei's avatar liwei

修改了语音指令和语音指令部署位置的token

parent d195c095
<script setup> <script setup>
import {reactive, ref} from "vue"; import {reactive, ref, watch} from "vue";
import zhCn from "element-plus/dist/locale/zh-cn.mjs" import zhCn from "element-plus/dist/locale/zh-cn.mjs"
import axios from "axios"; import axios from "axios";
import store from "../../store"; import store from "../../store";
import {getVoiceCommandsLocationData,deleteVoiceCommandsLocation,addVoiceCommandsLocation,updateVoiceCommandsLocation,getVoiceCommandsLocationDetail} from "../../api/AIStation/VoiceCommandLocation"; import {getVoiceCommandsLocationData,deleteVoiceCommandsLocation,addVoiceCommandsLocation,updateVoiceCommandsLocation,getVoiceCommandsLocationDetail} from "../../api/AIStation/VoiceCommandLocation";
import { ElMessage,ElMessageBox } from 'element-plus'; import { ElMessage,ElMessageBox } from 'element-plus';
import {handleGetAIToken} from "./AItoken";
import {useRoute} from "vue-router";
// 查询条件 // 查询条件
const queryParams = ref({ const queryParams = ref({
stationId: '',//换热站id stationId: '',//换热站id
...@@ -56,7 +59,7 @@ let dialogFormVisible = ref(false) ...@@ -56,7 +59,7 @@ let dialogFormVisible = ref(false)
const formTitle = ref('') const formTitle = ref('')
//加载列表数据 //加载列表数据
loadData() // loadData()
function loadData(){ function loadData(){
console.log('调用了LoadData') console.log('调用了LoadData')
const item = { const item = {
...@@ -310,6 +313,21 @@ function getSupplys(){ ...@@ -310,6 +313,21 @@ function getSupplys(){
}); });
} }
} }
const route = useRoute()
watch(
() => route.path, // 只监听路径变化
() => {
if(route.path === '/AIStation/VoiceCommandLocation') {
// 路由变化,执行相应操作
handleGetAIToken();
loadData()
console.log('route.path',route.path)
}
},
{ immediate: true } // 只在路径变化时触发
)
getSupplys() getSupplys()
</script> </script>
......
<script setup> <script setup>
import {reactive, ref} from "vue"; import {reactive, ref, watch} from "vue";
import zhCn from "element-plus/dist/locale/zh-cn.mjs" import zhCn from "element-plus/dist/locale/zh-cn.mjs"
import store from "../../store/index.js"; import store from "../../store/index.js";
import {getVoiceCommandsData,deleteVoiceCommands,addVoiceCommands,updateVoiceCommands,exportVoiceCommands} from "../../api/AIStation/VoiceCommand"; import {getVoiceCommandsData,deleteVoiceCommands,addVoiceCommands,updateVoiceCommands,exportVoiceCommands} from "../../api/AIStation/VoiceCommand";
import {useRoute} from "vue-router";
import {handleGetAIToken} from "./AItoken";
...@@ -64,7 +66,7 @@ function loadData(){ ...@@ -64,7 +66,7 @@ function loadData(){
Page.total = res.total Page.total = res.total
}) })
} }
loadData() // loadData()
const handleExport = () => { const handleExport = () => {
const item = { const item = {
...@@ -175,7 +177,19 @@ function handleDetail(row) { ...@@ -175,7 +177,19 @@ function handleDetail(row) {
singleDetails = row singleDetails = row
detailOpen.value = true detailOpen.value = true
} }
const route = useRoute()
watch(
() => route.path, // 只监听路径变化
() => {
if(route.path === '/AIStation/VoiceCommand') {
// 路由变化,执行相应操作
handleGetAIToken();
loadData()
console.log('route.path',route.path)
}
},
{ immediate: true } // 只在路径变化时触发
)
</script> </script>
<template> <template>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment