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

代理修改

上级 3979db01
/** /**
* web端文件预览功能 * web端文件预览功能
*/ */
import React, {Component} from 'react'; import React, { Component } from 'react';
import {checkIsImage} from '@/webPublic/one_stop_public/libs/UploadCom'; import { checkIsImage } from '@/webPublic/one_stop_public/libs/UploadCom';
import { getModal, getPopconfirm, isFromIframe } from '@/webPublic/one_stop_public/utils/utils'; import { getModal, getPopconfirm, isFromIframe } from '@/webPublic/one_stop_public/utils/utils';
// const FileViewer = CLIENT_TYPE === 'mobile' ? null : require('react-file-viewer'); // const FileViewer = CLIENT_TYPE === 'mobile' ? null : require('react-file-viewer');
...@@ -21,7 +21,7 @@ export default class index extends Component { ...@@ -21,7 +21,7 @@ export default class index extends Component {
} }
showModal = () => { showModal = () => {
if(isFromIframe()){ if (isFromIframe()) {
return false; return false;
} }
this.setState({ this.setState({
...@@ -41,18 +41,26 @@ export default class index extends Component { ...@@ -41,18 +41,26 @@ export default class index extends Component {
}); });
}; };
download = () => { download = () => {
let {path, pathName} = this.props; let {
if(window?.parent?.open && typeof window.parent.open === 'function'){ path,
pathName
} = this.props;
if (window?.parent?.open && typeof window.parent.open === 'function') {
window.parent.open(path, '_blank'); window.parent.open(path, '_blank');
}else{ } else {
window.open(path, '_blank'); window.open(path, '_blank');
} }
}; };
render() { render() {
let {path, pathName, width, height} = this.props; let {
path,
pathName,
width,
height
} = this.props;
const {visible} = this.state; const { visible } = this.state;
let isShow = false; let isShow = false;
let type; let type;
let isImg = checkIsImage(pathName); let isImg = checkIsImage(pathName);
...@@ -77,15 +85,17 @@ export default class index extends Component { ...@@ -77,15 +85,17 @@ export default class index extends Component {
<> <>
{isShow ? ( {isShow ? (
<Popconfirm <Popconfirm
title='查看附件' title="查看附件"
onConfirm={this.download} onConfirm={this.download}
okText='下载' okText="下载"
onCancel={this.showModal} onCancel={this.showModal}
cancelText={ isFromIframe() ? '取消' : '预览'}> cancelText={isFromIframe() ? '取消' : '预览'}>
{isImg ? ( {isImg ? (
<img <img
ref={(node)=>{ this.imageDom = node;}} ref={(node) => {
this.imageDom = node;
}}
style={{ style={{
width: width ? width : '100px', width: width ? width : '100px',
height: height ? height : 'auto', height: height ? height : 'auto',
...@@ -94,13 +104,13 @@ export default class index extends Component { ...@@ -94,13 +104,13 @@ export default class index extends Component {
alt={pathName} alt={pathName}
/> />
) : ( ) : (
<a target='_blank' href={path}> <a target="_blank" href={path}>
{pathName} {pathName}
</a> </a>
)} )}
</Popconfirm> </Popconfirm>
) : ( ) : (
<a target='_blank' href={path}> <a target="_blank" href={path}>
{pathName} {pathName}
</a> </a>
)} )}
...@@ -131,6 +141,10 @@ export default class index extends Component { ...@@ -131,6 +141,10 @@ export default class index extends Component {
<a onClick={this.download}> <a onClick={this.download}>
下载文件 下载文件
</a> </a>
{
!!checkIsImage(path) &&
<img src={path} style={{ maxWidth: '100%', }}/>
}
{/* {FileViewer && ( {/* {FileViewer && (
<FileViewer <FileViewer
fileType={type} fileType={type}
......
...@@ -21,7 +21,7 @@ export function checkIsImage(path) { ...@@ -21,7 +21,7 @@ export function checkIsImage(path) {
} }
let p = path.toLowerCase(); let p = path.toLowerCase();
let find = ['.jpg', '.png', '.jpeg', '.bmp', '.gif', '.bmp', '.svg'].find((x) => { let find = ['.jpg', '.png', '.jpeg', '.bmp', '.gif', '.bmp', '.svg'].find((x) => {
return path.indexOf(x) > -1; return p.indexOf(x) > -1;
}); });
return !!find; return !!find;
} }
......
...@@ -234,11 +234,11 @@ export default class TableCom extends Component { ...@@ -234,11 +234,11 @@ export default class TableCom extends Component {
}} }}
/> />
<Button <Button
type='primary' type="primary"
onClick={() => this.handleSearch(selectedKeys, confirm)} onClick={() => this.handleSearch(selectedKeys, confirm)}
icon='search' icon="search"
loading={this.props.loading} loading={this.props.loading}
size='small' size="small"
style={{ style={{
width: 90, width: 90,
marginRight: 8, marginRight: 8,
...@@ -248,14 +248,14 @@ export default class TableCom extends Component { ...@@ -248,14 +248,14 @@ export default class TableCom extends Component {
<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]
...@@ -863,7 +863,7 @@ export default class TableCom extends Component { ...@@ -863,7 +863,7 @@ export default class TableCom extends Component {
}; };
sqlUtil = (base52, json, orgCallback, sqlKey, params, p1, p2, p3) => { sqlUtil = (base52, json, orgCallback, sqlKey, params, p1, p2, p3) => {
let callback = p1; let callback = p1;
let options = p2 || {}; let options = typeof p2 === 'undefined' ? {} : p2;
let otherParams = {}; let otherParams = {};
if (p1 && typeof p1 === 'object') { if (p1 && typeof p1 === 'object') {
callback = p2; callback = p2;
...@@ -892,7 +892,8 @@ export default class TableCom extends Component { ...@@ -892,7 +892,8 @@ export default class TableCom extends Component {
} }
if (!isChange) { if (!isChange) {
const os = sqlKeys[sqlKey].options; const os = sqlKeys[sqlKey].options;
if (Object.keys(options).length != Object.keys(os).length) { if (JSON.stringify(options) !== JSON.stringify(os)) {
sqlKeys[sqlKey].options = options;
isChange = true; isChange = true;
} else { } else {
for (var k in options) { for (var k in options) {
...@@ -976,7 +977,7 @@ export default class TableCom extends Component { ...@@ -976,7 +977,7 @@ export default class TableCom extends Component {
...this.props.defaultValues[this.props.formKey], ...this.props.defaultValues[this.props.formKey],
...options, ...options,
}); });
console.log(JSON.stringify(allValues));
let pp = { let pp = {
sqlKey, sqlKey,
...@@ -1124,7 +1125,7 @@ export default class TableCom extends Component { ...@@ -1124,7 +1125,7 @@ export default class TableCom extends Component {
this.props.fatherCode, this.props.fatherCode,
{ // utils函数的参数 { // utils函数的参数
moment, moment,
sql: this.sqlUtil.bind(this, base52, json, callback), sql: this.sqlUtil.bind(this, base52, json, callback), // utils.sql xxx
message, message,
importExcel: this.props.importExcel, importExcel: this.props.importExcel,
router: router, router: router,
...@@ -1248,7 +1249,7 @@ export default class TableCom extends Component { ...@@ -1248,7 +1249,7 @@ export default class TableCom extends Component {
isMeta, isMeta,
filterSql, filterSql,
} = json; } = json;
if(isMeta){ // 2022年7月5日 2022 姚鑫国说的 如果是元数据 不需要传这个allValues if (isMeta) { // 2022年7月5日 2022 姚鑫国说的 如果是元数据 不需要传这个allValues
// 解决禅道bug 28017 // 解决禅道bug 28017
allValues = {}; allValues = {};
} }
...@@ -1259,9 +1260,9 @@ export default class TableCom extends Component { ...@@ -1259,9 +1260,9 @@ export default class TableCom extends Component {
allValues, allValues,
isMeta, isMeta,
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;
} }
...@@ -1308,10 +1309,10 @@ export default class TableCom extends Component { ...@@ -1308,10 +1309,10 @@ export default class TableCom extends Component {
valueName, valueName,
allValues, allValues,
isMeta, isMeta,
} };
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;
} }
...@@ -1337,7 +1338,7 @@ export default class TableCom extends Component { ...@@ -1337,7 +1338,7 @@ 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({
...@@ -1576,7 +1577,7 @@ export default class TableCom extends Component { ...@@ -1576,7 +1577,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 (
...@@ -1592,7 +1593,7 @@ export default class TableCom extends Component { ...@@ -1592,7 +1593,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') {
...@@ -1607,7 +1608,7 @@ export default class TableCom extends Component { ...@@ -1607,7 +1608,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}
...@@ -1683,7 +1684,7 @@ export default class TableCom extends Component { ...@@ -1683,7 +1684,7 @@ 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' : '',
...@@ -1699,7 +1700,7 @@ export default class TableCom extends Component { ...@@ -1699,7 +1700,7 @@ 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' : '',
...@@ -1747,7 +1748,7 @@ export default class TableCom extends Component { ...@@ -1747,7 +1748,7 @@ export default class TableCom extends Component {
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;
...@@ -1755,7 +1756,7 @@ export default class TableCom extends Component { ...@@ -1755,7 +1756,7 @@ export default class TableCom extends Component {
cm = ( cm = (
<span> <span>
{value} {value}
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br/> : ''}
</span> </span>
); );
...@@ -1773,7 +1774,7 @@ export default class TableCom extends Component { ...@@ -1773,7 +1774,7 @@ export default class TableCom extends Component {
cm = ( cm = (
<span style={{ paddingRight: get == 'mobile' ? 8 : '' }}> <span style={{ paddingRight: get == 'mobile' ? 8 : '' }}>
{value} {value}
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br/> : ''}
</span> </span>
); );
...@@ -1782,7 +1783,7 @@ export default class TableCom extends Component { ...@@ -1782,7 +1783,7 @@ export default class TableCom extends Component {
cm = ( cm = (
<span> <span>
{value} {value}
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br/> : ''}
</span> </span>
); );
...@@ -1792,7 +1793,7 @@ export default class TableCom extends Component { ...@@ -1792,7 +1793,7 @@ export default class TableCom extends Component {
<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>
) : ( ) : (
'' ''
...@@ -1807,14 +1808,14 @@ export default class TableCom extends Component { ...@@ -1807,14 +1808,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={queryApiActionPath() + f.path}>
{f.name} {f.name}
</a> </a>
</li> </li>
); );
})} })}
</ul> </ul>
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br/> : ''}
</> </>
); );
...@@ -1827,14 +1828,14 @@ export default class TableCom extends Component { ...@@ -1827,14 +1828,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={queryApiActionPath() + f.path}>
{f.name} {f.name}
</a> </a>
</li> </li>
); );
})} })}
</ul> </ul>
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br/> : ''}
</> </>
); );
...@@ -1859,7 +1860,7 @@ export default class TableCom extends Component { ...@@ -1859,7 +1860,7 @@ export default class TableCom extends Component {
height: json.height, height: json.height,
}} }}
/> />
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br/> : ''}
</> </>
); );
} }
...@@ -1885,7 +1886,7 @@ export default class TableCom extends Component { ...@@ -1885,7 +1886,7 @@ export default class TableCom extends Component {
height: json.height, height: json.height,
}} }}
/> />
{get === 'mobile' ? <br /> : ''} {get === 'mobile' ? <br/> : ''}
</> </>
); );
} }
...@@ -1918,7 +1919,7 @@ export default class TableCom extends Component { ...@@ -1918,7 +1919,7 @@ export default class TableCom extends Component {
</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"/>)}
</> </>
); );
} }
...@@ -1931,7 +1932,7 @@ export default class TableCom extends Component { ...@@ -1931,7 +1932,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"/>)}
</> </>
); );
} }
...@@ -2018,7 +2019,7 @@ export default class TableCom extends Component { ...@@ -2018,7 +2019,7 @@ export default class TableCom extends Component {
</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"/>)}
</> </>
); );
} }
...@@ -2031,7 +2032,7 @@ export default class TableCom extends Component { ...@@ -2031,7 +2032,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"/>)}
</> </>
); );
} }
...@@ -2125,7 +2126,7 @@ export default class TableCom extends Component { ...@@ -2125,7 +2126,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
...@@ -2228,7 +2229,7 @@ ${obj[dataColumn.base52]} ...@@ -2228,7 +2229,7 @@ ${obj[dataColumn.base52]}
<Table <Table
get={get} get={get}
columns={this.state.columns} columns={this.state.columns}
size='small' size="small"
dataSource={ds} dataSource={ds}
pagination={false} pagination={false}
/> />
...@@ -2400,7 +2401,7 @@ ${obj[dataColumn.base52]} ...@@ -2400,7 +2401,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={queryApiActionPath() + f.path}>
{f.name} {f.name}
</a> </a>
</li> </li>
...@@ -2437,7 +2438,7 @@ ${obj[dataColumn.base52]} ...@@ -2437,7 +2438,7 @@ ${obj[dataColumn.base52]}
return ( return (
<li key={index2}> <li key={index2}>
<a <a
target='_blank' target="_blank"
key={f.filePath} key={f.filePath}
href={queryApiActionPath() + f.filePath}> href={queryApiActionPath() + f.filePath}>
{f.fileName} {f.fileName}
...@@ -2595,7 +2596,7 @@ ${obj[dataColumn.base52]} ...@@ -2595,7 +2596,7 @@ ${obj[dataColumn.base52]}
if (json.isLink) { if (json.isLink) {
cm = <a {...ev} />; cm = <a {...ev} />;
} else { } else {
cm = <Button loading={this.props.loading} type='primary' {...ev} />; cm = <Button loading={this.props.loading} type="primary" {...ev} />;
} }
} }
...@@ -2678,7 +2679,7 @@ ${obj[dataColumn.base52]} ...@@ -2678,7 +2679,7 @@ ${obj[dataColumn.base52]}
if (json.isLink) { if (json.isLink) {
cm = <a {...ev} />; cm = <a {...ev} />;
} else { } else {
cm = <Button loading={this.props.loading} type='primary' {...ev} />; cm = <Button loading={this.props.loading} type="primary" {...ev} />;
} }
} }
...@@ -2740,7 +2741,7 @@ ${obj[dataColumn.base52]} ...@@ -2740,7 +2741,7 @@ ${obj[dataColumn.base52]}
}, },
], ],
})( })(
<SwitchWeb json={json} disabled={disabled} />, <SwitchWeb json={json} disabled={disabled}/>,
); );
break; break;
...@@ -2876,7 +2877,7 @@ ${obj[dataColumn.base52]} ...@@ -2876,7 +2877,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':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
...@@ -2935,7 +2936,7 @@ ${obj[dataColumn.base52]} ...@@ -2935,7 +2936,7 @@ ${obj[dataColumn.base52]}
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 (
...@@ -2962,7 +2963,7 @@ ${obj[dataColumn.base52]} ...@@ -2962,7 +2963,7 @@ ${obj[dataColumn.base52]}
case 'Checkbox': case 'Checkbox':
if (get === 'mobile') { if (get === 'mobile') {
cm = ( cm = (
<Flex direction='column' align='start'> <Flex direction="column" align="start">
{getFieldDecorator(dataColumn.base52, { {getFieldDecorator(dataColumn.base52, {
initialValue: initValue, // 默认值 initialValue: initValue, // 默认值
rules: rules:
...@@ -2974,7 +2975,7 @@ ${obj[dataColumn.base52]} ...@@ -2974,7 +2975,7 @@ ${obj[dataColumn.base52]}
message: '请选择' + dataColumn.title, message: '请选择' + dataColumn.title,
}, },
], ],
})(<Checkbox.Group options={options} disabled={disabled} />)} })(<Checkbox.Group options={options} disabled={disabled}/>)}
</Flex> </Flex>
); );
...@@ -3044,7 +3045,7 @@ ${obj[dataColumn.base52]} ...@@ -3044,7 +3045,7 @@ ${obj[dataColumn.base52]}
disabled={selectDis || disabled} disabled={selectDis || disabled}
placeholder={json.placeholder} placeholder={json.placeholder}
style={{ width: json.width }} style={{ width: json.width }}
optionFilterProp='children' optionFilterProp="children"
getPopupContainer={ getPopupContainer={
this.props.isDynamic && document.querySelector('#dynamic_div') this.props.isDynamic && document.querySelector('#dynamic_div')
? () => { ? () => {
...@@ -3174,7 +3175,7 @@ ${obj[dataColumn.base52]} ...@@ -3174,7 +3175,7 @@ ${obj[dataColumn.base52]}
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 (
...@@ -3542,7 +3543,7 @@ ${obj[dataColumn.base52]} ...@@ -3542,7 +3543,7 @@ ${obj[dataColumn.base52]}
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) ||
...@@ -3572,7 +3573,7 @@ ${obj[dataColumn.base52]} ...@@ -3572,7 +3573,7 @@ ${obj[dataColumn.base52]}
message: '请输入' + title, message: '请输入' + title,
}, },
], ],
})(<CronEditorDiy />); })(<CronEditorDiy/>);
break; break;
case 'LocationCom': case 'LocationCom':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
...@@ -3686,7 +3687,7 @@ ${obj[dataColumn.base52]} ...@@ -3686,7 +3687,7 @@ ${obj[dataColumn.base52]}
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) ||
...@@ -3716,7 +3717,7 @@ ${obj[dataColumn.base52]} ...@@ -3716,7 +3717,7 @@ ${obj[dataColumn.base52]}
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) ||
...@@ -3962,7 +3963,7 @@ ${obj[dataColumn.base52]} ...@@ -3962,7 +3963,7 @@ ${obj[dataColumn.base52]}
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>
</> </>
...@@ -4054,12 +4055,12 @@ ${obj[dataColumn.base52]} ...@@ -4054,12 +4055,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>
) )
......
...@@ -44,7 +44,7 @@ const queryConfig = (key) => { ...@@ -44,7 +44,7 @@ const queryConfig = (key) => {
if (typeof key === 'undefined') return dynamicConfig; if (typeof key === 'undefined') return dynamicConfig;
if(dynamicConfig[key] && typeof dynamicConfig[key] === 'string' && process.env.NODE_ENV === 'development'){ if(dynamicConfig[key] && typeof dynamicConfig[key] === 'string' && process.env.NODE_ENV === 'development'){
let url = dynamicConfig[key]; let url = dynamicConfig[key];
url = url.replace('https://yx.bpi.edu.cn/produce', 'http://localhost:8000/produce'); url = url.replace('https://yx.bpi.edu.cn/produce', 'http://localhost:8010/produce');
url = url.replace('http://scjoyedu.eicp.net:51352/produce', 'http://localhost:8000/produce'); url = url.replace('http://scjoyedu.eicp.net:51352/produce', 'http://localhost:8000/produce');
return url; return url;
} }
......
...@@ -14,6 +14,9 @@ export function setToken(value, time) { ...@@ -14,6 +14,9 @@ export function setToken(value, time) {
localStorage.setItem('wisdom-school-token', value); localStorage.setItem('wisdom-school-token', value);
return getOneStopMyInfo(); return getOneStopMyInfo();
} else { } else {
if (value && value.length > 10) {
setCookie('token', value, 1);
}
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
resolve(true); resolve(true);
}); });
...@@ -65,22 +68,18 @@ export const getUserInfo = () => { ...@@ -65,22 +68,18 @@ export const getUserInfo = () => {
}; };
export function setFetchUrl(data) { export function setFetchUrl(data) {
return localStorage.setItem('fetch-url-data', data); return localStorage.setItem('fetch-url-data', data);
} }
export function getFetchUrl() { export function getFetchUrl() {
return localStorage.getItem('fetch-url-data'); return localStorage.getItem('fetch-url-data');
} }
export function getType() { export function getType() {
return localStorage.getItem('antd-pro-type') || ''; return localStorage.getItem('antd-pro-type') || '';
} }
export function setType(type) { export function setType(type) {
return localStorage.setItem('antd-pro-type', type); return localStorage.setItem('antd-pro-type', type);
} }
...@@ -93,8 +92,8 @@ export function getCurrentUser() { ...@@ -93,8 +92,8 @@ export function getCurrentUser() {
} }
} }
export function setCurrentUser(v){ export function setCurrentUser(v) {
if(v && typeof v === 'object'){ if (v && typeof v === 'object') {
sessionStorage.setItem('currentUser', JSON.stringify(v)); sessionStorage.setItem('currentUser', JSON.stringify(v));
} }
} }
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论