bhd-components 0.9.0 → 0.9.2
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/dist/{f8c2008a.esm.es5.development.js → a5565b8a.esm.es5.development.js} +9382 -1289
- package/dist/deb6cc9b.esm.es5.production.js +485 -0
- package/dist/index.esm.es5.development.css +2278 -1580
- package/dist/index.esm.es5.development.js +4454 -221
- package/dist/index.esm.es5.production.css +1 -1
- package/dist/index.esm.es5.production.js +1 -1
- package/es2017/bhdDatePicker/index.d.ts +0 -1
- package/es2017/bhdDatePicker/index.js +238 -171
- package/es2017/bhdDatePicker/index.module.less +81 -46
- package/es2017/customerService/index.js +122 -23
- package/es2017/customerService/js-screen-shot/assets/less/screen-shot.less +478 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/CanvasPatch.d.ts +1 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/CanvasPatch.js +15 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/DeviceTypeVerif.d.ts +2 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/DeviceTypeVerif.js +32 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/FixedData.d.ts +11 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/FixedData.js +17 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/GetBrushSelectedName.d.ts +5 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/GetBrushSelectedName.js +18 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/GetCanvasImgData.d.ts +4 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/GetCanvasImgData.js +25 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/GetColor.d.ts +1 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/GetColor.js +41 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/GetSelectedCalssName.d.ts +1 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/GetSelectedCalssName.js +23 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/GetToolRelativePosition.d.ts +7 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/GetToolRelativePosition.js +9 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/ImgScaling.d.ts +11 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/ImgScaling.js +41 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/SaveBorderArrInfo.d.ts +8 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/SaveBorderArrInfo.js +125 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/SaveCanvasToBase64.d.ts +1 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/SaveCanvasToBase64.js +37 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/SaveCanvasToImage.d.ts +1 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/SaveCanvasToImage.js +26 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/SelectColor.d.ts +1 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/SelectColor.js +6 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/SelectTextSize.d.ts +5 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/SelectTextSize.js +26 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/SetBrushSize.d.ts +14 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/SetBrushSize.js +50 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/SetSelectedClassName.d.ts +7 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/SetSelectedClassName.js +28 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/TakeOutHistory.d.ts +1 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/TakeOutHistory.js +20 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/UpdateContainerMouseStyle.d.ts +1 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/UpdateContainerMouseStyle.js +10 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/ZoomCutOutBoxPosition.d.ts +17 -0
- package/es2017/customerService/js-screen-shot/lib/common-methods/ZoomCutOutBoxPosition.js +92 -0
- package/es2017/customerService/js-screen-shot/lib/config/Toolbar.d.ts +5 -0
- package/es2017/customerService/js-screen-shot/lib/config/Toolbar.js +46 -0
- package/es2017/customerService/js-screen-shot/lib/main-entrance/CreateDom.d.ts +24 -0
- package/es2017/customerService/js-screen-shot/lib/main-entrance/CreateDom.js +304 -0
- package/es2017/customerService/js-screen-shot/lib/main-entrance/InitData.d.ts +78 -0
- package/es2017/customerService/js-screen-shot/lib/main-entrance/InitData.js +538 -0
- package/es2017/customerService/js-screen-shot/lib/main-entrance/PlugInParameters.d.ts +46 -0
- package/es2017/customerService/js-screen-shot/lib/main-entrance/PlugInParameters.js +162 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/AddHistoryData.d.ts +1 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/AddHistoryData.js +23 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/BoundaryJudgment.d.ts +8 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/BoundaryJudgment.js +13 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/CalculateOptionIcoPosition.d.ts +5 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/CalculateOptionIcoPosition.js +21 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/CalculateToolLocation.d.ts +16 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/CalculateToolLocation.js +39 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawArrow.d.ts +31 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawArrow.js +131 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawCircle.d.ts +11 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawCircle.js +37 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawCutOutBox.d.ts +19 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawCutOutBox.js +118 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawLineArrow.d.ts +13 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawLineArrow.js +51 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawMasking.d.ts +6 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawMasking.js +41 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawMosaic.d.ts +12 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawMosaic.js +67 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawPencil.d.ts +13 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawPencil.js +27 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawRectangle.d.ts +11 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawRectangle.js +22 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawText.d.ts +10 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/DrawText.js +24 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/KeyboardEventHandle.d.ts +10 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/KeyboardEventHandle.js +50 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/SetPlugInParameters.d.ts +2 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/SetPlugInParameters.js +61 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/ToolClickEvent.d.ts +1 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/ToolClickEvent.js +132 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/drawCrossImg.d.ts +1 -0
- package/es2017/customerService/js-screen-shot/lib/split-methods/drawCrossImg.js +32 -0
- package/es2017/customerService/js-screen-shot/lib/type/ComponentType.d.ts +133 -0
- package/es2017/customerService/js-screen-shot/lib/type/ComponentType.js +2 -0
- package/es2017/customerService/js-screen-shot/main.d.ts +110 -0
- package/es2017/customerService/js-screen-shot/main.js +1098 -0
- package/es2017/customerService/screenShotPlugin.esm.js +6515 -0
- package/es2017/customerService/screenshotTool.d.ts +1 -0
- package/es2017/customerService/screenshotTool.js +23 -15
- package/es2017/theme/variable.less +27 -0
- package/esm/bhdDatePicker/index.d.ts +0 -1
- package/esm/bhdDatePicker/index.js +242 -175
- package/esm/bhdDatePicker/index.module.less +81 -46
- package/esm/customerService/index.js +127 -27
- package/esm/customerService/js-screen-shot/assets/less/screen-shot.less +478 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/CanvasPatch.d.ts +1 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/CanvasPatch.js +15 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/DeviceTypeVerif.d.ts +2 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/DeviceTypeVerif.js +32 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/FixedData.d.ts +11 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/FixedData.js +17 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/GetBrushSelectedName.d.ts +5 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/GetBrushSelectedName.js +18 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/GetCanvasImgData.d.ts +4 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/GetCanvasImgData.js +25 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/GetColor.d.ts +1 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/GetColor.js +41 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/GetSelectedCalssName.d.ts +1 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/GetSelectedCalssName.js +23 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/GetToolRelativePosition.d.ts +7 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/GetToolRelativePosition.js +10 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/ImgScaling.d.ts +11 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/ImgScaling.js +38 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/SaveBorderArrInfo.d.ts +8 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/SaveBorderArrInfo.js +125 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/SaveCanvasToBase64.d.ts +1 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/SaveCanvasToBase64.js +37 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/SaveCanvasToImage.d.ts +1 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/SaveCanvasToImage.js +26 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/SelectColor.d.ts +1 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/SelectColor.js +6 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/SelectTextSize.d.ts +5 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/SelectTextSize.js +26 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/SetBrushSize.d.ts +14 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/SetBrushSize.js +50 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/SetSelectedClassName.d.ts +7 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/SetSelectedClassName.js +28 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/TakeOutHistory.d.ts +1 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/TakeOutHistory.js +20 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/UpdateContainerMouseStyle.d.ts +1 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/UpdateContainerMouseStyle.js +10 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/ZoomCutOutBoxPosition.d.ts +17 -0
- package/esm/customerService/js-screen-shot/lib/common-methods/ZoomCutOutBoxPosition.js +92 -0
- package/esm/customerService/js-screen-shot/lib/config/Toolbar.d.ts +5 -0
- package/esm/customerService/js-screen-shot/lib/config/Toolbar.js +46 -0
- package/esm/customerService/js-screen-shot/lib/main-entrance/CreateDom.d.ts +24 -0
- package/esm/customerService/js-screen-shot/lib/main-entrance/CreateDom.js +345 -0
- package/esm/customerService/js-screen-shot/lib/main-entrance/InitData.d.ts +78 -0
- package/esm/customerService/js-screen-shot/lib/main-entrance/InitData.js +758 -0
- package/esm/customerService/js-screen-shot/lib/main-entrance/PlugInParameters.d.ts +46 -0
- package/esm/customerService/js-screen-shot/lib/main-entrance/PlugInParameters.js +259 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/AddHistoryData.d.ts +1 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/AddHistoryData.js +23 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/BoundaryJudgment.d.ts +8 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/BoundaryJudgment.js +13 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/CalculateOptionIcoPosition.d.ts +5 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/CalculateOptionIcoPosition.js +21 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/CalculateToolLocation.d.ts +16 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/CalculateToolLocation.js +39 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawArrow.d.ts +31 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawArrow.js +159 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawCircle.d.ts +11 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawCircle.js +37 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawCutOutBox.d.ts +19 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawCutOutBox.js +119 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawLineArrow.d.ts +13 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawLineArrow.js +51 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawMasking.d.ts +6 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawMasking.js +41 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawMosaic.d.ts +12 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawMosaic.js +67 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawPencil.d.ts +13 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawPencil.js +27 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawRectangle.d.ts +11 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawRectangle.js +22 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawText.d.ts +10 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/DrawText.js +24 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/KeyboardEventHandle.d.ts +10 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/KeyboardEventHandle.js +61 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/SetPlugInParameters.d.ts +2 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/SetPlugInParameters.js +62 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/ToolClickEvent.d.ts +1 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/ToolClickEvent.js +132 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/drawCrossImg.d.ts +1 -0
- package/esm/customerService/js-screen-shot/lib/split-methods/drawCrossImg.js +32 -0
- package/esm/customerService/js-screen-shot/lib/type/ComponentType.d.ts +133 -0
- package/esm/customerService/js-screen-shot/lib/type/ComponentType.js +2 -0
- package/esm/customerService/js-screen-shot/main.d.ts +110 -0
- package/esm/customerService/js-screen-shot/main.js +1201 -0
- package/esm/customerService/screenShotPlugin.esm.js +6516 -0
- package/esm/customerService/screenshotTool.d.ts +1 -0
- package/esm/customerService/screenshotTool.js +21 -13
- package/esm/theme/variable.less +27 -0
- package/package.json +20 -2
- package/dist/256789e0.esm.es5.production.js +0 -468
|
@@ -0,0 +1,758 @@
|
|
|
1
|
+
import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
|
|
2
|
+
import { _ as _create_class } from "@swc/helpers/_/_create_class";
|
|
3
|
+
import { takeOutHistory } from "../common-methods/TakeOutHistory";
|
|
4
|
+
import { getToolRelativePosition } from "../common-methods/GetToolRelativePosition";
|
|
5
|
+
import PlugInParameters from "./PlugInParameters";
|
|
6
|
+
// 裁剪框修剪状态
|
|
7
|
+
var draggingTrim = false;
|
|
8
|
+
// 裁剪框拖拽状态
|
|
9
|
+
var dragging = false;
|
|
10
|
+
// 截图工具栏点击状态
|
|
11
|
+
var toolClickStatus = false;
|
|
12
|
+
// 当前选择的颜色
|
|
13
|
+
var selectedColor = "#F53340";
|
|
14
|
+
// 当前点击的工具栏名称
|
|
15
|
+
var toolName = "";
|
|
16
|
+
// 当前选择的画笔大小
|
|
17
|
+
var penSize = 2;
|
|
18
|
+
// 马赛克工具的笔触大小
|
|
19
|
+
var mosaicPenSize = 10;
|
|
20
|
+
// 裁剪框顶点边框直径大小
|
|
21
|
+
var borderSize = 10;
|
|
22
|
+
// 撤销点击次数
|
|
23
|
+
var undoClickNum = 0;
|
|
24
|
+
// 画笔历史记录
|
|
25
|
+
var history = [];
|
|
26
|
+
// 文本输入工具栏点击状态
|
|
27
|
+
var textClickStatus = false;
|
|
28
|
+
// 工具栏超出截图容器状态
|
|
29
|
+
var toolPositionStatus = false;
|
|
30
|
+
// 裁剪框位置参数
|
|
31
|
+
var cutOutBoxPosition = {
|
|
32
|
+
startX: 0,
|
|
33
|
+
startY: 0,
|
|
34
|
+
width: 0,
|
|
35
|
+
height: 0
|
|
36
|
+
};
|
|
37
|
+
// 获取截图容器dom
|
|
38
|
+
var screenShotController = null;
|
|
39
|
+
// 获取截图工具栏容器dom
|
|
40
|
+
var toolController = null;
|
|
41
|
+
// let cutBoxSizeContainer: HTMLDivElement | null = null;
|
|
42
|
+
// 获取文本输入区域dom
|
|
43
|
+
var textInputController = null;
|
|
44
|
+
// 截图工具栏画笔选择dom
|
|
45
|
+
var optionIcoController = null;
|
|
46
|
+
// 截图工具栏文字大小选择dom
|
|
47
|
+
var optionTextSizeController = null;
|
|
48
|
+
var brushSelectionController = null;
|
|
49
|
+
var textSizeContainer = null;
|
|
50
|
+
var fontSize = 17;
|
|
51
|
+
var optionController = null;
|
|
52
|
+
var colorSelectController = null;
|
|
53
|
+
var rightPanel = null;
|
|
54
|
+
var colorSelectPanel = null;
|
|
55
|
+
var undoController = null;
|
|
56
|
+
// 屏幕截图容器
|
|
57
|
+
var screenShotImageController = null;
|
|
58
|
+
// 截图容器是否可滚动
|
|
59
|
+
var noScrollStatus = false;
|
|
60
|
+
// 数据初始化标识
|
|
61
|
+
var initStatus = false;
|
|
62
|
+
// 当前工具栏内选中的工具
|
|
63
|
+
var activeTool = "";
|
|
64
|
+
var textInfo;
|
|
65
|
+
// 是否需要还原页面的滚动条状态
|
|
66
|
+
var resetScrollbarState = false;
|
|
67
|
+
// 当前是否处于文本编辑状态
|
|
68
|
+
var textEditState = false;
|
|
69
|
+
var InitData = /*#__PURE__*/ function() {
|
|
70
|
+
"use strict";
|
|
71
|
+
function InitData() {
|
|
72
|
+
_class_call_check(this, InitData);
|
|
73
|
+
// 标识为true时则初始化数据
|
|
74
|
+
if (initStatus) {
|
|
75
|
+
// 初始化完成设置其值为false
|
|
76
|
+
initStatus = false;
|
|
77
|
+
screenShotController = null;
|
|
78
|
+
dragging = false;
|
|
79
|
+
toolController = null;
|
|
80
|
+
textInputController = null;
|
|
81
|
+
optionController = null;
|
|
82
|
+
optionIcoController = null;
|
|
83
|
+
optionTextSizeController = null;
|
|
84
|
+
brushSelectionController = null;
|
|
85
|
+
textSizeContainer = null;
|
|
86
|
+
// cutBoxSizeContainer = null;
|
|
87
|
+
cutOutBoxPosition = {
|
|
88
|
+
startX: 0,
|
|
89
|
+
startY: 0,
|
|
90
|
+
width: 0,
|
|
91
|
+
height: 0
|
|
92
|
+
};
|
|
93
|
+
toolClickStatus = false;
|
|
94
|
+
resetScrollbarState = false;
|
|
95
|
+
textEditState = false;
|
|
96
|
+
toolPositionStatus = false;
|
|
97
|
+
selectedColor = "#F53340";
|
|
98
|
+
toolName = "";
|
|
99
|
+
penSize = 2;
|
|
100
|
+
fontSize = 17;
|
|
101
|
+
mosaicPenSize = 10;
|
|
102
|
+
history = [];
|
|
103
|
+
undoClickNum = 0;
|
|
104
|
+
colorSelectController = null;
|
|
105
|
+
rightPanel = null;
|
|
106
|
+
colorSelectPanel = null;
|
|
107
|
+
undoController = null;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
_create_class(InitData, [
|
|
111
|
+
{
|
|
112
|
+
key: "setInitStatus",
|
|
113
|
+
value: // 设置数据初始化标识
|
|
114
|
+
function setInitStatus(status) {
|
|
115
|
+
initStatus = status;
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
key: "setScreenShotInfo",
|
|
120
|
+
value: // 设置截图容器宽高
|
|
121
|
+
function setScreenShotInfo(width, height) {
|
|
122
|
+
this.getScreenShotContainer();
|
|
123
|
+
if (screenShotController == null) return;
|
|
124
|
+
// 增加截图锁屏
|
|
125
|
+
if (noScrollStatus) {
|
|
126
|
+
document.body.classList.add("__screenshot-lock-scroll");
|
|
127
|
+
}
|
|
128
|
+
screenShotController.width = width;
|
|
129
|
+
screenShotController.height = height;
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
key: "setScreenShotPosition",
|
|
134
|
+
value: // 设置截图容器位置
|
|
135
|
+
function setScreenShotPosition(left, top) {
|
|
136
|
+
this.getScreenShotContainer();
|
|
137
|
+
if (screenShotController == null) return;
|
|
138
|
+
var _getToolRelativePosition = getToolRelativePosition(left, top), rLeft = _getToolRelativePosition.left, rTop = _getToolRelativePosition.top;
|
|
139
|
+
screenShotController.style.left = rLeft + "px";
|
|
140
|
+
screenShotController.style.top = rTop + "px";
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
key: "showScreenShotPanel",
|
|
145
|
+
value: // 显示截图区域容器
|
|
146
|
+
function showScreenShotPanel() {
|
|
147
|
+
this.getScreenShotContainer();
|
|
148
|
+
if (screenShotController == null) return;
|
|
149
|
+
screenShotController.style.display = "block";
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
key: "getScreenShotContainer",
|
|
154
|
+
value: // 获取截图容器dom
|
|
155
|
+
function getScreenShotContainer() {
|
|
156
|
+
screenShotController = document.getElementById("screenShotContainer");
|
|
157
|
+
return screenShotController;
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
key: "getToolController",
|
|
162
|
+
value: // 获取截图工具栏dom
|
|
163
|
+
function getToolController() {
|
|
164
|
+
toolController = document.getElementById("toolPanel");
|
|
165
|
+
return toolController;
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
key: "getTextInputController",
|
|
170
|
+
value: // // 获取裁剪框尺寸显示容器
|
|
171
|
+
// public getCutBoxSizeContainer() {
|
|
172
|
+
// cutBoxSizeContainer = document.getElementById(
|
|
173
|
+
// "cutBoxSizePanel"
|
|
174
|
+
// ) as HTMLDivElement | null;
|
|
175
|
+
// return cutBoxSizeContainer;
|
|
176
|
+
// }
|
|
177
|
+
// 获取文本输入区域dom
|
|
178
|
+
function getTextInputController() {
|
|
179
|
+
textInputController = document.getElementById("textInputPanel");
|
|
180
|
+
return textInputController;
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
key: "getTextStatus",
|
|
185
|
+
value: // 获取文本输入工具栏展示状态
|
|
186
|
+
function getTextStatus() {
|
|
187
|
+
return textClickStatus;
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
key: "getScreenShotImageController",
|
|
192
|
+
value: // 获取屏幕截图容器
|
|
193
|
+
function getScreenShotImageController() {
|
|
194
|
+
return screenShotImageController;
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
key: "setScreenShotImageController",
|
|
199
|
+
value: // 设置屏幕截图
|
|
200
|
+
function setScreenShotImageController(imageController) {
|
|
201
|
+
screenShotImageController = imageController;
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
key: "setToolStatus",
|
|
206
|
+
value: // 设置截图工具栏展示状态
|
|
207
|
+
function setToolStatus(status) {
|
|
208
|
+
toolController = this.getToolController();
|
|
209
|
+
if (status) {
|
|
210
|
+
toolController.style.display = "block";
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
toolController.style.display = "none";
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
key: "setTextEditState",
|
|
218
|
+
value: // // 设置裁剪框尺寸显示容器展示状态
|
|
219
|
+
// public setCutBoxSizeStatus(status: boolean) {
|
|
220
|
+
// if (cutBoxSizeContainer == null) return;
|
|
221
|
+
// if (status) {
|
|
222
|
+
// cutBoxSizeContainer.style.display = "flex";
|
|
223
|
+
// return;
|
|
224
|
+
// }
|
|
225
|
+
// cutBoxSizeContainer.style.display = "none";
|
|
226
|
+
// }
|
|
227
|
+
// // 设置裁剪框尺寸显示容器位置
|
|
228
|
+
// public setCutBoxSizePosition(x: number, y: number) {
|
|
229
|
+
// if (cutBoxSizeContainer == null) return;
|
|
230
|
+
// const { left, top } = getToolRelativePosition(x, y);
|
|
231
|
+
// cutBoxSizeContainer.style.left = left + "px";
|
|
232
|
+
// let sscTop = 0;
|
|
233
|
+
// if (screenShotController) {
|
|
234
|
+
// sscTop = parseInt(screenShotController.style.top);
|
|
235
|
+
// }
|
|
236
|
+
// cutBoxSizeContainer.style.top = top + sscTop + "px";
|
|
237
|
+
// }
|
|
238
|
+
function setTextEditState(state) {
|
|
239
|
+
textEditState = state;
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
key: "getTextEditState",
|
|
244
|
+
value: function getTextEditState() {
|
|
245
|
+
return textEditState;
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
key: "setTextStatus",
|
|
250
|
+
value: // // 设置裁剪框尺寸
|
|
251
|
+
// public setCutBoxSize(width: number, height: number) {
|
|
252
|
+
// if (cutBoxSizeContainer == null) return;
|
|
253
|
+
// // width和height保留整数
|
|
254
|
+
// width = Math.floor(width);
|
|
255
|
+
// height = Math.floor(height);
|
|
256
|
+
// const childrenPanel = cutBoxSizeContainer.childNodes;
|
|
257
|
+
// // p标签已存在直接更改文本值即可
|
|
258
|
+
// if (childrenPanel.length > 0) {
|
|
259
|
+
// (childrenPanel[0] as HTMLParagraphElement).innerText = `${width} * ${height}`;
|
|
260
|
+
// return;
|
|
261
|
+
// }
|
|
262
|
+
// // 不存在则渲染
|
|
263
|
+
// const textPanel = document.createElement("p");
|
|
264
|
+
// textPanel.innerText = `${width} * ${height}`;
|
|
265
|
+
// cutBoxSizeContainer.appendChild(textPanel);
|
|
266
|
+
// }
|
|
267
|
+
// 设置文本输入工具栏展示状态
|
|
268
|
+
function setTextStatus(status) {
|
|
269
|
+
textInputController = this.getTextInputController();
|
|
270
|
+
if (textInputController == null) return;
|
|
271
|
+
if (status) {
|
|
272
|
+
// 显示文本输入工具
|
|
273
|
+
textInputController.style.display = "block";
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
textInputController.style.display = "none";
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
key: "setToolInfo",
|
|
281
|
+
value: // 设置截图工具位置信息
|
|
282
|
+
function setToolInfo(left, top) {
|
|
283
|
+
toolController = document.getElementById("toolPanel");
|
|
284
|
+
var _getToolRelativePosition = getToolRelativePosition(left, top), rLeft = _getToolRelativePosition.left, rTop = _getToolRelativePosition.top;
|
|
285
|
+
toolController.style.left = rLeft + "px";
|
|
286
|
+
var sscTop = 0;
|
|
287
|
+
if (screenShotController) {
|
|
288
|
+
sscTop = parseInt(screenShotController.style.top);
|
|
289
|
+
}
|
|
290
|
+
toolController.style.top = rTop + sscTop + "px";
|
|
291
|
+
}
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
key: "getToolClickStatus",
|
|
295
|
+
value: // 获取截图工具栏点击状态
|
|
296
|
+
function getToolClickStatus() {
|
|
297
|
+
return toolClickStatus;
|
|
298
|
+
}
|
|
299
|
+
},
|
|
300
|
+
{
|
|
301
|
+
key: "setToolClickStatus",
|
|
302
|
+
value: // 设置截图工具栏点击状态
|
|
303
|
+
function setToolClickStatus(status) {
|
|
304
|
+
toolClickStatus = status;
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
key: "setResetScrollbarState",
|
|
309
|
+
value: function setResetScrollbarState(state) {
|
|
310
|
+
resetScrollbarState = state;
|
|
311
|
+
}
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
key: "getResetScrollbarState",
|
|
315
|
+
value: function getResetScrollbarState() {
|
|
316
|
+
return resetScrollbarState;
|
|
317
|
+
}
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
key: "getCutOutBoxPosition",
|
|
321
|
+
value: // 获取裁剪框位置信息
|
|
322
|
+
function getCutOutBoxPosition() {
|
|
323
|
+
return cutOutBoxPosition;
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
key: "getDragging",
|
|
328
|
+
value: function getDragging() {
|
|
329
|
+
return dragging;
|
|
330
|
+
}
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
key: "setDragging",
|
|
334
|
+
value: function setDragging(status) {
|
|
335
|
+
dragging = status;
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
key: "getDraggingTrim",
|
|
340
|
+
value: function getDraggingTrim() {
|
|
341
|
+
return draggingTrim;
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
key: "getToolPositionStatus",
|
|
346
|
+
value: function getToolPositionStatus() {
|
|
347
|
+
return toolPositionStatus;
|
|
348
|
+
}
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
key: "setToolPositionStatus",
|
|
352
|
+
value: function setToolPositionStatus(status) {
|
|
353
|
+
toolPositionStatus = status;
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
key: "setDraggingTrim",
|
|
358
|
+
value: function setDraggingTrim(status) {
|
|
359
|
+
draggingTrim = status;
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
key: "setCutOutBoxPosition",
|
|
364
|
+
value: // 设置裁剪框位置信息
|
|
365
|
+
function setCutOutBoxPosition(mouseX, mouseY, width, height) {
|
|
366
|
+
cutOutBoxPosition.startX = mouseX;
|
|
367
|
+
cutOutBoxPosition.startY = mouseY;
|
|
368
|
+
cutOutBoxPosition.width = width;
|
|
369
|
+
cutOutBoxPosition.height = height;
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
key: "setFontSize",
|
|
374
|
+
value: function setFontSize(size) {
|
|
375
|
+
fontSize = size;
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
key: "setOptionStatus",
|
|
380
|
+
value: // 设置截图工具栏画笔选择工具展示状态
|
|
381
|
+
function setOptionStatus(status) {
|
|
382
|
+
// 获取截图工具栏与三角形角标容器
|
|
383
|
+
optionIcoController = this.getOptionIcoController();
|
|
384
|
+
optionController = this.getOptionController();
|
|
385
|
+
if (optionIcoController == null || optionController == null) return;
|
|
386
|
+
if (status) {
|
|
387
|
+
optionIcoController.style.display = "block";
|
|
388
|
+
optionController.style.display = "block";
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
optionIcoController.style.display = "none";
|
|
392
|
+
optionController.style.display = "none";
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
key: "getFontSize",
|
|
397
|
+
value: function getFontSize() {
|
|
398
|
+
return fontSize;
|
|
399
|
+
}
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
key: "setTextSizeOptionStatus",
|
|
403
|
+
value: // 设置截图工具栏文字大小下拉框选项选择工具展示状态
|
|
404
|
+
function setTextSizeOptionStatus(status) {
|
|
405
|
+
optionTextSizeController = this.getOptionTextSizeController();
|
|
406
|
+
if (optionTextSizeController == null) return;
|
|
407
|
+
if (status) {
|
|
408
|
+
optionTextSizeController.style.display = "flex";
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
optionTextSizeController.style.display = "none";
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
key: "setTextSizePanelStatus",
|
|
416
|
+
value: function setTextSizePanelStatus(status) {
|
|
417
|
+
textSizeContainer = this.getTextSizeContainer();
|
|
418
|
+
if (textSizeContainer == null) return;
|
|
419
|
+
if (status) {
|
|
420
|
+
console.log("显示");
|
|
421
|
+
textSizeContainer.style.display = "flex";
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
textSizeContainer.style.display = "none";
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
key: "setBrushSelectionStatus",
|
|
429
|
+
value: function setBrushSelectionStatus(status) {
|
|
430
|
+
brushSelectionController = this.getBrushSelectionController();
|
|
431
|
+
if (brushSelectionController == null) return;
|
|
432
|
+
if (status) {
|
|
433
|
+
brushSelectionController.style.display = "block";
|
|
434
|
+
return;
|
|
435
|
+
}
|
|
436
|
+
brushSelectionController.style.display = "none";
|
|
437
|
+
}
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
key: "hiddenOptionIcoStatus",
|
|
441
|
+
value: // 隐藏画笔工具栏三角形角标
|
|
442
|
+
function hiddenOptionIcoStatus() {
|
|
443
|
+
optionIcoController = this.getOptionIcoController();
|
|
444
|
+
if (optionIcoController == null) return;
|
|
445
|
+
optionIcoController.style.display = "none";
|
|
446
|
+
}
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
key: "getOptionIcoController",
|
|
450
|
+
value: // 获取截图工具栏画笔选择工具dom
|
|
451
|
+
function getOptionIcoController() {
|
|
452
|
+
optionIcoController = document.getElementById("optionIcoController");
|
|
453
|
+
return optionIcoController;
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
key: "getTextSizeContainer",
|
|
458
|
+
value: function getTextSizeContainer() {
|
|
459
|
+
textSizeContainer = document.getElementById("textSizePanel");
|
|
460
|
+
return textSizeContainer;
|
|
461
|
+
}
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
key: "getOptionTextSizeController",
|
|
465
|
+
value: function getOptionTextSizeController() {
|
|
466
|
+
optionTextSizeController = document.getElementById("textSelectPanel");
|
|
467
|
+
return optionTextSizeController;
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
key: "getBrushSelectionController",
|
|
472
|
+
value: function getBrushSelectionController() {
|
|
473
|
+
brushSelectionController = document.getElementById("brushSelectPanel");
|
|
474
|
+
return brushSelectionController;
|
|
475
|
+
}
|
|
476
|
+
},
|
|
477
|
+
{
|
|
478
|
+
key: "getOptionController",
|
|
479
|
+
value: function getOptionController() {
|
|
480
|
+
optionController = document.getElementById("optionPanel");
|
|
481
|
+
return optionController;
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
key: "setOptionPosition",
|
|
486
|
+
value: // 设置画笔选择工具栏位置
|
|
487
|
+
function setOptionPosition(position) {
|
|
488
|
+
// 获取截图工具栏与三角形角标容器
|
|
489
|
+
optionIcoController = this.getOptionIcoController();
|
|
490
|
+
optionController = this.getOptionController();
|
|
491
|
+
if (optionIcoController == null || optionController == null) return;
|
|
492
|
+
// 修改位置
|
|
493
|
+
var toolPosition = this.getToolPosition();
|
|
494
|
+
if (toolPosition == null) return;
|
|
495
|
+
var icoLeft = toolPosition.left + position + "px";
|
|
496
|
+
var icoTop = toolPosition.top + 44 + "px";
|
|
497
|
+
var optionLeft = toolPosition.left + "px";
|
|
498
|
+
var optionTop = toolPosition.top + 44 + 6 + "px";
|
|
499
|
+
optionIcoController.style.left = icoLeft;
|
|
500
|
+
optionIcoController.style.top = icoTop;
|
|
501
|
+
optionController.style.left = optionLeft;
|
|
502
|
+
optionController.style.top = optionTop;
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
key: "getToolPosition",
|
|
507
|
+
value: // 获取工具栏位置
|
|
508
|
+
function getToolPosition() {
|
|
509
|
+
toolController = this.getToolController();
|
|
510
|
+
if (toolController == null) return;
|
|
511
|
+
return {
|
|
512
|
+
left: toolController.offsetLeft,
|
|
513
|
+
top: toolController.offsetTop
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
key: "getSelectedColor",
|
|
519
|
+
value: // 获取/设置当前选择的颜色
|
|
520
|
+
function getSelectedColor() {
|
|
521
|
+
return selectedColor;
|
|
522
|
+
}
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
key: "setSelectedColor",
|
|
526
|
+
value: function setSelectedColor(color) {
|
|
527
|
+
selectedColor = color;
|
|
528
|
+
colorSelectPanel = this.getColorSelectPanel();
|
|
529
|
+
if (colorSelectPanel == null) return;
|
|
530
|
+
colorSelectPanel.style.backgroundColor = selectedColor;
|
|
531
|
+
}
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
key: "getColorSelectPanel",
|
|
535
|
+
value: function getColorSelectPanel() {
|
|
536
|
+
colorSelectPanel = document.getElementById("colorSelectPanel");
|
|
537
|
+
return colorSelectPanel;
|
|
538
|
+
}
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
key: "getToolName",
|
|
542
|
+
value: // 获取/设置当前点击的工具栏条目名称
|
|
543
|
+
function getToolName() {
|
|
544
|
+
return toolName;
|
|
545
|
+
}
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
key: "setToolName",
|
|
549
|
+
value: function setToolName(itemName) {
|
|
550
|
+
toolName = itemName;
|
|
551
|
+
}
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
key: "getPenSize",
|
|
555
|
+
value: // 获取/设置当前画笔大小
|
|
556
|
+
function getPenSize() {
|
|
557
|
+
return penSize;
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
key: "setPenSize",
|
|
562
|
+
value: function setPenSize(size) {
|
|
563
|
+
penSize = size;
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
key: "getMosaicPenSize",
|
|
568
|
+
value: function getMosaicPenSize() {
|
|
569
|
+
return mosaicPenSize;
|
|
570
|
+
}
|
|
571
|
+
},
|
|
572
|
+
{
|
|
573
|
+
key: "setMosaicPenSize",
|
|
574
|
+
value: function setMosaicPenSize(size) {
|
|
575
|
+
mosaicPenSize = size;
|
|
576
|
+
}
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
key: "getBorderSize",
|
|
580
|
+
value: function getBorderSize() {
|
|
581
|
+
return borderSize;
|
|
582
|
+
}
|
|
583
|
+
},
|
|
584
|
+
{
|
|
585
|
+
key: "getHistory",
|
|
586
|
+
value: function getHistory() {
|
|
587
|
+
return history;
|
|
588
|
+
}
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
key: "shiftHistory",
|
|
592
|
+
value: function shiftHistory() {
|
|
593
|
+
return history.shift();
|
|
594
|
+
}
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
key: "popHistory",
|
|
598
|
+
value: function popHistory() {
|
|
599
|
+
return history.pop();
|
|
600
|
+
}
|
|
601
|
+
},
|
|
602
|
+
{
|
|
603
|
+
key: "pushHistory",
|
|
604
|
+
value: function pushHistory(item) {
|
|
605
|
+
history.push(item);
|
|
606
|
+
}
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
key: "getUndoClickNum",
|
|
610
|
+
value: function getUndoClickNum() {
|
|
611
|
+
return undoClickNum;
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
{
|
|
615
|
+
key: "setUndoClickNum",
|
|
616
|
+
value: function setUndoClickNum(clickNumber) {
|
|
617
|
+
undoClickNum = clickNumber;
|
|
618
|
+
}
|
|
619
|
+
},
|
|
620
|
+
{
|
|
621
|
+
key: "getColorPanel",
|
|
622
|
+
value: function getColorPanel() {
|
|
623
|
+
colorSelectController = document.getElementById("colorPanel");
|
|
624
|
+
return colorSelectController;
|
|
625
|
+
}
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
key: "setColorPanelStatus",
|
|
629
|
+
value: function setColorPanelStatus(status) {
|
|
630
|
+
colorSelectController = this.getColorPanel();
|
|
631
|
+
if (colorSelectController == null) return;
|
|
632
|
+
if (status) {
|
|
633
|
+
colorSelectController.style.display = "flex";
|
|
634
|
+
return;
|
|
635
|
+
}
|
|
636
|
+
colorSelectController.style.display = "none";
|
|
637
|
+
}
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
key: "getNoScrollStatus",
|
|
641
|
+
value: function getNoScrollStatus() {
|
|
642
|
+
return noScrollStatus;
|
|
643
|
+
}
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
key: "setNoScrollStatus",
|
|
647
|
+
value: function setNoScrollStatus(status) {
|
|
648
|
+
if (status != null) {
|
|
649
|
+
noScrollStatus = status;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
key: "setActiveToolName",
|
|
655
|
+
value: function setActiveToolName(toolName) {
|
|
656
|
+
activeTool = toolName;
|
|
657
|
+
}
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
key: "getActiveToolName",
|
|
661
|
+
value: function getActiveToolName() {
|
|
662
|
+
return activeTool;
|
|
663
|
+
}
|
|
664
|
+
},
|
|
665
|
+
{
|
|
666
|
+
key: "setTextInfo",
|
|
667
|
+
value: function setTextInfo(info) {
|
|
668
|
+
textInfo = info;
|
|
669
|
+
}
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
key: "getTextInfo",
|
|
673
|
+
value: function getTextInfo() {
|
|
674
|
+
return textInfo;
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
key: "getRightPanel",
|
|
679
|
+
value: function getRightPanel() {
|
|
680
|
+
rightPanel = document.getElementById("rightPanel");
|
|
681
|
+
return rightPanel;
|
|
682
|
+
}
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
key: "setRightPanel",
|
|
686
|
+
value: function setRightPanel(status) {
|
|
687
|
+
rightPanel = this.getRightPanel();
|
|
688
|
+
if (rightPanel == null) return;
|
|
689
|
+
if (status) {
|
|
690
|
+
rightPanel.style.display = "flex";
|
|
691
|
+
return;
|
|
692
|
+
}
|
|
693
|
+
rightPanel.style.display = "none";
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
key: "setUndoStatus",
|
|
698
|
+
value: function setUndoStatus(status) {
|
|
699
|
+
undoController = this.getUndoController();
|
|
700
|
+
if (undoController == null) return;
|
|
701
|
+
if (status) {
|
|
702
|
+
// 启用撤销按钮
|
|
703
|
+
undoController.classList.add("undo");
|
|
704
|
+
undoController.classList.remove("undo-disabled");
|
|
705
|
+
undoController.addEventListener("click", this.cancelEvent);
|
|
706
|
+
return;
|
|
707
|
+
}
|
|
708
|
+
// 禁用撤销按钮
|
|
709
|
+
undoController.classList.add("undo-disabled");
|
|
710
|
+
undoController.classList.remove("undo");
|
|
711
|
+
undoController.removeEventListener("click", this.cancelEvent);
|
|
712
|
+
}
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
key: "cancelEvent",
|
|
716
|
+
value: function cancelEvent() {
|
|
717
|
+
takeOutHistory();
|
|
718
|
+
}
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
key: "getUndoController",
|
|
722
|
+
value: function getUndoController() {
|
|
723
|
+
undoController = document.getElementById("undoPanel");
|
|
724
|
+
return undoController;
|
|
725
|
+
}
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
key: "destroyDOM",
|
|
729
|
+
value: // 销毁截图容器
|
|
730
|
+
function destroyDOM() {
|
|
731
|
+
if (screenShotController == null || toolController == null || optionIcoController == null || optionController == null || textInputController == null) return;
|
|
732
|
+
var plugInParameters = new PlugInParameters();
|
|
733
|
+
// 销毁dom
|
|
734
|
+
if (noScrollStatus) {
|
|
735
|
+
document.body.classList.remove("__screenshot-lock-scroll");
|
|
736
|
+
}
|
|
737
|
+
document.body.removeChild(screenShotController);
|
|
738
|
+
document.body.removeChild(toolController);
|
|
739
|
+
document.body.removeChild(optionIcoController);
|
|
740
|
+
document.body.removeChild(optionController);
|
|
741
|
+
document.body.removeChild(textInputController);
|
|
742
|
+
// document.body.removeChild(cutBoxSizeContainer);
|
|
743
|
+
if (document.body.classList.contains("no-cursor")) {
|
|
744
|
+
document.body.classList.remove("no-cursor");
|
|
745
|
+
}
|
|
746
|
+
if (resetScrollbarState) {
|
|
747
|
+
// 还原滚动条状态
|
|
748
|
+
document.documentElement.classList.remove("hidden-screen-shot-scroll");
|
|
749
|
+
document.body.classList.remove("hidden-screen-shot-scroll");
|
|
750
|
+
}
|
|
751
|
+
// 重置插件全局参数状态
|
|
752
|
+
plugInParameters.setInitStatus(true);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
]);
|
|
756
|
+
return InitData;
|
|
757
|
+
}();
|
|
758
|
+
export { InitData as default };
|