Browse Source

fix: ES日志创建时间多语言

pull/89/head
王军 3 years ago
parent
commit
e47c369157
  1. 52
      vben28/src/views/admin/elasticSearch/ElasticSearch.ts

52
vben28/src/views/admin/elasticSearch/ElasticSearch.ts

@ -1,52 +1,52 @@
import { FormSchema } from "/@/components/Table"; import { FormSchema } from '/@/components/Table';
import { BasicColumn } from "/@/components/Table"; import { BasicColumn } from '/@/components/Table';
import { useI18n } from "/@/hooks/web/useI18n"; import { useI18n } from '/@/hooks/web/useI18n';
const { t } = useI18n(); const { t } = useI18n();
import { formatToDateTime,dateUtil } from '/@/utils/dateUtil'; import { formatToDateTime, dateUtil } from '/@/utils/dateUtil';
import { import {
EsLogServiceProxy, EsLogServiceProxy,
PagingElasticSearchLogInput, PagingElasticSearchLogInput,
PagingElasticSearchLogOutputCustomePagedResultDto PagingElasticSearchLogOutputCustomePagedResultDto,
} from "/@/services/ServiceProxies"; } from '/@/services/ServiceProxies';
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ {
field: "filter", field: 'filter',
component: "Input", component: 'Input',
label: t("common.key"), label: t('common.key'),
labelWidth: 80, labelWidth: 80,
colProps: { colProps: {
span: 6 span: 6,
} },
}, },
{ {
field: "time", field: 'time',
component: "RangePicker", component: 'RangePicker',
label: "创建时间:", label: t('common.creationTime'),
labelWidth: 80, labelWidth: 80,
colProps: { span: 6 }, colProps: { span: 6 },
defaultValue: [dateUtil().subtract(0, "days"), dateUtil().add(1, "days")] defaultValue: [dateUtil().subtract(0, 'days'), dateUtil().add(1, 'days')],
} },
]; ];
export const tableColumns: BasicColumn[] = [ export const tableColumns: BasicColumn[] = [
{ {
title: t("routes.admin.logLevel"), title: t('routes.admin.logLevel'),
dataIndex: "level", dataIndex: 'level',
width: 200 width: 200,
}, },
{ {
title: t("common.creationTime"), title: t('common.creationTime'),
dataIndex: "creationTime", dataIndex: 'creationTime',
customRender: ({ text }) => { customRender: ({ text }) => {
return formatToDateTime(text); return formatToDateTime(text);
}, },
width: 200 width: 200,
}, },
{ {
title: t("routes.admin.logContent"), title: t('routes.admin.logContent'),
dataIndex: "message" dataIndex: 'message',
} },
]; ];
/** /**
@ -55,7 +55,7 @@ export const tableColumns: BasicColumn[] = [
* @returns * @returns
*/ */
export async function getElasticSearchLogAsync( export async function getElasticSearchLogAsync(
request: PagingElasticSearchLogInput request: PagingElasticSearchLogInput,
): Promise<PagingElasticSearchLogOutputCustomePagedResultDto> { ): Promise<PagingElasticSearchLogOutputCustomePagedResultDto> {
const _elasticSearchServiceProxy = new EsLogServiceProxy(); const _elasticSearchServiceProxy = new EsLogServiceProxy();
return await _elasticSearchServiceProxy.page(request); return await _elasticSearchServiceProxy.page(request);

Loading…
Cancel
Save