worksGM.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. <template>
  2. <div
  3. class="pb_content"
  4. style="
  5. background: unset;
  6. overflow: auto;
  7. padding: 20px;
  8. margin: 0;
  9. box-sizing: border-box;
  10. "
  11. >
  12. <div
  13. style="
  14. position: absolute;
  15. width: 95%;
  16. top: 0;
  17. height: 100%;
  18. overflow: auto;
  19. left: 50%;
  20. transform: translateX(-50%);
  21. "
  22. >
  23. <div
  24. class="pb_content_body"
  25. style="
  26. background: #fff;
  27. padding: 0px 25px;
  28. box-sizing: border-box;
  29. margin: 10px auto 0;
  30. "
  31. >
  32. <div class="pb_head">
  33. <span>评价管理</span>
  34. <!-- <span>备注:教师可以根据课程、班级条件筛选学生并查看该学生信息</span> -->
  35. <span
  36. @click="
  37. goTo('/courseGM?userid=' + userid + '&oid=' + oid + '&org=' + org)
  38. "
  39. >项目管理</span
  40. >
  41. </div>
  42. <div class="student_head">
  43. <div class="student_search">
  44. <div>项目筛选</div>
  45. <el-select v-model="groupA" @change="search">
  46. <el-option value="0" label="我的课程"></el-option>
  47. <el-option value="1" label="他人课程"></el-option>
  48. </el-select>
  49. <el-input
  50. v-model="cn"
  51. placeholder="筛选项目名称"
  52. @input="search"
  53. ></el-input>
  54. </div>
  55. </div>
  56. </div>
  57. <div class="pb_content_body" style="margin:0px auto">
  58. <div class="student_table">
  59. <el-table
  60. ref="table"
  61. :data="tableData1"
  62. border
  63. :height="tableHeight"
  64. :fit="true"
  65. v-loading="isLoading"
  66. style="width: 100%"
  67. :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
  68. :row-class-name="tableRowClassName"
  69. >
  70. <el-table-column
  71. prop="title"
  72. label="项目"
  73. min-width="30"
  74. align="center"
  75. ></el-table-column>
  76. <el-table-column
  77. prop="uname"
  78. label="创建人"
  79. min-width="30"
  80. align="center"
  81. ></el-table-column>
  82. <el-table-column
  83. prop="time"
  84. label="时间"
  85. min-width="20"
  86. align="center"
  87. ></el-table-column>
  88. <el-table-column label="操作" min-width="30">
  89. <template slot-scope="scope">
  90. <!-- <el-button
  91. type="primary"
  92. size="small"
  93. @click="
  94. goTo(
  95. '/worksDetail?cid=' +
  96. scope.row.courseId +
  97. '&userid=' +
  98. userid +
  99. '&oid=' +
  100. oid
  101. )
  102. "
  103. >查看学生</el-button>-->
  104. <!-- <el-button type="primary" size="small" @click="getWorkData(scope.row)">生成报告</el-button> -->
  105. <el-button
  106. type="primary"
  107. size="small"
  108. class="btnClass"
  109. @click="getWorkData(scope.row)"
  110. >查看课程</el-button
  111. >
  112. <el-button
  113. type="primary"
  114. size="small"
  115. class="btnClass"
  116. @click="getStudnet(scope.row)"
  117. >查看报告</el-button
  118. >
  119. </template>
  120. </el-table-column>
  121. </el-table>
  122. </div>
  123. <div class="student_page">
  124. <el-pagination
  125. background
  126. layout="prev, pager, next"
  127. :page-size="10"
  128. :total="total"
  129. v-if="page"
  130. @current-change="handleCurrentChange"
  131. ></el-pagination>
  132. </div>
  133. </div>
  134. </div>
  135. <!-- <el-dialog
  136. title="查看报告"
  137. :visible.sync="dialogVisible"
  138. :append-to-body="true"
  139. width="750px"
  140. :before-close="handleClose"
  141. class="dialog_diy"
  142. >
  143. <div>
  144. <div class="a_addBox">
  145. <WorkDate :dataJson="dataJson"></WorkDate>
  146. </div>
  147. </div>
  148. <span slot="footer" class="dialog-footer">
  149. <el-button @click="dialogVisible = false">关 闭</el-button>
  150. </span>
  151. </el-dialog>-->
  152. <WorkDate
  153. :dataJson="dataJson"
  154. :uid="userid"
  155. :cid="dataJson.courseId"
  156. :ooid="oid"
  157. v-if="dialogVisible"
  158. class="workdates"
  159. ></WorkDate>
  160. <div class="cancelbox" v-if="dialogVisible">
  161. <el-button @click="dialogVisibleBao = true" type="primary" size="small" class="btnClass"
  162. >自定义导出</el-button
  163. >
  164. <el-button @click="cancel" type="primary" size="small" class="btnClass">返回</el-button>
  165. <!-- <el-button
  166. type="primary"
  167. size="small"
  168. @click="
  169. goTo(
  170. '/worksDetail?cid=' +
  171. dataJson.courseId +
  172. '&userid=' +
  173. userid +
  174. '&oid=' +
  175. oid
  176. )
  177. "
  178. >查看作业</el-button
  179. >-->
  180. </div>
  181. <el-dialog
  182. title="自定义导出报告"
  183. :visible.sync="dialogVisibleBao"
  184. :append-to-body="true"
  185. width="550px"
  186. :before-close="handleClose"
  187. class="dialog_diy r_diy"
  188. >
  189. <div>
  190. <div>
  191. <Report :cid="dataJson.courseId"></Report>
  192. </div>
  193. </div>
  194. <span slot="footer" class="dialog-footer"> </span>
  195. </el-dialog>
  196. <el-dialog
  197. title="选择学生"
  198. :visible.sync="signDialog"
  199. width="500px"
  200. :before-close="handleClose"
  201. class="dialog_diy check_diy"
  202. >
  203. <div>
  204. <div class="student_search" style="margin-bottom: 10px">
  205. <div>筛选</div>
  206. <div style="display: flex; width: 90%">
  207. <el-select
  208. class="r_select"
  209. v-model="uname"
  210. placeholder="请选择学生"
  211. filterable
  212. @change="searchWork2"
  213. >
  214. <el-option label="所有学生" value></el-option>
  215. <el-option
  216. v-for="item in userAarray"
  217. :key="item.userid"
  218. :label="item.username"
  219. :value="item.userid"
  220. ></el-option>
  221. </el-select>
  222. </div>
  223. </div>
  224. <div>
  225. <el-table
  226. v-loading="isLoading2"
  227. ref="table"
  228. :data="res2"
  229. border
  230. :height="400"
  231. :fit="true"
  232. style="width: 100%"
  233. :row-class-name="tableRowClassName"
  234. :header-cell-style="{ background: 'rgb(238,238,238)' }"
  235. >
  236. <el-table-column
  237. prop="sName"
  238. label="姓名"
  239. min-width="20"
  240. ></el-table-column>
  241. <el-table-column label="操作" min-width="20">
  242. <template slot-scope="scope">
  243. <el-button
  244. type="primary"
  245. size="small"
  246. class="btnClass"
  247. @click="getReport(scope.row)"
  248. >查看报告</el-button
  249. >
  250. </template>
  251. </el-table-column>
  252. </el-table>
  253. <div style="margin-top: 10px" class="student_page">
  254. <el-pagination
  255. background
  256. layout="prev, pager, next"
  257. :page-size="10"
  258. :total="total2"
  259. @current-change="handleCurrentChange2"
  260. ></el-pagination>
  261. </div>
  262. </div>
  263. </div>
  264. <span slot="footer" class="dialog-footer">
  265. <el-button @click="signDialog = false" class="cancel_button"
  266. >关闭</el-button
  267. >
  268. </span>
  269. </el-dialog>
  270. <div class="report_box" v-if="reportVisible">
  271. <studentReport
  272. :checkCourse="checkCourse"
  273. :checkStudent="checkStudent"
  274. :oid="oid"
  275. ></studentReport>
  276. </div>
  277. <div class="cancelbox" v-if="reportVisible">
  278. <el-button @click="cancelR" type="primary" size="small" class="btnClass">返回</el-button>
  279. </div>
  280. </div>
  281. </template>
  282. <script>
  283. import WorkDate from "./components/workDataGM";
  284. import Report from "./components/reportGM";
  285. import studentReport from "./components/studentReportGM";
  286. export default {
  287. components: {
  288. WorkDate,
  289. Report,
  290. studentReport,
  291. },
  292. data() {
  293. return {
  294. tableHeight: "500px",
  295. isLoading: false,
  296. formLabelWidth: "100px",
  297. tableData1: [],
  298. subject: "",
  299. sClass: "",
  300. subjectJuri: [],
  301. projectJuri: [],
  302. grade: [],
  303. projectchoose: "",
  304. page: 1,
  305. total: 0,
  306. groupA: "0",
  307. cn: "",
  308. userid: this.$route.query.userid,
  309. org: this.$route.query.org,
  310. oid: this.$route.query.oid,
  311. dialogVisible: false,
  312. dialogVisibleBao: false,
  313. dataJson: {},
  314. signDialog: false,
  315. isLoading2: false,
  316. page2: 1,
  317. total2: 0,
  318. res2: [],
  319. checkCourse: "",
  320. reportVisible: false,
  321. checkStudent: "",
  322. userAarray: [],
  323. uname: "",
  324. };
  325. },
  326. mounted() {
  327. this.$nextTick(function () {
  328. this.tableHeight =
  329. window.innerHeight - this.$refs.table.$el.offsetTop - 200;
  330. if (this.tableHeight <= 530) {
  331. this.tableHeight = 530;
  332. }
  333. // 监听窗口大小变化
  334. let self = this;
  335. window.onresize = function () {
  336. self.tableHeight =
  337. window.innerHeight - self.$refs.table.$el.offsetTop - 200;
  338. if (self.tableHeight <= 530) {
  339. self.tableHeight = 530;
  340. }
  341. };
  342. });
  343. },
  344. methods: {
  345. goTo(path) {
  346. this.$router.push(path);
  347. },
  348. tableRowClassName({ row, rowIndex }) {
  349. if ((rowIndex + 1) % 2 === 0) {
  350. return "even_row";
  351. } else {
  352. return "";
  353. }
  354. },
  355. handleClose(done) {
  356. done();
  357. },
  358. handleCurrentChange(val) {
  359. this.page = val;
  360. this.getProject();
  361. },
  362. handleCurrentChange2(val) {
  363. this.page2 = val;
  364. this.getStudnet();
  365. },
  366. //获取班级列表
  367. getClass() {
  368. this.isLoading = true;
  369. let params = {
  370. cu: "",
  371. cn: this.sClass,
  372. page: this.page,
  373. };
  374. this.ajax
  375. .get(this.$store.state.api + "selectClass", params)
  376. .then((res) => {
  377. this.isLoading = false;
  378. this.grade = res.data[0];
  379. })
  380. .catch((err) => {
  381. this.isLoading = false;
  382. console.error(err);
  383. });
  384. },
  385. getProject() {
  386. this.isLoading = true;
  387. let params = {
  388. type: this.groupA,
  389. uid: this.userid,
  390. oid: this.oid,
  391. cn: this.cn,
  392. page: this.page,
  393. };
  394. this.ajax
  395. .get(this.$store.state.api + "getProject", params)
  396. .then((res) => {
  397. this.isLoading = false;
  398. this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  399. this.tableData1 = res.data[0];
  400. })
  401. .catch((err) => {
  402. this.isLoading = false;
  403. console.error(err);
  404. });
  405. },
  406. search() {
  407. this.page = 1;
  408. this.getProject();
  409. },
  410. getWorkData(res) {
  411. this.dataJson = res;
  412. this.dialogVisible = true;
  413. },
  414. cancel() {
  415. this.dataJson = "";
  416. this.dialogVisible = false;
  417. },
  418. cancelR() {
  419. this.checkStudent = "";
  420. this.reportVisible = false;
  421. this.signDialog = true;
  422. },
  423. searchWork2() {
  424. (this.page2 = 1), this.getStudnet();
  425. },
  426. getStudnet(row) {
  427. //获取作业
  428. this.signDialog = true;
  429. this.isLoading2 = true;
  430. this.checkCourse = row ? row.courseId : this.checkCourse;
  431. let params = {
  432. cid: this.checkCourse,
  433. uname: this.uname,
  434. stage: "",
  435. task: "",
  436. page: this.page2,
  437. };
  438. this.ajax
  439. .get(this.$store.state.api + "getCourseWorks3", params)
  440. .then((res) => {
  441. this.isLoading2 = false;
  442. this.total2 = res.data[0].length > 0 ? res.data[0][0].num : 0;
  443. this.res2 = res.data[0];
  444. this.getCourseDetail();
  445. })
  446. .catch((err) => {
  447. this.isLoading2 = false;
  448. console.error(err);
  449. });
  450. },
  451. getCourseDetail() {
  452. let params = {
  453. cid: this.checkCourse,
  454. };
  455. this.ajax
  456. .get(this.$store.state.api + "getCourseWorksReport", params)
  457. .then((res) => {
  458. this.userAarray = res.data[1];
  459. })
  460. .catch((err) => {
  461. console.error(err);
  462. });
  463. },
  464. getReport(row) {
  465. this.checkStudent = row.userid;
  466. this.reportVisible = true;
  467. this.signDialog = false;
  468. },
  469. },
  470. created() {
  471. this.page = 1;
  472. // this.getClass();
  473. // this.getGroup();
  474. this.getProject();
  475. },
  476. };
  477. </script>
  478. <style scoped>
  479. .pb_head > span:nth-child(2) {
  480. font-size: 16px;
  481. cursor: pointer;
  482. margin-left: 10px;
  483. /* color: #ab582f; */
  484. color: #5c549f;
  485. }
  486. .pb_head {
  487. margin: 0 !important;
  488. width: 100% !important;
  489. }
  490. .student_page {
  491. margin-top: 10px;
  492. }
  493. .student_head {
  494. margin-top: 10px;
  495. padding-bottom: 15px;
  496. display: flex;
  497. justify-content: space-between;
  498. }
  499. .student_search {
  500. display: flex;
  501. }
  502. .student_search > div:nth-child(1) {
  503. line-height: 35px;
  504. font-size: 14px;
  505. min-width: 60px;
  506. }
  507. .student_search >>> .el-input__inner {
  508. width: 190px;
  509. height: 35px;
  510. margin-left: 10px;
  511. }
  512. .student_table >>> .el-table--border td {
  513. border-right: 0px !important;
  514. }
  515. .student_page {
  516. margin-top: 10px;
  517. }
  518. .student_table >>> .el-table,
  519. .student_table >>> .el-table__body-wrapper {
  520. height: auto !important;
  521. }
  522. .el-table >>> .even_row {
  523. background-color: #f1f1f1 !important;
  524. }
  525. .dialog_diy >>> .el-dialog__header {
  526. padding: 9px 20px 10px;
  527. background: #32455b !important;
  528. }
  529. .dialog_diy >>> .el-dialog__title {
  530. color: #fff;
  531. font-size: 15px;
  532. }
  533. .dialog_diy >>> .el-dialog__headerbtn {
  534. top: 14px;
  535. }
  536. .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
  537. color: #fff;
  538. }
  539. .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
  540. color: #fff;
  541. }
  542. .check_diy >>> .el-dialog__body {
  543. padding-bottom: 0;
  544. }
  545. .dialog_diy >>> .el-dialog__body,
  546. .dialog_diy >>> .el-dialog__footer {
  547. background: #fafafa;
  548. }
  549. .r_diy >>> .el-dialog__footer {
  550. padding: 0;
  551. }
  552. .a_addBox {
  553. height: 570px;
  554. overflow: auto;
  555. }
  556. .workdates {
  557. height: 100%;
  558. position: absolute;
  559. top: 0;
  560. background: #fff;
  561. overflow: auto;
  562. z-index: 1;
  563. width: 95%;
  564. left: 50%;
  565. transform: translateX(-50%);
  566. padding: 20px;
  567. box-sizing: border-box;
  568. }
  569. .cancelbox {
  570. position: absolute;
  571. z-index: 2;
  572. left: 50%;
  573. width: 95%;
  574. transform: translateX(-50%);
  575. display: flex;
  576. justify-content: flex-end;
  577. padding: 0 90px 0px 0px;
  578. box-sizing: border-box;
  579. }
  580. .report_box {
  581. height: 100%;
  582. position: absolute;
  583. top: 0;
  584. /* background: #fff; */
  585. background: rgb(231, 242, 252);
  586. overflow: auto;
  587. z-index: 1;
  588. width: 100%;
  589. left: 50%;
  590. transform: translateX(-50%);
  591. padding: 20px;
  592. box-sizing: border-box;
  593. }
  594. .student_page
  595. >>> .el-pagination.is-background
  596. .el-pager
  597. li:not(.disabled).active {
  598. background-color: #5c549f;
  599. }
  600. .student_page
  601. >>> .el-pagination.is-background
  602. .el-pager
  603. li:not(.disabled):hover {
  604. color: #5c549f;
  605. }
  606. .student_search >>> .el-select .el-input.is-focus .el-input__inner {
  607. border-color: #5c549f;
  608. }
  609. .student_search >>> .el-select .el-input__inner:focus {
  610. border-color: #5c549f;
  611. }
  612. .el-select-dropdown__item.selected {
  613. color: #5c549f;
  614. }
  615. .student_search.is-active >>> .el-input__inner,
  616. .student_search >>> .el-input__inner:focus {
  617. border-color: #5c549f;
  618. }
  619. .btnClass {
  620. background: #8681b7;
  621. border-color: #8681b7;
  622. }
  623. .cancel_button:focus,
  624. .cancel_button:hover {
  625. color: rgb(92, 84, 159);
  626. border-color: #5c549f;
  627. background-color: #dbd7ff;
  628. }
  629. </style>