Browse Source

修改飞行质控无法启动的问题

lsh 1 week ago
parent
commit
cf233134ce

+ 25 - 0
lib/gmCrypt.ts

@@ -0,0 +1,25 @@
+import { sm4 } from 'sm-crypto'
+
+const default_hexKey = '86C63180C2806ED1F47B859DE501215B'
+
+
+/*
+ * text 待加密文本
+ */
+export function encrypt(text) {
+  const encrypt = sm4.encrypt(text, default_hexKey,{ mode: 'ecb', padding: 'pkcs#7' })
+  return encrypt
+}
+
+/*
+ * text 待解密密文
+ */
+export function decrypt(text) {
+  const decrypt = sm4.decrypt(text, default_hexKey,{ mode: 'ecb', padding: 'pkcs#7' })
+  return decrypt
+}
+
+export default {
+  encrypt,
+  decrypt
+}

+ 2 - 2
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "tcm-code-uni-app",
-    "appid" : "__UNI__B754677",
+    "appid" : "__UNI__144711F",
     "description" : "",
     "versionName" : "1.0.0",
     "versionCode" : "100",
@@ -116,7 +116,7 @@
     "h5" : {
         "router" : {
             "mode" : "history",
-            "base" : "/ydzk/"
+            "base" : "/zyzk/"
         },
         "devServer" : {
             "port" : 5005,

+ 2 - 1
package.json

@@ -1,5 +1,6 @@
 {
   "dependencies": {
-    "crypto-js": "^4.1.1"
+    "crypto-js": "^4.1.1",
+    "sm-crypto": "^0.3.13"
   }
 }

+ 6 - 0
pages.json

@@ -1,6 +1,12 @@
 {
 	"pages": [ //pages数组中第一项表示应用启动页,参考:https://uniapp.dcloud.io/collocation/pages
 		{
+			"path": "pages/index/login",
+			"style": {
+				"navigationBarTitleText": "登录页"
+			}
+		},
+		{
 			"path": "pages/index/index",
 			"style": {
 				"navigationBarTitleText": "微信登录"

+ 99 - 118
pages/index/index.vue

@@ -2,123 +2,104 @@
 </template>
 
 <script>
-	import http from '@/utils/request'
-	import * as commonuni from '@/utils/commonuni'
-	const ystabbar = () => {
-		uni.setTabBarItem({
-			index: 0,
-			visible: true
-		})
-		uni.setTabBarItem({
-			index: 1,
-			visible: true
-		})
-		uni.setTabBarItem({
-			index: 2,
-			visible: false
-		})
-		uni.setTabBarItem({
-			index: 3,
-			visible: false
-		})
-	}
-	const djtabbar = () => {
-		uni.setTabBarItem({
-			index: 0,
-			visible: false
-		})
-		uni.setTabBarItem({
-			index: 1,
-			visible: false
-		})
-		uni.setTabBarItem({
-			index: 2,
-			visible: true
-		})
-		uni.setTabBarItem({
-			index: 3,
-			visible: true
-		})
-	}
-	export default {
-		onLoad(option) {
-			if (option && (option.code || option.openId)) {
-				console.log('code', option.code) // name eagle
-				var code = option.code
-				var openId = option.openId
-				var url = openId != undefined ? "app-api/wxLogin/loginOpenId?openId=" + openId :
-					"app-api/wxLogin/login?code=" + code
-				http.get(url).then(e => {
-					uni.setStorage({
-						key: 'openId',
-						data: e.openId,
-					})
-					// commonuni.setStorage("openId",e.openId)
-					// 4001 没有该用户   4002未审核 4003审核拒绝
-					if (e.code == '4001') {
-						//注册页面
-						uni.navigateTo({
-							url: '../login/register'
-						});
-						return
-					}
-					if (e.code == '4002') {
-						// 未审核
-						uni.navigateTo({
-							url: '../login/registerSuccess'
-						});
-						return
-					}
-					if (e.code == '4003') {
-						// 未审核
-						uni.navigateTo({
-							url: '../login/registerFail?isRegister='+e.isRegister+'&bhgText='+e.bhgText+'&codeId='+e.id + '&openId=' + e.openId
-						});
-						return
-					}
-					uni.setStorage({
-						key: 'token',
-						data: e.token,
-					})
-					http.get("app-api/wxLogin/userInfo").then(user => {
-						console.log(user)
-						uni.setStorage({
-							key: 'userInfo',
-							data: user,
-						})
-						let roles = e.roleCode
-						if((user.rolesCodes.toString().indexOf('YCAdmin')!= -1 && user.rolesCodes.toString().indexOf('flyAdmin') != -1) ||
-							(roles.toString().indexOf('YCAdmin')!= -1 && roles.toString().indexOf('flyAdmin') != -1)){
-							uni.navigateTo({
-								url:'/pages/login/multipleRoles'
-							})
-						}
-						if ((user.rolesCodes.toString().indexOf('YCAdmin') != -1)
-						|| (roles.toString().indexOf('YCAdmin') != -1)) {
-							uni.switchTab({
-								url: '../ypczk/djfk/index/djfkIndex'
-							});
-							djtabbar()
-						}
-						if((user.rolesCodes.toString().indexOf('flyAdmin') != -1)
-						|| (roles.toString().indexOf('flyAdmin') != -1)){
-							uni.switchTab({
-								url: '../ypczk/index/leaderIndex'
-							});
-							ystabbar()
-						}
-						else {
-							uni.navigateTo({
-								url: '../login/registerFail'
-							});
-						}
-					})
+import http from '@/utils/request'
+import * as commonuni from '@/utils/commonuni'
 
-				})
-			}
-		}
-	}
-</script>
+// 设置tabbar可见性
+const ystabbar = () => {
+  uni.setTabBarItem({ index: 0, visible: true })
+  uni.setTabBarItem({ index: 1, visible: true })
+  uni.setTabBarItem({ index: 2, visible: false })
+  uni.setTabBarItem({ index: 3, visible: false })
+}
+
+const djtabbar = () => {
+  uni.setTabBarItem({ index: 0, visible: false })
+  uni.setTabBarItem({ index: 1, visible: false })
+  uni.setTabBarItem({ index: 2, visible: true })
+  uni.setTabBarItem({ index: 3, visible: true })
+}
+
+export default {
+  onLoad(option) {
+    if (!option || !(option.code || option.openId || option.isLogin)) return
+
+    const isLogin = option.isLogin === 'true' // 确保isLogin是布尔值
+    console.log('isLogin value:', isLogin)
+
+    if (isLogin) {
+      this.handleLoginSuccess(option)
+      return
+    }
+
+    const code = option.code
+    const openId = option.openId
+    const url = openId ? `app-api/wxLogin/loginOpenId?openId=${openId}` : `app-api/wxLogin/login?code=${code}`
+
+    http.get(url).then(e => {
+      uni.setStorage({ key: 'openId', data: e.openId })
+      
+      if (e.code === '4001') {
+        uni.navigateTo({ url: '../login/register' })
+        return
+      }
+      if (e.code === '4002') {
+        uni.navigateTo({ url: '../login/registerSuccess' })
+        return
+      }
+      if (e.code === '4003') {
+        uni.navigateTo({
+          url: `../login/registerFail?isRegister=${e.isRegister}&bhgText=${e.bhgText}&codeId=${e.id}&openId=${e.openId}`
+        })
+        return
+      }
 
-<style>
-</style>
+      this.handleLoginSuccess(e)
+    })
+  },
+
+  methods: {
+    handleLoginSuccess(data) {
+      // 设置token
+      uni.setStorage({ key: 'token', data: data.token })
+	
+      // 获取用户信息
+	  // api/app-api/wxLogin/userInfo
+      http.get("app-api/wxLogin/userInfo").then(user => {
+        uni.setStorage({ key: 'userInfo', data: user })
+
+		let roles = data.roleCode || []
+		console.log("内容",roles)
+		if((user.rolesCodes.toString().indexOf('YCAdmin')!= -1 && user.rolesCodes.toString().indexOf('flyAdmin') != -1) ||
+			(roles.toString().indexOf('YCAdmin')!= -1 && roles.toString().indexOf('flyAdmin') != -1)){		
+			uni.navigateTo({
+				url:'/pages/login/multipleRoles'
+			})
+		}
+		
+		if ((user.rolesCodes.toString().indexOf('YCAdmin') != -1)
+		|| (roles.toString().indexOf('YCAdmin') != -1)) {
+			uni.switchTab({
+				url: '../ypczk/djfk/index/djfkIndex'
+			});
+			// djtabbar()
+		}
+		
+		if((user.rolesCodes.toString().indexOf('flyAdmin') != -1)
+		|| (roles.toString().indexOf('flyAdmin') != -1)){
+			uni.switchTab({
+				url: '../ypczk/index/leaderIndex'
+			});
+			// ystabbar()
+		}
+		else {
+			uni.navigateTo({
+				url: '../login/registerFail'
+			});
+		}
+		
+      })
+    }
+  }
+}
+</script>

+ 151 - 0
pages/index/login.vue

@@ -0,0 +1,151 @@
+<template>
+	<view class="login">
+		<view class="login-content">
+			<view class="login-title">账号登录</view>
+			<uni-forms ref="formRef" :modelValue="formData" :rules="formRules" class="login-form">
+				<view class="form-title">姓名</view>
+				<uni-forms-item name="username">
+					<uni-easyinput class="pub-input" trim="all" v-model="formData.username" placeholder="请输入姓名"></uni-easyinput>
+				</uni-forms-item>
+				<view class="form-title">密码</view>
+				<uni-forms-item name="password">
+					<uni-easyinput type="password" class="pub-input" trim="all" v-model="formData.password" placeholder="请输入密码"></uni-easyinput>
+				</uni-forms-item>
+			</uni-forms>
+			<view class="pub-button is-bg large" @click="submit">登录</view>
+		</view>	
+	</view>
+</template>
+
+<script lang="ts" setup>
+	import { ref, reactive } from 'vue'
+	import http from '@/utils/request';
+	import { encrypt, decrypt } from "@/lib/gmCrypt"
+
+	const formData = ref({
+		username: '',
+		password: '',
+	})
+	const formRef = ref()
+	const formRules = reactive({
+		username: {
+			rules: [{
+				required: true,
+				errorMessage: '账号不能为空'
+			}]
+		},
+		password: {
+			rules: [{
+				required: true,
+				errorMessage: '密码不能为空'
+			}]
+		},
+	})
+
+
+	const submit = async () => {
+		// 校验表单
+		formRef.value.validate().then(async res => {
+			// 提交请求
+			try {
+				  const transitData = {
+				      username: formData.value.username,
+				      password: encrypt(formData.value.password),
+				    }
+					// cloud/api/admin-api/system/auth/login
+				http.post("admin-api/system/auth/login",transitData).then(data=>{
+					console.log('提示:', data);
+					uni.navigateTo({
+						url: '../index/index?token=' + data.accessToken+'&isLogin=true'
+					});
+				})
+			} catch (e) {
+				console.log('表单错误信息:', e);
+			}
+		}).catch(err => {
+			console.log('表单错误信息:', err);
+		})
+	}
+</script>
+
+<style lang="scss" scoped>
+	.login {
+		height: 100vh;
+		width: 100%;
+		background-image: url("~@/static/logo_bg.png");
+		background-repeat: no-repeat;
+		background-position: center;
+		width: 100%;
+		background-size: cover;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		justify-content: center;
+		position: relative;
+
+		.login-content {
+			position: relative;
+			top: -80px;
+			background: #FFFFFF;
+			border-radius: 4rpx;
+			width: calc(100% - 128rpx);
+			height: 642rpx;
+			border-radius: 12px;
+			padding: 40rpx 32rpx 16rpx;
+			box-sizing: border-box;
+
+			.login-title {
+				text-align: center;
+				font-size: 36rpx;
+				line-height: 50rpx;
+			}
+			.login-form {
+				margin-top: 10px;
+			}
+
+			.pub-input {
+				:deep(.uni-easyinput__content) {
+					border-color: #E8E9EC !important;
+					border-radius: 4rpx;
+
+					.uni-easyinput__content-input {
+						height: 88rpx;
+						font-size: 32rpx;
+						line-height: 44rpx;
+						color: #363A44;
+
+						.uni-input-placeholder {
+							color: #B3B5B9;
+							font-size: 32rpx;
+							line-height: 44rpx;
+						}
+					}
+				}
+
+
+			}
+
+			.form-title {
+				font-size: 32rpx;
+				color: #363A44;
+				margin-bottom: 16rpx;
+				line-height: 44rpx;
+			}
+
+			.pub-button {
+				margin-top: 50rpx;
+				min-width: 120rpx;
+				height: 72rpx;
+				font-size: 32rpx;
+				line-height: 44rpx;
+				border-radius: 36rpx;
+				padding: 0 32rpx;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				color: #1E92F0;
+				border: 1px solid #1E92F0;
+			}
+		}
+	}
+</style>

+ 1 - 0
pages/ypczk/djfk/djfkTask/allTask.vue

@@ -116,6 +116,7 @@ const getZgTask=()=>{
 
 // 获取待整改任务数量
 const getZgNumber=()=>{
+	// api/app-api/rectify/getZgNumber
 	http.get("app-api/rectify/getZgNumber").then(res=>{
 		if(res==0){
 			uni.removeTabBarBadge({

+ 2 - 0
pages/ypczk/djfk/index/djfkIndex.vue

@@ -154,6 +154,7 @@ const know=()=>{
 
 // 获取整改列表
 const getZgList=()=>{
+	// api/app-api/rectify/findZgTaskList
 	http.get("app-api/rectify/findZgTaskList",{status:'0'}).then(res=>{
 		pageData.taskNum=res.total
 		pageData.taskList=res.data
@@ -168,6 +169,7 @@ const getNotice=()=>{
 		title: '',
 		mask: true
 	});
+	// api/app-api/rectify/findNoticeList
 	http.get("app-api/rectify/findNoticeList").then(res=>{
 		uni.hideLoading()
 		res.forEach(item=>{

+ 24 - 14
pages/ypczk/djfk/uploadZg/zgMeasureList.vue

@@ -12,7 +12,7 @@
 			<view class="list_item">附件</view>
 		</view>
 		<view v-if="props.zgData.rectificationUrls!=null && props.zgData.rectificationUrls!=''">
-			<uni-file-picker :modelValue="showImage(props.zgData.rectificationUrls)" readonly="false"></uni-file-picker>
+			<uni-file-picker :modelValue="showImageStr(props.zgData.rectificationUrls)" readonly="false"></uni-file-picker>
 		</view>
 		<view class="list_content">
 			<view class="list_item">整改措施</view>
@@ -34,6 +34,8 @@ import { reactive,watch } from "vue";
 import {uploadImageModelValue} from '@/pages/controls/image/OssService';
 import {onLoad,onShow,onUnload,onPullDownRefresh} from "@dcloudio/uni-app";
 import http from '@/utils/request';
+import { UrlPath } from "@/utils/commonuni"
+
 const props=defineProps({
 	zgData:Object,
 	disabled:Boolean
@@ -49,27 +51,35 @@ const selectImg=(e)=>{
 			title: '图片上传....',
 			mask: true
 		});
-		http.upload("oss/upload",{file:file.file}).then(e => {
+		http.upload("admin-api/infra/file/upload",{file:file.file}).then(e => {
 			uni.hideLoading()
-			props.zgData.measureUrls.push(e.id)
+			props.zgData.measureUrls.push(e)
 		})
 	})
 }
 
 // 删除图片,并将其从列表中删除
-const deleteImg=(e)=>{
-	let index=0
-	props.zgData.measureUrls.forEach((item,idx)=>{
-		index=e.tempFilePath.indexOf(item)
-		if(index>0){
-			// 删除列表中的元素
-			props.zgData.measureUrls.splice(idx,1)
-		}
-	})
+const deleteImg=(val)=>{
+	if (val.index != -1) {
+		props.zgData.measureUrls.splice(val.index,1)
+	}
+}
+const showImageStr = (urlStr) => {
+	const rawPrefix = UrlPath.getBaseUrl()
+	const prefix = rawPrefix.replace(/\/+$/, '');
+	console.log("内容",prefix + urlStr)
+	return prefix + urlStr
 }
 // 显示图片
-const showImage=(id)=>{
-	return uploadImageModelValue(id)
+const showImage=(urlStr)=>{
+	if (!urlStr)return
+	console.log("内容",urlStr)
+	const rawPrefix = UrlPath.getBaseUrl()
+	const prefix = rawPrefix.replace(/\/+$/, '');
+	const result = urlStr.map(url => {
+		return prefix + url;
+	});
+	return result;
 }
 
 </script>

+ 1 - 4
pages/ypczk/index/leaderIndex.vue

@@ -25,7 +25,7 @@
 		</view>
 		<!-- 列表 -->
 		<view v-if="pageData.taskList.length!=0">
-			<uni-card is-shadow="false" v-for="(item,index) in pageData.taskList" padding="0" spacing="0" class="leaderIndex_list">
+			<uni-card :isShadow="false" v-for="(item,index) in pageData.taskList" padding="0" spacing="0" class="leaderIndex_list">
 				<view @click="showDetail(item)">
 					<view class="list_title">
 						<image :src="item.taskStatusIcon" class="statusIcon"></image>
@@ -151,7 +151,6 @@ const operatorDialogClose=()=>{
 // 签收接口
 const getSignTask=()=>{
 	http.get("app-api/index/qs",signFormData).then(res=>{
-		console.log(res)
 		if(res==true){
 			uni.showToast({
 				title:'签收成功',
@@ -261,7 +260,6 @@ const getTaskData=()=>{
 	});
 	http.get("app-api/index/findList").then(res=>{
 		uni.hideLoading()
-		console.log(res)
 		pageData.taskList=res.data
 		pageData.taskList.forEach(item=>{
 			if(item.wcrq1!=null && item.wcrq2!=null){
@@ -284,7 +282,6 @@ const getTaskData=()=>{
 const getUserInfo=()=>{
 	try{
 		const value=uni.getStorageSync("userInfo")
-		console.log(value);
 		pageData.userName = value.nickname
 	}catch(e){
 		//TODO handle the exception

+ 14 - 13
pages/ypczk/zkTask/djTask.vue

@@ -138,6 +138,7 @@
 	import {
 		uploadImageModelValue
 	} from '@/pages/controls/image/OssService'
+	import { UrlPath } from "@/utils/commonuni"
 
 	const pageData = reactive({
 		// 处方编号
@@ -300,25 +301,20 @@
 				title: '图片上传....',
 				mask: true
 			});
-			http.upload("oss/upload", {
+			http.upload("admin-api/infra/file/upload", {
 				file: item.file
 			}).then(e => {
 				uni.hideLoading()
-				pageData.imageList.push(e.id)
+				pageData.imageList.push(e)
 			})
 		})
 	}
 
 	// 删除图片,并将其从列表中删除
-	const deleteImg = (e) => {
-		let index = 0
-		pageData.imageList.forEach((item, idx) => {
-			index = e.tempFilePath.indexOf(item)
-			if (index > 0) {
-				// 删除列表中的元素
-				pageData.imageList.splice(idx, 1)
-			}
-		})
+	const deleteImg=(val)=>{
+		if (val.index != -1) {
+			pageData.imageList.splice(val.index, 1);
+		}
 	}
 
 	const item = ref({})
@@ -507,8 +503,13 @@
 	}
 
 	// 显示图片
-	const showImage = (id) => {
-		return uploadImageModelValue(id)
+	const showImage = (urlStr) => {
+		const rawPrefix = UrlPath.getBaseUrl()
+		const prefix = rawPrefix.replace(/\/+$/, '');
+		const result = urlStr.map(url => {
+			return prefix + url;
+		});
+		return result;
 	}
 
 	// 获取taskId

+ 18 - 14
pages/ypczk/zkTask/djhjTask.vue

@@ -75,6 +75,7 @@ import { ref,reactive, computed } from "vue";
 import {onLoad,onShow,onUnload,onPullDownRefresh} from "@dcloudio/uni-app";
 import http from '@/utils/request';
 import {uploadImageModelValue} from '@/pages/controls/image/OssService'
+import { UrlPath } from "@/utils/commonuni"
 
 const pageData=reactive({
 	bhgNum:0,
@@ -166,24 +167,20 @@ const selectImg=(e)=>{
 			title: '图片上传....',
 			mask: true
 		});
-		http.upload("oss/upload",{file:item.file}).then(e => {
+		http.upload("admin-api/infra/file/upload",{file:item.file}).then(e => {
 			uni.hideLoading()
-			pageData.imageList.push(e.id)
+			pageData.imageList.push(e)
 		})
 	})
+	console.log("上传后",pageData.imageList)
 }
 
 // 删除图片,并将其从列表中删除
-const deleteImg=(e)=>{
-	let index=0
-	pageData.imageList.forEach((item,idx)=>{
-		index=e.tempFilePath.indexOf(item)
-		if(index>0){
-			// 删除列表中的元素
-			pageData.imageList.splice(idx,1)
-		}
-	})
-}
+const deleteImg = (val) => {
+  if (val.index != -1) {
+  	pageData.imageList.splice(val.index, 1);
+  }
+};
 
 const item = ref({})
 // 不合格
@@ -246,6 +243,8 @@ const countTotal=()=>{
 const saveHjTask=()=>{
 	if(pageData.imageList!=null && pageData.imageList!=undefined && pageData.imageList.length!=0){
 		pageData.resList.detail.imageIds=pageData.imageList.toString()
+		console.log("内容",pageData.resList.detail)
+		console.log("内容2",pageData.imageList)
 		uni.showLoading({
 			title: '提交中.......',
 			mask: true
@@ -373,8 +372,13 @@ const getHJTask=(data)=>{
 }
 
 // 显示图片
-const showImage=(id)=>{
-	return uploadImageModelValue(id)
+const showImage = (urlStr) => {
+	const rawPrefix = UrlPath.getBaseUrl()
+	const prefix = rawPrefix.replace(/\/+$/, '');
+	const result = urlStr.map(url => {
+		return prefix + url;
+	});
+	return result;
 }
 
 onShow(()=>{

+ 17 - 15
pages/ypczk/zkTask/dpTask.vue

@@ -65,7 +65,7 @@
 			<uni-card>
 				<uni-section title="图片上传" type="line">
 				</uni-section>
-				<view class="image_upload" style="border-top: 0.5px solid #ebedf0;margin-bottom: 3px;">
+				<view class="image_upload">
 					<uni-file-picker limit="4" :modelValue="showImage(pageData.imageList)" :readonly="pageData.imageStatus" @select="selectImg" @delete="deleteImg"></uni-file-picker>
 				</view>
 			</uni-card>
@@ -80,7 +80,7 @@
         <button class="button" @click="editTask()">编辑</button>
       </view>
       <!-- 任务详情-保存 -->
-      <view class="finish_button" v-if="pageData.taskStatus=='1'">
+      <view class="finish_button" style="margin-top: -4px;" v-if="pageData.taskStatus=='1'">
         <button class="button" @click="finishTask()">保存</button>
       </view>
     </view>
@@ -92,6 +92,7 @@ import {reactive,onMounted,ref,watch,defineComponent, computed} from 'vue';
 import {onLoad,onShow,onUnload,onPullDownRefresh} from "@dcloudio/uni-app";
 import http from '@/utils/request';
 import {uploadImageModelValue} from '@/pages/controls/image/OssService'
+import { UrlPath } from "@/utils/commonuni"
 
 const data = reactive({
 	reciper: ''
@@ -203,23 +204,18 @@ const selectImg=(e)=>{
 			title: '图片上传....',
 			mask: true
 		});
-		http.upload("oss/upload",{file:item.file}).then(e => {
+		http.upload("admin-api/infra/file/upload",{file:item.file}).then(e => {
 			uni.hideLoading()
-			pageData.imageList.push(e.id)
+			pageData.imageList.push(e)
 		})
 	})
 }
 
 // 删除图片,并将其从列表中删除
-const deleteImg=(e)=>{
-	let index=0
-	pageData.imageList.forEach((item,idx)=>{
-		index=e.tempFilePath.indexOf(item)
-		if(index>0){
-			// 删除列表中的元素
-			pageData.imageList.splice(idx,1)
-		}
-	})
+const deleteImg=(val)=>{
+	if (val.index != -1) {
+		pageData.imageList.splice(val.index, 1);
+	}
 }
 
 const countResultContent=()=>{
@@ -255,6 +251,7 @@ const saveTask=()=>{
 
 // 下一个
 const finishTask=()=>{
+	console.log("内容",pageData.dpList)
 	if(pageData.dpList[0].totalScore=="0"){
 		uni.showToast({
 			title: '应重不能为0',
@@ -384,8 +381,13 @@ const getDpTask=(data)=>{
 }
 
 // 显示图片
-const showImage=(id)=>{
-	return uploadImageModelValue(id)
+const showImage = (urlStr) => {
+	const rawPrefix = UrlPath.getBaseUrl()
+	const prefix = rawPrefix.replace(/\/+$/, '');
+	const result = urlStr.map(url => {
+		return prefix + url;
+	});
+	return result;
 }
 
 // 任务进度(已完成)

+ 2 - 0
pages/ypczk/zkTask/index.scss

@@ -575,6 +575,7 @@
 
 // 代配处方质控作业
 .dpTask{
+	border: 1px solid #F8F9FA;
 	background-color: #F8F9FA;
 	height: 100%;
 	.progress_card{
@@ -651,6 +652,7 @@
 		}
 	}
 	.finish_button{
+		background-color: #F8F9FA;
 		.button{
 			width: 700rpx;
 			margin-top: 10rpx;

+ 12 - 5
pages/ypczk/zkTask/zkTask.vue

@@ -66,7 +66,7 @@
 					</uni-tr>
 					<!-- 表格数据行 -->
 					<uni-tr v-for="(item, index) in pageData.dpList" :key="index">
-						<uni-td align="center">{{item.cfbh}}</uni-td>
+						<uni-td align="center">{{item.yncfbh}}</uni-td>
 						<uni-td align="center">{{item.ts}}</uni-td>
 						<uni-td align="center">{{item.wc}}</uni-td>
 						<uni-td align="center">{{item.creatorName}}</uni-td>
@@ -100,7 +100,7 @@
 					</uni-tr>
 					<!-- 表格数据行 -->
 					<uni-tr v-for="(item, index) in pageData.djList" :key="index">
-						<uni-td align="center">{{item.cfbh}}</uni-td>
+						<uni-td align="center">{{item.yncfbh}}</uni-td>
 						<uni-td align="center">{{item.ts}}</uni-td>
 						<uni-td align="center" :style="changeColor(item.bhgx,'red')">{{item.bhgx}}</uni-td>
 						<uni-td align="center" :style="changeColor(item.djCount,'blue')">{{item.djCount}}</uni-td>
@@ -148,6 +148,7 @@
 	import {onLoad,onShow,onUnload,onPullDownRefresh} from "@dcloudio/uni-app";
 	import http from '@/utils/request';
 	import {uploadImageModelValue} from '@/pages/controls/image/OssService';
+	import { UrlPath } from "@/utils/commonuni"
 
 	const pageData = reactive({
 		detailList: {},
@@ -212,7 +213,7 @@
 	// 查看更多
 	const seeMore = (type) => {
 		let jumpUrl = ''
-		console.log(JSON.stringify(pageData));
+		// console.log(JSON.stringify(pageData));
 		if (type == 'dp') {
 			// 代配跳转
 			jumpUrl = '/pages/ypczk/zkTask/zkTaskDetail/detailsList?taskInfo=' + encodeURIComponent(JSON.stringify(pageData.taskList))
@@ -293,8 +294,14 @@
 	}
 
 	// 显示图片
-	const showImage = (id) => {
-		return uploadImageModelValue(id)
+	const showImage = (urlStr) => {
+		const filesArray = urlStr.split(',');
+		const rawPrefix = UrlPath.getBaseUrl()
+		const prefix = rawPrefix.replace(/\/+$/, '');
+		const result = filesArray.map(url => {
+			return prefix + url;
+		});
+		return result;
 	}
 
 	// 判断当前用户是否为组员(组员为true)

+ 7 - 7
pages/ypczk/zkTask/zkTaskDetail/detailsList.vue

@@ -1,6 +1,6 @@
 <template>
 	<view >
-		<custom-tabs type="detailRef" :value="pageInfo.activeIndex" fixed="true" style="height: 10%" :activeTextStyle="{color:'rgba(190, 163, 117, 1)'}" :activeLineStyle="{'background-color':'rgba(190, 163, 117, 1)',height:'6rpx'}" @change="tabChange">
+		<custom-tabs type="detailRef" :value="pageInfo.activeIndex" :fixed="true" :activeTextStyle="{color:'rgba(190, 163, 117, 1)'}" :activeLineStyle="{'background-color':'rgba(190, 163, 117, 1)',height:'6rpx'}" @change="tabChange">
 			<custom-tab-pane label="任务信息" name="detailRef_1">
 				<view class="taskInfo">
 					<!-- 质控信息 -->
@@ -130,21 +130,21 @@
 		djTaskList: [],
 		// 环境质控
 		hjTaskList: [],
-		imageUrl: "",
+		imageUrl: [],
 		// 代配不合格数
 		dpbhg: "",
 		// 代煎不合格数
-		djbhg: "",
+		djbhg: 0,
 		// 环境质控不合格数
 		hjbhg: 0,
 		// 代配抽样数量
-		dpCyCount: '',
+		dpCyCount: 0,
 		// 代配完成数量
-		dpWcCount: '',
+		dpWcCount: 0,
 		// 代煎抽样数量
-		djCyCount: '',
+		djCyCount: 0,
 		// 代煎完成数量
-		djWcCount: '',
+		djWcCount: 0,
 		// 创建人
 		creatorName: '',
 		// 对话框

+ 4 - 4
pages/ypczk/zkTask/zkTaskDetail/djTaskDetail.vue

@@ -20,7 +20,7 @@
 				</uni-tr>
 				<!-- 表格数据行 -->
 				<uni-tr v-for="(item, index) in props.djTaskList" :key="index" @click="toDetail(item)">
-					<uni-td align="center">{{item.cfbh}}</uni-td>
+					<uni-td align="center">{{item.yncfbh}}</uni-td>
 					<uni-td align="center">{{item.ts}}</uni-td>
 					<uni-td align="center">{{item.jcx}}</uni-td>
 					<uni-td align="center" :style="changeColor(item.bhgx,'red')">{{item.bhgx}}</uni-td>
@@ -58,13 +58,13 @@
 		// 代煎质控详情列表
 		djTaskList: Array,
 		// 代煎不合格数
-		djbhg: String,
+		djbhg: Number,
 		// 任务状态
 		taskStatus: String,
 		// 代煎抽样数量
-		djCyCount: String,
+		djCyCount: Number,
 		// 代煎完成数量
-		djWcCount: String,
+		djWcCount: Number,
 	});
 
 	// 开始质控

+ 10 - 3
pages/ypczk/zkTask/zkTaskDetail/djhjTaskDetail.vue

@@ -60,6 +60,7 @@ import {onLoad,onShow,onUnload,onPullDownRefresh} from "@dcloudio/uni-app";
 import http from '@/utils/request';
 import dataEmpty from "@/pages/ypczk/zkTask/zkTaskDetail/noStartTaskDetail.vue";
 import {uploadImageModelValue} from '@/pages/controls/image/OssService'
+import { UrlPath } from "@/utils/commonuni"
 
 const props = defineProps({
 	// 环境质控详情列表
@@ -67,7 +68,7 @@ const props = defineProps({
 	// 图片url
 	imageUrl:Array,
 	// 环境质控不合格数
-	hjbhg:String,
+	hjbhg: Number,
 	// 创建人
 	creatorName:String,
 	// 任务状态
@@ -80,8 +81,14 @@ const startTask=()=>{
 }
 
 // 显示图片
-const showImage=(id)=>{
-	return uploadImageModelValue(id)
+const showImage=(urlStr)=>{
+	const filesArray = urlStr.split(',');
+	const rawPrefix = UrlPath.getBaseUrl()
+	const prefix = rawPrefix.replace(/\/+$/, '');
+	const result = filesArray.map(url => {
+		return prefix + url;
+	});
+	return result;
 }
 const wcnumber = () =>{
 	let wcNumber = 0;

+ 3 - 3
pages/ypczk/zkTask/zkTaskDetail/dpTaskDetail.vue

@@ -16,7 +16,7 @@
 				</uni-tr>
 				<!-- 表格数据行 -->
 				<uni-tr v-for="(item, index) in props.dpTaskList" :key="index" @click="toDetail(item)">
-					<uni-td align="center">{{item.ptwybm}}</uni-td>
+					<uni-td align="center">{{item.yncfbh}}</uni-td>
 					<uni-td align="center">{{item.ts}}</uni-td>
 					<uni-td align="center">{{item.wc}}
 						<uni-icons type="right"></uni-icons>
@@ -49,9 +49,9 @@ const props = defineProps({
 	// 任务状态
 	taskStatus:String,
 	// 代配抽样数量
-	dpCyCount:String,
+	dpCyCount: Number,
 	// 代配完成数量
-	dpWcCount:String,
+	dpWcCount: Number,
 });
 
 // 开始质控

+ 4 - 1
pages/ypczk/zkTask/zkTaskDetail/index.scss

@@ -5,6 +5,7 @@
 ::v-deep .tab .tab-cont{
 	height: 100%;
 	margin-bottom: 60px;
+	background-color: #F8F9FA;
 }
 
 ::v-deep .tab-pane{
@@ -29,7 +30,9 @@
 	align-content: flex-end;
 	justify-content: space-around;
 }
-
+::v-deep .tab-fixed{
+	background-color: #F8F9FA;
+}
 ::v-deep .tab-fixed .tab-bar{
 	position: fixed;
 }

+ 1 - 1
pages/ypczk/zkTask/zkTaskList.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="zkTaskList" ref="zktaskList">
-		<custom-tabs type="zkTaskListViewRef" :value="pageInfo.current" fixed="true" :activeTextStyle="{color:'rgba(190, 163, 117, 1)'}" :activeLineStyle="{'background-color':'rgba(190, 163, 117, 1)',height:'6rpx'}" @change="changeIndex">
+		<custom-tabs type="zkTaskListViewRef" :value="pageInfo.current" :fixed="true" :activeTextStyle="{color:'rgba(190, 163, 117, 1)'}" :activeLineStyle="{'background-color':'rgba(190, 163, 117, 1)',height:'6rpx'}" @change="changeIndex">
 			<!-- 所有 -->
 			<custom-tab-pane label="所有" name="zkTaskListViewRef_1">
 				<ZkTaskListView ref="zkTaskListViewRef_1"  style="height: 100%;"></ZkTaskListView>

BIN
static/logo_bg.png


+ 27 - 16
uni_modules/uni-file-picker/components/uni-file-picker/uni-file-picker.vue

@@ -89,24 +89,18 @@
 		},
 		emits: ['select', 'success', 'fail', 'progress', 'delete', 'update:modelValue', 'input'],
 		props: {
-			// #ifdef VUE3
 			modelValue: {
 				type: [Array, Object],
 				default () {
 					return []
 				}
 			},
-			// #endif
-
-			// #ifndef VUE3
 			value: {
 				type: [Array, Object],
 				default () {
 					return []
 				}
 			},
-			// #endif
-
 			disabled: {
 				type: Boolean,
 				default: false
@@ -191,6 +185,10 @@
 				default () {
 					return  ['album', 'camera']
 				}
+			},
+			provider: {
+				type: String,
+				default: '' // 默认上传到 unicloud 内置存储 extStorage 扩展存储
 			}
 		},
 		data() {
@@ -200,30 +198,36 @@
 			}
 		},
 		watch: {
-			// #ifndef VUE3
 			value: {
 				handler(newVal, oldVal) {
 					this.setValue(newVal, oldVal)
 				},
 				immediate: true
 			},
-			// #endif
-			// #ifdef VUE3
 			modelValue: {
 				handler(newVal, oldVal) {
 					this.setValue(newVal, oldVal)
 				},
 				immediate: true
 			},
-			// #endif
 		},
 		computed: {
 			filesList() {
-				let files = []
-				this.files.forEach(v => {
-					files.push(v)
-				})
-				return files
+			  let files = [];
+			  const fileArray = Array.isArray(this.files) ? this.files : [];
+			  fileArray.forEach(v => {
+			    if (typeof v === 'string') {
+			      const fileName = v.split('/').pop();
+			      files.push({
+			        url: v,
+			        name: fileName,
+			        status: 'failed'
+			      });
+			    } else {
+			      // console.warn('Invalid file URL:', v);
+			    }
+			  });
+			  return files;
 			},
 			showType() {
 				if (this.fileMediatype === 'image') {
@@ -331,7 +335,6 @@
 			 * 选择文件
 			 */
 			choose() {
-
 				if (this.disabled) return
 				if (this.files.length >= Number(this.limitLength) && this.showType !== 'grid' && this.returnType ===
 					'array') {
@@ -418,6 +421,13 @@
 				if (!this.autoUpload || this.noSpace) {
 					res.tempFiles = []
 				}
+				res.tempFiles.forEach((fileItem, index) => {
+					this.provider && (fileItem.provider = this.provider);
+					const fileNameSplit = fileItem.name.split('.')
+					const ext = fileNameSplit.pop()
+					const fileName = fileNameSplit.join('.').replace(/[\s\/\?<>\\:\*\|":]/g, '_')
+					fileItem.cloudPath = fileName + '_' + Date.now() + '_' + index + '.' + ext
+				})
 			},
 
 			/**
@@ -523,6 +533,7 @@
 			 */
 			delFile(index) {
 				this.$emit('delete', {
+					index,
 					tempFile: this.files[index],
 					tempFilePath: this.files[index].url
 				})

+ 3 - 2
utils/commonuni.ts

@@ -9,10 +9,11 @@ const UrlPath = {
 	// 	return "http://10.110.65.77:5005/"
 	// }
 	// getBaseUrl() {
-	// 	return "/ydzk/"
+	// 	// return "http://192.168.31.7:48080/"
+	// 	return "http://192.168.31.36:98/zyzk/api/"
 	// }
 	getBaseUrl() {
-		return "/"
+		return "/zyzk/api/"
 	}
 
 }

+ 1 - 1
utils/fetch/interceptos.js

@@ -120,4 +120,4 @@ const interceptorsErr = (err, reject) => {
 export {
 	fetch,
 	fetchfile
-}
+}