PaperBasicComposition.vue 1.7 KB

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