|
@@ -1,9 +1,10 @@
|
|
|
import { useEditor } from "@/modules/editor";
|
|
|
-import { initResource, useResource } from "@/modules/resource";
|
|
|
+import { useResource } from "@/modules/resource";
|
|
|
import { css } from "@linaria/core";
|
|
|
-import { Image, List, Loadmore } from "@queenjs/ui";
|
|
|
+import { Image, Loadmore } from "@queenjs/ui";
|
|
|
import { Radio } from "ant-design-vue";
|
|
|
import { defineComponent, reactive } from "vue";
|
|
|
+import { Container, Draggable } from "vue-dndrop";
|
|
|
|
|
|
export const MySources = defineComponent({
|
|
|
setup() {
|
|
@@ -54,21 +55,54 @@ export const MySources = defineComponent({
|
|
|
<Radio.Button value="Image">图片</Radio.Button>
|
|
|
<Radio.Button value="Video">视频</Radio.Button>
|
|
|
</Radio.Group>
|
|
|
- <div class="scrollbar flex-1 -mr-15px pr-15px">
|
|
|
- <List data={control.state.list} columns={2} gap="20px">
|
|
|
+ <div class="flex-1 -mr-15px pr-15px overflow-x-hidden overflow-y-auto scrollbar">
|
|
|
+ <Container
|
|
|
+ class="grid grid-cols-2 gap-20px"
|
|
|
+ behaviour="copy"
|
|
|
+ group-name="canvas"
|
|
|
+ animation-duration={0}
|
|
|
+ get-child-payload={(index: number) => {
|
|
|
+ return {
|
|
|
+ type: state.sourceType,
|
|
|
+ data: control.state.list[index],
|
|
|
+ };
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {control.state.list.map((item: any) => (
|
|
|
+ <Draggable class="">
|
|
|
+ <div
|
|
|
+ class="draggable-item"
|
|
|
+ style={{ aspectRatio: 1 }}
|
|
|
+ onClick={() => clickToDesign(item.file.url)}
|
|
|
+ >
|
|
|
+ <Image
|
|
|
+ class="w-full h-full"
|
|
|
+ src={item.file.url}
|
|
|
+ size={240}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </Draggable>
|
|
|
+ ))}
|
|
|
+
|
|
|
+ {/* <List
|
|
|
+ data={control.state.list}
|
|
|
+ columns={2}
|
|
|
+ gap="20px"
|
|
|
+ class="h-1/1 pr-15px scrollbar"
|
|
|
+ >
|
|
|
{{
|
|
|
item(item: any) {
|
|
|
return (
|
|
|
- <div
|
|
|
- style={{ aspectRatio: 1 }}
|
|
|
- onClick={() => clickToDesign(item.file.url)}
|
|
|
- >
|
|
|
- <Image
|
|
|
- class="w-full h-full"
|
|
|
- src={item.file.url}
|
|
|
- size={240}
|
|
|
- />
|
|
|
- </div>
|
|
|
+ <div
|
|
|
+ style={{ aspectRatio: 1 }}
|
|
|
+ onClick={() => clickToDesign(item.file.url)}
|
|
|
+ >
|
|
|
+ <Image
|
|
|
+ class="w-full h-full"
|
|
|
+ src={item.file.url}
|
|
|
+ size={240}
|
|
|
+ />
|
|
|
+ </div>
|
|
|
);
|
|
|
},
|
|
|
loadmore() {
|
|
@@ -82,7 +116,14 @@ export const MySources = defineComponent({
|
|
|
);
|
|
|
},
|
|
|
}}
|
|
|
- </List>
|
|
|
+ </List> */}
|
|
|
+ </Container>
|
|
|
+ <Loadmore
|
|
|
+ class="mt-20px"
|
|
|
+ loading={control.state.loading}
|
|
|
+ canLoad={control.state.canLoadNext}
|
|
|
+ onChange={control.loadNextPage}
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
);
|