UNPKG

@cmstops/pro-compo

Version:

[物料平台文档中心](https://arco.design/docs/material/guide)

369 lines (368 loc) 14.6 kB
"use strict"; var vue = require("vue"); var webVue = require("@arco-design/web-vue"); var draggable = require("vuedraggable"); var config = require("../config.js"); var index = require("./components/Content/index.js"); var index$1 = require("./components/Doc/index.js"); var index$2 = require("./components/Records/index.js"); var index$3 = require("./components/CustomWrp/index.js"); function _interopDefaultLegacy(e) { return e && typeof e === "object" && "default" in e ? e : { "default": e }; } var draggable__default = /* @__PURE__ */ _interopDefaultLegacy(draggable); const _hoisted_1 = { class: "content-detail-list-container" }; const _hoisted_2 = { class: "drag-item" }; const _sfc_main = vue.defineComponent({ ...{ name: "contentDetailList" }, __name: "component", props: { height: {}, type: {}, data: {}, parmas: {}, dragalbe: { type: Boolean }, abttrites: {}, extraAttrs: {}, BASE_API: {} }, emits: [ "sortChange", "dragstart", "clickTitle", "cellMouseEnter", "cellMouseLeave", "update:data", "scroll", "scrollReachEnd" ], setup(__props, { emit: __emit }) { const props = __props; const emit = __emit; const parmasProps = props.parmas || {}; const dragalbeProps = props.dragalbe || false; const abttritesProps = props.abttrites || []; const BASE_API_R = props.BASE_API || config.DEFAULT_BASE_API; const outerStyle = vue.computed(() => { return { height: props.height || "100%", overflow: "auto" }; }); const dataList = vue.computed({ get() { return props.data; }, set(value) { emit("update:data", value); } }); const handleScroll = (e) => { emit("scroll", e); const { target } = e; if (target.scrollHeight - target.scrollTop <= target.clientHeight + 20) { emit("scrollReachEnd"); } }; const sortChange = (e) => { emit("sortChange", e); }; const clickTitle = (e) => { emit("clickTitle", e); }; const tableCellMouseEnter = (e) => { emit("cellMouseEnter", e); }; const tableCellMouseLeave = (e) => { emit("cellMouseLeave", e); }; return (_ctx, _cache) => { return vue.openBlock(), vue.createBlock(vue.unref(webVue.Scrollbar), { class: "mobile-content-list-scrollbar", "outer-style": outerStyle.value, style: { "height": "100%", "overflow": "auto" }, onScroll: handleScroll }, { default: vue.withCtx(() => [ vue.createElementVNode("div", _hoisted_1, [ vue.unref(dragalbeProps) ? (vue.openBlock(), vue.createBlock(vue.unref(draggable__default["default"]), { key: 0, modelValue: dataList.value, "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => dataList.value = $event), animation: 150, sort: vue.unref(dragalbeProps), "item-key": "id", onChange: sortChange, onStart: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("dragstart")) }, { item: vue.withCtx(({ element, index: index$4 }) => [ vue.createElementVNode("div", _hoisted_2, [ props.type === "content" ? (vue.openBlock(), vue.createBlock(index, { key: index$4, item: element, index: index$4, parmas: vue.unref(parmasProps), abttrites: vue.unref(abttritesProps), extraAttrs: _ctx.extraAttrs, BASE_API: vue.unref(BASE_API_R), onClickTitle: clickTitle, onCellMouseEnter: tableCellMouseEnter, onCellMouseLeave: tableCellMouseLeave }, { "after-index": vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "after-index", { row: element, index: index$4 }) ]), batch: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "batch", { row: element, index: index$4 }) ]), option: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "option", { row: element, index: index$4 }) ]), _: 2 }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs", "BASE_API"])) : props.type === "doc" ? (vue.openBlock(), vue.createBlock(index$1, { key: index$4, item: element, index: index$4, abttrites: vue.unref(abttritesProps), extraAttrs: _ctx.extraAttrs, BASE_API: vue.unref(BASE_API_R), onClickTitle: clickTitle, onCellMouseEnter: tableCellMouseEnter, onCellMouseLeave: tableCellMouseLeave }, { "after-index": vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "after-index", { row: element, index: index$4 }) ]), tip: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "tip", { row: element, index: index$4 }) ]), batch: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "batch", { row: element, index: index$4 }) ]), option: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "option", { row: element, index: index$4 }) ]), _: 2 }, 1032, ["item", "index", "abttrites", "extraAttrs", "BASE_API"])) : props.type === "record" ? (vue.openBlock(), vue.createBlock(index$2, { key: index$4, item: element, index: index$4, parmas: vue.unref(parmasProps), abttrites: vue.unref(abttritesProps), extraAttrs: _ctx.extraAttrs, onClickTitle: clickTitle, onCellMouseEnter: tableCellMouseEnter, onCellMouseLeave: tableCellMouseLeave }, { batch: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "batch", { row: element, index: index$4 }) ]), option: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "option", { row: element, index: index$4 }) ]), _: 2 }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : (vue.openBlock(), vue.createBlock(index$3, { key: 3, item: element, index: index$4, abttrites: vue.unref(abttritesProps), extraAttrs: _ctx.extraAttrs, onClickTitle: clickTitle, onCellMouseEnter: tableCellMouseEnter, onCellMouseLeave: tableCellMouseLeave }, { index: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "index", { row: element, index: index$4 }) ]), tip: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "tip", { row: element, index: index$4 }) ]), batch: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "batch", { row: element, index: index$4 }) ]), option: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "option", { row: element, index: index$4 }) ]), _: 2 }, 1032, ["item", "index", "abttrites", "extraAttrs"])) ]) ]), _: 3 }, 8, ["modelValue", "sort"])) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(dataList.value, (item, index$4) => { return vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: index$4 }, [ props.type === "content" ? (vue.openBlock(), vue.createBlock(index, { key: index$4, item, index: index$4, parmas: vue.unref(parmasProps), abttrites: vue.unref(abttritesProps), extraAttrs: _ctx.extraAttrs, BASE_API: vue.unref(BASE_API_R), onClickTitle: clickTitle, onCellMouseEnter: tableCellMouseEnter, onCellMouseLeave: tableCellMouseLeave }, { "after-index": vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "after-index", { row: item, index: index$4 }) ]), batch: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "batch", { row: item, index: index$4 }) ]), option: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "option", { row: item, index: index$4 }) ]), _: 2 }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs", "BASE_API"])) : props.type === "doc" ? (vue.openBlock(), vue.createBlock(index$1, { key: index$4, item, index: index$4, abttrites: vue.unref(abttritesProps), extraAttrs: _ctx.extraAttrs, BASE_API: vue.unref(BASE_API_R), onClickTitle: clickTitle, onCellMouseEnter: tableCellMouseEnter, onCellMouseLeave: tableCellMouseLeave }, { "after-index": vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "after-index", { row: item, index: index$4 }) ]), tip: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "tip", { row: item, index: index$4 }) ]), batch: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "batch", { row: item, index: index$4 }) ]), option: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "option", { row: item, index: index$4 }) ]), _: 2 }, 1032, ["item", "index", "abttrites", "extraAttrs", "BASE_API"])) : props.type === "record" ? (vue.openBlock(), vue.createBlock(index$2, { key: index$4, item, index: index$4, parmas: vue.unref(parmasProps), abttrites: vue.unref(abttritesProps), extraAttrs: _ctx.extraAttrs, onClickTitle: clickTitle, onCellMouseEnter: tableCellMouseEnter, onCellMouseLeave: tableCellMouseLeave }, { batch: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "batch", { row: item, index: index$4 }) ]), option: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "option", { row: item, index: index$4 }) ]), _: 2 }, 1032, ["item", "index", "parmas", "abttrites", "extraAttrs"])) : (vue.openBlock(), vue.createBlock(index$3, { key: 3, item, index: index$4, abttrites: vue.unref(abttritesProps), extraAttrs: _ctx.extraAttrs, onClickTitle: clickTitle, onCellMouseEnter: tableCellMouseEnter, onCellMouseLeave: tableCellMouseLeave }, { index: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "index", { row: item, index: index$4 }) ]), tip: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "tip", { row: item, index: index$4 }) ]), batch: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "batch", { row: item, index: index$4 }) ]), option: vue.withCtx(() => [ vue.renderSlot(_ctx.$slots, "option", { row: item, index: index$4 }) ]), _: 2 }, 1032, ["item", "index", "abttrites", "extraAttrs"])) ], 64); }), 128)) ]) ]), _: 3 }, 8, ["outer-style"]); }; } }); module.exports = _sfc_main;