king
2024-12-31 1adfb2b7ad4965f15dae773e0dd9b22c6e103fd8
2024-12-31
2个文件已修改
157 ■■■■■ 已修改文件
src/components/paste/index.jsx 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/syscheck/index.jsx 106 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/paste/index.jsx
@@ -3,6 +3,8 @@
import { Modal, notification } from 'antd'
import { SnippetsOutlined } from '@ant-design/icons'
import Utils from '@/utils/utils.js'
import MenuUtils from '@/utils/utils-custom.js'
import asyncComponent from '@/utils/asyncComponent'
const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform'))
@@ -17,6 +19,49 @@
    visible: false
  }
  resetconfig = (item, appType) => {
    if (item.copyType === 'action') {
      MenuUtils.resetBtn(item, item.uuid)
    } else if (item.copyType === 'cardcell') {
      item.setting = item.setting || {}
      item.setting.width = item.setting.width || 6
      delete item.$cardType
      if (item.elements) {
        item.elements = item.elements.map(cell => {
          cell.uuid = Utils.getuuid()
          if (cell.eleType === 'button') {
            MenuUtils.resetBtn(cell, item.uuid)
          }
          return cell
        })
        if (appType === 'mob') {
          item.elements = item.elements.filter(cell => {
            if (cell.eleType === 'button' && ['excelIn', 'tab'].includes(cell.OpenType)) {
              return false
            }
            return true
          })
        }
      }
      if (appType === 'mob') {
        item.backElements = []
      } else if (item.backElements) {
        item.backElements = item.backElements.map(cell => {
          cell.uuid = Utils.getuuid()
          if (cell.eleType === 'button') {
            MenuUtils.resetBtn(cell, item.uuid)
          }
          return cell
        })
      }
    }
    return item
  }
  pasteSubmit = () => {
    const { options } = this.props
    this.pasteFormRef.handleConfirm().then(res => {
@@ -24,6 +69,12 @@
        notification.warning({ top: 92, message: '配置信息格式错误!', duration: 5 })
        return
      }
      let appType = sessionStorage.getItem('appType')
      res.uuid = Utils.getuuid()
      res = this.resetconfig(res, appType)
      this.props.updateConfig(res, (result) => {
        if (result.status) {
          notification.success({
src/views/syscheck/index.jsx
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import { fromJS } from 'immutable'
import { Spin, notification, Button } from 'antd'
import { Spin, notification, Button, Modal } from 'antd'
import moment from 'moment'
import { SwapOutlined } from '@ant-design/icons'
@@ -11,6 +11,7 @@
import './index.scss'
const Header = asyncComponent(() => import('./header'))
const { confirm } = Modal
class SysCheck extends Component {
  state = {
@@ -105,12 +106,39 @@
            duration: 5
          })
        } else {
          this.sqlmap = new Map()
          let errlist = sessionStorage.getItem('syscheck_main')
          errlist = errlist ? JSON.parse(errlist) : null
          if (!errlist) {
          this.setState({
            menulist
          })
          this.sqlmap = new Map()
          this.getMenuParam(fromJS(menulist).toJS())
          } else {
            const that = this
            confirm({
              title: '是否跳过检查合格菜单?',
              content: '',
              okText: '跳过',
              cancelText: '不跳过',
              onOk() {
                menulist = menulist.filter(item => errlist.includes(item.MenuID))
                that.setState({
                  menulist
                })
                that.getMenuParam(fromJS(menulist).toJS())
              },
              onCancel() {
                that.setState({
                  menulist
                })
                that.getMenuParam(fromJS(menulist).toJS())
              }
            })
          }
        }
      } else {
        this.setState({
@@ -249,12 +277,39 @@
                  duration: 5
                })
              } else {
                this.sqlmap = new Map()
                let errlist = sessionStorage.getItem('syscheck_app')
                errlist = errlist ? JSON.parse(errlist) : null
                if (!errlist) {
                this.setState({
                  menulist: list
                })
                this.sqlmap = new Map()
                this.getMenuParam(fromJS(list).toJS())
                } else {
                  const that = this
                  confirm({
                    title: '是否跳过检查合格菜单?',
                    content: '',
                    okText: '跳过',
                    cancelText: '不跳过',
                    onOk() {
                      list = list.filter(item => errlist.includes(item.MenuID))
                      that.setState({
                        menulist: list
                      })
                      that.getMenuParam(fromJS(list).toJS())
                    },
                    onCancel() {
                      that.setState({
                        menulist: list
                      })
                      that.getMenuParam(fromJS(list).toJS())
                    }
                  })
                }
              }
            }
          })
@@ -345,6 +400,8 @@
        } else {
          this.setState({
            loading: false
          }, () => {
            this.record(menu.kei_no ? 'app' : '')
          })
        }
      } else {
@@ -360,6 +417,45 @@
    })
  }
  record = (type) => {
    const { lackmenus, outmenus, unablemenus, backmenus, appbackmenus } = this.state
    let menus = []
    lackmenus.forEach(item => {
      menus.push(item.MenuID)
    })
    outmenus.forEach(item => {
      menus.push(item.MenuID)
    })
    unablemenus.forEach(item => {
      menus.push(item.MenuID)
    })
    backmenus.forEach(item => {
      menus.push(item.MenuID)
    })
    appbackmenus.forEach(item => {
      menus.push(item[0].MenuID)
      menus.push(item[1].MenuID)
    })
    menus = Array.from(new Set(menus))
    if (type === 'app') {
      if (menus.length) {
        sessionStorage.setItem('syscheck_app', JSON.stringify(menus))
      } else {
        sessionStorage.removeItem('syscheck_app')
      }
    } else {
      if (menus.length) {
        sessionStorage.setItem('syscheck_main', JSON.stringify(menus))
      } else {
        sessionStorage.removeItem('syscheck_main')
      }
    }
  }
  render () {
    const { loading, activeMenu, menulist, remain, lackmenus, outmenus, unablemenus, backmenus, appbackmenus } = this.state