添加 table 业务组件

This commit is contained in:
金禅 2020-08-16 20:41:59 +08:00
parent fee2155ffb
commit 9924d5e87a

View File

@ -13,6 +13,13 @@
"urls": ["https://unpkg.antfin-inc.com/@alifd/next@1.20.0/dist/next.js", "https://unpkg.antfin-inc.com/@alifd/next@1.20.0/dist/next.css"], "urls": ["https://unpkg.antfin-inc.com/@alifd/next@1.20.0/dist/next.js", "https://unpkg.antfin-inc.com/@alifd/next@1.20.0/dist/next.css"],
"library": "Next" "library": "Next"
}, },
{
"title": "NextTable",
"package": "NextTable",
"version": "1.0.0",
"urls": ["http://localhost:3333/NextTable.js", "http://localhost:3333/NextTable.css"],
"library": "NextTable"
},
{ {
"title": "MCBreadcrumb", "title": "MCBreadcrumb",
"package": "mc-breadcrumb", "package": "mc-breadcrumb",
@ -176,7 +183,6 @@
"subName": "" "subName": ""
}, },
"props": [ "props": [
{ {
"name": "children", "name": "children",
"propType": "string", "propType": "string",
@ -218,7 +224,16 @@
"description": "分割线标题的位置", "description": "分割线标题的位置",
"defaultValue": "center" "defaultValue": "center"
} }
] ],
"experimental": {
"filters": [{
"name": "",
"filter": {
"type": "JSFunction",
"value": "filters"
}
}]
}
}, },
{ {
"componentName": "Drawer", "componentName": "Drawer",
@ -459,6 +474,163 @@
} }
] ]
}, },
{
"componentName": "NextTable",
"title": "NextTable",
"docUrl": "",
"screenshot": "",
"npm": {
"package": "NextTable",
"version": "1.19.18",
"exportName": "NextTable",
"main": "lib/index.js",
"subName": ""
},
"props": [
{
"name": "columns",
"title": "数据列",
"propType": {
"type": "arrayOf",
"value": {
"type": "shape",
"value": [
{
"name": "title",
"description": "列标题",
"propType": "string",
"defaultValue": "Title"
},
{
"name": "dataKey",
"description": "列索引",
"propType": "string",
"defaultValue": "Key"
},
{
"name": "dataType",
"description": "数据类型",
"propType": {
"type": "oneOf",
"value": [
"text",
"timestamp",
"cascadeTimestamp",
"employee",
"money",
"moneyRange"
]
},
"defaultValue": "Key"
},
{
"name": "editType",
"description": "编辑类型",
"propType": {
"type": "oneOf",
"value": [
"select",
"text",
"radio",
"date",
"employee"
]
},
"defaultValue": "Key"
}
]
}
}
},
{
"name": "data",
"title": "数据源",
"propType": {
"type": "oneOfType",
"value": [
"Json",
"JSExpression"
]
}
},
{
"name": "actionTitle",
"title": "操作列标题",
"propType": "string"
},
{
"name": "actionColumn",
"title": "操作列",
"propType": {
"type": "arrayOf",
"value": {
"type": "shape",
"value": [{
"name": "title",
"description": "列标题",
"propType": "string",
"defaultValue": "Title"
},{
"name": "callback",
"description": "callback",
"propType": "func",
"defaultValue": {
"type": "JSFunction",
"value": "(rowData, action, table) => {\n return table.editRow(rowData).then((row) => {\n console.log(row);\n })}"
}
}]
}
}
}
],
"configure": {
"props": [
{
"name": "action",
"title": "操作列",
"extraProps": {
"display": "entry"
},
"items": [
{
"name": "actionTitle",
"setter": "StringSetter"
},
{
"name": "actionColumn",
"title": "操作列",
"setter": {
"componentName": "ArraySetter",
"props": {
"itemSetter": {
"componentName": "ObjectSetter",
"props": {
"config": {
"items": [{
"name": "title",
"description": "列标题",
"setter": "StringSetter",
"defaultValue": "Title"
},{
"name": "callback",
"description": "callback",
"propType": "FunctionSetter",
"defaultValue": {
"type": "JSFunction",
"value": "(rowData, action, table) => {\n return table.editRow(rowData).then((row) => {\n console.log(row);\n })}"
}
}]
}
}
}
}
}
}
]
}
]
}
},
{ {
"componentName": "Table", "componentName": "Table",
"title": "Table", "title": "Table",
@ -477,6 +649,10 @@
"name": "prefix", "name": "prefix",
"propType": "string" "propType": "string"
}, },
{
"name": "children",
"propType": "string"
},
{ {
"name": "pure", "name": "pure",
"propType": "bool" "propType": "bool"
@ -705,15 +881,71 @@
} }
], ],
"configure": { "configure": {
"component": {
"isContainer": true
},
"props": { "props": {
"isExtends": true, "isExtends": true,
"override": [{ "override": [
{
"name": "dataSource", "name": "dataSource",
"setter": "JsonSetter" "setter": "JsonSetter"
}] },
{
"name": "children",
"setter": {
"componentName": "ArraySetter",
"props": {
"itemSetter": {
"componentName": "ObjectSetter",
"props": {
"config": {
"items": [
{
"name": "componentName",
"title": "子组件",
"defaultValue": "Table.Column",
"setter": {
"componentName": "StringSetter"
}
},
{
"name": "props",
"title": "props",
"setter": {
"componentName": "ObjectSetter",
"props": {
"config": {
"items": [
{
"name": "title",
"setter": {
"componentName": "StringSetter"
}
},
{
"name": "dataIndex",
"setter": {
"componentName": "StringSetter"
}
}
]
}
}
}
}
]
}
}
}
}
},
"extraProps": {
"defaultValue": "",
"onChange": {
"type": "JSFunction",
"value": "(val, field, editor) => {\n debugger;\n console.log('val', val);//field.nodes[0].children.import(val && {\"componentName\": \"Table.Column\", \"props\": {\"type\": val, \"style\": {\"marginRight\": 5}}}, true); //field.top.setPropValue('children', [{\"componentName\": \"Icon\", \"props\": {\"type\": val}}, (field.top.getPropValue('children') || []).slice(-1)]);\n}"
}
}
}
]
} }
} }
}, },
@ -13021,6 +13253,98 @@
} }
] ]
}, },
{
"componentName": "NextTable",
"title": "NextTable",
"icon": "https://alifd.oss-cn-hangzhou.aliyuncs.com/fusion-cool/icons/icon-light/ic_light_table.png",
"package": "NextTable",
"library": "NextTable",
"snippets": [{
"title": "NextTable",
"screenshot": "https://alifd.oss-cn-hangzhou.aliyuncs.com/fusion-cool/icons/icon-light/ic_light_table.png",
"schema": {
"componentName": "NextTable",
"props": {
"showMiniPager": true,
"showActionBar": true,
"actionBar": [
{
"title": "新增",
"type": "primary"
},
{
"title": "编辑"
}
],
"columns": [
{
"dataKey": "name",
"width": 200,
"align": "center",
"title": "姓名",
"editType": "text"
},
{
"dataKey": "age",
"width": 200,
"align": "center",
"title": "年龄"
},
{
"dataKey": "email",
"width": 200,
"align": "center",
"title": "邮箱"
}
],
"data": [
{
"name": "王小",
"id": "1",
"age": 15000,
"email": "aaa@abc.com"
},
{
"name": "王中",
"id": "2",
"age": 25000,
"email": "bbb@abc.com"
},
{
"name": "王大",
"id": "3",
"age": 35000,
"email": "ccc@abc.com"
}
],
"actionTitle": "操作",
"actionWidth": 180,
"actionType": "link",
"actionFixed": "right",
"actionHidden": false,
"maxWebShownActionCount": 2,
"actionColumn": [
{
"title": "编辑",
"callback": {
"type": "JSFunction",
"value": "(rowData, action, table) => {\n return table.editRow(rowData).then((row) => {\n console.log(row);\n });\n }"
},
"device": ["desktop"]
},
{
"title": "保存",
"callback": {
"type": "JSFunction",
"value": "(rowData, action, table) => { \nreturn table.saveRow(rowData).then((row) => { \nconsole.log(row); \n}); \n}"
},
"mode": "EDIT"
}
]
}
}
}]
},
{ {
"componentName": "Table", "componentName": "Table",
"title": "表格", "title": "表格",