UNPKG

@ued_fpi/data-visual

Version:

<br /> <br /> <div style="text-align:center"> <b style="font-size:30px">@ued_fpi/data-visual</b> <p>基于Vite4+TypeScript的Vue3大屏组件库开发框架</p> <img style="display:inline" src="https://img.shields.io/npm/v/@ued_fpi/data-visual" />

121 lines (118 loc) 5.41 kB
import { defineComponent, ref, watch, openBlock, createBlock, Teleport, createVNode, Transition, withCtx, withDirectives, createElementVNode, normalizeStyle, normalizeClass, toDisplayString, renderSlot, createElementBlock, createCommentVNode, vShow } from 'vue'; import getZIndex from './util.mjs'; const _hoisted_1 = /* @__PURE__ */ createElementVNode("g", null, [ /* @__PURE__ */ createElementVNode("path", { d: "M0.292786,0.292786C0.480314,0.105315,0.734622,0,0.999786,0C1.26495,0,1.51926,0.105315,1.70679,0.292786C1.70679,0.292786,5.24279,3.82879,5.24279,3.82879C5.24279,3.82879,8.77879,0.292786,8.77879,0.292786C8.96739,0.110628,9.21999,0.00983396,9.48219,0.0121124C9.74438,0.0143908,9.9952,0.11956,10.1806,0.304968C10.366,0.490376,10.4712,0.741189,10.4735,1.00339C10.4757,1.26558,10.3749,1.51818,10.1928,1.70679C10.1928,1.70679,6.65679,5.24279,6.65679,5.24279C6.65679,5.24279,10.1928,8.77879,10.1928,8.77879C10.3749,8.96739,10.4757,9.21999,10.4735,9.48219C10.4712,9.74438,10.366,9.9952,10.1806,10.1806C9.9952,10.366,9.74438,10.4712,9.48219,10.4735C9.21999,10.4757,8.96739,10.3749,8.77879,10.1928C8.77879,10.1928,5.24279,6.65679,5.24279,6.65679C5.24279,6.65679,1.70679,10.1928,1.70679,10.1928C1.51818,10.3749,1.26558,10.4757,1.00339,10.4735C0.741189,10.4712,0.490376,10.366,0.304968,10.1806C0.11956,9.9952,0.0143908,9.74438,0.0121124,9.48219C0.00983396,9.21999,0.110628,8.96739,0.292786,8.77879C0.292786,8.77879,3.82879,5.24279,3.82879,5.24279C3.82879,5.24279,0.292786,1.70679,0.292786,1.70679C0.105315,1.51926,0,1.26495,0,0.999786C0,0.734622,0.105315,0.480314,0.292786,0.292786C0.292786,0.292786,0.292786,0.292786,0.292786,0.292786C0.292786,0.292786,0.292786,0.292786,0.292786,0.292786Z", "fill-opacity": "1", fill: "currentColor" }) ], -1); const _hoisted_2 = [ _hoisted_1 ]; const clsfix = "dv-aims-basic-dialog"; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "index", props: { // 设置宽度 width: { type: [Number, String], default: 800 }, // 设置高度 height: { type: [Number, String], default: "" }, // 设置标题 title: { type: String, default: "" }, // 是否显示弹窗 visible: { type: Boolean, default: false }, // 是否在关闭弹窗后销毁内容区元素 destroyOnClose: { type: Boolean, default: false } }, emits: ["close"], setup(__props, { emit: emits }) { const props = __props; const zIndex = ref(0); watch(() => props.visible, () => { if (props.visible) zIndex.value = getZIndex(); }, { immediate: true }); const onClickClose = () => { emits("close"); }; return (_ctx, _cache) => { return openBlock(), createBlock(Teleport, { to: "body" }, [ createVNode(Transition, { name: "basicDialogAnimation" }, { default: withCtx(() => [ withDirectives(createElementVNode("div", { style: normalizeStyle({ width: typeof __props.width === "number" ? `${__props.width}px` : __props.width, height: typeof __props.height === "number" ? `${__props.height}px` : __props.height, zIndex: zIndex.value, transform: `translateX(-50%) translateY(160px)` }), class: normalizeClass(`${clsfix}-container`) }, [ createElementVNode("header", { class: normalizeClass(`${clsfix}-header`) }, [ createElementVNode("div", { class: normalizeClass(`${clsfix}-header-left`) }, [ createElementVNode("span", { class: normalizeClass(`${clsfix}-header-title`) }, toDisplayString(__props.title), 3), renderSlot(_ctx.$slots, "headerLeft") ], 2), createElementVNode("div", { class: normalizeClass(`${clsfix}-header-right`) }, [ renderSlot(_ctx.$slots, "headerRight"), (openBlock(), createElementBlock("svg", { class: normalizeClass(`${clsfix}-close`), xmlns: "http://www.w3.org/2000/svg", "xmlns:xlink": "http://www.w3.org/1999/xlink", version: "1.1", width: "10.473535537719727", height: "10.473535537719727", viewBox: "0 0 10.473535537719727 10.473535537719727", fill: "currentColor", onClick: onClickClose }, _hoisted_2, 2)) ], 2) ], 2), __props.destroyOnClose ? (openBlock(), createElementBlock("div", { key: 0, class: normalizeClass(`${clsfix}-content`) }, [ __props.visible ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true) ], 2)) : (openBlock(), createElementBlock("div", { key: 1, class: normalizeClass(`${clsfix}-content`) }, [ renderSlot(_ctx.$slots, "default") ], 2)) ], 6), [ [vShow, __props.visible] ]) ]), _: 3 }) ]); }; } }); export { _sfc_main as default };