UNPKG

yanzhen-design-vue

Version:

53 lines (52 loc) 2.73 kB
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, createBlock, mergeProps, isRef, resolveDynamicComponent, createCommentVNode } from "vue"; import { useVModel } from "@vueuse/core"; import "./other-table.vue.mjs"; import "./other-table-select.vue.mjs"; import { otherTablesName, otherTablesProps, otherTablesEmits, otherTablesOptions } from "./other-tables.mjs"; import "./hooks/index.mjs"; import { OTHER_TABLES_RELEVANCE, OTHER_TABLES_USE_ORIGIN_COMPONENT } from "./constants/common.mjs"; import { useOtherTablesConfig } from "./hooks/use-other-table-config.mjs"; import _sfc_main$1 from "./other-table-select.vue2.mjs"; import _sfc_main$2 from "./other-table.vue2.mjs"; const _sfc_main = /* @__PURE__ */ defineComponent({ ...{ name: otherTablesName }, __name: "other-tables", props: otherTablesProps, emits: otherTablesEmits, setup(__props, { emit: __emit }) { const { ns } = otherTablesOptions; const config = useOtherTablesConfig(); const props = __props; const emit = __emit; const _modelValue = useVModel(props, "value", emit); const Attributes = computed(() => props); const isCx1AndTc = computed(() => { switch (String(props.relBizObjectStorageMode)) { case OTHER_TABLES_RELEVANCE.TC: case OTHER_TABLES_RELEVANCE.CX1: return true; } return false; }); const useCx1Select = computed(() => { return OTHER_TABLES_RELEVANCE.CX1 === String(props.relBizObjectStorageMode) && props.sourceBizObjectModelCode === props.relBizObjectModelCode && !OTHER_TABLES_USE_ORIGIN_COMPONENT.includes(String(props.relBizObjectColumnBizType)); }); return (_ctx, _cache) => { var _a; return openBlock(), createElementBlock("div", { class: normalizeClass([unref(ns).b()]) }, [ useCx1Select.value ? (openBlock(), createBlock(_sfc_main$1, mergeProps({ key: 0 }, props, { value: unref(_modelValue), "onUpdate:value": _cache[0] || (_cache[0] = ($event) => isRef(_modelValue) ? _modelValue.value = $event : null) }), null, 16, ["value"])) : isCx1AndTc.value ? (openBlock(), createBlock(_sfc_main$2, mergeProps({ key: 1 }, props, { value: unref(_modelValue), "onUpdate:value": _cache[1] || (_cache[1] = ($event) => isRef(_modelValue) ? _modelValue.value = $event : null) }), null, 16, ["value"])) : ((_a = unref(config)) == null ? void 0 : _a.component) ? (openBlock(), createBlock(resolveDynamicComponent(unref(config).component), mergeProps({ key: 2 }, props, { Attributes: Attributes.value }), null, 16, ["Attributes"])) : createCommentVNode("", true) ], 2); }; } }); export { _sfc_main as default };