Browse Source

完善图片压缩和字体大小

LuChongMei 1 year ago
parent
commit
9413b8a152

+ 7 - 7
jp-console/jeeplus-modules/gw/src/main/java/com/jeeplus/gwflow/controller/GwFlowController.java

@@ -192,13 +192,13 @@ public class GwFlowController {
 				gwFlowDTOn.setGwId(gwFlowDTO.getGwId());
 				gwFlowDTOn.setState("1");
 				UserDTO userDTO3=userService.getUserByLoginName("bgszr","10000");
-				gwFlowDTO.setCreateBy(userDTO3);
-				gwFlowDTO.setUpdateBy(userDTO3);
-				gwFlowDTO.setCreateTruename(userDTO.getName());
-				gwFlowDTO.setNextTruename(userDTO3.getName());
-				gwFlowDTO.setNextUser(userDTO3.getId());
-				gwFlowDTO.setWhich("3");
-				gwFlowService.saveOrUpdate (gwFlowWrapper.toEntity (gwFlowDTO));
+				gwFlowDTOn.setCreateBy(userDTO3);
+				gwFlowDTOn.setUpdateBy(userDTO3);
+				gwFlowDTOn.setCreateTruename(userDTO.getName());
+				gwFlowDTOn.setNextTruename(userDTO3.getName());
+				gwFlowDTOn.setNextUser(userDTO3.getId());
+				gwFlowDTOn.setWhich("3");
+				gwFlowService.saveOrUpdate (gwFlowWrapper.toEntity (gwFlowDTOn));
 			}
 
 		}

+ 3 - 2
jp-mobile/components/jp-datetime-picker/jp-datetime-picker.vue

@@ -48,6 +48,7 @@
 		watch:{
 			value:{
 				handler (val) {
+					
 					if(val === 0) {
 						this.label = ''
 						return
@@ -55,13 +56,13 @@
 					const timeFormat = uni.$u.timeFormat
 					if(this.mode === 'date') {
 						this.label = val
-						this.value1 = Number(val);
+						this.value1 = Number(new Date());
 					}else if(this.mode === 'time'){
 						this.label = val
 						this.value1 = val;
 					}else if(this.mode === 'datetime'){
 						this.label = val
-						this.value1 = Number(val)
+						this.value1 = Number(new Date())
 					}
 					
 				},

+ 0 - 1
jp-mobile/components/ly-tree/ly-tree-node.vue

@@ -223,7 +223,6 @@
 			}
 			
 			this.node = this.tree.store.nodesMap[this.nodeId];
-			console.log("item",this.node);
 			this.highlightCurrent = this.tree.highlightCurrent;
 			if(this.node.data.icon ) {
 				this.node.icon = "../../static/img/flat-avatar.png"

+ 35 - 15
jp-mobile/pages/addressbook/addressbook.vue

@@ -1,5 +1,5 @@
 <template>
-	<view>
+	<view class="main">
 		<cu-custom bgColor="bg-blue">
 			<block slot="content">通讯录</block>
 		</cu-custom>
@@ -68,8 +68,18 @@
 		},
 		created() {
 			officeService.treeData().then(data => {
-				this.officeList = data
-				this.forItem(this.officeList)
+				// this.officeList = data
+				userService.list({
+					current: 1,
+					size: 10000
+				}).then((res) => {
+					this.userList = res.records
+					this.officeList = this.forItem(data)
+					this.total = res.total
+				}).catch((e) => {
+					throw e
+				})
+
 			})
 			userService.list({
 				current: 1,
@@ -125,23 +135,33 @@
 			},
 			// 遍历
 			forItem(list) {
-
 				for (let i = 0; i < list.length; i++) {
-					if (list[i].children) {
-						this.forItem(list[i].children)
+					let b = []
+					if(list[i].icon) continue;
+					b = this.userList.filter(item => item.officeDTO.id == list[i].id)
+					if (b.length > 0) {
+						b.forEach(item => {
+							this.$set(item, "icon", "/static/img/flat-avatar.png");
+						})
+						if (list[i].children) {
+							list[i].children = list[i].children.concat(b);
+							this.forItem(list[i].children)
+						} else {
+							this.$set(list[i], "children", b);
+						}
 					} else {
-						console.log(a);
-						let a = this.userList.filter(item => item.officeDTO.id == list[i].id)
-						if (a.length > 0) {
-							
-							a.forEach(item =>{
-								this.$set(item, "icon", "/static/img/flat-avatar.png");
-							})
-							this.$set(list[i], "children", a);
-							
+						if (list[i].children && list[i].children.length > 0) {
+							this.forItem(list[i].children)
+						} else {
+							let no = [{
+								id: "no001",
+								name: '暂无人员'
+							}]
+							this.$set(list[i], "children", no);
 						}
 					}
 				}
+				return list;
 			},
 		}
 	}

+ 148 - 133
jp-mobile/pages/fileTransmit/addFileTransmit.vue

@@ -1,9 +1,9 @@
 <template>
-	<view>
+	<view class="main">
 		<view class="bg-white default_title">
 			<u--form :model="inputForm" labelWidth="130px" class="u-form default_title" labelPosition="left"
 				ref="inputForm">
-				<u-form-item label="年度"  borderBottom prop="yearNum">
+				<u-form-item label="年度" borderBottom prop="yearNum">
 					<u--input readonly v-model="inputForm.yearNum" placeholder="输入年度" border="none"></u--input>
 				</u-form-item>
 				<u-form-item label="卡号" borderBottom prop="cardNum">
@@ -12,9 +12,9 @@
 			</u--form>
 		</view>
 		<view class="bg-white margin-top main_info">
-			<u--form :model="inputForm" labelWidth="130px" class="u-form default_title" labelPosition="left"
-				ref="inputForm">
-				<u-form-item label="来文机关" borderBottom prop="sendingAgency">
+			<u--form :model="inputForm" :rules="rules" labelWidth="130px" class="u-form default_title"
+				labelPosition="left" ref="inputForm">
+				<u-form-item required label="来文机关" borderBottom prop="sendingAgency">
 					<u--input v-model="inputForm.sendingAgency" placeholder="请输入来文机关" border="none"></u--input>
 				</u-form-item>
 				<u-form-item label="来文字号" borderBottom prop="docFontSize">
@@ -23,15 +23,15 @@
 				<u-form-item label="文件来源" borderBottom prop="fileSource">
 					<u--input v-model="inputForm.fileSource" placeholder="请输入文件来源" border="none"></u--input>
 				</u-form-item>
-				<u-form-item label="成文时间" borderBottom prop="writtenTime" @click="openDate(1)">
+				<u-form-item label="成文时间" borderBottom prop="writtenTime">
 					<jp-datetime-picker :show="iswrite" v-model="inputForm.writtenTime" placeholder="选择成文时间"
 						mode="date"></jp-datetime-picker>
 				</u-form-item>
-				<u-form-item label="收文时间" borderBottom prop="receivingTime" @click="openDate(2)">
+				<u-form-item label="收文时间" borderBottom prop="receivingTime">
 					<jp-datetime-picker :show="isreceive" v-model="inputForm.receivingTime" placeholder="选择收文时间"
 						mode="date"></jp-datetime-picker>
 				</u-form-item>
-				<u-form-item label="内容摘要" borderBottom prop="contentSummary">
+				<u-form-item required label="内容摘要" borderBottom prop="contentSummary">
 					<u--textarea v-model="inputForm.contentSummary" placeholder="请输入内容摘要" border="none"></u--textarea>
 				</u-form-item>
 				<u-form-item label="来文附件" prop="attachedDocumentId" labelPosition="top">
@@ -39,7 +39,11 @@
 						height="150" accept="file" :previewImage="false">
 						<view class="addfile flex"> <u-icon size="20" bold name="plus"></u-icon></view>
 					</u-upload>
+					<u-upload :fileList="fileLists" @afterRead="afterRead" multiple :maxCount="9" width="80" height="80"
+						accept="image" capture="camera" :previewImage="false">
+					</u-upload>
 				</u-form-item>
+				<view class="text-danger" style="font-size: 12px!important;">请确保上传图片内容清晰可见,所有涉密敏感信息不得上传</view>
 				<view class="other_info">
 					<view class="other_pdf">
 						<u-cell-group>
@@ -52,7 +56,7 @@
 				</view>
 				<u-upload :fileList="imgList" @delete="deletePic" multiple :maxCount="imgList.length"
 					:previewFullImage="true"></u-upload>
-				<u--text size="10" type="error" text="请确保上传图片内容清晰可见,所有涉密敏感信息不得上传"></u--text>
+
 				<view class="submit_btn flex">
 					<u-button v-if="!loading" type="primary" text="提交新增" @click="formSubmit"></u-button>
 					<u-button v-if="loading" :loading="loading" type="primary" text="加载中"></u-button>
@@ -60,7 +64,11 @@
 			</u--form>
 		</view>
 		<u-toast ref="uToast"></u-toast>
-
+		<u-overlay :show="loading">
+			<view class="warp">
+				<view class="rect"><u-button plain loading loadingText="加载中"></u-button></view>
+			</view>
+		</u-overlay>
 	</view>
 </template>
 
@@ -75,13 +83,14 @@
 	import gwCirculationCard2Service from '@/api/circulation/gwCirculationCard2.js'
 	export default {
 		mounted() {
-			gwCirculationCard2Service.getCardNum().then(data =>{
+			gwCirculationCard2Service.getCardNum().then(data => {
 				const currentYear = new Date().getFullYear();
 				this.inputForm.yearNum = currentYear
-				this.inputForm.cardNum = "["+currentYear +"]"+data+"号"
+				this.cardNum = data
+				this.inputForm.cardNum = "[" + currentYear + "]" + data + "号"
 				this.inputForm.writtenTime = moment().format('YYYY-MM-DD');
 				this.inputForm.receivingTime = moment().format('YYYY-MM-DD');
-			})	
+			})
 		},
 		data() {
 			return {
@@ -92,6 +101,7 @@
 				fileLists: [],
 				fileList: [],
 				imgList: [],
+				cardNum: "",
 				inputForm: {
 					id: '',
 					yearNum: '',
@@ -106,19 +116,24 @@
 					remark: '',
 					state: '1'
 				},
+				rules: {
+					sendingAgency: [{
+						required: true,
+						message: '请输入来问机关',
+						trigger: ['blur', 'change']
+					}],
+					contentSummary: [{
+						required: true,
+						message: '请输入内容摘要',
+						trigger: ['blur', 'change']
+					}]
+				}
 			}
 		},
 		methods: {
-			// 打开日期
-			openDate(type) {
-				console.log("c====", type);
-				if (type == 1) {
-					this.iswrite = !this.iswrite
-				} else if (type == 2) {
-					this.isreceive = !this.isreceive
-				}
-			},
+
 			showToast(params) {
+				this.loading = false
 				this.$refs.uToast.show({
 					...params,
 					complete() {
@@ -151,83 +166,70 @@
 				this[`fileLists${event.name}`].splice(event.index, 1)
 			},
 			// 图片压缩
-			compressH5(urlData) {
+			compressH5(urlData, targetSizeKB, initialQuality = 1.0) {
+				const maxQuality = 1.0;
+				const minQuality = 0.0;
+				const tolerance = 0.01; // 根据需要调整公差
 				let that = this
 				return new Promise((resolve, reject) => {
-					let a = uni.getImageInfo({
-						src: urlData.url,
-						success(res) {
-							let originWidth = res.width; //图片原始宽
-							let originHeight = res.height; //图片原始高
-							let maxWidth = 800;
-							let maxHeight = 800;
-							let img = new Image()
-							img.src = res.path
-							let canvas = document.createElement('canvas');
-							let ctx = canvas.getContext('2d')
-							// 目标尺寸
-							let targetWidth = originWidth;
-							let targetHeight = originHeight;
+					let binarySearch = (min, max) => {
+						const midQuality = (min + max) / 2;
+						uni.getImageInfo({
+							src: urlData.url,
+							success(res) {
+								let img = new Image()
+								img.src = res.path
+								img.onload = function() {
+									const canvas = document.createElement('canvas');
+									const ctx = canvas.getContext('2d');
 
-							canvas.width = targetWidth
-							canvas.height = targetHeight
-							// 图片压缩
-							ctx.drawImage(img, 0, 0, targetWidth, targetHeight)
-							// canvas对图片进行缩放 0.3是我定义的图片质量,
-							let base64 = canvas.toDataURL(urlData.type, 0.3);
-							// 将base64转换为file流,
-							
-							let file = that.convertBase64UrlToFile({
-								url: base64,
-								type: urlData.type,
-								name: urlData.name
-							})
-							
-							urlData.size = file.size
-							let result =  that.uploadFilePromise(urlData)
-							setTimeout(() => {
-								resolve(result)
-							}, 1000)
-						},
-						fail() {
-							uni.showModal({
-								title: '提示',
-								content: '图片压缩失败',
-								showCancel: false
-							});
-						}
-					})
-				})
-			},
-			convertBase64UrlToFile(base64) {
-				let urlData = base64.url
-				let type = base64.type
-				let contentName = base64.name
-				let bytes = null
-				if (urlData.split(',').length > 1) { //是否带前缀
-					bytes = window.atob(urlData.split(',')[1]) // 去掉url的头,并转换为byte
-				} else {
-					bytes = window.atob(urlData)
-				}
-				// 处理异常,将ascii码小于0的转换为大于0
-				let ab = new ArrayBuffer(bytes.length)
-				let ia = new Uint8Array(ab)
-				for (let i = 0; i < bytes.length; i++) {
-					ia[i] = bytes.charCodeAt(i)
-				}
-				let result = new Blob([ab], {
-					type: type,
-				})
-				let result1 = new File([result], contentName, {
-					type: type
+									canvas.width = img.width;
+									canvas.height = img.height;
+
+									ctx.clearRect(0, 0, canvas.width, canvas.height);
+									ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
+
+									// 使用异步的 toBlob 方法
+									canvas.toBlob(async (blob) => {
+										const fileSizeKB = blob.size / 1024;
+										if (Math.abs(fileSizeKB - targetSizeKB) <
+											tolerance || max - min < tolerance) {
+											// 当前质量足够接近目标大小,使用当前质量解析
+											const dataUrl = canvas.toDataURL(urlData.type, midQuality);
+											let result = that
+												.uploadFilePromise(dataUrl)
+											setTimeout(() => {
+												resolve(
+													result)
+											}, 1000)
+
+										} else if (fileSizeKB > targetSizeKB) {
+											// 如果文件大小太大,降低质量,继续二分查找
+											binarySearch(min, midQuality);
+										} else {
+											// 如果文件大小太小,增加质量,继续二分查找
+											binarySearch(midQuality, max);
+										}
+									}, urlData.type, midQuality);
+								};
+							},
+							fail() {
+								uni.showModal({
+									title: '提示',
+									content: '图片压缩失败',
+									showCancel: false
+								});
+							}
+						})
+					}
+					// 开始二分查找
+					binarySearch(minQuality, maxQuality);
 				})
-				result1.url = window.URL.createObjectURL(result)
-				return result1
 			},
 			// 新增图片
 			async afterRead(event) {
 				uni.showLoading({
-					title:"上传中"
+					title: "上传中"
 				})
 				// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
 				let lists = [].concat(event.file)
@@ -240,48 +242,47 @@
 					})
 				})
 				for (let i = 0; i < lists.length; i++) {
-					let result =""
-					if (isImageFormat(lists[i].name) && lists[i].size > (200 * 1024)) {
-						result = await this.compressH5(lists[i]);
-					}else {
-						result = await this.uploadFilePromise(lists[i])
-					}
-					let item = this.fileLists[fileListLen]
-
-					this.fileLists.splice(fileListLen, 1, Object.assign(item, {
-						status: 'success',
-						message: '',
-						url: result
-					}))
-					fileListLen++
-					if (isImageFormat(item.url)) {
+					let result = ""
+					if (isImageFormat(lists[i].name)) {
+						if (lists[i].size > (200 * 1024)) {
+							result = await this.compressH5(lists[i], 150);
+						} else {
+							result = await this.uploadFilePromise(lists[i].url)
+						}
 						let item1 = {
 							url: BASE_URL + result
 						}
 						this.imgList.push(item1)
+
 					} else {
-						const fileName = item.url.split(/[/\\=]/).pop();
+						result = await this.uploadFilePromise(lists[i].url)
+						const fileName = result.split(/[/\\=]/).pop();
 						let a = {
 							name: fileName,
-							url: item.url
+							url: BASE_URL + result
 						}
 						this.fileList.push(a)
 					}
+					let item = this.fileLists[fileListLen]
+					this.fileLists.splice(fileListLen, 1, Object.assign(item, {
+						status: 'success',
+						message: '',
+						url: result
+					}))
+					fileListLen++
 				}
 				uni.hideLoading()
 			},
 			async uploadFilePromise(param) {
-				
 				return new Promise((resolve, reject) => {
-					
+
 					let a = uni.uploadFile({
 						url: this.BASE_URL + '/gwfile/upload?uploadPath=filtransmit',
-						filePath: param.url,
+						filePath: param,
 						name: 'file',
 						header: {
 							"token": $auth.getUserToken()
 						},
-						formData: param,
 						success: (res) => {
 							setTimeout(() => {
 								resolve(res.data)
@@ -304,29 +305,37 @@
 					files.push(item.url)
 				})
 				this.inputForm.attachedDocumentId = files.join(",");
-				this.inputForm.writtenTime = this.inputForm.writtenTime+" 00:00:00";
-				this.inputForm.receivingTime = this.inputForm.receivingTime+" 00:00:00";
-				// this.$refs['inputForm'].validate((valid) => {
-				// 	if (valid) {
-				gwCirculationCard2Service.save(this.inputForm).then((data) => {
+				this.inputForm.writtenTime = this.inputForm.writtenTime + " 00:00:00";
+				this.inputForm.receivingTime = this.inputForm.receivingTime + " 00:00:00";
+				this.inputForm.cardNum = this.cardNum
+				this.$refs.inputForm.validate().then(valid => {
+					console.log("valid", valid);
+					if (valid) {
+						gwCirculationCard2Service.save(this.inputForm).then((data) => {
 
-					let param = {
-						type: 'success',
-						message: data,
-						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png',
-						url: "/pages/index/index"
-					}
-					this.showToast(param);
-				}).catch(() => {
-					let param = {
-						type: 'error',
-						message: data,
-						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png',
+							let param = {
+								type: 'success',
+								message: data,
+								iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png',
+								url: "/pages/index/index"
+							}
+							this.showToast(param);
+						}).catch(() => {
+							let param = {
+								type: 'error',
+								message: data,
+								iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png',
+							}
+							this.showToast(param);
+						})
 					}
-					this.showToast(param);
+				}).catch(e => {
+					this.inputForm.cardNum = "[" + this.inputForm.yearNum + "]" + this.cardNum + "号"
+					this.inputForm.writtenTime = moment().format('YYYY-MM-DD');
+					this.inputForm.receivingTime = moment().format('YYYY-MM-DD');
+					this.loading = false
 				})
-				// 	}
-				// })
+
 			}
 
 		}
@@ -334,13 +343,19 @@
 </script>
 
 <style>
+	.warp {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		height: 100%;
+	}
+
 	.default_title {
 		padding-top: 0px;
 	}
 
 	.main_info {
 		margin-top: 15px;
-		/* height: 80vh; */
 	}
 
 	.submit_btn {

+ 46 - 27
jp-mobile/pages/fileTransmit/examineFile.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="office_page">
+	<view>
 		<fileCard :gwId="gwId"></fileCard>
 		<view class="office_main">
 			<view class="office_title">
@@ -34,8 +34,9 @@
 						<u-button v-if="isAll" @click="formSubmit" type="success" text="归档"></u-button>
 						<!-- <u-button v-if="!show && one" :disabled="!auditForm.nextLeadUser!=''" type="primary" text="确认签字"
 							@click="show = true"></u-button> -->
-						<u-button v-if="one && !loading" type="primary" :disabled="auditForm.nextLeadUser==''" text="确认签字" @click="doSubmit"></u-button>
-						<u-button v-if="!one && !loading" type="primary"  text="提交" @click="doSubmit"></u-button>
+						<u-button v-if="one && !loading" type="primary" :disabled="auditForm.nextLeadUser==''"
+							text="确认签字" @click="doSubmit"></u-button>
+						<u-button v-if="!one && !loading" type="primary" text="提交" @click="doSubmit"></u-button>
 						<u-button v-if="loading" :loading="loading" type="primary" text="加载中"></u-button>
 					</view>
 				</u--form>
@@ -68,13 +69,17 @@
 					<view class="submit_btn flex ">
 						<!-- <u-button v-if="!show" type="primary" text="确认签字" @click="show = true"></u-button> -->
 						<u-button v-if="loading" :loading="loading" type="primary" text="加载中"></u-button>
-						<u-button v-if="show && !loading" type="primary" text="确认签字" @click="doSubmit"></u-button>
+						<u-button v-if="!loading" type="primary" text="确认签字" @click="doSubmit"></u-button>
 					</view>
 				</u--form>
 			</view>
 		</view>
 		<u-toast ref="uToast"></u-toast>
-
+		<u-overlay :show="loading">
+			<view class="warp">
+				<view class="rect"><u-button plain loading loadingText="加载中"></u-button></view>
+			</view>
+		</u-overlay>
 	</view>
 
 </template>
@@ -94,15 +99,15 @@
 			this.gwId = option.id
 			gwFlowService.queryByGwId(this.gwId).then(data => {
 				if (data.length > 1) this.one = false
-				if(this.one) {
+				if (this.one) {
 					this.roleId = "1770353074553331713"
-				}else {
-					
+				} else {
+
 					this.roleId = "1773547256256622594"
 				}
 				userService.leaderList(this.roleId).then(data => {
 					this.leaderList = data
-					if(this.one) this.auditForm.nextLeadUser =data[0].loginName
+					if (this.one) this.auditForm.nextLeadUser = data[0].loginName
 				})
 				let user = $auth.getUserInfo()
 				let role = $auth.getUserInfo().roleNames
@@ -116,11 +121,15 @@
 				}
 				if (role == '办公室主任') {
 					this.isoffice = true
-					let gw1 = data.filter(item => {
-						return item.which == 0
-					})
-					this.auditForm = gw1[0]
+					if(gw.length == 0) {
+						let gw1 = data.filter(item => {
+							return item.which == 0
+						})
+						gw1.sort((a, b) => b.createTime.localeCompare(a.createTime) || b.createTime.localeCompare(a
+							.createTime));
+						this.auditForm = gw1[0]
 					}
+				}
 				if (role == '局领导' && gw.length > 0) this.isleader = true
 				if (role == '科室负责人' && gw.length > 0) this.isundertake = true
 			})
@@ -137,7 +146,9 @@
 				show: false,
 				one: true,
 				action: this.BASE_URL + '/gwfile/upload?uploadPath=sign', //上传服务器的地址
-				header: {"token": $auth.getUserToken()}, //图片上传携带头部信息
+				header: {
+					"token": $auth.getUserToken()
+				}, //图片上传携带头部信息
 				auditForm: {
 					id: '',
 					gwId: '',
@@ -154,7 +165,7 @@
 					nextDepUser: '',
 					remark: '',
 				},
-				gwForm:{},
+				gwForm: {},
 				gwId: "",
 				isoffice: false,
 				isleader: false,
@@ -170,7 +181,7 @@
 					}],
 				},
 				searchForm: {
-					
+
 					// loginName: "",
 					// name: "",
 					// companyDTO: {
@@ -180,11 +191,12 @@
 					// 	id: "",
 					// },
 				},
-				roleId:""
+				roleId: ""
 			}
 		},
 		methods: {
 			showToast(params) {
+				this.loading = false
 				this.$refs.uToast.show({
 					...params,
 					complete() {
@@ -199,7 +211,7 @@
 			 * 签名完成回调
 			 */
 			signToUrl(e) {
-				
+
 				this.auditForm.signfj = e.data
 				if (e.error_code && e.error_code === '201') {
 					uni.showToast({
@@ -211,21 +223,21 @@
 			},
 			// 提交表单
 			doSubmit() {
-				let inputForm={};
+				let inputForm = {};
 				this.loading = true
-					if (this.auditForm.nextLeadUser != '' || this.auditForm.nextDepUser != '') this.auditForm.next = '1'
-					this.auditForm.state = "0"
-					this.auditForm.gwId = this.gwId
-					const date =  moment().format('YYYY-MM-DD HH:mm:ss');
-					this.auditForm.updateTime = date
-					inputForm = this.auditForm
-				
+				if (this.isoffice) this.auditForm.next = '1'
+				this.auditForm.state = "0"
+				this.auditForm.gwId = this.gwId
+				const date = moment().format('YYYY-MM-DD HH:mm:ss');
+				this.auditForm.updateTime = date
+				inputForm = this.auditForm
+
 				gwFlowService.save(inputForm).then(data => {
 					let param = {
 						type: 'success',
 						message: data,
 						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png',
-						url:"/pages/fileTransmit/fileTransmitList?type=1"
+						url: "/pages/fileTransmit/fileTransmitList?type=1"
 					}
 					this.showToast(param);
 				}).catch(() => {
@@ -268,6 +280,13 @@
 </script>
 
 <style>
+	.warp {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		height: 100%;
+	}
+
 	.office_main {
 		width: 100%;
 		margin: 5px 0;

+ 26 - 20
jp-mobile/pages/fileTransmit/fileCard.vue

@@ -15,31 +15,31 @@
 					</u-col>
 				</u-row>
 				<u-row justify="space-between" class="card_row">
-					<u-col span="3" textAlign="center" class="card_col">
+					<u-col span="3" textAlign="center" class="">
 						<view>来文机关</view>
 					</u-col>
-					<u-col span="3" textAlign="center" class="">
-						<u--text size="10" align="center" lines="1" :text="inputForm.sendingAgency"></u--text>
+					<u-col span="3" textAlign="center" class="card_col_1">
+						<u--text size="16" align="center" lines="1" :text="inputForm.sendingAgency"></u--text>
 					</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="10" align="center" lines="1" :text="inputForm.docFontSize"></u--text>
+						<u--text size="16" align="center" lines="1" :text="inputForm.docFontSize"></u--text>
 					</u-col>
 				</u-row>
 				<u-row justify="space-between" class="card_row card_row_border">
-					<u-col span="3" textAlign="center" class="card_col">
+					<u-col span="3" textAlign="center" class="">
 						<view>收文时间</view>
 					</u-col>
-					<u-col span="3" textAlign="center" class="">
-						<u--text size="10" align="center" lines="1" :text="inputForm.receivingTime"></u--text>
+					<u-col span="3" textAlign="center" class="card_col_1">
+						<u--text size="16" align="center" lines="1" :text="inputForm.receivingTime"></u--text>
 					</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="10" align="center" lines="1" :text="inputForm.fileSource"></u--text>
+						<u--text size="16" align="center" lines="1" :text="inputForm.fileSource"></u--text>
 					</u-col>
 				</u-row>
 				<u-row justify="space-between" class="card_row card_row_border">
@@ -52,12 +52,12 @@
 						</view>
 					</u-col>
 				</u-row>
-				<u-row v-if="officeInfo.length>0" style="height: 70px;" justify="space-between"
+				<u-row v-if="officeInfo.length>0"  justify="space-between"
 					class="card_row card_row_border">
-					<u-col span="1" textAlign="center">
+					<u-col span="2" textAlign="center">
 						<view class="vertical-text">办公室拟办</view>
 					</u-col>
-					<u-col span="11" class="info_abstract">
+					<u-col span="10" class="info_abstract">
 						<view v-for="item in officeInfo" class="info_abstract_v">
 							<view>
 								{{item.content}}
@@ -70,10 +70,10 @@
 					</u-col>
 				</u-row>
 				<u-row v-if="leaderInfo.length>0" justify="space-between" class="card_row card_row_border">
-					<u-col span="1" textAlign="center">
+					<u-col span="2" textAlign="center">
 						<view class="vertical-text">领导批示</view>
 					</u-col>
-					<u-col span="11" class="info_abstract">
+					<u-col span="10" class="info_abstract">
 						<view v-for="leader in leaderInfo" class="info_abstract_v">
 							<view>
 								{{leader.content}}
@@ -86,10 +86,10 @@
 					</u-col>
 				</u-row>
 				<u-row v-if="undertakeInfo.length>0" justify="space-between" class="card_row card_row_border">
-					<u-col span="1" textAlign="center">
+					<u-col span="2" textAlign="center">
 						<view class="vertical-text">承办情况</view>
 					</u-col>
-					<u-col span="11" class="info_abstract">
+					<u-col span="10" class="info_abstract">
 						<view v-for="item in undertakeInfo" class="info_abstract_v">
 							<view>
 								{{item.content}}
@@ -148,6 +148,7 @@
 			gwCirculationCard2Service.queryById(this.gwId).then(data => {
 				this.inputForm = data
 				this.inputForm.receivingTime = this.inputForm.receivingTime.substring(5, 10)
+				this.inputForm.cardNum = "[" + this.inputForm.yearNum + "]" + this.inputForm.cardNum + "号"
 				this.fileLists = this.inputForm.attachedDocumentId.split(",")
 				this.fileLists.forEach(item => {
 					if (isImageFormat(item)) {
@@ -241,8 +242,9 @@
 		methods: {
 			// 预览pdf
 			preview(fileUrl) {
+				console.log("luji",fileUrl);
 				uni.navigateTo({
-					url: "/pages/pdfPreview/pdfPreview?url=" + fileUrl
+					url: "/pages/pdfPreview/pdfPreview?url=" + fileUrl.url
 				})
 			},
 			// 下载文件
@@ -335,6 +337,9 @@
 		width: 100%;
 		background-color: #fefefe;
 	}
+	/* .card_main * {
+		font-size: 16px!important;
+	} */
 
 	.card_banner {
 		width: 100%;
@@ -352,7 +357,7 @@
 	}
 
 	.card_info_title {
-		font-size: 16px;
+		font-size: 20px;
 		font-weight: 700;
 		padding-top: 10px;
 		color: #36a7f3;
@@ -360,11 +365,11 @@
 
 	.card_table {
 		padding: 20px 20px;
-		font-size: 12px;
+		font-size: 18px;
 	}
 
 	.card_row {
-		line-height: 30px;
+		line-height: 50px;
 		border: 1px solid;
 		word-wrap: break-word;
 	}
@@ -382,7 +387,8 @@
 	}
 
 	.info_abstract {
-		line-height: 16px;
+		line-height: 34px;
+		font-size: 16px; 
 		word-wrap: break-word;
 		border-left: 1px solid;
 	}

+ 35 - 17
jp-mobile/pages/fileTransmit/fileInfo.vue

@@ -1,17 +1,24 @@
 <template>
-	<view class="info_page">
+	<view class="page_main">
 		<fileCard :gwId="gwId"></fileCard>
 		<view class="info_main">
 			<u-steps :current="current" direction="column" inactiveColor="#36a7f3" activeColor="#5fdf50">
+				<u-steps-item title="发起" desc="办公室管理员">
+				</u-steps-item>
 				<u-steps-item v-for="item in downList" :title="item.which=='0'?'办公室拟办':item.which=='1'?'领导审批':'承办情况'"
-					:desc="item.nextTruename +' - '+item.updateTime">
+					: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'?'领导审批':'承办情况'"
+					:desc="item.state==1?item.nextTruename :item.nextTruename +' - '+item.updateTime">
 				</u-steps-item>
-				<u-steps-item v-for="item in officeInfo" title="办公室拟办" :desc="item.nextTruename +' - '+item.updateTime">
+				<!-- <u-steps-item v-for="item in officeInfo" title="办公室拟办" :desc="item.nextTruename +' - '+item.updateTime">
 				</u-steps-item>
 				<u-steps-item title="领导审批" v-for="item in leaderInfo"
 					:desc="item.nextTruename +' - '+item.updateTime"></u-steps-item>
 				<u-steps-item title="承办情况" v-for="item in undertakeInfo"
-					:desc="item.nextTruename +' - '+item.updateTime"></u-steps-item>
+					:desc="item.nextTruename +' - '+item.updateTime"></u-steps-item> -->
+				<!-- <u-steps-item v-if="allNum == downList.length" title="归档" desc="">
+				</u-steps-item> -->
 			</u-steps>
 		</view>
 	</view>
@@ -39,33 +46,44 @@
 				// 承办信息
 				undertakeInfo: [],
 				downList: [],
-				current: 0
+				gwList: [],
+				current: 0,
+				allNum: ""
 			}
 		},
 		mounted() {
 			gwFlowService.queryByGwId(this.gwId).then(data => {
+				data.sort((a, b) => a.createTime.localeCompare(b.createTime) || a.createTime
+					.localeCompare(b.createTime));
 				console.log("data========", data);
+				this.allNum = data.length
+
 				data.forEach(item => {
-					if (item.state == 0) this.downList.push(item)
-					if (item.which == 0 && item.state == 1) {
-						this.officeInfo.push(item)
-					} else if (item.which == 1 && item.state == 1) {
-						if (item.state == 1) this.current = 1
-						this.leaderInfo.push(item)
-					} else if (item.which == 2 && item.state == 1) {
-						if (item.state == 1) this.current = 2
-						this.undertakeInfo.push(item)
+					if (item.state == 0) {
+						this.downList.push(item)
+					} else {
+						this.gwList.push(item)
 					}
+					// if (item.which == 0 && item.state == 1) {
+					// 	this.officeInfo.push(item)
+					// } else if (item.which == 1 && item.state == 1) {
+					// 	if (item.state == 1) this.current = 1
+					// 	this.leaderInfo.push(item)
+					// } else if (item.which == 2 && item.state == 1) {
+					// 	if (item.state == 1) this.current = 2
+					// 	this.undertakeInfo.push(item)
+					// }
 				})
-				this.downList.sort((a, b) => a.createTime.localeCompare(b.createTime) || a.createTime.localeCompare(b.createTime));
-				this.current = this.downList.length
+				this.downList.sort((a, b) => a.createTime.localeCompare(b.createTime) || a.createTime
+					.localeCompare(b.createTime));
+				this.current = this.downList.length+1
 			})
 		}
 	}
 </script>
 
 <style>
-	.info_page {
+	.page_main {
 		width: 100%;
 		background-color: #fefefe;
 	}

+ 35 - 26
jp-mobile/pages/fileTransmit/fileTransmitList.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="file_list_page">
+	<view >
 		<view class="list_search card_banner flex">
 			<uni-data-select class="list_search_select" v-model="searchForm.sendingAgency" :localdata="range"
 				placeholder="发文部门"></uni-data-select>
@@ -19,13 +19,16 @@
 					</view>
 					<view slot="value">
 						
-						<view class="text-grey text-sm  list_label margin-top">
-							{{item.createTime}} <u-tag v-if="type==5" :text="item.state==1?'待办':item.state == 3?'归档':'已办'" plain size="mini" :type="item.state==1?'warning':item.state == 3?'primary':'success'">
-						</u-tag>
+						<view class="text-grey text-sm list_label margin-top">
+							{{item.createTime}} 
+						</view>
+						<view >
+							<u-tag v-if="type==5" :text="item.state==1?'待办':item.state == 3?'归档':'已办'" plain  :type="item.state==1?'warning':item.state == 3?'primary':'success'">
+							</u-tag>
 						</view>
 					</view>
 					<view slot="label">
-						<view class="text-grey text-sm margin-top">
+						<view class="text-grey  margin-top">
 							{{item.sendingAgency}}
 						</view>
 					</view>
@@ -106,34 +109,35 @@
 			// 查看详情
 			toInfo(item) {
 				console.log("item ===",this.type);
-				if (this.type == 3 || this.type == 5) {
+				if (this.type == 3 || this.type == 5 || this.type == 4) {
 					uni.navigateTo({
 						url: '/pages/fileTransmit/fileInfo?id=' + item.id
 					})
 				} else {
-					let user = $auth.getUserInfo()
-					let role = $auth.getUserInfo().roleNames
-					if (role == '办公室主任') {
 						uni.navigateTo({
 							url: '/pages/fileTransmit/examineFile?id=' + item.id
 						})
-					} else {
-						gwFlowService.queryByGwId(item.id).then(data => {
-							let gw = data.filter(item => {
-								return item.nextUser == user.id && item.state == 1
-							})
-							if (gw.length > 0) {
-								uni.navigateTo({
-									url: '/pages/fileTransmit/examineFile?id=' + item.id
-								})
-							} else {
-								uni.navigateTo({
-									url: '/pages/fileTransmit/fileInfo?id=' + item.id
-								})
-							}
+					// let user = $auth.getUserInfo()
+					// let role = $auth.getUserInfo().roleNames
+					// if (role == '办公室主任') {
+					// 	uni.navigateTo({
+					// 		url: '/pages/fileTransmit/examineFile?id=' + item.id
+					// 	})
+					// } else {
+					// 	gwFlowService.queryByGwId(item.id).then(data => {
+					// 		let gw = data.filter(item => {
+					// 			return item.nextUser == user.id && item.state == 1
+					// 		})
+					// 		if (gw.length > 0) {
+					// 			uni.navigateTo({
+					// 				url: '/pages/fileTransmit/examineFile?id=' + item.id
+					// 			})
+					// 		} else {
+								
+					// 		}
 
-						})
-					}
+					// 	})
+					// }
 
 
 				}
@@ -201,7 +205,12 @@
 		height: 60px;
 		background-color: #36a7f3;
 	}
-
+	.ellipsis-description {
+		font-size: 20px;
+	}
+	.u-transition {
+		align-items: flex-end;
+	}
 	.list_search_icon {
 		line-height: 60px;
 	}

+ 7 - 3
jp-mobile/pages/login/login.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="content">
+	<view class="main">
 		<view id="box">
 
 			<view id="top" class="">
@@ -12,10 +12,10 @@
 			<view class="login-form">
 				<u--form :model="inputForm" labelWidth="100px"  labelPosition="left" :rules="rules" ref="uForm">
 						<u-form-item label="用户名" borderBottom prop="username">
-							<u-input border="none" v-model="inputForm.username" />
+							<u-input   v-model="inputForm.username" />
 						</u-form-item>
 						<u-form-item label="密码" borderBottom prop="password">
-							<u-input border="none" password v-model="inputForm.password" />
+							<u-input  password v-model="inputForm.password" />
 						</u-form-item>
 						<!-- <u-form-item label="验证码" borderBottom prop="code">
 							<u-input border="none" v-model="inputForm.code" />
@@ -94,7 +94,11 @@
 				  	url: '../index/index',
 				  });
 				}).catch(e => {
+					uni.showToast({
+						title:e.data
+					})
 				  this.getCaptcha()
+				  
 				  console.error(e)
 				})
 			})

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

@@ -12,7 +12,7 @@
 			};
 		},
 		onLoad(params) {
-			this.pdfUrl = '/hybrid/html/pdf.html?url=' + params.url
+			this.pdfUrl = `/hybrid/html/web/viewer.html?file=${encodeURIComponent(params)}`
 
 		},
 		onBackPress() {}

+ 1 - 2
jp-mobile/pages/workbench/workbench.vue

@@ -1,5 +1,5 @@
 <template>
-	<view>
+	<view class="main">
 		<cu-custom bgColor="bg-blue">
 			<block slot="content">文件传阅</block>
 		</cu-custom>
@@ -120,7 +120,6 @@
 		}),
 	    async mounted() {
 			gwCirculationCard2Service.getStatistics().then(data =>{
-				console.log("Statistics==",data);
 				this.statistics = data
 			})
 			// let res = await actCategoryService.treeData()

+ 3 - 0
jp-mobile/static/css/main.css

@@ -16,6 +16,9 @@ body {
 	background-color: #eee;
 	font-family: Helvetica Neue, Helvetica, sans-serif;
 }
+.main *{
+	font-size: 22px!important;
+}
 
 view,
 scroll-view,