CourseOutlineManage.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <div class="course-outline-manage">
  3. <div class="part-box part-box-filter part-box-flex">
  4. <el-form ref="FilterForm" label-position="left" label-width="85px" inline>
  5. <template v-if="checkPrivilege('condition', 'condition')">
  6. <el-form-item label="专业:">
  7. <professional-select
  8. v-model="filter.professionalId"
  9. placeholder="专业"
  10. ></professional-select>
  11. </el-form-item>
  12. <el-form-item label="培养方案:">
  13. <training-plan-select
  14. v-model="filter.cultureProgramId"
  15. placeholder="培养方案"
  16. :professional-id="filter.professionalId"
  17. professional-required
  18. ></training-plan-select>
  19. </el-form-item>
  20. <el-form-item label="课程:">
  21. <training-plan-course-select
  22. v-model="filter.courseId"
  23. placeholder="课程"
  24. :professional-id="filter.professionalId"
  25. :culture-program-id="filter.cultureProgramId"
  26. ></training-plan-course-select>
  27. </el-form-item>
  28. <el-form-item label="课程大纲名称:">
  29. <el-input
  30. v-model.trim="filter.name"
  31. placeholder="课程大纲名称"
  32. clearable
  33. ></el-input>
  34. </el-form-item>
  35. </template>
  36. <el-form-item label-width="0px">
  37. <el-button
  38. v-if="checkPrivilege('button', 'select')"
  39. type="primary"
  40. @click="search"
  41. >查询</el-button
  42. >
  43. </el-form-item>
  44. </el-form>
  45. <div class="part-box-action">
  46. <el-button
  47. v-if="checkPrivilege('button', 'Save')"
  48. type="primary"
  49. icon="el-icon-add"
  50. @click="toAdd"
  51. >新增</el-button
  52. >
  53. </div>
  54. </div>
  55. <div class="part-box part-box-pad">
  56. <el-table ref="TableList" :data="dataList">
  57. <el-table-column
  58. type="index"
  59. label="序号"
  60. width="55"
  61. :index="indexMethod"
  62. ></el-table-column>
  63. <el-table-column prop="outlineName" label="课程大纲" min-width="300">
  64. </el-table-column>
  65. <el-table-column prop="courseName" label="课程名称" min-width="200">
  66. </el-table-column>
  67. <el-table-column prop="credit" label="学分" width="80">
  68. <template slot-scope="scope">
  69. {{ scope.row.credit | defaultFieldFilter }}
  70. </template>
  71. </el-table-column>
  72. <el-table-column prop="evaluationMode" label="考核方式" width="100">
  73. <span slot-scope="scope">
  74. {{ scope.row.evaluationMode | evaluationModeFilter }}
  75. </span>
  76. </el-table-column>
  77. <el-table-column prop="courseType" label="课程类别" width="160">
  78. <span slot-scope="scope">
  79. {{ scope.row.courseType | courseTypeFilter }}
  80. </span>
  81. </el-table-column>
  82. <el-table-column prop="semesterName" label="修读学期" width="200">
  83. </el-table-column>
  84. <el-table-column
  85. prop="cultureProgramName"
  86. label="所属培养方案"
  87. min-width="240"
  88. >
  89. </el-table-column>
  90. <el-table-column
  91. prop="targetCount"
  92. label="课程目标数量"
  93. width="110"
  94. ></el-table-column>
  95. <el-table-column prop="weightSetting" label="权重设置状态" width="110">
  96. <template slot-scope="scope">
  97. <span :class="scope.row.weightSetting ? '' : 'color-gray-2'">
  98. {{ scope.row.weightSetting ? "已完成" : "未完成" }}
  99. </span>
  100. </template>
  101. </el-table-column>
  102. <el-table-column
  103. class-name="action-column"
  104. label="操作"
  105. width="180"
  106. fixed="right"
  107. >
  108. <template slot-scope="scope">
  109. <el-button
  110. v-if="checkPrivilege('link', 'edit')"
  111. class="btn-primary"
  112. type="text"
  113. @click="toEdit(scope.row)"
  114. >编辑</el-button
  115. >
  116. <el-button
  117. v-if="checkPrivilege('link', 'delete')"
  118. class="btn-danger"
  119. type="text"
  120. @click="toDelete(scope.row)"
  121. >删除</el-button
  122. >
  123. <el-button
  124. v-if="checkPrivilege('link', 'detail')"
  125. class="btn-primary"
  126. type="text"
  127. @click="toDetail(scope.row)"
  128. >查看详情</el-button
  129. >
  130. </template>
  131. </el-table-column>
  132. </el-table>
  133. <div class="part-page">
  134. <el-pagination
  135. background
  136. layout="total, sizes, prev, pager, next, jumper"
  137. :pager-count="5"
  138. :current-page="current"
  139. :total="total"
  140. :page-size="size"
  141. @current-change="toPage"
  142. @size-change="pageSizeChange"
  143. >
  144. </el-pagination>
  145. </div>
  146. </div>
  147. <!-- ModifyCourseOutline -->
  148. <modify-course-outline
  149. v-if="checkPrivilege('button', 'Save') || checkPrivilege('link', 'edit')"
  150. ref="ModifyCourseOutline"
  151. :instance="curRow"
  152. @modified="getList"
  153. ></modify-course-outline>
  154. <!-- DetailCourseOutline -->
  155. <detail-course-outline
  156. v-if="checkPrivilege('link', 'detail')"
  157. ref="DetailCourseOutline"
  158. :row-data="curRow"
  159. @modified="getList"
  160. ></detail-course-outline>
  161. </div>
  162. </template>
  163. <script>
  164. import { courseOutlineListPage, deleteCourseOutline } from "../api";
  165. import ModifyCourseOutline from "../components/course-outline/ModifyCourseOutline.vue";
  166. import DetailCourseOutline from "../components/course-outline/DetailCourseOutline.vue";
  167. export default {
  168. name: "course-outline-manage",
  169. components: { ModifyCourseOutline, DetailCourseOutline },
  170. data() {
  171. return {
  172. filter: {
  173. professionalId: "",
  174. cultureProgramId: "",
  175. courseId: "",
  176. name: "",
  177. },
  178. current: 1,
  179. size: this.GLOBAL.pageSize,
  180. total: 0,
  181. dataList: [],
  182. curRow: {},
  183. };
  184. },
  185. mounted() {
  186. this.toPage(1);
  187. },
  188. methods: {
  189. async getList() {
  190. if (!this.checkPrivilege("list", "list")) return;
  191. const datas = {
  192. ...this.filter,
  193. pageNumber: this.current,
  194. pageSize: this.size,
  195. };
  196. const data = await courseOutlineListPage(datas);
  197. this.dataList = data.records;
  198. this.total = data.total;
  199. },
  200. toPage(page) {
  201. this.current = page;
  202. this.getList();
  203. },
  204. search() {
  205. this.toPage(1);
  206. },
  207. toAdd() {
  208. this.curRow = {};
  209. this.$refs.ModifyCourseOutline.open();
  210. },
  211. toEdit(row) {
  212. this.curRow = row;
  213. this.$refs.ModifyCourseOutline.open();
  214. },
  215. async toDelete(row) {
  216. const confirm = await this.$confirm(
  217. `确定要删除课程大纲【${row.outlineName}】吗?`,
  218. "提示",
  219. {
  220. type: "warning",
  221. }
  222. ).catch(() => {});
  223. if (confirm !== "confirm") return;
  224. await deleteCourseOutline(row.id);
  225. this.$message.success("删除成功!");
  226. this.deletePageLastItem();
  227. },
  228. toDetail(row) {
  229. this.curRow = row;
  230. this.$refs.DetailCourseOutline.open();
  231. },
  232. },
  233. };
  234. </script>