UNPKG

@cmstops/pro-compo

Version:

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

134 lines (133 loc) 5.43 kB
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, unref, toDisplayString, renderSlot, createTextVNode, createVNode, withCtx } from "vue"; import { Image, Tooltip } from "@arco-design/web-vue"; import _sfc_main$1 from "../../../../typeIcons/component.js"; import _sfc_main$2 from "../../../../dataTags/component.js"; import { noCoverText, timeFormat } from "../../../../utils/index.js"; const _hoisted_1 = { class: "cover-view" }; const _hoisted_2 = { key: 1, class: "no-img" }; const _hoisted_3 = { class: "batch-select" }; const _hoisted_4 = { class: "info-view" }; const _hoisted_5 = { class: "abttrite-v" }; const _hoisted_6 = { class: "left" }; const _hoisted_7 = { class: "tags" }; const _hoisted_8 = { class: "abttr" }; const _hoisted_9 = { class: "abttr time" }; const _hoisted_10 = { class: "right" }; const _sfc_main = defineComponent({ __name: "index", props: { item: {}, abttrites: {}, extraAttrs: {} }, emits: ["clickTitle", "cellMouseEnter", "cellMouseLeave"], setup(__props, { emit: __emit }) { var _a, _b, _c; const props = __props; const emit = __emit; const hide = computed(() => { const { hide: hide2 } = props.item; return hide2 === 7 || hide2 === 6; }); const silent = computed(() => { return props.item && props.item.mourn_style === 1; }); const mpName = ((_c = (_b = (_a = window.situoyun) == null ? void 0 : _a.config) == null ? void 0 : _b.oem_config) == null ? void 0 : _c.mp_name) || "\u516C\u4F17\u53F7"; const thumb = computed(() => { if (!props.item) return null; if (props.item.preview_url) { return props.item.preview_url; } if (props.item.style) { let { style } = props.item; if (typeof style === "string") { style = JSON.parse(style); return style.data && style.data[0] && style.data[0].thumb; } return style.data && style.data[0] && style.data[0].thumb; } return props.item.cover && props.item.cover.data && props.item.cover.data[0] && props.item.cover.data[0].thumb; }); const mouseEnterFun = (event, row) => { emit("cellMouseEnter", { row, event }); }; const mouseLeaveFun = (event, row) => { emit("cellMouseLeave", { row, event }); }; const clickTitle = () => { emit("clickTitle", props.item); }; return (_ctx, _cache) => { return openBlock(), createElementBlock("div", { class: normalizeClass(["medialist-mpdoc-item-view", { "gray-forbidden": hide.value, "gray-for-state-hide": silent.value }]), onMouseenter: _cache[0] || (_cache[0] = ($event) => mouseEnterFun($event, _ctx.item)), onMouseleave: _cache[1] || (_cache[1] = ($event) => mouseLeaveFun($event, _ctx.item)) }, [ createElementVNode("div", _hoisted_1, [ thumb.value ? (openBlock(), createBlock(unref(Image), { key: 0, preview: false, src: thumb.value, class: "image", fit: "cover" }, null, 8, ["src"])) : (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(unref(noCoverText)(_ctx.item)), 1)), createElementVNode("div", _hoisted_3, [ renderSlot(_ctx.$slots, "batch", { row: _ctx.item }) ]) ]), createElementVNode("div", _hoisted_4, [ createElementVNode("div", { class: "title", onClick: clickTitle }, [ renderSlot(_ctx.$slots, "index"), createTextVNode(toDisplayString(_ctx.item.alias || _ctx.item.title), 1) ]), createElementVNode("div", _hoisted_5, [ createElementVNode("div", _hoisted_6, [ createVNode(_sfc_main$1, { class: "icon", doc: true, type: _ctx.item.series }, null, 8, ["type"]), createElementVNode("span", _hoisted_7, [ createVNode(_sfc_main$2, { item: _ctx.item }, null, 8, ["item"]), renderSlot(_ctx.$slots, "tip") ]), createElementVNode("span", _hoisted_8, [ createVNode(unref(Tooltip), { position: "top", content: `\u6240\u5C5E${unref(mpName)}: ${_ctx.item.account_name || _ctx.item.mp_user_name}` }, { default: withCtx(() => [ createElementVNode("span", null, toDisplayString(_ctx.item.account_name || _ctx.item.mp_user_name), 1) ]), _: 1 }, 8, ["content"]) ]), createElementVNode("span", _hoisted_9, [ createVNode(unref(Tooltip), { position: "top", content: `\u53D1\u5E03\u65F6\u95F4: ${unref(timeFormat)(_ctx.item.pub_time)}` }, { default: withCtx(() => [ createElementVNode("span", null, toDisplayString(unref(timeFormat)(_ctx.item.pub_time)), 1) ]), _: 1 }, 8, ["content"]) ]) ]), createElementVNode("div", _hoisted_10, [ renderSlot(_ctx.$slots, "option", { row: _ctx.item }) ]) ]) ]) ], 34); }; } }); export { _sfc_main as default };