浏览代码

移动端代码功能调整

wangqiang 1 年之前
父节点
当前提交
7debf715df

+ 8 - 0
api/file/fileService.js

@@ -14,6 +14,14 @@ export default {
     })
   },
 
+  downloadUrl: function (params) {
+    return request({
+      url: prefix + '/file/downloadUrl',
+      method: 'get',
+      params: params
+    })
+  },
+
   uploadFile: function (filePath, config = {}) {
 	return upload(prefix + '/file/uploadFile?uploadPath=userdir',filePath)      
   },

+ 51 - 0
api/flowable/NoticeService.js

@@ -0,0 +1,51 @@
+import request from "../../common/request"
+import { FLOW_PATH as prefix } from "../AppPath";
+
+export default {
+  list: function (params) {
+    return request({
+      url: '/flowable-server/' + '/flowable/notice/list',
+      method: 'get',
+      params: params
+    })
+  },
+
+  addInfo: function (params) {
+    return request({
+      url: prefix + '/flowable/notice/add',
+      method: 'get',
+      params: params
+    })
+  },
+
+  update: function (params) {
+    return request({
+      url: '/flowable-server/' + '/flowable/notice/update',
+      method: 'get',
+      params: params
+    })
+  },
+
+  stockUpdate: function (params) {
+    return request({
+      url: prefix + '/flowable/notice/stockUpdate',
+      method: 'get',
+      params: params
+    })
+  },
+
+  portionRead: function (ids) {
+    return request({
+      url: prefix + '/flowable/notice/portionRead',
+      method: 'post',
+      params: {ids: ids}
+    })
+  },
+
+  readAll: function () {
+    return request({
+      url: prefix + '/flowable/notice/readAll',
+      method: 'post'
+    })
+  }
+}

+ 7 - 0
api/sys/userService.js

@@ -19,6 +19,13 @@ export default {
 			params: inputForm,
 		});
 	},
+	savePwdByPhone: function (inputForm) {
+		return request({
+			url: prefix + "/sys/user/savePwdByPhone",
+			method: "post",
+			params: inputForm,
+		});
+	},
 
 	queryById: function (id) {
 		return request({

+ 1 - 0
common/request.js

@@ -45,6 +45,7 @@ export function request(body){
 		data = null
 
 	}
+	header.domain = window.location.origin + 'ydddl';
 	
 	let promise = new Promise((resolve,reject)=>{
 		uni.request({

+ 2 - 2
pages.json

@@ -2,13 +2,13 @@
 	"pages": [
 		//pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
-			"path": "pages/index/index",
+			"path": "pages/login/login",
 			"style": {
 				"navigationStyle": "custom" // 隐藏系统导航栏
 			}
 		},
 		{
-			"path": "pages/login/login",
+			"path": "pages/index/index",
 			"style": {
 				"navigationStyle": "custom" // 隐藏系统导航栏
 			}

+ 20 - 0
pages/addressbook/addressbook.vue

@@ -25,6 +25,10 @@
 							<u-avatar shape="square" size="35" icon="account-fill" fontSize="26" randomBgColor></u-avatar>
 							<!-- <view class="cu-avatar round " :style="'background-image:url('+(user.photo?user.photo:'/h5/static/user/flat-avatar.png')+');'"></view> -->
 							<text class="list__item__user-name">{{user.name}}</text>
+							<!-- 新增的展示其他信息的元素 -->
+							<text class="list__item__additional-info">{{ user.officeDTO.name }}</text>
+							<!-- 新的电话号码信息 -->
+							<text class="list__item__phone-number">{{ user.mobile }}</text>
 						</view>
 						<u-line></u-line>
 					</view>
@@ -126,4 +130,20 @@
 			margin: 15px 0;
 		}
 	}
+
+	.list__item__additional-info {
+		position: relative;
+		top: 10px; /* Adjust as needed */
+		left: 15px; /* Adjust as needed */
+		font-size: 12px; /* Adjust the font size as needed */
+		color: #999; /* Adjust the color as needed */
+	}
+
+	.list__item__phone-number {
+		position: relative;
+		top: 10px; /* Adjust as needed */
+		margin-left: 20px; /* 根据需要调整间距 */
+		font-size: 12px; /* 根据需要调整字体大小 */
+		color: #999; /* 根据需要调整颜色 */
+	}
 </style>

+ 57 - 0
pages/apps/notification/notificationDetail.vue

@@ -14,11 +14,21 @@
 		<view class="padding bg-white">
 			<u-parse :content="notication.content"></u-parse>
 		</view>
+		<u-cell-group :border="false">
+			<u-cell :border="false">
+				<u--text slot="title" :text="`附件`"></u--text>
+			</u-cell>
+			<u-cell v-for="(file, index) in fileArray" :key="index" :border="false">
+				<u--text slot="title" type="info" :text="getFileName(file)" @click="downloadFile(file)"></u--text>
+			</u-cell>
+		</u-cell-group>
 	</view>
 </template>
 
 <script>
+	import fileService from "@/api/file/fileService"
 	import notifyService from "@/api/notify/notifyService";
+	import pick from "lodash.pick";
 	export default {
 		data() {
 			return {
@@ -31,10 +41,57 @@
 				}
 			}
 		},
+		computed: {
+			fileArray() {
+				// 拆分字符串,以逗号为分隔符
+				return this.notication.files.split(',');
+			}
+		},
 		onLoad (option) {
 			notifyService.query({isSelf:true, id:option.id}).then((data)=>{
+				console.log('data', data)
 				this.notication = data
 			});
+		},
+		methods: {
+			getFileName(file) {
+				// 通过字符串处理方法提取出文件名部分
+				const nameIndex = file.indexOf('name=');
+				if (nameIndex !== -1) {
+					return decodeURIComponent(file.slice(nameIndex + 5)); // +5 是为了跳过 'name=' 部分
+				}
+				return file;
+			},
+			downloadFile(file) {
+				if (file) {
+
+					const paramsString = file.split('?')[1];
+					const paramsArray = paramsString.split('&');
+
+					let uploadPath = '';
+					let name = '';
+
+					// 遍历参数数组并提取参数值
+					paramsArray.forEach(param => {
+						const [key, value] = param.split('=');
+						if (key === 'uploadPath') {
+							uploadPath = value;
+						} else if (key === 'name') {
+							name = value;
+						}
+					});
+
+					// 使用 uni.downloadFile 下载文件
+					fileService.downloadUrl({
+						uploadPath: uploadPath,
+						name: name,
+					}).then((data) => {
+						console.log('data', data)
+						window.open(data, '_blank'); // 在新标签页或新窗口打开文件
+					})
+
+				}
+			}
 		}
 	}
 </script>

+ 20 - 2
pages/index/index.vue

@@ -15,7 +15,7 @@
 			<view class="action" @click="NavChange" data-cur="message">
 				<view :class="PageCur=='message'?'text-blue':'text-gray'">
 					<text class="lg" :class="PageCur=='message'?'cuIcon-messagefill':'cuIcon-message'">
-						<text class='cu-tag badge'>0</text>
+						<text class='cu-tag badge'>{{ messageCount }}</text>
 					</text>
 					<text>消息</text>
 				</view>
@@ -44,6 +44,8 @@
 </template>
 
 <script>
+	import notifyService from "@/api/notify/notifyService";
+	import noticeService from "@/api/flowable/NoticeService"
 	import addressbook from '@/pages/addressbook/addressbook.vue'
 	import person from '@/pages/user/person/person.vue'
 	import message from '@/pages/message/message.vue'
@@ -59,13 +61,29 @@
 		},
 		data() {
 			return {
-				PageCur: 'workbench'
+				PageCur: 'workbench',
+				messageCount: 0 // 初始化消息数量为 0
 			}
 		},
 		methods: {
 			NavChange: function(e) {
 				this.PageCur = e.currentTarget.dataset.cur
+			},
+			fetchMessageCount() {
+				notifyService.list({
+					current: 0,
+					size: -1,
+				}).then((data)=>{
+					console.log('data', data.records.length)
+					this.messageCount = data.records.length; // 更新消息数量
+				}).catch((error) => {
+					console.error('获取消息数量失败:', error);
+				});
 			}
+		},
+		created() {
+			// 在组件被创建后立即调用 fetchMessageCount 方法
+			this.fetchMessageCount();
 		}
 	}
 </script>

+ 4 - 3
pages/login/login.vue

@@ -90,9 +90,10 @@
 				loginService.login(this.inputForm).then((data) => {
 				  this.$store.commit('SET_TOKEN',data.token);
 				  this.refreshUserInfo();
-				  uni.reLaunch({
-				  	url: '../index/index',
-				  });
+				  // uni.reLaunch({
+				  // 	url: '/pages/index/index',
+				  // });
+					this.$router.push('/pages/index/index');
 				}).catch(e => {
 				  this.getCaptcha()
 				  console.error(e)

+ 29 - 2
pages/message/message.vue

@@ -9,7 +9,7 @@
 				<view
 					v-for="(notify, index) in dataList"
 					:key="index">
-						<u-swipe-action-item @click="del(notify.id)"  :key="notify.id" :threshold="60" duration="500" 
+						<u-swipe-action-item @click="del(notify.id)"  :key="notify.id" :threshold="60" duration="500"
 						:options="[ {
 							text: '删除',
 							style: {
@@ -54,7 +54,10 @@
 </template>
 
 <script>
-	import notifyService from "@/api/notify/notifyService";	
+	import taskService from "@/api/flowable/taskService"
+	import noticeService from "@/api/flowable/NoticeService"
+	import notifyService from "@/api/notify/notifyService";
+	import pick from "lodash.pick";
 	export default {
 		data() {
 			return {
@@ -87,6 +90,30 @@
 				}
 				
 			},
+			todo (row) {
+
+				console.log('row', row)
+				this.inputForm = {
+					taskId: '',
+					noticeId: '',
+					taskName: ''
+				}
+				console.log('进来了+++', row.taskId)
+				taskService.getTaskDef({
+					procInsId: row.taskId,
+					procDefId: row.defId
+				}).then((data) => {
+					this.inputForm.taskId = row.taskId
+					this.inputForm.noticeId = row.noticeName
+					this.inputForm.taskName = row.taskName
+					// noticeService.update(this.inputForm)
+
+					let query = {readOnly: true, title: `审批【${row.taskName || ''}】`, formTitle: `${row.title}`, ...pick(data, 'formType', 'formUrl', 'procDefKey', 'taskDefKey', 'procInsId', 'procDefId', 'taskId', 'status', 'title', 'businessId')}
+					uni.navigateTo({
+						url: '/pages/workbench/task/TaskFormDetail?flow='+JSON.stringify(query)
+					})
+				})
+			},
 			toEdit (notify) {
 				uni.navigateTo({
 				  url: '/pages/apps/notification/oaNotifyForm?id='+notify.id

+ 10 - 3
pages/user/person/person.vue

@@ -24,7 +24,7 @@
 		    title="岗位"
 			icon="account-fill"
 			:iconStyle="{color: '#0081ff'}"
-			:value="userInfo.post && userInfo.post.name"
+			:value="userInfo.postNames"
 		></u-cell>
 		<u-cell
 		    title="角色"
@@ -36,7 +36,7 @@
 		    title="联系电话"
 			icon="phone-fill"
 			:iconStyle="{color: '#0081ff'}"
-			:value="userInfo.phone"
+			:value="userInfo.mobile"
 		></u-cell>
 		<u-cell
 		    title="邮箱"
@@ -49,7 +49,7 @@
 			icon="edit-pen"
 		    isLink
 			:iconStyle="{color: '#e54d42'}"
-		    url="/pages/user/setting/password/password"
+			@click="goToPasswordPage"
 		></u-cell>
 	</u-cell-group>
 
@@ -83,6 +83,13 @@
           url: '/pages/user/setting/password/password'
         })
       },
+		goToPasswordPage() {
+			const params = { 'id': this.userInfo.id};
+			this.$router.push({
+				path: '/pages/user/setting/password/password',
+				query: params
+			});
+		},
 	 ChooseImage() {
 	 	uni.chooseImage({
 	 		count: 4, //默认9

+ 8 - 2
pages/user/setting/password/password.vue

@@ -26,7 +26,8 @@
 			inputForm: {
 				oldPassword: '',
 				newPassword: '',
-				confirmNewPassword: ''
+				confirmNewPassword: '',
+				userId: ''
 			},
 			rules: {
 				'oldPassword': [
@@ -63,13 +64,18 @@
 			}
 		}
 	},
+	  mounted() {
+		  const params = this.$route.query;
+		  this.inputForm.userId = params.id
+		  // 从 params 中读取传递过来的参数
+	  },
 
     methods:{
 		formSubmit: function(e) {
 			//定义表单规则
 			this.$refs.inputForm.validate().then(res => {
 				uni.showLoading()
-				userService.savePwd(this.inputForm).then((data) => {
+				userService.savePwdByPhone(this.inputForm).then((data) => {
 					uni.showToast({title:data, icon:"success"});
 					uni.clearStorage();
 					uni.reLaunch({