sbd-npm 1.2.44 → 1.2.46

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/constant.js +3 -2
  2. package/package.json +1 -1
  3. package/util.js +20 -20
package/constant.js CHANGED
@@ -212,8 +212,8 @@ const MenuList = [
212
212
  {'key': 'rank_profit', 'name': '净利润/营业收入', 'url': '/90ee0f9bcf37d965d0f894c6bd6be788'},
213
213
  {'key': 'rank_roe', 'name': 'ROE(净资产收益率)', 'url': '/575707ea27d7de73d5467660b9181606'},
214
214
  {'key': 'rank_dividend', 'name': '股息', 'url': '/83070c336bee9b99bd4f9ad54963f9ef'},
215
- {'key': 'rank_circulation_stock', 'name': '流通股比例', 'url': '/212721244ee3f9bab3ea2275f6f25272'},
216
- {'key': 'rank_holder', 'name': '股东比', 'url': '/5f09520c907774de4e1dfcf78e7f45b8'},
215
+ {'key': 'rank_circulation_stock', 'name': '流通股份', 'url': '/212721244ee3f9bab3ea2275f6f25272'},
216
+ {'key': 'rank_holder', 'name': '股东户数', 'url': '/5f09520c907774de4e1dfcf78e7f45b8'},
217
217
  {'key': 'rank_goodwill', 'name': '商誉占比', 'url': '/81e1e604b6fd26be1ab3f496e5edd742'},
218
218
  ]
219
219
  },
@@ -264,6 +264,7 @@ const IndexList = [
264
264
  {'code': 'SH000906', 'name': '中证800', 'is_industry': 1, 'is_key': 1},
265
265
  {'code': 'SH000852', 'name': '中证1000', 'is_industry': 1, 'is_key': 1},
266
266
  {'code': 'SZ399303', 'name': '国证2000', 'is_industry': 0, 'is_key': 1},
267
+ {'code': 'SZ399959', 'name': '军工指数', 'is_industry': 0, 'is_key': 0},
267
268
  {'code': 'SH000985', 'name': '中证全指', 'is_industry': 0, 'is_key': 0},
268
269
  {'code': 'SH000922', 'name': '中证红利', 'is_industry': 0, 'is_key': 0},
269
270
  {'code': 'SH000003', 'name': 'B股指数', 'is_industry': 0, 'is_key': 0},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.2.44",
3
+ "version": "1.2.46",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/util.js CHANGED
@@ -254,7 +254,7 @@ const Util = {
254
254
  let name = symbol;
255
255
  if (item["cname"]) {
256
256
  if (Util.is_us(item["code"])) {
257
- name = item["cname"].replace("公司", "");
257
+ name = item["cname"].replace("公司", "").replace("•", "").replace("•", "");
258
258
  } else {
259
259
  name = item["cname"];
260
260
  }
@@ -265,7 +265,7 @@ const Util = {
265
265
  let name_arr = name.split(' ');
266
266
  name = name_arr[0] ? name_arr[0] : name;
267
267
  } else {
268
- name = name.replace("公司", "");
268
+ name = name.replace("公司", "").replace("•", "").replace("•", "");
269
269
  }
270
270
  }
271
271
  name = name.substr(0, 10);
@@ -508,7 +508,7 @@ const Util = {
508
508
  us_logo_html: function (code) {
509
509
  code = code.toUpperCase();
510
510
  let logo_url = "https://storage.googleapis.com/iex/api/logos/" + code + ".png";
511
- return '<a rel="noopener noreferrer nofollow" href="' + logo_url + '" target="_blank"><img alt="' + code + '" width="20px" src="' + logo_url + '"/><a>';
511
+ return '<a rel="noopener noreferrer nofollow" href="' + logo_url + '" target="_blank"><img alt="' + code + '" width="20px" src="' + logo_url + '"/></a>';
512
512
  },
513
513
 
514
514
  /**
@@ -1342,6 +1342,23 @@ const Util = {
1342
1342
  $("#" + component_id).html(html.join(""));
1343
1343
  },
1344
1344
 
1345
+ /**
1346
+ * 初始 select 组件
1347
+ * @param component_id
1348
+ * @param data
1349
+ */
1350
+ init_select_component: function (component_id, data) {
1351
+ let element_id = component_id.replace("_div", "");
1352
+ let html = [];
1353
+ html.push('<label for="', element_id, '"></label>');
1354
+ html.push('<select id="', element_id, '" class="form-control">');
1355
+ data.forEach(function (item) {
1356
+ html.push('<option value="', item["val"], '">', item["name"], '</option>');
1357
+ });
1358
+ html.push('</select>');
1359
+ $("#" + component_id).html(html.join(""));
1360
+ },
1361
+
1345
1362
  /**
1346
1363
  * 当前时间戳
1347
1364
  * @returns {number}
@@ -2469,23 +2486,6 @@ const Util = {
2469
2486
  }
2470
2487
  },
2471
2488
 
2472
- /**
2473
- * 获取股东数据
2474
- * @param element_id
2475
- */
2476
- fetch_holder_num: function (element_id) {
2477
- let code_list = Util.get_code_list(element_id);
2478
- if (code_list.length > 0) {
2479
- Util.post("/action", {action: "holder_num", code_list: code_list.join("-")}, function (j) {
2480
- $.each(j, function (code, item) {
2481
- $(".holder_" + code).each(function () {
2482
- $(this).html(Util.pack_holder_num(item));
2483
- });
2484
- });
2485
- });
2486
- }
2487
- },
2488
-
2489
2489
  /**
2490
2490
  * 设置 option 的第 nth 项为默认项
2491
2491
  * @param obj