|
@@ -11,7 +11,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
- import { computed, defineComponent, ref, unref, reactive, onMounted, getCurrentInstance } from 'vue';
|
|
|
+ import { computed, defineComponent, ref, unref, reactive, onMounted, getCurrentInstance, h } from 'vue';
|
|
|
import { Popover, Tabs, Badge } from 'ant-design-vue';
|
|
|
import { BellOutlined } from '@ant-design/icons-vue';
|
|
|
import { tabListData } from './data';
|
|
@@ -27,9 +27,10 @@
|
|
|
import { readAllMsg } from '/@/views/monitor/mynews/mynews.api';
|
|
|
import { getToken } from '/@/utils/auth';
|
|
|
import md5 from 'crypto-js/md5';
|
|
|
-
|
|
|
+ import { SmileOutlined } from '@ant-design/icons-vue';
|
|
|
import SysMessageModal from '/@/views/system/message/components/SysMessageModal.vue';
|
|
|
-
|
|
|
+ import { useMessage } from '@/hooks/web/useMessage';
|
|
|
+ const { notification } = useMessage();
|
|
|
export default defineComponent({
|
|
|
components: {
|
|
|
Popover,
|
|
@@ -128,13 +129,9 @@
|
|
|
let url = glob.domainUrl?.replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId;
|
|
|
connectWebSocket(url);
|
|
|
onWebSocket(onWebSocketMessage);
|
|
|
-
|
|
|
- console.log(12312312);
|
|
|
}
|
|
|
|
|
|
function onWebSocketMessage(data) {
|
|
|
- console.log(data, 'datadatadatadata');
|
|
|
-
|
|
|
if (data.cmd === 'topic' || data.cmd === 'user') {
|
|
|
//update-begin-author:taoyan date:2022-7-13 for: VUEN-1674【严重bug】系统通知,为什么必须刷新右上角才提示
|
|
|
//后台保存数据太慢 前端延迟刷新消息
|
|
@@ -143,6 +140,16 @@
|
|
|
}, 1000);
|
|
|
//update-end-author:taoyan date:2022-7-13 for: VUEN-1674【严重bug】系统通知,为什么必须刷新右上角才提示
|
|
|
}
|
|
|
+
|
|
|
+ if (data.cmd === 'enquiry') {
|
|
|
+ setTimeout(() => {
|
|
|
+ notification.info({
|
|
|
+ message: `询盘通知`,
|
|
|
+ icon: () => h(SmileOutlined, { style: 'color: #108ee9' }),
|
|
|
+ description: `${data.msgTxt}`,
|
|
|
+ });
|
|
|
+ }, 1000);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 清空消息
|