denny hace 2 años
padre
commit
2dd4749de1

+ 26 - 0
VinnoManagementSystem/src/api/wing/upload.js

@@ -0,0 +1,26 @@
+import http from "@/utils/request"
+import common from "@/utils/common"
+
+export default {
+    getAuthorizationInfo: {
+		method: 'GetAuthorizationAsync',
+		name: "获取上传文件所需配置",
+		post: async function (fileType) {            
+            var data = {                
+                'FileTypeEnum': fileType
+            }
+            return await http.post({
+                "jsonrpc": "2.0",
+                "id": common.guid(),
+                "method": this.method,
+                "params": [data]
+            });
+        }
+	},
+    uploadFile: {
+		name: "上传文件接口",
+		put: async function (fileInfo, data) { 
+            return await http.put(fileInfo.Authorization, data, fileInfo.StorageUrl);
+        }
+	},
+}

+ 45 - 21
VinnoManagementSystem/src/components/scUpload/index.vue

@@ -69,6 +69,7 @@
 				fileIsImg: true,
 				img: "",
 				tempImg: "",
+				fileType: "",
 				style: {
 					width: this.width + "px",
 					height: this.height + "px"
@@ -109,10 +110,14 @@
 				this.cropperDialogVisible = false
 			},
 			isImg(fileUrl){
-				var strRegex = "(.jpg|.png|.gif|.jpeg)$";
+				this.fileType = "";
+				var strRegex = "(.jpg|.png|.gif|.jpeg|.icon|.bmp|.gif|.webp|.tiff|.img)$";
 				var re = new RegExp(strRegex);
 				if (re.test(fileUrl.toLowerCase())){
 					this.fileIsImg=true;
+					var arr =fileUrl.split('.');	
+					var typeStr = arr[arr.length - 1];				
+                    this.fileType = config.getUploadFileType(typeStr);
 				}else{
 					this.fileIsImg=false;
 				}
@@ -144,16 +149,13 @@
 			},
 			success(res){
 				this.loading = false;
-				this.tempImg = "";
-				var os = this.onSuccess(res);
-				if(os!=undefined && os==false){
-					return false;
-				}
-				var response = config.parseData(res);
-				if(response.code != config.successCode){
-					this.$message.warning(response.msg || "上传文件未知错误")
-				}else{
-					this.img = response.src;
+				// var os = this.onSuccess(res);
+				// if(os != undefined && os == false){
+				// 	return false;
+				// }
+				if (res != null && res != undefined && res.length > 0)
+				{
+					this.img = res;
 				}
 			},
 			error(err){
@@ -166,21 +168,43 @@
 				this.img = ""
 			},
 			del(){
-				this.img = ""
+				this.img = "";
+				this.tempImg = "";
 			},
-			request(param){
+			async request(param){
 				var apiObj = config.apiObj;
 				if(this.apiObj){
 					apiObj = this.apiObj;
 				}
-				const data = new FormData();
-				var file = this.cropper ? this.cropperUploadFile : param.file
-				data.append("file", file);
-				apiObj.post(data).then(res => {
-					param.onSuccess(res)
-				}).catch(err => {
-					param.onError(err)
-				})
+				var res = await apiObj.post(this.fileType);
+				if (res)
+				{
+					const formData = new FormData()
+					var file = this.cropper ? this.cropperUploadFile : param.file
+					formData.append('File', file)
+					//开始上传文件
+					var uploadFileApiObj = config.uploadFileApiObj;
+					var result = await uploadFileApiObj.put(res, formData);
+					if (result)
+					{
+						if (result.IsSuccess === "True" || result.IsSuccess)
+						{
+							param.onSuccess(res.StorageUrl)
+						}
+						else
+						{
+							param.onError(result.Msg)
+						}
+					}
+					else
+					{
+						param.onError("Upload File Error")
+					}
+				}
+				else
+				{
+					param.onError("Get AuthorizationInfo Error")
+				}
 			}
 		}
 	}

+ 83 - 2
VinnoManagementSystem/src/config/upload.js

@@ -3,7 +3,8 @@ import API from "@/api";
 //上传配置
 
 export default {
-	apiObj: API.common.upload,			//上传请求API对象
+	apiObj: API.upload.getAuthorizationInfo,			//上传权鉴请求API对象
+	uploadFileApiObj: API.upload.uploadFile,			//上传文件请求API对象
 	successCode: 200,					//请求完成代码
 	maxSize: 10,						//最大文件大小 默认10MB
 	parseData: function (res) {
@@ -12,5 +13,85 @@ export default {
 			src: res.data.src,			//分析图片远程地址结构
 			msg: res.message			//分析描述字段结构
 		}
-	}
+	},
+	getUploadFileType: function (fileType) {
+		fileType = fileType.toUpperCase();
+		var typeInt = 0;
+		switch (fileType) 
+		{ 
+			case "EXE":
+			typeInt = 1;
+			break; 
+			case "APK":
+			typeInt = 2;
+			break; 
+			case "IPA":
+			typeInt = 3;
+			break; 
+			case "ZIP":
+			typeInt = 4;
+			break; 
+			case "DAT":
+			typeInt = 5;
+			break; 
+			case "RAR":
+			typeInt = 6;
+			break; 
+			case "PNG":
+			typeInt = 7;
+			break; 
+			case "ICON":
+			typeInt = 8;
+			break; 
+			case "BMP":
+			typeInt = 9;
+			break; 
+			case "JPEG":
+			typeInt = 10;
+			break; 
+			case "JPG":
+			typeInt = 11;
+			break; 
+			case "GIF":
+			typeInt = 12;
+			break; 
+			case "WEBP":
+			typeInt = 13;
+			break; 
+			case "TIFF":
+			typeInt = 14;
+			break; 
+			case "IMG":
+			typeInt = 15;
+			break; 
+			case "PDF":
+			typeInt = 16;
+			break; 
+			case "DOC":
+			typeInt = 17;
+			break; 
+			case "DOCX":
+			typeInt = 18;
+			break; 
+			case "XLS":
+			typeInt = 19;
+			break; 
+			case "XLSX":
+			typeInt = 20;
+			break; 
+			case "MP4":
+			typeInt = 21;
+			break; 
+			case "MSI":
+			typeInt = 22;
+			break; 
+			case "VID":
+			typeInt = 23;
+			break; 
+			default:
+			typeInt = 0;
+			break;
+		}
+		return typeInt;
+	},
 }

+ 3 - 0
VinnoManagementSystem/src/locales/lang/en.js

@@ -90,6 +90,9 @@ export default {
 		cardreverse: "Card2",
 		applyRoleName: "Apply Role",
 		checkIsPass: "Please choice Approved or not",
+		rank: "Title",
+		userHeadImg: "User Head Image",
+		humanFaceImage: "Human Face Image",
 	},
 	dialogBox: {
 		confirmWarningText:"Confirm whether to ",

+ 3 - 0
VinnoManagementSystem/src/locales/lang/zh-cn.js

@@ -117,6 +117,9 @@ export default {
 		frontAuthority: "上级权限",
 		selectItem: "请选择左侧菜单后操作",
 		checkIsPass: "请选择是否审核通过",
+		rank: "职称",
+		userHeadImg: "用户头像",
+		humanFaceImage: "人像面",
 	},
 	admin: {
 		assignAdmin: "分配管理员",

+ 8 - 17
VinnoManagementSystem/src/utils/request.js

@@ -216,21 +216,20 @@ var http = {
 	},
 
 	/** put 请求
+	 * @param  {签名} authorization
 	 * @param  {接口地址} url
 	 * @param  {请求参数} data
-	 * @param  {参数} config
 	 */
-	put: function(data={}, url='/', defaultProxy='', config={}) {
-		if (defaultProxy.length > 0)
-		{
-			axios.defaults.baseURL = defaultProxy
-		}
+	put: function(authorization, data, url) {
 		return new Promise((resolve, reject) => {
 			axios({
+				headers: {
+					'Content-Type': 'multipart/form-data;charset=utf-8',
+					'Authorization': authorization
+				},
 				method: 'put',
 				url: url,
 				data: data,
-				...config
 			}).then((response) => {
 				resolve(response.data);
 			}).catch((error) => {
@@ -244,11 +243,7 @@ var http = {
 	 * @param  {请求参数} data
 	 * @param  {参数} config
 	 */
-	patch: function(data={}, url='/',defaultProxy='', config={}) {
-		if (defaultProxy.length > 0)
-		{
-			axios.defaults.baseURL = defaultProxy
-		}
+	patch: function(data={}, url='/',config={}) {
 		return new Promise((resolve, reject) => {
 			axios({
 				method: 'patch',
@@ -268,11 +263,7 @@ var http = {
 	 * @param  {请求参数} data
 	 * @param  {参数} config
 	 */
-	delete: function(data={}, url='/',defaultProxy='', config={}) {
-		if (defaultProxy.length > 0)
-		{
-			axios.defaults.baseURL = defaultProxy
-		}
+	delete: function(data={}, url='/',config={}) {
 		return new Promise((resolve, reject) => {
 			axios({
 				method: 'delete',

+ 0 - 27
VinnoManagementSystem/src/views/deviceManage/shareDeviceUser.vue

@@ -154,30 +154,3 @@
 		}
 	}
 </script>
-
-<style>
-.el-dialog__header {
-    padding: var(--el-dialog-padding-primary);
-    padding-bottom: 10px;
-	border-bottom: 2px solid rgba(0,0,0,.06);
- }
-.el-dialog__body {
-    padding: calc(var(--el-dialog-padding-primary) + 10px) var(--el-dialog-padding-primary);
-    color: var(--el-text-color-regular);
-    font-size: var(--el-dialog-content-font-size);
-    word-break: break-all;
-    padding-top: 10px;
-    padding-bottom: 10px;
-}
-.el-dialog__footer {
-    padding: var(--el-dialog-padding-primary);
-    padding-top: 10px;
-    text-align: right;
-    box-sizing: border-box;
-    border-top: 2px solid rgba(0,0,0,.06);
-}
-.el-form-item__label {
-    font-weight: bold;
-    line-height: 32px;
-}
-</style>

+ 25 - 2
VinnoManagementSystem/src/views/login/login.vue

@@ -300,5 +300,28 @@
 		backface-visibility: hidden;
 	}
 }
-</style>
-
+.el-dialog__header {
+    padding: var(--el-dialog-padding-primary);
+    padding-bottom: 10px;
+	border-bottom: 2px solid rgba(0,0,0,.06);
+ }
+.el-dialog__body {
+    padding: calc(var(--el-dialog-padding-primary) + 10px) var(--el-dialog-padding-primary);
+    color: var(--el-text-color-regular);
+    font-size: var(--el-dialog-content-font-size);
+    word-break: break-all;
+    padding-top: 10px;
+    padding-bottom: 10px;
+}
+.el-dialog__footer {
+    padding: var(--el-dialog-padding-primary);
+    padding-top: 10px;
+    text-align: right;
+    box-sizing: border-box;
+    border-top: 2px solid rgba(0,0,0,.06);
+}
+.el-form-item__label {
+    font-weight: bold;
+    line-height: 32px;
+}
+</style>

+ 146 - 0
VinnoManagementSystem/src/views/userManage/saveUser.vue

@@ -0,0 +1,146 @@
+<template>
+	<el-dialog :title="titleMap" v-model="visible" :width="700" destroy-on-close @closed="$emit('closed')">
+		<el-form :model="form" :rules="rules" :disabled="mode=='show'"  ref="dialogForm" label-width="100px" label-position="left">
+			<el-row :gutter="15">
+				<el-col :span="12">
+					<el-form-item :label="$t('user.userName')" prop="userName">
+						<el-input v-model="form.userName" disabled clearable></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item :label="$t('device.userQueryOptions2')" prop="nickName">
+						<el-input v-model="form.nickName" disabled clearable></el-input>
+					</el-form-item>
+				</el-col>
+			</el-row>
+			<el-row :gutter="15">
+				<el-col :span="12">
+					<el-form-item :label="$t('user.fullName')" prop="fullName">
+						<el-input v-model="form.fullName" disabled clearable></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item :label="$t('user.phone')" prop="phone">
+						<el-input v-model="form.phone" disabled clearable></el-input>
+					</el-form-item>
+				</el-col>
+			</el-row>
+			<el-row :gutter="15">
+				<el-col :span="12">
+					<el-form-item :label="$t('user.email')" prop="email">
+						<el-input v-model="form.email" disabled clearable></el-input>
+					</el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item :label="$t('user.rank')" prop="rank">
+						<el-input v-model="form.rank" disabled clearable></el-input>
+					</el-form-item>
+				</el-col>
+			</el-row>
+			<el-row :gutter="15">
+				<el-col :span="12">
+					<el-form-item :label="$t('user.hospitalName')" prop="organization">
+                        <sc-select v-model="form.organization" :apiObj="$API.organization.organizationSelectList" style="width:100%" disabled clearable filterable></sc-select>
+                    </el-form-item>
+				</el-col>
+				<el-col :span="12">
+					<el-form-item :label="$t('menu.roleList')" prop="role">
+                        <sc-select v-model="form.role" :apiObj="$API.organization.organizationSelectList" style="width:100%" disabled clearable filterable></sc-select>
+                    </el-form-item>
+				</el-col>
+			</el-row>
+			<el-row :gutter="15">
+				<el-col :span="24">
+					<el-form-item :label="$t('user.userHeadImg')">
+						<sc-upload v-model="form.imgUrl" :title="$t('user.humanFaceImage')"></sc-upload>
+					</el-form-item>
+				</el-col>
+			</el-row>
+		</el-form>
+		<template #footer>
+			<el-button @click="visible=false" >{{$t('dialogBox.cancelButtonText')}}</el-button>
+			<el-button type="primary" :loading="isSaveing" @click="submit()">{{$t('dialogBox.saveButtonText')}}</el-button>
+		</template>
+	</el-dialog>
+</template>
+
+<script>
+	export default {
+		emits: ['success', 'closed'],
+		data() {
+			return {
+				titleMap: this.$t('user.certificationAudit'),
+				visible: false,
+				isSaveing: false,
+				//表单数据
+				form: {
+					userName: '',
+					nickName: '',
+					fullName: '',
+					phone: '',
+					email: '',
+					rank: '',
+					organization: '',
+					rootOrganizationCode: '',
+					role: '',
+					imgUrl: ''
+				},
+				//审核列表
+				radioList:[
+					{ label: this.$t('yes'), value: 1 },
+					{ label: this.$t('no'), value: 2 }
+				],
+			}
+		},
+		methods: {
+			//显示
+			open(userCode = ''){
+				this.queryUserInfo(userCode);
+				this.visible = true;
+				return this
+			},
+			//用户详情信息
+			async queryUserInfo(code){
+				this.isSaveing = true;
+				var res = await this.$API.user.userDetailInfo.post(code);
+				this.isSaveing = false;
+				if (res){
+					this.form.fullName = res.FullName;
+					this.form.phone = res.Phone
+					this.form.email = res.Email
+					this.form.hospital = res.HospitalName
+					this.form.department = res.DepartmentName
+					this.form.applyRoleName = res.IdentityApplyRoleName
+					this.form.identityApplyCode = res.IdentityApplyCode
+					if (res.IdentityCard != null && res.IdentityCard.length > 0) {
+						this.form.cardFront = res.IdentityCard[0]
+						if (res.IdentityCard.length > 1) {
+							this.form.cardreverse = res.IdentityCard[1]
+						}
+					}
+					if (res.LicenseCard != null && res.LicenseCard.length > 0) {
+						this.form.doctorLicense = res.LicenseCard[0]
+					}
+				}
+			},
+			//表单提交方法
+			async submit(){
+				alert(this.form.imgUrl);
+				return false;
+				//通过
+				// if (this.form.radio === 1) {
+				// 	this.isSaveing = true;
+				// 	var res = await this.$API.user.AuditPass.post(this.form.identityApplyCode);
+				// 	this.isSaveing = false;
+				// 	if(res){	
+				// 		this.$emit('success');
+				// 		this.visible = false;
+				// 		this.$message.success(this.$t('response.operateSuccess'))
+				// 	}else{
+				// 		this.$alert(res.message, this.$t('dialogBox.confirmWarningTitle'), {type: 'error'})
+				// 	}
+				// }
+			}
+		}
+	}
+</script>

+ 0 - 26
VinnoManagementSystem/src/views/userManage/userAudit.vue

@@ -184,29 +184,3 @@
 	}
 </script>
 
-<style>
-.el-dialog__header {
-    padding: var(--el-dialog-padding-primary);
-    padding-bottom: 10px;
-	border-bottom: 2px solid rgba(0,0,0,.06);
- }
-.el-dialog__body {
-    padding: calc(var(--el-dialog-padding-primary) + 10px) var(--el-dialog-padding-primary);
-    color: var(--el-text-color-regular);
-    font-size: var(--el-dialog-content-font-size);
-    word-break: break-all;
-    padding-top: 10px;
-    padding-bottom: 10px;
-}
-.el-dialog__footer {
-    padding: var(--el-dialog-padding-primary);
-    padding-top: 10px;
-    text-align: right;
-    box-sizing: border-box;
-    border-top: 2px solid rgba(0,0,0,.06);
-}
-.el-form-item__label {
-    font-weight: bold;
-    line-height: 32px;
-}
-</style>