wwf
13 小时以前 a1d7e81859f554f3a53680cc35f0f49bf1f77098
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { IButtonMenu, IDomEditor } from '@wangeditor-next/editor'
 
class ProcessRecordMenu implements IButtonMenu {
  readonly tag: string
  readonly title: string
 
  constructor() {
    this.title = '流程记录'
    this.tag = 'button'
  }
 
  getValue(_editor: IDomEditor): string {
    return ''
  }
 
  isActive(_editor: IDomEditor): boolean {
    return false
  }
 
  isDisabled(_editor: IDomEditor): boolean {
    return false
  }
 
  exec(editor: IDomEditor, _value: string) {
    if (this.isDisabled(editor)) return
    const processRecordElem = {
      type: 'process-record',
      children: [{ text: '' }]
    }
    editor.insertNode(processRecordElem)
    editor.move(1)
  }
}
 
const ProcessRecordMenuConf = {
  key: 'ProcessRecordMenu',
  factory() {
    return new ProcessRecordMenu()
  }
}
 
export default ProcessRecordMenuConf