ImportPaper.vue 24 KB

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