This commit is contained in:
yangbin 2024-08-08 09:20:06 +08:00
commit e2b5a10fcf
5 changed files with 34 additions and 9 deletions

Binary file not shown.

View File

@ -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 }})

View File

@ -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,12 +53,15 @@ 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}`)
NProgress.done()
} else {
window.location.href = '' window.location.href = ''
} }
} }
} }
}
} else { } else {
/* has no token*/ /* has no token*/
if (whiteList.indexOf(to.path) !== -1) { if (whiteList.indexOf(to.path) !== -1) {
@ -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) {
next(`/login?redirect=${to.path}`)
} 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://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' // 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()
} }
} }

View File

@ -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) {

View File

@ -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',