king
2021-09-08 0e4c25700fac0e0c7d93327a5eaafc17b8dd3d78
2021-09-08
2 文件已重命名
2个文件已修改
2个文件已删除
369 ■■■■■ 已修改文件
src/components/header/index.jsx 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/versions/settingform/index.jsx 118 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/versions/settingform/index.scss 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/design/header/index.jsx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/design/header/versions/index.jsx 199 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/design/header/versions/index.scss 补丁 | 查看 | 原始文档 | blame | 历史
src/components/header/index.jsx
@@ -22,14 +22,12 @@
import enUS from '@/locales/en-US/main.js'
import Utils from '@/utils/utils.js'
import avatar from '@/assets/img/avatar.jpg'
import asyncComponent from '@/utils/asyncComponent'
import Resetpwd from './resetpwd'
import LoginForm from './loginform'
import './index.scss'
const { confirm } = Modal
const { Search } = Input
const VersionsUp = asyncComponent(() => import('./versions'))
class Header extends Component {
  static propTpyes = {
@@ -663,6 +661,37 @@
    }
  }
  verup = () => {
    confirm({
      title: '版本升级',
      content: '重新加载应用信息',
      onOk() {
        return new Promise(resolve => {
          if (!window.GLOB.WebSql && !window.GLOB.IndexDB) {
            notification.warning({
              top: 92,
              message: '升级失败,请刷新页面重试!',
              duration: 2
            })
            resolve()
          } else {
            Api.updateAppVersion()
            setTimeout(() => {
              notification.success({
                top: 92,
                message: '升级成功!',
                duration: 2
              })
              resolve()
            }, 1000)
          }
        })
      },
      onCancel() {}
    })
  }
  render () {
    const { mainMenu, collapse } = this.props
    const { thdMenuList, searchkey, debug, menulist, navBar, menuType } = this.state
@@ -680,8 +709,8 @@
          ))}
        </Menu.SubMenu> : null}
        <Menu.Item key="doc" onClick={this.gotoDoc}>{this.state.dict['main.doc']}</Menu.Item>
        <Menu.Item style={{padding: 0}} key="verup">
          <VersionsUp debug={debug} />
        <Menu.Item key="verup" onClick={this.verup}>
          版本升级
        </Menu.Item>
        <Menu.Item key="logout" onClick={this.logout}>{this.state.dict['main.logout']}</Menu.Item>
      </Menu>
src/components/header/versions/settingform/index.jsx
File was deleted
src/components/header/versions/settingform/index.scss
File was deleted
src/views/design/header/index.jsx
@@ -22,6 +22,7 @@
import './index.scss'
const EditMenu = asyncComponent(() => import('@/templates/menuconfig/editfirstmenu'))
const VersionsUp = asyncComponent(() => import('./versions'))
const { confirm } = Modal
class Header extends Component {
@@ -375,6 +376,9 @@
              <Switch size="small" style={{marginLeft: '7px'}} disabled={!!editLevel} checked={true} onChange={this.changeEditState} />
            </Menu.Item>
            <Menu.Item key="doc" onClick={this.gotoDoc}>{this.state.dict['main.doc']}</Menu.Item>
            {options.sysType !== 'cloud' ? <Menu.Item style={{padding: 0}} key="verup">
              <VersionsUp />
            </Menu.Item> : null}
            <Menu.Item key="logout" onClick={this.logout}>{this.state.dict['main.logout']}</Menu.Item>
          </Menu>
        }>
src/views/design/header/versions/index.jsx
File was renamed from src/components/header/versions/index.jsx
@@ -1,23 +1,17 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Modal, notification, Timeline, Icon, Button } from 'antd'
import { Modal, notification, Timeline, Icon, Button, Typography } from 'antd'
import moment from 'moment'
import md5 from 'md5'
// import SettingForm from './settingform'
import Api from '@/api'
import options from '@/store/options.js'
import Utils from '@/utils/utils.js'
import './index.scss'
const { confirm } = Modal
const { Paragraph } = Typography
class DataSource extends Component {
  static propTpyes = {
    debug: PropTypes.any
  }
  state = {
    visible: false,
    versions: null,
@@ -30,137 +24,94 @@
  }
  
  verup = () => {
    const { debug } = this.props
    let _param = {
      func: 's_get_sversions_sys',
    }
    if (!debug || options.sysType === 'cloud') {
      confirm({
        title: '版本升级',
        content: '重新加载应用信息',
        onOk() {
          return new Promise(resolve => {
            if (!window.GLOB.WebSql && !window.GLOB.IndexDB) {
              notification.warning({
                top: 92,
                message: '升级失败,请刷新页面重试!',
                duration: 2
              })
              resolve()
            } else {
              Api.updateAppVersion()
              setTimeout(() => {
                notification.success({
                  top: 92,
                  message: '升级成功!',
                  duration: 2
                })
                resolve()
              }, 1000)
            }
          })
        },
        onCancel() {}
      })
    } else {
      Api.updateAppVersion()
      if (!sessionStorage.getItem('CloudUserID') || !sessionStorage.getItem('CloudLoginUID')) {
    Api.getSystemConfig(_param).then(result => {
      if (!result.status) {
        notification.warning({
          top: 92,
          message: '请登录开发机!',
          duration: 2
          message: result.message,
          duration: 5
        })
        return
      }
      let _param = {
        func: 's_get_sversions_sys',
      let edition_int = ''
      if (options.sysType === 'SSO') {
        edition_int = result.edition_int_sso
      } else if (options.sysType === 'local' && window.GLOB.systemType !== 'production') {
        edition_int = result.edition_int_local
      } else {
        if (result.edition_int_sso < result.edition_int_local) {
          edition_int = result.edition_int_sso
        } else {
          edition_int = result.edition_int_local
        }
      }
      if (edition_int === '') {
        notification.warning({
          top: 92,
          message: '未查询到更新版本信息!',
          duration: 5
        })
        return
      }
      Api.getSystemConfig(_param).then(result => {
        if (!result.status) {
      let _rduri = window.atob('aHR0cHM6Ly9lcGMubWs5aC5$mkjbi93ZWJhcGkvZG9zdGFycw=='.replace(/\$mk/ig, ''))
      let _id = window.atob('YmgwYmFwYWJ0ZDQ1ZXBz$mkZ3JhNzlzZWdiY2g2YzFpYms='.replace(/\$mk/ig, ''))
      let sysType = options.sysType.toLowerCase()
      if (window.GLOB.systemType === 'production') {
        sysType = ''
      }
      let param = {
        func: 's_get_sversions_sys_epc',
        appkey: window.GLOB.appkey,
        userid: _id,
        LoginUID: _id,
        edition_int: edition_int,
        sys_type: sysType,
        nonc: Utils.getuuid()
      }
      let keys = Object.keys(param).sort()
      let values = ''
      keys.forEach(key => {
        values += key + param[key]
      })
      param.sign = md5(values)
      param.t = new Date().getTime()
      Api.directRequest(_rduri + '/s_get_sversions_sys_epc', 'post', param, 'true').then(res => {
        if (!res.status) {
          notification.warning({
            top: 92,
            message: result.message,
            message: res.message,
            duration: 5
          })
          return
        } else if (!res.data || res.data.length === 0) {
          notification.success({
            top: 92,
            message: '已经是最新的版本了。',
            duration: 2
          })
          return
        }
        let edition_int = ''
        if (options.sysType === 'SSO') {
          edition_int = result.edition_int_sso
        } else if (options.sysType === 'local' && window.GLOB.systemType !== 'production') {
          edition_int = result.edition_int_local
        } else {
          if (result.edition_int_sso < result.edition_int_local) {
            edition_int = result.edition_int_sso
          } else {
            edition_int = result.edition_int_local
          }
        }
        if (edition_int === '') {
          notification.warning({
            top: 92,
            message: '未查询到更新版本信息!',
            duration: 5
          })
          return
        }
        let _rduri = window.atob('aHR0cHM6Ly9lcGMubWs5aC5$mkjbi93ZWJhcGkvZG9zdGFycw=='.replace(/\$mk/ig, ''))
        let _id = window.atob('YmgwYmFwYWJ0ZDQ1ZXBz$mkZ3JhNzlzZWdiY2g2YzFpYms='.replace(/\$mk/ig, ''))
        let sysType = options.sysType.toLowerCase()
        if (window.GLOB.systemType === 'production') {
          sysType = ''
        }
        let param = {
          func: 's_get_sversions_sys_epc',
          appkey: window.GLOB.appkey,
          userid: _id,
          LoginUID: _id,
          edition_int: edition_int,
          sys_type: sysType,
          nonc: Utils.getuuid()
        }
        let keys = Object.keys(param).sort()
        let values = ''
        keys.forEach(key => {
          values += key + param[key]
        res.data = res.data.map((item, i) => {
          item.status = i === 0 ? 'loading' : 'waiting'
          item.index = i
          return item
        })
        param.sign = md5(values)
        param.t = new Date().getTime()
        Api.directRequest(_rduri + '/s_get_sversions_sys_epc', 'post', param, 'true').then(res => {
          if (!res.status) {
            notification.warning({
              top: 92,
              message: res.message,
              duration: 5
            })
            return
          } else if (!res.data || res.data.length === 0) {
            notification.success({
              top: 92,
              message: '已经是最新的版本了。',
              duration: 2
            })
            return
          }
          res.data = res.data.map((item, i) => {
            item.status = i === 0 ? 'loading' : 'waiting'
            item.index = i
            return item
          })
          this.setState({versions: res.data, version: res.data[0], visible: true}, () => {
            this.queryScript()
          })
        this.setState({versions: res.data, version: res.data[0], visible: true}, () => {
          this.queryScript()
        })
      })
    }
    })
  }
  queryScript = () => {
@@ -485,8 +436,8 @@
          ]}
          destroyOnClose
        >
          {versions ? <Timeline>
            {versions.map(item => {
          <Timeline>
            {versions && versions.map(item => {
              let icon = <Icon type="clock-circle-o" style={{ fontSize: '16px' }} />
              if (item.status === 'loading') {
                icon = <Icon type="sync" spin style={{ fontSize: '16px' }} />
@@ -498,10 +449,10 @@
                }
              }
              return (
                <Timeline.Item key={item.id} dot={icon}>{item.ProgramName}</Timeline.Item>
                <Timeline.Item key={item.id} dot={icon}>{item.ProgramName}(<Paragraph style={{display: 'inline-block', marginBottom: '0px'}} copyable>{item.id}</Paragraph>)</Timeline.Item>
              )
            })}
          </Timeline> : null}
          </Timeline>
        </Modal>
      </>
    )
src/views/design/header/versions/index.scss