Procházet zdrojové kódy

首页 公告 课程表

all před 5 roky
rodič
revize
c9763af989

+ 229 - 0
frontend_web/src/views/demo/page1/components/courseInfoDialog.vue

@@ -0,0 +1,229 @@
+<template>
+  <el-dialog title="课程详情"
+             :visible.sync="dialogvisible"
+             @opened="dialogOpen"
+             @closed="dialogClose"
+             width="75%">
+    <!-- <el-form size="mini"
+             :model="information"
+             :rules="rulesinformationForm"
+             label-width="100px"
+             ref="informationForm">
+      <el-row :gutter="24">
+        <el-col :span="24">
+          <el-form-item label="信息标题222"
+                        label-width="120px">
+            <el-input v-model="information.title"
+                      :disabled="true"
+                      style="width:100%;font-size:20px"></el-input>
+          </el-form-item>
+        </el-col>
+        <el-col :span="24">
+          <el-form-item label="2333"
+                        label-width="120px">
+            <el-input v-model="information.content"
+                      type="textarea"
+                      :rows=3
+                      :disabled="true"
+                      style="width:100%;font-size:20px"></el-input>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form> -->
+    <el-table ref="multipleTable"
+              :data="activities"
+              border
+              fit
+              tooltip-effect="dark"
+              style="width: 100%"
+              height="100%">
+      <el-table-column prop="CourseName"
+                       align="center"
+                       min-width="120px"
+                       label="课程名称"
+                       show-overflow-tooltip></el-table-column>
+      <el-table-column prop="Teacher"
+                       align="center"
+                       min-width="120px"
+                       label="授课老师"
+                       show-overflow-tooltip
+                       :formatter="teacherFormatter"></el-table-column>
+      <el-table-column prop="Local"
+                       align="center"
+                       min-width="120px"
+                       label="实验地点"
+                       show-overflow-tooltip
+                       :formatter="localFormatter"></el-table-column>
+      <el-table-column prop="Num"
+                       align="center"
+                       min-width="120px"
+                       label="人数"
+                       show-overflow-tooltip></el-table-column>
+      <el-table-column prop="CreatedTime"
+                       align="center"
+                       min-width="120px"
+                       label="创建时间"
+                       show-overflow-tooltip></el-table-column>
+    </el-table>
+    <template slot="footer">
+      <el-pagination style="margin: -10px;"
+                     @size-change="handleSizeChange"
+                     @current-change="handleCurrentChange"
+                     :current-page="page.current"
+                     :page-size="page.size"
+                     :total="page.total"
+                     :page-sizes="[10, 20]"
+                     layout="total, sizes, prev, pager, next, jumper">
+      </el-pagination>
+    </template>
+  </el-dialog>
+</template>
+
+<script>
+
+import detailApi from '@/api/course/detail'
+import itemDetailApi from '@/api/sysadmin/itemdetail'
+import { searchmanagingroomdata } from '@/api/instrumentroom'
+export default {
+  name: 'informationDialog',
+  props: {
+    courselist: { // 当前样本存在位置
+      type: Array
+    },
+  },
+  data () {
+    return {
+      page: {
+        current: 1,
+        size: 10,
+        total: 1
+      },
+      sort: {
+        prop: '',
+        order: ''
+      },
+      RoomList: [],
+      TeacherList: [],
+      activities: [],
+      dialogvisible: false,
+      information: {},
+      rulesinformationForm: {
+        title: [{
+          required: true,
+          message: '请输入信息标题',
+          trigger: 'blur'
+        }],
+        content: [{
+          required: true,
+          message: '请输入信息内容',
+          trigger: 'blur'
+        }]
+      }
+    }
+  },
+  created () {
+    this.getData()
+
+  },
+  methods: {
+    dialogOpen () {
+      this.information = {}
+      // this.$refs.informationForm.resetFields()
+      this.getData()
+    },
+    dialogClose () {
+      this.information = {}
+      // this.$refs.informationForm.resetFields()
+      // this.$emit('handleClose')
+      this.dialogVisible = false
+    },
+    // 分页-改变分页大小
+    handleSizeChange (value) {
+      this.page.size = value
+      this.page.current = 1
+      this.getData()
+    },
+    // 分页-改变当前页
+    handleCurrentChange (value) {
+      this.page.current = value
+      this.getData()
+    },
+    // 获取实验室地点
+    getRoomList () {
+      let _this = this
+      let params = {
+        _currentPage: 1,
+        _size: 9999
+      }
+      if (params !== '') {
+        _this.loading = true
+        searchmanagingroomdata(params)
+          .then(res => {
+            _this.loading = false
+            this.RoomList = res.info.items
+          })
+          .catch(function (error) {
+            console.log(error)
+          })
+      } else {
+        _this.RoomList = []
+      }
+    },
+    // 获取教师列表
+    getTeacherList (query) {
+      let _this = this
+      if (query !== '') {
+        _this.loading = true
+        itemDetailApi.getItemDetailByItemCode({ ItemCode: 'Teacher' })
+          .then(res => {
+            _this.loading = false
+            this.TeacherList = res
+          })
+          .catch(err => {
+            console.error(err)
+          })
+      } else {
+        _this.TeacherList = []
+      }
+    },
+    // 授课老师
+    teacherFormatter (row, column) {
+      for (var i = 0; i < this.TeacherList.length; i++) {
+        if (parseInt(this.TeacherList[i].ItemValue) === row.Teacher) {
+          return this.TeacherList[i].ItemName
+        }
+      }
+    },
+    // 实验地点
+    localFormatter (row, column) {
+      for (var i = 0; i < this.RoomList.length; i++) {
+        if (parseInt(this.RoomList[i].Id) === row.Local) {
+          return this.RoomList[i].RoomName
+        }
+      }
+    },
+    getData () {
+      this.getTeacherList()
+      this.getRoomList()
+      let _this = this
+      let query = {
+        // 分页信息
+        size: this.page.size,
+        current: this.page.current,
+        CourseId: this.courselist.CourseId // 课程ID
+      }
+      detailApi.getList(query)
+        .then(res => {
+          _this.activities = res.records ? res.records : []
+          _this.page.current = res.current
+          _this.page.size = res.size
+          _this.page.total = res.total
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    }
+
+  }
+}
+</script>

+ 12 - 12
frontend_web/src/views/demo/page1/components/informationInfoDialog.vue

@@ -3,7 +3,7 @@
              :visible.sync="dialogvisible"
              @opened="dialogOpen"
              @closed="dialogClose"
-             width="50%">
+             width="75%">
     <el-form size="mini"
              :model="information"
              :rules="rulesinformationForm"
@@ -11,27 +11,27 @@
              ref="informationForm">
       <el-row :gutter="24">
         <el-col :span="24">
-          <el-form-item label="信息标题:"
-                        prop="title"
+          <el-form-item label="信息标题"
                         label-width="120px">
-            <span style="float:left;font-size:20px">{{information.title}}</span>
+            <el-input v-model="information.title"
+                      :disabled="true"
+                      style="width:100%;font-size:20px"></el-input>
           </el-form-item>
         </el-col>
         <el-col :span="24">
-          <el-form-item label="信息内容:"
+          <el-form-item label="信息内容"
                         label-width="120px">
-            <span style="float:left;font-size:20px">{{information.content}}</span>
+            <el-input v-model="information.content"
+                      type="textarea"
+                      :rows=5
+                      :disabled="true"
+                      style="width:100%;font-size:20px"></el-input>
           </el-form-item>
         </el-col>
 
       </el-row>
     </el-form>
     <span slot="footer">
-      <!-- <el-button size="mini"
-                 @click="save(0)">保存草稿</el-button>
-      <el-button size="mini"
-                 type="primary"
-                 @click="save(1)">发布</el-button> -->
 
     </span>
   </el-dialog>
@@ -75,7 +75,7 @@ export default {
     dialogClose () {
       this.information = {}
       this.$refs.informationForm.resetFields()
-      this.$emit('handleClose')
+      // this.$emit('handleClose')
       this.dialogVisible = false
     },
     save (flag) {

+ 119 - 30
frontend_web/src/views/demo/page1/index.vue

@@ -113,6 +113,7 @@
         <el-table ref="multipleTable"
                   :data="activitiescourse"
                   border
+                  @row-click="opencourseDetails"
                   fit
                   tooltip-effect="dark"
                   style="width: 100%"
@@ -128,29 +129,31 @@
                            label="学期"
                            align="center"
                            min-width="160px"
-                           show-overflow-tooltip></el-table-column>
+                           show-overflow-tooltip
+                           :formatter="formatTerm"></el-table-column>
           <el-table-column prop="Title"
                            label="标题"
                            align="center"
                            min-width="160px"
                            show-overflow-tooltip></el-table-column>
-          <el-table-column prop="CourseWeek"
-                           label="教学周"
-                           align="center"
-                           min-width="160px"
-                           show-overflow-tooltip></el-table-column>
-          <el-table-column prop="content"
+          <!--      <el-table-column prop="CourseWeek"-->
+          <!--                       label="教学周"-->
+          <!--                       align="center"-->
+          <!--                       min-width="160px"-->
+          <!--                       show-overflow-tooltip></el-table-column>-->
+          <el-table-column prop="ClassId"
                            label="班级"
                            align="center"
                            min-width="160px"
-                           show-overflow-tooltip></el-table-column>
-          <!-- <el-table-column prop="status"
+                           show-overflow-tooltip
+                           :formatter="formatClass"></el-table-column>
+          <el-table-column prop="Status"
                            align="center"
                            min-width="40px"
                            label="状态"
                            show-overflow-tooltip
-                           :formatter="formatStatus"></el-table-column> -->
-          <el-table-column prop="createdtime"
+                           :formatter="formatStatus"></el-table-column>
+          <el-table-column prop="CreatedTime"
                            align="center"
                            min-width="120px"
                            label="创建时间"
@@ -170,7 +173,7 @@
 
     <el-row :gutter="15"
             style="margin-top: 10px;">
-      <el-card>
+      <!-- <el-card>
         <div style="font-size:20px">
           值班表
         </div>
@@ -257,7 +260,7 @@
                        layout="total, sizes, prev, pager, next, jumper"
                        :total="searchcourse.page.total">
         </el-pagination>
-      </el-card>
+      </el-card> -->
     </el-row>
 
     <!-- 信息发布 -->
@@ -265,6 +268,11 @@
                            @handleClose="handleClose"
                            :informationId="informationId"
                            width="75"></informationInfoDialog>
+    <!-- 课程管理 -->
+    <courseInfoDialog ref="courseDialog"
+                      @handleClose="handleClose"
+                      :courselist="courselist"
+                      width="75"></courseInfoDialog>
   </d2-container>
 </template>
 
@@ -275,18 +283,24 @@ import InformationApi from '@/api/information'
 import CourseApi from '@/api/course'
 import DutyApi from '@/api/duty'
 import informationInfoDialog from './components/informationInfoDialog'
+import courseInfoDialog from './components/courseInfoDialog'
 export default {
   name: 'informationIndex',
   components: {
-    informationInfoDialog
+    informationInfoDialog,
+    courseInfoDialog
   },
   data () {
     return {
       dialogvisible: false,
       years: [],
       details: false,
+      classList: [], // 班级列表
+      statusList: [], // 状态列表
+      termList: [], // 学期
       activities: [],
       activitiescourse: [],
+      courselist: [],
       activitiesduty: [],
       activitiesclass: [],
       informationId: -1,
@@ -301,14 +315,23 @@ export default {
         }
       },
       term: [],
+      // searchcourse: {
+      //   title: '',
+      //   status: 1,
+      //   content: '',
+      //   page: {
+      //     total: 0,
+      //     current: 1,
+      //     size: 5
+      //   }
+      // },
       searchcourse: {
-        title: '',
-        status: 1,
-        content: '',
+        Term: '',
+        Year: '',
         page: {
           total: 0,
           current: 1,
-          size: 5
+          size: 10
         }
       },
       status: [{
@@ -338,19 +361,25 @@ export default {
     // this.initDatas_duty()
     this.initDatas_class()
     this.getTerm()
+    this.getClassList()
   },
   methods: {
     openDetails (row) {
       this.informationId = row.id
       this.$refs.informationDialog.dialogvisible = true
-      console.log('-----row--', row)
     },
-
+    opencourseDetails (row) {
+      this.courselist = []
+      this.courselist.CourseId = row.Id
+      this.courselist.Year = row.Year
+      this.courselist.Term = row.Term
+      this.courselist.ClassId = row.ClassId
+      this.$refs.courseDialog.dialogvisible = true
+    },
     // 获取字典表
     getTerm () {
       itemDetailApi.getItemDetailByItemCode({ ItemCode: 'Term' })
         .then(res => {
-          console.log('---res--', res)
           this.term = res
           // this.initDatas()
         })
@@ -371,6 +400,63 @@ export default {
           }
         })
     },
+    // 发布状态
+    getStatus () {
+      let _this = this
+      itemDetailApi.getItemDetailByItemCode({ ItemCode: 'PublishStatus' })
+        .then(res => {
+          _this.statusList = res
+          // this.initDatas()
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    },
+    // 匹配状态
+    formatStatus (row, column) {
+      for (var i = 0; i < this.statusList.length; i++) {
+        if (parseInt(this.statusList[i].ItemValue) === parseInt(row.Status)) {
+          return this.statusList[i].ItemName
+        }
+      }
+    },
+    // 匹配班级
+    formatClass (row, column) {
+      for (var i = 0; i < this.classList.length; i++) {
+        if (parseInt(this.classList[i].Id) === row.ClassId) {
+          return this.classList[i].Name
+        }
+      }
+    },
+    // 获取学期
+    getTerm () {
+      itemDetailApi.getItemDetailByItemCode({ ItemCode: 'Term' })
+        .then(res => {
+          this.termList = res
+        })
+        .catch(err => {
+          console.error(err)
+        })
+    },
+    // 匹配学期
+    formatTerm (row, column) {
+      for (var i = 0; i < this.termList.length; i++) {
+        if (parseInt(this.termList[i].ItemValue) === parseInt(row.Term)) {
+          return this.termList[i].ItemName
+        }
+      }
+    },
+    // 获取班级列表
+    getClassList () {
+      let params = {
+        _currentPage: 1,
+        _size: 9999
+      }
+      ClassApi.getAllClass(params)
+        .then(res => {
+          this.classList = res.records
+        })
+    },
     initSelectYear (year) {
       for (let i = 0; i < 5; i++) {
         this.years.push({ value: (year - i), label: (year - i) + '年' })
@@ -390,10 +476,12 @@ export default {
     },
     // 初始化列表数据课程
     initDatasCourse () {
+      console.log('-----this.searchcourse----', this.searchcourse)
       CourseApi.getPageList(this.searchcourse)
         .then(res => {
+          console.log('------res---', res)
           this.activitiescourse = res.records
-          this.searchcourse.page = res
+          this.searchcourse.page.total = res.total
         })
     },
     formatStatus (row, column) {
@@ -418,10 +506,10 @@ export default {
         size: 10
       }
     },
-    // 打开 添加弹窗
-    openinformationadd () {
-      this.$refs.informationDialog.dialogvisible = true
-    },
+    // // 打开 添加弹窗
+    // openinformationadd () {
+    //   this.$refs.informationDialog.dialogvisible = true
+    // },
     // // 打开 编辑弹窗
     // informationedit (informationId) {
     //   this.informationId = informationId
@@ -459,12 +547,13 @@ export default {
     },
     // 课程管理
     handleSizeChange_course (val) {
-      this.search.page.size = val
-      this.search.page.current = 1
+      console.log('----val--111--', val)
+      this.searchcourse.page.size = val
+      this.searchcourse.page.current = 1
       this.initDatasCourse()
     },
     handleCurrentChange_course (val) {
-      this.search.page.current = val
+      this.searchcourse.page.current = val
       this.initDatasCourse()
     },
     searchCommand (command) {
@@ -475,7 +564,7 @@ export default {
       }
     },
     clearSearch () {
-      this.initDatasCourse()
+      // this.initDatasCourse()
     }
 
   }