改为时间戳且加上快捷时间选择
This commit is contained in:
@@ -1065,6 +1065,8 @@ export default {
|
|||||||
expression:'Expression',
|
expression:'Expression',
|
||||||
description:' Description',
|
description:' Description',
|
||||||
kpiSet:' Statistical Settings',
|
kpiSet:' Statistical Settings',
|
||||||
|
sixHoursAgo:'Six hours ago',
|
||||||
|
threeHoursAgo:'Three hours ago.',
|
||||||
delCustomTip:'Confirm deletion of data item with record number {num}?',
|
delCustomTip:'Confirm deletion of data item with record number {num}?',
|
||||||
delCustom:' Successfully delete record number {num} custom indicator',
|
delCustom:' Successfully delete record number {num} custom indicator',
|
||||||
addCustom:' Add custom indicator',
|
addCustom:' Add custom indicator',
|
||||||
|
|||||||
@@ -1065,6 +1065,8 @@ export default {
|
|||||||
expression:'计算公式',
|
expression:'计算公式',
|
||||||
description:'描述',
|
description:'描述',
|
||||||
kpiSet:'统计设置',
|
kpiSet:'统计设置',
|
||||||
|
sixHoursAgo:'6小时前',
|
||||||
|
threeHoursAgo:'3小时前',
|
||||||
delCustomTip:'确认删除记录编号为 {num} 的数据项?',
|
delCustomTip:'确认删除记录编号为 {num} 的数据项?',
|
||||||
delCustom:'成功删除记录编号为 {num} 自定义指标',
|
delCustom:'成功删除记录编号为 {num} 自定义指标',
|
||||||
addCustom:'添加自定义指标',
|
addCustom:'添加自定义指标',
|
||||||
@@ -1337,8 +1339,8 @@ export default {
|
|||||||
filter: "全局过滤",
|
filter: "全局过滤",
|
||||||
startTime: '开始时间',
|
startTime: '开始时间',
|
||||||
endTime: '结束时间',
|
endTime: '结束时间',
|
||||||
today: '昨天',
|
today: '今天',
|
||||||
yesterday: '今天',
|
yesterday: '昨天',
|
||||||
week: '本周',
|
week: '本周',
|
||||||
month: '本月',
|
month: '本月',
|
||||||
avgLoad: '平均负载',
|
avgLoad: '平均负载',
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ import saveAs from 'file-saver';
|
|||||||
import { generateColorRGBA } from '@/utils/generate-utils';
|
import { generateColorRGBA } from '@/utils/generate-utils';
|
||||||
import { OptionsType, WS } from '@/plugins/ws-websocket';
|
import { OptionsType, WS } from '@/plugins/ws-websocket';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
import dayjs, { Dayjs } from 'dayjs';
|
||||||
const neInfoStore = useNeInfoStore();
|
const neInfoStore = useNeInfoStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { t, currentLocale } = useI18n();
|
const { t, currentLocale } = useI18n();
|
||||||
@@ -77,6 +78,19 @@ let neCascaderOptions = ref<Record<string, any>[]>([]);
|
|||||||
/**记录开始结束时间 */
|
/**记录开始结束时间 */
|
||||||
let queryRangePicker = ref<[string, string]>(['', '']);
|
let queryRangePicker = ref<[string, string]>(['', '']);
|
||||||
|
|
||||||
|
/**时间选择 */
|
||||||
|
let ranges = ref<Record<string, [Dayjs, Dayjs]>>({
|
||||||
|
[t('views.perfManage.customTarget.sixHoursAgo')]: [
|
||||||
|
dayjs().subtract(6, 'hours'),
|
||||||
|
dayjs(),
|
||||||
|
],
|
||||||
|
[t('views.perfManage.customTarget.threeHoursAgo')]: [
|
||||||
|
dayjs().subtract(3, 'hours'),
|
||||||
|
dayjs(),
|
||||||
|
],
|
||||||
|
[t('views.monitor.monitor.today')]: [dayjs().startOf('day'), dayjs()],
|
||||||
|
});
|
||||||
|
|
||||||
/**表格字段列 */
|
/**表格字段列 */
|
||||||
let tableColumns = ref<any[]>([]);
|
let tableColumns = ref<any[]>([]);
|
||||||
|
|
||||||
@@ -260,12 +274,14 @@ function fnGetListTitle() {
|
|||||||
tableColumns.value = [];
|
tableColumns.value = [];
|
||||||
tableColumnsDnd.value = [];
|
tableColumnsDnd.value = [];
|
||||||
fnRanderChartData();
|
fnRanderChartData();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
tableColumns.value = [];
|
tableColumns.value = [];
|
||||||
const columns: any[] = [];
|
const columns: any[] = [];
|
||||||
for (const item of res.data) {
|
for (const item of res.data) {
|
||||||
const kpiDisplay = item[`unit`]? item[`title`]+ `(${item['unit']})`:item[`title`];
|
const kpiDisplay = item[`unit`]
|
||||||
|
? item[`title`] + `(${item['unit']})`
|
||||||
|
: item[`title`];
|
||||||
const kpiValue = item[`kpiId`];
|
const kpiValue = item[`kpiId`];
|
||||||
columns.push({
|
columns.push({
|
||||||
title: kpiDisplay,
|
title: kpiDisplay,
|
||||||
@@ -626,9 +642,9 @@ onMounted(() => {
|
|||||||
|
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
now.setMinutes(0, 0, 0);
|
now.setMinutes(0, 0, 0);
|
||||||
queryRangePicker.value[0] = parseDateToStr(now.getTime());
|
queryRangePicker.value[0] = `${now.getTime()}`;
|
||||||
now.setMinutes(59, 59, 59);
|
now.setMinutes(59, 59, 59);
|
||||||
queryRangePicker.value[1] = parseDateToStr(now.getTime());
|
queryRangePicker.value[1] = `${now.getTime()}`;
|
||||||
fnGetListTitle();
|
fnGetListTitle();
|
||||||
// 绘图
|
// 绘图
|
||||||
fnRanderChart();
|
fnRanderChart();
|
||||||
@@ -658,10 +674,7 @@ onBeforeUnmount(() => {
|
|||||||
<a-form :model="queryParams" name="queryParamsFrom" layout="horizontal">
|
<a-form :model="queryParams" name="queryParamsFrom" layout="horizontal">
|
||||||
<a-row :gutter="16">
|
<a-row :gutter="16">
|
||||||
<a-col :lg="6" :md="12" :xs="24">
|
<a-col :lg="6" :md="12" :xs="24">
|
||||||
<a-form-item
|
<a-form-item name="neType" :label="t('views.ne.common.neType')">
|
||||||
name="neType"
|
|
||||||
:label="t('views.ne.common.neType')"
|
|
||||||
>
|
|
||||||
<a-cascader
|
<a-cascader
|
||||||
v-model:value="state.neType"
|
v-model:value="state.neType"
|
||||||
:options="neCascaderOptions"
|
:options="neCascaderOptions"
|
||||||
@@ -681,7 +694,8 @@ onBeforeUnmount(() => {
|
|||||||
:allow-clear="false"
|
:allow-clear="false"
|
||||||
:show-time="{ format: 'HH:mm:ss' }"
|
:show-time="{ format: 'HH:mm:ss' }"
|
||||||
format="YYYY-MM-DD HH:mm:ss"
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
value-format="YYYY-MM-DD HH:mm:ss"
|
value-format="x"
|
||||||
|
:ranges="ranges"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
></a-range-picker>
|
></a-range-picker>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|||||||
Reference in New Issue
Block a user