|
|
@ -256,31 +256,39 @@ export default { |
|
|
|
this.getData() |
|
|
|
this.getData() |
|
|
|
}, |
|
|
|
}, |
|
|
|
preview(row) { |
|
|
|
preview(row) { |
|
|
|
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => { |
|
|
|
// 登录后才能预览,否则直接跳转到登录页 |
|
|
|
// 查询次数+1 |
|
|
|
if(this.token){ |
|
|
|
this.$post(this.api.saveRecord, { |
|
|
|
this.$get(`${this.api.previewData}?tableName=${row.name}&tableId=${row.id}`).then(res => { |
|
|
|
tableId: row.id, |
|
|
|
// 查询次数+1 |
|
|
|
type: 2, |
|
|
|
this.$post(this.api.saveRecord, { |
|
|
|
}).then(res => { }).catch(res => { }) |
|
|
|
tableId: row.id, |
|
|
|
|
|
|
|
type: 2, |
|
|
|
|
|
|
|
}).then(res => { }).catch(res => { }) |
|
|
|
|
|
|
|
|
|
|
|
let comment = res.comment |
|
|
|
let comment = res.comment |
|
|
|
let previewHead = [] |
|
|
|
let previewHead = [] |
|
|
|
comment.map(n => { |
|
|
|
comment.map(n => { |
|
|
|
// id和操作时间不用显示 |
|
|
|
// id和操作时间不用显示 |
|
|
|
n.field != 'id' && n.field != 'operation_time' && previewHead.push(n) |
|
|
|
n.field != 'id' && n.field != 'operation_time' && previewHead.push(n) |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.previewHead = previewHead |
|
|
|
this.previewHead = previewHead |
|
|
|
|
|
|
|
|
|
|
|
let data = res.data |
|
|
|
let data = res.data |
|
|
|
data.map(n => { |
|
|
|
data.map(n => { |
|
|
|
for (let i in n) { |
|
|
|
for (let i in n) { |
|
|
|
// 如果是以+0000结尾的,就表明这个是时间,则转化为正常的时间格式 |
|
|
|
// 如果是以+0000结尾的,就表明这个是时间,则转化为正常的时间格式 |
|
|
|
if (typeof n[i] == 'string' && n[i].endsWith('+0000')) n[i] = util.formatDate('yyyy-MM-dd hh:mm:ss', new Date(n[i])) |
|
|
|
if (typeof n[i] == 'string' && n[i].endsWith('+0000')) n[i] = util.formatDate('yyyy-MM-dd hh:mm:ss', new Date(n[i])) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.previewData = data |
|
|
|
|
|
|
|
this.previewVisible = true |
|
|
|
|
|
|
|
}).catch(res => { }) |
|
|
|
|
|
|
|
}else{ |
|
|
|
|
|
|
|
let route = this.$router.resolve({ |
|
|
|
|
|
|
|
path: '/login' |
|
|
|
}) |
|
|
|
}) |
|
|
|
this.previewData = data |
|
|
|
window.open(route.href) |
|
|
|
this.previewVisible = true |
|
|
|
} |
|
|
|
}).catch(res => { }) |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
download(row){ |
|
|
|
download(row){ |
|
|
|
// 登录了才能下载,否则直接跳转到登录页 |
|
|
|
// 登录了才能下载,否则直接跳转到登录页 |
|
|
|