--黄金指标增加排序

This commit is contained in:
lai
2023-12-27 17:08:33 +08:00
parent 45b04975eb
commit 9fdf13676e
2 changed files with 64 additions and 45 deletions

View File

@@ -91,6 +91,8 @@ export async function goldData(query: Record<string, any>) {
startTime: query.beginTime, startTime: query.beginTime,
endTime: query.endTime, endTime: query.endTime,
interval: query.particle, interval: query.particle,
sortField:query.sortField,
sortOrder:query.sortOrder
}, },
timeout: 60_000, timeout: 60_000,
}); });

View File

@@ -92,8 +92,24 @@ let queryParams: any = reactive({
particle: '15', particle: '15',
beginTime: '', beginTime: '',
endTime: '', endTime: '',
/**排序字段 */
sortField: 'timeGroup',
/**排序方式 */
sortOrder: 'asc',
}); });
/**表格分页、排序、筛选变化时触发操作, 排序方式,取值为 ascend descend */
function fnTableChange(pagination: any, filters: any, sorter: any, extra: any) {
const { columnKey, order } = sorter;
if (order) {
queryParams.sortField = columnKey;
queryParams.sortOrder = order.replace('end', '');
} else {
queryParams.sortOrder = 'asc';
}
fnMakeTable(1);
}
/**图表显示数据 */ /**图表显示数据 */
const chartsOption = reactive({ const chartsOption = reactive({
/**性能指标 */ /**性能指标 */
@@ -196,6 +212,8 @@ function fnDesign() {
dataIndex: 'timeGroup', dataIndex: 'timeGroup',
align: 'center', align: 'center',
fixed: 'right', fixed: 'right',
key: 'timeGroup',
sorter: true,
}); });
if (!queryRangePicker.value) { if (!queryRangePicker.value) {
queryRangePicker.value = ['', '']; queryRangePicker.value = ['', ''];
@@ -216,7 +234,7 @@ function fnDesign() {
.filter(key => !['timeGroup', 'neName', 'startIndex'].includes(key)) .filter(key => !['timeGroup', 'neName', 'startIndex'].includes(key))
.map(key => { .map(key => {
const title: any = findTitleByKey(key); const title: any = findTitleByKey(key);
hideAll[title]=false; hideAll[title] = false;
return { return {
name: title, name: title,
data: res.data.map((item: any) => parseInt(item[key])), data: res.data.map((item: any) => parseInt(item[key])),
@@ -260,7 +278,7 @@ function fnDesign() {
color: '#646A73', color: '#646A73',
}, },
icon: 'circle', icon: 'circle',
selected:hideAll, selected: hideAll,
}, },
grid: { grid: {
left: '10%', left: '10%',
@@ -293,52 +311,50 @@ function fnDesign() {
onMounted(() => { onMounted(() => {
// 获取网元网元列表 // 获取网元网元列表
neInfoStore neInfoStore.fnNelist().then(res => {
.fnNelist() if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
.then(res => { if (res.data.length > 0) {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { // 过滤不可用的网元
if (res.data.length > 0) { neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter(
// 过滤不可用的网元 (item: any) => {
neCascaderOptions.value = neInfoStore.getNeCascaderOptions.filter( return !['OMC'].includes(item.value);
(item: any) => {
return !['OMC'].includes(item.value);
}
);
if (neCascaderOptions.value.length === 0) {
message.warning({
content: t('common.noData'),
duration: 2,
});
return;
} }
// 默认选择AMF );
const item = neCascaderOptions.value.find(s => s.value === 'UPF'); if (neCascaderOptions.value.length === 0) {
if (item && item.children) { message.warning({
const info = item.children[0]; content: t('common.noData'),
queryParams.neType = [info.neType, info.neId]; duration: 2,
} else { });
const info = neCascaderOptions.value[0].children[0]; return;
queryParams.neType = [info.neType, info.neId];
}
const initTime: Date = new Date();
const startTime: Date = new Date(initTime);
startTime.setHours(0, 0, 0, 0); // 设置为今天的0点
const endTime: Date = new Date(initTime);
endTime.setHours(23, 59, 59, 59); // 设置为今天的12点
queryRangePicker.value = [
parseDateToStr(startTime),
parseDateToStr(endTime),
];
fnGetList();
} }
} else { // 默认选择AMF
message.warning({ const item = neCascaderOptions.value.find(s => s.value === 'UPF');
content: t('common.noData'), if (item && item.children) {
duration: 2, const info = item.children[0];
}); queryParams.neType = [info.neType, info.neId];
} else {
const info = neCascaderOptions.value[0].children[0];
queryParams.neType = [info.neType, info.neId];
}
const initTime: Date = new Date();
const startTime: Date = new Date(initTime);
startTime.setHours(0, 0, 0, 0); // 设置为今天的0点
const endTime: Date = new Date(initTime);
endTime.setHours(23, 59, 59, 59); // 设置为今天的12点
queryRangePicker.value = [
parseDateToStr(startTime),
parseDateToStr(endTime),
];
fnGetList();
} }
}); } else {
message.warning({
content: t('common.noData'),
duration: 2,
});
}
});
}); });
</script> </script>
@@ -481,6 +497,7 @@ onMounted(() => {
:scroll="{ x: tableColumnsDnd.length * 200, y: 450 }" :scroll="{ x: tableColumnsDnd.length * 200, y: 450 }"
@resizeColumn="(w:number, col:any) => (col.width = w)" @resizeColumn="(w:number, col:any) => (col.width = w)"
:show-expand-column="false" :show-expand-column="false"
@change="fnTableChange"
> >
</a-table> </a-table>
</a-card> </a-card>