sbd-npm 1.4.30 → 1.4.32

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/status.js +27 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.4.30",
3
+ "version": "1.4.32",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/status.js CHANGED
@@ -430,7 +430,8 @@ $(function () {
430
430
  $("#task_div").html(ht_html.join(""));
431
431
  $("#task_add").click(function() {
432
432
  let task_content = $("#task_content").val();
433
- if (task_content) {
433
+ task_content = task_content.replace(/\s+/g, '');
434
+ if (task_content && task_content.length > 0) {
434
435
  $("#task_content").prop('disabled', true);
435
436
  $("#task_add").prop('disabled', true);
436
437
  Util.show_loading();
@@ -637,14 +638,19 @@ $(function () {
637
638
  },
638
639
 
639
640
  handle_word: function() {
641
+ let is_init = 0;
640
642
  if (!document.getElementById("word_process_div")) {
643
+ is_init = 1;
641
644
  let word_html = [];
642
645
  if (Util.is_mobile()) {
643
646
  word_html.push('<form class="form-inline" style="margin-bottom: 5px;">');
644
647
  } else {
645
648
  word_html.push('<form class="form-inline">');
646
649
  }
647
- word_html.push('<a href="#" data-toggle="modal" data-target=".word_modal" id="word_random" class="btn btn-warning">RANDOM</a>');
650
+ word_html.push('<div class="form-group">');
651
+ word_html.push('<select id="word_day_num" class="form-control"><option value="">Loading...</option></select>');
652
+ word_html.push('</div>');
653
+ word_html.push('&nbsp;<a href="#" data-toggle="modal" data-target=".word_modal" id="word_random" class="btn btn-warning">RANDOM</a>');
648
654
  word_html.push('</form>');
649
655
  word_html.push('<div id="word_process_div"></div>');
650
656
  $("#word_div").html(word_html.join(""));
@@ -661,7 +667,12 @@ $(function () {
661
667
  });
662
668
  Status.init_word_modal();
663
669
  }
664
- Util.post(location.pathname, {active_div: localStorage[Status.tab_token]}, function (j) {
670
+ Status.fetch_word_data(is_init, "");
671
+ },
672
+
673
+ fetch_word_data: function(is_init, day) {
674
+ Util.show_loading();
675
+ Util.post(location.pathname, {active_div: localStorage[Status.tab_token], is_init: is_init, day: day}, function (j) {
665
676
  let html = [], index = 0;
666
677
  let is_mobile = Util.is_mobile();
667
678
  j["data"].forEach(function (item) {
@@ -680,6 +691,19 @@ $(function () {
680
691
  });
681
692
  Util.render_table_html("word_process_div_body", html);
682
693
  $("#word_num").html("共 <span class='label label-info'>" + index + "</span> 条");
694
+ if (j["day_num"]) {
695
+ let day_num_html = [];
696
+ day_num_html.push('<option value="">全部</option>');
697
+ j["day_num"].forEach(function (item) {
698
+ day_num_html.push('<option value="', item["day"], '">', item["day"], '(', item["num"], ')</option>');
699
+ });
700
+ let wdn_obj = $("#word_day_num");
701
+ wdn_obj.html(day_num_html.join(""));
702
+ wdn_obj.change(function() {
703
+ let day = $("#word_day_num").val();
704
+ Status.fetch_word_data(0, day);
705
+ });
706
+ }
683
707
  $(".word_del").each(function () {
684
708
  $(this).click(function () {
685
709
  let tr_obj = $(this).parent().parent();