@cmstops/pro-compo
Version:
[物料平台文档中心](https://arco.design/docs/material/guide)
125 lines (124 loc) • 5.52 kB
JavaScript
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, createBlock, unref, toDisplayString, renderSlot, createVNode, withCtx, createCommentVNode, createTextVNode } from "vue";
import { Image, Tooltip } from "@arco-design/web-vue";
import { IconInfoCircle } from "@arco-design/web-vue/es/icon";
import _sfc_main$1 from "../../../../typeIcons/component.js";
import { noCoverText, timeFormat } from "../../../../utils/index.js";
import { contentList_relation_type_map, contentList_layout_map } from "../../../../utils/typeMap.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: "title_i" };
const _hoisted_6 = { class: "title-tips" };
const _hoisted_7 = {
key: 0,
class: "title-tips red"
};
const _hoisted_8 = { class: "abttrite-v" };
const _hoisted_9 = { class: "left" };
const _hoisted_10 = { class: "abttr tags" };
const _hoisted_11 = { class: "abttr" };
const _hoisted_12 = { class: "abttr time" };
const _hoisted_13 = { class: "right" };
const _sfc_main = defineComponent({
__name: "index",
props: {
item: {},
parmas: {},
extraAttrs: {}
},
emits: ["clickTitle", "cellMouseEnter", "cellMouseLeave"],
setup(__props, { emit: __emit }) {
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 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-component-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, [
_ctx.item.cover && _ctx.item.cover.data && _ctx.item.cover.data[0] ? (openBlock(), createBlock(unref(Image), {
key: 0,
src: _ctx.item.cover.data[0].thumb,
preview: false,
fit: "cover",
class: "image"
}, 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"),
createElementVNode("span", _hoisted_5, toDisplayString(_ctx.item.alias || _ctx.item.title), 1),
createElementVNode("span", _hoisted_6, [
renderSlot(_ctx.$slots, "tips")
]),
createVNode(unref(Tooltip), {
content: "\u5F53\u524D\u9891\u9053\u6682\u672A\u7ED1\u5B9A\u5730\u7406\u4F4D\u7F6E\uFF0C\u53EF\u70B9\u51FB\u540E\u65B9\u201C\u7F16\u8F91\u9891\u9053\u201D\uFF0C\u4E3A\u9891\u9053\u5339\u914D\u5730\u7406\u4F4D\u7F6E",
position: "top",
trigger: "hover"
}, {
default: withCtx(() => {
var _a, _b, _c, _d;
return [
((_b = (_a = _ctx.parmas) == null ? void 0 : _a.labelTip) == null ? void 0 : _b.info(_ctx.item)) ? (openBlock(), createElementBlock("span", _hoisted_7, [
createVNode(unref(IconInfoCircle), {
class: "icon",
size: "16"
}),
createElementVNode("span", null, toDisplayString(((_d = (_c = _ctx.parmas) == null ? void 0 : _c.labelTip) == null ? void 0 : _d.info(_ctx.item)) || ""), 1)
])) : createCommentVNode("v-if", true)
];
}),
_: 1
})
]),
createElementVNode("div", _hoisted_8, [
createElementVNode("div", _hoisted_9, [
createVNode(_sfc_main$1, {
class: "icon",
doc: true,
type: _ctx.item.series
}, null, 8, ["type"]),
createElementVNode("span", _hoisted_10, [
createTextVNode(toDisplayString(unref(contentList_relation_type_map)[_ctx.item.relation_type]) + "\u9891\u9053", 1),
renderSlot(_ctx.$slots, "tip")
]),
createElementVNode("span", _hoisted_11, toDisplayString(unref(contentList_layout_map)[_ctx.item.list_layout || "blank"]), 1),
createElementVNode("span", _hoisted_12, "\u53D1\u5E03\u65F6\u95F4: " + toDisplayString(unref(timeFormat)(_ctx.item.pub_time)), 1)
]),
createElementVNode("div", _hoisted_13, [
renderSlot(_ctx.$slots, "option", { row: _ctx.item })
])
])
])
], 34);
};
}
});
export { _sfc_main as default };