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

文件预览地址修改

上级 94b9d0ca
...@@ -70,19 +70,17 @@ import PictureSignature, { ...@@ -70,19 +70,17 @@ import PictureSignature, {
} from '@/webPublic/one_stop_public/libs/PictureSignature/PictureSignature'; } from '@/webPublic/one_stop_public/libs/PictureSignature/PictureSignature';
import WangEditor from '@/webPublic/zyd_public/WangEditor/OnstopWang'; import WangEditor from '@/webPublic/zyd_public/WangEditor/OnstopWang';
import { noPrefixRequest, uaaRequest } from '@/webPublic/one_stop_public/utils/request'; import { noPrefixRequest, uaaRequest } from '@/webPublic/one_stop_public/utils/request';
import RangePickerDiy, { getMomentArr } from '@/webPublic/one_stop_public/tableCompon/Split_Index/RangePickerDiy'; import RangePickerDiy, {
getMomentArr,
} from '@/webPublic/one_stop_public/tableCompon/Split_Index/RangePickerDiy';
import getActiveJson from '@/webPublic/one_stop_public/Table/getActiveJson'; import getActiveJson from '@/webPublic/one_stop_public/Table/getActiveJson';
import getOneStopUploadUrl from '@/webPublic/one_stop_public/Base16/getOneStopUploadUrl'; import getOneStopUploadUrl from '@/webPublic/one_stop_public/Base16/getOneStopUploadUrl';
import SwitchWeb from '@/webPublic/one_stop_public/tableCompon/Split_Index/SwitchWeb'; import SwitchWeb from '@/webPublic/one_stop_public/tableCompon/Split_Index/SwitchWeb';
import CronEditorDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/CronEditorDiy/index'; import CronEditorDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/CronEditorDiy/index';
import ButtonDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/ButtonDiy'; import ButtonDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/ButtonDiy';
import giveVarcharRules import giveVarcharRules from '@/webPublic/one_stop_public/tableCompon/Split_Index/giveVarcharLength';
from '@/webPublic/one_stop_public/tableCompon/Split_Index/giveVarcharLength';
const { const { MonthPicker, WeekPicker } = DatePicker;
MonthPicker,
WeekPicker,
} = DatePicker;
/** /**
* 日期组件antd3.x有bug 详情见禅道 27152 毕业跟踪调查管理 毕业时间改为年级筛选 * 日期组件antd3.x有bug 详情见禅道 27152 毕业跟踪调查管理 毕业时间改为年级筛选
*/ */
...@@ -103,13 +101,7 @@ const giveRender = (column = {}) => { ...@@ -103,13 +101,7 @@ const giveRender = (column = {}) => {
return column; return column;
}; };
@connect(({ DataColumn, SqlManageEntity, formList, loading }) => ({
@connect(({
DataColumn,
SqlManageEntity,
formList,
loading,
}) => ({
DataColumn, DataColumn,
SqlManageEntity, SqlManageEntity,
formList, formList,
...@@ -182,7 +174,7 @@ export default class TableCom extends Component { ...@@ -182,7 +174,7 @@ export default class TableCom extends Component {
file = { file = {
name: 'file', name: 'file',
action: getOneStopUploadUrl(), action: getOneStopUploadUrl(),
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,
...@@ -203,7 +195,7 @@ export default class TableCom extends Component { ...@@ -203,7 +195,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();
}; };
...@@ -215,20 +207,15 @@ export default class TableCom extends Component { ...@@ -215,20 +207,15 @@ export default class TableCom extends Component {
}; };
getColumnSearchProps = (dataIndex, title) => ({ getColumnSearchProps = (dataIndex, title) => ({
filterDropdown: ({ filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => (
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={{ style={{
width: 188, width: 188,
...@@ -245,34 +232,34 @@ export default class TableCom extends Component { ...@@ -245,34 +232,34 @@ export default class TableCom extends Component {
style={{ style={{
width: 90, width: 90,
marginRight: 8, 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]
.toString() .toString()
.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
...@@ -307,11 +294,7 @@ export default class TableCom extends Component { ...@@ -307,11 +294,7 @@ export default class TableCom extends Component {
}; };
componentWillReceiveProps(props) { componentWillReceiveProps(props) {
const { const { json, mapData, obj } = props;
json,
mapData,
obj,
} = props;
if (json == null || this.props.safe) { if (json == null || this.props.safe) {
return; return;
} }
...@@ -369,7 +352,7 @@ export default class TableCom extends Component { ...@@ -369,7 +352,7 @@ export default class TableCom extends Component {
console.log( console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props `页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props
.i + 1}行,第${this.props.j + .i + 1}行,第${this.props.j +
1}列:存在循环风险,1秒内执行超过10次,现已停止执行,请检查,`, 1}列:存在循环风险,1秒内执行超过10次,现已停止执行,请检查,`,
); );
return; return;
...@@ -391,9 +374,9 @@ export default class TableCom extends Component { ...@@ -391,9 +374,9 @@ export default class TableCom extends Component {
this.props.fatherCode != null this.props.fatherCode != null
? bindObj ? bindObj
? { ? {
...bindObj, ...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`, 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; : bindObj;
if (this.props.fatherCode == null && dataColumn == null) { if (this.props.fatherCode == null && dataColumn == null) {
...@@ -429,21 +412,18 @@ export default class TableCom extends Component { ...@@ -429,21 +412,18 @@ export default class TableCom extends Component {
allValues = JSON.stringify(allValues); allValues = JSON.stringify(allValues);
if (json.comName === 'TableSelect') { if (json.comName === 'TableSelect') {
const { dispatch } = this.props; const { dispatch } = this.props;
const { const { sqlKey, optionType } = json;
sqlKey,
optionType,
} = json;
if (optionType === 'sql') { if (optionType === 'sql') {
dispatch({ dispatch({
type: 'SqlManageEntity/find', type: 'SqlManageEntity/find',
payload: { sqlKey }, payload: { 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++) {
...@@ -454,8 +434,7 @@ export default class TableCom extends Component { ...@@ -454,8 +434,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) column.render = val => moment(val).format('YYYY-MM-DD HH:mm:ss');
.format('YYYY-MM-DD HH:mm:ss');
} }
column = giveRender(column); column = giveRender(column);
...@@ -492,8 +471,7 @@ export default class TableCom extends Component { ...@@ -492,8 +471,7 @@ export default class TableCom extends Component {
break; break;
} }
column.render = (val) => moment(parseInt(val)) column.render = val => moment(parseInt(val)).format(ff);
.format(ff);
} }
if (cll[k].isQuery) { if (cll[k].isQuery) {
column = { column = {
...@@ -515,7 +493,7 @@ export default class TableCom extends Component { ...@@ -515,7 +493,7 @@ export default class TableCom extends Component {
sqlKey, sqlKey,
allValues, allValues,
}, },
callback: (list) => { callback: list => {
const x = { const x = {
list: list, list: list,
pagination: false, pagination: false,
...@@ -530,7 +508,7 @@ export default class TableCom extends Component { ...@@ -530,7 +508,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++) {
...@@ -539,8 +517,7 @@ export default class TableCom extends Component { ...@@ -539,8 +517,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) column.render = val => moment(val).format('YYYY-MM-DD HH:mm:ss');
.format('YYYY-MM-DD HH:mm:ss');
} }
column = giveRender(column); column = giveRender(column);
columns.push(column); columns.push(column);
...@@ -578,13 +555,7 @@ export default class TableCom extends Component { ...@@ -578,13 +555,7 @@ export default class TableCom extends Component {
break; break;
case 'sql': case 'sql':
if (json.sqlKey != null && json.sqlKey != '') { if (json.sqlKey != null && json.sqlKey != '') {
this.fetchData3( this.fetchData3(obj, dataColumn, init, json, allValues);
obj,
dataColumn,
init,
json,
allValues,
);
} }
break; break;
case 'func': case 'func':
...@@ -676,7 +647,7 @@ export default class TableCom extends Component { ...@@ -676,7 +647,7 @@ export default class TableCom extends Component {
} catch (e) { } catch (e) {
console.log( console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + `页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i +
1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`, 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
e, e,
); );
} }
...@@ -770,7 +741,7 @@ export default class TableCom extends Component { ...@@ -770,7 +741,7 @@ export default class TableCom extends Component {
} catch (e) { } catch (e) {
console.log( console.log(
`页面${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j + `页面${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`, 1}列:公式配置有误,回调函数内部错误,`,
e, e,
); );
} }
...@@ -785,79 +756,78 @@ export default class TableCom extends Component { ...@@ -785,79 +756,78 @@ export default class TableCom extends Component {
delete params[i]; delete params[i];
} }
} }
noPrefixRequest(url, params) noPrefixRequest(url, params).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(
this.setState( {
{ res: data,
res: data, reqUrls,
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); if (res != null && !(typeof res === 'function')) {
if (res != null && !(typeof res === 'function')) { this.setState(
this.setState( {
{ options: res,
options: res, selectDis: false,
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) { console.log(
console.log( `页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this .props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`, e,
e, );
); }
} else if (['Echart', 'QRCode', 'Graph'].includes(json.comName)) {
try {
const x = callback(data);
if (x != null) {
this.setState({ option: x });
} }
} else if (['Echart', 'QRCode', 'Graph'].includes(json.comName)) { } catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
} else {
if (base52) {
try { try {
const x = callback(data); const x = callback(data);
if (x != null) { // console.log(x, '757');
this.setState({ option: x }); if (x == null || x != 'NaN') this.props.form.setFieldsValue({ [base52]: x });
}
} catch (e) { } catch (e) {
console.log( console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this `页面${this.props.currentFormTitle} ${this.props.formKey} ${
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`, json.comName
}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
e, e,
); );
} }
} else {
if (base52) {
try {
const x = callback(data);
// console.log(x, '757');
if (x == null || x != 'NaN') this.props.form.setFieldsValue({ [base52]: x });
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${
json.comName
}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
}
} }
} }
}, }
); },
}); );
});
return 'norefeshxxxxxxxxxxxxxxxxxxxx'; return 'norefeshxxxxxxxxxxxxxxxxxxxx';
}; };
...@@ -988,50 +958,62 @@ export default class TableCom extends Component { ...@@ -988,50 +958,62 @@ export default class TableCom extends Component {
if (getToken() != null) { if (getToken() != null) {
pp.token = getToken(); pp.token = getToken();
} }
uaaRequest(url, pp) uaaRequest(url, pp).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 }); if (data == null) {
if (data == null) { return;
return; }
}
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')) { if (res != null && !(typeof res === 'function')) {
this.setState( this.setState(
{ {
options: res, options: res,
selectDis: false, 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) {
console.log( console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this `页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`, .props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
e, e,
); );
}
} else if (
json.comName == 'Echart' ||
json.comName == 'QRCode' ||
json.comName == 'Graph'
) {
try {
const x = callback(data);
if (x != null) {
this.setState({ option: x });
} }
} else if ( } catch (e) {
json.comName == 'Echart' || console.log(
json.comName == 'QRCode' || `页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
json.comName == 'Graph' .props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
) { e,
);
}
} else {
if (base52) {
try { try {
const x = callback(data); const x = callback(data);
if (x != null) { // console.log(x, 938);
this.setState({ option: x }); if (x == null || x != 'NaN') this.props.form.setFieldsValue({ [base52]: x });
}
} catch (e) { } catch (e) {
console.log( console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this `页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
...@@ -1039,23 +1021,10 @@ export default class TableCom extends Component { ...@@ -1039,23 +1021,10 @@ export default class TableCom extends Component {
e, e,
); );
} }
} else {
if (base52) {
try {
const x = callback(data);
// console.log(x, 938);
if (x == null || x != 'NaN') this.props.form.setFieldsValue({ [base52]: x });
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
}
} }
} }
}); }
});
}); });
return 'norefeshxxxxxxxxxxxxxxxxxxxx'; return 'norefeshxxxxxxxxxxxxxxxxxxxx';
...@@ -1070,8 +1039,8 @@ export default class TableCom extends Component { ...@@ -1070,8 +1039,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;
}); });
}); });
...@@ -1123,7 +1092,8 @@ export default class TableCom extends Component { ...@@ -1123,7 +1092,8 @@ export default class TableCom extends Component {
}, },
this.props.index, this.props.index,
this.props.fatherCode, this.props.fatherCode,
{ // utils函数的参数 {
// utils函数的参数
moment, moment,
sql: this.sqlUtil.bind(this, base52, json, callback), // utils.sql xxx sql: this.sqlUtil.bind(this, base52, json, callback), // utils.sql xxx
message, message,
...@@ -1186,19 +1156,14 @@ export default class TableCom extends Component { ...@@ -1186,19 +1156,14 @@ export default class TableCom extends Component {
} catch (e) { } catch (e) {
console.log( console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i + `页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i +
1}行,第${this.props.j + 1}列:公式配置有误,暂存失败,`, 1}行,第${this.props.j + 1}列:公式配置有误,暂存失败,`,
e, e,
); );
} }
}; };
componentDidMount() { componentDidMount() {
const { const { json, mapData, obj, init } = this.props;
json,
mapData,
obj,
init,
} = this.props;
if (json == null) { if (json == null) {
return; return;
} }
...@@ -1207,7 +1172,7 @@ export default class TableCom extends Component { ...@@ -1207,7 +1172,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 });
}, },
}); });
...@@ -1219,9 +1184,9 @@ export default class TableCom extends Component { ...@@ -1219,9 +1184,9 @@ export default class TableCom extends Component {
this.props.fatherCode != null this.props.fatherCode != null
? bindObj ? bindObj
? { ? {
...bindObj, ...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`, 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; : bindObj;
if (this.props.fatherCode == null && dataColumn == null) { if (this.props.fatherCode == null && dataColumn == null) {
...@@ -1243,14 +1208,9 @@ export default class TableCom extends Component { ...@@ -1243,14 +1208,9 @@ export default class TableCom extends Component {
} }
fetchData3 = (obj, dataColumn, init, json, allValues) => { fetchData3 = (obj, dataColumn, init, json, allValues) => {
const { const { sqlKey, labelName, valueName, isMeta, filterSql } = json;
sqlKey, if (isMeta) {
labelName, // 2022年7月5日 2022 姚鑫国说的 如果是元数据 不需要传这个allValues
valueName,
isMeta,
filterSql,
} = json;
if (isMeta) { // 2022年7月5日 2022 姚鑫国说的 如果是元数据 不需要传这个allValues
// 解决禅道bug 28017 // 解决禅道bug 28017
allValues = {}; allValues = {};
} }
...@@ -1263,14 +1223,15 @@ export default class TableCom extends Component { ...@@ -1263,14 +1223,15 @@ export default class TableCom extends Component {
filterSql: isMeta ? filterSql || '' : undefined, filterSql: isMeta ? filterSql || '' : undefined,
}; };
let getSqlOptionsCache = JSON.stringify(params); let getSqlOptionsCache = JSON.stringify(params);
if (isMeta && getSqlOptionsCache === this.state.getSqlOptionsCache) { // 当上次的请求参数和这次的相同时 不再发起请求 if (isMeta && getSqlOptionsCache === this.state.getSqlOptionsCache) {
// 当上次的请求参数和这次的相同时 不再发起请求
return false; return false;
} }
dispatch({ dispatch({
type: 'DataColumn/getSqlOptions', type: 'DataColumn/getSqlOptions',
payload: params, payload: params,
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];
...@@ -1313,7 +1274,8 @@ export default class TableCom extends Component { ...@@ -1313,7 +1274,8 @@ export default class TableCom extends Component {
}; };
let getSqlOptionsCache = JSON.stringify(params); let getSqlOptionsCache = JSON.stringify(params);
if (isMeta && getSqlOptionsCache === this.state.getSqlOptionsCache) { // 当上次的请求参数和这次的相同时 不再发起请求 if (isMeta && getSqlOptionsCache === this.state.getSqlOptionsCache) {
// 当上次的请求参数和这次的相同时 不再发起请求
return false; return false;
} }
...@@ -1321,7 +1283,7 @@ export default class TableCom extends Component { ...@@ -1321,7 +1283,7 @@ export default class TableCom extends Component {
dispatch({ dispatch({
type: 'DataColumn/getSqlLabels', type: 'DataColumn/getSqlLabels',
payload: params, payload: params,
callback: (labels) => { callback: labels => {
this.setState({ this.setState({
getSqlOptionsCache, getSqlOptionsCache,
labels, labels,
...@@ -1339,14 +1301,14 @@ export default class TableCom extends Component { ...@@ -1339,14 +1301,14 @@ export default class TableCom extends Component {
}; };
// console.log('1332', this.state.getSqlOptionsCache, JSON.stringify(params)); // console.log('1332', this.state.getSqlOptionsCache, JSON.stringify(params));
let getSqlOptionsCache = JSON.stringify(params); let getSqlOptionsCache = JSON.stringify(params);
if (isMeta && getSqlOptionsCache === this.state.getSqlOptionsCache) { // 当上次的请求参数和这次的相同时 不再发起请求 if (isMeta && getSqlOptionsCache === this.state.getSqlOptionsCache) {
// 当上次的请求参数和这次的相同时 不再发起请求
return false; return false;
} }
dispatch({ dispatch({
type: 'DataColumn/getSqlOptions', type: 'DataColumn/getSqlOptions',
payload: params, payload: params,
callback: (options) => { callback: options => {
// console.log(options); // console.log(options);
let base52 = dataColumn.base52; let base52 = dataColumn.base52;
let vl = this.props.form.getFieldsValue()[base52]; let vl = this.props.form.getFieldsValue()[base52];
...@@ -1429,7 +1391,7 @@ export default class TableCom extends Component { ...@@ -1429,7 +1391,7 @@ export default class TableCom extends Component {
filterSql, filterSql,
allValues, 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({
...@@ -1453,7 +1415,7 @@ export default class TableCom extends Component { ...@@ -1453,7 +1415,7 @@ export default class TableCom extends Component {
filterSql, filterSql,
allValues, allValues,
}, },
callback: (labels) => { callback: labels => {
this.setState({ this.setState({
labels, labels,
selectDis: false, selectDis: false,
...@@ -1469,7 +1431,7 @@ export default class TableCom extends Component { ...@@ -1469,7 +1431,7 @@ export default class TableCom extends Component {
filterSql, filterSql,
allValues, 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({
...@@ -1485,11 +1447,8 @@ export default class TableCom extends Component { ...@@ -1485,11 +1447,8 @@ export default class TableCom extends Component {
}); });
} }
}; };
getColumn = (key) => { getColumn = key => {
let { let { mapData, json } = this.props;
mapData,
json,
} = this.props;
const columnIds = json?.columnIds; const columnIds = json?.columnIds;
...@@ -1545,20 +1504,8 @@ export default class TableCom extends Component { ...@@ -1545,20 +1504,8 @@ export default class TableCom extends Component {
// console.log(formKey, json); // console.log(formKey, json);
// } // }
const { const { options, labels, selectDis, modalCode, modalTitle, modalInit, modalProps } = this.state;
options, const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form;
labels,
selectDis,
modalCode,
modalTitle,
modalInit,
modalProps,
} = this.state;
const {
getFieldDecorator,
getFieldError,
getFieldProps,
} = this.props.form;
const disabled = json != null ? json.disabled : false; const disabled = json != null ? json.disabled : false;
const permRank = json != null ? (json.permRank != null ? json.permRank : 0) : 0; const permRank = json != null ? (json.permRank != null ? json.permRank : 0) : 0;
if (json?.label === '账号') { if (json?.label === '账号') {
...@@ -1581,7 +1528,7 @@ export default class TableCom extends Component { ...@@ -1581,7 +1528,7 @@ export default class TableCom extends Component {
) { ) {
return <></>; return <></>;
} }
return <QRCode {...this.state.option} key={uuid}/>; return <QRCode {...this.state.option} key={uuid} />;
} }
if (json.comName == 'Echart') { if (json.comName == 'Echart') {
return ( return (
...@@ -1597,7 +1544,7 @@ export default class TableCom extends Component { ...@@ -1597,7 +1544,7 @@ export default class TableCom extends Component {
); );
} }
if (json.comName == 'Graph') { if (json.comName == 'Graph') {
return <Neo4jD3Com key={uuid} json={json} option={this.state.option || []}/>; return <Neo4jD3Com key={uuid} json={json} option={this.state.option || []} />;
} }
if (json.comName == 'PartForm') { if (json.comName == 'PartForm') {
...@@ -1612,8 +1559,7 @@ export default class TableCom extends Component { ...@@ -1612,8 +1559,7 @@ export default class TableCom extends Component {
<> <>
{this.props.form.getFieldDecorator(uuid, { {this.props.form.getFieldDecorator(uuid, {
initialValue: fk, initialValue: fk,
})(<Input type="hidden"/>)} })(<Input type="hidden" />)}{' '}
{' '}
<ZdyTable <ZdyTable
taskId={this.props.taskId} taskId={this.props.taskId}
importExcel={this.props.importExcel} importExcel={this.props.importExcel}
...@@ -1667,7 +1613,8 @@ export default class TableCom extends Component { ...@@ -1667,7 +1613,8 @@ export default class TableCom extends Component {
style={{ style={{
textAlign: 'center', textAlign: 'center',
height: value == null ? 20 : null, height: value == null ? 20 : null,
}}> }}
>
{value} {value}
</div> </div>
); );
...@@ -1688,15 +1635,16 @@ export default class TableCom extends Component { ...@@ -1688,15 +1635,16 @@ export default class TableCom extends Component {
<> <>
{this.props.form.getFieldDecorator(uid, { {this.props.form.getFieldDecorator(uid, {
initialValue: obj[uuid] || json.initialValue, initialValue: obj[uuid] || json.initialValue,
})(<Input type="hidden"/>)} })(<Input type="hidden" />)}
<span <span
style={{ style={{
fontWeight: get === 'mobile' ? 'bold' : '', fontWeight: get === 'mobile' ? 'bold' : '',
marginRight: get === 'mobile' ? 12 : '', marginRight: get === 'mobile' ? 12 : '',
}} }}
{...json.props}> {...json.props}
{obj[uuid] || json.initialValue} >
</span> {obj[uuid] || json.initialValue}
</span>
</> </>
); );
} else { } else {
...@@ -1704,15 +1652,16 @@ export default class TableCom extends Component { ...@@ -1704,15 +1652,16 @@ export default class TableCom extends Component {
<> <>
{this.props.form.getFieldDecorator(uid, { {this.props.form.getFieldDecorator(uid, {
initialValue: this.props.form.getFieldsValue()[uid] || json.initialValue, initialValue: this.props.form.getFieldsValue()[uid] || json.initialValue,
})(<Input type="hidden"/>)} })(<Input type="hidden" />)}
<span <span
style={{ style={{
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]} >
</span> {this.props.form.getFieldsValue()[uid]}
</span>
</> </>
); );
} }
...@@ -1751,54 +1700,53 @@ export default class TableCom extends Component { ...@@ -1751,54 +1700,53 @@ export default class TableCom extends Component {
case 'TextArea': case 'TextArea':
cm = ( cm = (
<span style={{ paddingRight: get === 'mobile' ? 8 : '' }}> <span style={{ paddingRight: get === 'mobile' ? 8 : '' }}>
{value} {value}
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</span> </span>
); );
break; break;
case 'Switch': case 'Switch':
cm = ( cm = (
<span> <span>
{value} {value}
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</span> </span>
); );
break; break;
case 'Input': case 'Input':
cm = ( cm = (
<span style={{ paddingRight: get === 'mobile' ? 8 : '' }} data-com-name={'input'}> <span style={{ paddingRight: get === 'mobile' ? 8 : '' }} data-com-name={'input'}>
{value} {value}
{get === 'mobile' ? '' : ''} {get === 'mobile' ? '' : ''}
</span> </span>
); );
break; break;
case 'Cron': case 'Cron':
cm = ( cm = (
<span style={{ paddingRight: get == 'mobile' ? 8 : '' }}> <span style={{ paddingRight: get == 'mobile' ? 8 : '' }}>
{value} {value}
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</span> </span>
); );
break; break;
case 'InputNumber': case 'InputNumber':
cm = ( cm = (
<span> <span>
{value} {value}
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</span> </span>
); );
break; break;
case 'DatePicker': case 'DatePicker':
cm = value ? ( cm = value ? (
<span> <span>
{moment(parseInt(value)) {moment(parseInt(value)).format('YYYY-MM-DD HH:mm:ss')}
.format('YYYY-MM-DD HH:mm:ss')} {get === 'mobile' ? <br /> : ''}
{get === 'mobile' ? <br/> : ''} </span>
</span>
) : ( ) : (
'' ''
); );
...@@ -1819,7 +1767,7 @@ export default class TableCom extends Component { ...@@ -1819,7 +1767,7 @@ export default class TableCom extends Component {
); );
})} })}
</ul> </ul>
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</> </>
); );
...@@ -1839,7 +1787,7 @@ export default class TableCom extends Component { ...@@ -1839,7 +1787,7 @@ export default class TableCom extends Component {
); );
})} })}
</ul> </ul>
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</> </>
); );
...@@ -1864,7 +1812,7 @@ export default class TableCom extends Component { ...@@ -1864,7 +1812,7 @@ export default class TableCom extends Component {
height: json.height, height: json.height,
}} }}
/> />
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</> </>
); );
} }
...@@ -1890,7 +1838,7 @@ export default class TableCom extends Component { ...@@ -1890,7 +1838,7 @@ export default class TableCom extends Component {
height: json.height, height: json.height,
}} }}
/> />
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</> </>
); );
} }
...@@ -1907,7 +1855,8 @@ export default class TableCom extends Component { ...@@ -1907,7 +1855,8 @@ export default class TableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || 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>
); );
...@@ -1918,12 +1867,13 @@ export default class TableCom extends Component { ...@@ -1918,12 +1867,13 @@ export default class TableCom extends Component {
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || 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}`, {
initialValue: value, initialValue: value,
})(<Input type="hidden"/>)} })(<Input type="hidden" />)}
</> </>
); );
} }
...@@ -1936,7 +1886,7 @@ export default class TableCom extends Component { ...@@ -1936,7 +1886,7 @@ export default class TableCom extends Component {
{cm} {cm}
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, { {this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value, initialValue: value,
})(<Input type="hidden"/>)} })(<Input type="hidden" />)}
</> </>
); );
} }
...@@ -1950,7 +1900,8 @@ export default class TableCom extends Component { ...@@ -1950,7 +1900,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}
...@@ -1961,7 +1912,8 @@ export default class TableCom extends Component { ...@@ -1961,7 +1912,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}
...@@ -1970,9 +1922,10 @@ export default class TableCom extends Component { ...@@ -1970,9 +1922,10 @@ 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>
</> </>
) : sqlData[key] ? ( ) : sqlData[key] ? (
<> <>
...@@ -1982,9 +1935,10 @@ export default class TableCom extends Component { ...@@ -1982,9 +1935,10 @@ 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>
</> </>
) : ( ) : (
'' ''
...@@ -1997,7 +1951,8 @@ export default class TableCom extends Component { ...@@ -1997,7 +1951,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>
...@@ -2007,7 +1962,8 @@ export default class TableCom extends Component { ...@@ -2007,7 +1962,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>
); );
...@@ -2018,12 +1974,13 @@ export default class TableCom extends Component { ...@@ -2018,12 +1974,13 @@ 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}`, {
initialValue: value, initialValue: value,
})(<Input type="hidden"/>)} })(<Input type="hidden" />)}
</> </>
); );
} }
...@@ -2036,7 +1993,7 @@ export default class TableCom extends Component { ...@@ -2036,7 +1993,7 @@ export default class TableCom extends Component {
{cm} {cm}
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, { {this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value, initialValue: value,
})(<Input type="hidden"/>)} })(<Input type="hidden" />)}
</> </>
); );
} }
...@@ -2052,9 +2009,9 @@ export default class TableCom extends Component { ...@@ -2052,9 +2009,9 @@ export default class TableCom extends Component {
this.props.fatherCode != null this.props.fatherCode != null
? bindObj ? bindObj
? { ? {
...bindObj, ...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`, base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
} }
: { base52: `${this.props.fatherCode}.[${this.props.index}].${uuid}` } : { base52: `${this.props.fatherCode}.[${this.props.index}].${uuid}` }
: bindObj; : bindObj;
...@@ -2090,16 +2047,6 @@ export default class TableCom extends Component { ...@@ -2090,16 +2047,6 @@ export default class TableCom extends Component {
} }
} }
} }
// if(json.comName === "Cascader" && this.props.uuid === 'id_32691685234912400529714267d34dc585a2'){
// console.log({
// objinit,
// fatherCode: this.props.fatherCode,
// index: this.props.fatherCode,
// bindObj,
// dataColumn,
//
// });
// }
if (!isEdit) { if (!isEdit) {
if (this.props.fatherCode) { if (this.props.fatherCode) {
...@@ -2112,9 +2059,6 @@ export default class TableCom extends Component { ...@@ -2112,9 +2059,6 @@ export default class TableCom extends Component {
// console.log(json.comName); // console.log(json.comName);
switch (json.comName) { switch (json.comName) {
// 电子签章展示
// case 'Signature':
// break;
case 'RichText': case 'RichText':
cm = ( cm = (
<Editor <Editor
...@@ -2128,7 +2072,7 @@ export default class TableCom extends Component { ...@@ -2128,7 +2072,7 @@ export default class TableCom extends Component {
case 'WangEditor': case 'WangEditor':
let textV = obj[dataColumn.base52]; let textV = obj[dataColumn.base52];
if (!textV || textV === 'null') { if (!textV || textV === 'null') {
return <div/>; return <div />;
} }
cm = ( cm = (
<div <div
...@@ -2145,9 +2089,10 @@ ${obj[dataColumn.base52]} ...@@ -2145,9 +2089,10 @@ ${obj[dataColumn.base52]}
<span <span
style={{ style={{
wordBreak: 'break-all', wordBreak: 'break-all',
}}> }}
{obj[dataColumn.base52]} >
</span> {obj[dataColumn.base52]}
</span>
); );
break; break;
case 'Switch': case 'Switch':
...@@ -2161,9 +2106,10 @@ ${obj[dataColumn.base52]} ...@@ -2161,9 +2106,10 @@ ${obj[dataColumn.base52]}
data-obj-comname={'Input'} data-obj-comname={'Input'}
style={{ style={{
wordBreak: 'break-all', wordBreak: 'break-all',
}}> }}
{obj[dataColumn.base52]} >
</span> {obj[dataColumn.base52]}
</span>
); );
break; break;
...@@ -2189,9 +2135,8 @@ ${obj[dataColumn.base52]} ...@@ -2189,9 +2135,8 @@ ${obj[dataColumn.base52]}
case 'Checkbox': case 'Checkbox':
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>
...@@ -2203,9 +2148,9 @@ ${obj[dataColumn.base52]} ...@@ -2203,9 +2148,9 @@ ${obj[dataColumn.base52]}
) : ( ) : (
',' + Object.values(r) ',' + Object.values(r)
), ),
) )
: ''} : ''}
</span> </span>
); );
break; break;
...@@ -2239,8 +2184,8 @@ ${obj[dataColumn.base52]} ...@@ -2239,8 +2184,8 @@ ${obj[dataColumn.base52]}
} else { } else {
cm = ( cm = (
<span> <span>
{ds.map((r, i) => (i == 0 ? r[json.labelName] : ',' + r[json.labelName]))} {ds.map((r, i) => (i == 0 ? r[json.labelName] : ',' + r[json.labelName]))}
</span> </span>
); );
} }
...@@ -2263,16 +2208,14 @@ ${obj[dataColumn.base52]} ...@@ -2263,16 +2208,14 @@ ${obj[dataColumn.base52]}
} else { } else {
cm = ( cm = (
<span> <span>
{moment(parseInt(obj[begin.base52])) {moment(parseInt(obj[begin.base52])).format(
.format( json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', )}{' '}
)}{' '}
{' '} {' '}
{moment(parseInt(obj[end.base52])) {moment(parseInt(obj[end.base52])).format(
.format( json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', )}
)} </span>
</span>
); );
} }
} else { } else {
...@@ -2281,25 +2224,22 @@ ${obj[dataColumn.base52]} ...@@ -2281,25 +2224,22 @@ ${obj[dataColumn.base52]}
title = title ? title : '起止时间'; title = title ? title : '起止时间';
break; break;
case 'DatePicker': case 'DatePicker':
const vTime = obj[dataColumn.base52]; const vTime = obj[dataColumn.base52];
if (vTime && typeof vTime === 'string' && vTime.indexOf('-') <= -1) { if (vTime && typeof vTime === 'string' && vTime.indexOf('-') <= -1) {
cm = ( cm = (
<span> <span>
{moment(parseInt(vTime)) {moment(parseInt(vTime)).format(json.format ? json.format : 'YYYY-MM-DD HH:mm:ss')}
.format(json.format ? json.format : 'YYYY-MM-DD HH:mm:ss')} </span>
</span>
); );
} else { } else {
cm = ( cm = (
<span> <span>
{vTime {vTime
? moment(+new Date(vTime)) ? moment(+new Date(vTime)).format(
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
) )
: ''} : ''}
</span> </span>
); );
} }
...@@ -2340,18 +2280,18 @@ ${obj[dataColumn.base52]} ...@@ -2340,18 +2280,18 @@ ${obj[dataColumn.base52]}
cm = ( cm = (
<ul className={styles.imageUl}> <ul className={styles.imageUl}>
{Array.isArray(files) && {Array.isArray(files) &&
files.map((f, index2) => { files.map((f, index2) => {
return ( return (
<li key={f.path}> <li key={f.path}>
<PictureSignature <PictureSignature
json={json} json={json}
disabled={true} // 只读模式 disabled={true} // 只读模式
basicUrl={queryApiActionPath()} basicUrl={queryApiActionPath()}
fileInfo={f} fileInfo={f}
/> />
</li> </li>
); );
})} })}
</ul> </ul>
); );
} }
...@@ -2416,29 +2356,26 @@ ${obj[dataColumn.base52]} ...@@ -2416,29 +2356,26 @@ ${obj[dataColumn.base52]}
cm = ( cm = (
<ul className={styles.imageUl}> <ul className={styles.imageUl}>
{Array.isArray(files) && {Array.isArray(files) &&
files.map((f, index2) => { files.map((f, index2) => {
if (get === 'web' || !this.props.isPrint) { if (get === 'web' || !this.props.isPrint) {
return (
<li key={index2}>
<FilePreview
path={queryFileUrl(f.path)}
pathName={f.name}
type={'UploadCom'}
/>
</li>
);
}
return ( return (
<li key={index2}> <li key={index2}>
<FilePreview <a target="_blank" key={f.filePath} href={queryFileUrl(f.filePath)}>
path={queryFileUrl(f.path)} {f.fileName}
pathName={f.name} </a>
type={'UploadCom'}
/>
</li> </li>
); );
} })}
return (
<li key={index2}>
<a
target="_blank"
key={f.filePath}
href={queryFileUrl(f.filePath)}>
{f.fileName}
</a>
</li>
);
})}
</ul> </ul>
); );
} }
...@@ -2449,9 +2386,10 @@ ${obj[dataColumn.base52]} ...@@ -2449,9 +2386,10 @@ ${obj[dataColumn.base52]}
display: 'inline-block', display: 'inline-block',
width: '100%', width: '100%',
textAlign: 'center', textAlign: 'center',
}}> }}
暂无附件 >
</span> 暂无附件
</span>
); );
} }
...@@ -2538,7 +2476,6 @@ ${obj[dataColumn.base52]} ...@@ -2538,7 +2476,6 @@ ${obj[dataColumn.base52]}
); );
} }
break; break;
case 'ChildForm': case 'ChildForm':
const xxxxx = obj[dataColumn.base52]; const xxxxx = obj[dataColumn.base52];
...@@ -2642,10 +2579,10 @@ ${obj[dataColumn.base52]} ...@@ -2642,10 +2579,10 @@ ${obj[dataColumn.base52]}
default: default:
cm = ( cm = (
<span> <span>
缺乏字段 缺乏字段
{json.comName} {json.comName}
的匹配项 的匹配项
</span> </span>
); );
break; break;
} }
...@@ -2706,21 +2643,22 @@ ${obj[dataColumn.base52]} ...@@ -2706,21 +2643,22 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择' + title, 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
...@@ -2736,14 +2674,12 @@ ${obj[dataColumn.base52]} ...@@ -2736,14 +2674,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择' + title, message: '请选择' + title,
}, },
], ],
})( })(<SwitchWeb json={json} disabled={disabled} />);
<SwitchWeb json={json} disabled={disabled}/>,
);
break; break;
case 'TextArea': case 'TextArea':
...@@ -2759,11 +2695,11 @@ ${obj[dataColumn.base52]} ...@@ -2759,11 +2695,11 @@ ${obj[dataColumn.base52]}
if (get === 'mobile') { if (get === 'mobile') {
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue, initialValue: initValue,
rules:giveVarcharRules({ rules: giveVarcharRules({
dataColumn, dataColumn,
json, json,
required, required,
title title,
}), }),
})( })(
<TextArea <TextArea
...@@ -2784,7 +2720,8 @@ ${obj[dataColumn.base52]} ...@@ -2784,7 +2720,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -2794,11 +2731,11 @@ ${obj[dataColumn.base52]} ...@@ -2794,11 +2731,11 @@ ${obj[dataColumn.base52]}
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue, initialValue: initValue,
rules:giveVarcharRules({ rules: giveVarcharRules({
dataColumn, dataColumn,
json, json,
required, required,
title title,
}), }),
})( })(
<TextArea <TextArea
...@@ -2821,7 +2758,7 @@ ${obj[dataColumn.base52]} ...@@ -2821,7 +2758,7 @@ ${obj[dataColumn.base52]}
otherProps = {}; otherProps = {};
} }
} }
const { disabledInputStyle = {},addonAfter } = otherProps; const { disabledInputStyle = {}, addonAfter } = otherProps;
let inputStyle = { let inputStyle = {
width: json.width, width: json.width,
}; };
...@@ -2837,7 +2774,7 @@ ${obj[dataColumn.base52]} ...@@ -2837,7 +2774,7 @@ ${obj[dataColumn.base52]}
dataColumn, dataColumn,
json, json,
required, required,
title title,
}), }),
})( })(
<Input <Input
...@@ -2860,7 +2797,8 @@ ${obj[dataColumn.base52]} ...@@ -2860,7 +2797,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -2870,7 +2808,7 @@ ${obj[dataColumn.base52]} ...@@ -2870,7 +2808,7 @@ ${obj[dataColumn.base52]}
case 'InputHidden': case 'InputHidden':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue, initialValue: initValue,
})(<Input type="hidden"/>); })(<Input type="hidden" />);
break; break;
case 'InputNumber': case 'InputNumber':
if (json?.otherProps) { if (json?.otherProps) {
...@@ -2887,18 +2825,18 @@ ${obj[dataColumn.base52]} ...@@ -2887,18 +2825,18 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请输入' + title, message: '请输入' + title,
}, },
], ],
})( })(
<InputNumber <InputNumber
disabled={disabled} disabled={disabled}
placeholder={json.placeholder} placeholder={json.placeholder}
max={json.max} max={json.max}
min={json.min} min={json.min}
addonAfter={otherProps?.addonAfter}//3.0ant 不支持 addonAfter={otherProps?.addonAfter} //3.0ant 不支持
precision={json.precision} precision={json.precision}
step={json.step} step={json.step}
/>, />,
...@@ -2915,7 +2853,8 @@ ${obj[dataColumn.base52]} ...@@ -2915,7 +2853,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -2933,12 +2872,12 @@ ${obj[dataColumn.base52]} ...@@ -2933,12 +2872,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择' + dataColumn.title, message: '请选择' + dataColumn.title,
}, },
], ],
})(<Radio.Group options={options} disabled={disabled}/>); })(<Radio.Group options={options} disabled={disabled} />);
if (get == 'mobile') { if (get == 'mobile') {
cm = <div>{cm}</div>; cm = <div>{cm}</div>;
if ( if (
...@@ -2951,7 +2890,8 @@ ${obj[dataColumn.base52]} ...@@ -2951,7 +2890,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -2972,12 +2912,12 @@ ${obj[dataColumn.base52]} ...@@ -2972,12 +2912,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择' + dataColumn.title, message: '请选择' + dataColumn.title,
}, },
], ],
})(<Checkbox.Group options={options} disabled={disabled}/>)} })(<Checkbox.Group options={options} disabled={disabled} />)}
</Flex> </Flex>
); );
...@@ -2991,7 +2931,8 @@ ${obj[dataColumn.base52]} ...@@ -2991,7 +2931,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3006,11 +2947,11 @@ ${obj[dataColumn.base52]} ...@@ -3006,11 +2947,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择' + dataColumn.title, message: '请选择' + dataColumn.title,
}, },
], ],
})( })(
<Checkbox.Group <Checkbox.Group
options={options} options={options}
...@@ -3035,11 +2976,11 @@ ${obj[dataColumn.base52]} ...@@ -3035,11 +2976,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择' + dataColumn.title, message: '请选择' + dataColumn.title,
}, },
], ],
})( })(
<Select <Select
allowClear allowClear
...@@ -3051,48 +2992,49 @@ ${obj[dataColumn.base52]} ...@@ -3051,48 +2992,49 @@ ${obj[dataColumn.base52]}
getPopupContainer={ getPopupContainer={
this.props.isDynamic && document.querySelector('#dynamic_div') this.props.isDynamic && document.querySelector('#dynamic_div')
? () => { ? () => {
return document.querySelector('#dynamic_div'); return document.querySelector('#dynamic_div');
} }
: '' : ''
} }
onFocus={() => { onFocus={() => {
get === 'mobile' // 移动端取消输入键盘弹出 get === 'mobile' // 移动端取消输入键盘弹出
? 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 => {
// arr.removeAttribute('readonly'); // arr.removeAttribute('readonly');
// }) // })
// }); // });
}); });
} }
}) })
: null; : null;
}} }}
filterOption={(input, option) => filterOption={(input, option) =>
option option
? option.props.children.toLowerCase() ? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
.indexOf(input.toLowerCase()) >= 0
: false : false
} }
{...otherProps}> {...otherProps}
{ >
(json.options && Array.isArray(json.options)) ? {json.options && Array.isArray(json.options)
json.options.map((r) => { ? json.options.map(r => {
return (<Option key={r.value} value={r.value}> return (
{r.label}
</Option>);
}) : options && options instanceof Array
? options.map((r) => (
<Option key={r.value} value={r.value}> <Option key={r.value} value={r.value}>
{r.label} {r.label}
</Option> </Option>
)) );
: '' })
} : options && options instanceof Array
? options.map(r => (
<Option key={r.value} value={r.value}>
{r.label}
</Option>
))
: ''}
</Select>, </Select>,
); );
if ( if (
...@@ -3106,7 +3048,8 @@ ${obj[dataColumn.base52]} ...@@ -3106,7 +3048,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3129,8 +3072,7 @@ ${obj[dataColumn.base52]} ...@@ -3129,8 +3072,7 @@ ${obj[dataColumn.base52]}
} }
const filterF = function filter(inputValue, path) { const filterF = function filter(inputValue, path) {
return path.some( return path.some(
(option) => option?.label?.toLowerCase() option => option?.label?.toLowerCase()?.indexOf(inputValue.toLowerCase()) > -1,
?.indexOf(inputValue.toLowerCase()) > -1,
); );
}; };
// if(this.props.uuid === 'id_32691685234912400529714267d34dc585a2'){ // if(this.props.uuid === 'id_32691685234912400529714267d34dc585a2'){
...@@ -3147,11 +3089,11 @@ ${obj[dataColumn.base52]} ...@@ -3147,11 +3089,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择' + dataColumn.title, message: '请选择' + dataColumn.title,
}, },
], ],
})( })(
<Cascader // 这里的options 获取方式存在bug 公式会重复调用 <Cascader // 这里的options 获取方式存在bug 公式会重复调用
options={options} options={options}
...@@ -3162,8 +3104,8 @@ ${obj[dataColumn.base52]} ...@@ -3162,8 +3104,8 @@ ${obj[dataColumn.base52]}
getPopupContainer={ getPopupContainer={
this.props.isDynamic && document.querySelector('#dynamic_div') this.props.isDynamic && document.querySelector('#dynamic_div')
? () => { ? () => {
return document.querySelector('#dynamic_div'); return document.querySelector('#dynamic_div');
} }
: '' : ''
} }
placeholder={json.placeholder} placeholder={json.placeholder}
...@@ -3179,12 +3121,12 @@ ${obj[dataColumn.base52]} ...@@ -3179,12 +3121,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择' + dataColumn.title, message: '请选择' + dataColumn.title,
}, },
], ],
})(<MobileCascader options={options} label={title} disabled={disabled} json={json}/>); })(<MobileCascader options={options} label={title} disabled={disabled} json={json} />);
} }
if ( if (
...@@ -3198,7 +3140,8 @@ ${obj[dataColumn.base52]} ...@@ -3198,7 +3140,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3215,22 +3158,22 @@ ${obj[dataColumn.base52]} ...@@ -3215,22 +3158,22 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
validator: (rule, value, callback) => { validator: (rule, value, callback) => {
let errors = []; let errors = [];
if ( if (
(Object.keys(value).length == 0 || (Object.keys(value).length == 0 ||
Object.keys(value.selects).length == 0) && Object.keys(value.selects).length == 0) &&
required != null && required != null &&
required required
) { ) {
errors.push(new Error('请选择至少一个', rule.field)); errors.push(new Error('请选择至少一个', rule.field));
} }
callback(errors); callback(errors);
},
required: required,
}, },
required: required, ],
},
],
})( })(
<TableSelect <TableSelect
get={get} get={get}
...@@ -3254,7 +3197,8 @@ ${obj[dataColumn.base52]} ...@@ -3254,7 +3197,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3278,16 +3222,14 @@ ${obj[dataColumn.base52]} ...@@ -3278,16 +3222,14 @@ ${obj[dataColumn.base52]}
if (!isEdit) { if (!isEdit) {
cm = ( cm = (
<span> <span>
{moment(parseInt(obj[begin.base52])) {moment(parseInt(obj[begin.base52])).format(
.format( json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', )}{' '}
)}{' '}
{' '} {' '}
{moment(parseInt(obj[end.base52])) {moment(parseInt(obj[end.base52])).format(
.format( json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss', )}
)} </span>
</span>
); );
} else { } else {
if (get === 'mobile') { if (get === 'mobile') {
...@@ -3297,11 +3239,11 @@ ${obj[dataColumn.base52]} ...@@ -3297,11 +3239,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择起止时间', message: '请选择起止时间',
}, },
], ],
})( })(
<MobileDate <MobileDate
disabled={disabled} disabled={disabled}
...@@ -3321,7 +3263,8 @@ ${obj[dataColumn.base52]} ...@@ -3321,7 +3263,8 @@ ${obj[dataColumn.base52]}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title} label={title}
required={required}> required={required}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3336,17 +3279,12 @@ ${obj[dataColumn.base52]} ...@@ -3336,17 +3279,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择起止时间', message: '请选择起止时间',
}, },
], ],
})( })(<RangePickerDiy json={json} disabled={disabled} />);
<RangePickerDiy
json={json}
disabled={disabled}
/>,
);
} }
if (json.label == null) title = '起止时间'; if (json.label == null) title = '起止时间';
break; break;
...@@ -3373,11 +3311,11 @@ ${obj[dataColumn.base52]} ...@@ -3373,11 +3311,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请选择起止时间', message: '请选择起止时间',
}, },
], ],
})( })(
<DatePicker <DatePicker
disabled={disabled} disabled={disabled}
...@@ -3388,22 +3326,21 @@ ${obj[dataColumn.base52]} ...@@ -3388,22 +3326,21 @@ ${obj[dataColumn.base52]}
onOpenChange={ onOpenChange={
get === 'mobile' get === 'mobile'
? () => { ? () => {
// 取消唤起移动端小键盘 // 取消唤起移动端小键盘
setTimeout(() => { setTimeout(() => {
if (document.querySelector('.ant-calendar-input ')) { if (document.querySelector('.ant-calendar-input ')) {
document
.querySelector('.ant-calendar-input ')
.setAttribute('readonly', 'readonly');
setTimeout(() => {
document document
.querySelector('.ant-calendar-input ') .querySelector('.ant-calendar-input ')
.removeAttribute('readonly'); .setAttribute('readonly', 'readonly');
}); setTimeout(() => {
} document
}); .querySelector('.ant-calendar-input ')
} .removeAttribute('readonly');
: () => { });
} }
});
}
: () => {}
} }
format={json.format ? json.format : 'YYYY-MM-DD HH:mm:ss'} format={json.format ? json.format : 'YYYY-MM-DD HH:mm:ss'}
{...otherProps} {...otherProps}
...@@ -3420,7 +3357,8 @@ ${obj[dataColumn.base52]} ...@@ -3420,7 +3357,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3439,11 +3377,11 @@ ${obj[dataColumn.base52]} ...@@ -3439,11 +3377,11 @@ ${obj[dataColumn.base52]}
json?.vlds && json?.vlds.length > 0 json?.vlds && json?.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required, required,
message: '请进行签章', message: '请进行签章',
}, },
], ],
})( })(
<SignArray // 签章组件 编辑模式 <SignArray // 签章组件 编辑模式
json={json} json={json}
...@@ -3463,7 +3401,8 @@ ${obj[dataColumn.base52]} ...@@ -3463,7 +3401,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3513,7 +3452,8 @@ ${obj[dataColumn.base52]} ...@@ -3513,7 +3452,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3526,19 +3466,12 @@ ${obj[dataColumn.base52]} ...@@ -3526,19 +3466,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请输入', message: '请输入',
}, },
], ],
})( })(<WangEditor json={json} dataColumn={dataColumn} disabled={disabled} uuid={uuid} />);
<WangEditor
json={json}
dataColumn={dataColumn}
disabled={disabled}
uuid={uuid}
/>,
);
break; break;
case 'RichText': case 'RichText':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
...@@ -3547,12 +3480,12 @@ ${obj[dataColumn.base52]} ...@@ -3547,12 +3480,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请输入', message: '请输入',
}, },
], ],
})(<DraftEditorCom placeholder={json.placeholder} disabled={json.disabled}/>); })(<DraftEditorCom placeholder={json.placeholder} disabled={json.disabled} />);
if ( if (
get === 'mobile' && get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) || ((json.isMobileLabel != null && json.isMobileLabel) ||
...@@ -3564,7 +3497,8 @@ ${obj[dataColumn.base52]} ...@@ -3564,7 +3497,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3577,12 +3511,12 @@ ${obj[dataColumn.base52]} ...@@ -3577,12 +3511,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请输入' + title, message: '请输入' + title,
}, },
], ],
})(<CronEditorDiy/>); })(<CronEditorDiy />);
break; break;
case 'LocationCom': case 'LocationCom':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
...@@ -3591,23 +3525,22 @@ ${obj[dataColumn.base52]} ...@@ -3591,23 +3525,22 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required, required,
message: '请获取定位信息', message: '请获取定位信息',
validator: (rule, valueThis, callback) => { validator: (rule, valueThis, callback) => {
let errors = []; let errors = [];
console.log(valueThis); console.log(valueThis);
if ( if (
(!valueThis || !JSON.stringify(valueThis) (!valueThis || !JSON.stringify(valueThis).includes('address')) &&
.includes('address')) && required
required ) {
) { errors.push(new Error('请获取定位信息', rule.field));
errors.push(new Error('请获取定位信息', rule.field)); }
} callback(errors);
callback(errors); },
}, },
}, ],
],
})( })(
<LocationCom <LocationCom
get={get} get={get}
...@@ -3629,7 +3562,8 @@ ${obj[dataColumn.base52]} ...@@ -3629,7 +3562,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3678,7 +3612,8 @@ ${obj[dataColumn.base52]} ...@@ -3678,7 +3612,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3691,12 +3626,12 @@ ${obj[dataColumn.base52]} ...@@ -3691,12 +3626,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请上传图片', message: '请上传图片',
}, },
], ],
})(<ImgUploadCom json={json} disabled={disabled}/>); })(<ImgUploadCom json={json} disabled={disabled} />);
if ( if (
get === 'mobile' && get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) || ((json.isMobileLabel != null && json.isMobileLabel) ||
...@@ -3708,7 +3643,8 @@ ${obj[dataColumn.base52]} ...@@ -3708,7 +3643,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3721,12 +3657,12 @@ ${obj[dataColumn.base52]} ...@@ -3721,12 +3657,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请上传视频', message: '请上传视频',
}, },
], ],
})(<VideoUploadCom json={json} disabled={disabled}/>); })(<VideoUploadCom json={json} disabled={disabled} />);
if ( if (
get === 'mobile' && get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) || ((json.isMobileLabel != null && json.isMobileLabel) ||
...@@ -3738,7 +3674,8 @@ ${obj[dataColumn.base52]} ...@@ -3738,7 +3674,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3751,18 +3688,12 @@ ${obj[dataColumn.base52]} ...@@ -3751,18 +3688,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0 json.vlds && json.vlds.length > 0
? json.vlds ? json.vlds
: [ : [
{ {
required: required, required: required,
message: '请进行签名', message: '请进行签名',
}, },
], ],
})( })(<Signature width={json.width} height={json.height} get={get} />);
<Signature
width={json.width}
height={json.height}
get={get}
/>,
);
if ( if (
get === 'mobile' && get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) || ((json.isMobileLabel != null && json.isMobileLabel) ||
...@@ -3774,7 +3705,8 @@ ${obj[dataColumn.base52]} ...@@ -3774,7 +3705,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
); );
...@@ -3818,13 +3750,15 @@ ${obj[dataColumn.base52]} ...@@ -3818,13 +3750,15 @@ ${obj[dataColumn.base52]}
margin: 5, margin: 5,
border: '1px solid #ccc', border: '1px solid #ccc',
}} }}
className={styles.mobileList}> className={styles.mobileList}
>
{modalCode ? ( {modalCode ? (
<FormModal <FormModal
{...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}
...@@ -3865,7 +3799,8 @@ ${obj[dataColumn.base52]} ...@@ -3865,7 +3799,8 @@ ${obj[dataColumn.base52]}
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}
...@@ -3876,7 +3811,8 @@ ${obj[dataColumn.base52]} ...@@ -3876,7 +3811,8 @@ ${obj[dataColumn.base52]}
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
...@@ -3885,9 +3821,10 @@ ${obj[dataColumn.base52]} ...@@ -3885,9 +3821,10 @@ ${obj[dataColumn.base52]}
position: 'relative', position: 'relative',
top: '-0.5px', top: '-0.5px',
margin: '0 8px 0 2px', margin: '0 8px 0 2px',
}}> }}
: >
</span> :
</span>
)} )}
</Col> </Col>
<Col <Col
...@@ -3897,7 +3834,8 @@ ${obj[dataColumn.base52]} ...@@ -3897,7 +3834,8 @@ ${obj[dataColumn.base52]}
lineHeight: '40px', lineHeight: '40px',
zoom: 1, zoom: 1,
fontSize: 14, fontSize: 14,
}}> }}
>
{cm} {cm}
</Col> </Col>
{modalCode ? ( {modalCode ? (
...@@ -3905,7 +3843,8 @@ ${obj[dataColumn.base52]} ...@@ -3905,7 +3843,8 @@ ${obj[dataColumn.base52]}
{...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}
...@@ -3941,7 +3880,8 @@ ${obj[dataColumn.base52]} ...@@ -3941,7 +3880,8 @@ ${obj[dataColumn.base52]}
{...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}
...@@ -3971,8 +3911,9 @@ ${obj[dataColumn.base52]} ...@@ -3971,8 +3911,9 @@ ${obj[dataColumn.base52]}
labelCol={{ span: json.labelSpan }} labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title} label={title}
data-cell-component-name={json.comName || 'no_com'}> data-cell-component-name={json.comName || 'no_com'}
<ShowComName json={json}/> >
<ShowComName json={json} />
{cm} {cm}
</Form.Item> </Form.Item>
</> </>
...@@ -3986,7 +3927,8 @@ ${obj[dataColumn.base52]} ...@@ -3986,7 +3927,8 @@ ${obj[dataColumn.base52]}
{...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}
...@@ -4024,7 +3966,8 @@ ${obj[dataColumn.base52]} ...@@ -4024,7 +3966,8 @@ ${obj[dataColumn.base52]}
{...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}
...@@ -4054,7 +3997,8 @@ ${obj[dataColumn.base52]} ...@@ -4054,7 +3997,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview} isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }} labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }} wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}> label={title}
>
{cm} {cm}
</MobileItem> </MobileItem>
) : isEdit && get == 'web' ? ( ) : isEdit && get == 'web' ? (
...@@ -4064,12 +4008,12 @@ ${obj[dataColumn.base52]} ...@@ -4064,12 +4008,12 @@ ${obj[dataColumn.base52]}
wrapperCol={{ span: json.wrapperSpan }} wrapperCol={{ span: json.wrapperSpan }}
label={title} label={title}
> >
<ShowComName json={json}/> <ShowComName json={json} />
{cm} {cm}
</Form.Item> </Form.Item>
) : ( ) : (
<Form.Item> <Form.Item>
<ShowComName json={json}/> <ShowComName json={json} />
{cm} {cm}
</Form.Item> </Form.Item>
) )
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论