sbd-npm 1.2.24 → 1.2.25
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/.npmignore +1 -0
- package/package.json +1 -1
- package/util.js +7 -3
package/.npmignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
sbd-npm.md
|
package/package.json
CHANGED
package/util.js
CHANGED
@@ -1279,16 +1279,20 @@ const Util = {
|
|
1279
1279
|
/**
|
1280
1280
|
* 初始指数组件
|
1281
1281
|
* @param component_id
|
1282
|
-
* @param index_type 0
|
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>');
|