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

1

...@@ -28,6 +28,7 @@ import { ...@@ -28,6 +28,7 @@ import {
RichUtils, RichUtils,
} from 'draft-js'; } from 'draft-js';
import { getToken } from '@/webPublic/one_stop_public/utils/token'; import { getToken } from '@/webPublic/one_stop_public/utils/token';
import { queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
const FormItem = Form.Item; const FormItem = Form.Item;
function getBlockStyle(block) { function getBlockStyle(block) {
...@@ -507,7 +508,7 @@ class AttrForm extends React.Component { ...@@ -507,7 +508,7 @@ class AttrForm extends React.Component {
onChangemultiple={false} onChangemultiple={false}
style={{ padding: 0 }}> style={{ padding: 0 }}>
{url ? ( {url ? (
<a href={config.httpServer + url} target="_blank"> <a href={queryFileUrl(url)} target="_blank">
{name} {name}
</a> </a>
) : ( ) : (
...@@ -600,7 +601,7 @@ class VideoForm extends React.Component { ...@@ -600,7 +601,7 @@ class VideoForm extends React.Component {
onChangemultiple={false} onChangemultiple={false}
style={{ padding: 0 }}> style={{ padding: 0 }}>
{url ? ( {url ? (
<video src={config.httpServer + url} controls="controls"> <video src={queryFileUrl(url)} controls="controls">
您的浏览器不支持 video 标签。 您的浏览器不支持 video 标签。
</video> </video>
) : ( ) : (
...@@ -692,7 +693,7 @@ class PicForm extends React.Component { ...@@ -692,7 +693,7 @@ class PicForm extends React.Component {
multiple={false} multiple={false}
style={{ padding: 0 }}> style={{ padding: 0 }}>
{url ? ( {url ? (
<img src={config.httpServer + url} style={{ height: 400, width: '100%' }} /> <img src={queryFileUrl(url)} style={{ height: 400, width: '100%' }} />
) : ( ) : (
<p className="ant-upload-drag-icon" style={{ marginBottom: 0, height: 400 }}> <p className="ant-upload-drag-icon" style={{ marginBottom: 0, height: 400 }}>
<Icon type="video" /> <Icon type="video" />
......
...@@ -27,6 +27,7 @@ import { ...@@ -27,6 +27,7 @@ import {
CompositeDecorator, CompositeDecorator,
RichUtils, RichUtils,
} from 'draft-js'; } from 'draft-js';
import { queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
const FormItem = Form.Item; const FormItem = Form.Item;
function getBlockStyle(block) { function getBlockStyle(block) {
...@@ -510,7 +511,7 @@ class AttrForm extends React.Component { ...@@ -510,7 +511,7 @@ class AttrForm extends React.Component {
onChangemultiple={false} onChangemultiple={false}
style={{ padding: 0 }}> style={{ padding: 0 }}>
{url ? ( {url ? (
<a href={config.httpServer + url} target="_blank"> <a href={queryFileUrl(url)} target="_blank">
{name} {name}
</a> </a>
) : ( ) : (
...@@ -603,7 +604,7 @@ class VideoForm extends React.Component { ...@@ -603,7 +604,7 @@ class VideoForm extends React.Component {
}} }}
style={{ padding: 0 }}> style={{ padding: 0 }}>
{url ? ( {url ? (
<video src={config.httpServer + url} controls="controls"> <video src={queryFileUrl(url)} controls="controls">
您的浏览器不支持 video 标签。 您的浏览器不支持 video 标签。
</video> </video>
) : ( ) : (
...@@ -695,7 +696,7 @@ class PicForm extends React.Component { ...@@ -695,7 +696,7 @@ class PicForm extends React.Component {
multiple={false} multiple={false}
style={{ padding: 0 }}> style={{ padding: 0 }}>
{url ? ( {url ? (
<img src={config.httpServer + url} style={{ height: 400, width: '100%' }} /> <img src={queryFileUrl(url)} style={{ height: 400, width: '100%' }} />
) : ( ) : (
<p className="ant-upload-drag-icon" style={{ marginBottom: 0, height: 400 }}> <p className="ant-upload-drag-icon" style={{ marginBottom: 0, height: 400 }}>
<Icon type="video" /> <Icon type="video" />
......
...@@ -4,6 +4,7 @@ import table from '../assets/专家经验系统切图/智能报告/table.png'; ...@@ -4,6 +4,7 @@ import table from '../assets/专家经验系统切图/智能报告/table.png';
import chart from '../assets/专家经验系统切图/智能报告/chart.png'; import chart from '../assets/专家经验系统切图/智能报告/chart.png';
import React from 'react'; import React from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
const ReactHighcharts = config.ReactHighcharts; const ReactHighcharts = config.ReactHighcharts;
@connect(({ Report, loading }) => ({ @connect(({ Report, loading }) => ({
...@@ -200,14 +201,14 @@ const AtomicComponent = (props) => { ...@@ -200,14 +201,14 @@ const AtomicComponent = (props) => {
const { src } = entity.getData(); const { src } = entity.getData();
return ( return (
<div> <div>
<img src={config.httpServer + src} style={{ maxWidth: '100%' }} /> <img src={queryFileUrl(src)} style={{ maxWidth: '100%' }} />
</div> </div>
); );
} }
if (type === 'attr') { if (type === 'attr') {
const { src, name } = entity.getData(); const { src, name } = entity.getData();
return ( return (
<a href={config.httpServer + src} target="_blank"> <a href={queryFileUrl(src)} target="_blank">
{name} {name}
</a> </a>
); );
...@@ -215,7 +216,7 @@ const AtomicComponent = (props) => { ...@@ -215,7 +216,7 @@ const AtomicComponent = (props) => {
const { src } = entity.getData(); const { src } = entity.getData();
return ( return (
<div> <div>
<video src={config.httpServer + src} controls="controls"> <video src={queryFileUrl(src)} controls="controls">
您的浏览器不支持 video 标签。 您的浏览器不支持 video 标签。
</video> </video>
</div> </div>
......
...@@ -42,7 +42,11 @@ import { ...@@ -42,7 +42,11 @@ import {
submitValues, submitValues,
checkNeedWriteAuditInfo, checkNeedWriteAuditInfo,
} from './splitDetailSplit'; } from './splitDetailSplit';
import { queryApiVersion, queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig'; import {
queryApiVersion,
queryApiActionPath,
queryFileUrl,
} from '@/webPublic/one_stop_public/utils/queryConfig';
import { isJSON } from '@/webPublic/zyd_public/utils/utils'; import { isJSON } from '@/webPublic/zyd_public/utils/utils';
import HistoryFormList from '@/webPublic/one_stop_public/DetailForAudit/HistoryFormList'; import HistoryFormList from '@/webPublic/one_stop_public/DetailForAudit/HistoryFormList';
...@@ -758,11 +762,7 @@ class DetailSplit extends Component { ...@@ -758,11 +762,7 @@ class DetailSplit extends Component {
marginTop: -25, marginTop: -25,
border: item.taskVariable?.sign ? '1px solid #ccc' : '', border: item.taskVariable?.sign ? '1px solid #ccc' : '',
}} }}
src={ src={queryFileUrl(item.taskVariable?.sign)}
item.taskVariable?.sign
? queryApiActionPath() + item.taskVariable?.sign
: ''
}
alt="" alt=""
/> />
) : ( ) : (
...@@ -828,11 +828,7 @@ class DetailSplit extends Component { ...@@ -828,11 +828,7 @@ class DetailSplit extends Component {
marginTop: -25, marginTop: -25,
border: item.taskVariable?.sign ? '1px solid #ccc' : '', border: item.taskVariable?.sign ? '1px solid #ccc' : '',
}} }}
src={ src={queryFileUrl(item.taskVariable?.sign)}
item.taskVariable?.sign
? queryApiActionPath() + item.taskVariable?.sign
: ''
}
alt="" alt=""
/> />
) : ( ) : (
......
...@@ -115,7 +115,7 @@ export default class Signature extends Component { ...@@ -115,7 +115,7 @@ export default class Signature extends Component {
Modal.info({ Modal.info({
title: '查看签名', title: '查看签名',
content: <div className={styles.showDiv}> content: <div className={styles.showDiv}>
<img src={config.httpServer + url}/> <img src={queryFileUrl(url)}/>
</div>, </div>,
footer: null, footer: null,
}); });
...@@ -138,7 +138,7 @@ export default class Signature extends Component { ...@@ -138,7 +138,7 @@ export default class Signature extends Component {
className={styles.reSign}> className={styles.reSign}>
重新签名 重新签名
</Button>*/} </Button>*/}
<img src={config.httpServer + url} className={styles.littleSign} onClick={this.showSignImage}/> <img src={queryFileUrl(url)} className={styles.littleSign} onClick={this.showSignImage}/>
</div> </div>
); );
} else { } else {
...@@ -233,7 +233,7 @@ export default class Signature extends Component { ...@@ -233,7 +233,7 @@ export default class Signature extends Component {
<this.EditIcon /> <this.EditIcon />
<img <img
onClick={this.showSignImage} onClick={this.showSignImage}
src={config.httpServer + url} src={queryFileUrl(url)}
style={{ style={{
height, height,
width, width,
......
...@@ -3,6 +3,7 @@ import {Upload, message} from 'antd'; ...@@ -3,6 +3,7 @@ import {Upload, message} from 'antd';
import config from '@/webPublic/one_stop_public/config'; import config from '@/webPublic/one_stop_public/config';
import {zipImage} from "@/webPublic/zyd_public/utils/handlePhoto"; import {zipImage} from "@/webPublic/zyd_public/utils/handlePhoto";
import { getToken } from '@/webPublic/one_stop_public/utils/token'; import { getToken } from '@/webPublic/one_stop_public/utils/token';
import { queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
export default class ImgUploadCom extends React.Component { export default class ImgUploadCom extends React.Component {
constructor(props) { constructor(props) {
...@@ -75,7 +76,7 @@ export default class ImgUploadCom extends React.Component { ...@@ -75,7 +76,7 @@ export default class ImgUploadCom extends React.Component {
style={{padding: 0}} style={{padding: 0}}
> >
{url ? ( {url ? (
<img src={config.httpServer + url} style={{ <img src={queryFileUrl(url)} style={{
height: json.height, height: json.height,
width: json.width, width: json.width,
maxWidth: '60vw', // 解决图片在移动端过宽的bug maxWidth: '60vw', // 解决图片在移动端过宽的bug
......
import React from 'react'; import React from 'react';
import { queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig'; import { queryApiActionPath, queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
import { getToken } from '@/webPublic/one_stop_public/utils/token'; import { getToken } from '@/webPublic/one_stop_public/utils/token';
import { isFromIframe } from '@/webPublic/one_stop_public/utils/utils'; import { isFromIframe } from '@/webPublic/one_stop_public/utils/utils';
import getOneStopUploadUrl from '@/webPublic/one_stop_public/Base16/getOneStopUploadUrl'; import getOneStopUploadUrl from '@/webPublic/one_stop_public/Base16/getOneStopUploadUrl';
const oneSetItemP = { const oneSetItemP = {
marginBottom: 0, marginBottom: 0,
userSelect: 'none', userSelect: 'none',
...@@ -157,7 +158,7 @@ export const uploadFile = (file) => { ...@@ -157,7 +158,7 @@ export const uploadFile = (file) => {
export const zipImage = (path, fileName, limitWidth = 1200) => { export const zipImage = (path, fileName, limitWidth = 1200) => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
let image = new Image(); //新建一个img标签(还没嵌入DOM节点) let image = new Image(); //新建一个img标签(还没嵌入DOM节点)
let imageUrl = queryApiActionPath() + path; let imageUrl = queryFileUrl(path);
image.setAttribute('crossOrigin', 'Anonymous'); image.setAttribute('crossOrigin', 'Anonymous');
image.src = imageUrl; image.src = imageUrl;
image.onload = () => { image.onload = () => {
......
// 图片上传组件 // 图片上传组件
import React from 'react'; import React from 'react';
import { Button, Icon, message, Upload } from 'antd'; import { Button, Icon, message, Upload } from 'antd';
import { queryApiActionPath } from '../utils/queryConfig'; import { queryApiActionPath, queryFileUrl } from '../utils/queryConfig';
import config from '@/webPublic/one_stop_public/config'; import config from '@/webPublic/one_stop_public/config';
import styles from './style.less'; import styles from './style.less';
import UploadComDiyForQnZy from '@/webPublic/one_stop_public/libs/UploadComDiyForQnZy'; import UploadComDiyForQnZy from '@/webPublic/one_stop_public/libs/UploadComDiyForQnZy';
...@@ -211,14 +211,13 @@ class UploadCom extends React.Component { ...@@ -211,14 +211,13 @@ class UploadCom extends React.Component {
<img <img
style={{ width: '100px', height: 'auto' }} style={{ width: '100px', height: 'auto' }}
className={styles.img} className={styles.img}
src={queryApiActionPath() + f.path} src={queryFileUrl(f.path)}
/> />
<div <div
className={styles.mask} className={styles.mask}
onClick={() => { onClick={() => {
// window.open(queryApiActionPath() + f.path);
this.setState({ this.setState({
previewImage: queryApiActionPath() + f.path, previewImage: queryFileUrl(f.path),
previewImageName : f.name, previewImageName : f.name,
previewVisible: true, previewVisible: true,
}); });
...@@ -238,7 +237,7 @@ class UploadCom extends React.Component { ...@@ -238,7 +237,7 @@ class UploadCom extends React.Component {
} }
return ( return (
<li key={f.path}> <li key={f.path}>
<a target="_blank" key={f.path} href={queryApiActionPath() + f.path}> <a target="_blank" key={f.path} href={queryFileUrl(f.path)}>
{f.name} {f.name}
</a>{' '} </a>{' '}
{!disabled && ( {!disabled && (
......
import React from "react"; import React from "react";
import { Button, Icon, message, Upload } from "antd"; import { Button, Icon, message, Upload } from "antd";
import { queryApiActionPath } from "../utils/queryConfig"; import { queryApiActionPath, queryFileUrl } from '../utils/queryConfig';
import config from "@/webPublic/one_stop_public/config"; import config from "@/webPublic/one_stop_public/config";
import styles from "./style.less"; import styles from "./style.less";
import { checkIsImage } from "./UploadCom"; import { checkIsImage } from "./UploadCom";
...@@ -140,15 +140,14 @@ export default class UploadComDiyForQnZy extends React.Component { ...@@ -140,15 +140,14 @@ export default class UploadComDiyForQnZy extends React.Component {
<img <img
style={{ width: 100, height: 100 }} style={{ width: 100, height: 100 }}
className={styles.img} className={styles.img}
src={queryApiActionPath() + f.path} src={queryFileUrl(f.path)}
/> />
<div <div
className={styles.mask} className={styles.mask}
onClick={() => { onClick={() => {
// window.open(queryApiActionPath() + f.path);
this.setState({ this.setState({
previewVisible: true, previewVisible: true,
previewImage: queryApiActionPath() + f.path, previewImage: queryFileUrl(f.path),
previewImageName: f.name, previewImageName: f.name,
}); });
}}> }}>
...@@ -167,7 +166,7 @@ export default class UploadComDiyForQnZy extends React.Component { ...@@ -167,7 +166,7 @@ export default class UploadComDiyForQnZy extends React.Component {
} }
return ( return (
<li key={f.path}> <li key={f.path}>
<a target="_blank" key={f.path} href={queryApiActionPath() + f.path}> <a target="_blank" key={f.path} href={queryFileUrl(f.path)}>
{f.name} {f.name}
</a>{" "} </a>{" "}
{!disabled && ( {!disabled && (
......
...@@ -30,7 +30,7 @@ import SearchInfo from '../../App/SearchInfo'; ...@@ -30,7 +30,7 @@ import SearchInfo from '../../App/SearchInfo';
import { Base16Encode } from '../../Base16/index'; import { Base16Encode } from '../../Base16/index';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import FilePreview from '@/webPublic/one_stop_public/filePreview'; import FilePreview from '@/webPublic/one_stop_public/filePreview';
import { queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig'; import { queryApiActionPath, queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
import UploadCom from '@/webPublic/one_stop_public/libs/UploadCom'; import UploadCom from '@/webPublic/one_stop_public/libs/UploadCom';
import { getModal, getPopconfirm } from '@/webPublic/one_stop_public/utils/utils'; import { getModal, getPopconfirm } from '@/webPublic/one_stop_public/utils/utils';
...@@ -494,7 +494,7 @@ class TreeList extends React.Component { ...@@ -494,7 +494,7 @@ class TreeList extends React.Component {
{files.map((f, index2) => { {files.map((f, index2) => {
return ( return (
<li key={index2}> <li key={index2}>
<FilePreview path={queryApiActionPath() + f.path} pathName={f.name} /> <FilePreview path={queryFileUrl(f.path)} pathName={f.name} />
</li> </li>
); );
})} })}
......
...@@ -29,7 +29,7 @@ import SearchInfo from '../../App/SearchInfo'; ...@@ -29,7 +29,7 @@ import SearchInfo from '../../App/SearchInfo';
import { Base16Encode } from '../../Base16/index'; import { Base16Encode } from '../../Base16/index';
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import FilePreview from '@/webPublic/one_stop_public/filePreview'; import FilePreview from '@/webPublic/one_stop_public/filePreview';
import { queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig'; import { queryApiActionPath, queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
import UploadCom from '@/webPublic/one_stop_public/libs/UploadCom'; import UploadCom from '@/webPublic/one_stop_public/libs/UploadCom';
import { cloneDeep } from '../../copy/index'; import { cloneDeep } from '../../copy/index';
import { getPopconfirm, getModal } from '@/webPublic/one_stop_public/utils/utils'; import { getPopconfirm, getModal } from '@/webPublic/one_stop_public/utils/utils';
...@@ -538,7 +538,7 @@ class FormList extends React.Component { ...@@ -538,7 +538,7 @@ class FormList extends React.Component {
{files.map((f, index2) => { {files.map((f, index2) => {
return ( return (
<li key={index2}> <li key={index2}>
<FilePreview path={queryApiActionPath() + f.path} pathName={f.name} /> <FilePreview path={queryFileUrl(f.path)} pathName={f.name} />
</li> </li>
); );
})} })}
......
...@@ -5,6 +5,7 @@ import { isNaN } from 'lodash'; ...@@ -5,6 +5,7 @@ import { isNaN } from 'lodash';
import React from 'react'; import React from 'react';
import config from '@/webPublic/one_stop_public/config'; import config from '@/webPublic/one_stop_public/config';
import { isJSON } from '@/webPublic/one_stop_public/2022beidianke/isJSON'; import { isJSON } from '@/webPublic/one_stop_public/2022beidianke/isJSON';
import { queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
const codeMessage = { const codeMessage = {
200: '服务器成功返回请求的数据。', 200: '服务器成功返回请求的数据。',
...@@ -184,12 +185,7 @@ const getRender = (com, props) => { ...@@ -184,12 +185,7 @@ const getRender = (com, props) => {
if (com == 'canvas') return <canvas {...props} />; if (com == 'canvas') return <canvas {...props} />;
if (com == 'iframe') return <iframe {...props} />; if (com == 'iframe') return <iframe {...props} />;
if (com == 'img') { if (com == 'img') {
const src = const src = queryFileUrl(props.src)
props.src != null
? props.src.indexOf('http') > -1
? props.src
: config.httpServer + props.src
: null;
const pp = { const pp = {
...props, ...props,
src: src src: src
......
...@@ -47,7 +47,7 @@ import TableList from '../libs/TableList'; ...@@ -47,7 +47,7 @@ import TableList from '../libs/TableList';
import styles from './style.less'; import styles from './style.less';
import config from '@/webPublic/one_stop_public/config'; import config from '@/webPublic/one_stop_public/config';
import { cloneDeep, isEmpty, isNaN } from 'lodash'; import { cloneDeep, isEmpty, isNaN } from 'lodash';
import { queryApiActionPath } from '../utils/queryConfig'; import { queryApiActionPath, queryFileUrl } from '../utils/queryConfig';
import Highlighter from 'react-highlight-words'; import Highlighter from 'react-highlight-words';
import Signature from '../Signature'; import Signature from '../Signature';
import { changeToDraftState, deepCopy, preHandle } from '../utils/myutils'; import { changeToDraftState, deepCopy, preHandle } from '../utils/myutils';
...@@ -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>
) : ( ) : (
'' ''
); );
...@@ -1812,14 +1760,14 @@ export default class TableCom extends Component { ...@@ -1812,14 +1760,14 @@ export default class TableCom extends Component {
{filesX.map((f, index2) => { {filesX.map((f, index2) => {
return ( return (
<li key={index2}> <li key={index2}>
<a target="_blank" key={f.path} href={queryApiActionPath() + f.path}> <a target="_blank" key={f.path} href={queryFileUrl(f.path)}>
{f.name} {f.name}
</a> </a>
</li> </li>
); );
})} })}
</ul> </ul>
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</> </>
); );
...@@ -1832,14 +1780,14 @@ export default class TableCom extends Component { ...@@ -1832,14 +1780,14 @@ export default class TableCom extends Component {
{files.map((f, index2) => { {files.map((f, index2) => {
return ( return (
<li key={index2}> <li key={index2}>
<a target="_blank" key={f.path} href={queryApiActionPath() + f.path}> <a target="_blank" key={f.path} href={queryFileUrl(f.path)}>
{f.name} {f.name}
</a> </a>
</li> </li>
); );
})} })}
</ul> </ul>
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</> </>
); );
...@@ -1858,13 +1806,13 @@ export default class TableCom extends Component { ...@@ -1858,13 +1806,13 @@ export default class TableCom extends Component {
cm = ( cm = (
<> <>
<img <img
src={config.httpServer + value} src={queryFileUrl(value)}
style={{ style={{
width: json.width, width: json.width,
height: json.height, height: json.height,
}} }}
/> />
{get === 'mobile' ? <br/> : ''} {get === 'mobile' ? <br /> : ''}
</> </>
); );
} }
...@@ -1884,13 +1832,13 @@ export default class TableCom extends Component { ...@@ -1884,13 +1832,13 @@ export default class TableCom extends Component {
cm = ( cm = (
<> <>
<img <img
src={config.httpServer + value} src={queryFileUrl(value)}
style={{ style={{
width: json.width, width: json.width,
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,10 +2059,6 @@ export default class TableCom extends Component { ...@@ -2112,10 +2059,6 @@ export default class TableCom extends Component {
// console.log(json.comName); // console.log(json.comName);
switch (json.comName) { switch (json.comName) {
// 电子签章展示
// case 'Signature':
// cm = <img src={queryApiActionPath()+obj[dataColumn.base52]} />
// break;
case 'RichText': case 'RichText':
cm = ( cm = (
<Editor <Editor
...@@ -2129,7 +2072,7 @@ export default class TableCom extends Component { ...@@ -2129,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
...@@ -2146,9 +2089,10 @@ ${obj[dataColumn.base52]} ...@@ -2146,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':
...@@ -2162,9 +2106,10 @@ ${obj[dataColumn.base52]} ...@@ -2162,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;
...@@ -2190,9 +2135,8 @@ ${obj[dataColumn.base52]} ...@@ -2190,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>
...@@ -2204,9 +2148,9 @@ ${obj[dataColumn.base52]} ...@@ -2204,9 +2148,9 @@ ${obj[dataColumn.base52]}
) : ( ) : (
',' + Object.values(r) ',' + Object.values(r)
), ),
) )
: ''} : ''}
</span> </span>
); );
break; break;
...@@ -2240,8 +2184,8 @@ ${obj[dataColumn.base52]} ...@@ -2240,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>
); );
} }
...@@ -2264,16 +2208,14 @@ ${obj[dataColumn.base52]} ...@@ -2264,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 {
...@@ -2282,25 +2224,22 @@ ${obj[dataColumn.base52]} ...@@ -2282,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>
); );
} }
...@@ -2341,18 +2280,18 @@ ${obj[dataColumn.base52]} ...@@ -2341,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>
); );
} }
...@@ -2395,7 +2334,7 @@ ${obj[dataColumn.base52]} ...@@ -2395,7 +2334,7 @@ ${obj[dataColumn.base52]}
return ( return (
<li key={index2}> <li key={index2}>
<FilePreview <FilePreview
path={queryApiActionPath() + f.path} path={queryFileUrl(f.path)}
pathName={f.name} pathName={f.name}
type={'UploadCom'} type={'UploadCom'}
/> />
...@@ -2404,7 +2343,7 @@ ${obj[dataColumn.base52]} ...@@ -2404,7 +2343,7 @@ ${obj[dataColumn.base52]}
} }
return ( return (
<li key={index2}> <li key={index2}>
<a target="_blank" key={f.path} href={queryApiActionPath() + f.path}> <a target="_blank" key={f.path} href={queryFileUrl(f.path)}>
{f.name} {f.name}
</a> </a>
</li> </li>
...@@ -2417,38 +2356,26 @@ ${obj[dataColumn.base52]} ...@@ -2417,38 +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 (f.filePath.indexOf('.png') != -1 || f.filePath.indexOf('.jpg') != -1) { if (get === 'web' || !this.props.isPrint) {
// return ( return (
// <img <li key={index2}>
// key={index2} <FilePreview
// style={{ width: 100, height: 100 }} path={queryFileUrl(f.path)}
// src={queryApiActionPath() + f.filePath} pathName={f.name}
// /> type={'UploadCom'}
// ); />
// } </li>
if (get === 'web' || !this.props.isPrint) { );
}
return ( return (
<li key={index2}> <li key={index2}>
<FilePreview <a target="_blank" key={f.filePath} href={queryFileUrl(f.filePath)}>
path={queryApiActionPath() + f.path} {f.fileName}
pathName={f.name} </a>
type={'UploadCom'}
/>
</li> </li>
); );
} })}
return (
<li key={index2}>
<a
target="_blank"
key={f.filePath}
href={queryApiActionPath() + f.filePath}>
{f.fileName}
</a>
</li>
);
})}
</ul> </ul>
); );
} }
...@@ -2459,9 +2386,10 @@ ${obj[dataColumn.base52]} ...@@ -2459,9 +2386,10 @@ ${obj[dataColumn.base52]}
display: 'inline-block', display: 'inline-block',
width: '100%', width: '100%',
textAlign: 'center', textAlign: 'center',
}}> }}
暂无附件 >
</span> 暂无附件
</span>
); );
} }
...@@ -2479,14 +2407,14 @@ ${obj[dataColumn.base52]} ...@@ -2479,14 +2407,14 @@ ${obj[dataColumn.base52]}
} else { } else {
cm = FilePreview ? ( cm = FilePreview ? (
<FilePreview <FilePreview
path={config.httpServer + obj[dataColumn.base52]} path={queryFileUrl(obj[dataColumn.base52])}
pathName={obj[dataColumn.base52]} pathName={obj[dataColumn.base52]}
width={json.width} width={json.width}
height={json.height} height={json.height}
/> />
) : ( ) : (
<img <img
src={config.httpServer + obj[dataColumn.base52]} src={queryFileUrl(obj[dataColumn.base52])}
style={{ style={{
width: json.width, width: json.width,
height: json.height, height: json.height,
...@@ -2509,14 +2437,14 @@ ${obj[dataColumn.base52]} ...@@ -2509,14 +2437,14 @@ ${obj[dataColumn.base52]}
} else { } else {
cm = FilePreview ? ( cm = FilePreview ? (
<FilePreview <FilePreview
path={config.httpServer + obj[dataColumn.base52]} path={queryFileUrl(obj[dataColumn.base52])}
pathName={obj[dataColumn.base52]} pathName={obj[dataColumn.base52]}
width={json.width} width={json.width}
height={json.height} height={json.height}
/> />
) : ( ) : (
<img <img
src={config.httpServer + obj[dataColumn.base52]} src={queryFileUrl(obj[dataColumn.base52])}
style={{ style={{
width: json.width, width: json.width,
height: json.height, height: json.height,
...@@ -2535,7 +2463,7 @@ ${obj[dataColumn.base52]} ...@@ -2535,7 +2463,7 @@ ${obj[dataColumn.base52]}
<img <img
data-cell-component={'Signature'} data-cell-component={'Signature'}
data-cell-base52={dataColumn.base52} data-cell-base52={dataColumn.base52}
src={config.httpServer + obj[dataColumn.base52]} src={queryFileUrl(obj[dataColumn.base52])}
style={{ style={{
marginLeft: 5, marginLeft: 5,
width: width:
...@@ -2548,7 +2476,6 @@ ${obj[dataColumn.base52]} ...@@ -2548,7 +2476,6 @@ ${obj[dataColumn.base52]}
); );
} }
break; break;
case 'ChildForm': case 'ChildForm':
const xxxxx = obj[dataColumn.base52]; const xxxxx = obj[dataColumn.base52];
...@@ -2652,10 +2579,10 @@ ${obj[dataColumn.base52]} ...@@ -2652,10 +2579,10 @@ ${obj[dataColumn.base52]}
default: default:
cm = ( cm = (
<span> <span>
缺乏字段 缺乏字段
{json.comName} {json.comName}
的匹配项 的匹配项
</span> </span>
); );
break; break;
} }
...@@ -2716,21 +2643,22 @@ ${obj[dataColumn.base52]} ...@@ -2716,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
...@@ -2746,14 +2674,12 @@ ${obj[dataColumn.base52]} ...@@ -2746,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':
...@@ -2769,11 +2695,11 @@ ${obj[dataColumn.base52]} ...@@ -2769,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
...@@ -2794,7 +2720,8 @@ ${obj[dataColumn.base52]} ...@@ -2794,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>
); );
...@@ -2804,11 +2731,11 @@ ${obj[dataColumn.base52]} ...@@ -2804,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
...@@ -2831,7 +2758,7 @@ ${obj[dataColumn.base52]} ...@@ -2831,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,
}; };
...@@ -2847,7 +2774,7 @@ ${obj[dataColumn.base52]} ...@@ -2847,7 +2774,7 @@ ${obj[dataColumn.base52]}
dataColumn, dataColumn,
json, json,
required, required,
title title,
}), }),
})( })(
<Input <Input
...@@ -2870,7 +2797,8 @@ ${obj[dataColumn.base52]} ...@@ -2870,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>
); );
...@@ -2880,7 +2808,7 @@ ${obj[dataColumn.base52]} ...@@ -2880,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) {
...@@ -2897,18 +2825,18 @@ ${obj[dataColumn.base52]} ...@@ -2897,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}
/>, />,
...@@ -2925,7 +2853,8 @@ ${obj[dataColumn.base52]} ...@@ -2925,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>
); );
...@@ -2943,12 +2872,12 @@ ${obj[dataColumn.base52]} ...@@ -2943,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 (
...@@ -2961,7 +2890,8 @@ ${obj[dataColumn.base52]} ...@@ -2961,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>
); );
...@@ -2982,12 +2912,12 @@ ${obj[dataColumn.base52]} ...@@ -2982,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>
); );
...@@ -3001,7 +2931,8 @@ ${obj[dataColumn.base52]} ...@@ -3001,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>
); );
...@@ -3016,11 +2947,11 @@ ${obj[dataColumn.base52]} ...@@ -3016,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}
...@@ -3045,11 +2976,11 @@ ${obj[dataColumn.base52]} ...@@ -3045,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
...@@ -3061,48 +2992,49 @@ ${obj[dataColumn.base52]} ...@@ -3061,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 (
...@@ -3116,7 +3048,8 @@ ${obj[dataColumn.base52]} ...@@ -3116,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>
); );
...@@ -3139,8 +3072,7 @@ ${obj[dataColumn.base52]} ...@@ -3139,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'){
...@@ -3157,11 +3089,11 @@ ${obj[dataColumn.base52]} ...@@ -3157,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}
...@@ -3172,8 +3104,8 @@ ${obj[dataColumn.base52]} ...@@ -3172,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}
...@@ -3189,12 +3121,12 @@ ${obj[dataColumn.base52]} ...@@ -3189,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 (
...@@ -3208,7 +3140,8 @@ ${obj[dataColumn.base52]} ...@@ -3208,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>
); );
...@@ -3225,22 +3158,22 @@ ${obj[dataColumn.base52]} ...@@ -3225,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}
...@@ -3264,7 +3197,8 @@ ${obj[dataColumn.base52]} ...@@ -3264,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>
); );
...@@ -3288,16 +3222,14 @@ ${obj[dataColumn.base52]} ...@@ -3288,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') {
...@@ -3307,11 +3239,11 @@ ${obj[dataColumn.base52]} ...@@ -3307,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}
...@@ -3331,7 +3263,8 @@ ${obj[dataColumn.base52]} ...@@ -3331,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>
); );
...@@ -3346,17 +3279,12 @@ ${obj[dataColumn.base52]} ...@@ -3346,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;
...@@ -3383,11 +3311,11 @@ ${obj[dataColumn.base52]} ...@@ -3383,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}
...@@ -3398,22 +3326,21 @@ ${obj[dataColumn.base52]} ...@@ -3398,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}
...@@ -3430,7 +3357,8 @@ ${obj[dataColumn.base52]} ...@@ -3430,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>
); );
...@@ -3449,11 +3377,11 @@ ${obj[dataColumn.base52]} ...@@ -3449,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}
...@@ -3473,7 +3401,8 @@ ${obj[dataColumn.base52]} ...@@ -3473,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>
); );
...@@ -3523,7 +3452,8 @@ ${obj[dataColumn.base52]} ...@@ -3523,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>
); );
...@@ -3536,19 +3466,12 @@ ${obj[dataColumn.base52]} ...@@ -3536,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, {
...@@ -3557,12 +3480,12 @@ ${obj[dataColumn.base52]} ...@@ -3557,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) ||
...@@ -3574,7 +3497,8 @@ ${obj[dataColumn.base52]} ...@@ -3574,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>
); );
...@@ -3587,12 +3511,12 @@ ${obj[dataColumn.base52]} ...@@ -3587,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, {
...@@ -3601,23 +3525,22 @@ ${obj[dataColumn.base52]} ...@@ -3601,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}
...@@ -3639,7 +3562,8 @@ ${obj[dataColumn.base52]} ...@@ -3639,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>
); );
...@@ -3688,7 +3612,8 @@ ${obj[dataColumn.base52]} ...@@ -3688,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>
); );
...@@ -3701,12 +3626,12 @@ ${obj[dataColumn.base52]} ...@@ -3701,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) ||
...@@ -3718,7 +3643,8 @@ ${obj[dataColumn.base52]} ...@@ -3718,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>
); );
...@@ -3731,12 +3657,12 @@ ${obj[dataColumn.base52]} ...@@ -3731,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) ||
...@@ -3748,7 +3674,8 @@ ${obj[dataColumn.base52]} ...@@ -3748,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>
); );
...@@ -3761,18 +3688,12 @@ ${obj[dataColumn.base52]} ...@@ -3761,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) ||
...@@ -3784,7 +3705,8 @@ ${obj[dataColumn.base52]} ...@@ -3784,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>
); );
...@@ -3828,13 +3750,15 @@ ${obj[dataColumn.base52]} ...@@ -3828,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}
...@@ -3875,7 +3799,8 @@ ${obj[dataColumn.base52]} ...@@ -3875,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}
...@@ -3886,7 +3811,8 @@ ${obj[dataColumn.base52]} ...@@ -3886,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
...@@ -3895,9 +3821,10 @@ ${obj[dataColumn.base52]} ...@@ -3895,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
...@@ -3907,7 +3834,8 @@ ${obj[dataColumn.base52]} ...@@ -3907,7 +3834,8 @@ ${obj[dataColumn.base52]}
lineHeight: '40px', lineHeight: '40px',
zoom: 1, zoom: 1,
fontSize: 14, fontSize: 14,
}}> }}
>
{cm} {cm}
</Col> </Col>
{modalCode ? ( {modalCode ? (
...@@ -3915,7 +3843,8 @@ ${obj[dataColumn.base52]} ...@@ -3915,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}
...@@ -3951,7 +3880,8 @@ ${obj[dataColumn.base52]} ...@@ -3951,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}
...@@ -3981,8 +3911,9 @@ ${obj[dataColumn.base52]} ...@@ -3981,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>
</> </>
...@@ -3996,7 +3927,8 @@ ${obj[dataColumn.base52]} ...@@ -3996,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}
...@@ -4034,7 +3966,8 @@ ${obj[dataColumn.base52]} ...@@ -4034,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}
...@@ -4064,7 +3997,8 @@ ${obj[dataColumn.base52]} ...@@ -4064,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' ? (
...@@ -4074,12 +4008,12 @@ ${obj[dataColumn.base52]} ...@@ -4074,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>
) )
......
...@@ -139,4 +139,19 @@ export const queryIsBinary = () => queryConfig('IS_BINARY'); // 是否开启接 ...@@ -139,4 +139,19 @@ export const queryIsBinary = () => queryConfig('IS_BINARY'); // 是否开启接
export const resetLoginUrl = () => queryConfig('resetLoginUrl'); // 是否退出登录注销token 解决北电科安全测评 export const resetLoginUrl = () => queryConfig('resetLoginUrl'); // 是否退出登录注销token 解决北电科安全测评
export const hiddenExitButton = () => queryConfig('hiddenExitButton'); export const hiddenExitButton = () => queryConfig('hiddenExitButton');
export const queryFileUrl = (url = '', defaultFile = '') => {
if (url && typeof url === 'string' && url.length > 10) {
if (url.indexOf('http') > -1) {
return url;
}
const prefix = window.CONFIG['FILE_PATH'] || window.CONFIG['API_ACTION_PATH'];
return prefix + url;
} else {
if (defaultFile) {
return defaultFile;
}
return '';
}
};
export default queryConfig; export default queryConfig;
...@@ -8,68 +8,64 @@ const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|( ...@@ -8,68 +8,64 @@ const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(
const isUrl = (path) => reg.test(path); const isUrl = (path) => reg.test(path);
const isAntDesignPro = () => { const isAntDesignPro = () => {
if (ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site') { if (ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site') {
return true; return true;
} }
return window.location.hostname === 'preview.pro.ant.design'; return window.location.hostname === 'preview.pro.ant.design';
}; // 给官方演示站点用,用于关闭真实开发环境不需要使用的特性 }; // 给官方演示站点用,用于关闭真实开发环境不需要使用的特性
const isAntDesignProOrDev = () => { const isAntDesignProOrDev = () => {
const { NODE_ENV } = process.env; const { NODE_ENV } = process.env;
if (NODE_ENV === 'development') { if (NODE_ENV === 'development') {
return true; return true;
} }
return isAntDesignPro(); return isAntDesignPro();
}; };
export { isAntDesignProOrDev, isAntDesignPro, isUrl }; export { isAntDesignProOrDev, isAntDesignPro, isUrl };
export const dispatch = (type, payload, callback) => { export const dispatch = (type, payload, callback) => {
window.g_app._store.dispatch({ window.g_app._store.dispatch({
type, type,
payload, payload,
callback, callback,
}); });
}; };
export const isFromIframe = () => {
export const isFromIframe = () => { // 判断是否来自iframe 嵌入页面 暂时放弃使用 // 判断是否来自iframe 嵌入页面 暂时放弃使用
return false; return false;
let isFromIframe = window.frames.length !== parent.frames.length; let isFromIframe = window.frames.length !== parent.frames.length;
if (window.location.origin.indexOf('localhost') > -1) { if (window.location.origin.indexOf('localhost') > -1) {
return false; return false;
} }
return isFromIframe; return isFromIframe;
}; };
export const getModal = () => { export const getModal = () => {
return isFromIframe() ? window?.parent?.iframeParentComponent?.Modal : Modal; return isFromIframe() ? window?.parent?.iframeParentComponent?.Modal : Modal;
}; };
export const getPopconfirm = () => { export const getPopconfirm = () => {
return isFromIframe() ? window?.parent?.iframeParentComponent?.Popconfirm : Popconfirm; return isFromIframe() ? window?.parent?.iframeParentComponent?.Popconfirm : Popconfirm;
}; };
export const getMessage = () => { export const getMessage = () => {
return isFromIframe() ? window?.parent?.iframeParentComponent?.message : message; return isFromIframe() ? window?.parent?.iframeParentComponent?.message : message;
}; };
export const getOneStopMyInfo = (params = {}) => { export const getOneStopMyInfo = (params = {}) => {
return uaaRequest('/UserApi/getMy', params) return uaaRequest('/UserApi/getMy', params).then((res) => {
.then((res) => { if (res) {
if (res) { if (!res.groupsId) {
if (!res.groupsId) { res.groupsId = 'pub';
res.groupsId = 'pub'; }
} res.differenceBetweenServerAndClientTime = -50;
return getTime() localStorage.setItem('user', JSON.stringify(res));
.then((t) => { return res;
res.differenceBetweenServerAndClientTime = t; }
localStorage.setItem('user', JSON.stringify(res)); });
return res;
});
}
});
}; };
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
import Editor from '@/webPublic/zyd_public/WangEditor/includes/wangEditor.min'; import Editor from '@/webPublic/zyd_public/WangEditor/includes/wangEditor.min';
import { message } from 'antd'; import { message } from 'antd';
import { uploadFile } from '@/webPublic/one_stop_public/libs/PictureSignature/ShowItem'; import { uploadFile } from '@/webPublic/one_stop_public/libs/PictureSignature/ShowItem';
import { queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig'; import { queryApiActionPath, queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
const E = Editor; const E = Editor;
const { BtnMenu } = E; const { BtnMenu } = E;
...@@ -43,7 +43,7 @@ export default class PdfMenu extends BtnMenu { ...@@ -43,7 +43,7 @@ export default class PdfMenu extends BtnMenu {
.then((res) => { .then((res) => {
setTimeout(() => { setTimeout(() => {
if (res && res.length > 10) { if (res && res.length > 10) {
let url = queryApiActionPath() + res; let url = queryFileUrl(res);
window.message.success('上传文件成功'); window.message.success('上传文件成功');
this.editor.txt.append(` this.editor.txt.append(`
<p class='wangEditor-pdfReader'> <p class='wangEditor-pdfReader'>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
import Editor from '@/webPublic/zyd_public/WangEditor/includes/wangEditor.min'; import Editor from '@/webPublic/zyd_public/WangEditor/includes/wangEditor.min';
import { message } from 'antd'; import { message } from 'antd';
import { uploadFile } from "@/webPublic/one_stop_public/libs/PictureSignature/ShowItem"; import { uploadFile } from "@/webPublic/one_stop_public/libs/PictureSignature/ShowItem";
import { queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig'; import { queryApiActionPath, queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
import videoSvg from './video.svg'; import videoSvg from './video.svg';
const E = Editor; const E = Editor;
...@@ -38,7 +38,7 @@ export default class VideoMenu extends BtnMenu { ...@@ -38,7 +38,7 @@ export default class VideoMenu extends BtnMenu {
const fileName = file.name; const fileName = file.name;
uploadFile(file).then((res) => { uploadFile(file).then((res) => {
if (res && res.length > 10) { if (res && res.length > 10) {
let url = queryApiActionPath() + res; let url = queryFileUrl(res);
setTimeout(()=>{ setTimeout(()=>{
window.message.success('上传成功'); window.message.success('上传成功');
this.editor.txt.append(` this.editor.txt.append(`
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import WangEditor from './includes/wangEditor.min'; import WangEditor from './includes/wangEditor.min';
import { uploadFile } from "@/webPublic/one_stop_public/libs/PictureSignature/ShowItem"; import { uploadFile } from "@/webPublic/one_stop_public/libs/PictureSignature/ShowItem";
import { queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig'; import { queryApiActionPath, queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
import PdfMenu from '@/webPublic/zyd_public/WangEditor/DiyMenu/PdfMenu'; import PdfMenu from '@/webPublic/zyd_public/WangEditor/DiyMenu/PdfMenu';
import VideoMenu from '@/webPublic/zyd_public/WangEditor/DiyMenu/VideoMenu'; import VideoMenu from '@/webPublic/zyd_public/WangEditor/DiyMenu/VideoMenu';
let editor = null; let editor = null;
...@@ -61,7 +61,7 @@ export default function Index({ ...@@ -61,7 +61,7 @@ export default function Index({
// 重写上传图片的方法 // 重写上传图片的方法
uploadFile(resultFiles[0]).then((y) => { uploadFile(resultFiles[0]).then((y) => {
if (y && y.length) { if (y && y.length) {
insertImgFn(queryApiActionPath() + y); insertImgFn(queryFileUrl(y));
} }
}); });
// insertImgFn(imgUrl); // insertImgFn(imgUrl);
......
import { uploadFile } from '@/webPublic/one_stop_public/libs/PictureSignature/ShowItem'; import { uploadFile } from '@/webPublic/one_stop_public/libs/PictureSignature/ShowItem';
import { queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig'; import { queryApiActionPath, queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
import { message } from 'antd'; import { message } from 'antd';
import { isJSON } from '@/webPublic/one_stop_public/tableCompon/Split_Index/staticInfo'; import { isJSON } from '@/webPublic/one_stop_public/tableCompon/Split_Index/staticInfo';
...@@ -45,7 +45,7 @@ class MyMenu { ...@@ -45,7 +45,7 @@ class MyMenu {
.then((res) => { .then((res) => {
setTimeout(() => { setTimeout(() => {
if (res && typeof res === 'string' && res.length > 10 && res.indexOf('errMsg') <= -1) { if (res && typeof res === 'string' && res.length > 10 && res.indexOf('errMsg') <= -1) {
let url = queryApiActionPath() + res; let url = queryFileUrl(res);
message.success('上传文件成功'); message.success('上传文件成功');
const v = `<p class='wangEditor-pdfReader'><embed width='100%' const v = `<p class='wangEditor-pdfReader'><embed width='100%'
height='768px' height='768px'
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
import styles from './css/style.less'; import styles from './css/style.less';
import React, { useEffect, useState, useRef } from 'react'; import React, { useEffect, useState, useRef } from 'react';
import compressImage from '@/webPublic/zyd_public/WangEditor/compressImage'; import compressImage from '@/webPublic/zyd_public/WangEditor/compressImage';
import { queryApiActionPath } from '@/webPublic/one_stop_public/utils/queryConfig'; import { queryApiActionPath, queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
import { uploadFile as uploadOnestopFile } from '@/webPublic/one_stop_public/libs/PictureSignature/ShowItem'; import { uploadFile as uploadOnestopFile } from '@/webPublic/one_stop_public/libs/PictureSignature/ShowItem';
import loadCss from '@/webPublic/zyd_public/WangEditor/WangEditor5/css/cssLoader'; import loadCss from '@/webPublic/zyd_public/WangEditor/WangEditor5/css/cssLoader';
import myMenuConf from '@/webPublic/zyd_public/WangEditor/WangEditor5/DiyMenu/pdfMenu'; import myMenuConf from '@/webPublic/zyd_public/WangEditor/WangEditor5/DiyMenu/pdfMenu';
...@@ -58,7 +58,7 @@ function WangEditorReactComponent(props) { ...@@ -58,7 +58,7 @@ function WangEditorReactComponent(props) {
uploadOnestopFile(fileNew).then((y) => { uploadOnestopFile(fileNew).then((y) => {
// 使用一站式的文件上传接口 // 使用一站式的文件上传接口
if (y && y.length) { if (y && y.length) {
insertFn(queryApiActionPath() + y, file.name); insertFn(queryFileUrl(y), file.name);
} }
}); });
}); });
......
...@@ -10,16 +10,15 @@ export const getTime = () => { ...@@ -10,16 +10,15 @@ export const getTime = () => {
method: 'POST', method: 'POST',
body: {}, body: {},
}, },
) ).then(t => {
.then(t => { if (t) {
if (t) { return t - new Date().getTime(); // 服务器时间 与 客户端时间的差值;
return t - new Date().getTime(); // 服务器时间 与 客户端时间的差值; } else {
} else { return 0;
return 0; }
} });
});
} else { } else {
return new Promise((resolve) => { return new Promise(resolve => {
resolve(0); resolve(0);
return 0; return 0;
}); });
...@@ -27,23 +26,19 @@ export const getTime = () => { ...@@ -27,23 +26,19 @@ export const getTime = () => {
}; };
export async function queryCurrent() { export async function queryCurrent() {
// let t = await getTime();
const config = window.specialImportantSystemConfig || {}; const config = window.specialImportantSystemConfig || {};
let token = getToken(); let token = getToken();
let userInfo = getCurrentUser(); let userInfo = getCurrentUser();
if (token && userInfo.token === token) { if (token && userInfo.token === token) {
return new Promise((resolve) => { return new Promise(resolve => {
resolve(userInfo); resolve(userInfo);
return userInfo; return userInfo;
}); });
} }
if (config.mockServer) { if (config.mockServer) {
return request( return request(`${config.mockServer}/${config.gateWayUrl.zydxg}/UserApi/queryCurrent`, {
`${config.mockServer}/${config.gateWayUrl.zydxg}/UserApi/queryCurrent`, method: 'POST',
{ body: {},
method: 'POST', });
body: {},
},
);
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论