kfb-view 2.3.8 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.idea/workspace.xml +18 -12
- package/config/webpack.dev.conf.js +2 -1
- package/example/index.js +56 -50
- package/lib/kfb-view.js +1 -1
- package/package.json +1 -1
- package/src/components/shape/index.js +41 -37
- package/src/const/mark.js +1 -0
- package/src/view.js +2 -1
package/.idea/workspace.xml
CHANGED
|
@@ -40,7 +40,9 @@
|
|
|
40
40
|
<change beforePath="$PROJECT_DIR$/config/webpack.dev.conf.js" beforeDir="false" afterPath="$PROJECT_DIR$/config/webpack.dev.conf.js" afterDir="false" />
|
|
41
41
|
<change beforePath="$PROJECT_DIR$/example/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/example/index.js" afterDir="false" />
|
|
42
42
|
<change beforePath="$PROJECT_DIR$/package.json" beforeDir="false" afterPath="$PROJECT_DIR$/package.json" afterDir="false" />
|
|
43
|
-
<change beforePath="$PROJECT_DIR$/src/components/
|
|
43
|
+
<change beforePath="$PROJECT_DIR$/src/components/shape/index.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/shape/index.js" afterDir="false" />
|
|
44
|
+
<change beforePath="$PROJECT_DIR$/src/const/mark.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/const/mark.js" afterDir="false" />
|
|
45
|
+
<change beforePath="$PROJECT_DIR$/src/view.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/view.js" afterDir="false" />
|
|
44
46
|
</list>
|
|
45
47
|
<option name="SHOW_DIALOG" value="false" />
|
|
46
48
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
@@ -379,14 +381,11 @@
|
|
|
379
381
|
<workItem from="1668992196461" duration="1190000" />
|
|
380
382
|
<workItem from="1669545429121" duration="449000" />
|
|
381
383
|
<workItem from="1669940971680" duration="1305000" />
|
|
382
|
-
<workItem from="1669965653573" duration="
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
<
|
|
386
|
-
<
|
|
387
|
-
<option name="presentableId" value="LOCAL-00066" />
|
|
388
|
-
<option name="project" value="LOCAL" />
|
|
389
|
-
<updated>1657181772078</updated>
|
|
384
|
+
<workItem from="1669965653573" duration="2149000" />
|
|
385
|
+
<workItem from="1671419756098" duration="2398000" />
|
|
386
|
+
<workItem from="1671437015276" duration="591000" />
|
|
387
|
+
<workItem from="1671501857160" duration="90000" />
|
|
388
|
+
<workItem from="1671751607914" duration="8964000" />
|
|
390
389
|
</task>
|
|
391
390
|
<task id="LOCAL-00067" summary="2.1.19">
|
|
392
391
|
<created>1657181784906</created>
|
|
@@ -724,7 +723,14 @@
|
|
|
724
723
|
<option name="project" value="LOCAL" />
|
|
725
724
|
<updated>1669965720747</updated>
|
|
726
725
|
</task>
|
|
727
|
-
<
|
|
726
|
+
<task id="LOCAL-00115" summary="2.3.8,截图文字内容增加函数">
|
|
727
|
+
<created>1669966382573</created>
|
|
728
|
+
<option name="number" value="00115" />
|
|
729
|
+
<option name="presentableId" value="LOCAL-00115" />
|
|
730
|
+
<option name="project" value="LOCAL" />
|
|
731
|
+
<updated>1669966382574</updated>
|
|
732
|
+
</task>
|
|
733
|
+
<option name="localTasksCounter" value="116" />
|
|
728
734
|
<servers />
|
|
729
735
|
</component>
|
|
730
736
|
<component name="TypeScriptGeneratedFilesManager">
|
|
@@ -766,7 +772,6 @@
|
|
|
766
772
|
<component name="VcsManagerConfiguration">
|
|
767
773
|
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
|
|
768
774
|
<option name="LOCAL_CHANGES_DETAILS_PREVIEW_SHOWN" value="false" />
|
|
769
|
-
<MESSAGE value="2.2.3" />
|
|
770
775
|
<MESSAGE value="grid优化" />
|
|
771
776
|
<MESSAGE value="触发限制优化" />
|
|
772
777
|
<MESSAGE value="增加图片绘制" />
|
|
@@ -791,7 +796,8 @@
|
|
|
791
796
|
<MESSAGE value="2.3.5,截图文字内容可自定义" />
|
|
792
797
|
<MESSAGE value="2.3.6,优化移动标注时的判断操作" />
|
|
793
798
|
<MESSAGE value="2.3.6,截图文字内容判断异常" />
|
|
794
|
-
<
|
|
799
|
+
<MESSAGE value="2.3.8,截图文字内容增加函数" />
|
|
800
|
+
<option name="LAST_COMMIT_MESSAGE" value="2.3.8,截图文字内容增加函数" />
|
|
795
801
|
<option name="REFORMAT_BEFORE_PROJECT_COMMIT" value="true" />
|
|
796
802
|
</component>
|
|
797
803
|
<component name="XSLT-Support.FileAssociations.UIState">
|
|
@@ -66,7 +66,8 @@ module.exports = function() {
|
|
|
66
66
|
// target: 'http://gastric.label.hzztai.com/',
|
|
67
67
|
// target: 'http://192.168.1.91:7007',
|
|
68
68
|
// target: 'http://192.168.1.91',
|
|
69
|
-
target: 'http://192.168.1.22',
|
|
69
|
+
// target: 'http://192.168.1.22',
|
|
70
|
+
target: 'https://vai.hzztai.com',
|
|
70
71
|
// target: 'https://tct.hzztai.com',
|
|
71
72
|
// target: 'https://pis-ningbo.hzztai.com',
|
|
72
73
|
// target: 'https://pis-test.hzztai.com',
|
package/example/index.js
CHANGED
|
@@ -76,7 +76,7 @@ instance.get(`/process/info?file=${fileName}`).then(({data}) => {
|
|
|
76
76
|
},
|
|
77
77
|
pxConversion: {
|
|
78
78
|
unit: 'um',
|
|
79
|
-
imageCapRes: data.imageCapRes,
|
|
79
|
+
imageCapRes: data.imageCapRes || 1,
|
|
80
80
|
},
|
|
81
81
|
grid: {
|
|
82
82
|
show: false,
|
|
@@ -273,7 +273,7 @@ instance.get(`/process/info?file=${fileName}`).then(({data}) => {
|
|
|
273
273
|
kv.viewer.addHandler('zoom', (res) => {
|
|
274
274
|
const zoom = kv.viewer.viewport.viewportToImageZoom(res.zoom) *
|
|
275
275
|
kv.$options.scale;
|
|
276
|
-
console.log(zoom.toFixed(2) / 1);
|
|
276
|
+
// console.log(zoom.toFixed(2) / 1);
|
|
277
277
|
});
|
|
278
278
|
console.log(kv);
|
|
279
279
|
let list = [];
|
|
@@ -412,67 +412,36 @@ instance.get(`/process/info?file=${fileName}`).then(({data}) => {
|
|
|
412
412
|
}, 6000);
|
|
413
413
|
}, 6000);
|
|
414
414
|
|
|
415
|
-
|
|
415
|
+
initLabels();
|
|
416
416
|
|
|
417
417
|
function initLabels() {
|
|
418
418
|
const labels = [];
|
|
419
|
-
const colors = ['#027AFF', '#f56c6c'];
|
|
420
|
-
for (let i = 0; i <
|
|
419
|
+
const colors = ['#027AFF', '#f56c6c', '#11ff6c', '#f56cff', '#11ffff'];
|
|
420
|
+
for (let i = 0; i < 10000; i++) {
|
|
421
421
|
const point = {
|
|
422
422
|
x: Math.random() * data.width,
|
|
423
423
|
y: Math.random() * data.height,
|
|
424
424
|
};
|
|
425
|
+
const point1 = {
|
|
426
|
+
x: point.x + Math.random() * 1000,
|
|
427
|
+
y: point.y + Math.random() * 1000,
|
|
428
|
+
};
|
|
425
429
|
const label = {
|
|
426
430
|
// fillStyle: 'rgba(2, 122, 255, 1)',
|
|
427
|
-
lineWidth:
|
|
428
|
-
points: [point,
|
|
431
|
+
lineWidth: 2,
|
|
432
|
+
points: [point, point1],
|
|
429
433
|
scale: 0.1,
|
|
430
|
-
strokeStyle: Math.random()
|
|
431
|
-
tool: '
|
|
432
|
-
move:
|
|
434
|
+
strokeStyle: colors[(Math.random() * colors.length) >> 0],
|
|
435
|
+
tool: 'Rectangle',
|
|
436
|
+
move: true,
|
|
437
|
+
resize: true,
|
|
433
438
|
};
|
|
434
439
|
labels.push(label);
|
|
435
440
|
}
|
|
436
441
|
kv.initLabelList(labels);
|
|
437
442
|
}
|
|
438
443
|
|
|
439
|
-
|
|
440
|
-
`/image_annotation?file=${fileName}&slide_label_id=38749&user_id=27`).
|
|
441
|
-
then(({data}) => {
|
|
442
|
-
data = data.data;
|
|
443
|
-
const labelRegionList = [];
|
|
444
|
-
(data || []).filter(item => item.id && item.region.width > 0).
|
|
445
|
-
forEach(item => {
|
|
446
|
-
const subClass = item.sub_class || item.subClass;
|
|
447
|
-
const is_ai = !!item.score || subClass === 'ROI' && !item.user_name; // 通过分数来判断是否是AI识别标注
|
|
448
|
-
const r = {
|
|
449
|
-
...item,
|
|
450
|
-
tool: (item.type || item.tool) === 'Spline' ?
|
|
451
|
-
'Polygon' :
|
|
452
|
-
(item.type || item.tool),
|
|
453
|
-
strokeStyle: item.strokeStyle || `#${item.color.toString(16).
|
|
454
|
-
slice(2)}${item.color.toString(16).slice(0, 2)}`,
|
|
455
|
-
measure: true,
|
|
456
|
-
sub_class: subClass,
|
|
457
|
-
isROI: subClass === 'ROI',
|
|
458
|
-
isClose: item.isClose || item.is_close,
|
|
459
|
-
lineWidth: item.lineWidth || item.width,
|
|
460
|
-
text: item.text || item.description,
|
|
461
|
-
is_ai,
|
|
462
|
-
ai_sub_class: is_ai ? (item.ai_sub_class ?? item.sub_class) : '',
|
|
463
|
-
ai_points: is_ai ? (item.ai_points ?? item.points) : '',
|
|
464
|
-
ai_region: is_ai ? (item.ai_region ?? item.region) : '',
|
|
465
|
-
};
|
|
466
|
-
r.content = (kv.area.getMeasureContent(r)?.texts || []).slice(1, -1);
|
|
467
|
-
labelRegionList.push({
|
|
468
|
-
...r,
|
|
469
|
-
});
|
|
470
|
-
});
|
|
471
|
-
console.time('initLabelList');
|
|
472
|
-
kv.initLabelList(labelRegionList.filter(({deleted_at}) => !deleted_at));
|
|
473
|
-
console.timeEnd('initLabelList');
|
|
474
|
-
});
|
|
475
|
-
document.querySelector('#reDraw').addEventListener('click', () => {
|
|
444
|
+
/*
|
|
476
445
|
instance.get(
|
|
477
446
|
`/image_annotation?file=${fileName}&slide_label_id=38749&user_id=27`).
|
|
478
447
|
then(({data}) => {
|
|
@@ -500,8 +469,7 @@ instance.get(`/process/info?file=${fileName}`).then(({data}) => {
|
|
|
500
469
|
ai_points: is_ai ? (item.ai_points ?? item.points) : '',
|
|
501
470
|
ai_region: is_ai ? (item.ai_region ?? item.region) : '',
|
|
502
471
|
};
|
|
503
|
-
r.content = (kv.area.getMeasureContent(r)?.texts || []).slice(1,
|
|
504
|
-
-1);
|
|
472
|
+
r.content = (kv.area.getMeasureContent(r)?.texts || []).slice(1, -1);
|
|
505
473
|
labelRegionList.push({
|
|
506
474
|
...r,
|
|
507
475
|
});
|
|
@@ -510,7 +478,45 @@ instance.get(`/process/info?file=${fileName}`).then(({data}) => {
|
|
|
510
478
|
kv.initLabelList(labelRegionList.filter(({deleted_at}) => !deleted_at));
|
|
511
479
|
console.timeEnd('initLabelList');
|
|
512
480
|
});
|
|
513
|
-
|
|
481
|
+
document.querySelector('#reDraw').addEventListener('click', () => {
|
|
482
|
+
instance.get(
|
|
483
|
+
`/image_annotation?file=${fileName}&slide_label_id=38749&user_id=27`).
|
|
484
|
+
then(({data}) => {
|
|
485
|
+
data = data.data;
|
|
486
|
+
const labelRegionList = [];
|
|
487
|
+
(data || []).filter(item => item.id && item.region.width > 0).
|
|
488
|
+
forEach(item => {
|
|
489
|
+
const subClass = item.sub_class || item.subClass;
|
|
490
|
+
const is_ai = !!item.score || subClass === 'ROI' && !item.user_name; // 通过分数来判断是否是AI识别标注
|
|
491
|
+
const r = {
|
|
492
|
+
...item,
|
|
493
|
+
tool: (item.type || item.tool) === 'Spline' ?
|
|
494
|
+
'Polygon' :
|
|
495
|
+
(item.type || item.tool),
|
|
496
|
+
strokeStyle: item.strokeStyle || `#${item.color.toString(16).
|
|
497
|
+
slice(2)}${item.color.toString(16).slice(0, 2)}`,
|
|
498
|
+
measure: true,
|
|
499
|
+
sub_class: subClass,
|
|
500
|
+
isROI: subClass === 'ROI',
|
|
501
|
+
isClose: item.isClose || item.is_close,
|
|
502
|
+
lineWidth: item.lineWidth || item.width,
|
|
503
|
+
text: item.text || item.description,
|
|
504
|
+
is_ai,
|
|
505
|
+
ai_sub_class: is_ai ? (item.ai_sub_class ?? item.sub_class) : '',
|
|
506
|
+
ai_points: is_ai ? (item.ai_points ?? item.points) : '',
|
|
507
|
+
ai_region: is_ai ? (item.ai_region ?? item.region) : '',
|
|
508
|
+
};
|
|
509
|
+
r.content = (kv.area.getMeasureContent(r)?.texts || []).slice(1,
|
|
510
|
+
-1);
|
|
511
|
+
labelRegionList.push({
|
|
512
|
+
...r,
|
|
513
|
+
});
|
|
514
|
+
});
|
|
515
|
+
console.time('initLabelList');
|
|
516
|
+
kv.initLabelList(labelRegionList.filter(({deleted_at}) => !deleted_at));
|
|
517
|
+
console.timeEnd('initLabelList');
|
|
518
|
+
});
|
|
519
|
+
});*/
|
|
514
520
|
});
|
|
515
521
|
|
|
516
522
|
/**
|