| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- <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>
|