Merge branch 'dev' into master-fetch-dev

master
奔跑的面条 3 years ago
commit 661b3570a5
  1. 6
      src/utils/storage.ts
  2. 2
      src/utils/utils.ts
  3. 14
      src/views/chart/ContentEdit/components/EditTools/index.vue

@ -1,3 +1,5 @@
import { JSONStringify, JSONParse } from './utils'
/**
* *
* @param k
@ -6,7 +8,7 @@
*/
export const setLocalStorage = <T>(k: string, v: T) => {
try {
window.localStorage.setItem(k, JSON.stringify(v))
window.localStorage.setItem(k, JSONStringify(v))
} catch (error) {
return false
}
@ -20,7 +22,7 @@ export const setLocalStorage = <T>(k: string, v: T) => {
export const getLocalStorage = (k: string) => {
const item = window.localStorage.getItem(k)
try {
return item ? JSON.parse(item) : item
return item ? JSONParse(item) : item
} catch (err) {
return item
}

@ -272,7 +272,7 @@ export const setKeyboardDressShow = (keyCode?: number) => {
* * JSON序列化 undefined
* @param data
*/
export const JSONStringify = (data: object) => {
export const JSONStringify = <T>(data: T) => {
return JSON.stringify(
data,
(key, val) => {

@ -172,19 +172,19 @@ const updateToSession = (id: string) => {
//
const btnList: BtnListType[] = [
{
key: 'import',
type: TypeEnum.IMPORTUPLOAD,
name: '导入',
icon: ShareIcon
},
{
key: 'export',
type: TypeEnum.BUTTON,
name: '导出',
icon: ShareIcon,
icon: DownloadIcon,
handle: exportHandle
},
{
key: 'import',
type: TypeEnum.IMPORTUPLOAD,
name: '导入',
icon: DownloadIcon
},
{
key: 'edit',
type: TypeEnum.BUTTON,

Loading…
Cancel
Save