From 0227c25e4ed573d3095ada3f9c9a4ba5f18b0de5 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 20 一月 2021 10:53:01 +0800
Subject: [PATCH] 2021-01-20

---
 src/menu/components/code/sandbox/editorcode/index.scss              |   14 +
 src/menu/components/code/sandbox/index.scss                         |   36 +++
 src/menu/components/share/usercomponent/index.jsx                   |    1 
 src/tabviews/scriptmanage/actionList/index.jsx                      |   10 
 src/tabviews/scriptmanage/config.jsx                                |    4 
 src/menu/components/code/sandbox/wrapsetting/settingform/index.jsx  |  199 ++++++++++++++++
 src/menu/components/code/sandbox/wrapsetting/index.jsx              |   83 ++++++
 src/menu/components/code/sandbox/index.jsx                          |  189 +++++++++++++++
 src/menu/modelsource/option.jsx                                     |    1 
 src/menu/components/editor/braft-editor/editorcontent/index.jsx     |    4 
 src/menu/components/editor/braft-editor/index.jsx                   |    4 
 src/tabviews/scriptmanage/index.jsx                                 |   17 -
 src/menu/menushell/card.jsx                                         |    3 
 src/menu/components/editor/braft-editor/index.scss                  |    4 
 src/menu/components/code/sandbox/editorcode/index.jsx               |   82 ++++++
 src/menu/components/code/sandbox/wrapsetting/index.scss             |    7 
 src/menu/components/code/sandbox/wrapsetting/settingform/index.scss |   15 +
 src/menu/menushell/index.jsx                                        |    1 
 18 files changed, 643 insertions(+), 31 deletions(-)

diff --git a/src/menu/components/code/sandbox/editorcode/index.jsx b/src/menu/components/code/sandbox/editorcode/index.jsx
new file mode 100644
index 0000000..69ad361
--- /dev/null
+++ b/src/menu/components/code/sandbox/editorcode/index.jsx
@@ -0,0 +1,82 @@
+import React, {Component} from 'react'
+import PropTypes from 'prop-types'
+import { is, fromJS } from 'immutable'
+import { Icon, Modal } from 'antd'
+
+import zhCN from '@/locales/zh-CN/model.js'
+import enUS from '@/locales/en-US/model.js'
+import asyncComponent from '@/utils/asyncComponent'
+import './index.scss'
+
+const CodeMirror = asyncComponent(() => import('@/templates/zshare/codemirror'))
+
+class DataSource extends Component {
+  static propTpyes = {
+    config: PropTypes.any,
+    updateConfig: PropTypes.func
+  }
+
+  state = {
+    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
+    visible: false,
+    html: null
+  }
+
+  shouldComponentUpdate (nextProps, nextState) {
+    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
+  }
+
+  trigger = () => {
+    const { config } = this.props
+
+    this.setState({
+      visible: true,
+      html: config.html || null
+    })
+  }
+
+  verifySubmit = () => {
+    const { config } = this.props
+    const { html } = this.state
+
+    this.setState({
+      visible: false
+    })
+    this.props.updateConfig({...config, html})
+  }
+
+  onChange = (val) => {
+    this.setState({
+      html: val
+    })
+  }
+
+  render () {
+    const { config } = this.props
+    const { visible, dict, html } = this.state
+
+    if (!config) return null
+
+    return (
+      <div className="model-menu-edit-content-wrap">
+        {config.wrap.datatype === 'static' ? <Icon title="鍐呭缂栬緫" type="form" onClick={() => this.trigger()} /> : null}
+        {config.wrap.datatype !== 'static' ? <Icon title="鍐呭缂栬緫" style={{color: '#eeeeee', cursor: 'not-allowed'}} type="form"/> : null}
+        <Modal
+          wrapClassName="popview-modal model-menu-edit-content-form"
+          title="鍐呭缂栬緫"
+          visible={visible}
+          width={950}
+          maskClosable={false}
+          okText={dict['model.submit']}
+          onOk={this.verifySubmit}
+          onCancel={() => { this.setState({ visible: false }) }}
+          destroyOnClose
+        >
+          <CodeMirror value={html} onChange={this.onChange} />
+        </Modal>
+      </div>
+    )
+  }
+}
+
+export default DataSource
\ No newline at end of file
diff --git a/src/menu/components/code/sandbox/editorcode/index.scss b/src/menu/components/code/sandbox/editorcode/index.scss
new file mode 100644
index 0000000..dc27e8c
--- /dev/null
+++ b/src/menu/components/code/sandbox/editorcode/index.scss
@@ -0,0 +1,14 @@
+.model-menu-edit-content-wrap {
+  display: inline-block;
+
+  >.anticon-form {
+    color: purple;
+  }
+}
+.model-menu-edit-content-form {
+  .normal-braft-editor {
+    border: 1px solid #d9d9d9;
+    border-radius: 4px;
+    overflow-x: hidden;
+  }
+}
\ No newline at end of file
diff --git a/src/menu/components/code/sandbox/index.jsx b/src/menu/components/code/sandbox/index.jsx
new file mode 100644
index 0000000..0cb56a5
--- /dev/null
+++ b/src/menu/components/code/sandbox/index.jsx
@@ -0,0 +1,189 @@
+import React, {Component} from 'react'
+import PropTypes from 'prop-types'
+import {connect} from 'react-redux'
+import { is, fromJS } from 'immutable'
+import { Icon, Popover } from 'antd'
+
+import asyncComponent from '@/utils/asyncComponent'
+import asyncIconComponent from '@/utils/asyncIconComponent'
+
+import MKEmitter from '@/utils/events.js'
+import zhCN from '@/locales/zh-CN/model.js'
+import enUS from '@/locales/en-US/model.js'
+
+import './index.scss'
+
+const SettingComponent = asyncIconComponent(() => import('@/menu/datasource'))
+const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent'))
+const UserComponent = asyncIconComponent(() => import('@/menu/components/share/usercomponent'))
+const WrapComponent = asyncIconComponent(() => import('./wrapsetting'))
+const EditorCode = asyncIconComponent(() => import('./editorcode'))
+const BraftContent = asyncComponent(() => import('@/tabviews/custom/components/share/braftContent'))
+
+class CodeSandBox extends Component {
+  static propTpyes = {
+    card: PropTypes.object,
+    deletecomponent: PropTypes.func,
+    updateConfig: PropTypes.func,
+  }
+
+  state = {
+    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
+    card: null,
+    back: false
+  }
+
+  UNSAFE_componentWillMount () {
+    const { card } = this.props
+
+    if (card.isNew) {
+      let _card = {
+        uuid: card.uuid,
+        type: card.type,
+        floor: card.floor,
+        tabId: card.tabId || '',
+        parentId: card.parentId || '',
+        dataName: card.dataName || '',
+        format: 'object',   // 缁勪欢灞炴�� - 鏁版嵁鏍煎紡
+        pageable: false,    // 缁勪欢灞炴�� - 鏄惁鍙垎椤�
+        switchable: false,  // 缁勪欢灞炴�� - 鏁版嵁鏄惁鍙垏鎹�
+        width: card.width || 24,
+        name: card.name,
+        subtype: card.subtype,
+        setting: { interType: 'system' },
+        wrap: { name: card.name, width: card.width || 24, encryption: 'true' },
+        style: { marginLeft: '8px', marginRight: '8px', marginTop: '8px', marginBottom: '8px' },
+        columns: [],
+        scripts: [],
+        html: '',
+        css: ''
+      }
+
+      if (card.config) {
+        let config = fromJS(card.config).toJS()
+
+        _card.wrap = config.wrap
+        _card.wrap.name = card.name
+        _card.style = config.style
+        _card.html = config.html
+        _card.css = config.css
+      }
+      
+      this.setState({
+        card: _card
+      })
+      this.props.updateConfig(_card)
+    } else {
+      this.setState({
+        card: fromJS(card).toJS()
+      })
+    }
+  }
+
+  componentDidMount () {
+    MKEmitter.addListener('submitStyle', this.getStyle)
+  }
+
+  shouldComponentUpdate (nextProps, nextState) {
+    return !is(fromJS(this.state), fromJS(nextState)) || (!this.props.menu && nextProps.menu)
+  }
+
+  /**
+   * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊锛屾竻闄ゅ揩鎹烽敭璁剧疆
+   */
+  componentWillUnmount () {
+    this.setState = () => {
+      return
+    }
+    MKEmitter.removeListener('submitStyle', this.getStyle)
+  }
+
+  /**
+   * @description 鍗$墖琛屽灞備俊鎭洿鏂帮紙鏁版嵁婧愶紝鏍峰紡绛夛級
+   */
+  updateComponent = (component) => {
+    this.setState({
+      card: component
+    })
+
+    component.width = component.wrap.width
+    component.name = component.wrap.name
+
+    this.props.updateConfig(component)
+  }
+
+  changeStyle = () => {
+    const { card } = this.state
+
+    MKEmitter.emit('changeStyle', [card.uuid], ['background', 'border', 'padding', 'margin'], card.style)
+  }
+
+  getStyle = (comIds, style) => {
+    const { card } = this.state
+
+    if (comIds[0] !== card.uuid || comIds.length !== 1) return
+
+    let _card = {...card, style}
+
+    this.setState({
+      card: _card
+    })
+    
+    this.props.updateConfig(_card)
+  }
+
+  /**
+   * @description 鏇存柊鎼滅储鏉′欢閰嶇疆淇℃伅
+   */
+  updateconfig = (config) => {
+    this.setState({
+      card: config
+    })
+    this.props.updateConfig(config)
+  }
+
+  clickComponent = (e) => {
+    if (sessionStorage.getItem('style-control') === 'true' || sessionStorage.getItem('style-control') === 'component') {
+      e.stopPropagation()
+      MKEmitter.emit('clickComponent', this.state.card)
+    }
+  }
+
+  render() {
+    const { card } = this.state
+    return (
+      <div className="menu-editor-sand-box" style={{...card.style}} onClick={this.clickComponent} id={card.uuid}>
+        <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={
+          <div className="mk-popover-control">
+            <WrapComponent config={card} updateConfig={this.updateComponent} />
+            <CopyComponent type="normaltable" card={card}/>
+            <Icon className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle} type="font-colors" />
+            <UserComponent config={card}/>
+            <Icon className="close" title="鍒犻櫎缁勪欢" type="delete" onClick={() => this.props.deletecomponent(card.uuid)} />
+            <EditorCode config={card} updateConfig={this.updateComponent}/>
+            {card.wrap.datatype !== 'static' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : null}
+            {card.wrap.datatype === 'static' ? <Icon style={{color: '#eeeeee', cursor: 'not-allowed'}} type="setting"/> : null}
+          </div>
+        } trigger="hover">
+          <Icon type="tool" />
+        </Popover>
+        <BraftContent
+          value={card.wrap.datatype !== 'static' ? '<p class="empty-content">瀵屾枃鏈�</p>' : card.html}
+          encryption="false"
+        />
+      </div>
+    )
+  }
+}
+
+const mapStateToProps = (state) => {
+  return {
+    menu: state.customMenu
+  }
+}
+
+const mapDispatchToProps = () => {
+  return {}
+}
+
+export default connect(mapStateToProps, mapDispatchToProps)(CodeSandBox)
\ No newline at end of file
diff --git a/src/menu/components/code/sandbox/index.scss b/src/menu/components/code/sandbox/index.scss
new file mode 100644
index 0000000..5301c03
--- /dev/null
+++ b/src/menu/components/code/sandbox/index.scss
@@ -0,0 +1,36 @@
+.menu-editor-sand-box {
+  position: relative;
+  box-sizing: border-box;
+  background: #ffffff;
+  background-position: center center;
+  background-repeat: no-repeat;
+  background-size: cover;
+  min-height: 100px;
+
+  .anticon-tool {
+    position: absolute;
+    z-index: 2;
+    font-size: 16px;
+    right: 1px;
+    top: 1px;
+    cursor: pointer;
+    padding: 5px;
+    background: rgba(255, 255, 255, 0.55);
+  }
+  .empty-content {
+    text-align: center;
+    font-size: 30px;
+    margin: 0;
+    line-height: 90px;
+    color: #bcbcbc;
+  }
+}
+.menu-editor-sand-box::after {
+  display: block;
+  content: ' ';
+  clear: both;
+}
+.menu-editor-sand-box:hover {
+  z-index: 1;
+  box-shadow: 0px 0px 4px #1890ff;
+}
diff --git a/src/menu/components/code/sandbox/wrapsetting/index.jsx b/src/menu/components/code/sandbox/wrapsetting/index.jsx
new file mode 100644
index 0000000..c949c28
--- /dev/null
+++ b/src/menu/components/code/sandbox/wrapsetting/index.jsx
@@ -0,0 +1,83 @@
+import React, {Component} from 'react'
+import PropTypes from 'prop-types'
+import { is, fromJS } from 'immutable'
+import { Icon, Modal } from 'antd'
+
+import zhCN from '@/locales/zh-CN/model.js'
+import enUS from '@/locales/en-US/model.js'
+import SettingForm from './settingform'
+import './index.scss'
+
+class DataSource extends Component {
+  static propTpyes = {
+    config: PropTypes.any,
+    updateConfig: PropTypes.func
+  }
+
+  state = {
+    dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS,
+    visible: false,
+    wrap: null
+  }
+
+  UNSAFE_componentWillMount () {
+    const { config } = this.props
+
+    this.setState({wrap: fromJS(config.wrap).toJS()})
+  }
+
+  shouldComponentUpdate (nextProps, nextState) {
+    return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState))
+  }
+
+  editDataSource = () => {
+    this.setState({
+      visible: true
+    })
+  }
+
+  verifySubmit = () => {
+    const { config } = this.props
+
+    this.verifyRef.handleConfirm().then(res => {
+
+      this.setState({
+        wrap: res,
+        visible: false
+      })
+      this.props.updateConfig({...config, wrap: res})
+    })
+  }
+
+  render () {
+    const { config } = this.props
+    const { visible, dict, wrap } = this.state
+
+    return (
+      <div className="model-menu-setting-wrap">
+        <Icon type="edit" onClick={() => this.editDataSource()} />
+        <Modal
+          wrapClassName="popview-modal"
+          title="瀵屾枃鏈缃�"
+          visible={visible}
+          width={700}
+          maskClosable={false}
+          okText={dict['model.submit']}
+          onOk={this.verifySubmit}
+          onCancel={() => { this.setState({ visible: false }) }}
+          destroyOnClose
+        >
+          <SettingForm
+            dict={dict}
+            wrap={wrap}
+            config={config}
+            inputSubmit={this.verifySubmit}
+            wrappedComponentRef={(inst) => this.verifyRef = inst}
+          />
+        </Modal>
+      </div>
+    )
+  }
+}
+
+export default DataSource
\ No newline at end of file
diff --git a/src/menu/components/code/sandbox/wrapsetting/index.scss b/src/menu/components/code/sandbox/wrapsetting/index.scss
new file mode 100644
index 0000000..04372e6
--- /dev/null
+++ b/src/menu/components/code/sandbox/wrapsetting/index.scss
@@ -0,0 +1,7 @@
+.model-menu-setting-wrap {
+  display: inline-block;
+
+  >.anticon-edit {
+    color: #1890ff;
+  }
+}
\ No newline at end of file
diff --git a/src/menu/components/code/sandbox/wrapsetting/settingform/index.jsx b/src/menu/components/code/sandbox/wrapsetting/settingform/index.jsx
new file mode 100644
index 0000000..b93fffd
--- /dev/null
+++ b/src/menu/components/code/sandbox/wrapsetting/settingform/index.jsx
@@ -0,0 +1,199 @@
+import React, {Component} from 'react'
+import PropTypes from 'prop-types'
+import { Form, Row, Col, Input, Radio, Tooltip, Icon, InputNumber, Select } from 'antd'
+
+import './index.scss'
+
+class SettingForm extends Component {
+  static propTpyes = {
+    dict: PropTypes.object,      // 瀛楀吀椤�
+    config: PropTypes.object,    // 鍗$墖琛屼俊鎭�
+    wrap: PropTypes.object,      // 鏁版嵁婧愰厤缃�
+    inputSubmit: PropTypes.func  // 鍥炶溅浜嬩欢
+  }
+
+  state = {
+    roleList: [],
+    datatype: this.props.wrap.datatype || 'dynamic'
+  }
+
+  UNSAFE_componentWillMount () {
+    let roleList = sessionStorage.getItem('sysRoles')
+    if (roleList) {
+      try {
+        roleList = JSON.parse(roleList)
+      } catch {
+        roleList = []
+      }
+    } else {
+      roleList = []
+    }
+
+    this.setState({roleList})
+  }
+
+  handleConfirm = () => {
+    // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭�
+    return new Promise((resolve, reject) => {
+      this.props.form.validateFieldsAndScroll((err, values) => {
+        if (!err) {
+          resolve(values)
+        } else {
+          reject(err)
+        }
+      })
+    })
+  }
+
+  handleSubmit = (e) => {
+    e.preventDefault()
+
+    if (this.props.inputSubmit) {
+      this.props.inputSubmit()
+    }
+  }
+
+  changeDataType = (e) => {
+    this.setState({datatype: e.target.value})
+  }
+
+  render() {
+    const { wrap, config } = this.props
+    const { getFieldDecorator } = this.props.form
+    const { roleList, datatype } = this.state
+
+    const formItemLayout = {
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 8 }
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 16 }
+      }
+    }
+
+    return (
+      <div className="model-menu-setting-form">
+        <Form {...formItemLayout}>
+          <Row gutter={24}>
+            <Col span={12}>
+              <Form.Item label="鏍囬">
+                {getFieldDecorator('title', {
+                  initialValue: wrap.title || ''
+                })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit} />)}
+              </Form.Item>
+            </Col>
+            <Col span={12}>
+              <Form.Item label={
+                <Tooltip placement="topLeft" title="鐢ㄤ簬缁勪欢闂寸殑鍖哄垎銆�">
+                  <Icon type="question-circle" />
+                  缁勪欢鍚嶇О
+                </Tooltip>
+              }>
+                {getFieldDecorator('name', {
+                  initialValue: wrap.name,
+                  rules: [
+                    {
+                      required: true,
+                      message: this.props.dict['form.required.input'] + '缁勪欢鍚嶇О!'
+                    }
+                  ]
+                })(<Input placeholder={''} autoComplete="off" onPressEnter={this.handleSubmit} />)}
+              </Form.Item>
+            </Col>
+            <Col span={12}>
+              <Form.Item label={
+                <Tooltip placement="topLeft" title="鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��">
+                  <Icon type="question-circle" />
+                  瀹藉害
+                </Tooltip>
+              }>
+                {getFieldDecorator('width', {
+                  initialValue: wrap.width || 24,
+                  rules: [
+                    {
+                      required: true,
+                      message: this.props.dict['form.required.input'] + '瀹藉害!'
+                    }
+                  ]
+                })(<InputNumber min={1} max={24} precision={0} onPressEnter={this.handleSubmit} />)}
+              </Form.Item>
+            </Col>
+            <Col span={12}>
+              <Form.Item label={
+                <Tooltip placement="topLeft" title="閫夋嫨闈欐�佸�硷紝鏃犻渶閰嶇疆鏁版嵁婧愩��">
+                  <Icon type="question-circle" />
+                  鏁版嵁鏉ユ簮
+                </Tooltip>
+              }>
+                {getFieldDecorator('datatype', {
+                  initialValue: datatype
+                })(
+                  <Radio.Group onChange={this.changeDataType}>
+                    <Radio value="dynamic">鍔ㄦ��</Radio>
+                    <Radio value="static">闈欐��</Radio>
+                  </Radio.Group>
+                )}
+              </Form.Item>
+            </Col>
+            {datatype === 'dynamic' ? <Col span={12}>
+              <Form.Item label={
+                <Tooltip placement="topLeft" title="閫夋嫨鍔ㄦ�佸�兼椂锛岄渶璁剧疆鏂囨湰瀛楁鎵嶅彲鐢熸晥銆�">
+                  <Icon type="question-circle" />
+                  鏂囨湰瀛楁
+                </Tooltip>
+              }>
+                {getFieldDecorator('field', {
+                  initialValue: wrap.field || ''
+                })(
+                  <Select>
+                    {config.columns.map(option =>
+                      <Select.Option key={option.uuid} value={option.field}>{option.label}</Select.Option>
+                    )}
+                  </Select>
+                )}
+              </Form.Item>
+            </Col> : null}
+            {datatype === 'dynamic' ? <Col span={12}>
+              <Form.Item label={
+                <Tooltip placement="topLeft" title="浠庢暟鎹簮鑾峰彇鐨勬暟鎹槸鍚﹂渶瑕佽В鐮併��">
+                  <Icon type="question-circle" />
+                  鏁版嵁瑙g爜
+                </Tooltip>
+              }>
+                {getFieldDecorator('encryption', {
+                  initialValue: wrap.encryption || 'true'
+                })(
+                  <Radio.Group>
+                    <Radio value="true">鏄�</Radio>
+                    <Radio value="false">鍚�</Radio>
+                  </Radio.Group>
+                )}
+              </Form.Item>
+            </Col> : null}
+            <Col span={12}>
+              <Form.Item label="榛戝悕鍗�">
+                {getFieldDecorator('blacklist', {
+                  initialValue: wrap.blacklist || []
+                })(
+                  <Select
+                    showSearch
+                    mode="multiple"
+                    filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
+                  >
+                    {roleList.map(option =>
+                      <Select.Option key={option.uuid} value={option.value}>{option.text}</Select.Option>
+                    )}
+                  </Select>
+                )}
+              </Form.Item>
+            </Col>
+          </Row>
+        </Form>
+      </div>
+    )
+  }
+}
+
+export default Form.create()(SettingForm)
\ No newline at end of file
diff --git a/src/menu/components/code/sandbox/wrapsetting/settingform/index.scss b/src/menu/components/code/sandbox/wrapsetting/settingform/index.scss
new file mode 100644
index 0000000..c530b18
--- /dev/null
+++ b/src/menu/components/code/sandbox/wrapsetting/settingform/index.scss
@@ -0,0 +1,15 @@
+.model-menu-setting-form {
+  position: relative;
+
+  .anticon-question-circle {
+    color: #c49f47;
+    margin-right: 3px;
+  }
+  .ant-input-number {
+    width: 100%;
+  }
+  .color-sketch-block {
+    position: relative;
+    top: 7px;
+  }
+}
\ No newline at end of file
diff --git a/src/menu/components/editor/braft-editor/editorcontent/index.jsx b/src/menu/components/editor/braft-editor/editorcontent/index.jsx
index 1548854..fd1f8a4 100644
--- a/src/menu/components/editor/braft-editor/editorcontent/index.jsx
+++ b/src/menu/components/editor/braft-editor/editorcontent/index.jsx
@@ -10,7 +10,7 @@
 
 const Editor = asyncComponent(() => import('@/components/editor'))
 
-class DataSource extends Component {
+class EditorContentComponent extends Component {
   static propTpyes = {
     config: PropTypes.any,
     updateConfig: PropTypes.func
@@ -79,4 +79,4 @@
   }
 }
 
-export default DataSource
\ No newline at end of file
+export default EditorContentComponent
\ No newline at end of file
diff --git a/src/menu/components/editor/braft-editor/index.jsx b/src/menu/components/editor/braft-editor/index.jsx
index 708d546..cac96be 100644
--- a/src/menu/components/editor/braft-editor/index.jsx
+++ b/src/menu/components/editor/braft-editor/index.jsx
@@ -21,7 +21,7 @@
 const EditorContent = asyncIconComponent(() => import('./editorcontent'))
 const BraftContent = asyncComponent(() => import('@/tabviews/custom/components/share/braftContent'))
 
-class TableCardEditComponent extends Component {
+class BraftEditorComponent extends Component {
   static propTpyes = {
     card: PropTypes.object,
     deletecomponent: PropTypes.func,
@@ -193,4 +193,4 @@
   return {}
 }
 
-export default connect(mapStateToProps, mapDispatchToProps)(TableCardEditComponent)
\ No newline at end of file
+export default connect(mapStateToProps, mapDispatchToProps)(BraftEditorComponent)
\ No newline at end of file
diff --git a/src/menu/components/editor/braft-editor/index.scss b/src/menu/components/editor/braft-editor/index.scss
index ee47b6d..8830797 100644
--- a/src/menu/components/editor/braft-editor/index.scss
+++ b/src/menu/components/editor/braft-editor/index.scss
@@ -25,12 +25,12 @@
     color: #bcbcbc;
   }
 }
-.menu-normal-table-edit-box::after {
+.menu-normal-editor-box::after {
   display: block;
   content: ' ';
   clear: both;
 }
-.menu-normal-table-edit-box:hover {
+.menu-normal-editor-box:hover {
   z-index: 1;
   box-shadow: 0px 0px 4px #1890ff;
 }
diff --git a/src/menu/components/share/usercomponent/index.jsx b/src/menu/components/share/usercomponent/index.jsx
index cff1df6..a69015a 100644
--- a/src/menu/components/share/usercomponent/index.jsx
+++ b/src/menu/components/share/usercomponent/index.jsx
@@ -54,6 +54,7 @@
     _config.cols = config.cols || []
     _config.plot = config.plot || {}
     _config.html = config.html || ''
+    _config.css = config.css || ''
 
     _config.width = _config.wrap.width || _config.plot.width || config.width || 24
 
diff --git a/src/menu/menushell/card.jsx b/src/menu/menushell/card.jsx
index fd43cac..1413357 100644
--- a/src/menu/menushell/card.jsx
+++ b/src/menu/menushell/card.jsx
@@ -14,6 +14,7 @@
 const NormalTable = asyncComponent(() => import('@/menu/components/table/normal-table'))
 const NormalGroup = asyncComponent(() => import('@/menu/components/group/normal-group'))
 const BraftEditor = asyncComponent(() => import('@/menu/components/editor/braft-editor'))
+const CodeSandbox = asyncComponent(() => import('@/menu/components/code/sandbox'))
 
 const Card = ({ id, card, moveCard, findCard, delCard, updateConfig }) => {
   const originalIndex = findCard(id).index
@@ -69,6 +70,8 @@
       return (<NormalGroup group={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
     } else if (card.type === 'editor') {
       return (<BraftEditor card={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
+    } else if (card.type === 'code') {
+      return (<CodeSandbox card={card} updateConfig={updateConfig} deletecomponent={delCard}/>)
     }
   }
   return (
diff --git a/src/menu/menushell/index.jsx b/src/menu/menushell/index.jsx
index 9c2b767..cb51df3 100644
--- a/src/menu/menushell/index.jsx
+++ b/src/menu/menushell/index.jsx
@@ -90,6 +90,7 @@
         table: '琛ㄦ牸',
         group: '鍒嗙粍',
         editor: '瀵屾枃鏈�',
+        code: '鑷畾涔�',
         card: '鍗$墖'
       }
       let i = 1
diff --git a/src/menu/modelsource/option.jsx b/src/menu/modelsource/option.jsx
index d263619..f99e7bc 100644
--- a/src/menu/modelsource/option.jsx
+++ b/src/menu/modelsource/option.jsx
@@ -29,6 +29,7 @@
   { type: 'menu', url: Pie, component: 'pie', subtype: 'pie', title: '楗煎浘', width: 12 },
   { type: 'menu', url: Pie1, component: 'pie', subtype: 'ring', title: '鐜浘', width: 12 },
   { type: 'menu', url: Editor, component: 'editor', subtype: 'brafteditor', title: '瀵屾枃鏈�', width: 24 },
+  { type: 'menu', url: Editor, component: 'code', subtype: 'sandbox', title: '鑷畾涔�', width: 24 },
   { type: 'menu', url: Pie2, component: 'pie', subtype: 'nightingale', title: '鍗椾竵鏍煎皵鍥�', width: 12 },
   { type: 'menu', url: group, component: 'group', subtype: 'normalgroup', title: '鍒嗙粍', width: 24, forbid: ['billPrint'] },
 ]
diff --git a/src/tabviews/scriptmanage/actionList/index.jsx b/src/tabviews/scriptmanage/actionList/index.jsx
index 677751a..29eb5df 100644
--- a/src/tabviews/scriptmanage/actionList/index.jsx
+++ b/src/tabviews/scriptmanage/actionList/index.jsx
@@ -33,10 +33,6 @@
     configMap: {}
   }
 
-  refreshdata = (item, type) => {
-    this.props.refreshdata(item, type)
-  }
-  
   /**
    * @description 瑙﹀彂鎸夐挳鎿嶄綔
    */
@@ -179,7 +175,9 @@
       })
     }
 
-    this.refreshdata(btn, 'success')
+    if (btn.execSuccess !== 'never') {
+      this.props.refreshdata()
+    }
   }
 
   /**
@@ -209,8 +207,6 @@
     } else if (res.ErrCode === 'NM') {
       message.error(res.message || res.ErrMesg)
     }
-    
-    this.refreshdata(btn, 'error')
   }
 
 
diff --git a/src/tabviews/scriptmanage/config.jsx b/src/tabviews/scriptmanage/config.jsx
index 7a06701..08305a9 100644
--- a/src/tabviews/scriptmanage/config.jsx
+++ b/src/tabviews/scriptmanage/config.jsx
@@ -63,7 +63,7 @@
       {"label":"鍑芥暟","field":"func","type":"text","initval":"","readonly":"false","required":"true","hidden":"false","readin":"true","fieldlength":50,"regular":"funcname","supField":"","blacklist":[],"uuid":"1587006164634l397q15t49u2pfq02f5"},
       {"label":"鎺掑簭","field":"Sort","type":"number","initval":0,"decimal":0,"min":"","max":"","readonly":"false","hidden":"false","readin":"true","supField":"","blacklist":[],"uuid":"15870101796149403f2pqfpviuo415m2"},
       {"label":"鎻忚堪","field":"Remark","type":"textarea","initval":"","readonly":"false","required":"false","hidden":"false","readin":"true","fieldlength":512,"maxRows":6,"supField":"","blacklist":[],"uuid":"1587006199263k8hm45cmtomgu6hd881"},
-      {"label":"鑴氭湰","field":"LongParam","type":"textarea","initval":"","readonly":"false","required":"true","hidden":"false","readin":"true","fieldlength":8000,"maxRows":20,"supField":"","blacklist":[],"uuid":"1587006209935qbkle15h4d9i9lg9tcu"}
+      {"label":"鑴氭湰","field":"LongParam","type":"textarea","initval":"","readonly":"false","required":"true","encryption":"true","hidden":"false","readin":"true","fieldlength":8000,"maxRows":20,"supField":"","blacklist":[],"uuid":"1587006209935qbkle15h4d9i9lg9tcu"}
     ]
   },
   '1587007258155ut4nbggg4r66t9uhut2': {
@@ -84,7 +84,7 @@
       {"label":"鍑芥暟","field":"func","type":"text","initval":"","readonly":"false","required":"true","hidden":"false","readin":"true","fieldlength":50,"regular":"funcname","supField":"","blacklist":[],"uuid":"1587006164634l397q15t49u2pfq02f5"},
       {"label":"鎺掑簭","field":"Sort","type":"number","initval":0,"decimal":0,"min":"","max":"","readonly":"false","hidden":"false","readin":"true","supField":"","blacklist":[],"uuid":"1587010196675i9m6ie3tv9kg2rhgfi0"},
       {"label":"鎻忚堪","field":"Remark","type":"textarea","initval":"","readonly":"false","required":"false","hidden":"false","readin":"true","fieldlength":512,"maxRows":6,"supField":"","blacklist":[],"uuid":"1587006199263k8hm45cmtomgu6hd881"},
-      {"label":"鑴氭湰","field":"LongParam","type":"textarea","initval":"","readonly":"false","required":"true","hidden":"false","readin":"true","fieldlength":8000,"maxRows":20,"supField":"","blacklist":[],"uuid":"1587006209935qbkle15h4d9i9lg9tcu"}
+      {"label":"鑴氭湰","field":"LongParam","type":"textarea","initval":"","readonly":"false","required":"true","encryption":"true","hidden":"false","readin":"true","fieldlength":8000,"maxRows":20,"supField":"","blacklist":[],"uuid":"1587006209935qbkle15h4d9i9lg9tcu"}
     ]
   }
 }
diff --git a/src/tabviews/scriptmanage/index.jsx b/src/tabviews/scriptmanage/index.jsx
index 64395fb..fef9e73 100644
--- a/src/tabviews/scriptmanage/index.jsx
+++ b/src/tabviews/scriptmanage/index.jsx
@@ -255,21 +255,6 @@
   }
 
   /**
-   * @description 鎸夐挳鎿嶄綔瀹屾垚鍚庯紙鎴愬姛鎴栧け璐ワ級锛岄〉闈㈠埛鏂帮紝閲嶇疆椤电爜鍙婇�夋嫨椤�
-   */
-  refreshbyaction = (btn, type) => {
-    if (btn.execSuccess === 'grid' && type === 'success') {
-      this.reloadtable()
-    } else if (btn.execError === 'grid' && type === 'error') {
-      this.reloadtable()
-    } else if (btn.execSuccess === 'view' && type === 'success') {
-      this.reloadview()
-    } else if (btn.execError === 'view' && type === 'error') {
-      this.reloadview()
-    }
-  }
-
-  /**
    * @description 琛ㄦ牸閫夋嫨椤瑰垏鎹�
    */
   changeSelectedData = (selectedData) => {
@@ -332,7 +317,7 @@
           MenuID={this.props.MenuID}
           selectedData={selectedData}
           ContainerId={this.state.ContainerId}
-          refreshdata={this.refreshbyaction}
+          refreshdata={this.reloadtable}
         />
         <div className="main-table-box">
           {this.state.data && this.state.data.length > 0 ?

--
Gitblit v1.8.0