[amis-saas-7476]:几个build warging

Change-Id: I4bce64b31260d9f1d53e0f8e9969e5eb8488b5e4
This commit is contained in:
hsm-lv 2022-10-18 20:39:38 +08:00
parent 7df75b140c
commit 0023e419e5
3 changed files with 12 additions and 12 deletions

View File

@ -610,7 +610,7 @@ export class CRUDPlugin extends BasePlugin {
}); });
// 只有表格才能找到操作列放这个内容,卡片和列表不知道位置 // 只有表格才能找到操作列放这个内容,卡片和列表不知道位置
if (context.schema.mode === 'table-v2') { if (context.schema.mode === 'table2') {
DataOperators.forEach(op => { DataOperators.forEach(op => {
if (!builder.features.includes(op.value)) { if (!builder.features.includes(op.value)) {
return; return;
@ -681,7 +681,7 @@ export class CRUDPlugin extends BasePlugin {
} }
const existCols = const existCols =
node!.children.find(child => child.type === 'table-v2')?.children[0] node!.children.find(child => child.type === 'table2')?.children[0]
?.children || []; ?.children || [];
const hasOperatorCol = node!.schema.columns?.some( const hasOperatorCol = node!.schema.columns?.some(
(col: any) => col.type === 'operation' (col: any) => col.type === 'operation'
@ -741,7 +741,7 @@ export class CRUDPlugin extends BasePlugin {
// context.node. // context.node.
// // 只有表格才能找到操作列放这个内容,卡片和列表不知道位置 // // 只有表格才能找到操作列放这个内容,卡片和列表不知道位置
// if (context.schema.mode === 'table-v2') { // if (context.schema.mode === 'table2') {
// DataOperators.forEach(op => { // DataOperators.forEach(op => {
// if (!builder.features.includes(op.value)) { // if (!builder.features.includes(op.value)) {
// return; // return;
@ -1422,7 +1422,7 @@ export class CRUDPlugin extends BasePlugin {
async buildDataSchemas(node: EditorNodeType, region?: EditorNodeType) { async buildDataSchemas(node: EditorNodeType, region?: EditorNodeType) {
const child: EditorNodeType = node.children.find( const child: EditorNodeType = node.children.find(
item => !!~['table-v2', 'cards', 'list'].indexOf(item.type) item => !!~['table2', 'cards', 'list'].indexOf(item.type)
); );
let items; let items;
@ -1531,7 +1531,7 @@ export class TableCRUDPlugin extends CRUDPlugin {
scaffold: any = { scaffold: any = {
type: 'crud2', type: 'crud2',
mode: 'table-v2', mode: 'table2',
columns: [ columns: [
{ {
key: 'id', key: 'id',

View File

@ -27,7 +27,7 @@ import {getArgsWrapper} from '../renderer/event-control/helper';
export class TableV2Plugin extends BasePlugin { export class TableV2Plugin extends BasePlugin {
// 关联渲染器名字 // 关联渲染器名字
rendererName = 'table-v2'; rendererName = 'table2';
$schema = '/schemas/TableSchema.json'; $schema = '/schemas/TableSchema.json';
// 组件名称 // 组件名称
@ -41,12 +41,12 @@ export class TableV2Plugin extends BasePlugin {
icon = 'fa fa-table'; icon = 'fa fa-table';
scaffold: SchemaObject = { scaffold: SchemaObject = {
type: 'table-v2', type: 'table2',
columns: [ columns: [
{ {
title: '列信息', title: '列信息',
key: 'a' name: 'a'
} }
], ],
@ -64,7 +64,7 @@ export class TableV2Plugin extends BasePlugin {
]; ];
previewSchema: any = { previewSchema: any = {
type: 'table-v2', type: 'table2',
className: 'text-left m-b-none', className: 'text-left m-b-none',
items: [ items: [
{a: 1, b: 2, c: 9}, {a: 1, b: 2, c: 9},
@ -342,7 +342,7 @@ export class TableV2Plugin extends BasePlugin {
} }
const result: any = { const result: any = {
$id: 'table-v2', $id: 'table2',
type: 'object', type: 'object',
properties: { properties: {
items: { items: {
@ -870,7 +870,7 @@ export class TableV2Plugin extends BasePlugin {
if ( if (
!schema.$$id && !schema.$$id &&
['crud', 'crud2'].includes(schema.$$editor?.renderer.name) && ['crud', 'crud2'].includes(schema.$$editor?.renderer.name) &&
renderer.name === 'table-v2' renderer.name === 'table2'
) { ) {
return { return {
...({id: schema.$$editor.id} as any), ...({id: schema.$$editor.id} as any),

View File

@ -28,7 +28,7 @@ export class TableCellV2Plugin extends BasePlugin {
const {context, data} = event.context; const {context, data} = event.context;
if ( if (
!context.node.parent?.parent?.type || !context.node.parent?.parent?.type ||
context.node.parent.parent.type !== 'table-v2' context.node.parent.parent.type !== 'table2'
) { ) {
return; return;
} }