Commit b1223e4c by 莫晓莉

时间戳

parent 6c14da3f
......@@ -49,6 +49,7 @@
"jsencrypt": "^3.0.0-rc.1",
"jszip": "3.1.5",
"mavon-editor": "^2.9.0",
"moment": "^2.29.1",
"node-sass": "^5.0.0",
"normalize.css": "7.0.0",
"nprogress": "0.2.0",
......
......@@ -29,6 +29,7 @@ import router from './router/routers'
import './assets/icons' // icon
import './router/index' // permission control
import 'echarts-gl'
import moment from 'moment'
Vue.use(VueHighlightJS)
Vue.use(mavonEditor)
......@@ -40,6 +41,15 @@ Vue.use(Element, {
Vue.config.productionTip = false
//全局过滤时间戳
Vue.filter('dateformat', function (dataStr, pattern) {
if (dataStr) {
return moment(dataStr).format(pattern || 'YYYY-MM-DD HH:mm:ss')
} else {
return dataStr
}
})
new Vue({
el: '#app',
router,
......
......@@ -28,7 +28,7 @@
<el-table-column prop="databaseName" label="资源库数据库名称" align="center" />
<el-table-column label="资源库更新时间" align="center">
<template slot-scope="scope">
{{ scope.row.updateTime | dateFormat }}
{{ scope.row.updateTime | dateformat("YYYY-MM-DD HH:mm") }}
</template>
</el-table-column>
<el-table-column prop label="操作" width="200" align="center">
......@@ -161,22 +161,22 @@ import {
} from "@/api/oracle/oracle";
// import { getToken } from "@/utils/auth";
export default {
filters: {
dateFormat (val) {
if (val == null || val == '') {
return ''
} else {
let d = new Date(val) // val 为表格内取到的后台时间
let month = d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1
let day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours()
let min = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()
let sec = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()
let times = d.getFullYear() + '-' + month + '-' + day + ' ' + hours + ':' + min + ':' + sec
return times
}
}
},
// filters: {
// dateFormat (val) {
// if (val == null || val == '') {
// return ''
// } else {
// let d = new Date(val) // val 为表格内取到的后台时间
// let month = d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1
// let day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
// let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours()
// let min = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()
// let sec = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()
// let times = d.getFullYear() + '-' + month + '-' + day + ' ' + hours + ':' + min + ':' + sec
// return times
// }
// }
// },
data() {
return {
jobShow:true,
......
......@@ -43,7 +43,7 @@
<el-table-column prop="customerQuarz" label="作业策略" align="center" />
<el-table-column label="作业更新时间" align="center" width="180">
<template slot-scope="scope">
{{ scope.row.updateTime | dateFormat }}
{{ scope.row.updateTime | dateformat("YYYY-MM-DD HH:mm:mm") }}
</template>
</el-table-column>
<el-table-column prop="status" label="作业状态" width="100" align="center" >
......@@ -364,22 +364,22 @@ import {
// import { getDoctorList } from "@/api/hospitalapi/doctor";
import { getToken } from "@/utils/auth";
export default {
filters: {
dateFormat (val) {
if (val == null || val == '') {
return ''
} else {
let d = new Date(val) // val 为表格内取到的后台时间
let month = d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1
let day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours()
let min = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()
let sec = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()
let times = d.getFullYear() + '-' + month + '-' + day + ' ' + hours + ':' + min + ':' + sec
return times
}
}
},
// filters: {
// dateFormat (val) {
// if (val == null || val == '') {
// return ''
// } else {
// let d = new Date(val) // val 为表格内取到的后台时间
// let month = d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1
// let day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
// let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours()
// let min = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()
// let sec = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()
// let times = d.getFullYear() + '-' + month + '-' + day + ' ' + hours + ':' + min + ':' + sec
// return times
// }
// }
// },
data() {
return {
tableData: [],
......
......@@ -36,7 +36,7 @@
<el-table-column prop="description" label="转换策略" align="center" />
<el-table-column prop="updateTime" label="转换更新时间" align="center">
<template slot-scope="scope">
{{ scope.row.updateTime | dateFormat }}
{{ scope.row.updateTime | dateformat("YYYY-MM-DD HH:mm:mm") }}
</template>
</el-table-column>
<el-table-column prop="status" label="转换状态" align="center" width="100">
......@@ -339,22 +339,22 @@ import {
} from "@/api/task/transform";
import { getToken } from "@/utils/auth";
export default {
filters: {
dateFormat (val) {
if (val == null || val == '') {
return ''
} else {
let d = new Date(val) // val 为表格内取到的后台时间
let month = d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1
let day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours()
let min = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()
let sec = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()
let times = d.getFullYear() + '-' + month + '-' + day + ' ' + hours + ':' + min + ':' + sec
return times
}
}
},
// filters: {
// dateFormat (val) {
// if (val == null || val == '') {
// return ''
// } else {
// let d = new Date(val) // val 为表格内取到的后台时间
// let month = d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1
// let day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
// let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours()
// let min = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()
// let sec = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()
// let times = d.getFullYear() + '-' + month + '-' + day + ' ' + hours + ':' + min + ':' + sec
// return times
// }
// }
// },
data() {
return {
tableData: [],
......
......@@ -134,12 +134,12 @@
<el-table-column prop="jobName" label="作业名称" align="center"/>
<el-table-column prop="startTime" label="日志执行起始时间" align="center">
<template slot-scope="scope">
{{ scope.row.startTime | dateFormat }}
{{ scope.row.startTime | dateformat("YYYY-MM-DD HH:mm:mm") }}
</template>
</el-table-column>
<el-table-column prop="stopTime" label="日志执行结束时间" align="center">
<template slot-scope="scope">
{{ scope.row.stopTime | dateFormat }}
{{ scope.row.stopTime | dateformat("YYYY-MM-DD HH:mm:mm") }}
</template>
</el-table-column>
<el-table-column label="日志执行状态" align="center">
......@@ -226,22 +226,22 @@ import {
import CountTo from 'vue-count-to'
export default {
filters: {
dateFormat (val) {
if (val == null || val == '') {
return ''
} else {
let d = new Date(val) // val 为表格内取到的后台时间
let month = d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1
let day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours()
let min = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()
let sec = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()
let times = d.getFullYear() + '-' + month + '-' + day + ' ' + hours + ':' + min + ':' + sec
return times
}
}
},
// filters: {
// dateFormat (val) {
// if (val == null || val == '') {
// return ''
// } else {
// let d = new Date(val) // val 为表格内取到的后台时间
// let month = d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1
// let day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
// let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours()
// let min = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()
// let sec = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()
// let times = d.getFullYear() + '-' + month + '-' + day + ' ' + hours + ':' + min + ':' + sec
// return times
// }
// }
// },
components: {
CountTo
},
......
......@@ -135,12 +135,12 @@
<el-table-column prop="transName" label="转换名称" align="center"/>
<el-table-column prop="startTime" label="转换执行起始时间" align="center">
<template slot-scope="scope">
{{ scope.row.startTime | dateFormat }}
{{ scope.row.startTime | dateformat("YYYY-MM-DD HH:mm:mm") }}
</template>
</el-table-column>
<el-table-column prop="stopTime" label="转换执行结束时间" align="center">
<template slot-scope="scope">
{{ scope.row.stopTime | dateFormat }}
{{ scope.row.stopTime | dateformat("YYYY-MM-DD HH:mm:mm") }}
</template>
</el-table-column>
<el-table-column prop="recordStatus" label="转换执行状态" align="center">
......@@ -221,22 +221,22 @@ import {
} from "@/api/Statistics";
export default {
filters: {
dateFormat (val) {
if (val == null || val == '') {
return ''
} else {
let d = new Date(val) // val 为表格内取到的后台时间
let month = d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1
let day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours()
let min = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()
let sec = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()
let times = d.getFullYear() + '-' + month + '-' + day + ' ' + hours + ':' + min + ':' + sec
return times
}
}
},
// filters: {
// dateFormat (val) {
// if (val == null || val == '') {
// return ''
// } else {
// let d = new Date(val) // val 为表格内取到的后台时间
// let month = d.getMonth() + 1 < 10 ? '0' + (d.getMonth() + 1) : d.getMonth() + 1
// let day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate()
// let hours = d.getHours() < 10 ? '0' + d.getHours() : d.getHours()
// let min = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes()
// let sec = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds()
// let times = d.getFullYear() + '-' + month + '-' + day + ' ' + hours + ':' + min + ':' + sec
// return times
// }
// }
// },
components: {
CountTo
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment