丽知中台报表更新

This commit is contained in:
hyt 2025-05-30 09:51:31 +08:00
parent c958c8d59c
commit 81bb8f55d8
7 changed files with 473 additions and 238 deletions

View File

@ -45,6 +45,8 @@ export default {
return data[3]; return data[3];
} else if (url.includes("ApplicationCenter")) { } else if (url.includes("ApplicationCenter")) {
return data[4]; return data[4];
}else if (url.includes("businessMatter")) {
return data[5];
} else { } else {
return empty; return empty;
} }

View File

@ -114,7 +114,9 @@ export default {
this.currentPath.includes("MasterDataCenter") || this.currentPath.includes("MasterDataCenter") ||
this.currentPath.includes("IntegrationTaskCenter") || this.currentPath.includes("IntegrationTaskCenter") ||
this.currentPath.includes("businessCenter") || this.currentPath.includes("businessCenter") ||
this.currentPath.includes("ApplicationCenter") this.currentPath.includes("ApplicationCenter")||
this.currentPath.includes("businessMatter")
) { ) {
route.meta.affix = true; route.meta.affix = true;
this.$store.dispatch("tagsView/addVisitedView", route); this.$store.dispatch("tagsView/addVisitedView", route);
@ -151,6 +153,7 @@ export default {
icon: "icon-gongzuotai", icon: "icon-gongzuotai",
show: true, show: true,
}, },
], ],
permissionsMenu: [ permissionsMenu: [
{ {
@ -177,6 +180,12 @@ export default {
icon: "el-icon-postcard", icon: "el-icon-postcard",
show: false, show: false,
}, },
{
title: "会计事项平台",
path: "/businessMatter",
icon: "el-icon-postcard",
show: false,
},
], ],
}; };
}, },
@ -188,7 +197,8 @@ export default {
url.includes("MasterDataCenter") || url.includes("MasterDataCenter") ||
url.includes("IntegrationTaskCenter") || url.includes("IntegrationTaskCenter") ||
url.includes("businessCenter") || url.includes("businessCenter") ||
url.includes("ApplicationCenter") url.includes("ApplicationCenter") ||
url.includes("businessMatter")
) { ) {
this.$store.dispatch("settings/changeSetting", { this.$store.dispatch("settings/changeSetting", {
key: "showTagsView", key: "showTagsView",
@ -266,7 +276,8 @@ export default {
item.path.includes("MasterDataCenter") || item.path.includes("MasterDataCenter") ||
item.path.includes("IntegrationTaskCenter") || item.path.includes("IntegrationTaskCenter") ||
item.path.includes("businessCenter") || item.path.includes("businessCenter") ||
item.path.includes("ApplicationCenter") item.path.includes("ApplicationCenter") ||
item.path.includes("businessMatter")
) { ) {
this.$store.dispatch("settings/changeSetting", { this.$store.dispatch("settings/changeSetting", {
key: "showTagsView", key: "showTagsView",

View File

@ -21,7 +21,7 @@
class="el-icon-close" class="el-icon-close"
@click.prevent.stop="closeSelectedTag(tag)" @click.prevent.stop="closeSelectedTag(tag)"
/> />
<span v-else class="el-icon-close-else" /> <span v-else class="el-icon-close-else"/>
<span>{{ tag.meta.title ? tag.meta.title : tag.title }}</span> <span>{{ tag.meta.title ? tag.meta.title : tag.title }}</span>
</router-link> </router-link>
</scroll-pane> </scroll-pane>
@ -53,13 +53,14 @@
</template> </template>
<script> <script>
import ScrollPane from "./ScrollPane"; import ScrollPane from './ScrollPane'
import path from "path"; import path from 'path'
import { getCompanyId, getMenuNode } from "@/utils/auth"; import { getCompanyId, getMenuNode } from '@/utils/auth'
import { ChangeCompany } from "@/api/apis/auth"; import { ChangeCompany } from '@/api/apis/auth'
export default { export default {
components: { components: {
ScrollPane, ScrollPane
}, },
data() { data() {
return { return {
@ -68,49 +69,49 @@ export default {
left: 0, left: 0,
selectedTag: {}, selectedTag: {},
affixTags: [], affixTags: [],
visitedViews: [], visitedViews: []
}; }
}, },
computed: { computed: {
routes() { routes() {
return this.$store.state.permission.routes; return this.$store.state.permission.routes
}, },
theme() { theme() {
return this.$store.state.settings.theme; return this.$store.state.settings.theme
}, },
companyID() { companyID() {
return this.$store.state.user.companyID; return this.$store.state.user.companyID
}, }
}, },
watch: { watch: {
"$store.getters.currentMenuNode": { '$store.getters.currentMenuNode': {
deep: true, deep: true,
immediate: true, immediate: true,
handler(newVal, old) { handler(newVal, old) {
this.visitedViews = this.getVisitedViews(); this.visitedViews = this.getVisitedViews()
}, }
}, },
$route() { $route() {
this.addTags(); this.addTags()
this.moveToCurrentTag(); this.moveToCurrentTag()
}, },
visible(value) { visible(value) {
if (value) { if (value) {
document.body.addEventListener("click", this.closeMenu); document.body.addEventListener('click', this.closeMenu)
} else { } else {
document.body.removeEventListener("click", this.closeMenu); document.body.removeEventListener('click', this.closeMenu)
} }
}, },
companyID: { companyID: {
deep: true, // true deep: true, // true
handler: function (newV, oldV) { handler: function(newV, oldV) {
if (newV) { if (newV) {
this.ChangeCompany(newV); this.ChangeCompany(newV)
this.$vmNews("切换公司成功", "success"); this.$vmNews('切换公司成功', 'success')
this.closeAllTags(this.closeAllTags); this.closeAllTags(this.closeAllTags)
}
}
} }
},
},
}, },
mounted() { mounted() {
// this.initTags(); // this.initTags();
@ -118,55 +119,57 @@ export default {
}, },
methods: { methods: {
getVisitedViews() { getVisitedViews() {
let url = getMenuNode(); let url = getMenuNode()
let currentData = []; let currentData = []
let data = this.$store.state.tagsView.visitedViews || []; let data = this.$store.state.tagsView.visitedViews || []
if (url) { if (url) {
if (url.includes("Workbench")) { if (url.includes('Workbench')) {
currentData = data[0]; currentData = data[0]
} else if (url.includes("MasterDataCenter")) { } else if (url.includes('MasterDataCenter')) {
currentData = data[1]; currentData = data[1]
} else if (url.includes("IntegrationTaskCenter")) { } else if (url.includes('IntegrationTaskCenter')) {
currentData = data[2]; currentData = data[2]
} else if (url.includes("businessCenter")) { } else if (url.includes('businessCenter')) {
currentData = data[3]; currentData = data[3]
} else if (url.includes("ApplicationCenter")) { } else if (url.includes('ApplicationCenter')) {
currentData = data[4]; currentData = data[4]
} else if (url.includes('businessMatter')) {
currentData = data[5]
} else { } else {
currentData = []; currentData = []
} }
} else { } else {
currentData = []; currentData = []
} }
return currentData; return currentData
}, },
async ChangeCompany(CompanyID) { async ChangeCompany(CompanyID) {
let params = { let params = {
CompanyID: CompanyID, CompanyID: CompanyID
}; }
let res = await ChangeCompany(params); let res = await ChangeCompany(params)
}, },
isActive(route) { isActive(route) {
return route.path === this.$route.path; return route.path === this.$route.path
}, },
activeStyle(tag) { activeStyle(tag) {
if (!this.isActive(tag)) return {}; if (!this.isActive(tag)) return {}
return { return {
"background-color": this.theme, 'background-color': this.theme,
"border-color": this.theme, 'border-color': this.theme
}; }
}, },
isAffix(tag) { isAffix(tag) {
return tag.meta && tag.meta.affix; return tag.meta && tag.meta.affix
}, },
isFirstView() { isFirstView() {
try { try {
return ( return (
this.selectedTag.fullPath === this.visitedViews[1].fullPath || this.selectedTag.fullPath === this.visitedViews[1].fullPath ||
this.selectedTag.fullPath === "/index" this.selectedTag.fullPath === '/index'
); )
} catch (err) { } catch (err) {
return false; return false
} }
}, },
isLastView() { isLastView() {
@ -174,115 +177,119 @@ export default {
return ( return (
this.selectedTag.fullPath === this.selectedTag.fullPath ===
this.visitedViews[this.visitedViews.length - 1].fullPath this.visitedViews[this.visitedViews.length - 1].fullPath
); )
} catch (err) { } catch (err) {
return false; return false
} }
}, },
filterAffixTags(routes, basePath = "/") { filterAffixTags(routes, basePath = '/') {
let tags = []; let tags = []
routes.forEach((route) => { routes.forEach((route) => {
if (route.meta && route.meta.affix) { if (route.meta && route.meta.affix) {
const tagPath = path.resolve(basePath, route.path); const tagPath = path.resolve(basePath, route.path)
tags.push({ tags.push({
fullPath: tagPath, fullPath: tagPath,
path: tagPath, path: tagPath,
name: route.name, name: route.name,
id: route.id ? route.id : 0, id: route.id ? route.id : 0,
meta: { meta: {
...route.meta, ...route.meta
}, }
}); })
} }
if (route.children) { if (route.children) {
const tempTags = this.filterAffixTags(route.children, route.path); const tempTags = this.filterAffixTags(route.children, route.path)
if (tempTags.length >= 1) { if (tempTags.length >= 1) {
tags = [...tags, ...tempTags]; tags = [...tags, ...tempTags]
} }
} }
}); })
return tags; return tags
}, },
initTags() { initTags() {
const affixTags = (this.affixTags = this.filterAffixTags(this.routes)); const affixTags = (this.affixTags = this.filterAffixTags(this.routes))
console.log(affixTags,"affixTags") console.log(affixTags, 'affixTags')
for (const tag of affixTags) { for (const tag of affixTags) {
// Must have tag name // Must have tag name
if (tag.name) { if (tag.name) {
this.$store.dispatch("tagsView/addVisitedView", tag); this.$store.dispatch('tagsView/addVisitedView', tag)
} }
} }
}, },
addTags() { addTags() {
const name = this.$route.meta.title; const name = this.$route.meta.title
// this.$route.meta.noCache = false // this.$route.meta.noCache = false
if (name) { if (name) {
this.$store.dispatch("tagsView/addView", this.$route); this.$store.dispatch('tagsView/addView', this.$route)
if (this.$route.meta && this.$route.meta.link) { if (this.$route.meta && this.$route.meta.link) {
this.$store.dispatch("tagsView/addIframeView", this.$route); this.$store.dispatch('tagsView/addIframeView', this.$route)
} }
} }
return false; return false
}, },
moveToCurrentTag() { moveToCurrentTag() {
const tags = this.$refs.tag; const tags = this.$refs.tag
this.$nextTick(() => { this.$nextTick(() => {
for (const tag of tags) { for (const tag of tags) {
if (tag.to.path === this.$route.path) { if (tag.to.path === this.$route.path) {
this.$refs.scrollPane.moveToTarget(tag); this.$refs.scrollPane.moveToTarget(tag)
// when query is different then update // when query is different then update
if (tag.to.fullPath !== this.$route.fullPath) { if (tag.to.fullPath !== this.$route.fullPath) {
this.$store.dispatch("tagsView/updateVisitedView", this.$route); this.$store.dispatch('tagsView/updateVisitedView', this.$route)
} }
break; break
} }
} }
}); })
}, },
refreshSelectedTag(view) { refreshSelectedTag(view) {
this.$tab.refreshPage(view); this.$tab.refreshPage(view)
if (this.$route.meta && this.$route.meta.link) { if (this.$route.meta && this.$route.meta.link) {
this.$store.dispatch("tagsView/delIframeView", this.$route); this.$store.dispatch('tagsView/delIframeView', this.$route)
} }
}, },
closeSelectedTag(view) { closeSelectedTag(view) {
this.$tab.closePage(view).then(({ visitedViews }) => { this.$tab.closePage(view).then(({ visitedViews }) => {
let url = getMenuNode(); let url = getMenuNode()
let currentData = []; let currentData = []
let data = visitedViews; let data = visitedViews
if (url) { if (url) {
if (url.includes("Workbench")) { if (url.includes('Workbench')) {
currentData = data[0]; currentData = data[0]
} else if (url.includes("MasterDataCenter")) { } else if (url.includes('MasterDataCenter')) {
currentData = data[1]; currentData = data[1]
} else if (url.includes("IntegrationTaskCenter")) { } else if (url.includes('IntegrationTaskCenter')) {
currentData = data[2]; currentData = data[2]
} else if (url.includes("businessCenter")) { } else if (url.includes('businessCenter')) {
currentData = data[3]; currentData = data[3]
} else if (url.includes("ApplicationCenter")) { } else if (url.includes('ApplicationCenter')) {
currentData = data[4]; currentData = data[4]
} else if (url.includes('businessMatter')) {
currentData = data[5]
} }
} }
if (this.isActive(view)) { if (this.isActive(view)) {
this.toLastView(currentData, view); this.toLastView(currentData, view)
} }
}); })
}, },
closeRightTags() { closeRightTags() {
this.$tab.closeRightPage(this.selectedTag).then((visitedViews) => { this.$tab.closeRightPage(this.selectedTag).then((visitedViews) => {
let url = getMenuNode(); let url = getMenuNode()
let INDEX = null; let INDEX = null
if (url) { if (url) {
if (url.includes("Workbench")) { if (url.includes('Workbench')) {
INDEX = 0; INDEX = 0
} else if (url.includes("MasterDataCenter")) { } else if (url.includes('MasterDataCenter')) {
INDEX = 1; INDEX = 1
} else if (url.includes("IntegrationTaskCenter")) { } else if (url.includes('IntegrationTaskCenter')) {
INDEX = 2; INDEX = 2
} else if (url.includes("businessCenter")) { } else if (url.includes('businessCenter')) {
INDEX = 3; INDEX = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes('ApplicationCenter')) {
INDEX = 4; INDEX = 4
} else if (url.includes('businessMatter')) {
INDEX = 5
} }
} }
@ -292,27 +299,29 @@ export default {
(i) => i.fullPath === this.$route.fullPath (i) => i.fullPath === this.$route.fullPath
) )
) { ) {
this.toLastView(visitedViews[INDEX]); this.toLastView(visitedViews[INDEX])
} }
this.visitedViews = this.getVisitedViews(); this.visitedViews = this.getVisitedViews()
} }
}); })
}, },
closeLeftTags() { closeLeftTags() {
this.$tab.closeLeftPage(this.selectedTag).then((visitedViews) => { this.$tab.closeLeftPage(this.selectedTag).then((visitedViews) => {
let url = getMenuNode(); let url = getMenuNode()
let INDEX = null; let INDEX = null
if (url) { if (url) {
if (url.includes("Workbench")) { if (url.includes('Workbench')) {
INDEX = 0; INDEX = 0
} else if (url.includes("MasterDataCenter")) { } else if (url.includes('MasterDataCenter')) {
INDEX = 1; INDEX = 1
} else if (url.includes("IntegrationTaskCenter")) { } else if (url.includes('IntegrationTaskCenter')) {
INDEX = 2; INDEX = 2
} else if (url.includes("businessCenter")) { } else if (url.includes('businessCenter')) {
INDEX = 3; INDEX = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes('ApplicationCenter')) {
INDEX = 4; INDEX = 4
} else if (url.includes('businessMatter')) {
INDEX = 5
} }
} }
if (INDEX != null) { if (INDEX != null) {
@ -321,91 +330,94 @@ export default {
(i) => i.fullPath === this.$route.fullPath (i) => i.fullPath === this.$route.fullPath
) )
) { ) {
this.toLastView(visitedViews[INDEX]); this.toLastView(visitedViews[INDEX])
} }
this.visitedViews = this.getVisitedViews(); this.visitedViews = this.getVisitedViews()
} }
}); })
}, },
closeOthersTags() { closeOthersTags() {
this.$router.push(this.selectedTag).catch(() => {}); this.$router.push(this.selectedTag).catch(() => {
})
this.$tab.closeOtherPage(this.selectedTag).then(() => { this.$tab.closeOtherPage(this.selectedTag).then(() => {
this.moveToCurrentTag(); this.moveToCurrentTag()
this.visitedViews = this.getVisitedViews(); this.visitedViews = this.getVisitedViews()
}); })
}, },
closeAllTags(view) { closeAllTags(view) {
this.$tab.closeAllPage().then(({ visitedViews }) => { this.$tab.closeAllPage().then(({ visitedViews }) => {
let url = getMenuNode(); let url = getMenuNode()
let INDEX = null; let INDEX = null
if (url) { if (url) {
if (url.includes("Workbench")) { if (url.includes('Workbench')) {
INDEX = 0; INDEX = 0
} else if (url.includes("MasterDataCenter")) { } else if (url.includes('MasterDataCenter')) {
INDEX = 1; INDEX = 1
} else if (url.includes("IntegrationTaskCenter")) { } else if (url.includes('IntegrationTaskCenter')) {
INDEX = 2; INDEX = 2
} else if (url.includes("businessCenter")) { } else if (url.includes('businessCenter')) {
INDEX = 3; INDEX = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes('ApplicationCenter')) {
INDEX = 4; INDEX = 4
} else if (url.includes('businessMatter')) {
INDEX = 5
} }
} }
if (INDEX != null) { if (INDEX != null) {
if (this.affixTags.some((tag) => tag.path === this.$route.path)) { if (this.affixTags.some((tag) => tag.path === this.$route.path)) {
return; return
} }
this.toLastView(visitedViews[INDEX], view); this.toLastView(visitedViews[INDEX], view)
this.visitedViews = this.getVisitedViews(); this.visitedViews = this.getVisitedViews()
} }
}); })
}, },
toLastView(visitedViews, view) { toLastView(visitedViews, view) {
const latestView = visitedViews.slice(-1)[0]; const latestView = visitedViews.slice(-1)[0]
if (latestView) { if (latestView) {
this.$router.push(latestView.fullPath); this.$router.push(latestView.fullPath)
} else { } else {
// now the default is to redirect to the home page if there is no tags-view, // now the default is to redirect to the home page if there is no tags-view,
// you can adjust it according to your needs. // you can adjust it according to your needs.
if (view.name === "Dashboard") { if (view.name === 'Dashboard') {
// to reload home page // to reload home page
this.$router.replace({ this.$router.replace({
path: "/redirect" + view.fullPath, path: '/redirect' + view.fullPath
}); })
} else { } else {
this.$router.push("/"); this.$router.push('/')
} }
} }
}, },
openMenu(tag, e) { openMenu(tag, e) {
const menuMinWidth = 105; const menuMinWidth = 105
const offsetLeft = this.$el.getBoundingClientRect().left; // container margin left const offsetLeft = this.$el.getBoundingClientRect().left // container margin left
const offsetWidth = this.$el.offsetWidth; // container width const offsetWidth = this.$el.offsetWidth // container width
const maxLeft = offsetWidth - menuMinWidth; // left boundary const maxLeft = offsetWidth - menuMinWidth // left boundary
const left = e.clientX - offsetLeft + 15; // 15: margin right const left = e.clientX - offsetLeft + 15 // 15: margin right
if (left > maxLeft) { if (left > maxLeft) {
this.left = maxLeft; this.left = maxLeft
} else { } else {
this.left = left; this.left = left
} }
if (this.newVersionSystem) { if (this.newVersionSystem) {
this.top = e.clientY; this.top = e.clientY
} else { } else {
this.top = e.clientY - 40; this.top = e.clientY - 40
} }
this.visible = true; this.visible = true
this.selectedTag = tag; this.selectedTag = tag
}, },
closeMenu() { closeMenu() {
this.visible = false; this.visible = false
}, },
handleScroll() { handleScroll() {
this.closeMenu(); this.closeMenu()
}, }
}, }
}; }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -548,6 +560,7 @@ export default {
transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1); transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
transform-origin: 100% 50%; transform-origin: 100% 50%;
margin-right: 5px; margin-right: 5px;
&:before { &:before {
// transform: scale(0.6); // transform: scale(0.6);
display: inline-block; display: inline-block;
@ -559,6 +572,7 @@ export default {
color: #fff; color: #fff;
} }
} }
.el-icon-close-else { .el-icon-close-else {
width: 16px; width: 16px;
height: 16px; height: 16px;

View File

@ -163,6 +163,15 @@ export const constantRoutes = [{
title: '业务中心', title: '业务中心',
icon: 'dashboard' icon: 'dashboard'
} }
},
{
path: 'businessMatter',
component: () => import('@/views/newVersionView/businessMatter/index'),
name: 'businessMatter',
meta: {
title: '会计事项平台',
icon: 'dashboard'
}
} }
] ]
}, },

View File

@ -6,6 +6,7 @@ const state = {
[], [],
[], [],
[], [],
[],
], ],
cachedViews: [ cachedViews: [
[], [],
@ -13,6 +14,7 @@ const state = {
[], [],
[], [],
[], [],
[],
], ],
iframeViews: [ iframeViews: [
[], [],
@ -20,7 +22,9 @@ const state = {
[], [],
[], [],
[], [],
] []
],
} }
const mutations = { const mutations = {
@ -38,6 +42,10 @@ const mutations = {
Index = 3 Index = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes("ApplicationCenter")) {
Index = 4 Index = 4
}else if (url.includes("businessMatter")) {
Index = 4
}else if (url.includes("businessMatter")) {
Index = 5;
} }
} }
if (Index != null) { if (Index != null) {
@ -63,6 +71,8 @@ const mutations = {
Index = 3 Index = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes("ApplicationCenter")) {
Index = 4 Index = 4
}else if (url.includes("businessMatter")) {
Index = 5;
} }
} }
if (Index != null) { if (Index != null) {
@ -97,6 +107,8 @@ const mutations = {
Index = 3 Index = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes("ApplicationCenter")) {
Index = 4 Index = 4
}else if (url.includes("businessMatter")) {
Index = 5;
} }
} }
if (Index != null) { if (Index != null) {
@ -120,6 +132,8 @@ const mutations = {
Index = 3 Index = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes("ApplicationCenter")) {
Index = 4 Index = 4
}else if (url.includes("businessMatter")) {
Index = 5;
} }
} }
if (Index != null) { if (Index != null) {
@ -146,6 +160,8 @@ const mutations = {
Index = 3 Index = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes("ApplicationCenter")) {
Index = 4 Index = 4
}else if (url.includes("businessMatter")) {
Index = 5;
} }
} }
if (Index != null) { if (Index != null) {
@ -167,6 +183,8 @@ const mutations = {
Index = 3 Index = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes("ApplicationCenter")) {
Index = 4 Index = 4
}else if (url.includes("businessMatter")) {
Index = 5;
} }
} }
if (Index != null) { if (Index != null) {
@ -189,6 +207,8 @@ const mutations = {
Index = 3 Index = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes("ApplicationCenter")) {
Index = 4 Index = 4
}else if (url.includes("businessMatter")) {
Index = 5;
} }
} }
if (Index != null) { if (Index != null) {
@ -212,6 +232,8 @@ const mutations = {
INDEX = 3 INDEX = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes("ApplicationCenter")) {
INDEX = 4 INDEX = 4
}else if (url.includes("businessMatter")) {
Index = 5;
} }
} }
if (INDEX != null) { if (INDEX != null) {
@ -239,6 +261,8 @@ const mutations = {
INDEX = 3 INDEX = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes("ApplicationCenter")) {
INDEX = 4 INDEX = 4
}else if (url.includes("businessMatter")) {
INDEX = 5;
} }
} }
if (INDEX != null) { if (INDEX != null) {
@ -261,6 +285,8 @@ const mutations = {
INDEX = 3 INDEX = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes("ApplicationCenter")) {
INDEX = 4 INDEX = 4
}else if (url.includes("businessMatter")) {
INDEX = 5;
} }
} }
if (INDEX != null) { if (INDEX != null) {
@ -281,6 +307,8 @@ const mutations = {
INDEX = 3 INDEX = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes("ApplicationCenter")) {
INDEX = 4 INDEX = 4
}else if (url.includes("businessMatter")) {
INDEX = 5;
} }
} }
if (INDEX != null) { if (INDEX != null) {
@ -301,6 +329,8 @@ const mutations = {
INDEX = 3 INDEX = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes("ApplicationCenter")) {
INDEX = 4 INDEX = 4
}else if (url.includes("businessMatter")) {
INDEX = 5;
} }
} }
if (INDEX != null) { if (INDEX != null) {
@ -326,6 +356,8 @@ const mutations = {
INDEX = 3 INDEX = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes("ApplicationCenter")) {
INDEX = 4 INDEX = 4
}else if (url.includes("businessMatter")) {
INDEX = 5;
} }
} }
if (INDEX != null) { if (INDEX != null) {
@ -364,6 +396,8 @@ const mutations = {
INDEX = 3 INDEX = 3
} else if (url.includes("ApplicationCenter")) { } else if (url.includes("ApplicationCenter")) {
INDEX = 4 INDEX = 4
}else if (url.includes("businessMatter")) {
INDEX = 5;
} }
} }
if (INDEX != null) { if (INDEX != null) {

View File

@ -0,0 +1,172 @@
/**
desc 业务中心
*/
<template>
<div class="workbench">
<h3 class="workbench-title">全部应用</h3>
<el-tabs>
<el-tab-pane
v-for="(item, index) in routeData"
:key="index"
:label="item.meta ? item.meta.title : ''"
v-if="item.meta"
>
<div class="menuContainer">
<div
v-for="(list, listIndex) in item.children"
class="menuBox"
@click="goRoute(item, list)"
v-if="!list.meta.hidden"
>
<img class="menuIcon" :src="list.meta.icon" v-if="list.meta.icon" />
<img class="menuIcon" src="../logo1.png" v-else />
<p class="menuContent">{{ list.meta.title }}</p>
</div>
</div>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
import { TagsView } from "@/layout/components";
import request from "@/utils/request";
export default {
name: "ApplicationCenter",
components: {
TagsView,
},
created() {
this.$store.dispatch("settings/changeSetting", {
key: "showTagsView",
value: true,
});
},
data() {
return {
routeData: [], //
};
},
mounted() {
let routeList = localStorage.getItem("routeList")
? JSON.parse(localStorage.getItem("routeList"))
: [];
this.routeData = this.OrganizeMenus(routeList);
},
methods: {
goRoute(val, item) {
let routeData = this.$router.resolve({
path: item.path,
name: item.name,
query: { mdmCode: item.meta.mdmCode, viewType: item.meta.viewType },
});
window.open(routeData.href, "_self");
},
// icon
handlerIcon(item) {
let str = "";
if (item.includes("?")) {
str = item.split("?")[1];
} else {
str = item;
}
return str;
},
handlerIconColor(item) {
let color = "";
if (item.includes("?")) {
color = item.split("?")[0];
} else {
color = "#1478F6";
}
return color;
},
//
OrganizeMenus(data) {
let arrData = [];
//
let arrID = ["97c96223dc7747498328562f526a71a1"];
arrID.forEach((a) => {
data.forEach((b) => {
if (a === b.id) {
arrData.push(b);
}
});
});
arrData.forEach((bItem) => {
if (bItem.children && bItem.children.length > 0) {
bItem.children.forEach((cItem) => {
if (cItem.meta.icon) {
this.getLogoUrl(cItem.meta.icon).then((res) => {
let imageUrl =
"data:image/png/jpg;base64," +
btoa(
new Uint8Array(res).reduce(
(el, byte) => el + String.fromCharCode(byte),
""
)
);
this.$set(cItem.meta, "icon", imageUrl);
});
}
});
}
});
return arrData;
},
getLogoUrl(id) {
return request({
url:
"/kangarooDataCenterV3/entranceController/fileDownloadNew?id=" + id,
method: "get",
responseType: "arraybuffer",
}).then((res) => {
return res;
});
},
},
};
</script>
<style lang="scss" scoped>
.workbench {
background: #fff;
padding: 15px;
//margin: 0 10px;
}
.workbench-title {
margin: 15px 0;
}
.menuContainer {
display: flex;
flex-wrap: wrap;
background-color: #fff;
}
.menuBox {
display: flex;
align-items: center;
background: #fafafa;
padding: 10px 15px;
border-radius: 10px;
width: 200px;
margin: 10px;
cursor: pointer;
}
.menuIcon {
width: 36px;
height: 36px;
line-height: 36px;
border-radius: 12px;
margin-right: 10px;
}
.menuContent {
font-size: 14px;
color: #333333;
}
</style>

View File

@ -1,17 +1,17 @@
"use strict"; 'use strict'
const path = require("path"); const path = require('path')
function resolve(dir) { function resolve(dir) {
return path.join(__dirname, dir); return path.join(__dirname, dir)
} }
const CompressionPlugin = require("compression-webpack-plugin"); const CompressionPlugin = require('compression-webpack-plugin')
const name = process.env.VUE_APP_TITLE || "用安数智中台"; // 网页标题 const name = process.env.VUE_APP_TITLE || '用安数智中台' // 网页标题
const port = process.env.port || process.env.npm_config_port || 80; // 端口 const port = process.env.port || process.env.npm_config_port || 80 // 端口
const webpack = require('webpack'); const webpack = require('webpack')
// vue.config.js 配置说明 // vue.config.js 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
@ -21,18 +21,18 @@ module.exports = {
// 默认情况下Vue CLI 会假设你的应用是被部署在一个域名的根路径上 // 默认情况下Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
// publicPath: process.env.NODE_ENV === "production" ? "/" : "./", // publicPath: process.env.NODE_ENV === "production" ? "/" : "./",
publicPath: "./", publicPath: './',
// 在npm run build 或 yarn build 时 生成文件的目录名称要和baseUrl的生产环境路径一致默认dist // 在npm run build 或 yarn build 时 生成文件的目录名称要和baseUrl的生产环境路径一致默认dist
outputDir: "dist", outputDir: 'dist',
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
assetsDir: "webPc", assetsDir: 'webPc',
// 是否开启eslint保存检测有效值ture | false | 'error' // 是否开启eslint保存检测有效值ture | false | 'error'
lintOnSave: process.env.NODE_ENV === "development", lintOnSave: process.env.NODE_ENV === 'development',
// 如果你不需要生产环境的 source map可以将其设置为 false 以加速生产环境构建。 // 如果你不需要生产环境的 source map可以将其设置为 false 以加速生产环境构建。
productionSourceMap: false, productionSourceMap: false,
// webpack-dev-server 相关配置 // webpack-dev-server 相关配置
devServer: { devServer: {
host: "0.0.0.0", host: '0.0.0.0',
// host:"localhost",z // host:"localhost",z
port: port, port: port,
open: true, open: true,
@ -40,110 +40,103 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
// target: `http://hzya.ufyct.com:9067/`, // target: `http://hzya.ufyct.com:9067/`,
target: `http://ufidahz.com.cn:9067/`,
// target: `http://127.0.0.1:9081/`, // target: `http://127.0.0.1:9081/`,
// target: `http://192.168.2.78:9999`, target: `http://192.168.2.189:10086`,//一凡
// target: `http://192.168.2.85:9999`,
// target: `http://192.168.2.78:8080`, // target: `http://192.168.2.78:8080`,
// target: `http://192.168.2.78:10086`,
// target: `http://192.168.2.185:10086`,
// target: `http://192.168.2.83:9999`,
// target:'http://39.170.109.90:8081/',
// target:'http://192.168.2.75:1024/',
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "", ['^' + process.env.VUE_APP_BASE_API]: ''
}
}
}, },
}, disableHostCheck: true
},
disableHostCheck: true,
}, },
css: { css: {
loaderOptions: { loaderOptions: {
sass: { sass: {
sassOptions: { outputStyle: "expanded" }, sassOptions: { outputStyle: 'expanded' }
}, }
}, }
}, },
configureWebpack: { configureWebpack: {
name: name, name: name,
resolve: { resolve: {
alias: { alias: {
"@": resolve("src"), '@': resolve('src')
}, }
}, },
plugins: [ plugins: [
// http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件 // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
new CompressionPlugin({ new CompressionPlugin({
cache: false, // 不启用文件缓存 cache: false, // 不启用文件缓存
test: /\.(js|css|html)?$/i, // 压缩文件格式 test: /\.(js|css|html)?$/i, // 压缩文件格式
filename: "[path].gz[query]", // 压缩后的文件名 filename: '[path].gz[query]', // 压缩后的文件名
algorithm: "gzip", // 使用gzip压缩 algorithm: 'gzip', // 使用gzip压缩
minRatio: 0.8, // 压缩率小于1才会压缩 minRatio: 0.8 // 压缩率小于1才会压缩
}), }),
new webpack.ProvidePlugin({ new webpack.ProvidePlugin({
'window.Quill': 'quill/dist/quill.js', 'window.Quill': 'quill/dist/quill.js',
'Quill': 'quill/dist/quill.js' 'Quill': 'quill/dist/quill.js'
}) })
], ]
}, },
chainWebpack(config) { chainWebpack(config) {
config.plugins.delete("preload"); // TODO: need test config.plugins.delete('preload') // TODO: need test
config.plugins.delete("prefetch"); // TODO: need test config.plugins.delete('prefetch') // TODO: need test
// set svg-sprite-loader // set svg-sprite-loader
config.module.rule("svg").exclude.add(resolve("src/assets/icons")).end(); config.module.rule('svg').exclude.add(resolve('src/assets/icons')).end()
config.module config.module
.rule("icons") .rule('icons')
.test(/\.svg$/) .test(/\.svg$/)
.include.add(resolve("src/assets/icons")) .include.add(resolve('src/assets/icons'))
.end() .end()
.use("svg-sprite-loader") .use('svg-sprite-loader')
.loader("svg-sprite-loader") .loader('svg-sprite-loader')
.options({ .options({
symbolId: "icon-[name]", symbolId: 'icon-[name]'
}) })
.end(); .end()
config.when(process.env.NODE_ENV !== "development", (config) => { config.when(process.env.NODE_ENV !== 'development', (config) => {
config config
.plugin("ScriptExtHtmlWebpackPlugin") .plugin('ScriptExtHtmlWebpackPlugin')
.after("html") .after('html')
.use("script-ext-html-webpack-plugin", [ .use('script-ext-html-webpack-plugin', [
{ {
// `runtime` must same as runtimeChunk name. default is `runtime` // `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/, inline: /runtime\..*\.js$/
}, }
]) ])
.end(); .end()
config.optimization.splitChunks({ config.optimization.splitChunks({
chunks: "all", chunks: 'all',
cacheGroups: { cacheGroups: {
libs: { libs: {
name: "chunk-libs", name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/, test: /[\\/]node_modules[\\/]/,
priority: 10, priority: 10,
chunks: "initial", // only package third parties that are initially dependent chunks: 'initial' // only package third parties that are initially dependent
}, },
elementUI: { elementUI: {
name: "chunk-elementUI", // split elementUI into a single package name: 'chunk-elementUI', // split elementUI into a single package
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm test: /[\\/]node_modules[\\/]_?element-ui(.*)/ // in order to adapt to cnpm
}, },
commons: { commons: {
name: "chunk-commons", name: 'chunk-commons',
test: resolve("src/components"), // can customize your rules test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number minChunks: 3, // minimum common number
priority: 5, priority: 5,
reuseExistingChunk: true, reuseExistingChunk: true
}, }
}, }
}); })
config.optimization.runtimeChunk("single"), config.optimization.runtimeChunk('single'),
{ {
from: path.resolve(__dirname, "./public/robots.txt"), //防爬虫文件 from: path.resolve(__dirname, './public/robots.txt'), //防爬虫文件
to: "./", //到根目录下 to: './' //到根目录下
}; }
}); })
}, }
}; }