Merge remote-tracking branch 'origin/main'

main
zhen 11 months ago
commit 91735f7985
  1. 2
      src/api/smart/workpermit.js
  2. 9
      src/api/user.js
  3. 41
      src/components/scada-login/main.vue
  4. 5
      src/permission.js
  5. 12
      src/router/page/index.js
  6. 21
      src/store/modules/user.js
  7. 4
      src/views/inspection/inspectionplan.vue
  8. 4
      src/views/inspection/inspectionroute.vue
  9. 9
      src/views/inspection/inspectiontasks.vue
  10. 5
      src/views/leger/equipmentledgerDetail.vue
  11. 2
      src/views/release/productioninformation.vue
  12. 2
      src/views/smart/operationticketDetail.vue
  13. 2
      src/views/smart/workpermitDetail.vue
  14. 6
      src/views/spares/materialDetail.vue
  15. 1
      src/views/wel/index.vue

@ -42,7 +42,7 @@ export const add = (row) => {
export const update = (row) => { export const update = (row) => {
return request({ return request({
url: '/api/smart/workpermit/submit', url: '/api/smart/workpermit/update',
method: 'post', method: 'post',
data: row data: row
}) })

@ -18,6 +18,15 @@ export const loginByUsername = (tenantId, account, password, type, key, code) =>
} }
}); });
export const loginByScada = (token) => request({
url: '/api/daf-auth/scada-token',
method: 'post',
params: {
token
}
});
export const loginBySocial = (tenantId, source, code, state) => request({ export const loginBySocial = (tenantId, source, code, state) => request({
url: '/api/daf-auth/token', url: '/api/daf-auth/token',
method: 'post', method: 'post',

@ -0,0 +1,41 @@
<template>
<div></div>
</template>
<script>
import {mapGetters} from "vuex";
export default {
name: "scada-sso",
data() {
return {
loginForm: {
token: null
}
};
},
created() {
},
mounted() {
this.handleLogin();
},
computed: {
...mapGetters(["tagWel"])
},
props: [],
methods: {
handleLogin() {
let token = this.$route.query.SSOToken;
this.loginForm.token = token;
this.$store.dispatch("loginByScada", this.loginForm).then(() => {
this.$router.push({path: this.tagWel.value});
}).catch(() => {
this.$router.push({path: "/403"});
});
},
}
};
</script>
<style>
</style>

@ -7,7 +7,8 @@ import store from './store'
import {validatenull} from '@/util/validate' import {validatenull} from '@/util/validate'
import {getToken} from '@/util/auth' import {getToken} from '@/util/auth'
import NProgress from 'nprogress' // progress bar import NProgress from 'nprogress' // progress bar
import 'nprogress/nprogress.css' // progress bar style import 'nprogress/nprogress.css'
import Cookies from "js-cookie"; // progress bar style
NProgress.configure({showSpinner: false}); NProgress.configure({showSpinner: false});
const lockPage = store.getters.website.lockPage; //锁屏页 const lockPage = store.getters.website.lockPage; //锁屏页
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
@ -21,7 +22,7 @@ router.beforeEach((to, from, next) => {
next({path: '/'}) next({path: '/'})
} else { } else {
//如果用户信息为空则获取用户信息,获取用户信息失败,跳转到登录页 //如果用户信息为空则获取用户信息,获取用户信息失败,跳转到登录页
if (store.getters.token.length === 0) { if (store.getters.token.length === 0 && !Cookies.get('scada-access-token')) {
store.dispatch('FedLogOut').then(() => { store.dispatch('FedLogOut').then(() => {
next({path: '/login'}) next({path: '/login'})
}) })

@ -21,6 +21,18 @@ export default [{
isAuth: false isAuth: false
} }
}, },
{
path: '/scada-login',
requiresAuth: false,
name: 'scada登录',
component: () =>
import( /* webpackChunkName: "page" */ '@/components/scada-login/main'),
meta: {
keepAlive: true,
isTab: false,
isAuth: false,
}
},
{ {
path: '/404', path: '/404',
component: () => component: () =>

@ -4,9 +4,10 @@ import {isURL, validatenull} from '@/util/validate'
import {deepClone} from '@/util/util' import {deepClone} from '@/util/util'
import webiste from '@/config/website' import webiste from '@/config/website'
import {Message, Notification} from 'element-ui' import {Message, Notification} from 'element-ui'
import {loginByUsername, loginBySocial, getUserInfo, getMenu, getTopMenu, logout, refreshToken, getButtons, getLicense} from '@/api/user' import {loginByUsername, loginByScada, loginBySocial, getUserInfo, getMenu, getTopMenu, logout, refreshToken, getButtons, getLicense} from '@/api/user'
import vue from '../../main.js' import vue from '../../main.js'
import website from "../../config/website"; import website from "../../config/website";
import Cookies from "js-cookie";
function addPath(ele, first) { function addPath(ele, first) {
@ -58,6 +59,22 @@ const user = {
}) })
}) })
}, },
loginByScada({commit}, userInfo) {
return new Promise((resolve, reject) => {
loginByScada(userInfo.token).then(res => {
const data = res.data.data;
var inFifteenMinutes = new Date(new Date().getTime() + 120 * 60 * 1000);
Cookies.set('scada-access-token', data.accessToken, { expires: inFifteenMinutes });
commit('SET_TOKEN', data.accessToken);
commit('SET_USER_INFO', data);
commit('DEL_ALL_TAG');
commit('CLEAR_LOCK');
resolve();
}).catch(error => {
reject(error);
})
})
},
//根据第三方信息登录 //根据第三方信息登录
LoginBySocial({ commit }, userInfo) { LoginBySocial({ commit }, userInfo) {
return new Promise((resolve) => { return new Promise((resolve) => {
@ -118,6 +135,7 @@ const user = {
LogOut({commit}) { LogOut({commit}) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
logout().then(() => { logout().then(() => {
Cookies.remove('scada-access-token');
commit('SET_TOKEN', ''); commit('SET_TOKEN', '');
commit('SET_MENU', []) commit('SET_MENU', [])
commit('SET_MENU_ALL', []); commit('SET_MENU_ALL', []);
@ -134,6 +152,7 @@ const user = {
//注销session //注销session
FedLogOut({commit}) { FedLogOut({commit}) {
return new Promise(resolve => { return new Promise(resolve => {
Cookies.remove('scada-access-token');
commit('SET_TOKEN', ''); commit('SET_TOKEN', '');
commit('SET_MENU', []); commit('SET_MENU', []);
commit('SET_MENU_ALL', []); commit('SET_MENU_ALL', []);

@ -320,7 +320,7 @@
return; return;
} }
this.cancelBox = true; this.cancelBox = true;
this.cancelForm.cancelReason = ''; this.$refs.cancelForm.resetForm();
}, },
handleDetailCancel() { handleDetailCancel() {
this.$confirm("是否将选择数据改为失效状态?", { this.$confirm("是否将选择数据改为失效状态?", {
@ -332,7 +332,7 @@
return lapse(this.ids, this.cancelForm.cancelReason); return lapse(this.ids, this.cancelForm.cancelReason);
}) })
.then(() => { .then(() => {
this.cancelForm.cancelReason = ''; this.$refs.cancelForm.resetForm();
this.cancelBox = false; this.cancelBox = false;
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({

@ -302,7 +302,7 @@
return; return;
} }
this.cancelBox = true; this.cancelBox = true;
this.cancelForm.cancelReason = ''; this.$refs.cancelForm.resetForm();
}, },
handleDetailCancel() { handleDetailCancel() {
this.$confirm("是否将选择数据改为失效状态?", { this.$confirm("是否将选择数据改为失效状态?", {
@ -314,7 +314,7 @@
return lapse(this.ids, this.cancelForm.cancelReason); return lapse(this.ids, this.cancelForm.cancelReason);
}) })
.then(() => { .then(() => {
this.cancelForm.cancelReason = ''; this.$refs.cancelForm.resetForm();
this.cancelBox = false; this.cancelBox = false;
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({

@ -563,8 +563,12 @@
return; return;
} }
this.stopBox = true; this.stopBox = true;
this.$refs.stopForm.resetForm();
}, },
submitStop(){ submitStop(){
this.$refs.stopForm.validate((valid, done, msg) => {
if (valid) {
done()
this.$confirm("是否将选择巡检任务停止?", { this.$confirm("是否将选择巡检任务停止?", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
@ -574,7 +578,7 @@
return stop(this.ids, this.stopForm.cancelReason); return stop(this.ids, this.stopForm.cancelReason);
}) })
.then(() => { .then(() => {
this.stopForm.cancelReason = ''; this.$refs.stopForm.resetForm();
this.stopBox = false; this.stopBox = false;
this.onLoad(this.page); this.onLoad(this.page);
this.$message({ this.$message({
@ -583,6 +587,9 @@
}); });
this.$refs.crud.toggleSelection(); this.$refs.crud.toggleSelection();
}); });
}
})
}, },
handleExport() { handleExport() {
this.$confirm("是否导出数据?", "提示", { this.$confirm("是否导出数据?", "提示", {

@ -392,7 +392,6 @@
format: 'yyyy/MM/dd', format: 'yyyy/MM/dd',
valueFormat: "yyyyMMdd", valueFormat: "yyyyMMdd",
span: 6, span: 6,
maxlength: 20,
}, },
{ {
label: "供应商", label: "供应商",
@ -1085,4 +1084,8 @@
justify-content: flex-end; /* 将子元素推到容器的末端 */ justify-content: flex-end; /* 将子元素推到容器的末端 */
} }
.head-style{
background-color: #3366cc !important;
color: #FFFFFF !important;
}
</style> </style>

@ -508,7 +508,7 @@
<style> <style>
.head-style{ .head-style{
background-color: #1e9fff !important; background-color: #3366cc !important;
color: #FFFFFF !important; color: #FFFFFF !important;
} }
</style> </style>

@ -922,7 +922,7 @@ export default {
</script> </script>
<style> <style>
.head-style{ .head-style{
background-color: #1e9fff !important; background-color: #3366cc !important;
color: #FFFFFF !important; color: #FFFFFF !important;
} }
.frame_class1 input.el-input__inner { .frame_class1 input.el-input__inner {

@ -800,7 +800,7 @@
</script> </script>
<style> <style>
.head-style{ .head-style{
background-color: #1e9fff !important; background-color: #3366cc !important;
color: #FFFFFF !important; color: #FFFFFF !important;
} }

@ -442,8 +442,7 @@
}, },
methods: { methods: {
test(val) { test(val) {
this.diaForm.code = ''; this.$refs.diaForm.resetForm();
this.diaForm.type = '';
this.dialogVisible = true; this.dialogVisible = true;
}, },
handleFormSubmit() { handleFormSubmit() {
@ -632,8 +631,7 @@
if (valid) { if (valid) {
done() done()
codeAdd(this.diaForm).then(() => { codeAdd(this.diaForm).then(() => {
this.diaForm.code = ''; this.$refs.diaForm.resetForm();
this.diaForm.type = '';
this.dialogVisible = false; this.dialogVisible = false;
this.SearchClassCode(); this.SearchClassCode();
this.$message({ this.$message({

@ -37,6 +37,7 @@
&& !homePageData.manufacturerInfoAudit && !homePageData.manufacturerInfoAudit
&& !homePageData.warehouseAudit && !homePageData.warehouseAudit
&& !homePageData.workPermitAudit && !homePageData.workPermitAudit
&& !homePageData.materialAudit
&& !homePageData.workOperationTicketAudit && !homePageData.workOperationTicketAudit
&& !homePageData.toolInventoryRecordsAudit && !homePageData.toolInventoryRecordsAudit
&& !homePageData.equipmentLedgerAudit"> && !homePageData.equipmentLedgerAudit">

Loading…
Cancel
Save