mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-14 22:25:19 +00:00
(feature)(webapp) use nativeQuery field to determine whether it is a selection (#222)
This commit is contained in:
@@ -61,6 +61,11 @@ const Table: React.FC<Props> = ({ data, size, onApplyAuth }) => {
|
||||
return index % 2 !== 0 ? `${prefixCls}-even-row` : '';
|
||||
};
|
||||
|
||||
const dateColumn = queryColumns.find(column => column.type === 'DATE');
|
||||
const dataSource = dateColumn
|
||||
? queryResults.sort((a, b) => moment(a[dateColumn.nameEn]).diff(moment(b[dateColumn.nameEn])))
|
||||
: queryResults;
|
||||
|
||||
return (
|
||||
<div className={prefixCls}>
|
||||
<AntTable
|
||||
@@ -68,8 +73,8 @@ const Table: React.FC<Props> = ({ data, size, onApplyAuth }) => {
|
||||
queryResults.length <= 10 ? false : { defaultPageSize: 10, position: ['bottomCenter'] }
|
||||
}
|
||||
columns={tableColumns}
|
||||
dataSource={queryResults}
|
||||
style={{ width: '100%', overflowX: 'auto' }}
|
||||
dataSource={dataSource}
|
||||
style={{ width: '100%', overflowX: 'auto', overflowY: 'hidden' }}
|
||||
rowClassName={getRowClassName}
|
||||
size={size}
|
||||
/>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useCallback, useEffect, useState } from 'react';
|
||||
import { MsgDataType } from '../../../common/type';
|
||||
import { getToken, isProd } from '../../../utils/utils';
|
||||
import { webPageHost } from '../../../common/env';
|
||||
|
||||
type Props = {
|
||||
id: string | number;
|
||||
@@ -88,6 +89,7 @@ const WebPage: React.FC<Props> = ({ id, data }) => {
|
||||
'?',
|
||||
`?token=${getToken()}&miniProgram=true&reportName=${name}&filterData=${filterData}&`
|
||||
);
|
||||
urlValue = `${webPageHost}${urlValue}`;
|
||||
} else {
|
||||
const params = Object.keys(valueParams || {}).map(key => `${key}=${valueParams[key]}`);
|
||||
if (params.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user