HomeworkTotally.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <!-- 活动解析 -->
  2. <template>
  3. <div>
  4. <!-- table 表格 -->
  5. <el-row :gutter="20" class="main-items">
  6. <el-col :span="20" class="main" :offset="2">
  7. <el-row>
  8. <el-col :span="20" class :offset="2">
  9. <h5 class="tiplog">作业统计表</h5>
  10. </el-col>
  11. <el-col :span="16" class :offset="4">
  12. <div class="block clickTime">
  13. <span class="demonstration">选择时间</span>
  14. <el-date-picker
  15. @change="FindSubjectChartsInfo"
  16. v-model="Timevalue"
  17. type="daterange"
  18. range-separator="至"
  19. start-placeholder="开始日期"
  20. end-placeholder="结束日期"
  21. value-format="yyyy-MM-dd"
  22. align="right"
  23. :picker-options="pickerOptions0"
  24. ></el-date-picker>
  25. </div>
  26. </el-col>
  27. </el-row>
  28. <el-row>
  29. <!-- {{AllFindSubjectEngCharts}} -->
  30. <!-- <el-col class="chartdiv" v-if="AllFindSubjectEngCharts.length >= 1"> -->
  31. <HomeworkTotalList :chartData="chartData1"></HomeworkTotalList>
  32. <!-- </el-col> -->
  33. <!-- <el-col class="chartdiv" v-if="AllFindSubjectEngCharts.length >= 2"> -->
  34. <HomeworkTotalList :chartData="chartData2"></HomeworkTotalList>
  35. <!-- </el-col> -->
  36. <!-- <el-col class="chartdiv" v-if="AllFindSubjectEngCharts.length >= 3"> -->
  37. <HomeworkTotalList :chartData="chartData3"></HomeworkTotalList>
  38. <!-- </el-col> -->
  39. <el-col class="chartdiv" v-if="AllFindSubjectEngCharts.length <= 0">
  40. <div>
  41. <img src="../../assets/img/SEARCH (1).png" alt />
  42. <div style="display:block; margin-top:20px;">暂无数据!</div>
  43. </div>
  44. </el-col>
  45. </el-row>
  46. </el-col>
  47. </el-row>
  48. </div>
  49. </template>
  50. <script>
  51. import { mapGetters, mapActions } from "vuex";
  52. import HomeworkTotalList from "@/components/HomeworkTotalList";
  53. import { IMG_BASE_URL } from "@/ImgConfig";
  54. export default {
  55. components: {
  56. HomeworkTotalList
  57. },
  58. name: "actvResolveLabel",
  59. props: {},
  60. data() {
  61. return {
  62. chartData1: {},
  63. chartData2: {},
  64. chartData3: {},
  65. pickerOptions0: {
  66. disabledDate(time) {
  67. return time.getTime() > Date.now() - 8.64e6
  68. }
  69. },
  70. Timevalue: "",
  71. startTime: "",
  72. endTime: ""
  73. // Timevalue: ""
  74. };
  75. },
  76. created() {
  77. this.getNowFormatDate(); //获取随机id
  78. },
  79. methods: {
  80. // 数据列表
  81. async FindSubjectChartsInfo() {
  82. let arr = this.Timevalue;
  83. if (this.Timevalue.length > 0) {
  84. for (let i = 0; i < arr.length; i++) {
  85. this.startTime = arr[0];
  86. this.endTime = arr[1];
  87. }
  88. }
  89. this.$store.dispatch("FindSubjectChartsLists", {
  90. startTime: this.startTime,
  91. endTime: this.endTime
  92. });
  93. console.log(this.startTime);
  94. console.log(this.endTime);
  95. },
  96. //获取当前时间,格式YYYY-MM-DD
  97. getNowFormatDate() {
  98. var date = new Date();
  99. var seperator1 = "-";
  100. var year = date.getFullYear();
  101. var month = date.getMonth() + 1;
  102. var strDate = date.getDate();
  103. if (month >= 1 && month <= 9) {
  104. month = "0" + month;
  105. }
  106. if (strDate >= 0 && strDate <= 9) {
  107. strDate = "0" + strDate;
  108. }
  109. var currentdate = year + seperator1 + month + seperator1 + strDate;
  110. this.startTime = currentdate
  111. this.endTime = currentdate
  112. console.log(this.startTime)
  113. console.log(this.endTime)
  114. console.log(currentdate)
  115. }
  116. },
  117. watch: {
  118. FindSubjectCharts: {
  119. handler: function(val, oldVal) {
  120. this.chartData1 = val;
  121. },
  122. deep: true
  123. },
  124. FindSubjectmathCharts: {
  125. handler: function(val, oldVal) {
  126. this.chartData2 = val;
  127. },
  128. deep: true
  129. },
  130. FindSubjectEngCharts: {
  131. handler: function(val, oldVal) {
  132. this.chartData3 = val;
  133. },
  134. deep: true
  135. }
  136. },
  137. mounted() {
  138. this.FindSubjectChartsInfo();
  139. },
  140. computed: {
  141. ...mapGetters([
  142. "FindSubjectCharts",
  143. "FindSubjectmathCharts",
  144. "FindSubjectEngCharts",
  145. "AllFindSubjectEngCharts"
  146. ])
  147. }
  148. };
  149. </script>
  150. <!-- Add "scoped" attribute to limit CSS to this component only -->
  151. <style scoped>
  152. .main {
  153. background-color: #fff;
  154. margin-top: 16px;
  155. padding: 0 !important;
  156. border: 1px solid #e1e1e1;
  157. min-height: 980px;
  158. }
  159. el-table {
  160. color: #999999;
  161. font-size: 18px;
  162. }
  163. .tiplog {
  164. font-size: 30px;
  165. text-align: center;
  166. margin-top: 100px;
  167. font-weight: 700;
  168. }
  169. .el-date-editor--daterange.el-input,
  170. .el-date-editor--daterange.el-input__inner,
  171. .el-date-editor--timerange.el-input,
  172. .el-date-editor--timerange.el-input__inner {
  173. width: 35%;
  174. height: 30%;
  175. font-size: 12px;
  176. border-radius: 15px;
  177. text-align: center;
  178. }
  179. .chartdiv {
  180. margin: 100px 0;
  181. }
  182. .block {
  183. margin-top: 40px;
  184. }
  185. .clickTime{
  186. text-align:left;
  187. }
  188. </style>