Files
aiot-platform-ui/apps/web-antd/dist/js/component-container-DYdka2Nx.js
lzh 19d36d1ffb
All checks were successful
Web UI CI/CD / build-and-deploy (push) Successful in 8s
chore: build and deploy web-antd
2026-03-09 13:05:46 +08:00

2 lines
3.2 KiB
JavaScript

import{ay as l,ak as m,an as d,ac as R}from"./bootstrap-CRjSNGHY.js";/* empty css */import"./vuedraggable.umd-C80eNCNV.js";import{c as x}from"./index-CflXhIdF.js";/* empty css *//* empty css */import{_ as k}from"./index.vue_vue_type_script_setup_true_lang-kavj7j0y.js";import{m as T,aa as L,be as z,ad as y,b2 as n,ae as b,ab as i,bf as D,aT as M,ac as v,bp as I,j as r,bJ as p,bL as c,u as o,aR as N}from"../jse/index-index-CMeVxoEG.js";import"./index-Bh-Hd8Ie.js";import"./index-BNS265yo.js";const S={class:"component-wrap absolute -bottom-1 -left-0.5 -right-0.5 block h-full w-full"},V={key:0,class:"component-name"},j={key:1,class:"component-toolbar"},U=T({name:"ComponentContainer",components:x,__name:"component-container",props:{component:{type:Object,required:!0},active:{type:Boolean,default:!1},canMoveUp:{type:Boolean,default:!1},canMoveDown:{type:Boolean,default:!1},showToolbar:{type:Boolean,default:!0}},emits:["move","copy","delete"],setup(t,{emit:h}){const C=t,u=h,$=L(()=>{const e=C.component.property.style;return e?{marginTop:`${e.marginTop||0}px`,marginBottom:`${e.marginBottom||0}px`,marginLeft:`${e.marginLeft||0}px`,marginRight:`${e.marginRight||0}px`,paddingTop:`${e.paddingTop||0}px`,paddingRight:`${e.paddingRight||0}px`,paddingBottom:`${e.paddingBottom||0}px`,paddingLeft:`${e.paddingLeft||0}px`,borderTopLeftRadius:`${e.borderTopLeftRadius||0}px`,borderTopRightRadius:`${e.borderTopRightRadius||0}px`,borderBottomRightRadius:`${e.borderBottomRightRadius||0}px`,borderBottomLeftRadius:`${e.borderBottomLeftRadius||0}px`,overflow:"hidden",background:e.bgType==="color"?e.bgColor:`url(${e.bgImg})`}:{}}),g=e=>{u("move",e)},w=()=>{u("copy")},B=()=>{u("delete")};return(e,a)=>{const s=z("tippy");return n(),y("div",{class:N(["component relative cursor-move",[{active:t.active}]])},[b("div",{style:M($.value)},[(n(),i(D(t.component.id),{property:t.component.property},null,8,["property"]))],4),b("div",S,[t.component.name?(n(),y("div",V,I(t.component.name),1)):v("",!0),t.showToolbar&&t.component.name&&t.active?(n(),y("div",j,[r(o(k),{size:"small"},{default:p(()=>[c((n(),i(o(l),{disabled:!t.canMoveUp,type:"primary",size:"small",onClick:a[0]||(a[0]=m(f=>g(-1),["stop"]))},{default:p(()=>[r(o(d),{icon:"lucide:arrow-up"})]),_:1},8,["disabled"])),[[s,{content:"上移",delay:100,placement:"right",arrow:!0}]]),c((n(),i(o(l),{disabled:!t.canMoveDown,type:"primary",size:"small",onClick:a[1]||(a[1]=m(f=>g(1),["stop"]))},{default:p(()=>[r(o(d),{icon:"lucide:arrow-down"})]),_:1},8,["disabled"])),[[s,{content:"下移",delay:100,placement:"right",arrow:!0}]]),c((n(),i(o(l),{type:"primary",size:"small",onClick:a[2]||(a[2]=m(f=>w(),["stop"]))},{default:p(()=>[r(o(d),{icon:"lucide:copy"})]),_:1})),[[s,{content:"复制",delay:100,placement:"right",arrow:!0}]]),c((n(),i(o(l),{type:"primary",size:"small",onClick:a[3]||(a[3]=m(f=>B(),["stop"]))},{default:p(()=>[r(o(d),{icon:"lucide:trash-2"})]),_:1})),[[s,{content:"删除",delay:100,placement:"right",arrow:!0}]])]),_:1})])):v("",!0)])],2)}}}),Q=R(U,[["__scopeId","data-v-95c113fb"]]);export{Q as default};