Bläddra i källkod

增加拨打电话和页面跳转和点击显示全部文字

LuChongMei 1 år sedan
förälder
incheckning
f49756c55b

+ 20 - 2
jp-mobile/components/ly-tree/ly-tree-node.vue

@@ -21,8 +21,8 @@
 				<text class="ly-tree-node__label">{{node.label}}</text>
 			</view>
 			<view class="ly-tree-node-desc">
-				<view class="ly-tree-node-desc-item">{{node.data.mobile}}</view>
-				<view class="ly-tree-node-desc-item">{{node.data.phone}}</view>
+				<view class="ly-tree-node-desc-item" @click="toPhone(node.data.mobile)" @longpress="copyPhone(node.data.mobile)">{{node.data.mobile}}</view>
+				<view class="ly-tree-node-desc-item" @click="toPhone(node.data.phone)" @longpress="copyPhone(node.data.phone)">{{node.data.phone}}</view>
 			</view>
 		</view>
 
@@ -123,6 +123,24 @@
 		},
 
 		methods: {
+			// 打电话
+			toPhone(phone) {
+				uni.makePhoneCall({
+					phoneNumber: phone //仅为示例
+				});
+			},
+			// 复制号码
+			copyPhone(phone){
+				uni.setClipboardData({
+					data: phone,
+					success: function () {
+						uni.showToast({
+							title: '复制成功',
+							icon:'success'
+						});
+					}
+				});
+			},
 			getNodeKey(nodeId) {
 				let node = this.tree.store.root.getChildNodes([nodeId])[0];
 				return getNodeKey(this.tree.nodeKey, node.data);

+ 20 - 13
jp-mobile/pages/fileTransmit/examineFile.vue

@@ -95,6 +95,18 @@
 	import gwCirculationCard2Service from '@/api/circulation/gwCirculationCard2.js'
 	import * as $auth from "@/common/auth.js"
 	export default {
+		// onHide() {
+		// 	uni.$emit('refresh', {
+		// 		type: 1
+		// 	})
+		// 	uni.navigateBack()
+		// },
+		// onUnload() {
+		// 	uni.$emit('refresh', {
+		// 		type: 1
+		// 	})
+		// 	uni.navigateBack()
+		// },
 		onLoad(option) {
 			this.gwId = option.id
 			gwFlowService.queryByGwId(this.gwId).then(data => {
@@ -240,13 +252,12 @@
 						type: 'success',
 						message: data,
 						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png',
-
 					}
 					this.showToast(param);
 					setTimeout(() => {
-						uni.$emit('refresh', {
-							type: 1
-						})
+						// uni.$emit('refresh', {
+						// 	type: 1
+						// })
 						// 先获取页面栈
 						let pages = getCurrentPages();
 						// 当前页面的前一个页面
@@ -255,11 +266,9 @@
 						if (prevPage) {
 							// 重定向到上一页
 							uni.redirectTo({
-								url: `/${prevPage.route}?type=1` // 注意此处可能需要加上参数保留
+								url: `/pages/fileTransmit/fileInfo?id=${this.gwId}` // 注意此处可能需要加上参数保留
 							});
 						}
-						// 关闭当前页面
-						uni.navigateBack();
 					}, 500)
 				}).catch(() => {
 					let param = {
@@ -284,9 +293,9 @@
 					}
 					this.showToast(param);
 					setTimeout(() => {
-						uni.$emit('refresh', {
-							type: 3
-						})
+						// uni.$emit('refresh', {
+						// 	type: 3
+						// })
 						// 先获取页面栈
 						let pages = getCurrentPages();
 						// 当前页面的前一个页面
@@ -295,11 +304,9 @@
 						if (prevPage) {
 							// 重定向到上一页
 							uni.redirectTo({
-								url: `/${prevPage.route}` // 注意此处可能需要加上参数保留
+								url: `/pages/fileTransmit/fileInfo?id=${this.gwId}` // 注意此处可能需要加上参数保留
 							});
 						}
-						// 关闭当前页面
-						uni.navigateBack();
 					}, 500)
 				})
 

+ 21 - 16
jp-mobile/pages/fileTransmit/fileCard.vue

@@ -19,13 +19,19 @@
 						<view>来文机关</view>
 					</u-col>
 					<u-col span="3" textAlign="center" class="card_col_1">
-						<u--text size="14" align="center" lines="1" :text="inputForm.sendingAgency"></u--text>
+						<uni-tooltip  :content="inputForm.sendingAgency" placement="top">
+						  <u--text size="14" align="center" lines="1" :text="inputForm.sendingAgency"></u--text>
+						</uni-tooltip>
+						
 					</u-col>
 					<u-col span="3" textAlign="center" class="card_col card_col_1">
 						<view>来文字号</view>
 					</u-col>
 					<u-col span="3" textAlign="center">
-						<u--text size="14" align="center" lines="1" :text="inputForm.docFontSize"></u--text>
+						<uni-tooltip  :content="inputForm.docFontSize" placement="top">
+						  <u--text size="14" align="center" lines="1" :text="inputForm.docFontSize"></u--text>
+						</uni-tooltip>
+						<!-- <u--text size="14" align="center" lines="1" :text="inputForm.docFontSize"></u--text> -->
 					</u-col>
 				</u-row>
 				<u-row justify="space-between" class="card_row card_row_border">
@@ -39,7 +45,10 @@
 						<view>文件来源</view>
 					</u-col>
 					<u-col span="3" textAlign="center">
-						<u--text size="14" align="center" lines="1" :text="inputForm.fileSource"></u--text>
+						<uni-tooltip :content="inputForm.fileSource" placement="top">
+						  <u--text size="14" align="center" lines="1" :text="inputForm.fileSource"></u--text>
+						</uni-tooltip>
+						<!-- <u--text size="14" align="center" lines="1" :text="inputForm.fileSource"></u--text> -->
 					</u-col>
 				</u-row>
 				<u-row justify="space-between" class="card_row card_row_border">
@@ -63,7 +72,7 @@
 							</view>
 							<view class="flex text-sm" style="line-height: 20px;">
 								<u--image :src="item.signfj" width="80px" height="20px"></u--image>
-								{{item.createTime}}
+								{{item.updateTime}}
 							</view>
 						</view>
 					</u-col>
@@ -79,7 +88,7 @@
 							</view>
 							<view class="flex text-sm" style="line-height: 20px;">
 								<u--image :src="leader.signfj" width="80px" height="20px"></u--image>
-								{{leader.createTime}}
+								{{leader.updateTime}}
 							</view>
 						</view>
 					</u-col>
@@ -95,7 +104,7 @@
 							</view>
 							<view class="flex text-sm" style="line-height: 20px;">
 								<u--image :src="item.signfj" width="80px" height="20px" mode="aspectFit"></u--image>
-								{{item.createTime}}
+								{{item.updateTime}}
 							</view>
 						</view>
 					</u-col>
@@ -189,12 +198,12 @@
 						this.undertakeInfo.push(item)
 					}
 				})
-				this.leaderInfo.sort((a, b) => a.createTime.localeCompare(b.createTime) || a.createTime
-					.localeCompare(b.createTime));
-				this.undertakeInfo.sort((a, b) => a.createTime.localeCompare(b.createTime) || a.createTime
-					.localeCompare(b.createTime));
-				this.officeInfo.sort((a, b) => a.createTime.localeCompare(b.createTime) || a.createTime
-					.localeCompare(b.createTime));
+				this.leaderInfo.sort((a, b) => a.updateTime.localeCompare(b.updateTime) || a.updateTime
+					.localeCompare(b.updateTime));
+				this.undertakeInfo.sort((a, b) => a.updateTime.localeCompare(b.updateTime) || a.updateTime
+					.localeCompare(b.updateTime));
+				this.officeInfo.sort((a, b) => a.updateTime.localeCompare(b.updateTime) || a.updateTime
+					.localeCompare(b.updateTime));
 				this.ismask = false
 			})
 
@@ -343,10 +352,6 @@
 		background-color: #fefefe;
 	}
 
-	/* .card_main * {
-		font-size: 16px!important;
-	} */
-
 	.card_banner {
 		width: 100%;
 		height: 60px;

+ 30 - 3
jp-mobile/pages/fileTransmit/fileInfo.vue

@@ -5,10 +5,12 @@
 			<u-steps :current="current" direction="column" inactiveColor="#36a7f3" activeColor="#5fdf50">
 				<u-steps-item title="发起" :desc="inputForm.createTruename +' - '+inputForm.createTime">
 				</u-steps-item>
-				<u-steps-item v-for="item in downList" :title="item.which=='0'?'办公室拟办':item.which=='1'?'领导审批':item.which=='2'?'承办情况':item.which=='3'?'承办转发':'已归档'"
+				<u-steps-item v-for="item in downList"
+					:title="item.which=='0'?'办公室拟办':item.which=='1'?'领导审批':item.which=='2'?'承办情况':item.which=='3'?'承办转发':'已归档'"
 					:desc="item.state==1?item.nextTruename :item.nextTruename +' - '+item.updateTime">
 				</u-steps-item>
-				<u-steps-item v-for="item in gwList" :title="item.which=='0'?'办公室拟办':item.which=='1'?'领导审批':item.which=='2'?'承办情况':item.which=='3'?'承办转发':'待归档'"
+				<u-steps-item v-for="item in gwList"
+					:title="item.which=='0'?'办公室拟办':item.which=='1'?'领导审批':item.which=='2'?'承办情况':item.which=='3'?'承办转发':'待归档'"
 					:desc="item.state==1?item.nextTruename :item.nextTruename +' - '+item.createTime">
 				</u-steps-item>
 				<!-- <u-steps-item v-for="item in officeInfo" title="办公室拟办" :desc="item.nextTruename +' - '+item.updateTime">
@@ -31,6 +33,31 @@
 	export default {
 		onLoad(option) {
 			this.gwId = option.id
+
+		},
+		onHide() {
+			// 先获取页面栈
+			let pages = getCurrentPages();
+			// 当前页面的前一个页面
+			let prevPage = pages[pages.length - 2];
+			if (prevPage.options.type == '1') {
+				uni.$emit('refresh', {
+					type: 4
+				})
+				uni.navigateBack()
+			}
+		},
+		onUnload() {
+			// 先获取页面栈
+			let pages = getCurrentPages();
+			// 当前页面的前一个页面
+			let prevPage = pages[pages.length - 1];
+			if (prevPage.options.type == '1') {
+				uni.$emit('refresh', {
+					type: 4
+				})
+				uni.navigateBack()
+			}
 		},
 		components: {
 			fileCard,
@@ -48,7 +75,7 @@
 				gwList: [],
 				current: 0,
 				allNum: "",
-				inputForm:{},
+				inputForm: {},
 			}
 		},
 		mounted() {

+ 0 - 1
jp-mobile/pages/fileTransmit/fileTransmitList.vue

@@ -81,7 +81,6 @@
 		},
 		onShow() {
 			uni.$on('refresh', (data) => {
-				console.log("onShow====>",data);
 				this.dataList = []
 				this.type = data.type
 				switch (data.type) {

+ 1 - 1
jp-mobile/pages/login/login.vue

@@ -7,7 +7,7 @@
 				<view class="top_ri"></view>
 			</view>
 			<view class="title">
-				<view>公文流转管理平台</view>
+				<view style="font-size: 28px!important;">公文流转管理平台</view>
 			</view>
 			<view class="login-form">
 				<u--form :model="inputForm" labelWidth="100px" labelPosition="left" :rules="rules" ref="uForm">

+ 14 - 0
jp-mobile/uni_modules/uni-tooltip/changelog.md

@@ -0,0 +1,14 @@
+## 0.2.3(2024-03-20)
+- 修复 弹出位置修正
+## 0.2.2(2024-01-15)
+- 新增 placement支持设置四个方向:top bottom left right
+## 0.2.1(2022-05-09)
+- 修复 content 为空时仍然弹出的bug
+## 0.2.0(2022-05-07)
+**注意:破坏性更新**
+- 更新 text 属性变更为 content
+- 更新 移除 width 属性
+## 0.1.1(2022-04-27)
+- 修复 组件根 text 嵌套组件 warning
+## 0.1.0(2022-04-21)
+- 初始化

+ 110 - 0
jp-mobile/uni_modules/uni-tooltip/components/uni-tooltip/uni-tooltip.vue

@@ -0,0 +1,110 @@
+<template>
+	<view class="uni-tooltip">
+		<slot></slot>
+		<view v-if="content || $slots.content" class="uni-tooltip-popup" :style="initPlacement">
+			<slot name="content">
+				{{content}}
+			</slot>
+		</view>
+	</view>
+</template>
+
+
+<script>
+	/**
+	 * Tooltip 提示文字
+	 * @description 常用于展示鼠标 hover 时的提示信息。
+	 * @tutorial https://uniapp.dcloud.io/component/uniui/uni-tooltip
+	 * @property {String} content   弹出层显示的内容
+	 * @property {String}  placement出现位置, 目前支持:left right top bottom
+	 */
+	export default {
+		name: "uni-tooltip",
+		data() {
+			return {
+
+			};
+		},
+		methods: {
+		},
+		computed: {
+			initPlacement() {
+				let style = {};
+				switch (this.placement) {
+					case 'left':
+						style = {
+							top: '50%',
+							transform: 'translateY(-50%)',
+							right: '100%',
+							"margin-right": '10rpx',
+						}
+						break;
+					case 'right':
+						style = {
+							top: '50%',
+							transform: 'translateY(-50%)',
+							left: '100%',
+							"margin-left": '10rpx',
+						}
+						break;
+					case 'top':
+						style = {
+							bottom: '100%',
+							transform: 'translateX(-50%)',
+							left: '50%',
+							"margin-bottom": '10rpx',
+						}
+						break;
+					case 'bottom':
+						style = {
+							top: '100%',
+							transform: 'translateX(-50%)',
+							left: '50%',
+							"margin-top": '10rpx',
+						}
+						break;
+				}
+				return style;
+			}
+		},
+		props: {
+			content: {
+				type: String,
+				default: ''
+			},
+
+			placement: {
+				type: String,
+				default: 'left'
+			},
+		}
+	}
+</script>
+
+<style>
+	.uni-tooltip {
+		position: relative;
+		cursor: pointer;
+		display: inline-block;
+	}
+
+	.uni-tooltip-popup {
+		z-index: 1;
+		display: none;
+		position: absolute;
+		background-color: #333;
+		border-radius: 8px;
+		color: #fff;
+		font-size: 12px;
+		text-align: left;
+		line-height: 16px;
+		padding: 12px;
+		overflow: auto;
+		width: 110px;
+	}
+
+
+	.uni-tooltip:hover .uni-tooltip-popup {
+		display: block;
+	}
+</style>

+ 85 - 0
jp-mobile/uni_modules/uni-tooltip/package.json

@@ -0,0 +1,85 @@
+{
+  "id": "uni-tooltip",
+  "displayName": "uni-tooltip 提示文字",
+  "version": "0.2.3",
+  "description": "Tooltip 提示文字",
+  "keywords": [
+    "uni-tooltip",
+    "uni-ui",
+    "tooltip",
+    "tip",
+    "文字提示"
+],
+  "repository": "https://github.com/dcloudio/uni-ui",
+  "engines": {
+    "HBuilderX": ""
+  },
+  "directories": {
+    "example": "../../temps/example_temps"
+  },
+"dcloudext": {
+    "sale": {
+      "regular": {
+        "price": "0.00"
+      },
+      "sourcecode": {
+        "price": "0.00"
+      }
+    },
+    "contact": {
+      "qq": ""
+    },
+    "declaration": {
+      "ads": "无 ",
+      "data": "无",
+      "permissions": "无"
+    },
+    "npmurl": "",
+    "type": "component-vue"
+  },
+  "uni_modules": {
+    "dependencies": [],
+    "encrypt": [],
+    "platforms": {
+      "cloud": {
+        "tcb": "y",
+        "aliyun": "y"
+      },
+      "client": {
+        "Vue": {
+          "vue2": "y",
+          "vue3": "y"
+        },
+        "App": {
+          "app-vue": "y",
+          "app-nvue": "u"
+        },
+        "H5-mobile": {
+          "Safari": "y",
+          "Android Browser": "y",
+          "微信浏览器(Android)": "y",
+          "QQ浏览器(Android)": "y"
+        },
+        "H5-pc": {
+          "Chrome": "y",
+          "IE": "y",
+          "Edge": "y",
+          "Firefox": "y",
+          "Safari": "y"
+        },
+        "小程序": {
+          "微信": "y",
+          "阿里": "u",
+          "百度": "u",
+          "字节跳动": "u",
+          "QQ": "u",
+          "京东": "u"
+        },
+        "快应用": {
+          "华为": "u",
+          "联盟": "u"
+        }
+      }
+    }
+  }
+}

+ 8 - 0
jp-mobile/uni_modules/uni-tooltip/readme.md

@@ -0,0 +1,8 @@
+## Badge 数字角标
+> **组件名:uni-tooltip**
+> 代码块: `uTooltip`
+
+数字角标一般和其它控件(列表、9宫格等)配合使用,用于进行数量提示,默认为实心灰色背景,
+
+### [查看文档](https://uniapp.dcloud.io/component/uniui/uni-tooltip)
+#### 如使用过程中有任何问题,或者您对uni-ui有一些好的建议,欢迎加入 uni-ui 交流群:871950839