index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <div class="app-container trainingCourse">
  3. <div class="title-box">
  4. <el-form class="form-box" :model="queryParams" ref="examineForm" :inline="true" label-width="65px">
  5. <el-form-item label="" prop="name">
  6. <div class="query-type-box">
  7. <p @click="queryTypeClick(1)" :class="queryParams.type == 1?'check-p':''">全部</p>
  8. <p @click="queryTypeClick(2)" :class="queryParams.type == 2?'check-p':''">待开课</p>
  9. <p @click="queryTypeClick(3)" :class="queryParams.type == 3?'check-p':''">已开课</p>
  10. </div>
  11. </el-form-item>
  12. <el-form-item label="关键字" prop="name">
  13. <el-input
  14. maxlength="10"
  15. v-model="queryParams.searchValue"
  16. placeholder="课程名称/主讲老师"
  17. clearable
  18. size="small"/>
  19. </el-form-item>
  20. <el-form-item>
  21. <p class="inquire-button-one" @click="onSearch">查询</p>
  22. <p class="reset-button-one" @click="resetForm">重置</p>
  23. </el-form-item>
  24. <el-form-item style="float: right;">
  25. <p class="inquire-button-one" style="width:100px;" @click="controlsButton(1)">+ 新增课程</p>
  26. </el-form-item>
  27. </el-form>
  28. </div>
  29. <div class="content-box">
  30. <el-table border :data="tableData" ref="multipleTable">
  31. <el-table-column label="序号" prop="code" width="50"/>
  32. <el-table-column label="课程名称" prop="name" show-overflow-tooltip/>
  33. <el-table-column label="学院" prop="mainPoint" width="180" show-overflow-tooltip/>
  34. <el-table-column label="主讲老师" prop="mainPoint" width="100" show-overflow-tooltip/>
  35. <el-table-column label="辅导老师" prop="mainPoint" width="100" show-overflow-tooltip/>
  36. <el-table-column label="辅导老师" prop="mainPoint" width="100" show-overflow-tooltip/>
  37. <el-table-column label="人数" prop="mainPoint" width="80" show-overflow-tooltip/>
  38. <el-table-column label="上课时间" prop="mainPoint" width="150" show-overflow-tooltip/>
  39. <el-table-column label="上课日期" prop="mainPoint" width="200" show-overflow-tooltip/>
  40. <el-table-column label="状态" prop="mainPoint" width="112" show-overflow-tooltip/>
  41. <el-table-column label="操作" width="180">
  42. <template slot-scope="scope">
  43. <div class="table-button-box">
  44. <p class="table-button-null"></p>
  45. <p class="table-button-p" @click="controlsButton(3,scope.row)">详情</p>
  46. <p class="table-button-p" @click="controlsButton(2,scope.row)">编辑</p>
  47. <p class="table-button-p" @click="controlsButton(4,scope.row)">删除</p>
  48. <p class="table-button-null"></p>
  49. </div>
  50. </template>
  51. </el-table-column>
  52. </el-table>
  53. <pagination :page-sizes="[20, 30, 40, 50]" v-show="total>0" :total="total"
  54. layout="total, prev, pager, next, sizes, jumper"
  55. :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
  56. @pagination="getList"/>
  57. </div>
  58. <!--添加/编辑弹窗-->
  59. <add-dialog v-if="addDialogType" :addDialogData="addDialogData"></add-dialog>
  60. <info-dialog v-if="infoDialogType" :infoDialogData="infoDialogData"></info-dialog>
  61. </div>
  62. </template>
  63. <script>
  64. import addDialog from './addDialog.vue'
  65. import infoDialog from './infoDialog.vue'
  66. export default {
  67. name: 'trainingCourse',
  68. components: {
  69. addDialog,
  70. infoDialog
  71. },
  72. data(){
  73. return{
  74. // 遮罩层
  75. loading: false,
  76. //查询数据
  77. queryParams:{
  78. type:1,
  79. searchValue:"",
  80. page:1,
  81. pageSize:20,
  82. },
  83. //列表数据
  84. tableData: [{ id:"123", }],
  85. total:10,
  86. //新增弹窗数据
  87. addDialogType:false,
  88. addDialogData:{},
  89. //详情弹窗数据
  90. infoDialogType:false,
  91. infoDialogData:{},
  92. }
  93. },
  94. created(){
  95. },
  96. mounted(){
  97. this.getList();
  98. },
  99. methods:{
  100. //列表状态切换
  101. queryTypeClick(type){
  102. if(this.queryParams.type != type){
  103. this.$set(this.queryParams,'type',type);
  104. this.getList();
  105. }
  106. },
  107. //列表搜索
  108. onSearch(){
  109. this.$set(this.queryParams,'page',1);
  110. this.getList();
  111. },
  112. //列表重置
  113. resetForm(){
  114. this.$set(this,'queryParams',{
  115. type:1,
  116. searchValue:'',
  117. page:1,
  118. pageSize:20,
  119. });
  120. this.onSearch();
  121. },
  122. // 查询数据列表
  123. getList() {
  124. this.loading = true;
  125. // checkOptionList(this.queryParams).then( response => {
  126. //
  127. // this.loading = false;
  128. // });
  129. },
  130. //操作按钮
  131. controlsButton(type,row){
  132. if(type == 1){
  133. //新增
  134. this.$set(this,'addDialogData',{});
  135. this.$set(this,'addDialogType',true);
  136. }else if(type == 2){
  137. //编辑
  138. this.$set(this,'addDialogData',row);
  139. this.$set(this,'addDialogType',true);
  140. }else if(type == 3){
  141. //详情
  142. this.$set(this,'infoDialogType',true);
  143. this.$set(this,'infoDialogData',row);
  144. }else if(type == 4){
  145. //删除
  146. let self = this;
  147. this.$confirm('是否确认删除?', "警告", {
  148. confirmButtonText: "确定",
  149. cancelButtonText: "取消",
  150. type: "warning"
  151. }).then(function() {
  152. // checkPlanDelete({id:row.id}).then(response => {
  153. // self.msgSuccess(response.msg)
  154. // self.getList();
  155. // })
  156. }).then(() => {
  157. }).catch(() => {});
  158. }else if(type == 5){
  159. //关闭新增&编辑窗口
  160. this.$set(this,'addDialogType',false);
  161. this.$set(this,'addDialogData',{});
  162. }else if(type == 6){
  163. //关闭新增&编辑窗口 并刷新页面
  164. this.$set(this,'addDialogType',false);
  165. this.$set(this,'addDialogData',{});
  166. this.resetForm();
  167. }else if(type == 7){
  168. //关闭详情窗口
  169. this.$set(this,'infoDialogType',false);
  170. this.$set(this,'infoDialogData',{});
  171. }
  172. },
  173. }
  174. }
  175. </script>
  176. <style scoped lang="scss">
  177. .trainingCourse{
  178. flex:1;
  179. display: flex!important;
  180. flex-direction: column;
  181. overflow: hidden;
  182. font-weight: 500;
  183. .title-box{
  184. padding-top:20px;
  185. .form-box{
  186. border-bottom:1px solid #E0E0E0;
  187. .query-type-box{
  188. margin-left:20px;
  189. display: flex;
  190. p{
  191. line-height:40px;
  192. font-size:14px;
  193. color:#333;
  194. width:80px;
  195. text-align: center;
  196. cursor: pointer;
  197. }
  198. p:nth-child(1){
  199. border:1px solid #E0E0E0;
  200. border-radius: 4px 0 0 4px
  201. }
  202. p:nth-child(2){
  203. border-top:1px solid #E0E0E0;
  204. border-bottom:1px solid #E0E0E0;
  205. }
  206. p:nth-child(3){
  207. border:1px solid #E0E0E0;
  208. border-radius: 0 4px 4px 0
  209. }
  210. .check-p{
  211. color:#fff;
  212. background: #0045AF;
  213. border-color:#0045AF!important;
  214. }
  215. }
  216. }
  217. }
  218. .content-box{
  219. flex:1;
  220. overflow: hidden;
  221. display: flex;
  222. flex-direction: column;
  223. padding:20px;
  224. }
  225. }
  226. </style>