-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
644 lines (571 loc) · 33.6 KB
/
index.html
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
<!-- 如何禁止浏览器缓存 https://www.zhihu.com/question/27565755 -->
<!-- 使用HTML meta no-cache标签来禁用缓存 https://www.cnblogs.com/zdz8207/p/vue-meta-no-cache.html -->
<!-- axios禁止请求缓存 https://blog.csdn.net/u010238381/article/details/84304968 -->
<title>空间关系理解数据标注 2022</title>
<link href="lib/bootstrap_5.1.3_.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<style type="text/css">
</style>
</head>
<body>
<div class="bodywrap" id="bodywrap">
<div class="page-cover" v-if="false">
<div class="container pt-5 text-center">
<div class="row">
<div><h2>空间关系理解数据标注 2022</h2></div>
</div>
<div class="row">
<div>
<p>正在加载,请稍候……</p>
</div>
</div>
</div>
</div>
<!-- navbar start -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container">
<a class="navbar-brand" href="#">空间关系理解数据标注 2022</a>
</div>
</nav>
<!-- navbar end -->
<div class="container page my-4 hiddent" id="page-import">
<div class="container py-2">
<!-- progressCtrl start -->
<div class="row align-items-center">
<div class="col col-12 my-2" v-if="!ctrl?.currentWorker?.length">
<div>请填写姓名!</div>
</div>
<div class="col col-12 col-md-3 col-lg-2 my-2">
<input class="form-control form-control-sm" type="text" v-model="ctrl.currentWorker" placeholder="请在此输入姓名">
</div>
<div class="col col-12 col-md-9 col-lg-10 my-2">
<div class="progress">
<div class="progress-bar bg-success" role="progressbar" :style="`min-width: ${ctrl.donePct};`"
:aria-valuenow="ctrl.doneNum" aria-valuemin="0" :aria-valuemax="ctrl.totalNum">{{ ctrl.doneNum }}/{{
ctrl.totalNum }}</div>
</div>
</div>
</div>
<!-- progressCtrl end -->
<!-- fileCtrl start -->
<form name="file-form" class="row" id="filePicker">
<div class="col-md-8 my-2">
<input type="file" class="form-control form-control-sm" name="file-input" id="file-input" accept=".json, .txt" />
</div>
<div class="btn-group btn-group-sm col-md-4 my-2">
<button
v-if="ctrl?.currentWorker?.length"
type="button"
name="do_import"
id="do_import"
@click="onImport"
class="btn btn-primary"
>导入</button>
<button
v-if="!dataWrap?.dataItems?.length && ctrl.haveStore && ctrl?.currentWorker?.length"
type="button"
name="do_loadStore"
id="do_loadStore"
v-on:click="loadStore"
class="btn btn-success"
>加载缓存数据</button>
<button
:disabled="!dataWrap?.dataItems?.length"
type="button"
name="do_export"
id="do_export"
@click="onExport"
class="btn btn-info"
>导出</button>
</div>
</form>
<!-- fileCtrl end -->
</div>
</div>
<!-- 编辑区 开始 -->
<div
class="container page my-4 py-2"
id="page-main-editor"
v-show="ctrl?.currentWorker?.length"
v-if="example!=null&&example?.material!=null"
:class="ctrl?.currentWorker=='admin'?'admin':''"
>
<div class="container" id="page-main-editor--container">
<div class="row">
<div class="row mt-2 mb-0">
<p class="text-muted small">{{example?.originId}} {{`${fileInfo(example?.originId).用户显示名称}`}}</p>
</div>
</div>
<div class="row mt-0 mb-2 __align-items-center" id="page-main-editor--main">
<!-- 内容区 开始 -->
<div class="col col-12 col-lg-7 my-1">
<!-- 替换后文本区 开始 -->
<div class="row my-1 material-area" id="material-replaced">
<p>
<span
v-for="token in example?.material?.tokenList"
:key="token.idx"
class="token"
:class="{'right-space': true, 'should-notice': token.word=='前'||token.word=='后'}"
:data-title="`${token.idx}, ${token.pos}`"
:data-idx="token.idx"
:data-pos="token.pos"
:data-auto-entity="token.autoEntity"
:data-auto-spatial="token.autoSpatial"
:data-selecting="token?._ctrl?.selecting"
:data-selected="token?._ctrl?.selected"
:data-replaced="token?.replaced ?? false"
:data-word="token.word"
:data-to-word="token?.to?.word"
@mousedown="onMouseDown(token, $event)"
@mouseenter="onMouseEnter(token)"
@mouseout="onMouseOut(token)"
@mouseup="onMouseUp(token)"
>{{ token?.replaced ? token?.to?.word : token.word }}<!-- <sub>{{ token.idx }}</sub> --></span>
</p>
</div>
<!-- 替换后文本区 结束 -->
<!-- 替换前原文区 开始 -->
<div class="row my-1 material-area" id="material-origin" :data-show="ctrl.showOrigin" v-show="ctrl.showOrigin">
<p>
<span
v-for="token in example?.material?.tokenList"
:key="token.idx"
class="token"
:class="{'right-space': true}"
:data-title="`${token.idx}, ${token.pos}`"
:data-idx="token.idx"
:data-pos="token.pos"
:data-auto-entity="token.autoEntity"
:data-auto-spatial="token.autoSpatial"
:data-selecting="token?._ctrl?.selecting"
:data-selected="token?._ctrl?.selected"
:data-have-replace="token?.replaced ?? false"
@mousedown="onMouseDown(token)"
@mouseenter="onMouseEnter(token)"
@mouseout="onMouseOut(token)"
@mouseup="onMouseUp(token)"
>{{ token.word }}<!-- <sub>{{ token.idx }}</sub> --></span>
</p>
</div>
<!-- 替换前原文区 结束 -->
<!-- 便捷选择操作区 开始 -->
<div class="row my-2" v-show="selection.array.length" id="convenient-ctrl">
<div class="col col-12 col-lg-12">
<button v-if=" 'multiSpans' == (currentStep.mode) && currentStep?.props?.addBtn" type="button" v-on:click="currentStep?.props?.data.tokenarrays.push(selection.array)" class="btn btn-sm my-1 me-1" :class="`btn-outline-primary`">{{ currentStep.props.addBtn.text }}</button>
<button
type="button"
v-on:click="copySelection"
class="btn btn-sm my-1 me-1"
:class="`btn-outline-info btn-copy-selection`"
:data-clipboard-text="selectedReplacedText()"
>拷贝选区{{ctrl.showOrigin ? "(1)" : ""}}</button>
<button
type="button"
v-show="ctrl.showOrigin"
v-on:click="copySelection"
class="btn btn-sm my-1 me-1"
:class="`btn-outline-info btn-copy-selection`"
:data-clipboard-text="selectedOriginText()"
>拷贝选区(2)</button>
<button type="button" v-on:click="clearSelection" class="btn btn-sm my-1 me-1" :class="`btn-outline-info`">清除选区</button>
</div>
</div>
<!-- 便捷选择操作区 结束 -->
</div>
<!-- 内容区 结束 -->
<!-- 功能区 开始 -->
<div class="col col-12 col-lg-5 my-2" id="func-ctrl">
<!-- deBug用的 开始 -->
<!-- <div class="row mb-3">
<div class="col col-12">
<div class="card">
<div class="card-body">
<div>{{ stepRecords.list }}</div>
</div>
</div>
</div>
</div> -->
<!-- deBug用的 结束 -->
<!-- 结束模块 开始 -->
<div class="row" v-show = "('interlude'==currentStep.mode&¤tStep?.props?.showResults)||'finalResult'==(currentStep.mode)" __v-if=" 'finalResult'==(currentStep.mode)" :data-mode="currentStep.mode">
<!-- 指导语 -->
<div class="col col-12 my-1" v-if="'finalResult'==(currentStep.mode)&¤tStep?.props?.instruction">
<div>{{ currentStep?.props?.instruction }}</div>
</div>
<div class="col col-12 my-1">
<!-- 取消按钮 -->
<button
type="button"
v-if="'finalResult'==(currentStep.mode)&¤tStep?.props?.cancelBtn"
v-on:click="cancelStep(currentStep.props.cancelBtn.go)"
class="btn btn-sm my-1 me-1"
:class="`btn-${currentStep.props.cancelBtn.style}`"
>{{ currentStep.props.cancelBtn.text }}</button>
<!-- 重置按钮 -->
<button
type="button"
v-if="'finalResult'==(currentStep.mode)&¤tStep?.props?.canReset"
v-on:click="resetStep(currentStep.props.resetBtn.go)"
class="btn btn-sm my-1 me-1"
:class="`btn-${currentStep.props.resetBtn.style}`"
>{{ currentStep.props.resetBtn.text }}</button>
<!-- 下一条按钮 -->
<button
type="button"
v-if="'finalResult'==(currentStep.mode)&¤tStep?.props?.nextBtn"
v-on:click="goIdx(ctrl.currentIdx+1)"
class="btn btn-sm my-1 me-1"
:class="`btn-${currentStep.props.nextBtn.style}`"
>{{ currentStep.props.nextBtn.text }}</button>
</div>
</div>
<!-- 结束模块 结束 -->
<!-- 选值模块 开始 -->
<div class="row" v-if="['selectValue'].includes(currentStep.mode)" :data-mode="currentStep.mode">
<!-- 指导语 -->
<div class="col col-12 my-1" v-if="currentStep?.props?.instruction">
<div v-html="currentStep?.props?.instruction">{{ currentStep?.props?.instruction }}</div>
</div>
<!-- 选项按钮 -->
<div class="col col-12 my-1" v-if="currentStep?.props?.optionBtns">
<template v-for="btn in currentStep.props.optionBtns">
<button :key="btn.text" type="button" v-on:click="goRefStep(btn.go, btn.data)" class="btn btn-sm my-1 me-1" :class="`btn-${btn.style}`">{{ btn.text }}</button><br v-if="false"/>
</template>
</div>
<!-- 完成按钮 -->
<div class="col col-12 my-1" v-if="currentStep?.props?.okBtn">
<button type="button" v-on:click="goRefStep(currentStep.props.okBtn.go)" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.okBtn.style}`">{{ currentStep.props.okBtn.text }}</button>
</div>
<!-- 重置按钮 -->
<div class="col col-12 my-1" v-if="currentStep?.props?.canReset">
<button type="button" v-on:click="resetStep(currentStep.props.resetBtn.go)" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.resetBtn.style}`">{{ currentStep.props.resetBtn.text }}</button>
</div>
</div>
<!-- 选值模块 结束 -->
<!-- 幕间模块 开始 -->
<div class="row" v-if="['interlude'].includes(currentStep.mode)" :data-mode="currentStep.mode">
<!-- 指导语 -->
<div class="col col-12 my-1" v-if="currentStep?.props?.instruction">
<div>{{ currentStep?.props?.instruction }}</div>
</div>
<!-- 选项按钮 -->
<div class="col col-12 my-1" v-if="currentStep?.props?.optionBtns">
<button v-for="btn in currentStep.props.optionBtns" :key="btn.text" type="button" v-on:click="goRefStep(btn.go)" class="btn btn-sm my-1 me-1" :class="`btn-${btn.style}`">{{ btn.text }}</button>
</div>
<!-- 完成按钮 -->
<div class="col col-12 my-1" v-if="currentStep?.props?.okBtn">
<button type="button" v-on:click="goRefStep(currentStep.props.okBtn.go)" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.okBtn.style}`">{{ currentStep.props.okBtn.text }}</button>
</div>
<!-- 重置按钮 -->
<div class="col col-12 my-1" v-if="currentStep?.props?.canReset">
<button type="button" v-on:click="resetStep(currentStep.props.resetBtn.go)" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.resetBtn.style}`">{{ currentStep.props.resetBtn.text }}</button>
</div>
</div>
<!-- 幕间模块 结束 -->
<!-- 初始模块 开始 -->
<div class="row" v-if=" 'root'==(currentStep.mode)" :data-mode="currentStep.mode">
<!-- 指导语 -->
<div class="col col-12 my-1" v-if="currentStep?.props?.instruction">
<div>{{ currentStep?.props?.instruction }}</div>
</div>
<!-- 开始按钮 -->
<div class="col col-12 my-1" v-if="currentStep?.props?.startBtn">
<button type="button" v-on:click="cancelStep(currentStep.props.startBtn.go)" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.startBtn.style}`">{{ currentStep.props.startBtn.text }}</button>
</div>
</div>
<!-- 初始模块 结束 -->
<!-- multiSpans 模式 开始 -->
<div class="row" v-if=" 'multiSpans' == (currentStep.mode)" :data-mode="currentStep.mode">
<!-- 指导语 -->
<div class="col col-12 my-1" v-if="currentStep?.props?.instruction">
<div>{{ currentStep?.props?.instruction }}</div>
</div>
<!-- --- -->
<div class="col col-12 my-1">
<!-- addBtn -->
<button v-if="currentStep?.props?.addBtn" type="button" v-on:click="currentStep?.props?.data.tokenarrays.push(selection.array);clearSelection();" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.addBtn.style}`" :disabled="selection.array.length<1">{{ currentStep.props.addBtn.text }}</button>
<!-- clearBtn -->
<button v-if="currentStep?.props?.clearBtn" type="button" v-on:click="clearSelection" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.clearBtn.style}`">{{ currentStep.props.clearBtn.text }}</button>
</div>
<!-- 已选列表 开始 -->
<div class="col col-12 my-1" v-if="currentStep?.props?.listTitle">
<div>{{ currentStep?.props?.listTitle }}</div>
</div>
<div class="col col-12 my-1" v-if="['multiSpans'].includes(currentStep.mode)">
<div class="card">
<div class="card-body">
<span class="badge rounded-pill bg-light text-dark m-1" v-for="tokenarray in currentStep.props.data.tokenarrays"><span v-for="tokenIdx in tokenarray">{{ getReplacedToken(tokenIdx) }}</span></span>
</div>
</div>
</div>
<div class="col col-12 my-1" v-if="currentStep.props.data.tokenarrays.length<2&¤tStep?.props?.lengthTip">
<div>{{ currentStep?.props?.lengthTip }}</div>
</div>
<!-- 已选列表 结束 -->
<!-- --- -->
<div class="col col-12 my-1">
<!-- okBtn -->
<button v-if="currentStep?.props?.okBtn" type="button" v-on:click="handleMultiSpans(currentStep.props.okBtn.go, currentStep.props.data);clearSelection();" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.okBtn.style}`" :disabled="currentStep.props.data.tokenarrays.length<2">{{ currentStep.props.okBtn.text }}</button>
<!-- cleanBtn -->
<!-- <button v-if="currentStep?.props?.cleanBtn" type="button" v-on:click="cleanSpans" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.clearBtn.style}`">{{ currentStep.props.cleanBtn.text }}</button> -->
<!-- cancelBtn -->
<button v-if="currentStep?.props?.cancelBtn" type="button" v-on:click="cancelStep(currentStep.props.cancelBtn.go);clearSelection();" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.cancelBtn.style}`">{{ currentStep.props.cancelBtn.text }}</button>
</div>
</div>
<!-- multiSpans 模式 结束 -->
<!-- add模式开始 -->
<div class="row" v-if=" 'add' == (currentStep.mode)" :data-mode="currentStep.mode">
<!-- 指导语 -->
<div class="col col-12 my-1" v-if="!selection.array.length&¤tStep?.props?.selectInstruction">
<div>{{ currentStep?.props?.selectInstruction }}</div>
</div>
<div class="col col-12 my-1" v-if="selection.array.length&¤tStep?.props?.selectedTitle">
<div>{{ currentStep?.props?.selectedTitle }}<span>“<span v-for="tokenIdx in [selection.array[0]]">{{ getReplacedToken(tokenIdx) }}</span>”</span><!-- <sub>{{selection.array}}</sub> --></div>
</div>
<template v-if="selection.array.length">
<!-- 选边指导语 -->
<div class="col col-12 my-1">
<div v-if="currentStep?.props?.sideInstruction">{{ currentStep?.props?.sideInstruction }}</div>
</div>
<!-- 选框区 -->
<div class="col col-12 my-1">
<select class="form-select form-select-sm" v-model="currentStep.props.data.side">
<option v-for="(option, index) in currentStep?.props?.options" :key="index" :value="option.value">{{ option.text }}</option>
</select>
</div>
<!-- 添加内容指导语 -->
<div class="col col-12 my-1">
<div v-if="currentStep?.props?.addInstruction">{{ currentStep?.props?.addInstruction }}</div>
</div>
<!-- 文本区 -->
<div class="col col-12 my-1">
<input class="form-control form-control-sm" type="text" v-model="currentStep.props.data.target" :placeholder="currentStep?.props?.addInstruction ?? ''">
</div>
</template>
<div class="col col-12 my-1">
<!-- okBtn -->
<button v-if="currentStep?.props?.okBtn" type="button" v-on:click="handleWord(currentStep.props.okBtn.go, currentStep.props.data)" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.okBtn.style}`" :disabled="(!selection.array.length)||(!currentStep.props.data.target.length)">{{ currentStep.props.okBtn.text }}</button>
<!-- cancelBtn -->
<button v-if="currentStep?.props?.cancelBtn" type="button" v-on:click="cancelStep(currentStep.props.cancelBtn.go)" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.cancelBtn.style}`">{{ currentStep.props.cancelBtn.text }}</button>
</div>
</div>
<!-- add模式结束 -->
<!-- modify模式开始 -->
<div class="row" v-if=" 'modify' == (currentStep.mode)" :data-mode="currentStep.mode">
<!-- 指导语 -->
<div class="col col-12 my-1" v-if="!selection.array.length&¤tStep?.props?.selectInstruction">
<div>{{ currentStep?.props?.selectInstruction }}</div>
</div>
<div class="col col-12 my-1" v-if="selection.array.length&¤tStep?.props?.selectedTitle">
<div>{{ currentStep?.props?.selectedTitle }}<span>“<span v-for="tokenIdx in [selection.array[0]]">{{ getReplacedToken(tokenIdx) }}</span>”</span><!-- <sub>{{selection.array}}</sub> --></div>
</div>
<template v-if="selection.array.length">
<!-- 指导语 -->
<div class="col col-12 my-1">
<div v-if="currentStep?.props?.instruction">{{ currentStep?.props?.instruction }}</div>
</div>
<!-- 文本区 -->
<div class="col col-12 my-1">
<input class="form-control form-control-sm" type="text" v-model="currentStep.props.data.target" :placeholder="currentStep?.props?.instruction ?? ''">
</div>
</template>
<div class="col col-12 my-1">
<!-- okBtn -->
<button v-if="currentStep?.props?.okBtn" type="button" v-on:click="handleWord(currentStep.props.okBtn.go, currentStep.props.data)" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.okBtn.style}`" :disabled="(!selection.array.length)||(!currentStep.props.data.target.length)">{{ currentStep.props.okBtn.text }}</button>
<!-- cancelBtn -->
<button v-if="currentStep?.props?.cancelBtn" type="button" v-on:click="cancelStep(currentStep.props.cancelBtn.go)" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.cancelBtn.style}`">{{ currentStep.props.cancelBtn.text }}</button>
</div>
</div>
<!-- modify模式结束 -->
<!-- delete模式开始 -->
<div class="row" v-if=" 'delete' == (currentStep.mode)" :data-mode="currentStep.mode">
<!-- 指导语 -->
<div class="col col-12 my-1" v-if="!selection.array.length&¤tStep?.props?.selectInstruction">
<div>{{ currentStep?.props?.selectInstruction }}</div>
</div>
<div class="col col-12 my-1" v-if="selection.array.length&¤tStep?.props?.selectedTitle">
<div>{{ currentStep?.props?.selectedTitle }}<span>“<span v-for="tokenIdx in [selection.array[0]]">{{ getReplacedToken(tokenIdx) }}</span>”</span><!-- <sub>{{selection.array}}</sub> --></div>
</div>
<div class="col col-12 my-1">
<!-- okBtn -->
<button v-if="currentStep?.props?.okBtn" type="button" v-on:click="handleWord(currentStep.props.okBtn.go, currentStep.props.data)" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.okBtn.style}`" :disabled="(!selection.array.length)">{{ currentStep.props.okBtn.text }}</button>
<!-- cancelBtn -->
<button v-if="currentStep?.props?.cancelBtn" type="button" v-on:click="cancelStep(currentStep.props.cancelBtn.go)" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.cancelBtn.style}`">{{ currentStep.props.cancelBtn.text }}</button>
</div>
</div>
<!-- delete模式结束 -->
<!-- choose 或 text 模式开始 -->
<div class="row" v-if="['choose', 'text'].includes(currentStep.mode)" :data-mode="currentStep.mode">
<!-- 已选片段 -->
<div class="col col-12 my-1" v-if="!selection.array.length&¤tStep?.props?.selectInstruction">
<div>{{ currentStep?.props?.selectInstruction }}</div>
</div>
<!-- 已选片段 -->
<div class="col col-12 my-1" v-if="selection.array.length&¤tStep?.props?.selectedTitle">
<div>{{ currentStep?.props?.selectedTitle }}<span>“<span v-for="tokenIdx in selection.array">{{ getReplacedToken(tokenIdx) }}</span>”</span><!-- <sub>{{selection.array}}</sub> --></div>
</div>
<template v-if="selection.array.length||currentStep?.props?.canSkipSelection">
<!-- 指导语 -->
<div class="col col-12 my-1">
<div v-if="currentStep?.props?.instruction">{{ currentStep?.props?.instruction }}</div>
</div>
<!-- 选框区 -->
<div class="col col-12 my-1" v-if="currentStep.mode=='choose'">
<select class="form-select form-select-sm" v-model="currentStep.props.data.withText">
<option v-for="(option, index) in currentStep?.props?.options" :key="index" :value="option">{{ option }}</option>
</select>
</div>
<!-- 文本区 -->
<div class="col col-12 my-1" v-if="currentStep.mode=='text'">
<input class="form-control form-control-sm" type="text" v-model="currentStep.props.data.withText" :placeholder="currentStep?.props?.instruction ?? ''">
</div>
</template>
<template v-if="!selection.array.length&¤tStep?.props?.qitainstruction">
<!-- 指导语 -->
<div class="col col-12 my-1">
<div v-if="currentStep?.props?.instruction">{{ currentStep?.props?.qitainstruction }}</div>
</div>
<!-- 文本区 -->
<div class="col col-12 my-1" v-if="currentStep.mode=='text'">
<input class="form-control form-control-sm" type="text" v-model="currentStep.props.data.withText" :placeholder="currentStep?.props?.qitainstruction ?? ''">
</div>
</template>
<!-- 按钮区 -->
<div class="col col-12 my-1">
<!-- okBtn -->
<button v-if="currentStep?.props?.okBtn" type="button" v-on:click="handleChooseOrText(currentStep.props.okBtn.go, currentStep.props.data)" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.okBtn.style}`" :disabled="(!currentStep?.props?.canSkipSelection&&!selection.array.length)||(!currentStep.props.data.withText.length)">{{ currentStep.props.okBtn.text }}</button>
<button v-if="currentStep?.props?.okBtn1" type="button" v-on:click="handleQita(currentStep.props.okBtn1.go, currentStep.props.data)" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.okBtn1.style}`" :disabled="(!currentStep.props.data.withText.length)">{{ currentStep.props.okBtn1.text }}</button>
<!-- cancelBtn -->
<button v-if="currentStep?.props?.cancelBtn" type="button" v-on:click="cancelStep(currentStep.props.cancelBtn.go)" class="btn btn-sm my-1 me-1" :class="`btn-${currentStep.props.cancelBtn.style}`">{{ currentStep.props.cancelBtn.text }}</button>
</div>
</div>
<!-- choose 或 text 模式结束 -->
</div>
<!-- 功能区 结束 -->
</div>
<!-- 标注结果展示模块 开始 -->
<div class="row mt-2 mb-1 carded" id="annotations-area">
<div class="col col-12 my-1" v-show="!example?.annotations?.length">
<div class="text-muted">标注好的内容将显示在这里</div>
</div>
<div class="col col-12 my-1" v-show="example?.annotations?.length">
<div class="text-muted">标注结果:</div>
<div
class="col col-12 col-lg-12"
v-for="anno in example.annotations"
:key="anno.idx"
:data-mode="anno.mode"
:data-label="anno.label"
>
<span v-if="['selectValue'].includes(anno.mode)" class="badge rounded-pill bg-light text-dark my-1 me-2">{{anno.desc}}</span>
<span v-if="['multiSpans','choose','text'].includes(anno.mode)" class="badge rounded-pill bg-light text-dark my-1 me-2">
<template v-if="anno.mode=='multiSpans'">
<span>错误原因:</span>
<span v-for="tokenarray, kk in anno.tokenarrays" :key="kk">
“<span v-for="idx in tokenarray" :key="idx" :title="idx">{{ getReplacedToken(idx) }}<!-- <sub>{{idx}}</sub> --></span>”
</span>
<span>{{anno.label}}</span>
</template>
<template v-if="anno.mode=='choose'||anno.mode=='text'">
<div v-if="anno.label=='不符合常识'">
<span>错误原因:</span>
“<span v-for="tokenIdx in anno.on" :key="tokenIdx" :title="tokenIdx">{{ getReplacedToken(tokenIdx) }}</span>”
<span>不符合{{anno.withText}}</span>
</div>
<div v-else>
<template v-if="anno?.on?.length">
“<span v-for="tokenIdx in anno.on" :key="tokenIdx" :title="tokenIdx">{{ getReplacedToken(tokenIdx) }}</span>”
</template>
<span> {{anno.desc ? anno.desc : anno.label}} </span>
<span> {{anno.withText}}</span>
</div>
</template>
</span>
<span v-if="['add','modify','delete'].includes(anno.mode)" class="badge rounded-pill bg-light text-dark my-1 me-2">
<template v-if="anno.mode=='add'">
将“<span >{{ getReplacedToken(anno.source) }}<!-- <sub>{{anno.source}}</sub> --></span>”增改为“<span v-if="anno.side=='0'">{{anno.target}}</span><span >{{ getReplacedToken(anno.source) }}<!-- <sub>{{anno.source}}</sub> --></span><span v-if="anno.side=='1'">{{anno.target}}</span>”
</template>
<template v-if="anno.mode=='modify'">
将 <span >“{{ getReplacedToken(anno.source) }}”<!-- <sub>{{anno.source}}</sub> --></span> 改为 <span>“{{anno.target}}”</span>
</template>
<template v-if="anno.mode=='delete'">
删除<s><span >“{{ getReplacedToken(anno.source) }}”<!-- <sub>{{anno.source}}</sub> --></span></s>
</template>
<template v-if="anno.toSolve!=null">
<span >以解决 {{example.annotations[anno.toSolve].label}}<!-- <sub>{{anno.toSolve}}</sub> --> 的问题</span>
</template>
</span>
</div>
</div>
</div>
<!-- 标注结果展示模块 结束 -->
</div>
</div>
<!-- 编辑区 结束 -->
<div class="position-fixed bottom-0 w-100 p-2" v-if="dataWrap.dataItems.length">
<div class="container">
<!-- 页码操作区 开始 -->
<div class="row page-ctrl">
<div class="col col-12 col-md-4 my-1">
<div class="input-group input-group-sm ">
<button class="btn btn-outline-secondary" type="button" @click="saveExample();goIdx(ctrl.currentIdx-1)">上一条</button>
<!-- <span class="input-group-text">3</span> -->
<input type="text" class="form-control text-center" disabled :value="ctrl.currentIdx+1">
<button class="btn btn-outline-secondary" type="button" @click="saveExample();goIdx(ctrl.currentIdx+1)">下一条</button>
</div>
</div>
<div class="col-md-4 my-0">
</div>
<div class="col col-12 col-md-4 my-1">
<div class="input-group input-group-sm">
<span class="input-group-text">前往第</span>
<input type="number" class="form-control text-center" v-model="ctrl.targetIdx">
<span class="input-group-text">条</span>
<button class="btn btn-outline-secondary" type="button" @click="saveExample();goIdx(ctrl.targetIdx-1)">GO</button>
</div>
</div>
<!-- <div class="col-md-1 my-0">
</div> -->
</div>
<!-- 页码操作区 结束 -->
</div>
</div>
<!-- Alert -->
<div class="alert-wrap" style="display: block;" ref="alert_wrap">
<transition name = "fade" v-for="alert in theAlert.alerts">
<div v-show="alert?.show" class="alert alert-dismissible" :class="'alert-'+(alert?.type ?? 'info')">
<button type="button" class="btn-close" @click="theAlert.removeAlert(alert?.idx)"></button>
<div>{{alert?.content}}</div>
</div>
</transition>
</div>
</div>
<!-- bodywrap end -->
<!-- scripts start -->
<!-- <script src="https://cdn.bootcdn.net/ajax/libs/clipboard.js/2.0.10/clipboard.min.js"></script> -->
<script type="text/javascript" src="lib/clipboard_2.0.10_.min.js"></script>
<script type="text/javascript" src="lib/store_2.0.9_.legacy.min.js"></script>
<script type="text/javascript" src="lib/vue_3.2.26_.global.prod.min.js"></script>
<script type="text/javascript" src="lib/axios_0.25.0_.min.js"></script>
<script type="text/javascript" src="lib/FileSaver.js"></script>
<script type="text/javascript" src="js/components/BaseAlert.js"></script>
<script type="text/javascript" src="js/components/BaseSaver.js"></script>
<script type="text/javascript" src="js/components/BaseReader.js"></script>
<script type="text/javascript" src="js/components/TheReader.js"></script>
<script type="text/javascript" src="js/components/TheSteps.js"></script>
<!-- <script type="text/javascript" src="js/components/TheSelector.js"></script> -->
<script type="text/javascript" src="js/util.js"></script>
<script type="text/javascript" src="js/main.js"></script>
<!-- scripts end -->
</body>
</html>