Commit 20ef7234 authored by 李苏's avatar 李苏 💬

11.28

parent ef6ad19e
......@@ -73,3 +73,22 @@ export function doImp(query) {
data: query||{}
})
}
/* 导出 */
export function excelExport(query) {
return request({
responseType:"blob",
url: 'aqgl/jcsj/scgw/excel/export',
method: 'post',
data: query||{}
})
}
/* 导入 */
export function excelimport(query) {
return request({
'Content-type' : 'multipart/form-data',
url: 'aqgl/jcsj/scgw/import',
method: 'post',
data: query||{}
})
}
......@@ -724,8 +724,7 @@ export const powerRoutes=[
path:"assessment"
},
{
commonComponent:'trainRecord',
component:() => import( "@/views/train/trainRecord/index"),
component:'train/trainRecord/index',
hidden:false,
meta:{
"title": "培训记录管理",
......@@ -736,7 +735,33 @@ export const powerRoutes=[
},
name:'trainRecord',
path:"trainRecord"
}/*,
},
{
component:'train/onlinExaminations/index',
hidden:false,
meta:{
"title": "在线考试管理",
"icon": "",
"noCache": false,
"link": null,
"mkid":'test',
},
name:'onlinExaminations',
path:"onlinExaminations"
},
{
component:'train/testPaper/index',
hidden:false,
meta:{
"title": "考试试卷",
"icon": "",
"noCache": false,
"link": null,
"mkid":'test',
},
name:'testPaper',
path:"testPaper"
},/*,
{
commonComponent:'questionManage',
component:() => import( "@/views/train/questionManage/index"),
......
......@@ -9,11 +9,19 @@
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="公司" ref="gsid" prop="gsid">
<!-- <el-input :readonly="readonly" v-model="form.name" ></el-input> -->
<RelSelect :readonly="readonly" filterable style="width: 100%;" src='/jcsj/common/bm/queryGs' :match="{value:'id',label:'bmmc'}" v-model='form.gsid' ></RelSelect>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="所属部门" ref="bmid" prop="bmid">
<!-- <el-input :readonly="readonly" v-model="form.name" ></el-input> -->
<RelSelect style="width: 100%;" src='kzzx/bm/query' :match="{value:'id',label:'bmmc'}" v-model='form.bmid' ></RelSelect>
<RelSelect :readonly="readonly" filterable linkage :linkParams="{pid:form.gsid}" style="width: 100%;" src='jcsj/common/bm/queryBz' :match="{value:'id',label:'bmmc'}" v-model='form.bmid' ></RelSelect>
</el-form-item>
</el-col>
</el-row>
......@@ -63,6 +71,7 @@
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: {
gsid:'',
bmid:'',
//ID
id:'',
......
......@@ -24,6 +24,8 @@
<FieldButton :app='app'></FieldButton>
<ExcelButton :app='app'></ExcelButton>
<el-button size='mini' @click.native="doPerson" type="primary">岗位人员管理</el-button>
<el-button size='mini' @click.native="drexcel" type="primary">导入模板</el-button>
<el-button size='mini' @click.native="dcexcel" type="primary">导出模板</el-button>
<!-- 额外按钮-->
<!-- 表头设置 -->
......@@ -47,7 +49,9 @@
doQuery,
doAdd,
doUpdate,
doDelete
doDelete,
excelExport,
excelimport
} from '@/api/basicData/scgw.js';
/* edit页面*/
import Edit from './edit'
......@@ -60,7 +64,7 @@
/* 初始额外赋值*/
async mounted() {
this.$refs['TablePager'].pageQuery()
},
data() {
......@@ -90,6 +94,95 @@
}
},
methods: {
drexcel(){
let that=this
let input = document.createElement('input');
input.type='file'
input.onchange=function(){
let file = input.files[0];
if(file){
let name = file.name
let type = file.type
let formData = new FormData();
formData.append('name', name)
formData.append('type', type)
formData.append('file', file)
excelimport(formData).then(res=>{
try{document.body.removeChild(input)}catch(e){
console.log(e)
}
if(res.success){
that.$success('上传成功')
that.$refs.TablePager.pageQuery()
}
})
}
}
input.click()
},
/* 下载*/
downLoad(data, title) {
let a = document.createElement('a');
a.download = title;
a.style.display = 'none';
let blob = new Blob([data], {
type: 'application/vnd.ms-excel;charset=UTF-8',
});
a.href = URL.createObjectURL(blob);
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
},
dcexcel(){
// var fields = [
// {label: "岗位编码", prop: "code", fieldType: "ftString",width:240},
// {label: "岗位名称", prop: "name", fieldType: "ftString",width:300},
// {label: "所属部门", prop: "bmName", fieldType: "ftString",width:300},
// {label: "负责人编码", prop: "fzrid", fieldType: "ftString",width:192},
// {label: "负责人", prop: "fzrName", fieldType: "ftString",width:192},
// {label: "备注", prop: "bz", fieldType: "ftString",width:300},
// {label: "维护人", prop: "whr", fieldType: "ftString"},
// {label: "维护时间", prop: "whsj", fieldType: "ftDateTime"}
// ]
var f = []
// fields.forEach((item, index) => {
// let newObj = {
// caption: item.label,
// name: item.prop,
// width: item.width||200
// }
// f[index] = newObj
// })
var file = '岗位模板';
var type = ".xlsx";
var filename = file.replace(/.*(\/|\\)/, "");
var fileExt = (/[.]/.exec(filename)) ? /[^.]+$/.exec(filename.toLowerCase()) : '';
var es = filename + type;
if (fileExt) {
switch (fileExt[0]) {
case 'xlsx':
es = filename;
break;
case "xls":
es = filename;
break;
default:
es = filename + type;
break
}
}
var formData = {
condition: JSON.stringify(this.queryParams || {}),
fileName: es,
fields: JSON.stringify(f)
};
excelExport(formData).then(e => {
this.downLoad(e, es)
})
},
doPerson(){
if (this.app.selectOne || this.app.clickOne) {
this.DialogWidth = '70vw'
......
......@@ -121,7 +121,7 @@
let yclCountList=[]
this.tabData.forEach(item=>{
fxdList.push(item.fxdName)
wclCountList.push(item.wclCount)
wclCountList.push(item.wclCount+item.yclCount)
yclCountList.push(item.yclCount)
})
......@@ -155,8 +155,8 @@
type: 'bar',
barWidth: '20px',
itemStyle: {
color: '#91cc75',
shadowColor: '#91cc75',
color: '#f00000',
shadowColor: '#f00000',
borderType: 'dashed',
}
......@@ -167,8 +167,8 @@
data: yclCountList,
type: 'bar',
itemStyle: {
color: '#f00000',
shadowColor: '#f00000',
color: '#91cc75',
shadowColor: '#91cc75',
borderType: 'dashed',
},
......
<template>
<div class="examMain" :title="subject">
<!-- 试题题目-->
<template v-if="type!='TKT'">
<span>{{`${index}.`}}</span>
<span>{{type|typeName}}</span>
<span>{{subject}}{{score}}</span>
<br>
</template>
<!-- 填空题-->
<template v-if="type=='TKT'">
<span>{{`${index}.`}}</span>
<span>{{'TKT'|typeName}}</span>
<span v-html="transTKT(subject,getValue)"></span><span>{{score}}</span>
</template>
<!-- 答案选项-->
<!-- 单选-->
<div v-if="type=='DXT'" class="options">
<div class="item" :key="index" v-for="(item,index) in options">
<el-radio v-model="value" :label="index"> {{`${index}.${item}`}}</el-radio>
</div>
</div>
<!-- 多选-->
<div v-if="type=='DXTS'" class="options">
<div class="item" :key="index" v-for="(item,index) in options">
<!-- <el-radio v-model="value" :label="index"> {{`${index}.${item}`}}</el-radio> -->
<el-checkbox-group v-model="valueList">
<el-checkbox :label="index">{{`${index}.${item}`}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</div>
</template>
<script>
export default{
mounted() {
this.type=='TKT'&&$(this.$el).find('[name=tktinput]').change(e=>{
this.value=$(this.$el).find('[name=tktinput]').val()||''
})
},
props:{
app:{
type:Object,
default:function(){
return {}
}
},
index:{
default:1
},
subject:{
type:String,
default:'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有( )个。'
},
score:{
type:String,
default:'(2分)'
},
type:{
type:String,
default:'DXT'
},
options:{
type:Object,
default:()=>{
return{
A:'1个',
B:'2个',
C:'3个',
D:'4个'
}
}
}
},
data(){
return{
value:'',
valueList:[],
}
},
methods:{
transTKT(val,fn){
let template=`<input type='text' name='tktinput' class='tktinput'>`
let nval=val.replace('( )',template)
return nval
}
},
filters:{
typeName(val){
let typeArry={
'DXT':'(单选题)',
'DXTS':'(多选题)',
'TKT':'(填空题)'
}
let nval=typeArry[val]
return nval||'其他'
}
}
}
</script>
<style lang="scss" scope>
input{
border: none;
outline: none;
}
input:focus{
border: none;
}
.tktinput:focus{
border: 0px;
border-bottom: 1px solid #eee;
}
.tktinput{
border: 0px;
border-bottom: 1px solid #eee;
}
.examMain{
height: 100%;
width: 100%;
font-size: 14px;
overflow: auto;
.options{
padding: 10px;
width: 100%;
display: flex;
flex-wrap: wrap;
.item{
width: 50%;
line-height: 20px;
}
}
}
</style>
<template>
<div class="testpaper">
<div class="title">{{title}}
<span style="position: absolute;right: 40px;;font-size: 14px;font-weight: 300;">{{`剩余时间:${parseInt(remaining/(60*1000))}分钟${parseInt((remaining%(60*1000))/1000)}秒`}}</span>
</div>
<div class="info">
<div class="infoItem">
<span>姓名:{{'周楠楠'}}</span>
</div>
<div class="infoItem">
<span>证件号:{{'221718301528'}}</span>
</div>
<div class="infoItem">
<span>开始时间:{{$moment(startTime).format('YYYY-MM-DD HH:mm:ss ') }}</span>
</div>
<div class="infoItem">
<span>结束时间:{{$moment(endTime).format('YYYY-MM-DD HH:mm:ss ') }}</span>
</div>
</div>
<Subject :app='that' v-for='(item,index) in subjectList' :key="index" :index='index+1' :subject='item.subject' :score='item.score' :type='item.type' :options='item.options' ></Subject>
<div style="height: 50px;">
<el-button @click="submit" size="mini" type="primary" style="float: right;width: 100px;">提交</el-button>
</div>
</div>
</template>
<script>
import Subject from './subject'
export default{
mounted() {
this.getRemain()
},
components:{
Subject
},
methods:{
getRemain(){
let setNum=setTimeout(()=>{
let time=new Date().getTime()
let remindTime=this.endTime-time
this.remaining=remindTime
if(this.remaining>0){
this.getRemain()
}
},1000)
},
submit(){
this.subjectList.forEach((item,index)=>{
if(item.value&&item.value.length>0){
}else{
this.$warning(`第${index+1}题未作答`)
throw new Error(`第${index+1}题未作答`)
}
})
/* 提交试卷*/
this.$confirm('是否提交试卷, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
console.log(this.subjectList)
this.$message({
type: 'success',
message: '试卷提交成功!'
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
});
}
},
data(){
return{
startTime:new Date().getTime(),
endTime:new Date().getTime()+1000*120*60,
remaining:'',
title:'专八仪表考试测试1128(在线考试)',
that:this,
subjectList:[
{id:'AE89',
subject:'下列营养物质中在人体不能产生能量的为',
score:'2',
type:'DXT',
options:{
A:'蔗糖',
B:'果糖',
C:'木质素',
D:'酪蛋白'
}
},
{
id:'AE891',
subject:'从业人员在职业活动中,以公平、对等的态度对待领导、同事和顾客等人的行为是()',
score:'5',
type:'TKT',
options:{
}
},
{
id:'AE8914',
subject:'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有()个。',
score:'2',
type:'DXTS',
options:{
A:'1个',
B:'2个',
C:'3个',
D:'4个',
E:'5个'
}
},
{id:'AE89',
subject:'下列营养物质中在人体不能产生能量的为',
score:'2',
type:'DXT',
options:{
A:'蔗糖',
B:'果糖',
C:'木质素',
D:'酪蛋白'
}
},
{
id:'AE891',
subject:'从业人员在职业活动中,以公平、对等的态度对待领导、同事和顾客等人的行为是()',
score:'5',
type:'TKT',
options:{
}
},
{
id:'AE8914',
subject:'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有()个。',
score:'2',
type:'DXTS',
options:{
A:'1个',
B:'2个',
C:'3个',
D:'4个',
E:'5个'
}
},
{id:'AE89',
subject:'下列营养物质中在人体不能产生能量的为',
score:'2',
type:'DXT',
options:{
A:'蔗糖',
B:'果糖',
C:'木质素',
D:'酪蛋白'
}
},
{
id:'AE891',
subject:'众所周知,()是世界上最帅的人。',
score:'5',
type:'TKT',
options:{
}
},
{
id:'AE8914',
subject:'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有()个。',
score:'2',
type:'DXTS',
options:{
A:'1个',
B:'2个',
C:'3个',
D:'4个',
E:'5个'
}
},
{id:'AE89',
subject:'下列营养物质中在人体不能产生能量的为',
score:'2',
type:'DXT',
options:{
A:'蔗糖',
B:'果糖',
C:'木质素',
D:'酪蛋白'
}
},
{
id:'AE891',
subject:'从业人员在职业活动中,以公平、对等的态度对待领导、同事和顾客等人的行为是()',
score:'5',
type:'TKT',
options:{
}
},
{
id:'AE8914',
subject:'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有()个。',
score:'2',
type:'DXTS',
options:{
A:'1个',
B:'2个',
C:'3个',
D:'4个',
E:'5个'
}
}
]
}
}
}
</script>
<style lang="scss">
.testpaper{
.info{
display: flex;
line-height: 80px;
font-size: 13px;
font-weight: 700;
text-align: center;
.infoItem{
width: 25%;
}
}
.title{
line-height: 30px;
text-align: center;
width: 100%;
font-size: 18px;
font-weight: 800;
}
padding-left: 111px;
padding-right: 111px;
}
</style>
<template>
<div class="examMain" :title="subject">
<!-- 试题题目-->
<template v-if="type!='TKT'">
<span>{{`${index}.`}}</span>
<span>{{type|typeName}}</span>
<span>{{subject}}{{score|typeScore}}</span>
<br>
</template>
<!-- 填空题-->
<template v-if="type=='TKT'">
<span>{{`${index}.`}}</span>
<span>{{'TKT'|typeName}}</span>
<span v-html="transTKT(subject)"></span><span>{{score|typeScore}}</span>
</template>
<!-- 答案选项-->
<!-- 单选-->
<div v-if="type=='DXT'" class="options">
<div class="item" :key="index" v-for="(item,index) in options">
<el-radio v-model="value" :label="index"> {{`${index}.${item}`}}</el-radio>
</div>
</div>
<!-- 多选-->
<div v-if="type=='DXTS'" class="options">
<div class="item" :key="index" v-for="(item,index) in options">
<el-checkbox-group v-model="valueList">
<el-checkbox :label="index">{{`${index}.${item}`}}</el-checkbox>
</el-checkbox-group>
</div>
</div>
</div>
</template>
<script>
export default{
updated() {
if(this.type=='DXTS'){
this.app.subjectList[this.index-1].value=this.valueList
}else{
this.app.subjectList[this.index-1].value=this.value
}
},
mounted() {
this.type=='TKT'&&$(this.$el).find('[name=tktinput]').change(e=>{
this.value=$(this.$el).find('[name=tktinput]').val()||''
this.app.subjectList[this.index-1].value=this.value
})
},
props:{
app:{
type:Object,
default:()=>{
return {}
}
},
index:{
default:1
},
subject:{
type:String,
default:'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有()个。'
},
score:{
type:String,
default:'2'
},
type:{
type:String,
default:'DXT'
},
options:{
type:Object,
default:()=>{
return{
A:'1个',
B:'2个',
C:'3个',
D:'4个'
}
}
}
},
data(){
return{
value:'',
valueList:[],
}
},
methods:{
transTKT(val,fn){
let template=`<input type='text' name='tktinput' class='tktinput'>`
let nval=val.replace('()',template)
return nval
}
},
filters:{
typeName(val){
let typeArry={
'DXT':'(单选题)',
'DXTS':'(多选题)',
'TKT':'(填空题)'
}
let nval=typeArry[val]
return nval||'其他'
},
typeScore(val){
let nval=`(${val}分)`
return nval
}
}
}
</script>
<style lang="scss" scope>
.el-radio__label{
font-size: 13px;
color:rgb(119, 119, 119);
}
input{
border: none;
outline: none;
}
input:focus{
border: none;
}
.tktinput:focus{
border: 0px;
border-bottom: 1px solid #eee;
}
.tktinput{
border: 0px;
border-bottom: 1px solid #eee;
color: #888;
}
.examMain{
margin-top: 30px;
height: 100%;
width: 100%;
font-size: 14px;
overflow: auto;
.options{
padding: 10px;
width: 100%;
display: flex;
flex-wrap: wrap;
.item{
padding-left: 20%;
width: 50%;
line-height: 20px;
}
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment