Bläddra i källkod

添加发布状态按钮

liuyang 5 år sedan
förälder
incheckning
67a9a9d22d
2 ändrade filer med 25 tillägg och 6 borttagningar
  1. 9 2
      frontend_web/src/views/course/index.vue
  2. 16 4
      frontend_web/src/views/duty/index.vue

+ 9 - 2
frontend_web/src/views/course/index.vue

@@ -71,6 +71,13 @@
                      @click="courseEdit(scope.row.Id)"
                      icon="el-icon-edit"
                      circle></el-button>
+          <el-button size="mini"
+                     type="primary"
+                     title="发布"
+                     @click="publish(scope.row)"
+                     style="margin-left:5px;"
+                     icon="el-icon-s-promotion"
+                     circle></el-button>
           <el-button size="mini"
                      type="danger"
                      title="删除"
@@ -274,8 +281,8 @@ export default {
       this.initDatas()
     },
     publish (course) {
-      course.status = 1
-      CourseApi.save(course)
+      course.Status = 1
+      CourseApi.addCourse(course)
     },
     // 初始化列表数据
     initDatas () {

+ 16 - 4
frontend_web/src/views/duty/index.vue

@@ -48,7 +48,7 @@
               @sort-change="orderby"
               height="100%">
       <el-table-column label="操作"
-                       width="120px"
+                       width="180px"
                        align="center"
                        fixed='right'>
         <template slot-scope="scope">
@@ -58,6 +58,13 @@
                      @click="edit(scope.row.Id)"
                      icon="el-icon-edit"
                      circle></el-button>
+          <el-button size="mini"
+                     type="primary"
+                     title="发布"
+                     @click="publish(scope.row)"
+                     style="margin-left:5px;"
+                     icon="el-icon-s-promotion"
+                     circle></el-button>
           <el-button size="mini"
                      type="danger"
                      title="删除"
@@ -75,14 +82,14 @@
       </el-table-column>
       <el-table-column prop="Year"
                        fit
-                       min-width="160px"
+                       min-width="80px"
                        label="学年"
                        align="center"
                        show-overflow-tooltip></el-table-column>
       <el-table-column prop="Term"
                        label="学期"
                        align="center"
-                       min-width="120px"
+                       min-width="80px"
                        show-overflow-tooltip
                        :formatter="formatTerm"
       ></el-table-column>
@@ -94,7 +101,7 @@
       <el-table-column prop="Status"
                        label="状态"
                        align="center"
-                       min-width="120px"
+                       min-width="80px"
                        show-overflow-tooltip
                        :formatter="formatStatus"
       ></el-table-column>
@@ -146,6 +153,7 @@ export default {
       currpage: 1,
       size: 10,
       term: [],
+      activities: [],
       Year: '',
       Title: '',
       Time: '',
@@ -219,6 +227,10 @@ export default {
       this.dutyId = dutyId
       this.$refs.editDialog.dialogvisible = true
     },
+    publish (duty) {
+      duty.Status = 1
+      DutyApi.saveDuty(duty)
+    },
     // 打开二级页面
     handleDetail (duty) {
       let Id = parseInt(duty.Id)