Commit 77e3fb8e authored by Mac's avatar Mac

1

parents f3135500 1b0a3703
......@@ -243,12 +243,24 @@ export function saveBatchQuestionLevel(data) {
}
/**
* 根据题库编号获取题库题型分类列表【试卷组卷使用】
* 根据题库编号获取题库题型列表(单选题、多选题、等)【试卷组卷使用】
* @param {*} data
*/
export function queryQuestionCategoryList(data) {
export function queryQuestionTypeStaticList(data) {
return request({
url: '/Question/GetQuestionCategoryList',
url: '/Question/GetQuestionTypeStaticList',
method: 'post',
data
})
}
/**
* 根据题库编号获取题库题型分类列表(读音选择题、汉字选择题等)【试卷组卷使用】
* @param {*} data
*/
export function queryQuestionCategoryStaticList(data) {
return request({
url: '/Question/GetQuestionCategoryStaticList',
method: 'post',
data
})
......
......@@ -314,9 +314,9 @@
methods: {
//是否可修改
isEdit(item) {
// if (this.currentUserInfo.Id == 1) {
// return true;
// }
if (this.currentUserInfo.Id == 1) {
return true;
}
return this.currentUserInfo.Id == item.CreateBy &&
(item.ExamineStatus == 0 || item.ExamineStatus == 3 || item.ExamineStatus == 4)
},
......
......@@ -20,7 +20,8 @@
</template>
<template v-slot:body-cell-optioned="props">
<q-td :props="props">
<q-btn flat size="xs" v-if="props.row.IsEdit==1" color="accent" style="font-weight: 400" label="修改" @click="publishExam(props.row)" />
<!--v-if="props.row.IsEdit==1"-->
<q-btn flat size="xs" color="accent" style="font-weight: 400" label="修改" @click="publishExam(props.row)" />
<q-btn-dropdown flat size="xs" color="dark" label="更多" style="margin-left: 10px">
<q-list>
<q-item clickable v-close-popup @click="submitExamAudit(props.row)"
......
......@@ -69,6 +69,12 @@
label: '模板名称',
field: 'TemplateName',
align: 'left',
},
{
name: 'GroupTypeName',
label: '组卷类型',
field: 'GroupTypeName',
align: 'left',
},
{
name: 'TemplateScore',
......
......@@ -37,7 +37,18 @@
.vClozeQuestionBold {
font-weight: bold;
}
.chooseOptionList:before{
content: "-";
display: block;
line-height: 1.5em;
color: transparent;
}
.chooseOptionList:after{
content: "-";
display: block;
line-height: 1em;
color: transparent;
}
</style>
<template>
<div class="vClozeQuestion">
......@@ -54,7 +65,7 @@
</thead>
<tbody class="chooseOptionList">
<tr v-for="(subItem,subIndex) in item.OptionList" :key="subIndex">
<td style="width:40px;text-align:center;">
<td style="width:40px;text-align:center;height:50px;">
<template v-if="isOperate">
<div class="Answer_List" @click="ChangeItem(item,subItem)" :class="{'Is_Answer':subItem.IsAnswer}">
{{subItem.Name}}
......
......@@ -48,15 +48,15 @@
<td colspan="2"><span v-if="data&&data.IsMutex==1" style="font-size:13px;">答案顺序打乱也判正确</span></td>
</tr>
<tr>
<td colspan="2">1. 一个空有多种答案时请用";"隔开。如:水;H2O</td>
<td colspan="2" style="height:40px;">1. 一个空有多种答案时请用";"隔开。如:水;H2O</td>
</tr>
<tr>
<td colspan="2">2. 若试题答案是数字,可设置范围,两个数字之间用"-"。如:1-9,学生填写1到9之间的数字都算正确(包括1和9)</td>
<td colspan="2" style="height:40px;">2. 若试题答案是数字,可设置范围,两个数字之间用"-"。如:1-9,学生填写1到9之间的数字都算正确(包括1和9)</td>
</tr>
</tbody>
<tfoot v-if="isShowAnswer">
<tr v-if="isShowStudentAnswer">
<td class="v_fillInBold">
<td class="v_fillInBold" style="height:40px;">
考生答案
</td>
<td>
......@@ -73,8 +73,8 @@
</tr>
</template>
<tr v-if="isShowStudentAnswer">
<td colspan="2">
<q-input v-if="isEditStudentScore" standout="bg-primary text-white" v-model="data.StudentScore" label="得分:"
<td colspan="2" style="height:70px;">
<q-input v-if="isEditStudentScore" filled style="width:180px;" v-model="data.StudentScore" label="得分:"
maxlength="20" @input="getQuestionScore" />
<span v-else class="v_fillInBold">考生得分:{{data.StudentScore}}</span>
</td>
......
......@@ -7,11 +7,17 @@
.v_judgeQuestionBold {
font-weight: bold
}
.v_judgeTable tfoot:before{
content: "-";
display: block;
line-height: 1em;
color: transparent;
}
</style>
<template>
<div class="v_judgeQuestion">
<table v-if="data&&data.QuestionContentObj&&data.QuestionContentObj.length>0" class="common_TiTable">
<table v-if="data&&data.QuestionContentObj&&data.QuestionContentObj.length>0" class="common_TiTable judgeTable">
<tbody v-for="(item,index) in data.QuestionContentObj" :key="index">
<tr>
<td style="width:50px;text-align:center;">
......@@ -34,15 +40,15 @@
</tbody>
<tfoot v-if="isShowAnswer">
<tr>
<td colspan="2" class="v_judgeQuestionBold">正确答案:{{data.Answer}}</td>
<td colspan="2" style="height:40px;" class="v_judgeQuestionBold">正确答案:{{data.Answer}}</td>
</tr>
<tr v-if="isShowStudentAnswer">
<td colspan="2" class="v_judgeQuestionBold" :style="{color:data.Answer ==data.StundetAnswer?'#67c23a':'red'}">
<td colspan="2" class="v_judgeQuestionBold" style="height:40px;" :style="{color:data.Answer ==data.StundetAnswer?'#67c23a':'red'}">
考生答案:{{data.StundetAnswer}}</td>
</tr>
<tr v-if="isShowStudentAnswer">
<td colspan="2">
<q-input v-if="isEditStudentScore" standout="bg-primary text-white" v-model="data.StudentScore" label="得分:"
<td colspan="2" style="height:70px;">
<q-input v-if="isEditStudentScore" filled style="width:180px" v-model="data.StudentScore" label="得分:"
maxlength="20" @input="getQuestionScore" />
<span v-else class="v_judgeQuestionBold">考生得分:{{data.StudentScore}}</span>
</td>
......
......@@ -23,11 +23,10 @@
.v_matchingQuestionBold {
font-weight: bold;
}
</style>
<template>
<div class="v_matchingQuestion">
<table v-if="data&&data.QuestionContentObj&&data.QuestionContentObj.length>0" class="common_TiTable">
<table v-if="data&&data.QuestionContentObj&&data.QuestionContentObj.length>0" class="common_TiTable" style="width:360px;">
<thead>
<tr>
<th colspan="2">第一组</th>
......@@ -58,12 +57,14 @@
<span class="line_center"></span>
</td>
<td>
<select v-model="data.QuestionContentObj[2][index].Content" class="selectBox2">
<template v-for="(cItem,cIndex) in data.QuestionContentObj[1]">
<option :key="cIndex" :label="cItem.Name" :value="cItem.Name">
</option>
</template>
</select>
<el-select v-model="data.QuestionContentObj[2][index].Content" style="width:100px" size="small" placeholder="请选择">
<el-option
v-for="(cItem,cIndex) in data.QuestionContentObj[1]"
:key="cIndex"
:label="cItem.Name"
:value="cItem.Name">
</el-option>
</el-select>
</td>
</tr>
</table>
......
......@@ -6,12 +6,19 @@
.v_multipleQuestionBold {
font-weight: bold;
height:40px;
}
.mutiTable tfoot:before{
content: "-";
display: block;
line-height: 1em;
color: transparent;
}
</style>
<template>
<div class="v_multipleQuestion">
<table v-if="data&&data.QuestionContentObj&&data.QuestionContentObj.length>0" class="common_TiTable">
<table v-if="data&&data.QuestionContentObj&&data.QuestionContentObj.length>0" class="common_TiTable mutiTable">
<tbody v-for="(item,index) in data.QuestionContentObj" :key="index">
<tr>
<td style="width:40px;text-align:center;">
......@@ -27,7 +34,7 @@
</div>
</template>
</td>
<td>
<td style="height:40px;">
<div class="InpDIV" style="border:0;" v-html="item.Content"></div>
</td>
</tr>
......@@ -41,18 +48,21 @@
:style="{color:data.Answer ==data.StundetAnswer?'#67c23a':'red'}">考生答案:{{data.StundetAnswer}}</td>
</tr>
<tr v-if="isShowStudentAnswer">
<td colspan="2">
<q-input v-if="isEditStudentScore" standout="bg-primary text-white" v-model="data.StudentScore" label="得分:"
<td colspan="2" style="height:70px;">
<q-input v-if="isEditStudentScore" style="width:180px;" filled v-model="data.StudentScore" label="得分:"
maxlength="20" @input="getQuestionScore" />
<span v-else class="v_multipleQuestionBold">考生得分:{{data.StudentScore}}</span>
</td>
</tr>
<tr>
<td colspan="2">
<div style="display:flex;">
<span class="v_multipleQuestionBold">
解析:
</span>
<span v-html="data.AnswerParse"></span></td>
<span v-html="data.AnswerParse"></span>
</div>
</td>
</tr>
</tfoot>
</table>
......
......@@ -26,6 +26,7 @@
.v_readingComprehensioQuestionBold {
font-weight: bold;
height:40px;
}
</style>
......@@ -164,17 +165,17 @@
</tr>
</template>
<tr v-if="isShowAnswer">
<td colspan="2" class="v_readingComprehensioQuestionBold">
<td colspan="2" style="height:40px" class="v_readingComprehensioQuestionBold">
答案: {{data.QuestionAnswerList[index].SubAnswer}}
</td>
</tr>
<tr v-if="isShowStudentAnswer">
<td colspan="2" class="v_readingComprehensioQuestionBold" :style="{color:data.QuestionAnswerList[index].SubAnswer ==data.AnswerList[index].SubAnswer?'#67c23a':'red'}">
<td colspan="2" style="height:40px" class="v_readingComprehensioQuestionBold" :style="{color:data.QuestionAnswerList[index].SubAnswer ==data.AnswerList[index].SubAnswer?'#67c23a':'red'}">
学生答案: {{data.AnswerList[index].SubAnswer}}
</td>
</tr>
<tr v-if="isShowStudentAnswer">
<td colspan="2">
<td colspan="2" style="height:40px">
<q-input v-if="isEditStudentScore" standout="bg-primary text-white"
v-model="data.AnswerList[index].StudentScore" label="得分:" maxlength="20" @input="getQuestionScore" />
<span v-else class="v_readingComprehensioQuestionBold">考生得分:{{data.AnswerList[index].StudentScore}}</span>
......
......@@ -14,11 +14,16 @@
.v_sharingChooseQuestionBold {
font-weight: bold;
}
.shareChooseTable td{
vertical-align: middle!important;
}
.shareChooseTable td p{
margin:0!important;
}
</style>
<template>
<div class="v_sharingChooseQuestion">
<table v-if="data.QuestionContentObj&&data.QuestionContentObj.length>0" class="common_TiTable">
<table v-if="data.QuestionContentObj&&data.QuestionContentObj.length>0" class="common_TiTable shareChooseTable">
<thead>
<tr>
<th colspan="2" style="text-align:left;">
......@@ -29,7 +34,7 @@
</tr>
</thead>
<tr v-for="(item,index) in data.QuestionContentObj[0]" :key="index">
<td style="width:40px;text-align:center; ">
<td style="width:40px;text-align:center;height:40px; ">
{{item.Name}}
</td>
<td>
......@@ -37,10 +42,10 @@
</td>
</tr>
</table>
<table v-if="data.QuestionContentObj&&data.QuestionContentObj.length>0" class="common_TiTable">
<table v-if="data.QuestionContentObj&&data.QuestionContentObj.length>0" class="common_TiTable shareChooseTable">
<tbody v-for="(item,index) in data.QuestionContentObj[1]" :key="index">
<tr>
<td style="width:40px;text-align:center;">
<td style="width:40px;text-align:center;height:40px;">
({{index+1}})
</td>
<td>
......@@ -55,25 +60,27 @@
答案: {{data.QuestionContentObj[1][index].Name}}
</template>
<template v-if="isOperate">
<select v-model="item.Name" class="selectBox" style="margin:10px 0 0 0;outline:none;">
<template v-for="(cItem,cIndex) in data.QuestionContentObj[0]">
<option :key="cIndex" :label="cItem.Name" :value="cItem.Name">
</option>
</template>
</select>
<el-select v-model="item.Name" style="width:100px" size="small" placeholder="请选择">
<el-option
v-for="(cItem,cIndex) in data.QuestionContentObj[0]"
:key="cIndex"
:label="cItem.Name"
:value="cItem.Name">
</el-option>
</el-select>
</template>
</td>
</tr>
</tbody>
<tfoot v-if="isShowStudentAnswer">
<tr>
<td colspan="2" class="v_sharingChooseQuestionBold" :style="{color:data.Answer ==data.StundetAnswer?'#67c23a':'red'}">
<td colspan="2" class="v_sharingChooseQuestionBold" style="height:70px" :style="{color:data.Answer ==data.StundetAnswer?'#67c23a':'red'}">
考生答案:{{data.StundetAnswer}}
</td>
</tr>
<tr>
<td colspan="2">
<q-input v-if="isEditStudentScore" standout="bg-primary text-white" v-model="data.StudentScore" label="得分:"
<q-input v-if="isEditStudentScore" filled style="width:180px" v-model="data.StudentScore" label="得分:"
maxlength="20" @input="getQuestionScore" />
<span v-else class="v_sharingChooseQuestionBold">考生得分:{{data.StudentScore}}</span>
</td>
......
......@@ -20,11 +20,11 @@
<el-input v-model="data.Answer" placeholder="请填写问题答案"> </el-input>
</div>
<div v-if="isShowStudentAnswer" style="display:flex;">
<div class="v_shortAnswerQuestionBold">考生答案:</div>
<div class="v_shortAnswerQuestionBold" style="margin:20px 0">考生答案:</div>
<div v-html="data.StundetAnswer"></div>
</div>
<div v-if="isShowStudentAnswer" style="display:flex;">
<q-input v-if="isEditStudentScore" standout="bg-primary text-white" v-model="data.StudentScore" label="得分:"
<div v-if="isShowStudentAnswer" style="display:flex;;margin-bottom:20px;">
<q-input v-if="isEditStudentScore" filled v-model="data.StudentScore" label="得分:"
maxlength="20" @input="getQuestionScore" />
<span v-else class="v_shortAnswerQuestionBold">考生得分:{{data.StudentScore}}</span>
</div>
......
......@@ -5,6 +5,7 @@
.v_singleQuestionBold {
font-weight: bold;
height:40px;
}
</style>
......@@ -41,18 +42,21 @@
:style="{color:data.Answer ==data.StundetAnswer?'#67c23a':'red'}">考生答案:{{data.StundetAnswer}}</td>
</tr>
<tr v-if="isShowStudentAnswer">
<td colspan="2">
<q-input v-if="isEditStudentScore" standout="bg-primary text-white" v-model="data.StudentScore" label="得分:"
<td colspan="2" style="height:70px;">
<q-input v-if="isEditStudentScore" filled v-model="data.StudentScore" label="得分:"
maxlength="20" @input="getQuestionScore" />
<span v-else class="v_singleQuestionBold">考生得分:{{data.StudentScore}}</span>
</td>
</tr>
<tr>
<td colspan="2">
<div style="display:flex;">
<span class="v_singleQuestionBold">
解析:
</span>
<span v-html="data.AnswerParse"></span></td>
<span v-html="data.AnswerParse"></span>
</div>
</td>
</tr>
</tfoot>
</table>
......
......@@ -56,12 +56,14 @@
<tr>
<td>
<template v-for="(item,index) in data.QuestionContentObj[1]">
<select v-model="item.Name" class="selectBox" :key="index">
<template v-for="(cItem,cIndex) in data.QuestionContentObj[0]">
<option :key="cIndex" :label="cItem.Name" :value="cItem.Name">
</option>
</template>
</select>
<el-select v-model="item.Name" :key="index" style="width:100px;margin-right:20px;" size="small" placeholder="请选择">
<el-option
v-for="(cItem,cIndex) in data.QuestionContentObj[0]"
:key="cIndex"
:label="cItem.Name"
:value="cItem.Name">
</el-option>
</el-select>
</template>
</td>
</tr>
......
......@@ -13,7 +13,8 @@
padding: 20px;
margin-bottom: 25px;
}
.addPhase .bold{
.addPhase .bold {
font-weight: 760;
font-size: 16px;
color: #333;
......@@ -31,51 +32,39 @@
<div class="bold">名称</div>
<q-input clearable debounce filled maxlength="20" counter v-model="addMsg.FlowName" style="width:600px"
@input="$forceUpdate()" placeholder="名称" :rules="[val => !!val || '不能为空']" />
</div>
<div class="box">
<div class="bold">阶段适用范围</div>
<q-btn class="q-mr-md" label="选择部门/成员" @click="outerVisible = true" />
</div>
<div class="box">
<div class="bold">选择使用阶段</div>
<div style="display:flex;align-items: center;">
</div>
</div>
<div v-if="StageList">
<div class="box" v-for="(x,y) in StageList" v-if="x.Type==2">
<div class="bold" v-if="x.Name=='已输单'">选择输单原因</div>
<div class="bold" v-if="x.Name=='无效'">选择无效原因</div>
<div style="display:flex;align-items: center;flex-wrap: wrap;">
<q-checkbox v-model="addMsg.LoseCause" v-if="x.Name=='已输单'"
v-for="(item,index) in x.OptionsList" :key='index' :val="item.Id"
:label="item.Name" />
<q-checkbox v-model="addMsg.InvalidCause" v-if="x.Name=='无效'"
v-for="(item,index) in x.OptionsList" :key='index' :val="item.Id"
:label="item.Name" />
<q-checkbox v-model="addMsg.LoseCause" v-if="x.Name=='已输单'" v-for="(item,index) in x.OptionsList" :key='index'
:val="item.Id" :label="item.Name" />
<q-checkbox v-model="addMsg.InvalidCause" v-if="x.Name=='无效'" v-for="(item,index) in x.OptionsList"
:key='index' :val="item.Id" :label="item.Name" />
</div>
</div>
</div>
<div class="box">
<el-form label-width="120px">
</el-form>
<q-card-actions align="left" class="bg-white" >
<q-btn color="accent" class="q-mr-md" label="保存" @click="savemove()" style="width: 100px;"
:loading="loading" />
<q-card-actions align="left" class="bg-white">
<q-btn color="accent" class="q-mr-md" label="保存" @click="savemove()" style="width: 100px;" :loading="loading" />
<q-btn class="q-mr-md" label="返回" @click="goblck()" style="width: 60px;" />
</q-card-actions>
</div>
<!-- 人员/部门选择 -->
<choiceapprovalorbranch v-if="outerVisible" @close="outerVisible = false" @success="getsuccess2" :byval='showMember' cptype="1"></choiceapprovalorbranch>
<choiceapprovalorbranch v-if="outerVisible" @close="outerVisible = false" @success="getsuccess2" :byval='showMember'
cptype="1"></choiceapprovalorbranch>
</div>
</template>
......@@ -97,48 +86,38 @@
data() {
return {
loading: false,
outerVisible:false,
addMsg:{
FlowName:'',
DeptEmpList:[],
UseStage:'',
LoseCause:[],
InvalidCause:[],
outerVisible: false,
addMsg: {
FlowName: '',
DeptEmpList: [],
UseStage: '',
LoseCause: [],
InvalidCause: [],
},
showMember:[],
StageList:[],
showMember: [],
StageList: [],
}
},
created() {
this.getCustomerStageList()
},
methods: {
goblck() {//返回上一个页面
this.$router.go(-1);//返回上一层
},
savemove(){
goblck() { //返回上一个页面
this.$router.go(-1); //返回上一层
},
getCustomerStageList(){
savemove() {},
getCustomerStageList() {
getCustomerStageList({}).then(res => {
this.loading = false
if (res.Code == 1) {
this.StageList = res.Data
}
})
},
getsuccess2(list,type){
console.log(list)
getsuccess2(list, type) {
this.showMember = list
this.outerVisible = false
},
}
}
</script>
\ No newline at end of file
<template>
<div class="addfield" style="padding: 0;margin: 0;">
<q-dialog v-model="Isadd" persistent>
<q-card style="width: 700px; max-width: 80vw;">
<q-card-section>
......@@ -9,72 +8,61 @@
<q-separator />
<q-card-section class="q-pt-none" style="margin-top: 15px;">
<q-splitter v-model="splitterModel">
<template v-slot:before>
<q-tabs v-model="tab" vertical @input="getdefault">
<q-tab v-for="(x,y) in tabsList" :key='y' :name="x.Id" :label="x.Name"
:disable="x.disable" />
<q-tab v-for="(x,y) in tabsList" :key='y' :name="x.Id" :label="x.Name" :disable="x.disable" />
</q-tabs>
</template>
<template v-slot:after>
<div style="height: 100%; width: 100%;padding: 16px">
<el-form label-width="120px">
<el-form-item label="字段名称:">
<q-input clearable filled maxlength="8" counter v-model="addMsg.Name"
@input="$forceUpdate()" label="字段名称" :rules="[val => !!val || '请输入字段名称']" />
<q-input clearable filled maxlength="8" counter v-model="addMsg.Name" @input="$forceUpdate()"
label="字段名称" :rules="[val => !!val || '请输入字段名称']" />
</el-form-item>
<el-form-item label="部门选择:">
<q-radio v-model="departmentType" val="1" label="公司字段"
@input='addMsg.DeptId=0' />
<q-radio v-model="departmentType" val="2" label="部门字段"
@input='addMsg.DeptId=0' />
<q-radio v-model="departmentType" val="1" label="公司字段" @input='addMsg.DeptId=0' />
<q-radio v-model="departmentType" val="2" label="部门字段" @input='addMsg.DeptId=0' />
<div v-if="departmentType==2">
<selectTree :treeData='deptl' :defaultArray="returnString"
nodeKey="DeptId" :multiple="false" labelKey="DeptName"
childrenKey="ChildList" tipText="选择部门" @getChild="getChild"
<selectTree :treeData='deptl' :defaultArray="returnString" nodeKey="DeptId" :multiple="false"
labelKey="DeptName" childrenKey="ChildList" tipText="选择部门" @getChild="getChild"
classStr="col-6 q-pb-lg">
</selectTree>
</div>
</el-form-item>
<el-form-item label="字数限制:" v-if='tab==1'>
<q-input v-model.number="addMsg.WordNum" :rules="[val => !!val || '不能为空']"
type="number" filled :max='50' :min='0' style="max-width: 200px" />
<q-input v-model.number="addMsg.WordNum" :rules="[val => !!val || '不能为空']" type="number" filled
:max='50' :min='0' style="max-width: 200px" />
</el-form-item>
<el-form-item label="输入类型:" v-if='tab==1'>
<div class="q-gutter-sm">
<q-checkbox v-model="addMsg.InputType"
v-for="(x,y) in checkboxList" :key='y' :val="x.Id"
<q-checkbox v-model="addMsg.InputType" v-for="(x,y) in checkboxList" :key='y' :val="x.Id"
:label="x.Name" />
</div>
</el-form-item>
<el-form-item label="文字字数:" v-if='tab==2'>
<el-input-number v-model="addMsg.WordNum" @change="handleChange" :min="1"
:max="2000"></el-input-number>
<el-input-number v-model="addMsg.WordNum" @change="handleChange" :min="1" :max="2000">
</el-input-number>
</el-form-item>
<el-form-item label="列表选项:" v-if='tab==3|| tab==4'>
<draggable v-model="addMsg.OptionsList">
<div v-for="(x,y) in addMsg.OptionsList" :key='y' style="display: flex;align-items: center;margin-bottom: 10px;">
<div v-for="(x,y) in addMsg.OptionsList" :key='y'
style="display: flex;align-items: center;margin-bottom: 10px;">
<i class="iconfont icon-weiyi" style="font-size: 14px;color: #777;margin-right: 10px;"></i>
<q-input clearable filled maxlength="16" v-model="x.Name" style="width: 280px;" @input="$forceUpdate()" label="列表项值" />
<q-btn round size="xs" color="deep-orange" icon="delete" v-if="addMsg.OptionsList.length>1" @click="addMsg.OptionsList.splice(y,1)" style='margin-left: 10px;'/>
<q-btn round size="xs" color="primary" icon="add" v-if="addMsg.OptionsList.length==y+1" @click="addMsg.OptionsList.push({Id:0,Name:''})" style='margin-left: 10px;'/>
<q-input clearable filled maxlength="16" v-model="x.Name" style="width: 280px;"
@input="$forceUpdate()" label="列表项值" />
<q-btn round size="xs" color="deep-orange" icon="delete" v-if="addMsg.OptionsList.length>1"
@click="addMsg.OptionsList.splice(y,1)" style='margin-left: 10px;' />
<q-btn round size="xs" color="primary" icon="add" v-if="addMsg.OptionsList.length==y+1"
@click="addMsg.OptionsList.push({Id:0,Name:''})" style='margin-left: 10px;' />
</div>
</draggable>
</el-form-item>
<el-form-item label="小数位数:" v-if='tab==7'>
<q-select filled stack-label option-value="Id" option-label="Id"
v-model="addMsg.Digits" ref="Id" :options="decimalslist" label="小数位数"
:dense="false" emit-value map-options />
<q-select filled stack-label option-value="Id" option-label="Id" v-model="addMsg.Digits" ref="Id"
:options="decimalslist" label="小数位数" :dense="false" emit-value map-options />
</el-form-item>
<el-form-item label="属性设置:">
<div class="q-gutter-sm">
<q-toggle v-model="addMsg.Required" label="必填项" :true-value="1" :false-value="2" />
......@@ -89,35 +77,33 @@
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn class="q-mr-md" label="取消" @click="getcancel()" />
<q-btn color="accent" class="q-mr-md" label="确定" @click="savewb()" :loading="loading"/>
<q-btn color="accent" class="q-mr-md" label="确定" @click="savewb()" :loading="loading" />
</q-card-actions>
</q-card>
</q-dialog>
</div>
</template>
<script>
import draggable from "vuedraggable"
import selectTree from '../../../../../components/common/select-tree'
import {
setCustomerFiledInfo
} from '../../../../../api/system/wechat'
const defaultObj = {
Id:0,
Type:1,
Name:'',
Required:2,
DeptId:0,
WordNum:1,
InputType:[],
OptionsList:[{Id:1,Name:''}],
Digits:0,
Enable:1,
Id: 0,
Type: 1,
Name: '',
Required: 2,
DeptId: 0,
WordNum: 1,
InputType: [],
OptionsList: [{
Id: 1,
Name: ''
}],
Digits: 0,
Enable: 1,
}
export default {
......@@ -131,80 +117,98 @@
type: Object,
default: {},
},
deptl:{
deptl: {
type: Array,
default: [],
},
tabsList:{
tabsList: {
type: Array,
default: [],
},
checkboxList:{
checkboxList: {
type: Array,
default: [],
},
},
data() {
return {
loading:false,
loading: false,
Isadd: true,
splitterModel: 13,
tab: 1,
departmentType:'1',
decimalslist: [{ Id: 0 }, { Id: 1 }, { Id: 2 }, { Id: 3 }, { Id: 4 }, { Id: 5 }, { Id: 6 }, { Id: 7 }, { Id: 8 }, { Id: 9 }, { Id: 10 }, { Id: 11 },],
addMsg: Object.assign({},defaultObj),
departmentType: '1',
decimalslist: [{
Id: 0
}, {
Id: 1
}, {
Id: 2
}, {
Id: 3
}, {
Id: 4
}, {
Id: 5
}, {
Id: 6
}, {
Id: 7
}, {
Id: 8
}, {
Id: 9
}, {
Id: 10
}, {
Id: 11
}, ],
addMsg: Object.assign({}, defaultObj),
returnString: [], //默认岗位
}
},
created() {
this.Isadd = true
if (this.obj != null) {//编辑的时候数据处理
let data={ Id:this.obj.Id,
Type:this.obj.Type,
Name:this.obj.Name,
Required:this.obj.Required,
DeptId:this.obj.DeptId,
WordNum:this.obj.WordNum,
InputType:this.obj.InputType.split(',').map(Number),
OptionsList:this.obj.OptionsList,
Digits:this.obj.Digits,
Enable:this.obj.Enable,
if (this.obj != null) { //编辑的时候数据处理
let data = {
Id: this.obj.Id,
Type: this.obj.Type,
Name: this.obj.Name,
Required: this.obj.Required,
DeptId: this.obj.DeptId,
WordNum: this.obj.WordNum,
InputType: this.obj.InputType.split(',').map(Number),
OptionsList: this.obj.OptionsList,
Digits: this.obj.Digits,
Enable: this.obj.Enable,
}
this.tab = this.obj.Type
if(this.obj.DeptId>0){
this.departmentType= '2'
this.returnString= []
setTimeout(()=>{
if (this.obj.DeptId > 0) {
this.departmentType = '2'
this.returnString = []
setTimeout(() => {
this.returnString.push(this.obj.DeptId)
this.$forceUpdate();
},500)
}, 500)
}
this.addMsg = data
this.tabsList.forEach(x=>{
if(x.Id !=data.Type){
x.disable =true
this.tabsList.forEach(x => {
if (x.Id != data.Type) {
x.disable = true
}
})
}else{
this.addMsg.InputType=[]
this.checkboxList.forEach(x=>{
} else {
this.addMsg.InputType = []
this.checkboxList.forEach(x => {
this.addMsg.InputType.push(x.Id)
})
}
},
methods: {
savewb() {
let addMsg = JSON.parse(JSON.stringify(this.addMsg))
addMsg.Type = this.tab//先类型赋值
if(addMsg.Name==''){
addMsg.Type = this.tab //先类型赋值
if (addMsg.Name == '') {
this.$q.notify({
type: 'negative',
message: `请填写字段名称`,
......@@ -212,7 +216,7 @@
})
return
}
if((addMsg.Type==1|| addMsg.Type==2) && addMsg.WordNum==''){
if ((addMsg.Type == 1 || addMsg.Type == 2) && addMsg.WordNum == '') {
this.$q.notify({
type: 'negative',
message: `字数不能为空`,
......@@ -220,7 +224,7 @@
})
return
}
if(this.departmentType==2 && (addMsg.DeptId==0|| addMsg.DeptId=='')){
if (this.departmentType == 2 && (addMsg.DeptId == 0 || addMsg.DeptId == '')) {
this.$q.notify({
type: 'negative',
message: `请选择部门`,
......@@ -228,10 +232,10 @@
})
return
}
if(addMsg.Type==3|| addMsg.Type ==4){
for(let i = 0 ;i< addMsg.OptionsList.length;i++){
if (addMsg.Type == 3 || addMsg.Type == 4) {
for (let i = 0; i < addMsg.OptionsList.length; i++) {
let x = addMsg.OptionsList[i]
if(x.Name==''){
if (x.Name == '') {
this.$q.notify({
type: 'negative',
message: `请填写列表选项值`,
......@@ -239,25 +243,24 @@
})
break
}
addMsg.OptionsList[i].Id = i+1
addMsg.OptionsList[i].Id = i + 1
}
}
if(addMsg.Type==1 ){
if(addMsg.InputType.length==0){
if (addMsg.Type == 1) {
if (addMsg.InputType.length == 0) {
this.$q.notify({
type: 'negative',
message: `至少选择一种输入类型`,
position: 'top'
})
return
}else{
addMsg.InputType= addMsg.InputType.join(',')
} else {
addMsg.InputType = addMsg.InputType.join(',')
}
}else{
addMsg.InputType='1'
} else {
addMsg.InputType = '1'
}
console.log(addMsg)
this.loading = true
setCustomerFiledInfo(addMsg).then(res => {
this.loading = false
......@@ -268,19 +271,14 @@
message: res.Message,
position: 'top'
})
this.$emit('getcancel',2)
this.$emit('getcancel', 2)
}).catch((e) => {
this.loading = false
})
},
getcancel() {
this.$emit('getcancel',1)
this.$emit('getcancel', 1)
},
getChild(deptArray) {
var tempStr = "";
if (deptArray && deptArray != '') {
......@@ -288,13 +286,15 @@
}
this.addMsg.DeptId = tempStr
},
handleChange(value) {
},
getdefault(){//新增的时候初始默认值
this.addMsg = Object.assign({},defaultObj)
this.addMsg.OptionsList=[{Id:0,Name:'',}]//多选和单选的值
getdefault() { //新增的时候初始默认值
this.addMsg = Object.assign({}, defaultObj)
this.addMsg.OptionsList = [{
Id: 0,
Name: '',
}] //多选和单选的值
}
}
}
......
......@@ -7,7 +7,6 @@
.stageManagement .box {
width: 100%;
border-radius: 6px;
background: #fff;
padding: 20px;
......@@ -29,61 +28,51 @@
display: flex;
align-items: center;
margin-top: 24px;
margin-left: 56px;
;margin-bottom: 30px;
margin-left: 56px;;
margin-bottom: 30px;
}
</style>
<template>
<div class="stageManagement" style="background: transparent;">
<div class="box" >
<div class="box">
<div class="bold" style="margin-bottom: 30px;">跟进阶段</div>
<ul v-for="(x,y) in addMsg" :key="y" v-if="x.Type==1">
<div v-if="x.IsDefault==0">
<draggable v-model="x.OptionsList">
<li v-for="(item,index) in x.OptionsList" :key="index" >
<li v-for="(item,index) in x.OptionsList" :key="index">
<div style="width: 57px;">
<i class="iconfont icon-weiyi" style="font-size: 14px;color: #777;margin: 0 10px;"></i>
</div>
<q-input clearable debounce filled maxlength="10" counter v-model="item.Name"
style="width:500px" @input="$forceUpdate()"
placeholder="名称" :rules="[val => !!val || '不能为空']" />
<q-btn flat size="sm" icon="delete" color="negative" class="q-mr-xs" style="margin-left: 10px;"
label="" @click="addMsg[y].OptionsList.splice(index,1)" />
<q-input clearable debounce filled maxlength="10" counter v-model="item.Name" style="width:500px"
@input="$forceUpdate()" placeholder="名称" :rules="[val => !!val || '不能为空']" />
<q-btn flat size="sm" icon="delete" color="negative" class="q-mr-xs" style="margin-left: 10px;" label=""
@click="addMsg[y].OptionsList.splice(index,1)" />
</li>
</draggable>
<div class="btn">
<q-btn v-if="x.OptionsList.length<30" color="accent" class="q-mr-md" label="添加" icon='add'
@click="addMsg[y].OptionsList.push({Id:0,Name:'',disable:false}),$forceUpdate()"
style="width: 100px;" />
@click="addMsg[y].OptionsList.push({Id:0,Name:'',disable:false}),$forceUpdate()" style="width: 100px;" />
<span style="color:#858598"> 已设/可设上限:{{x.OptionsList.length}}/30 </span>
</div>
</div>
<div v-if="x.IsDefault==1">
<li v-for="(item,index) in x.OptionsList" :key="index" >
<li v-for="(item,index) in x.OptionsList" :key="index">
<div style="width: 57px;">
</div>
<q-input clearable debounce filled v-model="item.Name"
style="width:500px" disable @input="$forceUpdate()"
<q-input clearable debounce filled v-model="item.Name" style="width:500px" disable @input="$forceUpdate()"
placeholder="名称" :rules="[val => !!val || '不能为空']" />
</li>
</div>
</ul>
</div>
<div class="box">
<div class="bold">结束跟进</div>
<div v-for="(x,y) in addMsg" :key="y" v-if="x.Type==2">
<ul style="margin-left: 30px;margin-top: 10px;">
<li>
<q-input clearable filled debounce placeholder="名称" v-model="x.Name" style="width:500px"
disable />
<q-input clearable filled debounce placeholder="名称" v-model="x.Name" style="width:500px" disable />
</li>
<li class="bold" style="margin: 10px 0 30px;" v-if="x.Name=='已输单'">输单原因</li>
<li class="bold" style="margin: 10px 0 30px;" v-if="x.Name=='无效'">无效原因</li>
......@@ -92,38 +81,28 @@
<div style="width: 31px;">
<i class="iconfont icon-weiyi" style="font-size: 14px;color: #777;margin: 0 10px;"></i>
</div>
<q-input clearable debounce filled maxlength="10" counter v-model="item.Name"
style="width:500px" @input="$forceUpdate()" placeholder="名称"
:rules="[val => !!val || '不能为空']" />
<q-btn flat size="sm" icon="delete" color="negative" class="q-mr-xs"
style="margin-left: 10px;" label="" @click="addMsg[y].OptionsList.splice(index,1)" />
<q-input clearable debounce filled maxlength="10" counter v-model="item.Name" style="width:500px"
@input="$forceUpdate()" placeholder="名称" :rules="[val => !!val || '不能为空']" />
<q-btn flat size="sm" icon="delete" color="negative" class="q-mr-xs" style="margin-left: 10px;" label=""
@click="addMsg[y].OptionsList.splice(index,1)" />
</li>
</draggable>
</ul>
<div class="btn" style="margin-left: 61px">
<q-btn v-if="x.OptionsList.length<30" color="accent" class="q-mr-md" label="添加" icon='add'
@click="addMsg[y].OptionsList.push({Id:0,Name:'',disable:false}),$forceUpdate()"
style="width: 100px;" />
@click="addMsg[y].OptionsList.push({Id:0,Name:'',disable:false}),$forceUpdate()" style="width: 100px;" />
<span style="color:#858598"> 已设/可设上限:{{x.OptionsList.length}}/30 </span>
</div>
</div>
</div>
<div class="box">
<el-form label-width="120px">
</el-form>
<q-card-actions align="left" class="bg-white">
<q-btn color="accent" class="q-mr-md" label="保存" @click="savemove()" style="width: 100px;"
:loading="loading" />
<q-btn color="accent" class="q-mr-md" label="保存" @click="savemove()" style="width: 100px;" :loading="loading" />
<q-btn class="q-mr-md" label="返回" @click="goblck()" style="width: 60px;" />
</q-card-actions>
</div>
</div>
</template>
......@@ -140,7 +119,6 @@
components: {
draggable,
},
name: "stageManagement",
data() {
return {
......@@ -150,8 +128,6 @@
},
created() {
this.getList()
},
methods: {
getList() {
......@@ -161,60 +137,103 @@
this.addMsg = res.Data
let num = 0
let isexistence = false
let orderEntered = false//判读是否有已输单
let invalid = false//无效
let orderEntered = false //判读是否有已输单
let invalid = false //无效
this.addMsg.forEach(x => {
if (x.Type == 1) {
num++
if (x.OptionsList && x.OptionsList.length > 0) {
for (let j = 0; j < x.OptionsList.length; j++) {
let z = x.OptionsList[j]
if(z.Name=='成交'){//判断是否有默认值
isexistence=true
if (z.Name == '成交') { //判断是否有默认值
isexistence = true
break
}
}
}
}
if(x.Type == 2){
if(x.Name=='已输单'){
if (x.Type == 2) {
if (x.Name == '已输单') {
orderEntered = true
}
if(x.Name=='无效'){
if (x.Name == '无效') {
invalid = true
}
}
})
if(num==0 ){//判断没有type==1的时候加2条数据
let obj = [
{Id:0,IsDefault:0,Name:'跟进阶段',OptionsList:[],Sort:0,Type:1},
{Id:0,IsDefault:1,Name:'跟进阶段',OptionsList:[{Id:0,Name:'成交'},{Id:0,Name:'多次成交'},],Sort:0,Type:1},
if (num == 0) { //判断没有type==1的时候加2条数据
let obj = [{
Id: 0,
IsDefault: 0,
Name: '跟进阶段',
OptionsList: [],
Sort: 0,
Type: 1
},
{
Id: 0,
IsDefault: 1,
Name: '跟进阶段',
OptionsList: [{
Id: 0,
Name: '成交'
}, {
Id: 0,
Name: '多次成交'
}, ],
Sort: 0,
Type: 1
},
]
this.addMsg = this.addMsg.concat(obj)
}
if(num>0 && isexistence==false){//判断type==1有 但是没有默认值
let obj = {Id:0,IsDefault:1,Name:'跟进阶段',OptionsList:[{Id:0,Name:'成交'},{Id:0,Name:'多次成交'},],Sort:0,Type:1};
if (num > 0 && isexistence == false) { //判断type==1有 但是没有默认值
let obj = {
Id: 0,
IsDefault: 1,
Name: '跟进阶段',
OptionsList: [{
Id: 0,
Name: '成交'
}, {
Id: 0,
Name: '多次成交'
}, ],
Sort: 0,
Type: 1
};
this.addMsg.unshift(obj)
}
if(orderEntered == false){//没有的话 加一个已输单
let obj = {Id:0,IsDefault:0,Name:'已输单',OptionsList:[],Sort:0,Type:2};
if (orderEntered == false) { //没有的话 加一个已输单
let obj = {
Id: 0,
IsDefault: 0,
Name: '已输单',
OptionsList: [],
Sort: 0,
Type: 2
};
this.addMsg.push(obj)
}
if(invalid == false){//没有的话 加一个无效
let obj = {Id:0,IsDefault:0,Name:'无效',OptionsList:[],Sort:0,Type:2};
if (invalid == false) { //没有的话 加一个无效
let obj = {
Id: 0,
IsDefault: 0,
Name: '无效',
OptionsList: [],
Sort: 0,
Type: 2
};
this.addMsg.push(obj)
}
}
})
},
goblck() {//返回上一个页面
this.$router.go(-1);//返回上一层
goblck() { //返回上一个页面
this.$router.go(-1); //返回上一层
},
savemove() {
console.log(this.addMsg)
let show = false
for (let i = 0; i < this.addMsg.length; i++) {
let x = this.addMsg[i]
......@@ -251,15 +270,10 @@
position: 'top'
})
this.goblck()
}).catch((e) => {
this.loading = false
})
},
}
}
</script>
\ No newline at end of file
......@@ -241,16 +241,19 @@
.examPaperInfo_Top .vClozeQuestion .clozeTest_question_tit {
margin: 15px 0;
}
.Exam_PaperNameV2{
font-size:20px;
font-weight: bold;
margin-bottom:5px;
}
</style>
<template>
<div class="examPaper page-body">
<div class="examPaperInfo_Top">
<div>
<div>
{{DataObj.PaperName}} <br />
题量:{{examNum}} &nbsp;&nbsp;&nbsp; 满分:{{examScore}}
<div class="Exam_PaperNameV2">{{DataObj.PaperName}}</div>
<div>题量:{{examNum}} &nbsp;&nbsp;&nbsp; 满分:{{examScore}}</div>
</div>
</div>
<div style="width:20%;text-align:right;">
......@@ -264,11 +267,13 @@
<div class="pGNameDiv"><span class="pGroupName">{{NoToChinese(gIndex+1)}}{{gItem.GroupName}}</span> (共
{{gItem.DetailsList.length}} 题,{{gItem.GScore}}分)</div>
<div v-for="(dItem,dIndex) in gItem.DetailsList" :key="dIndex">
<div style="display:flex;margin:10px 0;">
<span>{{dIndex+1}}</span>
<span class="paper_Title" v-html="dItem.Title"></span>
<span style="margin:10px 0;display:inline-block;">
<span style="margin-left:10px;display:inline-block;">
({{dItem.Score}}分)
</span>
</div>
<!--单选题-->
<v-single v-if="dItem.QuestionTypeKey=='single'||dItem.QuestionTypeKey=='single-number'"
:questionObj="dItem" :isShowAnswer="isShowAnswer" :isOperate="isOperate">
......
<style>
.examPaperInfo_Top {
height: 83px;
min-height: 83px;
border-bottom: 1px solid #d9d9d9;
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 100px;
padding-bottom:15px;
}
.Exam-main {
......@@ -241,7 +241,14 @@
.examPaperInfo_Top .vClozeQuestion .clozeTest_question_tit {
margin: 15px 0;
}
.Exam_PaperNameV2{
font-size:20px;
font-weight: bold;
margin-bottom:5px;
}
.pGNameDiv:first-child{
margin-top:0;
}
</style>
<!--阅卷-->
<template>
......@@ -249,14 +256,15 @@
<div class="examPaperInfo_Top">
<div>
<div>
{{DataObj.PaperName}} <br />
题量:{{examNum}} &nbsp;&nbsp;&nbsp; 满分:{{examScore}}
<br />
学生总得分:{{studentScore}}<br />
<div class="Exam_PaperNameV2">{{DataObj.PaperName}}</div>
<div>
<span>题量:{{examNum}} &nbsp;&nbsp;&nbsp; 满分:{{examScore}} </span>
<span style="margin-left:30px;">学生总得分:{{studentScore}}</span>
</div>
评语:{{DataObj.StuComment}} <br/>
</div>
</div>
<div style="width:20%;text-align:right;">
<div style="width:20%;text-align:right;flex-shrink:0;">
<q-btn color="accent" size="sm" class="q-mr-md" @click="goBack()" label="返回" />
</div>
</div>
......
<style>
.examPaperInfo_Top {
height: 83px;
min-height: 83px;
border-bottom: 1px solid #d9d9d9;
display: flex;
align-items: center;
justify-content: space-between;
margin: 0 100px;
padding-bottom:20px;
}
.Exam-main {
......@@ -241,20 +241,25 @@
.examPaperInfo_Top .vClozeQuestion .clozeTest_question_tit {
margin: 15px 0;
}
.Exam_PaperNameV2{
font-size:20px;
font-weight: bold;
margin-bottom:5px;
}
</style>
<!--阅卷-->
<template>
<div class="examPaper page-body">
<div class="examPaperInfo_Top">
<div style="width:80%;">
<div>
<div>
{{DataObj.PaperName}} <br />
<div class="Exam_PaperNameV2">{{DataObj.PaperName}}</div>
<div style="margin-bottom:10px;">
题量:{{examNum}} &nbsp;&nbsp;&nbsp; 满分:{{examScore}}
<br />
学生总得分:{{studentScore}}
<q-input filled stack-label maxlength="100" :dense="false" v-model="DataObj.StuComment"
class="col-6 q-pb-lg q-pr-lg" label="评语" />
<span style="margin-left:30px;">学生总得分:{{studentScore}}</span>
</div>
<q-input v-model="DataObj.StuComment" filled type="textarea" placeholder="评语" />
</div>
</div>
<div style="width:20%;text-align:right;">
......
......@@ -98,20 +98,24 @@
<div class="EmpLine_title">
<div class="Emp_Line"></div>
<div>试卷配置</div>
<q-radio v-model="templateMsg.GroupType" :val="1" label="问题类型" @input="getQuestionTypeStaticList" />
<q-radio v-model="templateMsg.GroupType" :val="2" label="题目大类" @input="getQuestionCategoryStaticList" />
</div>
<template v-if="templateMsg.GroupType==1">
<!-- 分割线<br /> -->
<template v-if="templateMsg&&templateMsg.TemplateData&&templateMsg.TemplateData.length>0">
<div v-for="(item,index) in templateMsg.TemplateData" :key="index" class="examTi_List">
<div class="examCreat_Top">
<div>{{item.QuestionTypeName}}</div>
<div><i @click="delQuestion(templateMsg.TemplateData,index)" class="iconfont icon-img_delete_small"></i></div>
<div><i @click="delQuestion(templateMsg.TemplateData,index)" class="iconfont icon-img_delete_small"></i>
</div>
</div>
<div style="padding:0 20px 10px 20px;">
<div class="row">
<q-input filled stack-label maxlength="5" :dense="false" v-model="item.QuestionScore"
class="col-6 q-pb-lg q-pr-lg" label="总分" @keyup.native="checkInteger(item,'QuestionScore')" />
<q-input filled stack-label maxlength="100" :dense="false" v-model="item.QuestionDesc" class="col-6 q-pb-lg"
label="题干信息" />
<q-input filled stack-label maxlength="100" :dense="false" v-model="item.QuestionDesc"
class="col-6 q-pb-lg" label="题干信息" />
</div>
<span>
<q-radio v-model="item.ChooseType" :val="1" label="从题库选题" />
......@@ -138,16 +142,61 @@
</div>
</template>
</span>
</div>
</div>
</template>
<div class="row">
<div class="col-6">
<q-btn-dropdown color="primary" label="添加题型">
<q-list>
<q-item clickable v-close-popup @click="onItemClick(item)" v-for="(item,index) in newQuestionTypeList"
:key="index">
<q-item-section>
<q-item-label>{{item.Name}}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div>
</div>
</template>
<template v-if="templateMsg.GroupType==2">
<!-- 分割线<br /> -->
<template v-if="templateMsg&&templateMsg.TemplateData&&templateMsg.TemplateData.length>0">
<div v-for="(item,index) in templateMsg.TemplateData" :key="index" class="examTi_List">
<div class="examCreat_Top">
<div>{{item.QuestionTypeName}}</div>
<div><i @click="delQuestion(templateMsg.TemplateData,index)" class="iconfont icon-img_delete_small"></i>
</div>
</div>
<div style="padding:0 20px 10px 20px;">
<div class="row">
<q-input filled stack-label maxlength="5" :dense="false" v-model="item.QuestionScore"
class="col-6 q-pb-lg q-pr-lg" label="总分" @keyup.native="checkInteger(item,'QuestionScore')" />
<q-input filled stack-label maxlength="100" :dense="false" v-model="item.QuestionDesc"
class="col-6 q-pb-lg" label="题干信息" />
</div>
<span>
<q-radio v-model="item.ChooseType" :val="1" label="从题库选题" />
<template v-if="item.ChooseType==1">
<span style="position:relative;top:2px;">{{item.QuestionTypeNum}} 道 抽
<el-input style="width:100px;" size="small"
:disabled="templateMsg.TemplateBankIds!=''&&item.QuestionTypeNum<=0" @input="getMaxInput(item)"
v-model="item.ChooseNum" @keyup.native="checkInteger(item,'ChooseNum')" maxlength="5"></el-input>
&nbsp;&nbsp;</span>
</template>
</span>
<br />
<span>
<q-radio v-model="item.ChooseType" :val="3" label="从题库按照分类选题" />
<template v-if="item.ChooseType==3">
<div style="margin:0 0 20px 40px;" v-for="(subItem,subIndex) in item.CategoryList" :key="subIndex">
{{subItem.CategoryName}} (共
{{subItem.QuestionTypeNum}} 道) 抽
<el-input style="width:100px;" size="small" @input="getMaxMiniCategoryInput(subItem)"
@keyup.native="checkInteger(subItem,'ChooseNum')" v-model="subItem.ChooseNum" maxlength="5">
</el-input>
<q-radio v-model="item.ChooseType" :val="2" label="从题库按照难易度选题" />
<template v-if="item.ChooseType==2">
<div style="margin:0 0 20px 40px;" v-for="(subItem,subIndex) in item.ChooseList" :key="subIndex">
{{subItem.DifficultyTypeName}} (共
{{subItem.DifficultyTypeCount}} 道) 抽
<el-input style="width:100px;" size="small"
:disabled="templateMsg.TemplateBankIds!=''&&subItem.DifficultyTypeCount<=0"
@input="getMaxMiniInput(subItem)" @keyup.native="checkInteger(subItem,'ChooseNum')"
v-model="subItem.ChooseNum" maxlength="5"></el-input>
&nbsp;&nbsp;
</div>
</template>
......@@ -157,18 +206,20 @@
</template>
<div class="row">
<div class="col-6">
<q-btn-dropdown color="primary" label="添加题型">
<q-btn-dropdown color="primary" label="添加分类">
<q-list>
<q-item clickable v-close-popup @click="onItemClick(item)" v-for="(item,index) in questionTypeList"
:key="index">
<q-item clickable v-close-popup @click="onCategoryItemClick(item)"
v-for="(item,index) in newQuestionCategoryList" :key="index">
<q-item-section>
<q-item-label>{{item.Name}}</q-item-label>
<q-item-label>{{item.QuestionTypeName}}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div>
</div>
</template>
<div class="row q-mt-lg">
<div class="col-6">
<span>开放状态</span>
......@@ -196,7 +247,8 @@
import {
queryQuestionTypeList,
queryDifficultyType,
queryQuestionCategoryList
queryQuestionTypeStaticList,
queryQuestionCategoryStaticList
} from '../../api/question/question'
import {
savePaperInfo,
......@@ -220,6 +272,7 @@
questionDifficultyTypeList: [], //难易程度列表
//模板数据
templateMsg: {
GroupType: 1, //类型(1-题目类型,2-题目大分类)'
TemplateId: 0, //模板编号
TemplateName: "", //模板名称
TemplateScore: 100, //模板分数
......@@ -234,9 +287,43 @@
ShowBankName: "", //显示题库名称
BankList: [],
questionTypeList: [], //问题列表
quastionCategory: [], //问题大类
saveLoading: false,
QuestionArray: [],
AllquestionTypeList: []
}
},
computed: {
//获取计算后的问题类型(单选题、多选他)
newQuestionTypeList() {
let newArray = JSON.parse(JSON.stringify(this.questionTypeList));
if (newArray && newArray.length > 0) {
if (this.templateMsg.TemplateData && this.templateMsg.TemplateData.length > 0) {
this.templateMsg.TemplateData.forEach(x => {
newArray.forEach((qItem, index) => {
if (x.QuestionTypeId == qItem.QId) {
newArray.splice(index, 1);
}
})
})
}
}
return newArray;
},
//获取计算后的问题分类(读音选择题、汉字选择题等)
newQuestionCategoryList() {
let newArray = JSON.parse(JSON.stringify(this.quastionCategory));
if (newArray && newArray.length > 0) {
if (this.templateMsg.TemplateData && this.templateMsg.TemplateData.length > 0) {
this.templateMsg.TemplateData.forEach(x => {
newArray.forEach((qItem, index) => {
if (x.QuestionTypeId == qItem.QuestionTypeId) {
newArray.splice(index, 1);
}
})
})
}
}
return newArray;
}
},
created() {
......@@ -247,7 +334,8 @@
}
this.getQuestionType();
this.getDifficultyType();
this.getQuestionCategoryList();
this.getQuestionCategoryStaticList();
this.getQuestionTypeStaticList();
},
mounted() {
var timeStr = date.formatDate(Date.now(), "YYYYMMDDHHmmss");
......@@ -266,18 +354,11 @@
item.ChooseNum = item.DifficultyTypeCount;
}
},
//分类
getMaxMiniCategoryInput(item) {
if (item.ChooseNum > item.QuestionTypeNum) {
item.ChooseNum = item.QuestionTypeNum;
}
},
//获取题型列表
getQuestionType() {
queryQuestionTypeList({}).then(res => {
if (res.Code == 1) {
this.questionTypeList = res.Data;
this.AllquestionTypeList = res.Data;
}
});
},
......@@ -314,28 +395,35 @@
})
}
}
this.filterChecked();
},
//过滤已经选中
filterChecked(type) {
var NewData = [];
if (type == 1) {
NewData = JSON.parse(JSON.stringify(this.AllquestionTypeList));
} else {
NewData = JSON.parse(JSON.stringify(this.questionTypeList));
//添加分类
onCategoryItemClick(myObj) {
var newObj = this.createdTempObj();
if (myObj) {
newObj.QuestionTypeId = myObj.QuestionTypeId;
newObj.QuestionTypeKey = myObj.QuestionTypeKey;
newObj.QuestionTypeName = myObj.QuestionTypeName;
}
let newArray = [];
if ((this.templateMsg.TemplateData && this.templateMsg.TemplateData.length > 0) && (NewData && NewData.length >
0)) {
this.templateMsg.TemplateData.forEach(x => {
NewData.forEach((y, index) => {
if (x.QuestionTypeId == y.QId) {
NewData.splice(index, 1);
//获取题库中的题型
var chooseQuestion = this.BankList.find((item) => {
return item.QuestionTypeId === myObj.QuestionTypeId;
});
//题库中有此题型
if (chooseQuestion) {
newObj.QuestionTypeNum = chooseQuestion.QuestionTypeNum;
newObj.ChooseList = chooseQuestion.ChooseList;
}
if (newObj && newObj.QuestionTypeId > 0) {
if (!this.checkExists(newObj.QuestionTypeId)) {
this.templateMsg.TemplateData.push(newObj);
} else {
this.$q.notify({
type: 'negative',
position: "top",
message: `已存在此题型,请勿重复选择!`
})
})
}
this.questionTypeList = NewData;
}
},
//创建模板对象
createdTempObj() {
......@@ -367,7 +455,6 @@
ChooseNum: 0
}
],
CategoryList: []
}
return newObj;
},
......@@ -385,12 +472,37 @@
}
return isExists;
},
//获取题库题目分类列表
getQuestionCategoryList() {
//获取题目(汉字选择题、读音选择题等)列表
getQuestionCategoryStaticList() {
var qMsg = {
QBankIds: this.templateMsg.TemplateBankIds
}
queryQuestionCategoryList(qMsg).then(res => {
this.BankList = [];
this.templateMsg.TemplateData = [];
queryQuestionCategoryStaticList(qMsg).then(res => {
if (res.Code == 1) {
var tempArray = res.Data;
if (tempArray && tempArray.length > 0) {
this.quastionCategory = tempArray;
this.BankList = tempArray;
tempArray.forEach(item => {
//默认添加【单选题,多选题、填空题,单选题(数字)】
if (item.QuestionTypeId == 1 || item.QuestionTypeKey == 2) {
this.templateMsg.TemplateData.push(item);
}
})
}
}
});
},
//获取题库题目题型(单选题、多选题等)列表
getQuestionTypeStaticList() {
var qMsg = {
QBankIds: this.templateMsg.TemplateBankIds
}
this.BankList = [];
this.templateMsg.TemplateData = [];
queryQuestionTypeStaticList(qMsg).then(res => {
if (res.Code == 1) {
var tempArray = res.Data;
if (tempArray && tempArray.length > 0) {
......@@ -421,14 +533,6 @@
},
//显示试卷模板
showExamTemplate() {
// if (this.templateMsg.TemplateBankIds == '') {
// this.$q.notify({
// type: 'negative',
// position: "top",
// message: `请先选择题库`
// })
// return;
// }
this.isShowExamTemplate = true;
},
//关闭题库
......@@ -456,7 +560,6 @@
}
this.templateMsg.TemplateBankIds = qBankIds;
this.ShowBankName = sBankName;
this.getQuestionCategoryList();
},
//获取模板数据
getTemplateData(tempObj) {
......@@ -466,6 +569,7 @@
this.templateMsg.TemplateNum = tempObj.TemplateNum;
this.templateMsg.TemplateScore = tempObj.TemplateScore;
this.templateMsg.TemplateDifficultyType = tempObj.TemplateDifficultyType;
this.templateMsg.GroupType=tempObj.GroupType;
this.templateMsg.TemplateData = [];
var tempData = tempObj.TemplateData;
if (tempData && tempData.length > 0) {
......@@ -489,7 +593,6 @@
newObj.ChooseList = chooseQuestion.ChooseList;
}
this.templateMsg.TemplateData.push(newObj);
this.filterChecked();
});
}
}
......@@ -598,7 +701,6 @@
cancel: "取消",
}).onOk(() => {
item.splice(index, 1);
this.filterChecked(1);
}).onCancel(() => {});
}
}
......
......@@ -21,7 +21,7 @@
border-radius: 3px;
border: 1px solid #d9d9d9;
background: #f0f0f0;
padding-top: 20px;
padding-top: 10px;
padding-bottom: 0px;
}
......@@ -41,7 +41,7 @@
.Left-ptitel {
font-size: 14px;
color: #777;
padding-left: 18px;
padding-left: 5px;
}
.Left-ptitel span {
......@@ -124,7 +124,7 @@
background: #fdfdfd;
font-size: 14px;
line-height: 40px;
padding-left: 10px;
/* padding-left: 10px; */
}
.List-bt i {
......@@ -251,6 +251,7 @@
overflow: hidden;
text-overflow: ellipsis;
margin-right: 5px;
cursor: pointer;
}
.paperEdit_Top {
......@@ -264,24 +265,40 @@
font-weight: normal;
}
.checkedExam {
background: #9cf !important;
}
</style>
<template>
<div class="examPaper page-body">
<div class="examPaper_Top">
<div style="width:80%;display:flex;">
<div style="width:36%;margin-right:20px;">
<div style="width:90%;display:flex;">
<div style="width:32%;margin-right:20px;">
<q-input filled label="标题" v-model="DataObj.PaperName" />
</div>
<div style="width:24%;">
<div style="width:20%;">
<q-select filled option-value="Id" option-label="Name" :options="questionDifficultyTypeList" emit-value
map-options label="难度" use-input clearable v-model="DataObj.DifficultyType" />
</div>
<div style="margin:8px 0 0 20px">
<q-radio v-model="DataObj.IsOpen" :val="1" label="私有" />
<q-radio v-model="DataObj.IsOpen" :val="2" label="公开" />
<div style="margin-left:20px;">
<q-field label="组卷类型" stack-label borderless>
<template v-slot:control>
<q-radio v-model="DataObj.GroupType" :val="1" label="问题类型" />
<q-radio v-model="DataObj.GroupType" :val="2" label="题目大类" />
</template>
</q-field>
</div>
<div style="margin-left:20px;">
<q-field label="访问设置" stack-label borderless>
<template v-slot:control>
<q-radio v-model="DataObj.IsOpen" :val="1" label="私有" title="只能自己查看" />
<q-radio v-model="DataObj.IsOpen" :val="2" label="公开" title="所有人均可见" />
</template>
</q-field>
</div>
</div>
<div style="width:20%;text-align:right;">
<div style="width:10%;text-align:right;">
<q-btn color="accent" size="sm" class="q-mr-md" label="预览" style="display:none;" />
<q-btn color="accent" size="sm" class="q-mr-md" label="保存并返回" :loading="savePaperLoading"
@click="SavePaper()" />
......@@ -289,23 +306,49 @@
</div>
<div class="Exam-main">
<div class="Exam-left f1">
<p class="Left-ptitel">
<div style="display:flex;justify-content:space-between;align-items:center;padding:0 10px 10px 5px;height:36px;">
<div class="Left-ptitel">
<span>题量:<i>{{examNum}}</i></span>
<span>  总分:<i>{{examScore.toFixed(2)}}</i></span>
</p>
<span>&nbsp;&nbsp;总分:<i>{{examScore.toFixed(2)}}</i></span>
</div>
<div v-if="DataObj.GroupType==2">
<q-btn-dropdown color="primary" label="添加分类" size="sm">
<q-list>
<q-item clickable v-close-popup @click="onCategoryItemClick(item)"
v-for="(item,index) in newQuestionCategoryList" :key="index">
<q-item-section>
<q-item-label>{{item.Name}}</q-item-label>
</q-item-section>
</q-item>
</q-list>
</q-btn-dropdown>
</div>
</div>
<div class="Left-list">
<template v-if="DataObj&&DataObj.GroupList&&DataObj.GroupList.length>0">
<div class="List-con1" v-for="(gItem,gIndex) in DataObj.GroupList" :key="gIndex">
<div class="List-bt">
<div class="paperEdit_Top">
<div class="paperEdit_Top" :class="{'checkedExam':clickIndex==gIndex}">
<template v-if="!gItem.isShowEdit">
<template v-if="DataObj.GroupType==2">
<div @click="GetGroupItem(gItem,gIndex)" style="display:flex;padding-left:5px;cursor:pointer">
<div>{{gIndex+1}}</div>&nbsp;
<div class="paper_GroupName" :title="gItem.GroupName">{{gItem.GroupName}}</div>
<div>(共{{ gItem.DetailsList?gItem.DetailsList.length:0 }}题,{{gItem.GScore}}分)</div>
</div>
</template>
<template v-else>
<div style="display:flex;padding-left:5px;">
<div>{{gIndex+1}}</div>&nbsp;
<div class="paper_GroupName" :title="gItem.GroupName">{{gItem.GroupName}}</div>
<div>(共{{ gItem.DetailsList?gItem.DetailsList.length:0 }}题,{{gItem.GScore}}分)</div>
</div>
</template>
</template>
<template v-else>
<el-input v-model="gItem.GroupName" size="small" maxlength="50"
style="width:160px;margin-right:10px;"></el-input>
style="width:160px;margin-right:10px;">
</el-input>
<el-input v-model="gItem.GScore" size="small" maxlength="6" style="width:80px;"
@keyup.native="checkPrice(gItem,'GScore')" @change="changeGroupScore(gItem)"></el-input>
</template>
......@@ -575,7 +618,9 @@
PaperType: 2, //试卷类型(1-文件夹,2-试卷)
ParentId: 0, //父节点编号,
GroupList: [], //试卷答题分类
IsOpen: 1 //(1-私有,2-开放)
IsOpen: 1, //(1-私有,2-开放)
GroupType: 1, //组卷类型
PaperScore: 0, //试卷总分数
},
//点击问题对象
ChooseItem: null,
......@@ -594,6 +639,26 @@
ComCheckIndex: -1,
savePaperLoading: false,
isShowPoint: false, //选择知识点
clickGroupItem: null, //选择的分组
clickIndex: -1
}
},
computed: {
//获取计算后的问题分类(读音选择题、汉字选择题等)
newQuestionCategoryList() {
let newArray = JSON.parse(JSON.stringify(this.questionCategoryList));
if (newArray && newArray.length > 0) {
if (this.DataObj.GroupList && this.DataObj.GroupList.length > 0) {
this.DataObj.GroupList.forEach(x => {
newArray.forEach((qItem, index) => {
if (x.QuestionTypeId == qItem.Id) {
newArray.splice(index, 1);
}
})
})
}
}
return newArray;
}
},
created() {
......@@ -619,6 +684,23 @@
}
},
methods: {
GetGroupItem(gItem, gIndex) {
this.clickIndex = gIndex;
this.clickGroupItem = gItem;
},
//添加分类
onCategoryItemClick(qObj) {
this.DataObj.GroupList.push({
GId: 0, //大题分组编号
PaperId: 0, //试卷编号
GroupName: qObj.Name,
QuestionTypeId: qObj.Id,
QuestionTypeKey: "",
GSortNum: 0,
GScore: 0, //分数
DetailsList: [], //问题列表
});
},
//关闭知识点弹窗
closeQuestionPoint() {
this.isShowPoint = false;
......@@ -840,8 +922,7 @@
}
if (qArray && qArray.length > 0) {
qArray.forEach(qItem => {
if (!this.checkGroupExists(qItem.QuestionTypeId)) {
this.DataObj.GroupList.push({
var gObj = {
GId: 0, //大题分组编号
PaperId: 0, //试卷编号
GroupName: qItem.GroupName,
......@@ -850,8 +931,12 @@
GSortNum: 0,
GScore: 0, //分数
DetailsList: [], //问题列表
});
}
//题目类型
if (!this.checkGroupExists(qItem.QuestionTypeId) && this.DataObj.GroupType == 1) {
this.DataObj.GroupList.push(gObj);
}
if (this.DataObj.GroupType == 1) {
this.DataObj.GroupList.forEach((gItem, gIndex) => {
if (gItem.QuestionTypeId == qItem.QuestionTypeId) {
if (!gItem.DetailsList) {
......@@ -860,6 +945,19 @@
gItem.DetailsList.push(qItem);
}
})
}
//题目分类
else if (this.DataObj.GroupType == 2) {
if (!this.clickGroupItem) {
this.$q.notify({
type: 'negative',
position: "top",
message: `请先点击左侧分类!在添加问题`
})
} else {
this.clickGroupItem.DetailsList.push(qItem);
}
}
})
}
}
......@@ -940,6 +1038,7 @@
this.DataObj.PaperType = tempData.PaperType;
this.DataObj.ParentId = tempData.ParentId;
this.DataObj.IsOpen = tempData.IsOpen;
this.DataObj.GroupType = tempData.GroupType;
if (tempData.GroupList && tempData.GroupList.length > 0) {
this.DataObj.GroupList = tempData.GroupList;
}
......@@ -962,6 +1061,9 @@
if (y.QuestionContentObj && y.QuestionContentObj.length > 0) {
y.QuestionContentObj.forEach(qItem => {
var tempClozeScore = 0;
if (!qItem.SubScore) {
qItem.SubScore = 0;
}
if (qItem.SubScore != '') {
tempClozeScore = qItem.SubScore;
}
......@@ -1025,6 +1127,7 @@
//保存题目
SavePaper() {
if (this.validateType()) {
this.DataObj.PaperScore = this.examScore;
this.savePaperLoading = true;
savePaperInfo(this.DataObj).then(res => {
this.savePaperLoading = false;
......
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