refine
This commit is contained in:
parent
2d5585709d
commit
bddf534300
|
@ -3,7 +3,6 @@ export { parseTime, formatTime } from '@/utils'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show plural label if time is plural number
|
* Show plural label if time is plural number
|
||||||
*
|
|
||||||
* @param {number} time
|
* @param {number} time
|
||||||
* @param {string} label
|
* @param {string} label
|
||||||
* @return {string}
|
* @return {string}
|
||||||
|
@ -30,7 +29,8 @@ export function timeAgo(time) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数字 格式化
|
* Number formatting
|
||||||
|
* like 10000 => 10k
|
||||||
* @param {number} num
|
* @param {number} num
|
||||||
* @param {number} digits
|
* @param {number} digits
|
||||||
*/
|
*/
|
||||||
|
@ -52,6 +52,7 @@ export function numberFormatter(num, digits) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 10000 => "10,000"
|
||||||
* @param {number} num
|
* @param {number} num
|
||||||
*/
|
*/
|
||||||
export function toThousandFilter(num) {
|
export function toThousandFilter(num) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
export { default as AppMain } from './AppMain'
|
||||||
export { default as Navbar } from './Navbar'
|
export { default as Navbar } from './Navbar'
|
||||||
|
export { default as Settings } from './Settings'
|
||||||
export { default as Sidebar } from './Sidebar/index.vue'
|
export { default as Sidebar } from './Sidebar/index.vue'
|
||||||
export { default as TagsView } from './TagsView/index.vue'
|
export { default as TagsView } from './TagsView/index.vue'
|
||||||
export { default as AppMain } from './AppMain'
|
|
||||||
export { default as Settings } from './Settings'
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import RightPanel from '@/components/RightPanel'
|
import RightPanel from '@/components/RightPanel'
|
||||||
import { Navbar, Sidebar, AppMain, TagsView, Settings } from './components'
|
import { AppMain, Navbar, Settings, Sidebar, TagsView } from './components'
|
||||||
import ResizeMixin from './mixin/ResizeHandler'
|
import ResizeMixin from './mixin/ResizeHandler'
|
||||||
import { mapState } from 'vuex'
|
import { mapState } from 'vuex'
|
||||||
|
|
||||||
|
|
|
@ -90,7 +90,6 @@ export function formatTime(time, option) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 格式化时间
|
|
||||||
* @param {string} url
|
* @param {string} url
|
||||||
* @returns {Object}
|
* @returns {Object}
|
||||||
*/
|
*/
|
||||||
|
@ -185,7 +184,6 @@ export function html2Text(val) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Merges two objects, giving the last one precedence
|
* Merges two objects, giving the last one precedence
|
||||||
*
|
|
||||||
* @param {Object} target
|
* @param {Object} target
|
||||||
* @param {(Object|Array)} source
|
* @param {(Object|Array)} source
|
||||||
* @returns {Object}
|
* @returns {Object}
|
||||||
|
@ -228,45 +226,6 @@ export function toggleClass(element, className) {
|
||||||
element.className = classString
|
element.className = classString
|
||||||
}
|
}
|
||||||
|
|
||||||
export const pickerOptions = [
|
|
||||||
{
|
|
||||||
text: '今天',
|
|
||||||
onClick(picker) {
|
|
||||||
const end = new Date()
|
|
||||||
const start = new Date(new Date().toDateString())
|
|
||||||
end.setTime(start.getTime())
|
|
||||||
picker.$emit('pick', [start, end])
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '最近一周',
|
|
||||||
onClick(picker) {
|
|
||||||
const end = new Date(new Date().toDateString())
|
|
||||||
const start = new Date()
|
|
||||||
start.setTime(end.getTime() - 3600 * 1000 * 24 * 7)
|
|
||||||
picker.$emit('pick', [start, end])
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '最近一个月',
|
|
||||||
onClick(picker) {
|
|
||||||
const end = new Date(new Date().toDateString())
|
|
||||||
const start = new Date()
|
|
||||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
|
|
||||||
picker.$emit('pick', [start, end])
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: '最近三个月',
|
|
||||||
onClick(picker) {
|
|
||||||
const end = new Date(new Date().toDateString())
|
|
||||||
const start = new Date()
|
|
||||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
|
|
||||||
picker.$emit('pick', [start, end])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} type
|
* @param {string} type
|
||||||
* @returns {Date}
|
* @returns {Date}
|
||||||
|
@ -361,7 +320,6 @@ export function createUniqueString() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if an element has a class
|
* Check if an element has a class
|
||||||
*
|
|
||||||
* @param {HTMLElement} elm
|
* @param {HTMLElement} elm
|
||||||
* @param {string} cls
|
* @param {string} cls
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
|
@ -372,7 +330,6 @@ export function hasClass(ele, cls) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add class to element
|
* Add class to element
|
||||||
*
|
|
||||||
* @param {HTMLElement} elm
|
* @param {HTMLElement} elm
|
||||||
* @param {string} cls
|
* @param {string} cls
|
||||||
*/
|
*/
|
||||||
|
@ -382,7 +339,6 @@ export function addClass(ele, cls) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove class from element
|
* Remove class from element
|
||||||
*
|
|
||||||
* @param {HTMLElement} elm
|
* @param {HTMLElement} elm
|
||||||
* @param {string} cls
|
* @param {string} cls
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
|
||||||
<div class="time-container">
|
<div class="time-container">
|
||||||
<el-date-picker v-model="time" :picker-options="pickerOptions" type="datetime" format="yyyy-MM-dd HH:mm:ss" placeholder="Release time" />
|
<el-date-picker v-model="time" type="datetime" format="yyyy-MM-dd HH:mm:ss" placeholder="Release time" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<el-button style="margin-left: 10px;" type="success">
|
<el-button style="margin-left: 10px;" type="success">
|
||||||
|
|
Loading…
Reference in New Issue