From d36a3b011cd63274a9470b8fe63971bb46a2c136 Mon Sep 17 00:00:00 2001
From: Your Name <123456>
Date: 星期三, 11 五月 2022 12:03:36 +0800
Subject: [PATCH] Merge branch 'master' of https://sinanoaq.cn:8888/r/ztqt
---
src/api/dictionary.js | 10 +++++
src/views/majorHazardSourceMonitoring/productionEquipment/index.vue | 31 +++++++++++++++
src/views/exam/index.vue | 36 +++++++-----------
3 files changed, 55 insertions(+), 22 deletions(-)
diff --git a/src/api/dictionary.js b/src/api/dictionary.js
index 0b1bfd4..c6f83d5 100644
--- a/src/api/dictionary.js
+++ b/src/api/dictionary.js
@@ -101,3 +101,13 @@
data
})
}
+
+export function getItemsByType(type) {
+ return request({
+ headers:{
+ 'Authorization': getToken()
+ },
+ url: process.env.BASE_API+'/dictionaryAllItems?dictionaryType='+type,
+ method: 'get',
+ })
+}
diff --git a/src/views/exam/index.vue b/src/views/exam/index.vue
index 283a7aa..f673765 100644
--- a/src/views/exam/index.vue
+++ b/src/views/exam/index.vue
@@ -2,7 +2,7 @@
<div class="app-container">
<el-alert
:title="message"
- :type="flag?'success':'error'">
+ :type="userType !== 1?'success':'error'">
</el-alert>
</div>
@@ -14,42 +14,34 @@
import {getToken} from "@/utils/auth"
import Cookies from 'js-cookie'
import request from '@/utils/request'
+ import { mapGetters } from 'vuex'
export default {
name: "current",
created(){
this.getExamAuth()
},
+ computed: {
+ ...mapGetters([
+ 'userType'
+ ])
+ },
data(){
return {
pass:false,
- message: ''
+ message: '',
+ flag:false,
}
},
methods:{
queryHandle(){
},
getExamAuth(){
- getExamAuth({token:getToken()})
- .then(res=>{
- if (res.data.code === 'failure') {
- this.flag = false
- this.message = res.data.message;
- }
- if (res.data.code === 'success') {
- this.flag = true
- this.message = res.data.message
- Cookies.set('JSESSIONID',res.data.data.ssid)
- window.open(process.env.NANO_API + "/foreground/system/noLogin/redirect?sessionId="+res.data.data.ssid )
-
- }
- })
- .catch(err=>{
- console.log(err)
- this.flag = false
- this.message = '请求出现问题,请联系管理员'
- })
-
+ if (this.userType !== 1) {
+ window.open(process.env.NANO_API + "/foreground/system/auth/verify.do?tokens=" + getToken());
+ this.message ='拥有权限登入'
+ }
+ else this.message = '没有权限登入';
}
}
diff --git a/src/views/majorHazardSourceMonitoring/productionEquipment/index.vue b/src/views/majorHazardSourceMonitoring/productionEquipment/index.vue
index 2949b54..967eb47 100644
--- a/src/views/majorHazardSourceMonitoring/productionEquipment/index.vue
+++ b/src/views/majorHazardSourceMonitoring/productionEquipment/index.vue
@@ -36,6 +36,8 @@
</el-table-column>
<el-table-column prop="name" align="center" label="设备名称">
</el-table-column>
+ <el-table-column prop="areaName" align="center" label="设备区域">
+ </el-table-column>
<el-table-column label="状态" align="center">
<template slot-scope="scope">
<span v-if="scope.row.status == 0">在用</span>
@@ -141,6 +143,24 @@
</el-select>
</el-form-item>
</el-col>
+ <el-col :span="12">
+ <el-form-item label="设备区域" prop="areaId">
+ <el-select
+ v-model="form.areaId"
+ placeholder="请选择设备区域"
+ style="width: 100%"
+ filterable
+ >
+ <el-option
+ v-for="item in areaList"
+ :key="item.id"
+ :label="item.value"
+ :value="item.id"
+ >
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
@@ -160,6 +180,7 @@
majorEquipmentDel,
majorEquipmentLis
} from "@/api/majorEquipment.js";
+ import {getItemsByType} from '@/api/dictionary'
export default {
data() {
return {
@@ -198,16 +219,26 @@
name:{ required: true, message: "设备名称不能为空", trigger: "change" },
status:{ required: true, message: "状态不能为空", trigger: "change" },
userId:{ required: true, message: "负责人不能为空", trigger: "change" },
+ areaId:{ required: true, message: "设备区域不能为空", trigger: "change" },
},
unitIdOptions:[{label:"在用",value:0},{label:"停用",value:1}],
personInCharge:[],
+ areaList:[],
};
},
created() {
this.elementManagementL();
+ this.initDictionaryAllItems()
this.productionMajorEquipmentErt();
},
methods: {
+ initDictionaryAllItems(){
+ getItemsByType('设备区域').then(res=>{
+ if (res.data.code ==200){
+ this.areaList=res.data.result
+ }
+ })
+ },
productionMajorEquipmentErt(){
majorEquipmentLis().then(res=>{
if (res.data.code ==200){
--
Gitblit v1.9.2