|
@@ -2,9 +2,11 @@ import { defineComponent, onMounted, watch } from "vue";
|
|
import { Container, Draggable } from "vue-dndrop";
|
|
import { Container, Draggable } from "vue-dndrop";
|
|
import { string } from "vue-types";
|
|
import { string } from "vue-types";
|
|
|
|
|
|
|
|
+import Thumbnail from "@/components/Thumbnail";
|
|
import { useEditor } from "@/modules/editor";
|
|
import { useEditor } from "@/modules/editor";
|
|
import { useResource } from "@/modules/resource";
|
|
import { useResource } from "@/modules/resource";
|
|
-import { Image, Loadmore } from "@queenjs/ui";
|
|
|
|
|
|
+import { Loadmore } from "@queenjs/ui";
|
|
|
|
+import Empty from "@queenjs/ui/empty";
|
|
|
|
|
|
export const Sources = defineComponent({
|
|
export const Sources = defineComponent({
|
|
props: {
|
|
props: {
|
|
@@ -55,7 +57,7 @@ export const Sources = defineComponent({
|
|
return (
|
|
return (
|
|
<div class="flex-1 overflow-x-hidden overflow-y-auto scrollbar">
|
|
<div class="flex-1 overflow-x-hidden overflow-y-auto scrollbar">
|
|
<Container
|
|
<Container
|
|
- class="grid grid-cols-2 gap-15px"
|
|
|
|
|
|
+ class="grid grid-cols-2 gap-10px"
|
|
behaviour="copy"
|
|
behaviour="copy"
|
|
group-name="canvas"
|
|
group-name="canvas"
|
|
animation-duration={0}
|
|
animation-duration={0}
|
|
@@ -68,34 +70,28 @@ export const Sources = defineComponent({
|
|
>
|
|
>
|
|
{dataSource.map((item: any) => (
|
|
{dataSource.map((item: any) => (
|
|
<Draggable>
|
|
<Draggable>
|
|
- <div
|
|
|
|
|
|
+ <Thumbnail
|
|
|
|
+ size={240}
|
|
class="draggable-item"
|
|
class="draggable-item"
|
|
style={{ aspectRatio: 1 }}
|
|
style={{ aspectRatio: 1 }}
|
|
onClick={() => clickToDesign(item.file.url)}
|
|
onClick={() => clickToDesign(item.file.url)}
|
|
- >
|
|
|
|
- {item.fileType == "video" ? (
|
|
|
|
- // <video
|
|
|
|
- // src={item.file.url}
|
|
|
|
- // class="w-full h-full object-cover"
|
|
|
|
- // />
|
|
|
|
- <Image class="w-full h-full" src={item.thumbnail} />
|
|
|
|
- ) : (
|
|
|
|
- <Image
|
|
|
|
- class="w-full h-full"
|
|
|
|
- src={item.file.url}
|
|
|
|
- size={240}
|
|
|
|
- />
|
|
|
|
- )}
|
|
|
|
- </div>
|
|
|
|
|
|
+ src={
|
|
|
|
+ item.fileType == "video" ? item.thumbnail : item.file.url
|
|
|
|
+ }
|
|
|
|
+ />
|
|
</Draggable>
|
|
</Draggable>
|
|
))}
|
|
))}
|
|
</Container>
|
|
</Container>
|
|
- <Loadmore
|
|
|
|
- class="mt-20px"
|
|
|
|
- loading={control.state.loading}
|
|
|
|
- canLoad={control.state.canLoadNext}
|
|
|
|
- onChange={control.loadNextPage}
|
|
|
|
- />
|
|
|
|
|
|
+ {dataSource.length == 0 ? (
|
|
|
|
+ <Empty />
|
|
|
|
+ ) : (
|
|
|
|
+ <Loadmore
|
|
|
|
+ class="mt-20px"
|
|
|
|
+ loading={control.state.loading}
|
|
|
|
+ canLoad={control.state.canLoadNext}
|
|
|
|
+ onChange={control.loadNextPage}
|
|
|
|
+ />
|
|
|
|
+ )}
|
|
</div>
|
|
</div>
|
|
);
|
|
);
|
|
};
|
|
};
|