Commit ca91c78d authored by 李苏's avatar 李苏 💬

修改字段

parent 78106698
import request from 'common/src/utils/request'
export function QueryBm(query) {
return request({
url: 'jcsj/ubm/query',
method: 'post',
data: query||{}
})
}
export function AddBm(query) {
return request({
url: 'jcsj/ubm/add',
method: 'post',
data: query||{}
})
}
export function DeleteBm(query) {
return request({
url: 'jcsj/ubm/delete',
method: 'post',
data: query||{}
})
}
export function UpdateBm(query) {
return request({
url: 'jcsj/ubm/update',
method: 'post',
data: query||{}
})
}
export function qtBm(query) {
return request({
url: 'jcsj/ubm/record/qt',
method: 'post',
data: query||{}
})
}
...@@ -16,11 +16,16 @@ ...@@ -16,11 +16,16 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="责任人" ref="fzrid" prop="type"> <el-form-item label="负责人" ref="ybfzrid" prop="type">
<personSelector :label="form.username||'暂无'" @selected='selected' ></personSelector> <personSelector :label="form.username||'暂无'" @selected='selected' ></personSelector>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="预备负责人" ref="fzrid" prop="type">
<personSelector :label="form.ybfzrName||'暂无'" @selected='ybselected' ></personSelector>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="上级部门" ref="pid" prop="type"> <el-form-item label="上级部门" ref="pid" prop="type">
<el-select style="width: 100%;" v-model="form.pid" placeholder=""> <el-select style="width: 100%;" v-model="form.pid" placeholder="">
<el-option v-for="(item,index) in bmList" :key="item.id" :label="item.bmmc" :value="item.id"></el-option> <el-option v-for="(item,index) in bmList" :key="item.id" :label="item.bmmc" :value="item.id"></el-option>
...@@ -65,6 +70,8 @@ ...@@ -65,6 +70,8 @@
/* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/ /* 当前表单初始值,默认由RelDialog查询indexQuery赋值,copy时不赋值id,初始化时所有query的值都会赋值给form*/
form: { form: {
ybfzrName:'',
ybfzrid:'',
pid:'', pid:'',
bz:'', bz:'',
bmmc:'', bmmc:'',
...@@ -74,11 +81,13 @@ ...@@ -74,11 +81,13 @@
rules: { rules: {
bmid: [{ bmid: [{
required: true, required: true,
trigger: 'blur' trigger: 'blur',
message: '请输入部门编码'
}, ], }, ],
bmmc: [{ bmmc: [{
required: true, required: true,
trigger: 'blur' trigger: 'blur',
message: '请输入部门名称'
}] }]
} }
} }
...@@ -86,7 +95,10 @@ ...@@ -86,7 +95,10 @@
methods: { methods: {
selected(row){ selected(row){
this.form.fzrid=row.id this.form.fzrid=row.id
} },
ybselected(row){
this.form.ybfzrid=row.id
}
} }
} }
......
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
<CopyButton ref="copy" :app='app'></CopyButton> <CopyButton ref="copy" :app='app'></CopyButton>
<EditButton ref="edit" :app='app'></EditButton> <EditButton ref="edit" :app='app'></EditButton>
<FieldButton :app='app'></FieldButton> <FieldButton :app='app'></FieldButton>
<ExcelButton :app='app'></ExcelButton> <ExcelButton :app='app'></ExcelButton>
</el-row> </el-row>
<!-- 表格--> <!-- 表格-->
<div class="tablePagers"> <div class="tablePagers">
<TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem' type='treeTable' <TablePager @getData='getData' :ref="'TablePager'" :app='app' :query='query' @selectItem='selectItem' type='treeTable'
@getRow='getRow'> @getRow='getRow'>
<template slot="tabCustom"> <template slot="tabCustom">
<el-table-column label="启用/停用" width="90" header-align="center" > <el-table-column label="启用/停用" width="90" header-align="center" >
...@@ -33,12 +33,12 @@ ...@@ -33,12 +33,12 @@
/* 引入需要的接口*/ /* 引入需要的接口*/
import { import {
QueryBm, QueryBm,
QueryApptype, // QueryApptype,
AddBm, AddBm,
DeleteBm, DeleteBm,
UpdateBm, UpdateBm,
qtBm qtBm
} from "common/src/api/system/dmgSystem.js"; } from "@/api/basicData/organizationalManagement.js";
/* edit页面*/ /* edit页面*/
import Edit from './edit' import Edit from './edit'
import {tableMixin} from 'common' import {tableMixin} from 'common'
...@@ -47,19 +47,7 @@ ...@@ -47,19 +47,7 @@
name: 'appVersion', name: 'appVersion',
/* 初始额外赋值*/ /* 初始额外赋值*/
async mounted() { async mounted() {
await this.$asRun(
[QueryApptype(),
res => {
var data = res['data']['records'];
let typeMap = []
for (var i in data) {
typeMap[data[i].id] = data[i].name
}
this.systemType = data
this.typeMap = typeMap
}
]
)
this.$refs['TablePager'].pageQuery() this.$refs['TablePager'].pageQuery()
}, },
data() { data() {
...@@ -68,7 +56,7 @@ ...@@ -68,7 +56,7 @@
/*需要的额外参数 */ /*需要的额外参数 */
typeMap: [], typeMap: [],
systemType: [], systemType: [],
baseUrl: 'kzzx/bm', baseUrl: 'jcsj/ubm',
/* 查询参数*/ /* 查询参数*/
queryParams: {}, queryParams: {},
/* 表格标题对应参数*/ /* 表格标题对应参数*/
...@@ -87,6 +75,11 @@ ...@@ -87,6 +75,11 @@
label: '负责人', label: '负责人',
width: '120' width: '120'
}, },
{
prop: 'ybfzrName',
label: '预备负责人',
width: '120'
},
{ {
prop: 'tyrq', prop: 'tyrq',
label: '停用日期', label: '停用日期',
...@@ -136,7 +129,7 @@ ...@@ -136,7 +129,7 @@
} }
}) })
}) })
}, },
/* 基础查询*/ /* 基础查询*/
query: QueryBm, query: QueryBm,
......
...@@ -50,7 +50,8 @@ ...@@ -50,7 +50,8 @@
this.subjectList=oList.map(item=>{ this.subjectList=oList.map(item=>{
let newobj=Object.create({}) let newobj=Object.create({})
newobj.id=item.id newobj.id=item.id
newobj.score=item.score||'暂无分值' newobj.ans=item.ans
newobj.score=item.score||2
newobj.type=type[item.type] newobj.type=type[item.type]
newobj.subject=item.cont||'未设置问题' newobj.subject=item.cont||'未设置问题'
newobj.options=Object.create({}) newobj.options=Object.create({})
...@@ -100,16 +101,21 @@ ...@@ -100,16 +101,21 @@
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
// this.$message({
// type: 'success',
// message: '试卷提交成功!'
// });
/* 计算*/
let sjdf=0
console.log(this.subjectList) console.log(this.subjectList)
this.$message({ this.subjectList.forEach(item=>{
type: 'success', /* 单选题*/
message: '试卷提交成功!' sjdf++
});
})
this.$warning(`您获得了${sjdf}分!`)
}).catch(() => { }).catch(() => {
this.$message({
type: 'info',
message: '已取消'
});
}); });
} }
}, },
......
<template> <template>
<div class="examMain"> <div class="examMain">
<!-- 试题题目--> <!-- 试题题目-->
<template v-if="type!='TKT'"> <template v-if="type!='TKT'">
<span>{{`${index}.`}}</span> <span>{{`${index}.`}}</span>
<span>{{type|typeName}}</span> <span>{{type|typeName}}</span>
<span>{{subject}}{{score|typeScore}}</span> <span>{{subject}}{{score|typeScore}}</span>
<br> <br>
</template> </template>
<!-- 填空题--> <!-- 填空题-->
<template v-if="type=='TKT'"> <template v-if="type=='TKT'">
<span>{{`${index}.`}}</span> <span>{{`${index}.`}}</span>
<span>{{'TKT'|typeName}}</span> <span>{{'TKT'|typeName}}</span>
<span v-html="transTKT(subject)"></span><span>{{score|typeScore}}</span> <span v-html="transTKT(subject)"></span><span>{{score|typeScore}}</span>
</template> </template>
<!-- 答案选项--> <!-- 答案选项-->
<!-- 单选--> <!-- 单选-->
<div v-if="type=='DXT'" class="options"> <div v-if="type=='DXT'" class="options">
<div class="item" :key="index" v-for="(item,index) in options"> <div class="item" :key="index" v-for="(item,index) in options">
<el-radio v-model="value" :label="index"> {{`${index}.${item}`}}</el-radio> <el-radio v-model="value" :label="index"> {{`${index}.${item}`}}</el-radio>
</div>
</div> </div>
</div> <!-- 多选-->
<!-- 多选--> <div v-if="type=='DXTS'" class="options">
<div v-if="type=='DXTS'" class="options"> <div class="item" :key="index" v-for="(item,index) in options">
<div class="item" :key="index" v-for="(item,index) in options"> <el-checkbox-group v-model="valueList">
<el-checkbox-group v-model="valueList"> <el-checkbox :label="index">{{`${index}.${item}`}}</el-checkbox>
<el-checkbox :label="index">{{`${index}.${item}`}}</el-checkbox> </el-checkbox-group>
</el-checkbox-group> </div>
</div> </div>
</div> <!-- 判断题 -->
<!-- 判断题 --> <div v-if="type=='PDT'" class="options">
<div v-if="type=='PDT'" class="options"> <div class="item" :key="index" v-for="(item,index) in options">
<div class="item" :key="index" v-for="(item,index) in options"> <el-radio v-model="value" :label="index"> {{`${index}.${item}`}}</el-radio>
<el-radio v-model="value" :label="index"> {{`${index}.${item}`}}</el-radio> </div>
</div> </div>
</div> <!-- 答案显示-->
<!-- <br>
<span>结果:错误</span>
<br>
<span>本题答案是:A,B,C</span>
<br>
<span>答案解析:钝角</span> -->
</div> </div>
</template> </template>
<script> <script>
export default{ export default {
updated() { updated() {
if(this.type=='DXTS'){ if (this.type == 'DXTS') {
this.app.subjectList[this.index-1].value=this.valueList let valueList=_.cloneDeep(this.valueList)
}else{ this.app.subjectList[this.index - 1].value=valueList.sort((s1, s2)=>{
this.app.subjectList[this.index-1].value=this.value let a1 = s1.toUpperCase();
let a2 = s2.toUpperCase();
if (a1 < a2) {
return -1;
}
if (a1 > a2) {
return 1;
}
return 0;
}).join(',')
/* 排序*/
} else {
this.app.subjectList[this.index - 1].value = this.value
} }
}, },
mounted() { mounted() {
this.type=='TKT'&&$(this.$el).find('[name=tktinput]').change(e=>{ this.type == 'TKT' && $(this.$el).find('[name=tktinput]').change(e => {
this.value=$(this.$el).find('[name=tktinput]').val()||'' this.value = $(this.$el).find('[name=tktinput]').val() || ''
this.app.subjectList[this.index-1].value=this.value this.app.subjectList[this.index - 1].value = this.value
}) })
}, },
props:{ props: {
app:{ app: {
type:Object, type: Object,
default:()=>{ default: () => {
return {} return {}
} }
}, },
index:{ index: {
default:1 default: 1
}, },
subject:{ subject: {
type:String, type: String,
default:'对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有()个。' default: '对于线性表(7,34,55,25,64,46,20,10)进行散列存储时,若选用H(K)=K %9作为散列函数,则散列地址为1的元素有()个。'
}, },
score:{ score: {
type:String, // type:String,
default:'2' default: '2'
}, },
type:{ type: {
type:String, type: String,
default:'DXT' default: 'DXT'
}, },
options:{ options: {
type:Object, type: Object,
default:()=>{ default: () => {
return{ return {
A:'1个', A: '1个',
B:'2个', B: '2个',
C:'3个', C: '3个',
D:'4个' D: '4个'
} }
} }
} }
}, },
data(){ data() {
return{ return {
value:'', value: '',
valueList:[], valueList: [],
} }
}, },
methods:{ methods: {
transTKT(val,fn){ transTKT(val, fn) {
let nval let nval
let template=`<input type='text' name='tktinput' class='tktinput'>` let template = `<input type='text' name='tktinput' class='tktinput'>`
/* 判断有无()*/ /* 判断有无()*/
val.indexOf('()')==-1?( nval=val+template):( nval=val.replace('()',template)) val.indexOf('()') == -1 ? (nval = val + template) : (nval = val.replace('()', template))
return nval return nval
} }
}, },
filters:{ filters: {
typeName(val){ typeName(val) {
let typeArry={ let typeArry = {
'DXT':'(单选题)', 'DXT': '(单选题)',
'DXTS':'(多选题)', 'DXTS': '(多选题)',
'TKT':'(填空题)', 'TKT': '(填空题)',
'PDT':'(判断题)' 'PDT': '(判断题)'
} }
let nval=typeArry[val] let nval = typeArry[val]
return nval||'其他' return nval || '其他'
}, },
typeScore(val){ typeScore(val) {
let nval=`(${val}分)` let nval = `(${val}分)`
return nval return nval
} }
} }
...@@ -123,42 +144,49 @@ ...@@ -123,42 +144,49 @@
</script> </script>
<style lang="scss" scope> <style lang="scss" scope>
.el-radio__label{ .el-radio__label {
font-size: 13px; font-size: 13px;
color:rgb(119, 119, 119); color: rgb(119, 119, 119);
} }
input{
input {
border: none; border: none;
outline: none; outline: none;
} }
input:focus{
border: none; input:focus {
border: none;
}
.tktinput:focus {
border: 0px;
border-bottom: 1px solid #eee;
} }
.tktinput:focus{
border: 0px; .tktinput {
border-bottom: 1px solid #eee;
}
.tktinput{
border: 0px; border: 0px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
color: #888; color: #888;
} }
.examMain{
margin-top: 30px; .examMain {
height: 100%; margin-top: 30px;
width: 100%; height: 100%;
font-size: 14px;
overflow: auto;
.options{
padding: 10px;
width: 100%; width: 100%;
display: flex; font-size: 14px;
flex-wrap: wrap; overflow: auto;
.item{
padding-left: 20%; .options {
width: 50%; padding: 10px;
line-height: 20px; width: 100%;
display: flex;
flex-wrap: wrap;
.item {
padding-left: 20%;
width: 50%;
line-height: 20px;
}
} }
} }
}
</style> </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