提交 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
};
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册