😎代码优化

This commit is contained in:
zuohuaijun 2024-09-01 17:29:16 +08:00
parent 852506182d
commit 761de56b49
5 changed files with 25 additions and 19 deletions

View File

@ -90,7 +90,7 @@
"@vitejs/plugin-vue": "^5.1.3",
"@vitejs/plugin-vue-jsx": "^4.0.1",
"@vue/compiler-sfc": "^3.4.38",
"code-inspector-plugin": "^0.16.0",
"code-inspector-plugin": "^0.16.1",
"eslint": "^9.9.1",
"eslint-plugin-vue": "^9.27.0",
"globals": "^15.8.0",

View File

@ -21,12 +21,12 @@ import VForm3 from 'vform3-builds';
import 'vform3-builds/dist/designer.style.css';
// Vxe-Table
import { setupVXETable } from '/@/hooks/setupVXETableHook';
// IM聊天框
import JwChat from 'jwchat';
import 'jwchat/lib/style.css';
// 关闭自动打印
import { disAutoConnect } from 'vue-plugin-hiprint';
disAutoConnect();
// IM聊天框
import JwChat from 'jwchat';
import 'jwchat/style.css';
const app = createApp(App);

View File

@ -9,6 +9,9 @@ declare module 'qs';
declare module 'sortablejs';
declare module 'vue-plugin-hiprint';
declare module 'vcrontab-3';
declare module 'vue-signature-pad';
declare module 'vform3-builds';
declare module 'jwchat';
// 声明一个模块,防止引入文件时报错
declare module '*.json';

View File

@ -0,0 +1,3 @@
<template>
<div></div>
</template>

View File

@ -140,7 +140,7 @@ onMounted(async () => {
// 线
signalR.off('ForceOffline');
signalR.on('ForceOffline', async (data: any) => {
console.log('强制下线', data);
// console.log('线', data);
await signalR.stop();
await getAPI(SysAuthApi).apiSysAuthLogoutPost();
@ -191,6 +191,20 @@ const resetQuery = () => {
handleQuery();
};
//
const gridEvents: VxeGridListeners<SysOnlineUser> = {
// pager-config
async pageChange({ pageSize }) {
state.localPageParam.pageSize = pageSize;
Local.set(localPageParamKey, state.localPageParam);
},
//
async sortChange({ field, order }) {
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
Local.set(localPageParamKey, state.localPageParam);
},
};
//
const openSendMessage = (row: any) => {
sendMessageRef.value?.openDialog(row);
@ -211,20 +225,6 @@ const forceOffline = async (row: any) => {
.catch(() => {});
};
//
const gridEvents: VxeGridListeners<SysOnlineUser> = {
// pager-config
async pageChange({ pageSize }) {
state.localPageParam.pageSize = pageSize;
Local.set(localPageParamKey, state.localPageParam);
},
//
async sortChange({ field, order }) {
state.localPageParam.defaultSort = { field: field, order: order!, descStr: 'desc' };
Local.set(localPageParamKey, state.localPageParam);
},
};
//
defineExpose({ openDrawer });
</script>