4591ce94 by lxs

BI报表

1 parent 80dbf143
......@@ -37,6 +37,7 @@
"html2canvas": "^1.4.1",
"insert-css": "^2.0.0",
"jquery": "^3.7.1",
"jsencrypt": "^3.3.2",
"lodash-es": "^4.17.21",
"md5": "^2.3.0",
"mitt": "^3.0.0",
......
This diff could not be displayed because it is too large.
......@@ -58,10 +58,14 @@ watch(
const changeTab = (pane: any, ev: any) => {
const tabIndex = Number(pane.index);
const paneData: any = tabbarList.value[tabIndex];
router.push({
name: paneData.name,
query: paneData.query
});
if (paneData.name == 'budgetDataIndex') {
router.push(paneData.fullPath);
} else {
router.push({
name: paneData.name,
query: paneData.query
});
}
const combPath = paneData.fullPath.split('/')[1] || 'app-scenes'
userStore.setActiveTabbar(combPath, paneData.fullPath);
};
......
import type { RouteRecordRaw } from 'vue-router'
function Layout() {
return import('@/layouts/index.vue')
}
const routes: RouteRecordRaw[] = [
{
path: '/data-catalog/data-warehouse',
component: Layout,
meta: {
title: '数仓目录',
icon: 'sidebar-videos',
},
children: [
{
path: '',
name: 'dataWarehouse',
component: () => import('@/views/data_catalog/dataWarehouse.vue'),
meta: {
title: '数仓目录',
sidebar: false,
breadcrumb: false,
cache: true
}
},
{
path: 'table-create-manual',
name: 'tableCreateManual',
component: () => import('@/views/data_catalog/tableCreateManual.vue'),
meta: {
title: '手动新建表',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true
},
beforeEnter: (to, from) => {
if (to.query.isLook) {
to.meta.title = `详情-`;
return;
}
if (to.query.domainName) {
to.meta.title = `手动新建表(${to.query.domainName})`;
to.meta.editPage = true;
} else if (to.query.guid) {
to.meta.title = `编辑-`;
to.meta.editPage = true;
}
}
},
{
path: 'dim-table-create-manual',
name: 'dimTableCreateManual',
component: () => import('@/views/data_catalog/dimTableCreateManual.vue'),
meta: {
title: '手动新建表',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true
},
beforeEnter: (to, from) => {
if (to.query.isLook) {
to.meta.title = `详情-`;
return;
}
if (to.query.domainName) {
to.meta.title = `手动新建表(${to.query.domainName})`;
to.meta.editPage = true;
} else if (to.query.guid) {
to.meta.title = `编辑-`;
to.meta.editPage = true;
}
}
},
{
path: 'table-create-existing',
name: 'tableCreateExisting',
component: () => import('@/views/data_catalog/tableCreateExisting.vue'),
meta: {
title: '已有表新建',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true
},
beforeEnter: (to, from) => {
if (to.query.domainName) {
to.meta.title = `已有表新建(${to.query.domainName})`;
to.meta.editPage = true;
}
}
},
{
path: 'table-sort-existing-data',
name: 'tableSortExistingData',
component: () => import('@/views/data_catalog/tableSortExisting.vue'),
meta: {
title: '已有表分类',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true
},
beforeEnter: (to, from) => {
if (to.query.domainName) {
to.meta.title = `已有表分类(${to.query.domainName})`;
to.meta.editPage = true;
} else if (to.query.guid) {
to.meta.title = `编辑-`;
to.meta.editPage = true;
}
}
},
{
path: 'table-sort-existing-edit',
name: 'tableSortExistingEdit',
component: () => import('@/views/data_catalog/tableSortExistingEdit.vue'),
meta: {
title: '编辑',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true
},
beforeEnter: (to, from) => {
if (to.query.isLook) {
to.meta.title = `详情-`;
return;
}
if (to.query.guid) {
to.meta.title = `编辑-`;
to.meta.editPage = true;
}
}
},
{
path: 'table-create-file',
name: 'tableCreateFile',
component: () => import('@/views/data_catalog/tableCreateFile.vue'),
meta: {
title: '根据文件新建',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true
},
beforeEnter: (to, from) => {
if (to.query.domainName) {
to.meta.title = `根据文件新建(${to.query.domainName})`;
} else if (to.query.guid) {
to.meta.title = `编辑-`;
to.meta.editPage = true;
}
}
},
{
path: 'tableDataView',
name: 'tableDataView',
component: () => import('@/views/data_catalog/tableDataView.vue'),
meta: {
title: '查看数据',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true
},
beforeEnter: (to, from) => {
if (to.query.id) {
to.meta.title = `查看数据-${to.query.name}(${to.query.domainName})`;
}
}
},
{
path: 'import-data',
name: 'importData',
component: () => import('@/views/data_catalog/importData.vue'),
meta: {
title: '文件导入',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true
},
beforeEnter: (to, from) => {
if (to.query.bizGuid) {
to.meta.title = `文件导入-${to.query.name}(${to.query.domainName})`;
}
}
},
{
path: 'import-file1',
name: 'importFile1',
component: () => import('@/views/importFile.vue'),
meta: {
title: '导入数据',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true
},
beforeEnter: (to, from) => {
if (to.query.bizGuid) {
to.meta.title = `导入数据-${to.query.name}(${to.query.domainName})`;
}
}
},
{
path: 'syncTableStructure',
name: 'syncTableStructure',
component: () => import('@/views/data_catalog/syncTableStructure.vue'),
meta: {
title: '同步表结构',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true
},
beforeEnter: (to, from) => {
if (to.query.id) {
to.meta.title = `同步表结构-`;
}
}
},
{
path: 'processDetail',
name: 'subjectProcessDetail',
component: () => import('@/views/data_catalog/detail_subjectTable.vue'),
meta: {
title: '流程详情',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true
},
},
],
},
// {
// path: '/data-catalog/budgetDataIndex',
// component: Layout,
// meta: {
// title: '资源看板',
// icon: 'sidebar-videos',
// },
// children: [
// {
// path: '',
// name: 'budgetDataIndex',
// component: () => import('@/views/data_catalog/budgetDataIndex.vue'),
// meta: {
// title: '资源看板',
// sidebar: false,
// breadcrumb: false,
// cache: true,
// reuse: true
// },
// }
// ]
// },
{
path: '/data-catalog/report',
component: Layout,
meta: {
title: '报表查看',
icon: 'sidebar-videos',
},
children: [
{
path: 'budgetDataIndex',
name: 'budgetDataIndex',
component: () => import('@/views/data_catalog/budgetDataIndex.vue'),
meta: {
title: '',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true
},
}
]
}
]
export default routes
......@@ -9,6 +9,7 @@ import AssetIndex from './modules/assetIndex';
import DataAssetRegistry from './modules/dataAssetRegistry';
import DataEntry from './modules/dataEntry';
import SecurityMenu from './modules/securityMenu';
import DataCatalog from './modules/dataCatalog'
import type { Route } from '#/global'
import useSettingsStore from '@/store/modules/settings'
......@@ -110,8 +111,9 @@ const asyncRoutes: RouteRecordRaw[] = [
...DataEntry,
...SecurityMenu,
...DataMeta,
...DataQuality,
...DataInventory
...DataQuality,
...DataInventory,
...DataCatalog,
]
const constantRoutesByFilesystem = generatedRoutes.filter((item) => {
......
......@@ -136,7 +136,7 @@ const useRouteStore = defineStore(
}
// 根据权限过滤路由
function filterAsyncRoutes<T extends Route.recordMainRaw[] | RouteRecordRaw[]>(routes: T, permissions: string[], menuList: any[], parentPath?: string): T {
parentPath = parentPath ?? "";
parentPath = parentPath ?? "";
const res: any = [];
menuList?.forEach( async(m) => {
let r: any = null;
......@@ -156,9 +156,12 @@ const useRouteStore = defineStore(
title: m.productName || m.menuName
};
}
r = routes.find((route: any) => route.path === path || route.path === m.path || `/${route.path}` === m.path);
r = routes.find((route: any) => route.path === path || route.path === m.path || `/${route.path}` === m.path || (path.includes('/data-catalog/report') && route.path.includes('/data-catalog/report')));
if (r && path.includes('budgetDataIndex')) {
r.path = path;
}
if(r && m.icon && m.icon !== "{}") {
r.meta.icon = m.icon
r.meta.isEle = true
}
......@@ -206,6 +209,9 @@ const useRouteStore = defineStore(
}
else {
if (m.menuType === 'C' && tmpRoute.children?.length) {
tmpRoute.children.forEach(c => {
!c.meta.title && (c.meta.title = tmpRoute.meta.title);
});
tmpRoute.children = tmpRoute.children?.filter(t => t.path == '') || [];
}
res.push(tmpRoute)
......
<route lang="yaml">
# 组件名称
name: ""
</route>
<template>
<iframe :style="tableStyle" :src="link" frameborder="0"></iframe>
</template>
<script lang="ts" setup name="budgetDataIndex">
import { ref, reactive, computed } from "vue";
import { JSEncrypt } from 'jsencrypt';
import { useElementSize } from "@vueuse/core";
import useUserStore from '@/store/modules/user'
const route = useRoute()
const encryptor = new JSEncrypt()
const publicKey = '-----BEGIN PUBLIC KEY-----MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgFiv3Ko6rOBvWDK96tIExpdyuuQAGgZo0YmQxpT10hD3qu/MnNKlIJgo4+NwUHcwpleKE2DBOxgvCeMtUoP4FDWt8q18X+4+7t8p0D/57NhA0liNKQ/Ise6b5i293ht1XPen3XhR5xIcDNxauQ5vKqdwwzhoonsbJDtbowoinLQbAgMBAAE=-----END PUBLIC KEY-----';
function encrypt(txt) {
encryptor.setPublicKey(publicKey) // 设置公钥
return encryptor.encrypt(txt); // 对数据进行加密
}
const { proxy } = getCurrentInstance() as any;
const searchContainer = ref(null)
const { height: contentHeight } = useElementSize(searchContainer)
const tableStyle = computed(() => {
return `height:calc(100% - ${contentHeight.value + 10}px);width:100%;`
})
const userStore = useUserStore()
const userInfoData = JSON.parse(userStore.userData)
const url: any = ref(route.query.url);
const isFormIndex = ref(route.query.isFormIndex);
const link = ref('')
// const router = useRouter()
// // 监听当前路由
// watch(
// () => router.currentRoute.value,
// (newValue: any) => {
// newValue.meta.title = title.value
// },
// { immediate: true }
// )
// 搜索区域的schema
onBeforeMount(() => {
let loginInfo = JSON.stringify({
username: '18600000001',
pwd: 'e3916047c3f96efa4642db7bde06d327',
timestamp: new Date().getTime()
})
console.log(route);
if (isFormIndex.value) {
let linkValue = decodeURIComponent(url.value) + '&loginInfo=' + encodeURI(encrypt(loginInfo));
link.value = linkValue;
} else {
let staffGuid = userInfoData.staffGuid;
let tenantGuid = userInfoData.tenantGuid;
let linkValue = decodeURIComponent(url.value) + '&staffGuid=' + staffGuid + '&tenantGuid=' + tenantGuid + '&organisationGuidList=' + userInfoData.organisationGuidList?.join('|') + '&loginInfo=' + encodeURI(encrypt(loginInfo))
link.value = linkValue;
}
});
onActivated(() => {
let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === route.fullPath);
if (tab) {
tab.meta.title = route.query.title;
}
})
</script>
<style lang="scss" scoped>
</style>
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!