ai-form-designer
Version:
vue3+adv的设计器,可视化开发页面表单
82 lines (81 loc) • 2.45 kB
JavaScript
import { defineComponent as h, ref as i, provide as v, onMounted as V, createElementBlock as x, openBlock as y, withDirectives as _, createElementVNode as s, vShow as w, unref as r, createTextVNode as b, createVNode as A } from "vue";
import { p as C, n as E } from "./index-DwcJO-0a.js";
import { a as u } from "./index-BKOQxhUA.js";
const S = { class: "" }, Y = { class: "py-4 my-2 text-center text-gray-400 bg-white" }, B = { style: { "margin-bottom": "12px" } }, q = /* @__PURE__ */ h({
__name: "index",
props: {
tree: { type: Boolean },
modelValue: {},
dataYVal: {}
},
emits: ["update:modelValue"],
setup(p, { emit: m }) {
const g = C.getComponent("select"), l = p, c = E(l, "modelValue", m), d = i(""), n = i([{ id: "", label: "qq", value: "222" }]);
v("tree", l.tree), V(() => {
u.post(
"/dcc/open/dicTypeList",
{
page: 1,
pageSize: 9999
},
{
headers: { "Access-Control-Allow-Origin": "*" }
}
).then(function(t) {
n.value = [], t.data.records.length > 0 && t.data.records.forEach((e) => {
n.value.push({
id: e.id,
value: e.id,
label: e.name
});
});
}).catch(function(t) {
console.log(t);
});
});
function f(t) {
t && u.post(
"/dcc/open/dicDataList",
{
typeId: t,
page: 1,
pageSize: 9999
},
{
headers: { "Access-Control-Allow-Origin": "*" }
}
).then(function(e) {
let o = [];
e.data.records.length > 0 && e.data.records.forEach((a) => {
o.push({
label: a.dictLabel,
value: a.dictValue
});
}), c.value = [...o];
}).catch(function(e) {
console.log(e);
});
}
return (t, e) => {
var o;
return y(), x("div", S, [
_(s("div", Y, " 暂无选项 ", 512), [
[w, !((o = r(c)) != null && o.length)]
]),
s("div", B, [
e[1] || (e[1] = b(" 配置数据源: ")),
A(r(g), {
modelValue: d.value,
"onUpdate:modelValue": e[0] || (e[0] = (a) => d.value = a),
style: { width: "calc(100% - 100px)" },
options: n.value,
onChange: f
}, null, 8, ["modelValue", "options"])
])
]);
};
}
});
export {
q as default
};