UNPKG

@wocwin/t-ui-plus

Version:

Page level components developed based on Element Plus.

140 lines (137 loc) 5.32 kB
import { defineComponent, useSlots, getCurrentInstance, ref, onMounted, createElementBlock, openBlock, createCommentVNode, createVNode, renderSlot, normalizeStyle, createElementVNode, withCtx, createBlock, mergeProps, createSlots, renderList, unref, normalizeProps, guardReactiveProps, normalizeClass } from 'vue'; import '../../layout-page/src/index.vue.mjs'; import '../../layout-page-item/src/index.vue.mjs'; import '../../table/src/index.vue.mjs'; import '../../query-condition/src/index.vue.mjs'; import _sfc_main$1 from '../../layout-page/src/index.vue2.mjs'; import _sfc_main$2 from '../../layout-page-item/src/index.vue2.mjs'; import _sfc_main$3 from '../../query-condition/src/index.vue2.mjs'; import _sfc_main$4 from '../../table/src/index.vue2.mjs'; const _hoisted_1 = { class: "t_adaptive_page" }; const _hoisted_2 = { class: "left_tree" }; var _sfc_main = /* @__PURE__ */ defineComponent({ ...{ name: "TAdaptivePage" }, __name: "index", props: { leftWidth: { default: 260 }, pageStyle: { default: () => ({}) }, columnSetting: { type: Boolean, default: false }, name: { default: "" }, queryPageStyle: { default: () => ({}) }, tablePageStyle: { default: () => ({}) }, isTTableSelfFilling: { type: Boolean, default: false } }, setup(__props, { expose: __expose }) { const slots = useSlots(); const isShow = (name) => { return Object.keys(slots).includes(name); }; const instance = getCurrentInstance(); const TQueryConditionPage = ref(null); const TTablePage = ref(null); onMounted(() => { var _a, _b; const exposedObj = { ...(_a = TQueryConditionPage.value) == null ? void 0 : _a.$.exposed, ...(_b = TTablePage.value) == null ? void 0 : _b.$.exposed }; const entries = Object.entries(exposedObj); for (const [key, value] of entries) { instance.exposed[key] = value; } }); __expose({ ...instance.exposed, TQueryConditionPage, TTablePage }); return (_ctx, _cache) => { return openBlock(), createElementBlock("div", _hoisted_1, [ isShow("leftContent") ? (openBlock(), createElementBlock( "div", { key: 0, style: normalizeStyle({ width: isShow("leftContent") ? `${_ctx.leftWidth}px` : "0px" }), class: "left_content" }, [ createElementVNode("div", _hoisted_2, [ renderSlot(_ctx.$slots, "leftContent") ]) ], 4 /* STYLE */ )) : createCommentVNode("v-if", true), createVNode(_sfc_main$1, { class: "right_content", style: normalizeStyle(_ctx.pageStyle) }, { default: withCtx(() => [ _ctx.$attrs.opts ? (openBlock(), createBlock(_sfc_main$2, { key: 0, class: "table_search", style: normalizeStyle(_ctx.queryPageStyle) }, { default: withCtx(() => [ createVNode( _sfc_main$3, mergeProps(_ctx.$attrs, { ref_key: "TQueryConditionPage", ref: TQueryConditionPage }), createSlots({ _: 2 /* DYNAMIC */ }, [ renderList(unref(slots), (_index, name) => { return { name, fn: withCtx((data) => [ renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(data))) ]) }; }) ]), 1040 /* FULL_PROPS, DYNAMIC_SLOTS */ ) ]), _: 3 /* FORWARDED */ }, 8, ["style"])) : createCommentVNode("v-if", true), renderSlot(_ctx.$slots, "content"), createVNode(_sfc_main$2, { class: normalizeClass(["table_main", { "t_table_self-filling": _ctx.isTTableSelfFilling }]), style: normalizeStyle(_ctx.tablePageStyle) }, { default: withCtx(() => [ createVNode(_sfc_main$4, mergeProps({ columnSetting: _ctx.columnSetting, name: _ctx.name, ..._ctx.$attrs }, { isSlotToolbar: isShow("toolbar"), isSlotTitle: isShow("title"), ref_key: "TTablePage", ref: TTablePage }), createSlots({ _: 2 /* DYNAMIC */ }, [ renderList(unref(slots), (_index, name) => { return { name, fn: withCtx((data) => [ renderSlot(_ctx.$slots, name, normalizeProps(guardReactiveProps(data))) ]) }; }) ]), 1040, ["isSlotToolbar", "isSlotTitle"]) ]), _: 3 /* FORWARDED */ }, 8, ["class", "style"]) ]), _: 3 /* FORWARDED */ }, 8, ["style"]), renderSlot(_ctx.$slots, "footer") ]); }; } }); export { _sfc_main as default };