This commit is contained in:
2025-12-06 18:58:31 +08:00
parent ac0e980f34
commit 0b0482a217

View File

@@ -18,7 +18,7 @@ export class Core {
key = 'core'; key = 'core';
title = '默认表'; title = '默认表';
description = '默认表描述'; description = '默认表描述';
tableId?: string; #tableId?: string;
constructor(opts: { constructor(opts: {
nocoApi: NocoApi, nocoApi: NocoApi,
baseId?: string, baseId?: string,
@@ -28,6 +28,15 @@ export class Core {
this.baseId = opts.baseId; this.baseId = opts.baseId;
this.tableId = opts.tableId; this.tableId = opts.tableId;
} }
get tableId() {
return this.#tableId;
}
set tableId(id: string | undefined) {
this.#tableId = id;
if (this.nocoApi.record && id) {
this.nocoApi.record.table = id;
}
}
async createTable(opts?: { columns?: any[], title?: string, description?: string, baseId?: string }): Promise<ReponseData<{ id: string, title: string }>> { async createTable(opts?: { columns?: any[], title?: string, description?: string, baseId?: string }): Promise<ReponseData<{ id: string, title: string }>> {
const baseId = opts?.baseId ?? this.baseId!; const baseId = opts?.baseId ?? this.baseId!;
const title = opts?.title ?? this.title; const title = opts?.title ?? this.title;