|
@@ -17,7 +17,11 @@
|
|
<div style="margin-top: 8px" class="">
|
|
<div style="margin-top: 8px" class="">
|
|
|
|
|
|
<div class="modify">
|
|
<div class="modify">
|
|
- <el-button type="primary" icon="el-icon-download" @click="exportSqlHandle" :loading='sqlBtnLoading' :disabled='sqlBtnLoading'>导出SQL文件</el-button>
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <el-button type="primary" icon="el-icon-download" @click="exportSqlHandle" :loading='sqlBtnLoading' :disabled='sqlBtnLoading'>导出SQL文件</el-button>
|
|
|
|
+ <el-button type="primary" @click="clearLog">清除日志</el-button>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
<div>
|
|
<div>
|
|
<el-input style="width: 220px" placeholder="请输入内容" @input="httpInputChange" @blur="httpInputBlur" :value="httpValue" />
|
|
<el-input style="width: 220px" placeholder="请输入内容" @input="httpInputChange" @blur="httpInputBlur" :value="httpValue" />
|
|
<el-button type="primary" style="margin-left: 8px" :loading='httpBtnLoading' :disabled='!httpValue' @click="httpExportHandle">导出Excel</el-button>
|
|
<el-button type="primary" style="margin-left: 8px" :loading='httpBtnLoading' :disabled='!httpValue' @click="httpExportHandle">导出Excel</el-button>
|
|
@@ -185,7 +189,8 @@ import {
|
|
syncData,
|
|
syncData,
|
|
queryRecordUpdata,
|
|
queryRecordUpdata,
|
|
dHttpExport,
|
|
dHttpExport,
|
|
- exportSql
|
|
|
|
|
|
+ exportSql,
|
|
|
|
+ clearLogApi
|
|
} from "@/api/synclog";
|
|
} from "@/api/synclog";
|
|
import moment from 'moment'
|
|
import moment from 'moment'
|
|
import { ENUM_OBJECT_TABLE, OBJ_TYPE, TABLE_NAME } from './constant'
|
|
import { ENUM_OBJECT_TABLE, OBJ_TYPE, TABLE_NAME } from './constant'
|
|
@@ -418,13 +423,51 @@ export default {
|
|
// 对象表变化
|
|
// 对象表变化
|
|
objTableChange(val) {
|
|
objTableChange(val) {
|
|
this.tableName = val;
|
|
this.tableName = val;
|
|
-
|
|
|
|
|
|
+ this.getTable();
|
|
},
|
|
},
|
|
// 时间变动
|
|
// 时间变动
|
|
timeChange() {
|
|
timeChange() {
|
|
|
|
|
|
this.getTable();
|
|
this.getTable();
|
|
},
|
|
},
|
|
|
|
+ // 清除日志
|
|
|
|
+ clearLog() {
|
|
|
|
+ this.$confirm('清除操作会清除当前条件下的所有日志,且清除后不可恢复,请谨慎操作', '提示', {
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
+ type: 'warning'
|
|
|
|
+ }).then( async () => {
|
|
|
|
+ let creationTime = this.timeParam && this.timeParam.map(item => moment(item).format('YYYYMMDDHHmm'))
|
|
|
|
+ const postParam = {
|
|
|
|
+ criteria: {
|
|
|
|
+ type: this.operationValue ? this.operationValue : undefined,
|
|
|
|
+ sign: this.sign,
|
|
|
|
+ tableName: this.tableName,
|
|
|
|
+ creationTime: (creationTime && creationTime.length) ? {
|
|
|
|
+ $gte: creationTime[0],
|
|
|
|
+ $lte: creationTime[1]
|
|
|
|
+ } : undefined,
|
|
|
|
+ objectType: this.objTypeValue ? this.objTypeValue : undefined,
|
|
|
|
+ classCodeName: this.objClassifyValue ? this.objClassifyValue : undefined,
|
|
|
|
+ targetId: this.targetId ? this.targetId : undefined
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ clearLogApi(postParam, res => {
|
|
|
|
+ if (res.result === 'success') {
|
|
|
|
+ this.$message({
|
|
|
|
+ type: 'success',
|
|
|
|
+ message: '清除成功!'
|
|
|
|
+ });
|
|
|
|
+ this.getTable();
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ },
|
|
// 对象id变化
|
|
// 对象id变化
|
|
objIdChange(val) {
|
|
objIdChange(val) {
|
|
this.targetId = val.trim();
|
|
this.targetId = val.trim();
|
|
@@ -434,44 +477,61 @@ export default {
|
|
getTable() {
|
|
getTable() {
|
|
this.loading = true;
|
|
this.loading = true;
|
|
if (this.projectId) {
|
|
if (this.projectId) {
|
|
- // 请求table以及中台状态接口
|
|
|
|
- //对象类型
|
|
|
|
- const objectType = this.objTypeValue
|
|
|
|
- ? `;objectType='${this.objTypeValue}'`
|
|
|
|
- : "";
|
|
|
|
- // 对象分类
|
|
|
|
- const classCodeName = this.objClassifyValue
|
|
|
|
- ? `;classCode='${this.objClassifyValue}'`
|
|
|
|
- : "";
|
|
|
|
- // 操作符状态
|
|
|
|
- const type = this.operationValue
|
|
|
|
- ? `;type='${this.operationValue}'`
|
|
|
|
- : "";
|
|
|
|
- // 对象表
|
|
|
|
- const tableName = this.tableName ? `;tableName='${this.tableName}'` : ''
|
|
|
|
|
|
|
|
- // 对象id
|
|
|
|
- const targetId = this.targetId ? `;targetId='${this.targetId}'` : ''
|
|
|
|
|
|
+ // // 请求table以及中台状态接口
|
|
|
|
+ // //对象类型
|
|
|
|
+ // const objectType = this.objTypeValue
|
|
|
|
+ // ? `;objectType='${this.objTypeValue}'`
|
|
|
|
+ // : "";
|
|
|
|
+ // // 对象分类
|
|
|
|
+ // const classCodeName = this.objClassifyValue
|
|
|
|
+ // ? `;classCode='${this.objClassifyValue}'`
|
|
|
|
+ // : "";
|
|
|
|
+ // // 操作符状态
|
|
|
|
+ // const type = this.operationValue
|
|
|
|
+ // ? `;type='${this.operationValue}'`
|
|
|
|
+ // : "";
|
|
|
|
+ // // 对象表
|
|
|
|
+ // const tableName = this.tableName ? `;tableName='${this.tableName}'` : ''
|
|
|
|
+
|
|
|
|
+ // // 对象id
|
|
|
|
+ // const targetId = this.targetId ? `;targetId='${this.targetId}'` : ''
|
|
|
|
|
|
// 时间范围
|
|
// 时间范围
|
|
let creationTime = this.timeParam && this.timeParam.map(item => moment(item).format('YYYYMMDDHHmm'))
|
|
let creationTime = this.timeParam && this.timeParam.map(item => moment(item).format('YYYYMMDDHHmm'))
|
|
- creationTime = creationTime && !!creationTime.length ? `;creationTime in [${creationTime}]` : ''
|
|
|
|
|
|
+ // creationTime = creationTime && !!creationTime.length ? `;creationTime in [${creationTime}]` : ''
|
|
|
|
|
|
|
|
|
|
|
|
+ // const postParam = {
|
|
|
|
+ // orders: this.order,
|
|
|
|
+ // pageNumber: this.pageObj.pageNumber,
|
|
|
|
+ // pageSize: this.pageObj.pageSize,
|
|
|
|
+ // filters: `projectId='${this.projectId}';sign=${this.sign}${type}${classCodeName}${objectType}${tableName}${targetId}${creationTime}`,
|
|
|
|
+ // };
|
|
const postParam = {
|
|
const postParam = {
|
|
- orders: this.order,
|
|
|
|
- pageNumber: this.pageObj.pageNumber,
|
|
|
|
- pageSize: this.pageObj.pageSize,
|
|
|
|
- filters: `projectId='${this.projectId}';sign=${this.sign}${type}${classCodeName}${objectType}${tableName}${targetId}${creationTime}`,
|
|
|
|
- };
|
|
|
|
|
|
+ page: this.pageObj.pageNumber,
|
|
|
|
+ size: this.pageObj.pageSize,
|
|
|
|
+ criteria: {
|
|
|
|
+ type: this.operationValue ? this.operationValue : undefined,
|
|
|
|
+ sign: this.sign,
|
|
|
|
+ tableName: this.tableName,
|
|
|
|
+ creationTime: (creationTime && creationTime.length) ? {
|
|
|
|
+ $gte: creationTime[0],
|
|
|
|
+ $lte: creationTime[1]
|
|
|
|
+ } : undefined,
|
|
|
|
+ objectType: this.objTypeValue ? this.objTypeValue : undefined,
|
|
|
|
+ classCodeName: this.objClassifyValue ? this.objClassifyValue : undefined,
|
|
|
|
+ targetId: this.targetId ? this.targetId : undefined
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
syncDataLogList(postParam, res => {
|
|
syncDataLogList(postParam, res => {
|
|
this.isShowTable = true;
|
|
this.isShowTable = true;
|
|
- this.data = res.content;
|
|
|
|
|
|
+ this.data = res.data;
|
|
this.loading = false;
|
|
this.loading = false;
|
|
this.pageObj = Object.assign(this.pageObj, {
|
|
this.pageObj = Object.assign(this.pageObj, {
|
|
- total: res.total,
|
|
|
|
|
|
+ total: res.count,
|
|
// pageNumber: res.pageNumber,
|
|
// pageNumber: res.pageNumber,
|
|
// pageSize: res.pageSize,
|
|
// pageSize: res.pageSize,
|
|
});
|
|
});
|