import { css, cx } from "@linaria/core"; import { IconMore } from "@queenjs/icons"; import { Image, View } from "@queenjs/ui"; import { Divider, Dropdown, Menu, Tag } from "ant-design-vue"; import { EyeOutlined } from "@ant-design/icons-vue"; import dayjs from "dayjs"; import { defineUI } from "queenjs"; import { any, bool } from "vue-types"; import { useAuth } from "@queenjs-modules/auth"; // const ShareBox = defineComponent({ // props: { // id: string(), // }, // setup(props) { // let shareLink = location.origin + "/share.html?id=" + props.id; // if (location.host == "www.infish.cn") { // shareLink = // location.origin + "/projects/queenshowv1/share.html?id=" + props.id; // } // const qrUrl = useQRCode(shareLink); // const { copy, copied } = useClipboard(); // return () => ( //
// //
// //
// ); // }, // }); export default defineUI({ props: { record: any(), isPc: bool().def(false), }, emits: ["edit", "preview", "menu"], setup(props, { emit }) { const auth = useAuth(); return () => { const { record, isPc } = props; //@ts-ignore const isSys = (auth.store.userInfo.roles || []).indexOf("system") > -1; return (
{isSys && ( {record.published ? "已发布" : "未发布"} )}
emit("edit", props.record)} > 编辑
{isPc ? (
emit("menu", "copyLink")} > 链接
) : (
emit("menu", "share")} > 分享
)}
); }; }, }); const itemStyles = css` /* 修复hover时,页面滚动条抖动的bug */ > div { font-size: 0; > div * { font-size: 14px; } } .item_footer { background: #414141; } .icon_action { background-color: rgba(0, 0, 0, 0.8); &.orange { background-color: rgba(232, 139, 0, 0.8); } } `; const menuStyles = css` .ant-dropdown-menu-item, .ant-dropdown-menu-submenu-title { font-size: 12px; } `;