feat(frontend): 重构前端架构并添加新功能
- 移除七牛云存储相关代码 - 新增 Minio 存储支持 - 添加字典管理功能 - 实现通用的表单对话框组件 - 开发可复用的表格组件 - 添加日期格式化工具 - 更新 README 文档
This commit is contained in:
@@ -75,9 +75,49 @@ const LabelUtil = {
|
||||
}
|
||||
}
|
||||
|
||||
const DateUtil = {
|
||||
formatDate: function(originVal) {
|
||||
if (originVal === undefined) {
|
||||
return ''
|
||||
}
|
||||
const dt = new Date(originVal)
|
||||
const y = dt.getFullYear()
|
||||
const m = (dt.getMonth() + 1 + '').padStart(2, '0')
|
||||
const d = (dt.getDate() + '').padStart(2, '0')
|
||||
return `${y}-${m}-${d}`
|
||||
},
|
||||
formatDateTime: function(originVal) {
|
||||
if (originVal === undefined) {
|
||||
return ''
|
||||
}
|
||||
const dt = new Date(originVal)
|
||||
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}`
|
||||
},
|
||||
formatRowDateTime: function(row, column, cellValue, index) {
|
||||
if (cellValue === undefined) {
|
||||
return ''
|
||||
}
|
||||
const dt = new Date(cellValue)
|
||||
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}`
|
||||
}
|
||||
}
|
||||
|
||||
export {
|
||||
PermissionUtil,
|
||||
StringUtil,
|
||||
ObjectUtil,
|
||||
LabelUtil
|
||||
LabelUtil,
|
||||
DateUtil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user