diff --git a/src/components/CustomPages/SE/SEConfigPage.js b/src/components/CustomPages/SE/SEConfigPage.js index 271200d..82a8eb0 100644 --- a/src/components/CustomPages/SE/SEConfigPage.js +++ b/src/components/CustomPages/SE/SEConfigPage.js @@ -1,8 +1,8 @@ import { message } from "antd/lib/index"; -import { Button, Popconfirm, Row, Col, Form, Input,InputNumber, DatePicker,Select, Table } from 'antd'; +import { Button, Popconfirm, Row, Col, Form, Input, InputNumber, DatePicker, Select, Table } from 'antd'; import React from 'react'; import { initFilter, extendRule, extendInclude, setDataFieldValue, guid, initQueryFilter } from "../../../utils/common"; -import styles from '../../CustomPages/HI/StepForm.css'; +import styles from '../../CustomPages/HI/StepForm.css'; import { connect } from 'dva'; import moment from 'moment'; @@ -10,7 +10,7 @@ class SEConfigPage extends React.Component { constructor(props) { super(props); this.state = { - isLoading:false, + isLoading: false, data: { ID: null, SAFE_SERVEY_TRIGGER_TIME: null, @@ -38,7 +38,7 @@ class SEConfigPage extends React.Component { this.props.closeFn(); else if (typeof this.props.data.closeTab == 'function') { this.props.data.closeTab(this.props.data.id) - } else if (typeof this.props.onCancel === "function"){ + } else if (typeof this.props.onCancel === "function") { this.props.onCancel(); } } @@ -50,30 +50,30 @@ class SEConfigPage extends React.Component { url: 'SE/SEConfig/Entities', onComplete: (ret) => { if (ret && ret.length > 0) { - this.setState({ data: ret[0] }); + this.setState({ data: ret[0] }); } } }); } - fmtEnum(name,value){ + fmtEnum(name, value) { const enums = this.props.app.enums; if (!enums || !enums[name]) return ''; - return enums[name].enums[value] || ''; + return enums[name].enums[value] || ''; } - onSave = () =>{ + onSave = () => { let data = JSON.parse(JSON.stringify(this.state.data)); - if (data.DEP_TRAIN_PLAN_END_TIME && data.DEP_TRAIN_PLAN_START_TIME){ + if (data.DEP_TRAIN_PLAN_END_TIME && data.DEP_TRAIN_PLAN_START_TIME) { let s = new Date(data.DEP_TRAIN_PLAN_START_TIME); let e = new Date(data.DEP_TRAIN_PLAN_END_TIME); - if (e.getTime() - s.getTime() < 1 * 24 * 60 * 60 * 1000){ + if (e.getTime() - s.getTime() < 1 * 24 * 60 * 60 * 1000) { message.error('截止时间至少比开始时间大一天'); return; } } - if (!data.ID){ + if (!data.ID) { data.ID = guid(); } - this.setState({isLoading:true}); + this.setState({ isLoading: true }); this.props.dispatch({ type: 'app/getDataByPost', payload: data, @@ -81,19 +81,19 @@ class SEConfigPage extends React.Component { onComplete: (ret) => { if (ret) { message.success('保存成功!'); - this.setState({isLoading:false}); + this.setState({ isLoading: false }); } } }); } render() { const { data } = this.state; - const dateFormat = 'YYYY/MM/DD'; + const dateFormat = 'MM-DD'; return <>
- -
-
(this.componentRef = el)} style={{ padding: '20px',backgroundColor:'FFF' }} id={'tableId' + this.props.data.id}> + +
+
(this.componentRef = el)} style={{ padding: '20px', backgroundColor: 'FFF' }} id={'tableId' + this.props.data.id}>

安全教育培训基础设置

@@ -102,27 +102,27 @@ class SEConfigPage extends React.Component { @@ -132,27 +132,27 @@ class SEConfigPage extends React.Component { @@ -162,27 +162,27 @@ class SEConfigPage extends React.Component { @@ -191,7 +191,7 @@ class SEConfigPage extends React.Component { - @@ -199,10 +199,11 @@ class SEConfigPage extends React.Component { - - - +
是非题数目 - { + { let data = this.state.data; data.C_TEST_COUNT = value; this.setState(data) - } - } + } + } > 是非题分值 - { + { let data = this.state.data; data.C_TEST_SCORE = value; this.setState(data) - } - } + } + } >
单选题数目 - { + { let data = this.state.data; data.S_TEST_COUNT = value; this.setState(data) - } - } + } + } > 单选题分值 - { + { let data = this.state.data; data.S_TEST_SCORE = value; this.setState(data) - } - } + } + } >
多选题数目 - { + { let data = this.state.data; data.M_TEST_COUNT = value; this.setState(data) - } - } + } + } > 多选题分值 - { + { let data = this.state.data; data.M_TEST_SCORE = value; this.setState(data) - } - } + } + } >
试题总分 { data.C_TEST_COUNT * data.C_TEST_SCORE + data.S_TEST_COUNT * data.S_TEST_SCORE + data.M_TEST_COUNT * data.M_TEST_SCORE} + {data.C_TEST_COUNT * data.C_TEST_SCORE + data.S_TEST_COUNT * data.S_TEST_SCORE + data.M_TEST_COUNT * data.M_TEST_SCORE}
安全意识调查触发时间 + { + onChange={value => { let data = this.state.data; data.SAFE_SERVEY_TRIGGER_TIME = value; this.setState(data) @@ -214,8 +215,9 @@ class SEConfigPage extends React.Component { 培训需求调查触发时间 { + format={dateFormat} + value={data.TRAIN_SURVEY_TRIGGER_TIME ? moment(data.TRAIN_SURVEY_TRIGGER_TIME) : null} + onChange={value => { let data = this.state.data; data.TRAIN_SURVEY_TRIGGER_TIME = value; this.setState(data) @@ -225,10 +227,11 @@ class SEConfigPage extends React.Component {
部门培训计划发起时间 + { + onChange={value => { let data = this.state.data; data.DEP_TRAIN_PLAN_START_TIME = value; this.setState(data) @@ -240,8 +243,9 @@ class SEConfigPage extends React.Component { 部门培训计划截至时间 { + format={dateFormat} + value={data.DEP_TRAIN_PLAN_END_TIME ? moment(data.DEP_TRAIN_PLAN_END_TIME) : null} + onChange={value => { let data = this.state.data; data.DEP_TRAIN_PLAN_END_TIME = value; this.setState(data) @@ -249,7 +253,7 @@ class SEConfigPage extends React.Component { />