diff --git a/src/api/smart/workpermit.js b/src/api/smart/workpermit.js
index 50c8f90..3a69a6f 100644
--- a/src/api/smart/workpermit.js
+++ b/src/api/smart/workpermit.js
@@ -42,7 +42,7 @@ export const add = (row) => {
export const update = (row) => {
return request({
- url: '/api/smart/workpermit/submit',
+ url: '/api/smart/workpermit/update',
method: 'post',
data: row
})
diff --git a/src/api/user.js b/src/api/user.js
index 90138a0..a318491 100644
--- a/src/api/user.js
+++ b/src/api/user.js
@@ -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({
url: '/api/daf-auth/token',
method: 'post',
diff --git a/src/components/scada-login/main.vue b/src/components/scada-login/main.vue
new file mode 100644
index 0000000..8a36238
--- /dev/null
+++ b/src/components/scada-login/main.vue
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
diff --git a/src/permission.js b/src/permission.js
index 8fc72d8..ffdb0ef 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -7,7 +7,8 @@ import store from './store'
import {validatenull} from '@/util/validate'
import {getToken} from '@/util/auth'
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});
const lockPage = store.getters.website.lockPage; //锁屏页
router.beforeEach((to, from, next) => {
@@ -21,7 +22,7 @@ router.beforeEach((to, from, next) => {
next({path: '/'})
} else {
//如果用户信息为空则获取用户信息,获取用户信息失败,跳转到登录页
- if (store.getters.token.length === 0) {
+ if (store.getters.token.length === 0 && !Cookies.get('scada-access-token')) {
store.dispatch('FedLogOut').then(() => {
next({path: '/login'})
})
diff --git a/src/router/page/index.js b/src/router/page/index.js
index 01dcc4d..a1ae221 100644
--- a/src/router/page/index.js
+++ b/src/router/page/index.js
@@ -21,6 +21,18 @@ export default [{
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',
component: () =>
@@ -77,4 +89,4 @@ export default [{
path: '*',
redirect: '/404'
}
-]
\ No newline at end of file
+]
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index f4c6a7a..d913f5b 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -4,9 +4,10 @@ import {isURL, validatenull} from '@/util/validate'
import {deepClone} from '@/util/util'
import webiste from '@/config/website'
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 website from "../../config/website";
+import Cookies from "js-cookie";
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) {
return new Promise((resolve) => {
@@ -118,6 +135,7 @@ const user = {
LogOut({commit}) {
return new Promise((resolve, reject) => {
logout().then(() => {
+ Cookies.remove('scada-access-token');
commit('SET_TOKEN', '');
commit('SET_MENU', [])
commit('SET_MENU_ALL', []);
@@ -134,6 +152,7 @@ const user = {
//注销session
FedLogOut({commit}) {
return new Promise(resolve => {
+ Cookies.remove('scada-access-token');
commit('SET_TOKEN', '');
commit('SET_MENU', []);
commit('SET_MENU_ALL', []);
diff --git a/src/views/inspection/inspectionplan.vue b/src/views/inspection/inspectionplan.vue
index 129e7df..96d4a7b 100644
--- a/src/views/inspection/inspectionplan.vue
+++ b/src/views/inspection/inspectionplan.vue
@@ -320,7 +320,7 @@
return;
}
this.cancelBox = true;
- this.cancelForm.cancelReason = '';
+ this.$refs.cancelForm.resetForm();
},
handleDetailCancel() {
this.$confirm("是否将选择数据改为失效状态?", {
@@ -332,7 +332,7 @@
return lapse(this.ids, this.cancelForm.cancelReason);
})
.then(() => {
- this.cancelForm.cancelReason = '';
+ this.$refs.cancelForm.resetForm();
this.cancelBox = false;
this.onLoad(this.page);
this.$message({
diff --git a/src/views/inspection/inspectionroute.vue b/src/views/inspection/inspectionroute.vue
index 17801cf..89654af 100644
--- a/src/views/inspection/inspectionroute.vue
+++ b/src/views/inspection/inspectionroute.vue
@@ -302,7 +302,7 @@
return;
}
this.cancelBox = true;
- this.cancelForm.cancelReason = '';
+ this.$refs.cancelForm.resetForm();
},
handleDetailCancel() {
this.$confirm("是否将选择数据改为失效状态?", {
@@ -314,7 +314,7 @@
return lapse(this.ids, this.cancelForm.cancelReason);
})
.then(() => {
- this.cancelForm.cancelReason = '';
+ this.$refs.cancelForm.resetForm();
this.cancelBox = false;
this.onLoad(this.page);
this.$message({
diff --git a/src/views/inspection/inspectiontasks.vue b/src/views/inspection/inspectiontasks.vue
index cff2358..ddebc78 100644
--- a/src/views/inspection/inspectiontasks.vue
+++ b/src/views/inspection/inspectiontasks.vue
@@ -563,26 +563,33 @@
return;
}
this.stopBox = true;
+ this.$refs.stopForm.resetForm();
},
submitStop(){
- this.$confirm("是否将选择巡检任务停止?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
+ this.$refs.stopForm.validate((valid, done, msg) => {
+ if (valid) {
+ done()
+ this.$confirm("是否将选择巡检任务停止?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return stop(this.ids, this.stopForm.cancelReason);
+ })
+ .then(() => {
+ this.$refs.stopForm.resetForm();
+ this.stopBox = false;
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
+ this.$refs.crud.toggleSelection();
+ });
+ }
})
- .then(() => {
- return stop(this.ids, this.stopForm.cancelReason);
- })
- .then(() => {
- this.stopForm.cancelReason = '';
- this.stopBox = false;
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
- this.$refs.crud.toggleSelection();
- });
+
},
handleExport() {
this.$confirm("是否导出数据?", "提示", {
diff --git a/src/views/leger/equipmentledgerDetail.vue b/src/views/leger/equipmentledgerDetail.vue
index 4c4bbcf..58d9942 100644
--- a/src/views/leger/equipmentledgerDetail.vue
+++ b/src/views/leger/equipmentledgerDetail.vue
@@ -392,7 +392,6 @@
format: 'yyyy/MM/dd',
valueFormat: "yyyyMMdd",
span: 6,
- maxlength: 20,
},
{
label: "供应商",
@@ -1085,4 +1084,8 @@
justify-content: flex-end; /* 将子元素推到容器的末端 */
}
+ .head-style{
+ background-color: #3366cc !important;
+ color: #FFFFFF !important;
+ }
diff --git a/src/views/release/productioninformation.vue b/src/views/release/productioninformation.vue
index 6890535..9a3fe2d 100644
--- a/src/views/release/productioninformation.vue
+++ b/src/views/release/productioninformation.vue
@@ -508,7 +508,7 @@
diff --git a/src/views/smart/operationticketDetail.vue b/src/views/smart/operationticketDetail.vue
index 204159c..bce13e3 100644
--- a/src/views/smart/operationticketDetail.vue
+++ b/src/views/smart/operationticketDetail.vue
@@ -922,7 +922,7 @@ export default {