UNPKG

ai-form-designer

Version:

vue3+adv的设计器,可视化开发页面表单

2 lines (1 loc) 1.71 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-Dv7gCSaY.cjs"),s=require("./index-Bb4SNRPt.cjs"),m={class:""},v={class:"py-4 my-2 text-center text-gray-400 bg-white"},V={style:{"margin-bottom":"12px"}},x=e.defineComponent({__name:"index",props:{tree:{type:Boolean},modelValue:{},dataYVal:{}},emits:["update:modelValue"],setup(u,{emit:p}){const g=i.pluginManager.getComponent("select"),d=u,h=p,c=i.useVModel(d,"modelValue",h),r=e.ref(""),l=e.ref([{id:1,label:"qq",value:"222"}]);e.provide("tree",d.tree),e.onMounted(()=>{s.axios.post("/dcc/open/treeTypeList",{},{headers:{"Access-Control-Allow-Origin":"*"}}).then(function(o){console.log(o.data.records),l.value=[],o.data.records.length>0&&o.data.records.forEach(t=>{l.value.push({id:t.id,value:t.id,label:t.name})})}).catch(function(o){console.log(o)})});function f(o){console.log(o),o&&s.axios.post("/dcc/open/treeDataList",{treeTypeId:o},{headers:{"Access-Control-Allow-Origin":"*"}}).then(function(t){console.log(t.data.data);let a=[];t.data.data.length>0&&t.data.data.forEach(n=>{a.push({label:n.label,value:n.value,children:n.children})}),c.value=[...a]}).catch(function(t){console.log(t)})}return(o,t)=>{var a;return e.openBlock(),e.createElementBlock("div",m,[e.withDirectives(e.createElementVNode("div",v," 暂无选项 ",512),[[e.vShow,!((a=e.unref(c))!=null&&a.length)]]),e.createElementVNode("div",V,[t[1]||(t[1]=e.createTextVNode(" 配置数据源: ")),e.createVNode(e.unref(g),{modelValue:r.value,"onUpdate:modelValue":t[0]||(t[0]=n=>r.value=n),style:{width:"calc(100% - 100px)"},options:l.value,onChange:f},null,8,["modelValue","options"])])])}}});exports.default=x;