Merge branch 'develop' of https://gitee.com/siwa-team/dawa-vue into develop
This commit is contained in:
commit
ccf71f158c
|
@ -1,24 +1,27 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
const questionApi = {
|
||||
// add: 'sys/menu/add',
|
||||
add: 'courseManagement/question/addOrUpdate',
|
||||
get: '/courseManagement/question/details',
|
||||
// update: 'sys/menu/update',
|
||||
// del: 'courseManagement/course/delete',
|
||||
del: 'courseManagement/question/delete',
|
||||
// updateStatus: 'sys/menu/updateStatus',
|
||||
// list: '/courseManagement/course/listPage',
|
||||
// coursewareList:'/courseManagement/course/courseware/details',
|
||||
// questionList:'/courseManagement/course/questionList'
|
||||
// questionList:'/courseManagement/course/questionList',
|
||||
importTemplate: "courseManagement/question/importTemplate"
|
||||
|
||||
}
|
||||
|
||||
// export function menuAdd (params) {
|
||||
// return request({
|
||||
// url: menuApi.add,
|
||||
// method: 'post',
|
||||
// data: params
|
||||
// })
|
||||
// }
|
||||
|
||||
// 题目新增
|
||||
export function questionAdd (params) {
|
||||
return request({
|
||||
url: questionApi.add,
|
||||
method: 'post',
|
||||
data: params
|
||||
})
|
||||
}
|
||||
// export function menuGet (params) {
|
||||
// return request({
|
||||
// url: menuApi.get,
|
||||
|
@ -35,6 +38,14 @@ const questionApi = {
|
|||
// }
|
||||
|
||||
|
||||
export function deleteQuestion (params) {
|
||||
return request({
|
||||
url: questionApi.del,
|
||||
method: 'delete',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
// 查看课程详情
|
||||
export function getQuestionDeatil (params) {
|
||||
return request({
|
||||
|
@ -44,5 +55,13 @@ export function getQuestionDeatil (params) {
|
|||
})
|
||||
}
|
||||
|
||||
// 题目批量导入
|
||||
export function importTemplate (params) {
|
||||
return request({
|
||||
url: questionApi.importTemplate,
|
||||
method: 'post',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
const personRegisterApi = {
|
||||
page: 'person/register/pageList'
|
||||
}
|
||||
|
||||
export function personRegisterPage (params) {
|
||||
return request({
|
||||
url: personRegisterApi.page,
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
const terminalTrainSignApi = {
|
||||
list: 'project/terminalTrain/list',
|
||||
|
||||
}
|
||||
|
||||
export function terminalTrainSignList(params) {
|
||||
console.log("terminalTrainList------------{}", params)
|
||||
return request({
|
||||
url: terminalTrainSignApi.list,
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
|
@ -14,7 +14,7 @@ const userApi = {
|
|||
|
||||
const userPasswordApi = {
|
||||
update: '/sys/user/passwordUpdate',
|
||||
reset: '/sys/user/passwordReset'
|
||||
reset: '/sys/user/resetPwd'
|
||||
}
|
||||
|
||||
export function userLogin (params) {
|
||||
|
@ -85,7 +85,7 @@ export function passwordUpdate (params) {
|
|||
export function passwordReset (params) {
|
||||
return request({
|
||||
url: userPasswordApi.reset,
|
||||
method: 'post',
|
||||
data: params
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
|
|
@ -4,7 +4,8 @@ const dictionaryItemApi = {
|
|||
add: 'sys/dictionary/item/add',
|
||||
update: 'sys/dictionary/item/edit',
|
||||
del: 'sys/dictionary/item/del',
|
||||
page: 'sys/dictionary/item/pageList'
|
||||
page: 'sys/dictionary/item/pageList',
|
||||
dropDown: 'sys/dictionary/item/dropDown'
|
||||
}
|
||||
|
||||
export function dictionaryItemAdd (params) {
|
||||
|
@ -35,3 +36,13 @@ export function dictionaryItemPage (params) {
|
|||
params: params
|
||||
})
|
||||
}
|
||||
/**
|
||||
* 获取字典类型下所有字典,举例,返回格式为:[{value:"M",name:"男"},{code:"F",name:"女"}]
|
||||
*/
|
||||
export function dictionaryDropDown (params) {
|
||||
return request({
|
||||
url: dictionaryItemApi.dropDown,
|
||||
method: 'get',
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
const ossApi = {
|
||||
list: '/sys/oss/list'
|
||||
list: '/sys/oss/list',
|
||||
upload: '/sys/oss/upload'
|
||||
}
|
||||
|
||||
export function ossList (params) {
|
||||
|
@ -11,3 +12,7 @@ export function ossList (params) {
|
|||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
export function ossUpload () {
|
||||
return process.env.VUE_APP_API_BASE_URL + ossApi.upload;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
<template>
|
||||
<a-card :bordered="false" title="系統新增">
|
||||
<a-form-model :model="form">
|
||||
<div style="width: 100%; height: 40px; margin-bottom: 8px; margin-left: 80%">
|
||||
<a-button type="primary" @click="goback">返回</a-button>
|
||||
</div>
|
||||
<a-row>
|
||||
<!-- 课程名称 -->
|
||||
<a-col :span="18" :offset="3">
|
||||
|
@ -19,7 +22,7 @@
|
|||
</a-form-model-item>
|
||||
</a-col>
|
||||
|
||||
<!-- 课时 -->
|
||||
<!-- 课件大小 -->
|
||||
<a-col :span="9">
|
||||
<a-form-item label="课时" :label-col="{ span: 4 }" :wrapper-col="{ span: 10 }">
|
||||
<a-input-number id="hour" v-model="dataValue" :min="1" :max="1000" @change="onChange" :style="{ display: 'ln', width: '100%' }" />
|
||||
|
@ -93,9 +96,9 @@
|
|||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :span="18" :offset="3">
|
||||
<a-button @click="save">保存</a-button>
|
||||
</a-row>
|
||||
<div style="width: 100%; height: 40px; margin-bottom: 8px; margin-left: 50%">
|
||||
<a-button type="primary" @click="save">保存</a-button>
|
||||
</div>
|
||||
</a-form-model>
|
||||
</a-card>
|
||||
</template>
|
||||
|
@ -120,8 +123,10 @@ export default {
|
|||
],
|
||||
|
||||
previewVisible: false,
|
||||
fileList: []
|
||||
fileList: [],
|
||||
previewImage :[
|
||||
|
||||
]
|
||||
|
||||
}
|
||||
},
|
||||
|
@ -164,6 +169,11 @@ export default {
|
|||
})
|
||||
},
|
||||
|
||||
//返回
|
||||
goback(){
|
||||
this.$router.push({path:"/course/CourseList",query:{} })
|
||||
},
|
||||
|
||||
getToken() {
|
||||
let hreader = {};
|
||||
hreader[ACCESS_TOKEN] = storage.get(ACCESS_TOKEN);
|
||||
|
@ -188,5 +198,18 @@ export default {
|
|||
},
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
// 图片预览Base64
|
||||
function getBase64(file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = () => resolve(reader.result);
|
||||
reader.onerror = error => reject(error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<template>
|
||||
<page-header-wrapper :title="false">
|
||||
<a-card :bordered="false" title="课程列表">
|
||||
<div class="table-page-search-wrapper">
|
||||
<SearchCom :form="queryParam" :list="queryOptions" @search="handleRefresh" @reset="() => {queryParam = {}, handleRefresh()}" ></SearchCom>
|
||||
|
@ -23,7 +22,6 @@
|
|||
</template>
|
||||
</s-table>
|
||||
</a-card>
|
||||
</page-header-wrapper>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
|
@ -0,0 +1,154 @@
|
|||
<template>
|
||||
<a-card :bordered="false" title="添加课件">
|
||||
<a-form-model :model="form">
|
||||
<div style="width: 100%; height: 40px; margin-bottom: 8px; margin-left: 80%">
|
||||
<a-button type="primary" @click="goback">返回</a-button>
|
||||
</div>
|
||||
<a-row>
|
||||
<!-- 课程名称 -->
|
||||
<a-col :span="18" :offset="3">
|
||||
<a-form-model-item label="课件名称" :label-col="{ span: 4 }" :wrapper-col="{ span: 15 }">
|
||||
<a-input v-model="form.courseName" v-decorator="['courseName', { rules: [{ required: true, message: '请填写课程名称' }] }]" />
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
|
||||
<!-- 课件分类 -->
|
||||
<a-col :span="9" :offset="3">
|
||||
<a-form-model-item label="课件分类" :label-col="{ span: 8 }" :wrapper-col="{ span: 12 }">
|
||||
<a-button type="primary" @click="classify">添加分类</a-button>
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
|
||||
<!-- 课件大小 -->
|
||||
<a-col :span="9">
|
||||
<a-form-item label="课件大小" :label-col="{ span: 9 }" :wrapper-col="{ span: 14 }">
|
||||
<div>
|
||||
<a-input-number :disabled="false"/>
|
||||
<div style="marginTop:15px">
|
||||
<a-button type="primary" @click="toggle">
|
||||
Toggle disabled
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
<!-- 上传课件 -->
|
||||
<a-col :span="18" :offset="3">
|
||||
<a-form-model-item label="上传课件" :label-col="{ span: 4 }" :wrapper-col="{ span: 15 }">
|
||||
<a-upload action="/dawa/sys/oss/upload?sourceId=course" list-type="picture-card" :file-list="fileList" :headers="getToken()" @change="handleChange" @preview="handlePreview">
|
||||
<div v-if="fileList.length < 1">
|
||||
<a-icon type="plus" />
|
||||
<div class="ant-upload-text">上传</div>
|
||||
</div>
|
||||
</a-upload>
|
||||
<a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">
|
||||
<img alt="example" style="width: 100%" :src="previewImage" />
|
||||
</a-modal>
|
||||
|
||||
<!-- <a-upload name="file" list-type="picture-card" class="avatar-uploader" :show-upload-list="false" action="" :headers="getToken()" :change="onSuccess">
|
||||
<img v-if="imageUrl" :src="imageUrl" alt="avatar" />
|
||||
<div v-else>
|
||||
<a-icon :type="loading ? 'loading' : 'plus'" />
|
||||
<div class="ant-upload-text">封面图片</div>
|
||||
</div>
|
||||
</a-upload> -->
|
||||
</a-form-model-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<div style="width: 100%; height: 40px; margin-bottom: 8px; margin-left: 50%">
|
||||
<a-button type="primary" @click="save">保存</a-button>
|
||||
</div>
|
||||
</a-form-model>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
import { courseAdd, getCourseDetails } from '@/api/course/course'
|
||||
import storage from 'store'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
|
||||
export default {
|
||||
name: 'step1',
|
||||
data() {
|
||||
return {
|
||||
dataValue: 1,
|
||||
form: {},
|
||||
personType: [
|
||||
{ id: '1', name: '人员类别1' },
|
||||
{ id: '2', name: '人员类别2' },
|
||||
{ id: '3', name: '人员类别3' },
|
||||
],
|
||||
|
||||
previewVisible: false,
|
||||
fileList: [],
|
||||
previewImage :[
|
||||
|
||||
]
|
||||
|
||||
}
|
||||
},
|
||||
components: {
|
||||
courseAdd,
|
||||
getCourseDetails
|
||||
},
|
||||
created() {
|
||||
if (this.$route.query.id) {
|
||||
getCourseDetails({ id: this.$route.query.id }).then(res => {
|
||||
this.form = res.data;
|
||||
|
||||
this.form.courseType = this.form.courseType + '';
|
||||
this.form.industryInvolved = this.form.industryInvolved + '';
|
||||
this.form.isRequired = this.form.isRequired + '';
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
||||
//返回
|
||||
goback(){
|
||||
this.$router.push({path:"/course/CourseList",query:{} })
|
||||
},
|
||||
|
||||
getToken() {
|
||||
let hreader = {};
|
||||
hreader[ACCESS_TOKEN] = storage.get(ACCESS_TOKEN);
|
||||
return hreader;
|
||||
},
|
||||
onSuccess(file) {
|
||||
console.log('1---', file);
|
||||
|
||||
},
|
||||
handleCancel() {
|
||||
this.previewVisible = false;
|
||||
},
|
||||
async handlePreview(file) {
|
||||
if (!file.url && !file.preview) {
|
||||
file.preview = await getBase64(file.originFileObj);
|
||||
}
|
||||
this.previewImage = file.url || file.preview;
|
||||
this.previewVisible = true;
|
||||
},
|
||||
handleChange({ fileList }) {
|
||||
this.fileList = fileList;
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
// 图片预览Base64
|
||||
function getBase64(file) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reader = new FileReader();
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = () => resolve(reader.result);
|
||||
reader.onerror = error => reject(error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
</script>
|
|
@ -1,9 +1,10 @@
|
|||
<template>
|
||||
<page-header-wrapper :title="false">
|
||||
<a-card :bordered="false">
|
||||
<span style="font-size : 20px; margin-left :15px">课件信息</span>
|
||||
<div class="button" style="width: 100%; height: 32px; margin-bottom: 8px; margin-left: 85%;">
|
||||
<a-button type="primary" @click="goback">返回</a-button>
|
||||
<a-card :bordered="false" title="项目档案">
|
||||
<template slot="extra">
|
||||
<a-button size="small" @click="goback">返回</a-button>
|
||||
</template>
|
||||
<div class="button" style="width: 100%; height: 32px; margin-bottom: 8px; margin-right: 10%;">
|
||||
<!-- <a-button type="primary" @click="goback">返回</a-button> -->
|
||||
<a-button type="primary" @click="coursewareAdd">上传课件</a-button>
|
||||
</div>
|
||||
<s-table ref="table" size="default" rowKey="id" :columns="columns" :data="loadData">
|
||||
|
@ -20,13 +21,11 @@
|
|||
</template>
|
||||
</s-table>
|
||||
</a-card>
|
||||
</page-header-wrapper>
|
||||
</template>
|
||||
<script>
|
||||
import { STable, SearchCom } from '@/components'
|
||||
import { getCoursewareListByCourseId } from '@/api/course/course'
|
||||
import { deleteCourseware } from '@/api/course/courseware'
|
||||
import { coursewareAdd } from '@/api/course/courseware'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
@ -54,7 +53,7 @@ export default {
|
|||
methods: {
|
||||
//新增课件
|
||||
coursewareAdd(){
|
||||
this.$router.push({path:"/course/courseware/coursewareAdd",query:{}})
|
||||
this.$router.push({path:"/course/CoursewareAddOrUpdate",query:{}})
|
||||
},
|
||||
|
||||
//返回
|
||||
|
|
|
@ -0,0 +1,398 @@
|
|||
<template>
|
||||
<a-card :bordered="false" title="新增习题">
|
||||
<template slot="extra">
|
||||
<a-button size="small" @click="close">返回</a-button>
|
||||
<a-button size="small" type="primary" @click="queding">确定</a-button>
|
||||
</template>
|
||||
<a-tabs :animated="false" :default-active-key="tabKey" @change="callback" :headStyle="{ paddingTop: '0px' }">
|
||||
<!-- 单选题 -->
|
||||
<a-tab-pane key="1" tab="单选" :disabled="radio.disabled">
|
||||
<a-radio-group v-model="radio.rightAnswers" style="width: 100%">
|
||||
<a-card title="题目(题干内容)" :bordered="false">
|
||||
<a-textarea placeholder="" :rows="6" v-model="radio.questionName" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card :bordered="false">
|
||||
<template slot="title">
|
||||
选项(从选项中选择一个作为答案)<br />A
|
||||
<a-radio value="A">答案</a-radio>
|
||||
</template>
|
||||
<a-textarea placeholder="" :rows="6" v-model="radio.answerA" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card :bordered="false">
|
||||
<template slot="title">
|
||||
B
|
||||
<a-radio value="B">答案</a-radio>
|
||||
</template>
|
||||
<a-textarea placeholder="" :rows="6" v-model="radio.answerB" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card :bordered="false">
|
||||
<template slot="title">
|
||||
C
|
||||
<a-radio value="C">答案</a-radio>
|
||||
</template>
|
||||
<a-textarea placeholder="" :rows="6" v-model="radio.answerC" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card :bordered="false">
|
||||
<template slot="title">
|
||||
D
|
||||
<a-radio value="D">答案</a-radio>
|
||||
</template>
|
||||
<a-textarea placeholder="" :rows="6" v-model="radio.answerD" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card title="答案解析" :bordered="false">
|
||||
<a-textarea placeholder="" :rows="6" v-model="radio.asnwerParse" style="width: 100%" />
|
||||
</a-card>
|
||||
</a-radio-group>
|
||||
</a-tab-pane>
|
||||
|
||||
<!-- 多选题 -->
|
||||
<a-tab-pane key="2" tab="多选" :disabled="multiselect.disabled">
|
||||
<a-card title="题目(题干内容)" :bordered="false">
|
||||
<a-textarea placeholder="" :rows="6" v-model="multiselect.questionName" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card :bordered="false">
|
||||
<template slot="title">
|
||||
选项(从选项中选择一个作为答案)<br />A
|
||||
<a-checkbox v-model="multiselect.a" value="A">答案</a-checkbox>
|
||||
</template>
|
||||
<a-textarea placeholder="" :rows="6" v-model="multiselect.answerA" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card :bordered="false">
|
||||
<template slot="title">
|
||||
B
|
||||
<a-checkbox v-model="multiselect.b" value="B">答案</a-checkbox>
|
||||
</template>
|
||||
<a-textarea placeholder="" :rows="6" v-model="multiselect.answerB" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card :bordered="false">
|
||||
<template slot="title">
|
||||
C
|
||||
<a-checkbox v-model="multiselect.c" value="C">答案</a-checkbox>
|
||||
</template>
|
||||
<a-textarea placeholder="" :rows="6" v-model="multiselect.answerC" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card :bordered="false">
|
||||
<template slot="title">
|
||||
D
|
||||
<a-checkbox v-model="multiselect.d" value="D">答案</a-checkbox>
|
||||
</template>
|
||||
<a-textarea placeholder="" :rows="6" v-model="multiselect.answerD" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card title="答案解析" :bordered="false">
|
||||
<a-textarea placeholder="" :rows="6" v-model="multiselect.asnwerParse" style="width: 100%" />
|
||||
</a-card>
|
||||
</a-tab-pane>
|
||||
|
||||
<!-- 判断题 -->
|
||||
<a-tab-pane key="3" tab="判断" :disabled="estimate.disabled">
|
||||
<a-radio-group v-model="estimate.rightAnswers" style="width: 100%">
|
||||
<a-card title="题目(题干内容)" :bordered="false">
|
||||
<a-textarea placeholder="" :rows="6" v-model="estimate.questionName" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card :bordered="false">
|
||||
<template slot="title">
|
||||
选项(从选项中选择一个作为答案)<br />
|
||||
<a-radio :value="1"> 正确 </a-radio>
|
||||
<a-radio :value="2"> 错误 </a-radio>
|
||||
</template>
|
||||
</a-card>
|
||||
<a-card title="答案解析" :bordered="false">
|
||||
<a-textarea placeholder="" :rows="6" v-model="estimate.asnwerParse" style="width: 100%" />
|
||||
</a-card>
|
||||
</a-radio-group>
|
||||
</a-tab-pane>
|
||||
|
||||
<!-- 简答题 -->
|
||||
<a-tab-pane key="4" tab="简答" :disabled="shortAnswer.disabled">
|
||||
<a-card title="题目(题干内容)" :bordered="false">
|
||||
<a-textarea placeholder="" :rows="6" v-model="shortAnswer.questionName" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card :bordered="false">
|
||||
<template slot="title"> 答案 </template>
|
||||
<a-textarea placeholder="" :rows="6" v-model="shortAnswer.rightAnswers" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card title="答案解析" :bordered="false">
|
||||
<a-textarea placeholder="" :rows="6" v-model="shortAnswer.asnwerParse" style="width: 100%" />
|
||||
</a-card>
|
||||
</a-tab-pane>
|
||||
|
||||
<!-- 填空题 -->
|
||||
<a-tab-pane key="5" tab="填空" :disabled="Completion.disabled">
|
||||
<a-card title="题目(题干内容)" :bordered="false">
|
||||
<a-textarea placeholder="" :rows="6" v-model="Completion.questionName" style="width: 100%" />
|
||||
</a-card>
|
||||
<a-card title="答案" :bordered="false">
|
||||
<div style="text-align: center; margin-bottom: 10px">
|
||||
<a-button type="primary" style="width: 40%" @click="addAnswerSize">添加一个新填空</a-button>
|
||||
<a-button style="width: 40%" @click="delAnswerSize">刪除一个新填空</a-button>
|
||||
</div>
|
||||
<div v-for="(answer, index) in Completion.answerList" :key="index" style="margin-bottom: 10px">
|
||||
<a-input v-model="Completion.answerList[index]">
|
||||
<template slot="addonBefore">
|
||||
<b>填空{{ index+1 }}:</b>
|
||||
</template>
|
||||
</a-input>
|
||||
</div>
|
||||
</a-card>
|
||||
<a-card title="答案解析" :bordered="false">
|
||||
<a-textarea placeholder="" :rows="6" v-model="Completion.asnwerParse" style="width: 100%" />
|
||||
</a-card>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
import { questionAdd, getQuestionDeatil } from '@/api/course/question/question'
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
radio: {},
|
||||
multiselect: {},
|
||||
estimate: {},
|
||||
shortAnswer: {},
|
||||
Completion: { answerList: [''] },
|
||||
tabKey: this.$route.query.questionType ? this.$route.query.questionType : '1'
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
if (this.$route.query.id && !this.$route.query.opt) {
|
||||
|
||||
this.radio.disabled = true;
|
||||
this.multiselect.disabled = true;
|
||||
this.estimate.disabled = true;
|
||||
this.shortAnswer.disabled = true;
|
||||
this.Completion.disabled = true;
|
||||
|
||||
getQuestionDeatil({ id: this.$route.query.id }).then((res) => {
|
||||
if (this.tabKey == '1') {
|
||||
this.radio = res.data;
|
||||
this.radio.disabled = false;
|
||||
} else if (this.tabKey == '2') {
|
||||
this.multiselect = res.data;
|
||||
this.multiselect.disabled = false;
|
||||
this.getRightAnswer();
|
||||
} else if(this.tabKey == '3') {
|
||||
this.estimate = res.data;
|
||||
this.estimate.disabled = false;
|
||||
} else if (this.tabKey == '4') {
|
||||
this.shortAnswer = res.data;
|
||||
this.shortAnswer.disabled = false;
|
||||
} else if (this.tabKey == '5') {
|
||||
this.Completion = res.data;
|
||||
this.Completion.disabled = false;
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
close() {
|
||||
this.$router.push({
|
||||
path: '/course/question/QuestionList',
|
||||
query: {
|
||||
id: this.$route.query.courseId,
|
||||
questionId: this.$route.query.id,
|
||||
isactive: this.$route.query.isactive,
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
callback(key) {
|
||||
this.radio = {}
|
||||
this.multiselect = {}
|
||||
this.estimate = {}
|
||||
this.shortAnswer = {}
|
||||
this.Completion = { answerList: [''] }
|
||||
this.tabKey = key
|
||||
},
|
||||
|
||||
// 添加填空
|
||||
addAnswerSize() {
|
||||
if (this.Completion.answerList.length == 10) {
|
||||
this.$message.error('填空数量最多不能超过10个')
|
||||
return
|
||||
}
|
||||
this.Completion.answerList.push('')
|
||||
},
|
||||
// 刪除填空
|
||||
delAnswerSize() {
|
||||
if (this.Completion.answerList.length == 1) {
|
||||
this.$message.error('填空数量最少不能少于1个')
|
||||
return
|
||||
}
|
||||
this.Completion.answerList.splice(this.Completion.answerList.length-1, 1);
|
||||
},
|
||||
|
||||
// 确定
|
||||
queding() {
|
||||
let from
|
||||
if (this.tabKey === '1') {
|
||||
from = this.radioV()
|
||||
if (typeof from == 'boolean' && !from) return
|
||||
} else if (this.tabKey === '2') {
|
||||
from = this.multiselectV()
|
||||
if (typeof from == 'boolean' && !from) return
|
||||
} else if (this.tabKey === '3') {
|
||||
from = this.estimateV()
|
||||
if (typeof from == 'boolean' && !from) return
|
||||
} else if (this.tabKey === '4') {
|
||||
from = this.shortAnswerV()
|
||||
if (typeof from == 'boolean' && !from) return
|
||||
} else if (this.tabKey === '5') {
|
||||
from = this.CompletionV()
|
||||
if (typeof from == 'boolean' && !from) return
|
||||
console.log('5---', this.Completion)
|
||||
}
|
||||
|
||||
console.log('a--')
|
||||
from.courseId = this.$route.query.courseId
|
||||
|
||||
questionAdd(from).then((res) => {
|
||||
this.$message.success('新增题目成功!')
|
||||
this.close()
|
||||
})
|
||||
},
|
||||
|
||||
//验证是否为空单选题
|
||||
radioV() {
|
||||
//验证题目是否为空
|
||||
if (!this.radio.questionName || this.radio.questionName === '') {
|
||||
this.$message.error('题目(题干内容)不能为空!')
|
||||
return false
|
||||
}
|
||||
|
||||
// 验证答案是否为空
|
||||
if (!this.radio.answerA || this.radio.answerA === '') {
|
||||
this.$message.error('答案A不能为空!')
|
||||
return false
|
||||
} else if (!this.radio.answerB || this.radio.answerB === '') {
|
||||
this.$message.error('答案B不能为空!')
|
||||
return false
|
||||
} else if (!this.radio.answerC || this.radio.answerC === '') {
|
||||
this.$message.error('答案C不能为空!')
|
||||
return false
|
||||
} else if (!this.radio.answerD || this.radio.answerD === '') {
|
||||
this.$message.error('答案D不能为空!')
|
||||
return false
|
||||
}
|
||||
|
||||
// 验证是否勾选正确答案
|
||||
if (!this.radio.rightAnswers || this.radio.rightAnswers === '') {
|
||||
this.$message.error('请选择正确答案!')
|
||||
return false
|
||||
}
|
||||
|
||||
let from = {}
|
||||
from = this.radio
|
||||
from.questionType = 1
|
||||
|
||||
return from
|
||||
},
|
||||
|
||||
// 验证多选题
|
||||
multiselectV() {
|
||||
// 题目名称是否为空
|
||||
if (!this.multiselect.questionName || this.multiselect.questionName === '') {
|
||||
this.$message.error('题目(题干内容)不能为空!')
|
||||
return false
|
||||
}
|
||||
|
||||
// 题目答案是否为空!
|
||||
if (!this.multiselect.answerA || this.multiselect.answerA === '') {
|
||||
this.$message.error('答案A不能为空!')
|
||||
return false
|
||||
} else if (!this.multiselect.answerB || this.multiselect.answerB === '') {
|
||||
this.$message.error('答案B不能为空!')
|
||||
return false
|
||||
} else if (!this.multiselect.answerC || this.multiselect.answerC === '') {
|
||||
this.$message.error('答案C不能为空!')
|
||||
return false
|
||||
} else if (!this.multiselect.answerD || this.multiselect.answerD === '') {
|
||||
this.$$message.error('答案D不能为空!')
|
||||
return false
|
||||
}
|
||||
|
||||
let from = {}
|
||||
from = this.multiselect
|
||||
from.questionType = 2
|
||||
from.rightAnswers = ''
|
||||
// 验证是否勾选正确答案,并且正确答案不能少于一个
|
||||
if (this.multiselect.a && this.multiselect.a == true) from.rightAnswers += 'A'
|
||||
if (this.multiselect.b && this.multiselect.b == true) from.rightAnswers += 'B'
|
||||
if (this.multiselect.c && this.multiselect.c == true) from.rightAnswers += 'C'
|
||||
if (this.multiselect.d && this.multiselect.d == true) from.rightAnswers += 'D'
|
||||
|
||||
if (from.rightAnswers.length < 1 || from.rightAnswers == '') {
|
||||
this.$message.error('请选择正确答案!')
|
||||
return false
|
||||
}
|
||||
return from
|
||||
},
|
||||
|
||||
// 验证判断题
|
||||
estimateV() {
|
||||
console.log('rightAnswers', this.estimate.rightAnswers)
|
||||
// 判断题目名称是否为空
|
||||
if (!this.estimate.questionName || this.estimate.questionName === '') {
|
||||
this.$message.error('题干不能为空!')
|
||||
return
|
||||
}
|
||||
|
||||
// 验证正确答案
|
||||
if (!this.estimate.rightAnswers || this.estimate === '') {
|
||||
this.$message.error('请选择题目的正确答案!')
|
||||
return
|
||||
}
|
||||
|
||||
let from = this.estimate
|
||||
from.questionType = 3
|
||||
return from
|
||||
},
|
||||
|
||||
// 简答题验证
|
||||
shortAnswerV() {
|
||||
// 题干是否为空
|
||||
if (!this.shortAnswer.questionName || this.shortAnswer.questionName === '') {
|
||||
this.$message.error('题干不能为空!')
|
||||
return false
|
||||
}
|
||||
|
||||
if (!this.shortAnswer.rightAnswers || this.shortAnswer.rightAnswers === '') {
|
||||
this.$message.error('正确答案不能为空!')
|
||||
return false
|
||||
}
|
||||
|
||||
let from = this.shortAnswer
|
||||
from.questionType = 4
|
||||
return from
|
||||
},
|
||||
|
||||
// 填空题
|
||||
CompletionV() {
|
||||
if (!this.Completion.questionName || this.Completion.questionName === '') {
|
||||
this.$message.error('题干不能为空!')
|
||||
return false
|
||||
}
|
||||
let from = this.Completion
|
||||
from.questionType = 5
|
||||
return from
|
||||
},
|
||||
|
||||
// 获取多选题的正确答案
|
||||
getRightAnswer(){
|
||||
if(this.multiselect.rightAnswers.indexOf('A') > -1) this.multiselect.a = true;
|
||||
if(this.multiselect.rightAnswers.indexOf('B') > -1) this.multiselect.b = true;
|
||||
if(this.multiselect.rightAnswers.indexOf('C') > -1) this.multiselect.c = true;
|
||||
if(this.multiselect.rightAnswers.indexOf('D') > -1) this.multiselect.d = true;
|
||||
console.log('1---', this.multiselect)
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
|
@ -1,29 +1,77 @@
|
|||
<template>
|
||||
<page-header-wrapper>
|
||||
<a-card :bordered="false">
|
||||
<!-- <page-header-wrapper> -->
|
||||
<a-card :bordered="false" title="题库管理">
|
||||
<template slot="extra">
|
||||
<a-button size="small" @click="questionColse">返回</a-button>
|
||||
</template>
|
||||
<div class="questionLeft">
|
||||
<div class="div-button">
|
||||
<a-button type="primary" class="close-button" style="font-size: 15px" @click="questionColse"> 关闭 </a-button>
|
||||
<a-button type="primary" class="create-button" style="font-size: 15px" @click="questionSave"> 新增 </a-button>
|
||||
</div>
|
||||
<h1 class="questionNumber">题序</h1>
|
||||
<!-- 题目序号 -->
|
||||
<div v-for="(item, index) in quesitonList" :key="item" class="questionLeftItem" @click="quesionId(item)">{{ index+1 }}</div>
|
||||
<div
|
||||
v-for="(item, index) in quesitonList"
|
||||
:key="item"
|
||||
class="questionLeftItem"
|
||||
@click="quesionId(item, index)"
|
||||
:class="{ active_color: index == isactive }"
|
||||
>
|
||||
{{ index + 1 }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="questionDetail">
|
||||
<br />
|
||||
<a-button
|
||||
type="primary"
|
||||
class="create-button"
|
||||
style="font-size: 15px; margin: 0px 10px 10px 0px"
|
||||
@click="questionSave"
|
||||
>新增题目</a-button
|
||||
>
|
||||
<a-button
|
||||
type="primary"
|
||||
class="create-button"
|
||||
style="font-size: 15px; margin: 0px 10px 10px 0px"
|
||||
@click="questionBatch"
|
||||
>
|
||||
批量导入
|
||||
</a-button>
|
||||
<a-button
|
||||
type="primary"
|
||||
class="create-button"
|
||||
style="font-size: 15px; margin: 0px 10px 10px 0px"
|
||||
@click="questionBatchDownload"
|
||||
>
|
||||
模板下载
|
||||
</a-button>
|
||||
<b><h1 class="questionContent">课程题目库预览</h1></b>
|
||||
<a-divider :style="{ backgroundColor: '#000' }" />
|
||||
<div class="question">
|
||||
<h1 class="questionName">
|
||||
({{ questionDetail.questionType }}){{questionDetail.questionName}}
|
||||
<span class="edit" @click="edit(i)">编辑</span>
|
||||
({{ questionDetail.questionTypeName }}){{ questionDetail.questionName }}
|
||||
<span class="edit" @click="edit(questionDetail.id)">编辑</span>
|
||||
<a-popconfirm title="确定要删除此题?" ok-text="确定" cancel-text="取消" @confirm="del(questionDetail.id)">
|
||||
<span class="edit">删除</span>
|
||||
</a-popconfirm>
|
||||
</h1>
|
||||
|
||||
<!-- 显示单选题和多选题 -->
|
||||
<div v-if="questionDetail.questionType == 1 || questionDetail.questionType == 2">
|
||||
<div class="answer">A. {{ questionDetail.answerA }}</div>
|
||||
<div class="answer">B. {{ questionDetail.answerB }}</div>
|
||||
<div class="answer">C. {{ questionDetail.answerC }}</div>
|
||||
<div class="answer">D. {{ questionDetail.answerD }}</div>
|
||||
</div>
|
||||
|
||||
<!-- 显示简答题 -->
|
||||
<div v-if="questionDetail.questionType == 4">
|
||||
<div class="answer">正确答案: {{ questionDetail.rightAnswers }}</div>
|
||||
</div>
|
||||
|
||||
<!-- 显示填空题 -->
|
||||
<div v-if="questionDetail.questionType == 5">
|
||||
<div class="answer" v-for="(item,ind) in questionDetail.answerList" :key="ind">正确答案{{ ind+1 }}: {{ item }}</div>
|
||||
</div>
|
||||
|
||||
<div class="info_parent">
|
||||
<div class="info">解析</div>
|
||||
<div class="info_main">
|
||||
|
@ -33,40 +81,58 @@
|
|||
<a-divider :style="{ backgroundColor: '#000' }" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input ref="inputFile" type="file" style="display: none;" @change="questionBatchImport">
|
||||
</a-card>
|
||||
</page-header-wrapper>
|
||||
<!-- </page-header-wrapper> -->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getQuestionListByCourseId } from '@/api/course/course'
|
||||
import { getQuestionDeatil } from '@/api/course/question/question'
|
||||
import { getQuestionDeatil, deleteQuestion, importTemplate } from '@/api/course/question/question'
|
||||
import { ossUpload } from '@/api/sys/oss'
|
||||
|
||||
import axios from 'axios'
|
||||
import storage from 'store'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
queryParam: { id: this.$route.query.id },
|
||||
quesitonList: [],
|
||||
questionDetail: {},
|
||||
isactive: 1,
|
||||
}
|
||||
},
|
||||
|
||||
created: function () {
|
||||
let parameter = {}
|
||||
this.getQuestion()
|
||||
},
|
||||
methods: {
|
||||
getQuestion() {
|
||||
// 查询所有题目id列表
|
||||
getQuestionListByCourseId(Object.assign(parameter, this.queryParam)).then((res) => {
|
||||
getQuestionListByCourseId({ id: this.$route.query.id }).then((res) => {
|
||||
this.quesitonList = res.data
|
||||
|
||||
if (!res.data.length) return
|
||||
this.quesionId(this.quesitonList[0])
|
||||
if (!res.data) return
|
||||
// this.quesionId(this.quesitonList[0])
|
||||
this.quesionId(this.$route.query.questionId || this.quesitonList[0], this.$route.query.isactive || 0);
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
//题目ID
|
||||
quesionId: function (i) {
|
||||
//题目ID查看题目
|
||||
quesionId: function (i, index) {
|
||||
this.isactive = index;
|
||||
this.questionId = i;
|
||||
|
||||
getQuestionDeatil({ id: i }).then((res) => {
|
||||
this.questionDetail = res.data
|
||||
//获取题目的名称
|
||||
if (this.questionDetail.questionType == '1') this.questionDetail.questionTypeName = '单选题'
|
||||
if (this.questionDetail.questionType == '2') this.questionDetail.questionTypeName = '多选题'
|
||||
if (this.questionDetail.questionType == '3') this.questionDetail.questionTypeName = '判断题'
|
||||
if (this.questionDetail.questionType == '4') this.questionDetail.questionTypeName = '简答题'
|
||||
if (this.questionDetail.questionType == '5') this.questionDetail.questionTypeName = '填空题'
|
||||
})
|
||||
},
|
||||
|
||||
|
@ -74,18 +140,77 @@ export default {
|
|||
questionColse() {
|
||||
this.$router.push({
|
||||
path: '/course/CourseList',
|
||||
query: {
|
||||
// courseName: this.$$router.query.courseName,
|
||||
// PageNum: this.$$router.query.PageNum,
|
||||
// courseUserOrgId : this.$$router.query.courseUserOrgId,
|
||||
},
|
||||
query: {},
|
||||
})
|
||||
},
|
||||
questionSave() {
|
||||
alert('還在對接中~~~')
|
||||
this.$router.push({
|
||||
path: '/course/question/QuestionAdd',
|
||||
query: {
|
||||
courseId: this.$route.query.id,
|
||||
isactive: this.isactive,
|
||||
id: this.questionId,
|
||||
opt: 'add'
|
||||
},
|
||||
edit: function (i) {
|
||||
alert('题目ID:' + i)
|
||||
})
|
||||
},
|
||||
edit(record) {
|
||||
console.log(record)
|
||||
this.$router.push({
|
||||
path: '/course/question/QuestionAdd',
|
||||
query: {
|
||||
id: record,
|
||||
isactive: this.isactive,
|
||||
questionType: this.questionDetail.questionType,
|
||||
courseId: this.$route.query.id
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
//删除
|
||||
del(id) {
|
||||
deleteQuestion({ id: id }).then((res) => {
|
||||
if (res.code == 200) this.getQuestion()
|
||||
})
|
||||
},
|
||||
|
||||
//批量导入
|
||||
questionBatch() {
|
||||
this.$refs.inputFile.click();
|
||||
},
|
||||
questionBatchImport(){
|
||||
if(!this.$refs.inputFile.value || this.$refs.inputFile.value === '') return;
|
||||
const data = new FormData();
|
||||
data.append('file', this.$refs.inputFile.files[0]);
|
||||
data.append('sourceId', 'questionImport');
|
||||
data.append('fileType', 'excel');
|
||||
|
||||
const header = {};
|
||||
header['Content-Type'] = 'multipart/form-data';
|
||||
header[ACCESS_TOKEN] = storage.get(ACCESS_TOKEN);
|
||||
|
||||
axios.post(ossUpload(), data, { headers: header }).then(res => {
|
||||
if(res.data.code === 200){
|
||||
let params = { fileUrl: res.data.url, courseId: this.$route.query.id }
|
||||
importTemplate(params).then(res1 => {
|
||||
this.$refs.inputFile.value = '';
|
||||
this.$message.success('题目导入成功!');
|
||||
this.getQuestion()
|
||||
});
|
||||
}else{
|
||||
this.$message.error(res.data.msg);
|
||||
this.$refs.inputFile.value = '';
|
||||
}
|
||||
}).catch(err => {
|
||||
this.$message.error(res);
|
||||
this.$refs.inputFile.value = '';
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
// 下载模板
|
||||
questionBatchDownload() {
|
||||
window.location.href = '/dawa/sys/oss/show/20211108/2420f1de94174bb8a0fb1a2f1e9e1742.xlsx'
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -107,8 +232,14 @@ export default {
|
|||
border: 1px solid #000;
|
||||
margin: 5px 5px;
|
||||
cursor: pointer;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
.active_color {
|
||||
background-color: wheat;
|
||||
}
|
||||
|
||||
/* wheat */
|
||||
.questionDetail {
|
||||
width: calc(100% - 300px - 20px);
|
||||
height: auto;
|
||||
|
@ -137,7 +268,7 @@ export default {
|
|||
font-size: 23px;
|
||||
font: bold;
|
||||
background-color: gainsboro;
|
||||
margin-top: 45px;
|
||||
/* margin-top: 45px; */
|
||||
}
|
||||
.questionContent {
|
||||
margin-left: 10px;
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
<h1>
|
||||
hello World
|
||||
</h1>
|
|
@ -26,7 +26,7 @@
|
|||
:wrapperCol="wrapperCol"
|
||||
has-feedback
|
||||
>
|
||||
<a-input placeholder="请输入用户名" v-decorator="['userName', {rules: [{required: true, min: 5, message: '请输入至少五个字符的账号!'}]}]" />
|
||||
<a-input placeholder="请输入用户名" :disabled="registerDisabled" v-decorator="['userName', {rules: [{required: true, min: 5, message: '请输入至少五个字符的账号!'}]}]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-col>
|
||||
|
@ -38,7 +38,7 @@
|
|||
:wrapperCol="wrapperCol"
|
||||
has-feedback
|
||||
>
|
||||
<a-input placeholder="请输入姓名" v-decorator="['name', {rules: [{required: true, message: '请输入姓名!'}]}]" />
|
||||
<a-input placeholder="请输入姓名" :disabled="registerDisabled" v-decorator="['name', {rules: [{required: true, message: '请输入姓名!'}]}]" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-col>
|
||||
|
@ -106,7 +106,9 @@
|
|||
:wrapperCol="{span: 20}"
|
||||
has-feedback
|
||||
>
|
||||
<a-input v-decorator="['jobs',{rules: [{ required: true, message: '请输入岗位!' }]}]" />
|
||||
<a-select style="width: 100%" placeholder="请选择岗位" v-decorator="['jobs',{rules: [{ required: true, message: '请选择岗位!' }]}]" >
|
||||
<a-select-option v-for="(item,index) in jobsData" :key="index" :value="item.value" >{{ item.name }}</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-col>
|
||||
|
@ -120,7 +122,9 @@
|
|||
:wrapperCol="wrapperCol"
|
||||
has-feedback
|
||||
>
|
||||
<a-input v-decorator="['workType',{rules: [{ required: true, message: '请输入工种!' }]}]" />
|
||||
<a-select style="width: 100%" placeholder="请选择工种" v-decorator="['workType',{rules: [{ required: true, message: '请选择工种!' }]}]" >
|
||||
<a-select-option v-for="(item,index) in workTypeData" :key="index" :value="item.value" >{{ item.name }}</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-col>
|
||||
|
@ -132,7 +136,9 @@
|
|||
:wrapperCol="wrapperCol"
|
||||
has-feedback
|
||||
>
|
||||
<a-input v-decorator="['degreeId',{rules: [{ required: true, message: '请输入工种!' }]}]" />
|
||||
<a-select style="width: 100%" placeholder="请选择学历" v-decorator="['degreeId',{rules: [{ required: true, message: '请选择学历!' }]}]" >
|
||||
<a-select-option v-for="(item,index) in degreeData" :key="index" :value="item.value" >{{ item.name }}</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-col>
|
||||
|
@ -146,20 +152,8 @@
|
|||
:wrapperCol="{span: 20}"
|
||||
>
|
||||
<a-checkbox-group v-decorator="['type',{rules: [{ required: true, message: '请选择人员类型!' }]}]">
|
||||
<a-checkbox value="1" name="type">
|
||||
单位主要负责人
|
||||
</a-checkbox>
|
||||
<a-checkbox value="2" name="type">
|
||||
安全管理员
|
||||
</a-checkbox>
|
||||
<a-checkbox value="3" name="type">
|
||||
班组长
|
||||
</a-checkbox>
|
||||
<a-checkbox value="4" name="type">
|
||||
特种作业人员
|
||||
</a-checkbox>
|
||||
<a-checkbox value="5" name="type">
|
||||
其他
|
||||
<a-checkbox name="type" v-for="(item,index) in typeData" :key="index" :value="item.value" >
|
||||
{{ item.name }}
|
||||
</a-checkbox>
|
||||
</a-checkbox-group>
|
||||
</a-form-item>
|
||||
|
@ -175,7 +169,7 @@
|
|||
:wrapperCol="wrapperCol"
|
||||
has-feedback
|
||||
>
|
||||
<a-input readOnly @click="openOrgTree" v-decorator="['orgName',{rules: [{ required: true, message: '请选择机构!' }]}]" />
|
||||
<a-input readOnly @click="openOrgTree" :disabled="registerDisabled" v-decorator="['orgName',{rules: [{ required: true, message: '请选择机构!' }]}]" />
|
||||
</a-form-item>
|
||||
<a-form-item style="display: none;">
|
||||
<a-input v-decorator="['orgId']" />
|
||||
|
@ -183,6 +177,9 @@
|
|||
</a-form>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
<a-divider orientation="left">上传身份证</a-divider>
|
||||
|
||||
</a-spin>
|
||||
|
||||
<org-tree @selectOrg="selectOrg($event)" ref="orgModal"/>
|
||||
|
@ -192,6 +189,7 @@
|
|||
|
||||
<script>
|
||||
import { personAddOrUpdate, personGet } from '@/api/person/person'
|
||||
import { dictionaryDropDown } from '@/api/sys/dictionaryItem'
|
||||
import OrgTree from '../org/OrgTree'
|
||||
export default {
|
||||
components: {
|
||||
|
@ -210,28 +208,61 @@
|
|||
modalTitle: '新增人员',
|
||||
visible: false,
|
||||
confirmLoading: false,
|
||||
form: this.$form.createForm(this)
|
||||
registerDisabled: false,
|
||||
form: this.$form.createForm(this),
|
||||
jobsData: [],
|
||||
workTypeData: [],
|
||||
degreeData: [],
|
||||
typeData: []
|
||||
}
|
||||
},
|
||||
mounted () {
|
||||
this.dictionaryDropDown()
|
||||
},
|
||||
methods: {
|
||||
// 新增初始化方法
|
||||
add () {
|
||||
// 注册信息编辑 新增人员初始化方法
|
||||
registerEdit (record) {
|
||||
this.modalTitle = '新增人员'
|
||||
this.confirmLoading = true
|
||||
this.visible = true
|
||||
|
||||
this.registerDisabled = true
|
||||
setTimeout(() => {
|
||||
// 基本信息加入表单
|
||||
this.form.setFieldsValue(
|
||||
{
|
||||
name: record.name,
|
||||
userName: record.userName,
|
||||
phone: record.phone,
|
||||
orgId: record.orgId,
|
||||
orgName: record.orgName
|
||||
}
|
||||
)
|
||||
}, 100)
|
||||
|
||||
this.confirmLoading = false
|
||||
},
|
||||
// 编辑初始化方法
|
||||
edit (record) {
|
||||
this.modalTitle = '编辑人员'
|
||||
this.confirmLoading = true
|
||||
this.visible = true
|
||||
|
||||
this.registerDisabled = true
|
||||
|
||||
// 基本信息加入表单
|
||||
personGet({ id: record.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
const data = res.data
|
||||
// 默认选中的多选框
|
||||
const type = data.type.split(',')
|
||||
this.form.getFieldDecorator('type', { valuePropName: 'checked', initialValue: type })
|
||||
const typeIntArr = []// 保存转换后的整型字符串
|
||||
type.forEach(item => {
|
||||
typeIntArr.push(+item)
|
||||
})
|
||||
this.form.getFieldDecorator('type', { valuePropName: 'checked', initialValue: typeIntArr })
|
||||
|
||||
console.log(data)
|
||||
this.form.setFieldsValue(
|
||||
{
|
||||
id: data.id,
|
||||
|
@ -242,8 +273,8 @@
|
|||
// age: data.age,
|
||||
// sex: data.sex,
|
||||
phone: data.phone,
|
||||
jobs: data.jobs,
|
||||
workType: data.workType,
|
||||
jobs: parseInt(data.jobs),
|
||||
workType: parseInt(data.workType),
|
||||
degreeId: data.degreeId,
|
||||
orgId: data.orgId,
|
||||
orgName: data.orgName
|
||||
|
@ -257,6 +288,29 @@
|
|||
})
|
||||
this.confirmLoading = false
|
||||
},
|
||||
/**
|
||||
* 获取字典数据
|
||||
*/
|
||||
dictionaryDropDown () {
|
||||
this.formLoading = true
|
||||
// 岗位
|
||||
dictionaryDropDown({ dictionaryCode: '0002' }).then((res) => {
|
||||
this.jobsData = res.data
|
||||
})
|
||||
// 工种
|
||||
dictionaryDropDown({ dictionaryCode: '0003' }).then((res) => {
|
||||
this.workTypeData = res.data
|
||||
})
|
||||
// 学历
|
||||
dictionaryDropDown({ dictionaryCode: '0004' }).then((res) => {
|
||||
this.degreeData = res.data
|
||||
})
|
||||
// 人员类型
|
||||
dictionaryDropDown({ dictionaryCode: '0005' }).then((res) => {
|
||||
this.typeData = res.data
|
||||
this.formLoading = false
|
||||
})
|
||||
},
|
||||
handleSubmit () {
|
||||
const { form: { validateFields } } = this
|
||||
this.confirmLoading = true
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</a-card>
|
||||
<a-card :bordered="false">
|
||||
<div class="table-operator">
|
||||
<a-button @click="$refs.personForm.add()" icon="plus" type="primary" v-if="hasPerm('person:add')">新增人员</a-button>
|
||||
<a-button @click="personRegister" icon="plus" type="primary" v-if="hasPerm('person:add')">新增人员</a-button>
|
||||
|
||||
<a-button @click="transfer" type="primary" v-if="hasPerm('person:transfer')">转移部门</a-button>
|
||||
<a-button @click="quit" type="primary" v-if="hasPerm('person:quit')">离职</a-button>
|
||||
|
@ -52,7 +52,7 @@
|
|||
</div>
|
||||
|
||||
<div class="table-operator">
|
||||
<div class='person-type'>
|
||||
<div class="person-type">
|
||||
<a-radio-group v-model="queryParam.isAdmin" @change="onRadioChange">
|
||||
<a-radio :value="2">学员</a-radio>
|
||||
<a-radio :value="1">管理员</a-radio>
|
||||
|
@ -111,6 +111,7 @@
|
|||
import { orgList } from '@/api/org/org'
|
||||
import { listToTree } from '@/utils/util'
|
||||
import { personPage, personDel, personQuit, personTransferOrg, personSetAdmin, personResetPwd } from '@/api/person/person'
|
||||
import PersonRegister from './PersonRegister'
|
||||
import PersonForm from './PersonForm'
|
||||
import PersonDetail from './PersonDetail'
|
||||
import OrgTree from '../org/OrgTree'
|
||||
|
@ -119,6 +120,7 @@
|
|||
export default {
|
||||
components: {
|
||||
STable,
|
||||
PersonRegister,
|
||||
PersonForm,
|
||||
PersonDetail,
|
||||
OrgTree
|
||||
|
@ -172,14 +174,13 @@
|
|||
title: 'name',
|
||||
key: 'id',
|
||||
value: 'id'
|
||||
}
|
||||
},
|
||||
orgId: ''
|
||||
}
|
||||
},
|
||||
created () {
|
||||
/**
|
||||
* 获取到机构树,展开顶级下树节点,考虑到后期数据量变大,不建议全部展开
|
||||
完犊子,你的决策支撑写完了?可以的呢
|
||||
我反正用不上,这两天发展党员还可以凑凑
|
||||
*/
|
||||
orgList().then(res => {
|
||||
this.treeLoading = false
|
||||
|
@ -187,6 +188,8 @@
|
|||
return
|
||||
}
|
||||
this.orgTree = listToTree(res.data, [], rootParentId)
|
||||
this.orgId = this.orgTree[0].id
|
||||
console.log(this.orgId)
|
||||
for (var item of this.orgTree) {
|
||||
if (item.pid === 0) {
|
||||
this.defaultExpandedKeys.push(item.id)
|
||||
|
@ -313,6 +316,12 @@
|
|||
}
|
||||
})
|
||||
},
|
||||
personRegister () {
|
||||
this.$router.push({
|
||||
path: '/person/personRegister',
|
||||
query: { orgId: this.orgId }
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 点击左侧机构树查询列表
|
||||
*/
|
||||
|
@ -320,6 +329,7 @@
|
|||
this.queryParam = {
|
||||
'orgId': e.toString()
|
||||
}
|
||||
this.orgId = e.toString()
|
||||
this.$refs.table.refresh(true)
|
||||
},
|
||||
handleOk () {
|
||||
|
|
|
@ -0,0 +1,117 @@
|
|||
<template>
|
||||
<div>
|
||||
<a-card :bordered="false" style="padding-bottom: 0px; margin-bottom: 10px ">
|
||||
<div class="table-page-search-wrapper">
|
||||
<h3>新增人员</h3>
|
||||
<h3>单位邀请码:{{ invitationCode }}</h3>
|
||||
<h3>邀请链接: www.anquanpeixun.com</h3>
|
||||
</div>
|
||||
</a-card>
|
||||
|
||||
<a-card :bordered="false">
|
||||
<div class="table-operator">
|
||||
<h3>最近注册人员</h3>
|
||||
</div>
|
||||
|
||||
<s-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
:data="loadData"
|
||||
:rowKey="(record) => record.id"
|
||||
>
|
||||
<template slot="createTime" slot-scope="text, record">
|
||||
{{ record.createTime | moment('YYYY-MM-DD') }}
|
||||
</template>
|
||||
|
||||
<span slot="action" slot-scope="text, record">
|
||||
<a @click="$refs.personForm.registerEdit(record)">编辑</a>
|
||||
</span>
|
||||
</s-table>
|
||||
|
||||
<person-form ref="personForm" @ok="handleOk" />
|
||||
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { STable } from '@/components'
|
||||
import { personRegisterPage } from '@/api/person/personRegister'
|
||||
import PersonForm from './PersonForm'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
STable,
|
||||
PersonForm
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
invitationCode: '',
|
||||
// 查询参数
|
||||
queryParam: { orgId: this.$route.query.orgId },
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'name'
|
||||
},
|
||||
{
|
||||
title: '用户名',
|
||||
dataIndex: 'userName'
|
||||
},
|
||||
{
|
||||
title: '单位信息',
|
||||
dataIndex: 'unit'
|
||||
},
|
||||
{
|
||||
title: '部门信息',
|
||||
dataIndex: 'dept'
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
dataIndex: 'phone'
|
||||
},
|
||||
{
|
||||
title: '注册时间',
|
||||
dataIndex: 'createTime',
|
||||
scopedSlots: { customRender: 'createTime' }
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '150px',
|
||||
dataIndex: 'action',
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
],
|
||||
// 加载数据方法 必须为 Promise 对象
|
||||
loadData: parameter => {
|
||||
return personRegisterPage(Object.assign(parameter, this.queryParam)).then((res) => {
|
||||
console.log(res)
|
||||
this.invitationCode = res.invitationCode
|
||||
return res
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
created () {
|
||||
},
|
||||
methods: {
|
||||
handleOk () {
|
||||
this.$refs.table.refresh()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less">
|
||||
.table-operator {
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
button {
|
||||
margin-right: 8px;
|
||||
}
|
||||
.person-type span{
|
||||
font-size: 24px;
|
||||
}
|
||||
h3 {
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<!-- PageHeader 第二种使用方式 (v-slot) -->
|
||||
<a-card :bordered="false" :title="title">
|
||||
<a-steps class="steps" :current="currentTab">
|
||||
<a-steps class="steps" type="navigation" :current="currentTab">
|
||||
<a-step title="基本信息" />
|
||||
<a-step title="选择单位" />
|
||||
<!-- v-if="['2', '3', '4'].includes(form.trainWay)" -->
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<a-button icon="select" @click="$refs.CourseSelect.edit({})">添加课程</a-button>
|
||||
</a-space>
|
||||
|
||||
<s-table ref="table" size="default" rowKey="id" :columns="columns" :data="loadData">
|
||||
<s-table ref="table" size="default" rowKey="id" :columns="columns" :data="data1">
|
||||
<span slot="serial" slot-scope="text, record, index">
|
||||
{{ index + 1 }}
|
||||
</span>
|
||||
|
@ -49,34 +49,24 @@ export default {
|
|||
data() {
|
||||
//这里存放数据
|
||||
return {
|
||||
form: this.$form.createForm(this, { name: 'project' }),
|
||||
labelCol: {},
|
||||
wrapperCol: {},
|
||||
vertical: 'vertical',
|
||||
data1: {},
|
||||
totalHours: 0, //总课时
|
||||
totalLearnHours: 0, //总学时
|
||||
totalTopicNum: 0, //题目数量
|
||||
//查询数据
|
||||
queryParam: {},
|
||||
// 表头
|
||||
queryParam: {},//查询数据
|
||||
columns: [
|
||||
{ title: '序号', key: 'id', dataIndex: 'id', width: 60, scopedSlots: { customRender: 'serial' } },
|
||||
{ title: '课程编号', dataIndex: 'courseNo', key: 'courseNo' },
|
||||
{ title: '课程名称', dataIndex: 'courseName', key: 'courseName' },
|
||||
{ title: '课时', dataIndex: 'courseHours', key: 'courseHours', customRender: (text) => text + '分' },
|
||||
{ title: '学时要求', dataIndex: 'learnHours', key: 'learnHours', customRender: (text) => text + '分' },
|
||||
{ title: '题量', dataIndex: 'topicNumber', key: 'projectName' },
|
||||
{ title: '题量', dataIndex: 'topicNumber', key: 'topicNumber' },
|
||||
{ title: '项目名称', dataIndex: 'projectName', key: 'projectName' },
|
||||
{
|
||||
title: '操作',
|
||||
width: 200,
|
||||
align: 'center',
|
||||
scopedSlots: { customRender: 'action' },
|
||||
},
|
||||
],
|
||||
// 加载数据方法 必须为 Promise 对象
|
||||
loadData: (parameter) => {
|
||||
return getProjectList(Object.assign(parameter, this.queryParam)).then((res) => {
|
||||
return res
|
||||
})
|
||||
},
|
||||
{ title: '操作', width: 200, align: 'center', scopedSlots: { customRender: 'action' }, },
|
||||
], // 表头
|
||||
}
|
||||
},
|
||||
//计算属性 类似于data概念
|
||||
|
|
|
@ -12,8 +12,8 @@
|
|||
<a-row type="flex" justify="center" align="top">
|
||||
<a-col :span="6">
|
||||
<a-menu v-model="current" mode="horizontal">
|
||||
<a-menu-item key="mail"> <a-icon type="mail" />系统课程</a-menu-item>
|
||||
<a-menu-item key="app"> <a-icon type="appstore" />自制课程</a-menu-item>
|
||||
<a-menu-item key="sys"> <a-icon type="mail" />系统课程</a-menu-item>
|
||||
<a-menu-item key="self"> <a-icon type="appstore" />自制课程</a-menu-item>
|
||||
</a-menu>
|
||||
<a-input-search style="margin-bottom: 8px" placeholder="Search" @change="onChange" />
|
||||
<a-tree
|
||||
|
@ -43,10 +43,6 @@
|
|||
//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
||||
//例如:import 《组件名称》 from '《组件路径》'
|
||||
|
||||
/**------------------------------------------------------------ */
|
||||
420500199901110031
|
||||
/**----------------------------------------------------------------- */
|
||||
|
||||
export default {
|
||||
//import引入的组件需要注入到对象中才能使用
|
||||
components: {},
|
||||
|
@ -57,11 +53,11 @@ export default {
|
|||
visible: false,
|
||||
confirmLoading: false,
|
||||
current: ['mail'],
|
||||
|
||||
modalTitle: '',
|
||||
expandedKeys: [],
|
||||
searchValue: '',
|
||||
autoExpandParent: true,
|
||||
gData,
|
||||
gData: [],
|
||||
}
|
||||
},
|
||||
//计算属性 类似于data概念
|
||||
|
|
|
@ -86,13 +86,13 @@
|
|||
<a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
|
||||
<a-input-number v-model="form.examNumber" :min="0" style="width: 100%" />
|
||||
</a-form-item>
|
||||
<span> 补考次数: </span>
|
||||
<!-- <span> 补考次数: </span>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
|
||||
<a-input-number v-model="form.resitNumber" :min="0" style="width: 100%" />
|
||||
</a-form-item>
|
||||
<a-form-item :style="{ display: 'inline-block', width: 'calc(30% - 1px)' }">
|
||||
<a-button type="primary" @click="randomResit"> 随机补考 </a-button>
|
||||
</a-form-item>
|
||||
</a-form-item> -->
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@
|
|||
</a-descriptions>
|
||||
<br />
|
||||
<div style="width: 100%; height: 32px; margin-bottom: 8px">
|
||||
<a-button type="primary">修 改 信 息</a-button>
|
||||
<a-button type="primary">会议签到信息</a-button>
|
||||
<a-button v-if="hasPerm('terminal:train:edit')" type="primary" @click="editInfo()">修 改 信 息</a-button>
|
||||
<a-button v-if="hasPerm('terminal:train:list')" type="primary" @click="signInfo()">会议签到信息</a-button>
|
||||
</div>
|
||||
</a-card>
|
||||
</template>
|
||||
|
@ -54,6 +54,23 @@ export default {
|
|||
},
|
||||
})
|
||||
},
|
||||
editInfo(){ //修改信息按钮
|
||||
this.$router.push({
|
||||
path: '/project/terminalTrain/form',
|
||||
query: {
|
||||
id: this.detailData.id,
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
signInfo(){ //跳转签到信息页面
|
||||
this.$router.push({
|
||||
path: '/project/terminalTrain/signList',
|
||||
query: {
|
||||
id: this.detailData.id,
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<a-card :bordered="false" :title="titleName">
|
||||
<a-form-model @submit="handleSubmit" :model="form">
|
||||
<a-form-model @submit="handleSubmit" :model="form" :layout="layout" :labelCol="{span: 2}" :wrapperCol="{span: 10}">
|
||||
<a-form-model-item label="培训名称">
|
||||
<a-input v-model="form.trainName" />
|
||||
</a-form-model-item>
|
||||
|
@ -31,8 +31,10 @@
|
|||
<a-form-model-item label="备注">
|
||||
<a-input v-model="form.remark" type="textarea" />
|
||||
</a-form-model-item>
|
||||
<a-button htmlType="submit" type="primary" > 保存 </a-button>
|
||||
<a-form-model-item>
|
||||
<a-button htmlType="submit" type="primary" @click="() => { this.form.status = 1}" style="border-left: 200px;"> 保存 </a-button>
|
||||
<a-button htmlType="submit" type="primary" @click="() => { this.form.status = 2}"> 保存并发布 </a-button>
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
</a-card>
|
||||
</template>
|
||||
|
@ -66,7 +68,8 @@ export default {
|
|||
remark: '',
|
||||
status: 1,
|
||||
},
|
||||
titleName: '新增终端培训',
|
||||
titleName: '终端培训表单',
|
||||
layout: 'horizontal'
|
||||
}
|
||||
},
|
||||
//计算属性 类似于data概念
|
||||
|
|
|
@ -78,40 +78,20 @@ export default {
|
|||
endDate: this.$route.query.terminalTrainEndDate || null,
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
title: '序号',
|
||||
width: 'auto',
|
||||
align: 'center',
|
||||
dataIndex: 'id',
|
||||
key: 'id',
|
||||
scopedSlots: { customRender: 'serial' },
|
||||
},
|
||||
{ title: '序号', width: 'auto', align: 'center', dataIndex: 'id', key: 'id', scopedSlots: { customRender: 'serial' }, },
|
||||
{ title: '项目名称', width: 'auto', align: 'center', dataIndex: 'projectName', key: 'projectName' },
|
||||
{
|
||||
title: '时间',
|
||||
dataIndex: 'date',
|
||||
key: 'date',
|
||||
{ title: '时间', dataIndex: 'date', key: 'date',
|
||||
customRender: (text, record, index) => {
|
||||
return record.startDate + ' - ' + record.endDate
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '人数',
|
||||
width: 'auto',
|
||||
align: 'center',
|
||||
dataIndex: 'num',
|
||||
key: 'num',
|
||||
{ title: '人数', width: 'auto', align: 'center', dataIndex: 'num', key: 'num',
|
||||
customRender: (text, record, index) => {
|
||||
return record.signNum + ' / ' + record.personNum
|
||||
},
|
||||
},
|
||||
{ title: '培训类型', width: 'auto', align: 'center', dataIndex: 'projectType', key: 'projectType' },
|
||||
{
|
||||
title: '项目状态',
|
||||
width: 'auto',
|
||||
align: 'center',
|
||||
dataIndex: 'status',
|
||||
key: 'status',
|
||||
{ title: '项目状态', width: 'auto', align: 'center', dataIndex: 'status', key: 'status',
|
||||
customRender: (text, record, index) => {
|
||||
if (text == '1') return '未发布'
|
||||
else if (text == '2') return '未开始'
|
||||
|
|
|
@ -0,0 +1,163 @@
|
|||
<template>
|
||||
<a-card :bordered="false" title="会议签到">
|
||||
<template slot="extra">
|
||||
<a-button size="small" @click="close">返回</a-button>
|
||||
</template>
|
||||
<a-tabs :animated="false" :default-active-key="1" @change="changeTab" :headStyle="{ paddingTop: '300px' }">
|
||||
<a-tab-pane key="1" :tab="list1.title">
|
||||
<a-list item-layout="horizontal" :data-source="list1.data">
|
||||
<a-list-item slot="renderItem" slot-scope="item">
|
||||
<a-list-item-meta :description="headerListData(item)">
|
||||
<p slot="title">{{ item.name }}</p>
|
||||
<a-avatar slot="avatar" src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
|
||||
</a-list-item-meta>
|
||||
<div class="list-content">
|
||||
<div class="list-content-item">
|
||||
<span>签到状态</span>
|
||||
<p v-if="item.signStatus == 1" :style="{ color: 'turquoise' }">正常</p>
|
||||
<p v-if="item.signStatus == 2" :style="{ color: 'red' }">迟到</p>
|
||||
</div>
|
||||
<div class="list-content-item">
|
||||
<span>签到时间</span>
|
||||
<p>{{ item.signTime }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</a-list-item>
|
||||
</a-list>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" :tab="list2.title" force-render>
|
||||
<a-list item-layout="horizontal" :data-source="list2.data">
|
||||
<a-list-item slot="renderItem" slot-scope="item">
|
||||
<a-list-item-meta :description="headerListData(item)">
|
||||
<p slot="title">{{ item.name }}</p>
|
||||
<a-avatar slot="avatar" src="https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png" />
|
||||
</a-list-item-meta>
|
||||
</a-list-item>
|
||||
</a-list>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</a-card>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
|
||||
// 例如:import 《组件名称》 from '《组件路径》'
|
||||
import { terminalTrainSignList } from '@/api/project/terminalTrainSign'
|
||||
|
||||
export default {
|
||||
// import引入的组件需要注入到对象中才能使用
|
||||
components: {
|
||||
terminalTrainSignList,
|
||||
},
|
||||
props: {},
|
||||
data() {
|
||||
// 这里存放数据
|
||||
return {
|
||||
list1: {
|
||||
title: '',
|
||||
params: {
|
||||
id: this.$route.query.id || '',
|
||||
type: 1,
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
list2: {
|
||||
title: '',
|
||||
params: {
|
||||
id: this.$route.query.id || '',
|
||||
type: 2,
|
||||
},
|
||||
data: [],
|
||||
},
|
||||
}
|
||||
},
|
||||
// 计算属性 类似于data概念
|
||||
computed: {},
|
||||
// 监控data中的数据变化
|
||||
watch: {},
|
||||
// 方法集合
|
||||
methods: {
|
||||
changeTab(key) {
|
||||
if (key === '1') {
|
||||
this.queryList(this.list1.params)
|
||||
} else {
|
||||
this.queryList(this.list2.params)
|
||||
}
|
||||
},
|
||||
// 返回 按钮
|
||||
close() {
|
||||
this.$router.push({
|
||||
path: '/project/terminalTrain/detail',
|
||||
query: {
|
||||
terminalTrainId: this.list1.params.id,
|
||||
},
|
||||
})
|
||||
},
|
||||
|
||||
//返回数据拼接
|
||||
headerListData(item) {
|
||||
return item.department + '-' + item.position
|
||||
},
|
||||
|
||||
//异步查询数据
|
||||
queryList(params) {
|
||||
terminalTrainSignList(params).then((res) => {
|
||||
console.log(res)
|
||||
if (params.type === 1) {
|
||||
this.list1.data = res.data
|
||||
this.list1.title = '已签到人员 (' + res.signNum + ')'
|
||||
this.list2.title = '未签到人员 (' + res.enrollNum + ')'
|
||||
} else {
|
||||
this.list2.data = res.data
|
||||
this.list1.title = '已签到人员 (' + res.signNum + ')'
|
||||
this.list2.title = '未签到人员 (' + res.enrollNum + ')'
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
// 生命周期 - 创建完成(可以访问当前this实例)
|
||||
created() {
|
||||
this.changeTab('1')
|
||||
},
|
||||
// 生命周期 - 挂载完成(可以访问DOM元素)
|
||||
mounted() {},
|
||||
// 生命周期 - 创建之前
|
||||
beforeCreate() {},
|
||||
// 生命周期 - 挂载之前
|
||||
beforeMount() {},
|
||||
// 生命周期 - 更新之前
|
||||
beforeUpdate() {},
|
||||
// 生命周期 - 更新之后
|
||||
updated() {},
|
||||
// 生命周期 - 销毁之前
|
||||
beforeDestroy() {},
|
||||
// 生命周期 - 销毁完成
|
||||
destroyed() {},
|
||||
// 如果页面有keep-alive缓存功能,这个函数会触发
|
||||
activated() {},
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.ant-avatar-lg {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
}
|
||||
|
||||
.list-content-item {
|
||||
color: rgba(0, 0, 0, 0.45);
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
font-size: 14px;
|
||||
margin-left: 300px;
|
||||
span {
|
||||
line-height: 20px;
|
||||
}
|
||||
p {
|
||||
margin-top: 4px;
|
||||
margin-bottom: 0;
|
||||
line-height: 22px;
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -7,6 +7,8 @@
|
|||
@search="handleRefresh"
|
||||
@reset="() => {queryParam = {}, handleRefresh()}" >
|
||||
</SearchCom>
|
||||
|
||||
<a-button type="primary" @click="handleCreate">新增</a-button>
|
||||
</div>
|
||||
<s-table
|
||||
ref="table"
|
||||
|
|
|
@ -46,13 +46,14 @@
|
|||
|
||||
<script>
|
||||
import { dictionaryItemPage, dictionaryItemDel } from '@/api/sys/dictionaryItem'
|
||||
import { STable } from '@/components'
|
||||
import { STable, GoBack } from '@/components'
|
||||
import DictionaryItemForm from './DictionaryItemForm'
|
||||
|
||||
export default {
|
||||
name: 'DictionaryItemList',
|
||||
components: {
|
||||
STable,
|
||||
GoBack,
|
||||
DictionaryItemForm
|
||||
},
|
||||
data () {
|
||||
|
@ -91,6 +92,10 @@ export default {
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
goBack () {
|
||||
// 返回到上一级
|
||||
this.$router.push({ path: '/dictionary' })
|
||||
},
|
||||
// 增
|
||||
handleCreate () {
|
||||
this.$refs.modal.add()
|
||||
|
|
Loading…
Reference in New Issue