feat: 合并 1.0.6 版本代码

This commit is contained in:
奔跑的面条
2022-07-21 11:03:04 +08:00
40 changed files with 1286 additions and 271 deletions
+3 -3
View File
@@ -6,7 +6,7 @@ import { EditCanvasConfigType } from '@/store/modules/chartEditStore/chartEditSt
type AttrType = PickCreateComponentType<'attr'>
type StylesType = PickCreateComponentType<'styles'>
// 动画
// * 动画
export const animationsClass = (animations: string[]) => {
if (animations.length) {
return `animate__animated animate__${animations[0]}`
@@ -14,7 +14,7 @@ export const animationsClass = (animations: string[]) => {
return ''
}
// 滤镜
// * 滤镜
export const getFilterStyle = (styles: StylesType | EditCanvasConfigType) => {
const { opacity, saturate, contrast, hueRotate, brightness } = styles
return {
@@ -23,7 +23,7 @@ export const getFilterStyle = (styles: StylesType | EditCanvasConfigType) => {
}
}
// 变换
// * 变换
export const getTransformStyle = (styles: StylesType) => {
const { rotateZ, rotateX, rotateY, skewX, skewY } = styles
return {
+43 -2
View File
@@ -6,7 +6,8 @@ import Image_404 from '../assets/images/exception/image-404.png'
import html2canvas from 'html2canvas'
import { downloadByA } from './file'
import { toString } from './type'
import cloneDeep from 'lodash/cloneDeep';
import cloneDeep from 'lodash/cloneDeep'
import { RequestHttpIntervalEnum, RequestParamsObjType } from '@/enums/httpEnum'
/**
* * 判断是否是开发环境
@@ -180,7 +181,7 @@ export const newFunctionHandle = (
try {
if (!funcStr) return data
const fn = new Function('data', funcStr)
const fnRes = fn( cloneDeep(data))
const fnRes = fn(cloneDeep(data))
const resHandle = isToString ? toString(fnRes) : fnRes
// 成功回调
successCallBack && successCallBack(resHandle)
@@ -191,3 +192,43 @@ export const newFunctionHandle = (
return '函数执行错误'
}
}
/**
* * 处理请求事件单位
* @param num 时间间隔
* @param unit RequestHttpIntervalEnum
* @return number 秒数
*/
export const intervalUnitHandle = (num: number, unit: RequestHttpIntervalEnum) => {
switch (unit) {
// 秒
case RequestHttpIntervalEnum.SECOND:
return num * 1000
// 分
case RequestHttpIntervalEnum.MINUTE:
return num * 1000 * 60
// 时
case RequestHttpIntervalEnum.HOUR:
return num * 1000 * 60 * 60
// 天
case RequestHttpIntervalEnum.DAY:
return num * 1000 * 60 * 60 * 24
default:
return num * 1000
}
}
/**
* * 对象转换 cookie 格式
* @param obj
* @returns string
*/
export const objToCookie = (obj: RequestParamsObjType) => {
if(!obj) return ''
let str = ''
for (const key in obj) {
str += key + '=' + obj[key] + ';'
}
return str.substr(0, str.length - 1)
}