提交 338bedbd authored 作者: lihuihui's avatar lihuihui

update

上级 ffd353b5
......@@ -8,6 +8,7 @@
"version": "0.0.0",
"dependencies": {
"axios": "^0.27.2",
"blueimp-md5": "^2.19.0",
"element-ui": "^2.15.8",
"lodash": "^4.17.21",
"query-string": "^7.1.1",
......@@ -15,6 +16,7 @@
"vue": "^2.6.14",
"vue-meta": "^2.4.0",
"vue-router": "^3.5.4",
"vuedraggable": "^2.24.3",
"vuex": "^3.6.2",
"xlsx": "^0.18.5"
},
......@@ -1529,6 +1531,11 @@
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
"dev": true
},
"node_modules/blueimp-md5": {
"version": "2.19.0",
"resolved": "https://registry.npmmirror.com/blueimp-md5/-/blueimp-md5-2.19.0.tgz",
"integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w=="
},
"node_modules/boolbase": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
......@@ -5277,6 +5284,11 @@
"node": ">= 6"
}
},
"node_modules/sortablejs": {
"version": "1.10.2",
"resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.10.2.tgz",
"integrity": "sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A=="
},
"node_modules/source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
......@@ -6277,6 +6289,14 @@
"integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==",
"dev": true
},
"node_modules/vuedraggable": {
"version": "2.24.3",
"resolved": "https://registry.npmmirror.com/vuedraggable/-/vuedraggable-2.24.3.tgz",
"integrity": "sha512-6/HDXi92GzB+Hcs9fC6PAAozK1RLt1ewPTLjK0anTYguXLAeySDmcnqE8IC0xa7shvSzRjQXq3/+dsZ7ETGF3g==",
"dependencies": {
"sortablejs": "1.10.2"
}
},
"node_modules/vuex": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz",
......@@ -7575,6 +7595,11 @@
"integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
"dev": true
},
"blueimp-md5": {
"version": "2.19.0",
"resolved": "https://registry.npmmirror.com/blueimp-md5/-/blueimp-md5-2.19.0.tgz",
"integrity": "sha512-DRQrD6gJyy8FbiE4s+bDoXS9hiW3Vbx5uCdwvcCf3zLHL+Iv7LtGHLpr+GZV8rHG8tK766FGYBwRbu8pELTt+w=="
},
"boolbase": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
......@@ -10279,6 +10304,11 @@
"socks": "^2.3.3"
}
},
"sortablejs": {
"version": "1.10.2",
"resolved": "https://registry.npmmirror.com/sortablejs/-/sortablejs-1.10.2.tgz",
"integrity": "sha512-YkPGufevysvfwn5rfdlGyrGjt7/CRHwvRPogD/lC+TnvcN29jDpCifKP+rBqf+LRldfXSTh+0CGLcSg0VIxq3A=="
},
"source-map": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
......@@ -11077,6 +11107,14 @@
"integrity": "sha512-4gDntzrifFnCEvyoO8PqyJDmguXgVPxKiIxrBKjIowvL9l+N66196+72XVYR8BBf1Uv1Fgt3bGevJ+sEmxfZzw==",
"dev": true
},
"vuedraggable": {
"version": "2.24.3",
"resolved": "https://registry.npmmirror.com/vuedraggable/-/vuedraggable-2.24.3.tgz",
"integrity": "sha512-6/HDXi92GzB+Hcs9fC6PAAozK1RLt1ewPTLjK0anTYguXLAeySDmcnqE8IC0xa7shvSzRjQXq3/+dsZ7ETGF3g==",
"requires": {
"sortablejs": "1.10.2"
}
},
"vuex": {
"version": "3.6.2",
"resolved": "https://registry.npmjs.org/vuex/-/vuex-3.6.2.tgz",
......
......@@ -12,9 +12,11 @@
},
"dependencies": {
"axios": "^0.27.2",
"blueimp-md5": "^2.19.0",
"element-ui": "^2.15.8",
"lodash": "^4.17.21",
"query-string": "^7.1.1",
"vuedraggable": "^2.24.3",
"video.js": "^7.18.1",
"vue": "^2.6.14",
"vue-meta": "^2.4.0",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -60,6 +60,7 @@
<el-select v-model="params.has_certificate" placeholder="请选择">
<el-option label="已获得" :value="true" />
<el-option label="未获得" :value="false" />
<el-option label="待上传" value="wait" />
</el-select>
</template>
<template v-slot:table-img="{ row }">
......@@ -147,13 +148,14 @@ export default {
{ label: '重修次数', align: 'center', prop: 'study_times' },
{ label: '当前学习进度', align: 'center', prop: 'progress' },
{ label: '考试成绩', align: 'center', prop: 'score' },
{
label: '证书',
align: 'center',
computed({ row }) {
return row.has_certificate ? '已获得' : '未获得'
}
},
{ label: '证书', align: 'center', prop: 'certificate_status_name' },
// {
// label: '证书',
// align: 'center',
// computed({ row }) {
// return row.has_certificate ? '已获得' : '未获得'
// }
// },
{ label: '操作', slots: 'table-x', align: 'center', width: '300', fixed: 'right' }
]
}
......
......@@ -19,3 +19,10 @@ export function getCertDetails(params) {
export function exportCertList(params) {
return httpRequest.get('/api/zy-admin/school/certificate/download', { params, headers: { responseType: 'blob' } })
}
/**
* 上传证书
*/
export function importPeople(data) {
return httpRequest.post('/api/zy-admin/school/certificate/upload', data)
}
<template>
<el-dialog v-bind="$attrs" v-on="$listeners" title="更新证书">
<el-upload
style="text-align: center"
class="file-import"
ref="upload"
:data="data"
:before-upload="beforeUpload"
:on-success="handleSuccess"
action="https://webapp-pub.oss-cn-beijing.aliyuncs.com"
:limit="1"
drag
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
</el-upload>
<div style="text-align: center; margin-top: 15px">
<el-button size="mini" @click="cancel">取消</el-button>
<el-button type="primary" size="mini" @click="submitUpload" style="margin-right: 5px"> 确认提交</el-button>
</div>
</el-dialog>
</template>
<script>
import { getSignature } from '@/api/base'
import md5 from 'blueimp-md5'
import { importPeople } from '../api'
export default {
data() {
return {
data: {},
file: '',
activityOption: [],
stepOption: [],
fileList: []
}
},
methods: {
beforeUpload(file) {
const limit = this.$attrs.limit
if (limit && this.fileList.length >= limit) {
this.message && this.message.close()
this.message = this.$message({ type: 'error', message: '文件超出个数限制' })
return false
}
const fileName = file.name
const key =
'upload/shop-admin/' + md5(fileName + new Date().getTime()) + fileName.substr(fileName.lastIndexOf('.'))
return new Promise((resolve, reject) => {
getSignature()
.then(response => {
const { accessid, policy, signature, host } = response
this.data = { key, OSSAccessKeyId: accessid, policy, signature, success_action_status: '200' }
file.url = `${host}/${key}`
resolve(true)
})
.catch(err => {
// console.log(err)
reject(err)
})
})
},
handleSuccess(response, file) {
// this.fileList.push({ name: file.name, url: file.raw.url })
this.fileList = [file.raw.url]
},
submitUpload() {
importPeople({
file: this.fileList[0]
}).then(res => {
this.$emit('cancel')
this.$alert('正在更新...', '更新证书', {
confirmButtonText: '我知道了',
callback: action => {}
})
})
},
cancel() {
this.$emit('cancel')
}
}
}
</script>
<style lang="scss" scoped>
.file-import {
::v-deep {
.el-upload-dragger {
width: 260px !important;
}
}
}
</style>
......@@ -28,6 +28,9 @@
>
</el-date-picker>
</template>
<div style="margin-bottom: 20px">
<el-button type="primary" @click="importDialogVisible = true">更新证书</el-button>
</div>
<template v-slot:table-x="{ row }">
<router-link
:to="{ path: './cert/details', query: { id: row.student_id, name: row.personal_name } }"
......@@ -44,21 +47,29 @@
<span style="font-size: 12px; padding: 0 10px; color: #606266">导出当前搜索结果</span>
</div>
</app-list>
<import-people
@cancel="importDialogVisible = false"
width="400px"
:visible.sync="importDialogVisible"
></import-people>
</app-card>
</template>
<script>
import AppClassSelect from '@/components/base/AppClassSelect.vue'
import importPeople from '../components/importPeople.vue'
import { getCertList } from '../api'
import queryString from 'query-string'
export default {
data() {
return {
listParams: {}
importDialogVisible: false,
listParams: {},
imgCert: ''
}
},
components: { AppClassSelect },
components: { AppClassSelect, importPeople },
computed: {
// 是否有班级权限
hasClassPermission() {
......@@ -81,7 +92,8 @@ export default {
prop: 'has_certificate',
options: [
{ label: '已获得', value: true },
{ label: '未获得', value: false }
{ label: '未获得', value: false },
{ label: '待上传', value: 'wait' }
],
visible: this.hasClassPermission
},
......@@ -93,13 +105,23 @@ export default {
{ label: '所属班级', align: 'center', prop: 'class_name', visible: this.hasClassPermission },
{ label: '所属机构', align: 'center', prop: 'organization_name' },
{ label: '身份证号码', align: 'center', prop: 'id_number' },
// {
// label: '是否取证',
// align: 'center',
// visible: this.hasClassPermission,
// computed({ row }) {
// return row.has_certificate ? '已获得' : '未获得'
// }
// },
{
label: '是否取证',
align: 'center',
visible: this.hasClassPermission,
computed({ row }) {
return row.has_certificate ? '已获得' : '未获得'
}
prop: 'certificate_status_name'
},
{
label: '证书类型',
align: 'center',
prop: 'class_certificate_type_name'
},
{ label: '取证时间', align: 'center', prop: 'certificate_created_time' },
{ label: '操作', slots: 'table-x', align: 'center', width: '220', fixed: 'right' }
......
......@@ -10,6 +10,22 @@
<el-form-item label="班级描述" prop="class_describe">
<el-input type="textarea" v-model="form.class_describe" maxlength="50"></el-input>
</el-form-item>
<el-form-item label="证书类型" prop="certificate_type">
<div class="cert-item">
<div :class="form.certificate_type == '1' ? 'item active' : 'item'" @click="changeType('1')">
<div class="pop">
<i class="el-icon-success"></i>
</div>
<img src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/fd/zs-admin.png" />
</div>
<div :class="form.certificate_type == '2' ? 'item active' : 'item'" @click="changeType('2')">
<div class="pop">
<i class="el-icon-success"></i>
</div>
<img src="https://webapp-pub.oss-cn-beijing.aliyuncs.com/project/fd/zs2.png" />
</div>
</div>
</el-form-item>
<el-form-item>
<el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="onPrimary">提交</el-button>
......@@ -30,7 +46,8 @@ export default {
form: {
class_name: '',
class_number: '',
class_describe: ''
class_describe: '',
certificate_type: '1'
},
rules: {
class_name: [
......@@ -38,7 +55,8 @@ export default {
{ min: 0, max: 40, message: '您最多可输入40 个字符', trigger: 'blur' }
],
class_number: [{ min: 0, max: 40, message: '您最多可输入40 个字符', trigger: 'blur' }],
class_describe: [{ min: 0, max: 100, message: '您最多可输入50个字符', trigger: 'blur' }]
class_describe: [{ min: 0, max: 100, message: '您最多可输入50个字符', trigger: 'blur' }],
certificate_type: { required: true, message: '' }
}
}
},
......@@ -66,6 +84,10 @@ export default {
}
},
methods: {
// 切换证书类型
changeType(n) {
this.form.certificate_type = n
},
cancel() {
this.$router.push('/school/class')
},
......@@ -103,3 +125,38 @@ export default {
}
}
</script>
<style scoped lang="scss">
.cert-item {
display: flex;
.item {
width: 150px;
position: relative;
margin-right: 20px;
&.active {
.pop {
opacity: 1;
}
}
.pop {
opacity: 0;
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
i {
color: #fff;
font-size: 34px;
}
}
img {
width: 100%;
display: block;
}
}
}
</style>
......@@ -3,8 +3,23 @@
<app-list v-bind="tableOptions" ref="list">
<template>
<el-row style="margin-bottom: 20px">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="add" v-permission="'menu_school_students_add'">新建</el-button>
<el-button type="primary" icon="el-icon-upload2" style="margin-left: 20px" @click="imports" size="mini" v-permission="'menu_school_students_import'">导入</el-button>
<el-button
type="primary"
icon="el-icon-plus"
size="mini"
@click="add"
v-permission="'menu_school_students_add'"
>新建</el-button
>
<el-button
type="primary"
icon="el-icon-upload2"
style="margin-left: 20px"
@click="imports"
size="mini"
v-permission="'menu_school_students_import'"
>导入</el-button
>
<!-- <el-button type="primary" icon="el-icon-download" style="margin-left: 20px" @click="downLoad" size="mini">下载</el-button> -->
</el-row>
</template>
......@@ -22,10 +37,21 @@
<router-link :to="{ path: 'student/view', query: { id: row.id } }" v-permission="'menu_school_students_view'">
<el-button type="primary" style="margin-left: 10px" size="mini" plain>查看</el-button>
</router-link>
<router-link :to="{ path: 'student/update', query: { id: row.id } }" v-permission="'menu_school_students_update'">
<router-link
:to="{ path: 'student/update', query: { id: row.id } }"
v-permission="'menu_school_students_update'"
>
<el-button type="success" style="margin-left: 10px" size="mini" plain>更新</el-button>
</router-link>
<el-button type="danger" @click="onRemove(row)" style="margin-left: 10px" size="mini" plain v-permission="'menu_school_student_delete'">删除</el-button>
<el-button
type="danger"
@click="onRemove(row)"
style="margin-left: 10px"
size="mini"
plain
v-permission="'menu_school_student_delete'"
>删除</el-button
>
</template>
</app-list>
</app-card>
......@@ -76,6 +102,7 @@ export default {
return row.expiration_time?.slice(0, 10)
}
},
{ label: '证书状态', prop: 'certificate_status_name', align: 'center' },
{ label: '操作', slots: 'table-x', align: 'center', width: '300', fixed: 'right' }
]
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论