mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-08-08 15:21:52 +08:00
v3.8.0 新增通用方法简化模态/缓存使用
This commit is contained in:
@@ -202,11 +202,7 @@ export default {
|
||||
params.pageSize = undefined;
|
||||
this.addBeginAndEndTime(params, this.dateRangeBeginTime, 'beginTime');
|
||||
// 执行导出
|
||||
this.$confirm('是否确认导出所有API 访问日志数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$modal.confirm('是否确认导出所有API 访问日志数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportApiAccessLogExcel(params);
|
||||
}).then(response => {
|
||||
|
@@ -205,13 +205,9 @@ export default {
|
||||
/** 处理已处理 / 已忽略的操作 **/
|
||||
handleProcessClick(row, processStatus) {
|
||||
const processStatusText = this.getDictDataLabel(this.DICT_TYPE.INFRA_API_ERROR_LOG_PROCESS_STATUS, processStatus)
|
||||
this.$confirm('确认标记为' + processStatusText, '提示', {
|
||||
type: 'warning',
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消'
|
||||
}).then(() => {
|
||||
this.$modal.confirm('确认标记为' + processStatusText).then(() => {
|
||||
updateApiErrorLogProcess(row.id, processStatus).then(() => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.getList();
|
||||
});
|
||||
}).catch(() => {});
|
||||
@@ -224,11 +220,7 @@ export default {
|
||||
params.pageSize = undefined;
|
||||
this.addBeginAndEndTime(params, this.dateRangeExceptionTime, 'exceptionTime');
|
||||
// 执行导出
|
||||
this.$confirm('是否确认导出所有API 错误日志数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$modal.confirm('是否确认导出所有API 错误日志数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportApiErrorLogExcel(params);
|
||||
}).then(response => {
|
||||
|
@@ -234,13 +234,13 @@ export default {
|
||||
if (valid) {
|
||||
if (this.form.id !== undefined) {
|
||||
updateConfig(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addConfig(this.form).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
@@ -251,15 +251,11 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$confirm('是否确认删除参数编号为"' + ids + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
this.$modal.confirm('是否确认删除参数编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delConfig(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
@@ -268,11 +264,7 @@ export default {
|
||||
this.dateRange[0] ? this.dateRange[0] + ' 00:00:00' : undefined,
|
||||
this.dateRange[1] ? this.dateRange[1] + ' 23:59:59' : undefined,
|
||||
]);
|
||||
this.$confirm('是否确认导出所有参数数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$modal.confirm('是否确认导出所有参数数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportConfig(queryParams);
|
||||
}).then(response => {
|
||||
|
@@ -180,21 +180,17 @@ export default {
|
||||
this.upload.isUploading = false;
|
||||
this.$refs.upload.clearFiles();
|
||||
// 提示成功,并刷新
|
||||
this.msgSuccess("上传成功");
|
||||
this.$modal.msgSuccess("上传成功");
|
||||
this.getList();
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$confirm('是否确认删除文件编号为"' + id + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
this.$modal.confirm('是否确认删除文件编号为"' + id + '"的数据项?').then(function() {
|
||||
return deleteFile(id);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
}
|
||||
|
@@ -247,14 +247,10 @@ export default {
|
||||
},
|
||||
/** 立即执行一次 **/
|
||||
handleRun(row) {
|
||||
this.$confirm('确认要立即执行一次"' + row.name + '"任务吗?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
this.$modal.confirm('确认要立即执行一次"' + row.name + '"任务吗?').then(function() {
|
||||
return runJob(row.id);
|
||||
}).then(() => {
|
||||
this.msgSuccess("执行成功");
|
||||
this.$modal.msgSuccess("执行成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 任务详细信息 */
|
||||
@@ -312,13 +308,13 @@ export default {
|
||||
if (valid) {
|
||||
if (this.form.id !== undefined) {
|
||||
updateJob(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addJob(this.form).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
@@ -329,15 +325,11 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id;
|
||||
this.$confirm('是否确认删除定时任务编号为"' + ids + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
this.$modal.confirm('是否确认删除定时任务编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delJob(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 更新状态操作 */
|
||||
@@ -345,15 +337,11 @@ export default {
|
||||
const id = row.id;
|
||||
let status = open ? InfraJobStatusEnum.NORMAL : InfraJobStatusEnum.STOP;
|
||||
let statusStr = open ? '开启' : '关闭';
|
||||
this.$confirm('是否确认' + statusStr + '定时任务编号为"' + id + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
this.$modal.confirm('是否确认' + statusStr + '定时任务编号为"' + id + '"的数据项?').then(function() {
|
||||
return updateJobStatus(id, status);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess(statusStr + "成功");
|
||||
this.$modal.msgSuccess(statusStr + "成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 更多操作触发
|
||||
@@ -375,11 +363,7 @@ export default {
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm("是否确认导出所有定时任务数据项?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$modal.confirm("是否确认导出所有定时任务数据项?").then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportJob(queryParams);
|
||||
}).then(response => {
|
||||
|
@@ -165,11 +165,7 @@ export default {
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
// 执行导出
|
||||
this.$confirm('是否确认导出所有定时任务日志数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(() => {
|
||||
this.$modal.confirm('是否确认导出所有定时任务日志数据项?').then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportJobLogExcel(params);
|
||||
}).then(response => {
|
||||
|
@@ -92,8 +92,6 @@ export default {
|
||||
name: "Server",
|
||||
data() {
|
||||
return {
|
||||
// 加载层信息
|
||||
loading: [],
|
||||
// 统计命令信息
|
||||
commandstats: null,
|
||||
// 使用内存
|
||||
@@ -115,7 +113,7 @@ export default {
|
||||
// 查询 Redis 监控信息
|
||||
getCache().then((response) => {
|
||||
this.cache = response.data;
|
||||
this.loading.close();
|
||||
this.$modal.closeLoading();
|
||||
|
||||
this.commandstats = echarts.init(this.$refs.commandstats, "macarons");
|
||||
const commandStats = [];
|
||||
@@ -176,12 +174,7 @@ export default {
|
||||
},
|
||||
// 打开加载层
|
||||
openLoading() {
|
||||
this.loading = this.$loading({
|
||||
lock: true,
|
||||
text: "拼命读取中",
|
||||
spinner: "el-icon-loading",
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
});
|
||||
this.$modal.loading("正在加载缓存监控数据,请稍后!");
|
||||
},
|
||||
},
|
||||
};
|
||||
|
Reference in New Issue
Block a user