From e8b665122cf256caae4993534c696d029883f0d5 Mon Sep 17 00:00:00 2001
From: cuiqian2004 <cuiqian2004@163.com>
Date: 星期三, 05 三月 2025 10:52:03 +0800
Subject: [PATCH] showmodal cancal 改成 close

---
 pages/modal/3200.vue |  177 +++++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 106 insertions(+), 71 deletions(-)

diff --git a/pages/modal/3200.vue b/pages/modal/3200.vue
index 993dd89..eb4082f 100644
--- a/pages/modal/3200.vue
+++ b/pages/modal/3200.vue
@@ -16,7 +16,7 @@
 						:placeholder="item.placeholder"
 						:style="{'width':item.setting.prefix && item.setting.suffix?'78%':item.setting.prefix || item.setting.suffix?'87%':'96%'}"
 						:focus="focusMateria" @focus="ontap(item)" @keyup.enter="onEnterChange(item)"
-						@blur="onEnterChange(item)" />
+						@blur="onEnterChange(item)" :maxlength="-1" />
 					<text v-if="item.setting.suffix" class="uni-icon" :class="[item.setting.suffix]"
 						@click="onEnterChange(item)">&#xe568;</text>
 				</view>
@@ -50,10 +50,8 @@
 									<view v-if="item.name!='Layout'">
 										<text class="txt_title"
 											:style="{'width':item.labelWidth+'px'}">{{item.label}}锛�/text>
-										<span class="form-item-span" v-if="item.disabled">{{item.value}}</span>
 										<!-- 鏂囨湰妗�鏁板瓧妗�-->
-										<view class="dv_input"
-											v-if="(item.name=='Input' || item.name=='InputNumber') && !item.disabled">
+										<view class="dv_input" v-if="(item.name=='Input' || item.name=='InputNumber')">
 											<text v-if="item.setting.prefix" class="uni-icon"
 												:class="[item.setting.prefix]" @change="onChange(item)">&#xe568;</text>
 											<input class="uni-input" :class="item.disabled?'input-disabled':''"
@@ -61,17 +59,18 @@
 												v-model="item.value" :disabled="item.disabled"
 												:placeholder="item.placeholder"
 												:style="{'width':item.setting.prefix && item.setting.suffix?'78%':item.setting.prefix || item.setting.suffix?'87%':'96%'}"
-												:focus="focusMateria" @focus="ontap(item)" @blur="onevent(item)" />
+												:focus="focusMateria" @focus="ontap(item)" @blur="onevent(item)"
+												:maxlength="-1" />
 											<text v-if="item.setting.suffix" class="uni-icon"
 												:class="[item.setting.suffix]" @click="onChange(item)">&#xe568;</text>
 										</view>
 										<!-- 涓嬫媺妗�鍗曢� item.useDict?item.dict:item.selections-->
-										<uni-data-select id="dv_select" v-if="item.name=='Select' && !item.disabled"
+										<uni-data-select id="dv_select" v-if="item.name=='Select'"
 											:class="item.disabled?'input-disabled':''" v-model="item.value"
 											:localdata="item.dict" @change="onChange(item)" :disabled="item.disabled"
 											:clear="false"></uni-data-select>
 										<!-- 澶氳鏂囨湰 -->
-										<view class="input-wrapper" v-if="item.name=='Textarea' && !item.disabled">
+										<view class="input-wrapper" v-if="item.name=='Textarea'">
 											<textarea class="uni-input" :value="item.value"
 												:class="item.disabled?'input-disabled':''"
 												:placeholder="item.placeholder" @blur="onModelValue(item)"
@@ -80,14 +79,25 @@
 										</view>
 										<!-- 澶嶉�妗�-->
 										<checkbox-group class="check_rememberPwd" v-if="item.name=='Checkbox'"
-											:class="item.disabled?'input-disabled':''" @change="onModelValue(item)"
-											:data-ischeck="item.value" :disabled="item.disabled"
-											:style="{'margin-left':'10rpx'}">
-											<label>
-												<checkbox :value="item.value" :checked="item.value" />
-												<text>{{item.label}}</text>
+											:class="item.disabled?'input-disabled':''" :disabled="item.disabled"
+											@change="onCheckBoxValue" :data-attr="item.fieldId">
+											<label v-for="(item2) in item.selections" :key="item2.value">
+												<checkbox :value="item2.value"
+													:checked="item.value.includes(item2.value)" />
+												<text>{{item2.label}}</text>
 											</label>
 										</checkbox-group>
+
+										<!-- 鍗曢�妗�-->
+										<radio-group class="check_rememberPwd" v-if="item.name=='Radio'"
+											:class="item.disabled?'input-disabled':''" :disabled="item.disabled"
+											:style="{'margin-left':'10rpx'}" @change="onModelValue(item)"
+											:data-attr="item.fieldId">
+											<label v-for="(item2) in item.selections" :key="item2.value">
+												<radio :value="item2.value" :checked="item2.value === item.value" />
+												<text>{{item2.label}}</text>
+											</label>
+										</radio-group>
 										<!-- Switch寮�叧 -->
 										<switch v-if="item.name=='Switch'" :class="item.disabled?'input-disabled':''"
 											:disabled="item.disabled" v-model="item.value" @change="onModelValue(item)"
@@ -109,7 +119,6 @@
 											<view v-if="cols!=null">
 												<text class="txt_title"
 													:style="{'width':cols.labelWidth+'px'}">{{cols.label}}锛�/text>
-												<span class="form-item-span" v-if="cols.disabled">{{cols.value}}</span>
 												<view class="dv_input"
 													v-if="(cols.name=='Input' || cols.name=='InputNumber') && !cols.disabled">
 													<text v-if="cols.setting.prefix" class="uni-icon"
@@ -120,21 +129,19 @@
 														v-model="cols.value" :disabled="cols.disabled"
 														:placeholder="cols.placeholder"
 														:style="{'width':cols.setting.prefix && cols.setting.suffix?'78%':cols.setting.prefix || cols.setting.suffix?'87%':'96%'}"
-														:focus="focusMateria" @focus="ontap(cols)"
-														@blur="onevent(cols)" />
+														:focus="focusMateria" @focus="ontap(cols)" @blur="onevent(cols)"
+														:maxlength="-1" />
 													<text v-if="cols.setting.suffix" class="uni-icon"
 														:class="[cols.setting.suffix]"
 														@click="onChange(cols)">&#xe568;</text>
 												</view>
 												<!-- 涓嬫媺妗�鍗曢� cols.useDict?cols.dict:cols.selections-->
-												<uni-data-select id="dv_select"
-													v-if="cols.name=='Select' && !cols.disabled"
+												<uni-data-select id="dv_select" v-if="cols.name=='Select'"
 													:class="cols.disabled?'input-disabled':''" v-model="cols.value"
 													:localdata="cols.dict" @change="onChange(cols)"
 													:disabled="cols.disabled" :clear="false"></uni-data-select>
 												<!-- 澶氳鏂囨湰 -->
-												<view class="input-wrapper"
-													v-if="cols.name=='Textarea' && !cols.disabled">
+												<view class="input-wrapper" v-if="cols.name=='Textarea'">
 													<textarea class="uni-input" :value="cols.value"
 														:class="cols.disabled?'input-disabled':''"
 														:placeholder="cols.placeholder" @blur="onModelValue(cols)"
@@ -143,14 +150,24 @@
 												</view>
 												<!-- 澶嶉�妗�-->
 												<checkbox-group class="check_rememberPwd" v-if="cols.name=='Checkbox'"
-													:class="cols.disabled?'input-disabled':''" :disabled="item.disabled"
-													@change="onModelValue(cols)" :data-ischeck="cols.value"
-													:style="{'margin-left':'10rpx'}">
-													<label>
-														<checkbox :value="cols.value" :checked="cols.value" />
-														<text>{{cols.label}}</text>
+													:class="cols.disabled?'input-disabled':''" :disabled="cols.disabled"
+													@change="onCheckBoxValue" :data-attr="cols.fieldId">
+													<label v-for="(cols2) in cols.selections" :key="cols2.value">
+														<checkbox :value="cols2.value"
+															:checked="cols.value.includes(cols2.value)" />
+														<text>{{cols2.label}}</text>
 													</label>
 												</checkbox-group>
+												<!-- 鍗曢�妗�-->
+												<radio-group class="check_rememberPwd" v-if="cols.name=='Radio'"
+													:class="cols.disabled?'input-disabled':''" :disabled="cols.disabled"
+													:style="{'margin-left':'10rpx'}" @change="onModelValue(cols)">
+													<label v-for="(cols2) in cols.selections" :key="cols2.value">
+														<radio :value="cols2.value"
+															:checked="cols2.value === cols.value" />
+														<text>{{cols2.label}}</text>
+													</label>
+												</radio-group>
 												<!-- Switch寮�叧 -->
 												<switch v-if="cols.name=='Switch'"
 													:class="cols.disabled?'input-disabled':''" :disabled="item.disabled"
@@ -470,7 +487,25 @@
 							console.log(ele.useDict);
 							if (ele.useDict == true) { //鍒ゆ柇useDict鏄惁浣跨敤瀛楀吀
 								await this.DictGetInfo(ele.bind.dict, index, 'mast');
+							} else {
+								if (ele?.name === "Select") {
+									const selections = ele?.selections || []
+									//鏈夐粯璁ゅ�锛屾樉绀洪粯璁ゅ�
+									let itemName = ele.value || "";
+									if (itemName) {
+										$this.head_styledef.form
+											.model[ele.fieldId] = itemName;
+									}
+									$this.head_styledef.form.items[index].dict = selections.map((a) => {
+										return {
+											value: a.value,
+											text: a.label
+										}
+									})
+								}
+
 							}
+
 						});
 
 					}
@@ -481,7 +516,7 @@
 						title: this.translateSys("error") + "1.1",
 						content: tip,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 				}
 
@@ -512,7 +547,7 @@
 						title: this.translateSys("error") + "1.1",
 						content: tip,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 				}
 
@@ -547,7 +582,7 @@
 						title: this.translateSys("error") + "1.1",
 						content: tip,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 				}
 			},
@@ -565,9 +600,9 @@
 						var itemName = '';
 						(result.dict_item_list || []).forEach((item) => {
 							if (item.is_default == '1')
-								itemName = item.name;
+								itemName = item.name
 							list.push({
-								text: item.value,
+								text: item.value ? item.value : item.name,
 								value: item.name,
 							});
 						});
@@ -588,7 +623,7 @@
 						title: this.translateSys("error") + "3",
 						content: ex.errMsg,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 				}
 			},
@@ -619,14 +654,14 @@
 									title: this.translateSys("tip"),
 									content: tip,
 									showCancel: false,
-									confirmText: this.translateSys("cancel")
+									confirmText: this.translateSys('close')
 								});
 							} else uni.showModal({
 								title: this.translateSys("tip"),
 								content: tip + ',' + this.translateSys('tip') + ':' + result
 									.ret,
 								showCancel: false,
-								confirmText: this.translateSys("cancel")
+								confirmText: this.translateSys('close')
 							});
 							return false;
 						} else {
@@ -636,7 +671,7 @@
 								title: this.translateSys("tip"),
 								content: tip,
 								showCancel: false,
-								confirmText: this.translateSys("cancel")
+								confirmText: this.translateSys('close')
 							});
 
 							if (result.result_type == 0 && result.action) {
@@ -659,7 +694,7 @@
 										title: this.translateSys("tip"),
 										content: result.info,
 										showCancel: false,
-										confirmText: this.translateSys("cancel")
+										confirmText: this.translateSys('close')
 									});
 								}
 							}
@@ -673,7 +708,7 @@
 								"comma") +
 							tip,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 
 				}
@@ -837,7 +872,7 @@
 							title: this.translateSys("error") + "5.1",
 							content: ex.errMsg,
 							showCancel: false,
-							confirmText: this.translateSys("cancel")
+							confirmText: this.translateSys('close')
 						});
 					});
 				} catch (ex) {
@@ -846,7 +881,7 @@
 						title: this.translateSys("error") + "5.2",
 						content: tip,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 				}
 			},
@@ -902,7 +937,7 @@
 												content: tip,
 												showCancel: false,
 												confirmText: this.translateSys(
-													"cancel")
+													'close')
 											});
 										}
 									}
@@ -978,7 +1013,7 @@
 								title: this.translateSys("tip"),
 								content: this.translateSys("unrealized"),
 								showCancel: false,
-								confirmText: this.translateSys("cancel")
+								confirmText: this.translateSys('close')
 							});
 						}
 					} else if (btn.FunCode == "Delete") {
@@ -998,7 +1033,7 @@
 							title: this.translateSys("tip"),
 							content: this.translateSys("unrealized"),
 							showCancel: false,
-							confirmText: this.translateSys("cancel")
+							confirmText: this.translateSys('close')
 						});
 					}
 				} catch (ex) {
@@ -1007,7 +1042,7 @@
 						title: this.translateSys("error"),
 						content: tip,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 				}
 			},
@@ -1073,7 +1108,7 @@
 										"delete_success"),
 									showCancel: false,
 									confirmText: this.translateSys(
-										"cancel")
+										'close')
 								});
 							}).catch(ex => {
 								// console.log(ex);
@@ -1083,7 +1118,7 @@
 									content: ex.errMsg,
 									showCancel: false,
 									confirmText: this.translateSys(
-										"cancel")
+										'close')
 								});
 							});
 						} else if (res.cancel) {
@@ -1146,7 +1181,7 @@
 								title: this.translateSys("tip"),
 								content: tip,
 								showCancel: false,
-								confirmText: this.translateSys("cancel")
+								confirmText: this.translateSys('close')
 							});
 						} else uni.showModal({
 							title: this.translateSys("tip"),
@@ -1155,7 +1190,7 @@
 								result
 								.ret,
 							showCancel: false,
-							confirmText: this.translateSys("cancel")
+							confirmText: this.translateSys('close')
 						});
 						return false;
 					} else {
@@ -1167,7 +1202,7 @@
 							title: this.translateSys("tip"),
 							content: tip,
 							showCancel: false,
-							confirmText: this.translateSys("cancel")
+							confirmText: this.translateSys('close')
 						});
 
 					}
@@ -1177,7 +1212,7 @@
 						title: this.translateSys("error"),
 						content: tip,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 					this.showError(ex);
 				}
@@ -1226,7 +1261,7 @@
 										'tip_no_app_param'),
 									showCancel: false,
 									confirmText: this.translateSys(
-										"cancel")
+										'close')
 								});
 								return;
 							}
@@ -1251,7 +1286,7 @@
 								content: this.translate(
 									"function_not_exist"),
 								showCancel: false,
-								confirmText: this.translateSys("cancel")
+								confirmText: this.translateSys('close')
 							});
 						}
 
@@ -1260,7 +1295,7 @@
 							title: this.translateSys("error"),
 							content: this.translate("cannot_related_function"),
 							showCancel: false,
-							confirmText: this.translateSys("cancel")
+							confirmText: this.translateSys('close')
 						});
 
 					}
@@ -1274,7 +1309,7 @@
 						title: this.translateSys("error"),
 						content: tip,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 					return undefined
 				}
@@ -1297,7 +1332,7 @@
 						title: this.translateSys("error") + "7",
 						content: tip,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 				}
 			},
@@ -1439,7 +1474,7 @@
 										content: tip,
 										showCancel: false,
 										confirmText: this
-											.translateSys("cancel")
+											.translateSys('close')
 									});
 								} else uni.showModal({
 									title: this.translateSys(
@@ -1451,7 +1486,7 @@
 										.ret,
 									showCancel: false,
 									confirmText: this.translateSys(
-										"cancel")
+										'close')
 								});
 								return false;
 							} else {
@@ -1465,7 +1500,7 @@
 									content: tip,
 									showCancel: false,
 									confirmText: this.translateSys(
-										"cancel")
+										'close')
 								});
 
 								if (result.result_type == 0 && result
@@ -1510,7 +1545,7 @@
 											showCancel: false,
 											confirmText: this
 												.translateSys(
-													"cancel")
+													'close')
 										});
 									}
 								}
@@ -1525,7 +1560,7 @@
 								content: ex.errMsg,
 								showCancel: false,
 								confirmText: this.translateSys(
-									"cancel")
+									'close')
 							});
 						});
 					}
@@ -1540,7 +1575,7 @@
 							this.translate('reason') + this.translateSys(
 								"colon") + tip,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 
 				}
@@ -1583,7 +1618,7 @@
 									content: tip,
 									showCancel: false,
 									confirmText: this
-										.translateSys("cancel")
+										.translateSys('close')
 								});
 							} else uni.showModal({
 								title: this.translateSys(
@@ -1594,7 +1629,7 @@
 									result.ret,
 								showCancel: false,
 								confirmText: this.translateSys(
-									"cancel")
+									'close')
 							});
 							return false;
 						} else {
@@ -1608,7 +1643,7 @@
 								content: tip,
 								showCancel: false,
 								confirmText: this.translateSys(
-									"cancel")
+									'close')
 							});
 
 							if (result.result_type == 0 && result
@@ -1684,7 +1719,7 @@
 											showCancel: false,
 											confirmText: this
 												.translateSys(
-													"cancel"
+													'close'
 												)
 										});
 									}
@@ -1699,7 +1734,7 @@
 										showCancel: false,
 										confirmText: this
 											.translateSys(
-												"cancel")
+												'close')
 									});
 								}
 							}
@@ -1714,7 +1749,7 @@
 							content: ex.errMsg,
 							showCancel: false,
 							confirmText: this.translateSys(
-								"cancel")
+								'close')
 						});
 					});
 				} catch (ex) {
@@ -1727,7 +1762,7 @@
 							this.translate('reason') + this.translateSys(
 								"colon") + tip,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 
 				}
@@ -1994,7 +2029,7 @@
 		},
 	};
 </script>
-<style lang="less">
+<style lang="scss">
 	.uni-page-modal-3200 {
 		display: flex;
 		flex-direction: column;
@@ -2206,7 +2241,7 @@
 			margin-top: 25rpx;
 			padding: 20rpx;
 			line-height: 1.5;
-			background: #4D6AF4;
+			background: #27A6E1;
 			border: none;
 			color: #fff;
 			font-size: 38rpx;
@@ -2221,8 +2256,8 @@
 			padding: 20rpx;
 			line-height: 1.5;
 			background: #fff;
-			border: none;
-			color: #000;
+			// border: none;
+			 color: #000;
 			font-size: 38rpx;
 			font-weight: bold;
 			float: left;

--
Gitblit v1.9.1