UNPKG

@cmstops/pro-compo

Version:

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

266 lines (265 loc) 10.9 kB
"use strict"; var vue = require("vue"); var webVue = require("@arco-design/web-vue"); var typeMap = require("../utils/typeMap.js"); var doc = require("../utils/doc.js"); var component = require("../typeIcons/component.js"); const _hoisted_1 = { key: 0, class: "doc-tags-container" }; const _hoisted_2 = { class: "doc-tags-thumb-ul" }; const _hoisted_3 = ["src"]; const _hoisted_4 = { key: 0 }; const _hoisted_5 = { key: 1 }; const _sfc_main = vue.defineComponent({ ...{ name: "dataTags" }, __name: "component", props: { item: {}, popverThumb: { type: Boolean, default: true }, disabled: { type: Boolean } }, setup(__props) { const props = __props; const thumbs = vue.ref([]); const thumbType = vue.computed(() => { if (props.item.style) { const style = JSON.parse(props.item.style); if (style.model === 0) return "\u65E0\u56FE"; return doc.docThumbMap()[style.model]; } if (props.item.cover) { if (props.item.cover.model === 0) return "\u65E0\u56FE"; return doc.docThumbMap()[props.item.cover.model]; } return "\u65E0\u56FE"; }); const thumbList = vue.computed(() => { if (thumbType.value === "\u65E0\u56FE") return []; if (props.item.style) { const style = JSON.parse(props.item.style); return style.data || []; } if (props.item.cover) { return props.item.cover.data || []; } return []; }); const showThumbs = () => { thumbs.value = thumbList.value; }; const localLiveType = vue.computed(() => { if (props.item.series === "local_live") { const payload = JSON.parse(props.item.payload || "{}"); if (payload && [0, 1, 2].includes(payload.type)) { return typeMap.local_live_doc_type[payload.type]; } return ""; } return ""; }); return (_ctx, _cache) => { return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [ vue.createCommentVNode(" \u539F\u521B/\u63A8\u8350/\u654F\u611F\u8BCD/\u5C01\u9762\u51E0\u56FE/ "), _ctx.item ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_1, [ _ctx.item.catalog === "doc" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [ _ctx.popverThumb && thumbList.value.length ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Popover), { key: 0, "content-class": "doc-tags-thumb-popver", "arrow-class": "doc-tags-popver-arrow", duration: 500, position: "top", class: "no-margin", trigger: "hover", onShow: _cache[0] || (_cache[0] = ($event) => showThumbs()) }, { content: vue.withCtx(() => [ vue.createElementVNode("div", _hoisted_2, [ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(thumbs.value, (thumb, index) => { return vue.openBlock(), vue.createElementBlock("img", { key: index, src: thumb.thumb || thumb.url, fit: "cover", lazy: true }, null, 8, _hoisted_3); }), 128)) ]) ]), default: vue.withCtx(() => [ vue.createVNode(vue.unref(webVue.Tag), { size: "small", class: vue.normalizeClass([{ disabled: _ctx.disabled }, "thumb"]) }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(thumbType.value), 1) ]), _: 1 }, 8, ["class"]) ]), _: 1 })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [ thumbType.value ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Tooltip), { key: 0, content: thumbType.value, position: "top" }, { default: vue.withCtx(() => [ vue.createVNode(vue.unref(webVue.Tag), { size: "small", class: vue.normalizeClass([{ disabled: _ctx.disabled }, "thumb"]) }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(thumbType.value), 1) ]), _: 1 }, 8, ["class"]) ]), _: 1 }, 8, ["content"])) : vue.createCommentVNode("v-if", true) ], 64)), _ctx.item.statement ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Tooltip), { key: 2, content: "\u539F\u521B", position: "top" }, { default: vue.withCtx(() => [ vue.createVNode(vue.unref(webVue.Tag), { size: "small", class: vue.normalizeClass([{ disabled: _ctx.disabled }, "yuanchuang"]) }, { default: vue.withCtx(() => _cache[1] || (_cache[1] = [ vue.createTextVNode("\u539F\u521B") ])), _: 1, __: [1] }, 8, ["class"]) ]), _: 1 })) : vue.createCommentVNode("v-if", true), _ctx.item.recommended ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Tooltip), { key: 3, content: "\u63A8\u8350", position: "top" }, { default: vue.withCtx(() => [ vue.createVNode(vue.unref(webVue.Tag), { size: "small", class: vue.normalizeClass([{ disabled: _ctx.disabled }, "star"]) }, { default: vue.withCtx(() => _cache[2] || (_cache[2] = [ vue.createTextVNode("\u63A8\u8350") ])), _: 1, __: [2] }, 8, ["class"]) ]), _: 1 })) : vue.createCommentVNode("v-if", true), _ctx.item.sensitives ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Tooltip), { key: 4, content: `\u5305\u542B\u654F\u611F\u8BCD\uFF1A${_ctx.item.sensitives}`, position: "top" }, { default: vue.withCtx(() => [ vue.createVNode(vue.unref(webVue.Tag), { size: "small", class: vue.normalizeClass([{ disabled: _ctx.disabled }, "waring"]) }, { default: vue.withCtx(() => _cache[3] || (_cache[3] = [ vue.createTextVNode("\u654F\u611F") ])), _: 1, __: [3] }, 8, ["class"]) ]), _: 1 }, 8, ["content"])) : vue.createCommentVNode("v-if", true), _ctx.item.push_state === 3 ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Tooltip), { key: 5, content: "\u63A8\u9001\u6210\u529F", position: "top" }, { default: vue.withCtx(() => [ vue.createVNode(vue.unref(webVue.Tag), { size: "small", class: vue.normalizeClass([{ disabled: _ctx.disabled }, "star"]) }, { default: vue.withCtx(() => _cache[4] || (_cache[4] = [ vue.createTextVNode("\u5DF2\u63A8\u9001") ])), _: 1, __: [4] }, 8, ["class"]) ]), _: 1 })) : vue.createCommentVNode("v-if", true), localLiveType.value ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Tooltip), { key: 6, content: `${localLiveType.value}`, position: "top" }, { default: vue.withCtx(() => [ vue.createVNode(vue.unref(webVue.Tag), { size: "small", class: vue.normalizeClass([{ disabled: _ctx.disabled }, "star"]) }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(localLiveType.value), 1) ]), _: 1 }, 8, ["class"]) ]), _: 1 }, 8, ["content"])) : vue.createCommentVNode("v-if", true), _ctx.item.is_matrix ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Tooltip), { key: 7, content: "\u7A3F\u4EF6\u5B58\u5728\u81EA\u5A92\u4F53\u77E9\u9635\u5206\u53D1\u8BB0\u5F55", position: "top" }, { default: vue.withCtx(() => [ vue.createVNode(vue.unref(webVue.Tag), { size: "small", class: vue.normalizeClass([{ disabled: _ctx.disabled }, "matrix"]) }, { default: vue.withCtx(() => _cache[5] || (_cache[5] = [ vue.createTextVNode(" \u77E9\u9635\u5206\u53D1 ") ])), _: 1, __: [5] }, 8, ["class"]) ]), _: 1 })) : vue.createCommentVNode("v-if", true) ], 64)) : _ctx.item.catalog === "kongo" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Tag), { key: 1, size: "small" }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(vue.unref(typeMap.kongo_source_map)[_ctx.item.series]), 1) ]), _: 1 })) : _ctx.item.catalog === "mp_account" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Tag), { key: 2, size: "small" }, { default: vue.withCtx(() => [ vue.createTextVNode(vue.toDisplayString(vue.unref(typeMap.mp_type_map)[_ctx.item.mp_type]), 1) ]), _: 1 })) : _ctx.item.catalog === "mp_content" ? (vue.openBlock(), vue.createBlock(component, { key: 3, class: "icon", type: "mpdoc" })) : (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 4 }, [ _ctx.item.list_type ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_4, vue.toDisplayString(vue.unref(typeMap.contentList_list_type_map)[_ctx.item.list_type]), 1)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_5, "--")) ], 64)) ])) : vue.createCommentVNode("v-if", true) ], 2112); }; } }); module.exports = _sfc_main;