|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+<template>
|
|
|
2
|
+ <div class="app-container">
|
|
|
3
|
+ <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
|
|
|
4
|
+ <el-form-item label="年月" prop="yearMonth">
|
|
|
5
|
+ <el-date-picker v-model="queryParams.yearMonth" type="month" placeholder="请选择年月" value-format="YYYY-MM" style="width: 200px" />
|
|
|
6
|
+ </el-form-item>
|
|
|
7
|
+ <el-form-item label="姓名" prop="studentName">
|
|
|
8
|
+ <el-input v-model="queryParams.studentName" placeholder="请输入姓名" clearable style="width: 200px" />
|
|
|
9
|
+ </el-form-item>
|
|
|
10
|
+ <el-form-item label="科队" prop="team">
|
|
|
11
|
+ <el-select v-model="queryParams.team" placeholder="请选择科队" clearable style="width: 200px">
|
|
|
12
|
+ <el-option v-for="dict in exam_team" :key="dict.value" :label="dict.label" :value="dict.value" />
|
|
|
13
|
+ </el-select>
|
|
|
14
|
+ </el-form-item>
|
|
|
15
|
+ <el-form-item label="岗位" prop="jobPosition">
|
|
|
16
|
+ <el-input v-model="queryParams.jobPosition" placeholder="请输入岗位" clearable style="width: 200px" />
|
|
|
17
|
+ </el-form-item>
|
|
|
18
|
+ <el-form-item>
|
|
|
19
|
+ <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
20
|
+ <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
21
|
+ </el-form-item>
|
|
|
22
|
+ </el-form>
|
|
|
23
|
+
|
|
|
24
|
+ <el-row :gutter="10" class="mb8">
|
|
|
25
|
+ <el-col :span="1.5">
|
|
|
26
|
+ <el-button type="info" plain icon="Upload" @click="handleImport">导入</el-button>
|
|
|
27
|
+ </el-col>
|
|
|
28
|
+ <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
29
|
+ </el-row>
|
|
|
30
|
+
|
|
|
31
|
+ <el-table v-loading="loading" :data="trainingPerformanceList" >
|
|
|
32
|
+ <el-table-column label="年月" align="center" prop="yearMonth" />
|
|
|
33
|
+ <el-table-column label="学生" align="center" prop="studentName" />
|
|
|
34
|
+ <el-table-column label="科队" align="center" prop="team">
|
|
|
35
|
+ <template #default="scope">
|
|
|
36
|
+ <dict-tag :options="exam_team" :value="scope.row.team" />
|
|
|
37
|
+ </template>
|
|
|
38
|
+ </el-table-column>
|
|
|
39
|
+ <el-table-column label="岗位" align="center" prop="jobPosition">
|
|
|
40
|
+
|
|
|
41
|
+ </el-table-column>
|
|
|
42
|
+ <el-table-column label="综合成绩" align="center" prop="comprehensiveScore" />
|
|
|
43
|
+ <el-table-column label="综合用时" align="center" prop="comprehensiveTime" />
|
|
|
44
|
+ <el-table-column label="专项成绩" align="center" prop="specialScore" />
|
|
|
45
|
+ <el-table-column label="专项用时" align="center" prop="specialTime" />
|
|
|
46
|
+ </el-table>
|
|
|
47
|
+
|
|
|
48
|
+ <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
|
|
|
49
|
+ v-model:limit="queryParams.pageSize" @pagination="getList" />
|
|
|
50
|
+
|
|
|
51
|
+ <!-- 导入对话框 -->
|
|
|
52
|
+ <el-dialog :title="upload.title" v-model="upload.open" width="400px" append-to-body>
|
|
|
53
|
+ <el-upload ref="uploadRef" :limit="1" accept=".xlsx, .xls" :headers="upload.headers"
|
|
|
54
|
+ :action="upload.url + '?updateSupport=' + upload.updateSupport" :disabled="upload.isUploading"
|
|
|
55
|
+ :on-progress="handleFileUploadProgress" :on-success="handleFileSuccess" :auto-upload="false" drag>
|
|
|
56
|
+ <el-icon class="el-icon--upload"><upload-filled /></el-icon>
|
|
|
57
|
+ <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
58
|
+ <template #tip>
|
|
|
59
|
+ <div class="el-upload__tip text-center">
|
|
|
60
|
+ <span>仅允许导入xls、xlsx格式文件。</span>
|
|
|
61
|
+ <el-link type="primary" :underline="false" style="font-size:16px;vertical-align: baseline;" @click="handleDownloadTemplate">下载模板</el-link>
|
|
|
62
|
+ </div>
|
|
|
63
|
+ </template>
|
|
|
64
|
+ </el-upload>
|
|
|
65
|
+ <template #footer>
|
|
|
66
|
+ <div class="dialog-footer">
|
|
|
67
|
+ <el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
68
|
+ <el-button @click="upload.open = false">取 消</el-button>
|
|
|
69
|
+ </div>
|
|
|
70
|
+ </template>
|
|
|
71
|
+ </el-dialog>
|
|
|
72
|
+ </div>
|
|
|
73
|
+</template>
|
|
|
74
|
+
|
|
|
75
|
+<script setup name="TrainingPerformance">
|
|
|
76
|
+import { listMonthlyScore, downloadTemplate, importData } from "@/api/examManage/monthlyAssessPerformance"
|
|
|
77
|
+import request from '@/utils/request'
|
|
|
78
|
+import { getToken } from "@/utils/auth"
|
|
|
79
|
+import { addDateRange, parseTime } from "@/utils/ruoyi"
|
|
|
80
|
+import { UploadFilled } from '@element-plus/icons-vue'
|
|
|
81
|
+
|
|
|
82
|
+const { proxy } = getCurrentInstance()
|
|
|
83
|
+const { exam_team, post } = proxy.useDict('exam_team', 'post')
|
|
|
84
|
+
|
|
|
85
|
+const trainingPerformanceList = ref([])
|
|
|
86
|
+const loading = ref(true)
|
|
|
87
|
+const showSearch = ref(true)
|
|
|
88
|
+const ids = ref([])
|
|
|
89
|
+const single = ref(true)
|
|
|
90
|
+const multiple = ref(true)
|
|
|
91
|
+const total = ref(0)
|
|
|
92
|
+const dateRange = ref([])
|
|
|
93
|
+
|
|
|
94
|
+// 导入参数
|
|
|
95
|
+const upload = reactive({
|
|
|
96
|
+ // 是否显示弹出层
|
|
|
97
|
+ open: false,
|
|
|
98
|
+ // 弹出层标题
|
|
|
99
|
+ title: "",
|
|
|
100
|
+ // 是否禁用上传
|
|
|
101
|
+ isUploading: false,
|
|
|
102
|
+ // 是否更新已经存在的用户数据
|
|
|
103
|
+ updateSupport: 0,
|
|
|
104
|
+ // 设置上传的请求头部
|
|
|
105
|
+ headers: { Authorization: "Bearer " + getToken() },
|
|
|
106
|
+ // 上传的地址
|
|
|
107
|
+ url: import.meta.env.VITE_APP_BASE_API + "/exam/monthlyScore/importData"
|
|
|
108
|
+})
|
|
|
109
|
+
|
|
|
110
|
+const data = reactive({
|
|
|
111
|
+ queryParams: {
|
|
|
112
|
+ pageNum: 1,
|
|
|
113
|
+ pageSize: 10,
|
|
|
114
|
+ yearMonth: undefined,
|
|
|
115
|
+ studentName: undefined,
|
|
|
116
|
+ team: undefined,
|
|
|
117
|
+ position: undefined
|
|
|
118
|
+ }
|
|
|
119
|
+})
|
|
|
120
|
+
|
|
|
121
|
+const { queryParams } = toRefs(data)
|
|
|
122
|
+
|
|
|
123
|
+/** 查询月考成绩列表 */
|
|
|
124
|
+function getList() {
|
|
|
125
|
+ loading.value = true;
|
|
|
126
|
+ let params = {
|
|
|
127
|
+ ...queryParams.value,
|
|
|
128
|
+ }
|
|
|
129
|
+ listMonthlyScore(params).then(response => {
|
|
|
130
|
+ trainingPerformanceList.value = response.rows
|
|
|
131
|
+ total.value = response.total
|
|
|
132
|
+ loading.value = false
|
|
|
133
|
+ })
|
|
|
134
|
+}
|
|
|
135
|
+
|
|
|
136
|
+/** 搜索按钮操作 */
|
|
|
137
|
+function handleQuery() {
|
|
|
138
|
+ queryParams.value.pageNum = 1
|
|
|
139
|
+ getList()
|
|
|
140
|
+}
|
|
|
141
|
+
|
|
|
142
|
+/** 重置按钮操作 */
|
|
|
143
|
+function resetQuery() {
|
|
|
144
|
+ dateRange.value = []
|
|
|
145
|
+ proxy.resetForm("queryRef")
|
|
|
146
|
+ handleQuery()
|
|
|
147
|
+}
|
|
|
148
|
+
|
|
|
149
|
+/** 多选框选中数据 */
|
|
|
150
|
+function handleSelectionChange(selection) {
|
|
|
151
|
+ ids.value = selection.map(item => item.id)
|
|
|
152
|
+ single.value = selection.length != 1
|
|
|
153
|
+ multiple.value = !selection.length
|
|
|
154
|
+}
|
|
|
155
|
+
|
|
|
156
|
+/** 导入按钮操作 */
|
|
|
157
|
+function handleImport() {
|
|
|
158
|
+ upload.title = "导入"
|
|
|
159
|
+ upload.open = true
|
|
|
160
|
+}
|
|
|
161
|
+
|
|
|
162
|
+/** 下载模板操作 */
|
|
|
163
|
+function handleDownloadTemplate() {
|
|
|
164
|
+ proxy.download("/exam/monthlyScore/importTemplate", {}, `monthly_score_template_${new Date().getTime()}.xlsx`, 'post')
|
|
|
165
|
+}
|
|
|
166
|
+
|
|
|
167
|
+/**文件上传中处理 */
|
|
|
168
|
+const handleFileUploadProgress = (event, file, fileList) => {
|
|
|
169
|
+ upload.isUploading = true
|
|
|
170
|
+}
|
|
|
171
|
+
|
|
|
172
|
+/** 文件上传成功处理 */
|
|
|
173
|
+const handleFileSuccess = (response, file, fileList) => {
|
|
|
174
|
+ upload.open = false
|
|
|
175
|
+ upload.isUploading = false
|
|
|
176
|
+ proxy.$refs["uploadRef"].handleRemove(file)
|
|
|
177
|
+ if (response.code === 200) {
|
|
|
178
|
+ proxy.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true })
|
|
|
179
|
+ getList()
|
|
|
180
|
+ } else {
|
|
|
181
|
+ proxy.$modal.msgError(response.msg)
|
|
|
182
|
+ }
|
|
|
183
|
+}
|
|
|
184
|
+
|
|
|
185
|
+/** 提交上传文件 */
|
|
|
186
|
+function submitFileForm() {
|
|
|
187
|
+ proxy.$refs["uploadRef"].submit()
|
|
|
188
|
+}
|
|
|
189
|
+
|
|
|
190
|
+getList()
|
|
|
191
|
+</script>
|