Question.vue 24 KB

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