EditSelectQuestion.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  1. <template>
  2. <div v-loading="fullscreenLoading">
  3. <!-- 头信息 -->
  4. <div class="part-box">
  5. <div class="part-box-header">
  6. <h1 class="part-box-title">
  7. {{ quesModel.id ? "试题修改" : "试题新增" }}
  8. </h1>
  9. <div>
  10. <el-button
  11. type="primary"
  12. icon="icon icon-save-white"
  13. :disabled="saveDisabled"
  14. @click="submitForm('quesModel')"
  15. >保存</el-button
  16. >
  17. <el-button
  18. type="danger"
  19. plain
  20. icon="icon icon-back"
  21. @click="backToQuesList()"
  22. >返回
  23. </el-button>
  24. </div>
  25. </div>
  26. <!-- 正文信息 -->
  27. <el-form
  28. ref="quesModel"
  29. class="padding-tb-20 form-tight"
  30. :model="quesModel"
  31. :rules="rules"
  32. label-width="100px"
  33. >
  34. <el-form-item label="题型">
  35. <el-select
  36. v-model="quesModel.questionType"
  37. :disabled="true"
  38. placeholder="请输入题型"
  39. >
  40. <el-option
  41. v-for="item in questionTypes"
  42. :key="item.value"
  43. :label="item.label"
  44. :value="item.value"
  45. >
  46. </el-option>
  47. </el-select>
  48. </el-form-item>
  49. <!--
  50. <el-form-item label="分数">
  51. <el-input placeholder="分数" v-model="quesModel.score" style="width:50px;"></el-input>
  52. </el-form-item>
  53. -->
  54. <!-- created by weiwenhai -->
  55. <el-form-item label="难度">
  56. <el-select
  57. v-model="quesModel.difficultyDegree"
  58. placeholder="请输入难度"
  59. >
  60. <el-option
  61. v-for="item in difficultyDegreeList"
  62. :key="item.value"
  63. :label="item.label"
  64. :value="item.value"
  65. >
  66. </el-option>
  67. </el-select>
  68. </el-form-item>
  69. <el-form-item label="公开度">
  70. <el-select v-model="quesModel.publicity" placeholder="请输入公开度">
  71. <el-option
  72. v-for="item in publicityList"
  73. :key="item.value"
  74. :label="item.label"
  75. :value="item.value"
  76. >
  77. </el-option>
  78. </el-select>
  79. </el-form-item>
  80. <el-form-item
  81. v-if="quesModel.questionType == 'TEXT_ANSWER_QUESTION'"
  82. label="作答类型"
  83. >
  84. <el-select v-model="quesModel.answerType">
  85. <el-option
  86. v-for="item in answerTypes"
  87. :key="item.value"
  88. :label="item.label"
  89. :value="item.value"
  90. >
  91. </el-option>
  92. </el-select>
  93. </el-form-item>
  94. <el-form-item label="属性列表">
  95. <el-tooltip
  96. v-for="(content, index) in quesModel.quesProperties"
  97. :key="index"
  98. placement="top"
  99. >
  100. <div slot="content">
  101. <span v-if="content.firstProperty != null"
  102. >一级属性:{{ content.firstProperty.name }}({{
  103. content.firstProperty.code
  104. }})</span
  105. ><br />
  106. <span v-if="content.secondProperty != null"
  107. >二级属性:{{ content.secondProperty.name }}({{
  108. content.secondProperty.code
  109. }})</span
  110. >
  111. </div>
  112. <el-tag
  113. :key="content.id"
  114. style="margin-right: 5px"
  115. closable
  116. effect="dark"
  117. type="primary"
  118. @close="handleClose(content)"
  119. >
  120. {{ content.coursePropertyName || content.courseProperty.name }}
  121. </el-tag>
  122. </el-tooltip>
  123. </el-form-item>
  124. <el-row :gutter="10">
  125. <el-col :xs="6" :sm="6" :md="6" :lg="6">
  126. <el-form-item label="属性名">
  127. <el-select
  128. v-model="coursePropertyId"
  129. :remote-method="getCoursesProperty"
  130. :loading="coursePropertyLoading"
  131. remote
  132. filterable
  133. clearable
  134. placeholder="属性名"
  135. class="property_with"
  136. @change="searchFirst"
  137. >
  138. <el-option
  139. v-for="item in coursePropertyList"
  140. :key="item.id"
  141. :label="item.name"
  142. :value="item.id"
  143. >
  144. </el-option>
  145. </el-select>
  146. </el-form-item>
  147. </el-col>
  148. <el-col :xs="6" :sm="6" :md="6" :lg="6">
  149. <el-form-item label="一级">
  150. <el-select
  151. v-model="firstPropertyId"
  152. placeholder="一级"
  153. class="property_with"
  154. @change="searchSecond"
  155. >
  156. <el-option
  157. v-for="item in firstPropertyList"
  158. :key="item.id"
  159. :label="item.name + '(' + item.code + ')'"
  160. :value="item.id"
  161. >
  162. </el-option>
  163. </el-select>
  164. </el-form-item>
  165. </el-col>
  166. <el-col :xs="6" :sm="6" :md="6" :lg="6">
  167. <el-form-item label="二级">
  168. <el-select
  169. v-model="secondPropertyId"
  170. placeholder="二级"
  171. class="property_with"
  172. >
  173. <el-option
  174. v-for="item in secondPropertyList"
  175. :key="item.id"
  176. :label="item.name + '(' + item.code + ')'"
  177. :value="item.id"
  178. >
  179. </el-option>
  180. </el-select>
  181. </el-form-item>
  182. </el-col>
  183. <el-col :xs="3" :sm="3" :md="3" :lg="3">
  184. <el-form-item label-width="0px">
  185. <el-button
  186. type="primary"
  187. icon="icon icon-plus-white"
  188. @click="insertProperty"
  189. >新增属性</el-button
  190. >
  191. </el-form-item>
  192. </el-col>
  193. </el-row>
  194. <!-- end -->
  195. </el-form>
  196. </div>
  197. <div class="part-box">
  198. <el-form class="form-tight" label-width="100px">
  199. <el-form-item label="题干" prop="quesBody">
  200. <v-editor v-model="quesModel.quesBody"></v-editor>
  201. </el-form-item>
  202. <el-form-item
  203. v-for="(option, index) in quesModel.quesOptions"
  204. :key="option.number"
  205. >
  206. <div class="question-edit-option">
  207. <div class="option-check">
  208. <el-radio
  209. v-if="quesModel.questionType === 'SINGLE_ANSWER_QUESTION'"
  210. v-model="singleRightAnswer"
  211. :label="index | optionOrderWordFilter"
  212. ></el-radio>
  213. <el-checkbox
  214. v-if="quesModel.questionType === 'MULTIPLE_ANSWER_QUESTION'"
  215. v-model="multipleRightAnswer"
  216. :label="index | optionOrderWordFilter"
  217. ></el-checkbox>
  218. </div>
  219. <div class="option-body">
  220. <v-editor v-model="option.optionBody"></v-editor>
  221. </div>
  222. <div class="option-delete">
  223. <el-button
  224. size="mini"
  225. circle
  226. type="danger"
  227. icon="el-icon-delete"
  228. title="删除"
  229. @click.prevent="removeQuesOption(option)"
  230. ></el-button>
  231. </div>
  232. </div>
  233. </el-form-item>
  234. <el-form-item>
  235. <el-button
  236. type="primary"
  237. icon="icon icon-plus-white"
  238. @click="addQuesOption"
  239. >新增选项</el-button
  240. >
  241. </el-form-item>
  242. <div class="line-seperator"></div>
  243. <el-form-item label="答案">
  244. <div v-html="answer"></div>
  245. </el-form-item>
  246. </el-form>
  247. </div>
  248. </div>
  249. </template>
  250. <script>
  251. import { QUESTION_API } from "@/constants/constants";
  252. import { isEmptyStr, QUESTION_TYPES } from "../constants/constants";
  253. import { checkRichTextContentIsEmpty } from "@/plugins/utils";
  254. export default {
  255. name: "EditSelectApp",
  256. data() {
  257. return {
  258. coursePropertyLoading: false,
  259. questionTypes: QUESTION_TYPES,
  260. fullscreenLoading: false,
  261. paperId: "",
  262. paperDetailId: "",
  263. questionId: "",
  264. quesModel: {
  265. quesBody: "",
  266. quesOptions: [],
  267. quesAnswer: "",
  268. questionType: "",
  269. courseId: "",
  270. difficultyDegree: 0.5,
  271. publicity: true,
  272. answerType: "",
  273. quesProperties: [],
  274. score: 1,
  275. },
  276. difficultyDegreeList: [
  277. { label: 0.1, value: 0.1 },
  278. { label: 0.2, value: 0.2 },
  279. { label: 0.3, value: 0.3 },
  280. { label: 0.4, value: 0.4 },
  281. { label: 0.5, value: 0.5 },
  282. { label: 0.6, value: 0.6 },
  283. { label: 0.7, value: 0.7 },
  284. { label: 0.8, value: 0.8 },
  285. { label: 0.9, value: 0.9 },
  286. { label: 1.0, value: 1.0 },
  287. ],
  288. publicityList: [
  289. { label: "公开", value: true },
  290. { label: "非公开", value: false },
  291. ],
  292. answerTypes: [
  293. { label: "文本", value: "DIVERSIFIED_TEXT" },
  294. { label: "音频", value: "SINGLE_AUDIO" },
  295. ],
  296. coursePropertyList: [],
  297. coursePropertyId: "", //课程属性名
  298. firstPropertyList: [], //一级属性集合
  299. firstPropertyId: "", //一级属性id
  300. secondPropertyList: [], //二级属性集合
  301. secondPropertyId: "", //二级属性id
  302. //验证
  303. rules: {
  304. // quesBody: [
  305. // { required: true, message: '请输入题干', trigger: 'blur'}
  306. // ]
  307. },
  308. singleRightAnswer: "", //接收单选答案
  309. multipleRightAnswer: [], //接收多选答案
  310. };
  311. },
  312. computed: {
  313. answer() {
  314. if (this.quesModel.questionType == "SINGLE_ANSWER_QUESTION") {
  315. return this.singleRightAnswer;
  316. } else if (this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION") {
  317. var obj = this.multipleRightAnswer;
  318. return obj.sort().toString();
  319. }
  320. return this.quesModel.quesAnswer;
  321. },
  322. saveDisabled() {
  323. if (!this.questionId && this.quesModel.quesOptions.length == 0) {
  324. return true;
  325. }
  326. return false;
  327. },
  328. },
  329. created() {
  330. let questionId = this.$route.params.id;
  331. if (questionId) {
  332. this.questionId = questionId;
  333. this.quesModel["id"] = questionId;
  334. this.findQuestionById(questionId);
  335. }
  336. this.paperId = this.$route.params.paperId;
  337. this.paperDetailId = this.$route.params.paperDetailId;
  338. this.courseId = this.$route.params.courseId;
  339. let questionType = this.$route.params.questionType;
  340. if (questionType) {
  341. this.quesModel.questionType = questionType;
  342. }
  343. if (this.courseId) {
  344. this.getCoursesProperty("");
  345. }
  346. if (isEmptyStr(this.quesModel.answerType)) {
  347. this.quesModel.answerType = "DIVERSIFIED_TEXT";
  348. }
  349. },
  350. mounted() {
  351. setTimeout(() => {
  352. if (this.quesModel.id) {
  353. this.$store.commit("UPDATE_CURRENT_PATHS", ["试题管理", "试题修改"]);
  354. } else {
  355. this.$store.commit("UPDATE_CURRENT_PATHS", ["试题管理", "试题新增"]);
  356. }
  357. }, 200);
  358. },
  359. methods: {
  360. getQuesPropertyKey(quesProp) {
  361. if (!quesProp) {
  362. return "";
  363. } else if (quesProp.secondProperty.id) {
  364. return (
  365. quesProp.courseProperty.id +
  366. "-" +
  367. quesProp.firstProperty.id +
  368. "-" +
  369. quesProp.secondProperty.id
  370. );
  371. } else {
  372. return quesProp.courseProperty.id + "-" + quesProp.firstProperty.id;
  373. }
  374. },
  375. getCoursesProperty(name) {
  376. this.coursePropertyLoading = true;
  377. this.$httpWithMsg
  378. .get(
  379. QUESTION_API +
  380. "/courseProperty/enable?courseId=" +
  381. this.courseId +
  382. "&name=" +
  383. name
  384. )
  385. .then((response) => {
  386. this.coursePropertyList = response.data;
  387. this.coursePropertyLoading = false;
  388. });
  389. },
  390. findQuestionById(questionId) {
  391. this.$http
  392. .get(QUESTION_API + "/question/" + questionId)
  393. .then((response) => {
  394. this.quesModel = response.data;
  395. this.courseId = this.quesModel.course.id;
  396. if (this.quesModel.quesOptions) {
  397. for (var i = 0; i < this.quesModel.quesOptions.length; i++) {
  398. var option = this.quesModel.quesOptions[i];
  399. if (
  400. this.quesModel.questionType == "SINGLE_ANSWER_QUESTION" &&
  401. option.isCorrect == 1
  402. ) {
  403. this.singleRightAnswer = String.fromCharCode(65 + i);
  404. }
  405. if (
  406. this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION" &&
  407. option.isCorrect == 1
  408. ) {
  409. this.multipleRightAnswer.push(String.fromCharCode(65 + i));
  410. }
  411. }
  412. }
  413. if (isEmptyStr(this.quesModel.answerType)) {
  414. this.quesModel.answerType = "DIVERSIFIED_TEXT";
  415. }
  416. this.getCoursesProperty("");
  417. });
  418. },
  419. submitForm(formName) {
  420. this.$refs[formName].validate((valid) => {
  421. if (valid) {
  422. if (this.quesModel.quesOptions.length > 20) {
  423. this.$notify({
  424. message: "选项最多20个",
  425. type: "error",
  426. });
  427. return;
  428. }
  429. if (
  430. this.quesModel.quesOptions.length &&
  431. this.quesModel.quesOptions.some((item) =>
  432. checkRichTextContentIsEmpty(item.optionBody)
  433. )
  434. ) {
  435. this.$notify({
  436. message: "有选项内容为空",
  437. type: "error",
  438. });
  439. return;
  440. }
  441. this.setRightAnswer();
  442. if (!this.hasAnswer()) {
  443. this.$notify({
  444. message: "请选择答案",
  445. type: "error",
  446. });
  447. return false;
  448. }
  449. if (this.questionId) {
  450. this.editQuestion();
  451. } else {
  452. this.saveNewQuestion();
  453. }
  454. } else {
  455. return false;
  456. }
  457. });
  458. },
  459. //修改试题
  460. editQuestion() {
  461. if (this.quesModel.quesOptions.length == 0) {
  462. this.$confirm("无选项将删除该试题, 是否继续?", "提示", {
  463. confirmButtonText: "确定",
  464. cancelButtonText: "取消",
  465. type: "warning",
  466. })
  467. .then(() => {
  468. this.fullscreenLoading = true;
  469. this.$http
  470. .delete(
  471. QUESTION_API + "/paper/deleteQuestion/" + this.quesModel.id
  472. )
  473. .then((response) => {
  474. if (response.data.length > 0) {
  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.$router.push({ path: "/questions/question_list/0" });
  486. }
  487. });
  488. })
  489. .catch(() => {});
  490. } else {
  491. this.fullscreenLoading = true;
  492. this.$http.put(QUESTION_API + "/question", this.quesModel).then(() => {
  493. this.$notify({
  494. message: "保存成功",
  495. type: "success",
  496. });
  497. this.fullscreenLoading = false;
  498. });
  499. }
  500. },
  501. //新增试题
  502. saveNewQuestion() {
  503. if (!this.quesModel.difficultyDegree) {
  504. this.$notify({
  505. message: "请选择试题难度",
  506. type: "error",
  507. });
  508. return false;
  509. }
  510. this.fullscreenLoading = true;
  511. this.$http
  512. .post(
  513. QUESTION_API +
  514. "/paper/addQuestion/" +
  515. this.paperId +
  516. "/" +
  517. this.paperDetailId,
  518. this.quesModel
  519. )
  520. .then(() => {
  521. this.fullscreenLoading = false;
  522. this.$notify({
  523. type: "success",
  524. message: "保存成功",
  525. });
  526. this.$router.push({ path: "/questions/question_list/0" });
  527. })
  528. .catch(() => {
  529. this.fullscreenLoading = false;
  530. });
  531. },
  532. //新增选项
  533. addQuesOption() {
  534. if (this.quesModel.quesOptions.length >= 20) {
  535. this.$notify({
  536. message: "选项最多20个",
  537. type: "error",
  538. });
  539. return;
  540. }
  541. this.quesModel.quesOptions.push({
  542. number: "",
  543. optionBody: "",
  544. isCorrect: "",
  545. });
  546. for (var i = 0; i < this.quesModel.quesOptions.length; i++) {
  547. this.quesModel.quesOptions[i]["number"] = i + 1;
  548. }
  549. },
  550. //删除选项
  551. removeQuesOption(option) {
  552. this.singleRightAnswer = "";
  553. this.multipleRightAnswer = [];
  554. let index = this.quesModel.quesOptions.indexOf(option);
  555. if (index !== -1) {
  556. this.quesModel.quesOptions.splice(index, 1);
  557. }
  558. if (this.quesModel.quesOptions.length > 0) {
  559. for (var i = 0; i < this.quesModel.quesOptions.length; i++) {
  560. var quesOption = this.quesModel.quesOptions[i];
  561. quesOption["number"] = i + 1;
  562. if (quesOption.isCorrect == 1) {
  563. var answerOrderNum = String.fromCharCode(65 + i);
  564. if (this.quesModel.questionType == "SINGLE_ANSWER_QUESTION") {
  565. this.singleRightAnswer = answerOrderNum;
  566. }
  567. if (this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION") {
  568. this.multipleRightAnswer.push(answerOrderNum);
  569. }
  570. }
  571. }
  572. }
  573. },
  574. //在正确的option上设置isCorrect=1
  575. setRightAnswer() {
  576. if (this.quesModel.quesOptions.length == 0) {
  577. return false;
  578. }
  579. let quesAnswer = [];
  580. for (var i = 0; i < this.quesModel.quesOptions.length; i++) {
  581. var option = this.quesModel.quesOptions[i];
  582. var answerOrderNum = String.fromCharCode(65 + i);
  583. if (this.quesModel.questionType == "SINGLE_ANSWER_QUESTION") {
  584. option["isCorrect"] =
  585. answerOrderNum == this.singleRightAnswer ? 1 : 0;
  586. }
  587. if (this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION") {
  588. option["isCorrect"] =
  589. this.multipleRightAnswer.indexOf(answerOrderNum) > -1 ? 1 : 0;
  590. }
  591. if (option["isCorrect"]) quesAnswer.push(i + 1);
  592. }
  593. this.quesModel.quesAnswer = JSON.stringify(quesAnswer);
  594. },
  595. hasAnswer() {
  596. if (this.quesModel.questionType == "SINGLE_ANSWER_QUESTION") {
  597. if (!this.singleRightAnswer || this.singleRightAnswer == "") {
  598. return false;
  599. } else {
  600. return true;
  601. }
  602. }
  603. if (this.quesModel.questionType == "MULTIPLE_ANSWER_QUESTION") {
  604. if (!this.multipleRightAnswer || this.multipleRightAnswer == "") {
  605. return false;
  606. } else {
  607. return true;
  608. }
  609. }
  610. },
  611. backToQuesList() {
  612. this.$router.push({
  613. path: "/questions/question_list/1",
  614. });
  615. },
  616. //查询一级属性
  617. searchFirst() {
  618. this.firstPropertyId = "";
  619. this.secondPropertyId = "";
  620. this.secondPropertyList = [];
  621. this.$http
  622. .get(QUESTION_API + "/property/first/" + this.coursePropertyId)
  623. .then((response) => {
  624. this.firstPropertyList = response.data;
  625. });
  626. },
  627. //查询二级属性
  628. searchSecond() {
  629. this.secondPropertyId = "";
  630. if (this.firstPropertyId) {
  631. this.$http
  632. .get(QUESTION_API + "/property/second/" + this.firstPropertyId)
  633. .then((response) => {
  634. this.secondPropertyList = response.data;
  635. });
  636. }
  637. },
  638. //新增属性
  639. insertProperty() {
  640. if (!this.checkInsertPro()) {
  641. return false;
  642. }
  643. var quesProperty = {
  644. key: "",
  645. courseProperty: {},
  646. firstProperty: {},
  647. secondProperty: {},
  648. };
  649. if (
  650. this.quesModel.quesProperties === undefined ||
  651. this.quesModel.quesProperties === null ||
  652. this.quesModel.quesProperties.length == 0
  653. ) {
  654. this.quesModel.quesProperties = [];
  655. }
  656. let quesPropertyKey =
  657. this.coursePropertyId +
  658. "-" +
  659. this.firstPropertyId +
  660. "-" +
  661. this.secondPropertyId;
  662. for (let quesPro of this.quesModel.quesProperties) {
  663. if (quesPro.key == quesPropertyKey) {
  664. this.$notify({
  665. message: "该属性已存在,请重新选择",
  666. type: "error",
  667. });
  668. return false;
  669. }
  670. }
  671. for (let property of this.coursePropertyList) {
  672. if (property.id == this.coursePropertyId) {
  673. quesProperty.courseProperty = property;
  674. }
  675. }
  676. //取到一级属性对象
  677. for (let property of this.firstPropertyList) {
  678. if (property.id == this.firstPropertyId) {
  679. quesProperty.firstProperty = property;
  680. }
  681. }
  682. //判断是否有二级属性
  683. if (
  684. this.secondPropertyList != undefined &&
  685. this.secondPropertyList.length > 0
  686. ) {
  687. if (!this.secondPropertyId) {
  688. this.$notify({
  689. message: "请选择二级属性",
  690. type: "error",
  691. });
  692. return false;
  693. }
  694. }
  695. //取到二级属性对象
  696. for (let property of this.secondPropertyList) {
  697. if (property.id == this.secondPropertyId) {
  698. quesProperty.secondProperty = property;
  699. }
  700. }
  701. quesProperty.key = this.getQuesPropertyKey(quesProperty);
  702. this.quesModel.quesProperties.push(quesProperty);
  703. this.quesModel = Object.assign({}, this.quesModel);
  704. //清空下拉框
  705. this.coursePropertyId = "";
  706. this.firstPropertyId = "";
  707. this.secondPropertyId = "";
  708. this.firstPropertyList = [];
  709. this.secondPropertyList = [];
  710. },
  711. //删除属性
  712. handleClose(tag) {
  713. this.quesModel.quesProperties.splice(
  714. this.quesModel.quesProperties.indexOf(tag),
  715. 1
  716. );
  717. this.quesModel = Object.assign({}, this.quesModel);
  718. },
  719. //新增属性验证
  720. checkInsertPro() {
  721. if (!this.coursePropertyId) {
  722. this.$notify({
  723. message: "请选择属性",
  724. type: "error",
  725. });
  726. return false;
  727. }
  728. if (!this.firstPropertyId) {
  729. this.$notify({
  730. message: "请选择一级属性",
  731. type: "error",
  732. });
  733. return false;
  734. }
  735. return true;
  736. },
  737. },
  738. };
  739. </script>