Commit f6f15a3b authored by TZW's avatar TZW

去除 log

parent d094b7af
...@@ -43,7 +43,6 @@ const Mtable = (props) => { ...@@ -43,7 +43,6 @@ const Mtable = (props) => {
dataSource, dataSource,
} = props; } = props;
console.log('this is path:', path);
const actionRefs = actionRef ?? useRef(), const actionRefs = actionRef ?? useRef(),
formRefs = formRef ?? useRef(), formRefs = formRef ?? useRef(),
ifspagination = pagination == 'false' || pagination === false, ifspagination = pagination == 'false' || pagination === false,
...@@ -92,10 +91,10 @@ const Mtable = (props) => { ...@@ -92,10 +91,10 @@ const Mtable = (props) => {
let itemwidth = valueColumns[it.key]?.width let itemwidth = valueColumns[it.key]?.width
? valueColumns[it.key].width ? valueColumns[it.key].width
: it.width : it.width
? it.width ? it.width
: resizeable : resizeable
? 160 ? 160
: 'auto'; : 'auto';
let options = {}; let options = {};
if (['select', 'treeSelect', 'radio', 'checkbox', 'cascader'].includes(it?.valueType)) { if (['select', 'treeSelect', 'radio', 'checkbox', 'cascader'].includes(it?.valueType)) {
if (Array.isArray(it.options)) { if (Array.isArray(it.options)) {
...@@ -279,79 +278,79 @@ const Mtable = (props) => { ...@@ -279,79 +278,79 @@ const Mtable = (props) => {
//缩放表格 //缩放表格
const handleResize = const handleResize =
(index) => (index) =>
(e, { size }) => { (e, { size }) => {
e.stopImmediatePropagation(); e.stopImmediatePropagation();
setcolumnes((s) => { setcolumnes((s) => {
const nextColumns = [...s]; const nextColumns = [...s];
nextColumns[index] = { nextColumns[index] = {
...nextColumns[index], ...nextColumns[index],
width: size.width, width: size.width,
}; };
return nextColumns; return nextColumns;
}); });
}; };
//更新表格缩放 //更新表格缩放
const handleResizeStop = const handleResizeStop =
(index) => (index) =>
(e, { size }) => { (e, { size }) => {
e.stopImmediatePropagation(); e.stopImmediatePropagation();
let submitdata = { ...valueColumns } ?? {}, let submitdata = { ...valueColumns } ?? {},
curkey = Object.keys(submitdata)[index]; curkey = Object.keys(submitdata)[index];
submitdata[curkey].width = parseInt(size.width); submitdata[curkey].width = parseInt(size.width);
setvalueColumns(submitdata); setvalueColumns(submitdata);
doFetch({ doFetch({
url: '/ngic-base-business/paFieldScene/save', url: '/ngic-base-business/paFieldScene/save',
params: { params: {
sceneMark: activeTabKey ? path + activeTabKey : path, sceneMark: activeTabKey ? path + activeTabKey : path,
controList: Object.keys(submitdata).map((it, i) => { controList: Object.keys(submitdata).map((it, i) => {
return { return {
fieldKey: it, fieldKey: it,
fieldWidth: i == index ? parseInt(size.width) : submitdata[it].width, fieldWidth: i == index ? parseInt(size.width) : submitdata[it].width,
fieldOrder: submitdata[it].order, fieldOrder: submitdata[it].order,
fieldFixed: submitdata[it].fixed, fieldFixed: submitdata[it].fixed,
fieldShow: submitdata[it].show, fieldShow: submitdata[it].show,
}; };
}), }),
}, },
}); });
}; };
const components = resizeable const components = resizeable
? { ? {
components: { components: {
header: { header: {
cell: Resizecell, cell: Resizecell,
},
}, },
}, columnsState: {
columnsState: { value: valueColumns,
value: valueColumns, onChange: (val, state) => {
onChange: (val, state) => { setvalueColumns((s) => {
setvalueColumns((s) => { let submitdata = {
let submitdata = { ...s,
...s, ...val,
...val, };
}; doFetch({
doFetch({ url: '/ngic-base-business/paFieldScene/save',
url: '/ngic-base-business/paFieldScene/save', params: {
params: { sceneMark: activeTabKey ? path + activeTabKey : path,
sceneMark: activeTabKey ? path + activeTabKey : path, controList: Object.keys(submitdata).map((it) => {
controList: Object.keys(submitdata).map((it) => { return {
return { fieldKey: it,
fieldKey: it, fieldWidth: submitdata[it].width,
fieldWidth: submitdata[it].width, fieldOrder: submitdata[it].order,
fieldOrder: submitdata[it].order, fieldFixed: submitdata[it].fixed,
fieldFixed: submitdata[it].fixed, fieldShow: submitdata[it].show,
fieldShow: submitdata[it].show, };
}; }),
}), },
}, });
return submitdata;
}); });
return submitdata; },
});
}, },
}, }
}
: {}; : {};
const datas = dataSource ? { dataSource, toolBarRender: false } : { request }; const datas = dataSource ? { dataSource, toolBarRender: false } : { request };
...@@ -400,19 +399,19 @@ const Mtable = (props) => { ...@@ -400,19 +399,19 @@ const Mtable = (props) => {
scroll={ scroll={
x x
? { ? {
x: x, x: x,
} }
: {} : {}
} }
pagination={ pagination={
pagination pagination
? { ? {
showTotal: (total, range) => <span>{total}</span>, showTotal: (total, range) => <span>{total}</span>,
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
pageSizeOptions: [5, 10, 15, 30, 50, 100, 200], pageSizeOptions: [5, 10, 15, 30, 50, 100, 200],
defaultPageSize: pageSize || 15, defaultPageSize: pageSize || 15,
} }
: false : false
} }
search={{ search={{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment