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/3018_2.vue | 209 +++++++++++++++++++++++++++++++++------------------- 1 files changed, 133 insertions(+), 76 deletions(-) diff --git a/pages/modal/3018_2.vue b/pages/modal/3018_2.vue index 4c59b99..56d6ed0 100644 --- a/pages/modal/3018_2.vue +++ b/pages/modal/3018_2.vue @@ -5,24 +5,24 @@ <uni-forms ref="baseForm" label-align="right"> <view class="v-headStyle" v-for="(item,index) in head_styledef.form.items"> <!-- 鏅�甯冨眬 --> - <uni-forms-item v-if="item.name != 'Layout'&& item.show==true" :label="item.label +'锛� " - :label-width="item.labelWidth+'px'"> + <uni-forms-item v-if="item.name != 'Layout'&& item.show==true" + :label="item.label ? item.label +'锛�:'' " :label-width="item.labelWidth+'px'"> <!-- <text class="txt_title" :style="{'width':item.labelWidth+'px'}">{{item.label}}锛�/text> --> <!-- 涓嬫媺妗�鍗曢� item.useDict?item.dict:item.selections--> <uni-data-select id="dv_select" v-if="item.name=='Select'" :style="'width: calc(100% - '+item.labelWidth-10+'px);'" :class="item.disabled?'input-disabled':''" v-model="item.value" :localdata="item.dict" - @change="onchange(item)" :disabled="item.disabled" :clear="false"></uni-data-select> + @change="onChange(item)" :disabled="item.disabled" :clear="false"></uni-data-select> <!-- 鏂囨湰妗�鏁板瓧妗�--> <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]" - @change="classAttr_extButton(item)"></text> + @click="classAttr_extButton(item)"></text> <input class="uni-input" :class="item.disabled?'input-disabled':''" :type="item.name=='Input'?'text':item.name=='InputNumber'?'number':'text'" 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%'}" + :style="{'padding-left':item.setting.prefix?0 : '8rpx','right':item.setting.suffix?0 : '8rpx'}" :focus="focusFieldId == item.fieldId" @focus="ontap(item)" @click="onClick(item)" - @blur="onevent(item)" :maxlength="-1" /> + @keyup.enter="onModelValue(item)" @blur="onModelValue(item)" :maxlength="-1" /> <text v-if="item.setting.suffix" class="uni-icon" :class="[item.setting.suffix]" @click="classAttr_extButton(item)"></text> </view> @@ -36,17 +36,17 @@ </view> <!-- 澶嶉�妗�--> <checkbox-group class="check_rememberPwd" v-if="item.name=='Checkbox'" - :class="item.disabled?'input-disabled':''" @change="onModelValue(item)" - :disabled="item.disabled" :data-ischeck="item.value"> - <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" - @change="onModelValue(item)"> + @change="onRadioBoxValue" :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> @@ -68,24 +68,24 @@ <uni-row class="demo-uni-row" v-if="item.name=='Layout'"> <uni-col v-for="(cols,key) in item.setting.colList" :span="item.setting.spanList?item.setting.spanList[key]:24 / item.setting.col"> - <uni-forms-item v-if="cols!=null && cols.show==true" :label="cols.label +'锛�" - :label-width="cols.labelWidth+'px'"> + <uni-forms-item v-if="cols!=null && cols.show==true" + :label="cols.label? cols.label +'锛�:''" :label-width="cols.labelWidth+'px'"> <view class="input-wrapper" v-if="(cols.name=='Input' || cols.name=='InputNumber') "> <text v-if="cols.setting.prefix" class="uni-icon" :class="[cols.setting.prefix]" - @change="onchange(cols)"></text> + @click="classAttr_extButton(cols)"></text> <input class="uni-input" :class="cols.disabled?'input-disabled':''" :type="cols.name=='Input'?'text':cols.name=='InputNumber'?'number':'text'" 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%'}" + :style="{'padding-left':cols.setting.prefix?0 : '8px','right':cols.setting.suffix?0 : '8px'}" :focus="focusFieldId == cols.fieldId" @focus="ontap(cols)" @click="onClick(cols)" @blur="onevent(cols)" :maxlength="-1" /> <text v-if="cols.setting.suffix" class="uni-icon" :class="[cols.setting.suffix]" - @click="onchange(cols)"></text> + @click="classAttr_extButton(cols)"></text> </view> <!-- 涓嬫媺妗�鍗曢� cols.useDict?cols.dict:cols.selections--> <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" + :localdata="cols.dict" @change="onChange(cols)" :disabled="cols.disabled" :clear="false"></uni-data-select> <!-- 澶氳鏂囨湰 --> <view class="input-wrapper" v-if="cols.name=='Textarea' "> @@ -98,17 +98,16 @@ <!-- 澶嶉�妗�--> <checkbox-group class="check_rememberPwd" v-if="cols.name=='Checkbox'" :class="cols.disabled?'input-disabled':''" :disabled="cols.disabled" - @change="onModelValue(cols)" :data-ischeck="cols.value" - :style="{'margin-left':'10rpx'}"> - <label> - <checkbox :value="cols.value" :checked="cols.value" /> - <text>{{cols.label}}</text> + @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" - @change="onModelValue(cols)"> + @change="onRadioBoxValue" :data-attr="cols.fieldId"> <label v-for="(cols2) in cols.selections" :key="cols2.value"> <radio :value="cols2.value" :checked="cols2.value === cols.value" /> <text>{{cols2.label}}</text> @@ -152,8 +151,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'}"> @@ -388,6 +388,24 @@ await $this.DictGetInfo(ele.bind.dict, styledefHead.form.model, ele); + } else { + if (ele?.name === "Select") { + const selections = ele?.selections || [] + //鏈夐粯璁ゅ�锛屾樉绀洪粯璁ゅ� + let itemName = ele.value || ""; + if (itemName) { + styledefHead.form + .model[ele.fieldId] = itemName; + } + ele.dict = selections.map((a) => { + return { + value: a.value, + text: a.label + } + }) + + } + } if ($this.focusFieldId == "") { if (ele.name == 'Input' || ele.name == @@ -408,6 +426,25 @@ .dict, styledefHead.form .model, col); + } else { + if (col?.name === "Select") { + const selections = col?.selections || [] + //鏈夐粯璁ゅ�锛屾樉绀洪粯璁ゅ� + let itemName = col.value || ""; + if (itemName) { + styledefHead.form + .model[col.fieldId] = itemName; + } + col.dict = selections.map((a) => { + return { + value: a.value, + text: a.label + } + }) + + + } + } if ($this.focusFieldId == "") { if (col.name == 'Input' || col @@ -451,7 +488,7 @@ title: this.translateSys("error") + "1.1", content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); } }, @@ -491,7 +528,7 @@ title: this.translateSys("error") + "1.3", content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); @@ -523,14 +560,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 { @@ -542,7 +579,7 @@ title: this.translateSys("tip"), content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); var actionlist = data.action; @@ -593,7 +630,7 @@ "quotation_mark_right") + this .translate('tip_action_unprocessed'), showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); } } @@ -611,7 +648,7 @@ this.translateSys("full_stop") + this.translate('reason') + this.translateSys("colon") + tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); } }, @@ -793,8 +830,8 @@ } }, - onchange(item) { - console.log("onchange", item); + onChange(item) { + console.log("onChange", item); if (item.oldvalue != item.value && item.value.trim() != "") { item.oldvalue = item.value; var attr = item.fieldId; @@ -827,9 +864,29 @@ }, onModelValue(item) { //缁戝畾Model鍊� var attr = item.fieldId; - this.head_styledef.form.model[attr] = item.value; + if (item.oldvalue != item.value && item.value.trim() != "") { + item.oldvalue = item.value; + var attr = item.fieldId; + this.head_styledef.form.model[attr] = item.value; + var onChangeEvent = item.bind.onChangeEvent; //鍐呭鍙樺寲鍚庝簨浠�+ if (onChangeEvent?.id) { //鍐呭鍙樺寲鍚庝簨浠�+ this.onChange(onChangeEvent); + } + + } + }, + onCheckBoxValue(e) { //缁戝畾Model鍊�+ let values = e.detail.value || [] + let attr = e.currentTarget?.dataset?.attr || "" + this.head_styledef.form.model[attr] = values; + }, + onRadioBoxValue(e) { //缁戝畾Model鍊�+ let value = e.detail.value || "" + let attr = e.currentTarget?.dataset?.attr || "" + this.head_styledef.form.model[attr] = value; }, classAttr_extButton(item) { + console.log("classAttr_extButton", item) var onSuffixClickCallbackEvent = item.bind.onSuffixClickCallbackEvent; //鍚庡浘鏍囩偣鍑讳簨浠� var onSuffixClickEvent = item.bind.onSuffixClickEvent; //鍚庡浘鏍囩偣鍑诲洖璋� @@ -838,7 +895,7 @@ title: this.translateSys("tip"), content: this.translate('icon_click_callback_empty'), showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); return; } @@ -847,7 +904,7 @@ title: this.translateSys("tip"), content: this.translate('icon_click_event_empty'), showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); return; } @@ -855,7 +912,7 @@ // 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); }, popupChange(e) { @@ -900,7 +957,7 @@ title: this.translateSys("tip"), content: "popupParam涓虹┖锛�, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); return; } @@ -909,7 +966,7 @@ title: this.translateSys("tip"), content: this.translate("tip_no_select_data"), showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); return; } @@ -1012,14 +1069,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 { @@ -1031,7 +1088,7 @@ title: this.translateSys("tip"), content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); var actionlist = data.action; @@ -1080,7 +1137,7 @@ .translate( "tip_action_unprocessed"), showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); } } @@ -1161,7 +1218,7 @@ title: this.translateSys("error") + "3.1", content: exStr, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); }); }, @@ -1253,14 +1310,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 { @@ -1272,7 +1329,7 @@ title: $this.translateSys("tip"), content: tip, showCancel: false, - confirmText: $this.translateSys("cancel") + confirmText: $this.translateSys('close') }); if (data != "") { @@ -1355,6 +1412,7 @@ } else if (action.action_type == 'open_common_dlg') { if (val.common_dlg_id == 'check_list') { + $this.setData({ check_list: val.config }) @@ -1450,7 +1508,7 @@ .translate( "tip_action_unprocessed"), showCancel: false, - confirmText: $this.translateSys("cancel") + confirmText: $this.translateSys('close') }); } } @@ -1463,7 +1521,7 @@ "quotation_mark_right") + $this.translateSys( "comma") + 'event_id' + eventid, showCancel: false, - confirmText: $this.translateSys("cancel") + confirmText: $this.translateSys('close') }); } } @@ -1478,7 +1536,7 @@ title: $this.translateSys('tip') + "5.1", content: exStr, showCancel: false, - confirmText: $this.translateSys("cancel") + confirmText: $this.translateSys('close') }); }); }, @@ -1556,14 +1614,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') }); this.saving = false return false @@ -1576,7 +1634,7 @@ title: this.translateSys("tip"), content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); else { @@ -1648,7 +1706,7 @@ title: this.translateSys("tip"), content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); }); }, @@ -1858,14 +1916,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') }); this.saving = false return false @@ -1878,7 +1936,7 @@ title: this.translateSys("tip"), content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); if (!this.$data.param.After_Btn_Not_Refresh) { //鍒锋柊 @@ -1938,7 +1996,7 @@ title: this.translateSys('tip') + "7.1", content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); }); }, @@ -1976,7 +2034,7 @@ title: this.translateSys("tip"), content: this.translateSys("unrealized"), showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); } } else if (btn.FunCode == "TriggerEvent") { @@ -2031,14 +2089,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 { @@ -2050,7 +2108,7 @@ title: this.translateSys("tip"), content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); if (!this.$data.param.After_Btn_Not_Refresh) { //鍒锋柊 @@ -2108,7 +2166,7 @@ title: this.translateSys('tip') + "7.1", content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys("close") }); }); @@ -2276,9 +2334,10 @@ width: 45%; margin: 0 10rpx; // padding: 5rpx 10rpx; - background: #4D6AF4; + background: #27A6E1; border: none; color: #fff; + font-size: 38rpx; float: left; display: inline-block; } @@ -2293,7 +2352,7 @@ margin: 0 10rpx; background: #fff; border: none; - color: #000; + //color: #000; font-size: 38rpx; float: right; display: inline-block; @@ -2303,7 +2362,7 @@ width: 90%; margin: 0 10rpx; background: #fff; - border: none; + // border: none; color: #000; font-size: 38rpx; float: right; @@ -2367,7 +2426,7 @@ .popup-footer { float: right; position: absolute; - bottom: 0; + bottom: 10rpx; right: 20rpx; } @@ -2391,9 +2450,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; */ @@ -2559,10 +2620,6 @@ .demo-uni-col { height: 36px; border-radius: 5px; - } - - .demo-uni-row .uni-input { - width: calc(100% - 120px); } .text { -- Gitblit v1.9.1