|
@ -3,12 +3,12 @@ |
|
|
<a-layout-sider collapsible v-model:collapsed="isSiderCollapsed" |
|
|
<a-layout-sider collapsible v-model:collapsed="isSiderCollapsed" |
|
|
:style="{ overflow: 'auto', height: '100vh', left: 0, top: 0, bottom: 0 }"> |
|
|
:style="{ overflow: 'auto', height: '100vh', left: 0, top: 0, bottom: 0 }"> |
|
|
|
|
|
|
|
|
<a-menu theme="dark" mode="inline" v-model:selectedKeys="menuSelectedKeys" :items="menuItems" |
|
|
|
|
|
|
|
|
<a-menu theme="dark" mode="inline" v-model:selectedKeys="menuSelectedKeys" :items="menuItems" :inlineIndent="6" |
|
|
@click="actionMenuItemClick" style="white-space: normal;"> |
|
|
@click="actionMenuItemClick" style="white-space: normal;"> |
|
|
</a-menu> |
|
|
</a-menu> |
|
|
</a-layout-sider> |
|
|
</a-layout-sider> |
|
|
|
|
|
|
|
|
<a-layout :style="{ marginLeft: '0px' }"> |
|
|
|
|
|
|
|
|
<a-layout :style="{ marginLeft: '0px', height: '100vh' }"> |
|
|
<a-layout-content :style="{ maxHeight: '40px' }"> |
|
|
<a-layout-content :style="{ maxHeight: '40px' }"> |
|
|
<!-- 显示消息 --> |
|
|
<!-- 显示消息 --> |
|
|
<input v-model="message" type="text" :style="{ width: '100%', height: '100%', color: messageColor }" |
|
|
<input v-model="message" type="text" :style="{ width: '100%', height: '100%', color: messageColor }" |
|
@ -33,14 +33,14 @@ |
|
|
<template #title> |
|
|
<template #title> |
|
|
<a >{{ item.title }}</a> |
|
|
<a >{{ item.title }}</a> |
|
|
</template> |
|
|
</template> |
|
|
<template #avatar> |
|
|
|
|
|
|
|
|
<template #avatar> |
|
|
<a-avatar /> |
|
|
<a-avatar /> |
|
|
</template> |
|
|
</template> |
|
|
</a-list-item-meta> |
|
|
|
|
|
</a-list-item> |
|
|
|
|
|
</template> |
|
|
|
|
|
</a-list> |
|
|
|
|
|
</template> --> |
|
|
|
|
|
|
|
|
</a-list-item-meta> |
|
|
|
|
|
</a-list-item> |
|
|
|
|
|
</template> |
|
|
|
|
|
</a-list> |
|
|
|
|
|
</template> --> |
|
|
|
|
|
|
|
|
</template> |
|
|
</template> |
|
|
<script setup> |
|
|
<script setup> |
|
@ -87,7 +87,10 @@ function handleOpenChange(keys) { |
|
|
openKeys.value = keys.length ? [keys[keys.length - 1]] : []; |
|
|
openKeys.value = keys.length ? [keys[keys.length - 1]] : []; |
|
|
} |
|
|
} |
|
|
function setupEventWebSocket() { |
|
|
function setupEventWebSocket() { |
|
|
const ws = new WebSocket('ws://localhost:80/api/v1/app/ws/event'); |
|
|
|
|
|
|
|
|
// process.env.NODE_ENV === 'production' ? `/api/${name}` : `http://localhost:80/api/${name}` |
|
|
|
|
|
// const ws = new WebSocket('ws://localhost:80/api/v1/app/ws/event'); |
|
|
|
|
|
const ws = new WebSocket(process.env.NODE_ENV === 'production' ? `ws://${window.location.host}:80/api/v1/app/ws/event` |
|
|
|
|
|
: `ws://localhost:80/api/v1/app/ws/event`); |
|
|
ws.onmessage = (event) => { |
|
|
ws.onmessage = (event) => { |
|
|
// wsEventData.value = JSON.parse(event.data); |
|
|
// wsEventData.value = JSON.parse(event.data); |
|
|
Modal.info({ |
|
|
Modal.info({ |
|
@ -100,7 +103,11 @@ function setupEventWebSocket() { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function setupStateUpdateWebSocket() { |
|
|
function setupStateUpdateWebSocket() { |
|
|
const ws = new WebSocket('ws://localhost:80/api/v1/app/ws/state'); |
|
|
|
|
|
|
|
|
// const ws = new WebSocket('ws://localhost:80/api/v1/app/ws/state'); |
|
|
|
|
|
// const ws = new WebSocket(process.env.NODE_ENV === 'production' ? `/api/v1/app/ws/state` : `ws://localhost:80/api/v1/app/ws/state`); |
|
|
|
|
|
const ws = new WebSocket(process.env.NODE_ENV === 'production' ? `ws://${window.location.host}:80/api/v1/app/ws/state` : |
|
|
|
|
|
`ws://localhost:80/api/v1/app/ws/state`); |
|
|
|
|
|
|
|
|
ws.onmessage = (event) => { |
|
|
ws.onmessage = (event) => { |
|
|
const data = JSON.parse(event.data); |
|
|
const data = JSON.parse(event.data); |
|
|
if (data.messageType === 'Report' && data.dataType === 'MessageBoxState') { |
|
|
if (data.messageType === 'Report' && data.dataType === 'MessageBoxState') { |
|
|