ai-form-designer
Version:
vue3+adv的设计器,可视化开发页面表单
67 lines (66 loc) • 2.1 kB
JavaScript
import { defineComponent as x, inject as I, useAttrs as y, computed as C, createBlock as N, openBlock as w, unref as l, withCtx as p, createVNode as d, mergeProps as i, createTextVNode as R } from "vue";
import { InputGroup as j, Input as k, Button as A } from "ant-design-vue";
import { a as B } from "./index-BKOQxhUA.js";
const S = /* @__PURE__ */ x({
__name: "document-number",
props: {
componentSchema: {
type: Object,
default: () => {
}
}
},
emits: ["update:modelValue"],
setup(g, { emit: f }) {
const h = I("pageManager", {}), V = g, c = y(), u = f;
function _(t = null) {
u("update:modelValue", t);
}
const s = C(() => ({
...c,
value: c.modelValue,
"onUpdate:modelValue": _
}));
function b() {
const t = V.componentSchema.componentProps.numberRule;
console.log("numberRule===>", t);
const o = [];
for (let e = 0; e < t.length; e++) {
const r = t[e], n = r.rule, v = r.separator, a = h.componentInstances.value;
console.log("rule===>", n), console.log("componentInstances===>", a), console.log("componentInstances[rule]===>", a[n]);
const m = a[n] ? a[n].getValue().value : n;
console.log("value===>", m), o.push(m), o.push(v);
}
B.get(
"/dcc/open/isoNum/getLatestNum/" + o.join(""),
{
headers: { "Access-Control-Allow-Origin": "*" }
}
).then(function(e) {
console.log(e.data.data), e.data.data && u("update:modelValue", e.data.data);
}).catch(function(e) {
console.log(e);
});
}
return (t, o) => (w(), N(l(j), { compact: "" }, {
default: p(() => [
d(l(k), i(s.value, { style: { width: "calc(100% - 65px)" } }), null, 16),
d(l(A), i(s.value, {
type: "primary",
onClick: b,
style: { "min-width": "65px" }
}), {
default: p(() => o[0] || (o[0] = [
R("生成")
])),
_: 1,
__: [0]
}, 16)
]),
_: 1
}));
}
});
export {
S as default
};