sbd-npm 1.3.73 → 1.3.75

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
@@ -140,6 +140,7 @@ const MenuList = [
140
140
  'icon': 'retweet',
141
141
  'menu': [
142
142
  {'key': 'portfolio_recommend', 'name': '关注', 'url': '/0x2da99e58e28de94b670c4200657ac7e26dd8dceb'},
143
+ {'key': 'portfolio_week', 'name': '周观察股', 'url': '/0xa97a3f551b5fddd48384952bbd0eb63b7c4636d0'},
143
144
  {'key': 'portfolio_chen', 'name': '陈营长极品投资', 'url': '/0x3f8cbeeeb38138a626e935017a4cc25f47ce3dbe'},
144
145
  {'key': 'portfolio_vegetable', 'name': 'Veget', 'url': '/0x671dd9dcfca7dbc220c8164c92a74d2c561c6464'},
145
146
  {'key': 'portfolio_follow', 'name': '跟我走吧14', 'url': '/0x4aa68e74a66297c0ece1bb05fad20c32ee1db9e4'},
@@ -147,7 +148,6 @@ const MenuList = [
147
148
  {'key': 'portfolio_tianjin', 'name': '天津股侠', 'url': '/0xb8428e42237a7485a787e2ab1b5ae0f057258f18'},
148
149
  {'key': 'portfolio_zan', 'name': 'zangyn', 'url': '/0xccb07ddaf4f1219b7b5ae64780e7905206927873'},
149
150
  {'key': 'portfolio_peng', 'name': '吴小朋同学', 'url': '/0x4f1a316c05731e365ec1b7ef454d98206fa973f6'},
150
- {'key': 'portfolio_penny', 'name': '梁斌penny', 'url': '/0x34ec770b56fbd946e2a3467664efbe674d04f6ec'},
151
151
  {'key': 'portfolio_wen', 'name': '李健2013', 'url': '/0xe09c047550390159bda66d6315743427dd7ccae4'},
152
152
  {'key': 'portfolio_patience', 'name': '耐力投资', 'url': '/0x55ecbeeabd7ad78dba8c38a9325b2889798622b3'},
153
153
  {'key': 'portfolio_star50', 'name': '科创50', 'url': '/0x378b2601d83c467f81f1d4e323c8bfbc72f6cc0d'},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.3.73",
3
+ "version": "1.3.75",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/status.js CHANGED
@@ -24,6 +24,9 @@ $(function () {
24
24
  case "database_table":
25
25
  Status.handle_database_table();
26
26
  break;
27
+ case "database_variable":
28
+ Status.handle_database_variable();
29
+ break;
27
30
  case "request_headers":
28
31
  Status.handle_request_headers();
29
32
  break;
@@ -246,7 +249,7 @@ $(function () {
246
249
  {"name": "序号", "table_sort": 1},
247
250
  {"name": "表名", "table_sort": 1},
248
251
  {"name": "表引擎", "table_sort": 1},
249
- {"name": "行记录格式"},
252
+ {"name": "行格式", "table_sort": 1},
250
253
  {"name": "数据量", "table_sort": 1},
251
254
  {"name": "数据大小", "table_sort": 1, "class": "info"},
252
255
  {"name": "索引大小", "table_sort": 1},
@@ -279,6 +282,34 @@ $(function () {
279
282
  });
280
283
  },
281
284
 
285
+ handle_database_variable: function () {
286
+ if (!document.getElementById("database_variable_div_body")) {
287
+ Util.init_table_skeleton({
288
+ "element_id": "database_variable_div",
289
+ "caption": '<caption class="text-right" id="database_variable_num"></caption>',
290
+ "head_cols": [
291
+ {"name": "序号", "style": "width: 100px;", "table_sort": 1},
292
+ {"name": "键", "table_sort": 1},
293
+ {"name": "值", "table_sort": 1},
294
+ ]
295
+ });
296
+ }
297
+ Util.post(location.pathname, {active_div: localStorage[Status.tab_token]}, function (j) {
298
+ let html = [], database_variable_num = 0;
299
+ j["data"].forEach(function (item) {
300
+ database_variable_num++;
301
+ html.push("<tr>");
302
+ html.push("<td>", database_variable_num, "</td>");
303
+ html.push("<td class='text-right'>", item["key"], "</td>");
304
+ html.push("<td class='text-left' style='word-break: break-all'>", item["val"], "</td>");
305
+ html.push("</tr>");
306
+ });
307
+ Util.render_table_html("database_variable_div_body", html);
308
+ $("#database_variable_num").html("共 <span class='label label-info'>" + database_variable_num + "</span> 条");
309
+ Util.hide_tips();
310
+ });
311
+ },
312
+
282
313
  handle_request_headers: function () {
283
314
  if (!document.getElementById("request_headers_div_body")) {
284
315
  Util.init_table_skeleton({
@@ -519,6 +550,9 @@ $(function () {
519
550
  let city = data["city"] ? data["city"] : "";
520
551
  let district = data["district"] ? data["district"] : "";
521
552
  let isp = data["isp"] ? (" - " + data["isp"]) : "";
553
+ if (country === city) {
554
+ country = "";
555
+ }
522
556
  if (country === province || province === city) {
523
557
  province = "";
524
558
  }
package/summary_daily.js CHANGED
@@ -46,6 +46,7 @@ $(function () {
46
46
 
47
47
  load_cache: function () {
48
48
  DailySummary["hsgt_money_flow_chart"] = Util.show_chart_loading(DailySummary["hsgt_money_flow_chart"], "hsgt_money_flow_line");
49
+ DailySummary["big_deal_pie_chart"] = Util.show_chart_loading(DailySummary["big_deal_pie_chart"], "big_deal_pie");
49
50
  try {
50
51
  Util.set_table_loading("market_overview_zone");
51
52
  let cache = DailySummary.get_cache();
@@ -55,9 +56,6 @@ $(function () {
55
56
  if (cache.hasOwnProperty("change_percent")) {
56
57
  DailySummary.pack_change_percent(cache["change_percent"]);
57
58
  }
58
- if (cache.hasOwnProperty("big_deal")) {
59
- DailySummary.pack_big_deal(cache["big_deal"], 0);
60
- }
61
59
  if (cache.hasOwnProperty("news")) {
62
60
  DailySummary.pack_news_data(cache["news"]);
63
61
  }
@@ -167,22 +165,25 @@ $(function () {
167
165
 
168
166
  /**
169
167
  * 大单交易
170
- * @param bd
168
+ * @param big_deal_data
171
169
  * @param big_deal_date
172
170
  */
173
- pack_big_deal: function (bd, big_deal_date) {
171
+ pack_big_deal: function (big_deal_data, big_deal_date) {
172
+ if (DailySummary["big_deal_pie_chart"]) {
173
+ DailySummary["big_deal_pie_chart"].hideLoading();
174
+ }
174
175
  let bd_obj = $('#big_deal_pie');
175
176
  if (bd_obj.length) {
176
177
  if (big_deal_date > 0) {
177
178
  $("#big_deal_date").html("(" + Util.seconds_to_format(big_deal_date, "%Y-%m-%d") + ")");
178
179
  }
179
- if (DailySummary.big_deal === {} || DailySummary.big_deal["buy1000"] !== bd["buy1000"] || DailySummary.big_deal["buy800"] !== bd["buy800"]
180
- || DailySummary.big_deal["buy600"] !== bd["buy600"] || DailySummary.big_deal["buy400"] !== bd["buy400"]
181
- || DailySummary.big_deal["sell400"] !== bd["sell400"] || DailySummary.big_deal["sell600"] !== bd["sell600"]
182
- || DailySummary.big_deal["sell800"] !== bd["sell800"] || DailySummary.big_deal["sell1000"] !== bd["sell1000"]) {
180
+ if (DailySummary.big_deal === {} || DailySummary.big_deal["buy1000"] !== big_deal_data["buy1000"] || DailySummary.big_deal["buy800"] !== big_deal_data["buy800"]
181
+ || DailySummary.big_deal["buy600"] !== big_deal_data["buy600"] || DailySummary.big_deal["buy400"] !== big_deal_data["buy400"]
182
+ || DailySummary.big_deal["sell400"] !== big_deal_data["sell400"] || DailySummary.big_deal["sell600"] !== big_deal_data["sell600"]
183
+ || DailySummary.big_deal["sell800"] !== big_deal_data["sell800"] || DailySummary.big_deal["sell1000"] !== big_deal_data["sell1000"]) {
183
184
  bd_obj.css("height", "300px");
184
- Util.big_deal_pie('big_deal_pie', bd);
185
- DailySummary.big_deal = bd;
185
+ Util.big_deal_pie('big_deal_pie', big_deal_data);
186
+ DailySummary.big_deal = big_deal_data;
186
187
  }
187
188
  }
188
189
  },
@@ -298,25 +299,28 @@ $(function () {
298
299
  pack_market_overview: function (market_overview_dict) {
299
300
  let _html = [], previous_mo_amount = 0, mo_amount = 0, mo_amount_cls = "", mo_amount_sign = "";
300
301
  for (let market_type in market_overview_dict) {
301
- if (market_overview_dict.hasOwnProperty(market_type)) {
302
- let market = market_overview_dict[market_type];
302
+ if (market_overview_dict.hasOwnProperty(market_type) && market_overview_dict[market_type]["name"]) {
303
+ let market_capital = "--", pe = "--", volume = "--", amount = "--", market = market_overview_dict[market_type];
304
+ _html.push("<tr>");
305
+ _html.push("<td style='padding: 18px 0;'>", Util.pack_html_link(market["url"], market["name"]), "</td>");
303
306
  if (market["item"]) {
304
307
  if (market_type !== 5 && market["item"]) {
305
308
  previous_mo_amount += market["item"]["prev_amount"];
306
309
  mo_amount += market["item"]["amount"];
307
310
  }
308
- _html.push("<tr>");
309
- _html.push("<td style='padding: 18px 0;'>", Util.pack_html_link(market["url"], market["name"]), "</td>");
310
- if (!market["item"]["market_capital"] && market["item"]["prev_market_capital"]) {
311
- market["item"]["market_capital"] = market["item"]["prev_market_capital"];
311
+ if (market["item"]["market_capital"] && market["item"]["market_capital"] > 0) {
312
+ market_capital = market["item"]["market_capital"] + "万亿";
313
+ } else if (market["item"]["prev_market_capital"] && market["item"]["prev_market_capital"] > 0) {
314
+ market_capital = market["item"]["prev_market_capital"] + "万亿";
315
+ }
316
+ if (market["item"]["pe"]) {
317
+ pe = market["item"]["pe"];
318
+ } else if (market["item"]["prev_pe"]) {
319
+ pe = market["item"]["prev_pe"];
312
320
  }
313
- _html.push("<td style='padding: 18px 0;'>", (market["item"]["market_capital"] ? (market["item"]["market_capital"] + "万亿") : "--"), "</td>");
314
- if (!market["item"]["pe"] && market["item"]["prev_pe"]) {
315
- market["item"]["pe"] = market["item"]["prev_pe"];
321
+ if (market["item"]["volume"] && market["item"]["volume"] > 0) {
322
+ volume = market["item"]["volume"] + "亿股";
316
323
  }
317
- _html.push("<td style='padding: 18px 0;'>", (market["item"]["pe"] ? market["item"]["pe"] : "--"), "</td>");
318
- _html.push("<td style='padding: 18px 0;'>", (market["item"]["volume"] ? (market["item"]["volume"] + "亿股") : "--"), "</td>");
319
- let amount = "--";
320
324
  if (market["item"]["amount"] && market["item"]["amount"] > 0) {
321
325
  if (market["item"]["prev_amount"] && market["item"]["prev_amount"] > 0 && market["item"]["amount"] !== market["item"]["prev_amount"]) {
322
326
  if (market["item"]["amount"] > market["item"]["prev_amount"]) {
@@ -328,9 +332,12 @@ $(function () {
328
332
  amount = market["item"]["amount"] + "亿";
329
333
  }
330
334
  }
331
- _html.push("<td style='padding: 18px 0;'>", amount, "</td>");
332
- _html.push("</tr>");
333
335
  }
336
+ _html.push("<td style='padding: 18px 0;'>", market_capital, "</td>");
337
+ _html.push("<td style='padding: 18px 0;'>", pe, "</td>");
338
+ _html.push("<td style='padding: 18px 0;'>", volume, "</td>");
339
+ _html.push("<td style='padding: 18px 0;'>", amount, "</td>");
340
+ _html.push("</tr>");
334
341
  }
335
342
  }
336
343
  $("#market_overview_zone").html(_html.join(""));
@@ -372,7 +379,6 @@ $(function () {
372
379
  DailySummary.pack_news_data(j["news"]);
373
380
  DailySummary.set_cache("index", j["index"]);
374
381
  DailySummary.set_cache("change_percent", j["change_percent"]);
375
- DailySummary.set_cache("big_deal", j["big_deal"]);
376
382
  DailySummary.set_cache("news", j["news"]);
377
383
  DailySummary.hide_loaded();
378
384
  if (DailySummary.is_trade_time === 1) {
@@ -438,6 +444,7 @@ $(function () {
438
444
  // 指数历史行情数据
439
445
  render_index_hist_modal: function() {
440
446
  Util.show_loading();
447
+ Util.set_table_loading("index_hist_modal_body_body");
441
448
  let payload = {
442
449
  action: "index_hist",
443
450
  index_code: "ths_all_a",
@@ -452,10 +459,18 @@ $(function () {
452
459
  _html.push("<td>", item["open"], "</td>");
453
460
  _html.push("<td>", item["low"], "</td>");
454
461
  _html.push("<td>", item["high"], "</td>");
455
- _html.push("<td>", item["close"], "</td>");
462
+ _html.push("<td data-val='", item["close"], "'><b class='", Util.text_color(item["p_change_rate"]), "'>", item["close"], "</b></td>");
456
463
  _html.push("<td>", Util.parse_ratio(item["p_change_rate"]), "</td>");
457
464
  _html.push("<td data-val='", item["volume"], "'>", Util.to_unit(item["volume"]), "股</td>");
458
- _html.push("<td data-val='", item["amount"], "'>", Util.to_unit(item["amount"]), "</td>");
465
+ let amount = Util.to_unit(item["amount"], 3);
466
+ if (item["pre_amount"]) {
467
+ if (item["amount"] > item["pre_amount"]) {
468
+ amount += "<b class='text-danger'>(+" + Util.to_unit(item["amount"] - item["pre_amount"], 3) + ")</b>";
469
+ } else if (item["amount"] < item["pre_amount"]) {
470
+ amount += "<b class='text-success'>(" + Util.to_unit(item["amount"] - item["pre_amount"], 3) + ")</b>";
471
+ }
472
+ }
473
+ _html.push("<td data-val='", item["amount"], "'>", amount, "</td>");
459
474
  _html.push("</tr>");
460
475
  });
461
476
  Util.render_table_html("index_hist_modal_body_body", _html);
package/util.js CHANGED
@@ -674,7 +674,15 @@ const Util = {
674
674
  let weekday = date.getDay();
675
675
  if (weekday > 0 && weekday < 6) {
676
676
  let hour = date.getHours();
677
- return hour >= 9 && hour < 15 && hour !== 12;
677
+ if (hour === 9) {
678
+ let minute = date.getMinutes();
679
+ return minute >= 30;
680
+ } else if (hour === 11) {
681
+ let minute = date.getMinutes();
682
+ return minute <= 30;
683
+ } else {
684
+ return hour > 9 && hour < 15 && hour !== 12;
685
+ }
678
686
  }
679
687
  return false;
680
688
  },
@@ -2186,8 +2194,8 @@ const Util = {
2186
2194
  _html.push('<option value="7">最近30日</option>');
2187
2195
  _html.push('<option value="8">最近60日</option>');
2188
2196
  _html.push('<option value="9">最近90日</option>');
2189
- _html.push('<option value="10">半年前</option>');
2190
- _html.push('<option value="11">一年前</option>');
2197
+ _html.push('<option value="10">最近半年</option>');
2198
+ _html.push('<option value="11">最近一年</option>');
2191
2199
  _html.push('<option value="99">所有时间</option>');
2192
2200
  _html.push('<option value="100">还原</option>');
2193
2201
  _html.push('<option value="101">置空</option>');
@@ -2254,12 +2262,12 @@ const Util = {
2254
2262
  sd_obj.val(Util.seconds_to_format(pre_90day_second, "%Y-%m-%d"));
2255
2263
  ed_obj.val(Util.seconds_to_format(midnight_second, "%Y-%m-%d"));
2256
2264
  break;
2257
- case "10": // 半年前
2265
+ case "10": // 最近半年
2258
2266
  let pre_half_year_second = midnight_second - (365 / 2) * Util.one_day_second;
2259
2267
  sd_obj.val(Util.seconds_to_format(pre_half_year_second, "%Y-%m-%d"));
2260
2268
  ed_obj.val(Util.seconds_to_format(midnight_second, "%Y-%m-%d"));
2261
2269
  break;
2262
- case "11": // 一年前
2270
+ case "11": // 最近一年
2263
2271
  let pre_one_year_second = midnight_second - 365 * Util.one_day_second;
2264
2272
  sd_obj.val(Util.seconds_to_format(pre_one_year_second, "%Y-%m-%d"));
2265
2273
  ed_obj.val(Util.seconds_to_format(midnight_second, "%Y-%m-%d"));