Merge branch 'master' of https://code.siemens.com/cs-psm-dig/siemens.emp.ui
This commit is contained in:
commit
e2b5a10fcf
Binary file not shown.
|
@ -10,7 +10,8 @@ export const reqGetRegionAndCity = () => request({ url: `/WRD-admin/sys/user/Rei
|
||||||
// export const reqSelectEngiStatus = (year, month, page, limit) => request({ url: `/WRD-admin/sys/workorder/page`, method: 'get', params: { year, month, page, limit } });
|
// export const reqSelectEngiStatus = (year, month, page, limit) => request({ url: `/WRD-admin/sys/workorder/page`, method: 'get', params: { year, month, page, limit } });
|
||||||
|
|
||||||
// 带部门
|
// 带部门
|
||||||
export const reqSelectEngiStatusByDept = (year, month, deptId, page, limit) => request({ url: `/WRD-admin/sys/workorder/pageSelect`, method: 'get', params: { year, month, deptId, page, limit }})
|
// export const reqSelectEngiStatusByDept = (year, month, deptId, page, limit) => request({ url: `/WRD-admin/sys/workorder/pageSelect`, method: 'get', params: { year, month, deptId, page, limit }})
|
||||||
|
export const reqSelectEngiStatusByDept = (year, month, deptId, page, limit, gids) => request({ url: `/WRD-admin/sys/workorder/pageSelectV2`, method: 'get', params: { year, month, deptId, page, limit, gids }})
|
||||||
|
|
||||||
// 工程师状态查询
|
// 工程师状态查询
|
||||||
export const reqSelectEngiStatusByMap = (year, month, page, limit) => request({ url: `/WRD-admin/sys/workorder/pageSelect`, method: 'get', params: { year, month, page, limit }})
|
export const reqSelectEngiStatusByMap = (year, month, page, limit) => request({ url: `/WRD-admin/sys/workorder/pageSelect`, method: 'get', params: { year, month, page, limit }})
|
||||||
|
|
|
@ -20,6 +20,20 @@ router.beforeEach(async(to, from, next) => {
|
||||||
// determine whether the user has logged in
|
// determine whether the user has logged in
|
||||||
const hasToken = getToken()
|
const hasToken = getToken()
|
||||||
|
|
||||||
|
// 检查当前环境
|
||||||
|
const isDevelopment = process.env.NODE_ENV === 'development'
|
||||||
|
const isProduction = process.env.NODE_ENV === 'production'
|
||||||
|
|
||||||
|
// 根据环境启用或禁用某些代码
|
||||||
|
// 开发环境不启用ONEID
|
||||||
|
if (isDevelopment) {
|
||||||
|
console.log('开发环境,启用某些代码')
|
||||||
|
// 启用某些代码
|
||||||
|
} else if (isProduction) {
|
||||||
|
console.log('生产环境,禁用某些代码')
|
||||||
|
// 禁用某些代码
|
||||||
|
}
|
||||||
|
|
||||||
if (hasToken) {
|
if (hasToken) {
|
||||||
if (to.path === '/login' || to.path === '/callback') {
|
if (to.path === '/login' || to.path === '/callback') {
|
||||||
// if is logged in, redirect to the home page
|
// if is logged in, redirect to the home page
|
||||||
|
@ -39,9 +53,12 @@ router.beforeEach(async(to, from, next) => {
|
||||||
// remove token and go to login page to re-login
|
// remove token and go to login page to re-login
|
||||||
await store.dispatch('user/resetToken')
|
await store.dispatch('user/resetToken')
|
||||||
Message.error(error || 'Has Error')
|
Message.error(error || 'Has Error')
|
||||||
// next(`/login?redirect=${to.path}`)
|
if (isDevelopment) {
|
||||||
// NProgress.done()
|
next(`/login?redirect=${to.path}`)
|
||||||
window.location.href = ''
|
NProgress.done()
|
||||||
|
} else {
|
||||||
|
window.location.href = ''
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,9 +69,12 @@ router.beforeEach(async(to, from, next) => {
|
||||||
next()
|
next()
|
||||||
} else {
|
} else {
|
||||||
// other pages that do not have permission to access are redirected to the login page.
|
// other pages that do not have permission to access are redirected to the login page.
|
||||||
// next(`/login?redirect=${to.path}`)
|
if (isDevelopment) {
|
||||||
window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://csdc.siemens.com.cn:8001/callback&scope=openid%20phone'
|
next(`/login?redirect=${to.path}`)
|
||||||
// window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://localhost:9528/callback&scope=openid%20phone'
|
} else {
|
||||||
|
window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://csdc.siemens.com.cn:8001/callback&scope=openid%20phone'
|
||||||
|
// window.location.href = 'https://api.oneid.siemens.com.cn/api/bff/v1.2/developer/ciam/oauth/authorize?client_id=1b867769c8cb221fb7fdb0f8beba6138TwXkI4mX8um&response_type=code&redirect_uri=http://localhost:9528/callback&scope=openid%20phone'
|
||||||
|
}
|
||||||
NProgress.done()
|
NProgress.done()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1293,15 +1293,19 @@ export default {
|
||||||
}
|
}
|
||||||
this.engiArray = resultOfSelectEngisByDept.data.list
|
this.engiArray = resultOfSelectEngisByDept.data.list
|
||||||
this.total = resultOfSelectEngisByDept.data.total
|
this.total = resultOfSelectEngisByDept.data.total
|
||||||
|
console.log(this.engiArray.map(item => item.gid))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const gids = this.engiArray.map(item => item.gid).join(',')
|
||||||
|
console.log(gids)
|
||||||
const resOfSelectEngiStatusByMap =
|
const resOfSelectEngiStatusByMap =
|
||||||
await this.$API.select.reqSelectEngiStatusByDept(
|
await this.$API.select.reqSelectEngiStatusByDept(
|
||||||
year,
|
year,
|
||||||
month,
|
month,
|
||||||
departmentId,
|
departmentId,
|
||||||
page,
|
page,
|
||||||
limit
|
limit,
|
||||||
|
gids
|
||||||
)
|
)
|
||||||
console.log(this.engiArray, resOfSelectEngiStatusByMap)
|
console.log(this.engiArray, resOfSelectEngiStatusByMap)
|
||||||
if (resOfSelectEngiStatusByMap.code === 0) {
|
if (resOfSelectEngiStatusByMap.code === 0) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ module.exports = {
|
||||||
* In most cases please use '/' !!!
|
* In most cases please use '/' !!!
|
||||||
* Detail: https://cli.vuejs.org/config/#publicpath
|
* Detail: https://cli.vuejs.org/config/#publicpath
|
||||||
*/
|
*/
|
||||||
publicPath: './',
|
publicPath: '/',
|
||||||
outputDir: 'dist',
|
outputDir: 'dist',
|
||||||
assetsDir: 'static',
|
assetsDir: 'static',
|
||||||
lintOnSave: process.env.NODE_ENV === 'development',
|
lintOnSave: process.env.NODE_ENV === 'development',
|
||||||
|
|
Loading…
Reference in New Issue