(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d21b0aa"],{bda3:function(e,t,n){"use strict";n.r(t),n.d(t,"default",(function(){return I}));var o=n("9127"),i=n("3af9"),r=n("b90b"),l=n("2eb5"),a=n("7ee8"),c=n("7a23"),s=n("7595");function d(e){const{focusData:t}=Object(i["fd"])(),n=Object(c["reactive"])({confirmVisible:!1}),l=Object(c["computed"])({get(){return n.confirmVisible&&!!s.value},set(t){n.confirmVisible=t;const{currentInstance:o}=e;o&&(i["R"].fetchOptions(o).confirmVisible=!1)}}),a=Object(c["computed"])(()=>o["F"].ofNullable(e.currentInstance).map(e=>e.element).map(e=>e.properties).map(e=>Object(o["U"])(e.confirmPosition)).orElse(o["H"].BM)),s=Object(c["computed"])(()=>o["F"].ofNullable(e.currentInstance).map(e=>e.element).map(e=>e.properties).map(e=>e.confirm).filter(e=>o["y"].isNotEmpty(e)).orElse(void 0)),d=Object(c["computed"])(()=>o["F"].ofNullable(e.currentInstance).map(e=>e.element).map(e=>e.properties).map(e=>e.enterText).filter(e=>o["y"].isNotEmpty(e)).orElse("确定")),u=Object(c["computed"])(()=>o["F"].ofNullable(e.currentInstance).map(e=>e.element).map(e=>e.properties).map(e=>e.cancelText).filter(e=>o["y"].isNotEmpty(e)).orElse("取消")),p=()=>{v(),r["Y"].info("提示","确定")},b=()=>{v(),r["Y"].info("提示","取消")},v=()=>{l.value=!1};return Object(c["watch"])(()=>{var t,n;return null===(n=null===(t=e.currentInstance)||void 0===t?void 0:t.options)||void 0===n?void 0:n.confirmVisible},n=>{var a,c;const s=e.currentInstance;if(!s)return;const d=t.value;if(d&&i["R"].contains(d,s))return;const u=null===(a=e.currentInstance)||void 0===a?void 0:a.element.properties;if(!u)return;const{confirmType:v,confirm:m}=u;if(!v||!m)return;const f=o["g"][v];if(!f)return;const g=u.enterText||"确定",I=u.cancelText||"取消";if(n)switch(f){case o["g"].MODAL:Object(o["T"])({zIndex:i["e"]+10*((null===(c=e.currentInstance)||void 0===c?void 0:c.level)||1),confirm:m,enterText:g,cancelText:I,teleport:".ui-designer-simulator"}).then(e=>{e?p():b()});break;case o["g"].POPPER:l.value=!0;break;default:return void r["Y"].error("错误","无法识别的提示类型，请联系开发人员提供技术支持")}}),{confirmVisible:l,confirmPosition:a,confirm:s,enterText:d,cancelText:u,confirmCallback:p,cancelCallback:b}}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function u(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,r){function l(e){try{c(o.next(e))}catch(t){r(t)}}function a(e){try{c(o["throw"](e))}catch(t){r(t)}}function c(e){e.done?n(e.value):i(e.value).then(l,a)}c((o=o.apply(e,t||[])).next())}))}function p(e){const t=Object(c["ref"])(""),n=Object(c["ref"])(),l=Object(i["fd"])(),{protocolVersion:a}=l,d=Object(s["b"])(),{onSelectCurrentInstance:p,switchModelWidgetLib:b,removeModelWidgetLib:v}=d,m=Object(c["computed"])(()=>{var t;if(n.value)return n.value;const o=null===(t=e.currentInstance)||void 0===t?void 0:t.children;if(o){const e=o.length;for(let t=0;t<e;t++){const e=o[t];if(i["W"].isModal(e)||i["K"].isDrawer(e)||i["P"].isInnerPopup(e))return{instance:e,index:t}}}}),f=(t,l,a)=>u(this,void 0,void 0,(function*(){var c,d,u,p,b,v;const m=yield Object(s["a"])(l.id);if(!m)return;let f,g;switch(a){case o["I"].dialog:f=t.children.find(i["W"].isModal);break;case o["I"].drawer:f=t.children.find(i["K"].isDrawer);break;case o["I"].inner:f=t.children.find(i["P"].isInnerPopup);break;default:throw new Error("Invalid popup scene.")}f&&(g=f.element.elements.find(e=>e.subtype===i["A"].FOOTER));while(t.children.length>0)i["R"].remove(t,0);const{designerJson:I}=m;if(!I)return r["Y"].warning(Object(o["W"])("警告"),Object(o["W"])("未找到设计数据，弹窗无法进行编辑")),void i["ab"].isError(t);const O=JSON.parse(I),{model:w,type:y}=l;let j,h;switch(a){case o["I"].dialog:j=i["W"].findModalSlotTemplate(O);break;case o["I"].drawer:j=i["K"].findDrawerSlotTemplate(O);break;case o["I"].inner:j=i["P"].findInnerPopupSlotTemplate(O);break}if(!j)return r["Y"].warning(Object(o["W"])("警告"),Object(o["W"])("无效的设计数据视图，绑定失败")),void i["ab"].isError(t);switch(a){case o["I"].dialog:h=i["wb"].rawCreateModalWidgetInstance(t,e.widgetNameGroup,e.widgetTypeGroup,w,o["f"].cast(y),{header:null===(c=j.header)||void 0===c?void 0:c.elements,default:O,footer:(null===g||void 0===g?void 0:g.elements)||(null===(d=j.footer)||void 0===d?void 0:d.elements)}),i["W"].hideFormAndDetailActionBar(h);break;case o["I"].drawer:h=i["wb"].rawCreateDrawerWidgetInstance(t,e.widgetNameGroup,e.widgetTypeGroup,w,o["f"].cast(y),{header:null===(u=j.header)||void 0===u?void 0:u.elements,default:O,footer:(null===g||void 0===g?void 0:g.elements)||(null===(p=j.footer)||void 0===p?void 0:p.elements)}),i["K"].hideFormAndDetailActionBar(h);break;case o["I"].inner:h=i["wb"].rawCreateInnerPopupWidgetInstance(t,e.widgetNameGroup,e.widgetTypeGroup,w,o["f"].cast(y),{header:null===(b=j.header)||void 0===b?void 0:b.elements,default:O,footer:(null===g||void 0===g?void 0:g.elements)||(null===(v=j.footer)||void 0===v?void 0:v.elements)}),i["P"].hideFormAndDetailActionBar(h);break;default:throw new Error("Invalid popup scene.")}f&&(h.element.properties=f.element.properties),h.element.isVirtual=!1,n.value={instance:h,index:0},i["R"].add(t,h),i["ab"].isReady(t),i["ab"].disableDesign(h)}));return Object(c["watch"])(()=>{var t,n,o,i,r;const l=e.currentInstance;if(!l)return;const a={name:null===(t=l.metadata)||void 0===t?void 0:t.name,target:null===(n=l.metadata)||void 0===n?void 0:n.target,popupSettingType:(null===(o=l.metadata)||void 0===o?void 0:o.popupSettingType)||(null===(i=l.metadata)||void 0===i?void 0:i.dialogSettingType),viewType:null===(r=l.metadata)||void 0===r?void 0:r.viewType};return Object.values(a).filter(e=>!!e).length?a:void 0},t=>{var n;if(!t)return;const r=e.currentInstance;if(!r)return;const l=i["W"].isAllowHasModal(r),a=i["K"].isAllowHasDrawer(r),c=i["P"].isAllowHasInnerPopup(r);if(!l&&!a&&!c){while(r.children.length>0)i["R"].remove(r,0);return}const s=r.element;if((null===(n=s.widget)||void 0===n?void 0:n.widgetSubtype)===i["A"].VIEW_ACTION_TYPE){const e=r.metadata||{},{target:t,popupSettingType:n,dialogSettingType:l,view:a}=e,c=n||l;if(!a||c!==i["bb"].BINDING)return;let s;switch(t){case o["M"].Dialog:s=o["I"].dialog;break;case o["M"].Drawer:s=o["I"].drawer;break;case o["M"].Inner:s=o["I"].inner;break}if(!s)throw new Error("Invalid popup scene.");f(r,a,s)}},{immediate:!0}),Object(c["watch"])(()=>{var t,n;return null===(n=null===(t=e.currentInstance)||void 0===t?void 0:t.options)||void 0===n?void 0:n.popupVisible},t=>{var n,o,l,a,c,s,d;const u=e.currentInstance;if(!u)return;const m=i["W"].isAllowHasModal(u),f=i["K"].isAllowHasDrawer(u),g=i["P"].isAllowHasInnerPopup(u);if(!m&&!f&&!g)return;const{element:I,metadata:O}=u;if(!I)return;const w=null===(n=I.widget)||void 0===n?void 0:n.widgetSubtype;let y;switch(w){case i["A"].VIEW_ACTION_TYPE:{if(!O)return;const{popupSettingType:e,dialogSettingType:t,dialogModel:n,view:r,copiedView:a}=O,c=e||t;if(!c)return;switch(c){case i["bb"].BINDING:y=null===(o=r)||void 0===o?void 0:o.model;break;case i["bb"].COPY:y=null===(l=a)||void 0===l?void 0:l.model;break;case i["bb"].CREATE:y=null===n||void 0===n?void 0:n.model;break}break}case i["A"].CLIENT_VIEW_ACTION_TYPE:case i["A"].CLIENT_FUNCTION_ACTION_TYPE:(m||f)&&(y=I.model);break;default:throw new Error("Invalid subtype. value = "+w)}if(y)if(t)b(y);else{v(y);const t=e.currentInstance,n=e.currentSelected;if(r["t"].equals(null===t||void 0===t?void 0:t.id,null===n||void 0===n?void 0:n.id))return;if(!t||!n)return;let o=!0,l=Object(i["qc"])(n,e=>i["W"].isModal(e)||i["K"].isDrawer(e)||i["P"].isInnerPopup(e),e=>e.root);if((null===(c=null===(a=null===l||void 0===l?void 0:l.root)||void 0===a?void 0:a.options)||void 0===c?void 0:c.popupVisible)&&(o=!1),!o)return;let u,b=e.currentInstance;l=t;do{if(l=Object(i["qc"])(l,e=>i["W"].isModal(e)||i["K"].isDrawer(e)||i["P"].isInnerPopup(e),e=>e.root),null===(d=null===(s=null===l||void 0===l?void 0:l.root)||void 0===s?void 0:s.options)||void 0===d?void 0:d.popupVisible){b=null===l||void 0===l?void 0:l.root,u=void 0;break}if(!l)break;u=l}while(l);u&&(b=u.root);while(b&&Object(i["zc"])(b))b=b.parent;r["t"].equals(null===n||void 0===n?void 0:n.id,null===b||void 0===b?void 0:b.id)||p(b)}}),Object(i["jd"])(Object.assign(Object.assign({},l),{protocolVersion:Object(c["computed"])(()=>t.value||a.value)})),{popup:m}}const b={type:o["e"].primary},v={type:o["e"].link,normalMaskStyle:Object.assign(Object.assign({},i["Rb"]),{borderWidth:"8px",borderRadius:"4px",top:"0px",left:"0px"}),toolbarStyle:{top:"0px",right:"0px"}},m=Object.assign({},v),f=Object.assign(Object.assign({},v),{toolbarStyle:{top:"0px",right:"0px"}});function g(e,t,n,o){var l,a,s;const d=!!(null===(l=null===e||void 0===e?void 0:e.children)||void 0===l?void 0:l.some(e=>i["W"].isModal(e))),u=!!(null===(a=null===e||void 0===e?void 0:e.children)||void 0===a?void 0:a.some(e=>i["K"].isDrawer(e))),p=!!(null===(s=null===e||void 0===e?void 0:e.children)||void 0===s?void 0:s.some(e=>i["P"].isInnerPopup(e)));if(d||u||p){let e=t,i="oinone-icon-dianjifangkuang";return u?(e=n,i="oinone-dianjichouti"):p&&(e=o,i="oinone-dianjichouti"),[Object(c["createVNode"])("div",{class:"designer-draggable-toolbar-options",onClick:e},[Object(c["createVNode"])(r["Q"],{icon:i,color:"rgba(0, 0, 0, 0.65)"})])]}return[]}var I=Object(c["defineComponent"])({name:"DesignerMobileButton",mixins:[i["u"]],components:{DesignerDraggableMask:i["x"],DesignerDraggableItem:i["w"],OioButton:r["w"],OioPopconfirm:r["bb"]},props:Object.assign(Object.assign({},i["v"]),{isSelectItem:{type:Boolean,default:!1}}),setup(e){const{currentSelectedInstance:t}=Object(i["qd"])(),{confirmVisible:n,confirmPosition:r,confirm:s,enterText:u,cancelText:I,confirmCallback:O,cancelCallback:w}=d(e),{onSelectInstance:y,focusData:j}=Object(i["fd"])();let h;const N=j.value,T=e.currentInstance;N&&T&&i["R"].contains(N,T)||(h=p(e).popup);const S=()=>{var t,n,r;const l=e.currentInstance;if(!l)return;const a=i["R"].fetchOptions(l);let s;a.title=o["f"].cast(Object(c["computed"])(()=>{var t,n;return E.value||(null===(n=null===(t=e.currentInstance)||void 0===t?void 0:t.currentWidget)||void 0===n?void 0:n.widgetDisplayName)||Object(o["W"])("动作")})),a.normalStyle=o["f"].cast(Object(c["computed"])(()=>k.value.normalStyle)),a.hoverStyle=o["f"].cast(Object(c["computed"])(()=>k.value.hoverStyle)),a.selectedStyle=o["f"].cast(Object(c["computed"])(()=>k.value.selectedStyle)),a.validatorErrorStyle=o["f"].cast(Object(c["computed"])(()=>k.value.validatorErrorStyle)),a.normalMaskStyle=o["f"].cast(Object(c["computed"])(()=>k.value.normalMaskStyle)),a.hoverMaskStyle=o["f"].cast(Object(c["computed"])(()=>k.value.hoverMaskStyle)),a.selectedMaskStyle=o["f"].cast(Object(c["computed"])(()=>k.value.selectedMaskStyle)),a.validatorErrorMaskStyle=o["f"].cast(Object(c["computed"])(()=>k.value.validatorErrorMaskStyle)),a.toolbarStyle=o["f"].cast(Object(c["computed"])(()=>k.value.toolbarStyle||Object.assign(Object.assign({},i["Sb"]),{right:0}))),s=e.isSelectItem?{toolbarAllowOptions:[i["hb"].custom,i["hb"].remove],toolbarExtendNode:Object(c["computed"])(()=>g(l,V,M,W))}:{toolbarAllowOptions:[i["hb"].selector,i["hb"].custom,i["hb"].remove],toolbarExtendNode:Object(c["computed"])(()=>g(l,V,M,W))},a.toolbarComponentData=Object.assign(Object.assign({},a.toolbarComponentData||{}),s),a.confirmVisible=!1;const d=l.element.title,u=i["R"].fetchExtendData(l);u.label=d;const p=i["R"].fetchDefaultProperties(l);p.label=d;const b=null===(n=null===(t=l.element)||void 0===t?void 0:t.widgetData)||void 0===n?void 0:n.name;b===o["v"].$$internal_DialogSubmit?p.type=o["e"].primary.toUpperCase():(null===(r=l.element.widget)||void 0===r?void 0:r.widgetSubtype)===i["A"].CLIENT_ACTION_TYPE&&(p.type=o["e"].default.toUpperCase())};Object(i["md"])(S);const k=Object(c["computed"])(()=>{var t;if(e.isSelectItem)return m;const n=null===(t=e.currentInstance)||void 0===t?void 0:t.parent;if(n){let e;if(i["R"].consumerInstance(n,t=>{const{bizType:n,subtype:o}=t.element;n===i["B"].ELEMENT&&o===i["A"].CARD&&(e=Object.assign({},f))}),e)return e}return o["F"].ofNullable(e.currentInstance).map(e=>{var t,n;return null===(n=null===(t=null===e||void 0===e?void 0:e.parent)||void 0===t?void 0:t.element)||void 0===n?void 0:n.subtype}).filter(e=>[i["A"].ROW_ACTIONS,i["A"].ROW_ACTIONS_WIDGET].includes(e)).map(t=>0===e.currentIndex?Object.assign(Object.assign({},v),{toolbarStyle:{top:"-8px",left:"0px"}}):v).orElseGet(()=>o["F"].ofNullable(e.currentInstance).map(e=>i["R"].fetchProperties(e)).map(e=>e.type).map(e=>e.toLowerCase()).map(e=>Object.assign(Object.assign({},b),{type:e})).orElse(b))}),x=Object(c["computed"])(()=>o["F"].ofNullable(e.currentInstance).map(e=>i["R"].fetchProperties(e)).map(e=>e.bizStyle).map(e=>e.toLowerCase()).orElse(o["d"].default)),E=Object(c["computed"])(()=>o["F"].ofNullable(e.currentInstance).map(e=>i["R"].fetchProperties(e)).map(e=>{const{label:t,displayName:n}=e;return Object(l["a"])(t)?n:t}).orElseGet(()=>o["F"].ofNullable(e.currentInstance).map(e=>i["R"].fetchExtendData(e)).map(e=>e.label).orElseGet(()=>o["F"].ofNullable(e.currentInstance).filter(e=>!e.element.initialization).map(e=>e.currentWidget).map(e=>e.widgetDisplayName||e.widgetName).filter(e=>!Object(a["a"])(e)).orElse("")))),P=Object(c["computed"])(()=>{var t;return null===(t=e.currentInstance)||void 0===t?void 0:t.element.properties.icon}),C=Object(c["computed"])(()=>o["F"].ofNullable(e.currentInstance).map(e=>i["R"].fetchProperties(e)).map(e=>o["c"].toBoolean(e.invisible)).orElse(void 0)),D=Object(c["computed"])(()=>o["F"].ofNullable(e.currentInstance).map(e=>e.level).map(e=>10*e+1).orElse(0)),A=Object(c["computed"])(()=>{var t;return{zIndex:""+(i["e"]+10*((null===(t=e.currentInstance)||void 0===t?void 0:t.level)||1))}}),V=()=>{o["F"].ofNullable(e.currentInstance).filter(e=>i["W"].isAllowHasModal(e)).map(e=>e.options).ifPresent(e=>{e.popupVisible=!0})},M=()=>{o["F"].ofNullable(e.currentInstance).filter(e=>i["K"].isAllowHasDrawer(e)).map(e=>e.options).ifPresent(e=>{e.popupVisible=!0})},W=()=>{o["F"].ofNullable(e.currentInstance).filter(e=>i["P"].isAllowHasInnerPopup(e)).map(e=>e.options).ifPresent(e=>{e.popupVisible=!0})};let R=!1;const F=e=>{R?R=!1:n.value=e},G=n=>{var i,r,l,a;o["y"].equals(null===(i=e.currentInstance)||void 0===i?void 0:i.id,null===(r=t.value)||void 0===r?void 0:r.id)||y({event:n,selectedInstance:e.currentInstance,selectedIndex:e.currentIndex}),null===(l=n.stopPropagation)||void 0===l||l.call(n),null===(a=n.preventDefault)||void 0===a||a.call(n),R=!0};return Object(c["watch"])(()=>{var t,n;return null===(n=null===(t=e.currentInstance)||void 0===t?void 0:t.element.widgetData)||void 0===n?void 0:n.displayName},t=>{const{currentInstance:n}=e;n&&(i["R"].fetchDefaultProperties(n).label=t)}),{confirmVisible:n,buttonStyle:k,bizStyle:x,displayName:E,icon:P,invisible:C,zIndex:D,overlayStyle:A,onClick:G,confirmPosition:r,confirm:s,enterText:u,cancelText:I,confirmCallback:O,cancelCallback:w,onUpdateConfirmVisible:F,popup:h}},render(){const{currentInstance:e,widgetCategoryGroup:t,widgetNameGroup:n,widgetTypeGroup:o,confirmVisible:l,buttonStyle:a,bizStyle:s,displayName:d,icon:u,zIndex:p,overlayStyle:b,onClick:v,confirmPosition:m,confirm:f,enterText:g,cancelText:I,confirmCallback:O,cancelCallback:w,onUpdateConfirmVisible:y,popup:j}=this;if(!e)return[];const h=[Object(c["createVNode"])(r["bb"],{teleport:".ui-designer-simulator",visible:l,placement:m,overlayStyle:b,text:f,enterText:g,cancelText:I,confirmCallback:O,cancelCallback:w,"onUpdate:visible":y},{default:()=>[Object(c["createVNode"])(i["x"],{zIndex:p,disabled:!0,onClick:v},{default:()=>{let e;return d&&(e=Object(c["createVNode"])("span",{class:"designer-button-content"},d)),[Object(c["createVNode"])(r["w"],{class:[this.invisible?"designer-button-invisible":""],type:a.type,bizStyle:s,icon:u},()=>e?[e]:[])]}})]})];if(j){const{instance:e,index:r}=j;h.push(Object(c["createVNode"])(i["w"],{key:e.id,currentInstance:e,currentIndex:r,widgetCategoryGroup:t,widgetNameGroup:n,widgetTypeGroup:o,invisibleToolbar:!0}))}return Object(c["createVNode"])("div",{id:Object(i["jc"])(e.id),class:"mobile-designer-button"},h)}});I.__file="src/view/component/designer-draggable/component/element/button/DesignerButton.vue"}}]);