123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- import { Button } from "ant-design-vue";
- import { defineComponent } from "vue";
- import { useResource } from "../..";
- import MaterialTemplateModal from "./MaterialTemplateModal";
- import { css, cx } from "@linaria/core";
- const materialType = [
- { name: "视频", key: "video" },
- { name: "图片", key: "image" },
- { name: "渲染任务", key: "task" },
- ];
- export default defineComponent({
- emits: ["change"],
- setup(props, { emit }) {
- const resource = useResource();
- const { store } = resource;
- const showModal = (type: string) => {
- resource.showModal(<MaterialTemplateModal type={type} />, {
- title: `${type === "image" ? "图片" : "视频"}模板中心`,
- width: "1000px",
- });
- };
- return () => {
- return (
- <div
- class={cx(rootStyles, "flex items-center justify-between mt-20px")}
- >
- <div class="filter space-x-60px">
- {materialType.map((d) => (
- <span
- key={d.key}
- onClick={() => emit("change", d.key)}
- class={cx(
- store.type == d.key && "active",
- "cursor-pointer btn_tab"
- )}
- >
- {d.name}
- </span>
- ))}
- </div>
- <div>
- <Button
- ghost
- type="primary"
- onClick={resource.actions.uploadMaterial}
- >
- 上传素材
- </Button>
- <Button
- ghost
- type="primary"
- class="ml-25px"
- onClick={() => showModal("image")}
- >
- 生成图片
- </Button>
- <Button
- ghost
- type="primary"
- class="ml-15px"
- onClick={() => showModal("video")}
- >
- 生成视频
- </Button>
- </div>
- </div>
- );
- };
- },
- });
- const rootStyles = css`
- .btn_tab {
- padding: 3px 5px;
- &:hover,
- &.active {
- color: @inf-primary-color;
- }
- }
- `;
|