Browse Source

feat(message/detail):消息详情页增加文档预览功能

HMY 1 year ago
parent
commit
cdf825ff9c
5 changed files with 145 additions and 39 deletions
  1. 15 3
      api/message.js
  2. 1 0
      config.js
  3. 12 2
      pages/message/detail/URLView.vue
  4. 97 14
      pages/message/detail/index.vue
  5. 20 20
      pages/message/index.vue

+ 15 - 3
api/message.js

@@ -8,7 +8,13 @@ export function GetMessageList(params) {
 		method: 'post',
 		data: {
 			'serviceId': 'oa_2017V001PHONE_messageList',
-			'params': params
+			'params': {
+				"currentUser": params.currentUser, //useid
+				"isRead": params.isRead,
+				"pSize": params.pSize,
+				"type": params.type,
+				"p": params.p,
+			}
 		}
 	})
 }
@@ -20,7 +26,13 @@ export function GetNoticeList(params) {
 		method: 'post',
 		data: {
 			'serviceId': 'eu_notice_2013V0010PHONE001',
-			'params': params
+			'params': {
+				"notice_title": params.notice_title,
+				"p": params.p,
+				"pSize": params.pSize,
+				"userId": params.userId,
+				"unitId": params.unitId,
+			}
 		}
 	})
 }
@@ -48,7 +60,7 @@ export function GetMessageInfo(params) {
 		data: {
 			'serviceId': 'oa_2017V002PHONE_messageInfo',
 			'params': {
-				'universalid': params.universalid,
+				'universalid': params.universalId,
 				'messageId': params.messageId
 			}
 		}

+ 1 - 0
config.js

@@ -2,6 +2,7 @@ export default {
 	// baseUrl: 'https://api.ygtxfj.com/oa',
 	baseUrl: 'http://localhost:8081/oa',
 	// baseUrl: 'http://118.195.146.34:20076/ynet',
+	baseUrlPre:'https://api.ygtxfj.com',
 	logoSrc: 'https://50006360.s21i.huaweicloudsite.cn/4/ABUIABAEGAAg-I3cuQYo6IXe9AQw9AM4Rg.png',
 	mapKey: 'KJBBZ-5JCLZ-3NLXD-742CK-Y26UZ-X7BJN'
 }

+ 12 - 2
pages/message/detail/URLView.vue

@@ -7,10 +7,20 @@
 <script setup lang="ts">
 	import { onLoad } from '@dcloudio/uni-app';
 	import { ref } from 'vue';
+	import config from '@/config';
+	
+	const url = ref('');
 	onLoad((options) => {
-		url.value = decodeURIComponent(options.url)
+		if(options.type=='doc'){
+			const previewDocUrl='https://view.xdocin.com/view?src='
+			// const baseUrlSub=config.baseUrl.substring(0, config.baseUrl.indexOf("/", config.baseUrl.indexOf("//") + 2))
+			url.value = decodeURIComponent(previewDocUrl+config.baseUrlPre+options.url)
+		}else{
+			url.value = decodeURIComponent(options.url)
+		}
+		console.log('url.value',url.value);
 	});
-	const url = ref('');
+	
 </script>
 
 <style lang="scss">

File diff suppressed because it is too large
+ 97 - 14
pages/message/detail/index.vue


+ 20 - 20
pages/message/index.vue

@@ -230,11 +230,11 @@
 		switch (currentIndex) {
 			case 0:
 				params = {
-					"currentUser": userStore.user.useId,
-					"isRead": "",
-					"pSize": "5",
-					"type": "",
-					"p": "1",
+					 currentUser : userStore.user.useId,
+					 isRead : "",
+					 pSize : "5",
+					 type : "",
+					 p : "1",
 				}
 				GetMessageList(params).then(res => {
 					messages.value = res.returnParams.list;
@@ -243,11 +243,11 @@
 				break;
 			case 1:
 				params = {
-					"currentUser": userStore.user.useId,
-					"isRead": "1",
-					"pSize": "5",
-					"type": "",
-					"p": "1",
+					 currentUser : userStore.user.useId,
+					 isRead : "1",
+					 pSize : "5",
+					 type : "",
+					 p : "1",
 				}
 				GetMessageList(params).then(res => {
 					messages.value = res.returnParams.list;
@@ -255,11 +255,11 @@
 				break;
 			case 2:
 				params = {
-					"currentUser": userStore.user.useId,
-					"isRead": "0",
-					"pSize": "5",
-					"type": "",
-					"p": "1",
+					 currentUser : userStore.user.useId,
+					 isRead : "0",
+					 pSize : "5",
+					 type : "",
+					 p : "1",
 				}
 				GetMessageList(params).then(res => {
 					messages.value = res.returnParams.list;
@@ -275,11 +275,11 @@
 		switch (currentIndex) {
 			case 0:
 				const params1 = {
-					"notice_title": "",
-					"p": "1",
-					"pSize": "5",
-					"userId": userStore.user.useId,
-					"unitId": userStore.user.unitId,
+					  notice_title  : "",
+					 p : "1",
+					 pSize : "5",
+					 userId : userStore.user.useId,
+					 unitId : userStore.user.unitId,
 				}
 				GetNoticeList(params1).then(res => {
 					// console.log(res);

Some files were not shown because too many files changed in this diff