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

文件预览地址修改

上级 1a409507
...@@ -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>
......
...@@ -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
......
...@@ -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
......
...@@ -1858,7 +1858,7 @@ export default class TableCom extends Component { ...@@ -1858,7 +1858,7 @@ 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,
...@@ -1884,7 +1884,7 @@ export default class TableCom extends Component { ...@@ -1884,7 +1884,7 @@ 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,
...@@ -2469,14 +2469,14 @@ ${obj[dataColumn.base52]} ...@@ -2469,14 +2469,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,
...@@ -2499,14 +2499,14 @@ ${obj[dataColumn.base52]} ...@@ -2499,14 +2499,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,
...@@ -2525,7 +2525,7 @@ ${obj[dataColumn.base52]} ...@@ -2525,7 +2525,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:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论