|
@@ -9,7 +9,7 @@ import Empty from "@/components/Empty";
|
|
|
import { useEditor } from "@/modules/editor";
|
|
|
import { useResource } from "@/modules/resource";
|
|
|
import { useAuth } from "@queenjs-modules/auth";
|
|
|
-import { Image } from "@queenjs/ui";
|
|
|
+import { Image, Loadmore } from "@queenjs/ui";
|
|
|
import { defineUI, queenApi } from "queenjs";
|
|
|
import Menu from "./Menu";
|
|
|
|
|
@@ -38,7 +38,9 @@ export default defineUI({
|
|
|
return () => {
|
|
|
const { sourceType } = props;
|
|
|
|
|
|
- if (listCtrl.state.list.length == 0) return <Empty class="pt-150px" />;
|
|
|
+ const dataSource = listCtrl.state.list;
|
|
|
+
|
|
|
+ if (dataSource.length == 0) return <Empty class="pt-150px" />;
|
|
|
|
|
|
return (
|
|
|
<div>
|
|
@@ -53,11 +55,11 @@ export default defineUI({
|
|
|
get-child-payload={(index: number) => {
|
|
|
return {
|
|
|
type: "CompCard",
|
|
|
- data: { id: listCtrl.state.list[index]._id, isSys: isSys },
|
|
|
+ data: { id: dataSource[index]._id, isSys: isSys },
|
|
|
};
|
|
|
}}
|
|
|
>
|
|
|
- {listCtrl.state.list.map((item: any) => {
|
|
|
+ {dataSource.map((item: compType) => {
|
|
|
const items = ["删除"];
|
|
|
|
|
|
if (isSys) {
|
|
@@ -68,9 +70,9 @@ export default defineUI({
|
|
|
return (
|
|
|
<Draggable>
|
|
|
<div
|
|
|
- class="text-center leading-50px bg-dark-50 rounded draggable-item relative"
|
|
|
- key={item.compKey}
|
|
|
- title={item.name}
|
|
|
+ class="text-center leading-50px bg-dark-50 rounded draggable-item relative cursor-pointer"
|
|
|
+ key={item._id}
|
|
|
+ title={item.title}
|
|
|
>
|
|
|
<Image
|
|
|
class="w-full rounded"
|
|
@@ -89,7 +91,7 @@ export default defineUI({
|
|
|
{item.published ? "已发布" : "未发布"}
|
|
|
</Tag>
|
|
|
)}
|
|
|
- <div class="item_footer rounded-b-4px flex items-center justify-between p-4px">
|
|
|
+ <div class="item_footer rounded-b-4px flex items-center justify-between p-4px bg-dark-50">
|
|
|
<div class="flex-1 w-0">
|
|
|
{/* <div class="text-white text-bold truncate">{record.title}</div> */}
|
|
|
<div class="flex items-center text-opacity-60 text-white text-12px">
|
|
@@ -117,6 +119,16 @@ export default defineUI({
|
|
|
);
|
|
|
})}
|
|
|
</Container>
|
|
|
+ {dataSource.length == 0 ? (
|
|
|
+ <Empty class="pt-150px" />
|
|
|
+ ) : (
|
|
|
+ <Loadmore
|
|
|
+ class="mt-20px"
|
|
|
+ loading={listCtrl.state.loading}
|
|
|
+ canLoad={listCtrl.state.canLoadNext}
|
|
|
+ onChange={listCtrl.loadNextPage}
|
|
|
+ />
|
|
|
+ )}
|
|
|
</div>
|
|
|
);
|
|
|
};
|