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/3037_2.vue | 180 ++++++++++++++++++++++++++++++++++-------------------------- 1 files changed, 102 insertions(+), 78 deletions(-) diff --git a/pages/modal/3037_2.vue b/pages/modal/3037_2.vue index 3c4dbe2..15f5ff0 100644 --- a/pages/modal/3037_2.vue +++ b/pages/modal/3037_2.vue @@ -39,16 +39,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" :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" @change="onModelValue(item)"> + :class="item.disabled?'input-disabled':''" :disabled="item.disabled" @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> @@ -128,17 +129,17 @@ </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)"> + :style="{'margin-left':'10rpx'}" @change="onRadioBoxValue" :data-attr="cols.fieldId"> <label v-for="(item2) in item.selections" :key="item2.value"> <radio :value="item2.value" :checked="item2.value === item.value" /> <text>{{item2.label}}</text> @@ -194,17 +195,17 @@ <!-- 澶嶉�妗�--> <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> @@ -251,8 +252,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'}"> @@ -411,6 +413,23 @@ ele.show = true; 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 + } + }) + } + } }); } @@ -428,7 +447,7 @@ title: this.translateSys("error") + "1.1", content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); } @@ -455,6 +474,21 @@ $this.detail1_styledef.form.items.forEach(async (ele, index) => { if (ele.useDict == true) { //鍒ゆ柇useDict鏄惁浣跨敤瀛楀吀 await this.DictGetInfo(ele.bind.dict, index, 'sub'); + } else { + if (ele?.name === "Select") { + const selections = ele?.selections || [] + //鏈夐粯璁ゅ�锛屾樉绀洪粯璁ゅ� + let itemName = ele.value || ""; + if (itemName) { + $this.detail1_styledef.form.items[ele.fieldId] = itemName; + } + $this.detail1_styledef.form.items[index].dict = selections.map((a) => { + return { + value: a.value, + text: a.label + } + }) + } } }); } @@ -472,7 +506,7 @@ title: this.translateSys("error") + "2.1", content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); } @@ -522,7 +556,7 @@ title: this.translateSys("error") + "1.3", content: ex.errMsg, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); } @@ -554,13 +588,13 @@ 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 { @@ -570,7 +604,7 @@ title: this.translateSys("tip"), content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); var actionlist = data.action; @@ -715,7 +749,7 @@ "quotation_mark_right") + this .translate('tip_action_unprocessed'), showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); } } @@ -730,7 +764,7 @@ this.translateSys("full_stop") + this.translate('reason') + this.translateSys("colon") + ex.errMsg, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); }); }, @@ -965,6 +999,17 @@ } } }, + + 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; + }, onModelValue(item) { //缁戝畾Model鍊� //console.log(e.target) var attr = item.fieldId; @@ -997,7 +1042,7 @@ title: this.translateSys("tip"), content: this.translate("delete_success"), showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); }).catch(ex => { @@ -1007,7 +1052,7 @@ title: this.translateSys('tip') + "9.1", content: ex.errMsg, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); }); } @@ -1020,7 +1065,7 @@ title: this.translateSys("tip"), content: this.translate("before_select_event_empty"), showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); return; } @@ -1120,7 +1165,7 @@ title: this.translateSys("tip"), content: this.translate("after_select_event_empty"), showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); return; } @@ -1143,7 +1188,7 @@ title: this.translateSys("tip"), content: this.translate("tip_no_select_data"), showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); return; } @@ -1260,13 +1305,13 @@ 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 { @@ -1276,7 +1321,7 @@ title: this.translateSys("tip"), content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); var actionlist = data.action; @@ -1456,7 +1501,7 @@ title: this.translateSys("error") + "3.1", content: ex.errMsg, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); }); }, @@ -1536,14 +1581,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('comma') + this.translate('result') + this .translateSys('colon') + data.ret, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); return false } else { @@ -1553,7 +1598,7 @@ title: this.translateSys("tip"), content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); var actionlist = data.action; @@ -1710,7 +1755,7 @@ "quotation_mark_right") + this.translate( "tip_action_unprocessed"), showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); } } @@ -1783,7 +1828,7 @@ title: this.translateSys("error") + "7.1", content: ex.errMsg, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); }); }, @@ -1889,13 +1934,13 @@ 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 @@ -1906,7 +1951,7 @@ title: this.translateSys("tip"), content: tip, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); var result = data.result; @@ -1930,7 +1975,7 @@ title: this.translateSys("error") + "8.1", content: ex.errMsg, showCancel: false, - confirmText: this.translateSys("cancel") + confirmText: this.translateSys('close') }); }); }, @@ -1955,7 +2000,6 @@ <style> .popup-content { @include flex; - } .popup-height { @@ -2103,30 +2147,6 @@ /* border: 1rpx solid red; */ } - button.btn_cancel { - width: 49.5%; - margin-top: 50rpx; - padding: 20rpx; - line-height: 1.5; - border: none; - font-size: 38rpx; - font-weight: bold; - float: left; - display: inline-block; - } - - button.btn_add { - width: 49.5%; - margin-top: 50rpx; - padding: 20rpx; - line-height: 1.5; - border: none; - font-size: 38rpx; - font-weight: bold; - float: right; - display: inline-block; - } - #dv_select { display: inline-block; width: 66%; @@ -2202,9 +2222,11 @@ margin-top: 50rpx; padding: 20rpx; 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: left; @@ -2351,7 +2373,7 @@ .popup-footer { float: right; position: absolute; - bottom: 0; + bottom: 10rpx; right: 20rpx; } @@ -2375,9 +2397,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