From 0023e419e576210ff485875ecad624f595b1e304 Mon Sep 17 00:00:00 2001 From: hsm-lv Date: Tue, 18 Oct 2022 20:39:38 +0800 Subject: [PATCH] =?UTF-8?q?[amis-saas-7476]:=E5=87=A0=E4=B8=AAbuild=20warg?= =?UTF-8?q?ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I4bce64b31260d9f1d53e0f8e9969e5eb8488b5e4 --- packages/amis-editor/src/plugin/CRUD2.tsx | 10 +++++----- packages/amis-editor/src/plugin/Table-v2.tsx | 12 ++++++------ packages/amis-editor/src/plugin/TableCell-v2.tsx | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/amis-editor/src/plugin/CRUD2.tsx b/packages/amis-editor/src/plugin/CRUD2.tsx index 22c0f7d07..0ab441303 100644 --- a/packages/amis-editor/src/plugin/CRUD2.tsx +++ b/packages/amis-editor/src/plugin/CRUD2.tsx @@ -610,7 +610,7 @@ export class CRUDPlugin extends BasePlugin { }); // 只有表格才能找到操作列放这个内容,卡片和列表不知道位置 - if (context.schema.mode === 'table-v2') { + if (context.schema.mode === 'table2') { DataOperators.forEach(op => { if (!builder.features.includes(op.value)) { return; @@ -681,7 +681,7 @@ export class CRUDPlugin extends BasePlugin { } const existCols = - node!.children.find(child => child.type === 'table-v2')?.children[0] + node!.children.find(child => child.type === 'table2')?.children[0] ?.children || []; const hasOperatorCol = node!.schema.columns?.some( (col: any) => col.type === 'operation' @@ -741,7 +741,7 @@ export class CRUDPlugin extends BasePlugin { // context.node. // // 只有表格才能找到操作列放这个内容,卡片和列表不知道位置 - // if (context.schema.mode === 'table-v2') { + // if (context.schema.mode === 'table2') { // DataOperators.forEach(op => { // if (!builder.features.includes(op.value)) { // return; @@ -1422,7 +1422,7 @@ export class CRUDPlugin extends BasePlugin { async buildDataSchemas(node: EditorNodeType, region?: EditorNodeType) { const child: EditorNodeType = node.children.find( - item => !!~['table-v2', 'cards', 'list'].indexOf(item.type) + item => !!~['table2', 'cards', 'list'].indexOf(item.type) ); let items; @@ -1531,7 +1531,7 @@ export class TableCRUDPlugin extends CRUDPlugin { scaffold: any = { type: 'crud2', - mode: 'table-v2', + mode: 'table2', columns: [ { key: 'id', diff --git a/packages/amis-editor/src/plugin/Table-v2.tsx b/packages/amis-editor/src/plugin/Table-v2.tsx index e11404123..98d8d337a 100644 --- a/packages/amis-editor/src/plugin/Table-v2.tsx +++ b/packages/amis-editor/src/plugin/Table-v2.tsx @@ -27,7 +27,7 @@ import {getArgsWrapper} from '../renderer/event-control/helper'; export class TableV2Plugin extends BasePlugin { // 关联渲染器名字 - rendererName = 'table-v2'; + rendererName = 'table2'; $schema = '/schemas/TableSchema.json'; // 组件名称 @@ -41,12 +41,12 @@ export class TableV2Plugin extends BasePlugin { icon = 'fa fa-table'; scaffold: SchemaObject = { - type: 'table-v2', + type: 'table2', columns: [ { title: '列信息', - key: 'a' + name: 'a' } ], @@ -64,7 +64,7 @@ export class TableV2Plugin extends BasePlugin { ]; previewSchema: any = { - type: 'table-v2', + type: 'table2', className: 'text-left m-b-none', items: [ {a: 1, b: 2, c: 9}, @@ -342,7 +342,7 @@ export class TableV2Plugin extends BasePlugin { } const result: any = { - $id: 'table-v2', + $id: 'table2', type: 'object', properties: { items: { @@ -870,7 +870,7 @@ export class TableV2Plugin extends BasePlugin { if ( !schema.$$id && ['crud', 'crud2'].includes(schema.$$editor?.renderer.name) && - renderer.name === 'table-v2' + renderer.name === 'table2' ) { return { ...({id: schema.$$editor.id} as any), diff --git a/packages/amis-editor/src/plugin/TableCell-v2.tsx b/packages/amis-editor/src/plugin/TableCell-v2.tsx index d06b38888..789555654 100644 --- a/packages/amis-editor/src/plugin/TableCell-v2.tsx +++ b/packages/amis-editor/src/plugin/TableCell-v2.tsx @@ -28,7 +28,7 @@ export class TableCellV2Plugin extends BasePlugin { const {context, data} = event.context; if ( !context.node.parent?.parent?.type || - context.node.parent.parent.type !== 'table-v2' + context.node.parent.parent.type !== 'table2' ) { return; }