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/5601.vue |  821 ++++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 595 insertions(+), 226 deletions(-)

diff --git a/pages/modal/5601.vue b/pages/modal/5601.vue
index d019952..a09008a 100644
--- a/pages/modal/5601.vue
+++ b/pages/modal/5601.vue
@@ -7,8 +7,9 @@
 				<uni-forms-item v-if="item.name != 'Layout'" :label="item.label ?item.label +'锛�:'' "
 					:label-width="item.labelWidth+'px'">
 					<uni-data-picker v-if="item.name=='Select'" :class="item.disabled?'input-disabled':''"
-						v-model="item.value" :localdata="item.dict" @change="onEnterChange(item)"
-						:readonly="item.disabled" :clear-icon="false" :popup-title="item.label"></uni-data-picker>
+						v-model="item.value" :localdata="item.useDict ? item.dict : item.selections"
+						@change="onEnterChange(item)" :readonly="item.disabled" :clear-icon="false"
+						:popup-title="item.label"></uni-data-picker>
 					<view class="input-wrapper" v-if="item.name=='Input' || item.name=='InputNumber'">
 						<text v-if="item.setting.prefix" class="uni-icon" :class="[item.setting.prefix]"
 							@click="classAttr_extButton(item)">&#xe568;</text>
@@ -48,10 +49,12 @@
 					<uni-col
 						:span=" item.setting.spanList && item.setting.spanList[key]? item.setting.spanList[key] : 24 / item.setting.col"
 						v-for="(col,key) in item.setting.colList">
-						<uni-forms-item :label="col.label ? col.label +'锛�:''" :label-width="col.labelWidth+'px'">
+						<uni-forms-item v-if="col!=null" :label="col.label ? col.label +'锛�:''"
+							:label-width="col.labelWidth+'px'">
 							<uni-data-picker v-if="col.name=='Select'" :class="col.disabled?'input-disabled':''"
-								v-model="col.value" :localdata="col.dict" @change="onEnterChange(col)"
-								:readonly="col.disabled" :clear-icon="false" :popup-title="col.label"></uni-data-picker>
+								v-model="col.value" :localdata="col.useDict ? col.dict : col.selections"
+								@change="onEnterChange(col)" :readonly="col.disabled" :clear-icon="false"
+								:popup-title="col.label"></uni-data-picker>
 							<view class="input-wrapper" v-if="col.name=='Input' || col.name=='InputNumber'">
 								<text v-if="col.setting.prefix" class="uni-icon" :class="[col.setting.prefix]"
 									@click="classAttr_extButton(col)">&#xe568;</text>
@@ -144,25 +147,44 @@
 												</uni-row>
 											</div>
 										</div>
-										<div class="dv-panel-button">
+										<div class="dv-panel-button"
+											v-if="pageData.Select_Button==true || pageData.Row_Button.length > 0">
 
 											<checkbox v-if="pageData.Select_Button==true" :model="ii"
 												:checked="style.SelBut_Checked" />
 											<!-- <text></text> -->
-
 											<!-- <button type="primary" @click="savaItem(ii)" v-if="param.Sub_Page[0].OK_Button==true">淇濆瓨</Button> -->
-											<button type="warn" @tap="delItem(pageData,ii)"
-												v-if="pageData.Del_Button==true">{{translateSys('delete')}}</button>
+											<button size="mini" v-for="(btn,btnIndex) in pageData.Row_Button"
+												:key="btnIndex" type="default"
+												:class="btn.FunCode == 'Delete' ? 'btn-warn' : 'btn-primary'"
+												@click="onRowBtnClick(btn, pageData,ii)">
+												<Icon v-if="btn.Style == 'img' || btn.Style == 'img_text'"
+													class="Img" />
+												{{(btn.Style == 'text'|| btn.Style == 'img_text') ? btn.ShowName :""}}
+											</button>
 										</div>
 									</div>
 								</checkbox-group>
 							</view>
-							<view class="view-bottom" v-if="pageData.OK_Button==true">
-								<button type="default" @tap="cancel"
-									class="btn_cancel">{{translateSys('cancel')}}</button>
-								<button type="primary" @tap="ok(pageData)" class="btn_add"
-									:class="pageData.okLoading?'btn_disabled':''"
-									:disabled="pageData.okLoading? true:false">{{translateSys('ok')}}</button>
+							<view class="view-bottom" v-if="pageData.Button.length >0 ">
+								<button v-for="(btn,btnIndex) in pageData.Button" :key="btnIndex" type="default"
+									:class="{'btn-disabled':(btn.FunCode != 'Cancel' && pageData.okLoading),
+										'btn-primary':(btn.FunCode != 'Cancel'),
+										'btn-cancel':(btn.FunCode == 'Cancel'),
+										'btn-one':pageData.Button.length == 1,
+										'btn-left':(btnIndex < pageData.Button.length - 1),
+										'btn-right': btnIndex > 0 && btnIndex == pageData.Button.length - 1 ,
+										'width-50':(pageData.Button.length == 2),'width-32':(pageData.Button.length == 3),'width-30':(pageData.DropDownButton.length> 0)}"
+									:disabled="(btn.FunCode != 'Cancel' && pageData.okLoading)? true:false"
+									@click="onBtnClick(btn, pageData)">
+									<Icon v-if="btn.Style == 'img' || btn.Style == 'img_text'" class="Img" />
+									{{(btn.Style == 'text'|| btn.Style == 'img_text') ? btn.ShowName :""}}
+								</button>
+								<view class="btn-right" v-if="pageData.DropDownButton.length >0 ">
+									<a @click="clickDropdownBtns(pageData)">
+										<Icon class="mobox-normal-more" />
+									</a>
+								</view>
 							</view>
 						</view>
 					</swiper-item>
@@ -183,8 +205,9 @@
 			<uni-popup class="view-popup" ref="popup" background-color="#fff" @change="popupChange">
 				<view class="popup-header">{{check_list.title}}</view>
 				<view class="popup-content" :class="{ 'popup-height': popupType === 'left' || popupType === 'right' }"
-					:style="{'width':check_list.width?check_list.width+'px':'200px','height':check_list.height?check_list.height+'px':'88%'}">
-					<view class="popup-cont" :style="{'height':check_list.height?check_list.height-45+'px':'415px'}">
+					:style="{'width':check_list.width?check_list.width+'px':'375rpx','height':check_list.height?check_list.height+'px':popupType =='center'?'60vh':'88vh'}">
+					<view class="popup-cont"
+						:style="{'height':check_list.height?check_list.height-45+'px':popupType =='center'?'50vh':'80vh'}">
 						<view class="view_popup_CheckList" v-for="(item,index) in check_list.items">
 							<checkbox-group class="check_list" @change="checkChange" :data-ischeck="item.check"
 								:data-index="index" :style="{'margin-left': '10rpx'}">
@@ -236,11 +259,7 @@
 				pageDetail: [], //{StyleDef{}:,DefList:[],ExtData:{}}
 				// 鍒嗘鍣ㄦ暟鎹� 				current: 0,
-				Before_OK_Event: {},
 				After_OK_Event: {},
-				Before_Del_Event: {},
-				After_Del_Event: {},
-
 				active_id: '',
 				selectAttrObj: {},
 
@@ -261,14 +280,11 @@
 			},
 		},
 		onLoad(options) {
-			console.log(options.titlename, options);
 			uni.setNavigationBarTitle({
 				title: options.titlename
 			}); //璁剧疆椤堕儴鏍囬 
 			this.title = options.titlename;
 			this.param = JSON.parse(options.param);
-
-
 			//鑾峰彇涓绘暟鎹被ID
 			this.ClsID = this.param.master_cls?.id;
 			if (this.ClsID) {
@@ -278,7 +294,7 @@
 					title: this.translateSys("error"),
 					content: this.translate("tip_no_master_class"),
 					showCancel: false,
-					confirmText: this.translateSys("cancel")
+					confirmText: this.translateSys('close')
 				});
 			}
 		},
@@ -308,7 +324,6 @@
 				});
 			},
 			async loadData(paramValue) {
-
 				//鑾峰彇鏁版嵁绫荤殑鑷畾涔夎〃鍗曞弬鏁� 				await this.Head_UIStyleGetInfo(this.ClsID, this.param.Input_UI_Style.ID);
 				//浼犲叆鍙傛暟鍊�@@ -351,6 +366,33 @@
 						this.ClsID,
 						page.UI_Style.ID
 					);
+					const buttons = this.pageButtonList(page)
+					page.Button = buttons
+					page.DropDownButton = []
+					if (buttons.length > 3) {
+						let cancelBtn = undefined
+						const btns = []
+						buttons.forEach((btn) => {
+							if (btn.FunCode == "Cancel") {
+								cancelBtn = btn
+							} else {
+								btns.push(btn)
+							}
+						})
+						if (cancelBtn) {
+							if (btns.length > 2) {
+								page.DropDownButton = btns.splice(2)
+								page.Button = btns
+							}
+							page.Button.push(cancelBtn)
+						} else {
+							if (btns.length > 3) {
+								page.DropDownButton = btns.splice(3)
+								page.Button = btns
+							}
+						}
+					}
+					page.Row_Button = this.rowButtonList(page)
 				}
 
 				this.setData({
@@ -365,6 +407,92 @@
 					current: index
 				})
 			},
+			pageButtonList(page) {
+				if (this.param?.ver == "2.0") {
+					return page?.Button || []
+
+				} else {
+					if (page?.OK_Button) {
+						let evt = {};
+						if (page.Before_ok?.ID) {
+							evt = {
+								ID: page.Before_ok?.ID,
+								Name: page.Before_ok?.Name
+							};
+						} else if (page.After_ok?.ID) {
+							evt = {
+								ID: page.After_ok?.ID,
+								Name: page.After_ok?.Name
+							};
+						}
+						let btnCancel = {
+							Cls_Name: this.param?.master_cls?.name || "",
+							Cls_ID: this.param?.master_cls?.id || "",
+							FunCode: "Cancel",
+							ShowName: this.$t("sys.cancel"),
+							Style: "text",
+							Prompt: false,
+						};
+						if (evt.ID) {
+							let btn = {
+								Cls_Name: this.param?.master_cls?.name || "",
+								Cls_ID: this.param?.master_cls?.id || "",
+								FunCode: "TriggerEvent",
+								ShowName: this.$t("sys.ok"),
+								Style: "text",
+								Prompt: false,
+								NotTriggerSYSEvent: false,
+								DataStateVerify: false,
+								AttrVerify: false,
+								Event: evt,
+							};
+							if (page.After_ok?.ID) {
+								btn.After_Event = page.After_ok;
+							}
+							return [btn, btnCancel];
+						} else return [btnCancel];
+					} else {
+						return [];
+					}
+				}
+			},
+			rowButtonList(page) {
+				if (this.param?.ver == "2.0") {
+					return page?.Row_Button || [];
+				} else {
+					if (page?.Del_Button) {
+						let evt = {};
+						if (page.Before_Delete?.ID) {
+							evt = {
+								ID: page.Before_Delete?.ID,
+								Name: page.Before_Delete?.Name,
+							};
+						} else if (page.After_Delete?.ID) {
+							evt = {
+								ID: page.After_Delete?.ID,
+								Name: page.After_Delete?.Name
+							};
+						}
+
+						if (evt.ID) {
+							return [{
+								Cls_Name: this.param?.master_cls?.name || "",
+								Cls_ID: this.param?.master_cls?.id || "",
+								FunCode: "Delete",
+								ShowName: this.$t("sys.delete"),
+								Style: "text",
+								Prompt: false,
+								NotTriggerSYSEvent: false,
+								DataStateVerify: false,
+								AttrVerify: false,
+								AfterProcess_Event: evt,
+							}];
+						}
+					}
+					return [];
+				}
+			},
+
 			checkboxChange(e) {
 
 				var items = this.pageDetail[this.current]?.DefList || []
@@ -414,7 +542,8 @@
 											styledefHead.form
 												.model[ele.fieldId] = itemName;
 										}
-										ele.dict = selections.map((a) => {
+
+										ele.selections = selections.map((a) => {
 											return {
 												value: a.value,
 												text: a.label
@@ -451,7 +580,7 @@
 												styledefHead.form
 													.model[col.fieldId] = itemName;
 											}
-											col.dict = selections.map((a) => {
+											col.selections = selections.map((a) => {
 												return {
 													value: a.value,
 													text: a.label
@@ -477,13 +606,15 @@
 					this.setData({
 						head_styledef: styledefHead
 					})
+					console.log("Head_UIStyleGetInfo", this.head_styledef)
+
 				} catch (ex) {
 					// console.log(ex);
 					uni.showModal({
 						title: this.translateSys("error") + "1",
 						content: ex.errMsg,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 					return {}
 				}
@@ -520,7 +651,12 @@
 									await this.DictGetInfo(ele.bind.dict,
 										detailstyledef.form
 										.model, ele);
+								} else {
+									if (ele?.name === "Select") {
+										ele.selections = []
+									}
 								}
+
 							} else {
 								for (let j in ele.setting.colList) {
 									const col = ele.setting.colList[j]
@@ -529,6 +665,10 @@
 											.bind.dict,
 											detailstyledef.form
 											.model, col);
+									} else {
+										if (col?.name === "Select") {
+											col.selections = []
+										}
 									}
 								}
 							}
@@ -543,7 +683,7 @@
 						title: this.translateSys("error") + "2",
 						content: ex.errMsg,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 					return {}
 				}
@@ -582,7 +722,7 @@
 						title: this.translateSys("error") + "3",
 						content: ex.errMsg,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 				}
 
@@ -609,7 +749,7 @@
 							.onSuffixClickEvent; //鍚庡浘鏍囩偣鍑诲洖璋� 						var isflag = false;
 
-						if (onChangeEvent.id) { //鍐呭鍙樺寲鍚庝簨浠�+						if (onChangeEvent?.id) { //鍐呭鍙樺寲鍚庝簨浠� 							$this.onChange(onChangeEvent);
 						}
 						if (item.value) { //绗竴涓緭鍏ユ涓嶄负绌�@@ -692,7 +832,7 @@
 					this.head_styledef.form.model[attr] = item.value;
 					var onChangeEvent = item.bind.onChangeEvent; //鍐呭鍙樺寲鍚庝簨浠� 
-					if (onChangeEvent.id) { //鍐呭鍙樺寲鍚庝簨浠�+					if (onChangeEvent?.id) { //鍐呭鍙樺寲鍚庝簨浠� 						this.onChange(onChangeEvent);
 					}
 
@@ -708,7 +848,7 @@
 						let attr = col.fieldId;
 						this.head_styledef.form.model[attr] = col.value;
 						var onChangeEvent = col.bind.onChangeEvent; //鍐呭鍙樺寲鍚庝簨浠�-						if (onChangeEvent.id) { //鍐呭鍙樺寲鍚庝簨浠�+						if (onChangeEvent?.id) { //鍐呭鍙樺寲鍚庝簨浠� 							this.onChange(onChangeEvent);
 						}
 						return
@@ -719,7 +859,7 @@
 						let attr = item.fieldId;
 						this.head_styledef.form.model[attr] = item.value;
 						var onChangeEvent = item.bind.onChangeEvent; //鍐呭鍙樺寲鍚庝簨浠�-						if (onChangeEvent.id) { //鍐呭鍙樺寲鍚庝簨浠�+						if (onChangeEvent?.id) { //鍐呭鍙樺寲鍚庝簨浠� 							this.onChange(onChangeEvent);
 						}
 					}
@@ -736,7 +876,7 @@
 						let attr = col.fieldId;
 						this.head_styledef.form.model[attr] = col.value;
 						var onChangeEvent = col.bind.onChangeEvent; //鍐呭鍙樺寲鍚庝簨浠�-						if (onChangeEvent.id) { //鍐呭鍙樺寲鍚庝簨浠�+						if (onChangeEvent?.id) { //鍐呭鍙樺寲鍚庝簨浠� 							this.onChange(onChangeEvent);
 						}
 						return
@@ -747,7 +887,7 @@
 						let attr = item.fieldId;
 						this.head_styledef.form.model[attr] = item.value;
 						var onChangeEvent = item.bind.onChangeEvent; //鍐呭鍙樺寲鍚庝簨浠�-						if (onChangeEvent.id) { //鍐呭鍙樺寲鍚庝簨浠�+						if (onChangeEvent?.id) { //鍐呭鍙樺寲鍚庝簨浠� 							this.onChange(onChangeEvent);
 						}
 					}
@@ -764,7 +904,7 @@
 						title: this.translateSys("tip"),
 						content: this.translate('icon_click_callback_empty'),
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 					return;
 				}
@@ -773,7 +913,7 @@
 						title: this.translateSys("tip"),
 						content: this.translate('icon_click_event_empty'),
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 					return;
 				}
@@ -781,12 +921,13 @@
 				// open 鏂规硶浼犲叆鍙傛暟 绛夊悓鍦�uni-popup 缁勪欢涓婄粦瀹�type灞炴�
 				this.$refs.popup.open(this.popupType);
 
-				this.dataObjRunCustomEvent_Return(onSuffixClickCallbackEvent.id, '', onSuffixClickEvent.id,
+				this.dataObjRunCustomEvent_Return(onSuffixClickEvent.id, '', onSuffixClickCallbackEvent.id,
 					item);
 			},
 
 			getDetailAttrList(pageData) {
 				const detailAttrList = [];
+				console.log(pageData)
 				if (pageData.DefList) {
 					pageData.DefList.forEach(style => {
 						var detail_attr = {};
@@ -829,6 +970,7 @@
 						});
 					});
 				}
+				console.log(detailAttrList)
 				const jsonlist = [];
 				detailAttrList.forEach(attr => {
 					jsonlist.push({
@@ -860,6 +1002,7 @@
 						});
 						var obj_attr = this.head_styledef.form.model;
 						// console.log(obj_attr);
+
 						var input_param = Base64.encode(
 							JSON.stringify(
 								Object.keys(head_attr).map((a) => ({
@@ -874,9 +1017,7 @@
 
 							jsonList.push({
 								page_name: page.Name,
-								item_list: $this.getDetailAttrList(page
-									.DefList, page
-									.Select_Button),
+								item_list: $this.getDetailAttrList(page),
 								ext_data: page.ExtData || {}
 							})
 
@@ -884,6 +1025,7 @@
 						const data_json = Base64.encode(
 							JSON.stringify(jsonList)
 						);
+						console.log(jsonList)
 						var dataInfo = {
 							ed_type: 0,
 							start_transaction: true,
@@ -905,7 +1047,6 @@
 						};
 						runCustomEvent(dataInfo).then(result => {
 							console.log(result);
-
 							if (result.ret != 0) {
 								var tip = result.err_info ? typeof result
 									.err_info == 'string' ? result
@@ -923,7 +1064,7 @@
 										content: tip,
 										showCancel: false,
 										confirmText: this.translateSys(
-											"cancel")
+											'close')
 									});
 								} else uni.showModal({
 									title: this.translateSys('tip'),
@@ -933,7 +1074,7 @@
 										.ret,
 									showCancel: false,
 									confirmText: this.translateSys(
-										"cancel")
+										'close')
 								});
 								return false;
 							} else {
@@ -945,7 +1086,7 @@
 									content: tip,
 									showCancel: false,
 									confirmText: this.translateSys(
-										"cancel")
+										'close')
 								});
 
 								if (result.result_type == 0 && result.action) {
@@ -1220,7 +1361,7 @@
 											content: result.info,
 											showCancel: false,
 											confirmText: this
-												.translateSys("cancel")
+												.translateSys('close')
 										});
 									}
 								}
@@ -1234,7 +1375,7 @@
 								title: this.translateSys("error") + "4.1",
 								content: tip,
 								showCancel: false,
-								confirmText: this.translateSys("cancel")
+								confirmText: this.translateSys('close')
 							});
 						});
 					}
@@ -1249,7 +1390,7 @@
 							this.translate('reason') + this.translateSys("colon") +
 							tip,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 				}
 			},
@@ -1594,130 +1735,80 @@
 				}
 
 			},
-			setFormValues(data) {
+			setFormValues(attrs) {
 				const head_styledef = this.head_styledef
-				if (JSON.stringify(data) == '{}') {
+				if (JSON.stringify(attrs) == '{}') {
 					return;
 				}
-				head_styledef.form.items.forEach(async (ele, index) => {
-					if (ele.name != "Layout") {
-						let curIndex = data.findIndex((attr, index2, arr) => {
-							return attr.attr == ele.fieldId;
-						})
-						if (curIndex > -1) {
-							const attr = data[curIndex]
-							if (ele.name ==
-								'Select' &&
-								attr
-								.choice_list
-							) {
-								const
-									dictItemList = [];
-								const
-									choiceList =
-									attr
-									.choice_list || [];
-								for (let d in
-										choiceList) {
-									const
-										val =
-										choiceList[
-											d
-										];
-									dictItemList
-										.push({
-											text: val,
-											value: val
-										});
+				console.log(attrs)
+				attrs.forEach(async (attr, key) => {
+					if (attr.choice_list) {
+						var dictItemList = [];
+						attr.choice_list.forEach(async (val, index) => {
+							dictItemList.push({
+								text: val,
+								value: val
+							});
+						});
+
+						head_styledef.form.items.forEach(async (attr_item, index) => {
+							if (attr_item.name != "Layout") {
+								if (attr_item.fieldId == attr.attr) {
+									if (attr_item.useDict) {
+										attr_item.dict = dictItemList;
+									} else {
+										attr_item.selections = dictItemList;
+									}
 								}
-								ele.dict =
-									dictItemList;
-							}
-
-							ele.value =
-								attr
-								.value;
-						}
-					} else {
-						ele.setting
-							.colList
-							.forEach(
-								async (
-									col
-								) => {
-									if (
-										col) {
-										let curIndex = data.findIndex((
-											attr, index2, arr) => {
-											return attr.attr == col.fieldId;
-										})
-										if (curIndex > -1) {
-											const attr = data[curIndex]
-											if (col.name ==
-												'Select' &&
-												attr
-												.choice_list
-											) {
-												const
-													dictItemList = [];
-												const
-													choiceList =
-													attr
-													.choice_list || [];
-												for (let d in
-														choiceList) {
-													const
-														val =
-														choiceList[
-															d
-														];
-													dictItemList
-														.push({
-															text: val,
-															value: val
-														});
-												}
-												col.dict =
-													dictItemList;
+							} else if (attr_item.name == "Layout") {
+								attr_item.setting.colList.forEach((col) => {
+									if (col) {
+										if (col.fieldId == attr.attr) {
+											if (col.useDict) {
+												col.dict = dictItemList;
+											} else {
+												col.selections = dictItemList;
 											}
-
-											col.value =
-												attr
-												.value;
 										}
 									}
-
-								})
-
+								});
+							}
+						});
 					}
-				})
+					if (!head_styledef.form.model[attr.attr]) {
+						head_styledef.form.model[attr.attr] = attr.value;
+					}
+					head_styledef.form.items.forEach(async (ele) => {
+						if (ele.name != "Layout") {
+							if (ele.fieldId == attr.attr) {
+								ele.value = attr.value;
+								ele.oldvalue = attr.value;
+							}
+						} else if (ele.name == "Layout") {
+							ele.setting.colList.forEach((col) => {
+								if (col) {
+									if (col.fieldId == attr.attr) {
+										col.value = attr.value;
+										col.oldvalue = attr.value;
+									}
+								}
+							});
+						}
 
+					})
+					//鍒ゆ柇琛ㄥ崟閲屾槸鍚︽湁杩斿洖瀛楁锛屾病鏈夊氨瑁呰浇鍒癿odel閲岋紝鐐瑰嚮纭畾鎻愪氦鐨勬椂鍊欏甫涓婅繖浜涙暟鎹�+				})
+				console.log(head_styledef)
 				this.setData({
 					head_styledef: head_styledef
 				})
 			},
-
 			onClickItem(e) { //閫夋嫨椤电
 				// console.log(e);
 				this.current = e.currentIndex
 			},
 			onDetail1EnterChange(item) { //鐮佺洏涓牱寮忓洖杞︿簨浠� 				console.log(item);
-			},
-			delItem(pageData, index) { //鍒犻櫎鐮佺洏涓牱寮忛潰鏉�-
-				//鍒犻櫎鐮佺洏涓牱寮忛潰鏉�-				this.Before_Del_Event = pageData.Before_Delete;
-				this.After_Del_Event = pageData.After_Delete;
-				const style = pageData.DefList[index];
-				//鍒犻櫎鐮佺洏涓牱寮忛潰鏉�-				pageData.DefList.splice(index, 1);
-				if (this.Before_Del_Event?.ID)
-					//鏄惁鏈夊垹闄ゅ墠浜嬩欢
-					this.del(pageData, style, this.Before_Del_Event);
-				else if (this.After_Del_Event?.ID)
-					//鏄惁鏈夊垹闄ゅ悗浜嬩欢
-					this.del(pageData, style, this.After_Del_Event);
 			},
 			async del(pageData, style, event) {
 				//鑾峰彇琛ㄥご灞炴�
@@ -1794,7 +1885,7 @@
 						title: this.translateSys("tip"),
 						content: this.translate("tip_no_select_data"),
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 					return;
 				}
@@ -1850,7 +1941,7 @@
 						title: this.translateSys("tip"),
 						content: "popupParam涓虹┖锛�,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 					return;
 				}
@@ -1859,7 +1950,7 @@
 						title: this.translateSys("tip"),
 						content: this.translate("tip_no_select_data"),
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 					return;
 				}
@@ -1955,14 +2046,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') + ':' + data
 								.ret,
 							showCancel: false,
-							confirmText: this.translateSys("cancel")
+							confirmText: this.translateSys('close')
 						});
 						return false
 					} else {
@@ -1974,7 +2065,7 @@
 							title: this.translateSys("tip"),
 							content: tip,
 							showCancel: false,
-							confirmText: this.translateSys("cancel")
+							confirmText: this.translateSys('close')
 						});
 
 						var actionlist = data.action;
@@ -2037,7 +2128,7 @@
 											.translate(
 												"tip_action_unprocessed"),
 										showCancel: false,
-										confirmText: this.translateSys("cancel")
+										confirmText: this.translateSys('close')
 									});
 								}
 							}
@@ -2114,7 +2205,7 @@
 						title: this.translateSys("error") + "3.1",
 						content: exStr,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 				});
 			},
@@ -2207,14 +2298,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') + ':' + data
 								.ret,
 							showCancel: false,
-							confirmText: $this.translateSys("cancel")
+							confirmText: $this.translateSys('close')
 						});
 						return false
 					} else {
@@ -2226,7 +2317,7 @@
 							title: $this.translateSys("tip"),
 							content: tip,
 							showCancel: false,
-							confirmText: $this.translateSys("cancel")
+							confirmText: $this.translateSys('close')
 						});
 
 						if (data != "") {
@@ -2312,6 +2403,7 @@
 											$this.setData({
 												check_list: val.config
 											})
+											console.log($this.check_list)
 											if (val.config.appear_style == 'sideslip') //鍒ゆ柇鏄惁鏄晶婊� 												$this.setData({
 													popupType: "right"
@@ -2404,7 +2496,7 @@
 												.translate(
 													"tip_action_unprocessed"),
 											showCancel: false,
-											confirmText: $this.translateSys("cancel")
+											confirmText: $this.translateSys('close')
 										});
 									}
 								}
@@ -2417,7 +2509,7 @@
 										"quotation_mark_right") + $this.translateSys(
 										"comma") + 'event_id' + eventid,
 								showCancel: false,
-								confirmText: $this.translateSys("cancel")
+								confirmText: $this.translateSys('close')
 							});
 						}
 					}
@@ -2432,7 +2524,7 @@
 						title: $this.translateSys('tip') + "5.1",
 						content: exStr,
 						showCancel: false,
-						confirmText: $this.translateSys("cancel")
+						confirmText: $this.translateSys('close')
 					});
 				});
 			},
@@ -2441,6 +2533,220 @@
 			onPanelClick(value, id) {
 				// console.log(value);
 				this.active_id = id;
+			},
+			//鐐瑰嚮鎸夐挳鍒楄〃
+			clickDropdownBtns(pageData) {
+				const that = this
+				const itemlist = [];
+				const btnList = pageData.DropDownButton || []
+
+				for (let i in btnList) {
+					itemlist.push(btnList[i].ShowName || "");
+				}
+				uni.showActionSheet({
+					// title: '鎸夐挳鍒楄〃',
+					itemList: itemlist,
+					success: (e) => {
+						console.log(e.tapIndex);
+						var btn = btnList[e.tapIndex];
+						that.onBtnClick(btn, pageData);
+					}
+				})
+			},
+			onBtnClick(btn, pageData) {
+				const $this = this
+				if (btn.Prompt) {
+					const sContent = btn.PromptContent || this.translate("confirm")
+					uni.showModal({
+						title: this.translateSys("tip"),
+						content: btn.PromptContent || this.translate("confirm"),
+						success: function(res) {
+							if (res.confirm) {
+								$this.onButtonClicked(btn, pageData, -1);
+							}
+
+						},
+					})
+
+				} else {
+					this.onButtonClicked(btn, pageData, -1);
+				}
+			},
+			onRowBtnClick(btn, pageData, index) {
+				const $this = this
+				if (btn.Prompt) {
+					const sContent = btn.PromptContent || this.translate("confirm")
+					uni.showModal({
+						title: this.translateSys("tip"),
+						content: btn.PromptContent || this.translate("confirm"),
+						success: function(res) {
+							if (res.confirm) {
+								$this.onButtonClicked(btn, pageData, index);
+							}
+
+						},
+					})
+
+				} else {
+					this.onButtonClicked(btn, pageData, index);
+				}
+			},
+			onButtonClicked(btn, pageData, index) {
+				this.After_OK_Event = {}
+				let enviroment = {
+					button: "top",
+					button_name: btn.ShowName,
+					cls_id: btn.Cls_ID,
+					function: "5601",
+					master: {},
+				};
+				if (btn.FunCode == "TriggerEvent") {
+					this.After_OK_Event = btn?.After_Event || {};
+					this.sava(pageData, btn.Event);
+				} else if (btn.FunCode == "Cancel") {
+					this.cancel();
+				} else if (btn.FunCode == "Delete") {
+					if (index > -1) {
+						const pageIndex = this.pageDetail.findIndex((
+							page) => {
+							return pageData.Name == page.Name;
+						})
+						const style = pageData.DefList[index];
+						//鍒犻櫎鐮佺洏涓牱寮忛潰鏉�+						pageData.DefList.splice(index, 1);
+						this.del(pageData, style, btn.AfterProcess_Event);
+						this.$set(this.pageDetail, pageIndex, pageData)
+					}
+				} else if (btn.FunCode == "Modify") {
+					if (index > -1) {
+						const style = pageData.DefList[index];
+						if (btn.Edit_dlg.Model == "small") {
+							this.showSmallDialog(btn, style, enviroment, pageData);
+						} else if (btn.Edit_dlg.Model == "form") {
+							this.showFormDialog(btn, style, enviroment, pageData);
+						} else {
+							uni.showModal({
+								title: this.translateSys("tip"),
+								content: this.translateSys("unrealized"),
+								showCancel: false,
+								confirmText: this.translateSys('close')
+							});
+						}
+					}
+
+				} else {
+					this.$Message.warning(this.$t("sys.unrealized"));
+				}
+			},
+			//淇敼灏忕獥鍙f暟鎹�+			showSmallDialog(btn, row, enviroment, pageData) {
+				var data = {
+					Add_BtnName: btn.ShowName,
+					EditDlgMode: btn.Edit_dlg.Model,
+					clsid: btn.Cls_ID,
+					objid: "",
+					cls_name: btn.Cls_Name,
+					Edit_dlg: btn.Edit_dlg
+				};
+				const objAttr = {}
+				row.form.items.forEach(item => {
+					if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮�+						item.setting.colList.forEach(cols => {
+							if (cols != null) objAttr[cols
+								.fieldId] = cols.value;
+						});
+					} else
+						objAttr[item.fieldId] = item.value;
+				});
+				const url = `../modal/3018?param=${JSON.stringify(data)}&titlename=${btn.Edit_dlg
+					.Name}&editMode=1&objAttr=${JSON.stringify(objAttr)}&type=updateDataObj`
+
+				var $this = this;
+				uni.navigateTo({
+					url: url,
+					events: {
+						// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�鍒板綋鍓嶉〉闈㈢殑鏁版嵁
+						updateDataObj: function(formData) {
+							const pageIndex = $this.pageDetail.findIndex((
+								page) => {
+								return pageData.Name == page.Name;
+							})
+							if (pageIndex < 0)
+								return
+							Object.assign(row.form.model, formData);
+							row.form.items.forEach(async (ele, index) => {
+								if (ele.name != "Layout") {
+									let value = formData[ele.fieldId]
+									if (value)
+										ele.value = value
+
+								} else {
+									ele.setting.colList.forEach(async (col) => {
+										if (col) {
+											let value = formData[col.fieldId]
+											if (value)
+												col.value = value
+										}
+									});
+								}
+							})
+							$this.$set($this.pageDetail, pageIndex, pageData)
+
+						},
+
+					}
+				});
+			},
+
+			//淇敼鑷畾涔夎〃鍗曟暟鎹�+			showFormDialog(btn, row, enviroment, pageData) {
+				const objAttr = {}
+				row.form.items.forEach(item => {
+					if (item.name == "Layout") { //鍒ゆ柇鏄惁鏄爡鏍忔牸寮�+						item.setting.colList.forEach(cols => {
+							if (cols != null) objAttr[cols
+								.fieldId] = cols.value;
+						});
+					} else
+						objAttr[item.fieldId] = item.value;
+				});
+
+				const url =
+					`../modal/form/index?param=${JSON.stringify(btn)}&titlename=${btn.ShowName}&editMode=1&objAttr=${JSON.stringify(objAttr)}&type=updateDataObj`
+				var $this = this;
+				uni.navigateTo({
+					url: url,
+					events: {
+						// 涓烘寚瀹氫簨浠舵坊鍔犱竴涓洃鍚櫒锛岃幏鍙栬鎵撳紑椤甸潰浼犻�鍒板綋鍓嶉〉闈㈢殑鏁版嵁
+						updateDataObj: function(formData) {
+							const pageIndex = $this.pageDetail.findIndex((
+								page) => {
+								return pageData.Name == page.Name;
+							})
+							if (pageIndex < 0)
+								return
+							Object.assign(row.form.model, formData);
+							row.form.items.forEach(async (ele) => {
+								if (ele.name != "Layout") {
+									let value = formData[ele.fieldId]
+									if (value)
+										ele.value = value
+
+								} else {
+									ele.setting.colList.forEach(async (col) => {
+										if (col) {
+											let value = formData[col.fieldId]
+											if (value)
+												col.value = value
+										}
+									});
+								}
+							})
+							$this.$set($this.pageDetail, pageIndex, pageData)
+
+						},
+					}
+				});
 			},
 			//纭畾
 			ok(pageData) {
@@ -2467,7 +2773,7 @@
 							this.translate(
 								"tip_no_data_last"),
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 					return false;
 				}
@@ -2558,7 +2864,7 @@
 						title: this.translateSys("tip"),
 						content: this.translate("tip_no_select_data"),
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 					return;
 				}
@@ -2619,7 +2925,7 @@
 								content: tip,
 								showCancel: false,
 								confirmText: this.translateSys(
-									"cancel")
+									'close')
 							});
 						} else uni.showModal({
 							title: this.translateSys('tip'),
@@ -2628,7 +2934,7 @@
 								result.ret,
 							showCancel: false,
 							confirmText: this.translateSys(
-								"cancel")
+								'close')
 						});
 						return false;
 					} else {
@@ -2640,7 +2946,7 @@
 							content: tip,
 							showCancel: false,
 							confirmText: this.translateSys(
-								"cancel")
+								'close')
 						});
 						if (result.result_type == 0) {
 							if (result.action) {
@@ -2693,7 +2999,7 @@
 											showCancel: false,
 											confirmText: this
 												.translateSys(
-													"cancel"
+													'close'
 												)
 										});
 									} else if (item.action_type ==
@@ -2916,7 +3222,7 @@
 									content: result.info,
 									showCancel: false,
 									confirmText: this
-										.translateSys("cancel")
+										.translateSys('close')
 								});
 							}
 						}
@@ -2934,7 +3240,7 @@
 								"comma") +
 							tip,
 						showCancel: false,
-						confirmText: this.translateSys("cancel")
+						confirmText: this.translateSys('close')
 					});
 				});
 			},
@@ -2955,7 +3261,17 @@
 		},
 	};
 </script>
+<style>
+	.popup-content {
+		@include flex;
 
+	}
+
+	.popup-height {
+		@include height;
+		/* width: 200px; */
+	}
+</style>
 <style lang="scss">
 	.uni-page-modal-5601 {
 
@@ -3039,15 +3355,81 @@
 			flex-direction: column !important;
 		}
 
+
 		.view-bottom {
 			display: flex;
 			flex-direction: row;
 			width: calc(100% - 30rpx);
 			padding: 10rpx 15rpx 30rpx 15rpx;
+
+			.btn-disabled {
+				background-color: #ddd !important;
+				color: #888 !important;
+			}
+
+
+
+			.btn-left {
+				padding: 20rpx;
+				line-height: 1.5;
+				font-size: 38rpx;
+				font-weight: bold;
+				float: left;
+				display: inline-block;
+
+			}
+
+			.btn-one {
+				padding: 20rpx;
+				line-height: 1.5;
+				font-size: 38rpx;
+				font-weight: bold;
+				float: left;
+				display: inline-block;
+				width: 50%;
+				margin-left: 25%;
+			}
+
+			.btn-right {
+				padding: 20rpx;
+				line-height: 1.5;
+				font-size: 38rpx;
+				font-weight: bold;
+				float: right;
+				display: inline-block;
+			}
+
+			.width-50 {
+				width: 49%;
+			}
+
+			.width-32 {
+				width: 32%;
+				margin-left: 1%;
+			}
+
+			.width-30 {
+				width: 30%;
+				margin-left: 1%;
+			}
 		}
 
+		.btn-warn {
+			background: #ff2d1e;
+			border: none;
+			color: #fff;
+		}
 
+		.btn-cancel {
+			background: #fff;
+			color: #000;
+		}
 
+		.btn-primary {
+			background: #27A6E1;
+			border: none;
+			color: #fff;
+		}
 
 		[nvue] uni-view {
 			position: relative;
@@ -3073,7 +3455,7 @@
 
 		.dv-panel {
 			background-color: #efefef;
-			padding: 20rpx 20rpx 4rpx 0px;
+			padding: 20rpx 20rpx 10rpx 0px;
 			border-radius: 12rpx;
 			margin: 10rpx 0 20rpx 0;
 			text-align: right;
@@ -3118,7 +3500,8 @@
 			.dv-panel-button {
 				width: 100%;
 				text-align: left;
-				padding-bottom: 20rpx;
+				min-height: 30rpx;
+				padding-bottom: 10rpx;
 
 				checkbox {
 					padding-left: 20px;
@@ -3127,44 +3510,13 @@
 
 				button {
 					text-align: left;
-					line-height: 1.8;
+					line-height: 1.5;
 					border: none;
-					font-size: 34rpx;
-					width: 180rpx;
+					font-size: 30rpx;
+					margin-right: 10rpx;
 					display: inline-block;
 					float: right;
 					text-align: center;
-
-					.btn_cancel {
-						width: 49.5%;
-						padding: 20rpx;
-						line-height: 1.5;
-						border: none;
-						font-size: 38rpx;
-						font-weight: bold;
-						float: left;
-						display: inline-block;
-					}
-
-					.btn_add {
-						width: 49.5%;
-
-						padding: 20rpx;
-						line-height: 1.5;
-						border: none;
-						font-size: 38rpx;
-						font-weight: bold;
-						float: right;
-						color: #fff;
-						display: inline-block;
-					}
-
-					.btn_disabled {
-						background-color: #ddd;
-						color: #888;
-					}
-
-
 				}
 			}
 
@@ -3273,15 +3625,6 @@
 			background-color: #f3f3f3 !important;
 		}
 
-		.demo-uni-row {
-			margin-bottom: 0px;
-			display: block;
-
-			.uni-input {
-				width: calc(100% - 120px);
-			}
-		}
-
 		::v-deep .uni-row {
 			margin-bottom: 0px;
 		}
@@ -3293,6 +3636,30 @@
 		.demo-uni-col {
 			height: 36px;
 			border-radius: 5px;
+		}
+
+		.view-popup {
+			position: relative;
+		}
+
+		.popup-content {
+			// @include flex;
+			align-items: center;
+			justify-content: center;
+			padding: 30rpx;
+			background-color: #fff;
+			/* height: 150px; */
+			/* border: 1px solid red; */
+		}
+
+		.popup-cont {
+			overflow-y: auto;
+			/* border: 1px solid red; */
+		}
+
+		.popup-height {
+			// @include height;
+			/* width: 200px; */
 		}
 
 		.popup-header {
@@ -3308,7 +3675,7 @@
 		.popup-footer {
 			float: right;
 			position: absolute;
-			bottom: 0;
+			bottom:10rpx;
 			right: 20rpx;
 		}
 
@@ -3332,9 +3699,11 @@
 			margin-top: 50rpx;
 			padding: 15rpx;
 			line-height: 1.5;
-			background: #27A6E1;
-			border: none;
-			color: #fff;
+			// background: #27A6E1;
+			// border: none;
+			// color: #fff;
+			background: #fff;
+			color: #000;
 			font-size: 38rpx;
 			font-weight: bold;
 			/* float: right; */

--
Gitblit v1.9.1