diff --git a/dist.rar b/dist.rar index 4c0e21e..4ca85de 100644 Binary files a/dist.rar and b/dist.rar differ diff --git a/src/utils/pythonBridge.js b/src/utils/pythonBridge.js index 1cf7d40..72a6de2 100644 --- a/src/utils/pythonBridge.js +++ b/src/utils/pythonBridge.js @@ -1,15 +1,16 @@ // pythonBridge.js import { ref, onMounted } from 'vue'; - +const bridge = ref(null); +// 初始化 QWebChannel +const initBridge = () => { + new QWebChannel(qt.webChannelTransport, (channel) => { + bridge.value = channel.objects.bridge; + }); +}; export function usePythonBridge() { - const bridge = ref(null); - // 初始化 QWebChannel - const initBridge = () => { - new QWebChannel(qt.webChannelTransport, (channel) => { - bridge.value = channel.objects.bridge; - }); - }; + + // 调用 Python 方法 const fetchDataConfig = (data) => { diff --git a/src/views/hosts/workbenches.vue b/src/views/hosts/workbenches.vue index 2f416c0..73b03e4 100644 --- a/src/views/hosts/workbenches.vue +++ b/src/views/hosts/workbenches.vue @@ -254,6 +254,8 @@ const submit = () => { getHostTimer.value = setInterval(() => { fetchDataCount().then((res) => { hostData.value = JSON.parse(res); + tkaccountuse(tkData.value[0].account, 0) + tkaccountuse(tkData.value[1].account, 1) }) }, 1000);