手动添加课件试题
This commit is contained in:
parent
1c32bbb9c6
commit
57fa6c09d5
@ -3,10 +3,6 @@ import { getPropertyData, extendInclude, extendRule, auditOptionShow, initFilter
|
|||||||
import FormPage from '../../components/FormPage';
|
import FormPage from '../../components/FormPage';
|
||||||
import ShowModal from '../../components/common/ShowModal';
|
import ShowModal from '../../components/common/ShowModal';
|
||||||
import { Button } from 'antd'
|
import { Button } from 'antd'
|
||||||
// import { forEach } from "core-js/core/array";
|
|
||||||
// import { now } from "core-js/core/date";
|
|
||||||
// import { connect } from 'dva';
|
|
||||||
// import { forEach } from "core-js/core/array";
|
|
||||||
/**
|
/**
|
||||||
* @return {string}
|
* @return {string}
|
||||||
*/
|
*/
|
||||||
@ -14,7 +10,33 @@ import { Button } from 'antd'
|
|||||||
export default {
|
export default {
|
||||||
onBeforeSaveHandleRecord(params) {
|
onBeforeSaveHandleRecord(params) {
|
||||||
// debugger
|
// debugger
|
||||||
// params.record = params.stateData//所有的信息都过去 后台竟然没法接收
|
// if (params != null && params.record != null && params.record.Nav_Detail != null && params.record.Nav_Detail.length > 0) {
|
||||||
|
// params.record.Nav_Detail.forEach(e => {
|
||||||
|
// var TestID = guid()
|
||||||
|
// if (e.TEST_ID == undefined) {
|
||||||
|
// e.CREATER_ID = null
|
||||||
|
// e.CREATE_TIME = null
|
||||||
|
// e.FLOW_ID = null
|
||||||
|
// e.ENTITY_ORG_TPYE = 0
|
||||||
|
// e.FLOW_ID = null
|
||||||
|
// e.FLOW_SEND_STATUS = 0
|
||||||
|
// e.FLOW_STATUS = 0
|
||||||
|
// e.FORM_ID = null
|
||||||
|
// e.IS_DELETED = false
|
||||||
|
// e.MODIFIER_ID = null
|
||||||
|
// e.MODIFY_TIME = null
|
||||||
|
// e.NUM = 0
|
||||||
|
// e.SCOREPER = 0
|
||||||
|
// e.TEST_ID = TestID
|
||||||
|
// e.TaskID = '00000000-0000-0000-0000-000000000000'
|
||||||
|
// e.Nav_Test.ID = TestID
|
||||||
|
// e.Nav_Test.ANSWER = 1
|
||||||
|
// e.Nav_Test.ORG_ID = e.ORG_ID
|
||||||
|
// e.Nav_Test.TaskID = '00000000-0000-0000-0000-000000000000'
|
||||||
|
// e.Nav_Test.IS_DELETED = false
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
btnSubAdd: ({ record, parentRecord, setState, data, stateData, close, loadData, login, btn, closeForm, onCancel }) => {//setStateData 报错
|
btnSubAdd: ({ record, parentRecord, setState, data, stateData, close, loadData, login, btn, closeForm, onCancel }) => {//setStateData 报错
|
||||||
let dataSubForm = {
|
let dataSubForm = {
|
||||||
@ -28,7 +50,6 @@ export default {
|
|||||||
if (stateData.Nav_Detail == null) {
|
if (stateData.Nav_Detail == null) {
|
||||||
stateData.Nav_Detail = []
|
stateData.Nav_Detail = []
|
||||||
}
|
}
|
||||||
debugger
|
|
||||||
login.RegD.forEach(e => {
|
login.RegD.forEach(e => {
|
||||||
stateData.Nav_Detail.push(e)
|
stateData.Nav_Detail.push(e)
|
||||||
})
|
})
|
||||||
@ -47,4 +68,89 @@ export default {
|
|||||||
</ShowModal>
|
</ShowModal>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
onSubChange: ({ value, pageCode, record, colInfo, dispatch, stateData, props, saveRowRecord }) => {
|
||||||
|
if (colInfo.FIELD_NAME == "TYPE") {
|
||||||
|
if (record.TYPE == 0) {
|
||||||
|
stateData.Nav_Detail.forEach(e => {
|
||||||
|
if (e.ID == record.ID) {
|
||||||
|
e.OPTION_A = "正确"
|
||||||
|
e.OPTION_B = "错误"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
record.OPTION_A = "正确"
|
||||||
|
record.OPTION_B = "错误"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//导入的题目不可编辑
|
||||||
|
handleRenderRowControl(params) {
|
||||||
|
// 新增时页面需要重写
|
||||||
|
// 编辑时页面不能重写 去题库修改
|
||||||
|
if (params.record.Nav_Test != undefined) {
|
||||||
|
//说明后台导入 不可编辑
|
||||||
|
// if (params.colConfig.field === 'TYPE') {
|
||||||
|
// debugger
|
||||||
|
// // return <>
|
||||||
|
// // <p className={styles.pLin} title={params.record.CHECKRESULT_DESCRIPTION}> {params.record.CHECKRESULT_DESCRIPTION}</p>
|
||||||
|
// // </>
|
||||||
|
// // return <>
|
||||||
|
// // {params.record.TYPE}
|
||||||
|
// // </>
|
||||||
|
// }
|
||||||
|
if (params.colConfig.field === 'NAME') {
|
||||||
|
return <>
|
||||||
|
{params.record.NAME}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
if (params.colConfig.field === 'ANSWERSHOW') {
|
||||||
|
return <>
|
||||||
|
{params.record.ANSWERSHOW}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
if (params.colConfig.field === 'OPTION_A') {
|
||||||
|
return <>
|
||||||
|
{params.record.OPTION_A}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
if (params.colConfig.field === 'OPTION_B') {
|
||||||
|
return <>
|
||||||
|
{params.record.OPTION_B}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
if (params.colConfig.field === 'OPTION_C') {
|
||||||
|
return <>
|
||||||
|
{params.record.OPTION_C}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
if (params.colConfig.field === 'OPTION_D') {
|
||||||
|
return <>
|
||||||
|
{params.record.OPTION_D}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
if (params.colConfig.field === 'OPTION_E') {
|
||||||
|
return <>
|
||||||
|
{params.record.OPTION_E}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
} else if (params.record != undefined && params.record.TYPE != undefined && params.record.TYPE == 0) {
|
||||||
|
if (params.colConfig.field === 'OPTION_A') {
|
||||||
|
return <>
|
||||||
|
{params.record.OPTION_A}
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
if (params.colConfig.field === 'OPTION_B') {
|
||||||
|
return <>{params.record.OPTION_B}</>
|
||||||
|
}
|
||||||
|
if (params.colConfig.field === 'OPTION_C') {
|
||||||
|
return <></>
|
||||||
|
}
|
||||||
|
if (params.colConfig.field === 'OPTION_D') {
|
||||||
|
return <></>
|
||||||
|
}
|
||||||
|
if (params.colConfig.field === 'OPTION_E') {
|
||||||
|
return <></>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user