works.vue 19 KB

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