Vacity 7 gadi atpakaļ
vecāks
revīzija
54e0bf189d

+ 13 - 5
src/main/resources/static/js/adminCinemaStatistic.js

@@ -8,12 +8,20 @@ $(document).ready(function() {
         getRequest(
             '/statistics/scheduleRate',
             function (res) {
-                var data = res.content;
-                console.log(data);
+                var data = res.content||[];
+                var tableData = data.map(function (item) {
+                   return {
+                       value: item.time,
+                       name: item.name
+                   };
+                });
+                var nameList = data.map(function (item) {
+                    return item.name;
+                });
                 var option = {
                     title : {
-                        text: '南丁格尔玫瑰图',
-                        subtext: '纯属虚构',
+                        text: '今日排片率',
+                        subtext: new Date().toLocaleDateString(),
                         x:'center'
                     },
                     tooltip : {
@@ -44,7 +52,7 @@ $(document).ready(function() {
                             name:'面积模式',
                             type:'pie',
                             radius : [30, 110],
-                            center : ['75%', '50%'],
+                            center : ['50%', '50%'],
                             roseType : 'area',
                             data:[
                                 {value:10, name:'rose1'},

+ 8 - 5
src/main/resources/static/js/adminScheduleManage.js

@@ -1,12 +1,11 @@
 var colors = [
     '#FF6666',
-    '#FFFF33',
+    '#3399FF',
     '#FF9933',
     '#66cccc',
     '#FFCCCC',
-    '#3399FF',
     '#9966FF',
-
+    'steelblue'
 ];
 
 function formatDate(date){
@@ -155,8 +154,12 @@ $(document).ready(function() {
             '/schedule/add',
             form,
             function (res) {
-                getSchedules();
-                $("#scheduleModal").modal('hide');
+                if(res.success){
+                    getSchedules();
+                    $("#scheduleModal").modal('hide');
+                } else {
+                    alert(res.message);
+                }
             },
             function (error) {
                 alert(JSON.stringify(error));