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

合并分支 'yaanzhiyuan_2021' 到 'master'

norefeshxxxxxxxxxxxxxxxxxxxx 修改 查看合并请求 !2
...@@ -26,7 +26,7 @@ export default class TableSelect extends React.Component { ...@@ -26,7 +26,7 @@ export default class TableSelect extends React.Component {
// Should provide an event to pass value to Form. // Should provide an event to pass value to Form.
const onChange = this.props.onChange; const onChange = this.props.onChange;
if (onChange) { if (onChange) {
console.log('changedValue', changedValue); // console.log('changedValue', changedValue);
onChange(Object.assign({}, this.state, changedValue)); onChange(Object.assign({}, this.state, changedValue));
} }
}; };
...@@ -234,9 +234,9 @@ export default class TableSelect extends React.Component { ...@@ -234,9 +234,9 @@ export default class TableSelect extends React.Component {
}); });
} }
console.log(this.props); // console.log(this.props);
console.log(this.state); // console.log(this.state);
console.log('-0000 TableSelect000'); // console.log('-0000 TableSelect000');
return ( return (
<div> <div>
{Object.keys(selects).length > 0 ? ( {Object.keys(selects).length > 0 ? (
......
import {message} from "antd";
import baseX from "base-x";
import moment from "moment";
import {isNaN} from "lodash";
import React from 'react';
import config from "@/webPublic/one_stop_public/config";
const codeMessage = {
200: '服务器成功返回请求的数据。',
201: '新建或修改数据成功。',
202: '一个请求已经进入后台排队(异步任务)。',
204: '删除数据成功。',
400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。',
401: '登录已过期,请重新登录',
403: '用户得到授权,但是访问是被禁止的。',
404: '发出的请求针对的是不存在的记录,服务器没有进行操作。',
406: '请求的格式不可得。',
410: '请求的资源被永久删除,且不会再得到的。',
422: '当创建一个对象时,发生一个验证错误。',
500: '服务器发生错误,请检查服务器。',
502: '网关错误。',
503: '服务不可用,服务器暂时过载或维护。',
504: '网关超时。',
};
const errorHandler = (error) => {
const { response } = error;
if (response && response.status) {
const errorText = codeMessage[response.status] || response.statusText;
message.error(`请求错误${errorText}`);
if (response.status === 401) {
return window.g_app._store.dispatch({
type: 'login/loginout',
});
}
} else {
message.error(`网络故障,请检查网络链接或联系管理员`);
}
};
const Bs64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
const base64 = baseX(Bs64);
export function getBase64(value) {
return value ? base64.encode(new Buffer(value)) : null;
}
const excludeKeys = ['defaultValues', ''];
const equal = (obj1, obj2, json, sqlContent, depth, props) => {
if (obj1 == null && obj2 != null) {
return false;
}
if (obj1 != null && obj2 == null) {
return false;
}
if (obj1 == null && obj2 == null) {
return true;
}
if (obj1 instanceof Date) {
if (obj1.valueOf() != obj2.valueOf()) {
return false;
}
} else if (obj1 instanceof moment) {
if (obj1.valueOf() != obj2.valueOf()) {
return false;
}
} else if (typeof obj1 == 'function') {
if (obj1.toString() != obj2.toString()) {
return false;
}
}
const keys = new Set();
if (obj2 != null) {
Object.keys(obj2).forEach(k => {
if (k != '') keys.add(k);
});
}
if (obj1 != null) {
Object.keys(obj1).forEach(k => {
if (k != '') keys.add(k);
});
}
let res = true;
for (let key of keys) {
if (key == '') {
continue;
}
if (excludeKeys.includes(key)) {
continue;
}
if (obj1[key] == null && obj2[key] != null) {
res = false;
break;
}
if (obj1[key] != null && obj2[key] == null) {
res = false;
break;
}
if (
depth == 1 &&
((props.json.sqlKey == null &&
sqlContent == null &&
json.formula == null &&
json.funcs == null) ||
(sqlContent != null && sqlContent.indexOf(key) == -1) ||
(json.formula != null &&
json.formula.indexOf(key) == -1 &&
json.funcs != null &&
json.funcs.indexOf(key) == -1))
) {
excludeKeys.push(key);
continue;
}
if (obj1[key] == null && obj2[key] == null) {
continue;
}
if (isNaN(obj1[key]) && isNaN(obj2[key])) {
continue;
}
if (obj1[key] instanceof Array) {
if (obj1[key].length != obj2[key].length) {
res = false;
break;
} else {
var xx = true;
for (var i = 0; i < obj1[key].length; i++) {
if (!equal(obj1[key][i], obj2[key][i], json, sqlContent, depth + 1)) {
xx = false;
break;
}
}
if (!xx) {
res = false;
break;
}
}
} else if (obj1[key] instanceof Object) {
const x = equal(obj1[key], obj2[key], json, sqlContent, depth + 1);
if (!x) {
res = false;
break;
}
} else if (typeof obj1[key] == 'function') {
if (obj1[key].toString() != obj2[key].toString()) {
res = false;
break;
}
} else {
if (obj1[key] != obj2[key]) {
res = false;
break;
}
}
}
return res;
};
const getRender = (com, props) => {
if (com == 'p') return <p {...props} />;
if (com == 'ul') return <ul {...props} />;
if (com == 'li') return <li {...props} />;
if (com == 'video') return <video {...props} />;
if (com == 'span') return <span {...props} />;
if (com == 'a') return <a {...props} />;
if (com == 'div') return <div {...props} />;
if (com == 'canvas') return <canvas {...props} />;
if (com == 'iframe') return <iframe {...props} />;
if (com == 'img') {
const src =
props.src != null
? props.src.indexOf('http') > -1
? props.src
: config.httpServer + props.src
: null;
const pp = { ...props, src: src };
return <img {...pp} />;
}
};
/**
* 判断传入值是否为JSON文本
*/
const isJSON = str => {
if (typeof str == 'string') {
try {
var obj = JSON.parse(str);
if (typeof obj == 'object' && obj) {
return true;
} else {
return false;
}
} catch (e) {
console.log('error:' + str + '!!!' + e);
return false;
}
}
};
export { errorHandler, equal, getRender, isJSON };
...@@ -51,58 +51,18 @@ import { extend } from 'umi-request'; ...@@ -51,58 +51,18 @@ import { extend } from 'umi-request';
import Highlighter from 'react-highlight-words'; import Highlighter from 'react-highlight-words';
import Signature from '../Signature'; import Signature from '../Signature';
import { changeToDraftState } from '../utils/myutils'; import { changeToDraftState } from '../utils/myutils';
import baseX from 'base-x';
import { Base16Encode } from '../Base16/index'; import { Base16Encode } from '../Base16/index';
import { getToken } from '../utils/token'; import { getToken } from '../utils/token';
import { formulaList } from '../excelInitFuc/functionList'; import { formulaList } from '../excelInitFuc/functionList';
import FilePreview from '../filePreview'; import FilePreview from '../filePreview';
import DraftEditorCom from '../App/DraftEditorCom'; import DraftEditorCom from '../App/DraftEditorCom';
import MobileItem from './MobileItem'; import MobileItem from './MobileItem';
import MobileCascader from "./CascaderDiy/MobileCascader"; import MobileCascader from './CascaderDiy/MobileCascader';
import { errorHandler, getBase64, equal, getRender, isJSON } from './Split_Index/staticInfo';
const Bs64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
const base64 = baseX(Bs64);
function getBase64(value) {
return value ? base64.encode(new Buffer(value)) : null;
}
const codeMessage = {
200: '服务器成功返回请求的数据。',
201: '新建或修改数据成功。',
202: '一个请求已经进入后台排队(异步任务)。',
204: '删除数据成功。',
400: '发出的请求有错误,服务器没有进行新建或修改数据的操作。',
401: '登录已过期,请重新登录',
403: '用户得到授权,但是访问是被禁止的。',
404: '发出的请求针对的是不存在的记录,服务器没有进行操作。',
406: '请求的格式不可得。',
410: '请求的资源被永久删除,且不会再得到的。',
422: '当创建一个对象时,发生一个验证错误。',
500: '服务器发生错误,请检查服务器。',
502: '网关错误。',
503: '服务不可用,服务器暂时过载或维护。',
504: '网关超时。',
};
const { TextArea } = Input; const { TextArea } = Input;
const { Option } = Select; const { Option } = Select;
const { RangePicker } = DatePicker; const { RangePicker } = DatePicker;
const errorHandler = (error) => {
const { response } = error;
if (response && response.status) {
const errorText = codeMessage[response.status] || response.statusText;
message.error(`请求错误${errorText}`);
if (response.status === 401) {
return window.g_app._store.dispatch({
type: 'login/loginout',
});
}
} else {
message.error(`网络故障,请检查网络链接或联系管理员`);
}
};
@connect(({ DataColumn, SqlManageEntity, formList, loading }) => ({ @connect(({ DataColumn, SqlManageEntity, formList, loading }) => ({
DataColumn, DataColumn,
...@@ -136,7 +96,6 @@ export default class tableCom extends Component { ...@@ -136,7 +96,6 @@ export default class tableCom extends Component {
pagination: false, pagination: false,
}, },
}; };
this.excludeKeys = ['defaultValues', ''];
} }
closeModal = (fk, callback) => { closeModal = (fk, callback) => {
...@@ -149,6 +108,7 @@ export default class tableCom extends Component { ...@@ -149,6 +108,7 @@ export default class tableCom extends Component {
callback: callback, callback: callback,
}); });
}; };
showModal = (fk, title, data, modalProps) => { showModal = (fk, title, data, modalProps) => {
const { dispatch } = this.props; const { dispatch } = this.props;
const x = this.props.DataColumn.isShowModal; const x = this.props.DataColumn.isShowModal;
...@@ -167,174 +127,6 @@ export default class tableCom extends Component { ...@@ -167,174 +127,6 @@ export default class tableCom extends Component {
}); });
}; };
equal = (obj1, obj2, json, sqlContent, depth) => {
if (obj1 == null && obj2 != null) {
return false;
}
if (obj1 != null && obj2 == null) {
return false;
}
if (obj1 == null && obj2 == null) {
return true;
}
if (obj1 instanceof Date) {
if (obj1.valueOf() != obj2.valueOf()) {
return false;
}
} else if (obj1 instanceof moment) {
if (obj1.valueOf() != obj2.valueOf()) {
return false;
}
} else if (typeof obj1 == 'function') {
if (obj1.toString() != obj2.toString()) {
return false;
}
}
const keys = new Set();
if (obj2 != null) {
Object.keys(obj2).forEach((k) => {
if (k != '') keys.add(k);
});
}
if (obj1 != null) {
Object.keys(obj1).forEach((k) => {
if (k != '') keys.add(k);
});
}
let res = true;
for (let key of keys) {
if (key == '') {
continue;
}
if (this.excludeKeys.includes(key)) {
continue;
}
if (obj1[key] == null && obj2[key] != null) {
res = false;
break;
}
if (obj1[key] != null && obj2[key] == null) {
res = false;
break;
}
if (
depth == 1 &&
((this.props.json.sqlKey == null &&
sqlContent == null &&
json.formula == null &&
json.funcs == null) ||
(sqlContent != null && sqlContent.indexOf(key) == -1) ||
(json.formula != null &&
json.formula.indexOf(key) == -1 &&
json.funcs != null &&
json.funcs.indexOf(key) == -1))
) {
this.excludeKeys.push(key);
continue;
}
if (obj1[key] == null && obj2[key] == null) {
continue;
}
if (isNaN(obj1[key]) && isNaN(obj2[key])) {
continue;
}
/* if (this.typeOf(obj1[key]) != this.typeOf(obj1[key])) {
res = false
break;
} */
if (obj1[key] instanceof Array) {
if (obj1[key].length != obj2[key].length) {
res = false;
break;
} else {
var xx = true;
for (var i = 0; i < obj1[key].length; i++) {
if (!this.equal(obj1[key][i], obj2[key][i], json, sqlContent, depth + 1)) {
xx = false;
break;
}
}
if (!xx) {
res = false;
break;
}
}
} else if (obj1[key] instanceof Object) {
const x = this.equal(obj1[key], obj2[key], json, sqlContent, depth + 1);
if (!x) {
res = false;
break;
}
} else if (typeof obj1[key] == 'function') {
if (obj1[key].toString() != obj2[key].toString()) {
res = false;
break;
}
} else {
if (obj1[key] != obj2[key]) {
res = false;
break;
}
}
}
return res;
};
getRender = (com, props) => {
if (com == 'p') return <p {...props} />;
if (com == 'ul') return <ul {...props} />;
if (com == 'li') return <li {...props} />;
if (com == 'video') return <video {...props} />;
if (com == 'span') return <span {...props} />;
if (com == 'a') return <a {...props} />;
if (com == 'div') return <div {...props} />;
if (com == 'canvas') return <canvas {...props} />;
if (com == 'iframe') return <iframe {...props} />;
if (com == 'img') {
const src =
props.src != null
? props.src.indexOf('http') > -1
? props.src
: config.httpServer + props.src
: null;
const pp = { ...props, src: src };
return <img {...pp} />;
}
};
/**
* 判断传入值是否为JSON文本
*/
isJSON = (str) => {
if (typeof str == 'string') {
try {
var obj = JSON.parse(str);
if (typeof obj == 'object' && obj) {
return true;
} else {
return false;
}
} catch (e) {
console.log('error:' + str + '!!!' + e);
return false;
}
}
};
/** /**
* 上传文件输入 * 上传文件输入
* 使用antd上传组件 * 使用antd上传组件
...@@ -342,7 +134,7 @@ export default class tableCom extends Component { ...@@ -342,7 +134,7 @@ export default class tableCom extends Component {
file = { file = {
name: 'file', name: 'file',
action: queryApiActionPath() + '/upload', action: queryApiActionPath() + '/upload',
onChange: (info) => { onChange: info => {
if (info.file.status !== 'uploading') { if (info.file.status !== 'uploading') {
this.setState({ this.setState({
img: info.file.response, img: info.file.response,
...@@ -363,7 +155,7 @@ export default class tableCom extends Component { ...@@ -363,7 +155,7 @@ export default class tableCom extends Component {
this.setState({ searchText: selectedKeys[0] }); this.setState({ searchText: selectedKeys[0] });
}; };
handleReset = (clearFilters) => { handleReset = clearFilters => {
clearFilters(); clearFilters();
this.resetSearchText(); this.resetSearchText();
}; };
...@@ -378,12 +170,12 @@ export default class tableCom extends Component { ...@@ -378,12 +170,12 @@ export default class tableCom extends Component {
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => ( filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => (
<div style={{ padding: 8 }}> <div style={{ padding: 8 }}>
<Input <Input
ref={(node) => { ref={node => {
this.searchInput = node; this.searchInput = node;
}} }}
placeholder={`请输入${title}`} placeholder={`请输入${title}`}
value={selectedKeys[0]} 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)} onPressEnter={() => this.handleSearch(selectedKeys, confirm)}
style={{ width: 188, marginBottom: 8, display: 'block' }} style={{ width: 188, marginBottom: 8, display: 'block' }}
/> />
...@@ -393,21 +185,21 @@ export default class tableCom extends Component { ...@@ -393,21 +185,21 @@ export default class tableCom extends Component {
icon="search" icon="search"
loading={this.props.loading} loading={this.props.loading}
size="small" size="small"
style={{ width: 90, marginRight: 8 }}> style={{ width: 90, marginRight: 8 }}
>
搜索 搜索
</Button> </Button>
<Button <Button
loading={this.props.loading} loading={this.props.loading}
onClick={() => this.handleReset(clearFilters)} onClick={() => this.handleReset(clearFilters)}
size="small" size="small"
style={{ width: 90 }}> style={{ width: 90 }}
>
重置 重置
</Button> </Button>
</div> </div>
), ),
filterIcon: (filtered) => ( filterIcon: filtered => <Icon type="search" style={{ color: filtered ? '#1890ff' : 'red' }} />,
<Icon type="search" style={{ color: filtered ? '#1890ff' : 'red' }} />
),
onFilter: (value, record) => onFilter: (value, record) =>
record[dataIndex] record[dataIndex]
? record[dataIndex] ? record[dataIndex]
...@@ -415,12 +207,12 @@ export default class tableCom extends Component { ...@@ -415,12 +207,12 @@ export default class tableCom extends Component {
.toLowerCase() .toLowerCase()
.includes(value.toLowerCase()) .includes(value.toLowerCase())
: '', : '',
onFilterDropdownVisibleChange: (visible) => { onFilterDropdownVisibleChange: visible => {
if (visible) { if (visible) {
setTimeout(() => this.searchInput.select()); setTimeout(() => this.searchInput.select());
} }
}, },
render: (text) => { render: text => {
if (text != null) { if (text != null) {
return ( return (
<Highlighter <Highlighter
...@@ -468,14 +260,14 @@ export default class tableCom extends Component { ...@@ -468,14 +260,14 @@ export default class tableCom extends Component {
return; return;
} }
const obj2 = props.form.getFieldsValue(); const obj2 = props.form.getFieldsValue();
const bb = this.equal(this.obj, obj2, json, this.state.sqlContent, 1); const bb = equal(this.obj, obj2, json, this.state.sqlContent, 1, this.props);
let bb2 = true; let bb2 = true;
let childObj2 = {}; let childObj2 = {};
if (props.fatherCode) { if (props.fatherCode) {
if (obj2 != null && obj2[props.fatherCode]) { if (obj2 != null && obj2[props.fatherCode]) {
childObj2 = obj2[props.fatherCode][props.index]; childObj2 = obj2[props.fatherCode][props.index];
bb2 = this.equal(this.childObj, childObj2, json, this.state.sqlContent, 1); bb2 = equal(this.childObj, childObj2, json, this.state.sqlContent, 1, this.props);
} }
} }
...@@ -560,13 +352,13 @@ export default class tableCom extends Component { ...@@ -560,13 +352,13 @@ export default class tableCom extends Component {
dispatch({ dispatch({
type: 'SqlManageEntity/find', type: 'SqlManageEntity/find',
payload: { sqlKey: sqlKey }, payload: { sqlKey: sqlKey },
callback: (sqlModel) => { callback: sqlModel => {
this.setState({ sqlModel }); this.setState({ sqlModel });
if (sqlModel.dataObjId) { if (sqlModel.dataObjId) {
dispatch({ dispatch({
type: 'formList/getHead', type: 'formList/getHead',
payload: { dataObjId: sqlModel.dataObjId }, payload: { dataObjId: sqlModel.dataObjId },
callback: (datas) => { callback: datas => {
if (datas) { if (datas) {
const columns = []; const columns = [];
for (var i = 0; i < datas.length; i++) { for (var i = 0; i < datas.length; i++) {
...@@ -577,7 +369,7 @@ export default class tableCom extends Component { ...@@ -577,7 +369,7 @@ export default class tableCom extends Component {
if ( if (
['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type) ['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); columns.push(column);
} else { } else {
...@@ -611,7 +403,7 @@ export default class tableCom extends Component { ...@@ -611,7 +403,7 @@ export default class tableCom extends Component {
break; break;
} }
column.render = (val) => moment(parseInt(val)).format(ff); column.render = val => moment(parseInt(val)).format(ff);
} }
if (cll[k].isQuery) { if (cll[k].isQuery) {
column = { column = {
...@@ -628,7 +420,7 @@ export default class tableCom extends Component { ...@@ -628,7 +420,7 @@ export default class tableCom extends Component {
dispatch({ dispatch({
type: 'DataColumn/getSqlData', type: 'DataColumn/getSqlData',
payload: { sqlKey, allValues }, payload: { sqlKey, allValues },
callback: (list) => { callback: list => {
const x = { const x = {
list: list, list: list,
pagination: false, pagination: false,
...@@ -643,7 +435,7 @@ export default class tableCom extends Component { ...@@ -643,7 +435,7 @@ export default class tableCom extends Component {
dispatch({ dispatch({
type: 'formList/getHead', type: 'formList/getHead',
payload: { dataObjId: dataColumn.referenceObjId }, payload: { dataObjId: dataColumn.referenceObjId },
callback: (datas) => { callback: datas => {
if (datas) { if (datas) {
const columns = []; const columns = [];
for (var i = 0; i < datas.length; i++) { for (var i = 0; i < datas.length; i++) {
...@@ -652,7 +444,7 @@ export default class tableCom extends Component { ...@@ -652,7 +444,7 @@ export default class tableCom extends Component {
column.title = datas[i].title; column.title = datas[i].title;
column.dataIndex = datas[i].name; column.dataIndex = datas[i].name;
if (['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)) { 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); columns.push(column);
} else { } else {
...@@ -837,8 +629,16 @@ export default class tableCom extends Component { ...@@ -837,8 +629,16 @@ export default class tableCom extends Component {
if (json.optionType && json.optionType == 'func') { if (json.optionType && json.optionType == 'func') {
const res = callback(data); const res = callback(data);
if (res != null && !(typeof res === 'function')) { if (
this.setState({ options: res, selectDis: false }, () => { res != null &&
!(typeof res === 'function') &&
res !== 'norefeshxxxxxxxxxxxxxxxxxxxx'
) {
// console.table(res);
this.setState({
options: res,
selectDis: false,
}, () => {
if (orgCallback) orgCallback(); if (orgCallback) orgCallback();
}); });
} }
...@@ -912,21 +712,28 @@ export default class tableCom extends Component { ...@@ -912,21 +712,28 @@ export default class tableCom extends Component {
data: requestParams, data: requestParams,
method: method, method: method,
requestType: 'form', requestType: 'form',
}).then((data) => { }).then(data => {
// if (!data || !Array.isArray(data)) { // if (!data || !Array.isArray(data)) {
// data = []; // data = [];
// } // }
const { reqUrls } = this.state; const { reqUrls } = this.state;
if(reqUrls && reqUrls[url]){ if (reqUrls && reqUrls[url]) {
reqUrls[url].data = data; reqUrls[url].data = data;
} }
this.setState({ res: data, reqUrls }, () => { this.setState({ res: data, reqUrls }, () => {
if (callback) { if (callback) {
if (json.optionType && json.optionType == 'func') { if (json.optionType && json.optionType == 'func') {
const res = callback(data); const res = callback(data);
// console.error(res) if (
if (res != null && !(typeof res === 'function')) { res != null &&
this.setState({ options: res, selectDis: false }, () => { !(typeof res === 'function') &&
res !== 'norefeshxxxxxxxxxxxxxxxxxxxx'
) {
// console.table(res);
this.setState({
options: res,
selectDis: false,
}, () => {
if (orgCallback) orgCallback(); if (orgCallback) orgCallback();
}); });
} }
...@@ -974,30 +781,32 @@ export default class tableCom extends Component { ...@@ -974,30 +781,32 @@ export default class tableCom extends Component {
} }
}); });
}); });
return 'norefeshxxxxxxxxxxxxxxxxxxxx'; return 'norefeshxxxxxxxxxxxxxxxxxxxx';
}; };
sqlUtil = (base52, json, orgCallback, sqlKey, params, callback, options = {}) => { sqlUtil = (base52, json, orgCallback, sqlKey, params, callback, options = {}) => {
//查缓存 //查缓存
var isChange = false; var isChange = false;
const { sqlKeys } = this.state; const { sqlKeys } = this.state;
if (sqlKeys[sqlKey] != null) { if (sqlKeys[sqlKey] != null) {
const ps = sqlKeys[sqlKey].params; const ps = sqlKeys[sqlKey].params; // []
if (params.length != ps.length) { if (params.length !== ps.length) {
// 长度不想等 直接更新
isChange = true; isChange = true;
} else { } else {
for (var i = 0; i < params.length; i++) { for (var i = 0; i < params.length; i++) {
if (params[i] != ps[i]) { if (params[i] != ps[i]) {
// 某一个不相等 直接更新
isChange = true; isChange = true;
break; break;
} }
} }
} }
if (!isChange) { if (!isChange) {
const os = sqlKeys[sqlKey].options; const os = sqlKeys[sqlKey].options; // {}
if (Object.keys(options).length != Object.keys(os).length) { if (Object.keys(options).length !== Object.keys(os).length) {
// {}
isChange = true; isChange = true;
} else { } else {
for (var k in options) { for (var k in options) {
...@@ -1009,20 +818,32 @@ export default class tableCom extends Component { ...@@ -1009,20 +818,32 @@ export default class tableCom extends Component {
} }
} }
} else { } else {
sqlKeys[sqlKey] = { params: params, options: options }; sqlKeys[sqlKey] = { params, options };
isChange = true; isChange = true;
} }
if (!isChange) { if (!isChange) {
if (callback) { if (callback) {
const data = sqlKeys[sqlKey].data; const data = sqlKeys[sqlKey].data; // Array[8]; options
if (json.optionType && json.optionType == 'func') { if (json.optionType && json.optionType === 'func') {
const res = callback(data); const res = callback(data);
if (res != null && !(typeof res === 'function')) { if (
this.setState({ options: res, selectDis: false }, () => { res != null &&
!(typeof res === 'function') &&
res !== 'norefeshxxxxxxxxxxxxxxxxxxxx'
) {
// console.log(res);
this.setState(
{
options: res,
selectDis: false,
},
() => {
if (orgCallback) orgCallback(); if (orgCallback) orgCallback();
}); },
);
} }
} else if (json.comName == 'Button') { } else if (json.comName === 'Button') {
try { try {
callback(data); callback(data);
} catch (e) { } catch (e) {
...@@ -1032,11 +853,7 @@ export default class tableCom extends Component { ...@@ -1032,11 +853,7 @@ export default class tableCom extends Component {
e, e,
); );
} }
} else if ( } else if (['Echart', 'QRCode', 'Graph'].includes(json.comName)) {
json.comName == 'Echart' ||
json.comName == 'QRCode' ||
json.comName == 'Graph'
) {
try { try {
const x = callback(data); const x = callback(data);
if (x != null) { if (x != null) {
...@@ -1089,7 +906,7 @@ export default class tableCom extends Component { ...@@ -1089,7 +906,7 @@ export default class tableCom extends Component {
data: pp, data: pp,
method: 'POST', method: 'POST',
requestType: 'form', requestType: 'form',
}).then((data) => { }).then(data => {
const { sqlKeys } = this.state; const { sqlKeys } = this.state;
sqlKeys[sqlKey].data = data; sqlKeys[sqlKey].data = data;
this.setState({ sqlKeys }); this.setState({ sqlKeys });
...@@ -1100,9 +917,12 @@ export default class tableCom extends Component { ...@@ -1100,9 +917,12 @@ export default class tableCom extends Component {
if (callback) { if (callback) {
if (json.optionType && json.optionType == 'func') { if (json.optionType && json.optionType == 'func') {
const res = callback(data); const res = callback(data);
if (res != null && !(typeof res === 'function') && res !== 'norefeshxxxxxxxxxxxxxxxxxxxx') {
if (res != null && !(typeof res === 'function')) { // console.log(res);
this.setState({ options: res, selectDis: false }, () => { this.setState({
options: res,
selectDis: false,
}, () => {
if (orgCallback) orgCallback(); if (orgCallback) orgCallback();
}); });
} }
...@@ -1150,7 +970,6 @@ export default class tableCom extends Component { ...@@ -1150,7 +970,6 @@ export default class tableCom extends Component {
} }
}); });
}); });
return 'norefeshxxxxxxxxxxxxxxxxxxxx'; return 'norefeshxxxxxxxxxxxxxxxxxxxx';
}; };
...@@ -1163,8 +982,8 @@ export default class tableCom extends Component { ...@@ -1163,8 +982,8 @@ export default class tableCom extends Component {
* 动态生成表单配置函数所使用 * 动态生成表单配置函数所使用
*/ */
let functionObj = {}; let functionObj = {};
formulaList.map((item) => { formulaList.map(item => {
item.children.map((arr) => { item.children.map(arr => {
functionObj[arr.callKey] = arr.function; functionObj[arr.callKey] = arr.function;
}); });
}); });
...@@ -1228,7 +1047,7 @@ export default class tableCom extends Component { ...@@ -1228,7 +1047,7 @@ export default class tableCom extends Component {
md5, md5,
showModal: this.showModal, showModal: this.showModal,
closeModal: this.closeModal, closeModal: this.closeModal,
render: this.getRender, render: getRender,
base64: getBase64, base64: getBase64,
form: this.props.form, form: this.props.form,
}, },
...@@ -1238,7 +1057,7 @@ export default class tableCom extends Component { ...@@ -1238,7 +1057,7 @@ export default class tableCom extends Component {
this.props.concealModel, this.props.concealModel,
); );
if (base52) { if (base52) {
if (value != null && value == 'norefeshxxxxxxxxxxxxxxxxxxxx') { if (value != null && value === 'norefeshxxxxxxxxxxxxxxxxxxxx') {
} else { } else {
/** /**
* 会出现重复调用2次,然后NAN造成无限循环 * 会出现重复调用2次,然后NAN造成无限循环
...@@ -1246,11 +1065,15 @@ export default class tableCom extends Component { ...@@ -1246,11 +1065,15 @@ export default class tableCom extends Component {
if (isNaN(value)) { if (isNaN(value)) {
return; return;
} }
if (json.comName == 'Button') { if (json.comName === 'Button') {
return value; return value;
} else if (json.optionType && json.optionType == 'func') { } else if (json.optionType && json.optionType === 'func') {
if (value != null && !(typeof value === 'function')) { if (value != null && !(typeof value === 'function') && value !== 'norefeshxxxxxxxxxxxxxxxxxxxx') {
this.setState({ options: value, selectDis: false }, () => { // console.log(value);
this.setState({
options: value,
selectDis: false,
}, () => {
if (callback) callback(); if (callback) callback();
}); });
} }
...@@ -1259,7 +1082,9 @@ export default class tableCom extends Component { ...@@ -1259,7 +1082,9 @@ export default class tableCom extends Component {
json.comName == 'QRCode' || json.comName == 'QRCode' ||
json.comName == 'Graph' json.comName == 'Graph'
) { ) {
this.setState({ option: value }); this.setState({
option: value,
});
} else { } else {
try { try {
this.props.form.setFieldsValue({ [base52]: value }); this.props.form.setFieldsValue({ [base52]: value });
...@@ -1292,7 +1117,7 @@ export default class tableCom extends Component { ...@@ -1292,7 +1117,7 @@ export default class tableCom extends Component {
dispatch({ dispatch({
type: 'SqlManageEntity/find', type: 'SqlManageEntity/find',
payload: { sqlKey: json.sqlKey }, payload: { sqlKey: json.sqlKey },
callback: (res) => { callback: res => {
this.setState({ sqlContent: res.sql }); this.setState({ sqlContent: res.sql });
}, },
}); });
...@@ -1333,7 +1158,7 @@ export default class tableCom extends Component { ...@@ -1333,7 +1158,7 @@ export default class tableCom extends Component {
dispatch({ dispatch({
type: 'DataColumn/getSqlOptions', type: 'DataColumn/getSqlOptions',
payload: { sqlKey, allValues }, payload: { sqlKey, allValues },
callback: (options) => { callback: options => {
const optionsx = []; const optionsx = [];
let base52 = dataColumn.base52; let base52 = dataColumn.base52;
let vl = this.props.form.getFieldsValue()[base52]; let vl = this.props.form.getFieldsValue()[base52];
...@@ -1351,7 +1176,10 @@ export default class tableCom extends Component { ...@@ -1351,7 +1176,10 @@ export default class tableCom extends Component {
if (!isExist && vl != null && options.length > 0) { 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 }); // console.log(optionsx);
this.setState({
options: optionsx,
selectDis: false });
}, },
}); });
} else if (!this.props.isEdit && Object.keys(obj).length > 0) { } else if (!this.props.isEdit && Object.keys(obj).length > 0) {
...@@ -1364,8 +1192,11 @@ export default class tableCom extends Component { ...@@ -1364,8 +1192,11 @@ export default class tableCom extends Component {
dispatch({ dispatch({
type: 'DataColumn/getSqlLabels', type: 'DataColumn/getSqlLabels',
payload: { sqlKey, values: obj[base52], labelName, valueName, allValues }, payload: { sqlKey, values: obj[base52], labelName, valueName, allValues },
callback: (labels) => { callback: labels => {
this.setState({ labels, selectDis: false }); this.setState({
labels,
selectDis: false,
});
}, },
}); });
} }
...@@ -1373,7 +1204,7 @@ export default class tableCom extends Component { ...@@ -1373,7 +1204,7 @@ export default class tableCom extends Component {
dispatch({ dispatch({
type: 'DataColumn/getSqlOptions', type: 'DataColumn/getSqlOptions',
payload: { sqlKey, allValues }, payload: { sqlKey, allValues },
callback: (options) => { callback: options => {
let base52 = dataColumn.base52; let base52 = dataColumn.base52;
let vl = this.props.form.getFieldsValue()[base52]; let vl = this.props.form.getFieldsValue()[base52];
const optionsx = []; const optionsx = [];
...@@ -1392,8 +1223,11 @@ export default class tableCom extends Component { ...@@ -1392,8 +1223,11 @@ export default class tableCom extends Component {
//console.log("isExist",optionsx,vl,isExist) //console.log("isExist",optionsx,vl,isExist)
this.props.form.setFieldsValue({ [base52]: null }); this.props.form.setFieldsValue({ [base52]: null });
} }
// console.log(optionsx);
this.setState({ options: optionsx, selectDis: false }); this.setState({
options: optionsx,
selectDis: false,
});
}, },
}); });
} }
...@@ -1420,9 +1254,15 @@ export default class tableCom extends Component { ...@@ -1420,9 +1254,15 @@ export default class tableCom extends Component {
} }
} }
this.setState({ labels: labels, selectDis: false }); this.setState({
labels,
selectDis: false,
});
} else { } else {
this.setState({ options: options, selectDis: false }); // console.log(options);
this.setState({
options,
selectDis: false });
} }
}; };
fetchData = (obj, dataColumn, init, filterSql, allValues) => { fetchData = (obj, dataColumn, init, filterSql, allValues) => {
...@@ -1432,7 +1272,7 @@ export default class tableCom extends Component { ...@@ -1432,7 +1272,7 @@ export default class tableCom extends Component {
dispatch({ dispatch({
type: 'DataColumn/getOptions', type: 'DataColumn/getOptions',
payload: { id: dataColumn.id, filterSql, allValues }, payload: { id: dataColumn.id, filterSql, allValues },
callback: (options) => { callback: options => {
const optionsx = []; const optionsx = [];
for (var i = 0; i < options.length; i++) { for (var i = 0; i < options.length; i++) {
optionsx.push({ optionsx.push({
...@@ -1440,7 +1280,11 @@ export default class tableCom extends Component { ...@@ -1440,7 +1280,11 @@ export default class tableCom extends Component {
value: options[i][dataColumn.referenceCodeName], value: options[i][dataColumn.referenceCodeName],
}); });
} }
this.setState({ options: optionsx, selectDis: false }); // console.log(optionsx);
this.setState({
options: optionsx,
selectDis: false,
});
}, },
}); });
} else if (!this.props.isEdit && Object.keys(obj).length > 0) { } else if (!this.props.isEdit && Object.keys(obj).length > 0) {
...@@ -1448,8 +1292,11 @@ export default class tableCom extends Component { ...@@ -1448,8 +1292,11 @@ export default class tableCom extends Component {
dispatch({ dispatch({
type: 'DataColumn/getLabels', type: 'DataColumn/getLabels',
payload: { id: dataColumn.id, values: obj[dataColumn.base52], filterSql, allValues }, payload: { id: dataColumn.id, values: obj[dataColumn.base52], filterSql, allValues },
callback: (labels) => { callback: labels => {
this.setState({ labels, selectDis: false }); this.setState({
labels,
selectDis: false,
});
}, },
}); });
} }
...@@ -1457,7 +1304,7 @@ export default class tableCom extends Component { ...@@ -1457,7 +1304,7 @@ export default class tableCom extends Component {
dispatch({ dispatch({
type: 'DataColumn/getOptions', type: 'DataColumn/getOptions',
payload: { id: dataColumn.id, filterSql, allValues }, payload: { id: dataColumn.id, filterSql, allValues },
callback: (options) => { callback: options => {
const optionsx = []; const optionsx = [];
for (var i = 0; i < options.length; i++) { for (var i = 0; i < options.length; i++) {
optionsx.push({ optionsx.push({
...@@ -1465,12 +1312,16 @@ export default class tableCom extends Component { ...@@ -1465,12 +1312,16 @@ export default class tableCom extends Component {
value: options[i][dataColumn.referenceCodeName], value: options[i][dataColumn.referenceCodeName],
}); });
} }
this.setState({ options: optionsx, selectDis: false }); // console.log(optionsx);
this.setState({
options: optionsx,
selectDis: false,
});
}, },
}); });
} }
}; };
getColumn = (key) => { getColumn = key => {
let { mapData, json } = this.props; let { mapData, json } = this.props;
const columnIds = json.columnIds; const columnIds = json.columnIds;
...@@ -1624,7 +1475,8 @@ export default class tableCom extends Component { ...@@ -1624,7 +1475,8 @@ export default class tableCom extends Component {
fontWeight: get == 'mobile' ? 'bold' : '', fontWeight: get == 'mobile' ? 'bold' : '',
marginRight: get == 'mobile' ? 12 : '', marginRight: get == 'mobile' ? 12 : '',
}} }}
{...json.props}> {...json.props}
>
{obj[this.props.uuid] || json.initialValue} {obj[this.props.uuid] || json.initialValue}
</span> </span>
</> </>
...@@ -1640,7 +1492,8 @@ export default class tableCom extends Component { ...@@ -1640,7 +1492,8 @@ export default class tableCom extends Component {
fontWeight: get == 'mobile' ? 'bold' : '', fontWeight: get == 'mobile' ? 'bold' : '',
marginRight: get == 'mobile' ? 12 : '', marginRight: get == 'mobile' ? 12 : '',
}} }}
{...json.props}> {...json.props}
>
{this.props.form.getFieldsValue()[uid]} {this.props.form.getFieldsValue()[uid]}
</span> </span>
</> </>
...@@ -1794,7 +1647,8 @@ export default class tableCom extends Component { ...@@ -1794,7 +1647,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}> label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -1805,7 +1659,8 @@ export default class tableCom extends Component { ...@@ -1805,7 +1659,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}> label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}
>
{cm} {cm}
</MobileItem> </MobileItem>
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, { {this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
...@@ -1837,7 +1692,8 @@ export default class tableCom extends Component { ...@@ -1837,7 +1692,8 @@ export default class tableCom extends Component {
style={{ style={{
minHeight: 40, minHeight: 40,
lineHeight: '40px', lineHeight: '40px',
}}> }}
>
<Col <Col
className={json.label ? json.label : sqlData[key] ? styles.row_col_div : ''} className={json.label ? json.label : sqlData[key] ? styles.row_col_div : ''}
span={json.labelSpan} span={json.labelSpan}
...@@ -1848,7 +1704,8 @@ export default class tableCom extends Component { ...@@ -1848,7 +1704,8 @@ export default class tableCom extends Component {
overflow: 'hidden', overflow: 'hidden',
fontSize: 14, fontSize: 14,
color: 'rgba(0,0,0,0.85)', color: 'rgba(0,0,0,0.85)',
}}> }}
>
{json.label ? ( {json.label ? (
<> <>
{json.label} {json.label}
...@@ -1857,7 +1714,8 @@ export default class tableCom extends Component { ...@@ -1857,7 +1714,8 @@ export default class tableCom extends Component {
position: 'relative', position: 'relative',
top: '-0.5px', top: '-0.5px',
margin: '0 8px 0 2px', margin: '0 8px 0 2px',
}}> }}
>
: :
</span> </span>
</> </>
...@@ -1869,7 +1727,8 @@ export default class tableCom extends Component { ...@@ -1869,7 +1727,8 @@ export default class tableCom extends Component {
position: 'relative', position: 'relative',
top: '-0.5px', top: '-0.5px',
margin: '0 8px 0 2px', margin: '0 8px 0 2px',
}}> }}
>
: :
</span> </span>
</> </>
...@@ -1884,7 +1743,8 @@ export default class tableCom extends Component { ...@@ -1884,7 +1743,8 @@ export default class tableCom extends Component {
lineHeight: '40px', lineHeight: '40px',
zoom: 1, zoom: 1,
fontSize: 14, fontSize: 14,
}}> }}
>
{cm} {cm}
</Col> </Col>
</Row> </Row>
...@@ -1894,7 +1754,8 @@ export default class tableCom extends Component { ...@@ -1894,7 +1754,8 @@ export default class tableCom extends Component {
<Form.Item <Form.Item
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}> label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}
>
{cm} {cm}
</Form.Item> </Form.Item>
); );
...@@ -1905,7 +1766,8 @@ export default class tableCom extends Component { ...@@ -1905,7 +1766,8 @@ export default class tableCom extends Component {
<Form.Item <Form.Item
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}> label={json.label ? json.label : sqlData[key] ? sqlData[key].title : ''}
>
{cm} {cm}
</Form.Item> </Form.Item>
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, { {this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
...@@ -2008,7 +1870,8 @@ export default class tableCom extends Component { ...@@ -2008,7 +1870,8 @@ export default class tableCom extends Component {
<span <span
style={{ style={{
wordBreak: 'break-all', wordBreak: 'break-all',
}}> }}
>
{obj[dataColumn.base52]} {obj[dataColumn.base52]}
</span> </span>
); );
...@@ -2022,7 +1885,8 @@ export default class tableCom extends Component { ...@@ -2022,7 +1885,8 @@ export default class tableCom extends Component {
<span <span
style={{ style={{
wordBreak: 'break-all', wordBreak: 'break-all',
}}> }}
>
{obj[dataColumn.base52]} {obj[dataColumn.base52]}
</span> </span>
); );
...@@ -2051,8 +1915,7 @@ export default class tableCom extends Component { ...@@ -2051,8 +1915,7 @@ export default class tableCom extends Component {
cm = ( cm = (
<span> <span>
{labels != null {labels != null
? labels.map( ? labels.map((r, i) =>
(r, i) =>
i == 0 ? ( i == 0 ? (
typeof r == 'string' ? ( typeof r == 'string' ? (
<span>{r}</span> <span>{r}</span>
...@@ -2165,7 +2028,7 @@ export default class tableCom extends Component { ...@@ -2165,7 +2028,7 @@ export default class tableCom extends Component {
/** /**
* 判断返回值是否为JSON字符串,不是则直接使用 * 判断返回值是否为JSON字符串,不是则直接使用
*/ */
if (this.isJSON(obj[dataColumn.base52])) { if (isJSON(obj[dataColumn.base52])) {
ary = JSON.parse(obj[dataColumn.base52]); ary = JSON.parse(obj[dataColumn.base52]);
} else { } else {
ary = obj[dataColumn.base52]; ary = obj[dataColumn.base52];
...@@ -2229,7 +2092,8 @@ export default class tableCom extends Component { ...@@ -2229,7 +2092,8 @@ export default class tableCom extends Component {
<a <a
target="_blank" target="_blank"
key={f.filePath} key={f.filePath}
href={queryApiActionPath() + f.filePath}> href={queryApiActionPath() + f.filePath}
>
{f.fileName} {f.fileName}
</a> </a>
</li> </li>
...@@ -2500,7 +2364,8 @@ export default class tableCom extends Component { ...@@ -2500,7 +2364,8 @@ export default class tableCom extends Component {
<Form.Item <Form.Item
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</Form.Item> </Form.Item>
); );
...@@ -2541,14 +2406,15 @@ export default class tableCom extends Component { ...@@ -2541,14 +2406,15 @@ export default class tableCom extends Component {
: [{ required: required, message: '请选择' + title }], : [{ required: required, message: '请选择' + title }],
})} })}
disabled={disabled} disabled={disabled}
onClick={(checked) => { onClick={checked => {
// set new value // set new value
this.props.form.setFieldsValue({ this.props.form.setFieldsValue({
[dataColumn.base52]: checked, [dataColumn.base52]: checked,
}); });
}} }}
/> />
}> }
>
{(json.isMobileLabel != null && json.isMobileLabel) || {(json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel) (json.isMobileLabel == null && json.isLabel)
? title ? title
...@@ -2605,7 +2471,8 @@ export default class tableCom extends Component { ...@@ -2605,7 +2471,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -2646,7 +2513,8 @@ export default class tableCom extends Component { ...@@ -2646,7 +2513,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -2677,7 +2545,8 @@ export default class tableCom extends Component { ...@@ -2677,7 +2545,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -2712,7 +2581,8 @@ export default class tableCom extends Component { ...@@ -2712,7 +2581,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -2731,6 +2601,8 @@ export default class tableCom extends Component { ...@@ -2731,6 +2601,8 @@ export default class tableCom extends Component {
break; break;
case 'Select': case 'Select':
// console.table(selectDis, disabled);
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue, initialValue: initValue,
rules: rules:
...@@ -2757,7 +2629,7 @@ export default class tableCom extends Component { ...@@ -2757,7 +2629,7 @@ export default class tableCom extends Component {
? setTimeout(() => { ? setTimeout(() => {
if (document.querySelectorAll(`.ant-select-search__field`).length > 0) { if (document.querySelectorAll(`.ant-select-search__field`).length > 0) {
let ary = [...document.querySelectorAll(`.ant-select-search__field`)]; let ary = [...document.querySelectorAll(`.ant-select-search__field`)];
ary.map((item) => { ary.map(item => {
item.setAttribute('readonly', 'readonly'); item.setAttribute('readonly', 'readonly');
// setTimeout(() => { // setTimeout(() => {
// ary.map(arr => { // ary.map(arr => {
...@@ -2773,9 +2645,10 @@ export default class tableCom extends Component { ...@@ -2773,9 +2645,10 @@ export default class tableCom extends Component {
option option
? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0 ? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
: false : false
}> }
>
{options && options instanceof Array {options && options instanceof Array
? options.map((r) => ( ? options.map(r => (
<Option key={r.value} value={r.value}> <Option key={r.value} value={r.value}>
{r.label} {r.label}
</Option> </Option>
...@@ -2794,7 +2667,8 @@ export default class tableCom extends Component { ...@@ -2794,7 +2667,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -2829,20 +2703,14 @@ export default class tableCom extends Component { ...@@ -2829,20 +2703,14 @@ export default class tableCom extends Component {
style={{ width: json.width }} style={{ width: json.width }}
/>, />,
); );
if(get === 'mobile') { if (get === 'mobile') {
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue, initialValue: initValue,
rules: rules:
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [{ required: required, message: '请选择' + dataColumn.title }], : [{ required: required, message: '请选择' + dataColumn.title }],
})( })(<MobileCascader options={options} label={title} disabled={disabled} json={json} />);
<MobileCascader options={options}
label={title}
disabled={disabled}
json={json}
/>);
} }
if ( if (
...@@ -2856,7 +2724,8 @@ export default class tableCom extends Component { ...@@ -2856,7 +2724,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -2912,7 +2781,8 @@ export default class tableCom extends Component { ...@@ -2912,7 +2781,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -2961,7 +2831,8 @@ export default class tableCom extends Component { ...@@ -2961,7 +2831,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3033,7 +2904,8 @@ export default class tableCom extends Component { ...@@ -3033,7 +2904,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3047,7 +2919,6 @@ export default class tableCom extends Component { ...@@ -3047,7 +2919,6 @@ export default class tableCom extends Component {
files = initValue.files; files = initValue.files;
} }
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: { files: files }, initialValue: { files: files },
rules: [ rules: [
...@@ -3064,7 +2935,8 @@ export default class tableCom extends Component { ...@@ -3064,7 +2935,8 @@ export default class tableCom extends Component {
}, },
], ],
})( })(
<UploadCom isMultiple={json.isMultiple} <UploadCom
isMultiple={json.isMultiple}
accept={json.accept} accept={json.accept}
btnName={json.btnName} btnName={json.btnName}
disabled={disabled || isPreview} disabled={disabled || isPreview}
...@@ -3081,7 +2953,8 @@ export default class tableCom extends Component { ...@@ -3081,7 +2953,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3106,7 +2979,8 @@ export default class tableCom extends Component { ...@@ -3106,7 +2979,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3149,14 +3023,14 @@ export default class tableCom extends Component { ...@@ -3149,14 +3023,14 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
} }
break; break;
case 'ChildForm': case 'ChildForm':
cm = getFieldDecorator(dataColumn.base52, { initialValue: initValue || {} })( cm = getFieldDecorator(dataColumn.base52, { initialValue: initValue || {} })(
<ChildForm <ChildForm
taskId={this.props.taskId} taskId={this.props.taskId}
...@@ -3196,7 +3070,8 @@ export default class tableCom extends Component { ...@@ -3196,7 +3070,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3221,7 +3096,8 @@ export default class tableCom extends Component { ...@@ -3221,7 +3096,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3246,7 +3122,8 @@ export default class tableCom extends Component { ...@@ -3246,7 +3122,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3280,7 +3157,8 @@ export default class tableCom extends Component { ...@@ -3280,7 +3157,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3324,7 +3202,8 @@ export default class tableCom extends Component { ...@@ -3324,7 +3202,8 @@ export default class tableCom extends Component {
{...modalProps} {...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]} visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)} handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}> title={modalTitle}
>
<ZdyTable <ZdyTable
taskId={this.props.taskId} taskId={this.props.taskId}
taskAssignee={taskAssignee} taskAssignee={taskAssignee}
...@@ -3361,7 +3240,8 @@ export default class tableCom extends Component { ...@@ -3361,7 +3240,8 @@ export default class tableCom extends Component {
style={{ style={{
minHeight: 40, minHeight: 40,
lineHeight: '40px', lineHeight: '40px',
}}> }}
>
<Col <Col
className={title ? styles.row_col_div : ''} className={title ? styles.row_col_div : ''}
span={json.labelSpan} span={json.labelSpan}
...@@ -3372,7 +3252,8 @@ export default class tableCom extends Component { ...@@ -3372,7 +3252,8 @@ export default class tableCom extends Component {
overflow: 'hidden', overflow: 'hidden',
fontSize: 14, fontSize: 14,
color: 'rgba(0,0,0,0.85)', color: 'rgba(0,0,0,0.85)',
}}> }}
>
{title} {title}
{title && ( {title && (
<span <span
...@@ -3380,7 +3261,8 @@ export default class tableCom extends Component { ...@@ -3380,7 +3261,8 @@ export default class tableCom extends Component {
position: 'relative', position: 'relative',
top: '-0.5px', top: '-0.5px',
margin: '0 8px 0 2px', margin: '0 8px 0 2px',
}}> }}
>
: :
</span> </span>
)} )}
...@@ -3392,7 +3274,8 @@ export default class tableCom extends Component { ...@@ -3392,7 +3274,8 @@ export default class tableCom extends Component {
lineHeight: '40px', lineHeight: '40px',
zoom: 1, zoom: 1,
fontSize: 14, fontSize: 14,
}}> }}
>
{cm} {cm}
</Col> </Col>
{modalCode ? ( {modalCode ? (
...@@ -3400,7 +3283,8 @@ export default class tableCom extends Component { ...@@ -3400,7 +3283,8 @@ export default class tableCom extends Component {
{...modalProps} {...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]} visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)} handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}> title={modalTitle}
>
<ZdyTable <ZdyTable
taskId={this.props.taskId} taskId={this.props.taskId}
taskAssignee={taskAssignee} taskAssignee={taskAssignee}
...@@ -3435,7 +3319,8 @@ export default class tableCom extends Component { ...@@ -3435,7 +3319,8 @@ export default class tableCom extends Component {
{...modalProps} {...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]} visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)} handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}> title={modalTitle}
>
<ZdyTable <ZdyTable
taskId={this.props.taskId} taskId={this.props.taskId}
taskAssignee={taskAssignee} taskAssignee={taskAssignee}
...@@ -3463,7 +3348,8 @@ export default class tableCom extends Component { ...@@ -3463,7 +3348,8 @@ export default class tableCom extends Component {
<Form.Item <Form.Item
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</Form.Item> </Form.Item>
</> </>
...@@ -3477,7 +3363,8 @@ export default class tableCom extends Component { ...@@ -3477,7 +3363,8 @@ export default class tableCom extends Component {
{...modalProps} {...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]} visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)} handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}> title={modalTitle}
>
<ZdyTable <ZdyTable
taskId={this.props.taskId} taskId={this.props.taskId}
taskAssignee={taskAssignee} taskAssignee={taskAssignee}
...@@ -3514,7 +3401,8 @@ export default class tableCom extends Component { ...@@ -3514,7 +3401,8 @@ export default class tableCom extends Component {
{...modalProps} {...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]} visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)} handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}> title={modalTitle}
>
<ZdyTable <ZdyTable
taskId={this.props.taskId} taskId={this.props.taskId}
taskAssignee={taskAssignee} taskAssignee={taskAssignee}
...@@ -3544,7 +3432,8 @@ export default class tableCom extends Component { ...@@ -3544,7 +3432,8 @@ export default class tableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
) : isEdit && get == 'web' ? ( ) : isEdit && get == 'web' ? (
...@@ -3552,7 +3441,8 @@ export default class tableCom extends Component { ...@@ -3552,7 +3441,8 @@ export default class tableCom extends Component {
<Form.Item <Form.Item
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</Form.Item> </Form.Item>
) : ( ) : (
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论