|  | @@ -4,65 +4,137 @@
 | 
	
		
			
				|  |  |        <div class="squrt"></div>系统日志
 | 
	
		
			
				|  |  |      </h2>
 | 
	
		
			
				|  |  |      <div class="m-core">
 | 
	
		
			
				|  |  | -      <el-tabs type="border-card"
 | 
	
		
			
				|  |  | -               v-model.trim="activeIndex"
 | 
	
		
			
				|  |  | -               @tab-click="handleClick">
 | 
	
		
			
				|  |  | -        <el-tab-pane label="系统通知"
 | 
	
		
			
				|  |  | -                     v-if="permissionList.journalItem"
 | 
	
		
			
				|  |  | -                     name='0'>
 | 
	
		
			
				|  |  | -          <item v-if="activeIndex == 0" />
 | 
	
		
			
				|  |  | -        </el-tab-pane>
 | 
	
		
			
				|  |  | -        <el-tab-pane label="学员申诉"
 | 
	
		
			
				|  |  | -                     v-if="permissionList.studentComplain"
 | 
	
		
			
				|  |  | -                     name='1'>
 | 
	
		
			
				|  |  | -          <studentComplain v-if="activeIndex == 1" />
 | 
	
		
			
				|  |  | -        </el-tab-pane>
 | 
	
		
			
				|  |  | -        <el-tab-pane label="退团退课"
 | 
	
		
			
				|  |  | -                     v-if="permissionList.musicGroupCourse"
 | 
	
		
			
				|  |  | -                     name='2'>
 | 
	
		
			
				|  |  | -          <musicGroup v-if="activeIndex == 2" />
 | 
	
		
			
				|  |  | -        </el-tab-pane>
 | 
	
		
			
				|  |  | -        <el-tab-pane label="请假处理"
 | 
	
		
			
				|  |  | -                     v-if="permissionList.leaveOperation"
 | 
	
		
			
				|  |  | -                     name='3'>
 | 
	
		
			
				|  |  | -          <leaveOperation v-if="activeIndex == 3" />
 | 
	
		
			
				|  |  | -        </el-tab-pane>
 | 
	
		
			
				|  |  | -        <el-tab-pane label="VIP申请审核"
 | 
	
		
			
				|  |  | -                     v-if="permissionList.vipApply"
 | 
	
		
			
				|  |  | -                     name='4'>
 | 
	
		
			
				|  |  | -          <vipApply v-if="activeIndex == 4" />
 | 
	
		
			
				|  |  | -        </el-tab-pane>
 | 
	
		
			
				|  |  | -      </el-tabs>
 | 
	
		
			
				|  |  | +      <el-form :inline="true"
 | 
	
		
			
				|  |  | +                ref="searchForm"
 | 
	
		
			
				|  |  | +               :model="searchForm">
 | 
	
		
			
				|  |  | +        <!-- <el-form-item>
 | 
	
		
			
				|  |  | +          <el-input v-model.trim="searchForm.search"
 | 
	
		
			
				|  |  | +                    @keyup.enter.native="search"
 | 
	
		
			
				|  |  | +                    placeholder="课程编号、课程组名称"></el-input>
 | 
	
		
			
				|  |  | +        </el-form-item> -->
 | 
	
		
			
				|  |  | +        <el-form-item prop="group">
 | 
	
		
			
				|  |  | +          <el-select v-model.trim="searchForm.group"
 | 
	
		
			
				|  |  | +                     clearable
 | 
	
		
			
				|  |  | +                     placeholder="日志类型">
 | 
	
		
			
				|  |  | +            <el-option label="系统通知" value="SYSTEM"></el-option>
 | 
	
		
			
				|  |  | +            <el-option label="学生申诉" value="STUDENT"></el-option>
 | 
	
		
			
				|  |  | +            <el-option label="退团退课" value="MUSICGROUP"></el-option>
 | 
	
		
			
				|  |  | +            <el-option label="请假处理" value="LEAVE"></el-option>
 | 
	
		
			
				|  |  | +            <el-option label="VIP申请审核" value="VIPAPPLY"></el-option>
 | 
	
		
			
				|  |  | +          </el-select>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="readStatus">
 | 
	
		
			
				|  |  | +          <el-select v-model.trim="searchForm.readStatus"
 | 
	
		
			
				|  |  | +                     clearable
 | 
	
		
			
				|  |  | +                     placeholder="日志状态">
 | 
	
		
			
				|  |  | +            <el-option label="已读" value="1"></el-option>
 | 
	
		
			
				|  |  | +            <el-option label="未读" value="0"></el-option>
 | 
	
		
			
				|  |  | +          </el-select>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <!-- <el-form-item>
 | 
	
		
			
				|  |  | +          <el-date-picker :clearable="false"
 | 
	
		
			
				|  |  | +                          v-model="searchForm.month"
 | 
	
		
			
				|  |  | +                          type="date"
 | 
	
		
			
				|  |  | +                          placeholder="选择年月"></el-date-picker>
 | 
	
		
			
				|  |  | +        </el-form-item> -->
 | 
	
		
			
				|  |  | +        <el-form-item>
 | 
	
		
			
				|  |  | +          <el-button type="danger" @click="onSearch">搜索</el-button>
 | 
	
		
			
				|  |  | +          <el-button type="primary" @click="onSearchReset('searchForm')">重置</el-button>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +      </el-form>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  | +      <div class="tableWrap">
 | 
	
		
			
				|  |  | +        <el-table style="width: 100%"
 | 
	
		
			
				|  |  | +                  :header-cell-style="{background:'#EDEEF0',color:'#444'}"
 | 
	
		
			
				|  |  | +                  :data="tableList">
 | 
	
		
			
				|  |  | +          <el-table-column label="申请人" prop="userId" width="100px">
 | 
	
		
			
				|  |  | +            <template slot-scope="scope">
 | 
	
		
			
				|  |  | +              <el-badge :is-dot="!scope.row.readStatus" style="vertical-align: sub;"></el-badge>
 | 
	
		
			
				|  |  | +              {{ scope.row.userId }}
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  | +          </el-table-column>
 | 
	
		
			
				|  |  | +          <el-table-column align="center" label="申请时间" prop="createOn"></el-table-column>
 | 
	
		
			
				|  |  | +          <el-table-column align="center" label="类型">
 | 
	
		
			
				|  |  | +            <template slot-scope="scope">
 | 
	
		
			
				|  |  | +              {{ scope.row.group | journalTypeFormat }}
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  | +          </el-table-column>
 | 
	
		
			
				|  |  | +          <el-table-column align="center" label="内容" prop="content"></el-table-column>
 | 
	
		
			
				|  |  | +          <el-table-column align="center"
 | 
	
		
			
				|  |  | +                           label="操作"
 | 
	
		
			
				|  |  | +                           fixed="right">
 | 
	
		
			
				|  |  | +            <template slot-scope="scope">
 | 
	
		
			
				|  |  | +              <el-button type="text" v-if="scope.row.readStatus != 1">已读</el-button>
 | 
	
		
			
				|  |  | +              <el-button type="text">查看</el-button>
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  | +          </el-table-column>
 | 
	
		
			
				|  |  | +        </el-table>
 | 
	
		
			
				|  |  | +        <pagination :total="pageInfo.total"
 | 
	
		
			
				|  |  | +                    :page.sync="pageInfo.page"
 | 
	
		
			
				|  |  | +                    :limit.sync="pageInfo.limit"
 | 
	
		
			
				|  |  | +                    :page-sizes="pageInfo.page_size"
 | 
	
		
			
				|  |  | +                    @pagination="getList" />
 | 
	
		
			
				|  |  | +      </div>
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  |    </div>
 | 
	
		
			
				|  |  |  </template>
 | 
	
		
			
				|  |  |  <script>
 | 
	
		
			
				|  |  | -import item from './journalItem'
 | 
	
		
			
				|  |  | -import studentComplain from './studentComplain'
 | 
	
		
			
				|  |  | -import musicGroup from './musicGroup'
 | 
	
		
			
				|  |  | -import leaveOperation from './leaveOperation'
 | 
	
		
			
				|  |  | -import vipApply from './vipApply'
 | 
	
		
			
				|  |  | -import { permission } from '@/utils/directivePage'
 | 
	
		
			
				|  |  | +import cleanDeep from 'clean-deep';
 | 
	
		
			
				|  |  | +import pagination from "@/components/Pagination/index";
 | 
	
		
			
				|  |  | +import { queryCountOfUnread, sysMessageList, setRead } from '@/api/journal'
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  | -  components: {
 | 
	
		
			
				|  |  | -    item, studentComplain, musicGroup, leaveOperation, vipApply
 | 
	
		
			
				|  |  | -  },
 | 
	
		
			
				|  |  | +  components: { pagination },
 | 
	
		
			
				|  |  |    name: 'journal',
 | 
	
		
			
				|  |  |    data () {
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  | -      activeIndex: '0',
 | 
	
		
			
				|  |  | -      permissionList: {
 | 
	
		
			
				|  |  | -        journalItem: permission('/journalItem'),
 | 
	
		
			
				|  |  | -        studentComplain: permission('/studentComplain'),
 | 
	
		
			
				|  |  | -        musicGroupCourse: permission('/musicGroupCourse'),
 | 
	
		
			
				|  |  | -        leaveOperation: permission('/leaveOperation'),
 | 
	
		
			
				|  |  | -        vipApply: permission('/vipApply')
 | 
	
		
			
				|  |  | +      searchForm: {
 | 
	
		
			
				|  |  | +        search: null,
 | 
	
		
			
				|  |  | +        group: null,
 | 
	
		
			
				|  |  | +        readStatus: null
 | 
	
		
			
				|  |  | +      },
 | 
	
		
			
				|  |  | +      tableList: [],
 | 
	
		
			
				|  |  | +      pageInfo: {
 | 
	
		
			
				|  |  | +        // 分页规则
 | 
	
		
			
				|  |  | +        limit: 10, // 限制显示条数
 | 
	
		
			
				|  |  | +        page: 1, // 当前页
 | 
	
		
			
				|  |  | +        total: 0, // 总条数
 | 
	
		
			
				|  |  | +        page_size: [10, 20, 40, 50] // 选择限制显示条数
 | 
	
		
			
				|  |  |        }
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    },
 | 
	
		
			
				|  |  | +  mounted() {
 | 
	
		
			
				|  |  | +    this.getList()
 | 
	
		
			
				|  |  | +  },
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  | -    handleClick (val) {
 | 
	
		
			
				|  |  | -      this.activeIndex = val.name
 | 
	
		
			
				|  |  | +    __init () {
 | 
	
		
			
				|  |  | +      // 未读消息
 | 
	
		
			
				|  |  | +      // queryCountOfUnread().then(res => {
 | 
	
		
			
				|  |  | +      //   if (res.code == 200) {
 | 
	
		
			
				|  |  | +      //     if (res.data && res.data.SYSTEM) {
 | 
	
		
			
				|  |  | +      //       this.noReadMessage = res.data.SYSTEM
 | 
	
		
			
				|  |  | +      //     }
 | 
	
		
			
				|  |  | +      //   }
 | 
	
		
			
				|  |  | +      // })
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    onSearch() {
 | 
	
		
			
				|  |  | +      this.pageInfo.page = 1
 | 
	
		
			
				|  |  | +      this.getList()
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    onSearchReset(formName) {
 | 
	
		
			
				|  |  | +      this.$refs[formName].resetFields()
 | 
	
		
			
				|  |  | +      this.getList()
 | 
	
		
			
				|  |  | +    },
 | 
	
		
			
				|  |  | +    async getList() {
 | 
	
		
			
				|  |  | +      const pageInfo = this.pageInfo
 | 
	
		
			
				|  |  | +      const params = Object.assign({}, this.searchForm)
 | 
	
		
			
				|  |  | +      params.rows = pageInfo.limit
 | 
	
		
			
				|  |  | +      params.page = pageInfo.page
 | 
	
		
			
				|  |  | +      await sysMessageList(params).then(res => {
 | 
	
		
			
				|  |  | +        if (res.code == 200) {
 | 
	
		
			
				|  |  | +          this.tableList = res.data.rows
 | 
	
		
			
				|  |  | +          pageInfo.total = res.data.total
 | 
	
		
			
				|  |  | +        }
 | 
	
		
			
				|  |  | +      })
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    }
 | 
	
		
			
				|  |  |  }
 |