ExportStructure.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810
  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. v-model="formSearch.examType"
  16. class="search_width"
  17. filterable
  18. clearable
  19. placeholder="请选择"
  20. size="small"
  21. @change="searchExams"
  22. >
  23. <el-option
  24. v-for="item in EXAM_TYPES"
  25. :key="item.value"
  26. :label="item.label"
  27. :value="item.value"
  28. >
  29. </el-option>
  30. </el-select>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :span="6">
  34. <el-form-item label="考试名称">
  35. <el-select
  36. v-model="formSearch.examId"
  37. class="search_width"
  38. filterable
  39. :remote-method="getExams"
  40. remote
  41. clearable
  42. placeholder="请选择"
  43. size="small"
  44. >
  45. <el-option
  46. v-for="item in examList"
  47. :key="item.id"
  48. :label="item.name"
  49. :value="item.id"
  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. v-model="formSearch.exportType"
  59. class="search_width"
  60. filterable
  61. clearable
  62. placeholder="请选择"
  63. size="small"
  64. >
  65. <el-option
  66. v-for="item in EXPORT_TYPES"
  67. :key="item.value"
  68. :label="item.label"
  69. :value="item.value"
  70. >
  71. </el-option>
  72. </el-select>
  73. </el-form-item>
  74. </el-col>
  75. <el-col :span="6">
  76. <div class="search_down">
  77. <el-button size="small" type="primary" @click="searchFrom"
  78. ><i class="el-icon-search"></i> 查询</el-button
  79. >
  80. <el-button size="small" @click="resetForm"
  81. ><i class="el-icon-refresh"></i> 重 置</el-button
  82. >
  83. <el-button size="small" type="primary" @click="add"
  84. ><i class="el-icon-plus"></i> 新增</el-button
  85. >
  86. </div>
  87. </el-col>
  88. </el-row>
  89. </el-form>
  90. <div
  91. style="width: 100%; border-bottom: 1px solid #ddd; margin: 10px 0"
  92. ></div>
  93. <!-- 页面列表 -->
  94. <el-table border :data="tableData">
  95. <el-table-column label="考试类型">
  96. <template slot-scope="scope">
  97. <span>{{ scope.row.examType | examTypesFilter }}</span>
  98. </template>
  99. </el-table-column>
  100. <el-table-column label="考试名称">
  101. <template slot-scope="scope">
  102. <span>{{ scope.row.examName }}</span>
  103. </template>
  104. </el-table-column>
  105. <el-table-column label="导出类型">
  106. <template slot-scope="scope">
  107. <span>{{ scope.row.exportType | exportTypesFilter }}</span>
  108. </template>
  109. </el-table-column>
  110. <el-table-column label="题数">
  111. <template slot-scope="scope">
  112. <div
  113. v-for="(item, index) in scope.row.questionTypeNums"
  114. v-show="scope.row.exportType == 'NORMAL'"
  115. :key="index"
  116. >
  117. <span>{{ item.questionType | questionType }}</span>
  118. <span>{{ item.quantity }}</span>
  119. </div>
  120. </template>
  121. </el-table-column>
  122. <el-table-column label="操作" width="175">
  123. <template slot-scope="scope">
  124. <div class="operate_left">
  125. <el-button
  126. size="mini"
  127. type="primary"
  128. plain
  129. @click="copy(scope.row)"
  130. ><i class="el-icon-edit"></i>复用</el-button
  131. >
  132. <el-button size="mini" type="danger" @click="del(scope.row)"
  133. ><i class="el-icon-delete"></i> 删除</el-button
  134. >
  135. </div>
  136. </template>
  137. </el-table-column>
  138. </el-table>
  139. <div class="page pull-right">
  140. <el-pagination
  141. :current-page="currentPage"
  142. :page-size="pageSize"
  143. :page-sizes="[10, 20, 50, 100, 200, 300]"
  144. layout="total, sizes, prev, pager, next, jumper"
  145. :total="total"
  146. @current-change="handleCurrentChange"
  147. @size-change="handleSizeChange"
  148. >
  149. </el-pagination>
  150. </div>
  151. </div>
  152. <!-- 复用窗口 -->
  153. <el-dialog
  154. title="试卷结构复用"
  155. :visible.sync="dialogCopyModel"
  156. width="500px"
  157. >
  158. <el-form
  159. :model="exportStructureCopy"
  160. label-position="right"
  161. label-width="120px"
  162. >
  163. <el-tabs> <el-tab-pane label="原结构信息"></el-tab-pane> </el-tabs>
  164. <el-form-item label="考试类型">
  165. <el-select
  166. v-model="exportStructureCopy.examTypeOld"
  167. placeholder="请选择"
  168. disabled
  169. >
  170. <el-option
  171. v-for="item in EXAM_TYPES"
  172. :key="item.value"
  173. :label="item.label"
  174. :value="item.value"
  175. ></el-option>
  176. </el-select>
  177. </el-form-item>
  178. <el-form-item label="考试名称">
  179. <el-select
  180. v-model="exportStructureCopy.examIdOld"
  181. placeholder="请选择"
  182. disabled
  183. >
  184. <el-option
  185. v-for="item in examList"
  186. :key="item.id"
  187. :label="item.name"
  188. :value="item.id"
  189. ></el-option>
  190. </el-select>
  191. </el-form-item>
  192. <el-form-item label="导出类型">
  193. <el-select
  194. v-model="exportStructureCopy.exportTypeOld"
  195. placeholder="请选择"
  196. disabled
  197. >
  198. <el-option
  199. v-for="item in EXPORT_TYPES"
  200. :key="item.value"
  201. :label="item.label"
  202. :value="item.value"
  203. ></el-option>
  204. </el-select>
  205. </el-form-item>
  206. <el-tabs> <el-tab-pane label="新结构信息"></el-tab-pane> </el-tabs>
  207. <el-form-item label="考试类型">
  208. <el-select
  209. v-model="exportStructureCopy.examType"
  210. placeholder="请选择"
  211. @change="searchExamId"
  212. >
  213. <el-option
  214. v-for="item in EXAM_TYPES"
  215. :key="item.value"
  216. :label="item.label"
  217. :value="item.value"
  218. ></el-option>
  219. </el-select>
  220. <span
  221. v-if="check_value(exportStructureCopy.examType)"
  222. class="error_message error_other"
  223. >请选择考试类型</span
  224. >
  225. </el-form-item>
  226. <el-form-item label="考试名称">
  227. <el-select v-model="exportStructureCopy.examId" placeholder="请选择">
  228. <el-option
  229. v-for="item in examListNew"
  230. :key="item.id"
  231. :label="item.name"
  232. :value="item.id"
  233. ></el-option>
  234. </el-select>
  235. <span
  236. v-if="check_value(exportStructureCopy.examId)"
  237. class="error_message error_other"
  238. >请选择考试名称</span
  239. >
  240. </el-form-item>
  241. <el-row class="margin_top_10 margin_left_120">
  242. <el-button type="primary" @click="saveCopy">保 存</el-button>
  243. <!-- <el-button @click="resetForm3"
  244. ><i class="el-icon-refresh"></i> 重 置</el-button
  245. > -->
  246. <el-button type="primary" @click="cancleCopy"
  247. ><i class="el-icon-arrow-left"></i> 返 回</el-button
  248. >
  249. </el-row>
  250. </el-form>
  251. </el-dialog>
  252. <!-- 新增窗口 -->
  253. <el-dialog title="新增导出结构" :visible.sync="dialogModel" width="500px">
  254. <el-form
  255. :model="exportStructure"
  256. label-position="right"
  257. label-width="78px"
  258. :inline="true"
  259. >
  260. <el-row>
  261. <div style="color: #f56c6c; margin-bottom: -30px">*</div>
  262. <el-form-item label="考试类型">
  263. <el-select
  264. v-model="exportStructure.examType"
  265. placeholder="请选择"
  266. @change="searchExportStructure('examType')"
  267. >
  268. <el-option
  269. v-for="item in EXAM_TYPES"
  270. :key="item.value"
  271. :label="item.label"
  272. :value="item.value"
  273. ></el-option>
  274. </el-select>
  275. <span
  276. v-if="check_value(exportStructure.examType)"
  277. class="error_message error_other"
  278. >请选择考试类型</span
  279. >
  280. </el-form-item>
  281. </el-row>
  282. <el-row>
  283. <div style="color: #f56c6c; margin-bottom: -30px; margin-top: 8px">
  284. *
  285. </div>
  286. <el-form-item label="考试名称">
  287. <el-select
  288. v-model="exportStructure.examId"
  289. filterable
  290. placeholder="请选择"
  291. @change="searchExportStructure('examId')"
  292. >
  293. <el-option
  294. v-for="item in examListByExamType"
  295. :key="item.id"
  296. :label="item.name"
  297. :value="item.id"
  298. ></el-option>
  299. </el-select>
  300. <span
  301. v-if="check_value(exportStructure.examId)"
  302. class="error_message error_other"
  303. >请选择考试名称</span
  304. >
  305. </el-form-item>
  306. </el-row>
  307. <el-row>
  308. <div style="color: #f56c6c; margin-bottom: -30px; margin-top: 8px">
  309. *
  310. </div>
  311. <el-form-item label="导出类型">
  312. <el-select
  313. v-model="exportStructure.exportType"
  314. placeholder="请选择"
  315. :disabled="button"
  316. >
  317. <el-option
  318. v-for="item in EXPORT_TYPES"
  319. :key="item.value"
  320. :label="item.label"
  321. :value="item.value"
  322. ></el-option>
  323. </el-select>
  324. <span
  325. v-if="check_value(exportStructure.exportType)"
  326. class="error_message error_other"
  327. >请选择导出类型</span
  328. >
  329. </el-form-item>
  330. </el-row>
  331. <!-- 判断机考还是传统 -->
  332. <div v-if="exportStructure.exportType == 'NORMAL'">
  333. <div
  334. v-for="(item, index) in exportStructure.questionTypeNums"
  335. :key="index"
  336. >
  337. <el-row>
  338. <div
  339. style="
  340. color: #f56c6c;
  341. margin-bottom: -30px;
  342. margin-left: 26px;
  343. margin-top: 8px;
  344. "
  345. >
  346. *
  347. </div>
  348. <el-form-item
  349. :label="item.questionType | questionType"
  350. label-width="78px"
  351. >
  352. <el-input
  353. v-model="item.quantity"
  354. style="width: 220px"
  355. :disabled="button"
  356. ></el-input>
  357. <span
  358. v-if="check(item.quantity)"
  359. class="error_message error_other"
  360. >
  361. 请输入正整数或0
  362. </span>
  363. </el-form-item>
  364. </el-row>
  365. </div>
  366. </div>
  367. <el-row class="margin_top_10 margin_left_120">
  368. <el-button type="primary" :disabled="button" @click="save"
  369. >保 存</el-button
  370. >
  371. <!-- <el-button @click="resetForm2"
  372. ><i class="el-icon-refresh"></i> 重 置</el-button
  373. > -->
  374. <el-button type="primary" @click="cancel"
  375. ><i class="el-icon-arrow-left"></i> 返 回</el-button
  376. >
  377. </el-row>
  378. </el-form>
  379. </el-dialog>
  380. </section>
  381. </template>
  382. <script>
  383. import { QUESTION_API, EXAM_WORK_API } from "@/constants/constants";
  384. import { EXAM_TYPES, EXPORT_TYPES } from "../constants/constants";
  385. import { mapState } from "vuex";
  386. import _ from "lodash";
  387. export default {
  388. data() {
  389. return {
  390. isShow: false,
  391. loading: false,
  392. dialogModel: false,
  393. dialogCopyModel: false,
  394. formSearch: {
  395. examType: null,
  396. examId: null,
  397. exportType: null,
  398. },
  399. exportStructure: {
  400. examType: "",
  401. examId: "",
  402. examName: "",
  403. exportType: "",
  404. useable: "1", //默认启用
  405. questionTypeNums: [
  406. {
  407. questionType: "SINGLE_ANSWER_QUESTION",
  408. quantity: "",
  409. },
  410. {
  411. questionType: "MULTIPLE_ANSWER_QUESTION",
  412. quantity: "",
  413. },
  414. {
  415. questionType: "BOOL_ANSWER_QUESTION",
  416. quantity: "",
  417. },
  418. ],
  419. },
  420. exportStructureCopy: {
  421. examTypeOld: "",
  422. examIdOld: "",
  423. exportTypeOld: "",
  424. examType: "",
  425. examId: "",
  426. useable: "1",
  427. questionTypeNums: [
  428. {
  429. questionType: "SINGLE_ANSWER_QUESTION",
  430. quantity: "",
  431. },
  432. {
  433. questionType: "MULTIPLE_ANSWER_QUESTION",
  434. quantity: "",
  435. },
  436. {
  437. questionType: "BOOL_ANSWER_QUESTION",
  438. quantity: "",
  439. },
  440. ],
  441. },
  442. EXAM_TYPES: EXAM_TYPES,
  443. EXPORT_TYPES: EXPORT_TYPES,
  444. examList: [],
  445. examListByExamType: [],
  446. tableData: [],
  447. pageSize: 10,
  448. currentPage: 1,
  449. total: 10,
  450. button: false,
  451. examListNew: [],
  452. disMessage: false,
  453. reShow: false,
  454. };
  455. },
  456. computed: {
  457. ...mapState({ user: (state) => state.user }),
  458. },
  459. created() {
  460. this.getExams("");
  461. this.search();
  462. },
  463. methods: {
  464. resetForm() {
  465. this.formSearch = {
  466. examType: null,
  467. examId: null,
  468. exportType: null,
  469. };
  470. },
  471. searchFrom() {
  472. this.currentPage = 1;
  473. this.search();
  474. },
  475. search() {
  476. if (this.formSearch.examType === "") {
  477. this.formSearch.examType = null;
  478. }
  479. this.tableData = [];
  480. this.loading = true;
  481. var url =
  482. QUESTION_API +
  483. "/findPageByExportStructure/" +
  484. this.currentPage +
  485. "/" +
  486. this.pageSize;
  487. this.$http.post(url, this.formSearch).then((response) => {
  488. this.tableData = response.data.content;
  489. this.total = response.data.totalElements;
  490. this.loading = false;
  491. });
  492. },
  493. //新增考试结构
  494. add() {
  495. this.dialogModel = true;
  496. this.button = false;
  497. this.isShow = false;
  498. this.exportStructure = {
  499. examType: "",
  500. examId: "",
  501. examName: "",
  502. exportType: "",
  503. useable: "1", //默认启用
  504. questionTypeNums: [
  505. {
  506. questionType: "SINGLE_ANSWER_QUESTION",
  507. quantity: "",
  508. },
  509. {
  510. questionType: "MULTIPLE_ANSWER_QUESTION",
  511. quantity: "",
  512. },
  513. {
  514. questionType: "BOOL_ANSWER_QUESTION",
  515. quantity: "",
  516. },
  517. ],
  518. };
  519. },
  520. handleCurrentChange(val) {
  521. this.currentPage = val;
  522. this.search();
  523. },
  524. handleSizeChange(val) {
  525. this.pageSize = val;
  526. this.currentPage = 1;
  527. this.search();
  528. },
  529. closeQuesDialog() {
  530. this.dialogModel = false;
  531. },
  532. //表单验证
  533. check(value) {
  534. if (this.disMessage) {
  535. return false;
  536. }
  537. if (this.reShow) {
  538. return false;
  539. }
  540. var r = /^\+?[1-9][0-9]*$/;
  541. if ((r.test(value) || value === "0") && this.isShow) {
  542. return false;
  543. }
  544. return true;
  545. },
  546. check_value(value) {
  547. if (!value && this.isShow) {
  548. return true;
  549. }
  550. return false;
  551. },
  552. save() {
  553. this.reShow = false;
  554. this.isShow = true;
  555. if (this.check_value(this.exportStructure.examType)) {
  556. return false;
  557. }
  558. if (this.check_value(this.exportStructure.examId)) {
  559. return false;
  560. }
  561. if (this.check_value(this.exportStructure.exportType)) {
  562. return false;
  563. }
  564. if (this.exportStructure.exportType == "NORMAL") {
  565. for (var i = 0; i < this.exportStructure.questionTypeNums.length; i++) {
  566. if (this.check(this.exportStructure.questionTypeNums[i].quantity)) {
  567. return false;
  568. }
  569. }
  570. }
  571. let examId = this.exportStructure.examId;
  572. this.exportStructure.examName = _.filter(this.examList, function (item) {
  573. return item.id == examId;
  574. })[0].name;
  575. this.$http
  576. .post(QUESTION_API + "/saveExportStructure", this.exportStructure)
  577. .then(() => {
  578. this.$notify({
  579. title: "提示",
  580. message: "保存成功",
  581. type: "success",
  582. });
  583. this.closeQuesDialog();
  584. this.search();
  585. });
  586. },
  587. //重置2
  588. resetForm2() {
  589. this.exportStructure = {
  590. examType: "",
  591. examId: "",
  592. examName: "",
  593. exportType: "",
  594. useable: "1", //默认启用
  595. questionTypeNums: [
  596. {
  597. questionType: "SINGLE_ANSWER_QUESTION",
  598. quantity: "",
  599. },
  600. {
  601. questionType: "MULTIPLE_ANSWER_QUESTION",
  602. quantity: "",
  603. },
  604. {
  605. questionType: "BOOL_ANSWER_QUESTION",
  606. quantity: "",
  607. },
  608. ],
  609. };
  610. this.isShow = false;
  611. this.button = false;
  612. },
  613. //取消
  614. cancel() {
  615. this.isShow = false;
  616. this.button = false;
  617. this.dialogModel = false;
  618. },
  619. //取消复用
  620. cancleCopy() {
  621. this.isShow = false;
  622. this.dialogCopyModel = false;
  623. },
  624. //重置3
  625. resetForm3() {
  626. this.exportStructureCopy.examType = "";
  627. this.exportStructureCopy.examId = "";
  628. this.isShow = false;
  629. },
  630. //复用
  631. copy(row) {
  632. this.dialogCopyModel = true;
  633. this.exportStructureCopy.examTypeOld = row.examType;
  634. this.exportStructureCopy.examIdOld = parseInt(row.examId);
  635. this.exportStructureCopy.exportTypeOld = row.exportType;
  636. this.exportStructureCopy.questionTypeNums = row.questionTypeNums;
  637. this.exportStructureCopy.examType = "";
  638. this.exportStructureCopy.examId = "";
  639. },
  640. //新增的时候,先查询
  641. searchExportStructure(type) {
  642. this.disMessage = false;
  643. if (type == "examType") {
  644. this.$http
  645. .get(
  646. EXAM_WORK_API +
  647. "/exam/queryByNameLike?enable=true&name=&examTypes=" +
  648. this.exportStructure.examType
  649. )
  650. .then((response) => {
  651. this.examListByExamType = response.data;
  652. this.exportStructure.examId = "";
  653. this.resetExportStructure();
  654. });
  655. }
  656. if (this.exportStructure.examType && this.exportStructure.examId) {
  657. var url =
  658. QUESTION_API + "/findExportStructure/" + this.exportStructure.examId;
  659. this.$http
  660. .get(url)
  661. .then((response) => {
  662. console.log(response);
  663. if (!response.data.id) {
  664. //如果没有数据
  665. this.resetExportStructure();
  666. } else {
  667. this.button = true;
  668. this.exportStructure.exportType = response.data.exportType;
  669. this.exportStructure.useable = response.data.useable
  670. ? response.data.useable.toString()
  671. : "1";
  672. for (
  673. var i = 0;
  674. i < this.exportStructure.questionTypeNums.length;
  675. i++
  676. ) {
  677. this.exportStructure.questionTypeNums[i].quantity =
  678. response.data.questionTypeNums[i].quantity;
  679. }
  680. this.disMessage = true;
  681. console.log("非空对象");
  682. }
  683. })
  684. .catch(() => {});
  685. }
  686. },
  687. resetExportStructure() {
  688. this.button = false;
  689. this.reShow = true;
  690. this.exportStructure.exportType = "";
  691. this.exportStructure.useable = "1";
  692. for (var i = 0; i < this.exportStructure.questionTypeNums.length; i++) {
  693. this.exportStructure.questionTypeNums[i].quantity = "";
  694. }
  695. },
  696. //点击复用,选择
  697. searchExamId() {
  698. if (this.exportStructureCopy.examType) {
  699. this.$http
  700. .get(
  701. EXAM_WORK_API +
  702. "/exam/queryByNameLike?enable=true&name=&examTypes=" +
  703. this.exportStructureCopy.examType
  704. )
  705. .then((response) => {
  706. let examListFilter = response.data;
  707. var url =
  708. QUESTION_API +
  709. "/findExportStructureByExamType/" +
  710. this.exportStructureCopy.examType;
  711. this.$http.get(url).then((response) => {
  712. let examListOld = response.data;
  713. //两个数组相减
  714. this.examListNew = _.filter(examListFilter, function (exam) {
  715. return examListOld.indexOf(exam.id.toString()) == -1;
  716. });
  717. });
  718. });
  719. }
  720. },
  721. //保存复用
  722. saveCopy() {
  723. this.isShow = true;
  724. if (this.check_value(this.exportStructureCopy.examType) === true) {
  725. return false;
  726. }
  727. if (this.check_value(this.exportStructureCopy.examId) === true) {
  728. return false;
  729. }
  730. this.exportStructure.examType = this.exportStructureCopy.examType;
  731. this.exportStructure.examId = this.exportStructureCopy.examId;
  732. this.exportStructure.exportType = this.exportStructureCopy.exportTypeOld;
  733. this.exportStructure.useable = this.exportStructureCopy.useable;
  734. this.exportStructure.questionTypeNums =
  735. this.exportStructureCopy.questionTypeNums;
  736. let examId = this.exportStructure.examId;
  737. this.exportStructure.examName = _.filter(
  738. this.examListNew,
  739. function (item) {
  740. return item.id == examId;
  741. }
  742. )[0].name;
  743. this.$http
  744. .post(QUESTION_API + "/saveExportStructure", this.exportStructure)
  745. .then(() => {
  746. this.$notify({
  747. title: "提示",
  748. message: "保存成功",
  749. type: "success",
  750. });
  751. this.dialogCopyModel = false;
  752. this.search();
  753. });
  754. },
  755. //删除
  756. del(row) {
  757. this.$confirm("是否删除该条导出结构", "提示", {
  758. confirmButtonText: "确定",
  759. cancelButtonText: "取消",
  760. type: "warning",
  761. }).then(() => {
  762. this.loading = true;
  763. var url = QUESTION_API + "/deleteExportStructure/" + row.id;
  764. this.$http.delete(url).then(
  765. () => {
  766. this.$notify({
  767. type: "success",
  768. message: "删除成功!",
  769. });
  770. this.loading = false;
  771. this.search();
  772. },
  773. () => {
  774. this.$notify({
  775. type: "error",
  776. message: "删除失败!",
  777. });
  778. this.loading = false;
  779. }
  780. );
  781. });
  782. this.loading = false;
  783. },
  784. //查询考试
  785. getExams(query) {
  786. query = query.trim();
  787. var examType = this.formSearch.examType;
  788. if (this.formSearch.examType == null) {
  789. examType = "";
  790. }
  791. this.$http
  792. .get(
  793. EXAM_WORK_API +
  794. "/exam/queryByNameLike?enable=true&name=" +
  795. query +
  796. "&examTypes=" +
  797. examType
  798. )
  799. .then((response) => {
  800. this.examList = response.data;
  801. });
  802. },
  803. searchExams() {
  804. this.formSearch.examId = null;
  805. this.getExams("");
  806. },
  807. },
  808. };
  809. </script>
  810. <style scoped src="../styles/Common.css"></style>