liujt 1 день назад
Родитель
Сommit
032faf2fff

+ 17 - 13
App.vue

@@ -127,18 +127,22 @@
 								})
 
 								// 确保任务完成时隐藏loading
-								downloadTask.onStop(() => {
-									if (loadingVisible) {
-										uni.hideLoading();
-										loadingVisible = false;
-									}
-								})
-								downloadTask.onError(() => {
-									if (loadingVisible) {
-										uni.hideLoading();
-										loadingVisible = false;
-									}
-								})
+								if (downloadTask && typeof downloadTask.onStop === 'function') {
+									downloadTask.onStop(() => {
+										if (loadingVisible) {
+											uni.hideLoading();
+											loadingVisible = false;
+										}
+									})
+								}
+								if (downloadTask && typeof downloadTask.onError === 'function') {
+									downloadTask.onError(() => {
+										if (loadingVisible) {
+											uni.hideLoading();
+											loadingVisible = false;
+										}
+									})
+								}
 							}
 						}
 					});
@@ -498,4 +502,4 @@
 	.icon-a-baoyangrunhua:before {
 		content: '\e67d';
 	}
-</style>
+</style>

+ 20 - 11
hybrid/html/a.html

@@ -4,6 +4,17 @@
 		<meta charset="UTF-8">
 		<meta name="viewport"
 			content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
+		<script>
+			if (!String.prototype.replaceAll) {
+				String.prototype.replaceAll = function(search, replacement) {
+					var target = String(this)
+					if (search instanceof RegExp) {
+						return target.replace(search, replacement)
+					}
+					return target.split(search).join(replacement)
+				}
+			}
+		</script>
 		<link rel="stylesheet" href="./resource/vantIndex.css" />
 		<link rel="stylesheet" href="./vue-form-making/index.css">
 	</head>
@@ -1171,10 +1182,10 @@
 							}).then(res => {
 								console.log('model~~~', res.data.data)
 								const info = res.data.data
-								this.form.FQLC = info?.id || '';
-								this.form.FQLCName = info?.name || '';
-								this.form.key = info?.key;
-								this.form.LCFL = info?.category || '';
+								this.form.FQLC = info && info.id ? info.id : '';
+								this.form.FQLCName = info && info.name ? info.name : '';
+								this.form.key = info ? info.key : '';
+								this.form.LCFL = info && info.category ? info.category : '';
 
 								axios({
 									method: 'get',
@@ -1867,15 +1878,13 @@
 							method: 'post',
 							url: API,
 							headers: this.headers,
-							data: {
-								...this.form,
-								variables: {
-									...this.form.valueJson,
+							data: Object.assign({}, this.form, {
+								variables: Object.assign({}, this.form.valueJson, {
 									businessCode: this.form.code,
 									businessName: this.form.name,
 									businessType: dictName
-								}
-							}
+								})
+							})
 						}).then((res) => {
 							this.loading = false;
 							if (res.data.code != '-1') {
@@ -1913,4 +1922,4 @@
 			}).use(vant).use(FormMakingV3).mount('#app')
 		</script>
 	</body>
-</html>
+</html>

+ 12 - 1
hybrid/html/c.html

@@ -4,6 +4,17 @@
 		<meta charset="UTF-8">
 		<meta name="viewport"
 			content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no" />
+		<script>
+			if (!String.prototype.replaceAll) {
+				String.prototype.replaceAll = function(search, replacement) {
+					var target = String(this)
+					if (search instanceof RegExp) {
+						return target.replace(search, replacement)
+					}
+					return target.split(search).join(replacement)
+				}
+			}
+		</script>
 		<link rel="stylesheet" href="./resource/vantIndex.css" />
 		<link rel="stylesheet" href="./vue-form-making/index.css">
 	</head>
@@ -549,4 +560,4 @@
 			}).use(vant).use(FormMakingV3).mount('#app')
 		</script>
 	</body>
-</html>
+</html>

+ 2 - 1
pages/home/wt/components/formParser/routerView.vue

@@ -137,8 +137,9 @@
 			}
 			console.log(params)
 			setTimeout(() => {
+				const cacheBust = Date.now()
 				this.webViewUrl =
-					`/hybrid/html/${html}?params=${JSON.stringify(params)}&headers=${JSON.stringify(headers)}`
+					`/hybrid/html/${html}?_ts=${cacheBust}&params=${JSON.stringify(params)}&headers=${JSON.stringify(headers)}`
 				this.isShow = true
 			})
 		},

+ 18 - 8
pages/internalManagement/apply/index.vue

@@ -6,8 +6,8 @@
 			<u-search placeholder="搜索模板名称" shape="square" v-model="keyword"></u-search>
 		</div> -->
 		<view class="list-container">
-			<u-list v-show='value1==0'>
-				<u-list-item v-for="(item, index) in baseList" :key="index">
+			<u-list v-if='value1==0 && baseReady'>
+				<u-list-item v-for="(item, index) in baseList" :key="getBaseListKey(item, index)">
 					<view class="kd-card">
 						<view class="card-title">
 							<text>{{ Object.values(item)[0] }}</text>
@@ -15,9 +15,9 @@
 						<view>
 
 							<u-grid :border="true">
-								<u-grid-item v-if='listItem.dictType== Object.keys(item)[0]' class='grid-item'
+								<u-grid-item class='grid-item'
 									:customStyle="{width:33+'%',height:220+'rpx'}"
-									v-for="(listItem,listIndex) in defaultList" :key="listIndex"
+									v-for="listItem in getFormsByType(Object.keys(item)[0])" :key="listItem.id || listItem.code || listItem.name"
 									@click="handleDetail(listItem,'add')">
 									<zui-svg-icon style="position: relative;bottom: -14px" :icon="listItem.icon"
 										width="3rem" />
@@ -32,7 +32,7 @@
 				<view v-show="list.length === 0" class="no_data">
 					<u-empty mode="data" textSize="30"></u-empty>
 				</view>
-				<u-list-item v-for="(item, index) in list" :key="index">
+				<u-list-item v-for="(item, index) in list" :key="item.id || item.processInstanceId || index">
 					<view class="kd-card-1">
 						<view class="card-title-1">
 							<text>{{ item.processInstance.name }}</text>
@@ -59,7 +59,7 @@
 					<u-empty mode="data" textSize="30"></u-empty>
 				</view>
 				<!-- @click.native="handleDetailView(item)" -->
-				<u-list-item v-for="(item, index) in doneList" :key="index" >
+				<u-list-item v-for="(item, index) in doneList" :key="item.id || item.processInstanceId || index" >
 					<view class="kd-card-2">
 						<view class="card-title-1">
 							<text>{{ item.name }}</text>
@@ -94,7 +94,7 @@
 					<u-empty mode="data" textSize="30"></u-empty>
 				</view>
 				<!-- @click.native="handleDetailView(item)" -->
-				<u-list-item v-for="(item, index) in copyList" :key="index" >
+				<u-list-item v-for="(item, index) in copyList" :key="item.id || item.processInstanceId || index" >
 					<view class="kd-card-2">
 						<view class="card-title-1">
 							<text><text v-if="item.isRead == 0" class="dot"></text> {{ item.name }}</text>
@@ -190,6 +190,7 @@
 					}
 				],
 				keyword: '',
+				baseReady: false,
 				baseList: [],
 				defaultList: [],
 				list: [],
@@ -223,6 +224,13 @@
 			this.getCopyList()
 		},
 		methods: {
+			getBaseListKey(item, index) {
+				const key = Object.keys(item || {})[0]
+				return key || index
+			},
+			getFormsByType(dictType) {
+				return (this.defaultList || []).filter(item => item.dictType === dictType)
+			},
 			scrolltolower() {
 				if (isEnd) return
 				page++
@@ -239,9 +247,11 @@
 				this.getCopyList()
 			},
 			async getBaseList() {
+				this.baseReady = false
 				this.defaultList = await getBpmCustomFormList({status: 1})
 				console.log(this.defaultList,'this.defaultList')
 				this.baseList = await getByCode('collaborative_type')
+				this.baseReady = true
 			},
 			handleDetail(item, type, isEdit = true) {
 				//'pages/home' + this.listData.miniHandleRouter
@@ -648,4 +658,4 @@
 			}
 		}
 	}
-</style>
+</style>

+ 9 - 5
pages/login/login.vue

@@ -300,10 +300,14 @@
 				})
 
 				// 确保任务完成时隐藏loading
-				downloadTask.onStop(() => this.hideLoadingIfNeeded(loadingVisible))
-				downloadTask.onError(() => {
-					this.hideLoadingIfNeeded(loadingVisible)
-				})
+				if (downloadTask && typeof downloadTask.onStop === 'function') {
+					downloadTask.onStop(() => this.hideLoadingIfNeeded(loadingVisible))
+				}
+				if (downloadTask && typeof downloadTask.onError === 'function') {
+					downloadTask.onError(() => {
+						this.hideLoadingIfNeeded(loadingVisible)
+					})
+				}
 			},
 
 			// 隐藏loading(封装方法)
@@ -453,4 +457,4 @@
 		text-align: center;
 		width: 100%;
 	}
-</style>
+</style>

+ 17 - 13
pages/systemSettings/index.vue

@@ -288,18 +288,22 @@
 									})
 
 									// 确保任务完成时隐藏loading
-									downloadTask.onStop(() => {
-										if (loadingVisible) {
-											uni.hideLoading();
-											loadingVisible = false;
-										}
-									})
-									downloadTask.onError(() => {
-										if (loadingVisible) {
-											uni.hideLoading();
-											loadingVisible = false;
-										}
-									})
+									if (downloadTask && typeof downloadTask.onStop === 'function') {
+										downloadTask.onStop(() => {
+											if (loadingVisible) {
+												uni.hideLoading();
+												loadingVisible = false;
+											}
+										})
+									}
+									if (downloadTask && typeof downloadTask.onError === 'function') {
+										downloadTask.onError(() => {
+											if (loadingVisible) {
+												uni.hideLoading();
+												loadingVisible = false;
+											}
+										})
+									}
 								}
 							}
 						});
@@ -355,4 +359,4 @@
 		text-align: center;
 		padding: 20rpx 0;
 	}
-</style>
+</style>