king
2022-10-12 53b9fb93d0376eb02bb996935f1720b4e95cd897
src/menu/components/code/sandbox/editorcode/index.jsx
@@ -1,7 +1,8 @@
import React, {Component} from 'react'
import PropTypes from 'prop-types'
import { is, fromJS } from 'immutable'
import { Icon, Modal, Tabs } from 'antd'
import { Modal, Tabs, message } from 'antd'
import { FormOutlined } from '@ant-design/icons'
import zhCN from '@/locales/zh-CN/model.js'
import enUS from '@/locales/en-US/model.js'
@@ -18,7 +19,7 @@
  }
  state = {
    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
    visible: false,
    html: '',
    css: '',
@@ -63,6 +64,11 @@
  }
  onJsChange = (val) => {
    if (/document\.getElementsByTagName/g.test(val)) {
      message.warning('为防止代码冲突,js中不可使用document.getElementsByTagName方法!')
      return
    }
    this.setState({
      js: val
    })
@@ -73,7 +79,7 @@
    return (
      <div style={{display: 'inline-block'}}>
        <Icon title="代码编辑" style={{color: 'purple'}} type="form" onClick={() => this.trigger()} />
        <FormOutlined title="代码编辑" style={{color: 'purple'}} onClick={() => this.trigger()} />
        <Modal
          wrapClassName="popview-modal code-sand-box-code-editor"
          title="内容编辑"