摘要: /** * 判断日期格式是否正确 * @param {(Object|string|number)} time 日期 * @returns {Boolean | true} */ export function checkDate(time) { var data = /^(\d{4})-(\d{2 阅读全文
posted @ 2021-04-25 14:23 吃不棒的胖胖糖 阅读(231) 评论(0) 推荐(0) 编辑
摘要: addClass(document.body, 'showRightPanel') removeClass(document.body, 'showRightPanel') /** * Add class to element * @param {HTMLElement} elm * @param  阅读全文
posted @ 2021-04-25 14:12 吃不棒的胖胖糖 阅读(203) 评论(0) 推荐(0) 编辑
摘要: /** * kevin 2021.1.4 * 将rgb表示方式转换为hex表示方式 * @param {string} rgbColor 传过来的hex格式的颜色 * @returns {string | null} */ export function colorHex(rgbColor) { v 阅读全文
posted @ 2021-04-25 14:07 吃不棒的胖胖糖 阅读(209) 评论(0) 推荐(0) 编辑
摘要: /** * kevin 2021.1.4 * 根据色值深浅返回相对应的深浅字体颜色 * @param {string} hex 传过来的hex格式的颜色 * @returns {string | null} */ export function fontColorConvert(hex) { //  阅读全文
posted @ 2021-04-25 14:05 吃不棒的胖胖糖 阅读(82) 评论(0) 推荐(0) 编辑
摘要: /** * kevin 2021/1/4 * @description el-upload + accept限制上传的文件格式 * @param e 校验的类型 * @returns {string | null} */ export function acceptFile(e) { const a 阅读全文
posted @ 2021-04-25 13:10 吃不棒的胖胖糖 阅读(2547) 评论(0) 推荐(0) 编辑
摘要: /** * 生成随机uuid */ export function uuid() { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = Math.random() * 16 | 0 阅读全文
posted @ 2021-04-25 11:49 吃不棒的胖胖糖 阅读(87) 评论(0) 推荐(0) 编辑
摘要: /** * 文件流转换 主要代码块,可自定义下载文件名称 * @param {} data */ export function download(data, titName) { if (!data) { return } const content = data const blob = new 阅读全文
posted @ 2021-04-25 11:47 吃不棒的胖胖糖 阅读(138) 评论(0) 推荐(0) 编辑