From d1f19b794216b37417e114b71c1cd7a2ac3d7748 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 02 三月 2023 01:14:29 +0800
Subject: [PATCH] 2023-03-02
---
src/menu/components/code/sandbox/editorcode/index.jsx | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/menu/components/code/sandbox/editorcode/index.jsx b/src/menu/components/code/sandbox/editorcode/index.jsx
index 6d3df7d..45acab3 100644
--- a/src/menu/components/code/sandbox/editorcode/index.jsx
+++ b/src/menu/components/code/sandbox/editorcode/index.jsx
@@ -1,10 +1,9 @@
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'
import asyncComponent from '@/utils/asyncComponent'
import './index.scss'
@@ -18,7 +17,6 @@
}
state = {
- dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
visible: false,
html: '',
css: '',
@@ -63,24 +61,29 @@
}
onJsChange = (val) => {
+ if (/document\.getElementsByTagName/g.test(val)) {
+ message.warning('涓洪槻姝唬鐮佸啿绐侊紝js涓笉鍙娇鐢╠ocument.getElementsByTagName鏂规硶!')
+ return
+ }
+
this.setState({
js: val
})
}
render () {
- const { visible, dict, html, css, js } = this.state
+ const { visible, html, css, js } = this.state
return (
<div style={{display: 'inline-block'}}>
- <Icon title="浠g爜缂栬緫" style={{color: 'purple'}} type="form" onClick={() => this.trigger()} />
+ <FormOutlined title="浠g爜缂栬緫" style={{color: 'purple'}} onClick={() => this.trigger()} />
<Modal
wrapClassName="popview-modal code-sand-box-code-editor"
title="鍐呭缂栬緫"
visible={visible}
width={950}
maskClosable={false}
- okText={dict['model.submit']}
+ okText="鎻愪氦"
onOk={this.verifySubmit}
onCancel={() => { this.setState({ visible: false }) }}
destroyOnClose
--
Gitblit v1.8.0