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

1

......@@ -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>
......
......@@ -42,7 +42,11 @@ import {
submitValues,
checkNeedWriteAuditInfo,
} 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 HistoryFormList from '@/webPublic/one_stop_public/DetailForAudit/HistoryFormList';
......@@ -758,11 +762,7 @@ class DetailSplit extends Component {
marginTop: -25,
border: item.taskVariable?.sign ? '1px solid #ccc' : '',
}}
src={
item.taskVariable?.sign
? queryApiActionPath() + item.taskVariable?.sign
: ''
}
src={queryFileUrl(item.taskVariable?.sign)}
alt=""
/>
) : (
......@@ -828,11 +828,7 @@ class DetailSplit extends Component {
marginTop: -25,
border: item.taskVariable?.sign ? '1px solid #ccc' : '',
}}
src={
item.taskVariable?.sign
? queryApiActionPath() + item.taskVariable?.sign
: ''
}
src={queryFileUrl(item.taskVariable?.sign)}
alt=""
/>
) : (
......
......@@ -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
......
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 { isFromIframe } from '@/webPublic/one_stop_public/utils/utils';
import getOneStopUploadUrl from '@/webPublic/one_stop_public/Base16/getOneStopUploadUrl';
const oneSetItemP = {
marginBottom: 0,
userSelect: 'none',
......@@ -157,7 +158,7 @@ export const uploadFile = (file) => {
export const zipImage = (path, fileName, limitWidth = 1200) => {
return new Promise((resolve, reject) => {
let image = new Image(); //新建一个img标签(还没嵌入DOM节点)
let imageUrl = queryApiActionPath() + path;
let imageUrl = queryFileUrl(path);
image.setAttribute('crossOrigin', 'Anonymous');
image.src = imageUrl;
image.onload = () => {
......
// 图片上传组件
import React from 'react';
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 styles from './style.less';
import UploadComDiyForQnZy from '@/webPublic/one_stop_public/libs/UploadComDiyForQnZy';
......@@ -211,14 +211,13 @@ class UploadCom extends React.Component {
<img
style={{ width: '100px', height: 'auto' }}
className={styles.img}
src={queryApiActionPath() + f.path}
src={queryFileUrl(f.path)}
/>
<div
className={styles.mask}
onClick={() => {
// window.open(queryApiActionPath() + f.path);
this.setState({
previewImage: queryApiActionPath() + f.path,
previewImage: queryFileUrl(f.path),
previewImageName : f.name,
previewVisible: true,
});
......@@ -238,7 +237,7 @@ class UploadCom extends React.Component {
}
return (
<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}
</a>{' '}
{!disabled && (
......
import React from "react";
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 styles from "./style.less";
import { checkIsImage } from "./UploadCom";
......@@ -140,15 +140,14 @@ export default class UploadComDiyForQnZy extends React.Component {
<img
style={{ width: 100, height: 100 }}
className={styles.img}
src={queryApiActionPath() + f.path}
src={queryFileUrl(f.path)}
/>
<div
className={styles.mask}
onClick={() => {
// window.open(queryApiActionPath() + f.path);
this.setState({
previewVisible: true,
previewImage: queryApiActionPath() + f.path,
previewImage: queryFileUrl(f.path),
previewImageName: f.name,
});
}}>
......@@ -167,7 +166,7 @@ export default class UploadComDiyForQnZy extends React.Component {
}
return (
<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}
</a>{" "}
{!disabled && (
......
......@@ -30,7 +30,7 @@ import SearchInfo from '../../App/SearchInfo';
import { Base16Encode } from '../../Base16/index';
import { isEmpty } from 'lodash';
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 { getModal, getPopconfirm } from '@/webPublic/one_stop_public/utils/utils';
......@@ -494,7 +494,7 @@ class TreeList extends React.Component {
{files.map((f, index2) => {
return (
<li key={index2}>
<FilePreview path={queryApiActionPath() + f.path} pathName={f.name} />
<FilePreview path={queryFileUrl(f.path)} pathName={f.name} />
</li>
);
})}
......
......@@ -29,7 +29,7 @@ import SearchInfo from '../../App/SearchInfo';
import { Base16Encode } from '../../Base16/index';
import { isEmpty } from 'lodash';
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 { cloneDeep } from '../../copy/index';
import { getPopconfirm, getModal } from '@/webPublic/one_stop_public/utils/utils';
......@@ -538,7 +538,7 @@ class FormList extends React.Component {
{files.map((f, index2) => {
return (
<li key={index2}>
<FilePreview path={queryApiActionPath() + f.path} pathName={f.name} />
<FilePreview path={queryFileUrl(f.path)} pathName={f.name} />
</li>
);
})}
......
......@@ -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
......
......@@ -47,7 +47,7 @@ import TableList from '../libs/TableList';
import styles from './style.less';
import config from '@/webPublic/one_stop_public/config';
import { cloneDeep, isEmpty, isNaN } from 'lodash';
import { queryApiActionPath } from '../utils/queryConfig';
import { queryApiActionPath, queryFileUrl } from '../utils/queryConfig';
import Highlighter from 'react-highlight-words';
import Signature from '../Signature';
import { changeToDraftState, deepCopy, preHandle } from '../utils/myutils';
......@@ -70,19 +70,17 @@ import PictureSignature, {
} from '@/webPublic/one_stop_public/libs/PictureSignature/PictureSignature';
import WangEditor from '@/webPublic/zyd_public/WangEditor/OnstopWang';
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 getOneStopUploadUrl from '@/webPublic/one_stop_public/Base16/getOneStopUploadUrl';
import SwitchWeb from '@/webPublic/one_stop_public/tableCompon/Split_Index/SwitchWeb';
import CronEditorDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/CronEditorDiy/index';
import ButtonDiy from '@/webPublic/one_stop_public/tableCompon/Split_Index/ButtonDiy';
import giveVarcharRules
from '@/webPublic/one_stop_public/tableCompon/Split_Index/giveVarcharLength';
import giveVarcharRules from '@/webPublic/one_stop_public/tableCompon/Split_Index/giveVarcharLength';
const {
MonthPicker,
WeekPicker,
} = DatePicker;
const { MonthPicker, WeekPicker } = DatePicker;
/**
* 日期组件antd3.x有bug 详情见禅道 27152 毕业跟踪调查管理 毕业时间改为年级筛选
*/
......@@ -103,13 +101,7 @@ const giveRender = (column = {}) => {
return column;
};
@connect(({
DataColumn,
SqlManageEntity,
formList,
loading,
}) => ({
@connect(({ DataColumn, SqlManageEntity, formList, loading }) => ({
DataColumn,
SqlManageEntity,
formList,
......@@ -182,7 +174,7 @@ export default class TableCom extends Component {
file = {
name: 'file',
action: getOneStopUploadUrl(),
onChange: (info) => {
onChange: info => {
if (info.file.status !== 'uploading') {
this.setState({
img: info.file.response,
......@@ -203,7 +195,7 @@ export default class TableCom extends Component {
this.setState({ searchText: selectedKeys[0] });
};
handleReset = (clearFilters) => {
handleReset = clearFilters => {
clearFilters();
this.resetSearchText();
};
......@@ -215,20 +207,15 @@ export default class TableCom extends Component {
};
getColumnSearchProps = (dataIndex, title) => ({
filterDropdown: ({
setSelectedKeys,
selectedKeys,
confirm,
clearFilters,
}) => (
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => (
<div style={{ padding: 8 }}>
<Input
ref={(node) => {
ref={node => {
this.searchInput = node;
}}
placeholder={`请输入${title}`}
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)}
style={{
width: 188,
......@@ -245,34 +232,34 @@ export default class TableCom extends Component {
style={{
width: 90,
marginRight: 8,
}}>
}}
>
搜索
</Button>
<Button
loading={this.props.loading}
onClick={() => this.handleReset(clearFilters)}
size="small"
style={{ width: 90 }}>
style={{ width: 90 }}
>
重置
</Button>
</div>
),
filterIcon: (filtered) => (
<Icon type="search" style={{ color: filtered ? '#1890ff' : 'red' }}/>
),
filterIcon: filtered => <Icon type="search" style={{ color: filtered ? '#1890ff' : 'red' }} />,
onFilter: (value, record) =>
record[dataIndex]
? record[dataIndex]
.toString()
.toLowerCase()
.includes(value.toLowerCase())
.toString()
.toLowerCase()
.includes(value.toLowerCase())
: '',
onFilterDropdownVisibleChange: (visible) => {
onFilterDropdownVisibleChange: visible => {
if (visible) {
setTimeout(() => this.searchInput.select());
}
},
render: (text) => {
render: text => {
if (text != null) {
return (
<Highlighter
......@@ -307,11 +294,7 @@ export default class TableCom extends Component {
};
componentWillReceiveProps(props) {
const {
json,
mapData,
obj,
} = props;
const { json, mapData, obj } = props;
if (json == null || this.props.safe) {
return;
}
......@@ -369,7 +352,7 @@ export default class TableCom extends Component {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props
.i + 1}行,第${this.props.j +
1}列:存在循环风险,1秒内执行超过10次,现已停止执行,请检查,`,
1}列:存在循环风险,1秒内执行超过10次,现已停止执行,请检查,`,
);
return;
......@@ -391,9 +374,9 @@ export default class TableCom extends Component {
this.props.fatherCode != null
? bindObj
? {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: bindObj;
if (this.props.fatherCode == null && dataColumn == null) {
......@@ -429,21 +412,18 @@ export default class TableCom extends Component {
allValues = JSON.stringify(allValues);
if (json.comName === 'TableSelect') {
const { dispatch } = this.props;
const {
sqlKey,
optionType,
} = json;
const { sqlKey, optionType } = json;
if (optionType === 'sql') {
dispatch({
type: 'SqlManageEntity/find',
payload: { sqlKey },
callback: (sqlModel) => {
callback: sqlModel => {
this.setState({ sqlModel });
if (sqlModel.dataObjId) {
dispatch({
type: 'formList/getHead',
payload: { dataObjId: sqlModel.dataObjId },
callback: (datas) => {
callback: datas => {
if (datas) {
const columns = [];
for (var i = 0; i < datas.length; i++) {
......@@ -454,8 +434,7 @@ export default class TableCom extends Component {
if (
['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)
) {
column.render = (val) => moment(val)
.format('YYYY-MM-DD HH:mm:ss');
column.render = val => moment(val).format('YYYY-MM-DD HH:mm:ss');
}
column = giveRender(column);
......@@ -492,8 +471,7 @@ export default class TableCom extends Component {
break;
}
column.render = (val) => moment(parseInt(val))
.format(ff);
column.render = val => moment(parseInt(val)).format(ff);
}
if (cll[k].isQuery) {
column = {
......@@ -515,7 +493,7 @@ export default class TableCom extends Component {
sqlKey,
allValues,
},
callback: (list) => {
callback: list => {
const x = {
list: list,
pagination: false,
......@@ -530,7 +508,7 @@ export default class TableCom extends Component {
dispatch({
type: 'formList/getHead',
payload: { dataObjId: dataColumn.referenceObjId },
callback: (datas) => {
callback: datas => {
if (datas) {
const columns = [];
for (var i = 0; i < datas.length; i++) {
......@@ -539,8 +517,7 @@ export default class TableCom extends Component {
column.title = datas[i].title;
column.dataIndex = datas[i].name;
if (['DATE', 'DATETIME', 'TIME', 'TIMESTAMP', 'YEAR'].includes(datas[i].type)) {
column.render = (val) => moment(val)
.format('YYYY-MM-DD HH:mm:ss');
column.render = val => moment(val).format('YYYY-MM-DD HH:mm:ss');
}
column = giveRender(column);
columns.push(column);
......@@ -578,13 +555,7 @@ export default class TableCom extends Component {
break;
case 'sql':
if (json.sqlKey != null && json.sqlKey != '') {
this.fetchData3(
obj,
dataColumn,
init,
json,
allValues,
);
this.fetchData3(obj, dataColumn, init, json, allValues);
}
break;
case 'func':
......@@ -676,7 +647,7 @@ export default class TableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i +
1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -770,7 +741,7 @@ export default class TableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.formKey} ${json.comName}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
1}列:公式配置有误,回调函数内部错误,`,
e,
);
}
......@@ -785,79 +756,78 @@ export default class TableCom extends Component {
delete params[i];
}
}
noPrefixRequest(url, params)
.then((data) => {
// if (!data || !Array.isArray(data)) {
// data = [];
// }
const { reqUrls } = this.state;
if (reqUrls && reqUrls[url]) {
reqUrls[url].data = data;
}
this.setState(
{
res: data,
reqUrls,
},
() => {
if (callback) {
if (json.optionType && json.optionType == 'func') {
const res = callback(data);
if (res != null && !(typeof res === 'function')) {
this.setState(
{
options: res,
selectDis: false,
},
() => {
if (orgCallback) orgCallback();
},
);
}
} else if (json.comName == 'Button') {
try {
callback(data);
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
e,
);
noPrefixRequest(url, params).then(data => {
// if (!data || !Array.isArray(data)) {
// data = [];
// }
const { reqUrls } = this.state;
if (reqUrls && reqUrls[url]) {
reqUrls[url].data = data;
}
this.setState(
{
res: data,
reqUrls,
},
() => {
if (callback) {
if (json.optionType && json.optionType == 'func') {
const res = callback(data);
if (res != null && !(typeof res === 'function')) {
this.setState(
{
options: res,
selectDis: false,
},
() => {
if (orgCallback) orgCallback();
},
);
}
} else if (json.comName == 'Button') {
try {
callback(data);
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
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 {
const x = callback(data);
if (x != null) {
this.setState({ option: x });
}
// 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}列:公式配置有误,回调函数内部错误,`,
`页面${this.props.currentFormTitle} ${this.props.formKey} ${
json.comName
}${this.props.i + 1}行,第${this.props.j +
1}列:公式配置有误,回调函数内部错误,`,
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';
};
......@@ -988,50 +958,62 @@ export default class TableCom extends Component {
if (getToken() != null) {
pp.token = getToken();
}
uaaRequest(url, pp)
.then((data) => {
const { sqlKeys } = this.state;
sqlKeys[sqlKey].data = data;
this.setState({ sqlKeys });
if (data == null) {
return;
}
uaaRequest(url, pp).then(data => {
const { sqlKeys } = this.state;
sqlKeys[sqlKey].data = data;
this.setState({ sqlKeys });
if (data == null) {
return;
}
if (callback) {
if (json.optionType && json.optionType === 'func') {
const res = callback(data);
if (callback) {
if (json.optionType && json.optionType === 'func') {
const res = callback(data);
if (res != null && !(typeof res === 'function')) {
this.setState(
{
options: res,
selectDis: false,
},
() => {
if (orgCallback) orgCallback();
},
);
}
} else if (json.comName == 'Button') {
try {
callback(data);
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
e,
);
if (res != null && !(typeof res === 'function')) {
this.setState(
{
options: res,
selectDis: false,
},
() => {
if (orgCallback) orgCallback();
},
);
}
} else if (json.comName == 'Button') {
try {
callback(data);
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this
.props.i + 1}行,第${this.props.j + 1}列:公式配置有误,回调函数内部错误,`,
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 (
json.comName == 'Echart' ||
json.comName == 'QRCode' ||
json.comName == 'Graph'
) {
} 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 {
const x = callback(data);
if (x != null) {
this.setState({ option: x });
}
// 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
......@@ -1039,23 +1021,10 @@ export default class TableCom extends Component {
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';
......@@ -1070,8 +1039,8 @@ export default class TableCom extends Component {
* 动态生成表单配置函数所使用
*/
let functionObj = {};
formulaList.map((item) => {
item.children.map((arr) => {
formulaList.map(item => {
item.children.map(arr => {
functionObj[arr.callKey] = arr.function;
});
});
......@@ -1123,7 +1092,8 @@ export default class TableCom extends Component {
},
this.props.index,
this.props.fatherCode,
{ // utils函数的参数
{
// utils函数的参数
moment,
sql: this.sqlUtil.bind(this, base52, json, callback), // utils.sql xxx
message,
......@@ -1186,19 +1156,14 @@ export default class TableCom extends Component {
} catch (e) {
console.log(
`页面${this.props.currentFormTitle} ${this.props.formKey} ${json.comName}${this.props.i +
1}行,第${this.props.j + 1}列:公式配置有误,暂存失败,`,
1}行,第${this.props.j + 1}列:公式配置有误,暂存失败,`,
e,
);
}
};
componentDidMount() {
const {
json,
mapData,
obj,
init,
} = this.props;
const { json, mapData, obj, init } = this.props;
if (json == null) {
return;
}
......@@ -1207,7 +1172,7 @@ export default class TableCom extends Component {
dispatch({
type: 'SqlManageEntity/find',
payload: { sqlKey: json.sqlKey },
callback: (res) => {
callback: res => {
this.setState({ sqlContent: res.sql });
},
});
......@@ -1219,9 +1184,9 @@ export default class TableCom extends Component {
this.props.fatherCode != null
? bindObj
? {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${this.props.uuid}` }
: bindObj;
if (this.props.fatherCode == null && dataColumn == null) {
......@@ -1243,14 +1208,9 @@ export default class TableCom extends Component {
}
fetchData3 = (obj, dataColumn, init, json, allValues) => {
const {
sqlKey,
labelName,
valueName,
isMeta,
filterSql,
} = json;
if (isMeta) { // 2022年7月5日 2022 姚鑫国说的 如果是元数据 不需要传这个allValues
const { sqlKey, labelName, valueName, isMeta, filterSql } = json;
if (isMeta) {
// 2022年7月5日 2022 姚鑫国说的 如果是元数据 不需要传这个allValues
// 解决禅道bug 28017
allValues = {};
}
......@@ -1263,14 +1223,15 @@ export default class TableCom extends Component {
filterSql: isMeta ? filterSql || '' : undefined,
};
let getSqlOptionsCache = JSON.stringify(params);
if (isMeta && getSqlOptionsCache === this.state.getSqlOptionsCache) { // 当上次的请求参数和这次的相同时 不再发起请求
if (isMeta && getSqlOptionsCache === this.state.getSqlOptionsCache) {
// 当上次的请求参数和这次的相同时 不再发起请求
return false;
}
dispatch({
type: 'DataColumn/getSqlOptions',
payload: params,
callback: (options) => {
callback: options => {
const optionsx = [];
let base52 = dataColumn.base52;
let vl = this.props.form.getFieldsValue()[base52];
......@@ -1313,7 +1274,8 @@ export default class TableCom extends Component {
};
let getSqlOptionsCache = JSON.stringify(params);
if (isMeta && getSqlOptionsCache === this.state.getSqlOptionsCache) { // 当上次的请求参数和这次的相同时 不再发起请求
if (isMeta && getSqlOptionsCache === this.state.getSqlOptionsCache) {
// 当上次的请求参数和这次的相同时 不再发起请求
return false;
}
......@@ -1321,7 +1283,7 @@ export default class TableCom extends Component {
dispatch({
type: 'DataColumn/getSqlLabels',
payload: params,
callback: (labels) => {
callback: labels => {
this.setState({
getSqlOptionsCache,
labels,
......@@ -1339,14 +1301,14 @@ export default class TableCom extends Component {
};
// console.log('1332', this.state.getSqlOptionsCache, JSON.stringify(params));
let getSqlOptionsCache = JSON.stringify(params);
if (isMeta && getSqlOptionsCache === this.state.getSqlOptionsCache) { // 当上次的请求参数和这次的相同时 不再发起请求
if (isMeta && getSqlOptionsCache === this.state.getSqlOptionsCache) {
// 当上次的请求参数和这次的相同时 不再发起请求
return false;
}
dispatch({
type: 'DataColumn/getSqlOptions',
payload: params,
callback: (options) => {
callback: options => {
// console.log(options);
let base52 = dataColumn.base52;
let vl = this.props.form.getFieldsValue()[base52];
......@@ -1429,7 +1391,7 @@ export default class TableCom extends Component {
filterSql,
allValues,
},
callback: (options) => {
callback: options => {
const optionsx = [];
for (var i = 0; i < options.length; i++) {
optionsx.push({
......@@ -1453,7 +1415,7 @@ export default class TableCom extends Component {
filterSql,
allValues,
},
callback: (labels) => {
callback: labels => {
this.setState({
labels,
selectDis: false,
......@@ -1469,7 +1431,7 @@ export default class TableCom extends Component {
filterSql,
allValues,
},
callback: (options) => {
callback: options => {
const optionsx = [];
for (var i = 0; i < options.length; i++) {
optionsx.push({
......@@ -1485,11 +1447,8 @@ export default class TableCom extends Component {
});
}
};
getColumn = (key) => {
let {
mapData,
json,
} = this.props;
getColumn = key => {
let { mapData, json } = this.props;
const columnIds = json?.columnIds;
......@@ -1545,20 +1504,8 @@ export default class TableCom extends Component {
// console.log(formKey, json);
// }
const {
options,
labels,
selectDis,
modalCode,
modalTitle,
modalInit,
modalProps,
} = this.state;
const {
getFieldDecorator,
getFieldError,
getFieldProps,
} = this.props.form;
const { options, labels, selectDis, modalCode, modalTitle, modalInit, modalProps } = this.state;
const { getFieldDecorator, getFieldError, getFieldProps } = this.props.form;
const disabled = json != null ? json.disabled : false;
const permRank = json != null ? (json.permRank != null ? json.permRank : 0) : 0;
if (json?.label === '账号') {
......@@ -1581,7 +1528,7 @@ export default class TableCom extends Component {
) {
return <></>;
}
return <QRCode {...this.state.option} key={uuid}/>;
return <QRCode {...this.state.option} key={uuid} />;
}
if (json.comName == 'Echart') {
return (
......@@ -1597,7 +1544,7 @@ export default class TableCom extends Component {
);
}
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') {
......@@ -1612,8 +1559,7 @@ export default class TableCom extends Component {
<>
{this.props.form.getFieldDecorator(uuid, {
initialValue: fk,
})(<Input type="hidden"/>)}
{' '}
})(<Input type="hidden" />)}{' '}
<ZdyTable
taskId={this.props.taskId}
importExcel={this.props.importExcel}
......@@ -1667,7 +1613,8 @@ export default class TableCom extends Component {
style={{
textAlign: 'center',
height: value == null ? 20 : null,
}}>
}}
>
{value}
</div>
);
......@@ -1688,15 +1635,16 @@ export default class TableCom extends Component {
<>
{this.props.form.getFieldDecorator(uid, {
initialValue: obj[uuid] || json.initialValue,
})(<Input type="hidden"/>)}
})(<Input type="hidden" />)}
<span
style={{
fontWeight: get === 'mobile' ? 'bold' : '',
marginRight: get === 'mobile' ? 12 : '',
}}
{...json.props}>
{obj[uuid] || json.initialValue}
</span>
{...json.props}
>
{obj[uuid] || json.initialValue}
</span>
</>
);
} else {
......@@ -1704,15 +1652,16 @@ export default class TableCom extends Component {
<>
{this.props.form.getFieldDecorator(uid, {
initialValue: this.props.form.getFieldsValue()[uid] || json.initialValue,
})(<Input type="hidden"/>)}
})(<Input type="hidden" />)}
<span
style={{
fontWeight: get === 'mobile' ? 'bold' : '',
marginRight: get === 'mobile' ? 12 : '',
}}
{...json.props}>
{this.props.form.getFieldsValue()[uid]}
</span>
{...json.props}
>
{this.props.form.getFieldsValue()[uid]}
</span>
</>
);
}
......@@ -1751,54 +1700,53 @@ export default class TableCom extends Component {
case 'TextArea':
cm = (
<span style={{ paddingRight: get === 'mobile' ? 8 : '' }}>
{value}
{get === 'mobile' ? <br/> : ''}
</span>
{value}
{get === 'mobile' ? <br /> : ''}
</span>
);
break;
case 'Switch':
cm = (
<span>
{value}
{get === 'mobile' ? <br/> : ''}
</span>
{value}
{get === 'mobile' ? <br /> : ''}
</span>
);
break;
case 'Input':
cm = (
<span style={{ paddingRight: get === 'mobile' ? 8 : '' }} data-com-name={'input'}>
{value}
{value}
{get === 'mobile' ? '' : ''}
</span>
</span>
);
break;
case 'Cron':
cm = (
<span style={{ paddingRight: get == 'mobile' ? 8 : '' }}>
{value}
{get === 'mobile' ? <br/> : ''}
</span>
{value}
{get === 'mobile' ? <br /> : ''}
</span>
);
break;
case 'InputNumber':
cm = (
<span>
{value}
{get === 'mobile' ? <br/> : ''}
</span>
{value}
{get === 'mobile' ? <br /> : ''}
</span>
);
break;
case 'DatePicker':
cm = value ? (
<span>
{moment(parseInt(value))
.format('YYYY-MM-DD HH:mm:ss')}
{get === 'mobile' ? <br/> : ''}
</span>
{moment(parseInt(value)).format('YYYY-MM-DD HH:mm:ss')}
{get === 'mobile' ? <br /> : ''}
</span>
) : (
''
);
......@@ -1812,14 +1760,14 @@ export default class TableCom extends Component {
{filesX.map((f, index2) => {
return (
<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}
</a>
</li>
);
})}
</ul>
{get === 'mobile' ? <br/> : ''}
{get === 'mobile' ? <br /> : ''}
</>
);
......@@ -1832,14 +1780,14 @@ export default class TableCom extends Component {
{files.map((f, index2) => {
return (
<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}
</a>
</li>
);
})}
</ul>
{get === 'mobile' ? <br/> : ''}
{get === 'mobile' ? <br /> : ''}
</>
);
......@@ -1858,13 +1806,13 @@ export default class TableCom extends Component {
cm = (
<>
<img
src={config.httpServer + value}
src={queryFileUrl(value)}
style={{
width: json.width,
height: json.height,
}}
/>
{get === 'mobile' ? <br/> : ''}
{get === 'mobile' ? <br /> : ''}
</>
);
}
......@@ -1884,13 +1832,13 @@ export default class TableCom extends Component {
cm = (
<>
<img
src={config.httpServer + value}
src={queryFileUrl(value)}
style={{
width: json.width,
height: json.height,
}}
/>
{get === 'mobile' ? <br/> : ''}
{get === 'mobile' ? <br /> : ''}
</>
);
}
......@@ -1907,7 +1855,8 @@ export default class TableCom extends Component {
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
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}
</MobileItem>
);
......@@ -1918,12 +1867,13 @@ export default class TableCom extends Component {
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
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}
</MobileItem>
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type="hidden"/>)}
})(<Input type="hidden" />)}
</>
);
}
......@@ -1936,7 +1886,7 @@ export default class TableCom extends Component {
{cm}
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type="hidden"/>)}
})(<Input type="hidden" />)}
</>
);
}
......@@ -1950,7 +1900,8 @@ export default class TableCom extends Component {
style={{
minHeight: 40,
lineHeight: '40px',
}}>
}}
>
<Col
className={json.label ? json.label : sqlData[key] ? styles.row_col_div : ''}
span={json.labelSpan}
......@@ -1961,7 +1912,8 @@ export default class TableCom extends Component {
overflow: 'hidden',
fontSize: 14,
color: 'rgba(0,0,0,0.85)',
}}>
}}
>
{json.label ? (
<>
{json.label}
......@@ -1970,9 +1922,10 @@ export default class TableCom extends Component {
position: 'relative',
top: '-0.5px',
margin: '0 8px 0 2px',
}}>
:
</span>
}}
>
:
</span>
</>
) : sqlData[key] ? (
<>
......@@ -1982,9 +1935,10 @@ export default class TableCom extends Component {
position: 'relative',
top: '-0.5px',
margin: '0 8px 0 2px',
}}>
:
</span>
}}
>
:
</span>
</>
) : (
''
......@@ -1997,7 +1951,8 @@ export default class TableCom extends Component {
lineHeight: '40px',
zoom: 1,
fontSize: 14,
}}>
}}
>
{cm}
</Col>
</Row>
......@@ -2007,7 +1962,8 @@ export default class TableCom extends Component {
<Form.Item
labelCol={{ span: json.labelSpan }}
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}
</Form.Item>
);
......@@ -2018,12 +1974,13 @@ export default class TableCom extends Component {
<Form.Item
labelCol={{ span: json.labelSpan }}
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}
</Form.Item>
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type="hidden"/>)}
})(<Input type="hidden" />)}
</>
);
}
......@@ -2036,7 +1993,7 @@ export default class TableCom extends Component {
{cm}
{this.props.form.getFieldDecorator(`defaultValues.${formKey}.${key}`, {
initialValue: value,
})(<Input type="hidden"/>)}
})(<Input type="hidden" />)}
</>
);
}
......@@ -2052,9 +2009,9 @@ export default class TableCom extends Component {
this.props.fatherCode != null
? bindObj
? {
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
...bindObj,
base52: `${this.props.fatherCode}.[${this.props.index}].${bindObj.base52}`,
}
: { base52: `${this.props.fatherCode}.[${this.props.index}].${uuid}` }
: bindObj;
......@@ -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 (this.props.fatherCode) {
......@@ -2112,10 +2059,6 @@ export default class TableCom extends Component {
// console.log(json.comName);
switch (json.comName) {
// 电子签章展示
// case 'Signature':
// cm = <img src={queryApiActionPath()+obj[dataColumn.base52]} />
// break;
case 'RichText':
cm = (
<Editor
......@@ -2129,7 +2072,7 @@ export default class TableCom extends Component {
case 'WangEditor':
let textV = obj[dataColumn.base52];
if (!textV || textV === 'null') {
return <div/>;
return <div />;
}
cm = (
<div
......@@ -2146,9 +2089,10 @@ ${obj[dataColumn.base52]}
<span
style={{
wordBreak: 'break-all',
}}>
{obj[dataColumn.base52]}
</span>
}}
>
{obj[dataColumn.base52]}
</span>
);
break;
case 'Switch':
......@@ -2162,9 +2106,10 @@ ${obj[dataColumn.base52]}
data-obj-comname={'Input'}
style={{
wordBreak: 'break-all',
}}>
{obj[dataColumn.base52]}
</span>
}}
>
{obj[dataColumn.base52]}
</span>
);
break;
......@@ -2190,9 +2135,8 @@ ${obj[dataColumn.base52]}
case 'Checkbox':
cm = (
<span>
{labels != null
? labels.map(
(r, i) =>
{labels != null
? labels.map((r, i) =>
i == 0 ? (
typeof r == 'string' ? (
<span>{r}</span>
......@@ -2204,9 +2148,9 @@ ${obj[dataColumn.base52]}
) : (
',' + Object.values(r)
),
)
)
: ''}
</span>
</span>
);
break;
......@@ -2240,8 +2184,8 @@ ${obj[dataColumn.base52]}
} else {
cm = (
<span>
{ds.map((r, i) => (i == 0 ? r[json.labelName] : ',' + r[json.labelName]))}
</span>
{ds.map((r, i) => (i == 0 ? r[json.labelName] : ',' + r[json.labelName]))}
</span>
);
}
......@@ -2264,16 +2208,14 @@ ${obj[dataColumn.base52]}
} else {
cm = (
<span>
{moment(parseInt(obj[begin.base52]))
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '}
{moment(parseInt(obj[begin.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '}
{' '}
{moment(parseInt(obj[end.base52]))
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}
</span>
{moment(parseInt(obj[end.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}
</span>
);
}
} else {
......@@ -2282,25 +2224,22 @@ ${obj[dataColumn.base52]}
title = title ? title : '起止时间';
break;
case 'DatePicker':
const vTime = obj[dataColumn.base52];
if (vTime && typeof vTime === 'string' && vTime.indexOf('-') <= -1) {
cm = (
<span>
{moment(parseInt(vTime))
.format(json.format ? json.format : 'YYYY-MM-DD HH:mm:ss')}
</span>
{moment(parseInt(vTime)).format(json.format ? json.format : 'YYYY-MM-DD HH:mm:ss')}
</span>
);
} else {
cm = (
<span>
{vTime
? moment(+new Date(vTime))
.format(
{vTime
? moment(+new Date(vTime)).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)
: ''}
</span>
</span>
);
}
......@@ -2341,18 +2280,18 @@ ${obj[dataColumn.base52]}
cm = (
<ul className={styles.imageUl}>
{Array.isArray(files) &&
files.map((f, index2) => {
return (
<li key={f.path}>
<PictureSignature
json={json}
disabled={true} // 只读模式
basicUrl={queryApiActionPath()}
fileInfo={f}
/>
</li>
);
})}
files.map((f, index2) => {
return (
<li key={f.path}>
<PictureSignature
json={json}
disabled={true} // 只读模式
basicUrl={queryApiActionPath()}
fileInfo={f}
/>
</li>
);
})}
</ul>
);
}
......@@ -2395,7 +2334,7 @@ ${obj[dataColumn.base52]}
return (
<li key={index2}>
<FilePreview
path={queryApiActionPath() + f.path}
path={queryFileUrl(f.path)}
pathName={f.name}
type={'UploadCom'}
/>
......@@ -2404,7 +2343,7 @@ ${obj[dataColumn.base52]}
}
return (
<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}
</a>
</li>
......@@ -2417,38 +2356,26 @@ ${obj[dataColumn.base52]}
cm = (
<ul className={styles.imageUl}>
{Array.isArray(files) &&
files.map((f, index2) => {
// if (f.filePath.indexOf('.png') != -1 || f.filePath.indexOf('.jpg') != -1) {
// return (
// <img
// key={index2}
// style={{ width: 100, height: 100 }}
// src={queryApiActionPath() + f.filePath}
// />
// );
// }
if (get === 'web' || !this.props.isPrint) {
files.map((f, index2) => {
if (get === 'web' || !this.props.isPrint) {
return (
<li key={index2}>
<FilePreview
path={queryFileUrl(f.path)}
pathName={f.name}
type={'UploadCom'}
/>
</li>
);
}
return (
<li key={index2}>
<FilePreview
path={queryApiActionPath() + f.path}
pathName={f.name}
type={'UploadCom'}
/>
<a target="_blank" key={f.filePath} href={queryFileUrl(f.filePath)}>
{f.fileName}
</a>
</li>
);
}
return (
<li key={index2}>
<a
target="_blank"
key={f.filePath}
href={queryApiActionPath() + f.filePath}>
{f.fileName}
</a>
</li>
);
})}
})}
</ul>
);
}
......@@ -2459,9 +2386,10 @@ ${obj[dataColumn.base52]}
display: 'inline-block',
width: '100%',
textAlign: 'center',
}}>
暂无附件
</span>
}}
>
暂无附件
</span>
);
}
......@@ -2479,14 +2407,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,
......@@ -2509,14 +2437,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,
......@@ -2535,7 +2463,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:
......@@ -2548,7 +2476,6 @@ ${obj[dataColumn.base52]}
);
}
break;
case 'ChildForm':
const xxxxx = obj[dataColumn.base52];
......@@ -2652,10 +2579,10 @@ ${obj[dataColumn.base52]}
default:
cm = (
<span>
缺乏字段
缺乏字段
{json.comName}
的匹配项
</span>
</span>
);
break;
}
......@@ -2716,21 +2643,22 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择' + title,
},
],
{
required: required,
message: '请选择' + title,
},
],
})}
disabled={disabled}
onClick={(checked) => {
onClick={checked => {
// set new value
this.props.form.setFieldsValue({
[dataColumn.base52]: checked,
});
}}
/>
}>
}
>
{(json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel)
? title
......@@ -2746,14 +2674,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择' + title,
},
],
})(
<SwitchWeb json={json} disabled={disabled}/>,
);
{
required: required,
message: '请选择' + title,
},
],
})(<SwitchWeb json={json} disabled={disabled} />);
break;
case 'TextArea':
......@@ -2769,11 +2695,11 @@ ${obj[dataColumn.base52]}
if (get === 'mobile') {
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
rules:giveVarcharRules({
rules: giveVarcharRules({
dataColumn,
json,
required,
title
title,
}),
})(
<TextArea
......@@ -2794,7 +2720,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -2804,11 +2731,11 @@ ${obj[dataColumn.base52]}
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
rules:giveVarcharRules({
rules: giveVarcharRules({
dataColumn,
json,
required,
title
title,
}),
})(
<TextArea
......@@ -2831,7 +2758,7 @@ ${obj[dataColumn.base52]}
otherProps = {};
}
}
const { disabledInputStyle = {},addonAfter } = otherProps;
const { disabledInputStyle = {}, addonAfter } = otherProps;
let inputStyle = {
width: json.width,
};
......@@ -2847,7 +2774,7 @@ ${obj[dataColumn.base52]}
dataColumn,
json,
required,
title
title,
}),
})(
<Input
......@@ -2870,7 +2797,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -2880,7 +2808,7 @@ ${obj[dataColumn.base52]}
case 'InputHidden':
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
})(<Input type="hidden"/>);
})(<Input type="hidden" />);
break;
case 'InputNumber':
if (json?.otherProps) {
......@@ -2897,18 +2825,18 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请输入' + title,
},
],
{
required: required,
message: '请输入' + title,
},
],
})(
<InputNumber
disabled={disabled}
placeholder={json.placeholder}
max={json.max}
min={json.min}
addonAfter={otherProps?.addonAfter}//3.0ant 不支持
addonAfter={otherProps?.addonAfter} //3.0ant 不支持
precision={json.precision}
step={json.step}
/>,
......@@ -2925,7 +2853,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -2943,12 +2872,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择' + dataColumn.title,
},
],
})(<Radio.Group options={options} disabled={disabled}/>);
{
required: required,
message: '请选择' + dataColumn.title,
},
],
})(<Radio.Group options={options} disabled={disabled} />);
if (get == 'mobile') {
cm = <div>{cm}</div>;
if (
......@@ -2961,7 +2890,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -2982,12 +2912,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择' + dataColumn.title,
},
],
})(<Checkbox.Group options={options} disabled={disabled}/>)}
{
required: required,
message: '请选择' + dataColumn.title,
},
],
})(<Checkbox.Group options={options} disabled={disabled} />)}
</Flex>
);
......@@ -3001,7 +2931,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -3016,11 +2947,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择' + dataColumn.title,
},
],
{
required: required,
message: '请选择' + dataColumn.title,
},
],
})(
<Checkbox.Group
options={options}
......@@ -3045,11 +2976,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择' + dataColumn.title,
},
],
{
required: required,
message: '请选择' + dataColumn.title,
},
],
})(
<Select
allowClear
......@@ -3061,48 +2992,49 @@ ${obj[dataColumn.base52]}
getPopupContainer={
this.props.isDynamic && document.querySelector('#dynamic_div')
? () => {
return document.querySelector('#dynamic_div');
}
return document.querySelector('#dynamic_div');
}
: ''
}
onFocus={() => {
get === 'mobile' // 移动端取消输入键盘弹出
? setTimeout(() => {
if (document.querySelectorAll(`.ant-select-search__field`).length > 0) {
let ary = [...document.querySelectorAll(`.ant-select-search__field`)];
ary.map((item) => {
item.setAttribute('readonly', 'readonly');
// setTimeout(() => {
// ary.map(arr => {
// arr.removeAttribute('readonly');
// })
// });
});
}
})
if (document.querySelectorAll(`.ant-select-search__field`).length > 0) {
let ary = [...document.querySelectorAll(`.ant-select-search__field`)];
ary.map(item => {
item.setAttribute('readonly', 'readonly');
// setTimeout(() => {
// ary.map(arr => {
// arr.removeAttribute('readonly');
// })
// });
});
}
})
: null;
}}
filterOption={(input, option) =>
option
? option.props.children.toLowerCase()
.indexOf(input.toLowerCase()) >= 0
? option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
: false
}
{...otherProps}>
{
(json.options && Array.isArray(json.options)) ?
json.options.map((r) => {
return (<Option key={r.value} value={r.value}>
{r.label}
</Option>);
}) : options && options instanceof Array
? options.map((r) => (
{...otherProps}
>
{json.options && Array.isArray(json.options)
? json.options.map(r => {
return (
<Option key={r.value} value={r.value}>
{r.label}
</Option>
))
: ''
}
);
})
: options && options instanceof Array
? options.map(r => (
<Option key={r.value} value={r.value}>
{r.label}
</Option>
))
: ''}
</Select>,
);
if (
......@@ -3116,7 +3048,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -3139,8 +3072,7 @@ ${obj[dataColumn.base52]}
}
const filterF = function filter(inputValue, path) {
return path.some(
(option) => option?.label?.toLowerCase()
?.indexOf(inputValue.toLowerCase()) > -1,
option => option?.label?.toLowerCase()?.indexOf(inputValue.toLowerCase()) > -1,
);
};
// if(this.props.uuid === 'id_32691685234912400529714267d34dc585a2'){
......@@ -3157,11 +3089,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择' + dataColumn.title,
},
],
{
required: required,
message: '请选择' + dataColumn.title,
},
],
})(
<Cascader // 这里的options 获取方式存在bug 公式会重复调用
options={options}
......@@ -3172,8 +3104,8 @@ ${obj[dataColumn.base52]}
getPopupContainer={
this.props.isDynamic && document.querySelector('#dynamic_div')
? () => {
return document.querySelector('#dynamic_div');
}
return document.querySelector('#dynamic_div');
}
: ''
}
placeholder={json.placeholder}
......@@ -3189,12 +3121,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择' + dataColumn.title,
},
],
})(<MobileCascader options={options} label={title} disabled={disabled} json={json}/>);
{
required: required,
message: '请选择' + dataColumn.title,
},
],
})(<MobileCascader options={options} label={title} disabled={disabled} json={json} />);
}
if (
......@@ -3208,7 +3140,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -3225,22 +3158,22 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
validator: (rule, value, callback) => {
let errors = [];
if (
(Object.keys(value).length == 0 ||
Object.keys(value.selects).length == 0) &&
required != null &&
required
) {
errors.push(new Error('请选择至少一个', rule.field));
}
callback(errors);
{
validator: (rule, value, callback) => {
let errors = [];
if (
(Object.keys(value).length == 0 ||
Object.keys(value.selects).length == 0) &&
required != null &&
required
) {
errors.push(new Error('请选择至少一个', rule.field));
}
callback(errors);
},
required: required,
},
required: required,
},
],
],
})(
<TableSelect
get={get}
......@@ -3264,7 +3197,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -3288,16 +3222,14 @@ ${obj[dataColumn.base52]}
if (!isEdit) {
cm = (
<span>
{moment(parseInt(obj[begin.base52]))
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '}
{moment(parseInt(obj[begin.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}{' '}
{' '}
{moment(parseInt(obj[end.base52]))
.format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}
</span>
{moment(parseInt(obj[end.base52])).format(
json.format ? json.format : 'YYYY-MM-DD HH:mm:ss',
)}
</span>
);
} else {
if (get === 'mobile') {
......@@ -3307,11 +3239,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择起止时间',
},
],
{
required: required,
message: '请选择起止时间',
},
],
})(
<MobileDate
disabled={disabled}
......@@ -3331,7 +3263,8 @@ ${obj[dataColumn.base52]}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}
required={required}>
required={required}
>
{cm}
</MobileItem>
);
......@@ -3346,17 +3279,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择起止时间',
},
],
})(
<RangePickerDiy
json={json}
disabled={disabled}
/>,
);
{
required: required,
message: '请选择起止时间',
},
],
})(<RangePickerDiy json={json} disabled={disabled} />);
}
if (json.label == null) title = '起止时间';
break;
......@@ -3383,11 +3311,11 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请选择起止时间',
},
],
{
required: required,
message: '请选择起止时间',
},
],
})(
<DatePicker
disabled={disabled}
......@@ -3398,22 +3326,21 @@ ${obj[dataColumn.base52]}
onOpenChange={
get === 'mobile'
? () => {
// 取消唤起移动端小键盘
setTimeout(() => {
if (document.querySelector('.ant-calendar-input ')) {
document
.querySelector('.ant-calendar-input ')
.setAttribute('readonly', 'readonly');
setTimeout(() => {
// 取消唤起移动端小键盘
setTimeout(() => {
if (document.querySelector('.ant-calendar-input ')) {
document
.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'}
{...otherProps}
......@@ -3430,7 +3357,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -3449,11 +3377,11 @@ ${obj[dataColumn.base52]}
json?.vlds && json?.vlds.length > 0
? json.vlds
: [
{
required,
message: '请进行签章',
},
],
{
required,
message: '请进行签章',
},
],
})(
<SignArray // 签章组件 编辑模式
json={json}
......@@ -3473,7 +3401,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -3523,7 +3452,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -3536,19 +3466,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请输入',
},
],
})(
<WangEditor
json={json}
dataColumn={dataColumn}
disabled={disabled}
uuid={uuid}
/>,
);
{
required: required,
message: '请输入',
},
],
})(<WangEditor json={json} dataColumn={dataColumn} disabled={disabled} uuid={uuid} />);
break;
case 'RichText':
cm = getFieldDecorator(dataColumn.base52, {
......@@ -3557,12 +3480,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请输入',
},
],
})(<DraftEditorCom placeholder={json.placeholder} disabled={json.disabled}/>);
{
required: required,
message: '请输入',
},
],
})(<DraftEditorCom placeholder={json.placeholder} disabled={json.disabled} />);
if (
get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) ||
......@@ -3574,7 +3497,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -3587,12 +3511,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请输入' + title,
},
],
})(<CronEditorDiy/>);
{
required: required,
message: '请输入' + title,
},
],
})(<CronEditorDiy />);
break;
case 'LocationCom':
cm = getFieldDecorator(dataColumn.base52, {
......@@ -3601,23 +3525,22 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required,
message: '请获取定位信息',
validator: (rule, valueThis, callback) => {
let errors = [];
console.log(valueThis);
if (
(!valueThis || !JSON.stringify(valueThis)
.includes('address')) &&
required
) {
errors.push(new Error('请获取定位信息', rule.field));
}
callback(errors);
{
required,
message: '请获取定位信息',
validator: (rule, valueThis, callback) => {
let errors = [];
console.log(valueThis);
if (
(!valueThis || !JSON.stringify(valueThis).includes('address')) &&
required
) {
errors.push(new Error('请获取定位信息', rule.field));
}
callback(errors);
},
},
},
],
],
})(
<LocationCom
get={get}
......@@ -3639,7 +3562,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -3688,7 +3612,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -3701,12 +3626,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请上传图片',
},
],
})(<ImgUploadCom json={json} disabled={disabled}/>);
{
required: required,
message: '请上传图片',
},
],
})(<ImgUploadCom json={json} disabled={disabled} />);
if (
get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) ||
......@@ -3718,7 +3643,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -3731,12 +3657,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请上传视频',
},
],
})(<VideoUploadCom json={json} disabled={disabled}/>);
{
required: required,
message: '请上传视频',
},
],
})(<VideoUploadCom json={json} disabled={disabled} />);
if (
get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) ||
......@@ -3748,7 +3674,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -3761,18 +3688,12 @@ ${obj[dataColumn.base52]}
json.vlds && json.vlds.length > 0
? json.vlds
: [
{
required: required,
message: '请进行签名',
},
],
})(
<Signature
width={json.width}
height={json.height}
get={get}
/>,
);
{
required: required,
message: '请进行签名',
},
],
})(<Signature width={json.width} height={json.height} get={get} />);
if (
get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) ||
......@@ -3784,7 +3705,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
);
......@@ -3828,13 +3750,15 @@ ${obj[dataColumn.base52]}
margin: 5,
border: '1px solid #ccc',
}}
className={styles.mobileList}>
className={styles.mobileList}
>
{modalCode ? (
<FormModal
{...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}>
title={modalTitle}
>
<ZdyTable
taskId={this.props.taskId}
taskAssignee={taskAssignee}
......@@ -3875,7 +3799,8 @@ ${obj[dataColumn.base52]}
style={{
minHeight: 40,
lineHeight: '40px',
}}>
}}
>
<Col
className={title ? styles.row_col_div : ''}
span={json.labelSpan}
......@@ -3886,7 +3811,8 @@ ${obj[dataColumn.base52]}
overflow: 'hidden',
fontSize: 14,
color: 'rgba(0,0,0,0.85)',
}}>
}}
>
{title}
{title && (
<span
......@@ -3895,9 +3821,10 @@ ${obj[dataColumn.base52]}
position: 'relative',
top: '-0.5px',
margin: '0 8px 0 2px',
}}>
:
</span>
}}
>
:
</span>
)}
</Col>
<Col
......@@ -3907,7 +3834,8 @@ ${obj[dataColumn.base52]}
lineHeight: '40px',
zoom: 1,
fontSize: 14,
}}>
}}
>
{cm}
</Col>
{modalCode ? (
......@@ -3915,7 +3843,8 @@ ${obj[dataColumn.base52]}
{...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}>
title={modalTitle}
>
<ZdyTable
taskId={this.props.taskId}
taskAssignee={taskAssignee}
......@@ -3951,7 +3880,8 @@ ${obj[dataColumn.base52]}
{...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}>
title={modalTitle}
>
<ZdyTable
taskId={this.props.taskId}
taskAssignee={taskAssignee}
......@@ -3981,8 +3911,9 @@ ${obj[dataColumn.base52]}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
data-cell-component-name={json.comName || 'no_com'}>
<ShowComName json={json}/>
data-cell-component-name={json.comName || 'no_com'}
>
<ShowComName json={json} />
{cm}
</Form.Item>
</>
......@@ -3996,7 +3927,8 @@ ${obj[dataColumn.base52]}
{...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}>
title={modalTitle}
>
<ZdyTable
taskId={this.props.taskId}
taskAssignee={taskAssignee}
......@@ -4034,7 +3966,8 @@ ${obj[dataColumn.base52]}
{...modalProps}
visible={this.props.DataColumn.isShowModal[modalCode]}
handleCancel={this.closeModal.bind(this, modalCode)}
title={modalTitle}>
title={modalTitle}
>
<ZdyTable
taskId={this.props.taskId}
taskAssignee={taskAssignee}
......@@ -4064,7 +3997,8 @@ ${obj[dataColumn.base52]}
isPreview={isPreview}
labelCol={{ span: json.mLabelSpan || json.labelSpan }}
wrapperCol={{ span: json.mWrapperSpan || json.wrapperSpan }}
label={title}>
label={title}
>
{cm}
</MobileItem>
) : isEdit && get == 'web' ? (
......@@ -4074,12 +4008,12 @@ ${obj[dataColumn.base52]}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
<ShowComName json={json}/>
<ShowComName json={json} />
{cm}
</Form.Item>
) : (
<Form.Item>
<ShowComName json={json}/>
<ShowComName json={json} />
{cm}
</Form.Item>
)
......
......@@ -139,4 +139,19 @@ export const queryIsBinary = () => queryConfig('IS_BINARY'); // 是否开启接
export const resetLoginUrl = () => queryConfig('resetLoginUrl'); // 是否退出登录注销token 解决北电科安全测评
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;
......@@ -8,68 +8,64 @@ const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(
const isUrl = (path) => reg.test(path);
const isAntDesignPro = () => {
if (ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site') {
return true;
}
if (ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site') {
return true;
}
return window.location.hostname === 'preview.pro.ant.design';
return window.location.hostname === 'preview.pro.ant.design';
}; // 给官方演示站点用,用于关闭真实开发环境不需要使用的特性
const isAntDesignProOrDev = () => {
const { NODE_ENV } = process.env;
const { NODE_ENV } = process.env;
if (NODE_ENV === 'development') {
return true;
}
if (NODE_ENV === 'development') {
return true;
}
return isAntDesignPro();
return isAntDesignPro();
};
export { isAntDesignProOrDev, isAntDesignPro, isUrl };
export const dispatch = (type, payload, callback) => {
window.g_app._store.dispatch({
type,
payload,
callback,
});
window.g_app._store.dispatch({
type,
payload,
callback,
});
};
export const isFromIframe = () => { // 判断是否来自iframe 嵌入页面 暂时放弃使用
return false;
let isFromIframe = window.frames.length !== parent.frames.length;
if (window.location.origin.indexOf('localhost') > -1) {
return false;
}
return isFromIframe;
export const isFromIframe = () => {
// 判断是否来自iframe 嵌入页面 暂时放弃使用
return false;
let isFromIframe = window.frames.length !== parent.frames.length;
if (window.location.origin.indexOf('localhost') > -1) {
return false;
}
return isFromIframe;
};
export const getModal = () => {
return isFromIframe() ? window?.parent?.iframeParentComponent?.Modal : Modal;
return isFromIframe() ? window?.parent?.iframeParentComponent?.Modal : Modal;
};
export const getPopconfirm = () => {
return isFromIframe() ? window?.parent?.iframeParentComponent?.Popconfirm : Popconfirm;
return isFromIframe() ? window?.parent?.iframeParentComponent?.Popconfirm : Popconfirm;
};
export const getMessage = () => {
return isFromIframe() ? window?.parent?.iframeParentComponent?.message : message;
return isFromIframe() ? window?.parent?.iframeParentComponent?.message : message;
};
export const getOneStopMyInfo = (params = {}) => {
return uaaRequest('/UserApi/getMy', params)
.then((res) => {
if (res) {
if (!res.groupsId) {
res.groupsId = 'pub';
}
return getTime()
.then((t) => {
res.differenceBetweenServerAndClientTime = t;
localStorage.setItem('user', JSON.stringify(res));
return res;
});
}
});
return uaaRequest('/UserApi/getMy', params).then((res) => {
if (res) {
if (!res.groupsId) {
res.groupsId = 'pub';
}
res.differenceBetweenServerAndClientTime = -50;
localStorage.setItem('user', JSON.stringify(res));
return res;
}
});
};
......@@ -2,7 +2,7 @@
import Editor from '@/webPublic/zyd_public/WangEditor/includes/wangEditor.min';
import { message } from 'antd';
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 { BtnMenu } = E;
......@@ -43,7 +43,7 @@ export default class PdfMenu extends BtnMenu {
.then((res) => {
setTimeout(() => {
if (res && res.length > 10) {
let url = queryApiActionPath() + res;
let url = queryFileUrl(res);
window.message.success('上传文件成功');
this.editor.txt.append(`
<p class='wangEditor-pdfReader'>
......
......@@ -6,7 +6,7 @@
import Editor from '@/webPublic/zyd_public/WangEditor/includes/wangEditor.min';
import { message } from 'antd';
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';
const E = Editor;
......@@ -38,7 +38,7 @@ export default class VideoMenu extends BtnMenu {
const fileName = file.name;
uploadFile(file).then((res) => {
if (res && res.length > 10) {
let url = queryApiActionPath() + res;
let url = queryFileUrl(res);
setTimeout(()=>{
window.message.success('上传成功');
this.editor.txt.append(`
......
......@@ -16,7 +16,7 @@
import React, { useState, useEffect } from 'react';
import WangEditor from './includes/wangEditor.min';
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 VideoMenu from '@/webPublic/zyd_public/WangEditor/DiyMenu/VideoMenu';
let editor = null;
......@@ -61,7 +61,7 @@ export default function Index({
// 重写上传图片的方法
uploadFile(resultFiles[0]).then((y) => {
if (y && y.length) {
insertImgFn(queryApiActionPath() + y);
insertImgFn(queryFileUrl(y));
}
});
// insertImgFn(imgUrl);
......
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 { isJSON } from '@/webPublic/one_stop_public/tableCompon/Split_Index/staticInfo';
......@@ -45,7 +45,7 @@ class MyMenu {
.then((res) => {
setTimeout(() => {
if (res && typeof res === 'string' && res.length > 10 && res.indexOf('errMsg') <= -1) {
let url = queryApiActionPath() + res;
let url = queryFileUrl(res);
message.success('上传文件成功');
const v = `<p class='wangEditor-pdfReader'><embed width='100%'
height='768px'
......
......@@ -8,7 +8,7 @@
import styles from './css/style.less';
import React, { useEffect, useState, useRef } from 'react';
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 loadCss from '@/webPublic/zyd_public/WangEditor/WangEditor5/css/cssLoader';
import myMenuConf from '@/webPublic/zyd_public/WangEditor/WangEditor5/DiyMenu/pdfMenu';
......@@ -58,7 +58,7 @@ function WangEditorReactComponent(props) {
uploadOnestopFile(fileNew).then((y) => {
// 使用一站式的文件上传接口
if (y && y.length) {
insertFn(queryApiActionPath() + y, file.name);
insertFn(queryFileUrl(y), file.name);
}
});
});
......
......@@ -10,16 +10,15 @@ export const getTime = () => {
method: 'POST',
body: {},
},
)
.then(t => {
if (t) {
return t - new Date().getTime(); // 服务器时间 与 客户端时间的差值;
} else {
return 0;
}
});
).then(t => {
if (t) {
return t - new Date().getTime(); // 服务器时间 与 客户端时间的差值;
} else {
return 0;
}
});
} else {
return new Promise((resolve) => {
return new Promise(resolve => {
resolve(0);
return 0;
});
......@@ -27,23 +26,19 @@ export const getTime = () => {
};
export async function queryCurrent() {
// let t = await getTime();
const config = window.specialImportantSystemConfig || {};
let token = getToken();
let userInfo = getCurrentUser();
if (token && userInfo.token === token) {
return new Promise((resolve) => {
return new Promise(resolve => {
resolve(userInfo);
return userInfo;
});
}
if (config.mockServer) {
return request(
`${config.mockServer}/${config.gateWayUrl.zydxg}/UserApi/queryCurrent`,
{
method: 'POST',
body: {},
},
);
return request(`${config.mockServer}/${config.gateWayUrl.zydxg}/UserApi/queryCurrent`, {
method: 'POST',
body: {},
});
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论