代码优化

This commit is contained in:
dqjdda
2019-11-23 21:53:02 +08:00
parent 559adfd786
commit f7d78f4b98
17 changed files with 155 additions and 467 deletions

View File

@@ -49,14 +49,13 @@
</template>
<script>
import initData from '@/mixins/initData'
import { parseTime } from '@/utils/index'
import crud from '@/mixins/crud'
import { getErrDetail } from '@/api/monitor/log'
import Search from './search'
export default {
name: 'ErrorLog',
components: { Search },
mixins: [initData],
mixins: [crud],
data() {
return {
errorInfo: '', dialog: false
@@ -68,21 +67,13 @@ export default {
})
},
methods: {
parseTime,
// 获取数据前设置好接口地址
beforeInit() {
this.url = 'api/logs/error'
const sort = 'id,desc'
const query = this.query
const value = query.value
this.params = { page: this.page, size: this.size, sort: sort }
if (value) { this.params['blurry'] = value }
this.params['logType'] = 'ERROR'
if (query.date) {
this.params['startTime'] = query.date[0]
this.params['endTime'] = query.date[1]
}
return true
},
// 获取异常详情
info(id) {
this.dialog = true
getErrDetail(id).then(res => {