sbd-npm 1.2.82 → 1.2.83

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/util.js +27 -17
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.2.82",
3
+ "version": "1.2.83",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/util.js CHANGED
@@ -904,22 +904,34 @@ const Util = {
904
904
  /**
905
905
  * 股价相对强度(Relative Price Strength)
906
906
  * @param code
907
+ * @param zone_id
907
908
  */
908
- fetch_rps_data: function (code) {
909
+ fetch_rps_data: function (code, zone_id) {
909
910
  Util.show_loading();
910
- $("#rps_head").html(Util.pack_html_link("https://bafybeibav23h2xcyzevh4o26kb7mpz5j2ra3uryqycpkstuvsddfjgffwy.ipfs.dweb.link/欧奈尔RPS指标.html", "股价相对强度(Relative Price Strength)"));
911
- Util.init_table_skeleton({
912
- "element_id": "rps_table",
913
- "head_cols": [
914
- {"name": "时间"},
915
- {"name": "RPS20", "tooltip": "20日股价相对强度,表示过去20个交易日内,该股票的价格涨幅超过了市场上多少的股票,该值为85,表示该股在过去20日内的价格涨幅超过了市场上85%的股票"},
916
- {"name": "20日涨跌"},
917
- {"name": "RPS60", "tooltip": "60日股价相对强度,表示过去60个交易日内,该股票的价格涨幅超过了市场上多少的股票,该值为85,表示该股在过去60日内的价格涨幅超过了市场上85%的股票"},
918
- {"name": "60日涨跌"},
919
- {"name": "RPS120", "tooltip": "120日股价相对强度,表示过去120个交易日内,该股票的价格涨幅超过了市场上多少的股票,该值为85,表示该股在过去120日内的价格涨幅超过了市场上85%的股票"},
920
- {"name": "120日涨跌"},
921
- ]
922
- });
911
+ if ($("#rps_table").length <= 0) {
912
+ let rps_html = [];
913
+ rps_html.push('<div class="x_panel">');
914
+ rps_html.push('<div class="x_title">');
915
+ rps_html.push('<h2>', Util.pack_html_link("https://bafybeibav23h2xcyzevh4o26kb7mpz5j2ra3uryqycpkstuvsddfjgffwy.ipfs.dweb.link/欧奈尔RPS指标.html", "股价相对强度(Relative Price Strength)"), '</h2>');
916
+ rps_html.push('<div class="clearfix"></div>');
917
+ rps_html.push('</div>');
918
+ rps_html.push('<div class="x_content2" id="rps_table"></div>');
919
+ rps_html.push('</div>');
920
+ $("#" + zone_id).html(rps_html.join(""));
921
+ Util.init_table_skeleton({
922
+ "element_id": "rps_table",
923
+ "caption": "none",
924
+ "head_cols": [
925
+ {"name": "时间"},
926
+ {"name": "RPS20", "tooltip": "20日股价相对强度,表示过去20个交易日内,该股票的价格涨幅超过了市场上多少的股票,该值为85,表示该股在过去20日内的价格涨幅超过了市场上85%的股票"},
927
+ {"name": "20日涨跌"},
928
+ {"name": "RPS60", "tooltip": "60日股价相对强度,表示过去60个交易日内,该股票的价格涨幅超过了市场上多少的股票,该值为85,表示该股在过去60日内的价格涨幅超过了市场上85%的股票"},
929
+ {"name": "60日涨跌"},
930
+ {"name": "RPS120", "tooltip": "120日股价相对强度,表示过去120个交易日内,该股票的价格涨幅超过了市场上多少的股票,该值为85,表示该股在过去120日内的价格涨幅超过了市场上85%的股票"},
931
+ {"name": "120日涨跌"},
932
+ ]
933
+ });
934
+ }
923
935
  Util.post("/stock/" + code, {action: "rps"}, function (j) {
924
936
  let _html = [];
925
937
  j["data"].forEach(function (item) {
@@ -2526,9 +2538,7 @@ const Util = {
2526
2538
  * @returns {string}
2527
2539
  */
2528
2540
  digit_compare_trend1: function (digit, previous_digit) {
2529
- let cls = "";
2530
- let trend_ratio = "";
2531
- let ratio_val = 0;
2541
+ let cls = "", trend_ratio = "", ratio_val = 0;
2532
2542
  if (digit > 0 && previous_digit > 0) {
2533
2543
  if (digit > previous_digit) {
2534
2544
  cls = "text-danger";