96 lines
4.1 KiB
Vue
96 lines
4.1 KiB
Vue
<template>
|
|
<div class="app-container">
|
|
<el-form v-show="showSearch" ref="queryForm" :model="queryParams" size="small" :inline="true">
|
|
<el-form-item label="培训计划" prop="planName">
|
|
<el-input v-model="queryParams.planName" placeholder="请输入计划名称" clearable @keyup.enter.native="handleQuery" />
|
|
</el-form-item>
|
|
<el-form-item label="学员" prop="studentName">
|
|
<el-input v-model="queryParams.studentName" placeholder="请输入学员姓名" clearable @keyup.enter.native="handleQuery" />
|
|
</el-form-item>
|
|
<el-form-item label="来源系统" prop="sourceSystem">
|
|
<el-input v-model="queryParams.sourceSystem" placeholder="如 VR实训系统" clearable @keyup.enter.native="handleQuery" />
|
|
</el-form-item>
|
|
<el-form-item label="学习内容" prop="learningContent">
|
|
<el-input v-model="queryParams.learningContent" placeholder="请输入学习内容" clearable @keyup.enter.native="handleQuery" />
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
<el-row :gutter="10" class="mb8">
|
|
<el-col :span="1.5">
|
|
<el-button
|
|
v-hasPermi="['train:learning:export']"
|
|
type="warning"
|
|
plain
|
|
icon="el-icon-download"
|
|
size="mini"
|
|
@click="handleExport"
|
|
>导出</el-button>
|
|
</el-col>
|
|
<right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
|
|
</el-row>
|
|
<el-alert title="学习记录由外部学习系统或设备上报,本页面仅供查询。" type="info" :closable="false" show-icon class="mb8" />
|
|
<el-table v-loading="loading" :data="rows">
|
|
<el-table-column label="培训计划" prop="planName" min-width="150" show-overflow-tooltip />
|
|
<el-table-column label="学员" prop="studentName" min-width="100" />
|
|
<el-table-column label="课程" prop="courseName" min-width="130" show-overflow-tooltip />
|
|
<el-table-column label="学习内容" prop="learningContent" min-width="160" show-overflow-tooltip />
|
|
<el-table-column label="学习资源" prop="resourceName" min-width="130" show-overflow-tooltip />
|
|
<el-table-column label="来源系统" prop="sourceSystem" min-width="120" show-overflow-tooltip />
|
|
<el-table-column label="开始时间" prop="startTime" width="170" />
|
|
<el-table-column label="结束时间" prop="endTime" width="170" />
|
|
<el-table-column label="有效时长" align="right" width="110">
|
|
<template slot-scope="scope">{{ formatDuration(scope.row.studySeconds) }}</template>
|
|
</el-table-column>
|
|
<el-table-column label="入库时间" prop="syncTime" width="170" />
|
|
</el-table>
|
|
<pagination
|
|
v-show="total > 0"
|
|
:total="total"
|
|
:page.sync="queryParams.pageNum"
|
|
:limit.sync="queryParams.pageSize"
|
|
@pagination="getList"
|
|
/>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import { listDuration } from '@/api/train/duration'
|
|
|
|
export default {
|
|
name: 'Duration',
|
|
data() {
|
|
return {
|
|
loading: true,
|
|
showSearch: true,
|
|
total: 0,
|
|
rows: [],
|
|
queryParams: { pageNum: 1, pageSize: 10, planName: null, studentName: null, sourceSystem: null, learningContent: null }
|
|
}
|
|
},
|
|
created() { this.getList() },
|
|
methods: {
|
|
getList() {
|
|
this.loading = true
|
|
listDuration(this.queryParams).then(response => {
|
|
this.rows = response.rows
|
|
this.total = response.total
|
|
}).finally(() => { this.loading = false })
|
|
},
|
|
formatDuration(seconds) {
|
|
if (seconds == null) return '-'
|
|
const hours = Math.floor(seconds / 3600)
|
|
const minutes = Math.floor((seconds % 3600) / 60)
|
|
return hours > 0 ? `${hours}小时${minutes}分` : `${minutes}分钟`
|
|
},
|
|
handleQuery() { this.queryParams.pageNum = 1; this.getList() },
|
|
resetQuery() { this.resetForm('queryForm'); this.handleQuery() },
|
|
handleExport() {
|
|
this.download('train/duration/export', { ...this.queryParams }, `duration_${new Date().getTime()}.xlsx`)
|
|
}
|
|
}
|
|
}
|
|
</script>
|