dedsudiyu 1 dia atrás
pai
commit
407dce78b9

+ 2 - 2
api/request/config.js

@@ -2,7 +2,7 @@ const config = {
 	/************************************ 后台服务地址 ************************************/
 	
 	// base_url: 'http://192.168.1.43/api', //43服务器
-	base_url: 'http://192.168.1.8/api',//1.8服务器
+	// base_url: 'http://192.168.1.8/api',//1.8服务器
 	// base_url: 'http://192.168.1.9:8080',//柴
 	// base_url: 'http://192.168.1.24:8080',//林总
 	// base_url: 'http://192.168.1.7:8080',//刘波
@@ -13,7 +13,7 @@ const config = {
 	// base_url: 'http://192.168.1.29:8080',//何成
 	// base_url: 'https://demo.zjznai.com/xzgd/',
 	// base_url: 'https://lab.zjznai.com/labNhSystem/',//43服务器高升测试
-	// base_url: 'https://lab.zjznai.com/labTest/',//1.8外网
+	base_url: 'https://lab.zjznai.com/labTest/',//1.8外网
 	// base_url: 'https://lab.zjznai.com/labapp/',//43服务器线上
 	// base_url: 'https://lab.zjznai.com/appTest/',//88服务器线上
 	// base_url: 'https://lab.zjznai.com/labSystem/', //矿大地址

+ 8 - 0
pages/api/index.js

@@ -538,4 +538,12 @@ export const chemicalAppletSelectStockInfo  = (data) => {
 				method: 'POST',
 				data: { ...data }
     })
+};
+//查询是否是管理员/安全员
+export const systemSubjectCheckIsAdminOrSafeUser = (data) => {
+	return apiResquest({
+		url: `/system/subject/checkIsAdminOrSafeUser`,
+		method: 'GET',
+		data: data,
+	})
 };

+ 17 - 0
pages/views/login/accountLogin.vue

@@ -43,6 +43,7 @@
 		configInfo,
 		getConfigByType,
 		systemAppletRolePermission,
+		systemSubjectCheckIsAdminOrSafeUser,
 		securityDataStatisticsGetUserIdentity
 	} from '@/pages/api/index.js'
 	import {
@@ -125,6 +126,8 @@
 							this.getConfigByType(),
 							//获取权限字段
 							this.systemAppletRolePermission(),
+							//查询是否是管理员/安全员
+							this.systemSubjectCheckIsAdminOrSafeUser(),
 							//查询身份
 							this.securityDataStatisticsGetUserIdentity()
 						]).then((result) => {
@@ -238,6 +241,20 @@
 					uni.setStorageSync('fileBrowseEnvironmentExtranet','https://'+Decrypt(obj.fileBrowseEnvironmentExtranet))
 				}
 			},
+			//查询是否是管理员/安全员
+			async systemSubjectCheckIsAdminOrSafeUser(){
+				let self = this;
+				const {
+					data
+				} = await systemSubjectCheckIsAdminOrSafeUser();
+				if (data.code == 200) {
+					if(data.data.isSafe || data.data.isAdmin){
+						uni.setStorageSync('subAdmin','1');
+					}else{
+						uni.setStorageSync('subAdmin','0');
+					}
+				}
+			},
 			//查询身份
 			async securityDataStatisticsGetUserIdentity(routeUrl) {
 				let self = this;

+ 38 - 11
pages/views/teacherPage/laboratoryList.vue

@@ -108,10 +108,18 @@
 			}
 		},
 		onLoad() {
-			this.systemDeptDropList();
-			this.laboratoryClassTypeGetList();
-			this.laboratoryClassLevelGetList();
-			this.getList()
+			Promise.all([
+				this.laboratoryClassTypeGetList(),
+				this.laboratoryClassLevelGetList()
+			]).then((result) => {
+				this.systemDeptDropList();
+			}).catch((error) => {
+				uni.showToast({
+					title: '数据异常,请稍候再试!',
+					icon: "none",
+					duration: 3000
+				});
+			})
 		},
 		onShow() {
 		},
@@ -154,13 +162,32 @@
 					for (let i = 0; i < data.data.length; i++) {
 						list.push(data.data[i].deptName)
 					}
-					this.facultyArray = list;
-					list.unshift('全部');
-					this.facultyList = data.data;
-					this.facultyList.unshift({
-						deptName: "全部",
-						deptId: ""
-					})
+					if(uni.getStorageSync('subAdmin')==1){
+						this.facultyArray.push('我的实验室')
+						this.facultyList.push({
+							deptName: "我的实验室",
+							deptId: "-1"
+						})
+					}
+					if(config.schoolId == uni.getStorageSync('user').position){
+						this.facultyArray.push('全部')
+						this.facultyList.push({
+							deptName: "全部",
+							deptId: ""
+						})
+						this.facultyArray = this.facultyArray.concat(list)
+						this.facultyList = this.facultyArray.concat(data.data)
+					}else{
+						this.facultyArray.push(uni.getStorageSync('userDeptName'))
+						this.facultyList.push({
+							deptName: uni.getStorageSync('userDeptName'),
+							deptId: uni.getStorageSync('userDeptId')
+						})
+					}
+					if(this.facultyList[0]){
+						this.$set(this,'facultyIndex',0);
+						this.getList()
+					}
 				}
 			},
 			//分类下拉列表