PaperBasicComposition.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <template>
  2. <section class="content">
  3. <div class="box-body">
  4. <div class="ques-tag-main2">
  5. <div>整卷属性</div>
  6. <div
  7. v-for="(paperTag, tagIndex) in paperData.tags"
  8. :key="tagIndex"
  9. class="ques-tag-container"
  10. >
  11. <div class="ques-tag">
  12. <div class="ques-tag-title">{{ paperTag.tag }}</div>
  13. <div>{{ paperTag.content }}</div>
  14. </div>
  15. </div>
  16. </div>
  17. <div class="ques-tag-main2">
  18. <div>组成结构</div>
  19. <div style="width: 100%">
  20. <el-table :data="paperData.data" border>
  21. <el-table-column
  22. v-for="(colval, colIndex) in paperData.head"
  23. :key="colIndex"
  24. width="100"
  25. >
  26. <template slot="header">
  27. <span style="margin-left: 10px">{{ colval }}</span>
  28. </template>
  29. <template slot-scope="scope">
  30. <span style="margin-left: 10px">{{ scope.row[colIndex] }}</span>
  31. </template>
  32. </el-table-column>
  33. </el-table>
  34. </div>
  35. </div>
  36. </div>
  37. </section>
  38. </template>
  39. <script>
  40. import { QUESTION_API } from "@/constants/constants.js";
  41. import { mapState } from "vuex";
  42. export default {
  43. props: {
  44. paperId: {
  45. type: String,
  46. default: "",
  47. },
  48. },
  49. data() {
  50. return {
  51. paperData: {},
  52. loading: false,
  53. };
  54. },
  55. computed: {
  56. ...mapState({ user: (state) => state.user }),
  57. },
  58. //初始化查询
  59. created() {
  60. this.init();
  61. },
  62. methods: {
  63. init() {
  64. this.$http
  65. .get(QUESTION_API + "/paper/basic/composition?id=" + this.paperId)
  66. .then((response) => {
  67. this.paperData = response.data;
  68. });
  69. },
  70. },
  71. };
  72. </script>
  73. <style scoped src="../styles/EditPaper.css"></style>
  74. <style scoped src="../styles/Common.css"></style>