sbd-npm 1.2.90 → 1.2.92

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 CHANGED
@@ -58,7 +58,7 @@ const MenuList = [
58
58
  ]
59
59
  },
60
60
  {
61
- 'name': '沪深港股通',
61
+ 'name': '沪深港通',
62
62
  'icon': 'cogs',
63
63
  'menu': [
64
64
  {'key': 'hsgt_flow', 'name': '资金流向', 'url': '/e0c6105a6de37e91aa886c70d2227948'},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.2.90",
3
+ "version": "1.2.92",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/stock_basics.js CHANGED
@@ -198,11 +198,11 @@ let Stock = {
198
198
  }
199
199
  // 备注
200
200
  let remark_html = [];
201
- if (item["is_down_macd"] === 1) {
201
+ if (item["is_down_macd"]) {
202
202
  remark_html.push("<b class='text-success'>MACD 下行</b>");
203
203
  }
204
- if (item["is_bull_trend"] === 1) {
205
- remark_html.push("<b class='text-success'>多头趋势</b>");
204
+ if (item["is_bull_trend"]) {
205
+ remark_html.push("<a href='" + Util.get_url("trend_bull_trend") + "'><b class='text-danger'>多头趋势</b></a>");
206
206
  }
207
207
  if (item["xsg_date"] > 0) {
208
208
  let xsg_date = Util.seconds_to_format(item["xsg_date"], "%Y-%m-%d");
@@ -226,6 +226,10 @@ let Stock = {
226
226
  remark_html += " <a href='" + url + "' class='btn btn-xs btn-warning'>" + i_d["name"] + "</a>";
227
227
  });
228
228
  }
229
+ if (item["is_star50"]) {
230
+ let summary_index_url = Util.get_url("summary_index") + "?index_code=SH000688";
231
+ remark_html += " <a href='" + summary_index_url + "' class='btn btn-xs btn-warning'>科创50</a>";
232
+ }
229
233
  if (item["links"]) {
230
234
  if (remark_html.length > 0) {
231
235
  remark_html += "<br>";
package/util.js CHANGED
@@ -1489,19 +1489,26 @@ const Util = {
1489
1489
  /**
1490
1490
  * 数量限制组件
1491
1491
  * @param component_id
1492
+ * @param select_val
1493
+ * @param max_val
1492
1494
  */
1493
- init_limit_num_component: function (component_id) {
1495
+ init_limit_num_component: function (component_id, select_val = 0, max_val = 0) {
1494
1496
  let element_id = component_id.replace("_div", "");
1495
1497
  let html = [];
1496
1498
  html.push('<label for="', element_id, '"></label>');
1497
1499
  html.push('<select id="', element_id, '" class="form-control">');
1498
1500
  html.push('<option value="50">50</option>');
1499
- html.push('<option value="100" selected>100</option>');
1501
+ html.push('<option value="100">100</option>');
1500
1502
  html.push('<option value="200">200</option>');
1501
1503
  html.push('<option value="500">500</option>');
1502
1504
  html.push('<option value="1000">1000</option>');
1505
+ if (max_val > 0) {
1506
+ html.push('<option value="', max_val, '">', max_val, '</option>');
1507
+ }
1503
1508
  html.push('</select>');
1504
- $("#" + component_id).html(html.join(""));
1509
+ let obj = $("#" + component_id);
1510
+ obj.html(html.join(""));
1511
+ obj.find("option[value='" + (select_val > 0 ? select_val : 100) + "']").attr("selected", true);
1505
1512
  },
1506
1513
 
1507
1514
  /**
@@ -2372,14 +2379,22 @@ const Util = {
2372
2379
  }
2373
2380
  if ($("#remark_" + code).length) {
2374
2381
  let remark = "";
2375
- if (item["is_down_macd"] && item["is_down_macd"] > 0) {
2382
+ if (item["is_down_macd"]) {
2376
2383
  remark += "<b>MACD 下行</b><br />";
2377
2384
  }
2378
- if (item["is_bull_trend"] && item["is_bull_trend"] > 0) {
2379
- remark += "<b>多头趋势</b><br />";
2385
+ if (item["is_bull_trend"]) {
2386
+ remark += "<b>" + Util.pack_html_link(Util.get_url("trend_bull_trend"), "多头趋势") + "</b><br />";
2380
2387
  }
2381
2388
  if (item["kdj_trend"] && item["kdj_trend"] > 0) {
2382
- remark += "<b>" + (item["kdj_trend"] === 2 ? "周" : "") + "KDJ金叉</b><br />";
2389
+ let kdj_name = "KDJ金叉";
2390
+ let kdj_url = Util.get_url("trend_kdj");
2391
+ if (item["kdj_trend"] === 2) {
2392
+ kdj_name = "周" + kdj_name;
2393
+ kdj_url += "?date_type=3";
2394
+ } else {
2395
+ kdj_url += "?date_type=2";
2396
+ }
2397
+ remark += "<b>" + Util.pack_html_link(kdj_url, kdj_name) + "</b><br />";
2383
2398
  }
2384
2399
  $("#remark_" + code).html(remark);
2385
2400
  }
@@ -2629,7 +2644,10 @@ const Util = {
2629
2644
  * @returns {string}
2630
2645
  */
2631
2646
  pack_html_link: function (url, title) {
2632
- return "<a target='_blank' class='link_cls' rel='noopener noreferrer nofollow' href='" + url + "'>" + title + "</a>";
2647
+ if (url) {
2648
+ return "<a target='_blank' class='link_cls' rel='noopener noreferrer nofollow' href='" + url + "'>" + title + "</a>";
2649
+ }
2650
+ return title;
2633
2651
  },
2634
2652
 
2635
2653
  /**