|
@@ -1,9 +1,8 @@
|
|
|
import { css, cx } from "@linaria/core";
|
|
|
import { IconDelete } from "@queenjs/icons";
|
|
|
import { Image, View } from "@queenjs/ui";
|
|
|
-import { Checkbox } from "ant-design-vue";
|
|
|
import { defineUI } from "queenjs";
|
|
|
-import { any, bool, string } from "vue-types";
|
|
|
+import { any, string } from "vue-types";
|
|
|
|
|
|
const renderStatus = {
|
|
|
succ: "",
|
|
@@ -13,18 +12,17 @@ const renderStatus = {
|
|
|
|
|
|
export default defineUI({
|
|
|
props: {
|
|
|
- active: bool().def(false),
|
|
|
record: any(),
|
|
|
use: string<"show" | "select" | "task">(),
|
|
|
},
|
|
|
- emits: ["delete", "select", "download", "use"],
|
|
|
+ emits: ["delete", "download", "use", "preview"],
|
|
|
setup(props, { emit }) {
|
|
|
return () => {
|
|
|
- const { active, record, use } = props;
|
|
|
+ const { record, use } = props;
|
|
|
// console.error("record: ", record);
|
|
|
|
|
|
return (
|
|
|
- <div class={cx(itemStyles, "relative", active && "active")}>
|
|
|
+ <div class={cx(itemStyles, "relative")}>
|
|
|
<View ratio={1.4} class="overflow-hidden">
|
|
|
{record.fileType == "video" ? (
|
|
|
<video src={record.file?.url} class="h-1/1 w-1/1" />
|
|
@@ -36,28 +34,26 @@ export default defineUI({
|
|
|
}
|
|
|
/>
|
|
|
)}
|
|
|
- {active && (
|
|
|
- <Checkbox
|
|
|
- checked
|
|
|
- class="!-mt-0.2em absolute top-0 left-0 text-20px text-red-200 z-3"
|
|
|
- />
|
|
|
- )}
|
|
|
+
|
|
|
{use == "task" && record.status !== "succ" && (
|
|
|
<div class="waiting absolute inset-0 z-2 flex items-center justify-center text-white">
|
|
|
{(renderStatus as any)[record.status || "default"]}
|
|
|
</div>
|
|
|
)}
|
|
|
{use !== "task" && (
|
|
|
- <div
|
|
|
- class="absolute inset-0 flex items-center justify-center z-2 opacity-0 hover:opacity-100 transition-all text-white"
|
|
|
- onClick={() => emit("select")}
|
|
|
- >
|
|
|
+ <div class="absolute inset-0 flex items-center justify-center z-2 opacity-0 hover:opacity-100 transition-all text-white">
|
|
|
{use == "show" && (
|
|
|
<IconDelete
|
|
|
class="icon_del absolute right-5px top-5px p-3px rounded-2px text-14px cursor-pointer"
|
|
|
onClick={() => emit("delete")}
|
|
|
/>
|
|
|
)}
|
|
|
+ <div
|
|
|
+ class="rounded-1/2 text-center w-56px leading-56px cursor-pointer orange"
|
|
|
+ onClick={() => emit("preview")}
|
|
|
+ >
|
|
|
+ 预览
|
|
|
+ </div>
|
|
|
{use == "show" && (
|
|
|
<div
|
|
|
class="btn_circle rounded-1/2 text-center w-56px leading-56px cursor-pointer"
|
|
@@ -92,17 +88,18 @@ export default defineUI({
|
|
|
});
|
|
|
|
|
|
const itemStyles = css`
|
|
|
- border: 1px solid transparent;
|
|
|
- &.active {
|
|
|
- border-color: @inf-primary-color;
|
|
|
+ .orange {
|
|
|
+ background-color: rgba(232, 139, 0, 0.5);
|
|
|
+ &:hover {
|
|
|
+ background-color: rgba(232, 139, 0, 0.7);
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
.btn_circle {
|
|
|
background-color: rgba(0, 0, 0, 0.7);
|
|
|
&:hover {
|
|
|
background-color: rgba(0, 0, 0, 0.8);
|
|
|
}
|
|
|
- &:not(:first-child) {
|
|
|
+ &:not(:nth-of-type(1)) {
|
|
|
margin-left: 10px;
|
|
|
}
|
|
|
}
|