sbd-npm 1.2.24 → 1.2.27

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/sbd.css +4 -0
  3. package/util.js +8 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.2.24",
3
+ "version": "1.2.27",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/sbd.css CHANGED
@@ -16,6 +16,10 @@ th {
16
16
  display: none;
17
17
  }
18
18
 
19
+ .form-control-static span {
20
+ color: #BDBDBD;
21
+ }
22
+
19
23
  .form-control:hover, .form-control:focus {
20
24
  border-color: #5BC0DE;
21
25
  }
package/util.js CHANGED
@@ -1279,16 +1279,20 @@ const Util = {
1279
1279
  /**
1280
1280
  * 初始指数组件
1281
1281
  * @param component_id
1282
- * @param index_type 0全部1行业2KEY
1282
+ * @param index_type 0全部、1行业、2KEY
1283
+ * @param is_select 是否设默认选项
1283
1284
  */
1284
- init_index_code_component: function (component_id, index_type = 0) {
1285
+ init_index_code_component: function (component_id, index_type = 0, is_select = 1) {
1285
1286
  let element_id = component_id.replace("_div", "");
1286
1287
  let html = [];
1287
1288
  html.push('<label for="', element_id, '"></label>');
1288
1289
  html.push('<select id="', element_id, '" class="form-control">');
1290
+ if (is_select !== 1) {
1291
+ html.push('<option value="">指数</option>');
1292
+ }
1289
1293
  IndexList.forEach(function (item) {
1290
1294
  if (index_type === 0 || (index_type === 1 && item["is_industry"] === 1) || (index_type === 2 && item["is_key"] === 1)) {
1291
- html.push('<option ', (item["code"] === "SH000906" ? "selected" : ""), ' value="', item["code"], '">', item["name"], '</option>');
1295
+ html.push('<option ', ((item["code"] === "SH000906" && is_select === 1) ? "selected" : ""), ' value="', item["code"], '">', item["name"], '</option>');
1292
1296
  }
1293
1297
  });
1294
1298
  html.push('</select>');
@@ -2454,8 +2458,8 @@ const Util = {
2454
2458
  let end_id = prefix + "_end_date";
2455
2459
  let nth_day = 0;
2456
2460
  if (!Util.regexp_date_yyyy_mm_dd(start_date)) {
2457
- start_date = "";
2458
2461
  nth_day = start_date;
2462
+ start_date = "";
2459
2463
  }
2460
2464
  if (!Util.regexp_date_yyyy_mm_dd(end_date)) {
2461
2465
  end_date = "";