import $ from "jquery"; import { defineComponent } from "vue"; import "./xInfoCard.less"; import { xU } from "../ventoseUtils"; export const InfoCardCol = defineComponent({ props: ["col"], computed: { isHide() { return this.col.isHide || false; }, styleLabel() { return {}; }, vDomLabel() { return this.col.label; }, vDomContent() { return this.col.value; } }, render() { if (this.isHide) { return null; } return ( <>
{this.vDomLabel}
{this.vDomContent}
); } }); export const InfoCardRow = defineComponent({ props: ["row"], computed: { colArray() { return this?.row?.colArray || false; }, vDomCol() { if (this.row) { return xU.map(this.colArray, col => { return ; }); } return null; }, styleRow() { if (this?.row?.style) { return this.row.style; } return ""; } }, render() { return (
{this.vDomCol}
); } }); export const xInfoCard = defineComponent({ props: ["info", "title"], methods: { updateLableStyle(styleObject) { const styleString = xU .map( xU.merge( { "min-width": "120px", "text-align": "right" }, styleObject ), (value, prop) => `${prop}: ${value}` ) .join(";"); const styleContent = `#${this.id} .ant-descriptions-item-label {${styleString}}`; if (!this.$styleEle) { const $form = $(`#${this.id}`); const $style = $("