提交 789cb895 authored 作者: 钟是志's avatar 钟是志

泸职版本增加自定义表单 增加视频上传组件. 后台接口暂时用的雅职生产

token 获取方式 localstorage('uploadVideoServiceToken')
上级 4cfdf202
...@@ -55,6 +55,7 @@ import MobileDate from '../libs/MobileDate'; ...@@ -55,6 +55,7 @@ import MobileDate from '../libs/MobileDate';
import ChildForm from '../libs/ChildForm'; import ChildForm from '../libs/ChildForm';
import Neo4jD3Com from '../libs/Neo4jD3Com'; import Neo4jD3Com from '../libs/Neo4jD3Com';
import ImgUploadCom from '../libs/ImgUploadCom'; import ImgUploadCom from '../libs/ImgUploadCom';
import VideoUploadCom from "../libs/VideoUploadCom";
import moment from 'moment'; import moment from 'moment';
import router from 'umi/router'; import router from 'umi/router';
import TableList from '../libs/TableList'; import TableList from '../libs/TableList';
...@@ -63,21 +64,18 @@ import config from '@/webPublic/one_stop_public/config'; ...@@ -63,21 +64,18 @@ import config from '@/webPublic/one_stop_public/config';
import { isEmpty, isNaN, cloneDeep } from 'lodash'; import { isEmpty, isNaN, cloneDeep } from 'lodash';
import { queryApiActionPath } from '../utils/queryConfig'; import { queryApiActionPath } from '../utils/queryConfig';
import { extend } from 'umi-request'; import { extend } from 'umi-request';
import { date } from '../libs/formList/config';
import Highlighter from 'react-highlight-words'; import Highlighter from 'react-highlight-words';
import Signature from '../Signature'; import Signature from '../Signature';
import baseX from 'base-x';
import { changeToDraftState } from '../utils/myutils'; import { changeToDraftState } from '../utils/myutils';
const Bs64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
const base64 = baseX(Bs64);
import { Base16Encode } from '../Base16/index'; import { Base16Encode } from '../Base16/index';
import { getToken } from '../utils/token'; import { getToken } from '../utils/token';
import { formulaList } from '../excelInitFuc/functionList'; import { formulaList } from '../excelInitFuc/functionList';
import FilePreview from '../filePreview'; import FilePreview from '../filePreview';
import DraftEditorCom from '../App/DraftEditorCom'; import DraftEditorCom from '../App/DraftEditorCom';
import MobileItem from './MobileItem'; import MobileItem from './MobileItem';
const Item = MobileList.Item; const Bs64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
const Brief = Item.Brief; const base64 = baseX(Bs64);
function getBase64(value) { function getBase64(value) {
return value ? base64.encode(new Buffer(value)) : null; return value ? base64.encode(new Buffer(value)) : null;
} }
...@@ -1712,6 +1710,22 @@ export default class tableCom extends Component { ...@@ -1712,6 +1710,22 @@ export default class tableCom extends Component {
); );
} }
break;
case 'VideoUploadCom':
if (value == null || value == '') {
cm = <div style={{ width: json.width, height: json.height }}>
</div>;
} else {
cm = (
<>
<img
src={config.httpServer + value}
style={{ width: json.width, height: json.height }}
/>
{get === 'mobile' ? <br /> : ''}
</>
);
}
break; break;
} }
if (get === 'mobile') { if (get === 'mobile') {
...@@ -2186,7 +2200,35 @@ export default class tableCom extends Component { ...@@ -2186,7 +2200,35 @@ export default class tableCom extends Component {
break; break;
case 'ImgUploadCom': case 'ImgUploadCom':
if (obj[dataColumn.base52] == null || obj[dataColumn.base52] == '') { if (obj[dataColumn.base52] == null || obj[dataColumn.base52] == '') {
cm = <div style={{ width: json.width, height: json.height }}></div>; cm = <div style={{
width: json.width,
height: json.height}}>
</div>;
} else {
cm = FilePreview ? (
<FilePreview
path={config.httpServer + obj[dataColumn.base52]}
pathName={obj[dataColumn.base52]}
width={json.width}
height={json.height}
/>
) : (
<img
src={config.httpServer + obj[dataColumn.base52]}
style={{ width: json.width, height: json.height }}
/>
);
}
break;
case 'VideoUploadCom':
if (obj[dataColumn.base52] == null || obj[dataColumn.base52] == '') {
cm = <div style={{
width: json.width,
height: json.height }}>
</div>;
} else { } else {
cm = FilePreview ? ( cm = FilePreview ? (
<FilePreview <FilePreview
...@@ -3049,6 +3091,34 @@ export default class tableCom extends Component { ...@@ -3049,6 +3091,34 @@ export default class tableCom extends Component {
); );
} }
break; break;
case 'VideoUploadCom':
cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue,
rules:
json.vlds && json.vlds.length > 0
? json.vlds
: [{ required: required, message: '请上传视频' }],
})(<VideoUploadCom json={json}
disabled={disabled}
/>);
if (
get === 'mobile' &&
((json.isMobileLabel != null && json.isMobileLabel) ||
(json.isMobileLabel == null && json.isLabel)) &&
title
) {
cm = (
<MobileItem
isPreview={isPreview}
labelCol={{ span: json.labelSpan }}
wrapperCol={{ span: json.wrapperSpan }}
label={title}
>
{cm}
</MobileItem>
);
}
break;
case 'Signature': case 'Signature':
cm = getFieldDecorator(dataColumn.base52, { cm = getFieldDecorator(dataColumn.base52, {
initialValue: initValue, initialValue: initValue,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论