Explorar o código

附件功能,推送功能

asd26269546 hai 1 ano
pai
achega
b24c43bf2a

+ 2 - 0
.env.development

@@ -6,3 +6,5 @@ VITE_APP_ENV = 'development'
 
 # 若依管理系统/开发环境
 VITE_APP_BASE_API = '/dev-api'
+
+VITE_APP_IP = '36.134.91.96'

+ 3 - 1
.env.production

@@ -8,4 +8,6 @@ VITE_APP_ENV = 'production'
 VITE_APP_BASE_API = '/prod-api'
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli
-VITE_BUILD_COMPRESS = gzip
+VITE_BUILD_COMPRESS = gzip
+
+VITE_APP_IP = '139.159.251.109'

+ 3 - 1
.env.staging

@@ -8,4 +8,6 @@ VITE_APP_ENV = 'staging'
 VITE_APP_BASE_API = '/test-api'
 
 # 是否在打包时开启压缩,支持 gzip 和 brotli
-VITE_BUILD_COMPRESS = gzip
+VITE_BUILD_COMPRESS = gzip
+
+VITE_APP_IP = '36.134.91.96'

+ 20 - 20
src/components/notice/index.vue

@@ -4,6 +4,7 @@
 			title="系统公告"
 			v-model="value"
 			width="460px"
+			:align-center="true"
 			:before-close="handleClose"
 		>
 			<div class="title">
@@ -18,7 +19,7 @@
 			</div>
 			<template #footer>
 				<span class="dialog-footer">
-					<el-button
+					<!-- <el-button
 						size="small"
 						@click="index--"
 						:disabled="data.length < 2 || index == 0"
@@ -29,7 +30,7 @@
 						@click="index++"
 						:disabled="data.length == index + 1"
 						>下一条</el-button
-					>
+					> -->
 					<!-- <el-button
 						type="primary"
 						size="small"
@@ -81,7 +82,7 @@ import { ElMessageBox, ElNotification } from 'element-plus'
 import {
   getToken
 } from '@/utils/auth'
-
+const { proxy } = getCurrentInstance();
 defineProps({
   modelValue: {
     type: Object,
@@ -115,14 +116,9 @@ let noticeData = ref([
 	// 	address: '上海市普陀区金沙江路 1516 弄',
 	// },
 ])
-const index = ref(1)
-const data = ref([
-	{ title: '11', content: '11' },
-	{ title: '22', content: '22' },
-	{ title: '33', content: '33' },
-	{ title: '44', content: '44' },
-])
-const value = ref(false)
+let index = ref(0)
+let data = ref([])
+let value = ref(false)
 const moreFn = () => {
 	noticeTableModal.value = true
 }
@@ -130,10 +126,16 @@ const moreFn = () => {
 const confirm = () => {
 	value.value = false
 }
+// proxy.post('sendMeg/page',{
+// 	pageNum:1,
+// 	pageSize:30,
+// }).then(res=>{
+// 	data.value = res.rows
+// })
 
 const socketInit = () => {
 	window.ws = new WebSocket(
-		'ws://36.134.91.96:9898/test-api/webStock/' +
+		'ws://'+ import.meta.env.VITE_APP_IP +':9898/test-api/webStock/' +
 			getToken()
 		// 'ws://192.168.1.97:8300/webStock/' + window.localStorage.getItem('token')
 	)
@@ -144,14 +146,12 @@ const socketInit = () => {
 	}
 	window.ws.onmessage = function (e) {
 		//当客户端收到服务端发来的消息时,触发onmessage事件,参数e.data包含server传递过来的数据
-
-		var msg = JSON.parse(e.data)
-		console.log(msg)
-		//系统消息
-		if (msg.data.type == 1) {
-			data.value = msg.data
-			value.value = true
-		}
+		//在data.value前面插入
+		console.log(JSON.parse(e.data).data)
+		data.value.unshift({title:"最新公告",content:JSON.parse(e.data).data})
+		index.value = 0
+		value.value = true
+		
 		
 	}
 	window.ws.onclose = function (e) {

+ 13 - 0
src/views/process/processApproval/index.vue

@@ -89,6 +89,9 @@
                     <span v-if="item.status != 3">办理人:</span>{{ item.processedUser }}<span class="time">{{ item.processedDate }}</span>
                   </div>
                   {{ item.remark }}
+                  <div v-for="j in fileObj[item.flowExampleDetailId]" v-if="fileObj[item.flowExampleDetailId]">
+                    <a :href="j.fileUrl" style="color:#409EFF;line-height: 30px;">{{ j.fileName }}</a>
+                  </div>
                 </div>
               </div>
               <div class="line"></div>
@@ -511,6 +514,8 @@ let queryData = reactive({
 });
 // 记录
 const recordList = ref([]);
+const fileIds = ref([]);
+const fileObj = ref({}); 
 const approvalRecordData = ref({
   buttonInfoList: [],
 });
@@ -524,6 +529,14 @@ const getRecords = (_id) => {
         recordList.value = res.recordList;
         queryData.data.recordList = res.recordList;
         approvalRecordData.value = res;
+        fileIds.value = res.recordList.map((item) => {
+          return item.flowExampleDetailId;
+        });
+        proxy.post('fileInfo/getList',{businessIdList:fileIds.value}).then(res2=>{
+          console.log(res2)
+          fileObj.value = res2
+        })  
+        console.log(fileObj.value)
       });
   } else {
     proxy