GenPaper.vue 24 KB

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