mirror of
https://gitee.com/dromara/go-view.git
synced 2026-04-23 00:00:12 +08:00
feat: 合并1.1.1,升级版本到2.0.8
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
/**
|
||||
* * 存储本地会话数据
|
||||
* @param k 键名
|
||||
@@ -29,7 +28,7 @@ export const getLocalStorage = (k: string) => {
|
||||
|
||||
/**
|
||||
* * 清除本地会话数据
|
||||
* @param name
|
||||
* @param name
|
||||
*/
|
||||
export const clearLocalStorage = (name: string) => {
|
||||
window.localStorage.removeItem(name)
|
||||
@@ -64,7 +63,7 @@ export const getSessionStorage: (k: string) => any = (k: string) => {
|
||||
|
||||
/**
|
||||
* * 清除本地会话数据
|
||||
* @param name
|
||||
* @param name
|
||||
*/
|
||||
export const clearSessioStorage = (name: string) => {
|
||||
window.sessionStorage.removeItem(name)
|
||||
@@ -106,4 +105,4 @@ export const getCookie = (cname: string) => {
|
||||
*/
|
||||
export const clearCookie = (name: string) => {
|
||||
setCookie(name, "", -1);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ export const animationsClass = (animations: string[]) => {
|
||||
|
||||
// * 滤镜
|
||||
export const getFilterStyle = (styles?: StylesType | EditCanvasConfigType) => {
|
||||
if(!styles) return {}
|
||||
if(!styles || !styles.filterShow) return {}
|
||||
const { opacity, saturate, contrast, hueRotate, brightness } = styles
|
||||
return {
|
||||
opacity: opacity,
|
||||
|
||||
+6
-3
@@ -112,11 +112,13 @@ export const isMac = () => {
|
||||
/**
|
||||
* * 挂载监听
|
||||
*/
|
||||
// eslint-disable-next-line no-undef
|
||||
export const addEventListener = <K extends keyof WindowEventMap>(
|
||||
target: HTMLElement | Document,
|
||||
type: K,
|
||||
listener: any,
|
||||
delay?: number,
|
||||
// eslint-disable-next-line no-undef
|
||||
options?: boolean | AddEventListenerOptions | undefined
|
||||
) => {
|
||||
if (!target) return
|
||||
@@ -133,6 +135,7 @@ export const addEventListener = <K extends keyof WindowEventMap>(
|
||||
/**
|
||||
* * 卸载监听
|
||||
*/
|
||||
// eslint-disable-next-line no-undef
|
||||
export const removeEventListener = <K extends keyof WindowEventMap>(
|
||||
target: HTMLElement | Document,
|
||||
type: K,
|
||||
@@ -222,12 +225,12 @@ export const intervalUnitHandle = (num: number, unit: RequestHttpIntervalEnum) =
|
||||
|
||||
/**
|
||||
* * 对象转换 cookie 格式
|
||||
* @param obj
|
||||
* @param obj
|
||||
* @returns string
|
||||
*/
|
||||
export const objToCookie = (obj: RequestParamsObjType) => {
|
||||
if(!obj) return ''
|
||||
|
||||
if (!obj) return ''
|
||||
|
||||
let str = ''
|
||||
for (const key in obj) {
|
||||
str += key + '=' + obj[key] + ';'
|
||||
|
||||
Reference in New Issue
Block a user