sbd-npm 1.2.20 → 1.2.21

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 (2) hide show
  1. package/package.json +1 -1
  2. package/util.js +19 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.2.20",
3
+ "version": "1.2.21",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/util.js CHANGED
@@ -1276,6 +1276,25 @@ const Util = {
1276
1276
  $("#" + component_id).html(html.join(""));
1277
1277
  },
1278
1278
 
1279
+ /**
1280
+ * 初始指数组件
1281
+ * @param component_id
1282
+ * @param is_industry
1283
+ */
1284
+ init_index_code_component: function (component_id, is_industry = 0) {
1285
+ let element_id = component_id.replace("_div", "");
1286
+ let html = [];
1287
+ html.push('<label for="', element_id, '"></label>');
1288
+ html.push('<select id="', element_id, '" class="form-control">');
1289
+ IndexList.forEach(function (item) {
1290
+ if (is_industry === 0 || (is_industry === 1 && item["is_industry"] === 1)) {
1291
+ html.push('<option ', (item["code"] === "SH000906" ? "selected" : ""), ' value="', item["code"], '">', item["name"], '</option>');
1292
+ }
1293
+ });
1294
+ html.push('</select>');
1295
+ $("#" + component_id).html(html.join(""));
1296
+ },
1297
+
1279
1298
  /**
1280
1299
  * 当前时间戳
1281
1300
  * @returns {number}