import * as React from 'react'; import { SearchBox, List, Muted, LMR } from 'tonva-react-form'; import { TuidMain, Entity } from '../../entities'; import { Page } from 'tonva-tools'; import { CLink } from '../link'; import { VEntity } from '../CVEntity'; import { CTuidMain, TuidUI } from './cTuid'; export class VTuidMain extends VEntity { protected controller: CTuidMain; onNew = () => this.event('new'); onList = () => this.event('list'); onSearch = async (key:string) => this.event('list', key); async open(param?:any):Promise { this.openPage(this.view); } protected entityRender(link: CLink, index: number): JSX.Element { return link.render(); } protected async entityClick(link: CLink) { await link.onClick(); } protected get view() { let {label, proxyLinks, isFrom} = this.controller; let newButton:any; if (isFrom === false) newButton = ; let content:any; if (proxyLinks === undefined) { let right = <> {newButton} ; content = ; } else { content = {label} 代理下列Tuid} items={proxyLinks} item={{render: this.entityRender, onClick:this.entityClick}} /> } return () => {content} ; } }