GenPaper.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787
  1. <template>
  2. <section class="content">
  3. <div v-show="isClear == 1">
  4. <LinkTitlesCustom :currentPaths="['题库管理 ', '考试试卷管理']" />
  5. </div>
  6. <div class="box-body">
  7. <el-form
  8. :inline="true"
  9. :model="formSearch"
  10. label-position="right"
  11. label-width="70px"
  12. >
  13. <el-row>
  14. <el-col :span="6">
  15. <el-form-item label="课程名称">
  16. <el-select
  17. class="search_width"
  18. v-model="formSearch.courseNo"
  19. filterable
  20. :remote-method="getCourses"
  21. remote
  22. clearable
  23. placeholder="全部"
  24. size="small"
  25. >
  26. <el-option
  27. v-for="item in courseInfoSelect"
  28. :label="item.courseInfo"
  29. :value="item.courseNo"
  30. :key="item.courseNo"
  31. >
  32. </el-option>
  33. </el-select>
  34. </el-form-item>
  35. </el-col>
  36. <el-col :span="6">
  37. <el-form-item label="试卷名称">
  38. <el-input
  39. class="search_width"
  40. v-model="formSearch.name"
  41. placeholder="试卷名称"
  42. size="small"
  43. ></el-input>
  44. </el-form-item>
  45. </el-col>
  46. <el-col :span="6">
  47. <el-form-item label="层次">
  48. <el-select
  49. class="search_width"
  50. v-model="formSearch.level"
  51. clearable
  52. placeholder="请选择"
  53. size="small"
  54. >
  55. <el-option
  56. v-for="item in levelList"
  57. :label="item.label"
  58. :value="item.value"
  59. :key="item.value"
  60. >
  61. </el-option>
  62. </el-select>
  63. </el-form-item>
  64. </el-col>
  65. <el-col :span="6">
  66. <div class="search_down">
  67. <el-button size="small" type="primary" @click="searchFrom"
  68. ><i class="el-icon-search"></i> 查询</el-button
  69. >
  70. <el-button size="small" @click="resetForm"
  71. ><i class="el-icon-refresh"></i> 重 置</el-button
  72. >
  73. <el-button size="small" type="primary" @click="genPaperDetail"
  74. ><i class="el-icon-plus"></i> 组卷</el-button
  75. >
  76. </div>
  77. </el-col>
  78. </el-row>
  79. <div
  80. style="width: 100%; border-bottom: 1px solid #ddd; margin: 10px 0;"
  81. ></div>
  82. <el-row>
  83. <el-form-item>
  84. <span>批量操作:</span>
  85. <el-button
  86. size="small"
  87. type="danger"
  88. @click="batchDeleteGenPaper"
  89. :disabled="noBatchSelected"
  90. >
  91. <i class="el-icon-delete"></i> 删除成卷
  92. </el-button>
  93. <el-button
  94. size="small"
  95. type="primary"
  96. @click="openBatchExportPaperDialog"
  97. :disabled="noBatchSelected"
  98. ><i class="el-icon-download"></i> 下载成卷</el-button
  99. >
  100. <el-button
  101. size="small"
  102. type="primary"
  103. @click="openPrints"
  104. :disabled="noBatchSelected"
  105. ><i class="el-icon-share"></i> 发送成卷</el-button
  106. >
  107. </el-form-item>
  108. </el-row>
  109. </el-form>
  110. <div style="width: 100%;margin-bottom: 10px;"></div>
  111. <el-table
  112. v-loading="loading"
  113. element-loading-text="拼命加载中"
  114. :data="tableData"
  115. border
  116. style="width: 100%"
  117. @selection-change="selectChange"
  118. >
  119. <el-table-column type="selection" width="35"></el-table-column>
  120. <el-table-column label="课程名称" width="180">
  121. <template slot-scope="scope">
  122. <span>{{ scope.row.course.name }}</span>
  123. </template>
  124. </el-table-column>
  125. <el-table-column label="课程代码" width="80">
  126. <template slot-scope="scope">
  127. <span>{{ scope.row.course.code }}</span>
  128. </template>
  129. </el-table-column>
  130. <el-table-column label="试卷名称" width="180">
  131. <template slot-scope="scope">
  132. <span>{{ scope.row.name }}</span>
  133. </template>
  134. </el-table-column>
  135. <el-table-column label="试卷总分" width="80">
  136. <template slot-scope="scope">
  137. <span>{{ scope.row.totalScore }}</span>
  138. </template>
  139. </el-table-column>
  140. <el-table-column label="试卷难度" width="80">
  141. <template slot-scope="scope">
  142. <span>{{ scope.row.difficultyDegree }}</span>
  143. </template>
  144. </el-table-column>
  145. <el-table-column label="大题数量" width="80">
  146. <template slot-scope="scope">
  147. <span>{{ scope.row.paperDetailCount }}</span>
  148. </template>
  149. </el-table-column>
  150. <el-table-column label="录入员" width="150">
  151. <template slot-scope="scope">
  152. <span>{{ scope.row.creator }}</span>
  153. </template>
  154. </el-table-column>
  155. <el-table-column label="创建时间" width="153">
  156. <template slot-scope="scope">
  157. <span>{{ scope.row.createTime }}</span>
  158. </template>
  159. </el-table-column>
  160. <el-table-column label="修改人" width="150">
  161. <template slot-scope="scope">
  162. <span>{{ scope.row.lastModifyName }}</span>
  163. </template>
  164. </el-table-column>
  165. <el-table-column label="操作" width="180" fixed="right">
  166. <template slot-scope="scope">
  167. <div class="operate_left">
  168. <el-button
  169. size="mini"
  170. type="primary"
  171. @click="editGenPaper(scope.row)"
  172. plain
  173. ><i class="el-icon-edit"></i>编辑</el-button
  174. >
  175. <el-dropdown class="button_left">
  176. <el-button type="primary" size="mini" plain>
  177. 更多 <i class="el-icon-arrow-down el-icon--right"></i>
  178. </el-button>
  179. <el-dropdown-menu slot="dropdown">
  180. <el-dropdown-item>
  181. <el-button
  182. size="mini"
  183. type="primary"
  184. @click="openExportDialog(scope.row)"
  185. plain
  186. ><i class="el-icon-download"></i> 下载</el-button
  187. >
  188. </el-dropdown-item>
  189. <el-dropdown-item>
  190. <el-button
  191. size="mini"
  192. type="primary"
  193. @click="previewPDF2(scope.row)"
  194. plain
  195. ><i class="el-icon-zoom-in"></i> 预览</el-button
  196. >
  197. </el-dropdown-item>
  198. <el-dropdown-item>
  199. <el-button
  200. size="mini"
  201. type="primary"
  202. @click="openPrint(scope.row)"
  203. plain
  204. ><i class="el-icon-share"></i> 发送</el-button
  205. >
  206. </el-dropdown-item>
  207. <el-dropdown-item>
  208. <el-button
  209. size="mini"
  210. type="danger"
  211. @click="deleteGenPaper(scope.row)"
  212. ><i class="el-icon-delete"></i> 删除</el-button
  213. >
  214. </el-dropdown-item>
  215. </el-dropdown-menu>
  216. </el-dropdown>
  217. </div>
  218. </template>
  219. </el-table-column>
  220. </el-table>
  221. <div class="page pull-right">
  222. <el-pagination
  223. @current-change="handleCurrentChange"
  224. :current-page="currentPage"
  225. :page-size="pageSize"
  226. layout="total, prev, pager, next, jumper"
  227. :total="total"
  228. >
  229. </el-pagination>
  230. </div>
  231. </div>
  232. <el-dialog title="导出" :visible.sync="exportDialog">
  233. <el-form :model="exportModel" label-position="right" label-width="80px">
  234. <el-row v-if="isShow">
  235. <el-col :md="12">
  236. <el-form-item label="课程名称">
  237. {{ exportModel.courseName }}
  238. </el-form-item>
  239. </el-col>
  240. </el-row>
  241. <el-row v-if="isShow">
  242. <el-col :md="12">
  243. <el-form-item label="课程代码">
  244. {{ exportModel.courseCode }}
  245. </el-form-item>
  246. </el-col>
  247. </el-row>
  248. <el-row>
  249. <el-col :md="24">
  250. <el-form-item label="导出内容">
  251. <el-checkbox-group v-model="exportModel.exportContentList">
  252. <el-checkbox label="PAPER">试卷</el-checkbox>
  253. <el-checkbox label="ANSWER">答案</el-checkbox>
  254. <el-checkbox label="COMPUTERTEST_PACKAGE"
  255. >机考数据包</el-checkbox
  256. >
  257. <el-checkbox
  258. v-if="isShowPrintExamPackage"
  259. label="PRINT_EXAM_PACKAGE"
  260. >分布式印刷数据包
  261. </el-checkbox>
  262. <el-input
  263. v-if="isShowPrintExamPackagePassword"
  264. v-model="printExamPackagePassword"
  265. placeholder="加密密码 (可选)"
  266. type="password"
  267. style="width: 150px"
  268. ></el-input>
  269. </el-checkbox-group>
  270. </el-form-item>
  271. </el-col>
  272. </el-row>
  273. <el-row>
  274. <el-col :md="24" class="text-center">
  275. <el-button type="primary" @click="exportPaperInfo"
  276. >开始导出</el-button
  277. >
  278. </el-col>
  279. </el-row>
  280. </el-form>
  281. </el-dialog>
  282. <el-dialog title="传送印刷平台" :visible.sync="dialogModel" width="500px">
  283. <el-form
  284. :model="printFrom"
  285. ref="printFrom"
  286. :rules="rules"
  287. label-position="right"
  288. label-width="120px"
  289. inline-message
  290. >
  291. <el-row>
  292. <el-form-item label="学校名称">
  293. <el-input
  294. class="dialog_input_width"
  295. v-model="this.Org.name"
  296. :disabled="true"
  297. ></el-input>
  298. </el-form-item>
  299. </el-row>
  300. <el-row>
  301. <el-form-item label="考试名称" prop="examId">
  302. <el-select
  303. class="dialog_input_width"
  304. v-model="printFrom.examId"
  305. filterable
  306. clearable
  307. :remote-method="getExams"
  308. remote
  309. placeholder="请选择"
  310. >
  311. <el-option
  312. v-for="item in examList"
  313. :label="item.name"
  314. :value="item.id"
  315. :key="item.id"
  316. ></el-option>
  317. </el-select>
  318. </el-form-item>
  319. </el-row>
  320. <el-row class="margin_top_10 margin_left_120">
  321. <el-button type="primary" @click="sendPrint('printFrom')"
  322. >保 存</el-button
  323. >
  324. <el-button @click="resetForm2('printFrom')"
  325. ><i class="el-icon-refresh"></i> 重 置</el-button
  326. >
  327. <el-button @click="cancel('printFrom')" type="primary"
  328. ><i class="el-icon-arrow-left"></i> 返 回</el-button
  329. >
  330. </el-row>
  331. </el-form>
  332. </el-dialog>
  333. </section>
  334. </template>
  335. <script>
  336. import { CORE_API, QUESTION_API, EXAM_WORK_API } from "@/constants/constants";
  337. import { LEVEL_TYPE } from "../constants/constants";
  338. import { mapState } from "vuex";
  339. import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
  340. export default {
  341. components: { LinkTitlesCustom },
  342. data() {
  343. return {
  344. isClear: 0,
  345. courseLoading: false,
  346. formSearch: {
  347. courseNo: "",
  348. courseName: "",
  349. level: "",
  350. name: ""
  351. },
  352. tableData: [],
  353. currentPage: 1,
  354. pageSize: 10,
  355. total: 0,
  356. loading: false,
  357. courseList: [],
  358. levelList: LEVEL_TYPE,
  359. dialogVisible: false,
  360. selectedPaperIds: [],
  361. fileList: [],
  362. uploadAction: "",
  363. formUpload: {
  364. paperName: ""
  365. },
  366. uploadData: {},
  367. fileLoading: false,
  368. exportDialog: false,
  369. exportModel: {
  370. id: "",
  371. courseCode: "",
  372. courseName: "",
  373. exportContentList: []
  374. },
  375. isShow: true,
  376. examList: [],
  377. Org: {},
  378. dialogModel: false,
  379. rowIds: [],
  380. isShowPrintExamPackage: false,
  381. isShowPrintExamPackagePassword: false,
  382. printExamPackagePassword: "",
  383. printFrom: {
  384. examId: ""
  385. },
  386. rules: {
  387. examId: [{ required: true, message: "请输入名称", trigger: "change" }]
  388. }
  389. };
  390. },
  391. methods: {
  392. resetForm() {
  393. this.formSearch = {
  394. courseNo: "",
  395. courseName: "",
  396. level: "",
  397. name: ""
  398. };
  399. },
  400. //查询
  401. searchFrom() {
  402. this.currentPage = 1;
  403. this.searchGenPaper();
  404. },
  405. searchGenPaper() {
  406. this.loading = true;
  407. var url =
  408. QUESTION_API + "/genPaper/" + this.currentPage + "/" + this.pageSize;
  409. this.$http.get(url, { params: this.formSearch }).then(response => {
  410. this.tableData = response.data.content;
  411. this.total = response.data.totalElements;
  412. });
  413. this.loading = false;
  414. },
  415. genPaperDetail() {
  416. var courseNo = this.formSearch.courseNo;
  417. if (!courseNo) {
  418. this.$notify({
  419. title: "警告",
  420. message: "请选择课程",
  421. type: "warning"
  422. });
  423. } else {
  424. var course = this.getCourseObj(courseNo);
  425. this.formSearch.courseName = course.name;
  426. var level = course.level;
  427. sessionStorage.setItem("gen_paper", JSON.stringify(this.formSearch));
  428. sessionStorage.setItem("gen_paper_currentPage", this.currentPage);
  429. this.$router.push({
  430. path: "/questions/gen_paper_detail/" + courseNo + "/" + level
  431. });
  432. }
  433. },
  434. handleCurrentChange(val) {
  435. this.currentPage = val;
  436. this.searchGenPaper();
  437. },
  438. getCourseObj(courseNo) {
  439. for (let course of this.courseList) {
  440. if (course.code == courseNo) {
  441. return course;
  442. }
  443. }
  444. },
  445. exportGenPaper(row) {
  446. window.open(
  447. QUESTION_API + "/paper/export/" + row.id + "/" + this.user.rootOrgName
  448. );
  449. },
  450. editGenPaper(row) {
  451. this.getCourseName(this.formSearch.courseNo);
  452. sessionStorage.setItem("gen_paper", JSON.stringify(this.formSearch));
  453. sessionStorage.setItem("gen_paper_currentPage", this.currentPage);
  454. this.$router.push({
  455. path: "/edit_paper/" + row.id + "/gen_paper"
  456. });
  457. },
  458. deleteGenPaper(row) {
  459. this.$confirm("确认删除试卷吗?", "提示", {
  460. type: "warning"
  461. }).then(() => {
  462. this.loading = true;
  463. this.$http.delete(QUESTION_API + "/paper/" + row.id).then(
  464. () => {
  465. this.$notify({
  466. message: "删除成功",
  467. type: "success"
  468. });
  469. this.searchGenPaper();
  470. },
  471. response => {
  472. this.$notify({
  473. message: response.data.msg,
  474. type: "error"
  475. });
  476. this.loading = false;
  477. }
  478. );
  479. });
  480. },
  481. selectChange(row) {
  482. this.selectedPaperIds = [];
  483. row.forEach(element => {
  484. this.selectedPaperIds.push(element.id);
  485. });
  486. },
  487. batchDeleteGenPaper() {
  488. var paperIds = this.paperIds;
  489. console.log("试卷id:", paperIds);
  490. if (this.selectedPaperIds.length != 0) {
  491. this.$confirm("确认删除试卷吗?", "提示", {
  492. type: "warning"
  493. }).then(() => {
  494. this.loading = true;
  495. this.$http.delete(QUESTION_API + "/paper/" + paperIds).then(
  496. () => {
  497. this.$notify({
  498. message: "删除成功",
  499. type: "success"
  500. });
  501. this.searchGenPaper();
  502. this.selectedPaperIds = [];
  503. },
  504. response => {
  505. this.$notify({
  506. message: response.data.msg,
  507. type: "error"
  508. });
  509. this.loading = false;
  510. }
  511. );
  512. });
  513. } else {
  514. this.$notify({
  515. message: "请勾选删除的数据",
  516. type: "warning"
  517. });
  518. }
  519. },
  520. //查询所有课程
  521. getCourses(query) {
  522. query = query.trim();
  523. if (query) {
  524. if (!(query.indexOf("(") > -1 && query.indexOf(")") > -1)) {
  525. this.courseLoading = true;
  526. this.$http
  527. .get(CORE_API + "/course/query?name=" + query + "&enable=true")
  528. .then(response => {
  529. this.courseList = response.data;
  530. this.courseLoading = false;
  531. });
  532. }
  533. } else {
  534. this.courseList = [];
  535. }
  536. },
  537. //打开导出弹框
  538. openExportDialog(row) {
  539. this.isShow = true;
  540. this.isShow = true;
  541. this.exportDialog = true;
  542. this.exportModel.id = row.id;
  543. this.exportModel.courseCode = row.course.code;
  544. this.exportModel.courseName = row.course.name;
  545. this.exportModel.exportContentList = [];
  546. /* 分布式印刷数据包设置 */
  547. this.isShowPrintExamPackage = true;
  548. this.isShowPrintExamPackagePassword = false;
  549. this.printExamPackagePassword = "";
  550. },
  551. //打开批量弹出框
  552. openBatchExportPaperDialog() {
  553. if (this.selectedPaperIds.length != 0) {
  554. this.exportDialog = true;
  555. this.isShow = false;
  556. this.isShow = false;
  557. this.exportModel.exportContentList = [];
  558. } else {
  559. this.$notify({
  560. message: "请勾选导出的数据",
  561. type: "warning"
  562. });
  563. }
  564. /* 分布式印刷数据包设置 */
  565. this.isShowPrintExamPackage = false;
  566. this.isShowPrintExamPackagePassword = false;
  567. this.printExamPackagePassword = "";
  568. },
  569. //导出试卷,答案,机考数据包
  570. exportPaperInfo() {
  571. if (this.exportModel.exportContentList.length == 0) {
  572. this.$notify({
  573. message: "请选择导出内容",
  574. type: "error"
  575. });
  576. return false;
  577. }
  578. if (this.printExamPackagePassword.length > 0) {
  579. var reg = /^[0-9A-Za-z]{6,12}$/;
  580. if (!reg.test(this.printExamPackagePassword)) {
  581. this.$notify({
  582. message: "加密密码请输入6至12位的数字或字母!",
  583. type: "error"
  584. });
  585. return false;
  586. }
  587. }
  588. var key = this.user.key;
  589. var token = this.user.token;
  590. if (this.isShow) {
  591. console.log("单个导出");
  592. window.location.href =
  593. QUESTION_API +
  594. "/paper/export/" +
  595. this.exportModel.id +
  596. "/" +
  597. this.exportModel.exportContentList +
  598. "/" +
  599. this.user.rootOrgName +
  600. "/" +
  601. this.user.displayName +
  602. "/onLine" +
  603. "?psw=" +
  604. this.printExamPackagePassword +
  605. "&$key=" +
  606. key +
  607. "&$token=" +
  608. token;
  609. this.exportDialog = false;
  610. } else {
  611. console.log("批量导出");
  612. var paperIds = this.paperIds;
  613. console.log(paperIds);
  614. window.location.href =
  615. QUESTION_API +
  616. "/paper/batch_export/" +
  617. paperIds +
  618. "/" +
  619. this.exportModel.exportContentList +
  620. "/" +
  621. this.user.rootOrgName +
  622. "/" +
  623. this.user.displayName +
  624. "/onLine" +
  625. "?$key=" +
  626. key +
  627. "&$token=" +
  628. token;
  629. this.exportDialog = false;
  630. console.log(paperIds);
  631. }
  632. },
  633. removeItem() {
  634. sessionStorage.removeItem("gen_paper");
  635. sessionStorage.removeItem("gen_paper_currentPage");
  636. },
  637. previewPDF2(row) {
  638. window.open(QUESTION_API + "/paper/pdf/" + row.id);
  639. },
  640. openPrint(row) {
  641. this.dialogModel = true;
  642. this.rowIds.push(row.id);
  643. },
  644. openPrints() {
  645. this.dialogModel = true;
  646. this.rowIds = this.selectedPaperIds;
  647. },
  648. cancel(formData) {
  649. this.resetForm2(formData);
  650. this.dialogModel = false;
  651. },
  652. resetForm2(formData) {
  653. this.printFrom.examId = "";
  654. this.$refs[formData].clearValidate();
  655. },
  656. //传至印刷模块
  657. sendPrint(formData) {
  658. this.$refs[formData].validate(valid => {
  659. if (valid) {
  660. var orgId = "";
  661. for (let exam of this.examList) {
  662. if (exam.id == this.printFrom.examId) {
  663. orgId = exam.rootOrgId;
  664. }
  665. }
  666. if (orgId != "") {
  667. for (let printPid of this.rowIds) {
  668. this.$http.get(
  669. QUESTION_API +
  670. "/sendPrint/" +
  671. printPid +
  672. "/" +
  673. this.printFrom.examId +
  674. "/" +
  675. orgId
  676. );
  677. }
  678. this.$notify({
  679. message: "已推送",
  680. type: "success"
  681. });
  682. this.resetForm2(formData);
  683. this.dialogModel = false;
  684. this.rowIds = [];
  685. }
  686. } else {
  687. return false;
  688. }
  689. });
  690. },
  691. //查询考试
  692. getExams(query) {
  693. query = query.trim();
  694. this.$http
  695. .get(
  696. EXAM_WORK_API + "/exam/queryByNameLike?name=" + query + "&enable=true"
  697. )
  698. .then(response => {
  699. this.examList = response.data;
  700. });
  701. },
  702. searchExamList() {
  703. //查询所有考试
  704. this.$http
  705. .get(EXAM_WORK_API + "/exam/queryByNameLike?name=&enable=true")
  706. .then(response => {
  707. var list = response.data;
  708. for (var i = 0; i < list.length; i++) {
  709. if (list[i].examType == "TRADITION") {
  710. this.examList.push(list[i]);
  711. }
  712. }
  713. });
  714. },
  715. //根据orgId查询学校名称
  716. searchOrgName() {
  717. this.$http
  718. .get(CORE_API + "/org/rootOrg/" + this.user.rootOrgId)
  719. .then(response => {
  720. this.Org = response.data;
  721. });
  722. },
  723. initVue() {
  724. this.isClear = this.$route.params.isClear;
  725. if (this.isClear == 0 || !this.isClear) {
  726. this.removeItem();
  727. this.formSearch = {
  728. courseNo: "",
  729. courseName: "",
  730. level: "",
  731. name: ""
  732. };
  733. } else {
  734. this.formSearch = JSON.parse(sessionStorage.getItem("gen_paper"));
  735. this.currentPage =
  736. sessionStorage.getItem("gen_paper_currentPage") == null
  737. ? 1
  738. : parseInt(sessionStorage.getItem("gen_paper_currentPage"));
  739. }
  740. this.getCourses(this.formSearch.courseName);
  741. this.searchGenPaper();
  742. }
  743. },
  744. computed: {
  745. paperIds() {
  746. var paperIds = "";
  747. for (let paperId of this.selectedPaperIds) {
  748. if (!paperIds) {
  749. paperIds += paperId;
  750. } else {
  751. paperIds += "," + paperId;
  752. }
  753. }
  754. return paperIds;
  755. },
  756. courseInfoSelect() {
  757. var courseList = [];
  758. for (let course of this.courseList) {
  759. var courseInfo = course.name + "(" + course.code + ")";
  760. var courseNo = course.code;
  761. var courseName = course.name;
  762. courseList.push({
  763. courseNo: courseNo,
  764. courseInfo: courseInfo,
  765. courseName: courseName
  766. });
  767. }
  768. return courseList;
  769. },
  770. noBatchSelected() {
  771. return this.selectedPaperIds.length === 0;
  772. },
  773. ...mapState({ user: state => state.user })
  774. },
  775. watch: {
  776. $route: "initVue"
  777. },
  778. created() {
  779. this.initVue();
  780. this.searchExamList();
  781. this.searchOrgName();
  782. }
  783. };
  784. </script>
  785. <style scoped src="../styles/Common.css"></style>