king
2024-02-04 0bbaa727cdfc65622e33e91c4bf694c83f184535
src/views/design/header/versions/index.jsx
@@ -1,10 +1,10 @@
import React, {Component} from 'react'
import { is, fromJS } from 'immutable'
import { Modal, notification, Timeline, Icon, Button, Typography } from 'antd'
import { Modal, notification, Timeline, Button, Typography } from 'antd'
import { ClockCircleOutlined, SyncOutlined, WarningOutlined, CheckCircleOutlined } from '@ant-design/icons'
import moment from 'moment'
import Api from '@/api'
import options from '@/store/options.js'
import Utils from '@/utils/utils.js'
import './index.scss'
@@ -27,7 +27,7 @@
      func: 's_get_sversions_sys',
    }
    Api.getSystemConfig(_param).then(result => {
    Api.getCloudConfig(_param).then(result => {
      if (!result.status) {
        notification.warning({
          top: 92,
@@ -38,9 +38,9 @@
      }
      let edition_int = ''
      if (options.sysType === 'SSO') {
      if (window.GLOB.sysType === 'SSO') {
        edition_int = result.edition_int_sso
      } else if (options.sysType === 'local' && window.GLOB.systemType !== 'production') {
      } else if (window.GLOB.sysType === 'local' && window.GLOB.systemType !== 'production') {
        edition_int = result.edition_int_local
      } else {
        if (result.edition_int_sso < result.edition_int_local) {
@@ -58,7 +58,7 @@
        return
      }
      let sysType = options.sysType.toLowerCase()
      let sysType = window.GLOB.sysType.toLowerCase()
      if (window.GLOB.systemType === 'production' || sysType !== 'local') {
        sysType = ''
@@ -115,7 +115,7 @@
      res.func = 's_sVersion_Local_add'
      res.VersionName = version.id
      Api.getLocalConfig(res).then(result => {
      Api.genericInterface(res).then(result => {
        if (!result.status) {
          notification.warning({
            top: 92,
@@ -143,14 +143,15 @@
          obj_name: 'data',
          arr_field: 'ID,KeyWords,Remark,TypeName,Sort,SrcID',
          BID: '',
          exec_type: window.GLOB.execType || 'y'
        }
        param.LText = Utils.formatOptions(sql)
        param.LText = Utils.formatOptions(sql, param.exec_type)
        param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
        param.secretkey = Utils.encrypt(param.LText, param.timestamp)
        param.secretkey = Utils.encrypt('', param.timestamp)
        param.DateCount = ''
        Api.getLocalConfig(param).then(response => {
        Api.genericInterface(param).then(response => {
          if (!response.status) {
            notification.warning({
              top: 92,
@@ -231,7 +232,7 @@
  }
  execSso = (ssoParam, scripts) => {
    Api.getLocalConfig(ssoParam).then(res => {
    Api.genericInterface(ssoParam).then(res => {
      if (!res.status) {
        notification.warning({
          top: 92,
@@ -259,7 +260,7 @@
  }
  execLocal = (localParam, ssoParam, scripts) => {
    Api.getLocalConfig(localParam).then(res => {
    Api.genericInterface(localParam).then(res => {
      if (!res.status) {
        notification.warning({
          top: 92,
@@ -318,15 +319,15 @@
    let param = {
      func: 'sPC_TableData_InUpDe',
      exec_type: 'y',
      exec_type: window.GLOB.execType || 'y',
      ID: version.BID
    }
    param.LText = Utils.formatOptions(sql)
    param.LText = Utils.formatOptions(sql, param.exec_type)
    param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
    param.secretkey = Utils.encrypt('', param.timestamp)
    Api.getLocalConfig(param).then(response => {
    Api.genericInterface(param).then(response => {
      if (!response.status) {
        notification.warning({
          top: 92,
@@ -423,14 +424,14 @@
        >
          <Timeline>
            {versions && versions.map(item => {
              let icon = <Icon type="clock-circle-o" style={{ fontSize: '16px' }} />
              let icon = <ClockCircleOutlined style={{ fontSize: '16px' }} />
              if (item.status === 'loading') {
                icon = <Icon type="sync" spin style={{ fontSize: '16px' }} />
                icon = <SyncOutlined spin style={{ fontSize: '16px' }} />
              } else if (item.status === 'done') {
                if (item.warning) {
                  icon = <Icon type="warning" style={{ fontSize: '16px', color: 'orange' }}/>
                  icon = <WarningOutlined style={{ fontSize: '16px', color: 'orange' }}/>
                } else {
                  icon = <Icon type="check-circle" style={{ fontSize: '16px', color: '#52c41a' }} />
                  icon = <CheckCircleOutlined style={{ fontSize: '16px', color: '#52c41a' }} />
                }
              }
              return (