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

文件预览地址修改

上级 1a409507
......@@ -28,6 +28,7 @@ import {
RichUtils,
} from 'draft-js';
import { getToken } from '@/webPublic/one_stop_public/utils/token';
import { queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
const FormItem = Form.Item;
function getBlockStyle(block) {
......@@ -507,7 +508,7 @@ class AttrForm extends React.Component {
onChangemultiple={false}
style={{ padding: 0 }}>
{url ? (
<a href={config.httpServer + url} target="_blank">
<a href={queryFileUrl(url)} target="_blank">
{name}
</a>
) : (
......@@ -600,7 +601,7 @@ class VideoForm extends React.Component {
onChangemultiple={false}
style={{ padding: 0 }}>
{url ? (
<video src={config.httpServer + url} controls="controls">
<video src={queryFileUrl(url)} controls="controls">
您的浏览器不支持 video 标签。
</video>
) : (
......@@ -692,7 +693,7 @@ class PicForm extends React.Component {
multiple={false}
style={{ padding: 0 }}>
{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 }}>
<Icon type="video" />
......
......@@ -27,6 +27,7 @@ import {
CompositeDecorator,
RichUtils,
} from 'draft-js';
import { queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
const FormItem = Form.Item;
function getBlockStyle(block) {
......@@ -510,7 +511,7 @@ class AttrForm extends React.Component {
onChangemultiple={false}
style={{ padding: 0 }}>
{url ? (
<a href={config.httpServer + url} target="_blank">
<a href={queryFileUrl(url)} target="_blank">
{name}
</a>
) : (
......@@ -603,7 +604,7 @@ class VideoForm extends React.Component {
}}
style={{ padding: 0 }}>
{url ? (
<video src={config.httpServer + url} controls="controls">
<video src={queryFileUrl(url)} controls="controls">
您的浏览器不支持 video 标签。
</video>
) : (
......@@ -695,7 +696,7 @@ class PicForm extends React.Component {
multiple={false}
style={{ padding: 0 }}>
{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 }}>
<Icon type="video" />
......
......@@ -4,6 +4,7 @@ import table from '../assets/专家经验系统切图/智能报告/table.png';
import chart from '../assets/专家经验系统切图/智能报告/chart.png';
import React from 'react';
import { connect } from 'dva';
import { queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
const ReactHighcharts = config.ReactHighcharts;
@connect(({ Report, loading }) => ({
......@@ -200,14 +201,14 @@ const AtomicComponent = (props) => {
const { src } = entity.getData();
return (
<div>
<img src={config.httpServer + src} style={{ maxWidth: '100%' }} />
<img src={queryFileUrl(src)} style={{ maxWidth: '100%' }} />
</div>
);
}
if (type === 'attr') {
const { src, name } = entity.getData();
return (
<a href={config.httpServer + src} target="_blank">
<a href={queryFileUrl(src)} target="_blank">
{name}
</a>
);
......@@ -215,7 +216,7 @@ const AtomicComponent = (props) => {
const { src } = entity.getData();
return (
<div>
<video src={config.httpServer + src} controls="controls">
<video src={queryFileUrl(src)} controls="controls">
您的浏览器不支持 video 标签。
</video>
</div>
......
......@@ -115,7 +115,7 @@ export default class Signature extends Component {
Modal.info({
title: '查看签名',
content: <div className={styles.showDiv}>
<img src={config.httpServer + url}/>
<img src={queryFileUrl(url)}/>
</div>,
footer: null,
});
......@@ -138,7 +138,7 @@ export default class Signature extends Component {
className={styles.reSign}>
重新签名
</Button>*/}
<img src={config.httpServer + url} className={styles.littleSign} onClick={this.showSignImage}/>
<img src={queryFileUrl(url)} className={styles.littleSign} onClick={this.showSignImage}/>
</div>
);
} else {
......@@ -233,7 +233,7 @@ export default class Signature extends Component {
<this.EditIcon />
<img
onClick={this.showSignImage}
src={config.httpServer + url}
src={queryFileUrl(url)}
style={{
height,
width,
......
......@@ -3,6 +3,7 @@ import {Upload, message} from 'antd';
import config from '@/webPublic/one_stop_public/config';
import {zipImage} from "@/webPublic/zyd_public/utils/handlePhoto";
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 {
constructor(props) {
......@@ -75,7 +76,7 @@ export default class ImgUploadCom extends React.Component {
style={{padding: 0}}
>
{url ? (
<img src={config.httpServer + url} style={{
<img src={queryFileUrl(url)} style={{
height: json.height,
width: json.width,
maxWidth: '60vw', // 解决图片在移动端过宽的bug
......
......@@ -5,6 +5,7 @@ import { isNaN } from 'lodash';
import React from 'react';
import config from '@/webPublic/one_stop_public/config';
import { isJSON } from '@/webPublic/one_stop_public/2022beidianke/isJSON';
import { queryFileUrl } from '@/webPublic/one_stop_public/utils/queryConfig';
const codeMessage = {
200: '服务器成功返回请求的数据。',
......@@ -184,12 +185,7 @@ const getRender = (com, props) => {
if (com == 'canvas') return <canvas {...props} />;
if (com == 'iframe') return <iframe {...props} />;
if (com == 'img') {
const src =
props.src != null
? props.src.indexOf('http') > -1
? props.src
: config.httpServer + props.src
: null;
const src = queryFileUrl(props.src)
const pp = {
...props,
src: src
......
......@@ -1858,7 +1858,7 @@ export default class TableCom extends Component {
cm = (
<>
<img
src={config.httpServer + value}
src={queryFileUrl(value)}
style={{
width: json.width,
height: json.height,
......@@ -1884,7 +1884,7 @@ export default class TableCom extends Component {
cm = (
<>
<img
src={config.httpServer + value}
src={queryFileUrl(value)}
style={{
width: json.width,
height: json.height,
......@@ -2469,14 +2469,14 @@ ${obj[dataColumn.base52]}
} else {
cm = FilePreview ? (
<FilePreview
path={config.httpServer + obj[dataColumn.base52]}
path={queryFileUrl(obj[dataColumn.base52])}
pathName={obj[dataColumn.base52]}
width={json.width}
height={json.height}
/>
) : (
<img
src={config.httpServer + obj[dataColumn.base52]}
src={queryFileUrl(obj[dataColumn.base52])}
style={{
width: json.width,
height: json.height,
......@@ -2499,14 +2499,14 @@ ${obj[dataColumn.base52]}
} else {
cm = FilePreview ? (
<FilePreview
path={config.httpServer + obj[dataColumn.base52]}
path={queryFileUrl(obj[dataColumn.base52])}
pathName={obj[dataColumn.base52]}
width={json.width}
height={json.height}
/>
) : (
<img
src={config.httpServer + obj[dataColumn.base52]}
src={queryFileUrl(obj[dataColumn.base52])}
style={{
width: json.width,
height: json.height,
......@@ -2525,7 +2525,7 @@ ${obj[dataColumn.base52]}
<img
data-cell-component={'Signature'}
data-cell-base52={dataColumn.base52}
src={config.httpServer + obj[dataColumn.base52]}
src={queryFileUrl(obj[dataColumn.base52])}
style={{
marginLeft: 5,
width:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论