提交 d7cf8b2a 编写于 作者: lxm1993's avatar lxm1993

feat: 插件升级

上级 36e816a2
......@@ -15,6 +15,6 @@
temp-pub
./src/*
dist
plugins/**/dist
lib
es
\ No newline at end of file
import { defineComponent as f, getCurrentInstance as b, watch as h, h as n } from "vue";
import { useNamespace as C, useController as y } from "@ibiz-template/vue-util";
import { FormMDCtrlModel as v } from "@ibiz-template/model";
import { FormMDCtrlController as D } from "@ibiz-template/controller";
const M = f({
name: "KqbcFormMDCtrl",
props: {
modelData: {
type: v,
required: !0
},
controller: {
type: D,
required: !0
}
},
setup(a) {
const m = C("form-mdctrl"), {
proxy: r
} = b();
y(r, a.controller);
const e = a.controller;
h(() => e.form.isLoaded, (t, o) => {
t !== o && t === !0 && e.loadData();
});
const c = async () => {
var o;
const t = e.form;
if (t) {
const l = (o = t.model.appEntity) == null ? void 0 : o.codeName, d = t.context;
if (l && d) {
const p = {
...d
}, u = await ibiz.entityService.getService(l, p);
if (u && e.data) {
const i = await u.exec("Getkqzgzsc", p, {
...e.data
});
i.ok && i.data && (e.data.gzsc = i.data.gzsc, e.data.bcs = i.data.bcs);
}
}
}
}, s = (t) => (o) => {
e.formNeurons.get(t) || o.evt.on("afterSave", c), e.onNeuronInit(t)(o);
};
return h(() => {
var t;
return (t = e.contentCtrlData) == null ? void 0 : t.length;
}, () => {
c();
}), {
ns: m,
c: e,
onNeuronInit: s
};
},
render() {
const a = () => this.c.contentCtrlData.length > 0 && this.c.contentCtrlData.map((r, e) => {
var t;
let c = null;
const {
form: s
} = this.c.model;
if (s && this.c.providers[s.name] && this.c.model.appEntity) {
const o = Object.assign(this.c.form.context.clone(), {
[(t = this.c.model.appEntity.codeName) == null ? void 0 : t.toLowerCase()]: r[this.c.model.appEntity.keyName]
});
c = n(this.c.providers[s.name].component, {
props: {
modelData: s,
context: o,
params: this.c.form.params,
enableAutoSave: !0
},
on: {
neuronInit: this.onNeuronInit(r.srfkey)
}
});
}
return n("div", {
class: this.ns.b("form-content"),
key: r.srfkey
}, [c, n("div", {
class: this.ns.b("btn")
}, [n("i-button", {
class: this.ns.b("remove-btn"),
attrs: {
type: "text"
},
on: {
click: () => this.c.handleRemove(r, e)
}
}, ["\u5220\u9664"])])]);
}), m = () => n("div", {
class: this.ns.b("main")
}, [[n("div", {
class: this.ns.b("title")
}, [n("span", {
class: this.ns.b("caption")
}, [this.modelData.source.caption]), n("i-button", {
class: this.ns.b("add-btn"),
attrs: {
type: "text"
},
on: {
click: () => this.c.handleAdd()
}
}, ["\u6DFB\u52A0"])]), a()]]);
return n("div", {
class: this.ns.b()
}, [m()]);
}
});
export {
M as KqbcFormMDCtrl,
M as default
};
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e=function(){return r};var r={},n=Object.prototype,o=n.hasOwnProperty,i=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(D){s=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o=e&&e.prototype instanceof v?e:v,a=Object.create(o.prototype),c=new k(n||[]);return i(a,"_invoke",{value:L(t,r,c)}),a}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(D){return{type:"throw",arg:D}}}r.wrap=f;var h={};function v(){}function d(){}function y(){}var m={};s(m,c,(function(){return this}));var g=Object.getPrototypeOf,b=g&&g(g(P([])));b&&b!==n&&o.call(b,c)&&(m=b);var w=y.prototype=v.prototype=Object.create(m);function x(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function O(e,r){function n(i,a,c,u){var l=p(e[i],e,a);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==t(f)&&o.call(f,"__await")?r.resolve(f.__await).then((function(t){n("next",t,c,u)}),(function(t){n("throw",t,c,u)})):r.resolve(f).then((function(t){s.value=t,c(s)}),(function(t){return n("throw",t,c,u)}))}u(l.arg)}var a;i(this,"_invoke",{value:function(t,e){function o(){return new r((function(r,o){n(t,e,r,o)}))}return a=a?a.then(o,o):o()}})}function L(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return N()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===h)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=p(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var o=p(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,h;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,h):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,h)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function S(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function P(t){if(t){var e=t[c];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:N}}function N(){return{value:void 0,done:!0}}return d.prototype=y,i(w,"constructor",{value:y,configurable:!0}),i(y,"constructor",{value:d,configurable:!0}),d.displayName=s(y,l,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===d||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,s(t,l,"GeneratorFunction")),t.prototype=Object.create(w),t},r.awrap=function(t){return{__await:t}},x(O.prototype),s(O.prototype,u,(function(){return this})),r.AsyncIterator=O,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new O(f(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},x(w),s(w,l,"Generator"),s(w,c,(function(){return this})),s(w,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=P,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,h):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.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),h},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;S(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:P(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},r}function r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function n(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach((function(e){o(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function o(e,r,n){return(r=function(e){var r=function(e,r){if("object"!==t(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,r||"default");if("object"!==t(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(e)}(e,"string");return"symbol"===t(r)?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function i(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(l){return void r(l)}c.done?e(u):Promise.resolve(u).then(n,o)}System.register(["vue","@ibiz-template/vue-util","@ibiz-template/model","@ibiz-template/controller"],(function(t,r){"use strict";var a,c,u,l,s,f,p,h;return{setters:[function(t){a=t.defineComponent,c=t.getCurrentInstance,u=t.watch,l=t.h},function(t){s=t.useNamespace,f=t.useController},function(t){p=t.FormMDCtrlModel},function(t){h=t.FormMDCtrlController}],execute:function(){var r=a({name:"KqbcFormMDCtrl",props:{modelData:{type:p,required:!0},controller:{type:h,required:!0}},setup:function(t){var r=s("form-mdctrl"),o=c().proxy;f(o,t.controller);var a=t.controller;u((function(){return a.form.isLoaded}),(function(t,e){t!==e&&!0===t&&a.loadData()}));var l=function(){var t,r=(t=e().mark((function t(){var r,o,i,c,u,l,s;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(r=a.form)){t.next=14;break}if(i=null===(o=r.model.appEntity)||void 0===o?void 0:o.codeName,c=r.context,!i||!c){t.next=14;break}return u=n({},c),t.next=8,ibiz.entityService.getService(i,u);case 8:if(!(l=t.sent)||!a.data){t.next=14;break}return t.next=12,l.exec("Getkqzgzsc",u,n({},a.data));case 12:(s=t.sent).ok&&s.data&&(a.data.gzsc=s.data.gzsc,a.data.bcs=s.data.bcs);case 14:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(n,o){var a=t.apply(e,r);function c(t){i(a,n,o,c,u,"next",t)}function u(t){i(a,n,o,c,u,"throw",t)}c(void 0)}))});return function(){return r.apply(this,arguments)}}();return u((function(){var t;return null===(t=a.contentCtrlData)||void 0===t?void 0:t.length}),(function(){l()})),{ns:r,c:a,onNeuronInit:function(t){return function(e){a.formNeurons.get(t)||e.evt.on("afterSave",l),a.onNeuronInit(t)(e)}}}},render:function(){var t=this;return l("div",{class:this.ns.b()},[l("div",{class:t.ns.b("main")},[[l("div",{class:t.ns.b("title")},[l("span",{class:t.ns.b("caption")},[t.modelData.source.caption]),l("i-button",{class:t.ns.b("add-btn"),attrs:{type:"text"},on:{click:function(){return t.c.handleAdd()}}},["添加"])]),t.c.contentCtrlData.length>0&&t.c.contentCtrlData.map((function(e,r){var n=null,i=t.c.model.form;if(i&&t.c.providers[i.name]&&t.c.model.appEntity){var a,c=Object.assign(t.c.form.context.clone(),o({},null===(a=t.c.model.appEntity.codeName)||void 0===a?void 0:a.toLowerCase(),e[t.c.model.appEntity.keyName]));n=l(t.c.providers[i.name].component,{props:{modelData:i,context:c,params:t.c.form.params,enableAutoSave:!0},on:{neuronInit:t.onNeuronInit(e.srfkey)}})}return l("div",{class:t.ns.b("form-content"),key:e.srfkey},[n,l("div",{class:t.ns.b("btn")},[l("i-button",{class:t.ns.b("remove-btn"),attrs:{type:"text"},on:{click:function(){return t.c.handleRemove(e,r)}}},["删除"])])])}))]])])}});t({KqbcFormMDCtrl:r,default:r})}}}))}();
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册