king
2023-08-08 dc258e4600bea2fba1e25054d163a2f4b1326a85
2023-08-08
22个文件已修改
217 ■■■■ 已修改文件
src/api/cacheutils.js 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/index.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/calendar/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/balcony/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/data-card/index.jsx 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/double-data-card/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/prop-card/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/card/table-card/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/carousel/data-card/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/carousel/prop-card/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-G6/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-bar-line/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-dashboard/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-pie/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/antv-scatter/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/chart/custom-chart/index.jsx 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/code/sand-box/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/share/tabtransfer/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/table/normal-table/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/timeline/normal-timeline/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/tree/antd-tree/index.jsx 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/index.jsx 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/cacheutils.js
@@ -204,7 +204,7 @@
  /**
   * @description 获取IndexedDB中的配置信息
   */
  static getIndexDBCacheConfig (MenuID, limit) {
  static getIndexDBCacheConfig (MenuID) {
    if (!window.GLOB.IndexDB) return Promise.resolve()
    
    return new Promise((resolve, reject) => {
@@ -215,15 +215,7 @@
      }
      request.onsuccess = () => {
        if (limit && request.result) {
          if (request.result.CreateDate > limit) {
            resolve(request.result)
          } else {
            resolve()
          }
        } else {
          resolve(request.result)
        }
        resolve(request.result)
      }
    })
  }
src/api/index.js
@@ -341,20 +341,15 @@
    return new Promise((resolve, reject) => {
      if (window.GLOB.IndexDB) {
        let limit = minutes ? moment().subtract(minutes, 'minutes').format('YYYY-MM-DD HH:mm:ss') : ''
        CacheUtils.getIndexDBCacheConfig(menuid, limit).then(res => {
        CacheUtils.getIndexDBCacheConfig(menuid).then(res => {
          if (res && res.LongParam) {
            let _data = JSON.parse(res.LongParam)
            if (_data.length === 0) {
              resolve()
            } else {
              resolve(_data)
            }
            resolve({data: JSON.parse(res.LongParam), valid: !limit || res.CreateDate > limit})
          } else {
            resolve()
            resolve({data: null, valid: false})
          }
        })
      } else {
        resolve()
        resolve({data: null, valid: false})
      }
    })
  }
src/tabviews/custom/components/calendar/index.jsx
@@ -91,10 +91,10 @@
    if (config.$cache && !this.loaded) {
      Api.getLCacheConfig(config.uuid).then(res => {
        if (!res || this.loaded) return
        if (!res.data || this.loaded) return
        let data = []
        res.forEach((item, index) => {
        res.data.forEach((item, index) => {
          item.key = index
          item.$$uuid = item[config.setting.primaryKey] || ''
src/tabviews/custom/components/card/balcony/index.jsx
@@ -178,15 +178,15 @@
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
            if (!res && config.setting.onload === 'true') {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData()
              }, config.setting.delay || 0)
            }
  
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
            let _data = res[0] || {$$empty: true}
            let _data = res.data[0] || {$$empty: true}
            _data.$$uuid = _data[config.setting.primaryKey] || ''
    
            this.setState({data: _data})
@@ -195,9 +195,9 @@
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
    
            let _data = res[0] || {$$empty: true}
            let _data = res.data[0] || {$$empty: true}
            _data.$$uuid = _data[config.setting.primaryKey] || ''
    
            this.setState({data: _data})
src/tabviews/custom/components/card/data-card/index.jsx
@@ -261,15 +261,15 @@
      if (config.$time && !config.setting.laypage) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
            if (!res && config.setting.onload === 'true') {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData()
              }, config.setting.delay || 0)
            }
            if (!res || this.loaded) return
            let _data = res.map((item, index) => {
            if (!res.data || this.loaded) return
            let _data = res.data.map((item, index) => {
              item.key = index
              item.$$uuid = item[config.setting.primaryKey] || ''
              item.$Index = index + 1 + ''
@@ -289,9 +289,9 @@
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
    
            let _data = res.map((item, index) => {
            let _data = res.data.map((item, index) => {
              item.key = index
              item.$$uuid = item[config.setting.primaryKey] || ''
              item.$Index = index + 1 + ''
src/tabviews/custom/components/card/double-data-card/index.jsx
@@ -286,21 +286,21 @@
      
      if (config.$time && !config.setting.laypage) {
        Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          if (!res) {
          if (!res.valid) {
            setTimeout(() => {
              this.loadData()
            }, config.setting.delay || 0)
          }
          if (!res) return
          if (!res.data) return
  
          this.setState({data: getData(res)})
          this.setState({data: getData(res.data)})
        })
      } else {
        Api.getLCacheConfig(config.uuid, 0).then(res => {
          if (!res || this.loaded) return
          if (!res.data || this.loaded) return
  
          this.setState({data: getData(res)})
          this.setState({data: getData(res.data)})
        })
        setTimeout(() => {
src/tabviews/custom/components/card/prop-card/index.jsx
@@ -180,15 +180,15 @@
        if (config.$time) {
          if (!this.loaded) {
            Api.getLCacheConfig(config.uuid, config.$time).then(res => {
              if (!res && config.setting.onload === 'true') {
              if (!res.valid && config.setting.onload === 'true') {
                setTimeout(() => {
                  this.loadData()
                }, config.setting.delay || 0)
              }
              if (!res || this.loaded) return
              if (!res.data || this.loaded) return
  
              let _data = res[0] || {$$empty: true}
              let _data = res.data[0] || {$$empty: true}
              _data.$$uuid = _data[config.setting.primaryKey] || ''
      
              this.setState({data: _data})
@@ -210,9 +210,9 @@
        } else {
          if (!this.loaded) {
            Api.getLCacheConfig(config.uuid, 0).then(res => {
              if (!res || this.loaded) return
              if (!res.data || this.loaded) return
      
              let _data = res[0] || {$$empty: true}
              let _data = res.data[0] || {$$empty: true}
              _data.$$uuid = _data[config.setting.primaryKey] || ''
      
              this.setState({data: _data})
@@ -278,7 +278,7 @@
      if (config.$cache && config.$time && config.wrap.autoExec) {
        Api.getLCacheConfig(config.uuid, config.$time).then(res => {
          if (!res) {
          if (!res.valid) {
            this.autoExec()
          } else {
            Api.writeCacheConfig(config.uuid, [])
src/tabviews/custom/components/card/table-card/index.jsx
@@ -161,15 +161,15 @@
      if (config.$time && !config.setting.laypage) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
            if (!res && config.setting.onload === 'true') {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData()
              }, config.setting.delay || 0)
            }
  
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
            let _data = res.map((item, index) => {
            let _data = res.data.map((item, index) => {
              item.key = index
              item.$$uuid = item[config.setting.primaryKey] || ''
              item.$Index = index + 1 + ''
@@ -182,9 +182,9 @@
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
    
            let _data = res.map((item, index) => {
            let _data = res.data.map((item, index) => {
              item.key = index
              item.$$uuid = item[config.setting.primaryKey] || ''
              item.$Index = index + 1 + ''
src/tabviews/custom/components/carousel/data-card/index.jsx
@@ -148,15 +148,15 @@
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
            if (!res && config.setting.onload === 'true') {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData()
              }, config.setting.delay || 0)
            }
  
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
            let _data = res.map((item, index) => {
            let _data = res.data.map((item, index) => {
              item.key = index
              item.$$uuid = item[config.setting.primaryKey] || ''
              item.$Index = index + 1 + ''
@@ -172,9 +172,9 @@
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
    
            let _data = res.map((item, index) => {
            let _data = res.data.map((item, index) => {
              item.key = index
              item.$$uuid = item[config.setting.primaryKey] || ''
              item.$Index = index + 1 + ''
src/tabviews/custom/components/carousel/prop-card/index.jsx
@@ -147,15 +147,15 @@
        if (config.$time) {
          if (!this.loaded) {
            Api.getLCacheConfig(config.uuid, config.$time).then(res => {
              if (!res && config.setting.onload === 'true') {
              if (!res.valid && config.setting.onload === 'true') {
                setTimeout(() => {
                  this.loadData()
                }, config.setting.delay || 0)
              }
    
              if (!res || this.loaded) return
              if (!res.data || this.loaded) return
  
              let _data = res[0] || {$$empty: true}
              let _data = res.data[0] || {$$empty: true}
              _data.$$uuid = _data[config.setting.primaryKey] || ''
      
              this.setState({data: _data})
@@ -166,9 +166,9 @@
        } else {
          if (!this.loaded) {
            Api.getLCacheConfig(config.uuid, 0).then(res => {
              if (!res || this.loaded) return
              if (!res.data || this.loaded) return
      
              let _data = res[0] || {$$empty: true}
              let _data = res.data[0] || {$$empty: true}
              _data.$$uuid = _data[config.setting.primaryKey] || ''
      
              this.setState({data: _data})
src/tabviews/custom/components/chart/antv-G6/index.jsx
@@ -1032,15 +1032,15 @@
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
            if (!res && config.setting.onload === 'true') {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData()
              }, config.setting.delay || 0)
            }
  
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
            this.data = res
            this.data = res.data
            this.handleData()
          })
        } else {
@@ -1049,9 +1049,9 @@
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
    
            this.data = res
            this.data = res.data
            this.handleData()
          })
        }
src/tabviews/custom/components/chart/antv-bar-line/index.jsx
@@ -405,15 +405,15 @@
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
            if (!res && config.setting.onload === 'true') {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData()
              }, config.setting.delay || 0)
            }
  
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
            this.data = res
            this.data = res.data
            this.handleData()
          })
        } else {
@@ -422,9 +422,9 @@
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
    
            this.data = res
            this.data = res.data
            this.handleData()
          })
        }
src/tabviews/custom/components/chart/antv-dashboard/index.jsx
@@ -175,15 +175,15 @@
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
            if (!res && config.setting.onload === 'true') {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData()
              }, config.setting.delay || 0)
            }
  
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
            this.data = res
            this.data = res.data
            if (config.subtype !== 'ratioboard') {
              if (Array.isArray(this.data)) {
@@ -200,9 +200,9 @@
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
    
            this.data = res
            this.data = res.data
            if (config.subtype !== 'ratioboard') {
              if (Array.isArray(this.data)) {
src/tabviews/custom/components/chart/antv-pie/index.jsx
@@ -147,15 +147,15 @@
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
            if (!res && config.setting.onload === 'true') {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData()
              }, config.setting.delay || 0)
            }
  
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
            this.data = res
            this.data = res.data
            this.handleData()
          })
        } else {
@@ -164,9 +164,9 @@
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
    
            this.data = res
            this.data = res.data
            this.handleData()
          })
        }
src/tabviews/custom/components/chart/antv-scatter/index.jsx
@@ -143,18 +143,18 @@
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
            if (!res && config.setting.onload === 'true') {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData()
              }, config.setting.delay || 0)
            }
  
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
            this.data = res
            this.data = res.data
            this.handleData()
            this.setState({empty: res.length === 0})
            this.setState({empty: res.data.length === 0})
          })
        } else {
          this.handleData()
@@ -162,12 +162,12 @@
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
    
            this.data = res
            this.data = res.data
            this.handleData()
            this.setState({empty: res.length === 0})
            this.setState({empty: res.data.length === 0})
          })
        }
src/tabviews/custom/components/chart/custom-chart/index.jsx
@@ -132,18 +132,18 @@
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
            if (!res && config.setting.onload === 'true') {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData()
              }, config.setting.delay || 0)
            }
  
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
            this.data = res
            this.data = res.data
            this.handleData()
            this.setState({empty: res.length === 0})
            this.setState({empty: res.data.length === 0})
          })
        } else {
          this.handleData()
@@ -151,12 +151,12 @@
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
    
            this.data = res
            this.data = res.data
            this.handleData()
            this.setState({empty: res.length === 0})
            this.setState({empty: res.data.length === 0})
          })
        }
src/tabviews/custom/components/code/sand-box/index.jsx
@@ -114,15 +114,15 @@
        if (config.$time) {
          if (!this.loaded) {
            Api.getLCacheConfig(config.uuid, config.$time).then(res => {
              if (!res && config.setting.onload === 'true') {
              if (!res.valid && config.setting.onload === 'true') {
                setTimeout(() => {
                  this.loadData()
                }, config.setting.delay || 0)
              }
    
              if (!res || this.loaded) return
              if (!res.data || this.loaded) return
  
              this.setState({data: res}, () => {
              this.setState({data: res.data}, () => {
                this.renderView()
              })
            })
@@ -132,9 +132,9 @@
        } else {
          if (!this.loaded) {
            Api.getLCacheConfig(config.uuid, 0).then(res => {
              if (!res || this.loaded) return
              if (!res.data || this.loaded) return
      
              this.setState({data: res}, () => {
              this.setState({data: res.data}, () => {
                this.renderView()
              })
            })
src/tabviews/custom/components/share/tabtransfer/index.jsx
@@ -129,7 +129,7 @@
    if (config.$cache && config.$time) {
      Api.getLCacheConfig(params[0].uuid, config.$time).then(res => {
        if (!res) {
        if (!res.valid) {
          this.getMainData(param, params, config.uuid)
        }
      })
src/tabviews/custom/components/table/normal-table/index.jsx
@@ -215,15 +215,15 @@
      if (config.$time && !setting.laypage) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
            if (!res && config.setting.onload === 'true') {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadmaindata()
              }, config.setting.delay || 0)
            }
  
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
            this.setState({data: res.map((item, index) => {
            this.setState({data: res.data.map((item, index) => {
              item.key = index
              item.$$uuid = item[config.setting.primaryKey] || ''
              item.$$key = '' + item.key + item.$$uuid
@@ -250,9 +250,9 @@
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
    
            this.setState({data: res.map((item, index) => {
            this.setState({data: res.data.map((item, index) => {
              item.key = index
              item.$$uuid = item[config.setting.primaryKey] || ''
              item.$$key = '' + item.key + item.$$uuid
src/tabviews/custom/components/timeline/normal-timeline/index.jsx
@@ -156,15 +156,15 @@
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
            if (!res && config.setting.onload === 'true') {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData()
              }, config.setting.delay || 0)
            }
  
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
            this.setState({data: res.map((item, index) => {
            this.setState({data: res.data.map((item, index) => {
              item.key = index
              item.$$uuid = item[config.setting.primaryKey] || ''
              item.$Index = index + 1 + ''
@@ -176,9 +176,9 @@
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
    
            this.setState({data: res.map((item, index) => {
            this.setState({data: res.data.map((item, index) => {
              item.key = index
              item.$$uuid = item[config.setting.primaryKey] || ''
              item.$Index = index + 1 + ''
src/tabviews/custom/components/tree/antd-tree/index.jsx
@@ -136,15 +136,15 @@
      if (config.$time) {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, config.$time).then(res => {
            if (!res && config.setting.onload === 'true') {
            if (!res.valid && config.setting.onload === 'true') {
              setTimeout(() => {
                this.loadData()
              }, config.setting.delay || 0)
            }
  
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
            this.setState({data: res}, () => {
            this.setState({data: res.data}, () => {
              this.handleData()
            })
          })
@@ -154,9 +154,9 @@
      } else {
        if (!this.loaded) {
          Api.getLCacheConfig(config.uuid, 0).then(res => {
            if (!res || this.loaded) return
            if (!res.data || this.loaded) return
    
            this.setState({data: res}, () => {
            this.setState({data: res.data}, () => {
              this.handleData()
            })
          })
src/tabviews/custom/index.jsx
@@ -1131,7 +1131,7 @@
    if (config.$cache && config.$time) {
      Api.getLCacheConfig(params[0].uuid, config.$time).then(res => {
        if (!res) {
        if (!res.valid) {
          this.getMainData(param, params, config.MenuID)
        } else {
          this.setState({