onlineExamOrgSettings.vue 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. <template>
  2. <div>
  3. <LinkTitlesCustom
  4. :currentPaths="['考试管理', '考试信息', '学习中心设置']"
  5. />
  6. <section class="content">
  7. <div class="box-body">
  8. <el-form
  9. :model="formSearch"
  10. :inline="true"
  11. label-position="right"
  12. label-width="80px"
  13. >
  14. <el-form-item label="学习中心">
  15. <el-select
  16. class="select"
  17. :remote-method="getOrgList4Search"
  18. :loading="loadingOrg4Search"
  19. remote
  20. filterable
  21. clearable
  22. v-model="formSearch.orgId"
  23. placeholder="请选择"
  24. >
  25. <el-option
  26. v-for="item in orgList4Search"
  27. :label="item.name"
  28. :value="item.id"
  29. :key="item.id"
  30. >
  31. </el-option>
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item>
  35. <el-button
  36. size="small"
  37. type="primary"
  38. icon="el-icon-search"
  39. @click="resetPageAndSearch"
  40. >查询</el-button
  41. >
  42. <el-button
  43. size="small"
  44. type="primary"
  45. icon="el-icon-plus"
  46. @click="showAddOrgSetting"
  47. >新增</el-button
  48. >
  49. <el-button
  50. size="small"
  51. type="primary"
  52. icon="el-icon-download"
  53. @click="exportOrgSettings"
  54. >
  55. 导出
  56. </el-button>
  57. <el-button
  58. size="small"
  59. type="primary"
  60. icon="el-icon-upload2"
  61. @click="importOrgSettings"
  62. >
  63. 导入
  64. </el-button>
  65. <el-button size="small" type="primary" @click="back"
  66. >返 回</el-button
  67. >
  68. </el-form-item>
  69. </el-form>
  70. <div class="block-seperator"></div>
  71. <span>批量操作:</span>
  72. <el-button
  73. size="small"
  74. type="success"
  75. icon="el-icon-check"
  76. :disabled="noBatchSelected"
  77. @click="batchNotLimit"
  78. >开考
  79. </el-button>
  80. <el-button
  81. size="small"
  82. type="danger"
  83. icon="el-icon-close"
  84. :disabled="noBatchSelected"
  85. @click="batchLimit"
  86. >禁考
  87. </el-button>
  88. <div style="width: 100%;margin-bottom: 10px;"></div>
  89. <!-- 页面列表 -->
  90. <el-table
  91. :data="tableData"
  92. border
  93. style="width: 100%;text-align:center;"
  94. @selection-change="selectChange"
  95. v-loading="loading4FormSearch"
  96. >
  97. <el-table-column type="selection" width="40"></el-table-column>
  98. <el-table-column prop="id" width="80" label="ID"></el-table-column>
  99. <el-table-column
  100. prop="orgCode"
  101. label="学习中心代码"
  102. sortable
  103. ></el-table-column>
  104. <el-table-column
  105. prop="orgName"
  106. label="学习中心名称"
  107. sortable
  108. ></el-table-column>
  109. <el-table-column
  110. prop="beginTime"
  111. width="155"
  112. label="开始时间"
  113. sortable
  114. >
  115. </el-table-column>
  116. <el-table-column prop="endTime" width="155" label="结束时间" sortable>
  117. </el-table-column>
  118. <el-table-column width="80" label="开考状态">
  119. <span slot-scope="scope">
  120. <span v-if="!scope.row.examLimit">
  121. <el-tooltip
  122. class="item"
  123. effect="dark"
  124. content="开考"
  125. placement="left"
  126. >
  127. <i class="el-icon-success" style="color:green;"></i>
  128. </el-tooltip>
  129. </span>
  130. <span v-else>
  131. <el-tooltip
  132. class="item"
  133. effect="dark"
  134. content="禁考"
  135. placement="left"
  136. >
  137. <i class="el-icon-error" style="color:red;"></i>
  138. </el-tooltip>
  139. </span>
  140. </span>
  141. </el-table-column>
  142. <el-table-column prop="updateTime" width="155" label="更新时间">
  143. </el-table-column>
  144. <el-table-column label="操作" width="200">
  145. <template slot-scope="scope">
  146. <div>
  147. <el-button
  148. v-if="scope.row.examLimit"
  149. size="mini"
  150. type="primary"
  151. plain
  152. icon="el-icon-edit"
  153. @click="updateExamLimit(scope.row)"
  154. >
  155. 开考
  156. </el-button>
  157. <el-button
  158. v-else
  159. size="mini"
  160. type="danger"
  161. icon="el-icon-edit"
  162. @click="updateExamLimit(scope.row)"
  163. >
  164. 禁考
  165. </el-button>
  166. <el-button
  167. size="mini"
  168. type="primary"
  169. plain
  170. icon="el-icon-edit"
  171. @click="showUpdateOrgSetting(scope.row)"
  172. >
  173. 编辑
  174. </el-button>
  175. </div>
  176. </template>
  177. </el-table-column>
  178. </el-table>
  179. <div class="page pull-right">
  180. <el-pagination
  181. @current-change="handleCurrentChange"
  182. :current-page="currentPage"
  183. :page-size="pageSize"
  184. :page-sizes="[10, 20, 50, 100]"
  185. @size-change="handleSizeChange"
  186. layout="total, sizes, prev, pager, next, jumper"
  187. :total="total"
  188. >
  189. </el-pagination>
  190. </div>
  191. <!-- 新增 -->
  192. <el-dialog
  193. title="新增学习中心考试设置"
  194. size="tiny"
  195. :visible.sync="addOrgSettingDialog"
  196. >
  197. <el-form
  198. :model="orgSetting"
  199. :rules="orgSettingRules"
  200. ref="addOrgSettingForm"
  201. label-position="right"
  202. :inline="true"
  203. inline-message
  204. >
  205. <el-row>
  206. <el-form-item label="学习中心" prop="orgId" label-width="120px">
  207. <el-select
  208. class="select"
  209. :remote-method="getOrgList4InsertOrUpdate"
  210. :loading="loadingOrg4InsertOrUpdate"
  211. remote
  212. filterable
  213. clearable
  214. v-model="orgSetting.orgId"
  215. placeholder="请选择"
  216. >
  217. <el-option
  218. v-for="item in orgList4InsertOrUpdate"
  219. :label="item.name"
  220. :value="item.id"
  221. :key="item.id"
  222. >
  223. </el-option>
  224. </el-select>
  225. </el-form-item>
  226. </el-row>
  227. <el-row>
  228. <el-form-item
  229. label="考试时间"
  230. prop="orgSettingDatetimeRange"
  231. label-width="120px"
  232. >
  233. <el-date-picker
  234. v-model="orgSettingDatetimeRange"
  235. type="datetimerange"
  236. range-separator="至"
  237. start-placeholder="开始日期"
  238. end-placeholder="结束日期"
  239. value-format="yyyy-MM-dd HH:mm:ss"
  240. >
  241. </el-date-picker>
  242. </el-form-item>
  243. </el-row>
  244. <el-row>
  245. <el-form-item label="开考状态" label-width="120px">
  246. <el-radio-group v-model="orgSetting.examLimit" class="input">
  247. <el-radio label="true">禁考</el-radio>
  248. <el-radio label="false">开考</el-radio>
  249. </el-radio-group>
  250. </el-form-item>
  251. </el-row>
  252. <el-row>
  253. <div style="text-align:center;">
  254. <el-button type="primary" @click="addOrgSetting"
  255. >确 定</el-button
  256. >
  257. <el-button @click="addOrgSettingDialog = false"
  258. >取 消</el-button
  259. >
  260. </div>
  261. </el-row>
  262. </el-form>
  263. </el-dialog>
  264. <!-- 修改 -->
  265. <el-dialog
  266. title="修改学习中心考试设置"
  267. size="tiny"
  268. :visible.sync="updateOrgSettingDialog"
  269. >
  270. <el-form
  271. :model="orgSetting"
  272. :rules="orgSettingRules"
  273. ref="updateOrgSettingForm"
  274. label-position="right"
  275. :inline="true"
  276. inline-message
  277. >
  278. <el-row>
  279. <el-form-item label="学习中心" prop="orgId" label-width="120px">
  280. <el-select
  281. class="select"
  282. :remote-method="getOrgList4InsertOrUpdate"
  283. :loading="loadingOrg4InsertOrUpdate"
  284. remote
  285. filterable
  286. clearable
  287. :disabled="true"
  288. v-model="orgSetting.orgId"
  289. placeholder="请选择"
  290. >
  291. <el-option
  292. v-for="item in orgList4InsertOrUpdate"
  293. :label="item.name"
  294. :value="item.id"
  295. :key="item.id"
  296. >
  297. </el-option>
  298. </el-select>
  299. </el-form-item>
  300. </el-row>
  301. <el-row>
  302. <el-form-item
  303. label="考试时间"
  304. prop="orgSettingDatetimeRange"
  305. label-width="120px"
  306. >
  307. <el-date-picker
  308. v-model="orgSettingDatetimeRange"
  309. type="datetimerange"
  310. range-separator="至"
  311. start-placeholder="开始日期"
  312. end-placeholder="结束日期"
  313. value-format="yyyy-MM-dd HH:mm:ss"
  314. >
  315. </el-date-picker>
  316. </el-form-item>
  317. </el-row>
  318. <el-row>
  319. <el-form-item label="开考状态" label-width="120px">
  320. <el-radio-group v-model="orgSetting.examLimit" class="input">
  321. <el-radio label="true">禁考</el-radio>
  322. <el-radio label="false">开考</el-radio>
  323. </el-radio-group>
  324. </el-form-item>
  325. </el-row>
  326. <el-row>
  327. <div style="margin-left:30%">
  328. <el-button type="primary" @click="updateOrgSetting"
  329. >确 定</el-button
  330. >
  331. <el-button @click="updateOrgSettingDialog = false"
  332. >取 消</el-button
  333. >
  334. </div>
  335. </el-row>
  336. </el-form>
  337. </el-dialog>
  338. <!-- 导入弹窗 -->
  339. <el-dialog
  340. title="学习中心设置导入"
  341. size="tiny"
  342. width="500px"
  343. :visible.sync="orgSettingsImportDialog"
  344. >
  345. <el-form :model="orgSettingsImportForm" ref="orgSettingsImportForm">
  346. <el-row>
  347. <el-form-item style="margin-left:30px">
  348. <el-upload
  349. ref="upload"
  350. accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  351. :action="uploadAction"
  352. :headers="uploadHeaders"
  353. :data="uploadData"
  354. :on-success="uploadSuccess"
  355. :on-error="uploadError"
  356. :file-list="fileList"
  357. :auto-upload="false"
  358. :multiple="false"
  359. >
  360. <el-button
  361. size="small"
  362. slot="trigger"
  363. type="primary"
  364. icon="el-icon-search"
  365. >选择文件</el-button
  366. >
  367. <el-button
  368. size="small"
  369. style="margin-left:10px;"
  370. type="primary"
  371. @click="submitUpload"
  372. icon="el-icon-check"
  373. >确认上传
  374. </el-button>
  375. <el-button
  376. size="small"
  377. style="margin-left: 10px;"
  378. type="primary"
  379. @click="removeFile"
  380. icon="el-icon-refresh"
  381. >清空文件
  382. </el-button>
  383. <div slot="tip" class="el-upload__tip">只能上传xlsx文件</div>
  384. </el-upload>
  385. </el-form-item>
  386. </el-row>
  387. </el-form>
  388. </el-dialog>
  389. <!-- 导入错误信息列表 -->
  390. <el-dialog title="错误提示" :visible.sync="errDialog">
  391. <div
  392. class="text-danger"
  393. v-for="errMessage in errMessages"
  394. :key="errMessage.lineNum"
  395. >
  396. 第{{ errMessage.lineNum }}行:{{ errMessage.msg }}
  397. </div>
  398. <span slot="footer" class="dialog-footer">
  399. <el-button @click="errDialog = false">确定</el-button>
  400. </span>
  401. </el-dialog>
  402. <!--END-->
  403. </div>
  404. </section>
  405. </div>
  406. </template>
  407. <script>
  408. import { CORE_API, EXAM_WORK_API } from "@/constants/constants.js";
  409. import LinkTitlesCustom from "@/components/LinkTitlesCustom.vue";
  410. import { mapState } from "vuex";
  411. export default {
  412. components: { LinkTitlesCustom },
  413. data() {
  414. return {
  415. examId: null,
  416. loading4FormSearch: false,
  417. formSearch: {
  418. examId: null,
  419. orgId: ""
  420. },
  421. loadingOrg4Search: false,
  422. orgList4Search: [],
  423. tableData: [],
  424. currentPage: 1,
  425. pageSize: 10,
  426. total: 0,
  427. selectedOrgSettings: [],
  428. orgSetting: {
  429. examId: null,
  430. orgId: null,
  431. beginTime: null,
  432. endTime: null,
  433. examLimit: "false",
  434. properties: {
  435. CAN_UPLOAD_ATTACHMENT: "true"
  436. }
  437. },
  438. orgSettingDatetimeRange: [],
  439. addOrgSettingDialog: false,
  440. updateOrgSettingDialog: false,
  441. orgList4InsertOrUpdate: [],
  442. loadingOrg4InsertOrUpdate: false,
  443. orgSettingRules: {
  444. orgId: [
  445. { required: true, message: "请选择学习中心", trigger: "blur,change" }
  446. ]
  447. },
  448. orgSettingsImportDialog: false,
  449. orgSettingsImportForm: {},
  450. uploadAction: null,
  451. uploadHeaders: {},
  452. uploadData: {},
  453. fileList: [],
  454. errDialog: false,
  455. errMessages: []
  456. };
  457. },
  458. computed: {
  459. ...mapState({ user: state => state.user }),
  460. noBatchSelected() {
  461. return this.selectedOrgSettings.length === 0;
  462. }
  463. },
  464. methods: {
  465. batchNotLimit() {
  466. this.$confirm("所选学生是否开考?", "提示", {
  467. confirmButtonText: "确定",
  468. cancelButtonText: "取消",
  469. type: "warning"
  470. }).then(() => {
  471. let url =
  472. EXAM_WORK_API +
  473. "/exam/setOrgExamNotLimited/" +
  474. this.selectedOrgSettings;
  475. this.$httpWithMsg.put(url).then(response => {
  476. console.log(response);
  477. this.$notify({
  478. type: "success",
  479. message: "开考成功"
  480. });
  481. this.search();
  482. });
  483. });
  484. },
  485. batchLimit() {
  486. this.$confirm("所选学生是否禁考?", "提示", {
  487. confirmButtonText: "确定",
  488. cancelButtonText: "取消",
  489. type: "warning"
  490. }).then(() => {
  491. let url =
  492. EXAM_WORK_API + "/exam/setOrgExamLimited/" + this.selectedOrgSettings;
  493. this.$httpWithMsg.put(url).then(response => {
  494. console.log(response);
  495. this.$notify({
  496. type: "success",
  497. message: "禁考成功"
  498. });
  499. this.search();
  500. });
  501. });
  502. },
  503. selectChange(row) {
  504. this.selectedOrgSettings = [];
  505. row.forEach((element, index) => {
  506. console.log(index);
  507. this.selectedOrgSettings.push(element.id);
  508. });
  509. console.log(this.selectedOrgSettings);
  510. },
  511. getOrgList4Search(name) {
  512. this.loadingOrg4Search = true;
  513. var url = CORE_API + "/org/query?" + new URLSearchParams({ name: name });
  514. this.$httpWithMsg
  515. .get(url)
  516. .then(response => {
  517. this.orgList4Search = response.data;
  518. this.loadingOrg4Search = false;
  519. })
  520. .catch(response => {
  521. console.log(response);
  522. this.loadingOrg4Search = false;
  523. });
  524. },
  525. getOrgList4InsertOrUpdate(name) {
  526. this.loadingOrg4InsertOrUpdate = true;
  527. var url = CORE_API + "/org/query?" + new URLSearchParams({ name: name });
  528. this.$httpWithMsg
  529. .get(url)
  530. .then(response => {
  531. this.orgList4InsertOrUpdate = response.data;
  532. this.loadingOrg4InsertOrUpdate = false;
  533. })
  534. .catch(response => {
  535. console.log(response);
  536. this.loadingOrg4InsertOrUpdate = false;
  537. });
  538. },
  539. updateExamLimit(row) {
  540. row.examLimit = !row.examLimit;
  541. let url = EXAM_WORK_API + "/exam/examOrgSettings";
  542. this.$httpWithMsg.post(url, row).then(response => {
  543. row.updateTime = response.data.updateTime;
  544. });
  545. },
  546. updateOrgSetting() {
  547. if (!this.orgSettingDatetimeRange) {
  548. this.orgSetting.beginTime = null;
  549. this.orgSetting.endTime = null;
  550. } else {
  551. this.orgSetting.beginTime = this.orgSettingDatetimeRange[0];
  552. this.orgSetting.endTime = this.orgSettingDatetimeRange[1];
  553. }
  554. this.$refs.updateOrgSettingForm.validate(valid => {
  555. if (valid) {
  556. let url = EXAM_WORK_API + "/exam/examOrgSettings";
  557. this.$httpWithMsg.post(url, this.orgSetting).then(response => {
  558. console.log(response);
  559. this.$notify({
  560. type: "success",
  561. message: "保存成功"
  562. });
  563. this.search();
  564. this.updateOrgSettingDialog = false;
  565. });
  566. } else {
  567. return false;
  568. }
  569. });
  570. },
  571. addOrgSetting() {
  572. if (!this.orgSettingDatetimeRange) {
  573. this.orgSetting.beginTime = null;
  574. this.orgSetting.endTime = null;
  575. } else {
  576. this.orgSetting.beginTime = this.orgSettingDatetimeRange[0];
  577. this.orgSetting.endTime = this.orgSettingDatetimeRange[1];
  578. }
  579. this.$refs.addOrgSettingForm.validate(valid => {
  580. if (valid) {
  581. let url = EXAM_WORK_API + "/exam/examOrgSettings";
  582. this.$httpWithMsg.put(url, this.orgSetting).then(response => {
  583. console.log(response);
  584. this.$notify({
  585. type: "success",
  586. message: "保存成功"
  587. });
  588. this.search();
  589. this.addOrgSettingDialog = false;
  590. });
  591. } else {
  592. return false;
  593. }
  594. });
  595. },
  596. back() {
  597. this.$router.push({ path: "/examwork/examInfo" });
  598. },
  599. getCanUpload(row) {
  600. if (row.properties.CAN_UPLOAD_ATTACHMENT === null) {
  601. if (Date.now() > row.endTime) {
  602. return "不允许";
  603. } else {
  604. return "允许";
  605. }
  606. } else {
  607. return row.properties.CAN_UPLOAD_ATTACHMENT == "true"
  608. ? "允许"
  609. : "不允许";
  610. }
  611. },
  612. handleCurrentChange(val) {
  613. this.currentPage = val;
  614. this.search();
  615. },
  616. handleSizeChange(val) {
  617. this.pageSize = val;
  618. this.search();
  619. },
  620. showUpdateOrgSetting(row) {
  621. this.orgSetting.examId = row.examId;
  622. this.orgSetting.beginTime = row.beginTime;
  623. this.orgList4InsertOrUpdate = [{ id: row.orgId, name: row.orgName }];
  624. this.orgSetting.orgId = row.orgId;
  625. this.orgSetting.endTime = row.endTime;
  626. this.orgSetting.examLimit = row.examLimit ? "true" : "false";
  627. this.orgSetting.properties.CAN_UPLOAD_ATTACHMENT =
  628. row.properties.CAN_UPLOAD_ATTACHMENT;
  629. if (row.beginTime && row.endTime) {
  630. this.orgSettingDatetimeRange = [row.beginTime, row.endTime];
  631. } else {
  632. this.orgSettingDatetimeRange = [];
  633. }
  634. this.updateOrgSettingDialog = true;
  635. },
  636. showAddOrgSetting() {
  637. this.orgSetting.examId = this.examId;
  638. this.orgSetting.beginTime = null;
  639. this.orgList4InsertOrUpdate = [];
  640. this.orgSetting.orgId = null;
  641. this.orgSetting.endTime = null;
  642. this.orgSetting.properties.CAN_UPLOAD_ATTACHMENT = "true";
  643. this.orgSettingDatetimeRange = [];
  644. this.addOrgSettingDialog = true;
  645. },
  646. exportOrgSettings() {
  647. window.open(
  648. EXAM_WORK_API +
  649. "/exam/exportExamOrgSettings/" +
  650. this.examId +
  651. "?$key=" +
  652. this.user.key +
  653. "&$token=" +
  654. this.user.token
  655. );
  656. },
  657. importOrgSettings() {
  658. this.removeFile();
  659. this.orgSettingsImportDialog = true;
  660. },
  661. uploadSuccess(response, file, fileList) {
  662. console.log("uploadSuccess");
  663. console.log(response);
  664. console.log(file);
  665. console.log(fileList);
  666. this.$notify({
  667. message: "上传成功",
  668. type: "success"
  669. });
  670. this.orgSettingsImportDialog = false;
  671. this.resetPageAndSearch();
  672. },
  673. uploadError(response, file, fileList) {
  674. console.log("uploadError");
  675. console.log(response);
  676. console.log(file);
  677. console.log(fileList);
  678. var json = JSON.parse(response.message);
  679. if (response.status == 500) {
  680. this.$notify({
  681. message: json.desc,
  682. type: "error"
  683. });
  684. }
  685. },
  686. //清空文件
  687. removeFile() {
  688. this.fileList = [];
  689. if (this.$refs.upload) {
  690. this.$refs.upload.clearFiles();
  691. }
  692. },
  693. //确定上传
  694. submitUpload() {
  695. if (!this.checkUpload()) {
  696. return false;
  697. }
  698. this.$refs.upload.submit();
  699. this.fileLoading = true;
  700. },
  701. checkUpload() {
  702. var fileList = this.$refs.upload.uploadFiles;
  703. if (fileList.length == 0) {
  704. this.$notify({
  705. message: "上传文件不能为空",
  706. type: "error"
  707. });
  708. return false;
  709. }
  710. if (fileList.length > 1) {
  711. this.$notify({
  712. message: "每次只能上传一个文件",
  713. type: "error"
  714. });
  715. return false;
  716. }
  717. for (let file of fileList) {
  718. if (!file.name.endsWith(".xlsx")) {
  719. this.$notify({
  720. message: "上传文件必须为xlsx格式",
  721. type: "error"
  722. });
  723. return false;
  724. }
  725. }
  726. return true;
  727. },
  728. resetPageAndSearch() {
  729. this.currentPage = 1;
  730. this.search();
  731. },
  732. search() {
  733. let param = new URLSearchParams(this.formSearch);
  734. let url =
  735. EXAM_WORK_API +
  736. "/exam/getExamOrgSettingsList/" +
  737. (this.currentPage - 1) +
  738. "/" +
  739. this.pageSize +
  740. "?" +
  741. param;
  742. this.loading4FormSearch = true;
  743. this.$httpWithMsg
  744. .get(url)
  745. .then(response => {
  746. console.log(response);
  747. this.tableData = response.data.list;
  748. this.total = response.data.total;
  749. this.loading4FormSearch = false;
  750. })
  751. .catch(response => {
  752. console.log(response);
  753. this.loading4FormSearch = false;
  754. });
  755. },
  756. init() {
  757. this.search();
  758. }
  759. },
  760. created() {
  761. this.examId = this.$route.params.id;
  762. this.formSearch.examId = this.examId;
  763. this.init();
  764. this.uploadHeaders = {
  765. key: this.user.key,
  766. token: this.user.token
  767. };
  768. this.uploadAction =
  769. EXAM_WORK_API + "/exam/importExamOrgSettings/" + this.examId;
  770. }
  771. };
  772. </script>
  773. <style scoped></style>