works.vue 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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. border-radius: 5px;
  30. "
  31. >
  32. <div class="pb_head">
  33. <span>评价管理</span>
  34. <!-- <span>备注:教师可以根据课程、班级条件筛选学生并查看该学生信息</span> -->
  35. </div>
  36. <div class="student_head">
  37. <div class="student_search">
  38. <div>项目筛选</div>
  39. <el-select v-model="groupA" @change="search">
  40. <el-option value="0" label="我的课程"></el-option>
  41. <el-option value="1" label="他人课程"></el-option>
  42. </el-select>
  43. <el-input v-model="cn" placeholder="筛选项目名称" @input="search"></el-input>
  44. </div>
  45. </div>
  46. </div>
  47. <div class="pb_content_body">
  48. <div class="student_table">
  49. <el-table
  50. ref="table"
  51. :data="tableData1"
  52. border
  53. :height="tableHeight"
  54. :fit="true"
  55. v-loading="isLoading"
  56. style="width: 100%"
  57. :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
  58. :row-class-name="tableRowClassName"
  59. >
  60. <el-table-column prop="title" label="项目" min-width="30" align="center"></el-table-column>
  61. <el-table-column prop="uname" label="创建人" min-width="30" align="center"></el-table-column>
  62. <el-table-column prop="time" label="时间" min-width="20" align="center"></el-table-column>
  63. <el-table-column label="操作" min-width="30">
  64. <template slot-scope="scope">
  65. <!-- <el-button
  66. type="primary"
  67. size="small"
  68. @click="
  69. goTo(
  70. '/worksDetail?cid=' +
  71. scope.row.courseId +
  72. '&userid=' +
  73. userid +
  74. '&oid=' +
  75. oid
  76. )
  77. "
  78. >查看学生</el-button>-->
  79. <!-- <el-button type="primary" size="small" @click="getWorkData(scope.row)">生成报告</el-button> -->
  80. <el-button type="primary" size="small" @click="getWorkData(scope.row)">查看课程</el-button>
  81. </template>
  82. </el-table-column>
  83. </el-table>
  84. </div>
  85. <div class="student_page">
  86. <el-pagination
  87. background
  88. layout="prev, pager, next"
  89. :page-size="10"
  90. :total="total"
  91. v-if="page"
  92. @current-change="handleCurrentChange"
  93. ></el-pagination>
  94. </div>
  95. </div>
  96. </div>
  97. <!-- <el-dialog
  98. title="查看报告"
  99. :visible.sync="dialogVisible"
  100. :append-to-body="true"
  101. width="750px"
  102. :before-close="handleClose"
  103. class="dialog_diy"
  104. >
  105. <div>
  106. <div class="a_addBox">
  107. <WorkDate :dataJson="dataJson"></WorkDate>
  108. </div>
  109. </div>
  110. <span slot="footer" class="dialog-footer">
  111. <el-button @click="dialogVisible = false">关 闭</el-button>
  112. </span>
  113. </el-dialog>-->
  114. <WorkDate
  115. :dataJson="dataJson"
  116. :uid="userid"
  117. :cid="dataJson.courseId"
  118. :ooid="oid"
  119. v-if="dialogVisible"
  120. class="workdates"
  121. ></WorkDate>
  122. <div class="cancelbox" v-if="dialogVisible">
  123. <!-- <el-button @click="dialogVisibleBao = true" type="primary" size="small">自定义导出</el-button> -->
  124. <el-button @click="cancel" type="primary" size="small">返回</el-button>
  125. <!-- <el-button
  126. type="primary"
  127. size="small"
  128. @click="
  129. goTo(
  130. '/worksDetail?cid=' +
  131. dataJson.courseId +
  132. '&userid=' +
  133. userid +
  134. '&oid=' +
  135. oid
  136. )
  137. "
  138. >查看作业</el-button
  139. >-->
  140. </div>
  141. <el-dialog
  142. title="自定义导出报告"
  143. :visible.sync="dialogVisibleBao"
  144. :append-to-body="true"
  145. width="550px"
  146. :before-close="handleClose"
  147. class="dialog_diy"
  148. >
  149. <div>
  150. <div>
  151. <Report :cid="dataJson.courseId"></Report>
  152. </div>
  153. </div>
  154. <span slot="footer" class="dialog-footer">
  155. <el-button @click="dialogVisibleBao = false">关 闭</el-button>
  156. </span>
  157. </el-dialog>
  158. </div>
  159. </template>
  160. <script>
  161. import WorkDate from "./components/workData";
  162. import Report from "./components/report";
  163. export default {
  164. components: {
  165. WorkDate,
  166. Report
  167. },
  168. data() {
  169. return {
  170. tableHeight: "500px",
  171. isLoading: false,
  172. formLabelWidth: "100px",
  173. tableData1: [],
  174. subject: "",
  175. sClass: "",
  176. subjectJuri: [],
  177. projectJuri: [],
  178. grade: [],
  179. projectchoose: "",
  180. page: 1,
  181. total: 0,
  182. groupA: "0",
  183. cn: "",
  184. userid: this.$route.query.userid,
  185. oid: this.$route.query.oid,
  186. dialogVisible: false,
  187. dialogVisibleBao:false,
  188. dataJson: {},
  189. };
  190. },
  191. mounted() {
  192. this.$nextTick(function () {
  193. this.tableHeight =
  194. window.innerHeight - this.$refs.table.$el.offsetTop - 200;
  195. if (this.tableHeight <= 530) {
  196. this.tableHeight = 530;
  197. }
  198. // 监听窗口大小变化
  199. let self = this;
  200. window.onresize = function () {
  201. self.tableHeight =
  202. window.innerHeight - self.$refs.table.$el.offsetTop - 200;
  203. if (self.tableHeight <= 530) {
  204. self.tableHeight = 530;
  205. }
  206. };
  207. });
  208. },
  209. methods: {
  210. goTo(path) {
  211. this.$router.push(path);
  212. },
  213. tableRowClassName({ row, rowIndex }) {
  214. if ((rowIndex + 1) % 2 === 0) {
  215. return "even_row";
  216. } else {
  217. return "";
  218. }
  219. },
  220. handleClose(done) {
  221. done();
  222. },
  223. handleCurrentChange(val) {
  224. this.page = val;
  225. this.getProject();
  226. },
  227. //获取班级列表
  228. getClass() {
  229. this.isLoading = true;
  230. let params = {
  231. cu: "",
  232. cn: this.sClass,
  233. page: this.page,
  234. };
  235. this.ajax
  236. .get(this.$store.state.api + "selectClass", params)
  237. .then((res) => {
  238. this.isLoading = false;
  239. this.grade = res.data[0];
  240. })
  241. .catch((err) => {
  242. this.isLoading = false;
  243. console.error(err);
  244. });
  245. },
  246. getProject() {
  247. this.isLoading = true;
  248. let params = {
  249. type: this.groupA,
  250. uid: this.userid,
  251. oid: this.oid,
  252. cn: this.cn,
  253. page: this.page,
  254. };
  255. this.ajax
  256. .get(this.$store.state.api + "getProject", params)
  257. .then((res) => {
  258. this.isLoading = false;
  259. this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  260. this.tableData1 = res.data[0];
  261. })
  262. .catch((err) => {
  263. this.isLoading = false;
  264. console.error(err);
  265. });
  266. },
  267. search() {
  268. this.page = 1;
  269. this.getProject();
  270. },
  271. getWorkData(res) {
  272. this.dataJson = res;
  273. this.dialogVisible = true;
  274. },
  275. cancel() {
  276. this.dataJson = "";
  277. this.dialogVisible = false;
  278. },
  279. },
  280. created() {
  281. this.page = 1;
  282. // this.getClass();
  283. // this.getGroup();
  284. this.getProject();
  285. },
  286. };
  287. </script>
  288. <style scoped>
  289. .pb_head > span:nth-child(2) {
  290. font-size: 16px;
  291. margin-left: 80px;
  292. color: #ab582f;
  293. }
  294. .pb_head {
  295. margin: 0 !important;
  296. width: 100% !important;
  297. }
  298. .student_page {
  299. margin-top: 10px;
  300. }
  301. .student_head {
  302. margin-top: 10px;
  303. padding-bottom: 15px;
  304. display: flex;
  305. justify-content: space-between;
  306. }
  307. .student_search {
  308. display: flex;
  309. }
  310. .student_search > div:nth-child(1) {
  311. line-height: 35px;
  312. font-size: 14px;
  313. min-width: 60px;
  314. }
  315. .student_search >>> .el-input__inner {
  316. width: 190px;
  317. height: 35px;
  318. margin-left: 10px;
  319. }
  320. .student_table >>> .el-table--border td {
  321. border-right: 0px !important;
  322. }
  323. .student_page {
  324. margin-top: 10px;
  325. }
  326. .student_table >>> .el-table {
  327. height: 635px !important;
  328. }
  329. .el-table >>> .even_row {
  330. background-color: #f1f1f1 !important;
  331. }
  332. .dialog_diy >>> .el-dialog__header {
  333. padding: 9px 20px 10px;
  334. background: #32455b !important;
  335. }
  336. .dialog_diy >>> .el-dialog__title {
  337. color: #fff;
  338. font-size: 15px;
  339. }
  340. .dialog_diy >>> .el-dialog__headerbtn {
  341. top: 14px;
  342. }
  343. .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
  344. color: #fff;
  345. }
  346. .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
  347. color: #fff;
  348. }
  349. .dialog_diy >>> .el-dialog__body,
  350. .dialog_diy >>> .el-dialog__footer {
  351. background: #fafafa;
  352. }
  353. .a_addBox {
  354. height: 570px;
  355. overflow: auto;
  356. }
  357. .workdates {
  358. height: 100%;
  359. position: absolute;
  360. top: 0;
  361. background: #fff;
  362. overflow: auto;
  363. z-index: 1;
  364. width: 95%;
  365. left: 50%;
  366. transform: translateX(-50%);
  367. padding: 20px;
  368. box-sizing: border-box;
  369. }
  370. .cancelbox {
  371. position: absolute;
  372. z-index: 2;
  373. left: 50%;
  374. width: 95%;
  375. transform: translateX(-50%);
  376. display: flex;
  377. justify-content: flex-end;
  378. padding: 0 90px 0px 0px;
  379. box-sizing: border-box;
  380. }
  381. </style>