Files
SaaS-lib/hx-ai-intelligent/src/App.vue
2024-08-26 09:27:23 +08:00

208 lines
5.2 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<a-config-provider :locale="locale">
<div style="width:100%;height:100%;">
<a-spin :spinning="state.isLoading" size="large">
<router-view />
</a-spin>
</div>
</a-config-provider>
</template>
<script lang="ts">
import { defineComponent, watch, ref } from 'vue';
import zhCN from 'ant-design-vue/es/locale/zh_CN';
import { useRouter } from 'vue-router';
import Cookies from 'js-cookie';
import { message } from 'ant-design-vue';
import { items } from '/@/store/item';
export default defineComponent({
name: 'App',
setup() {
const router = useRouter();
const cachedViews = ['Status'];
window.localStorage.setItem('mapKey', JSON.stringify({ type: 'tmap', url: '' }));
// watch(
// () => router.currentRoute.value,
// (e) => {
// // if (Cookies.get(`${import.meta.env.VITE_PUBLIC_PATH}-nervsid`) === undefined && e.fullPath !== '/login') {
// // message.warn('登陆信息已过期,请重新登录!', 1);
// // router.push('/login');
// // }
// // } else {
// // if (Cookies.get(`${import.meta.env.VITE_PUBLIC_PATH}-nervsid`) !== undefined && e === '/login') {
// // let url = window.sessionStorage.getItem('url');
// // url === null ? window.sessionStorage.setItem('url', '/doorway/visitor/audit') : '';
// // router.push(url === null ? '/doorway' : url);
// // }
// // }
// }
// );
return {
cachedViews,
locale: zhCN,
// 获得全局变量
state: items(),
};
},
});
</script>
<style lang="less" scoped>
:deep(.ns-content-main) {
.ant-tabs-content {
height: 100%;
}
}
// 树组件
:deep(.ant-tree-node-content-wrapper) {
overflow: hidden;
text-overflow: ellipsis;
text-wrap: nowrap;
}
:deep(.ant-tree-node-selected) {
color: @primary-color !important;
}
// ns-view-list-table 搜索区域
:deep(.ns-table-search) {
.ns-flexv2-form {
.ns-operate {
text-align: left;
margin-left: 0;
.ant-btn {
margin: 0;
margin-right: 6px;
}
}
}
.ns-form-body {
max-width: 1000px;
}
}
// 区域阴影
// .ns-list-table {
:deep(.ant-tabs) {
// // overflow: visible;
// box-shadow: @ns-content-box-shadow;
// border-radius: @ns-border-radius;
.ns-table-search {
border-top-left-radius: 0px !important;
border-top-right-radius: 0px !important;
}
.ns-table-main {
border-bottom-left-radius: 0px !important;
border-bottom-right-radius: 0px !important;
}
// .ant-tabs-tabpane-active > div {
// height: 100%;
// }
}
// .ant-tabs .ns-table-main {
// border-bottom-left-radius: 0px !important;
// border-bottom-right-radius: 0px !important;
// }
// }
// 菜单icon(仅仅处理特殊需求未选中时icon与文字不同色)
:deep(.anticon) {
color: #8d96a3 !important;
}
:deep(.ant-menu-item-selected .ant-menu-item-only-child),
:deep(.ant-menu-submenu-selected .ant-menu-item-only-child),
:deep(.firstMenuItem-selected) {
.router-link-active > .anticon {
color: @white !important;
}
}
:deep(.ant-menu-item-active) {
.anticon {
color: @primary-color !important;
}
}
:deep(.ant-menu-submenu-active),
:deep(.ant-menu-submenu-open),
:deep(.ant-menu-item-selected) {
.ant-menu-submenu-title {
.anticon {
color: @primary-color !important;
}
}
}
@min-padding: 5px;
:deep(.ns-left-menu-space):not(.ns-left-menu-space-collapsed) {
.firstMenuItem-selected {
background-color: transparent !important;
}
.ant-menu:not(.ant-menu-horizontal) .ant-menu-item-selected {
background-color: transparent;
&::before {
background-color: @primary-color;
opacity: 1;
height: calc(100% - @min-padding*2);
top: @min-padding;
border-radius: @ns-border-radius;
}
}
.ant-menu-item-active:not(.ant-menu-item-selected) {
background-color: transparent !important;
position: relative;
&::before {
content: '';
position: absolute;
width: 100%;
background-color: rgb(@primary-color, 0.1);
height: calc(100% - @min-padding*2);
top: @min-padding;
left: 0;
border-radius: @ns-border-radius;
z-index: 0;
}
}
// .ant-menu-inline .ant-menu-item-selected::after {
// content: '';
// position: absolute;
// top: 50%;
// right: -20px;
// transform: translateY(-50%);
// width: 3px !important;
// border-radius: 2px;
// background-color: red;
// height: 30px;
// z-index: 2;
// border: none;
// }
.ant-menu-title-content {
z-index: 1;
}
}
:deep(.nsHeader_action) {
.action {
font-size: 18px;
font-weight: bold;
letter-spacing: 0px;
line-height: 24px;
color: rgba(51, 51, 51, 1);
}
}
:deep(.ant-spin-nested-loading) {
min-height: 100%;
height: 100%;
}
:deep(.ant-spin-container) {
min-height: 100%;
height: 100%;
}
</style>