--黄金指标增加排序

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,9 +311,7 @@ function fnDesign() {
onMounted(() => { onMounted(() => {
// 获取网元网元列表 // 获取网元网元列表
neInfoStore neInfoStore.fnNelist().then(res => {
.fnNelist()
.then(res => {
if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) {
if (res.data.length > 0) { if (res.data.length > 0) {
// 过滤不可用的网元 // 过滤不可用的网元
@@ -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>