Browse Source

推送逻辑修改

develop
fuguobin 8 months ago
parent
commit
d5a39092d3
  1. 16
      src/permission.ts
  2. 15
      src/views/monitoring/screen/components/main.vue
  3. 39
      src/views/monitoring/screenData/components/main.vue
  4. 260
      src/views/monitoring/screenData/components/menu.vue
  5. 36
      src/views/monitoring/screenData/components/showTree.vue
  6. 6
      src/views/monitoring/screenData/index.vue
  7. 4
      tsconfig.json

16
src/permission.ts

@ -35,11 +35,11 @@ router.beforeEach(async (to, from, next) => {
if (to.matched.length === 0) { if (to.matched.length === 0) {
from.name ? next({ name: from.name }) : next('/404'); from.name ? next({ name: from.name }) : next('/404');
} else { } else {
console.log('切换页面发送websocket信息'); // console.log('切换页面发送websocket信息');
const exitStatu = { // const exitStatu = {
code: 'exitDataMonitor' // code: 'exitDataMonitor'
}; // };
socket.onSend(exitStatu); // socket.onSend(exitStatu);
next(); next();
} }
} else { } else {
@ -50,13 +50,13 @@ router.beforeEach(async (to, from, next) => {
router.addRoute(route); router.addRoute(route);
}); });
console.log('登录后链接websocket'); // console.log('登录后链接websocket');
//登录后连接webSocket //登录后连接webSocket
const userStorageInfo = sessionStorage.getItem('userInfo'); const userStorageInfo = sessionStorage.getItem('userInfo');
const userInfo = JSON.parse(userStorageInfo === null ? '' : userStorageInfo); const userInfo = JSON.parse(userStorageInfo === null ? '' : userStorageInfo);
const wsUrl = `ws://${window.location.host}/ws/websocket/${userInfo.userName}`; //websocket地址 // const wsUrl = `ws://${window.location.host}/ws/websocket/${userInfo.userName}`; //websocket地址
// const wsUrl = `ws://10.10.10.56:9010/websocket/${userInfo.userName}`; //websocket地址 // const wsUrl = `ws://10.10.10.56:9010/websocket/${userInfo.userName}`; //websocket地址
socket.initialize(wsUrl); // socket.initialize(wsUrl);
next({ ...to, replace: true }); next({ ...to, replace: true });
} catch (error) { } catch (error) {
// 移除 token 并跳转登录页 // 移除 token 并跳转登录页

15
src/views/monitoring/screen/components/main.vue

@ -116,6 +116,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import router from '@/router'; import router from '@/router';
import { useRoute, useRouter, onBeforeRouteLeave } from 'vue-router';
import { import {
VxeGridProps, VxeGridProps,
VxeGridInstance, VxeGridInstance,
@ -211,7 +212,7 @@ const userInfo = JSON.parse(userStorageInfo === null ? '' : userStorageInfo);
// const baseApi = "http://board.heatiot.cn:8001/prod-api"//websocket // const baseApi = "http://board.heatiot.cn:8001/prod-api"//websocket
//const baseApi = import.meta.env.VITE_APP_BASE_API //const baseApi = import.meta.env.VITE_APP_BASE_API
//const apiUrl = baseApi.replace(/https?:/, ''); //const apiUrl = baseApi.replace(/https?:/, '');
// const wsUrl = `ws://${window.location.host}/ws/websocket/${userInfo.userName}`; //websocket const wsUrl = `ws://${window.location.host}/ws/websocket/${userInfo.userName}`; //websocket
// const wsUrl = `ws://10.10.10.56:9010/websocket/${userInfo.userName}`; //websocket // const wsUrl = `ws://10.10.10.56:9010/websocket/${userInfo.userName}`; //websocket
const emit = defineEmits(['tableHeaderData']); const emit = defineEmits(['tableHeaderData']);
@ -264,7 +265,16 @@ onMounted(() => {
sessionStorage.getItem('currentPage') === null ? 1 : Number(sessionStorage.getItem('currentPage')); sessionStorage.getItem('currentPage') === null ? 1 : Number(sessionStorage.getItem('currentPage'));
console.log(Number(sessionStorage.getItem('currentPage'))); console.log(Number(sessionStorage.getItem('currentPage')));
tablePage.pageSize = sessionStorage.getItem('pageSize') === null ? 10 : Number(sessionStorage.getItem('pageSize')); tablePage.pageSize = sessionStorage.getItem('pageSize') === null ? 10 : Number(sessionStorage.getItem('pageSize'));
// socket.initialize(wsUrl); //websocket http:// socket.initialize(wsUrl); //websocket http://
});
onBeforeRouteLeave((to, from) => {
//
console.log('onBeforeRouteLeave--', to.path, from.path);
if (to.path != from.path) {
console.log('离开页面');
socket.close(false);
}
}); });
mitt.on('currentPageEmit', (res: any) => { mitt.on('currentPageEmit', (res: any) => {
@ -440,7 +450,6 @@ const cellDBLClickEvent: VxeTableEvents.CellDblclick<TableVo> = ({ row, column }
cellRow.value = row; cellRow.value = row;
cellColumn.value = column; cellColumn.value = column;
cellField.value = cellField; cellField.value = cellField;
debugger;
if (cellField.canBeControl === '1' && controlPerm) { if (cellField.canBeControl === '1' && controlPerm) {
modalTitle.value = column.title; modalTitle.value = column.title;
///formData.value.url = data.url; ///formData.value.url = data.url;

39
src/views/monitoring/screenData/components/main.vue

@ -116,6 +116,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import router from '@/router'; import router from '@/router';
import { onBeforeRouteLeave } from 'vue-router';
import { import {
VxeGridProps, VxeGridProps,
VxeGridInstance, VxeGridInstance,
@ -132,7 +133,7 @@ import { getMockTableHeader, getStationInfo, getMockTableData, editConfig, sendC
import { TableVo } from '@/api/table/types'; import { TableVo } from '@/api/table/types';
import { tableStore } from '@/store/modules/table'; import { tableStore } from '@/store/modules/table';
import mitt from '@/plugins/bus'; import mitt from '@/plugins/bus';
import socket from '@/utils/socket'; // import socket from '@/utils/socket';
import useStorage from '@/utils/useStorage'; import useStorage from '@/utils/useStorage';
import { useUserStoreHook } from '@/store/modules/user'; import { useUserStoreHook } from '@/store/modules/user';
@ -258,7 +259,7 @@ const headerData = ref<HeaderVo[]>();
onMounted(() => { onMounted(() => {
// stationInfo(); // stationInfo();
// tableHeader(); // tableMockHeader();
console.log('aaaa', sessionStorage.getItem('currentPage')); console.log('aaaa', sessionStorage.getItem('currentPage'));
tablePage.currentPage = tablePage.currentPage =
sessionStorage.getItem('currentPage') === null ? 1 : Number(sessionStorage.getItem('currentPage')); sessionStorage.getItem('currentPage') === null ? 1 : Number(sessionStorage.getItem('currentPage'));
@ -267,25 +268,33 @@ onMounted(() => {
// socket.initialize(wsUrl); //websocket http:// // socket.initialize(wsUrl); //websocket http://
}); });
onUnmounted(() => { // onUnmounted(() => {
// //setTimeout
// if (timer.value !== null || timer.value !== undefined) {
// clearTimeout(timer.value);
// }
// });
onBeforeRouteLeave((to, from) => {
//
//setTimeout //setTimeout
if (timer.value !== null || timer.value !== undefined) { if (timer.value !== null || timer.value !== undefined) {
clearTimeout(timer.value); clearTimeout(timer.value);
} }
}); });
mitt.on('currentPageEmit', (res: any) => { mitt.on('currentPageEmits', (res: any) => {
// //
tablePage.currentPage = res; tablePage.currentPage = res;
}); });
mitt.on('menuKey', (res: any) => { mitt.on('menuMockKeys', (res: any) => {
// //
menuKey.value = res; menuKey.value = res;
tableHeader(); tableMockHeader();
tableDatas(); tableMockDatas();
}); });
mitt.on('treeData', (res: any) => { mitt.on('treeDatas', (res: any) => {
//header //header
tableColumn.value = []; tableColumn.value = [];
nextTick(() => { nextTick(() => {
@ -343,7 +352,7 @@ const handlePageChange: VxePagerEvents.PageChange = ({ currentPage, pageSize })
tablePage.pageSize = pageSize; tablePage.pageSize = pageSize;
sessionStorageIns.setUseStorage('currentPage', currentPage); sessionStorageIns.setUseStorage('currentPage', currentPage);
sessionStorageIns.setUseStorage('pageSize', pageSize); sessionStorageIns.setUseStorage('pageSize', pageSize);
tableDatas(); tableMockDatas();
}; };
function stationInfo() { function stationInfo() {
@ -355,7 +364,7 @@ function stationInfo() {
}); });
} }
function tableHeader() { function tableMockHeader() {
//header //header
getMockTableHeader().then((res: any) => { getMockTableHeader().then((res: any) => {
console.log(res); console.log(res);
@ -409,11 +418,11 @@ function tableHeader() {
// console.log('', gridOptions.value.columns); // console.log('', gridOptions.value.columns);
emit('tableHeaderData', res.data); emit('tableHeaderData', res.data);
// mitt.emit('tableHeaderData', res.data); // mitt.emit('tableHeaderData', res.data);
// tableDatas(); // tableMockDatas();
}); });
} }
function tableDatas() { function tableMockDatas() {
// //
// const params = menuKey.value; // const params = menuKey.value;
const params = { const params = {
@ -475,7 +484,7 @@ const cellDBLClickEvent: VxeTableEvents.CellDblclick<TableVo> = ({ row, column }
formData.value = cellField.ctrlPro; formData.value = cellField.ctrlPro;
formData.value.value = cellField.val; formData.value.value = cellField.val;
// formData.value.paramCode = cellField.ctrlPro.paramcode; // formData.value.paramCode = cellField.ctrlPro.paramcode;
editModal.value = true; editModal.value = false;
} }
console.log(row[column.field]); console.log(row[column.field]);
}; };
@ -495,10 +504,10 @@ const formatRole: VxeColumnPropTypes.Formatter<HeaderVo> = ({ cellValue }) => {
// }" ></i> // }" ></i>
// ${cellValue.canBeControl === '1' && controlPerm ? '<i class="iconfont icon-edit-icon"></i>' : ''}`; // ${cellValue.canBeControl === '1' && controlPerm ? '<i class="iconfont icon-edit-icon"></i>' : ''}`;
const cellData = ` const cellData = `
<span class="cellClass ${cellValue.alertProp === 1 ? 'warning' : cellValue.canBeControl === '1' ? 'cellEdit' : ''}"> <span class="cellClass ${cellValue.alertProp === 1 ? 'warning' : cellValue.canBeControl === '1' ? '' : ''}">
${cellValue.ctrlPro.valueType != 'bool' ? cellValue.val : cellValue.val === 'true' ? '启' : '停'} ${cellValue.ctrlPro.valueType != 'bool' ? cellValue.val : cellValue.val === 'true' ? '启' : '停'}
</span> </span>
${cellValue.canBeControl === '1' && controlPerm ? '<i class="iconfont icon-edit-icon"></i>' : ''}`; ${cellValue.canBeControl === '1' && controlPerm ? '' : ''}`;
return cellData; return cellData;
}; };

260
src/views/monitoring/screenData/components/menu.vue

@ -1,36 +1,95 @@
<template> <template>
<n-menu ref="menuInstRef" class="menu" :indent="0" :options="menuOptions" v-model:value="selectedKey" key-field="deptId" <div class="menuCantent">
label-field="deptName" :default-expand-all="false" :watch-props="['defaultExpandedKeys']" <n-menu
:render-label="renderMenuLabel" @update:value="menuUpdateValue" /> ref="menuInstRef"
class="menu"
:indent="0"
:options="menuOptions"
v-model:value="selectedKey"
key-field="deptId"
label-field="deptName"
:default-expand-all="false"
:watch-props="['defaultExpandedKeys']"
:render-label="renderMenuLabel"
@update:value="menuUpdateValue"
/>
</div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { useRoute } from 'vue-router';
import type { MenuOption } from 'naive-ui'; import type { MenuOption } from 'naive-ui';
// import { NEllipsis } from 'naive-ui'; // import { NEllipsis } from 'naive-ui';
import { getMenu } from '@/api/table/list'; import { getMenu } from '@/api/table/list';
import { getMenuData } from '@/api/device/index';
import { getFirstNodeLastLevel } from '@/utils/index'; import { getFirstNodeLastLevel } from '@/utils/index';
import useStorage from '@/utils/useStorage' import useStorage from '@/utils/useStorage';
import mitt from '@/plugins/bus'; import mitt from '@/plugins/bus';
const router = useRoute();
const menuOptions = ref([]); const menuOptions = ref([]);
const selectedKey = ref(); const selectedKey = ref();
const sessionStorageIns = useStorage('sessionStorage'); const sessionStorageIns = useStorage('sessionStorage');
const routerType = ref('');
const id = ref(0);
const deptId = ref(0);
const menuDeptKey = ref(0);
const menuIdKey = ref(0);
const emit = defineEmits(['tableMenuData']); const emit = defineEmits(['tableMenuData']);
const props = defineProps({
menuType: {
type: String,
default: '1'
}
});
onMounted(() => { onMounted(() => {
menuApi(); routerType.value = router.query?.id === undefined ? '0' : '1';
id.value = sessionStorage.getItem('id') === null ? 0 : Number(sessionStorage.getItem('id'));
deptId.value = sessionStorage.getItem('deptId') === null ? 0 : Number(sessionStorage.getItem('deptId'));
if (props.menuType === '1') {
menuApi();
} else if (props.menuType === '2') {
comMenuApi();
}
}); });
function menuApi() { function menuApi() {
// //
getMenu().then((res: any) => { getMenu().then((res: any) => {
if (res.code === 200) { if (res.code === 200) {
const key = getFirstNodeLastLevel(res.data).deptId menuDeptKey.value =
routerType.value === '1'
? deptId.value
: routerType.value === '0' && deptId.value != 0
? deptId.value
: getFirstNodeLastLevel(res.data).deptId;
removeChildren(res.data); removeChildren(res.data);
menuOptions.value = res.data; menuOptions.value = res.data;
selectedKey.value = key; selectedKey.value = menuDeptKey.value;
sessionStorageIns.setUseStorage('deptId', key); sessionStorageIns.setUseStorage('deptId', menuDeptKey.value);
mitt.emit('menuKey', key); mitt.emit('menuMockKeys', menuDeptKey.value);
emit('tableMenuData', res.data);
}
});
}
function comMenuApi() {
//
getMenuData().then((res: any) => {
if (res.code === 200) {
menuIdKey.value =
routerType.value === '1'
? id.value
: routerType.value === '0' && id.value != 0
? id.value
: getFirstNodeLastLevel(res.data).deptId;
const parentId = routerType.value === '1' ? deptId.value : getFirstNodeLastLevel(res.data).parentId;
removeChildren(res.data);
menuOptions.value = res.data;
selectedKey.value = menuIdKey.value;
sessionStorageIns.setUseStorage('deptId', routerType.value === '1' ? deptId.value : parentId);
mitt.emit('deviceMenuKey', menuIdKey.value);
emit('tableMenuData', res.data); emit('tableMenuData', res.data);
} }
}); });
@ -42,7 +101,7 @@ function removeChildren(menu: any) {
return; return;
} }
menu.forEach((item) => { menu.forEach(item => {
if (item.children && item.children.length === 0) { if (item.children && item.children.length === 0) {
delete item.children; delete item.children;
} else { } else {
@ -50,19 +109,184 @@ function removeChildren(menu: any) {
} }
}); });
} }
// function renderMenuLabel(option: MenuOption) {
function renderMenuLabel(option: MenuOption) { const renderMenuLabel = (option: MenuOption) => {
// //
return h(NEllipsis, null, option.deptName as string); // return h(NEllipsis, null, option.deptName as string);
} return h(NEllipsis, null, { default: () => option.deptName });
};
function menuUpdateValue(key: string, item: MenuOption) { function menuUpdateValue(key: string, item: MenuOption) {
// //
sessionStorageIns.setUseStorage('id', key); sessionStorageIns.setUseStorage(props.menuType === '1' ? 'deptId' : 'id', key);
mitt.emit('menuKey', key); sessionStorageIns.setUseStorage('currentPage', 1);
if (props.menuType === '1') {
mitt.emit('currentPageEmits', 1);
}
if (props.menuType === '2') {
sessionStorageIns.setUseStorage('deptId', item.parentId);
}
mitt.emit(props.menuType === '1' ? 'menuKey' : 'deviceMenuKey', key);
console.log(key, item); console.log(key, item);
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../index.scss'; :root {
--n-item-text-color-child-active-hover: #fff;
--n-item-text-color-active-hover: #fff;
--n-item-text-color-child-active: #fff;
}
.menuCantent {
height: -webkit-fill-available;
overflow: auto;
.menu {
text-align: center;
:deep(.n-submenu) {
--n-item-color-hover: auto;
.n-menu-item {
.n-menu-item-content {
padding: 0 !important;
.n-ellipsis {
font-family: 'AlibabaPuHuiTiBold';
padding: 0 15px;
}
// .n-menu-item-content__arrow {
// color: #b1e3ff;
// }
}
.n-menu-item-content.n-menu-item-content--child-active {
// .n-menu-item-content-header {
// color: #b1e3ff;
// }
.n-menu-item-content__arrow {
color: var(--n-arrow-color);
}
}
// .n-menu-item-content--child-active {
// .n-menu-item-content-header:hover {
// color: #fff !important;
// }
// .n-menu-item-content__arrow:hover {
// color: #fff !important;
// }
// }
// .n-menu-item-content--child-active:hover{
// color: #fff !important;
// }
.n-menu-item-content-header {
font-size: 2.2rem;
color: var(--vxe-table-header-font-color);
}
}
.n-menu-item:hover {
color: #409eff;
}
.n-submenu-children {
.n-menu-item-content-header {
font-size: 1.6rem;
}
.n-menu-item-content--selected {
.n-menu-item-content-header {
color: #409eff;
.n-ellipsis {
position: relative;
span {
padding: 0 10px;
}
span::before {
content: none;
position: absolute;
left: 0;
top: 0.7rem;
width: 1.8rem;
height: 1.8rem;
// background: url(@/assets/images/taps.png) no-repeat;
// background-size: cover;
background-color: var(--menuActiveBg) !important;
}
}
}
}
.n-menu-item-content--selected::before {
background: -webkit-linear-gradient(left, #91d3fd 0%, #dedede 100%);
left: 0;
right: 0;
}
.n-menu-item-content--selected::after {
content: '';
position: absolute;
bottom: 0;
width: 100%;
height: 2px;
background: -webkit-linear-gradient(left, #409eff 0%, #dedede 100%);
}
}
.n-base-icon {
// color: #84e0f7;
right: 10px;
}
}
}
}
/*滚动条整体部分*/
.menuCantent::-webkit-scrollbar,
.tableGrid ::-webkit-scrollbar {
width: 8px;
height: 8px;
}
/*滚动条的轨道*/
.menuCantent::-webkit-scrollbar-track,
.tableGrid ::-webkit-scrollbar-track {
background-color: transparent;
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
}
/*滚动条里面的小方块,能向上向下移动*/
.menuCantent::-webkit-scrollbar-thumb,
.tableGrid ::-webkit-scrollbar-thumb {
background-color: rgb(147, 147, 153, 0.5);
-webkit-border-radius: 8px;
-moz-border-radius: 8px;
border-radius: 8px;
}
.menuCantent::-webkit-scrollbar-thumb:hover,
.tableGrid ::-webkit-scrollbar-thumb:hover {
background-color: #a8a8a8;
}
.menuCantent::-webkit-scrollbar-thumb:active,
.tableGrid :-webkit-scrollbar-thumb:active {
background-color: #787878;
}
/*边角,即两个滚动条的交汇处*/
.menuCantent::-webkit-scrollbar-corner,
.tableGrid ::-webkit-scrollbar-corner {
background-color: transparent;
}
</style> </style>

36
src/views/monitoring/screenData/components/showTree.vue

@ -1,8 +1,18 @@
<template> <template>
<div class="treeCard"> <div class="treeCard">
<el-tree ref="tree" class="showTree" :data="treeData" node-key="id" show-checkbox draggable :props="defaultProps" <el-tree
:default-checked-keys="defaultCheckedKeys" :allow-drop="allowDrop" @node-drop="nodeDrop" ref="tree"
@check-change="treeCheckChange"> class="showTree"
:data="treeData"
node-key="id"
show-checkbox
draggable
:props="defaultProps"
:default-checked-keys="defaultCheckedKeys"
:allow-drop="allowDrop"
@node-drop="nodeDrop"
@check-change="treeCheckChange"
>
<template #default="{ node, data }"> <template #default="{ node, data }">
<span class="custom-tree-node"> <span class="custom-tree-node">
<span>{{ data.field === 'deviceStatus' ? '状态' : data.title }}</span> <span>{{ data.field === 'deviceStatus' ? '状态' : data.title }}</span>
@ -15,7 +25,9 @@
</el-tree> </el-tree>
<div class="treeBtn"> <div class="treeBtn">
<el-button @click="cancelClick">取消</el-button> <el-button @click="cancelClick">取消</el-button>
<el-button type="primary" :loading="treeLoading" @click="confirmClick">{{ treeLoading ? '确认中' : '确认' }}</el-button> <el-button type="primary" :loading="treeLoading" @click="confirmClick">{{
treeLoading ? '确认中' : '确认'
}}</el-button>
</div> </div>
</div> </div>
</template> </template>
@ -23,7 +35,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { getCurrentInstance, ComponentInternalInstance } from 'vue'; import { getCurrentInstance, ComponentInternalInstance } from 'vue';
import mitt from '@/plugins/bus'; import mitt from '@/plugins/bus';
const { proxy } = getCurrentInstance() as ComponentInternalInstance const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const defaultCheckedKeys = ref([]); // const defaultCheckedKeys = ref([]); //
const checkList = ref<TreeVo[]>([]); // const checkList = ref<TreeVo[]>([]); //
@ -39,15 +51,15 @@ interface TreeVo {
controlValue?: number; controlValue?: number;
children?: TreeVo[]; children?: TreeVo[];
} }
const treeLoading = ref(false) const treeLoading = ref(false);
const treeData = ref<TreeVo[]>(); const treeData = ref<TreeVo[]>();
const emit = defineEmits(['cancelClick', 'confirmClick']); const emit = defineEmits(['cancelClick', 'confirmClick']);
const props: any = defineProps({ const props: any = defineProps({
headerData: { headerData: {
type: Array, type: Array,
default: [], default: []
}, }
}); });
onMounted(() => { onMounted(() => {
@ -77,12 +89,12 @@ onMounted(() => {
mitt.on('treeClose', (res: any) => { mitt.on('treeClose', (res: any) => {
// //
emit('cancelClick', ''); emit('cancelClick', '');
treeLoading.value = false treeLoading.value = false;
}); });
const defaultProps = { const defaultProps = {
children: 'children', children: 'children',
label: 'title', label: 'title'
}; };
// const treeData: TreeVo[] = [ // const treeData: TreeVo[] = [
@ -290,8 +302,8 @@ function cancelClick() {
} }
function confirmClick() { function confirmClick() {
// //
treeLoading.value = true treeLoading.value = true;
mitt.emit('treeData', treeData.value); mitt.emit('treeDatas', treeData.value);
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

6
src/views/monitoring/screenData/index.vue

@ -79,7 +79,9 @@
</div> </div>
<div class="panelBtn" :class="menuShow ? 'left' : 'right'" @click="panelClick"> <div class="panelBtn" :class="menuShow ? 'left' : 'right'" @click="panelClick">
<i class="iconfont icon-arrow-up" :class="!panelShow ? 'up' : 'down'"></i> <i class="iconfont icon-arrow-up" :class="!panelShow ? 'up' : 'down'"></i>
<div class="copyright">Copyright © {{ $t('copyright.year') }} {{ $t('copyright.abbr') }} {{ $t('copyright.document') }}</div> <div class="copyright">
Copyright © {{ $t('copyright.year') }} {{ $t('copyright.abbr') }} {{ $t('copyright.document') }}
</div>
<!-- <n-button type="info" size="tiny" ghost @click="panelClick">按钮</n-button> --> <!-- <n-button type="info" size="tiny" ghost @click="panelClick">按钮</n-button> -->
</div> </div>
</div> </div>
@ -89,7 +91,7 @@ import { useRoute, useRouter, onBeforeRouteLeave } from 'vue-router';
// import { useDateFormat, useNow } from '@vueuse/core'; // import { useDateFormat, useNow } from '@vueuse/core';
// import { Filter, Maximize, Settings, Power } from '@vicons/tabler'; // import { Filter, Maximize, Settings, Power } from '@vicons/tabler';
import Header from '../components/header.vue'; import Header from '../components/header.vue';
import Menu from '../components/menu.vue'; import Menu from './components/menu.vue';
import Main from './components/main.vue'; import Main from './components/main.vue';
import InfoPanel from './components/infoPanel.vue'; import InfoPanel from './components/infoPanel.vue';
import ShowTree from './components/showTree.vue'; import ShowTree from './components/showTree.vue';

4
tsconfig.json

@ -16,10 +16,10 @@
"@/*": ["src/*"] "@/*": ["src/*"]
}, },
"outDir": "dist", "outDir": "dist",
"types": ["vite/client", "element-plus/global","unplugin-icons/types/vue"], "types": ["vite/client", "element-plus/global", "unplugin-icons/types/vue"],
"skipLibCheck": true /* Skip type checking all .d.ts files. */, "skipLibCheck": true /* Skip type checking all .d.ts files. */,
"allowSyntheticDefaultImports": true /* */, "allowSyntheticDefaultImports": true /* */,
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */
}, },
"include": ["src/**/*.ts", "src/**/*.vue", "src/types/**/*.d.ts"], "include": ["src/**/*.ts", "src/**/*.vue", "src/types/**/*.d.ts"],
"exclude": ["node_modules", "dist", "**/*.js"] "exclude": ["node_modules", "dist", "**/*.js"]

Loading…
Cancel
Save