Merge branch 'develop' of https://gitee.com/siwa-team/dawa-vue into develop

This commit is contained in:
18571350067 2022-02-24 09:45:43 +08:00
commit 357753d893
10 changed files with 165 additions and 73 deletions

View File

@ -3,9 +3,9 @@
<div class="answer-card"> <div class="answer-card">
<a-card :bordered="false"> <a-card :bordered="false">
<div @click="handlerBack" class="answer-card-title"><a-icon type="arrow-left" style="margin-right: 6px;" />答题卡</div> <div @click="handlerBack" class="answer-card-title"><a-icon type="arrow-left" style="margin-right: 6px;" />答题卡</div>
<div class="answer-cart-time"> <div v-if="data.examTime" class="answer-cart-time">
倒计时: 倒计时:
<b style="margin-left: 5px;"><a-statistic-countdown :value="deadline" :valueStyle="{ fontSize: '16px' }" @finish="onFinish"/></b> <b style="margin-left: 5px;"><a-statistic-countdown :value="Date.now() + data.examTime*60*1000" :valueStyle="{ fontSize: '16px' }" @finish="onFinish"/></b>
</div> </div>
<DbAnswerCard :data="data"></DbAnswerCard> <DbAnswerCard :data="data"></DbAnswerCard>
<div class="answer-cart-footer flex-center" style="margin-top: 20px;"> <div class="answer-cart-footer flex-center" style="margin-top: 20px;">
@ -89,12 +89,23 @@ export default {
}, },
methods: { methods: {
// //
onFinish () {}, onFinish () {
this.$emit('submit', this.data)
},
handlerBack () { handlerBack () {
this.$router.go(-1) this.$router.go(-1)
}, },
handlerSubmit () { handlerSubmit () {
this.$emit('submit', this.data) const _this = this
this.$confirm({
title: '安全培训',
content: '一但提交将不能修改,确定要现在提交吗?',
onOk () {
// change()
_this.$emit('submit', _this.data)
},
onCancel () {}
})
} }
} }
} }

View File

@ -3,7 +3,7 @@
<div class="container"> <div class="container">
<div class="top"> <div class="top">
<div class="header"> <div class="header">
<a href="/"> <a href="javascript:void(0);">
<img src="~@/assets/logo.svg" class="logo" alt="logo"> <img src="~@/assets/logo.svg" class="logo" alt="logo">
<span class="title">安全培训平台</span> <span class="title">安全培训平台</span>
</a> </a>

View File

@ -39,7 +39,7 @@ const user = {
actions: { actions: {
// 登录 // 登录
Login({ commit }, userInfo) { Login ({ commit }, userInfo) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
login(userInfo).then(response => { login(userInfo).then(response => {
storage.set(ACCESS_TOKEN, response.token, 24 * 60 * 60 * 1000) storage.set(ACCESS_TOKEN, response.token, 24 * 60 * 60 * 1000)
@ -52,7 +52,7 @@ const user = {
}, },
// 获取用户信息 // 获取用户信息
GetInfo({ commit, state }) { GetInfo ({ commit, state }) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
getLoginUser().then(response => { getLoginUser().then(response => {
if (response.code === 200) { if (response.code === 200) {
@ -76,18 +76,25 @@ const user = {
}, },
// 登出 // 登出
Logout({ commit, state }) { Logout ({ commit, state }) {
return new Promise((resolve) => { return new Promise((resolve) => {
logout().then(() => { const clear = function () {
resolve()
}).catch(() => {
resolve()
}).finally(() => {
commit('SET_TOKEN', '') commit('SET_TOKEN', '')
commit('SET_ROLES', []) commit('SET_ROLES', [])
commit('SET_BUTTONS', []) commit('SET_BUTTONS', [])
commit('SET_ROUTERS', []) commit('SET_ROUTERS', [])
storage.remove(ACCESS_TOKEN) storage.remove(ACCESS_TOKEN)
}
logout().then(() => {
clear()
setTimeout(() => {
resolve()
}, 300)
resolve()
}).catch(() => {
resolve()
}).finally(() => {
clear()
}) })
}) })
} }

View File

@ -163,10 +163,14 @@ export default {
methods: { methods: {
// //
goback() { goback() {
this.$router.push({ if(this.$route.query.isOther){
path: '/course/CoursewareList', this.$router.go(-1)
query: { id: this.$route.query.courseId, type: this.$route.query.types }, }else{
}) this.$router.push({
path: '/course/CoursewareList',
query: { id: this.$route.query.courseId, type: this.$route.query.types },
})
}
}, },
/// ///

View File

@ -26,7 +26,7 @@
<a-card :bordered="false"> <a-card :bordered="false">
<div class="table-page-search-wrapper"> <div class="table-page-search-wrapper">
<a-form layout="inline"> <a-form layout="inline">
<a-row :gutter="48"> <!-- <a-row :gutter="48">
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-form-item label="部门名称"><a-input v-model="queryParam.orgName" placeholder="请输入部门名称" @pressEnter="loadData1" /></a-form-item> <a-form-item label="部门名称"><a-input v-model="queryParam.orgName" placeholder="请输入部门名称" @pressEnter="loadData1" /></a-form-item>
</a-col> </a-col>
@ -34,7 +34,7 @@
<a-button type="primary" @click="$refs.table1.refresh(true)">查询</a-button> <a-button type="primary" @click="$refs.table1.refresh(true)">查询</a-button>
<a-button style="margin-left: 8px" @click="() => {queryParam = {}, this.loadData1()}">重置</a-button> <a-button style="margin-left: 8px" @click="() => {queryParam = {}, this.loadData1()}">重置</a-button>
</a-col> </a-col>
</a-row> </a-row> -->
</a-form> </a-form>
</div> </div>
<s-table <s-table
@ -74,7 +74,7 @@
<a-card :bordered="false"> <a-card :bordered="false">
<div class="table-page-search-wrapper" > <div class="table-page-search-wrapper" >
<a-form layout="inline"> <a-form layout="inline">
<a-row :gutter="48"> <!-- <a-row :gutter="48">
<a-col :md="6" :sm="24"> <a-col :md="6" :sm="24">
<a-form-item label="部门名称"><a-input v-model="queryParam.orgName" placeholder="请输入部门名称" @pressEnter="loadData2" /></a-form-item> <a-form-item label="部门名称"><a-input v-model="queryParam.orgName" placeholder="请输入部门名称" @pressEnter="loadData2" /></a-form-item>
</a-col> </a-col>
@ -82,9 +82,13 @@
<a-button type="primary" @click="$refs.table2.refresh(true)">查询</a-button> <a-button type="primary" @click="$refs.table2.refresh(true)">查询</a-button>
<a-button style="margin-left: 8px" @click="() => {queryParam = {}, this.loadData2()}">重置</a-button> <a-button style="margin-left: 8px" @click="() => {queryParam = {}, this.loadData2()}">重置</a-button>
</a-col> </a-col>
</a-row> </a-row> -->
</a-form> </a-form>
</div> </div>
<div class="table-operator">
<a-button @click="changeSort(1)" ref="toFocus">按累计学时排序</a-button>
<a-button @click="changeSort(2)">按年度学时排序</a-button>
</div>
<s-table <s-table
ref="table2" ref="table2"
@ -100,9 +104,9 @@
<a-divider>前十统计排名</a-divider> <a-divider>前十统计排名</a-divider>
<div class="table-operator"> <div class="table-operator">
<a-button @click="changeTopType(1)" ref="toFocus">公司排名年度学时前十统计</a-button> <a-button @click="changeTopType(1)">公司排名年度学时前十统计</a-button>
<a-button @click="changeTopType(2)">公司累计学时学时前十统计</a-button> <a-button @click="changeTopType(2)">公司累计学时学时前十统计</a-button>
</div> </div>
<s-table <s-table
v-show="topType==1" v-show="topType==1"
ref="tableTop1" ref="tableTop1"
@ -112,7 +116,7 @@
:rowKey="(record) => record.id" :rowKey="(record) => record.id"
> >
</s-table> </s-table>
<s-table <s-table
v-show="topType==2" v-show="topType==2"
ref="tableTop2" ref="tableTop2"
@ -121,7 +125,7 @@
:showPagination="false" :showPagination="false"
:rowKey="(record) => record.id" :rowKey="(record) => record.id"
> >
</s-table> </s-table>
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
@ -141,7 +145,7 @@
data () { data () {
return { return {
// //
queryParam: { orgId: undefined, orgName: '' }, queryParam: { orgId: undefined, orgName: '', asc: 1, type: 1 },
// 1 // 1
columns1: [ columns1: [
{ {
@ -150,7 +154,7 @@
}, },
{ {
title: '学员数量', title: '学员数量',
dataIndex: 'studentCount' dataIndex: 'personCount'
}, },
{ {
title: '培训人数', title: '培训人数',
@ -175,6 +179,10 @@
], ],
loadData1: parameter => { loadData1: parameter => {
return dataOrgStatistics(Object.assign(parameter, this.queryParam)).then((res) => { return dataOrgStatistics(Object.assign(parameter, this.queryParam)).then((res) => {
const data = res.rows
data.forEach(function(val){
val.trainRate = val.trainRate + '%'
})
return res return res
}) })
}, },
@ -200,10 +208,6 @@
title: '累计学时', title: '累计学时',
dataIndex: 'sumClassHour' dataIndex: 'sumClassHour'
}, },
{
title: '人均学时',
dataIndex: 'avgClassHour'
}
], ],
loadData2: parameter => { loadData2: parameter => {
return dataPersonalStatistics(Object.assign(parameter, this.queryParam)).then((res) => { return dataPersonalStatistics(Object.assign(parameter, this.queryParam)).then((res) => {
@ -241,7 +245,7 @@
} }
], ],
loadDataTop1: parameter => { loadDataTop1: parameter => {
return dataClassHourTop(Object.assign(parameter, {type : 1})).then((res) => { return dataClassHourTop(Object.assign(parameter, this.queryParam)).then((res) => {
return res.data return res.data
}) })
}, },
@ -276,7 +280,7 @@
} }
], ],
loadDataTop2: parameter => { loadDataTop2: parameter => {
return dataClassHourTop(Object.assign(parameter, {type : 2})).then((res) => { return dataClassHourTop(Object.assign(parameter, this.queryParam)).then((res) => {
return res.data return res.data
}) })
}, },
@ -302,7 +306,7 @@
this.getOrgTree() this.getOrgTree()
}, },
mounted () { mounted () {
}, },
methods: { methods: {
tabsCallback (key) { tabsCallback (key) {
@ -347,10 +351,27 @@
} }
if (this.keyType === '2') { if (this.keyType === '2') {
this.$refs.table2.refresh(true) this.$refs.table2.refresh(true)
if (this.topType === 1) {
this.$refs.tableTop1.refresh(true)
}
if (this.topType === 2) {
this.$refs.tableTop2.refresh(true)
}
} }
}, },
changeTopType (type) { changeTopType (type) {
this.topType = type this.topType = type
this.queryParam.type = type
if (this.topType === 1) {
this.$refs.tableTop1.refresh(true)
}
if (this.topType === 2) {
this.$refs.tableTop2.refresh(true)
}
},
changeSort (type) {
this.queryParam.asc = type
this.$refs.table2.refresh(true)
} }
} }
} }

View File

@ -19,10 +19,12 @@ export default {
data () { data () {
return { return {
examData: {}, examData: {},
query: {} query: {},
startTime: 0
} }
}, },
mounted () { mounted () {
this.startTime = Date.now()
this.query = this.$route.query this.query = this.$route.query
this.$nextTick(() => { this.$nextTick(() => {
this.initData() this.initData()
@ -134,7 +136,7 @@ export default {
const params = { const params = {
projectId: query.projectId, projectId: query.projectId,
courseId: query.courseId, courseId: query.courseId,
answerTime: 0, answerTime: Number.parseInt((Date.now() - this.startTime) / 1000),
type: query.practiceType, type: query.practiceType,
questionList: this.formatSubmit(result) questionList: this.formatSubmit(result)
} }
@ -149,7 +151,7 @@ export default {
const params = { const params = {
projectId: query.projectId, projectId: query.projectId,
courseId: query.courseId, courseId: query.courseId,
answerTime: 0, answerTime: Number.parseInt((Date.now() - this.startTime) / 1000),
type: query.practiceType, type: query.practiceType,
questionList: this.formatSubmit(result) questionList: this.formatSubmit(result)
} }
@ -164,7 +166,7 @@ export default {
const params = { const params = {
projectId: query.projectId, projectId: query.projectId,
courseId: query.courseId, courseId: query.courseId,
answerTime: 0, answerTime: Number.parseInt((Date.now() - this.startTime) / 1000),
type: query.practiceType, type: query.practiceType,
examType: query.type === 'test' ? 1 : (query.type === 'operation' ? 3 : 2), examType: query.type === 'test' ? 1 : (query.type === 'operation' ? 3 : 2),
questionList: this.formatSubmit(result) questionList: this.formatSubmit(result)

View File

@ -7,21 +7,42 @@
@search="handleRefresh" @search="handleRefresh"
@reset=" @reset="
() => { () => {
queryParam = {} queryParam = {};
handleRefresh() handleRefresh();
} }
"></SearchCom> "
></SearchCom>
</div> </div>
<template v-if="dataList && dataList.length>0"> <template v-if="dataList && dataList.length > 0">
<a-card v-for="(item, index) in dataList" :key="index" style="margin-bottom: 15px;"> <a-card v-for="(item, index) in dataList" :key="index" style="margin-bottom: 15px;">
<div class="flex-center" > <div class="flex-center">
<div style="flex: 1;"> <div style="flex: 1;">
<h3>{{ item.name }}</h3> <h3>{{ item.name }}</h3>
<div><span style="margin-right: 20px;">下载次数{{ item.rightQuestions }}</span><span>预览次数{{ item.submitTime }}</span></div> <div>
<span style="margin-right: 20px;">下载次数{{ item.downCount || 0 }}</span>
<span>预览次数{{ item.viewCount }}</span>
</div>
</div> </div>
<div style="flex: 0 0 200px; text-align: right;"> <div style="flex: 0 0 200px; text-align: right;">
<div @click="handlerDown(item)" :span="24" style="margin-bottom: 10px;"><a-button type="primary" size="small" >下载</a-button></div> <!-- <div @click="handlerDown(item)" :span="24" style="margin-bottom: 10px;"><a-button type="primary" size="small" >下载</a-button></div> -->
<div @click="handlerPreview(item)" :span="24"><a-button type="danger" size="small">预览</a-button></div> <a-popover title="资源下载">
<template slot="content">
<a
style="display: block;margin-bottom:15px"
v-for="j in item.videoList"
:href="j.path"
:key="j.id"
>
{{ j.name }}
</a>
</template>
<div :span="24" style="margin-bottom: 10px;">
<a-button type="primary" size="small">下载</a-button>
</div>
</a-popover>
<div @click="handlerPreview(item)" :span="24">
<a-button type="danger" size="small">预览</a-button>
</div>
</div> </div>
</div> </div>
</a-card> </a-card>
@ -32,7 +53,6 @@
<template v-else> <template v-else>
<a-empty style="margin: 30px 0;" /> <a-empty style="margin: 30px 0;" />
</template> </template>
</a-card> </a-card>
</template> </template>
@ -54,24 +74,27 @@ export default {
pageNum: 1 pageNum: 1
}, },
queryParam: { queryParam: {
name: '', // classify: ''
trainWay: ''
}, },
queryOptions: [ queryOptions: [
{ type: 'select-dic-tree', placeholder: '课程类别', key: 'trainWay', options: [] } { type: 'select-dic-tree', placeholder: '课件类别', key: 'classify', options: [] }
] ]
} }
}, },
created () {
this.dictionaryDropDown()
},
mounted () { mounted () {
this.dictionaryDropDown()
this.getList() this.getList()
}, },
methods: { methods: {
//
dictionaryDropDown () {
dictionaryDropDown({ dictionaryCode: '0009' }).then(res => {
this.queryOptions[0].options = dictToTree(res.data, [], 0)
this.loading = false
})
},
getList () { getList () {
gerMyresource(this.params).then(res => { gerMyresource({ ...this.params, ...this.queryParam }).then(res => {
console.log('>>>>>>', res)
this.dataList = res.rows this.dataList = res.rows
this.total = res.total this.total = res.total
}) })
@ -83,24 +106,18 @@ export default {
this.getList() this.getList()
}) })
}, },
handlerDown () { handlerDown () {},
handlerPreview (data) {
this.$router.push({
path: '/course/CoursewarePreview',
query: { coursewareId: data.id, courseId: data.courseId, types: 'self', isOther: 1 }
})
}, },
handlerPreview () {},
handleRefresh () { handleRefresh () {
this.getList() this.getList()
},
//
dictionaryDropDown () {
dictionaryDropDown({ dictionaryCode: '0006' }).then((res) => {
this.queryOptions[1].options = dictToTree(res.data, [], 0)
this.loading = false
})
} }
} }
} }
</script> </script>
<style lang="less"> <style lang="less"></style>
</style>

View File

@ -32,14 +32,23 @@
</a-radio-group> </a-radio-group>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row>
<a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
<a-form-model-item ref="isCalculate" label="是否计算学时" prop="isCalculate"> <a-form-model-item ref="isCalculate" label="是否计算学时" prop="isCalculate">
<a-radio-group v-model="form.isCalculate"> <a-radio-group v-model="form.isCalculate">
<a-radio :value="1"></a-radio> <a-radio :value="1" @click="isCalculateFunc(1)"></a-radio>
<a-radio :value="0"></a-radio> <a-radio :value="0" @click="isCalculateFunc(0)"></a-radio>
</a-radio-group> </a-radio-group>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<div v-if="classHourShow">
<a-col :span="12" >
<a-form-model-item ref="classHour" label="学时" prop="classHour" >
<a-input v-model="form.classHour" />
</a-form-model-item>
</a-col>
</div>
</a-row> </a-row>
<a-row :gutter="16"> <a-row :gutter="16">
<a-col :span="12"> <a-col :span="12">
@ -136,7 +145,8 @@ export default {
rangeId: 0, rangeId: 0,
rangeName: '', rangeName: '',
isTop: 0, isTop: 0,
isCalculate: 0, isCalculate: 1,
classHour: 0,
isNowPublish: false, isNowPublish: false,
publishTime: '', publishTime: '',
type: 1, type: 1,
@ -144,11 +154,13 @@ export default {
}, },
fileList: [], fileList: [],
timeShow: true, timeShow: true,
classHourShow: true,
rules: { rules: {
title: [{ required: true, message: '请输入公告标题', trigger: 'blur' }], title: [{ required: true, message: '请输入公告标题', trigger: 'blur' }],
rangeName: [{ required: true, message: '请选择发布范围', trigger: 'blur' }], rangeName: [{ required: true, message: '请选择发布范围', trigger: 'blur' }],
isTop: [{ required: true, message: '请选择是否置顶', trigger: 'change' }], isTop: [{ required: true, message: '请选择是否置顶', trigger: 'change' }],
isCalculate: [{ required: true, message: '请选择是否计算学时', trigger: 'change' }], isCalculate: [{ required: true, message: '请选择是否计算学时', trigger: 'change' }],
classHour: [{ required: true, message: '请填写学时', trigger: 'change' }],
isNowPublish: [{ required: true, message: '请选择即时发布', trigger: 'change' }], isNowPublish: [{ required: true, message: '请选择即时发布', trigger: 'change' }],
publishTime: [{ required: true, message: '请选择发布时间', trigger: 'change' }], publishTime: [{ required: true, message: '请选择发布时间', trigger: 'change' }],
type: [{ required: true, message: '请选择发布类型', trigger: 'change' }], type: [{ required: true, message: '请选择发布类型', trigger: 'change' }],
@ -209,6 +221,9 @@ export default {
}, },
onChangeNow(checked) { onChangeNow(checked) {
this.timeShow = !checked this.timeShow = !checked
},
isCalculateFunc(type) {
this.classHourShow = type === 1
} }
} }
} }

View File

@ -177,6 +177,20 @@
</a-form> </a-form>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="24">
<a-col :md="12" :sm="24">
<a-form :form="form">
<a-form-item
label="年度计划学时"
:labelCol="labelCol"
:wrapperCol="wrapperCol"
has-feedback
>
<a-input placeholder="请输入年度计划学时" v-decorator="['planClassHour']" />
</a-form-item>
</a-form>
</a-col>
</a-row>
<a-divider orientation="left">上传身份证</a-divider> <a-divider orientation="left">上传身份证</a-divider>
<a-row :gutter="24"> <a-row :gutter="24">
@ -330,7 +344,8 @@
workType: data.workType ? parseInt(data.workType) : undefined, workType: data.workType ? parseInt(data.workType) : undefined,
degreeId: data.degreeId, degreeId: data.degreeId,
orgId: data.orgId, orgId: data.orgId,
orgName: data.orgName orgName: data.orgName,
planClassHour: data.planClassHour
} }
) )
// //

View File

@ -27,7 +27,7 @@
<a-button type="primary" icon="search" @click="$refs.table.refresh(true)">查询</a-button> <a-button type="primary" icon="search" @click="$refs.table.refresh(true)">查询</a-button>
<a-button icon="redo" @click="() => (queryParam = {})">重置</a-button> <a-button icon="redo" @click="() => (queryParam = {})">重置</a-button>
</a-space> </a-space>
<br/>
<a-space class="table-operator" direction="horizontal"> <a-space class="table-operator" direction="horizontal">
<a-button v-if="hasPerm(power.add)" type="primary" icon="plus" @click="handledCreate">新增项目</a-button> <a-button v-if="hasPerm(power.add)" type="primary" icon="plus" @click="handledCreate">新增项目</a-button>
</a-space> </a-space>