Commit 9e7a38dc by fanyj

tijiao

parent d859bbdf
...@@ -188,7 +188,89 @@ export class App extends React.Component { ...@@ -188,7 +188,89 @@ export class App extends React.Component {
return ( return (
<AppContext.Provider value={{ <AppContext.Provider value={{
env: hostParams?.env, env: hostParams?.env||{
"options": null,
"domainId": 1747334554,
"domainName": "默认",
"catalogs": [
{
"catalogId": 1,
"catalogName": "domain0",
"scopes": [
{
"scopeId": 1,
"scopeName": "DB"
}
]
}
],
"label": "默认",
"title": "默认",
"key": "domain-1747334554",
"value": 1747334554,
"children": [
{
"catalogId": 1,
"catalogInfo": {
"catalogId": 1,
"catalogName": "domain0",
"scopes": [
{
"scopeId": 1,
"scopeName": "DB"
}
]
},
"catalogName": "domain0",
"label": "domain0",
"title": "domain0",
"key": "catalog-1-1747334554",
"value": 1,
"domain": 1747334554,
"disabled": true,
"children": [
{
"scopeId": 1,
"scopeName": "DB",
"label": "DB",
"title": "DB",
"key": "system-1",
"value": 1,
"catalog": 1,
"domainId": 1747334554,
"catalogInfo": {
"catalogId": 1,
"catalogName": "domain0",
"scopes": [
{
"scopeId": 1,
"scopeName": "DB"
}
]
},
"prevnode": null,
"nextnode": null,
"domain": {
"domainId": 1747334554,
"domainName": "默认",
"catalogs": [
{
"catalogId": 1,
"catalogName": "domain0",
"scopes": [
{
"scopeId": 1,
"scopeName": "DB"
}
]
}
]
}
}
]
}
]
},
user: hostParams?.user, user: hostParams?.user,
hostParams, hostParams,
onGlobalStateChange onGlobalStateChange
......
...@@ -4,6 +4,7 @@ import { UploadOutlined } from '@ant-design/icons'; ...@@ -4,6 +4,7 @@ import { UploadOutlined } from '@ant-design/icons';
import { dispatch } from '../../../../model'; import { dispatch } from '../../../../model';
import { showMessage } from '../../../../util'; import { showMessage } from '../../../../util';
import UploadFile from './UploadFile';
const { Option } = Select; const { Option } = Select;
...@@ -81,7 +82,6 @@ const UpdateDatasourceModal = (props) => { ...@@ -81,7 +82,6 @@ const UpdateDatasourceModal = (props) => {
_currentTypies = {...typies}; _currentTypies = {...typies};
} }
}) })
console.log(_currentTypies)
setCurrentSupportedDatasourceTypies(_currentTypies); setCurrentSupportedDatasourceTypies(_currentTypies);
} }
...@@ -319,16 +319,22 @@ const UpdateDatasourceModal = (props) => { ...@@ -319,16 +319,22 @@ const UpdateDatasourceModal = (props) => {
rules={[{ required: item.required, message: '必填项'}]} rules={[{ required: item.required, message: '必填项'}]}
> >
{ item.selectMode==='file' ? ( { item.selectMode==='file' ? (
<Upload <UploadFile
onRemove={(file) => { onRemoveFile(item.name, file); }} onRemoveFile={onRemoveFile}
beforeUpload={(file) => { beforeUpload(item.name, file); }} beforeUpload={beforeUpload}
fileList={_fileList} fileList={_fileList}
// accept='.txt' name={item.name}
> />
<Button icon={<UploadOutlined />}> // <Upload
选择文件上传 // onRemove={(file) => { onRemoveFile(item.name, file); }}
</Button> // beforeUpload={(file) => { beforeUpload(item.name, file); }}
</Upload> // fileList={_fileList}
// // accept='.txt'
// >
// <Button icon={<UploadOutlined />}>
// 选择文件上传
// </Button>
// </Upload>
) : ( item.show ? <Input placeholder={item.explain||''} /> : <Input.Password placeholder={item.explain||''} visibilityToggle={false} /> ) } ) : ( item.show ? <Input placeholder={item.explain||''} /> : <Input.Password placeholder={item.explain||''} visibilityToggle={false} /> ) }
</Form.Item> </Form.Item>
) )
......
import React from 'react';
import { Upload, Button } from 'antd';
import { UploadOutlined } from '@ant-design/icons';
const UploadFile: React.FC<any> = (props) => {
const {value,onRemoveFile,name,beforeUpload,fileList} = props
console.log('valueinfo',value)
return (
<Upload
onRemove={(file) => { onRemoveFile(name, file); }}
beforeUpload={(file) => { beforeUpload(name, file); }}
fileList={fileList}
// accept='.txt'
>
<Button icon={<UploadOutlined />}>
选择文件上传
</Button>
<div style={{marginLeft:10,display:'inline-block'}}>{value?'已有上传文件':''}</div>
</Upload>
);
};
export default UploadFile;
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment