Commit 5f4456dd authored by 李苏's avatar 李苏 💬

新增试题管理

parent 006b53a1
# 页面标题 # 页面标题
VUE_APP_TITLE = 陕钢安全管理 VUE_APP_TITLE = 金属科技安全云
# 开发环境配置 # 开发环境配置
ENV = 'http://demo.ruoyi.vip/' ENV = 'http://demo.ruoyi.vip/'
......
# 页面标题 # 页面标题
VUE_APP_TITLE = 陕钢安全管理 VUE_APP_TITLE = 金属科技安全云
# 生产环境配置 # 生产环境配置
ENV = 'production' ENV = 'production'
......
import request from 'common/src/utils/request'
/* 查询 */
export function doQuery(query) {
return request({
url: '/aqgl/pxgl/pxst/query',
method: 'post',
data: query||{}
})
}
/* 更新 */
export function doUpdate(query) {
return request({
url: '/aqgl/pxgl/pxst/update',
method: 'post',
data: query||{}
})
}
export function doAdd(query) {
return request({
url: '/aqgl/pxgl/pxst/add',
method: 'post',
data: query||{}
})
}
export function doDelete(query) {
return request({
url: '/aqgl/pxgl/pxst/delete',
method: 'post',
data: query||{}
})
}
/* 导入试题类型 */
export function pxxmQuery(query) {
return request({
url: '/aqgl/pxgl/pxxm/query',
method: 'post',
data: query||{}
})
}
/* 导入试题 */
export function excelimport(query) {
return request({
'Content-type' : 'multipart/form-data',
url: 'aqgl/pxgl/pxst/excel/import',
method: 'post',
data: query||{}
})
}
...@@ -834,46 +834,48 @@ export const powerRoutes=[ ...@@ -834,46 +834,48 @@ export const powerRoutes=[
name:'trainRecord', name:'trainRecord',
path:"trainRecord" path:"trainRecord"
}, },
// {
// component:'train/onlinExaminations/index',
// hidden:false,
// meta:{
// "title": "在线考试管理",
// "icon": "",
// "noCache": false,
// "link": null,
// "mkid":'test',
// },
// name:'onlinExaminations',
// path:"onlinExaminations"
// },
{ {
component:'train/onlinExaminations/index', component:'train/questionManage/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"),
hidden:false, hidden:false,
meta:{ meta:{
"title": "试题管理", "title": "试题管理",
"icon": "", "icon": "",
"noCache": false, "noCache": false,
"link": null, "link": null,
"mkid":1010013009, "mkid":'906000800',
}, },
name:'questionManage', name:'questionManage',
path:"questionManage" path:"questionManage"
}, },
// {
// component:'train/testPaper/index',
// hidden:false,
// meta:{
// "title": "考试试卷",
// "icon": "",
// "noCache": false,
// "link": null,
// "mkid":'test',
// },
// name:'testPaper',
// path:"testPaper"
// },
/*,
{ {
commonComponent:'paperManagement', commonComponent:'paperManagement',
component:() => import( "@/views/train/paperManagement/index"), component:() => import( "@/views/train/paperManagement/index"),
......
<template>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<!-- 填写表单内容,slot=form必写-->
<el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules">
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="标题" ref="roleid" prop="roleid">
<el-input :readonly="readonly" v-model="form.roleid"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="内容" ref="roleid" prop="roleid">
<el-input :readonly="readonly" type="textarea" v-model="form.roleid"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="有效期至">
<el-date-picker style="width: 100%;"
type="date"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="编制单位">
<el-select placeholder="请选择" style="width: 100%;" >
</el-select>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!-- 按钮重写, -->
<!-- <div slot="reFooter">
<span slot="footer">
重写按钮写在这里,根据需要重写 slot(reFooter,foorer) 节点样式 重写方法需要在此页重新定义
</span>
</div> -->
</RelDialog>
</template>
<script>
import {editMixin} from 'common'
export default {
mixins: [editMixin],
/* 存放index页面传递的额外参数*/
mounted() {
},
/* 组件名称*/
name: 'roleManagementEdit',
/* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/
data() {
return {
/* 额外初始化,根据需求*/
systemType: [],
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: {
roleid: '',
rolename: '',
bz: "",
},
/* form提交时的规则,具体规则参考官网*/
rules: {
roleid: [{
required: true,
trigger: 'blur'
}, ],
rolename: [{
required: true,
trigger: 'blur'
}, ]
}
}
},
methods: {
}
}
</script>
<style scoped lang="scss">
</style>
<template>
<div class="min_full" style="height: 140vh;">
<div class="min_full" style="height: 40%;">
<!-- 查询条件-->
<div class="search" v-condition >
<SearchButton :app='app'></SearchButton>
<el-row :gutter="20" class="search-row-1">
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">类别:</span>
<el-input></el-input>
</div>
</el-col>
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">机型:</span>
<el-input></el-input>
</div>
</el-col>
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">专业:</span>
<el-input></el-input>
</div>
</el-col>
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">岗位:</span>
<el-input></el-input>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="search-row-1">
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">题型:</span>
<el-input></el-input>
</div>
</el-col>
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">考核点:</span>
<el-input></el-input>
</div>
</el-col>
</el-row>
</div>
<!-- 按钮操作-->
<el-row class="tool-bar">
<PrintButton :app='app'></PrintButton>
<ViewButton ref="view" :app='app'></ViewButton>
<AddButton ref="add" :app='app'></AddButton>
<CopyButton ref="copy" :app='app'></CopyButton>
<EditButton ref="edit" :app='app'></EditButton>
<AttachFileButton :app='app'></AttachFileButton>
<FieldButton :app='app'></FieldButton>
<ExcelButton :app='app'></ExcelButton>
<!-- 额外按钮-->
<!-- 表头设置 -->
<!-- 权限-->
</el-row>
<!-- 表格-->
<div class="tablePagers">
<TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem'
@getRow='getRow'>
</TablePager>
</div>
</div>
<div class="min_full" style="height: 60%;padding: 10px;">
<div class="ktstyle" style="padding: 10px;">
<el-form label-width="auto">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="难易度">
<el-select></el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="考核点">
<el-select></el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="分值">
<el-input type="number"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="题目">
<el-input rows="8" type="textarea"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="ktstyle" style="padding: 10px;height: 100px;margin-top: 40px;padding-top: 40px;padding-left: 40px;position: relative;">
<span class="kttitle" style="">
答案
</span>
<el-form label-width="auto">
<el-row :gutter="20">
<el-col :span="4">
<el-radio v-model="radio" label="A">A</el-radio>
</el-col>
<el-col :span="4">
<el-radio v-model="radio" label="B">B</el-radio>
</el-col>
<el-col :span="4">
<el-radio v-model="radio" label="C">C</el-radio>
</el-col>
<el-col :span="4">
<el-radio v-model="radio" label="D">D</el-radio>
</el-col>
<el-col :span="4">
<el-radio v-model="radio" label="E">E</el-radio>
</el-col>
<el-col :span="4">
<el-radio v-model="radio" label="F">F</el-radio>
</el-col>
</el-row>
</el-form>
</div>
</div>
</div>
</template>
<script>
/* 引入需要的接口*/
import {
QueryKzzxRole,
QueryApptype,
AddKzzxRole,
DeleteKzzxRole,
UpdateKzzxRole,
QtKzzxRole
} from "common/src/api/system/dmgSystem.js";
/* edit页面*/
import Edit from './edit'
import Participants from './participants.vue'
import {
tableMixin
} from 'common'
export default {
mixins: [tableMixin],
name: 'appVersion',
/* 初始额外赋值*/
async mounted() {
this.$refs['TablePager'].pageQuery()
},
data() {
return {
radio:'A',
/*需要的额外参数 */
showDialog: false,
DialogName: '',
type: '',
DialogTitle: '',
/* 基础url*/
baseUrl: 'kzzx/role',
/* 查询参数*/
queryParams: {
ksrq: '',
jsrq: ''
},
/* 表格标题对应参数*/
tableTitle: [
{
prop: 'whsj',
label: '机型',
show:false,
fieldType:'ftDateTime',
width: '100',
align:'left'
},
{
prop: 'whsj',
label: '专业',
...this.$common('ftDateTime')
},
{
prop: 'whr',
label: '岗位',
width: '100'
},
{
prop: 'whr',
label: '类别',
width: '100'
},
{
prop: 'whr',
label: '题型',
width: '100'
},
{
prop: 'whr',
label: '难易度',
width: '100'
},
{
prop: 'whr',
label: '考核点',
width: '100'
},
{
prop: 'whr',
label: '分值',
width: '100'
},
{
prop: 'whr',
label: '维护人',
width: '100'
},
{
prop: 'whr',
label: '维护时间',
width: '100'
}
]
}
},
methods: {
handleClick(val){
},
/* 基础查询*/
query: QueryKzzxRole,
/* 基础增*/
apiAdd: AddKzzxRole,
/* 基础更新*/
apiUpdate: UpdateKzzxRole,
/* 删除操作*/
apiDelete: DeleteKzzxRole,
/* 初始化赋值操作*/
init() {
},
/* 启用停用*/
setEnable(id) {
this.$confirm('是否启用/停用该角色, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = {
id: id
}
QtKzzxRole(params).then(res => {
if (res.success) {
this.$success('操作成功')
this.app.$refs['TablePager'].reLoad()
} else {
this.$error(res.message || '操作失败')
}
})
})
}
},
components: {
Edit,
Participants,
}
}
</script>
<style scoped>
/deep/.el-tabs__item {
font-size: 13px;
color: #666;
}
.ktstyle{
width: 70%;margin: 0 auto;border: 1px solid #eee;height: 250px;border-radius: 10px;
}
.kttitle{
position: absolute;left: 10px;top: 10px;font-size: 13px;color: #666;
}
</style>
<template> <template>
<RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'> <RelDialog :type='type' :editApp='editApp' :app='app' :buttonApp='buttonApp'>
<!-- 填写表单内容,slot=form必写--> <!-- 填写表单内容,slot=form必写-->
<el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules"> <el-form slot="form" ref="form" :model="form" label-width="80px" :rules="rules">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="24"> <el-col :span="24">
<el-form-item label="标题" ref="roleid" prop="roleid"> <el-form-item label="题目 " ref="cont" prop="cont">
<el-input :readonly="readonly" v-model="form.roleid"></el-input> <el-input :readonly="readonly" v-model="form.cont" ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> <el-col :span="12">
<el-row :gutter="20"> <el-form-item label="试题类型 " ref="type" prop="type">
<el-col :span="24"> <!-- <el-input :readonly="readonly" v-model="form.type" ></el-input> -->
<el-form-item label="内容" ref="roleid" prop="roleid"> <RelSelect :readonly="readonly" filterable style="width: 100%;" clearable src='aqgl/pxgl/pxst/init/type' :match="{value:'id',label:'name'}" v-model='form.type' ></RelSelect>
<el-input :readonly="readonly" type="textarea" v-model="form.roleid"></el-input> </el-form-item>
</el-form-item> </el-col>
</el-col> <el-col :span="12">
</el-row> <el-form-item label="题库编码" ref="mid" prop="mid">
<el-row :gutter="20"> <!-- <el-input :readonly="readonly" v-model="form.mid" ></el-input> -->
<el-col :span="12"> <RelSelect :readonly="readonly" filterable style="width: 100%;" clearable src='aqgl/pxgl/pxxm/query' :match="{value:'id',label:'name'}" v-model='form.mid' ></RelSelect>
<el-form-item label="有效期至"> </el-form-item>
<el-date-picker style="width: 100%;" </el-col>
type="date"
placeholder="选择日期"> </el-row>
</el-date-picker> <el-row :gutter="20">
</el-form-item> <el-col :span="12">
</el-col> <el-form-item label="选项A" ref="opta" prop="opta">
<el-col :span="12"> <el-input :readonly="readonly" v-model="form.opta" ></el-input>
<el-form-item label="编制单位"> </el-form-item>
<el-select placeholder="请选择" style="width: 100%;" > </el-col>
</el-select> <el-col :span="12">
</el-form-item> <el-form-item label="选项B" ref="optb" prop="optb">
</el-col> <el-input :readonly="readonly" v-model="form.optb" ></el-input>
</el-row> </el-form-item>
</el-form> </el-col>
<!-- 按钮重写, --> <el-col :span="12">
<!-- <div slot="reFooter"> <el-form-item label="选项C" ref="optc" prop="optc">
<span slot="footer"> <el-input :readonly="readonly" v-model="form.optc" ></el-input>
重写按钮写在这里,根据需要重写 slot(reFooter,foorer) 节点样式 重写方法需要在此页重新定义 </el-form-item>
</span> </el-col>
</div> --> <el-col :span="12">
</RelDialog> <el-form-item label="选项D" ref="optd" prop="optd">
<el-input :readonly="readonly" v-model="form.optd" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="选项E" ref="opte" prop="opte">
<el-input :readonly="readonly" v-model="form.opte" ></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="选项F" ref="optf" prop="optf">
<el-input :readonly="readonly" v-model="form.optf" ></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="答案" ref="ans" prop="ans">
<el-input :readonly="readonly" v-model="form.ans" ></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item label="答案描述" ref="desc" prop="desc">
<el-input type="textarea" :readonly="readonly" v-model="form.desc" ></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="备注" ref="bz" prop="bz">
<el-input type="textarea" :readonly="readonly" v-model="form.bz" ></el-input>
</el-form-item>
</el-col>
<!-- <el-col :span="8">
<el-form-item label="系统版本" ref="sysversion" prop="sysversion">
<el-input :readonly="readonly" v-model="form.sysversion" ></el-input>
</el-form-item>
</el-col> -->
</el-row>
</el-form>
</RelDialog>
</template> </template>
<script> <script>
import {editMixin} from 'common' import {editMixin} from 'common'
export default { export default {
mixins: [editMixin], mixins: [editMixin],
/* 存放index页面传递的额外参数*/ /* 存放index页面传递的额外参数*/
mounted() { mounted() {
},
/* 组件名称*/ },
name: 'roleManagementEdit', /* 组件名称*/
/* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/ name: "pxglPxstEdit",
/* 传递props模式一样必填,用于index,button,REdialog之间的组件通信*/
data() {
return {
/* 额外初始化,根据需求*/
systemType: [],
data() { bmList: [],
return {
/* 额外初始化,根据需求*/ /* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
systemType: [], form: {
cont:'',
//ID
id:'',
//试题类型
type:'',
//题库编码
mid:'',
//选项A
opta:'',
//选项B
optb:'',
//选项C
optc:'',
//选项D
optd:'',
//选项E
opte:'',
//选项F
optf:'',
//答案
ans:'',
//答案描述
desc:'',
//备注
bz:'',
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: { },
roleid: '', /* form提交时的规则,具体规则参考官网*/
rolename: '', rules: {
bz: "",
}
}
}, },
/* form提交时的规则,具体规则参考官网*/ methods: {
rules: {
roleid: [{
required: true,
trigger: 'blur'
}, ],
rolename: [{
required: true,
trigger: 'blur'
}, ]
}
}
},
methods: {
}
} }
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
......
<template> <template>
<div class="min_full" style="height: 140vh;"> <div class="min_full">
<!-- 查询条件-->
<div class="min_full" style="height: 40%;"> <Selecter :app='this' v-if="showDialog" ></Selecter>
<div class="search" v-condition>
<!-- 查询条件--> <SearchButton :app='app'></SearchButton>
<div class="search" v-condition > <el-row :gutter="20" class="search-row-1">
<SearchButton :app='app'></SearchButton> <el-col :span="12" class="search-col">
<el-row :gutter="20" class="search-row-1"> <div class="search-item">
<el-col :span="6" class="search-col"> <span class="search-span">名称:</span>
<div class="search-item"> <el-input v-model="queryParams.info"></el-input>
<span class="search-span">类别:</span> </div>
<el-input></el-input> </el-col>
</div> </el-row>
</el-col> </div>
<el-col :span="6" class="search-col"> <!-- 按钮操作-->
<div class="search-item"> <el-row class="tool-bar">
<span class="search-span">机型:</span> <PrintButton :app='app'></PrintButton>
<el-input></el-input> <ViewButton ref="view" :app='app'></ViewButton>
</div> <AddButton ref="add" :app='app'></AddButton>
</el-col> <CopyButton ref="copy" :app='app'></CopyButton>
<el-col :span="6" class="search-col"> <EditButton ref="edit" :app='app'></EditButton>
<div class="search-item"> <!-- <AttachFileButton :app='app' ></AttachFileButton> -->
<span class="search-span">专业:</span> <FieldButton :app='app'></FieldButton>
<el-input></el-input> <ExcelButton :app='app'></ExcelButton>
</div> <el-button size='mini' @click="importst" type="primary">导入试题</el-button>
</el-col> <!-- 额外按钮-->
<el-col :span="6" class="search-col"> <!-- 表头设置 -->
<div class="search-item">
<span class="search-span">岗位:</span> <!-- 权限-->
<el-input></el-input> </el-row>
</div> <!-- 表格-->
</el-col> <div class="tablePagers">
</el-row> <TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem'
<el-row :gutter="20" class="search-row-1"> @getRow='getRow'>
<el-col :span="6" class="search-col"> </TablePager>
<div class="search-item"> </div>
<span class="search-span">题型:</span> </div>
<el-input></el-input>
</div>
</el-col>
<el-col :span="6" class="search-col">
<div class="search-item">
<span class="search-span">考核点:</span>
<el-input></el-input>
</div>
</el-col>
</el-row>
</div>
<!-- 按钮操作-->
<el-row class="tool-bar">
<PrintButton :app='app'></PrintButton>
<ViewButton ref="view" :app='app'></ViewButton>
<AddButton ref="add" :app='app'></AddButton>
<CopyButton ref="copy" :app='app'></CopyButton>
<EditButton ref="edit" :app='app'></EditButton>
<AttachFileButton :app='app'></AttachFileButton>
<FieldButton :app='app'></FieldButton>
<ExcelButton :app='app'></ExcelButton>
<!-- 额外按钮-->
<!-- 表头设置 -->
<!-- 权限-->
</el-row>
<!-- 表格-->
<div class="tablePagers">
<TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem'
@getRow='getRow'>
</TablePager>
</div>
</div>
<div class="min_full" style="height: 60%;padding: 10px;">
<div class="ktstyle" style="padding: 10px;">
<el-form label-width="auto">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="难易度">
<el-select></el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="考核点">
<el-select></el-select>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="分值">
<el-input type="number"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="题目">
<el-input rows="8" type="textarea"></el-input>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
<div class="ktstyle" style="padding: 10px;height: 100px;margin-top: 40px;padding-top: 40px;padding-left: 40px;position: relative;">
<span class="kttitle" style="">
答案
</span>
<el-form label-width="auto">
<el-row :gutter="20">
<el-col :span="4">
<el-radio v-model="radio" label="A">A</el-radio>
</el-col>
<el-col :span="4">
<el-radio v-model="radio" label="B">B</el-radio>
</el-col>
<el-col :span="4">
<el-radio v-model="radio" label="C">C</el-radio>
</el-col>
<el-col :span="4">
<el-radio v-model="radio" label="D">D</el-radio>
</el-col>
<el-col :span="4">
<el-radio v-model="radio" label="E">E</el-radio>
</el-col>
<el-col :span="4">
<el-radio v-model="radio" label="F">F</el-radio>
</el-col>
</el-row>
</el-form>
</div>
</div>
</div>
</template> </template>
<script>
/* 引入需要的接口*/
import {
QueryKzzxRole,
QueryApptype,
AddKzzxRole,
DeleteKzzxRole,
UpdateKzzxRole,
QtKzzxRole
} from "common/src/api/system/dmgSystem.js";
/* edit页面*/
import Edit from './edit'
import Participants from './participants.vue'
import {
tableMixin
} from 'common'
export default {
mixins: [tableMixin],
name: 'appVersion',
/* 初始额外赋值*/
async mounted() {
this.$refs['TablePager'].pageQuery()
},
data() {
return {
radio:'A',
/*需要的额外参数 */
showDialog: false,
DialogName: '',
type: '',
DialogTitle: '',
/* 基础url*/
baseUrl: 'kzzx/role',
/* 查询参数*/
queryParams: {
ksrq: '',
jsrq: ''
},
/* 表格标题对应参数*/
tableTitle: [
{
prop: 'whsj',
label: '机型',
show:false,
fieldType:'ftDateTime',
width: '100',
align:'left'
},
{
prop: 'whsj',
label: '专业',
...this.$common('ftDateTime')
},
{
prop: 'whr',
label: '岗位',
width: '100'
},
{
prop: 'whr',
label: '类别',
width: '100'
},
{
prop: 'whr',
label: '题型',
width: '100'
},
{
prop: 'whr',
label: '难易度',
width: '100'
},
{
prop: 'whr',
label: '考核点',
width: '100'
},
{
prop: 'whr',
label: '分值',
width: '100'
},
{
prop: 'whr',
label: '维护人',
width: '100'
},
{
prop: 'whr',
label: '维护时间',
width: '100'
}
]
}
},
methods: {
handleClick(val){
},
/* 基础查询*/
query: QueryKzzxRole,
/* 基础增*/
apiAdd: AddKzzxRole,
/* 基础更新*/
apiUpdate: UpdateKzzxRole,
/* 删除操作*/
apiDelete: DeleteKzzxRole,
/* 初始化赋值操作*/
init() {
},
/* 启用停用*/
setEnable(id) {
this.$confirm('是否启用/停用该角色, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = {
id: id
}
QtKzzxRole(params).then(res => {
if (res.success) {
this.$success('操作成功')
this.app.$refs['TablePager'].reLoad()
} else {
this.$error(res.message || '操作失败')
}
})
})
}
<script>
/* 引入需要的接口*/
import {
doQuery,
doAdd,
doUpdate,
doDelete,
pxxmQuery,
excelimport
} from '@/api/train/questionManage';
/* edit页面*/
import Edit from './edit'
import Selecter from './selecter'
import {
tableMixin
} from 'common'
export default {
mixins: [tableMixin],
name: 'aqgl/pxglPxst',
/* 初始额外赋值*/
async mounted() {
this.$refs['TablePager'].pageQuery()
},
data() {
return {
/*需要的额外参数 */
showDialog: false,
DialogName: '',
type: '',
DialogTitle: '导入试题',
/* 基础url*/
baseUrl: '/aqgl/pxgl/pxst',
/* 查询参数*/
queryParams: {
info: ''
},
/* 表格标题对应参数*/
tableTitle: [
{label: "题目 ", prop: "cont", fieldType: "ftString",width:200},
{label: "试题类型 ", prop: "type", fieldType: "ftString",width:150,transform:{
url:'aqgl/pxgl/pxst/init/type',label:'name',value:'id'
}},
{label: "题库编码", prop: "mid", fieldType: "ftString",width:192,transform:{
url:'aqgl/pxgl/pxxm/query',label:'name',value:'id'
}},
{label: "选项A", prop: "opta", fieldType: "ftString",width:240},
{label: "选项B", prop: "optb", fieldType: "ftString",width:240},
{label: "选项C", prop: "optc", fieldType: "ftString",width:240},
{label: "选项D", prop: "optd", fieldType: "ftString",width:240},
{label: "选项E", prop: "opte", fieldType: "ftString",width:240},
{label: "选项F", prop: "optf", fieldType: "ftString",width:240},
{label: "答案", prop: "ans", fieldType: "ftString",width:240},
{label: "答案描述", prop: "desc", fieldType: "ftString",width:300},
{label: "备注", prop: "bz", fieldType: "ftString",width:300},
{label: "维护人", prop: "whr", fieldType: "ftString"},
{label: "维护时间", prop: "whsj", fieldType: "ftDateTime"},
{label: "创建人", prop: "cjr", fieldType: "ftString"},
{label: "创建时间", prop: "cjsj", fieldType: "ftDateTime"},
]
}
},
methods: {
importst(){
this.showDialog=true
}, },
components: { /* 基础查询*/
Edit, query: doQuery,
Participants, /* 基础增*/
} apiAdd: doAdd,
/* 基础更新*/
apiUpdate: doUpdate,
} /* 删除操作*/
apiDelete: doDelete,
/* 初始化赋值操作*/
init() {
}
},
components: {
Edit,
Selecter
}
}
</script> </script>
<style scoped> <style scoped>
/deep/.el-tabs__item {
font-size: 13px;
color: #666;
}
.ktstyle{
width: 70%;margin: 0 auto;border: 1px solid #eee;height: 250px;border-radius: 10px;
}
.kttitle{
position: absolute;left: 10px;top: 10px;font-size: 13px;color: #666;
}
</style> </style>
<template>
<DefaultDialog :app='app'>
<el-form slot="form" ref="form" label-width="100px" >
<el-row :gutter="20">
<el-col :span="24">
<el-col :span="24">
<el-form-item label="试题类型" ref="stlx" prop="stlx">
<RelSelect filterable style="width: 100%;" clearable src='aqgl/pxgl/pxxm/query' :match="{value:'id',label:'name'}" v-model='xmid' ></RelSelect>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-form>
<div slot="reFooter" class="refooter" >
<span slot="footer" class="dialog-footer" >
<el-button @click="app.showDialog=false">取 消</el-button>
<el-button type="primary" @click="save()">导 入</el-button>
</span>
</div>
</DefaultDialog>
</template>
<script>
import {
doQuery,
doAdd,
doUpdate,
doDelete,
pxxmQuery,
excelimport
} from '@/api/train/questionManage';
export default {
props: {
app: {
type: Object,
default: {}
}
},
async mounted() {
},
data() {
return {
xmid:''
}},
methods: {
drexcel(){
let that=this
let input = document.createElement('input');
input.type='file'
input.onchange=function(){
that.app.showDialog=false
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)
formData.append('xmid', that.xmid)
excelimport(formData).then(res=>{
try{document.body.removeChild(input)}catch(e){
console.log(e)
}
if(res.success){
that.$success('上传成功')
that.app.$refs.TablePager.pageQuery()
}
})
}
}
input.click()
},
save(){
if(!this.xmid){
this.$warning('请选中一条培训项目')
}else{
this.drexcel()
}
},
jcrSelected(row){
this.singleItem.jcrid=row.id
},
fcrSelected(row){
this.singleItem.fcr=row.id
}
}
}
</script>
<style scoped>
</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