sbd-npm 1.3.51 → 1.3.53
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/constant.js +1 -1
- package/package.json +1 -1
- package/stock_basics.js +42 -8
- package/util.js +3 -3
package/constant.js
CHANGED
@@ -52,9 +52,9 @@ const MenuList = [
|
|
52
52
|
{'key': 'daily_price_limit_up', 'name': '每日涨停', 'url': '/0x7e05ba643accb5fc6fb4ed5962e560182bfbe782'},
|
53
53
|
{'key': 'daily_margin', 'name': '融资融券', 'url': '/0x346eb98b16e29800315ad99545be9d391d0bdcf1'},
|
54
54
|
{'key': 'daily_volume', 'name': '成交量(大量)', 'url': '/0xd92468b610939a0a904069b4293afd7f2e8c4411'},
|
55
|
+
{'key': 'daily_amount', 'name': '成交额', 'url': '/0x52f628266cf952dcde3c51720f69d4cf3179282d'},
|
55
56
|
{'key': 'daily_gap', 'name': '缺口', 'url': '/0xc09193d6aa6e30481598783ef22d3bf5d0f79aad'},
|
56
57
|
{'key': 'daily_turnover', 'name': '换手率', 'url': '/0xdf9b75b31bba10c011bbaf48799d8420f192cfa6'},
|
57
|
-
{'key': 'daily_amount', 'name': '成交额', 'url': '/0x52f628266cf952dcde3c51720f69d4cf3179282d'},
|
58
58
|
{'key': 'daily_buy_sell', 'name': '买入卖出', 'url': '/0x79d1721e939806b2ee507762ade8104bb9320cf7'},
|
59
59
|
{'key': 'daily_big_deal', 'name': '大单交易', 'url': '/0x0ecbe70538ea87c664889e763faecb4a0b080104'},
|
60
60
|
{'key': 'daily_block', 'name': '大宗交易', 'url': '/0x591119baf53f3cda6c34fd9025a5a2b5d68342ce'},
|
package/package.json
CHANGED
package/stock_basics.js
CHANGED
@@ -605,12 +605,16 @@ let Stock = {
|
|
605
605
|
"element_id": "profit_table",
|
606
606
|
"head_cols": [
|
607
607
|
{"name": "年份-季度"},
|
608
|
-
{"name": "净利率
|
608
|
+
{"name": "净利率"},
|
609
609
|
{"name": "毛利率"},
|
610
610
|
{"name": "EPS", "tooltip": "每股收益(Earnings Per Share)"},
|
611
611
|
{"name": "ROE", "tooltip": "净资产收益率(Return On Equity)"},
|
612
612
|
{"name": "营业收入"},
|
613
|
+
{"name": "营收同比", "tooltip": "(当前营业收入 - 去年同期的营业收入) / 去年同期的营业收入 × 100%"},
|
614
|
+
{"name": "营收环比", "tooltip": "(当前营业收入 - 上一季度的营业收入) / 上一季度的营业收入 × 100%"},
|
613
615
|
{"name": "净利润"},
|
616
|
+
{"name": "净利同比", "tooltip": "(当前净利润 - 去年同期的净利润) / 去年同期的净利润 × 100%"},
|
617
|
+
{"name": "净利环比", "tooltip": "(当前净利润 - 上一季度的净利润) / 上一季度的净利润 × 100%"},
|
614
618
|
{"name": "扣非净利润"},
|
615
619
|
]
|
616
620
|
});
|
@@ -696,8 +700,38 @@ let Stock = {
|
|
696
700
|
_html.push("<td>", Util.to_float(item["gross_profit_rate"], 2), "%</td>");
|
697
701
|
_html.push("<td>", Util.to_float(item["eps"], 2), "元</td>");
|
698
702
|
_html.push("<td>", item["roe"], "%</td>");
|
699
|
-
|
700
|
-
_html.push("<td>",
|
703
|
+
let total_revenue = Util.to_unit(item["total_revenue"], 3);
|
704
|
+
_html.push("<td>", total_revenue, "</td>");
|
705
|
+
let total_revenue_yoy_title = "", total_revenue_yoy_ratio = "--";
|
706
|
+
if (item["yoy_total_revenue"]) {
|
707
|
+
total_revenue_yoy_title = " title='" + Util.strip_html(Util.to_unit(item["yoy_total_revenue"])) + " - " + Util.strip_html(total_revenue) + "'";
|
708
|
+
total_revenue_yoy_ratio = Util.to_float(((item["total_revenue"] - item["yoy_total_revenue"]) / item["yoy_total_revenue"]) * 100, 2);
|
709
|
+
total_revenue_yoy_ratio = Util.parse_ratio(total_revenue_yoy_ratio);
|
710
|
+
}
|
711
|
+
_html.push("<td", total_revenue_yoy_title, ">", total_revenue_yoy_ratio, "</td>");
|
712
|
+
let total_revenue_qoq_title = "", total_revenue_qoq_ratio = "--";
|
713
|
+
if (item["qoq_total_revenue"]) {
|
714
|
+
total_revenue_qoq_title = " title='" + Util.strip_html(Util.to_unit(item["qoq_total_revenue"])) + " - " + Util.strip_html(Util.to_unit(item["total_revenue_add"])) + "'";
|
715
|
+
total_revenue_qoq_ratio = Util.to_float(((item["total_revenue_add"] - item["qoq_total_revenue"]) / item["qoq_total_revenue"]) * 100, 2);
|
716
|
+
total_revenue_qoq_ratio = Util.parse_ratio(total_revenue_qoq_ratio);
|
717
|
+
}
|
718
|
+
_html.push("<td", total_revenue_qoq_title, ">", total_revenue_qoq_ratio, "</td>");
|
719
|
+
let net_profit = Util.to_unit(item["net_profit"], 3);
|
720
|
+
_html.push("<td>", net_profit, "</td>");
|
721
|
+
let net_profit_yoy_title = "", net_profit_yoy_ratio = "--";
|
722
|
+
if (item["yoy_net_profit"]) {
|
723
|
+
net_profit_yoy_title = " title='" + Util.strip_html(Util.to_unit(item["yoy_net_profit"])) + " - " + Util.strip_html(net_profit) + "'";
|
724
|
+
net_profit_yoy_ratio = Util.to_float(((item["net_profit"] - item["yoy_net_profit"]) / item["yoy_net_profit"]) * 100, 2);
|
725
|
+
net_profit_yoy_ratio = Util.parse_ratio(net_profit_yoy_ratio);
|
726
|
+
}
|
727
|
+
_html.push("<td", net_profit_yoy_title, ">", net_profit_yoy_ratio, "</td>");
|
728
|
+
let net_profit_qoq_title = "", net_profit_qoq_ratio = "--";
|
729
|
+
if (item["qoq_net_profit"]) {
|
730
|
+
net_profit_qoq_title = " title='" + Util.strip_html(Util.to_unit(item["qoq_net_profit"])) + " - " + Util.strip_html(Util.to_unit(item["net_profit_add"])) + "'";
|
731
|
+
net_profit_qoq_ratio = Util.to_float(((item["net_profit_add"] - item["qoq_net_profit"]) / item["qoq_net_profit"]) * 100, 2);
|
732
|
+
net_profit_qoq_ratio = Util.parse_ratio(net_profit_qoq_ratio);
|
733
|
+
}
|
734
|
+
_html.push("<td", net_profit_qoq_title, ">", net_profit_qoq_ratio, "</td>");
|
701
735
|
_html.push("<td>", Util.to_unit(item["adjusted_net_profit"], 3), "</td>");
|
702
736
|
_html.push("</tr>");
|
703
737
|
}
|
@@ -1077,17 +1111,17 @@ let Stock = {
|
|
1077
1111
|
}
|
1078
1112
|
date = Util.format_to_second(year + "-" + month + "-01");
|
1079
1113
|
Stock.hist_end_date = Util.seconds_to_format(date - 1, "%Y-%m-%d");
|
1080
|
-
} else if (date_type === "
|
1114
|
+
} else if (date_type === "quarter") {
|
1081
1115
|
let d_arr = date.split("-");
|
1082
1116
|
let year = parseInt(d_arr[0]);
|
1083
|
-
let
|
1084
|
-
if (
|
1117
|
+
let quarter = d_arr[1];
|
1118
|
+
if (quarter === "S1") {
|
1085
1119
|
Stock.hist_start_date = year + "-01-01";
|
1086
1120
|
date = year + "-04-01";
|
1087
|
-
} else if (
|
1121
|
+
} else if (quarter === "S2") {
|
1088
1122
|
Stock.hist_start_date = year + "-04-01";
|
1089
1123
|
date = year + "-07-01";
|
1090
|
-
} else if (
|
1124
|
+
} else if (quarter === "S3") {
|
1091
1125
|
Stock.hist_start_date = year + "-07-01";
|
1092
1126
|
date = year + "-10-01";
|
1093
1127
|
} else {
|
package/util.js
CHANGED
@@ -1792,7 +1792,7 @@ const Util = {
|
|
1792
1792
|
},
|
1793
1793
|
|
1794
1794
|
/**
|
1795
|
-
*
|
1795
|
+
* 获取指定的时间戳是哪个季度
|
1796
1796
|
* @param seconds
|
1797
1797
|
* @returns {*|number}
|
1798
1798
|
*/
|
@@ -3373,7 +3373,7 @@ const Util = {
|
|
3373
3373
|
Util.init_time_drop_down(metrics, metrics_drop_down_id, "daily", callback_func);
|
3374
3374
|
Util.init_time_drop_down(metrics, metrics_drop_down_id, "week", callback_func);
|
3375
3375
|
Util.init_time_drop_down(metrics, metrics_drop_down_id, "month", callback_func);
|
3376
|
-
Util.init_time_drop_down(metrics, metrics_drop_down_id, "
|
3376
|
+
Util.init_time_drop_down(metrics, metrics_drop_down_id, "quarter", callback_func);
|
3377
3377
|
}
|
3378
3378
|
callback_func(metrics, "week");
|
3379
3379
|
},
|
@@ -3384,7 +3384,7 @@ const Util = {
|
|
3384
3384
|
let time_arr = ["30周", "52周", "100周", "150周", "200周", "300周"];
|
3385
3385
|
if (date_type === "month") {
|
3386
3386
|
time_arr = ["30月", "40月", "50月", "60月", "100月", "120月"];
|
3387
|
-
} else if (date_type === "
|
3387
|
+
} else if (date_type === "quarter") {
|
3388
3388
|
time_arr = ["30季", "40季", "50季"];
|
3389
3389
|
} else if (date_type === "daily") {
|
3390
3390
|
time_arr = ["20日", "60日", "120日", "200日"];
|