king
2025-04-22 d0d00a8ebb25278e7526bc34786a307baa009b24
2025-04-22
2个文件已修改
2个文件已添加
108 ■■■■■ 已修改文件
src/menu/lowerText/index.jsx 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/lowerText/index.scss 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/menudesign/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/tabledesign/index.jsx 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/menu/lowerText/index.jsx
New file
@@ -0,0 +1,71 @@
import React, { Component } from 'react'
import { Modal, Button, Input, message } from 'antd'
import { CopyOutlined } from '@ant-design/icons'
import './index.scss'
const { TextArea } = Input
class LowerText extends Component {
  state = {
    visible: false,
    content: ''
  }
  trigger = () => {
    this.setState({
      visible: true,
      content: ''
    })
  }
  changeValue = (e) => {
    this.setState({content: e.target.value.toLowerCase()})
  }
  copy = () => {
    const { content } = this.state
    if (navigator.clipboard) {
      navigator.clipboard.writeText(content)
    } else {
      let oInput = document.createElement('input')
      oInput.value = content
      document.body.appendChild(oInput)
      oInput.select()
      document.execCommand('Copy')
      document.body.removeChild(oInput)
    }
    message.success('复制成功。')
  }
  render() {
    const { visible, content } = this.state
    return (
      <>
        <Button className="mk-border-yellow" onClick={this.trigger}>文本转小写</Button>
        <Modal
          title="文本转小写"
          wrapClassName="lower-text-modal"
          visible={visible}
          width={700}
          maskClosable={false}
          centered={true}
          onCancel={() => { this.setState({ visible: false })}}
          footer={[
            <Button key="cancel" onClick={() => { this.setState({ visible: false })}}>关闭</Button>
          ]}
          destroyOnClose
        >
          <TextArea defaultValue="" autoFocus rows={7} onChange={this.changeValue}/>
          <CopyOutlined onClick={this.copy}/>
          <div className="lower-value">{content}</div>
        </Modal>
      </>
    )
  }
}
export default LowerText
src/menu/lowerText/index.scss
New file
@@ -0,0 +1,33 @@
.lower-text-modal {
  .ant-modal-body {
    min-height: 150px;
    .anticon-copy {
      float: right;
      color: #52c41a;
      position: relative;
      top: 20px;
    }
    .lower-value {
      border: 1px solid #91d5ff;
      height: 200px;
      margin-top: 40px;
      padding: 5px;
      overflow-y: auto;
    }
    .lower-value::-webkit-scrollbar {
      width: 8px;
    }
    .lower-value::-webkit-scrollbar-thumb {
      box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13);
      background: rgba(0, 0, 0, 0.13);
      border-radius: 5px;
    }
    .lower-value::-webkit-scrollbar-track {
      box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
      border: 1px solid rgba(0, 0, 0, 0.07);
      background: rgba(0, 0, 0, 0);
      border-radius: 3px;
    }
  }
}
src/views/menudesign/index.jsx
@@ -37,6 +37,7 @@
const ReplaceField = asyncComponent(() => import('@/menu/replaceField'))
const DelExtraDb = asyncComponent(() => import('@/menu/delExtraDb'))
const LowerField = asyncComponent(() => import('@/menu/lowerField'))
const LowerText = asyncComponent(() => import('@/menu/lowerText'))
const Debug = asyncComponent(() => import('@/menu/debug'))
const NormalCss = asyncComponent(() => import('@/menu/normalCss'))
const NormalCopy = asyncComponent(() => import('@/menu/normalCopy'))
@@ -1369,6 +1370,7 @@
                    <ReplaceField config={config} updateConfig={this.resetConfig}/>
                    <LowerField config={config} updateConfig={this.resetConfig}/>
                    <DelExtraDb config={config} updateConfig={this.resetConfig}/>
                    <LowerText />
                    <PictureController/>
                    <Button onClick={() => window.open('#/ai')}>DeepSeek</Button>
                  </div>} trigger={['hover']}>
src/views/tabledesign/index.jsx
@@ -35,6 +35,7 @@
const ReplaceField = asyncComponent(() => import('@/menu/replaceField'))
const DelExtraDb = asyncComponent(() => import('@/menu/delExtraDb'))
const LowerField = asyncComponent(() => import('@/menu/lowerField'))
const LowerText = asyncComponent(() => import('@/menu/lowerText'))
const Debug = asyncComponent(() => import('@/menu/debug'))
const Versions = asyncComponent(() => import('@/menu/versions'))
const Transfer = asyncComponent(() => import('@/menu/transfer'))
@@ -1097,6 +1098,7 @@
                      <ReplaceField config={config} updateConfig={this.resetConfig}/>
                      <LowerField config={config} updateConfig={this.resetConfig}/>
                      <DelExtraDb config={config} updateConfig={this.resetConfig}/>
                      <LowerText />
                      <Button onClick={() => window.open('#/ai')}>DeepSeek</Button>
                    </div>} trigger={['hover']}>
                      <div className="mk-button-more">更多<DownOutlined/></div>