CourseOutlineTarget.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. <template>
  2. <div class="course-outline-target">
  3. <div class="part-box part-box-pad">
  4. <div class="box-justify mb-2">
  5. <div></div>
  6. <div>
  7. <el-button type="primary" @click="toAdd">新增课程目标</el-button>
  8. <el-button type="success" @click="toPredict">预期值</el-button>
  9. </div>
  10. </div>
  11. <el-table ref="TableList" :data="dataList">
  12. <el-table-column
  13. type="index"
  14. label="序号"
  15. width="70"
  16. :index="indexMethod"
  17. ></el-table-column>
  18. <el-table-column prop="targetName" label="课程目标" min-width="120">
  19. </el-table-column>
  20. <el-table-column prop="expectValue" label="预期值" width="120">
  21. </el-table-column>
  22. <el-table-column prop="degreeRequirement" label="内容" min-width="300">
  23. </el-table-column>
  24. <el-table-column
  25. prop="obeCultureProgramRequirementName"
  26. label="指标点"
  27. width="140"
  28. >
  29. <template slot-scope="scope">
  30. <span>{{ scope.row.obeCultureProgramRequirementName }}</span>
  31. <el-tooltip
  32. v-if="scope.row.obeCultureProgramRequirementContent"
  33. :content="scope.row.obeCultureProgramRequirementContent"
  34. effect="dark"
  35. placement="top"
  36. >
  37. <i class="el-icon-info ml-1"></i>
  38. </el-tooltip>
  39. </template>
  40. </el-table-column>
  41. <el-table-column
  42. class-name="action-column"
  43. label="操作"
  44. width="120"
  45. fixed="right"
  46. >
  47. <template slot-scope="scope">
  48. <el-button
  49. class="btn-primary"
  50. type="text"
  51. @click="toEdit(scope.row)"
  52. >编辑</el-button
  53. >
  54. <el-button
  55. class="btn-danger"
  56. type="text"
  57. @click="toDelete(scope.row)"
  58. >删除</el-button
  59. >
  60. </template>
  61. </el-table-column>
  62. </el-table>
  63. </div>
  64. <!-- ModifyCourseOutlineTarget -->
  65. <modify-course-outline-target
  66. ref="ModifyCourseOutlineTarget"
  67. :instance="curRow"
  68. @modified="getList"
  69. ></modify-course-outline-target>
  70. <!-- ModifyCourseOutlineTargetPredict -->
  71. <modify-course-outline-target-predict
  72. ref="ModifyCourseOutlineTargetPredict"
  73. :rowData="rowData"
  74. @modified="getList"
  75. ></modify-course-outline-target-predict>
  76. </div>
  77. </template>
  78. <script>
  79. import {
  80. courseOutlineTargetListPage,
  81. deleteCourseOutlineTarget,
  82. } from "../../api";
  83. import ModifyCourseOutlineTarget from "./ModifyCourseOutlineTarget.vue";
  84. import ModifyCourseOutlineTargetPredict from "./ModifyCourseOutlineTargetPredict.vue";
  85. export default {
  86. name: "course-outline-target",
  87. components: { ModifyCourseOutlineTarget, ModifyCourseOutlineTargetPredict },
  88. props: {
  89. rowData: {
  90. type: Object,
  91. default() {
  92. return {};
  93. },
  94. },
  95. },
  96. data() {
  97. return {
  98. modalForm: {
  99. description: "",
  100. },
  101. dataList: [],
  102. curRow: {},
  103. };
  104. },
  105. mounted() {
  106. this.getList();
  107. },
  108. methods: {
  109. async getList() {
  110. const datas = {
  111. obeCourseOutlineId: this.rowData.id,
  112. };
  113. const data = await courseOutlineTargetListPage(datas);
  114. this.dataList = data || [];
  115. },
  116. toAdd() {
  117. this.curRow = {
  118. obeCourseOutlineId: this.rowData.id,
  119. cultureProgramId: this.rowData.cultureProgramId,
  120. };
  121. this.$refs.ModifyCourseOutlineTarget.open();
  122. },
  123. toPredict() {
  124. this.$refs.ModifyCourseOutlineTargetPredict.open();
  125. },
  126. toEdit(row) {
  127. this.curRow = {
  128. ...row,
  129. obeCourseOutlineId: this.rowData.id,
  130. cultureProgramId: this.rowData.cultureProgramId,
  131. };
  132. this.$refs.ModifyCourseOutlineTarget.open();
  133. },
  134. async toDelete(row) {
  135. const confirm = await this.$confirm(
  136. `确定要删除课程目标【${row.targetName}】吗?`,
  137. "提示",
  138. {
  139. type: "warning",
  140. }
  141. ).catch(() => {});
  142. if (confirm !== "confirm") return;
  143. await deleteCourseOutlineTarget(row.id);
  144. this.$message.success("删除成功!");
  145. this.getList();
  146. },
  147. },
  148. };
  149. </script>