From 9b8282bcf5c5fbc22858bbfa15934b7f8a0ab753 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期三, 10 七月 2024 18:24:55 +0800
Subject: [PATCH] smallwnd

---
 pages/modal/3018.vue |  184 ++++++++++++++++++++++++----------------------
 1 files changed, 96 insertions(+), 88 deletions(-)

diff --git a/pages/modal/3018.vue b/pages/modal/3018.vue
index 65a0133..f2eae75 100644
--- a/pages/modal/3018.vue
+++ b/pages/modal/3018.vue
@@ -254,7 +254,7 @@
 			</div>
 
 		</view>
-		<button type="default" @tap="cancel" class="btn_cancel">鍙栨秷</button>
+		<button type="default" @tap="cancel" class="btn_cancel">{{translateSys('cancel')}}</button>
 		<button type="default" @tap="sava" class="btn_add">{{title}}</button>
 		<!-- 鏅�寮圭獥 top bottom center left right -->
 		<view>
@@ -274,8 +274,8 @@
 						</view>
 					</view>
 					<view class="popup-footer">
-						<button type="default" @tap="popup_sava" class="btn_popup_add">纭畾</button>
-						<button type="default" @tap="popup_cancel" class="btn_popup_cancel">鍙栨秷</button>
+						<button type="default" @tap="popup_sava" class="btn_popup_add">{{translateSys('ok')}}</button>
+						<button type="default" @tap="popup_cancel" class="btn_popup_cancel">{{translateSys('cancel')}}</button>
 					</view>
 				</view>
 			</uni-popup>
@@ -306,7 +306,7 @@
 		},
 		data() {
 			return {
-				title: '鏂板',
+				title: this.translateSys('add2'),
 				param: {},
 				type: '',
 				classAttrList: [],
@@ -350,19 +350,19 @@
 			console.log(param);
 			if (!param.EditDlgMode) {
 				uni.showModal({
-					title: "鎻愮ず",
+					title: this.translateSys('tip') + "",
 					content: "璇ュ姛鑳界偣鏈厤缃紪杈戠獥鍙o紝璇烽噸鏂伴厤缃紒",
 					showCancel: false,
-					confirmText: "鍙栨秷"
+					confirmText: this.translateSys('cancel')
 				});
 				return;
 			}
 			if (!param.Edit_dlg.Name) {
 				uni.showModal({
-					title: "鎻愮ず",
+					title: this.translateSys('tip') + "",
 					content: "璇ュ姛鑳界偣鏈厤缃獥鍙f牱寮忥紝璇烽噸鏂伴厤缃紒",
 					showCancel: false,
-					confirmText: "鍙栨秷"
+					confirmText: this.translateSys('cancel')
 				});
 				return;
 			}
@@ -400,19 +400,19 @@
 						}, 500);
 					} else {
 						uni.showModal({
-							title: "閿欒1",
+							title: this.translateSys('error') + " 1",
 							content: success.err_msg,
 							showCancel: false,
-							confirmText: "鍙栨秷"
+							confirmText: this.translateSys('cancel')
 						});
 					}
 				}).catch(ex => {
 					// console.log(ex);
 					uni.showModal({
-						title: "閿欒1.1",
+						title: this.translateSys('error') + " 1.1",
 						content: ex.errMsg,
 						showCancel: false,
-						confirmText: "鍙栨秷"
+						confirmText: this.translateSys('cancel')
 					});
 				});
 
@@ -434,19 +434,19 @@
 
 					} else {
 						uni.showModal({
-							title: "閿欒1.2",
+							title: this.translateSys('error') + " 1.2",
 							content: success.err_msg,
 							showCancel: false,
-							confirmText: "鍙栨秷"
+							confirmText: this.translateSys('cancel')
 						});
 					}
 				}).catch(ex => {
 					// console.log(ex);
 					uni.showModal({
-						title: "閿欒1.3",
+						title: this.translateSys('error') + " 1.3",
 						content: ex.errMsg,
 						showCancel: false,
-						confirmText: "鍙栨秷"
+						confirmText: this.translateSys('cancel')
 					});
 				});
 			},
@@ -476,19 +476,19 @@
 							$this.viewParam();
 						} else {
 							uni.showModal({
-								title: "閿欒1.4",
+								title: this.translateSys('error') + " 1.4",
 								content: success.err_msg,
 								showCancel: false,
-								confirmText: "鍙栨秷"
+								confirmText: this.translateSys('cancel')
 							});
 						}
 					}).catch(ex => {
 						console.log(ex);
 						uni.showModal({
-							title: "閿欒1.5",
+							title: this.translateSys('error') + " 1.5",
 							content: ex.errMsg,
 							showCancel: false,
-							confirmText: "鍙栨秷"
+							confirmText: this.translateSys('cancel')
 						});
 					});
 				}
@@ -629,7 +629,7 @@
 													ca.Value = ca.dictitem[d].CN_S_NAME;
 											}
 										}
-										if(utils.classUtils.attrTypeIsDate(ca.Type)){
+										if(utils.classUtils.attrTypeIsDateTime(ca.Type)){
 											var nowDate = new Date();
 											var date = {
 												year: nowDate.getFullYear(),
@@ -725,10 +725,10 @@
 
 				} else {
 					uni.showModal({
-						title: "鎻愮ず",
+						title: this.translateSys('tip') + "",
 						content: "鏈壘鍒板彲鏄剧ず鐨勭殑灞炴�",
 						showCancel: false,
-						confirmText: "鍙栨秷"
+						confirmText: this.translateSys('cancel')
 					});
 				}
 			},
@@ -760,19 +760,19 @@
 				var button_callback = $this.$data.classAttrList[index].Attr[iindex].button_callback;
 				if (!before_click_button) {
 					uni.showModal({
-						title: "鎻愮ず",
+						title: this.translateSys('tip') + "",
 						content: "before_click_button-event_id涓虹┖锛�,
 						showCancel: false,
-						confirmText: "鍙栨秷"
+						confirmText: this.translateSys('cancel')
 					});
 					return;
 				}
 				if (!button_callback) {
 					uni.showModal({
-						title: "鎻愮ず",
+						title: this.translateSys('tip') + "",
 						content: "button_callback-event_id涓虹┖锛�,
 						showCancel: false,
-						confirmText: "鍙栨秷"
+						confirmText: this.translateSys('cancel')
 					});
 					return;
 				}
@@ -817,10 +817,10 @@
 				}
 				if (!$this.$data.popupParam) {
 					uni.showModal({
-						title: "鎻愮ず",
+						title: this.translateSys('tip') + "",
 						content: "popupParam涓虹┖锛�,
 						showCancel: false,
-						confirmText: "鍙栨秷"
+						confirmText: this.translateSys('cancel')
 					});
 					return;
 				}
@@ -1112,10 +1112,10 @@
 			classAttr_AddRef(e) {
 				console.log(e.target);
 				uni.showModal({
-					title: "鎻愮ず",
+					title: this.translateSys('tip') + "",
 					content: "姝ゅ姛鑳借繕鏈疄鐜帮紒",
 					showCancel: false,
-					confirmText: "鍙栨秷"
+					confirmText: this.translateSys('cancel')
 				});
 				// var value=this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].RelCls[e.target.value];
 				// this.$data.classAttrList[e.target.dataset['index']].Attr[e.target.dataset['iindex']].Value=value;
@@ -1212,10 +1212,10 @@
 							uni.hideLoading();
 							// uni.showToast({title:ar.DispName+'涓嶈兘涓虹┖锛�,icon:"success",duration:3000});
 							uni.showModal({
-								title: "鎻愮ず",
+								title: this.translateSys('tip') + "",
 								content: ar.DispName + '涓嶈兘涓虹┖锛�,
 								showCancel: false,
-								confirmText: "鍙栨秷"
+								confirmText: this.translateSys('cancel')
 							});
 							return;
 						}
@@ -1270,19 +1270,19 @@
 							if (action.ret == '0') {
 								if (action.ret != 0) {
 									uni.showModal({
-										title: "鎻愮ず",
+										title: this.translateSys('tip') + "",
 										content: '鎵ц鑴氭湰澶辫触锛� + action.result,
 										showCancel: false,
-										confirmText: "鍙栨秷"
+										confirmText: this.translateSys('cancel')
 									});
 									return;
 								}
 								if (action.info) {
 									uni.showModal({
-										title: "鎻愮ず",
+										title: this.translateSys('tip') + "",
 										content: '鎵ц鑴氭湰澶辫触锛� + action.info,
 										showCancel: false,
-										confirmText: "鍙栨秷"
+										confirmText: this.translateSys('cancel')
 									});
 									return;
 								}
@@ -1310,20 +1310,20 @@
 						// this.cancel();
 					} else {
 						uni.showModal({
-							title: "閿欒",
+							title: this.translateSys('error') + " ",
 							content: success.err_msg,
 							showCancel: false,
-							confirmText: "鍙栨秷"
+							confirmText: this.translateSys('cancel')
 						});
 					}
 				}).catch(ex => {
 					console.log(ex);
 					uni.hideLoading();
 					uni.showModal({
-						title: "鎻愮ず",
+						title: this.translateSys('tip') + "",
 						content: ex.errMsg,
 						showCancel: false,
-						confirmText: "鍙栨秷"
+						confirmText: this.translateSys('cancel')
 					});
 				});
 			},
@@ -1387,26 +1387,26 @@
 							var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data
 								.err_info.join('<br/>') : '';
 							if (data.ret == 801) uni.showModal({
-								title: '鎻愮ず',
+								title: this.translateSys('tip') ,
 								content: tip,
 								showCancel: false,
-								confirmText: "鍙栨秷"
+								confirmText: this.translateSys('cancel')
 							});
 							else uni.showModal({
-								title: '鎻愮ず',
+								title: this.translateSys('tip') ,
 								content: tip + ',鎻愮ず:' + data.ret,
 								showCancel: false,
-								confirmText: "鍙栨秷"
+								confirmText: this.translateSys('cancel')
 							});
 							return false
 						} else {
 							var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
 								'<br/>') : '';
 							if (tip) uni.showModal({
-								title: '鎻愮ず',
+								title: this.translateSys('tip') ,
 								content: tip,
 								showCancel: false,
-								confirmText: "鍙栨秷"
+								confirmText: this.translateSys('cancel')
 							});
 
 							if (data.action) {
@@ -1465,10 +1465,10 @@
 										}
 										if (action_type == 'open_select_userdlg') {
 											uni.showModal({
-												title: "閿欒2.2",
+												title: this.translateSys('error') + " 2.2",
 												content: "open_select_userdlg杩欎釜action_type杩樻湭澶勭悊锛�,
 												showCancel: false,
-												confirmText: "鍙栨秷"
+												confirmText: this.translateSys('cancel')
 											});
 										}
 										// else if (action_type == 'tip_dlg') {
@@ -1480,19 +1480,19 @@
 						}
 					} else {
 						uni.showModal({
-							title: "閿欒2",
+							title: this.translateSys('error') + " 2",
 							content: success.err_msg,
 							showCancel: false,
-							confirmText: "鍙栨秷"
+							confirmText: this.translateSys('cancel')
 						});
 					}
 				}).catch(ex => {
 					// console.log(ex);
 					uni.showModal({
-						title: "閿欒2.1",
+						title: this.translateSys('error') + " 2.1",
 						content: ex.errMsg,
 						showCancel: false,
-						confirmText: "鍙栨秷"
+						confirmText: this.translateSys('cancel')
 					});
 				});
 			},
@@ -1570,26 +1570,26 @@
 							var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data
 								.err_info.join('<br/>') : '';
 							if (data.ret == 801) uni.showModal({
-								title: '鎻愮ず',
+								title: this.translateSys('tip') ,
 								content: tip,
 								showCancel: false,
-								confirmText: "鍙栨秷"
+								confirmText: this.translateSys('cancel')
 							});
 							else uni.showModal({
-								title: '鎻愮ず',
+								title: this.translateSys('tip') ,
 								content: tip + ',鎻愮ず:' + data.ret,
 								showCancel: false,
-								confirmText: "鍙栨秷"
+								confirmText: this.translateSys('cancel')
 							});
 							return false
 						} else {
 							var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
 								'<br/>') : '';
 							if (tip) uni.showModal({
-								title: '鎻愮ず',
+								title: this.translateSys('tip') ,
 								content: tip,
 								showCancel: false,
-								confirmText: "鍙栨秷"
+								confirmText: this.translateSys('cancel')
 							});
 
 							var actionlist = data.action;
@@ -1684,19 +1684,19 @@
 						}
 					} else {
 						uni.showModal({
-							title: "閿欒3",
+							title: this.translateSys('error') + " 3",
 							content: success.err_msg,
 							showCancel: false,
-							confirmText: "鍙栨秷"
+							confirmText: this.translateSys('cancel')
 						});
 					}
 				}).catch(ex => {
 					// console.log(ex);
 					uni.showModal({
-						title: "閿欒3.1",
+						title: this.translateSys('error') + " 3.1",
 						content: ex.errMsg,
 						showCancel: false,
-						confirmText: "鍙栨秷"
+						confirmText: this.translateSys('cancel')
 					});
 				});
 			},
@@ -1788,26 +1788,26 @@
 							var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data
 								.err_info.join('<br/>') : '';
 							if (data.ret == 801) uni.showModal({
-								title: '鎻愮ず',
+								title: this.translateSys('tip') ,
 								content: tip,
 								showCancel: false,
-								confirmText: "鍙栨秷"
+								confirmText: this.translateSys('cancel')
 							});
 							else uni.showModal({
-								title: '鎻愮ず',
+								title: this.translateSys('tip') ,
 								content: tip + ',鎻愮ず:' + data.ret,
 								showCancel: false,
-								confirmText: "鍙栨秷"
+								confirmText: this.translateSys('cancel')
 							});
 							return false
 						} else {
 							var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
 								'<br/>') : '';
 							if (tip) uni.showModal({
-								title: '鎻愮ず',
+								title: this.translateSys('tip') ,
 								content: tip,
 								showCancel: false,
-								confirmText: "鍙栨秷"
+								confirmText: this.translateSys('cancel')
 							});
 
 							var result = data.result;
@@ -1833,19 +1833,19 @@
 						}
 					} else {
 						uni.showModal({
-							title: "閿欒4",
+							title: this.translateSys('error') + " 4",
 							content: success.err_msg,
 							showCancel: false,
-							confirmText: "鍙栨秷"
+							confirmText: this.translateSys('cancel')
 						});
 					}
 				}).catch(ex => {
 					// console.log(ex);
 					uni.showModal({
-						title: "閿欒4.1",
+						title: this.translateSys('error') + " 4.1",
 						content: ex.errMsg,
 						showCancel: false,
-						confirmText: "鍙栨秷"
+						confirmText: this.translateSys('cancel')
 					});
 				});
 			},
@@ -1939,26 +1939,26 @@
 							var tip = data.err_info ? typeof data.err_info == 'string' ? data.err_info : data
 								.err_info.join('<br/>') : '';
 							if (data.ret == 801) uni.showModal({
-								title: '鎻愮ず',
+								title: this.translateSys('tip') ,
 								content: tip,
 								showCancel: false,
-								confirmText: "鍙栨秷"
+								confirmText: this.translateSys('cancel')
 							});
 							else uni.showModal({
-								title: '鎻愮ず',
+								title: this.translateSys('tip') ,
 								content: tip + ',鎻愮ず:' + data.ret,
 								showCancel: false,
-								confirmText: "鍙栨秷"
+								confirmText: this.translateSys('cancel')
 							});
 							return false
 						} else {
 							var tip = data.info ? typeof data.info == 'string' ? data.info : data.info.join(
 								'<br/>') : '';
 							if (tip) uni.showModal({
-								title: '鎻愮ず',
+								title: this.translateSys('tip') ,
 								content: tip,
 								showCancel: false,
-								confirmText: "鍙栨秷"
+								confirmText: this.translateSys('cancel')
 							});
 
 							if (data != "") {
@@ -1973,7 +1973,7 @@
 										if (action.action_type == 'open_panel') {
 											var d = dialog({
 												title: '<i class="ace-icon fa fa-info-circle"></i> ' +
-													'鎻愮ず',
+													this.translateSys('tip') ,
 												content: action.action_type + '姝ction灏氭湭澶勭悊锛�
 											});
 											d.show();
@@ -2017,7 +2017,7 @@
 										} else if (action.action_type == 'open_data_query_dlg') {
 											var d = dialog({
 												title: '<i class="ace-icon fa fa-info-circle"></i> ' +
-													'鎻愮ず',
+													this.translateSys('tip') ,
 												content: action.action_type + '姝ction灏氭湭澶勭悊锛�
 											});
 											d.show();
@@ -2099,7 +2099,7 @@
 										} else {
 											var d = dialog({
 												title: '<i class="ace-icon fa fa-info-circle"></i> ' +
-													'鎻愮ず',
+													this.translateSys('tip') ,
 												content: action.action_type + '姝ction灏氭湭澶勭悊锛�
 											});
 											d.show();
@@ -2108,28 +2108,28 @@
 								}
 							} else {
 								uni.showModal({
-									title: "鎻愮ず5.2",
+									title: this.translateSys('tip') + "5.2",
 									content: '璋冪敤 before_click_button 鑴氭湰杩斿洖绌猴紝event_id' + eventid,
 									showCancel: false,
-									confirmText: "鍙栨秷"
+									confirmText: this.translateSys('cancel')
 								});
 							}
 						}
 					} else {
 						uni.showModal({
-							title: "閿欒5",
+							title: this.translateSys('error') + " 5",
 							content: success.err_msg,
 							showCancel: false,
-							confirmText: "鍙栨秷"
+							confirmText: this.translateSys('cancel')
 						});
 					}
 				}).catch(ex => {
 					// console.log(ex);
 					uni.showModal({
-						title: "鎻愮ず5.1",
+						title: this.translateSys('tip') + "5.1",
 						content: ex.errMsg,
 						showCancel: false,
-						confirmText: "鍙栨秷"
+						confirmText: this.translateSys('cancel')
 					});
 				});
 			},
@@ -2154,6 +2154,14 @@
 						value: attr.Value ? attr.Value : ''
 					};
 			},
+			translate(t) {
+				if (typeof this.$t == "function") return this.$t(`page.${t}`)
+				else return t;
+			},
+			translateSys(t) {
+				if (typeof this.$t == "function") return this.$t(`sys.${t}`)
+				else return t;
+			},
 		}
 	}
 </script>

--
Gitblit v1.9.1