hqchart 1.1.15845 → 1.1.15849

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/lib/main.js CHANGED
@@ -1,4 +1,4 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
3
  /*
4
4
  Copyright (c) 2018 jones
@@ -13,13 +13,13 @@
13
13
  */
14
14
 
15
15
  //行情图形库
16
- module.exports.Chart = require('./umychart.vue.js').default;
16
+ module.exports.Chart = require('./umychart.vue.js')["default"];
17
17
 
18
18
  //行情图形库 调试用
19
19
  //module.exports.Chart = require("../src/jscommon/umychart.vue/umychart.vue.js").default;
20
20
 
21
21
  //行情股票数据接口类
22
- module.exports.Stock = require('./umychart.stock.vue.js').default;
22
+ module.exports.Stock = require('./umychart.stock.vue.js')["default"];
23
23
 
24
24
  //行情股票数据接口类
25
- module.exports.RegressionTest = require('./umychart.regressiontest.vue.js').default;
25
+ module.exports.RegressionTest = require('./umychart.regressiontest.vue.js')["default"];
@@ -1,207 +1,186 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
- value: true
4
+ value: true
5
5
  });
6
+ exports["default"] = void 0;
6
7
  function StockStringFormat() {}
7
8
  //字符串格式化 千分位分割
8
9
  StockStringFormat.FormatValueThousandsString = function (value, floatPrecision) {
9
- if (value == null || isNaN(value)) {
10
- if (floatPrecision > 0) {
11
- var nullText = '-.';
12
- for (var i = 0; i < floatPrecision; ++i) {
13
- nullText += '-';
14
- }return nullText;
15
- }
16
-
17
- return '--';
18
- }
19
-
20
- var result = '';
21
- var num = value.toFixed(floatPrecision);
10
+ if (value == null || isNaN(value)) {
22
11
  if (floatPrecision > 0) {
23
- var numFloat = num.split('.')[1];
24
- var numM = num.split('.')[0];
25
- var numMa = Number(numM);
26
- var isLowZero = null;
27
- if (numMa < 0) {
28
- numMa = Math.abs(numMa);
29
- isLowZero = true;
30
- }
31
- numMa = numMa.toString();
32
- while (numMa.length > 3) {
33
- result = ',' + numMa.slice(-3) + result;
34
- numMa = numMa.slice(0, numMa.length - 3);
35
- }
36
- if (numMa) {
37
- result = isLowZero != null ? '-' + numMa + result + '.' + numFloat : numMa + result + '.' + numFloat;
38
- }
39
- } else {
40
- var numNF = Number(num);
41
- var isLowZero = null;
42
- if (numNF < 0) {
43
- numNF = Math.abs(numNF);
44
- isLowZero = true;
45
- }
46
- numNF = numNF.toString();
47
- while (numNF.length > 3) {
48
- result = ',' + numNF.slice(-3) + result;
49
- numNF = numNF.slice(0, numNF.length - 3);
50
- }
51
- if (numNF) {
52
- result = isLowZero != null ? '-' + numNF + result : numNF + result;
53
- }
12
+ var nullText = '-.';
13
+ for (var i = 0; i < floatPrecision; ++i) nullText += '-';
14
+ return nullText;
54
15
  }
55
-
56
- return result;
16
+ return '--';
17
+ }
18
+ var result = '';
19
+ var num = value.toFixed(floatPrecision);
20
+ if (floatPrecision > 0) {
21
+ var numFloat = num.split('.')[1];
22
+ var numM = num.split('.')[0];
23
+ var numMa = Number(numM);
24
+ var isLowZero = null;
25
+ if (numMa < 0) {
26
+ numMa = Math.abs(numMa);
27
+ isLowZero = true;
28
+ }
29
+ numMa = numMa.toString();
30
+ while (numMa.length > 3) {
31
+ result = ',' + numMa.slice(-3) + result;
32
+ numMa = numMa.slice(0, numMa.length - 3);
33
+ }
34
+ if (numMa) {
35
+ result = isLowZero != null ? '-' + numMa + result + '.' + numFloat : numMa + result + '.' + numFloat;
36
+ }
37
+ } else {
38
+ var numNF = Number(num);
39
+ var isLowZero = null;
40
+ if (numNF < 0) {
41
+ numNF = Math.abs(numNF);
42
+ isLowZero = true;
43
+ }
44
+ numNF = numNF.toString();
45
+ while (numNF.length > 3) {
46
+ result = ',' + numNF.slice(-3) + result;
47
+ numNF = numNF.slice(0, numNF.length - 3);
48
+ }
49
+ if (numNF) {
50
+ result = isLowZero != null ? '-' + numNF + result : numNF + result;
51
+ }
52
+ }
53
+ return result;
57
54
  };
58
55
 
59
56
  //数据输出格式化 floatPrecision=小数位数
60
57
  StockStringFormat.FormatValueString = function (value, floatPrecision) {
61
- if (value == null || isNaN(value)) {
62
- if (floatPrecision > 0) {
63
- var nullText = '-.';
64
- for (var i = 0; i < floatPrecision; ++i) {
65
- nullText += '-';
66
- }return nullText;
67
- }
68
-
69
- return '--';
70
- }
71
-
72
- if (value < 0.00000000001 && value > -0.00000000001) {
73
- return "0";
74
- }
75
-
76
- var absValue = Math.abs(value);
77
- if (absValue < 10000) {
78
- return value.toFixed(floatPrecision);
79
- } else if (absValue < 100000000) {
80
- return (value / 10000).toFixed(floatPrecision) + "万";
81
- } else if (absValue < 1000000000000) {
82
- return (value / 100000000).toFixed(floatPrecision) + "亿";
83
- } else {
84
- return (value / 1000000000000).toFixed(floatPrecision) + "万亿";
58
+ if (value == null || isNaN(value)) {
59
+ if (floatPrecision > 0) {
60
+ var nullText = '-.';
61
+ for (var i = 0; i < floatPrecision; ++i) nullText += '-';
62
+ return nullText;
85
63
  }
86
-
87
- return TRUE;
64
+ return '--';
65
+ }
66
+ if (value < 0.00000000001 && value > -0.00000000001) {
67
+ return "0";
68
+ }
69
+ var absValue = Math.abs(value);
70
+ if (absValue < 10000) {
71
+ return value.toFixed(floatPrecision);
72
+ } else if (absValue < 100000000) {
73
+ return (value / 10000).toFixed(floatPrecision) + "万";
74
+ } else if (absValue < 1000000000000) {
75
+ return (value / 100000000).toFixed(floatPrecision) + "亿";
76
+ } else {
77
+ return (value / 1000000000000).toFixed(floatPrecision) + "万亿";
78
+ }
79
+ return TRUE;
88
80
  };
89
-
90
81
  StockStringFormat.NumberToString = function (value) {
91
- if (value < 10) return '0' + value.toString();
92
- return value.toString();
82
+ if (value < 10) return '0' + value.toString();
83
+ return value.toString();
93
84
  };
94
-
95
85
  StockStringFormat.FormatDateString = function (value, format) {
96
- var year = parseInt(value / 10000);
97
- var month = parseInt(value / 100) % 100;
98
- var day = value % 100;
99
-
100
- switch (format) {
101
- case 'MM-DD':
102
- return StockStringFormat.NumberToString(month) + '-' + StockStringFormat.NumberToString(day);
103
- default:
104
- return year.toString() + '-' + StockStringFormat.NumberToString(month) + '-' + StockStringFormat.NumberToString(day);
105
- }
86
+ var year = parseInt(value / 10000);
87
+ var month = parseInt(value / 100) % 100;
88
+ var day = value % 100;
89
+ switch (format) {
90
+ case 'MM-DD':
91
+ return StockStringFormat.NumberToString(month) + '-' + StockStringFormat.NumberToString(day);
92
+ default:
93
+ return year.toString() + '-' + StockStringFormat.NumberToString(month) + '-' + StockStringFormat.NumberToString(day);
94
+ }
106
95
  };
107
-
108
96
  StockStringFormat.FormatTimeString = function (value) {
109
- if (value < 10000) {
110
- var hour = parseInt(value / 100);
111
- var minute = value % 100;
112
- return StockStringFormat.NumberToString(hour) + ':' + StockStringFormat.NumberToString(minute);
113
- } else {
114
- var hour = parseInt(value / 10000);
115
- var minute = parseInt(value % 10000 / 100);
116
- var second = value % 100;
117
- return StockStringFormat.NumberToString(hour) + ':' + StockStringFormat.NumberToString(minute) + ':' + StockStringFormat.NumberToString(second);
118
- }
97
+ if (value < 10000) {
98
+ var hour = parseInt(value / 100);
99
+ var minute = value % 100;
100
+ return StockStringFormat.NumberToString(hour) + ':' + StockStringFormat.NumberToString(minute);
101
+ } else {
102
+ var hour = parseInt(value / 10000);
103
+ var minute = parseInt(value % 10000 / 100);
104
+ var second = value % 100;
105
+ return StockStringFormat.NumberToString(hour) + ':' + StockStringFormat.NumberToString(minute) + ':' + StockStringFormat.NumberToString(second);
106
+ }
119
107
  };
120
108
 
121
109
  //报告格式化
122
110
  StockStringFormat.FormatReportDateString = function (value) {
123
- var year = parseInt(value / 10000);
124
- var month = parseInt(value / 100) % 100;
125
- var monthText;
126
- switch (month) {
127
- case 3:
128
- monthText = "一季度报";
129
- break;
130
- case 6:
131
- monthText = "半年报";
132
- break;
133
- case 9:
134
- monthText = "三季度报";
135
- break;
136
- case 12:
137
- monthText = "年报";
138
- break;
139
- }
140
-
141
- return year.toString() + monthText;
111
+ var year = parseInt(value / 10000);
112
+ var month = parseInt(value / 100) % 100;
113
+ var monthText;
114
+ switch (month) {
115
+ case 3:
116
+ monthText = "一季度报";
117
+ break;
118
+ case 6:
119
+ monthText = "半年报";
120
+ break;
121
+ case 9:
122
+ monthText = "三季度报";
123
+ break;
124
+ case 12:
125
+ monthText = "年报";
126
+ break;
127
+ }
128
+ return year.toString() + monthText;
142
129
  };
143
-
144
130
  StockStringFormat.FormatDateTimeString = function (value, isShowDate) {
145
- var aryValue = value.split(' ');
146
- if (aryValue.length < 2) return "";
147
- var time = parseInt(aryValue[1]);
148
- var minute = time % 100;
149
- var hour = parseInt(time / 100);
150
- var text = (hour < 10 ? '0' + hour.toString() : hour.toString()) + ':' + (minute < 10 ? '0' + minute.toString() : minute.toString());
151
-
152
- if (isShowDate == true) {
153
- var date = parseInt(aryValue[0]);
154
- var year = parseInt(date / 10000);
155
- var month = parseInt(date % 10000 / 100);
156
- var day = date % 100;
157
- text = year.toString() + '-' + (month < 10 ? '0' + month.toString() : month.toString()) + '-' + (day < 10 ? '0' + day.toString() : day.toString()) + " " + text;
158
- }
159
-
160
- return text;
131
+ var aryValue = value.split(' ');
132
+ if (aryValue.length < 2) return "";
133
+ var time = parseInt(aryValue[1]);
134
+ var minute = time % 100;
135
+ var hour = parseInt(time / 100);
136
+ var text = (hour < 10 ? '0' + hour.toString() : hour.toString()) + ':' + (minute < 10 ? '0' + minute.toString() : minute.toString());
137
+ if (isShowDate == true) {
138
+ var date = parseInt(aryValue[0]);
139
+ var year = parseInt(date / 10000);
140
+ var month = parseInt(date % 10000 / 100);
141
+ var day = date % 100;
142
+ text = year.toString() + '-' + (month < 10 ? '0' + month.toString() : month.toString()) + '-' + (day < 10 ? '0' + day.toString() : day.toString()) + " " + text;
143
+ }
144
+ return text;
161
145
  };
162
146
 
163
147
  //字段颜色格式化
164
148
  StockStringFormat.FormatValueColor = function (value, value2) {
165
- if (value != null && value2 == null) //只传一个值的 就判断value正负
166
- {
167
- if (value == 0) return 'PriceNull';else if (value > 0) return 'PriceUp';else return 'PriceDown';
168
- }
149
+ if (value != null && value2 == null)
150
+ //只传一个值的 就判断value正负
151
+ {
152
+ if (value == 0) return 'PriceNull';else if (value > 0) return 'PriceUp';else return 'PriceDown';
153
+ }
169
154
 
170
- //2个数值对比 返回颜色
171
- if (value == null || value2 == null) return 'PriceNull';
172
- if (value == value2) return 'PriceNull';else if (value > value2) return 'PriceUp';else return 'PriceDown';
155
+ //2个数值对比 返回颜色
156
+ if (value == null || value2 == null) return 'PriceNull';
157
+ if (value == value2) return 'PriceNull';else if (value > value2) return 'PriceUp';else return 'PriceDown';
173
158
  };
174
-
175
159
  StockStringFormat.IsNumber = function (value) {
176
- if (value == null) return false;
177
- if (isNaN(value)) return false;
178
-
179
- return true;
160
+ if (value == null) return false;
161
+ if (isNaN(value)) return false;
162
+ return true;
180
163
  };
181
164
 
182
165
  //判断是否是正数
183
166
  StockStringFormat.IsPlusNumber = function (value) {
184
- if (value == null) return false;
185
- if (isNaN(value)) return false;
186
-
187
- return value > 0;
167
+ if (value == null) return false;
168
+ if (isNaN(value)) return false;
169
+ return value > 0;
188
170
  };
189
171
 
190
172
  //判断字段是否存在
191
173
  StockStringFormat.IsObjectExist = function (obj) {
192
- if (obj === undefined) return false;
193
- if (obj == null) return false;
194
-
195
- return true;
174
+ if (obj === undefined) return false;
175
+ if (obj == null) return false;
176
+ return true;
196
177
  };
197
-
198
178
  StockStringFormat.Guid = function () {
199
- function S4() {
200
- return ((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1);
201
- }
202
- return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
179
+ function S4() {
180
+ return ((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1);
181
+ }
182
+ return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
203
183
  };
204
-
205
- exports.default = {
206
- StockStringFormat: StockStringFormat
184
+ var _default = exports["default"] = {
185
+ StockStringFormat: StockStringFormat
207
186
  };
@@ -1,15 +1,11 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
- value: true
4
+ value: true
5
5
  });
6
-
7
- var _jquery = require('jquery');
8
-
9
- var _jquery2 = _interopRequireDefault(_jquery);
10
-
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
6
+ exports["default"] = void 0;
7
+ var _jquery = _interopRequireDefault(require("jquery"));
8
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
13
9
  /*
14
10
  Copyright (c) 2018 jones
15
11
 
@@ -23,18 +19,20 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
23
19
  */
24
20
 
25
21
  function JSAliYunNetwork() {
26
- this.AliYunUrl = []; //需要验证的阿里账户的域名
27
- this.AppCode;
28
-
29
- this.HttpRequest = function (obj) {
30
- _jquery2.default.ajax({
31
- headers: this.AppCode,
32
- url: obj.url, data: obj.data,
33
- type: obj.type, dataType: obj.dataType, async: obj.async,
34
- success: obj.success,
35
- error: obj.error
36
- });
37
- };
22
+ this.AliYunUrl = []; //需要验证的阿里账户的域名
23
+ this.AppCode;
24
+ this.HttpRequest = function (obj) {
25
+ _jquery["default"].ajax({
26
+ headers: this.AppCode,
27
+ url: obj.url,
28
+ data: obj.data,
29
+ type: obj.type,
30
+ dataType: obj.dataType,
31
+ async: obj.async,
32
+ success: obj.success,
33
+ error: obj.error
34
+ });
35
+ };
38
36
  }
39
37
 
40
38
  // var g_AilYunNetwork=new JSAliYunNetwork(); //初始化一个全局的变量
@@ -52,10 +50,7 @@ JSNetwork.HttpRequest= function (obj)
52
50
  */
53
51
 
54
52
  /*外部导入*/
55
-
56
-
57
53
  /*暴露外部用的方法*/
58
- exports.default = {
59
- g_AliYunNetwork: JSAliYunNetwork
60
-
54
+ var _default = exports["default"] = {
55
+ g_AliYunNetwork: JSAliYunNetwork
61
56
  };
@@ -1,57 +1,61 @@
1
1
  "use strict";
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
- value: true
4
+ value: true
5
5
  });
6
+ exports["default"] = void 0;
6
7
  //////////////////////////////////////////////////////////////////////////////
7
8
  // 拖拽宽度|宽度
8
9
  //
9
10
  //
10
11
  /////////////////////////////////////////////////////////////////////////////
11
12
 
12
-
13
13
  function JSDragDiv(divElement) {
14
- this.DivElement = divElement;
15
- this.MouseDownPoint; //点击鼠标位置
16
- this.MouseMovePoint;
17
- this.Cache = {};
18
- this.MouseMoveCallback;
19
- this.MouseDownCallback;
20
-
21
- var self = this;
22
- divElement.onmousedown = function (e) {
23
- self.OnMouseDown(e);
24
- document.onmousemove = function (e) {
25
- self.OnMouseMove(e);
26
- };
27
- document.onmouseup = function (e) {
28
- self.OnMouseUp(e);
29
- };
14
+ this.DivElement = divElement;
15
+ this.MouseDownPoint; //点击鼠标位置
16
+ this.MouseMovePoint;
17
+ this.Cache = {};
18
+ this.MouseMoveCallback;
19
+ this.MouseDownCallback;
20
+ var self = this;
21
+ divElement.onmousedown = function (e) {
22
+ self.OnMouseDown(e);
23
+ document.onmousemove = function (e) {
24
+ self.OnMouseMove(e);
30
25
  };
31
-
32
- this.OnMouseDown = function (e) {
33
- console.log("[JSDragDiv::OnMouseDown] x=" + e.clientX + " y=" + e.clientY);
34
- this.MouseDownPoint = { X: e.clientX, Y: e.clientY };
35
- this.MouseMovePoint = { X: e.clientX, Y: e.clientY };
36
- if (this.MouseDownCallback) this.MouseDownCallback(e, this);
26
+ document.onmouseup = function (e) {
27
+ self.OnMouseUp(e);
37
28
  };
38
-
39
- this.OnMouseMove = function (e) {
40
- console.log("[JSDragDiv::OnMouseMove] x=" + e.clientX + " y=" + e.clientY);
41
- if (this.MouseMoveCallback) this.MouseMoveCallback(e, this);
42
-
43
- this.MouseMovePoint = { X: e.clientX, Y: e.clientY };
29
+ };
30
+ this.OnMouseDown = function (e) {
31
+ console.log("[JSDragDiv::OnMouseDown] x=".concat(e.clientX, " y=").concat(e.clientY));
32
+ this.MouseDownPoint = {
33
+ X: e.clientX,
34
+ Y: e.clientY
44
35
  };
45
-
46
- this.OnMouseUp = function (e) {
47
- console.log("[JSDragDiv::OnMouseUp] x=" + e.clientX + " y=" + e.clientY);
48
- //清空事件
49
- document.onmousemove = null;
50
- document.onmouseup = null;
36
+ this.MouseMovePoint = {
37
+ X: e.clientX,
38
+ Y: e.clientY
39
+ };
40
+ if (this.MouseDownCallback) this.MouseDownCallback(e, this);
41
+ };
42
+ this.OnMouseMove = function (e) {
43
+ console.log("[JSDragDiv::OnMouseMove] x=".concat(e.clientX, " y=").concat(e.clientY));
44
+ if (this.MouseMoveCallback) this.MouseMoveCallback(e, this);
45
+ this.MouseMovePoint = {
46
+ X: e.clientX,
47
+ Y: e.clientY
51
48
  };
49
+ };
50
+ this.OnMouseUp = function (e) {
51
+ console.log("[JSDragDiv::OnMouseUp] x=".concat(e.clientX, " y=").concat(e.clientY));
52
+ //清空事件
53
+ document.onmousemove = null;
54
+ document.onmouseup = null;
55
+ };
52
56
  }
53
57
 
54
58
  /*暴露外部用的方法*/
55
- exports.default = {
56
- JSDragDiv: JSDragDiv
59
+ var _default = exports["default"] = {
60
+ JSDragDiv: JSDragDiv
57
61
  };