Commit 0f387267 authored by 左玲玲's avatar 左玲玲 😬

1723

parent e2fb5688
...@@ -57,6 +57,14 @@ const Mtable = (props) => { ...@@ -57,6 +57,14 @@ const Mtable = (props) => {
//调用接口 //调用接口
const request = async (params, sort, filter) => { const request = async (params, sort, filter) => {
if (!path) return; if (!path) return;
for (let i in params) {
let itemType = columns.filter(it => it.key == i)?.[0]?.valueType ?? '';
if (itemType && (itemType == 'dateTimeRange' || itemType == 'dateRange' || itemType == 'timeRange' || itemType == 'checkbox')) {
if (params[i] === '') {
params[i] = undefined;
}
}
}
let newparams = { let newparams = {
...extraparams, //父组件传参 ...extraparams, //父组件传参
...params, ...params,
...@@ -68,6 +76,7 @@ const Mtable = (props) => { ...@@ -68,6 +76,7 @@ const Mtable = (props) => {
delete newparams.pageIndex; delete newparams.pageIndex;
delete newparams.pageSize; delete newparams.pageSize;
} }
const result = await doFetch({ url: path, params: newparams }); const result = await doFetch({ url: path, params: newparams });
//分页结果 //分页结果
let data = result?.data?.page?.list, let data = result?.data?.page?.list,
...@@ -424,7 +433,7 @@ const Mtable = (props) => { ...@@ -424,7 +433,7 @@ const Mtable = (props) => {
} }
search={{ search={{
filterType: 'light', //轻量模式 filterType: 'light', //轻量模式
placement: 'bottomLeft', placement: 'bottomLeft'
}} }}
/> />
); );
......
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