!function(){functiont(t,e){varr=Object.keys(t);if(Object.getOwnPropertySymbols){varn=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){returnObject.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}returnr}functione(e){for(varr=1;r<arguments.length;r++){varn=null!=arguments[r]?arguments[r]:{};r%2?t(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}returne}functionr(t){returnfunction(t){if(Array.isArray(t))returnn(t)}(t)||function(t){if("undefined"!=typeofSymbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])returnArray.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeoft)returnn(t,e);varr=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)returnArray.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))returnn(t,e)}(t)||function(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}functionn(t,e){(null==e||e>t.length)&&(e=t.length);for(varr=0,n=newArray(e);r<e;r++)n[r]=t[r];returnn}functiono(t){returno="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft},o(t)}functioni(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){returnt};vart={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeofSymbol?Symbol:{},c=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";functionl(t,e,r){returnObject.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(N){l=function(t,e,r){returnt[e]=r}}functionf(t,e,r,o){vari=e&&e.prototypeinstanceofh?e:h,a=Object.create(i.prototype),c=newS(o||[]);returnn(a,"_invoke",{value:j(t,r,c)}),a}functionp(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(N){return{type:"throw",arg:N}}}t.wrap=f;vard={};functionh(){}functionm(){}functionv(){}vary={};l(y,c,(function(){returnthis}));varb=Object.getPrototypeOf,g=b&&b(b(_([])));g&&g!==e&&r.call(g,c)&&(y=g);varw=v.prototype=h.prototype=Object.create(y);functionO(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){returnthis._invoke(e,t)}))}))}functionE(t,e){functioni(n,a,c,s){varu=p(t[n],t,a);if("throw"!==u.type){varl=u.arg,f=l.value;returnf&&"object"==o(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,c,s)}),(function(t){i("throw",t,c,s)})):e.resolve(f).then((function(t){l.value=t,c(l)}),(function(t){returni("throw",t,c,s)}))}s(u.arg)}vara;n(this,"_invoke",{value:function(t,r){functionn(){returnnewe((function(e,n){i(t,r,e,n)}))}returna=a?a.then(n,n):n()}})}functionj(t,e,r){varn="suspendedStart";returnfunction(o,i){if("executing"===n)thrownewError("Generator is already running");if("completed"===n){if("throw"===o)throwi;returnL()}for(r.method=o,r.arg=i;;){vara=r.delegate;if(a){varc=x(a,r);if(c){if(c===d)continue;returnc}}if("next"===r.method)r.sent=r._sent=r.arg;elseif("throw"===r.method){if("suspendedStart"===n)thrown="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";vars=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}functionx(t,e){varr=e.method,n=t.iterator[r];if(void0===n)returne.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=newTypeError("The iterator does not provide a '"+r+"' method")),d;varo=p(n,t.iterator,e.arg);if("throw"===o.type)returne.method="throw",e.arg=o.arg,e.delegate=null,d;vari=o.arg;returni?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void0),e.delegate=null,d):i:(e.method="throw",e.arg=newTypeError("iterator result is not an object"),e.delegate=null,d)}functionP(t){vare={tryLoc:t[0]};1int&&(e.catchLoc=t[1]),2int&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}functionD(t){vare=t.completion||{};e.type="normal",deletee.arg,t.completion=e}functionS(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function_(t){if(t){vare=t[c];if(e)returne.call(t);if("function"==typeoft.next)returnt;if(!isNaN(t.length)){varn=-1,o=functione(){for(;++n<t.length;)if(r.call(t,n))returne.value=t[n],e.done=!1,e;returne.value=void0,e.done=!0,e};returno.next=o}}return{next:L}}functionL(){return{value:void0,done:!0}}returnm.prototype=v,n(w,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:m,configurable:!0}),m.displayName=l(v,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){vare="function"==typeoft&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){returnObject.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},O(E.prototype),l(E.prototype,s,(function(){returnthis})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void0===i&&(i=Promise);vara=newE(f(e,r,n,o),i);returnt.isGeneratorFunction(r)?a:a.next().then((function(t){returnt.done?t.value:a.next()}))},O(w),l(w,u,"Generator"),l(w,c,(function(){returnthis})),l(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){vare=Object(t),r=[];for(varnine)r.push(n);returnr.reverse(),functiont(){for(;r.length;){varn=r.pop();if(nine)returnt.value=n,t.done=!1,t}returnt.done=!0,t}},t.values=_,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void0,this.done=!1,this.delegate=null,this.method="next",this.arg=void0,this.tryEntries.forEach(D),!t)for(vareinthis)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void0)},stop:function(){this.done=!0;vart=this.tryEntries[0].completion;if("throw"===t.type)throwt.arg;returnthis.rval},dispatchException:function(t){if(this.done)throwt;vare=this;functionn(r,n){returna.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void0),!!n}for(varo=this.tryEntries.length-1;o>=0;--o){vari=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)returnn("end");if(i.tryLoc<=this.prev){varc=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)returnn(i.catchLoc,!0);if(this.prev<i.finallyLoc)returnn(i.finallyLoc)}elseif(c){if(this.prev<i.catchLoc)returnn(i.catchLoc,!0)}else{if(!s)thrownewError("try statement without catch or finally");if(this.prev<i.finallyLoc)returnn(i.finallyLoc)}}}},abrupt:function(t,e){for(varn=this.tryEntries.length-1;n>=0;--n){varo=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){vari=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);vara=i?i.completion:{};returna.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throwt.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(vare=this.tryEntries.length-1;e>=0;--e){varr=this.tryEntries[e];if(r.finallyLoc===t)returnthis.complete(r.completion,r.afterLoc),D(r),d}},catch:function(t){for(vare=this.tryEntries.length-1;e>=0;--e){varr=this.tryEntries[e];if(r.tryLoc===t){varn=r.completion;if("throw"===n.type){varo=n.arg;D(r)}returno}}thrownewError("illegal catch attempt")},delegateYield:function(t,e,r){returnthis.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void0),d}},t}functiona(t,e,r,n,o,i,a){try{varc=t[i](a),s=c.value}catch(u){returnvoidr(u)}c.done?e(s):Promise.resolve(s).then(n,o)}functionc(t){returnfunction(){vare=this,r=arguments;returnnewPromise((function(n,o){vari=t.apply(e,r);functionc(t){a(i,n,o,c,s,"next",t)}functions(t){a(i,n,o,c,s,"throw",t)}c(void0)}))}}functions(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functionu(t,e){for(varr=0;r<e.length;r++){varn=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(t,y(n.key),n)}}functionl(t,e,r){returne&&u(t.prototype,e),r&&u(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}functionf(t,e){returnf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){returnt.__proto__=e,t},f(t,e)}functionp(t){vare=function(){if("undefined"==typeofReflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeofProxy)return!0;try{returnBoolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();returnfunction(){varr,n=m(t);if(e){varo=m(this).constructor;r=Reflect.construct(n,arguments,o)}elser=n.apply(this,arguments);returnd(this,r)}}functiond(t,e){if(e&&("object"===o(e)||"function"==typeofe))returne;if(void0!==e)thrownewTypeError("Derived constructors may only return object or undefined");returnh(t)}functionh(t){if(void0===t)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");returnt}functionm(t){returnm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){returnt.__proto__||Object.getPrototypeOf(t)},m(t)}functionv(t,e,r){return(e=y(e))int?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}functiony(t){vare=function(t,e){if("object"!==o(t)||null===t)returnt;varr=t[Symbol.toPrimitive];if(void0!==r){varn=r.call(t,e||"default");if("object"!==o(n))returnn;thrownewTypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===o(e)?e:String(e)}System.register(["@ibiz-template/model","@ibiz-template/vue-util","vue","qx-util","@ibiz-template/runtime","@ibiz-template/controller","@ibiz-template/service"],(function(t,n){"use strict";vara,u,d,m,y,b,g,w,O,E,j,x,P;return{setters:[function(t){a=t.EditFormModel},function(t){u=t.useNamespace,d=t.useControlController,m=t.usePropsWatch},function(t){y=t.defineComponent,b=t.getCurrentInstance,g=t.ref,w=t.watch,O=t.h},function(t){E=t.createUUID},function(t){j=t.ViewMode},function(t){x=t.EditFormController},function(t){P=t.ControlVO}],execute:function(){varD=function(t){!function(t,e){if("function"!=typeofe&&null!==e)thrownewTypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}(n,t);vare,r=p(n);functionn(){vart;s(this,n);for(vare=arguments.length,o=newArray(e),i=0;i<e;i++)o[i]=arguments[i];returnv(h(t=r.call.apply(r,[this].concat(o))),"baseResData",[]),v(h(t),"compareResData",[]),v(h(t),"oldData",newP),v(h(t),"versionData",[]),v(h(t),"comparisonArr",{}),v(h(t),"gridData",[]),v(h(t),"AllGridData",[]),v(h(t),"removeSameGridData",[]),v(h(t),"AlldruipartData",newMap),v(h(t),"druipartDataSize",0),v(h(t),"newDruipartData",{}),t}returnl(n,[{key:"loadGridData",value:(e=c(i().mark((functiont(){vare,r,n,o,a,c,s,u,l;returni().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returnt.next=2,this.startLoading();case2:returne=this.model.source.M.getPSControlParam.ctrlParams,r=e.BASEENTITY,n=e.COMPAREENTITY,t.next=6,ibiz.entityService.getService(r);case6:returno=t.sent,t.next=9,ibiz.entityService.getService(n);case9:returna=t.sent,c=Object.assign({},this.context.clone(),v({},r.toLowerCase(),this.params.base_version)),s=Object.assign({},this.context.clone(),v({},n.toLowerCase(),this.params.compare_version)),t.next=14,o.exec("Get",c,this.params);case14:returnu=t.sent,t.next=17,a.exec("Get",s,this.params);case17:returnl=t.sent,this.isLoaded=!0,t.abrupt("return",{baseData:u.data.data,compareData:l.data.data});case20:case"end":returnt.stop()}}),t,this)}))),function(){returne.apply(this,arguments)})},{key:"isFalseyButNotEmpty",value:function(t){returnnull==t||"string"==typeoft&&""===t||Array.isArray(t)&&0===t.length||"object"===o(t)&&0===Object.keys(t).length}},{key:"compareObjectValues",value:function(t,e){returnJSON.stringify(t)!==JSON.stringify(e)}}]),n}(x),S=y({name:"IBizFormDataComparison",props:{modelData:{type:a,required:!0},context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}},enableAutoSave:{type:Boolean,required:!1}},setup:function(t){varn=u("form-data-comparison"),o=b().proxy,a=d(o,(function(){vare=newD(t.modelData,t.context,t.params);returnm(o,"enableAutoSave",e.setEnableAutoSave.bind(e)),e})),s=g(!1),l=g({}),f=g({}),p=g([]),h=[],v=g([]),y=g([]),x=g([]),P=newMap,S=g(0),_=functiont(e){varn=[];if(n.push(e),e&&e.children){varo=[];e.children.forEach((function(e){varn=t(e);o.push.apply(o,r(n))})),n.push.apply(n,o)}returnn}(t.modelData);h.push.apply(h,r(_));varL=function(t){vare=a.details[t.source.name],r=O("not-supported-editor",{attrs:{modelData:t.editor}});returnO("div",{class:[n.e("form-grid-item"),n.is("add",v.value.includes(t.source.name)),n.is("update",x.value.includes(t.source.name)),n.is("delete",y.value.includes(t.source.name))]},[O("div",{class:n.em("form-grid-item","name")},[t.source.caption]),O("div",{class:n.em("form-grid-item","left")},[e.editorProvider?O(e.editorProvider.formEditor,{props:{value:f.value[t.source.name],data:e.data,controller:e.editor,disabled:e.disabled,readonly:!0}}):r]),O("div",{class:n.em("form-grid-item","right")},[e.editorProvider?O(e.editorProvider.formEditor,{props:{value:l.value[t.source.name],data:e.data,controller:e.editor,disabled:e.disabled,readonly:!0}}):r])])},N=function(t,e){P.set(t.source.id,e),e.evt.on("mounted",(function(){a.startLoading(),S.value+=1,e.call.refresh()})),e.evt.on("refreshed",(function(){S.value-=1,setTimeout((function(){a.endLoading()}),500)}))},T=function(t){vare=p.value.findIndex((function(e){returne===t.source.name}));e>-1?p.value.splice(e,1):p.value.push(t.source.name)},F=function(t,e){varr=[],n=[],o=[];returnObject.keys(e).forEach((function(o){vari=t[o],c=e[o];a.isFalseyButNotEmpty(i)&&!a.isFalseyButNotEmpty(c)&&r.push(o),a.isFalseyButNotEmpty(i)||a.isFalseyButNotEmpty(c)||!a.compareObjectValues(i,c)||n.push(o)})),Object.keys(t).forEach((function(r){if(!Object.prototype.hasOwnProperty.call(e,r)||a.isFalseyButNotEmpty(e[r])){varn=t[r];a.isFalseyButNotEmpty(n)||o.push(r)}})),{added:r,modified:n,deleted:o}};returnw((function(){returnt.params}),c(i().mark((functiont(){vare,r,n,o,c;returni().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returnt.next=2,a.loadGridData();case2:e=t.sent,l.value=e.baseData,f.value=e.compareData,r=F(f.value,l.value),n=r.added,o=r.modified,c=r.deleted,v.value=n,x.value=o,y.value=c;case9:case"end":returnt.stop()}}),t)}))),{immediate:!0}),{ns:n,c:a,switchValue:s,druipartNum:S,renderEditor:L,renderByDetailType:functionr(o){if(!o.source.hidden){if("FORMPAGE"===o.source.detailType)returnO("div",{class:n.e("form-page")},[o.children.map((function(t){returnr(t)}))]);if("FORMITEM"===o.source.detailType){vari=v.value.includes(o.source.name),c=y.value.includes(o.source.name),u=x.value.includes(o.source.name);return!s.value||i||c||u?L(o):null}if("GROUPPANEL"===o.source.detailType){vard=p.value.includes(o.source.name);returnO("div",{class:n.b("group")},[O("div",{class:[n.be("group","header"),n.is("hide-caption",!o.source.showCaption)]},[O("div",{class:n.bem("group","header","name")},[O("i-icon",d?{class:n.bem("group","header","icon"),attrs:{type:"ios-arrow-forward",title:"展开"},on:{click:function(){returnT(o)}}}:{class:n.bem("group","header","icon"),attrs:{type:"ios-arrow-down",title:"收缩"},on:{click:function(){returnT(o)}}}),O("span",{class:n.bem("group","header","name-text")},[o.source.caption||o.source.title])]),O("div",["---"]),O("div",["---"])]),O("div",{class:[n.be("group","content"),n.is("collapse",d)]},[o.children.map((function(t){returnr(t)}))])])}return"DRUIPART"!==o.source.detailType||o.source.name.endsWith("_srfcopy")?"MDCTRL"===o.source.detailType?(b={modelData:m=o,controller:a.details[m.source.name]},g=a.providers[m.source.name],w=O(g.component,{props:e({},b),key:m.id}),P=O(g.component,{props:e({},b),key:"compare_".concat(m.id)}),O("div",{class:n.e("mdctrl")},[O("div",{class:n.em("mdctrl","caption")},[m.source.caption]),O("div",{class:n.em("mdctrl","left")},[w]),O("div",{class:n.em("mdctrl","right")},[P])])):null:function(e){varr=h.find((function(t){returnt.id==="".concat(e.source.id,"_srfcopy")})),o=e.embedView.source.modelPath,i=null==r?void0:r.embedView.source.modelPath,c=a.context.clone(),s={base_version:t.params.base_version},u=a.context.clone();Object.assign(u,{gysrlzy_info:t.params.compare_version,compare_version:t.params.compare_version});varp={compare_version:t.params.compare_version},d=l.value[e.source.userTag],m=f.value[null==r?void0:r.source.userTag],v=!1,y=!1,b=!1;returna.isFalseyButNotEmpty(d)&&!a.isFalseyButNotEmpty(m)?v=!0:!a.isFalseyButNotEmpty(d)&&a.isFalseyButNotEmpty(m)?b=!0:a.isFalseyButNotEmpty(d)||a.isFalseyButNotEmpty(m)||!a.compareObjectValues(d,m)||(y=!0),O("div",{class:[n.e("druipart"),n.is("add",v),n.is("update",y),n.is("delete",b)]},[O("div",{class:n.em("druipart","caption")},[e.source.caption]),O("div",{class:n.em("druipart","left")},[i&&O("ViewShell",{attrs:{context:u,params:p,modal:{mode:j.EMBED},modelPath:i,noLoadDefault:!0},key:E(),on:{neuronInit:function(t){returnN(r,t)}}})]),O("div",{class:n.em("druipart","right")},[o&&O("ViewShell",{attrs:{context:c,params:s,modal:{mode:j.EMBED},modelPath:o,noLoadDefault:!0},key:E(),on:{neuronInit:function(t){returnN(e,t)}}})])])}(o);varm,b,g,w,P}}}},render:function(){vart=this;returnthis.c.complete?O("control-layout",{attrs:{modelData:this.c.model}},[O("div",{class:this.ns.b()},[O("div",{class:this.ns.e("top")},[O("div",{class:this.ns.e("top-hidesame-content")},[O("div",{class:this.ns.e("top-hidesame-content-left")},["隐藏相同项 ",O("i-switch",{model:{value:this.switchValue,callback:function(e){t.switchValue=e}}})]),O("div",{class:this.ns.e("top-hidesame-content-right")},[O("div",{class:this.ns.e("top-hidesame-content-right-item")},["新增",O("div",{class:this.ns.e("top-hidesame-content-right-item-add")})]),O("div",{class:this.ns.e("top-hidesame-content-right-item")},["修改",O("div",{class:this.ns.e("top-hidesame-content-right-item-change")})]),O("div",{class:this.ns.e("top-hidesame-content-right-item")},["删除",O("div",{class:this.ns.e("top-hidesame-content-right-item-delete")})])])]),O("div",{class:this.ns.e("top-content")},[O("div",{class:this.ns.em("top-content","attr")},["信息项"]),O("div",{class:[this.ns.em("top-content","left")]},["更新前内容"]),O("div",{class:[this.ns.em("top-content","right")]},["更新后内容"])])]),O("div",{class:this.ns.e("content")},[this.modelData.children.map((function(e){returnt.renderByDetailType(e)}))])])]):null}}),_=l((functiont(){s(this,t),v(this,"component","IBizFormDataComparison")}));t("default",{mateUrl:n.meta.url,install:function(t){t.component("IBizFormDataComparison",S),ibiz.register.control.register("EDITFORM_RENDER_FORM_DATA_COMPARISON",new_)}})}}}))}();
!function(){functiont(t,e){varr=Object.keys(t);if(Object.getOwnPropertySymbols){varn=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){returnObject.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}returnr}functione(e){for(varr=1;r<arguments.length;r++){varn=null!=arguments[r]?arguments[r]:{};r%2?t(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}returne}functionr(t){returnfunction(t){if(Array.isArray(t))returnn(t)}(t)||function(t){if("undefined"!=typeofSymbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])returnArray.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeoft)returnn(t,e);varr=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)returnArray.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))returnn(t,e)}(t)||function(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}functionn(t,e){(null==e||e>t.length)&&(e=t.length);for(varr=0,n=newArray(e);r<e;r++)n[r]=t[r];returnn}functiono(t){returno="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft},o(t)}functioni(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){returnt};vart={},e=Object.prototype,r=e.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeofSymbol?Symbol:{},c=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",u=a.toStringTag||"@@toStringTag";functionl(t,e,r){returnObject.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(N){l=function(t,e,r){returnt[e]=r}}functionf(t,e,r,o){vari=e&&e.prototypeinstanceofh?e:h,a=Object.create(i.prototype),c=newS(o||[]);returnn(a,"_invoke",{value:j(t,r,c)}),a}functionp(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(N){return{type:"throw",arg:N}}}t.wrap=f;vard={};functionh(){}functionm(){}functionv(){}vary={};l(y,c,(function(){returnthis}));varb=Object.getPrototypeOf,g=b&&b(b(_([])));g&&g!==e&&r.call(g,c)&&(y=g);varw=v.prototype=h.prototype=Object.create(y);functionO(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){returnthis._invoke(e,t)}))}))}functionE(t,e){functioni(n,a,c,s){varu=p(t[n],t,a);if("throw"!==u.type){varl=u.arg,f=l.value;returnf&&"object"==o(f)&&r.call(f,"__await")?e.resolve(f.__await).then((function(t){i("next",t,c,s)}),(function(t){i("throw",t,c,s)})):e.resolve(f).then((function(t){l.value=t,c(l)}),(function(t){returni("throw",t,c,s)}))}s(u.arg)}vara;n(this,"_invoke",{value:function(t,r){functionn(){returnnewe((function(e,n){i(t,r,e,n)}))}returna=a?a.then(n,n):n()}})}functionj(t,e,r){varn="suspendedStart";returnfunction(o,i){if("executing"===n)thrownewError("Generator is already running");if("completed"===n){if("throw"===o)throwi;returnL()}for(r.method=o,r.arg=i;;){vara=r.delegate;if(a){varc=x(a,r);if(c){if(c===d)continue;returnc}}if("next"===r.method)r.sent=r._sent=r.arg;elseif("throw"===r.method){if("suspendedStart"===n)thrown="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";vars=p(t,e,r);if("normal"===s.type){if(n=r.done?"completed":"suspendedYield",s.arg===d)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n="completed",r.method="throw",r.arg=s.arg)}}}functionx(t,e){varr=e.method,n=t.iterator[r];if(void0===n)returne.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void0,x(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=newTypeError("The iterator does not provide a '"+r+"' method")),d;varo=p(n,t.iterator,e.arg);if("throw"===o.type)returne.method="throw",e.arg=o.arg,e.delegate=null,d;vari=o.arg;returni?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void0),e.delegate=null,d):i:(e.method="throw",e.arg=newTypeError("iterator result is not an object"),e.delegate=null,d)}functionP(t){vare={tryLoc:t[0]};1int&&(e.catchLoc=t[1]),2int&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}functionD(t){vare=t.completion||{};e.type="normal",deletee.arg,t.completion=e}functionS(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function_(t){if(t){vare=t[c];if(e)returne.call(t);if("function"==typeoft.next)returnt;if(!isNaN(t.length)){varn=-1,o=functione(){for(;++n<t.length;)if(r.call(t,n))returne.value=t[n],e.done=!1,e;returne.value=void0,e.done=!0,e};returno.next=o}}return{next:L}}functionL(){return{value:void0,done:!0}}returnm.prototype=v,n(w,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:m,configurable:!0}),m.displayName=l(v,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){vare="function"==typeoft&&t.constructor;return!!e&&(e===m||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){returnObject.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,l(t,u,"GeneratorFunction")),t.prototype=Object.create(w),t},t.awrap=function(t){return{__await:t}},O(E.prototype),l(E.prototype,s,(function(){returnthis})),t.AsyncIterator=E,t.async=function(e,r,n,o,i){void0===i&&(i=Promise);vara=newE(f(e,r,n,o),i);returnt.isGeneratorFunction(r)?a:a.next().then((function(t){returnt.done?t.value:a.next()}))},O(w),l(w,u,"Generator"),l(w,c,(function(){returnthis})),l(w,"toString",(function(){return"[object Generator]"})),t.keys=function(t){vare=Object(t),r=[];for(varnine)r.push(n);returnr.reverse(),functiont(){for(;r.length;){varn=r.pop();if(nine)returnt.value=n,t.done=!1,t}returnt.done=!0,t}},t.values=_,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void0,this.done=!1,this.delegate=null,this.method="next",this.arg=void0,this.tryEntries.forEach(D),!t)for(vareinthis)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void0)},stop:function(){this.done=!0;vart=this.tryEntries[0].completion;if("throw"===t.type)throwt.arg;returnthis.rval},dispatchException:function(t){if(this.done)throwt;vare=this;functionn(r,n){returna.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void0),!!n}for(varo=this.tryEntries.length-1;o>=0;--o){vari=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)returnn("end");if(i.tryLoc<=this.prev){varc=r.call(i,"catchLoc"),s=r.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)returnn(i.catchLoc,!0);if(this.prev<i.finallyLoc)returnn(i.finallyLoc)}elseif(c){if(this.prev<i.catchLoc)returnn(i.catchLoc,!0)}else{if(!s)thrownewError("try statement without catch or finally");if(this.prev<i.finallyLoc)returnn(i.finallyLoc)}}}},abrupt:function(t,e){for(varn=this.tryEntries.length-1;n>=0;--n){varo=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){vari=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);vara=i?i.completion:{};returna.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throwt.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(vare=this.tryEntries.length-1;e>=0;--e){varr=this.tryEntries[e];if(r.finallyLoc===t)returnthis.complete(r.completion,r.afterLoc),D(r),d}},catch:function(t){for(vare=this.tryEntries.length-1;e>=0;--e){varr=this.tryEntries[e];if(r.tryLoc===t){varn=r.completion;if("throw"===n.type){varo=n.arg;D(r)}returno}}thrownewError("illegal catch attempt")},delegateYield:function(t,e,r){returnthis.delegate={iterator:_(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void0),d}},t}functiona(t,e,r,n,o,i,a){try{varc=t[i](a),s=c.value}catch(u){returnvoidr(u)}c.done?e(s):Promise.resolve(s).then(n,o)}functionc(t){returnfunction(){vare=this,r=arguments;returnnewPromise((function(n,o){vari=t.apply(e,r);functionc(t){a(i,n,o,c,s,"next",t)}functions(t){a(i,n,o,c,s,"throw",t)}c(void0)}))}}functions(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functionu(t,e){for(varr=0;r<e.length;r++){varn=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(t,y(n.key),n)}}functionl(t,e,r){returne&&u(t.prototype,e),r&&u(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}functionf(t,e){returnf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){returnt.__proto__=e,t},f(t,e)}functionp(t){vare=function(){if("undefined"==typeofReflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeofProxy)return!0;try{returnBoolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();returnfunction(){varr,n=m(t);if(e){varo=m(this).constructor;r=Reflect.construct(n,arguments,o)}elser=n.apply(this,arguments);returnd(this,r)}}functiond(t,e){if(e&&("object"===o(e)||"function"==typeofe))returne;if(void0!==e)thrownewTypeError("Derived constructors may only return object or undefined");returnh(t)}functionh(t){if(void0===t)thrownewReferenceError("this hasn't been initialised - super() hasn't been called");returnt}functionm(t){returnm=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){returnt.__proto__||Object.getPrototypeOf(t)},m(t)}functionv(t,e,r){return(e=y(e))int?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}functiony(t){vare=function(t,e){if("object"!==o(t)||null===t)returnt;varr=t[Symbol.toPrimitive];if(void0!==r){varn=r.call(t,e||"default");if("object"!==o(n))returnn;thrownewTypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"===o(e)?e:String(e)}System.register(["@ibiz-template/model","@ibiz-template/vue-util","vue","qx-util","@ibiz-template/runtime","@ibiz-template/controller","@ibiz-template/service"],(function(t,n){"use strict";vara,u,d,m,y,b,g,w,O,E,j,x,P,D;return{setters:[function(t){a=t.EditFormModel},function(t){u=t.useNamespace,d=t.useControlController,m=t.usePropsWatch},function(t){y=t.defineComponent,b=t.getCurrentInstance,g=t.ref,w=t.watch,O=t.h},function(t){E=t.createUUID},function(t){j=t.ViewMode,x=t.PluginStaticResource},function(t){P=t.EditFormController},function(t){D=t.ControlVO}],execute:function(){varS=function(t){!function(t,e){if("function"!=typeofe&&null!==e)thrownewTypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&f(t,e)}(n,t);vare,r=p(n);functionn(){vart;s(this,n);for(vare=arguments.length,o=newArray(e),i=0;i<e;i++)o[i]=arguments[i];returnv(h(t=r.call.apply(r,[this].concat(o))),"baseResData",[]),v(h(t),"compareResData",[]),v(h(t),"oldData",newD),v(h(t),"versionData",[]),v(h(t),"comparisonArr",{}),v(h(t),"gridData",[]),v(h(t),"AllGridData",[]),v(h(t),"removeSameGridData",[]),v(h(t),"AlldruipartData",newMap),v(h(t),"druipartDataSize",0),v(h(t),"newDruipartData",{}),t}returnl(n,[{key:"loadGridData",value:(e=c(i().mark((functiont(){vare,r,n,o,a,c,s,u,l;returni().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returnt.next=2,this.startLoading();case2:returne=this.model.source.M.getPSControlParam.ctrlParams,r=e.BASEENTITY,n=e.COMPAREENTITY,t.next=6,ibiz.entityService.getService(r);case6:returno=t.sent,t.next=9,ibiz.entityService.getService(n);case9:returna=t.sent,c=Object.assign({},this.context.clone(),v({},r.toLowerCase(),this.params.base_version)),s=Object.assign({},this.context.clone(),v({},n.toLowerCase(),this.params.compare_version)),t.next=14,o.exec("Get",c,this.params);case14:returnu=t.sent,t.next=17,a.exec("Get",s,this.params);case17:returnl=t.sent,this.isLoaded=!0,t.abrupt("return",{baseData:u.data.data,compareData:l.data.data});case20:case"end":returnt.stop()}}),t,this)}))),function(){returne.apply(this,arguments)})},{key:"isFalseyButNotEmpty",value:function(t){returnnull==t||"string"==typeoft&&""===t||Array.isArray(t)&&0===t.length||"object"===o(t)&&0===Object.keys(t).length}},{key:"compareObjectValues",value:function(t,e){returnJSON.stringify(t)!==JSON.stringify(e)}}]),n}(P),_=y({name:"IBizFormDataComparison",props:{modelData:{type:a,required:!0},context:{type:Object,required:!0},params:{type:Object,default:function(){return{}}},enableAutoSave:{type:Boolean,required:!1}},setup:function(t){varn=u("form-data-comparison"),o=b().proxy,a=d(o,(function(){vare=newS(t.modelData,t.context,t.params);returnm(o,"enableAutoSave",e.setEnableAutoSave.bind(e)),e})),s=g(!1),l=g({}),f=g({}),p=g([]),h=[],v=g([]),y=g([]),x=g([]),P=newMap,D=g(0),_=functiont(e){varn=[];if(n.push(e),e&&e.children){varo=[];e.children.forEach((function(e){varn=t(e);o.push.apply(o,r(n))})),n.push.apply(n,o)}returnn}(t.modelData);h.push.apply(h,r(_));varL=function(t){vare=a.details[t.source.name],r=O("not-supported-editor",{attrs:{modelData:t.editor}});returnO("div",{class:[n.e("form-grid-item"),n.is("add",v.value.includes(t.source.name)),n.is("update",x.value.includes(t.source.name)),n.is("delete",y.value.includes(t.source.name))]},[O("div",{class:n.em("form-grid-item","name")},[t.source.caption]),O("div",{class:n.em("form-grid-item","left")},[e.editorProvider?O(e.editorProvider.formEditor,{props:{value:f.value[t.source.name],data:e.data,controller:e.editor,disabled:e.disabled,readonly:!0}}):r]),O("div",{class:n.em("form-grid-item","right")},[e.editorProvider?O(e.editorProvider.formEditor,{props:{value:l.value[t.source.name],data:e.data,controller:e.editor,disabled:e.disabled,readonly:!0}}):r])])},N=function(t,e){P.set(t.source.id,e),e.evt.on("mounted",(function(){a.startLoading(),D.value+=1,e.call.refresh()})),e.evt.on("refreshed",(function(){D.value-=1,setTimeout((function(){a.endLoading()}),500)}))},T=function(t){vare=p.value.findIndex((function(e){returne===t.source.name}));e>-1?p.value.splice(e,1):p.value.push(t.source.name)},F=function(t,e){varr=[],n=[],o=[];returnObject.keys(e).forEach((function(o){vari=t[o],c=e[o];a.isFalseyButNotEmpty(i)&&!a.isFalseyButNotEmpty(c)&&r.push(o),a.isFalseyButNotEmpty(i)||a.isFalseyButNotEmpty(c)||!a.compareObjectValues(i,c)||n.push(o)})),Object.keys(t).forEach((function(r){if(!Object.prototype.hasOwnProperty.call(e,r)||a.isFalseyButNotEmpty(e[r])){varn=t[r];a.isFalseyButNotEmpty(n)||o.push(r)}})),{added:r,modified:n,deleted:o}};returnw((function(){returnt.params}),c(i().mark((functiont(){vare,r,n,o,c;returni().wrap((function(t){for(;;)switch(t.prev=t.next){case0:returnt.next=2,a.loadGridData();case2:e=t.sent,l.value=e.baseData,f.value=e.compareData,r=F(f.value,l.value),n=r.added,o=r.modified,c=r.deleted,v.value=n,x.value=o,y.value=c;case9:case"end":returnt.stop()}}),t)}))),{immediate:!0}),{ns:n,c:a,switchValue:s,druipartNum:D,renderEditor:L,renderByDetailType:functionr(o){if(!o.source.hidden){if("FORMPAGE"===o.source.detailType)returnO("div",{class:n.e("form-page")},[o.children.map((function(t){returnr(t)}))]);if("FORMITEM"===o.source.detailType){vari=v.value.includes(o.source.name),c=y.value.includes(o.source.name),u=x.value.includes(o.source.name);return!s.value||i||c||u?L(o):null}if("GROUPPANEL"===o.source.detailType){vard=p.value.includes(o.source.name);returnO("div",{class:n.b("group")},[O("div",{class:[n.be("group","header"),n.is("hide-caption",!o.source.showCaption)]},[O("div",{class:n.bem("group","header","name")},[O("i-icon",d?{class:n.bem("group","header","icon"),attrs:{type:"ios-arrow-forward",title:"展开"},on:{click:function(){returnT(o)}}}:{class:n.bem("group","header","icon"),attrs:{type:"ios-arrow-down",title:"收缩"},on:{click:function(){returnT(o)}}}),O("span",{class:n.bem("group","header","name-text")},[o.source.caption||o.source.title])]),O("div",["---"]),O("div",["---"])]),O("div",{class:[n.be("group","content"),n.is("collapse",d)]},[o.children.map((function(t){returnr(t)}))])])}return"DRUIPART"!==o.source.detailType||o.source.name.endsWith("_srfcopy")?"MDCTRL"===o.source.detailType?(b={modelData:m=o,controller:a.details[m.source.name]},g=a.providers[m.source.name],w=O(g.component,{props:e({},b),key:m.id}),P=O(g.component,{props:e({},b),key:"compare_".concat(m.id)}),O("div",{class:n.e("mdctrl")},[O("div",{class:n.em("mdctrl","caption")},[m.source.caption]),O("div",{class:n.em("mdctrl","left")},[w]),O("div",{class:n.em("mdctrl","right")},[P])])):null:function(e){varr=h.find((function(t){returnt.id==="".concat(e.source.id,"_srfcopy")})),o=e.embedView.source.modelPath,i=null==r?void0:r.embedView.source.modelPath,c=a.context.clone(),s={base_version:t.params.base_version},u=a.context.clone();Object.assign(u,{gysrlzy_info:t.params.compare_version,compare_version:t.params.compare_version});varp={compare_version:t.params.compare_version},d=l.value[e.source.userTag],m=f.value[null==r?void0:r.source.userTag],v=!1,y=!1,b=!1;returna.isFalseyButNotEmpty(d)&&!a.isFalseyButNotEmpty(m)?v=!0:!a.isFalseyButNotEmpty(d)&&a.isFalseyButNotEmpty(m)?b=!0:a.isFalseyButNotEmpty(d)||a.isFalseyButNotEmpty(m)||!a.compareObjectValues(d,m)||(y=!0),O("div",{class:[n.e("druipart"),n.is("add",v),n.is("update",y),n.is("delete",b)]},[O("div",{class:n.em("druipart","caption")},[e.source.caption]),O("div",{class:n.em("druipart","left")},[i&&O("ViewShell",{attrs:{context:u,params:p,modal:{mode:j.EMBED},modelPath:i,noLoadDefault:!0},key:E(),on:{neuronInit:function(t){returnN(r,t)}}})]),O("div",{class:n.em("druipart","right")},[o&&O("ViewShell",{attrs:{context:c,params:s,modal:{mode:j.EMBED},modelPath:o,noLoadDefault:!0},key:E(),on:{neuronInit:function(t){returnN(e,t)}}})])])}(o);varm,b,g,w,P}}}},render:function(){vart=this;returnthis.c.complete?O("control-layout",{attrs:{modelData:this.c.model}},[O("div",{class:this.ns.b()},[O("div",{class:this.ns.e("top")},[O("div",{class:this.ns.e("top-hidesame-content")},[O("div",{class:this.ns.e("top-hidesame-content-left")},["隐藏相同项 ",O("i-switch",{model:{value:this.switchValue,callback:function(e){t.switchValue=e}}})]),O("div",{class:this.ns.e("top-hidesame-content-right")},[O("div",{class:this.ns.e("top-hidesame-content-right-item")},["新增",O("div",{class:this.ns.e("top-hidesame-content-right-item-add")})]),O("div",{class:this.ns.e("top-hidesame-content-right-item")},["修改",O("div",{class:this.ns.e("top-hidesame-content-right-item-change")})]),O("div",{class:this.ns.e("top-hidesame-content-right-item")},["删除",O("div",{class:this.ns.e("top-hidesame-content-right-item-delete")})])])]),O("div",{class:this.ns.e("top-content")},[O("div",{class:this.ns.em("top-content","attr")},["信息项"]),O("div",{class:[this.ns.em("top-content","left")]},["更新前内容"]),O("div",{class:[this.ns.em("top-content","right")]},["更新后内容"])])]),O("div",{class:this.ns.e("content")},[this.modelData.children.map((function(e){returnt.renderByDetailType(e)}))])])]):null}}),L=l((functiont(){s(this,t),v(this,"component","IBizFormDataComparison")})),N=newx(n.meta.url);t("default",{mateUrl:n.meta.url,install:function(t){N.loadStyle(["/style.css"]),t.component("IBizFormDataComparison",_),ibiz.register.control.register("EDITFORM_RENDER_FORM_DATA_COMPARISON",newL)}})}}}))}();