Question.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  1. <template>
  2. <section class="content">
  3. <div class="part-box">
  4. <h2 class="part-box-title">试题列表</h2>
  5. <el-form class="part-filter-form" :inline="true" :model="formSearch">
  6. <el-form-item label="课程名称">
  7. <el-select
  8. v-model="formSearch.courseNo"
  9. class="search_width"
  10. filterable
  11. :remote-method="getCourses"
  12. remote
  13. clearable
  14. placeholder="请选择"
  15. @change="initCourseProperty"
  16. @focus="(e) => getCourses(e.target.value)"
  17. >
  18. <el-option
  19. v-for="item in courseInfoSelect"
  20. :key="item.courseNo"
  21. :label="item.courseInfo"
  22. :value="item.courseNo"
  23. >
  24. </el-option>
  25. </el-select>
  26. </el-form-item>
  27. <el-form-item label="层次">
  28. <el-select
  29. v-model="formSearch.courseLevel"
  30. class="search_width"
  31. filterable
  32. clearable
  33. placeholder="请选择"
  34. >
  35. <el-option
  36. v-for="item in levelList"
  37. :key="item.value"
  38. :label="item.label"
  39. :value="item.value"
  40. >
  41. </el-option>
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item label="题型">
  45. <el-select
  46. v-model="formSearch.questionType"
  47. class="search_width"
  48. filterable
  49. clearable
  50. placeholder="请选择"
  51. >
  52. <el-option
  53. v-for="item in questionTypes"
  54. :key="item.value"
  55. :label="item.label"
  56. :value="item.value"
  57. >
  58. </el-option>
  59. </el-select>
  60. </el-form-item>
  61. <el-form-item label="属性名">
  62. <el-select
  63. v-model="formSearch.coursePropertyName"
  64. class="search_width"
  65. filterable
  66. clearable
  67. :disabled="updatePorperty"
  68. placeholder="请选择"
  69. @change="searchFirst"
  70. >
  71. <el-option
  72. v-for="item in coursePropertyList"
  73. :key="item.name"
  74. :label="item.name"
  75. :value="item.name"
  76. ></el-option>
  77. </el-select>
  78. </el-form-item>
  79. <!-- created by wwh -->
  80. <el-form-item label="一级属性">
  81. <el-select
  82. v-model="formSearch.firstPropertyId"
  83. class="search_width"
  84. filterable
  85. clearable
  86. :disabled="updateFirst"
  87. placeholder="请选择"
  88. @change="searchSecond"
  89. >
  90. <el-option
  91. v-for="item in firstPropertyList"
  92. :key="item.id"
  93. :label="item.name"
  94. :value="item.id"
  95. ></el-option>
  96. </el-select>
  97. </el-form-item>
  98. <el-form-item label="二级属性">
  99. <el-select
  100. v-model="formSearch.secondPropertyId"
  101. class="search_width"
  102. filterable
  103. clearable
  104. :disabled="updateSecond"
  105. placeholder="请选择"
  106. >
  107. <el-option
  108. v-for="item in secondPropertyList"
  109. :key="item.id"
  110. :label="item.name"
  111. :value="item.id"
  112. ></el-option>
  113. </el-select>
  114. </el-form-item>
  115. <el-form-item label="公开度">
  116. <el-select
  117. v-model="formSearch.publicity"
  118. class="search_width"
  119. filterable
  120. clearable
  121. placeholder="请选择"
  122. >
  123. <el-option
  124. v-for="item in publicityList"
  125. :key="item.value"
  126. :label="item.label"
  127. :value="item.value"
  128. >
  129. </el-option>
  130. </el-select>
  131. </el-form-item>
  132. <el-form-item>
  133. <el-button type="primary" @click="searchFrom"
  134. ><i class="el-icon-search"></i> 查询</el-button
  135. >
  136. <el-button @click="resetForm"
  137. ><i class="el-icon-refresh"></i> 重 置</el-button
  138. >
  139. </el-form-item>
  140. </el-form>
  141. </div>
  142. <div class="part-box">
  143. <!-- 页面列表 -->
  144. <el-table v-loading="loading" :data="tableData">
  145. <el-table-column label="课程" width="180">
  146. <template slot-scope="scope">
  147. <span>{{ scope.row.course.name }}</span>
  148. </template>
  149. </el-table-column>
  150. <el-table-column label="层次" width="100">
  151. <template slot-scope="scope">
  152. <span>{{ getLevel(scope.row.course.level) }}</span>
  153. </template>
  154. </el-table-column>
  155. <el-table-column label="题型" width="100">
  156. <template slot-scope="scope">
  157. <span>{{ scope.row.questionType | questionType }}</span>
  158. </template>
  159. </el-table-column>
  160. <el-table-column label="题干">
  161. <template slot-scope="scope">
  162. <span
  163. class="row_quesBody"
  164. @click="prevViewQues(scope.row)"
  165. v-html="scope.row.quesBody"
  166. >
  167. </span>
  168. </template>
  169. </el-table-column>
  170. <el-table-column label="操作" width="175">
  171. <template slot-scope="scope">
  172. <div class="operate_left">
  173. <el-button
  174. v-if="!isNested(scope.row.questionType)"
  175. size="mini"
  176. type="primary"
  177. plain
  178. @click="updateRow(scope.row)"
  179. >
  180. <i class="el-icon-edit"></i>编辑
  181. </el-button>
  182. <el-button
  183. size="mini"
  184. type="danger"
  185. @click="deleteRow(scope.row)"
  186. >
  187. <i class="el-icon-delete"></i> 删除
  188. </el-button>
  189. </div>
  190. </template>
  191. </el-table-column>
  192. </el-table>
  193. <div class="part-page">
  194. <el-pagination
  195. :current-page="currentPage"
  196. :page-size="pageSize"
  197. :page-sizes="[10, 20, 50, 100, 200, 300]"
  198. layout="total, sizes, prev, pager, next, jumper"
  199. :total="total"
  200. @current-change="handleCurrentChange"
  201. @size-change="handleSizeChange"
  202. >
  203. </el-pagination>
  204. </div>
  205. </div>
  206. <el-dialog
  207. title="试题预览"
  208. :visible.sync="quesDialog"
  209. :modal="false"
  210. append-to-body
  211. custom-class="side-dialog"
  212. @close="closeQuesDialog"
  213. >
  214. <el-form :model="quesModel" label-position="right" label-width="80px">
  215. <el-row :gutter="10">
  216. <el-col :xs="10" :sm="10" :md="10" :lg="10">
  217. <el-form-item label="题型">
  218. <el-select
  219. v-model="quesModel.questionType"
  220. :disabled="true"
  221. placeholder="题型"
  222. >
  223. <el-option
  224. v-for="item in questionTypes"
  225. :key="item.value"
  226. :label="item.label"
  227. :value="item.value"
  228. >
  229. </el-option>
  230. </el-select>
  231. </el-form-item>
  232. </el-col>
  233. </el-row>
  234. <el-row :gutter="10">
  235. <el-col :xs="30" :sm="30" :md="30" :lg="30">
  236. <el-form-item label="题干">
  237. <span class="ques-body" v-html="quesModel.quesBody"></span>
  238. </el-form-item>
  239. </el-col>
  240. </el-row>
  241. <!-- 非套题 -->
  242. <div v-if="quesModel.questionType !== 'NESTED_ANSWER_QUESTION'">
  243. <el-row
  244. v-for="(quesOption, index) in quesModel.quesOptions"
  245. :key="index"
  246. :gutter="10"
  247. >
  248. <el-col :xs="30" :sm="30" :md="30" :lg="30">
  249. <el-form-item :label="index | optionOrderWordFilter">
  250. <span class="ques-body" v-html="quesOption.optionBody"></span>
  251. </el-form-item>
  252. </el-col>
  253. </el-row>
  254. </div>
  255. <!-- 套题 -->
  256. <div v-if="quesModel.questionType === 'NESTED_ANSWER_QUESTION'">
  257. <el-row
  258. v-for="subQuestionModel in quesModel.subQuestions"
  259. :key="subQuestionModel"
  260. :gutter="10"
  261. >
  262. <el-col :xs="30" :sm="30" :md="30" :lg="30">
  263. <el-row>
  264. <el-form-item label="题目">
  265. <span v-html="subQuestionModel.quesBody"></span>
  266. </el-form-item>
  267. </el-row>
  268. <el-row
  269. v-for="(
  270. subQuesOption, subIndex
  271. ) in subQuestionModel.quesOptions"
  272. :key="subIndex"
  273. :gutter="10"
  274. >
  275. <el-col :xs="30" :sm="30" :md="30" :lg="30">
  276. <el-form-item :label="subIndex | optionOrderWordFilter">
  277. <span v-html="subQuesOption.optionBody"></span>
  278. </el-form-item>
  279. </el-col>
  280. </el-row>
  281. <el-row>
  282. <el-form-item label="答案">
  283. <span v-html="subQuestionModel.quesAnswer"></span>
  284. </el-form-item>
  285. </el-row>
  286. </el-col>
  287. </el-row>
  288. </div>
  289. <!-- 非套题答案 -->
  290. <div v-if="quesModel.questionType !== 'NESTED_ANSWER_QUESTION'">
  291. <el-form-item label="答案">
  292. <span v-html="answer"></span>
  293. </el-form-item>
  294. </div>
  295. </el-form>
  296. </el-dialog>
  297. <el-dialog title="提示" :visible.sync="deleteDialogVisible">
  298. <span>{{ deleteInfo }}</span>
  299. <span slot="footer" class="dialog-footer">
  300. <el-button type="primary" @click="deleteDialogVisible = false"
  301. >确 定</el-button
  302. >
  303. </span>
  304. </el-dialog>
  305. </section>
  306. </template>
  307. <script>
  308. import { QUESTION_API } from "@/constants/constants";
  309. import { QUESTION_TYPES, LEVEL_TYPE } from "../constants/constants";
  310. import { mapState } from "vuex";
  311. export default {
  312. data() {
  313. return {
  314. formSearch: {
  315. questionType: "",
  316. courseNo: "",
  317. courseLevel: "",
  318. courseName: "",
  319. publicity: "",
  320. coursePropertyName: "",
  321. firstPropertyId: "",
  322. secondPropertyId: "",
  323. },
  324. courseList: [], //课程list
  325. levelList: LEVEL_TYPE, //层次list
  326. tableData: [],
  327. currentPage: 1,
  328. pageSize: 10,
  329. total: 10,
  330. quesModel: {},
  331. questionTypes: [],
  332. quesDialog: false,
  333. loading: false,
  334. deleteDialogVisible: false,
  335. deleteInfo: "",
  336. singleRightAnswer: "", //接收单选答案
  337. multipleRightAnswer: [], //接收多选答案
  338. publicityList: [
  339. { label: "公开", value: true },
  340. { label: "非公开", value: false },
  341. ],
  342. coursePropertyList: [], //课程属性集合
  343. firstPropertyList: [], //一级属性集合
  344. secondPropertyList: [], //二级属性集合
  345. isClear: 0,
  346. };
  347. },
  348. computed: {
  349. ...mapState({ user: (state) => state.user }),
  350. courseInfoSelect() {
  351. var courseList = [];
  352. for (let course of this.courseList) {
  353. var courseInfo = course.name + "(" + course.code + ")";
  354. var courseNo = course.code;
  355. courseList.push({ courseNo: courseNo, courseInfo: courseInfo });
  356. }
  357. return courseList;
  358. },
  359. answer() {
  360. if (this.quesModel.questionType == "SINGLE_ANSWER_QUESTION") {
  361. return this.singleRightAnswer;
  362. } else if (this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION") {
  363. var obj = this.multipleRightAnswer;
  364. return obj.sort().toString();
  365. } else {
  366. return this.quesModel.quesAnswer;
  367. }
  368. },
  369. updateFirst() {
  370. if (this.formSearch.coursePropertyName) {
  371. return false;
  372. }
  373. return true;
  374. },
  375. updateSecond() {
  376. if (this.formSearch.firstPropertyId) {
  377. return false;
  378. }
  379. return true;
  380. },
  381. updatePorperty() {
  382. if (this.formSearch.courseNo) {
  383. return false;
  384. }
  385. return true;
  386. },
  387. },
  388. watch: {
  389. $route: "initVue",
  390. },
  391. //钩子函数
  392. created() {
  393. var url =
  394. QUESTION_API +
  395. "/org/property/" +
  396. this.user.rootOrgId +
  397. "/ROOT_ORG_QUESTION_TYPES";
  398. this.$http.get(url).then((response) => {
  399. if (response.data && response.data.length > 0) {
  400. this.questionTypes = QUESTION_TYPES.filter((m) =>
  401. response.data.includes(m.value)
  402. );
  403. }
  404. });
  405. this.initVue();
  406. },
  407. methods: {
  408. isMatchingQuestion(questionType) {
  409. if (
  410. questionType == "PARAGRAPH_MATCHING" ||
  411. questionType == "BANKED_CLOZE"
  412. ) {
  413. return true;
  414. } else {
  415. return false;
  416. }
  417. },
  418. isNested(questionType) {
  419. if (
  420. questionType == "PARAGRAPH_MATCHING" ||
  421. questionType == "BANKED_CLOZE" ||
  422. questionType == "CLOZE" ||
  423. questionType == "READING_COMPREHENSION" ||
  424. questionType == "LISTENING_QUESTION"
  425. ) {
  426. return true;
  427. } else {
  428. return false;
  429. }
  430. },
  431. resetForm() {
  432. this.formSearch = {
  433. questionType: "",
  434. courseNo: "",
  435. courseLevel: "",
  436. courseName: "",
  437. publicity: "",
  438. coursePropertyName: "",
  439. firstPropertyId: "",
  440. secondPropertyId: "",
  441. };
  442. },
  443. getLevel(level) {
  444. if (level == "ZSB") {
  445. return "专升本";
  446. } else if (level == "GQZ") {
  447. return "高起专";
  448. } else if (level == "GQB") {
  449. return "高起本";
  450. } else if (level == "ALL") {
  451. return "不限";
  452. } else {
  453. return "";
  454. }
  455. },
  456. //查询列表
  457. searchFrom() {
  458. this.currentPage = 1;
  459. this.searchQues();
  460. },
  461. searchQues() {
  462. var pageNo = this.currentPage || 1;
  463. this.currentPage = 1;
  464. this.tableData = [];
  465. var url = QUESTION_API + "/question/" + pageNo + "/" + this.pageSize;
  466. this.loading = true;
  467. this.$http.get(url, { params: this.formSearch }).then((response) => {
  468. this.tableData = response.data.content;
  469. this.total = response.data.totalElements;
  470. this.currentPage = pageNo;
  471. this.loading = false;
  472. });
  473. },
  474. //分页
  475. handleCurrentChange(val) {
  476. this.currentPage = val;
  477. this.searchQues();
  478. },
  479. handleSizeChange(val) {
  480. this.pageSize = val;
  481. this.currentPage = 1;
  482. this.searchQues();
  483. },
  484. getCourseName(courseNo) {
  485. for (let course of this.courseList) {
  486. if (course.code == courseNo) {
  487. this.formSearch.courseName = course.name;
  488. }
  489. }
  490. },
  491. //修改
  492. updateRow(row) {
  493. this.getCourseName(this.formSearch.courseNo);
  494. //选择题:单选、多选
  495. if (
  496. row.questionType === "SINGLE_ANSWER_QUESTION" ||
  497. row.questionType === "MULTIPLE_ANSWER_QUESTION"
  498. ) {
  499. this.$router.push({
  500. path: "/questions/edit_select_question/" + row.id,
  501. });
  502. }
  503. //判断、填空、问答
  504. if (
  505. row.questionType === "BOOL_ANSWER_QUESTION" ||
  506. row.questionType === "FILL_BLANK_QUESTION" ||
  507. row.questionType === "TEXT_ANSWER_QUESTION"
  508. ) {
  509. this.$router.push({
  510. path: "/questions/edit_other_question/" + row.id,
  511. });
  512. }
  513. sessionStorage.setItem("question", JSON.stringify(this.formSearch));
  514. sessionStorage.setItem("question_currentPage", this.currentPage);
  515. },
  516. //删除
  517. deleteRow(row) {
  518. this.$confirm("确认删除试题吗?", "提示", {
  519. type: "warning",
  520. }).then(() => {
  521. this.loading = true;
  522. this.$http
  523. .delete(QUESTION_API + "/paper/deleteQuestion/" + row.id)
  524. .then(
  525. (response) => {
  526. if (response.data.length > 0) {
  527. this.loading = false;
  528. this.deleteInfo =
  529. "该试题被试卷:" +
  530. response.data.join(" , ") +
  531. "使用,不能删除";
  532. this.deleteDialogVisible = true;
  533. } else {
  534. this.$notify({
  535. message: "删除成功",
  536. type: "success",
  537. });
  538. this.searchQues();
  539. }
  540. },
  541. () => {
  542. this.$notify({
  543. message: "删除失败",
  544. type: "error",
  545. });
  546. this.loading = false;
  547. }
  548. );
  549. });
  550. },
  551. //打开弹窗
  552. openQuesDialog() {
  553. this.quesDialog = true;
  554. },
  555. //关闭弹窗
  556. closeQuesDialog() {
  557. this.quesDialog = false;
  558. this.quesModel = {};
  559. },
  560. //预览
  561. prevViewQues(row) {
  562. this.quesModel = row;
  563. this.disposeSelectAnswer();
  564. this.openQuesDialog();
  565. },
  566. //查询所有课程
  567. getCourses(query) {
  568. this.$http
  569. .get(QUESTION_API + "/course/query?name=" + query + "&enable=true")
  570. .then((response) => {
  571. this.courseList = response.data;
  572. if (this.formSearch.courseNo) {
  573. this.$http
  574. .get(
  575. QUESTION_API +
  576. "/courseProperty/enable/" +
  577. this.formSearch.courseNo
  578. )
  579. .then((response) => {
  580. this.coursePropertyList = response.data;
  581. //查询一级属性
  582. this.getFirst();
  583. });
  584. } else {
  585. this.coursePropertyList = [];
  586. }
  587. });
  588. },
  589. //重置查询表单
  590. resetSearchForm() {
  591. this.formSearch = {
  592. questionType: "",
  593. courseNo: "",
  594. };
  595. },
  596. /*处理选择题答案显示,处理套题下选择题答案显示*/
  597. disposeSelectAnswer() {
  598. this.singleRightAnswer = "";
  599. this.multipleRightAnswer = [];
  600. //处理选择题答案显示
  601. if (
  602. this.quesModel.questionType == "SINGLE_ANSWER_QUESTION" ||
  603. this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION"
  604. ) {
  605. for (var i = 0; i < this.quesModel.quesOptions.length; i++) {
  606. var option = this.quesModel.quesOptions[i];
  607. var orderNum = String.fromCharCode(65 + i);
  608. if (
  609. this.quesModel.questionType == "SINGLE_ANSWER_QUESTION" &&
  610. option.isCorrect == 1
  611. ) {
  612. this.singleRightAnswer = orderNum;
  613. }
  614. if (
  615. this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION" &&
  616. option.isCorrect == 1
  617. ) {
  618. this.multipleRightAnswer.push(orderNum);
  619. }
  620. }
  621. }
  622. //处理套题下选择题答案显示
  623. if (this.quesModel.questionType == "NESTED_ANSWER_QUESTION") {
  624. var subQuestions = this.quesModel.subQuestions;
  625. for (var ii = 0; ii < subQuestions.length; ii++) {
  626. var subQuestion = subQuestions[ii];
  627. if (subQuestion.questionType == "SINGLE_ANSWER_QUESTION") {
  628. for (var j = 0; j < subQuestion.quesOptions.length; j++) {
  629. var option_j = subQuestion.quesOptions[j];
  630. var orderNum_j = String.fromCharCode(65 + j);
  631. if (option_j.isCorrect == 1) {
  632. subQuestion["quesAnswer"] = orderNum_j;
  633. }
  634. }
  635. }
  636. if (subQuestion.questionType == "MULTIPLE_ANSWER_QUESTION") {
  637. var subQuestionMultipleRightAnswer = [];
  638. for (var k = 0; k < subQuestion.quesOptions.length; k++) {
  639. var option2 = subQuestion.quesOptions[k];
  640. var orderNum2 = String.fromCharCode(65 + k);
  641. if (option2.isCorrect == 1) {
  642. subQuestionMultipleRightAnswer.push(orderNum2);
  643. }
  644. }
  645. subQuestion["quesAnswer"] = subQuestionMultipleRightAnswer
  646. .sort()
  647. .toString();
  648. }
  649. }
  650. }
  651. },
  652. //查询所有课程属性名
  653. initCourseProperty() {
  654. this.formSearch.coursePropertyName = "";
  655. this.formSearch.firstPropertyId = "";
  656. this.formSearch.secondPropertyId = "";
  657. if (this.formSearch.courseNo) {
  658. this.$http
  659. .get(
  660. QUESTION_API + "/courseProperty/enable/" + this.formSearch.courseNo
  661. )
  662. .then((response) => {
  663. this.coursePropertyList = response.data;
  664. });
  665. } else {
  666. this.coursePropertyList = [];
  667. }
  668. },
  669. //查询一级属性
  670. searchFirst() {
  671. if (this.formSearch.coursePropertyName) {
  672. this.formSearch.firstPropertyId = "";
  673. this.formSearch.secondPropertyId = "";
  674. for (let courseProperty of this.coursePropertyList) {
  675. if (courseProperty.name == this.formSearch.coursePropertyName) {
  676. this.$http
  677. .get(QUESTION_API + "/property/first/" + courseProperty.id)
  678. .then((response) => {
  679. this.firstPropertyList = response.data;
  680. });
  681. }
  682. }
  683. }
  684. },
  685. //查询二级属性
  686. searchSecond() {
  687. if (this.formSearch.firstPropertyId) {
  688. this.formSearch.secondPropertyId = "";
  689. this.$http
  690. .get(
  691. QUESTION_API + "/property/second/" + this.formSearch.firstPropertyId
  692. )
  693. .then((response) => {
  694. this.secondPropertyList = response.data;
  695. });
  696. }
  697. },
  698. getFirst() {
  699. if (this.formSearch.coursePropertyName) {
  700. for (let courseProperty of this.coursePropertyList) {
  701. if (courseProperty.name == this.formSearch.coursePropertyName) {
  702. this.$http
  703. .get(QUESTION_API + "/property/first/" + courseProperty.id)
  704. .then((response) => {
  705. this.firstPropertyList = response.data;
  706. //查询二级
  707. this.getSecond();
  708. });
  709. }
  710. }
  711. }
  712. },
  713. getSecond() {
  714. if (this.formSearch.firstPropertyId) {
  715. this.$http
  716. .get(
  717. QUESTION_API + "/property/second/" + this.formSearch.firstPropertyId
  718. )
  719. .then((response) => {
  720. this.secondPropertyList = response.data;
  721. });
  722. }
  723. },
  724. initVue() {
  725. this.isClear = this.$route.params.isClear;
  726. if (this.isClear == 0 || !this.isClear) {
  727. sessionStorage.removeItem("question");
  728. sessionStorage.removeItem("question_currentPage");
  729. this.formSearch = {
  730. questionType: "",
  731. courseNo: "",
  732. courseLevel: "",
  733. courseName: "",
  734. publicity: "",
  735. coursePropertyName: "",
  736. firstPropertyId: "",
  737. secondPropertyId: "",
  738. };
  739. this.currentPage = 1;
  740. } else {
  741. this.formSearch = JSON.parse(sessionStorage.getItem("question"));
  742. this.currentPage = parseInt(
  743. sessionStorage.getItem("question_currentPage")
  744. );
  745. }
  746. if (this.formSearch && this.formSearch.courseName) {
  747. this.getCourses(this.formSearch.courseName);
  748. } else {
  749. this.formSearch = {
  750. questionType: "",
  751. courseNo: "",
  752. courseLevel: "",
  753. courseName: "",
  754. publicity: "",
  755. coursePropertyName: "",
  756. firstPropertyId: "",
  757. secondPropertyId: "",
  758. };
  759. }
  760. this.searchQues();
  761. },
  762. },
  763. };
  764. </script>
  765. <style scoped>
  766. .select_width {
  767. width: 150px;
  768. }
  769. .row_quesBody >>> p {
  770. text-overflow: ellipsis;
  771. overflow: hidden;
  772. }
  773. </style>
  774. <style scoped src="../styles/Common.css"></style>