Browse Source

2026-09-15

oa跳转plm优化
master
fengyuan_yang 4 days ago
parent
commit
c5ce9d8dc2
  1. 4
      src/router/index.js
  2. 16
      src/views/common/login-token.vue
  3. 4
      src/views/modules/customer/customerInformationManagement.vue
  4. 53
      src/views/modules/project/projectInfo/projectInfo.vue

4
src/router/index.js

@ -124,9 +124,9 @@ function fnAddDynamicMenuRoutes (menuList = [], routes = []) {
} else if (menuList[i].url && /\S/.test(menuList[i].url)) { } else if (menuList[i].url && /\S/.test(menuList[i].url)) {
menuList[i].url = menuList[i].url.replace(/^\//, '') menuList[i].url = menuList[i].url.replace(/^\//, '')
var route = { var route = {
path: menuList[i].url.replace('/', '-'),
path: menuList[i].url.replace(/\//g, '-'),
component: null, component: null,
name: menuList[i].url.replace('/', '-'),
name: menuList[i].url.replace(/\//g, '-'),
meta: { meta: {
menuId: menuList[i].menuId, menuId: menuList[i].menuId,
title: menuList[i].name, title: menuList[i].name,

16
src/views/common/login-token.vue

@ -70,12 +70,24 @@
for(let i = 0,len = paramsArr.length;i < len;i++){ for(let i = 0,len = paramsArr.length;i < len;i++){
// = key:value // = key:value
let arr = paramsArr[i].split('=') let arr = paramsArr[i].split('=')
obj[arr[0]] = arr[1];
obj[arr[0]] = arr[1] ? decodeURIComponent(arr[1]) : arr[1];
} }
this.urlParam = obj this.urlParam = obj
this.dataFormSubmit() this.dataFormSubmit()
}, },
// name url '/' '-'
// OA project-projectInfo/projectInfo
normalizeRouteName (path) {
if (!path) {
return path
}
if (path === 'project-projectInfo/projectInfo') {
return 'project-projectInfo-projectInfo'
}
return path
},
getSiteData () { getSiteData () {
let data = {} let data = {}
getSiteData(data).then(({data}) => { getSiteData(data).then(({data}) => {
@ -105,7 +117,7 @@
if (data && data.code === 0) { if (data && data.code === 0) {
this.$cookie.set('token_plm', data.token) this.$cookie.set('token_plm', data.token)
this.$router.replace({ this.$router.replace({
name: this.urlParam.path,
name: this.normalizeRouteName(this.urlParam.path),
params: { params: {
site: data.site, site: data.site,
docNo: this.urlParam.docNo, docNo: this.urlParam.docNo,

4
src/views/modules/customer/customerInformationManagement.vue

@ -3251,10 +3251,10 @@ export default {
return s return s
}, },
clickProjectId(projectId) { clickProjectId(projectId) {
if (this.$router.resolve('project-projectInfo/projectInfo').resolved.name === '404') {
if (this.$router.resolve('project-projectInfo-projectInfo').resolved.name === '404') {
this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',}); this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',});
} else { } else {
this.$router.push({name: "project-projectInfo/projectInfo", params: {projectId: projectId},})
this.$router.push({name: "project-projectInfo-projectInfo", params: {projectId: projectId},})
} }
}, },
rowStyle({row}) { rowStyle({row}) {

53
src/views/modules/project/projectInfo/projectInfo.vue

@ -1424,6 +1424,7 @@
this.authIssue = this.isAuth(this.menuId + ':issue') this.authIssue = this.isAuth(this.menuId + ':issue')
this.checkSuperAdmin() this.checkSuperAdmin()
this.fetchNodeOptions() this.fetchNodeOptions()
this.handleRouteQuery()
this.$nextTick(() => { this.$nextTick(() => {
//this.height = window.innerHeight - 520; //this.height = window.innerHeight - 520;
this.height = window.innerHeight / 2 - 50 this.height = window.innerHeight / 2 - 50
@ -2308,13 +2309,55 @@
return true return true
}, },
handleRouteQuery () {
const routeParams = this.$route.params || {}
const isTokenLogin = routeParams.type === 'tokenLogin'
const projectId = String(routeParams.docNo || routeParams.projectId || '').trim()
if (isTokenLogin) {
if (!projectId) {
return
}
if (this.addOrUpdateVisible && this.currentRow && String(this.currentRow.projectId || '').trim() === projectId) {
return
}
this.searchData.projectId = projectId
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
this.searchData.userId = this.$store.state.user.id
this.searchData.menuId = this.menuId
projectInfoSearch(this.searchData).then(({data}) => {
if (data.code == 0) {
this.dataList1 = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
if (this.dataList1 && this.dataList1.length > 0) {
this.$nextTick(() => {
if (this.$refs.mainTable) {
this.$refs.mainTable.setCurrentRow(this.dataList1[0])
}
this.changeData(this.dataList1[0])
this.addOrUpdateVisible = true
this.addOrUpdate = 'update'
this.$nextTick(() => {
this.$refs.addOrUpdate.init(this.dataList1[0].id)
})
})
}
}
this.dataListLoading = false
})
return
}
if (projectId) {
this.searchData.projectId = projectId
this.search()
}
},
}, },
activated() { activated() {
if (this.$route.params.projectId){
this.searchData.projectId = this.$route.params.projectId
this.search();
}
// this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
this.handleRouteQuery()
}, },
} }
</script> </script>

Loading…
Cancel
Save