@cniot/mdd-render-pc-ftp
Advanced tools
Comparing version 0.0.6 to 0.0.7
{ | ||
"name": "@cniot/mdd-render-pc-ftp", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"description": "模型驱动FTP渲染组件", | ||
@@ -27,2 +27,2 @@ "scripts": { | ||
} | ||
} | ||
} |
@@ -7,8 +7,8 @@ const DEFAULT_CLOSE_MODE = ['close', 'esc', 'mask']; | ||
// v2 版本会导致dialog重复渲染3次 | ||
// v2: true, | ||
v2: true, | ||
title, | ||
visible: true, | ||
footer: false, | ||
width, | ||
height, | ||
width: Number(width) || undefined, | ||
height: Number(height) || undefined, | ||
closeMode, | ||
@@ -15,0 +15,0 @@ onClose() { |
@@ -10,3 +10,2 @@ import React from 'react'; | ||
const { tr } = i18n; | ||
const RESPONSIVE_GRID_COLUMES = 12; | ||
// Form Item type 的配对关系 | ||
@@ -27,3 +26,3 @@ const FIELD_ITEM_TYPE_MAP = { | ||
export default function ({ schema, engine }) { | ||
const { size = 'medium', fields = [], col = 4, labelSpan = 4, maxVisibleRow = 2 } = schema; | ||
const { fields = [], col = 4, labelSpan = 4, maxVisibleRow = 2 } = schema; | ||
@@ -34,7 +33,8 @@ const [filterModel] = React.useState(() => { | ||
const filter = useFilter( | ||
(filter) => { | ||
engine.emit(FILTER_SUBMIT, filter); | ||
(_) => { | ||
engine.emit(FILTER_SUBMIT, _); | ||
}, | ||
{ | ||
columns: col, | ||
maxVisibleRow, | ||
labelCol: { fixedSpan: labelSpan }, | ||
@@ -53,3 +53,3 @@ }, | ||
className="mdd-build-filter" | ||
onChange={(filter, item) => { | ||
onChange={(_, item) => { | ||
const { name, value } = item; | ||
@@ -56,0 +56,0 @@ filterModel.setValue(name, value); |
@@ -59,6 +59,9 @@ import React, { useEffect, useState, useRef } from 'react'; | ||
// 操作列 | ||
const operateColumn = { | ||
width: actionColumnWidth(actionColumns), | ||
buttons: actionColumn, | ||
}; | ||
const operateColumn = | ||
actionColumn && actionColumn.length > 0 | ||
? { | ||
width: actionColumnWidth(actionColumns), | ||
buttons: actionColumn, | ||
} | ||
: null; | ||
@@ -116,3 +119,3 @@ // 批量操作区, 左侧操作区 | ||
const result = { total: 0, list: [] }; | ||
const result = { total: 0, dataSource: [] }; | ||
try { | ||
@@ -129,4 +132,4 @@ const ajax = engine.getModule(MODULE_AJAX); | ||
}); | ||
result.total = res.paging.totalCount; | ||
result.dataSource = res.tableData; | ||
result.total = res?.paging?.totalCount || 0; | ||
result.dataSource = res?.tableData || []; | ||
} catch (e) { | ||
@@ -136,3 +139,7 @@ console.error('data source load error:', api, e); | ||
tableModel.setCurrentPage(currentPage).setPageSize(pageSize).setTableData(result.list).setTotalCount(result.total); | ||
tableModel | ||
.setCurrentPage(currentPage) | ||
.setPageSize(pageSize) | ||
.setTableData(result.dataSource) | ||
.setTotalCount(result.total); | ||
return result; | ||
@@ -142,15 +149,16 @@ }; | ||
const tableProps = useTable(pageQueryAsync); | ||
const { pageInfo } = tableProps; | ||
const { pageInfo, onSizeChange, toolbar } = tableProps; | ||
const [realColumns, setRealColumns] = useState(tableColumns); | ||
const [realAllColumns, setRealAllColumns] = useState(tableColumns); | ||
// 操作区 | ||
const toolBar = { | ||
const realToolBar = { | ||
...toolbar, | ||
batchArea: realBulkActions, | ||
toolArea: realHeaderToolbar, | ||
settings: ['size', 'zebra', 'fullscreen', 'columnSet'], | ||
sizeChange(size) { | ||
console.log('size: ', size); | ||
columnChange(showColumns, allColumns) { | ||
setRealColumns(showColumns); | ||
setRealAllColumns(allColumns); | ||
}, | ||
columnChange(newColumn) { | ||
console.log('newColumn: ', newColumn); | ||
}, | ||
screenChange(isFullScreen) { | ||
@@ -193,8 +201,10 @@ console.log('isFullScreen: ', isFullScreen); | ||
{...tableProps} | ||
pageSizeList={[10, 20, 50, 100]} | ||
paging={!isSimpleTable} | ||
{...rowSelectionProps} | ||
columns={tableColumns} | ||
columns={realColumns} | ||
allColumns={realAllColumns} | ||
primaryKey={primaryKey} | ||
operateColumn={operateColumn} | ||
toolbar={toolBar} | ||
toolbar={realToolBar} | ||
/> | ||
@@ -201,0 +211,0 @@ </div> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses eval() which is a dangerous function. This prevents the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
2
0
149512
31
1119