提交 b573a359 authored 作者: 钟是志's avatar 钟是志

21843 宿舍管理/宿舍维修审核。20210111 维修师排期之后 在进行排期 时间显示错误

上级 8ef90099
......@@ -228,6 +228,7 @@ export default class ZdyTable extends Component {
: val.taskFormKey
? val.taskFormKey
: obj.init;
console.log('231--------');
this.initExcel(obj, () =>
this.setState(
{
......@@ -251,7 +252,7 @@ export default class ZdyTable extends Component {
items: this.props.table ? obj.datas[val.taskFormKey].items : xxx.items,
isReady: true,
init: { ...this.state.init, ...(val.isSecond ? this.props.obj : {}) },
init: { ...this.state.init, ...(val.isSecond ? this.props.obj : {}) }, // 重新发起就拿obj 里面的值给初始值
formConfig: xxx,
// init:this.props.get==="mobile"?!!val.content?JSON.parse(val.content):'':{},// 移动端默认值设置
},
......@@ -573,7 +574,9 @@ export default class ZdyTable extends Component {
isRowCol: this.props.table ? obj.datas[val.taskFormKey].isRowCol : xxx.isRowCol,
items: this.props.table ? obj.datas[val.taskFormKey].items : xxx.items,
isReady: true,
init: { ...this.state.init, ...(val.isSecond ? this.props.obj : {}) },
init: {
...this.state.init,
...(val.isSecond ? this.props.obj : {}) },
formConfig: xxx,
// init:this.props.get==="mobile"?!!val.content?JSON.parse(val.content):'':{},// 移动端默认值设置
});
......
......@@ -35,7 +35,6 @@ export default class index extends Component {
};
render() {
let { path, pathName, width, height } = this.props;
console.log(path, '????');
const { visible } = this.state;
let isShow =
pathName?.indexOf('.pdf') !== -1 ||
......
......@@ -3,7 +3,7 @@
* 2019年9月22日
* 动态表格组件返回对应的组件
*/
import React, { Component } from 'react';
import React, {Component} from 'react';
import md5 from 'js-md5';
import FormModal from './FormModal';
import {
......@@ -25,13 +25,13 @@ import {
} from 'antd';
import UUID from 'react-native-uuid';
import QRCode from 'qrcode.react';
import { Editor } from 'draft-js';
import {Editor} from 'draft-js';
import MyBlockRenderer from '../App/MyBlockRender';
import CronEditor from 'antd-cron-editor';
import { Card, Flex, List as MobileList, Switch as MobileSwitch } from 'antd-mobile';
import {Card, Flex, List as MobileList, Switch as MobileSwitch} from 'antd-mobile';
import ReactEcharts from 'echarts-for-react';
import ZdyTable from '../Table/index';
import { connect } from 'dva';
import {connect} from 'dva';
import UploadCom from '../libs/UploadCom';
import TableSelect from '../libs/TableSelect';
import LocationCom from '../libs/LocationCom';
......@@ -45,27 +45,26 @@ import router from 'umi/router';
import TableList from '../libs/TableList';
import styles from './style.less';
import config from '@/webPublic/one_stop_public/config';
import { cloneDeep, isEmpty, isNaN } from 'lodash';
import { queryApiActionPath } from '../utils/queryConfig';
import { extend } from 'umi-request';
import {cloneDeep, isEmpty, isNaN} from 'lodash';
import {queryApiActionPath} from '../utils/queryConfig';
import {extend} from 'umi-request';
import Highlighter from 'react-highlight-words';
import Signature from '../Signature';
import { changeToDraftState } from '../utils/myutils';
import { Base16Encode } from '../Base16/index';
import { getToken } from '../utils/token';
import { formulaList } from '../excelInitFuc/functionList';
import {changeToDraftState} from '../utils/myutils';
import {Base16Encode} from '../Base16/index';
import {getToken} from '../utils/token';
import {formulaList} from '../excelInitFuc/functionList';
import FilePreview from '../filePreview';
import DraftEditorCom from '../App/DraftEditorCom';
import MobileItem from './MobileItem';
import MobileCascader from "./CascaderDiy/MobileCascader";
import { errorHandler, getBase64, equal, getRender, isJSON } from './Split_Index/staticInfo';
import {equal, errorHandler, getBase64, getRender, isJSON} from './Split_Index/staticInfo';
const { TextArea } = Input;
const { Option } = Select;
const { RangePicker } = DatePicker;
const {TextArea} = Input;
const {Option} = Select;
const {RangePicker} = DatePicker;
@connect(({ DataColumn, SqlManageEntity, formList, loading }) => ({
@connect(({DataColumn, SqlManageEntity, formList, loading}) => ({
DataColumn,
SqlManageEntity,
formList,
......@@ -101,22 +100,22 @@ export default class tableCom extends Component {
}
closeModal = (fk, callback) => {
const { dispatch } = this.props;
const {dispatch} = this.props;
const x = this.props.DataColumn.isShowModal;
x[fk] = false;
dispatch({
type: 'DataColumn/showModal',
payload: { isShowModal: x },
payload: {isShowModal: x},
callback: callback,
});
};
showModal = (fk, title, data, modalProps) => {
const { dispatch } = this.props;
const {dispatch} = this.props;
const x = this.props.DataColumn.isShowModal;
x[fk] = true;
dispatch({
type: 'DataColumn/showModal',
payload: { isShowModal: x },
payload: {isShowModal: x},
callback: () => {
this.setState({
modalInit: data,
......@@ -135,7 +134,7 @@ export default class tableCom extends Component {
file = {
name: 'file',
action: queryApiActionPath() + '/upload',
onChange: (info) => {
onChange: info => {
if (info.file.status !== 'uploading') {
this.setState({
img: info.file.response,
......@@ -153,10 +152,10 @@ export default class tableCom extends Component {
count = [];
handleSearch = (selectedKeys, confirm) => {
confirm();
this.setState({ searchText: selectedKeys[0] });
this.setState({searchText: selectedKeys[0]});
};
handleReset = (clearFilters) => {
handleReset = clearFilters => {
clearFilters();
this.resetSearchText();
};
......@@ -168,17 +167,17 @@ export default class tableCom extends Component {
};
getColumnSearchProps = (dataIndex, title) => ({
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => (
<div style={{ padding: 8 }}>
filterDropdown: ({setSelectedKeys, selectedKeys, confirm, clearFilters}) => (
<div style={{padding: 8}}>
<Input
ref={(node) => {
ref={node => {
this.searchInput = node;
}}
placeholder={`请输入${title}`}
value={selectedKeys[0]}
onChange={(e) => setSelectedKeys(e.target.value ? [e.target.value] : [])}
onChange={e => setSelectedKeys(e.target.value ? [e.target.value] : [])}
onPressEnter={() => this.handleSearch(selectedKeys, confirm)}
style={{ width: 188, marginBottom: 8, display: 'block' }}
style={{width: 188, marginBottom: 8, display: 'block'}}
/>
<Button
type="primary"
......@@ -186,21 +185,21 @@ export default class tableCom extends Component {
icon="search"
loading={this.props.loading}
size="small"
style={{ width: 90, marginRight: 8 }}>
style={{width: 90, marginRight: 8}}
>
搜索
</Button>
<Button
loading={this.props.loading}
onClick={() => this.handleReset(clearFilters)}
size="small"
style={{ width: 90 }}>
style={{width: 90}}
>
重置
</Button>
</div>
),
filterIcon: (filtered) => (
<Icon type="search" style={{ color: filtered ? '#1890ff' : 'red' }} />
),
filterIcon: filtered => <Icon type="search" style={{color: filtered ? '#1890ff' : 'red'}}/>,
onFilter: (value, record) =>
record[dataIndex]
? record[dataIndex]
......@@ -208,16 +207,16 @@ export default class tableCom extends Component {
.toLowerCase()
.includes(value.toLowerCase())
: '',
onFilterDropdownVisibleChange: (visible) => {
onFilterDropdownVisibleChange: visible => {
if (visible) {
setTimeout(() => this.searchInput.select());
}
},
render: (text) => {
render: text => {
if (text != null) {
return (
<Highlighter
highlightStyle={{ backgroundColor: '#ffc069', padding: 0 }}
highlightStyle={{backgroundColor: '#ffc069', padding: 0}}
searchWords={[this.state.searchText]}
autoEscape
textToHighlight={text.toString()}
......@@ -241,7 +240,7 @@ export default class tableCom extends Component {
};
componentWillReceiveProps(props) {
const { json, mapData, obj } = props;
const {json, mapData, obj} = props;
if (json == null || this.props.safe) {
return;
}
......@@ -268,7 +267,15 @@ export default class tableCom extends Component {
if (obj2 != null && obj2[props.fatherCode]) {
childObj2 = obj2[props.fatherCode][props.index];
bb2 = equal(this.childObj, childObj2, json, this.state.sqlContent, 1, this.props, this.excludeKeys);
bb2 = equal(
this.childObj,
childObj2,
json,
this.state.sqlContent,
1,
this.props,
this.excludeKeys,
);
}
}
......@@ -316,10 +323,10 @@ export default class tableCom extends Component {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: {base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}`}
: bindObj;
if (this.props.fatherCode == null && dataColumn == null)
dataColumn = { base52: this.props.uuid };
dataColumn = {base52: this.props.uuid};
if (!this.props.isEdit && this.props.fatherCode) {
if (bindObj != null) {
......@@ -347,19 +354,19 @@ export default class tableCom extends Component {
getData = (json, dataColumn, obj, init) => {
const allValues = JSON.stringify(obj);
if (json.comName == 'TableSelect') {
const { dispatch } = this.props;
const { sqlKey, optionType } = json;
const {dispatch} = this.props;
const {sqlKey, optionType} = json;
if (optionType == 'sql') {
dispatch({
type: 'SqlManageEntity/find',
payload: { sqlKey: sqlKey },
callback: (sqlModel) => {
this.setState({ sqlModel });
payload: {sqlKey: sqlKey},
callback: sqlModel => {
this.setState({sqlModel});
if (sqlModel.dataObjId) {
dispatch({
type: 'formList/getHead',
payload: { dataObjId: sqlModel.dataObjId },
callback: (datas) => {
payload: {dataObjId: sqlModel.dataObjId},
callback: datas => {
if (datas) {
const columns = [];
for (var i = 0; i < datas.length; i++) {
......@@ -370,14 +377,14 @@ export default class tableCom extends Component {
if (
['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)
) {
column.render = (val) => moment(val).format('YYYY-MM-DD HH:mm:ss');
column.render = val => moment(val).format('YYYY-MM-DD HH:mm:ss');
}
columns.push(column);
} else {
break;
}
}
this.setState({ columns });
this.setState({columns});
}
},
});
......@@ -404,7 +411,7 @@ export default class tableCom extends Component {
break;
}
column.render = (val) => moment(parseInt(val)).format(ff);
column.render = val => moment(parseInt(val)).format(ff);
}
if (cll[k].isQuery) {
column = {
......@@ -415,18 +422,18 @@ export default class tableCom extends Component {
columns.push(column);
}
this.setState({ columns });
this.setState({columns});
}
dispatch({
type: 'DataColumn/getSqlData',
payload: { sqlKey, allValues },
callback: (list) => {
payload: {sqlKey, allValues},
callback: list => {
const x = {
list: list,
pagination: false,
};
this.setState({ dataSource: x });
this.setState({dataSource: x});
},
});
}
......@@ -435,8 +442,8 @@ export default class tableCom extends Component {
} else if (optionType == 'reference' && dataColumn.referenceObjId) {
dispatch({
type: 'formList/getHead',
payload: { dataObjId: dataColumn.referenceObjId },
callback: (datas) => {
payload: {dataObjId: dataColumn.referenceObjId},
callback: datas => {
if (datas) {
const columns = [];
for (var i = 0; i < datas.length; i++) {
......@@ -445,14 +452,14 @@ export default class tableCom extends Component {
column.title = datas[i].title;
column.dataIndex = datas[i].name;
if (['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)) {
column.render = (val) => moment(val).format('YYYY-MM-DD HH:mm:ss');
column.render = val => moment(val).format('YYYY-MM-DD HH:mm:ss');
}
columns.push(column);
} else {
break;
}
}
this.setState({ columns });
this.setState({columns});
}
},
});
......@@ -496,14 +503,14 @@ export default class tableCom extends Component {
if (json.funcs != null && json.funcs != '') {
if (json.comName == 'Cascader') {
try {
this.getFunctionValue(json.funcs, { base52: this.props.uuid }, json, () => {
this.getFunctionValue(json.funcs, {base52: this.props.uuid}, json, () => {
if (init != null && Object.keys(init).length > 0) {
let base52 = dataColumn.base52;
let vlu = this.props.form.getFieldsValue()[base52];
const labs = [];
this.searchJson(vlu, this.state.options, 0, labs);
this.setState({ labels: labs });
this.setState({labels: labs});
} else if (!this.props.isEdit && Object.keys(obj).length > 0) {
let base52 = dataColumn.base52;
......@@ -511,7 +518,7 @@ export default class tableCom extends Component {
const labs = [];
this.searchJson(vlu, this.state.options, 0, labs);
this.setState({ labels: labs });
this.setState({labels: labs});
}
});
} catch (e) {
......@@ -519,7 +526,7 @@ export default class tableCom extends Component {
}
} else {
try {
this.getFunctionValue(json.funcs, { base52: this.props.uuid }, json, () => {
this.getFunctionValue(json.funcs, {base52: this.props.uuid}, json, () => {
if (init != null && Object.keys(init).length > 0) {
let base52 = dataColumn.base52;
let vlu = this.props.form.getFieldsValue()[base52];
......@@ -539,7 +546,7 @@ export default class tableCom extends Component {
}
}
this.setState({ labels: labs });
this.setState({labels: labs});
} else if (!this.props.isEdit && Object.keys(obj).length > 0) {
let base52 = dataColumn.base52;
......@@ -561,7 +568,7 @@ export default class tableCom extends Component {
}
}
this.setState({ labels: labs });
this.setState({labels: labs});
}
});
} catch (e) {
......@@ -596,7 +603,7 @@ export default class tableCom extends Component {
if (url.indexOf('http') === -1) {
url = config.httpServer + url;
}
const { reqUrls } = this.state;
const {reqUrls} = this.state;
if (reqUrls[url] != null) {
const ps = reqUrls[url].params;
......@@ -619,7 +626,7 @@ export default class tableCom extends Component {
}
}
} else {
reqUrls[url] = { params: params };
reqUrls[url] = {params: params};
isChange = true;
}
......@@ -631,7 +638,7 @@ export default class tableCom extends Component {
const res = callback(data);
if (res != null && !(typeof res === 'function')) {
this.setState({ options: res, selectDis: false }, () => {
this.setState({options: res, selectDis: false}, () => {
if (orgCallback) orgCallback();
});
}
......@@ -654,7 +661,7 @@ export default class tableCom extends Component {
try {
const x = callback(data);
if (x != null) {
this.setState({ option: x });
this.setState({option: x});
}
} catch (e) {
console.log(
......@@ -667,7 +674,7 @@ export default class tableCom extends Component {
if (base52) {
try {
const x = callback(data);
if (x == null || x != 'NaN') this.props.form.setFieldsValue({ [base52]: x });
if (x == null || x != 'NaN') this.props.form.setFieldsValue({[base52]: x});
} catch (e) {
console.log(
`页面${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
......@@ -705,20 +712,20 @@ export default class tableCom extends Component {
data: requestParams,
method: method,
requestType: 'form',
}).then((data) => {
}).then(data => {
// if (!data || !Array.isArray(data)) {
// data = [];
// }
const { reqUrls } = this.state;
if(reqUrls && reqUrls[url]){
const {reqUrls} = this.state;
if (reqUrls && reqUrls[url]) {
reqUrls[url].data = data;
}
this.setState({ res: data, reqUrls }, () => {
this.setState({res: data, reqUrls}, () => {
if (callback) {
if (json.optionType && json.optionType == 'func') {
const res = callback(data);
if (res != null && !(typeof res === 'function')) {
this.setState({ options: res, selectDis: false }, () => {
this.setState({options: res, selectDis: false}, () => {
if (orgCallback) orgCallback();
});
}
......@@ -740,7 +747,7 @@ export default class tableCom extends Component {
try {
const x = callback(data);
if (x != null) {
this.setState({ option: x });
this.setState({option: x});
}
} catch (e) {
console.log(
......@@ -753,7 +760,7 @@ export default class tableCom extends Component {
if (base52) {
try {
const x = callback(data);
if (x == null || x != 'NaN') this.props.form.setFieldsValue({ [base52]: x });
if (x == null || x != 'NaN') this.props.form.setFieldsValue({[base52]: x});
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
......@@ -772,7 +779,7 @@ export default class tableCom extends Component {
sqlUtil = (base52, json, orgCallback, sqlKey, params, callback, options = {}) => {
//查缓存
var isChange = false;
const { sqlKeys } = this.state;
const {sqlKeys} = this.state;
if (sqlKeys[sqlKey] != null) {
const ps = sqlKeys[sqlKey].params;
......@@ -801,7 +808,7 @@ export default class tableCom extends Component {
}
}
} else {
sqlKeys[sqlKey] = { params: params, options: options };
sqlKeys[sqlKey] = {params: params, options: options};
isChange = true;
}
if (!isChange) {
......@@ -810,7 +817,7 @@ export default class tableCom extends Component {
if (json.optionType && json.optionType == 'func') {
const res = callback(data);
if (res != null && !(typeof res === 'function')) {
this.setState({ options: res, selectDis: false }, () => {
this.setState({options: res, selectDis: false}, () => {
if (orgCallback) orgCallback();
});
}
......@@ -832,7 +839,7 @@ export default class tableCom extends Component {
try {
const x = callback(data);
if (x != null) {
this.setState({ option: x });
this.setState({option: x});
}
} catch (e) {
console.log(
......@@ -845,7 +852,7 @@ export default class tableCom extends Component {
if (base52) {
try {
const x = callback(data);
if (x == null || x != 'NaN') this.props.form.setFieldsValue({ [base52]: x });
if (x == null || x != 'NaN') this.props.form.setFieldsValue({[base52]: x});
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
......@@ -860,7 +867,7 @@ export default class tableCom extends Component {
}
const url = queryApiActionPath() + '/DataColumnApi/getSqlData';
this.setState({ sqlKeys }, () => {
this.setState({sqlKeys}, () => {
const umiRequest = extend({
errorHandler, // 默认错误处理
credentials: options.credentials || 'omit', // 默认请求是否带上cookie
......@@ -872,7 +879,7 @@ export default class tableCom extends Component {
...this.props.defaultValues[this.props.formKey],
...options,
});
const pp = { sqlKey: Base16Encode(sqlKey), params, allValues: Base16Encode(allValues) };
const pp = {sqlKey: Base16Encode(sqlKey), params, allValues: Base16Encode(allValues)};
if (getToken() != null) {
pp.token = getToken();
}
......@@ -881,10 +888,10 @@ export default class tableCom extends Component {
data: pp,
method: 'POST',
requestType: 'form',
}).then((data) => {
const { sqlKeys } = this.state;
}).then(data => {
const {sqlKeys} = this.state;
sqlKeys[sqlKey].data = data;
this.setState({ sqlKeys });
this.setState({sqlKeys});
if (data == null) {
return;
}
......@@ -894,7 +901,7 @@ export default class tableCom extends Component {
const res = callback(data);
if (res != null && !(typeof res === 'function')) {
this.setState({ options: res, selectDis: false }, () => {
this.setState({options: res, selectDis: false}, () => {
if (orgCallback) orgCallback();
});
}
......@@ -916,7 +923,7 @@ export default class tableCom extends Component {
try {
const x = callback(data);
if (x != null) {
this.setState({ option: x });
this.setState({option: x});
}
} catch (e) {
console.log(
......@@ -929,7 +936,7 @@ export default class tableCom extends Component {
if (base52) {
try {
const x = callback(data);
if (x == null || x != 'NaN') this.props.form.setFieldsValue({ [base52]: x });
if (x == null || x != 'NaN') this.props.form.setFieldsValue({[base52]: x});
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
......@@ -955,8 +962,8 @@ export default class tableCom extends Component {
* 动态生成表单配置函数所使用
*/
let functionObj = {};
formulaList.map((item) => {
item.children.map((arr) => {
formulaList.map(item => {
item.children.map(arr => {
functionObj[arr.callKey] = arr.function;
});
});
......@@ -1042,7 +1049,7 @@ export default class tableCom extends Component {
return value;
} else if (json.optionType && json.optionType == 'func') {
if (value != null && !(typeof value === 'function')) {
this.setState({ options: value, selectDis: false }, () => {
this.setState({options: value, selectDis: false}, () => {
if (callback) callback();
});
}
......@@ -1051,10 +1058,10 @@ export default class tableCom extends Component {
json.comName == 'QRCode' ||
json.comName == 'Graph'
) {
this.setState({ option: value });
this.setState({option: value});
} else {
try {
this.props.form.setFieldsValue({ [base52]: value });
this.props.form.setFieldsValue({[base52]: value});
} catch {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
......@@ -1075,17 +1082,17 @@ export default class tableCom extends Component {
};
componentDidMount() {
const { json, mapData, obj, init } = this.props;
const {json, mapData, obj, init} = this.props;
if (json == null) {
return;
}
if (json.sqlKey != null && json.sqlKey != '') {
const { dispatch } = this.props;
const {dispatch} = this.props;
dispatch({
type: 'SqlManageEntity/find',
payload: { sqlKey: json.sqlKey },
callback: (res) => {
this.setState({ sqlContent: res.sql });
payload: {sqlKey: json.sqlKey},
callback: res => {
this.setState({sqlContent: res.sql});
},
});
}
......@@ -1099,10 +1106,10 @@ export default class tableCom extends Component {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: {base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}`}
: bindObj;
if (this.props.fatherCode == null && dataColumn == null)
dataColumn = { base52: this.props.uuid };
dataColumn = {base52: this.props.uuid};
if (!this.props.isEdit && this.props.fatherCode) {
if (bindObj != null) {
......@@ -1119,13 +1126,13 @@ export default class tableCom extends Component {
}
fetchData3 = (obj, dataColumn, init, sqlKey, labelName, valueName, allValues) => {
const { dispatch } = this.props;
const {dispatch} = this.props;
if (init != null && Object.keys(init).length > 0) {
dispatch({
type: 'DataColumn/getSqlOptions',
payload: { sqlKey, allValues },
callback: (options) => {
payload: {sqlKey, allValues},
callback: options => {
const optionsx = [];
let base52 = dataColumn.base52;
let vl = this.props.form.getFieldsValue()[base52];
......@@ -1141,9 +1148,9 @@ export default class tableCom extends Component {
}
if (!isExist && vl != null && options.length > 0) {
this.props.form.setFieldsValue({ [base52]: null });
this.props.form.setFieldsValue({[base52]: null});
}
this.setState({ options: optionsx, selectDis: false });
this.setState({options: optionsx, selectDis: false});
},
});
} else if (!this.props.isEdit && Object.keys(obj).length > 0) {
......@@ -1155,17 +1162,17 @@ export default class tableCom extends Component {
if (obj[base52]) {
dispatch({
type: 'DataColumn/getSqlLabels',
payload: { sqlKey, values: obj[base52], labelName, valueName, allValues },
callback: (labels) => {
this.setState({ labels, selectDis: false });
payload: {sqlKey, values: obj[base52], labelName, valueName, allValues},
callback: labels => {
this.setState({labels, selectDis: false});
},
});
}
} else {
dispatch({
type: 'DataColumn/getSqlOptions',
payload: { sqlKey, allValues },
callback: (options) => {
payload: {sqlKey, allValues},
callback: options => {
let base52 = dataColumn.base52;
let vl = this.props.form.getFieldsValue()[base52];
const optionsx = [];
......@@ -1182,10 +1189,10 @@ export default class tableCom extends Component {
if (!isExist && vl != null && options.length > 0) {
//console.log("isExist",optionsx,vl,isExist)
this.props.form.setFieldsValue({ [base52]: null });
this.props.form.setFieldsValue({[base52]: null});
}
this.setState({ options: optionsx, selectDis: false });
this.setState({options: optionsx, selectDis: false});
},
});
}
......@@ -1212,19 +1219,19 @@ export default class tableCom extends Component {
}
}
this.setState({ labels: labels, selectDis: false });
this.setState({labels: labels, selectDis: false});
} else {
this.setState({ options: options, selectDis: false });
this.setState({options: options, selectDis: false});
}
};
fetchData = (obj, dataColumn, init, filterSql, allValues) => {
const { dispatch } = this.props;
const {dispatch} = this.props;
if (init != null && Object.keys(init).length > 0) {
dispatch({
type: 'DataColumn/getOptions',
payload: { id: dataColumn.id, filterSql, allValues },
callback: (options) => {
payload: {id: dataColumn.id, filterSql, allValues},
callback: options => {
const optionsx = [];
for (var i = 0; i < options.length; i++) {
optionsx.push({
......@@ -1232,24 +1239,24 @@ export default class tableCom extends Component {
value: options[i][dataColumn.referenceCodeName],
});
}
this.setState({ options: optionsx, selectDis: false });
this.setState({options: optionsx, selectDis: false});
},
});
} else if (!this.props.isEdit && Object.keys(obj).length > 0) {
if (obj[dataColumn.base52]) {
dispatch({
type: 'DataColumn/getLabels',
payload: { id: dataColumn.id, values: obj[dataColumn.base52], filterSql, allValues },
callback: (labels) => {
this.setState({ labels, selectDis: false });
payload: {id: dataColumn.id, values: obj[dataColumn.base52], filterSql, allValues},
callback: labels => {
this.setState({labels, selectDis: false});
},
});
}
} else {
dispatch({
type: 'DataColumn/getOptions',
payload: { id: dataColumn.id, filterSql, allValues },
callback: (options) => {
payload: {id: dataColumn.id, filterSql, allValues},
callback: options => {
const optionsx = [];
for (var i = 0; i < options.length; i++) {
optionsx.push({
......@@ -1257,13 +1264,13 @@ export default class tableCom extends Component {
value: options[i][dataColumn.referenceCodeName],
});
}
this.setState({ options: optionsx, selectDis: false });
this.setState({options: optionsx, selectDis: false});
},
});
}
};
getColumn = (key) => {
let { mapData, json } = this.props;
getColumn = key => {
let {mapData, json} = this.props;
const columnIds = json.columnIds;
......@@ -1282,6 +1289,7 @@ export default class tableCom extends Component {
};
render() {
/**
* json为申请表单
* obj为查看详情用户输入值
......@@ -1305,8 +1313,8 @@ export default class tableCom extends Component {
currentFormTitle,
getCellValue,
} = this.props;
const { options, labels, selectDis, modalCode, modalTitle, modalInit, modalProps } = this.state;
const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form;
const {options, labels, selectDis, modalCode, modalTitle, modalInit, modalProps} = this.state;
const {getFieldDecorator, getFieldError, getFieldProps} = this.props.form;
const disabled = json != null ? json.disabled : false;
const permRank = json != null ? (json.permRank != null ? json.permRank : 0) : 0;
if (json == null) {
......@@ -1323,12 +1331,12 @@ export default class tableCom extends Component {
this.state.option.value == null
)
return <></>;
return <QRCode {...this.state.option} key={this.props.uuid} />;
return <QRCode {...this.state.option} key={this.props.uuid}/>;
}
if (json.comName == 'Echart') {
return (
<ReactEcharts
style={{ height: json.height || 500 }}
style={{height: json.height || 500}}
key={this.props.uuid}
option={this.state.option || {}}
notMerge={true}
......@@ -1339,7 +1347,7 @@ export default class tableCom extends Component {
);
}
if (json.comName == 'Graph') {
return <Neo4jD3Com key={this.props.uuid} json={json} option={this.state.option || []} />;
return <Neo4jD3Com key={this.props.uuid} json={json} option={this.state.option || []}/>;
}
if (json.comName == 'PartForm') {
......@@ -1354,7 +1362,7 @@ export default class tableCom extends Component {
<>
{this.props.form.getFieldDecorator(this.props.uuid, {
initialValue: fk,
})(<Input type="hidden" />)}{' '}
})(<Input type="hidden"/>)}{' '}
<ZdyTable
taskId={this.props.taskId}
setRealTimeValues={this.props.setRealTimeValues}
......@@ -1391,7 +1399,7 @@ export default class tableCom extends Component {
if (json.comName == 'Excel') {
const value = getCellValue(i, j, currentFormTitle);
const xx = (
<div style={{ textAlign: 'center', height: value == null ? 20 : null }}>{value}</div>
<div style={{textAlign: 'center', height: value == null ? 20 : null}}>{value}</div>
);
return xx;
}
......@@ -1410,15 +1418,16 @@ export default class tableCom extends Component {
<>
{this.props.form.getFieldDecorator(uid, {
initialValue: obj[this.props.uuid] || json.initialValue,
})(<Input type="hidden" />)}
})(<Input type="hidden"/>)}
<span
style={{
fontWeight: get == 'mobile' ? 'bold' : '',
marginRight: get == 'mobile' ? 12 : '',
}}
{...json.props}>
{obj[this.props.uuid] || json.initialValue}
</span>
{...json.props}
>
{obj[this.props.uuid] || json.initialValue}
</span>
</>
);
} else {
......@@ -1426,15 +1435,16 @@ export default class tableCom extends Component {
<>
{this.props.form.getFieldDecorator(uid, {
initialValue: this.props.form.getFieldsValue()[uid] || json.initialValue,
})(<Input type="hidden" />)}
})(<Input type="hidden"/>)}
<span
style={{
fontWeight: get == 'mobile' ? 'bold' : '',
marginRight: get == 'mobile' ? 12 : '',
}}
{...json.props}>
{this.props.form.getFieldsValue()[uid]}
</span>
{...json.props}
>
{this.props.form.getFieldsValue()[uid]}
</span>
</>
);
}
......@@ -1459,53 +1469,53 @@ export default class tableCom extends Component {
case 'TextArea':
cm = (
<span>
{value}
{get === 'mobile' ? <br /> : ''}
</span>
{value}
{get === 'mobile' ? <br/> : ''}
</span>
);
break;
case 'Switch':
cm = (
<span>
{value}
{get === 'mobile' ? <br /> : ''}
</span>
{value}
{get === 'mobile' ? <br/> : ''}
</span>
);
break;
case 'Input':
cm = (
<span style={{ paddingRight: get == 'mobile' ? 8 : '' }}>
{value}
{get === 'mobile' ? <br /> : ''}
</span>
<span style={{paddingRight: get == 'mobile' ? 8 : ''}}>
{value}
{get === 'mobile' ? <br/> : ''}
</span>
);
break;
case 'Cron':
cm = (
<span style={{ paddingRight: get == 'mobile' ? 8 : '' }}>
{value}
{get === 'mobile' ? <br /> : ''}
</span>
<span style={{paddingRight: get == 'mobile' ? 8 : ''}}>
{value}
{get === 'mobile' ? <br/> : ''}
</span>
);
break;
case 'InputNumber':
cm = (
<span>
{value}
{get === 'mobile' ? <br /> : ''}
</span>
{value}
{get === 'mobile' ? <br/> : ''}
</span>
);
break;
case 'DatePicker':
cm = value ? (
<span>
{moment(parseInt(value)).format('YYYY-MM-DD HH:mm:ss')}
{get === 'mobile' ? <br /> : ''}
</span>
{moment(parseInt(value)).format('YYYY-MM-DD HH:mm:ss')}
{get === 'mobile' ? <br/> : ''}
</span>
) : (
''
);
......@@ -1524,7 +1534,7 @@ export default class tableCom extends Component {
return (
<img
key={index2}
style={{ width: 100, height: 100 }}
style={{width: 100, height: 100}}
src={queryApiActionPath() + f.path}
/>
);
......@@ -1538,22 +1548,22 @@ export default class tableCom extends Component {
);
})}
</ul>
{get === 'mobile' ? <br /> : ''}
{get === 'mobile' ? <br/> : ''}
</>
);
break;
case 'ImgUploadCom':
if (value == null || value == '') {
cm = <div style={{ width: json.width, height: json.height }} />;
cm = <div style={{width: json.width, height: json.height}}/>;
} else {
cm = (
<>
<img
src={config.httpServer + value}
style={{ width: json.width, height: json.height }}
style={{width: json.width, height: json.height}}
/>
{get === 'mobile' ? <br /> : ''}
{get === 'mobile' ? <br/> : ''}
</>
);
}
......@@ -1561,15 +1571,15 @@ export default class tableCom extends Component {
break;
case 'VideoUploadCom':
if (value == null || value == '') {
cm = <div style={{ width: json.width, height: json.height }} />;
cm = <div style={{width: json.width, height: json.height}}/>;
} else {
cm = (
<>
<img
src={config.httpServer + value}
style={{ width: json.width, height: json.height }}
style={{width: json.width, height: json.height}}
/>
{get === 'mobile' ? <br /> : ''}
{get === 'mobile' ? <br/> : ''}
</>
);
}
......@@ -1584,9 +1594,10 @@ export default class tableCom extends Component {
return (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}
>
{cm}
</MobileItem>
);
......@@ -1595,14 +1606,15 @@ export default class tableCom extends Component {
<>
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}
>
{cm}
</MobileItem>
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type="hidden" />)}
})(<Input type="hidden"/>)}
</>
);
}
......@@ -1615,7 +1627,7 @@ export default class tableCom extends Component {
{cm}
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type="hidden" />)}
})(<Input type="hidden"/>)}
</>
);
}
......@@ -1629,7 +1641,8 @@ export default class tableCom extends Component {
style={{
minHeight: 40,
lineHeight: '40px',
}}>
}}
>
<Col
className={json.label ? json.label : sqlData[key] ? styles.row_col_div : ''}
span={json.labelSpan}
......@@ -1640,7 +1653,8 @@ export default class tableCom extends Component {
overflow: 'hidden',
fontSize: 14,
color: 'rgba(0,0,0,0.85)',
}}>
}}
>
{json.label ? (
<>
{json.label}
......@@ -1649,9 +1663,10 @@ export default class tableCom extends Component {
position: 'relative',
top: '-0.5px',
margin: '0 8px 0 2px',
}}>
:
</span>
}}
>
:
</span>
</>
) : sqlData[key] ? (
<>
......@@ -1661,9 +1676,10 @@ export default class tableCom extends Component {
position: 'relative',
top: '-0.5px',
margin: '0 8px 0 2px',
}}>
:
</span>
}}
>
:
</span>
</>
) : (
''
......@@ -1676,7 +1692,8 @@ export default class tableCom extends Component {
lineHeight: '40px',
zoom: 1,
fontSize: 14,
}}>
}}
>
{cm}
</Col>
</Row>
......@@ -1684,9 +1701,10 @@ export default class tableCom extends Component {
} else {
return (
<Form.Item
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}
>
{cm}
</Form.Item>
);
......@@ -1695,14 +1713,15 @@ export default class tableCom extends Component {
return (
<>
<Form.Item
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}
>
{cm}
</Form.Item>
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type="hidden" />)}
})(<Input type="hidden"/>)}
</>
);
}
......@@ -1715,7 +1734,7 @@ export default class tableCom extends Component {
{cm}
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type="hidden" />)}
})(<Input type="hidden"/>)}
</>
);
}
......@@ -1734,11 +1753,11 @@ export default class tableCom extends Component {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: {base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}`}
: bindObj;
if (this.props.fatherCode == null && dataColumn == null) {
dataColumn = { base52: this.props.uuid };
dataColumn = {base52: this.props.uuid};
}
if (dataColumn.isNull != null && !dataColumn.isNull) {
required = true;
......@@ -1746,7 +1765,7 @@ export default class tableCom extends Component {
var title = json.label || (dataColumn && dataColumn.title);
var initValue;
const objinit = { ...init, ...obj };
const objinit = {...init, ...obj};
if (objinit != null && Object.keys(objinit).length > 0) {
if (this.props.fatherCode != null) {
......@@ -1800,9 +1819,10 @@ export default class tableCom extends Component {
<span
style={{
wordBreak: 'break-all',
}}>
{obj[dataColumn.base52]}
</span>
}}
>
{obj[dataColumn.base52]}
</span>
);
break;
case 'Switch':
......@@ -1814,9 +1834,10 @@ export default class tableCom extends Component {
<span
style={{
wordBreak: 'break-all',
}}>
{obj[dataColumn.base52]}
</span>
}}
>
{obj[dataColumn.base52]}
</span>
);
break;
......@@ -1842,23 +1863,22 @@ export default class tableCom extends Component {
case 'Checkbox':
cm = (
<span>
{labels != null
? labels.map(
(r, i) =>
i == 0 ? (
typeof r == 'string' ? (
<span>{r}</span>
) : (
Object.values(r)
)
) : typeof r == 'string' ? (
<span style={{ marginLeft: 12 }}>{r}</span>
{labels != null
? labels.map((r, i) =>
i == 0 ? (
typeof r == 'string' ? (
<span>{r}</span>
) : (
',' + Object.values(r)
),
Object.values(r)
)
) : typeof r == 'string' ? (
<span style={{marginLeft: 12}}>{r}</span>
) : (
',' + Object.values(r)
),
)
: ''}
</span>
</span>
);
break;
......@@ -1887,8 +1907,8 @@ export default class tableCom extends Component {
} else {
cm = (
<span>
{ds.map((r, i) => (i == 0 ? r[json.labelName] : ',' + r[json.labelName]))}
</span>
{ds.map((r, i) => (i == 0 ? r[json.labelName] : ',' + r[json.labelName]))}
</span>
);
}
......@@ -1900,7 +1920,11 @@ export default class tableCom extends Component {
if (initValue != null && init != null) {
ivs.push(moment(parseInt(initValue)));
if (end != null) ivs.push(moment(parseInt(init[end.base52])));
if (end != null && init[end.base52]) {
ivs.push(moment(parseInt(init[end.base52])));
}else{
ivs.push(moment());
}
}
if (begin != null && end != null) {
if (!obj[begin.base52]) {
......@@ -1908,14 +1932,14 @@ export default class tableCom extends Component {
} else {
cm = (
<span>
{moment(parseInt(obj[begin.base52])).format(
{moment(parseInt(obj[begin.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '}
{' '}
{moment(parseInt(obj[end.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}
</span>
</span>
);
}
} else {
......@@ -1927,20 +1951,20 @@ export default class tableCom extends Component {
if (obj[dataColumn.base52] && obj[dataColumn.base52].indexOf('-') === -1) {
cm = (
<span>
{moment(parseInt(obj[dataColumn.base52])).format(
{moment(parseInt(obj[dataColumn.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}
</span>
</span>
);
} else {
cm = (
<span>
{obj[dataColumn.base52]
{obj[dataColumn.base52]
? moment(+new Date(obj[dataColumn.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)
: ''}
</span>
</span>
);
}
......@@ -1980,7 +2004,7 @@ export default class tableCom extends Component {
if (get === 'web' && !this.props.isPrint) {
return (
<li key={index2}>
<FilePreview path={queryApiActionPath() + f.path} pathName={f.name} />
<FilePreview path={queryApiActionPath() + f.path} pathName={f.name}/>
</li>
);
}
......@@ -2012,7 +2036,7 @@ export default class tableCom extends Component {
if (get === 'web' || !this.props.isPrint) {
return (
<li key={index2}>
<FilePreview path={queryApiActionPath() + f.path} pathName={f.name} />
<FilePreview path={queryApiActionPath() + f.path} pathName={f.name}/>
</li>
);
}
......@@ -2021,7 +2045,8 @@ export default class tableCom extends Component {
<a
target="_blank"
key={f.filePath}
href={queryApiActionPath() + f.filePath}>
href={queryApiActionPath() + f.filePath}
>
{f.fileName}
</a>
</li>
......@@ -2032,9 +2057,9 @@ export default class tableCom extends Component {
}
} else {
cm = (
<span style={{ display: 'inline-block', width: '100%', textAlign: 'center' }}>
暂无附件
</span>
<span style={{display: 'inline-block', width: '100%', textAlign: 'center'}}>
暂无附件
</span>
);
}
......@@ -2060,7 +2085,7 @@ export default class tableCom extends Component {
) : (
<img
src={config.httpServer + obj[dataColumn.base52]}
style={{ width: json.width, height: json.height }}
style={{width: json.width, height: json.height}}
/>
);
}
......@@ -2087,7 +2112,7 @@ export default class tableCom extends Component {
) : (
<img
src={config.httpServer + obj[dataColumn.base52]}
style={{ width: json.width, height: json.height }}
style={{width: json.width, height: json.height}}
/>
);
}
......@@ -2153,7 +2178,7 @@ export default class tableCom extends Component {
let events = {};
if (json.events != null) {
events = this.getFunctionValue(json.events, { base52: this.props.uuid }, json);
events = this.getFunctionValue(json.events, {base52: this.props.uuid}, json);
}
if (events && events.dom) {
cm = events.dom;
......@@ -2173,7 +2198,7 @@ export default class tableCom extends Component {
case 'LocationCom':
cm = (
<span>
<LocationCom
<LocationCom
get={get}
btnName={json.btnName}
btnSucName={json.btnSucName}
......@@ -2182,7 +2207,7 @@ export default class tableCom extends Component {
showMap={json.showMap}
value={obj[dataColumn.base52]}
/>
</span>
</span>
);
break;
......@@ -2209,10 +2234,10 @@ export default class tableCom extends Component {
default:
cm = (
<span>
缺乏字段
缺乏字段
{json.comName}
的匹配项
</span>
</span>
);
break;
}
......@@ -2234,7 +2259,7 @@ export default class tableCom extends Component {
let events = {};
if (json.events != null) {
events = this.getFunctionValue(json.events, { base52: this.props.uuid }, json);
events = this.getFunctionValue(json.events, {base52: this.props.uuid}, json);
}
if (events && events.dom) {
cm = events.dom;
......@@ -2258,10 +2283,10 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请输入' + title }],
: [{required: required, message: '请输入' + title}],
})(
<TextArea
autoSize={{ minRows: 4 }}
autoSize={{minRows: 4}}
disabled={disabled}
placeholder={json.placeholder}
/>,
......@@ -2290,9 +2315,10 @@ export default class tableCom extends Component {
) {
cm = (
<Form.Item
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</Form.Item>
);
......@@ -2304,10 +2330,10 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请输入' + title }],
: [{required: required, message: '请输入' + title}],
})(
<TextArea
autoSize={{ minRows: 4 }}
autoSize={{minRows: 4}}
disabled={disabled}
rows={4}
placeholder={json.placeholder}
......@@ -2330,17 +2356,18 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请选择' + title }],
: [{required: required, message: '请选择' + title}],
})}
disabled={disabled}
onClick={(checked) => {
onClick={checked => {
// set new value
this.props.form.setFieldsValue({
[dataColumn.base52]: checked,
});
}}
/>
}>
}
>
{(json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel)
? title
......@@ -2360,7 +2387,7 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请选择' + title }],
: [{required: required, message: '请选择' + title}],
})(
<Switch
disabled={disabled}
......@@ -2377,11 +2404,11 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请输入' + title }],
: [{required: required, message: '请输入' + title}],
})(
<Input
disabled={disabled}
style={{ width: json.width }}
style={{width: json.width}}
placeholder={json.placeholder}
/>,
);
......@@ -2395,9 +2422,10 @@ export default class tableCom extends Component {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
......@@ -2407,7 +2435,7 @@ export default class tableCom extends Component {
case 'InputHidden':
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
})(<Input type="hidden" />);
})(<Input type="hidden"/>);
break;
case 'InputNumber':
cm = getFieldDecorator(dataColumn.base52, {
......@@ -2415,7 +2443,7 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请输入' + title }],
: [{required: required, message: '请输入' + title}],
})(
<InputNumber
disabled={disabled}
......@@ -2436,9 +2464,10 @@ export default class tableCom extends Component {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
......@@ -2455,8 +2484,8 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请选择' + dataColumn.title }],
})(<Radio.Group options={options} disabled={disabled} />);
: [{required: required, message: '请选择' + dataColumn.title}],
})(<Radio.Group options={options} disabled={disabled}/>);
if (get == 'mobile') {
cm = <div>{cm}</div>;
if (
......@@ -2467,9 +2496,10 @@ export default class tableCom extends Component {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
......@@ -2489,8 +2519,8 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请选择' + dataColumn.title }],
})(<Checkbox.Group options={options} disabled={disabled} />)}
: [{required: required, message: '请选择' + dataColumn.title}],
})(<Checkbox.Group options={options} disabled={disabled}/>)}
</Flex>
);
......@@ -2502,9 +2532,10 @@ export default class tableCom extends Component {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
......@@ -2518,8 +2549,8 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请选择' + dataColumn.title }],
})(<Checkbox.Group options={options} disabled={disabled} />);
: [{required: required, message: '请选择' + dataColumn.title}],
})(<Checkbox.Group options={options} disabled={disabled}/>);
break;
case 'Select':
......@@ -2528,14 +2559,14 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请选择' + dataColumn.title }],
: [{required: required, message: '请选择' + dataColumn.title}],
})(
<Select
allowClear
showSearch
disabled={selectDis || disabled}
placeholder={json.placeholder}
style={{ width: json.width }}
style={{width: json.width}}
optionFilterProp="children"
getPopupContainer={
this.props.isDynamic && document.querySelector('#dynamic_div')
......@@ -2549,7 +2580,7 @@ export default class tableCom extends Component {
? setTimeout(() => {
if (document.querySelectorAll(`.ant-select-search__field`).length > 0) {
let ary = [...document.querySelectorAll(`.ant-select-search__field`)];
ary.map((item) => {
ary.map(item => {
item.setAttribute('readonly', 'readonly');
// setTimeout(() => {
// ary.map(arr => {
......@@ -2565,9 +2596,10 @@ export default class tableCom extends Component {
option
? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
: false
}>
}
>
{options && options instanceof Array
? options.map((r) => (
? options.map(r => (
<Option key={r.value} value={r.value}>
{r.label}
</Option>
......@@ -2584,9 +2616,10 @@ export default class tableCom extends Component {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
......@@ -2603,7 +2636,7 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请选择' + dataColumn.title }],
: [{required: required, message: '请选择' + dataColumn.title}],
})(
<Cascader
options={options}
......@@ -2618,23 +2651,17 @@ export default class tableCom extends Component {
: ''
}
placeholder={json.placeholder}
style={{ width: json.width }}
style={{width: json.width}}
/>,
);
if(get === 'mobile') {
if (get === 'mobile') {
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请选择' + dataColumn.title }],
})(
<MobileCascader options={options}
label={title}
disabled={disabled}
json={json}
/>);
: [{required: required, message: '请选择' + dataColumn.title}],
})(<MobileCascader options={options} label={title} disabled={disabled} json={json}/>);
}
if (
......@@ -2646,9 +2673,10 @@ export default class tableCom extends Component {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
......@@ -2702,9 +2730,10 @@ export default class tableCom extends Component {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
......@@ -2715,24 +2744,39 @@ export default class tableCom extends Component {
const begin = dataColumn;
var end = this.getColumn('c2');
if (end == null) {
end = { base52: this.props.uuid + '_2' };
end = {base52: this.props.uuid + '_2'};
}
const ivs = [];
// console.table(begin); // KLBqPJxzefU
// console.table(end); // KLBqPJydVnE
// console.table(ivs); // KLBqPJxzefU$KLBqPJydVnE
// console.table(init); // KLBqPJxzefU$KLBqPJydVnE
// console.log(typeof init);
if (initValue != null && init != null) {
ivs.push(moment(parseInt(initValue)));
ivs.push(moment(parseInt(init[end.base52])));
if(init && init[end.base52]){
ivs.push(moment(parseInt(init[end.base52])));
}else if(obj[end.base52]){
ivs.push(moment(parseInt(obj[end.base52])));
// 钟是志 2021年9月28日13:59:48
// 禅道bug http://scjoyedu.eicp.net:88/zentao/bug-view-21843.html
// 不知道怎么改 init 为空对象 暂时处理为从obj里面拿
}else{
ivs.push(moment());
}
}
if (!isEdit) {
cm = (
<span>
{moment(parseInt(obj[begin.base52])).format(
{moment(parseInt(obj[begin.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '}
{' '}
{moment(parseInt(obj[end.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}
</span>
</span>
);
} else {
if (get === 'mobile') {
......@@ -2741,8 +2785,8 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请选择起止时间' }],
})(<MobileDate disabled={disabled} formate={json.format} />);
: [{required: required, message: '请选择起止时间'}],
})(<MobileDate disabled={disabled} formate={json.format}/>);
if (
((json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel)) &&
......@@ -2751,21 +2795,23 @@ export default class tableCom extends Component {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
}
break;
}
cm = getFieldDecorator(begin.base52 + '$' + end.base52, {
initialValue: ivs,
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请选择起止时间' }],
: [{required: required, message: '请选择起止时间'}],
})(
<RangePicker
showTime={json.showTime != null ? json.showTime : true}
......@@ -2787,7 +2833,7 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请选择起止时间' }],
: [{required: required, message: '请选择起止时间'}],
})(
<DatePicker
disabled={disabled}
......@@ -2809,7 +2855,8 @@ export default class tableCom extends Component {
}
});
}
: () => {}
: () => {
}
}
format={json.format ? json.format : 'YYYY-MM-DD HH:mm:ss'}
/>,
......@@ -2823,9 +2870,10 @@ export default class tableCom extends Component {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
......@@ -2839,9 +2887,8 @@ export default class tableCom extends Component {
files = initValue.files;
}
cm = getFieldDecorator(dataColumn.base52, {
initialValue: { files: files },
initialValue: {files: files},
rules: [
{
validator: (rule, value, callback) => {
......@@ -2856,10 +2903,11 @@ export default class tableCom extends Component {
},
],
})(
<UploadCom isMultiple={json.isMultiple}
accept={json.accept}
btnName={json.btnName}
disabled={disabled || isPreview}
<UploadCom
isMultiple={json.isMultiple}
accept={json.accept}
btnName={json.btnName}
disabled={disabled || isPreview}
/>,
);
if (
......@@ -2871,9 +2919,10 @@ export default class tableCom extends Component {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
......@@ -2885,8 +2934,8 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请输入' }],
})(<DraftEditorCom placeholder={json.placeholder} />);
: [{required: required, message: '请输入'}],
})(<DraftEditorCom placeholder={json.placeholder}/>);
if (
get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) ||
......@@ -2896,9 +2945,10 @@ export default class tableCom extends Component {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
......@@ -2910,8 +2960,8 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请输入' + title }],
})(<CronEditor style={{ width: 600 }} />);
: [{required: required, message: '请输入' + title}],
})(<CronEditor style={{width: 600}}/>);
break;
case 'LocationCom':
cm = getFieldDecorator(dataColumn.base52, {
......@@ -2919,7 +2969,7 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请进行定位' }],
: [{required: required, message: '请进行定位'}],
})(
<LocationCom
get={get}
......@@ -2939,17 +2989,17 @@ export default class tableCom extends Component {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
}
break;
case 'ChildForm':
cm = getFieldDecorator(dataColumn.base52, { initialValue: initValue || {} })(
cm = getFieldDecorator(dataColumn.base52, {initialValue: initValue || {}})(
<ChildForm
taskId={this.props.taskId}
setRealTimeValues={this.props.setRealTimeValues}
......@@ -2986,9 +3036,10 @@ export default class tableCom extends Component {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
......@@ -3000,8 +3051,8 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请上传图片' }],
})(<ImgUploadCom json={json} disabled={disabled} />);
: [{required: required, message: '请上传图片'}],
})(<ImgUploadCom json={json} disabled={disabled}/>);
if (
get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) ||
......@@ -3011,9 +3062,10 @@ export default class tableCom extends Component {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
......@@ -3025,8 +3077,8 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请上传视频' }],
})(<VideoUploadCom json={json} disabled={disabled} />);
: [{required: required, message: '请上传视频'}],
})(<VideoUploadCom json={json} disabled={disabled}/>);
if (
get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) ||
......@@ -3036,9 +3088,10 @@ export default class tableCom extends Component {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
......@@ -3050,7 +3103,7 @@ export default class tableCom extends Component {
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请进行签名' }],
: [{required: required, message: '请进行签名'}],
})(
<Signature
width={
......@@ -3070,9 +3123,10 @@ export default class tableCom extends Component {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
);
......@@ -3110,13 +3164,14 @@ export default class tableCom extends Component {
if (json.isLabel) {
if (get === 'mobile' && !this.props.isEdit) {
return (
<Card style={{ margin: 5, border: '1px solid #ccc' }}>
<Card style={{margin: 5, border: '1px solid #ccc'}}>
{modalCode ? (
<FormModal
{...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}>
title={modalTitle}
>
<ZdyTable
taskId={this.props.taskId}
taskAssignee={taskAssignee}
......@@ -3141,7 +3196,7 @@ export default class tableCom extends Component {
) : (
''
)}
<Card.Header title={<span style={{ fontSize: 14 }}>{title}:</span>} />
<Card.Header title={<span style={{fontSize: 14}}>{title}:</span>}/>
<Card.Body>{cm}</Card.Body>
</Card>
);
......@@ -3153,7 +3208,8 @@ export default class tableCom extends Component {
style={{
minHeight: 40,
lineHeight: '40px',
}}>
}}
>
<Col
className={title ? styles.row_col_div : ''}
span={json.labelSpan}
......@@ -3164,7 +3220,8 @@ export default class tableCom extends Component {
overflow: 'hidden',
fontSize: 14,
color: 'rgba(0,0,0,0.85)',
}}>
}}
>
{title}
{title && (
<span
......@@ -3172,9 +3229,10 @@ export default class tableCom extends Component {
position: 'relative',
top: '-0.5px',
margin: '0 8px 0 2px',
}}>
:
</span>
}}
>
:
</span>
)}
</Col>
<Col
......@@ -3184,7 +3242,8 @@ export default class tableCom extends Component {
lineHeight: '40px',
zoom: 1,
fontSize: 14,
}}>
}}
>
{cm}
</Col>
{modalCode ? (
......@@ -3192,7 +3251,8 @@ export default class tableCom extends Component {
{...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}>
title={modalTitle}
>
<ZdyTable
taskId={this.props.taskId}
taskAssignee={taskAssignee}
......@@ -3227,7 +3287,8 @@ export default class tableCom extends Component {
{...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}>
title={modalTitle}
>
<ZdyTable
taskId={this.props.taskId}
taskAssignee={taskAssignee}
......@@ -3253,9 +3314,10 @@ export default class tableCom extends Component {
''
)}
<Form.Item
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</Form.Item>
</>
......@@ -3269,7 +3331,8 @@ export default class tableCom extends Component {
{...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}>
title={modalTitle}
>
<ZdyTable
taskId={this.props.taskId}
taskAssignee={taskAssignee}
......@@ -3306,7 +3369,8 @@ export default class tableCom extends Component {
{...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}>
title={modalTitle}
>
<ZdyTable
taskId={this.props.taskId}
taskAssignee={taskAssignee}
......@@ -3334,17 +3398,19 @@ export default class tableCom extends Component {
{json.isMobileLabel && !isEdit && get == 'mobile' ? (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</MobileItem>
) : isEdit && get == 'web' ? (
json.isLabel ? (
<Form.Item
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}>
labelCol={{span: json.labelSpan}}
wrapperCol={{span: json.wrapperSpan}}
label={title}
>
{cm}
</Form.Item>
) : (
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论