From dcfa09f5bac5a96f342429fec26d84132d556b54 Mon Sep 17 00:00:00 2001 From: jt <jt@activesoft.com.cn> Date: 星期四, 07 三月 2024 13:58:33 +0800 Subject: [PATCH] 5602/5600功能点action处理改进 --- pages/modal/3200.vue | 111 ++++++++++++++++--------------------------------------- 1 files changed, 33 insertions(+), 78 deletions(-) diff --git a/pages/modal/3200.vue b/pages/modal/3200.vue index 495046b..e1f48cf 100644 --- a/pages/modal/3200.vue +++ b/pages/modal/3200.vue @@ -477,10 +477,10 @@ <view class="view-floor"> <button type="default" @click="cancel" class="btn_cancel" - :style="{'width':param.ListPage.Page_Button?'39.5%':'49.5%'}">鍏抽棴</button> + :style="{'width':param.ListPage.Page_Button.length>0?'39.5%':'48.5%'}">鍏抽棴</button> <button type="default" @click="Refresh" class="btn_refresh" - :style="{'width':param.ListPage.Page_Button?'39.5%':'49.5%'}">鍒锋柊</button> - <view class="uni-padding-wrap" v-if="param.ListPage.Page_Button"> + :style="{'width':param.ListPage.Page_Button.length>0?'39.5%':'48.5%'}">鍒锋柊</button> + <view class="uni-padding-wrap" v-if="param.ListPage.Page_Button.length>0"> <view class="uni-btn-v"> <a @tap="actionSheetTap"><Icon class="mobox-normal-more"/></a> </view> @@ -603,7 +603,7 @@ if(!ret.result.style_def.includes('"')) styledef = Base64.decode(ret.result.style_def); } $this.$data.detail1_styledef = ret.result.style_def? JSON.parse(styledef): {}; - $this.$data.detail1_styledef.SelBut_Checked = true; + $this.$data.detail1_styledef.SelBut_Checked = false; // console.log($this.$data.detail1_styledef); // $this.$data.detail1StyleDefList.push($this.$data.detail1_styledef); // var aa = JSON.stringify(this.detail1_styledef); @@ -670,6 +670,7 @@ var $this = this; var dataInfo={ ed_type: 0, + start_transaction: true, class_id: clsid, event_id: eventid, }; @@ -681,7 +682,7 @@ var tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result.err_info.join('<br/>') : ''; if (result.ret == 801) uni.showModal({title:'鎻愮ず',content:tip,showCancel:false,confirmText:"鍙栨秷"}); else uni.showModal({title:'鎻愮ず',content:tip+',鎻愮ず:'+result.ret,showCancel:false,confirmText:"鍙栨秷"}); - return false + return false; }else{ var tip = result.info ? typeof result.info == 'string' ? result.info : result.info.join('<br/>') : ''; if (tip) uni.showModal({title:'鎻愮ず',content:tip,showCancel:false,confirmText:"鍙栨秷"}); @@ -800,7 +801,7 @@ url:'../modal/3200?param='+JSON.stringify(this.$data.param)+"&titlename="+this.$data.title }); }, - //鐐瑰嚮鏄剧ず娴忚瀵硅薄鏄剧ず椤甸潰瀹氫箟 + //鐐瑰嚮鏄剧ず娴忚瀵硅薄鏄剧ず椤甸潰 async onViewPageClick(style){ if(this.param.ViewPage){ if(this.param.ViewPage.View_UIDef){ @@ -816,14 +817,15 @@ var eventid = $this.param.ViewPage.Exit_View_Event?.id; if(eventid){ try { - var obj_attr = [{attr: 'S_ID',value:$this.styledef.form.objId}]; + var obj_attr = {'S_ID':$this.styledef.form.objId}; $this.styledef.form.attrs.forEach((attr) => { - obj_attr.push({attr: attr.name,value: attr.value}); + obj_attr[attr.name]=attr.value; }); // console.log(obj_attr); var input_param = Base64.encode(JSON.stringify(obj_attr)); this.runCustomEvent({ ed_type: 0, + start_transaction: true, class_id: this.param.DataCls.id, event_id: eventid, obj_attr, @@ -986,6 +988,7 @@ //鎵ц鍚庡鐞嗕簨浠� await this.runCustomEvent({ ed_type: 0, + start_transaction: true, class_id: clsId, event_id: afterProcess_Event.ID, }); @@ -1085,7 +1088,7 @@ var $this = this; var dataInfo={ ed_type: 0, - start_transaction: '', + start_transaction: true, class_id: this.$data.head_styledef.form.clsId, class_name: '', event_id: event.id, @@ -1110,75 +1113,14 @@ var tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result.err_info.join('<br/>') : ''; if (result.ret == 801) uni.showModal({title:'鎻愮ず',content:tip,showCancel:false,confirmText:"鍙栨秷"}); else uni.showModal({title:'鎻愮ず',content:tip+',鎻愮ず:'+result.ret,showCancel:false,confirmText:"鍙栨秷"}); - return false + return false; }else{ var tip = result.info ? typeof result.info == 'string' ? result.info : result.info.join('<br/>') : ''; if (tip) uni.showModal({title:'鎻愮ず',content:tip,showCancel:false,confirmText:"鍙栨秷"}); if(result.result_type == 0 && result.action){ result.action.forEach(item=>{ - if(item.action_type == "insert_subtable_page_row"){ //鍒嗘嫞涓�- $this.$data.param.Show_Welcom_Page=false; - var value = item.value; - $this.viewAceionRow(value); - } - else if(item.action_type == "set_subtable_page_content"){ //宸插垎鎷�- $this.$data.param.Show_Welcom_Page=false; - var value = item.value; - if(value.clear == true && $this.$data.detail1StyleDefList.length>0){ //鍒ゆ柇鏄惁娓呯┖椤电鍐呭,姝e湪鍒嗘嫞鏄惁鏈夋暟鎹�- uni.showModal({ - title: '鎻愮ず', - content: '绯荤粺妫�祴鍒版湁寰呭垎鎷d腑鐨勮揣鍝侊紝缁х画鎿嶄綔浼氭竻绌猴紝鏄惁缁х画锛�, - success: function (res) { - if (res.confirm) { - $this.$data.detail1StyleDefList=[]; - $this.$data.detail2StyleDefList=[]; - $this.viewAceionContent(value); - } else if (res.cancel) { - if(value.page_name == $this.$data.param.Sub_Page[0].Name){ //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 - $this.$data.detail1StyleDefList=[]; - }else{ - $this.$data.detail2StyleDefList=[]; - } - $this.viewAceionContent(value); - } - } - }); - } else { - if(value.page_name == $this.$data.param.Sub_Page[0].Name){ //鍒ゆ柇杩斿洖鐨刟ction鐨刾age_name鏄惁鏄緟鍒嗘嫞 - $this.$data.detail1StyleDefList=[]; - }else{ - $this.$data.detail2StyleDefList=[]; - } - $this.viewAceionContent(value); - } - } - else if(item.action_type == "select_subtable_page_row"){ - // value = {"page_name":"鐮佺洏涓�, "row":{"id":"xx"}} - var value = item.value; - $this.detail1StyleDefList.forEach((ele,index)=>{ - $this.activelist[index].active = false; - if(ele.form.objId == value.row.id){ - ele.SelBut_Checked = true; - $this.active_id = ele.form.htmlobjId; - //鑷姩婊氬姩鍒版寚瀹氬厓绱�- uni.createSelectorQuery() - .select("#tabpanel")//瀵瑰簲澶栧眰鑺傜偣 - .boundingClientRect((container) => { - uni.createSelectorQuery() - .select("#tabpanel"+ele.form.htmlobjId)//鐩爣鑺傜偣 - .boundingClientRect((target) => { - uni.pageScrollTo({ - scrollTop: target.top - container.top,//婊氬姩鍒板疄闄呰窛绂绘槸鍏冪礌璺濈椤堕儴鐨勮窛绂诲噺鍘绘渶澶栧眰鐩掑瓙鐨勬粴鍔ㄨ窛绂�- }); - }) - .exec(); - }) - .exec(); - } - }); - } - else if(item.action_type == "set_dlg_attr"){ + if(item.action_type == "set_dlg_attr"){ // value = {"attr":"xxx", "value":"xxx"} var data = item.value; $this.$data.head_styledef.form.items.forEach(async (ele,index) => { @@ -1226,25 +1168,38 @@ try { var $this = this; this.$store.dispatch('runCustomEvent',dataInfo).then(ret=>{ - // console.log(ret); + console.log(ret); if (ret.err_code == 0) { var result = ret.result; if (result.ret != 0) { var tip = result.err_info ? typeof result.err_info == 'string' ? result.err_info : result.err_info.join('<br/>') : ''; if (result.ret == 801) uni.showModal({title:'鎻愮ず',content:tip,showCancel:false,confirmText:"鍙栨秷"}); else uni.showModal({title:'鎻愮ず',content:tip+',鎻愮ず:'+result.ret,showCancel:false,confirmText:"鍙栨秷"}); - return false + return false; }else{ var tip = result.info ? typeof result.info == 'string' ? result.info : result.info.join('<br/>') : ''; if (tip) uni.showModal({title:'鎻愮ず',content:tip,showCancel:false,confirmText:"鍙栨秷"}); if(result.result_type == 0 && result.action){ result.action.forEach(item=>{ - // if(item.action_type == "insert_subtable_page_row"){ + if(item.action_type == "goback_to_pre_page"){ //杩斿洖涓婁竴椤�+ var value = item.value; + uni.navigateBack({ + delta:1 ,//杩斿洖灞傛暟锛�鍒欎笂涓婇〉 + }); + } else if(item.action_type == "hidden_button"){ //闅愯棌鎸夐挳 + var value = item.value; + value.forEach(btn => { + var index = $this.param.ListPage.Page_Button.findIndex(button => button.ShowName == btn) + if (index > -1) + $this.param.ListPage.Page_Button.splice(index, 1) + }) + // } else if(item.action_type == "refresh_cur_row"){ // // var value = item.value; - // } - uni.showModal({title:"鎻愮ず",content:"褰撳墠action_type锛�+item.action_type+"鏈鐞�,showCancel:false,confirmText:"鍙栨秷"}); - + + } else{ + uni.showModal({title:"鎻愮ず",content:"褰撳墠action_type锛�+item.action_type+"鏈鐞�,showCancel:false,confirmText:"鍙栨秷"}); + } }); }else{ // this.detail2StyleDefList=[]; -- Gitblit v1.9.1