BI报表
Showing
7 changed files
with
388 additions
and
2 deletions
| ... | @@ -37,6 +37,7 @@ | ... | @@ -37,6 +37,7 @@ |
| 37 | "html2canvas": "^1.4.1", | 37 | "html2canvas": "^1.4.1", |
| 38 | "insert-css": "^2.0.0", | 38 | "insert-css": "^2.0.0", |
| 39 | "jquery": "^3.7.1", | 39 | "jquery": "^3.7.1", |
| 40 | "jsencrypt": "^3.3.2", | ||
| 40 | "lodash-es": "^4.17.21", | 41 | "lodash-es": "^4.17.21", |
| 41 | "md5": "^2.3.0", | 42 | "md5": "^2.3.0", |
| 42 | "mitt": "^3.0.0", | 43 | "mitt": "^3.0.0", | ... | ... |
This diff could not be displayed because it is too large.
| ... | @@ -58,10 +58,14 @@ watch( | ... | @@ -58,10 +58,14 @@ watch( |
| 58 | const changeTab = (pane: any, ev: any) => { | 58 | const changeTab = (pane: any, ev: any) => { |
| 59 | const tabIndex = Number(pane.index); | 59 | const tabIndex = Number(pane.index); |
| 60 | const paneData: any = tabbarList.value[tabIndex]; | 60 | const paneData: any = tabbarList.value[tabIndex]; |
| 61 | if (paneData.name == 'budgetDataIndex') { | ||
| 62 | router.push(paneData.fullPath); | ||
| 63 | } else { | ||
| 61 | router.push({ | 64 | router.push({ |
| 62 | name: paneData.name, | 65 | name: paneData.name, |
| 63 | query: paneData.query | 66 | query: paneData.query |
| 64 | }); | 67 | }); |
| 68 | } | ||
| 65 | const combPath = paneData.fullPath.split('/')[1] || 'app-scenes' | 69 | const combPath = paneData.fullPath.split('/')[1] || 'app-scenes' |
| 66 | userStore.setActiveTabbar(combPath, paneData.fullPath); | 70 | userStore.setActiveTabbar(combPath, paneData.fullPath); |
| 67 | }; | 71 | }; | ... | ... |
src/router/modules/dataCatalog.ts
0 → 100644
| 1 | import type { RouteRecordRaw } from 'vue-router' | ||
| 2 | |||
| 3 | function Layout() { | ||
| 4 | return import('@/layouts/index.vue') | ||
| 5 | } | ||
| 6 | |||
| 7 | const routes: RouteRecordRaw[] = [ | ||
| 8 | { | ||
| 9 | path: '/data-catalog/data-warehouse', | ||
| 10 | component: Layout, | ||
| 11 | meta: { | ||
| 12 | title: '数仓目录', | ||
| 13 | icon: 'sidebar-videos', | ||
| 14 | }, | ||
| 15 | children: [ | ||
| 16 | { | ||
| 17 | path: '', | ||
| 18 | name: 'dataWarehouse', | ||
| 19 | component: () => import('@/views/data_catalog/dataWarehouse.vue'), | ||
| 20 | meta: { | ||
| 21 | title: '数仓目录', | ||
| 22 | sidebar: false, | ||
| 23 | breadcrumb: false, | ||
| 24 | cache: true | ||
| 25 | } | ||
| 26 | }, | ||
| 27 | { | ||
| 28 | path: 'table-create-manual', | ||
| 29 | name: 'tableCreateManual', | ||
| 30 | component: () => import('@/views/data_catalog/tableCreateManual.vue'), | ||
| 31 | meta: { | ||
| 32 | title: '手动新建表', | ||
| 33 | sidebar: false, | ||
| 34 | breadcrumb: false, | ||
| 35 | cache: true, | ||
| 36 | reuse: true | ||
| 37 | }, | ||
| 38 | beforeEnter: (to, from) => { | ||
| 39 | if (to.query.isLook) { | ||
| 40 | to.meta.title = `详情-`; | ||
| 41 | return; | ||
| 42 | } | ||
| 43 | if (to.query.domainName) { | ||
| 44 | to.meta.title = `手动新建表(${to.query.domainName})`; | ||
| 45 | to.meta.editPage = true; | ||
| 46 | } else if (to.query.guid) { | ||
| 47 | to.meta.title = `编辑-`; | ||
| 48 | to.meta.editPage = true; | ||
| 49 | } | ||
| 50 | } | ||
| 51 | }, | ||
| 52 | { | ||
| 53 | path: 'dim-table-create-manual', | ||
| 54 | name: 'dimTableCreateManual', | ||
| 55 | component: () => import('@/views/data_catalog/dimTableCreateManual.vue'), | ||
| 56 | meta: { | ||
| 57 | title: '手动新建表', | ||
| 58 | sidebar: false, | ||
| 59 | breadcrumb: false, | ||
| 60 | cache: true, | ||
| 61 | reuse: true | ||
| 62 | }, | ||
| 63 | beforeEnter: (to, from) => { | ||
| 64 | if (to.query.isLook) { | ||
| 65 | to.meta.title = `详情-`; | ||
| 66 | return; | ||
| 67 | } | ||
| 68 | if (to.query.domainName) { | ||
| 69 | to.meta.title = `手动新建表(${to.query.domainName})`; | ||
| 70 | to.meta.editPage = true; | ||
| 71 | } else if (to.query.guid) { | ||
| 72 | to.meta.title = `编辑-`; | ||
| 73 | to.meta.editPage = true; | ||
| 74 | } | ||
| 75 | } | ||
| 76 | }, | ||
| 77 | { | ||
| 78 | path: 'table-create-existing', | ||
| 79 | name: 'tableCreateExisting', | ||
| 80 | component: () => import('@/views/data_catalog/tableCreateExisting.vue'), | ||
| 81 | meta: { | ||
| 82 | title: '已有表新建', | ||
| 83 | sidebar: false, | ||
| 84 | breadcrumb: false, | ||
| 85 | cache: true, | ||
| 86 | reuse: true | ||
| 87 | }, | ||
| 88 | beforeEnter: (to, from) => { | ||
| 89 | if (to.query.domainName) { | ||
| 90 | to.meta.title = `已有表新建(${to.query.domainName})`; | ||
| 91 | to.meta.editPage = true; | ||
| 92 | } | ||
| 93 | } | ||
| 94 | }, | ||
| 95 | { | ||
| 96 | path: 'table-sort-existing-data', | ||
| 97 | name: 'tableSortExistingData', | ||
| 98 | component: () => import('@/views/data_catalog/tableSortExisting.vue'), | ||
| 99 | meta: { | ||
| 100 | title: '已有表分类', | ||
| 101 | sidebar: false, | ||
| 102 | breadcrumb: false, | ||
| 103 | cache: true, | ||
| 104 | reuse: true | ||
| 105 | }, | ||
| 106 | beforeEnter: (to, from) => { | ||
| 107 | if (to.query.domainName) { | ||
| 108 | to.meta.title = `已有表分类(${to.query.domainName})`; | ||
| 109 | to.meta.editPage = true; | ||
| 110 | } else if (to.query.guid) { | ||
| 111 | to.meta.title = `编辑-`; | ||
| 112 | to.meta.editPage = true; | ||
| 113 | } | ||
| 114 | } | ||
| 115 | }, | ||
| 116 | { | ||
| 117 | path: 'table-sort-existing-edit', | ||
| 118 | name: 'tableSortExistingEdit', | ||
| 119 | component: () => import('@/views/data_catalog/tableSortExistingEdit.vue'), | ||
| 120 | meta: { | ||
| 121 | title: '编辑', | ||
| 122 | sidebar: false, | ||
| 123 | breadcrumb: false, | ||
| 124 | cache: true, | ||
| 125 | reuse: true | ||
| 126 | }, | ||
| 127 | beforeEnter: (to, from) => { | ||
| 128 | if (to.query.isLook) { | ||
| 129 | to.meta.title = `详情-`; | ||
| 130 | return; | ||
| 131 | } | ||
| 132 | if (to.query.guid) { | ||
| 133 | to.meta.title = `编辑-`; | ||
| 134 | to.meta.editPage = true; | ||
| 135 | } | ||
| 136 | } | ||
| 137 | }, | ||
| 138 | { | ||
| 139 | path: 'table-create-file', | ||
| 140 | name: 'tableCreateFile', | ||
| 141 | component: () => import('@/views/data_catalog/tableCreateFile.vue'), | ||
| 142 | meta: { | ||
| 143 | title: '根据文件新建', | ||
| 144 | sidebar: false, | ||
| 145 | breadcrumb: false, | ||
| 146 | cache: true, | ||
| 147 | reuse: true | ||
| 148 | }, | ||
| 149 | beforeEnter: (to, from) => { | ||
| 150 | if (to.query.domainName) { | ||
| 151 | to.meta.title = `根据文件新建(${to.query.domainName})`; | ||
| 152 | } else if (to.query.guid) { | ||
| 153 | to.meta.title = `编辑-`; | ||
| 154 | to.meta.editPage = true; | ||
| 155 | } | ||
| 156 | } | ||
| 157 | }, | ||
| 158 | { | ||
| 159 | path: 'tableDataView', | ||
| 160 | name: 'tableDataView', | ||
| 161 | component: () => import('@/views/data_catalog/tableDataView.vue'), | ||
| 162 | meta: { | ||
| 163 | title: '查看数据', | ||
| 164 | sidebar: false, | ||
| 165 | breadcrumb: false, | ||
| 166 | cache: true, | ||
| 167 | reuse: true | ||
| 168 | }, | ||
| 169 | beforeEnter: (to, from) => { | ||
| 170 | if (to.query.id) { | ||
| 171 | to.meta.title = `查看数据-${to.query.name}(${to.query.domainName})`; | ||
| 172 | } | ||
| 173 | } | ||
| 174 | }, | ||
| 175 | { | ||
| 176 | path: 'import-data', | ||
| 177 | name: 'importData', | ||
| 178 | component: () => import('@/views/data_catalog/importData.vue'), | ||
| 179 | meta: { | ||
| 180 | title: '文件导入', | ||
| 181 | sidebar: false, | ||
| 182 | breadcrumb: false, | ||
| 183 | cache: true, | ||
| 184 | reuse: true | ||
| 185 | }, | ||
| 186 | beforeEnter: (to, from) => { | ||
| 187 | if (to.query.bizGuid) { | ||
| 188 | to.meta.title = `文件导入-${to.query.name}(${to.query.domainName})`; | ||
| 189 | } | ||
| 190 | } | ||
| 191 | }, | ||
| 192 | { | ||
| 193 | path: 'import-file1', | ||
| 194 | name: 'importFile1', | ||
| 195 | component: () => import('@/views/importFile.vue'), | ||
| 196 | meta: { | ||
| 197 | title: '导入数据', | ||
| 198 | sidebar: false, | ||
| 199 | breadcrumb: false, | ||
| 200 | cache: true, | ||
| 201 | reuse: true | ||
| 202 | }, | ||
| 203 | beforeEnter: (to, from) => { | ||
| 204 | if (to.query.bizGuid) { | ||
| 205 | to.meta.title = `导入数据-${to.query.name}(${to.query.domainName})`; | ||
| 206 | } | ||
| 207 | } | ||
| 208 | }, | ||
| 209 | |||
| 210 | { | ||
| 211 | path: 'syncTableStructure', | ||
| 212 | name: 'syncTableStructure', | ||
| 213 | component: () => import('@/views/data_catalog/syncTableStructure.vue'), | ||
| 214 | meta: { | ||
| 215 | title: '同步表结构', | ||
| 216 | sidebar: false, | ||
| 217 | breadcrumb: false, | ||
| 218 | cache: true, | ||
| 219 | reuse: true | ||
| 220 | }, | ||
| 221 | beforeEnter: (to, from) => { | ||
| 222 | if (to.query.id) { | ||
| 223 | to.meta.title = `同步表结构-`; | ||
| 224 | } | ||
| 225 | } | ||
| 226 | }, | ||
| 227 | { | ||
| 228 | path: 'processDetail', | ||
| 229 | name: 'subjectProcessDetail', | ||
| 230 | component: () => import('@/views/data_catalog/detail_subjectTable.vue'), | ||
| 231 | meta: { | ||
| 232 | title: '流程详情', | ||
| 233 | sidebar: false, | ||
| 234 | breadcrumb: false, | ||
| 235 | cache: true, | ||
| 236 | reuse: true | ||
| 237 | }, | ||
| 238 | }, | ||
| 239 | ], | ||
| 240 | }, | ||
| 241 | // { | ||
| 242 | // path: '/data-catalog/budgetDataIndex', | ||
| 243 | // component: Layout, | ||
| 244 | // meta: { | ||
| 245 | // title: '资源看板', | ||
| 246 | // icon: 'sidebar-videos', | ||
| 247 | // }, | ||
| 248 | // children: [ | ||
| 249 | // { | ||
| 250 | // path: '', | ||
| 251 | // name: 'budgetDataIndex', | ||
| 252 | // component: () => import('@/views/data_catalog/budgetDataIndex.vue'), | ||
| 253 | // meta: { | ||
| 254 | // title: '资源看板', | ||
| 255 | // sidebar: false, | ||
| 256 | // breadcrumb: false, | ||
| 257 | // cache: true, | ||
| 258 | // reuse: true | ||
| 259 | // }, | ||
| 260 | // } | ||
| 261 | // ] | ||
| 262 | // }, | ||
| 263 | { | ||
| 264 | path: '/data-catalog/report', | ||
| 265 | component: Layout, | ||
| 266 | meta: { | ||
| 267 | title: '报表查看', | ||
| 268 | icon: 'sidebar-videos', | ||
| 269 | }, | ||
| 270 | children: [ | ||
| 271 | { | ||
| 272 | path: 'budgetDataIndex', | ||
| 273 | name: 'budgetDataIndex', | ||
| 274 | component: () => import('@/views/data_catalog/budgetDataIndex.vue'), | ||
| 275 | meta: { | ||
| 276 | title: '', | ||
| 277 | sidebar: false, | ||
| 278 | breadcrumb: false, | ||
| 279 | cache: true, | ||
| 280 | reuse: true | ||
| 281 | }, | ||
| 282 | } | ||
| 283 | ] | ||
| 284 | } | ||
| 285 | ] | ||
| 286 | |||
| 287 | export default routes |
| ... | @@ -9,6 +9,7 @@ import AssetIndex from './modules/assetIndex'; | ... | @@ -9,6 +9,7 @@ import AssetIndex from './modules/assetIndex'; |
| 9 | import DataAssetRegistry from './modules/dataAssetRegistry'; | 9 | import DataAssetRegistry from './modules/dataAssetRegistry'; |
| 10 | import DataEntry from './modules/dataEntry'; | 10 | import DataEntry from './modules/dataEntry'; |
| 11 | import SecurityMenu from './modules/securityMenu'; | 11 | import SecurityMenu from './modules/securityMenu'; |
| 12 | import DataCatalog from './modules/dataCatalog' | ||
| 12 | 13 | ||
| 13 | import type { Route } from '#/global' | 14 | import type { Route } from '#/global' |
| 14 | import useSettingsStore from '@/store/modules/settings' | 15 | import useSettingsStore from '@/store/modules/settings' |
| ... | @@ -111,7 +112,8 @@ const asyncRoutes: RouteRecordRaw[] = [ | ... | @@ -111,7 +112,8 @@ const asyncRoutes: RouteRecordRaw[] = [ |
| 111 | ...SecurityMenu, | 112 | ...SecurityMenu, |
| 112 | ...DataMeta, | 113 | ...DataMeta, |
| 113 | ...DataQuality, | 114 | ...DataQuality, |
| 114 | ...DataInventory | 115 | ...DataInventory, |
| 116 | ...DataCatalog, | ||
| 115 | ] | 117 | ] |
| 116 | 118 | ||
| 117 | const constantRoutesByFilesystem = generatedRoutes.filter((item) => { | 119 | const constantRoutesByFilesystem = generatedRoutes.filter((item) => { | ... | ... |
| ... | @@ -156,7 +156,10 @@ const useRouteStore = defineStore( | ... | @@ -156,7 +156,10 @@ const useRouteStore = defineStore( |
| 156 | title: m.productName || m.menuName | 156 | title: m.productName || m.menuName |
| 157 | }; | 157 | }; |
| 158 | } | 158 | } |
| 159 | r = routes.find((route: any) => route.path === path || route.path === m.path || `/${route.path}` === m.path); | 159 | 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'))); |
| 160 | if (r && path.includes('budgetDataIndex')) { | ||
| 161 | r.path = path; | ||
| 162 | } | ||
| 160 | if(r && m.icon && m.icon !== "{}") { | 163 | if(r && m.icon && m.icon !== "{}") { |
| 161 | 164 | ||
| 162 | r.meta.icon = m.icon | 165 | r.meta.icon = m.icon |
| ... | @@ -206,6 +209,9 @@ const useRouteStore = defineStore( | ... | @@ -206,6 +209,9 @@ const useRouteStore = defineStore( |
| 206 | } | 209 | } |
| 207 | else { | 210 | else { |
| 208 | if (m.menuType === 'C' && tmpRoute.children?.length) { | 211 | if (m.menuType === 'C' && tmpRoute.children?.length) { |
| 212 | tmpRoute.children.forEach(c => { | ||
| 213 | !c.meta.title && (c.meta.title = tmpRoute.meta.title); | ||
| 214 | }); | ||
| 209 | tmpRoute.children = tmpRoute.children?.filter(t => t.path == '') || []; | 215 | tmpRoute.children = tmpRoute.children?.filter(t => t.path == '') || []; |
| 210 | } | 216 | } |
| 211 | res.push(tmpRoute) | 217 | res.push(tmpRoute) | ... | ... |
src/views/data_catalog/budgetDataIndex.vue
0 → 100644
| 1 | <route lang="yaml"> | ||
| 2 | # 组件名称 | ||
| 3 | name: "" | ||
| 4 | </route> | ||
| 5 | |||
| 6 | <template> | ||
| 7 | <iframe :style="tableStyle" :src="link" frameborder="0"></iframe> | ||
| 8 | </template> | ||
| 9 | |||
| 10 | <script lang="ts" setup name="budgetDataIndex"> | ||
| 11 | |||
| 12 | import { ref, reactive, computed } from "vue"; | ||
| 13 | |||
| 14 | import { JSEncrypt } from 'jsencrypt'; | ||
| 15 | import { useElementSize } from "@vueuse/core"; | ||
| 16 | import useUserStore from '@/store/modules/user' | ||
| 17 | const route = useRoute() | ||
| 18 | |||
| 19 | const encryptor = new JSEncrypt() | ||
| 20 | const publicKey = '-----BEGIN PUBLIC KEY-----MIGeMA0GCSqGSIb3DQEBAQUAA4GMADCBiAKBgFiv3Ko6rOBvWDK96tIExpdyuuQAGgZo0YmQxpT10hD3qu/MnNKlIJgo4+NwUHcwpleKE2DBOxgvCeMtUoP4FDWt8q18X+4+7t8p0D/57NhA0liNKQ/Ise6b5i293ht1XPen3XhR5xIcDNxauQ5vKqdwwzhoonsbJDtbowoinLQbAgMBAAE=-----END PUBLIC KEY-----'; | ||
| 21 | function encrypt(txt) { | ||
| 22 | encryptor.setPublicKey(publicKey) // 设置公钥 | ||
| 23 | return encryptor.encrypt(txt); // 对数据进行加密 | ||
| 24 | } | ||
| 25 | |||
| 26 | const { proxy } = getCurrentInstance() as any; | ||
| 27 | |||
| 28 | const searchContainer = ref(null) | ||
| 29 | const { height: contentHeight } = useElementSize(searchContainer) | ||
| 30 | const tableStyle = computed(() => { | ||
| 31 | return `height:calc(100% - ${contentHeight.value + 10}px);width:100%;` | ||
| 32 | }) | ||
| 33 | const userStore = useUserStore() | ||
| 34 | const userInfoData = JSON.parse(userStore.userData) | ||
| 35 | const url: any = ref(route.query.url); | ||
| 36 | const isFormIndex = ref(route.query.isFormIndex); | ||
| 37 | |||
| 38 | const link = ref('') | ||
| 39 | // const router = useRouter() | ||
| 40 | // // 监听当前路由 | ||
| 41 | // watch( | ||
| 42 | // () => router.currentRoute.value, | ||
| 43 | // (newValue: any) => { | ||
| 44 | // newValue.meta.title = title.value | ||
| 45 | // }, | ||
| 46 | // { immediate: true } | ||
| 47 | // ) | ||
| 48 | |||
| 49 | |||
| 50 | |||
| 51 | // 搜索区域的schema | ||
| 52 | |||
| 53 | onBeforeMount(() => { | ||
| 54 | let loginInfo = JSON.stringify({ | ||
| 55 | username: '18600000001', | ||
| 56 | pwd: 'e3916047c3f96efa4642db7bde06d327', | ||
| 57 | timestamp: new Date().getTime() | ||
| 58 | }) | ||
| 59 | |||
| 60 | console.log(route); | ||
| 61 | |||
| 62 | if (isFormIndex.value) { | ||
| 63 | let linkValue = decodeURIComponent(url.value) + '&loginInfo=' + encodeURI(encrypt(loginInfo)); | ||
| 64 | link.value = linkValue; | ||
| 65 | } else { | ||
| 66 | let staffGuid = userInfoData.staffGuid; | ||
| 67 | let tenantGuid = userInfoData.tenantGuid; | ||
| 68 | let linkValue = decodeURIComponent(url.value) + '&staffGuid=' + staffGuid + '&tenantGuid=' + tenantGuid + '&organisationGuidList=' + userInfoData.organisationGuidList?.join('|') + '&loginInfo=' + encodeURI(encrypt(loginInfo)) | ||
| 69 | link.value = linkValue; | ||
| 70 | } | ||
| 71 | |||
| 72 | }); | ||
| 73 | |||
| 74 | onActivated(() => { | ||
| 75 | let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === route.fullPath); | ||
| 76 | if (tab) { | ||
| 77 | tab.meta.title = route.query.title; | ||
| 78 | } | ||
| 79 | }) | ||
| 80 | |||
| 81 | </script> | ||
| 82 | |||
| 83 | <style lang="scss" scoped> | ||
| 84 | |||
| 85 | |||
| 86 | </style> |
-
Please register or sign in to post a comment