|
@@ -1,15 +1,16 @@
|
|
|
import { Container, Draggable } from "vue-dndrop";
|
|
|
-import { any, string } from "vue-types";
|
|
|
+import { any, bool, string } from "vue-types";
|
|
|
|
|
|
import { useEditor } from "@/modules/editor";
|
|
|
import { ICompKeys } from "@/modules/editor/typings";
|
|
|
import { Empty, Image } from "@queenjs/ui";
|
|
|
import { useReactive } from "@queenjs/use";
|
|
|
-import { defineUI } from "queenjs";
|
|
|
+import { defineUI, queenApi } from "queenjs";
|
|
|
import { useAuth } from "@queenjs-modules/auth";
|
|
|
import { Dropdown, Tag } from "ant-design-vue";
|
|
|
import dayjs from "dayjs";
|
|
|
import Menu from "./Menu";
|
|
|
+import { useResource } from "@/modules/resource";
|
|
|
|
|
|
export default defineUI({
|
|
|
props: {
|
|
@@ -28,7 +29,12 @@ export default defineUI({
|
|
|
}));
|
|
|
|
|
|
return () => {
|
|
|
- return <Comp components={state.currComps} />;
|
|
|
+ return (
|
|
|
+ <Comp
|
|
|
+ components={state.currComps}
|
|
|
+ taggable={props.compType == "user"}
|
|
|
+ />
|
|
|
+ );
|
|
|
};
|
|
|
},
|
|
|
});
|
|
@@ -44,10 +50,13 @@ const Comp = defineUI({
|
|
|
createTime?: string;
|
|
|
}[]
|
|
|
>().isRequired,
|
|
|
+
|
|
|
+ taggable: bool().def(false),
|
|
|
},
|
|
|
setup(props) {
|
|
|
const editor = useEditor();
|
|
|
const auth = useAuth();
|
|
|
+ const resource = useResource();
|
|
|
|
|
|
return () => {
|
|
|
//@ts-ignore
|
|
@@ -87,7 +96,7 @@ const Comp = defineUI({
|
|
|
size={240}
|
|
|
/>
|
|
|
|
|
|
- {isSys && (
|
|
|
+ {isSys && props.taggable && (
|
|
|
<Tag
|
|
|
color={item.published ? "green" : "#E88B00"}
|
|
|
// color="rgba(0, 0, 0, 0.4)"
|
|
@@ -97,20 +106,31 @@ const Comp = defineUI({
|
|
|
</Tag>
|
|
|
)}
|
|
|
|
|
|
- <div class="item_footer rounded-b-4px flex items-center justify-between p-4px">
|
|
|
- <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">
|
|
|
- {dayjs(item.createTime).format("YYYY.MM.DD")}
|
|
|
+ {props.taggable && (
|
|
|
+ <div class="item_footer rounded-b-4px flex items-center justify-between p-4px">
|
|
|
+ <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">
|
|
|
+ {dayjs(item.createTime).format("YYYY.MM.DD")}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ <Menu
|
|
|
+ items={items}
|
|
|
+ onMenu={async (name) => {
|
|
|
+ console.log("name", name);
|
|
|
+ if (name == "删除") {
|
|
|
+ await resource.actions.deleteCustomComp(item)
|
|
|
+ // editor.controls.compUICtrl.
|
|
|
+ queenApi.messageSuccess("删除成功!")
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const pub = (name == "发布平台");
|
|
|
+ await resource.actions.publishFrame(item, pub)
|
|
|
+ item.published = pub;
|
|
|
+ }}
|
|
|
+ />
|
|
|
</div>
|
|
|
- <Menu
|
|
|
- items={items}
|
|
|
- onMenu={(name) => {
|
|
|
- console.log("name", name);
|
|
|
- }}
|
|
|
- />
|
|
|
- </div>
|
|
|
+ )}
|
|
|
</div>
|
|
|
</Draggable>
|
|
|
);
|