@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" />
84 lines (81 loc) • 3.03 kB
JavaScript
import { defineComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, toDisplayString, renderSlot, createBlock, unref, withCtx, createVNode, createCommentVNode } from 'vue';
import { ElIcon } from 'element-plus';
import { CopyDocument } from '@element-plus/icons-vue';
import { copyText, messageBox } from '../../../utils/tools.mjs';
const clsfix = "dv-aims-basic-card";
const _sfc_main = /* @__PURE__ */ defineComponent({
__name: "index",
props: {
width: { default: 400 },
height: { default: "" },
title: { default: "" },
subTitie: { default: "" },
canChecked: { type: Boolean, default: false },
checked: { type: Boolean, default: false },
contentClass: { default: "" },
contentStyle: { default: void 0 },
showCopy: { type: Boolean, default: false },
copyStr: { default: "" }
},
emits: ["clickCard"],
setup(__props, { emit: emits }) {
const props = __props;
const onClickCard = () => {
emits("clickCard");
};
const onCopy = () => {
copyText(props.copyStr);
messageBox("复制成功", "success");
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass({
[`${clsfix}-container`]: true,
[`${clsfix}-container-checked`]: _ctx.checked
}),
style: normalizeStyle({
width: typeof _ctx.width === "number" ? `${_ctx.width}px` : _ctx.width,
height: typeof _ctx.height === "number" ? `${_ctx.height}px` : _ctx.height,
cursor: _ctx.canChecked ? "pointer" : void 0
}),
onClick: onClickCard
}, [
createElementVNode("header", {
class: normalizeClass(`${clsfix}-header`)
}, [
createElementVNode("div", {
class: normalizeClass(`${clsfix}-header-left`)
}, [
createElementVNode("span", {
class: normalizeClass(`${clsfix}-header-title`)
}, toDisplayString(_ctx.title), 3),
createElementVNode("span", {
class: normalizeClass(`${clsfix}-header-sub-title`)
}, toDisplayString(_ctx.subTitie), 3),
renderSlot(_ctx.$slots, "headerLeft")
], 2),
createElementVNode("div", null, [
renderSlot(_ctx.$slots, "headerRight"),
_ctx.showCopy ? (openBlock(), createBlock(unref(ElIcon), {
key: 0,
style: { "cursor": "pointer" },
onClick: onCopy
}, {
default: withCtx(() => [
createVNode(unref(CopyDocument))
]),
_: 1
})) : createCommentVNode("", true)
])
], 2),
createElementVNode("div", {
class: normalizeClass([`${clsfix}-content`, _ctx.contentClass]),
style: normalizeStyle(_ctx.contentStyle)
}, [
renderSlot(_ctx.$slots, "default")
], 6)
], 6);
};
}
});
export { _sfc_main as default };