列表导出功能修改、图形分析默认日期修改

This commit is contained in:
康冉冉
2025-09-08 18:11:21 +08:00
parent 223834134e
commit 5a35edad38
23 changed files with 276 additions and 221 deletions

View File

@@ -139,6 +139,7 @@ aside {
//main-container全局样式
.app-container {
height: calc(100vh - 132px);
padding: 8px 20px 20px;
}

View File

@@ -88,30 +88,41 @@
},
// 获取前一个月的所有日期
getDaysOfPreviousMonth(star, end) {
// 1. 获取当前日期(终点日期)
const currentDate = new Date();
const currentYear = currentDate.getFullYear();
const currentMonth = currentDate.getMonth(); // 0-11 表示 1-12
const endYear = currentDate.getFullYear();
const endMonth = currentDate.getMonth(); // 0=1月11=12月
const endDay = currentDate.getDate(); // 当前日如8
// 计算前一个月的年份和月份
const prevMonth = currentMonth - 1;
const prevYear = prevMonth >= 0 ? currentYear : currentYear - 1;
const prevMonthActual = prevMonth >= 0 ? prevMonth : 11; // 11 表示 12 月
// 2. 计算起点日期当前日期的“上月同日”处理边界如3月31日→2月28/29日
const startDate = new Date(endYear, endMonth, endDay);
// 核心将当前日期的月份减1得到上月同日自动处理天数不足问题
startDate.setMonth(startDate.getMonth() - 1);
// 获取第一天和最后一天
const firstDay = star ? new Date(star) : new Date(prevYear, prevMonthActual, 1);
const lastDay = end ? new Date(end) : new Date(prevYear, prevMonthActual + 1, 0); // 下个月首日减 1 天
// 3. 提取起点日期的年、月、日(用于循环判断)
const startYear = startDate.getFullYear();
const startMonth = startDate.getMonth();
const startDay = startDate.getDate();
// 生成所有日期
const oneMonthDays = [];
let currentDay = firstDay;
while (currentDay <= lastDay) {
// 格式化为 YYYY-MM-DD
const formattedDate = currentDay.toISOString().split('T')[0];
oneMonthDays.push(formattedDate);
currentDay = new Date(currentDay); // 避免引用同一对象
currentDay.setDate(currentDay.getDate() + 1);
// 4. 循环生成“起点~终点”的所有日期
const dateCollection = [];
// 临时日期:从起点日期开始递增
const tempDate = new Date(startYear, startMonth, startDay);
// 循环条件:临时日期 <= 当前日期(终点)
while (tempDate <= currentDate) {
// 格式化日期为“YYYY-MM-DD”补零处理如8月→085日→05
const year = tempDate.getFullYear();
const month = String(tempDate.getMonth() + 1).padStart(2, '0');
const day = String(tempDate.getDate()).padStart(2, '0');
const formattedDate = `${year}-${month}-${day}`;
dateCollection.push(formattedDate);
// 临时日期加1天进入下一天
tempDate.setDate(tempDate.getDate() + 1);
}
let timeArr = [oneMonthDays[0], oneMonthDays[oneMonthDays.length - 1]];
let timeArr = [dateCollection[0], dateCollection[dateCollection.length - 1]];
this.$emit("dataChange", this.isActive, [], timeArr);
// this.$emit("dataChange", this.isActive, oneMonthDays);
},
@@ -120,7 +131,7 @@
const threeMonths = [];
const today = new Date(); // 当前日期
const currentYear = today.getFullYear();
const currentMonth = today.getMonth(); // 月份从0开始0=1月11=12月
const currentMonth = today.getMonth() + 1; // 月份从0开始0=1月11=12月
// 循环获取前3个月i=0: 前1个月i=1: 前2个月i=2: 前3个月
for (let i = 1; i <= num; i++) {
// 计算目标月份(当前月 - i

View File

@@ -1,5 +1,5 @@
<template>
<div>
<div class="w100 h100">
<!-- 表格头部按钮 -->
<el-row :gutter="10" class="mb8">
<template v-if="config && config.tableButton && config.tableButton.top">
@@ -10,7 +10,7 @@
<right-toolbar v-if="!(config && config.colTopHiddenIcon)" :showSearch.sync="showSearch" @queryTable="renderList" :columns="columns"></right-toolbar>
</el-row>
<!-- 表格数据 -->
<el-table v-loading="loading" :data="tableList" ref="selChangeList" highlight-selection-row @selection-change="handleSelectionChange">
<el-table height="80%" v-loading="loading" :data="tableList" ref="selChangeList" highlight-selection-row @selection-change="handleSelectionChange">
<el-table-column v-if="!(config && config.colHiddenCheck)" fixed type="selection" width="55" align="center" />
<template v-for="(column, key, index) of columns">
<el-table-column v-if="column && column.visible" :label="column.label" :key="key" :prop="key" :width="column.width" :min-width="column.minWidth || '100px'" align="left" :show-overflow-tooltip="true">
@@ -47,7 +47,19 @@
</template>
</el-table-column>
</el-table>
<pagination v-show="queryParams.total > 0" :total="queryParams.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="renderList" />
<pagination v-show="queryParams.total > 0" :layout="queryParams && queryParams.layout" :total="queryParams.total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="renderList" />
<el-dialog title="导出项" :visible.sync="dialogOpen" width="800px" append-to-body>
<el-checkbox-group v-model="checkColumns">
<template v-for="(item, key, index) of columns">
<el-checkbox v-if="key !== 'id'" :label="key" :key="key" style="width: 25%;margin-right: 0px;">{{item.label}}</el-checkbox>
</template>
</el-checkbox-group>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="diaColSubmit"> </el-button>
<el-button @click="diaColCancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
@@ -66,9 +78,10 @@
queryParams: {
type: Object,
default: {
total: 0,
pageNum: 1,
pageSize: 10,
total: 0,
pageNum: 1,
pageSize: 10,
layout: 'total, sizes, prev, pager, next, jumper'
}
},
config: {
@@ -83,9 +96,11 @@
return {
loading: false,
showSearch: true,
dialogOpen: false,
ids: [],
selectList: [],
isProcessing: false, // 防止事件循环的标志位
checkColumns: []
}
},
// 监听showSearch的变化并且把变化后的值传给父组件
@@ -98,8 +113,35 @@
},
methods: {
// 所有方法都抛出到父组件里去
handleClick(item, row) {
this.$emit("fnClick", item, row, this.ids, this.selectList);
handleClick(result, row) {
if (result && result.fnCode) {
switch (result.fnCode) {
case 'export':
this.dialogOpen = true;
this.diaColumnCheck();
break;
default:
this.$emit("fnClick", result, row, this.ids, this.selectList);
}
}
},
// 导出弹窗 默认选中项
diaColumnCheck() {
this.checkColumns = [];
Object.keys(this.columns).forEach(item => {
if (item !== 'id' && this.columns[item] && this.columns[item].visible) {
this.checkColumns.push(item);
}
});
},
// 弹窗确认
diaColSubmit(){
this.$emit("fnClick", {fnCode: 'export'}, {properties: this.checkColumns});
this.dialogOpen = false;
},
// 弹窗取消
diaColCancel() {
this.dialogOpen = false;
},
/** 多选框选中数据 */

View File

@@ -123,14 +123,24 @@ service.interceptors.response.use(res => {
)
// 通用下载方法
export function download(url, params, filename, config) {
export function download(url, params, filename, config, type) {
let typeParams = {};
if (type && type === 'json') {
typeParams = {
headers: { 'Content-Type': 'application/json' },
responseType: 'blob',
...config
};
} else {
typeParams = {
transformRequest: [(params) => { return tansParams(params) }],
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob',
...config
};
}
downloadLoadingInstance = Loading.service({ text: "正在下载数据,请稍候", spinner: "el-icon-loading", background: "rgba(0, 0, 0, 0.7)", })
return service.post(url, params, {
transformRequest: [(params) => { return tansParams(params) }],
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
responseType: 'blob',
...config
}).then(async (data) => {
return service.post(url, params, typeParams).then(async (data) => {
const isBlob = blobValidate(data)
if (isBlob) {
const blob = new Blob([data])

View File

@@ -130,15 +130,15 @@
}).catch(() => {});
break;
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("rocketmq/cpuInfo/export", {
properties: dataList
}, `CPU数据_${new Date().getTime()}.xlsx`);
// let dataList = [];
// Object.keys(this.columns).forEach(item => {
// if (item.visible) {
// dataList.push(item.prop);
// }
// });
// this.download("rocketmq/cpuInfo/export", {properties: dataList}, `CPU数据_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign({}, this.queryParams,rowData);
this.download("rocketmq/cpuInfo/export", paramsList, `CPU数据_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:
}

View File

@@ -127,15 +127,15 @@
}).catch(() => {});
break;
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("rocketmq/diskInfo/export", {
properties: dataList
}, `磁盘数据_${new Date().getTime()}.xlsx`);
// let dataList = [];
// Object.keys(this.columns).forEach(item => {
// if (item.visible) {
// dataList.push(item.prop);
// }
// });
// this.download("rocketmq/diskInfo/export", {properties: dataList}, `磁盘数据_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign({}, this.queryParams,rowData);
this.download("rocketmq/diskInfo/export", paramsList, `磁盘数据_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:
}

View File

@@ -124,15 +124,15 @@
}).catch(() => {});
break;
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("rocketmq/dockerInfo/export", {
properties: dataList
}, `容器数据_${new Date().getTime()}.xlsx`);
// let dataList = [];
// Object.keys(this.columns).forEach(item => {
// if (item.visible) {
// dataList.push(item.prop);
// }
// });
// this.download("rocketmq/dockerInfo/export", {properties: dataList}, `容器数据_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign({}, this.queryParams,rowData);
this.download("rocketmq/dockerInfo/export", paramsList, `容器数据_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:
}

View File

@@ -124,15 +124,15 @@
}).catch(() => {});
break;
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("rocketmq/memoryInfo/export", {
properties: dataList
}, `内存信息数据_${new Date().getTime()}.xlsx`);
// let dataList = [];
// Object.keys(this.columns).forEach(item => {
// if (item.visible) {
// dataList.push(item.prop);
// }
// });
// this.download("rocketmq/memoryInfo/export", {properties: dataList}, `内存信息数据_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign({}, this.queryParams,rowData);
this.download("rocketmq/memoryInfo/export", paramsList, `内存信息数据_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:
}

View File

@@ -123,15 +123,15 @@
}).catch(() => {});
break;
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("rocketmq/mountPointInfo/export", {
properties: dataList
}, `挂载点信息数据_${new Date().getTime()}.xlsx`);
// let dataList = [];
// Object.keys(this.columns).forEach(item => {
// if (item.visible) {
// dataList.push(item.prop);
// }
// });
// this.download("rocketmq/mountPointInfo/export", {properties: dataList}, `挂载点信息数据_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign({}, this.queryParams,rowData);
this.download("rocketmq/mountPointInfo/export", paramsList, `挂载点信息数据_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:
}

View File

@@ -129,15 +129,15 @@
}).catch(() => {});
break;
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("rocketmq/systemInfo/export", {
properties: dataList
}, `系统信息数据_${new Date().getTime()}.xlsx`);
// let dataList = [];
// Object.keys(this.columns).forEach(item => {
// if (item.visible) {
// dataList.push(item.prop);
// }
// });
// this.download("rocketmq/systemInfo/export", {properties: dataList}, `系统信息数据_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign({}, this.queryParams,rowData);
this.download("rocketmq/systemInfo/export", paramsList, `系统信息数据_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:
}

View File

@@ -158,15 +158,15 @@
}).catch(() => {});
break;
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("/system/Business/export", {
properties: dataList,
}, `业务管理_${new Date().getTime()}.xlsx`);
// let dataList = [];
// Object.keys(this.columns).forEach(item => {
// if (item.visible) {
// dataList.push(item.prop);
// }
// });
// this.download("/system/Business/export", {properties: dataList,}, `业务管理_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign({}, this.queryParams,rowData);
this.download("system/Business/export", paramsList, `业务管理_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:

View File

@@ -111,15 +111,15 @@
if (result && result.fnCode) {
switch (result.fnCode) {
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("/system/record/export", {
properties: dataList,
}, `收益方式修改记录_${new Date().getTime()}.xlsx`);
// let dataList = [];
// Object.keys(this.columns).forEach(item => {
// if (item.visible) {
// dataList.push(item.prop);
// }
// });
// this.download("/system/record/export", {properties: dataList,}, `收益方式修改记录_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign({}, this.queryParams,rowData);
this.download("system/record/export", paramsList, `收益方式修改记录_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:
}

View File

@@ -258,36 +258,46 @@
// 获取前一个月的所有日期
getDaysOfPreviousMonth(star, end) {
const currentDate = new Date();
const currentYear = currentDate.getFullYear();
const currentMonth = currentDate.getMonth(); // 0-11 表示 1-12
const endYear = currentDate.getFullYear();
const endMonth = currentDate.getMonth(); // 0=1月11=12月
const endDay = currentDate.getDate(); // 当前日如8
// 计算前一个月的年份和月份
const prevMonth = currentMonth - 1;
const prevYear = prevMonth >= 0 ? currentYear : currentYear - 1;
const prevMonthActual = prevMonth >= 0 ? prevMonth : 11; // 11 表示 12 月
// 2. 计算起点日期当前日期的“上月同日”处理边界如3月31日→2月28/29日
const startDate = new Date(endYear, endMonth, endDay);
// 核心将当前日期的月份减1得到上月同日自动处理天数不足问题
startDate.setMonth(startDate.getMonth() - 1);
// 获取第一天和最后一天
const firstDay = star ? new Date(star) : new Date(prevYear, prevMonthActual, 1);
const lastDay = end ? new Date(end) : new Date(prevYear, prevMonthActual + 1, 0); // 下个月首日减 1 天
// 3. 提取起点日期的年、月、日(用于循环判断)
const startYear = startDate.getFullYear();
const startMonth = startDate.getMonth();
const startDay = startDate.getDate();
// 生成所有日期
const oneMonthDays = [];
let currentDay = firstDay;
while (currentDay <= lastDay) {
// 格式化为 YYYY-MM-DD
const formattedDate = currentDay.toISOString().split('T')[0];
oneMonthDays.push(formattedDate);
currentDay = new Date(currentDay); // 避免引用同一对象
currentDay.setDate(currentDay.getDate() + 1);
// 4. 循环生成“起点~终点”的所有日期
const dateCollection = [];
// 临时日期:从起点日期开始递增
const tempDate = new Date(startYear, startMonth, startDay);
// 循环条件:临时日期 <= 当前日期(终点)
while (tempDate <= currentDate) {
// 格式化日期为“YYYY-MM-DD”补零处理如8月→085日→05
const year = tempDate.getFullYear();
const month = String(tempDate.getMonth() + 1).padStart(2, '0');
const day = String(tempDate.getDate()).padStart(2, '0');
const formattedDate = `${year}-${month}-${day}`;
dateCollection.push(formattedDate);
// 临时日期加1天进入下一天
tempDate.setDate(tempDate.getDate() + 1);
}
return {startTime: oneMonthDays[0], endTime: oneMonthDays[oneMonthDays.length - 1]};
return {startTime: dateCollection[0], endTime: dateCollection[dateCollection.length - 1]};
},
// 获取前一年的月
getLastMonths() {
const threeMonths = [];
const today = new Date(); // 当前日期
const currentYear = today.getFullYear();
const currentMonth = today.getMonth(); // 月份从0开始0=1月11=12月
const currentMonth = today.getMonth() + 1; // 月份从0开始0=1月11=12月
// 循环获取前3个月i=0: 前1个月i=1: 前2个月i=2: 前3个月
for (let i = 1; i <= 12; i++) {
// 计算目标月份(当前月 - i

View File

@@ -127,7 +127,7 @@
</el-form>
<!-- 表格数据 -->
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<TableList class="w100 h100" :columns="columns" :config="config" :queryParams="queryParams" :tableList="tableList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempDay="{ valueKey, row, column }">
<span v-if="row && row[valueKey]">{{row[valueKey]}}/{{row.createTime}}</span>
</template>
@@ -200,7 +200,7 @@
effectiveBandwidth95Daily: undefined,
effectiveBandwidth95Monthly: undefined,
effectiveAvgMonthlyBandwidth95: undefined,
}
},
}
},
created() {
@@ -349,21 +349,13 @@
}).catch(() => {});
break;
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("system/bandwidth/export", {
properties: dataList,
resourceType: 1
}, `服务器带宽收益_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign(this.queryParams,rowData, {resourceType: 1});
this.download("system/bandwidth/export", paramsList, `服务器带宽收益_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:
}
}
}
},
}
}
</script>

View File

@@ -250,16 +250,15 @@
this.handleUpdate(rowData);
break;
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("system/revenueConfig/export", {
properties: dataList,
resourceType: 1
}, `服务器收益方式配置_${new Date().getTime()}.xlsx`);
// let dataList = [];
// Object.keys(this.columns).forEach(item => {
// if (item.visible) {
// dataList.push(item.prop);
// }
// });
// this.download("system/revenueConfig/export", {properties: dataList, resourceType: 1}, `服务器收益方式配置_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign(this.queryParams,rowData, {resourceType: 1});
this.download("system/revenueConfig/export", paramsList, `服务器收益方式配置_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:
}

View File

@@ -417,16 +417,15 @@
}).catch(() => {});
break;
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("system/bandwidth/export", {
properties: dataList,
resourceType: 2
}, `交换机带宽收益_${new Date().getTime()}.xlsx`);
// let dataList = [];
// Object.keys(this.columns).forEach(item => {
// if (item.visible) {
// dataList.push(item.prop);
// }
// });
// this.download("system/bandwidth/export", {properties: dataList, resourceType: 2}, `交换机带宽收益_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign(this.queryParams,rowData, {resourceType: 2});
this.download("system/bandwidth/export", paramsList, `交换机带宽收益_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:
}

View File

@@ -127,15 +127,15 @@
}).catch(() => {});
break;
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("/system/group/export", {
properties: dataList,
}, `资源分组_${new Date().getTime()}.xlsx`);
// let dataList = [];
// Object.keys(this.columns).forEach(item => {
// if (item.visible) {
// dataList.push(item.prop);
// }
// });
// this.download("/system/group/export", {properties: dataList,}, `资源分组_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign({}, this.queryParams,rowData);
this.download("system/group/export", paramsList, `资源分组_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:

View File

@@ -154,15 +154,15 @@
}).catch(() => {});
break;
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("/system/monitorStategy/export", {
properties: dataList,
}, `拓扑管理_${new Date().getTime()}.xlsx`);
// let dataList = [];
// Object.keys(this.columns).forEach(item => {
// if (item.visible) {
// dataList.push(item.prop);
// }
// });
// this.download("/system/monitorStategy/export", {properties: dataList,}, `拓扑管理_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign({}, this.queryParams,rowData);
this.download("system/monitorStategy/export", paramsList, `资源监控策略_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:
}

View File

@@ -135,15 +135,15 @@
}).catch(() => {});
break;
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("/system/monitorTemp/export", {
properties: dataList,
}, `拓扑管理_${new Date().getTime()}.xlsx`);
// let dataList = [];
// Object.keys(this.columns).forEach(item => {
// if (item.visible) {
// dataList.push(item.prop);
// }
// });
// this.download("/system/monitorTemp/export", {properties: dataList}, `拓扑管理_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign({}, this.queryParams,rowData);
this.download("system/monitorTemp/export", paramsList, `监控模版_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:
}

View File

@@ -161,15 +161,15 @@
});
break;
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("/system/registration/export", {
properties: dataList,
}, `资源管理_${new Date().getTime()}.xlsx`);
// let dataList = [];
// Object.keys(this.columns).forEach(item => {
// if (item.visible) {
// dataList.push(item.prop);
// }
// });
// this.download("/system/registration/export", {properties: dataList,}, `资源管理_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign({}, this.queryParams,rowData);
this.download("system/registration/export", paramsList, `资源注册_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:

View File

@@ -77,7 +77,7 @@
</el-form-item>
</el-col>
</el-form>
<TableList :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<TableList style="height: calc(100vh - 302px);" :columns="columns" :config="config" :queryParams="queryParams" :tableList="roleList" @fnClick="callback" @fnRenderList="getList" @value-change="handleValueChange">
<template #tempType="{ row, column }">
<dict-tag :options="dict.type.rm_topology_type" :value="row.connectedDeviceType"/>
</template>
@@ -250,17 +250,6 @@
this.$modal.msgSuccess("删除成功")
}).catch(() => {});
break;
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("/system/management/export", {
properties: dataList,
}, `拓扑管理_${new Date().getTime()}.xlsx`);
break;
default:
}
}

View File

@@ -127,15 +127,15 @@
}).catch(() => {});
break;
case 'export':
let dataList = [];
Object.keys(this.columns).forEach(item => {
if (item.visible) {
dataList.push(item.prop);
}
});
this.download("/system/management/export", {
properties: dataList,
}, `拓扑管理_${new Date().getTime()}.xlsx`);
// let dataList = [];
// Object.keys(this.columns).forEach(item => {
// if (item.visible) {
// dataList.push(item.prop);
// }
// });
// this.download("/system/management/export", {properties: dataList,}, `拓扑管理_${new Date().getTime()}.xlsx`);
let paramsList = Object.assign({}, this.queryParams,rowData);
this.download("system/management/export", paramsList, `拓扑管理_${new Date().getTime()}.xlsx`, null, 'json');
break;
default:
}

View File

@@ -32,7 +32,7 @@
<span @click="routerLine(1)" style="float: right;font-size: 12px; color: #0d52d9;cursor: pointer;">更多 >></span>
</div>
<div style="height: 90%;overflow: scroll;" class="newSty">
<TableList :config="{colHiddenCheck: true, colTopHiddenIcon: true}" :columns="serverColumns" :queryParams="serQueryParams" :tableList="serTableList"></TableList>
<TableList style="height: 95%" class="w100" :config="{colHiddenCheck: true, colTopHiddenIcon: true}" :columns="serverColumns" :queryParams="serQueryParams" :tableList="serTableList" @fnRenderList="serverTableList"></TableList>
</div>
</div>
<div class="disInlineBlock h100 p10" style="width: 49.5%;border: 1px solid #d8dce6;border-radius: 10px;vertical-align: middle;">
@@ -41,7 +41,7 @@
<span @click="routerLine(2)" style="float: right;font-size: 12px; color: #0d52d9;cursor: pointer;">更多 >></span>
</div>
<div style="height: 90%;overflow: scroll;" class="newSty">
<TableList :config="{colHiddenCheck: true, colTopHiddenIcon: true}" :columns="resMonitorColumns" :queryParams="resQueryParams" :tableList="resTableList"></TableList>
<TableList style="height: 95%" class="w100" :config="{colHiddenCheck: true, colTopHiddenIcon: true}" :columns="resMonitorColumns" :queryParams="resQueryParams" :tableList="resTableList" @fnRenderList="resMonitorTableList"></TableList>
</div>
</div>
</div>
@@ -113,7 +113,8 @@ export default {
serQueryParams: {
pageNum: 1,
pageSize: 5,
total: 0
total: 0,
layout: 'pager'
},
// 列显隐信息
resMonitorColumns: {
@@ -127,7 +128,8 @@ export default {
resQueryParams: {
pageNum: 1,
pageSize: 6,
total: 0
total: 0,
layout: 'pager'
}
}
},