sbd-npm 1.1.56 → 1.1.57

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 +13 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.1.56",
3
+ "version": "1.1.57",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/util.js CHANGED
@@ -639,6 +639,11 @@ const Util = {
639
639
  let is_table_sort = 0;
640
640
  let is_tooltip = 0;
641
641
  let _html = [];
642
+ if (options["alert"]) {
643
+ _html.push('<div class="alert alert-info" role="alert">');
644
+ _html.push(options["alert"]);
645
+ _html.push('</div>');
646
+ }
642
647
  let table_class = options["table_class"] ? options["table_class"] : "table table-bordered table-hover table-striped text-center";
643
648
  _html.push('<table class="' + table_class + '">');
644
649
  if (options["caption"]) {
@@ -781,8 +786,9 @@ const Util = {
781
786
  * 初始分类股票的显示表格
782
787
  * @param stock_category
783
788
  * @param table_id
789
+ * @param alert_tips
784
790
  */
785
- init_stock_category_data: function (stock_category, table_id) {
791
+ init_stock_category_data: function (stock_category, table_id, alert_tips = "") {
786
792
  Util.show_tips("Loading...");
787
793
  let head_cols = [
788
794
  {"name": "代码"},
@@ -803,11 +809,15 @@ const Util = {
803
809
  head_cols.push({"name": "股东数", "table_sort": 1});
804
810
  head_cols.push({"name": "备注", "id": "remark_title"});
805
811
  }
806
- Util.init_table_skeleton({
812
+ let table_options = {
807
813
  "element_id": table_id,
808
814
  "caption": '<caption><span id="index_data"></span><div class="pull-right" id="' + table_id + '_body_tips"></div></caption>',
809
815
  "head_cols": head_cols
810
- });
816
+ };
817
+ if (alert_tips.length > 0) {
818
+ table_options["alert"] = alert_tips;
819
+ }
820
+ Util.init_table_skeleton(table_options);
811
821
  Util.post(location.pathname, {active_div: stock_category}, function (j) {
812
822
  let _html = [];
813
823
  let total_num = 0;