This commit is contained in:
@fawn-nine
2023-07-26 17:30:04 +08:00
parent 09e8452903
commit 581d515cf8
8 changed files with 1013 additions and 49 deletions

View File

@@ -23,7 +23,29 @@ import 'quill/dist/quill.bubble.css'
// 注册富文本编辑器组件为全局组件
Vue.use(VueQuillEditor)
// 时间过滤器
// 定义时间过滤器(不含时分秒)
Vue.filter('formatDate', function(originVal) {
const dt = new Date(originVal * 1000)
const y = dt.getFullYear()
const m = (dt.getMonth() + 1 + '').padStart(2, '0')
const d = (dt.getDate() + '').padStart(2, '0')
const hh = (dt.getHours() + '').padStart(2, '0')
const mm = (dt.getMinutes() + '').padStart(2, '0')
const ss = (dt.getSeconds() + '').padStart(2, '0')
return `${y}-${m}-${d}`
})
// 含时分秒
Vue.filter('formatDatehms', function(originVal) {
const dt = new Date(originVal * 1000)
const y = dt.getFullYear()
const m = (dt.getMonth() + 1 + '').padStart(2, '0')
const d = (dt.getDate() + '').padStart(2, '0')
const hh = (dt.getHours() + '').padStart(2, '0')
const mm = (dt.getMinutes() + '').padStart(2, '0')
const ss = (dt.getSeconds() + '').padStart(2, '0')
return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
})
// 引入wps文档编辑
import mammoth from "mammoth";