UNPKG

epic-designer-gold

Version:

基于vue3的设计器,可视化开发页面表单

2 lines (1 loc) 2.68 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),m=require("./index-CZ_nc70v.cjs"),p=require("./pluginManager-DWHAX8kP.cjs"),P=require("./index-BoL2PSBk.cjs"),g=["title"],b={class:"epic-attr-input"},k=e.defineComponent({__name:"styleView",setup(v){const{t:r}=P.useLocale(),d=e.inject("designer"),i=e.inject("pageSchema"),u=e.inject("revoke"),s=[{label:r("width"),type:"EInputSize",field:"componentProps.style.width"},{label:r("height"),type:"EInputSize",field:"componentProps.style.height"},{label:"行高",type:"EInputSize",field:"componentProps.style.lineHeight",componentProps:{type:"border",style:{}}},{label:r("backgroundColor"),type:"color-picker",field:"componentProps.style.backgroundColor",componentProps:{type:"color",style:{}}},{label:r("fontColor"),type:"color-picker",field:"componentProps.style.color",componentProps:{type:"color",style:{}}},{label:"边框",type:"input",field:"componentProps.style.border",componentProps:{type:"border",placeholder:"请输入",style:{}}},{label:"字体粗细",type:"input",field:"componentProps.style.fontWeight",componentProps:{type:"border",placeholder:"请输入",style:{}}},{label:"",type:"PaddingMarginControl",field:"componentProps.style"}],c=e.computed(()=>d.state.checkedNode);function y(t){var n;return typeof t.show=="boolean"?t.show:((n=t.show)==null?void 0:n.call(t,{values:c.value}))??!0}function h(t,n,l,o=c.value){typeof l.onChange=="function"&&l.onChange({value:t,values:o,componentStyles:s}),l.changeSync?p.setValueByPath(o,n,t):e.nextTick(()=>{p.setValueByPath(o,n,t)}),u.push(i.schemas,r("editComponentProperties"))}return(t,n)=>{var l;return e.openBlock(),e.createElementBlock("div",{class:"epic-style-view",key:(l=c.value)==null?void 0:l.id},[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,o=>{var a;return e.createElementVNode("div",{key:o.field},[y(o)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["epic-attr-item",o.layout])},[o.label?(e.openBlock(),e.createElementBlock("div",{key:0,class:"epic-attr-label",title:o.label},e.toDisplayString(o.label),9,g)):e.createCommentVNode("",!0),e.createElementVNode("div",b,[e.createVNode(e.unref(m._sfc_main),{componentSchema:{...o,componentProps:{...o.componentProps,...o.field==="componentProps.defaultValue"?(a=c.value)==null?void 0:a.componentProps:{},input:!1,field:void 0,hidden:!1},show:!0,noFormItem:!0},"model-value":e.unref(p.getValueByPath)(o.editData??c.value,o.field),"onUpdate:modelValue":f=>h(f,o.field,o,o.editData)},null,8,["componentSchema","model-value","onUpdate:modelValue"])])],2)):e.createCommentVNode("",!0)])}),64))])}}});exports.default=k;