sbd-npm 1.2.53 → 1.2.54

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 (3) hide show
  1. package/package.json +1 -1
  2. package/util.js +25 -7
  3. package/.npmignore +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.2.53",
3
+ "version": "1.2.54",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/util.js CHANGED
@@ -331,13 +331,15 @@ const Util = {
331
331
  */
332
332
  get_code_list: function (element_id) {
333
333
  let code_list = [];
334
- $("#" + element_id).find(".code_item").each(function () {
335
- let code = $(this).text();
336
- if (/^HK[0-9]+$/.test(code.toUpperCase())) {
337
- code = code.replace(/[^0-9]/ig, "");
338
- }
339
- code_list.push(code);
340
- });
334
+ if (element_id.length > 0) {
335
+ $("#" + element_id).find(".code_item").each(function () {
336
+ let code = $(this).text();
337
+ if (/^HK[0-9]+$/.test(code.toUpperCase())) {
338
+ code = code.replace(/[^0-9]/ig, "");
339
+ }
340
+ code_list.push(code);
341
+ });
342
+ }
341
343
  return code_list;
342
344
  },
343
345
 
@@ -877,6 +879,22 @@ const Util = {
877
879
  });
878
880
  },
879
881
 
882
+ /**
883
+ * 板块个股数量数据
884
+ * @param code_zone_id
885
+ * @param classify_id
886
+ * @param callback_func
887
+ */
888
+ fetch_classify_num: function (code_zone_id, classify_id, callback_func) {
889
+ let code_list = Util.get_code_list(code_zone_id);
890
+ code_list = code_list.length > 0 ? code_list.join("-") : "all";
891
+ Util.post("/action", {action: "classify_num", code_list: code_list}, function (j) {
892
+ if (j["data"]) {
893
+ Util.render_classify_html(classify_id, j["data"], callback_func);
894
+ }
895
+ });
896
+ },
897
+
880
898
  /**
881
899
  * 初始分类股票的显示表格
882
900
  * @param stock_category
package/.npmignore DELETED
@@ -1 +0,0 @@
1
- sbd-npm.md