king
2025-01-10 dfdcdcb3dbd0b711bc0b77bb00fd1d39af91bd0b
src/menu/components/share/markcomponent/index.jsx
@@ -112,13 +112,27 @@
        options: [],
        render: text => {
          let sign = {
            'font': '文字',
            'font': '字体颜色',
            'background': '背景',
            'underline': '下划线',
            'line-through': '中划线',
            'icon': '图标',
            'iconfront': '图标',
            'iconback': '图标',
            'iconback': '图标'
          }
          if (text[0] === 'indent') {
            return (
              <div>缩进/{text[1]}个字符</div>
            )
          } else if (text[0] === 'pointfront') {
            return (
              <div><span style={{display: 'inline-block', width: '8px', height: '8px', borderRadius: '14px', background: 'black', verticalAlign: 'middle'}}></span> 点(前)</div>
            )
          } else if (text[0] === 'pointback') {
            return (
              <div>点(后) <span style={{display: 'inline-block', width: '8px', height: '8px', borderRadius: '14px', background: 'black', verticalAlign: 'middle'}}></span></div>
            )
          }
          return (
@@ -249,10 +263,11 @@
        })
      }
    ]
    let signs = [
      {
        value: 'font',
        label: '文字'
        label: '字体颜色'
      },
      {
        value: 'background',
@@ -267,6 +282,14 @@
        label: '中划线'
      },
      {
        value: 'pointfront',
        label: '点(前)'
      },
      {
        value: 'pointback',
        label: '点(后)'
      },
      {
        value: 'iconfront',
        label: '图标(前)',
        children: icons
@@ -275,12 +298,37 @@
        value: 'iconback',
        label: '图标(后)',
        children: icons
      },
      {
        value: 'indent',
        label: '缩进',
        children: [{
          value: 2,
          label: '2个字符'
        }, {
          value: 4,
          label: '4个字符'
        }, {
          value: 6,
          label: '6个字符'
        }, {
          value: 8,
          label: '8个字符'
        }]
      }
    ]
    if (type === 'line' || type === 'sequence') {
      signs.pop()
      signs.pop()
      signs.pop()
      signs.pop()
      signs.pop()
    } else if (type === 'icon') {
      signs = [{
        value: 'font',
        label: '字体颜色'
      }]
    } else if (type === 'slider') {
      markColumns = markColumns.filter(col => {
        col.width = '20%'
@@ -356,12 +404,12 @@
      })
      this.props.onSubmit(marks)
    } else {
      const _this = this
      const that = this
      confirm({
        title: '存在未保存标记,确定忽略吗?',
        onOk() {
          _this.setState({ visible: false })
          _this.props.onSubmit(marks)
          that.setState({ visible: false })
          that.props.onSubmit(marks)
        },
        onCancel() {}
      })
@@ -371,11 +419,16 @@
  render() {
    const { marks, markColumns, visible, options, signs } = this.state
    let className = ''
    if (this.props.type === 'line' && this.props.marks.length) {
      className = 'mk-line-marks'
    }
    return (
      <div style={{display: 'inline-block'}}>
      <div style={{display: 'inline-block'}} className={className}>
        <AntDesignOutlined className="profile" title="标记" onClick={this.resetMark} />
        <Modal
          wrapClassName="model-table-column-mark-modal"
          wrapClassName="mark-modal-wrap"
          title="标记设置"
          visible={visible}
          width={'75vw'}
@@ -387,7 +440,7 @@
        >
          <MarkForm field={this.props.field} signs={signs} columns={options} markChange={this.markChange}/>
          <Col style={{fontSize: '12px', color: '#757575', paddingLeft: '10px'}} span={24}>注:从上到下,匹配第一个符合条件的标记。</Col>
          <EditTable actions={['edit', 'move', 'del']} data={marks} columns={markColumns} onChange={(marks) => this.setState({marks})}/>
          <EditTable actions={['edit', 'move', 'del', 'copy']} type="marks" data={marks} columns={markColumns} onChange={(marks) => this.setState({marks})}/>
        </Modal>
      </div>
    )