king
2023-03-15 3875da845b8fae679bd784d1246101a5fb1b61b5
2023-03-15
16个文件已修改
1279 ■■■■ 已修改文件
public/options.json 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cacheutils.js 476 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 242 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/balcony/index.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/balcony/index.scss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/components/card/cardcellcomponent/index.jsx 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/balcony/index.scss 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/double-data-card/index.jsx 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/sharecomponent/fieldscomponent/index.jsx 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/templates/zshare/verifycard/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/utils.js 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/design/header/index.jsx 60 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/interface/api/index.js 116 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/interface/history/index.jsx 251 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/interface/workspace/index.jsx 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
public/options.json
@@ -1,12 +1,12 @@
{
  "appId": "201912040924165801464FF1788654BC5AC73",
  "appkey": "20191106103859640976D6E924E464D029CF0",
  "appId": "202108312122504607B107A83F55B40C98CCF",
  "appkey": "20210831212235413F287EC3BF489424496C8",
  "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars",
  "systemType": "",
  "externalDatabase": "",
  "lineColor": "",
  "filter": "false",
  "defaultApp": "mk",
  "defaultApp": "mkindustry",
  "defaultLang": "zh-CN",
  "WXAppID": "",
  "WXminiAppID": "",
@@ -17,6 +17,6 @@
  "transfer": "false",
  "keepPassword": "true",
  "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"],
  "host": "http://qingqiumarket.cn",
  "service": "MKWMS/"
  "host": "http://demo.mk9h.cn",
  "service": "erp_new/"
}
src/api/cacheutils.js
@@ -2,274 +2,274 @@
 * @description 缓存工具类
 */
export default class CacheUtils {
  /**
   * @description 打开websql
   */
  static openWebSql (db) {
    try {
      window.GLOB.WebSql = openDatabase(db, '1', 'mk-pc-database', 50 * 1024 * 1024)
      window.GLOB.WebSql.transaction(tx => {
        tx.executeSql('CREATE TABLE IF NOT EXISTS VERSIONS (version varchar(50), createDate varchar(50), CDefine1 varchar(50), CDefine2 varchar(50), CDefine3 varchar(50))', [], () => {
  // /**
  //  * @description 打开websql
  //  */
  // static openWebSql (db) {
  //   try {
  //     window.GLOB.WebSql = openDatabase(db, '1', 'mk-pc-database', 50 * 1024 * 1024)
  //     window.GLOB.WebSql.transaction(tx => {
  //       tx.executeSql('CREATE TABLE IF NOT EXISTS VERSIONS (version varchar(50), createDate varchar(50), CDefine1 varchar(50), CDefine2 varchar(50), CDefine3 varchar(50))', [], () => {
        
        }, () => {
          // eslint-disable-next-line
          throw 'CREATE TABLE ERROR'
        })
        tx.executeSql('CREATE TABLE IF NOT EXISTS CONFIGS (menuid varchar(50), userid varchar(50), openEdition varchar(50), webEdition varchar(50), LongParam text, LongParamUser text, CDefine1 varchar(50), CDefine2 varchar(50), CDefine3 varchar(50), CDefine4 varchar(50), CDefine5 varchar(50))', [], () => {
  //       }, () => {
  //         // eslint-disable-next-line
  //         throw 'CREATE TABLE ERROR'
  //       })
  //       tx.executeSql('CREATE TABLE IF NOT EXISTS CONFIGS (menuid varchar(50), userid varchar(50), openEdition varchar(50), webEdition varchar(50), LongParam text, LongParamUser text, CDefine1 varchar(50), CDefine2 varchar(50), CDefine3 varchar(50), CDefine4 varchar(50), CDefine5 varchar(50))', [], () => {
        }, () => {
          // eslint-disable-next-line
          throw 'CREATE TABLE ERROR'
        })
  //       }, () => {
  //         // eslint-disable-next-line
  //         throw 'CREATE TABLE ERROR'
  //       })
        tx.executeSql('CREATE TABLE IF NOT EXISTS CACHES (menuid varchar(50), CreateDate varchar(50), LongParam text, CDefine1 varchar(50), CDefine2 varchar(50))', [], () => {
  //       tx.executeSql('CREATE TABLE IF NOT EXISTS CACHES (menuid varchar(50), CreateDate varchar(50), LongParam text, CDefine1 varchar(50), CDefine2 varchar(50))', [], () => {
        }, () => {
          // eslint-disable-next-line
          throw 'CREATE TABLE ERROR'
        })
  //       }, () => {
  //         // eslint-disable-next-line
  //         throw 'CREATE TABLE ERROR'
  //       })
        if (window.GLOB.systemType === '') {
          tx.executeSql('CREATE TABLE IF NOT EXISTS FUNCS (func_code varchar(50), key_sql text, CDefine1 varchar(50), CDefine2 varchar(50), CDefine3 varchar(50))', [], () => {
  //       if (window.GLOB.systemType === '') {
  //         tx.executeSql('CREATE TABLE IF NOT EXISTS FUNCS (func_code varchar(50), key_sql text, CDefine1 varchar(50), CDefine2 varchar(50), CDefine3 varchar(50))', [], () => {
          }, () => {
            // eslint-disable-next-line
            throw 'CREATE TABLE ERROR'
          })
        }
      })
      // window.GLOB.WebSql.transaction(tx => {
      //   tx.executeSql('DROP TABLE VERSIONS')
      //   tx.executeSql('DROP TABLE CONFIGS')
      // })
    } catch (e) {
      console.warn('WebSql 初始化失败!')
      window.GLOB.WebSql = null
  //         }, () => {
  //           // eslint-disable-next-line
  //           throw 'CREATE TABLE ERROR'
  //         })
  //       }
  //     })
  //     // window.GLOB.WebSql.transaction(tx => {
  //     //   tx.executeSql('DROP TABLE VERSIONS')
  //     //   tx.executeSql('DROP TABLE CONFIGS')
  //     // })
  //   } catch (e) {
  //     console.warn('WebSql 初始化失败!')
  //     window.GLOB.WebSql = null
      if (window.indexedDB) {
        this.openIndexDB(db)
      }
    }
  }
  //     if (window.indexedDB) {
  //       this.openIndexDB(db)
  //     }
  //   }
  // }
  /**
   * @description 清空函数
   */
  static clearFuncs () {
    if (window.GLOB.systemType !== '') return
  // /**
  //  * @description 清空函数
  //  */
  // static clearFuncs () {
  //   if (window.GLOB.systemType !== '') return
    if (window.GLOB.WebSql) {
      window.GLOB.WebSql.transaction(tx => {
        tx.executeSql('DELETE FROM FUNCS')
  //   if (window.GLOB.WebSql) {
  //     window.GLOB.WebSql.transaction(tx => {
  //       tx.executeSql('DELETE FROM FUNCS')
        tx.executeSql(`UPDATE VERSIONS SET createDate='1970-01-01 14:59:09.000' where CDefine1='funcs'`)
      })
    } else if (window.GLOB.IndexDB) {
      let objectStore = window.GLOB.IndexDB.transaction(['funcs'], 'readwrite').objectStore('funcs')
      objectStore.clear()
  //       tx.executeSql(`UPDATE VERSIONS SET createDate='1970-01-01 14:59:09.000' where CDefine1='funcs'`)
  //     })
  //   } else if (window.GLOB.IndexDB) {
  //     let objectStore = window.GLOB.IndexDB.transaction(['funcs'], 'readwrite').objectStore('funcs')
  //     objectStore.clear()
      window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version').delete('funcs')
    }
  }
  //     window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version').delete('funcs')
  //   }
  // }
  /**
   * @description 获取websql中保存信息版本
   */
  static getWebSqlVersion () {
    if (!window.GLOB.WebSql) {
      return Promise.reject()
    }
  // /**
  //  * @description 获取websql中保存信息版本
  //  */
  // static getWebSqlVersion () {
  //   if (!window.GLOB.WebSql) {
  //     return Promise.reject()
  //   }
    let deffers = []
  //   let deffers = []
    deffers.push(
      new Promise((resolve) => {
        window.GLOB.WebSql.transaction(tx => {
          tx.executeSql("SELECT * FROM VERSIONS where CDefine1='LongParam'", [], (tx, results) => {
            if (results.rows[0]) {
              resolve(results.rows[0])
            } else {
              resolve({version: '', createDate: ''})
            }
          }, (tx, results) => {
            console.warn(results)
            resolve({version: '', createDate: ''})
          })
        })
      })
    )
  //   deffers.push(
  //     new Promise((resolve) => {
  //       window.GLOB.WebSql.transaction(tx => {
  //         tx.executeSql("SELECT * FROM VERSIONS where CDefine1='LongParam'", [], (tx, results) => {
  //           if (results.rows[0]) {
  //             resolve(results.rows[0])
  //           } else {
  //             resolve({version: '', createDate: ''})
  //           }
  //         }, (tx, results) => {
  //           console.warn(results)
  //           resolve({version: '', createDate: ''})
  //         })
  //       })
  //     })
  //   )
    deffers.push(
      new Promise((resolve) => {
        window.GLOB.WebSql.transaction(tx => {
          tx.executeSql(`SELECT * FROM CONFIGS`, [], (tx, results) => {
            let menus = []
            for (let i = 0; i < results.rows.length; i++) {
              menus.push(`'${results.rows[i].menuid}','${results.rows[i].openEdition || 'mk'}'`)
            }
            resolve(menus)
          }, (tx, results) => {
            console.warn(results)
            resolve([])
          })
        })
      })
    )
  //   deffers.push(
  //     new Promise((resolve) => {
  //       window.GLOB.WebSql.transaction(tx => {
  //         tx.executeSql(`SELECT * FROM CONFIGS`, [], (tx, results) => {
  //           let menus = []
  //           for (let i = 0; i < results.rows.length; i++) {
  //             menus.push(`'${results.rows[i].menuid}','${results.rows[i].openEdition || 'mk'}'`)
  //           }
  //           resolve(menus)
  //         }, (tx, results) => {
  //           console.warn(results)
  //           resolve([])
  //         })
  //       })
  //     })
  //   )
    return new Promise((resolve) => {
      Promise.all(deffers).then(res => {
        let result = res[0]
  //   return new Promise((resolve) => {
  //     Promise.all(deffers).then(res => {
  //       let result = res[0]
        if (result.createDate && !/^\d{4}-\d{2}-\d{2}/.test(result.createDate)) {
          result.createDate = ''
        }
  //       if (result.createDate && !/^\d{4}-\d{2}-\d{2}/.test(result.createDate)) {
  //         result.createDate = ''
  //       }
        result.menuids = res[1].join(';')
  //       result.menuids = res[1].join(';')
        resolve(result)
      })
    })
  }
  //       resolve(result)
  //     })
  //   })
  // }
  /**
   * @description 删除websql中保存的配置信息
   */
  static delWebSqlConfig (keys) {
    if (!window.GLOB.WebSql) return
  // /**
  //  * @description 删除websql中保存的配置信息
  //  */
  // static delWebSqlConfig (keys) {
  //   if (!window.GLOB.WebSql) return
    if (!keys) {
      window.GLOB.WebSql.transaction(tx => {
        tx.executeSql(`DELETE FROM CONFIGS`, [], () => {}, (tx, results) => {
          console.warn(results)
        })
      })
    } else {
      window.GLOB.WebSql.transaction(tx => {
        tx.executeSql(`DELETE FROM CONFIGS where menuid in (${keys})`, [], () => {}, (tx, results) => {
          console.warn(results)
        })
      })
    }
  }
  //   if (!keys) {
  //     window.GLOB.WebSql.transaction(tx => {
  //       tx.executeSql(`DELETE FROM CONFIGS`, [], () => {}, (tx, results) => {
  //         console.warn(results)
  //       })
  //     })
  //   } else {
  //     window.GLOB.WebSql.transaction(tx => {
  //       tx.executeSql(`DELETE FROM CONFIGS where menuid in (${keys})`, [], () => {}, (tx, results) => {
  //         console.warn(results)
  //       })
  //     })
  //   }
  // }
  /**
   * @description 删除websql中保存的配置信息
   */
  static delMenuWebSqlConfig (menuId) {
    if (!window.GLOB.WebSql || !menuId) return Promise.resolve()
    return new Promise(resolve => {
      window.GLOB.WebSql.transaction(tx => {
        tx.executeSql(`DELETE FROM CONFIGS where menuid='${menuId}'`, [], () => {
          resolve()
        }, (tx, results) => {
          console.warn(results)
          resolve()
        })
      })
    })
  }
  // /**
  //  * @description 删除websql中保存的配置信息
  //  */
  // static delMenuWebSqlConfig (menuId) {
  //   if (!window.GLOB.WebSql || !menuId) return Promise.resolve()
  //   return new Promise(resolve => {
  //     window.GLOB.WebSql.transaction(tx => {
  //       tx.executeSql(`DELETE FROM CONFIGS where menuid='${menuId}'`, [], () => {
  //         resolve()
  //       }, (tx, results) => {
  //         console.warn(results)
  //         resolve()
  //       })
  //     })
  //   })
  // }
  /**
   * @description 更新websql中配置信息的版本
   */
  static updateWebSqlversion (version, curTime) {
    if (!window.GLOB.WebSql) return
  // /**
  //  * @description 更新websql中配置信息的版本
  //  */
  // static updateWebSqlversion (version, curTime) {
  //   if (!window.GLOB.WebSql) return
    window.GLOB.WebSql.transaction(tx => {
      tx.executeSql(`DELETE FROM VERSIONS where CDefine1='LongParam'`)
  //   window.GLOB.WebSql.transaction(tx => {
  //     tx.executeSql(`DELETE FROM VERSIONS where CDefine1='LongParam'`)
      if (version) {
        tx.executeSql('INSERT INTO VERSIONS (version, createDate, CDefine1) VALUES (?, ?, ?)', [version, curTime, 'LongParam'], () => {}, (tx, results) => {
          console.warn(results)
        })
      }
    })
  }
  //     if (version) {
  //       tx.executeSql('INSERT INTO VERSIONS (version, createDate, CDefine1) VALUES (?, ?, ?)', [version, curTime, 'LongParam'], () => {}, (tx, results) => {
  //         console.warn(results)
  //       })
  //     }
  //   })
  // }
  /**
   * @description 获取websql中的配置信息
   */
  static getWebSqlMenuConfig (MenuID, userid) {
    if (!window.GLOB.WebSql || !MenuID || !userid) return Promise.reject()
    return new Promise((resolve, reject) => {
      window.GLOB.WebSql.transaction(tx => {
        tx.executeSql(`SELECT * FROM CONFIGS WHERE menuid='${MenuID}' and userid='${userid}'`, [], (tx, results) => {
          let paramItem = results.rows[0]
          if (paramItem) {
            resolve({
              ErrCode: 'S',
              ErrMesg: '',
              LongParam: paramItem.LongParam,
              LongParamUser: paramItem.LongParamUser,
              message: '',
              open_edition: paramItem.openEdition,
              status: true,
              web_edition: paramItem.webEdition
            })
          } else {
            reject()
          }
        }, (tx, results) => {
          console.warn(results)
          reject()
        })
      })
    })
  }
  // /**
  //  * @description 获取websql中的配置信息
  //  */
  // static getWebSqlMenuConfig (MenuID, userid) {
  //   if (!window.GLOB.WebSql || !MenuID || !userid) return Promise.reject()
  //   return new Promise((resolve, reject) => {
  //     window.GLOB.WebSql.transaction(tx => {
  //       tx.executeSql(`SELECT * FROM CONFIGS WHERE menuid='${MenuID}' and userid='${userid}'`, [], (tx, results) => {
  //         let paramItem = results.rows[0]
  //         if (paramItem) {
  //           resolve({
  //             ErrCode: 'S',
  //             ErrMesg: '',
  //             LongParam: paramItem.LongParam,
  //             LongParamUser: paramItem.LongParamUser,
  //             message: '',
  //             open_edition: paramItem.openEdition,
  //             status: true,
  //             web_edition: paramItem.webEdition
  //           })
  //         } else {
  //           reject()
  //         }
  //       }, (tx, results) => {
  //         console.warn(results)
  //         reject()
  //       })
  //     })
  //   })
  // }
  /**
   * @description 将数据写入websql
   */
  static writeInWebSql (data) {
    if (!window.GLOB.WebSql || !data) return
    window.GLOB.WebSql.transaction(tx => {
      tx.executeSql('INSERT INTO CONFIGS (menuid, userid, openEdition, webEdition, LongParam, LongParamUser) VALUES (?, ?, ?, ?, ?, ?)', data)
    })
  }
  // /**
  //  * @description 将数据写入websql
  //  */
  // static writeInWebSql (data) {
  //   if (!window.GLOB.WebSql || !data) return
  //   window.GLOB.WebSql.transaction(tx => {
  //     tx.executeSql('INSERT INTO CONFIGS (menuid, userid, openEdition, webEdition, LongParam, LongParamUser) VALUES (?, ?, ?, ?, ?, ?)', data)
  //   })
  // }
  /**
   * @description 将缓存数据写入websql
   */
  static writeCacheInWebSql (data) {
    if (!window.GLOB.WebSql) return
    window.GLOB.WebSql.transaction(tx => {
      tx.executeSql(`DELETE FROM CACHES where menuid='${data[0]}'`)
      if (data[2]) {
        tx.executeSql('INSERT INTO CACHES (menuid, CreateDate, LongParam) VALUES (?, ?, ?)', data)
      }
    })
  }
  // /**
  //  * @description 将缓存数据写入websql
  //  */
  // static writeCacheInWebSql (data) {
  //   if (!window.GLOB.WebSql) return
  //   window.GLOB.WebSql.transaction(tx => {
  //     tx.executeSql(`DELETE FROM CACHES where menuid='${data[0]}'`)
  //     if (data[2]) {
  //       tx.executeSql('INSERT INTO CACHES (menuid, CreateDate, LongParam) VALUES (?, ?, ?)', data)
  //     }
  //   })
  // }
  /**
   * @description 获取websql中的配置信息
   */
  static getWebSqlCacheConfig (MenuID) {
    if (!window.GLOB.WebSql) return Promise.resolve()
    return new Promise((resolve, reject) => {
      window.GLOB.WebSql.transaction(tx => {
        tx.executeSql(`SELECT * FROM CACHES WHERE menuid='${MenuID}'`, [], (tx, results) => {
          resolve(results.rows[0])
        }, (tx, results) => {
          console.warn(results)
          resolve()
        })
      })
    })
  }
  // /**
  //  * @description 获取websql中的配置信息
  //  */
  // static getWebSqlCacheConfig (MenuID) {
  //   if (!window.GLOB.WebSql) return Promise.resolve()
  //   return new Promise((resolve, reject) => {
  //     window.GLOB.WebSql.transaction(tx => {
  //       tx.executeSql(`SELECT * FROM CACHES WHERE menuid='${MenuID}'`, [], (tx, results) => {
  //         resolve(results.rows[0])
  //       }, (tx, results) => {
  //         console.warn(results)
  //         resolve()
  //       })
  //     })
  //   })
  // }
  /**
   * @description 删除websql中超过7天的缓存信息
   */
  static delWebSqlCacheConfig (date, type) {
    if (!window.GLOB.WebSql) return
    window.GLOB.WebSql.transaction(tx => {
      if (type === 'all') {
        tx.executeSql('DELETE FROM CACHES')
      } else {
        tx.executeSql(`DELETE FROM CACHES where CreateDate<'${date}'`)
      }
    })
  }
  // /**
  //  * @description 删除websql中超过7天的缓存信息
  //  */
  // static delWebSqlCacheConfig (date, type) {
  //   if (!window.GLOB.WebSql) return
  //   window.GLOB.WebSql.transaction(tx => {
  //     if (type === 'all') {
  //       tx.executeSql('DELETE FROM CACHES')
  //     } else {
  //       tx.executeSql(`DELETE FROM CACHES where CreateDate<'${date}'`)
  //     }
  //   })
  // }
  /**
   * @description 打开IndexedDB
src/api/index.js
@@ -9,7 +9,7 @@
import CacheUtils from './cacheutils'
import options from '@/store/options.js'
window.GLOB.WebSql = null
// window.GLOB.WebSql = null
window.GLOB.IndexDB = null
window.GLOB.OuterToken = {}
const systemMenuKeys = `1581067625930haged11ieaivpavv77k,1581734956310scks442ul2d955g9tu5,1583991994144ndddg0bhh0is6shi0v1,1583979633842550imkchl4qt4qppsiv,
@@ -21,9 +21,10 @@
let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : ''
let db = `mkdb${service}`
if (window.openDatabase) {
  CacheUtils.openWebSql(db)
} else if (window.indexedDB) {
// if (window.openDatabase) {
//   CacheUtils.openWebSql(db)
// } else if (window.indexedDB) {
if (window.indexedDB) {
  CacheUtils.openIndexDB(db)
}
@@ -363,7 +364,7 @@
  delCacheConfig (type = '') {
    let date = moment().subtract(7, 'days').format('YYYY-MM-DD')
    CacheUtils.delWebSqlCacheConfig(date, type)
    // CacheUtils.delWebSqlCacheConfig(date, type)
    CacheUtils.delIndexDBCacheConfig(date, type)
  }
@@ -372,26 +373,27 @@
    let date = moment().format('YYYY-MM-DD')
    let _data = data ? JSON.stringify(data) : ''
    CacheUtils.writeCacheInWebSql([menuid, date, _data])
    // CacheUtils.writeCacheInWebSql([menuid, date, _data])
    CacheUtils.writeCacheInIndexDB({menuid, CreateDate: date, LongParam: _data})
  }
  getLCacheConfig (menuid) {
    return new Promise((resolve, reject) => {
      if (window.GLOB.WebSql) {
        CacheUtils.getWebSqlCacheConfig(menuid).then(res => {
          if (res && res.LongParam) {
            let _data = JSON.parse(res.LongParam)
            if (_data.length === 0) {
              resolve()
            } else {
              resolve(_data)
            }
          } else {
            resolve()
          }
        })
      } else if (window.GLOB.IndexDB) {
      // if (window.GLOB.WebSql) {
      //   CacheUtils.getWebSqlCacheConfig(menuid).then(res => {
      //     if (res && res.LongParam) {
      //       let _data = JSON.parse(res.LongParam)
      //       if (_data.length === 0) {
      //         resolve()
      //       } else {
      //         resolve(_data)
      //       }
      //     } else {
      //       resolve()
      //     }
      //   })
      // }
      if (window.GLOB.IndexDB) {
        CacheUtils.getIndexDBCacheConfig(menuid).then(res => {
          if (res && res.LongParam) {
            let _data = JSON.parse(res.LongParam)
@@ -414,7 +416,7 @@
   * @description 获取系统版本信息,启用或更新websql
   */
  getAppVersion (reload) {
    if (!window.GLOB.WebSql && !window.GLOB.IndexDB) {
    if (!window.GLOB.IndexDB) {
      return Promise.reject()
    }
@@ -429,76 +431,79 @@
      }
    }
    if (window.GLOB.WebSql) {
      return new Promise((resolve, reject) => {
        CacheUtils.getWebSqlVersion().then(msg => {
          let param = {
            func: 's_get_app_version',
            modifydate: msg.createDate
          }
    // if (window.GLOB.WebSql) {
    //   return new Promise((resolve, reject) => {
    //     CacheUtils.getWebSqlVersion().then(msg => {
    //       let param = {
    //         func: 's_get_app_version',
    //         modifydate: msg.createDate
    //       }
          param.TypeCharOne = ''
          param.typename = ''
    //       param.TypeCharOne = ''
    //       param.typename = ''
          if (!msg.createDate && !msg.menuids) {
            CacheUtils.updateWebSqlversion('1.00', curTime)
            resolve()
            return
          } else if (!msg.createDate || reload === true) {
            param.modifydate = curTime
            param.menuids = window.btoa(msg.menuids)
          } else if (msg.menuids) {
            let d = localStorage.getItem(db)
    //       if (!msg.createDate && !msg.menuids) {
    //         CacheUtils.updateWebSqlversion('1.00', curTime)
    //         resolve()
    //         return
    //       } else if (!msg.createDate || reload === true) {
    //         param.modifydate = curTime
    //         param.menuids = window.btoa(msg.menuids)
    //       } else if (msg.menuids) {
    //         let d = localStorage.getItem(db)
            if (!d || curTime.indexOf(d) === -1) {
              param.menuids = window.btoa(msg.menuids)
            }
    //         if (!d || curTime.indexOf(d) === -1) {
    //           param.menuids = window.btoa(msg.menuids)
    //         }
            localStorage.setItem(db, curTime.substr(0, 10))
          }
    //         localStorage.setItem(db, curTime.substr(0, 10))
    //       }
  
          this.getSystemConfig(param).then(res => {
            if (!res.status) {
              reject()
              return
            }
    //       this.getSystemConfig(param).then(res => {
    //         if (!res.status) {
    //           reject()
    //           return
    //         }
            
            let list = res.menu_data || []
    //         let list = res.menu_data || []
            if (res.menu_del) {
              list.push(...res.menu_del)
            }
    //         if (res.menu_del) {
    //           list.push(...res.menu_del)
    //         }
            list = list.map(mid => mid.menuid)
    //         list = list.map(mid => mid.menuid)
            if (typeof(reload) === 'string' && !list.includes(reload)) {
              list.push(reload)
            }
    //         if (typeof(reload) === 'string' && !list.includes(reload)) {
    //           list.push(reload)
    //         }
            if (list.length > 0) {
              let clear = false
              list.forEach(mid => {
                if (systemMenuKeys.indexOf(mid) > -1) {
                  clear = true
                }
              })
              if (clear) {
                list = ''
              } else {
                list = list.map(mid => `'${mid}'`).join(',')
              }
              CacheUtils.delWebSqlConfig(list)
            }
    //         if (list.length > 0) {
    //           let clear = false
    //           let _appkey = window.GLOB.appkey.substr(-10)
    //           let reg = new RegExp(_appkey + '$', 'ig')
            CacheUtils.updateWebSqlversion(res.app_version || '1.00', curTime)
    //           list.forEach(mid => {
    //             if (systemMenuKeys.indexOf(mid) > -1 || reg.test(mid)) {
    //               clear = true
    //             }
    //           })
    //           if (clear) {
    //             list = ''
    //           } else {
    //             list = list.map(mid => `'${mid}'`).join(',')
    //           }
    //           CacheUtils.delWebSqlConfig(list)
    //         }
    //         CacheUtils.updateWebSqlversion(res.app_version || '1.00', curTime)
  
            resolve()
          })
        }, () => {
          reject()
        })
      })
    } else {
    //         resolve()
    //       })
    //     }, () => {
    //       reject()
    //     })
    //   })
    // } else {
      return new Promise((resolve, reject) => {
        CacheUtils.getIndexDBVersion().then(msg => {
          let param = {
@@ -546,8 +551,11 @@
            if (list.length > 0) {
              let clear = false
              let _appkey = window.GLOB.appkey.substr(-10)
              let reg = new RegExp(_appkey + '$', 'ig')
              list.forEach(mid => {
                if (systemMenuKeys.indexOf(mid) > -1) {
                if (systemMenuKeys.indexOf(mid) > -1 || reg.test(mid)) {
                  clear = true
                }
              })
@@ -565,18 +573,18 @@
          reject()
        })
      })
    }
    // }
  }
  /**
   * @description 更新系统版本信息,清空配置信息
   */
  updateAppVersion () {
    CacheUtils.delWebSqlConfig()
    CacheUtils.updateWebSqlversion()
    // CacheUtils.delWebSqlConfig()
    // CacheUtils.updateWebSqlversion()
    CacheUtils.delIndexDBConfig()
    CacheUtils.updateIndexDBversion()
    CacheUtils.clearFuncs()
    // CacheUtils.clearFuncs()
  }
  /**
@@ -586,8 +594,8 @@
    if (window.GLOB.IndexDB) {
      let key = menuId + (sessionStorage.getItem('UserID') || '')
      return CacheUtils.delMenuIndexDBConfig(key)
    } else {
      return CacheUtils.delMenuWebSqlConfig(menuId)
    // } else {
    //   return CacheUtils.delMenuWebSqlConfig(menuId)
    }
  }
@@ -703,27 +711,28 @@
    _param = JSON.stringify(_param)
    _param  = md5(_param)
    
    if (window.GLOB.WebSql) {
      return new Promise(resolve => {
        CacheUtils.getWebSqlMenuConfig(param.MenuID, param.userid).then(res => {
          resolve(res)
        }, () => {
          param = this.encryptParam(param)
          axios({
            url: `${url}${param.func ? '/' + param.func : ''}`,
            method: 'post',
            data: param
          }).then(res => {
            if (res.status && window.GLOB.WebSql) {
              CacheUtils.writeInWebSql([param.MenuID, param.userid, res.open_edition, res.web_edition, res.LongParam, res.LongParamUser])
            } else if (res.status) {
              window.GLOB.CacheMap.set(_param, res)
            }
            resolve(res)
          })
        })
      })
    } else if (window.GLOB.IndexDB) {
    // if (window.GLOB.WebSql) {
    //   return new Promise(resolve => {
    //     CacheUtils.getWebSqlMenuConfig(param.MenuID, param.userid).then(res => {
    //       resolve(res)
    //     }, () => {
    //       param = this.encryptParam(param)
    //       axios({
    //         url: `${url}${param.func ? '/' + param.func : ''}`,
    //         method: 'post',
    //         data: param
    //       }).then(res => {
    //         if (res.status && window.GLOB.WebSql) {
    //           CacheUtils.writeInWebSql([param.MenuID, param.userid, res.open_edition, res.web_edition, res.LongParam, res.LongParamUser])
    //         } else if (res.status) {
    //           window.GLOB.CacheMap.set(_param, res)
    //         }
    //         resolve(res)
    //       })
    //     })
    //   })
    // }
    if (window.GLOB.IndexDB) {
      return new Promise(resolve => {
        CacheUtils.getIndexDBMenuConfig(param.MenuID, param.userid).then(res => {
          resolve(res)
@@ -781,15 +790,16 @@
    let _param  = md5(JSON.stringify(param))
    
    if (window.GLOB.WebSql) {
      return new Promise(resolve => {
        CacheUtils.getWebSqlMenuConfig(param.MenuID, param.userid).then(res => {
          resolve(res)
        }, () => {
          resolve({ ErrCode: 'S', ErrMesg: '', LongParam: '', message: '', status: false })
        })
      })
    } else if (window.GLOB.CacheMap.has(_param)) {
    // if (window.GLOB.WebSql) {
    //   return new Promise(resolve => {
    //     CacheUtils.getWebSqlMenuConfig(param.MenuID, param.userid).then(res => {
    //       resolve(res)
    //     }, () => {
    //       resolve({ ErrCode: 'S', ErrMesg: '', LongParam: '', message: '', status: false })
    //     })
    //   })
    // }
    if (window.GLOB.CacheMap.has(_param)) {
      return Promise.resolve(window.GLOB.CacheMap.get(_param))
    } else {
      return Promise.resolve({ErrCode: 'S', ErrMesg: '', LongParam: '', message: '', status: false})
src/components/header/index.jsx
@@ -513,7 +513,7 @@
      content: '重新加载应用信息',
      onOk() {
        return new Promise(resolve => {
          if (!window.GLOB.WebSql && !window.GLOB.IndexDB) {
          if (!window.GLOB.IndexDB) {
            notification.warning({
              top: 92,
              message: '更新失败,请刷新页面重试!',
src/menu/components/card/balcony/index.jsx
@@ -275,6 +275,19 @@
      }
    }
    if (_card.wrap.position === 'fixed') {
      if (_card.wrap.top && _card.wrap.bottom && _card.wrap.top.indexOf('vh') > -1 && _card.wrap.bottom.indexOf('vh') > -1) {
        if (parseFloat(_card.wrap.top) + parseFloat(_card.wrap.bottom) >= 100) {
          message.warning('元素距上距下之和超出100%,可能导致元素无法显示。')
        }
      }
      if (_card.wrap.left && _card.wrap.right && _card.wrap.left.indexOf('vw') > -1 && _card.wrap.right.indexOf('vw') > -1) {
        if (parseFloat(_card.wrap.left) + parseFloat(_card.wrap.right) >= 100) {
          message.warning('元素距左距右之和超出100%,可能导致元素无法显示。')
        }
      }
    }
    this.updateComponent(_card)
  }
src/menu/components/card/balcony/index.scss
@@ -7,6 +7,7 @@
  background-size: cover;
  min-height: 30px;
  display: flex;
  overflow: hidden;
  
  .check-all {
    width: 70px;
src/menu/components/card/cardcellcomponent/index.jsx
@@ -706,6 +706,7 @@
      return <VerifyCard
        card={card}
        config={cards}
        side={side || ''}
        columns={side === 'sub' ? cards.subColumns : cards.columns}
        wrappedComponentRef={(inst) => this.verifyRef = inst}
      />
src/tabviews/custom/components/card/balcony/index.scss
@@ -5,6 +5,7 @@
  background-size: cover;
  position: relative;
  display: flex;
  overflow: hidden;
  >.check-all {
    width: 70px;
src/tabviews/custom/components/card/double-data-card/index.jsx
@@ -183,22 +183,24 @@
      Api.getLCacheConfig(config.uuid).then(res => {
        if (!res || this.loaded) return
        let _data = res.map((item, index) => {
          item.children = []
          if (item[config.setting.subdata]) {
            let _children = item[config.setting.subdata]
            delete item[config.setting.subdata]
            item.children = _children.map((cell, i) => {
            _children.forEach((cell, i) => {
              cell.key = i
              cell.$$uuid = cell[config.setting.subKey] || ''
              cell.$$BID = item[config.setting.primaryKey] || ''
              cell.$$BData = {...item}
              cell.$Index = i + 1 + ''
              return cell
              if (cell.$$uuid) {
                item.children.push(cell)
              }
            })
          } else {
            item.children = []
          }
          item.key = index
@@ -535,22 +537,24 @@
      if (type === 'plus') {
        let _data = (this.state.data || []).concat(result.data || [])
        data = _data.map((item, index) => {
          item.children = []
          if (item[config.setting.subdata]) {
            let _children = item[config.setting.subdata]
            delete item[config.setting.subdata]
            item.children = _children.map((cell, i) => {
            _children.forEach((cell, i) => {
              cell.key = i
              cell.$$uuid = cell[config.setting.subKey] || ''
              cell.$$BID = item[config.setting.primaryKey] || ''
              cell.$$BData = {...item}
              cell.$Index = i + 1 + ''
              return cell
              if (cell.$$uuid) {
                item.children.push(cell)
              }
            })
          } else {
            item.children = []
          }
          item.key = index
@@ -569,24 +573,25 @@
        })
      } else {
        data = result.data.map((item, index) => {
          item.children = []
          if (item[config.setting.subdata]) {
            let _children = item[config.setting.subdata]
            delete item[config.setting.subdata]
            item.children = _children.map((cell, i) => {
            _children.forEach((cell, i) => {
              cell.key = i
              cell.$$uuid = cell[config.setting.subKey] || ''
              cell.$$BID = item[config.setting.primaryKey] || ''
              cell.$$BData = {...item}
              cell.$Index = i + 1 + ''
              return cell
              if (cell.$$uuid) {
                item.children.push(cell)
              }
            })
          } else {
            item.children = []
          }
          item.key = index
          item.$$uuid = item[config.setting.primaryKey] || ''
          item.$$BID = BID || ''
@@ -669,22 +674,24 @@
        try {
          data = data.map(item => {
            if (item[config.setting.primaryKey] === _data[config.setting.primaryKey]) {
              _data.children = []
              if (_data[config.setting.subdata]) {
                let _children = _data[config.setting.subdata]
                delete _data[config.setting.subdata]
                _data.children = _children.map((cell, i) => {
                _children.forEach((cell, i) => {
                  cell.key = i
                  cell.$$uuid = cell[config.setting.subKey] || ''
                  cell.$$BID = _data[config.setting.primaryKey] || ''
                  cell.$$BData = {..._data}
                  cell.$Index = i + 1 + ''
                  return cell
                  if (cell.$$uuid) {
                    _data.children.push(cell)
                  }
                })
              } else {
                _data.children = []
              }
              _data.key = item.key
src/templates/sharecomponent/fieldscomponent/index.jsx
@@ -263,9 +263,16 @@
    const { type } = this.props
    const { fields } = this.state
    let label = '批量添加'
    if (type === 'search') {
      label = '添加搜索'
    } else if (type === 'columns') {
      label = '添加显示列'
    }
    return (
      <div className="quickly-add">
        <Button type="primary" block onClick={this.queryField}>批量添加</Button>
        <Button type="primary" block onClick={this.queryField}>{label}</Button>
        {/* 根据字段名添加显示列及搜索条件 */}
        <Modal
          wrapClassName="model-table-fieldmanage-modal"
src/templates/zshare/verifycard/index.jsx
@@ -789,6 +789,10 @@
      let _updatesql = ''
      let _primaryKey = config.setting.primaryKey || 'id'
      if (this.props.side === 'sub') {
        _primaryKey = config.setting.subKey || 'id'
      }
      if (card.sqlType === 'insert' || card.sqlType === 'insertOrUpdate') {
        let keys = []
        let values = []
src/utils/utils.js
@@ -2253,24 +2253,24 @@
 */
export function setGLOBFuncs () {
  window.GLOB.funcs = []
  if (!window.GLOB.WebSql && !window.GLOB.IndexDB) {
  if (!window.GLOB.IndexDB) {
    return
  }
  if (window.GLOB.WebSql) {
    window.GLOB.WebSql.transaction(tx => {
      tx.executeSql("SELECT * FROM FUNCS", [], (tx, results) => {
        let rows = results.rows
        if (!rows || rows.length === 0) return
        for (let i = 0; i < rows.length; i++) {
          window.GLOB.funcs.push({
            func_code: rows[i].func_code,
            key_sql: window.decodeURIComponent(window.atob(rows[i].key_sql))
          })
        }
      })
    })
  } else {
  // if (window.GLOB.WebSql) {
  //   window.GLOB.WebSql.transaction(tx => {
  //     tx.executeSql("SELECT * FROM FUNCS", [], (tx, results) => {
  //       let rows = results.rows
  //       if (!rows || rows.length === 0) return
  //       for (let i = 0; i < rows.length; i++) {
  //         window.GLOB.funcs.push({
  //           func_code: rows[i].func_code,
  //           key_sql: window.decodeURIComponent(window.atob(rows[i].key_sql))
  //         })
  //       }
  //     })
  //   })
  // } else {
    let objectStore = window.GLOB.IndexDB.transaction('funcs').objectStore('funcs')
    objectStore.openCursor().onsuccess = (event) => {
@@ -2284,7 +2284,7 @@
        cursor.continue()
      }
    }
  }
  // }
}
/**
src/views/design/header/index.jsx
@@ -237,7 +237,7 @@
  }
  setSystemFuncs = () => {
    if (!window.GLOB.WebSql && !window.GLOB.IndexDB) {
    if (!window.GLOB.IndexDB) {
      return
    }
    this.getfuncTime().then(res => {
@@ -265,17 +265,17 @@
      timestamp = moment(sys_datetime, 'YYYY-MM-DD HH:mm:ss').add(seconds, 'seconds').format('YYYY-MM-DD HH:mm:ss')
    }
    if (window.GLOB.WebSql) {
      window.GLOB.WebSql.transaction(tx => {
        tx.executeSql('DELETE FROM FUNCS')
    // if (window.GLOB.WebSql) {
    //   window.GLOB.WebSql.transaction(tx => {
    //     tx.executeSql('DELETE FROM FUNCS')
        funcs.forEach(item => {
          if (!item.key_sql) return
          tx.executeSql('INSERT INTO FUNCS (func_code, key_sql) VALUES (?, ?)', [item.func_code, item.key_sql])
        })
        tx.executeSql(`UPDATE VERSIONS SET createDate='${timestamp}' where CDefine1='funcs'`)
      })
    } else {
    //     funcs.forEach(item => {
    //       if (!item.key_sql) return
    //       tx.executeSql('INSERT INTO FUNCS (func_code, key_sql) VALUES (?, ?)', [item.func_code, item.key_sql])
    //     })
    //     tx.executeSql(`UPDATE VERSIONS SET createDate='${timestamp}' where CDefine1='funcs'`)
    //   })
    // } else {
      let objectStore = window.GLOB.IndexDB.transaction(['funcs'], 'readwrite').objectStore('funcs')
      objectStore.clear()
@@ -288,28 +288,28 @@
      let funcStore = window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version')
      funcStore.put({id: 'funcs', version: '1.0', createDate: timestamp})
    }
    // }
  }
  getfuncTime = () => {
    return new Promise((resolve, reject) => {
      if (window.GLOB.WebSql) {
        window.GLOB.WebSql.transaction(tx => {
          tx.executeSql("SELECT * FROM VERSIONS where CDefine1='funcs'", [], (tx, results) => {
            let rows = results.rows
            if (rows.length === 0) {
              tx.executeSql('DELETE FROM FUNCS')
              tx.executeSql('INSERT INTO VERSIONS (version, createDate, CDefine1) VALUES (?, ?, ?)', ['1.0', '1970-01-01 14:59:09.000', 'funcs'])
              resolve({createDate: '1970-01-01 14:59:09.000'})
            } else {
              resolve(rows[0])
            }
          }, (tx, results) => {
            reject()
            console.warn(results)
          })
        })
      } else {
      // if (window.GLOB.WebSql) {
      //   window.GLOB.WebSql.transaction(tx => {
      //     tx.executeSql("SELECT * FROM VERSIONS where CDefine1='funcs'", [], (tx, results) => {
      //       let rows = results.rows
      //       if (rows.length === 0) {
      //         tx.executeSql('DELETE FROM FUNCS')
      //         tx.executeSql('INSERT INTO VERSIONS (version, createDate, CDefine1) VALUES (?, ?, ?)', ['1.0', '1970-01-01 14:59:09.000', 'funcs'])
      //         resolve({createDate: '1970-01-01 14:59:09.000'})
      //       } else {
      //         resolve(rows[0])
      //       }
      //     }, (tx, results) => {
      //       reject()
      //       console.warn(results)
      //     })
      //   })
      // } else {
        let objectStore = window.GLOB.IndexDB.transaction(['version'], 'readwrite').objectStore('version')
        let request = objectStore.get('funcs')
@@ -332,7 +332,7 @@
            }
          }
        }
      }
      // }
    })
  }
src/views/interface/api/index.js
@@ -1,25 +1,30 @@
import axios from 'axios'
import md5 from 'md5'
import jsSHA from 'jssha'
import { notification } from 'antd'
window.GLOB.WebSql = null
window.GLOB.IndexDB = null
if (window.openDatabase) {
  let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : ''
let service = window.GLOB.service ? '-' + window.GLOB.service.replace('/', '') : ''
let db = `mk_inter${service}`
if (window.indexedDB) {
  try {
    window.GLOB.WebSql = openDatabase(`mkdb${service}`, '1', 'mk-pc-database', 50 * 1024 * 1024)
    window.GLOB.WebSql.transaction(tx => {
      tx.executeSql('CREATE TABLE IF NOT EXISTS INTERFACES (uuid varchar(50), createDate varchar(50), method varchar(50), interface text, params text, headers text, active varchar(50), raw text, formData text, CDefine1 varchar(50), CDefine2 varchar(50), CDefine3 varchar(50), CDefine4 varchar(50), CDefine5 text)', [], () => {
      }, () => {
        // eslint-disable-next-line
        throw 'CREATE TABLE ERROR'
      })
    })
    let request = window.indexedDB.open(db, 1)
    request.onerror = () => {
      console.warn('IndexedDB 初始化失败!')
    }
    request.onsuccess = () => {
      window.GLOB.IndexDB = request.result
    }
    request.onupgradeneeded = (event) => {
      window.GLOB.IndexDB = event.target.result
      if (!window.GLOB.IndexDB.objectStoreNames.contains('interfaces')) {
        window.GLOB.IndexDB.createObjectStore('interfaces', { keyPath: 'id' })
      }
    }
  } catch (e) {
    console.warn('WebSql 初始化失败!')
    window.GLOB.WebSql = null
    console.warn('IndexedDB 初始化失败,历史记录将无法查询或修改!')
    window.GLOB.IndexDB = null
  }
}
@@ -102,73 +107,46 @@
    return axios(config)
  }
  writeInWebSql (data) {
    if (!window.GLOB.WebSql) {
      notification.warning({ top: 92, message: 'WebSql开启失败!', duration: 5 })
      return
    }
    return new Promise((resolve, reject) => {
      window.GLOB.WebSql.transaction(tx => {
        tx.executeSql(`INSERT INTO INTERFACES (uuid, createDate, method, interface, params, headers, active, raw, formData) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`, data, (tx, results) => {
          resolve(results)
        }, () => {
          resolve()
        })
      })
    })
  writeInIndexDB (data) {
    if (!window.GLOB.IndexDB) return
    window.GLOB.IndexDB.transaction(['interfaces'], 'readwrite').objectStore('interfaces').add(data)
  }
  getInterfaces () {
    if (!window.GLOB.WebSql) {
      notification.warning({ top: 92, message: 'WebSql开启失败!', duration: 5 })
      return
    }
    if (!window.GLOB.IndexDB) return Promise.resolve()
    return new Promise((resolve, reject) => {
      window.GLOB.WebSql.transaction(tx => {
        tx.executeSql(`SELECT * FROM INTERFACES`, [], (tx, results) => {
          // let paramItem = results.rows[0]
          resolve(results)
        }, () => {
          window.GLOB.WebSql = null
          reject()
        })
      })
      let request = window.GLOB.IndexDB.transaction(['interfaces']).objectStore('interfaces').openCursor()
      let list = []
      request.onsuccess = (e) => {
        let cursor = e.target.result
        if (cursor) {
          if (cursor.value) {
            list.push(cursor.value)
          }
          cursor.continue()
        } else {
          resolve(list)
        }
      }
    })
  }
  delInterface (uuid) {
    if (!window.GLOB.WebSql) {
      notification.warning({ top: 92, message: 'WebSql开启失败!', duration: 5 })
      return
    }
    return new Promise((resolve, reject) => {
      window.GLOB.WebSql.transaction(tx => {
        tx.executeSql(`DELETE FROM INTERFACES where uuid = '${uuid}'`, [], (tx, results) => {
          resolve(results)
        }, () => {
          resolve()
        })
      })
    })
  delInterface (id) {
    if (!window.GLOB.IndexDB) return
    window.GLOB.IndexDB.transaction(['interfaces'], 'readwrite').objectStore('interfaces').delete(id)
  }
  /**
   * @description 清空接口调用记录
   */
  clearInterfaces () {
    if (!window.GLOB.WebSql) {
      notification.warning({ top: 92, message: 'WebSql开启失败!', duration: 5 })
      return
    }
    return new Promise((resolve, reject) => {
      window.GLOB.WebSql.transaction(tx => {
        tx.executeSql(`DELETE FROM INTERFACES`, [], (tx, results) => {
          resolve(results)
        }, () => {
          resolve()
        })
      })
    })
    if (!window.GLOB.IndexDB) return
    window.GLOB.IndexDB.transaction(['interfaces'], 'readwrite').objectStore('interfaces').clear()
  }
}
src/views/interface/history/index.jsx
@@ -22,69 +22,13 @@
  componentDidMount() {
    MKEmitter.addListener('insertInterface', this.insertInterface)
    setTimeout(() => {
      Api.getInterfaces().then(res => {
        if (!res || !res.rows) return
        let rows = [...res.rows]
        rows.sort((a,b) => {
          return a.createDate < b.createDate ? 1 : -1
        })
        let list = []
        let item = null
        rows.forEach(m => {
          let date = m.createDate.substring(0, 10)
          if (m.params) {
            try {
              m.params = JSON.parse(m.params)
            } catch (e) {
              m.params = []
            }
          } else {
            m.params = []
          }
          if (m.headers) {
            try {
              m.headers = JSON.parse(m.headers)
            } catch (e) {
              m.headers = []
            }
          } else {
            m.headers = []
          }
          if (m.formData) {
            try {
              m.formData = JSON.parse(m.formData)
            } catch (e) {
              m.formData = []
            }
          } else {
            m.formData = []
          }
          if (item && item.date !== date) {
            list.push(item)
            item = null
          }
          if (!item) {
            item = {date, sublist: []}
            item.sublist.push(m)
          } else if (item && item.date === date) {
            item.sublist.push(m)
          }
        })
        if (item) {
          list.push(item)
        }
        this.setState({list, historys: fromJS(list).toJS()})
      })
      if (window.GLOB.IndexDB) {
        this.getHistory()
      } else {
        setTimeout(() => {
          this.getHistory()
        }, 1000)
      }
    }, 200)
  }
@@ -103,91 +47,136 @@
    confirm({
      content: 'Are you sure you want to clear all your history requests?',
      onOk() {
        Api.clearInterfaces().then(res => {
          if (res && res.rows.length === 0) {
            _this.setState({list: [], historys: []})
            Modal.success({
              title: '清除成功。'
            })
          } else {
            Modal.error({
              title: '清除失败!请刷新重试。'
            })
          }
        })
        Api.clearInterfaces()
        _this.setState({list: [], historys: []})
      },
      onCancel() {}
    })
  }
  delete = (m) => {
    const { searchKey } = this.state
    Api.delInterface(m.uuid).then(res => {
      if (res) {
        let list = this.state.list.filter(item => {
          item.sublist = item.sublist.filter(cell => cell.uuid !== m.uuid)
          return item.sublist.length > 0
        })
  getHistory = () => {
    Api.getInterfaces().then(res => {
      if (!res) return
        let historys = fromJS(list).toJS()
        if (searchKey) {
          historys = historys.filter(item => {
            item.sublist = item.sublist.filter(cell => cell.interface.indexOf(searchKey) > -1)
            return item.sublist.length > 0
          })
      res.sort((a,b) => {
        return a.createDate < b.createDate ? 1 : -1
      })
      let list = []
      let item = null
      res.forEach(m => {
        let date = m.createDate.substring(0, 10)
        if (m.params) {
          try {
            m.params = JSON.parse(m.params)
          } catch (e) {
            m.params = []
          }
        } else {
          m.params = []
        }
        this.setState({list, historys})
      } else {
        Modal.error({
          title: '删除失败!请刷新重试。'
        })
        if (m.headers) {
          try {
            m.headers = JSON.parse(m.headers)
          } catch (e) {
            m.headers = []
          }
        } else {
          m.headers = []
        }
        if (m.formData) {
          try {
            m.formData = JSON.parse(m.formData)
          } catch (e) {
            m.formData = []
          }
        } else {
          m.formData = []
        }
        if (item && item.date !== date) {
          list.push(item)
          item = null
        }
        if (!item) {
          item = {date, sublist: []}
          item.sublist.push(m)
        } else if (item && item.date === date) {
          item.sublist.push(m)
        }
      })
      if (item) {
        list.push(item)
      }
      this.setState({list, historys: fromJS(list).toJS()})
    })
  }
  delete = (m) => {
    const { searchKey } = this.state
    Api.delInterface(m.id)
    let list = this.state.list.filter(item => {
      item.sublist = item.sublist.filter(cell => cell.id !== m.id)
      return item.sublist.length > 0
    })
    let historys = fromJS(list).toJS()
    if (searchKey) {
      historys = historys.filter(item => {
        item.sublist = item.sublist.filter(cell => cell.interface.indexOf(searchKey) > -1)
        return item.sublist.length > 0
      })
    }
    this.setState({list, historys})
  }
  insertInterface = (item) => {
    item.uuid = Utils.getuuid()
    item.id = Utils.getuuid()
    item.createDate = moment().format('YYYY-MM-DD HH:mm:ss')
    Api.writeInWebSql([item.uuid, item.createDate, item.method, item.interface, JSON.stringify(item.params), JSON.stringify(item.headers), item.active, item.raw, JSON.stringify(item.formData)]).then(res => {
      if (res) {
        let list = fromJS(this.state.list).toJS()
    Api.writeInIndexDB(item)
        if (list[0]) {
          if (list[0].date === item.createDate.substring(0, 10)) {
            list[0].sublist.unshift(item)
          } else {
            list.unshift({
              date: item.createDate.substring(0, 10),
              sublist: [item]
            })
          }
        } else {
          list.push({
            date: item.createDate.substring(0, 10),
            sublist: [item]
          })
        }
    let list = fromJS(this.state.list).toJS()
        let historys = fromJS(list).toJS()
        if (this.state.searchKey) {
          historys = historys.filter(item => {
            item.sublist = item.sublist.filter(cell => cell.interface.indexOf(this.state.searchKey) > -1)
            return item.sublist.length > 0
          })
        }
        this.setState({ list, historys })
    if (list[0]) {
      if (list[0].date === item.createDate.substring(0, 10)) {
        list[0].sublist.unshift(item)
      } else {
        Modal.error({
          title: '添加失败!请刷新重试。'
        list.unshift({
          date: item.createDate.substring(0, 10),
          sublist: [item]
        })
      }
    })
    } else {
      list.push({
        date: item.createDate.substring(0, 10),
        sublist: [item]
      })
    }
    let historys = fromJS(list).toJS()
    if (this.state.searchKey) {
      historys = historys.filter(item => {
        item.sublist = item.sublist.filter(cell => cell.interface.indexOf(this.state.searchKey) > -1)
        return item.sublist.length > 0
      })
    }
    this.setState({ list, historys })
  }
  use = (m) => {
@@ -204,7 +193,7 @@
      method: 'POST',
      params: [],
      raw: "{\n \"UserName\":\"******\",\n \"Password\":\"******\",\n \"systemType\":\"local\",\n \"Type\":\"公钥\",\n \"privatekey\":\"私钥\",\n \"timestamp\":\"" + moment().format('YYYY-MM-DD HH:mm:ss') + "\",\n \"appkey\":\"" + window.GLOB.appkey + "\"\n}",
      uuid: 'dologon'
      id: 'dologon'
    }
    if (window.GLOB.mainSystemApi) {
@@ -223,7 +212,7 @@
      method: 'POST',
      params: [],
      raw: "{\n \"func\":\"******\",\n \"LoginUID\":\"" + (sessionStorage.getItem('LoginUID') || "******") + "\",\n \"UserID\":\"" + (sessionStorage.getItem('UserID') || "******") + "\",\n \"nonc\":\"" + Utils.getguid() + "\",\n \"t\":" + parseInt(new Date().getTime() / 1000) + "\n}",
      uuid: 'dologon'
      id: 'dologon'
    }
    MKEmitter.emit('useInterface', m)
  }
@@ -258,7 +247,7 @@
            <div className="list-line" key={index}>
              <div className="line-title">{item.date}</div>
              {item.sublist.map(m => (
                <div className="line-item" key={m.uuid}>
                <div className="line-item" key={m.id}>
                  <div className="method">POST</div>
                  <div className="inter">{m.interface}</div>
                  <div className="action">
src/views/interface/workspace/index.jsx
@@ -12,7 +12,7 @@
class WorkSpace extends Component {
  state = {
    tabviews: [{
      uuid: Utils.getuuid(),
      id: Utils.getuuid(),
      createDate: '',
      method: 'POST',
      interface: '',
@@ -39,24 +39,24 @@
  }
  useInterface = (item) => {
    item.uuid = Utils.getuuid()
    item.id = Utils.getuuid()
    
    this.setState({tabviews: [...this.state.tabviews, item]}, () => {
      let div = document.getElementById(item.uuid)
      let div = document.getElementById(item.id)
      div && div.click && div.click()
    })
  }
  handleTabview = (view) => {
    let tabviews = fromJS(this.state.tabviews).toJS()
    tabviews = tabviews.filter(item => item.uuid !== view.uuid)
    tabviews = tabviews.filter(item => item.id !== view.id)
    this.setState({tabviews}, () => {
      if (tabviews.length > 0) return
      setTimeout(() => {
        this.setState({tabviews: [{
          uuid: Utils.getuuid(),
          id: Utils.getuuid(),
          createDate: '',
          method: 'POST',
          interface: '',
@@ -72,7 +72,7 @@
  handleAdd = () => {
    let item = {
      uuid: Utils.getuuid(),
      id: Utils.getuuid(),
      createDate: '',
      method: 'POST',
      interface: '',
@@ -83,7 +83,7 @@
      formData: []
    }
    this.setState({tabviews: [...this.state.tabviews, item]}, () => {
      let div = document.getElementById(item.uuid)
      let div = document.getElementById(item.id)
      div && div.click && div.click()
    })
  }
@@ -99,7 +99,7 @@
            return (
              <Tabs.TabPane
                tab={
                  <span className="control" id={view.uuid || ''}>
                  <span className="control" id={view.id || ''}>
                    <span className="method">
                      {view.method || 'POST'}
                    </span>
@@ -109,7 +109,7 @@
                    <CloseOutlined onClick={() => this.handleTabview(view)}/>
                  </span>
                }
                key={view.uuid}
                key={view.id}
              >
                <Request config={view} />
              </Tabs.TabPane>