You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

list.vue 7.2 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <template>
  2. <view class="page">
  3. <div class="timeTable_sec1">
  4. <div class="tSec1Box" id="semester">
  5. <image src="~@/common/images/timeT1-1.png" mode="widthFix"></image>
  6. <span>2019年上半学期</span>
  7. </div>
  8. <view class="tSec1Box" id="weekTime">
  9. <text class="text-xxl cuIcon cuIcon-back" @click="timeTap(1)"></text>
  10. <text>{{ todayWeek.Monday }}</text>
  11. -
  12. <text>{{ todayWeek.Sunday }}</text>
  13. <text class="text-xxl cuIcon cuIcon-right" @click="timeTap(2)"></text>
  14. </view>
  15. </div>
  16. <div class="timeTable_sec2">
  17. <view class="tSec2Top">
  18. <view class="tSec2TopLi" v-for="(item, ind) in weekArr" :key="item.en" @click="liTap(ind)" :class="ind == num ? 'active' : ''">
  19. <text>{{ item.en }}</text>
  20. <text>{{ item.cn }}</text>
  21. </view>
  22. </view>
  23. <div class="tSec2Box">
  24. <view class="tSec2Con" v-for="(items, i) in dataArr" :key="items.num" v-show="i == num">
  25. <view class="tSec2List">
  26. <view v-if="items.lessonData.length <= 0" class="tSec2ListLi">
  27. <view class="noHtml">该时间段没有考试</view>
  28. </view>
  29. <view v-if="items.lessonData.length > 0">
  30. <view class="tSec2ListLi" v-for="(k, j) in items.lessonData" :key="j">
  31. <view class="tSec2ListL">第 {{ k.sectionTime }} 节</view>
  32. <view class="tSec2ListR">
  33. <view class="tSec2ListBox">
  34. <view class="tSec2ListT">{{ k.LessonName }}</view>
  35. <view class="tSec2ListT">{{ k.ClassName }}</view>
  36. <view class="tSec2ListTxt">
  37. <text class="text-xxl cuIcon cuIcon-profile"></text>
  38. {{ k.EmpName }}
  39. </view>
  40. </view>
  41. <view class="tSec2Location">
  42. <text class="text-xxl cuIcon cuIcon-location"></text>
  43. {{ k.ClassroomName }}
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. </div>
  51. </div>
  52. </view>
  53. </template>
  54. <script>
  55. import common from '@/common/js/common.js';
  56. export default {
  57. data() {
  58. return {
  59. semester: '',
  60. num: 0,
  61. user: null,
  62. weekDayTime: 0,
  63. todayWeek: {},
  64. dataArr: [],
  65. weekArr: [
  66. {
  67. en: 'MON',
  68. cn: '星期一'
  69. },
  70. {
  71. en: 'TUE',
  72. cn: '星期二'
  73. },
  74. {
  75. en: 'WED',
  76. cn: '星期三'
  77. },
  78. {
  79. en: 'THU',
  80. cn: '星期四'
  81. },
  82. {
  83. en: 'FRI',
  84. cn: '星期五'
  85. },
  86. {
  87. en: 'SAT',
  88. cn: '星期六'
  89. },
  90. {
  91. en: 'SUN',
  92. cn: '星期日'
  93. }
  94. ]
  95. };
  96. },
  97. methods: {
  98. init() {
  99. let _this = this;
  100. _this.todayWeek = common.weekday();
  101. _this.semester = common.judgeDate();
  102. _this.weekDayTime = 7 * common.oneDayTime();
  103. _this.user = _this.GET_GLOBAL('loginUser');
  104. _this.loadData(_this.todayWeek.Monday, _this.todayWeek.Sunday);
  105. },
  106. loadData(start, end) {
  107. let param = { startTime: start, endTime: end };
  108. // let param = { StartDate: '2018-11-05', EndDate: '2018-11-11' };
  109. let _this = this;
  110. _this.LOADING('加载数据中…');
  111. _this.HTTP_GET('arrangeExam/list', param, '加载数据时出错').then(res => {
  112. this.HIDE_LOADING();
  113. console.log(res);
  114. _this.ProcessingData(res);
  115. });
  116. },
  117. liTap(ind) {
  118. this.num = ind;
  119. },
  120. timeTap(num) {
  121. let _this = this;
  122. if (num == 1) {
  123. _this.todayWeek.MondayTime = _this.todayWeek.MondayTime - _this.weekDayTime;
  124. _this.todayWeek.SundayTime = _this.todayWeek.SundayTime - _this.weekDayTime;
  125. } else {
  126. _this.todayWeek.MondayTime = _this.todayWeek.MondayTime + _this.weekDayTime;
  127. _this.todayWeek.SundayTime = _this.todayWeek.SundayTime + _this.weekDayTime;
  128. }
  129. _this.num = 0;
  130. _this.todayWeek.Monday = common.fmtDate(_this.todayWeek.MondayTime);
  131. _this.todayWeek.Sunday = common.fmtDate(_this.todayWeek.SundayTime);
  132. _this.semester = common.judgeDate(_this.todayWeek.SundayTime);
  133. _this.loadData(_this.todayWeek.Monday, _this.todayWeek.Sunday);
  134. },
  135. ProcessingData(data) {
  136. let dataM = [
  137. {
  138. weekTime: 1,
  139. num: Math.floor(Math.random() * 100000000),
  140. lessonData: []
  141. },
  142. {
  143. weekTime: 2,
  144. num: Math.floor(Math.random() * 100000000),
  145. lessonData: []
  146. },
  147. {
  148. weekTime: 3,
  149. num: Math.floor(Math.random() * 100000000),
  150. lessonData: []
  151. },
  152. {
  153. weekTime: 4,
  154. num: Math.floor(Math.random() * 100000000),
  155. lessonData: []
  156. },
  157. {
  158. weekTime: 5,
  159. num: Math.floor(Math.random() * 100000000),
  160. lessonData: []
  161. },
  162. {
  163. weekTime: 6,
  164. num: Math.floor(Math.random() * 100000000),
  165. lessonData: []
  166. },
  167. {
  168. weekTime: 7,
  169. num: Math.floor(Math.random() * 100000000),
  170. lessonData: []
  171. }
  172. ];
  173. data.forEach((n, i) => {
  174. n.sectionTime = n.LessonTime.slice(1);
  175. dataM.forEach((k, j) => {
  176. if (k.weekTime == n.LessonTime.slice(0, 1)) {
  177. k.lessonData.push(n);
  178. }
  179. });
  180. });
  181. dataM.forEach((n, i) => {
  182. n.lessonData.sort(common.compare('sectionTime'));
  183. });
  184. this.dataArr = dataM;
  185. }
  186. },
  187. created() {
  188. this.init();
  189. }
  190. };
  191. </script>
  192. <style lang="less" scoped>
  193. .page {
  194. background: #fff;
  195. }
  196. .timeTable_sec1 {
  197. padding: 14px 12px;
  198. text-align: center;
  199. background: #0075c4;
  200. color: #94d4ff;
  201. font-size: 0;
  202. }
  203. .tSec1Box > * {
  204. display: inline-block;
  205. vertical-align: middle;
  206. }
  207. .tSec1Line {
  208. height: 13px;
  209. width: 1px;
  210. background: #94d4ff;
  211. margin: 0 10px;
  212. }
  213. .tSec1Box {
  214. font-size: 15px;
  215. overflow: hidden;
  216. white-space: nowrap;
  217. text-overflow: ellipsis;
  218. }
  219. #semester {
  220. margin-bottom: 10px;
  221. }
  222. #weekTime {
  223. }
  224. #weekTime text {
  225. margin: 0 10px;
  226. }
  227. .tSec1Box > text {
  228. width: auto;
  229. text-align: center;
  230. line-height: 22px;
  231. }
  232. .tSec1Box image {
  233. width: 15px;
  234. margin-right: 2px;
  235. }
  236. .tSec1Box text:after {
  237. display: none;
  238. }
  239. .timeTable_sec2 {
  240. margin-bottom: 30px;
  241. }
  242. .tSec2Top {
  243. padding: 0 12px;
  244. background: #0075c4;
  245. height: 55px;
  246. text-align: center;
  247. overflow: hidden;
  248. }
  249. .tSec2TopLi {
  250. width: 14.285714%;
  251. float: left;
  252. line-height: 18px;
  253. padding: 9px 0 9px;
  254. color: #fff;
  255. font-size: 13px;
  256. border-right: 1px solid #1084d2;
  257. border-top: 1px solid #1084d2;
  258. }
  259. .tSec2TopLi:first-child {
  260. border-left: 1px solid #1084d2;
  261. }
  262. .tSec2TopLi.active {
  263. color: #0075c4;
  264. background: #fff;
  265. border-color: #fff;
  266. }
  267. .tSec2TopLi text {
  268. display: block;
  269. }
  270. .tSec2TopLi text:first-child {
  271. letter-spacing: 2px;
  272. text-transform: uppercase;
  273. }
  274. .tSec2Box {
  275. padding: 0 12px 10px;
  276. margin-top: 10px;
  277. }
  278. .tSec2Con {
  279. border-left: 1px solid #d5eaf7;
  280. border-right: 1px solid #d5eaf7;
  281. border-top: 1px solid #d5eaf7;
  282. // display: none;
  283. }
  284. .tSec2Con:first-child {
  285. display: block;
  286. }
  287. .tSec2List {
  288. margin-top: 10px;
  289. }
  290. .tSec2List:first-child {
  291. margin-top: 0;
  292. }
  293. .tSec2ListLi {
  294. border-bottom: 1px solid #d5eaf7;
  295. overflow: hidden;
  296. height: 80px;
  297. }
  298. .tSec2ListL {
  299. float: left;
  300. background: #e8f6ff;
  301. height: 100%;
  302. width: 25%;
  303. text-align: center;
  304. line-height: 36px;
  305. padding: 11px 0;
  306. font-size: 14px;
  307. color: #646464;
  308. }
  309. .tSec2ListR {
  310. float: left;
  311. width: 75%;
  312. height: 100%;
  313. line-height: 18px;
  314. padding: 4px 0;
  315. overflow: hidden;
  316. }
  317. .tSec2ListBox {
  318. width: 70%;
  319. float: left;
  320. padding-left: 5px;
  321. }
  322. .tSec2ListT {
  323. color: #3e3e3e;
  324. font-size: 15px;
  325. margin: 5px 0;
  326. overflow: hidden;
  327. white-space: nowrap;
  328. text-overflow: ellipsis;
  329. }
  330. .tSec2ListTxt {
  331. color: #888888;
  332. font-size: 13px;
  333. }
  334. .tSec2Location {
  335. width: 30%;
  336. float: left;
  337. line-height: 44px;
  338. font-size: 13px;
  339. color: #888888;
  340. }
  341. .noHtml {
  342. height: 100%;
  343. line-height: 60px;
  344. text-align: center;
  345. font-size: 14px;
  346. }
  347. </style>