sbd-npm 1.3.66 → 1.3.68

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
@@ -27,7 +27,7 @@ const MenuList = [
27
27
  {'key': 'trend_kdj', 'name': 'KDJ金叉', 'url': '/0x3382bdaec4e8715ce27ca2b538dce09a2f8f5e50'},
28
28
  {'key': 'trend_macd_cross', 'name': 'MACD金叉', 'url': '/0x277bc35fcd21059103dd7917c8bfe0c474880b85'},
29
29
  {'key': 'trend_bull_trend', 'name': '多头趋势', 'url': '/0x37b24777154ee090926e57bfa5602efa5c89b8a8'},
30
- {'key': 'trend_fund_hold', 'name': '基金数持股变化', 'url': '/0x706c0e77ca3e314b5186c763e6ee857b744e9880'},
30
+ {'key': 'trend_fund_hold', 'name': '基金持股变化', 'url': '/0x706c0e77ca3e314b5186c763e6ee857b744e9880'},
31
31
  {'key': 'trend_money_inflow', 'name': '资金流入历史最高', 'url': '/0xfbfc92be1eebe9ccf5b2f14b9a2ea25f2cc941b8'},
32
32
  {'key': 'trend_boll', 'name': '布林线', 'url': '/0x7f2c6b9542ce7626669ab4910cbf7e8812883fea'},
33
33
  {'key': 'trend_holder_minimum', 'name': '股东数历史最少', 'url': '/0xf0c0c360a283689c83ae216c6bbb03777d8068ca'},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.3.66",
3
+ "version": "1.3.68",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/stock_basics.js CHANGED
@@ -238,6 +238,11 @@ let Stock = {
238
238
  if (item["is_hs300"]) {
239
239
  remark_html += " <a href='" + (Util.get_url("summary_index") + "?index_code=SH000300") + "' class='btn btn-xs btn-warning'>沪深300</a>";
240
240
  }
241
+ if (item["etf_data"]) {
242
+ item["etf_data"].forEach(function (etf) {
243
+ remark_html += " <a class='btn btn-xs btn-warning' data-toggle='modal' data-target='.public_fund_modal' data-val='" + etf["etf_code"] + "'>" + etf["etf_name"] + "</a>";
244
+ });
245
+ }
241
246
  if (item["links"]) {
242
247
  if (remark_html.length > 0) {
243
248
  remark_html += "<br>";
package/util.js CHANGED
@@ -351,7 +351,7 @@ const Util = {
351
351
  let name = symbol;
352
352
  if (item["cname"]) {
353
353
  if (Util.is_us(item["code"])) {
354
- name = item["cname"].replace("公司", "").replace("•", "").replace("&#8226;", "");
354
+ name = item["cname"].replace("有限公司", "").replace("公司", "").replace("•", "").replace("&#8226;", "");
355
355
  } else {
356
356
  name = item["cname"];
357
357
  }
@@ -1224,23 +1224,38 @@ const Util = {
1224
1224
  */
1225
1225
  fetch_public_fund_change: function (code) {
1226
1226
  Util["pfc_stock_chart"] = Util.show_chart_loading(Util["pfc_stock_chart"], "pfc_stock_line_canvas");
1227
- Util.init_table_skeleton({
1228
- "element_id": "pfc_fund_table",
1229
- "head_cols": [
1230
- {"name": "时间", "class": "info", "table_sort": 1},
1231
- {"name": "当时股价", "table_sort": 1},
1232
- {"name": "总持股数", "table_sort": 1},
1233
- {"name": "持仓家数", "table_sort": 1},
1234
- {"name": "持仓市值", "table_sort": 1, "title": "当时股价 * 总持股数"},
1235
- ]
1236
- });
1227
+ if ($("#pfc_fund_table_body").length === 0) {
1228
+ Util.init_table_skeleton({
1229
+ "element_id": "pfc_fund_table",
1230
+ "head_cols": [
1231
+ {"name": "季度时间", "class": "info", "table_sort": 1},
1232
+ {"name": "当时股价", "table_sort": 1, "title": "当季最后一个交易日的收盘价"},
1233
+ {"name": "持股总数", "table_sort": 1},
1234
+ {"name": "持仓基金数", "table_sort": 1},
1235
+ {"name": "持股进前10的基金数", "table_sort": 1, "title": "基金数以持股数占比进前10内的股票来统计"},
1236
+ {"name": "持仓市值", "table_sort": 1, "title": "当时股价 * 持股总数"},
1237
+ ]
1238
+ });
1239
+ if ($("#is_fund10_num").length > 0) {
1240
+ $("#is_fund10_num").click(function() {
1241
+ Util.fetch_public_fund_change(code);
1242
+ });
1243
+ }
1244
+ }
1237
1245
  Util.post("/stock/" + code, {action: "public_fund_change"}, function (j) {
1238
1246
  Util["pfc_stock_chart"].hideLoading();
1239
- let date_data = [], fund_num_data = [], stock_num_data = [], price_data = [], _html = [];
1247
+ let date_data = [], fund_num_data = [], stock_num_data = [], price_data = [], _html = [], is_fund10_num = 0;
1248
+ if ($("#is_fund10_num").length > 0) {
1249
+ is_fund10_num = $("#is_fund10_num").prop("checked") ? 1 : 0;
1250
+ }
1240
1251
  j["data"].forEach(function (item) {
1241
1252
  let date_format = Util.seconds_to_format(item["date"], "%Y-%m-%d");
1242
1253
  date_data.push(date_format);
1243
- fund_num_data.push(item["fund_num"]);
1254
+ if (is_fund10_num === 1) {
1255
+ fund_num_data.push(item["fund_rank_num"]);
1256
+ } else {
1257
+ fund_num_data.push(item["fund_num"]);
1258
+ }
1244
1259
  stock_num_data.push(item["stock_num"]);
1245
1260
  price_data.push(item["price"]);
1246
1261
  _html.push("<tr>");
@@ -1259,9 +1274,13 @@ const Util = {
1259
1274
  if (item["pre_fund_num"]) {
1260
1275
  fund_num_rate = "(" + Util.year_price_rate(item["fund_num"], item["pre_fund_num"], 1) + ")";
1261
1276
  }
1262
- _html.push("<td>", item["fund_num"], fund_num_rate, "</td>");
1263
- let market_capital = item["price"] * item["stock_num"];
1264
- _html.push("<td data-val='", market_capital, "' title='", market_capital, "'>", Util.to_unit(market_capital, 4), "</td>");
1277
+ _html.push("<td data-val='", item["fund_num"], "'>", item["fund_num"], fund_num_rate, "</td>");
1278
+ let fund_rank_num_rate = "";
1279
+ if (item["pre_fund_rank_num"]) {
1280
+ fund_rank_num_rate = "(" + Util.year_price_rate(item["fund_rank_num"], item["pre_fund_rank_num"], 1) + ")";
1281
+ }
1282
+ _html.push("<td data-val='", item["fund_rank_num"], "'>", item["fund_rank_num"], fund_rank_num_rate, "</td>");
1283
+ _html.push("<td data-val='", item["hold_value"], "' title='", item["hold_value"], "'>", Util.to_unit(item["hold_value"], 3), "</td>");
1265
1284
  _html.push("</tr>");
1266
1285
  });
1267
1286
  date_data = date_data.reverse();