import { useResource } from "@/modules/resource"; import { Button, Empty } from "ant-design-vue"; import { queenApi, useModal } from "queenjs"; import { defineComponent, reactive } from "vue"; import { useRoute } from "vue-router"; import OutputTemplateItem from "./OutputTemplateItem"; export default defineComponent({ setup() { const resource = useResource(); const modal = useModal(); const route = useRoute(); const state = reactive({ list: [] as { id: string; qos: 1 }[], }) as any; const submit = async () => { if (state.list.length == 0) { queenApi.messageError("请选择至少一个模板"); return; } const isOk = await resource.actions.submitRender( route.params.id as string, state.list, [] ); if (isOk) { modal.submit(true); } }; return () => { return (
{resource.store.sourceDetail.images.length == 0 && ( )}
{resource.store.sourceDetail.images.map((record: any) => ( v.id == record.id)} onChange={(qos) => { const selected = state.list.find( (v: any) => v.id == record.id ); selected.qos = qos; }} onSelect={() => { const selected = !!state.list.find( (v: any) => v.id == record.id ); if (selected) { const index = state.list.findIndex( (d: any) => d.id == record.id ); state.list.splice(index); return; } state.list.push({ id: record.id, qos: 1 }); }} /> ))}
); }; }, });