| @@ -16,8 +16,8 @@ export default { | |||||
| '/api/': { | '/api/': { | ||||
| // 要代理的地址 | // 要代理的地址 | ||||
| // target: 'http://172.20.32.181:31205', | // target: 'http://172.20.32.181:31205', | ||||
| // target: 'http://172.20.32.98:8082', | |||||
| target: 'http://172.20.32.150:8082', | |||||
| target: 'http://172.20.32.98:8082', | |||||
| // target: 'http://172.20.32.150:8082', | |||||
| // 配置了这个可以从 http 代理到 https | // 配置了这个可以从 http 代理到 https | ||||
| // 依赖 origin 的功能可能需要这个,比如 cookie | // 依赖 origin 的功能可能需要这个,比如 cookie | ||||
| changeOrigin: true, | changeOrigin: true, | ||||
| @@ -223,36 +223,50 @@ | |||||
| flex: 1; | flex: 1; | ||||
| flex-wrap: wrap; | flex-wrap: wrap; | ||||
| align-content: flex-start; | align-content: flex-start; | ||||
| width: 100%; | |||||
| width: 103%; | |||||
| .dataItem { | .dataItem { | ||||
| position: relative; | position: relative; | ||||
| width: 32%; | |||||
| height: 66px; | |||||
| margin: 0 15px 18px 0; | |||||
| background: rgba(128, 128, 128, 0.05); | |||||
| border-radius: 8px; | |||||
| box-shadow: 0px 0px 12px rgba(75, 84, 137, 0.05); | |||||
| width: 23%; | |||||
| height:164px; | |||||
| background:#ffffff; | |||||
| border:1px solid; | |||||
| border-color:#eaeaea; | |||||
| border-radius:4px; | |||||
| margin: 0 20px 25px 0; | |||||
| cursor: pointer; | cursor: pointer; | ||||
| .itemText { | .itemText { | ||||
| position: absolute; | position: absolute; | ||||
| top: 10px; | |||||
| top: 20px; | |||||
| left: 20px; | left: 20px; | ||||
| color: #1d1d20; | color: #1d1d20; | ||||
| font-size: 15px; | |||||
| font-size: 16px; | |||||
| } | |||||
| .itemDescripition{ | |||||
| position: absolute; | |||||
| top: 57px; | |||||
| left: 20px; | |||||
| padding-right: 28px; | |||||
| color:#575757; | |||||
| font-size:14px; | |||||
| word-break: break-all; | |||||
| overflow: hidden; | |||||
| display: -webkit-box; | |||||
| -webkit-line-clamp: 2; | |||||
| -webkit-box-orient: vertical; | |||||
| } | } | ||||
| .itemTime { | .itemTime { | ||||
| position: absolute; | position: absolute; | ||||
| bottom: 10px; | |||||
| bottom: 22px; | |||||
| left: 20px; | left: 20px; | ||||
| color: #808080; | color: #808080; | ||||
| font-size: 14px; | |||||
| font-size: 13px; | |||||
| } | } | ||||
| .itemIcon { | .itemIcon { | ||||
| position: absolute; | position: absolute; | ||||
| right: 20px; | right: 20px; | ||||
| bottom: 10px; | |||||
| bottom: 22px; | |||||
| color: #808080; | color: #808080; | ||||
| font-size: 14px; | |||||
| font-size: 13px; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -269,8 +269,9 @@ const PublicData = (React.FC = () => { | |||||
| return ( | return ( | ||||
| <div className={Styles.dataItem} onClick={(e) => routeToIntro(e, item)}> | <div className={Styles.dataItem} onClick={(e) => routeToIntro(e, item)}> | ||||
| <div className={Styles.itemText}>{item.name}</div> | <div className={Styles.itemText}>{item.name}</div> | ||||
| <div className={Styles.itemDescripition}>{item.description}</div> | |||||
| <div className={Styles.itemTime}> | <div className={Styles.itemTime}> | ||||
| <span>最近更新: {moment(item.update_time).format('YYYY-MM-DD')}</span> | |||||
| <span>{item.create_by}</span> | |||||
| </div> | </div> | ||||
| <div className={Styles.itemIcon}> | <div className={Styles.itemIcon}> | ||||
| <img | <img | ||||
| @@ -278,7 +279,7 @@ const PublicData = (React.FC = () => { | |||||
| src={`/assets/images/upload-icon.png`} | src={`/assets/images/upload-icon.png`} | ||||
| alt="" | alt="" | ||||
| /> | /> | ||||
| <span>1582</span> | |||||
| <span>最近更新: {moment(item.update_time).format('YYYY-MM-DD')}</span> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| ); | ); | ||||
| @@ -101,22 +101,32 @@ const EditPipeline = () => { | |||||
| openParamsDrawer(); | openParamsDrawer(); | ||||
| return; | return; | ||||
| } | } | ||||
| const data = graph.save(); | |||||
| console.log(data); | |||||
| const params = { | |||||
| ...locationParams, | |||||
| dag: JSON.stringify(data), | |||||
| global_param: JSON.stringify(res.global_param), | |||||
| }; | |||||
| saveWorkflow(params).then((ret) => { | |||||
| message.success('保存成功'); | |||||
| closeParamsDrawer(); | |||||
| setTimeout(() => { | |||||
| if (val) { | |||||
| navgite({ pathname: `/pipeline` }); | |||||
| } | |||||
| }, 500); | |||||
| }); | |||||
| const [propsRes, propsError] = await to(propsRef.current.getFieldsValue()); | |||||
| console.log(await to(propsRef.current.getFieldsValue())); | |||||
| if (propsError) { | |||||
| message.error('基本信息必填项需配置'); | |||||
| // handlerClick(); | |||||
| return; | |||||
| } | |||||
| propsRef.current.propClose(); | |||||
| setTimeout(() => { | |||||
| const data = graph.save(); | |||||
| console.log(data); | |||||
| const params = { | |||||
| ...locationParams, | |||||
| dag: JSON.stringify(data), | |||||
| global_param: JSON.stringify(res.global_param), | |||||
| }; | |||||
| saveWorkflow(params).then((ret) => { | |||||
| message.success('保存成功'); | |||||
| closeParamsDrawer(); | |||||
| setTimeout(() => { | |||||
| if (val) { | |||||
| navgite({ pathname: `/pipeline` }); | |||||
| } | |||||
| }, 500); | |||||
| }); | |||||
| }, 500); | |||||
| }; | }; | ||||
| const handlerClick = (e) => { | const handlerClick = (e) => { | ||||
| e.stopPropagation(); | e.stopPropagation(); | ||||
| @@ -1,5 +1,6 @@ | |||||
| import { pick } from '@/utils/index'; | import { pick } from '@/utils/index'; | ||||
| import { openAntdModal } from '@/utils/modal'; | import { openAntdModal } from '@/utils/modal'; | ||||
| import { to } from '@/utils/promise'; | |||||
| import { Icon } from '@umijs/max'; | import { Icon } from '@umijs/max'; | ||||
| import { Button, Drawer, Form, Input } from 'antd'; | import { Button, Drawer, Form, Input } from 'antd'; | ||||
| import { forwardRef, useImperativeHandle, useState } from 'react'; | import { forwardRef, useImperativeHandle, useState } from 'react'; | ||||
| @@ -8,6 +9,7 @@ import Styles from './editPipeline.less'; | |||||
| const { TextArea } = Input; | const { TextArea } = Input; | ||||
| const Props = forwardRef(({ onParentChange }, ref) => { | const Props = forwardRef(({ onParentChange }, ref) => { | ||||
| const [form] = Form.useForm(); | const [form] = Form.useForm(); | ||||
| const [stagingItem, setStagingItem] = useState({}); | const [stagingItem, setStagingItem] = useState({}); | ||||
| const [open, setOpen] = useState(false); | const [open, setOpen] = useState(false); | ||||
| const [selectedModel, setSelectedModel] = useState(undefined); | const [selectedModel, setSelectedModel] = useState(undefined); | ||||
| @@ -59,6 +61,15 @@ const Props = forwardRef(({ onParentChange }, ref) => { | |||||
| console.log('Failed:', errorInfo); | console.log('Failed:', errorInfo); | ||||
| }; | }; | ||||
| useImperativeHandle(ref, () => ({ | useImperativeHandle(ref, () => ({ | ||||
| getFieldsValue: async () => { | |||||
| const [propsRes, propsError] = await to(form.validateFields()); | |||||
| if (propsRes && !propsError) { | |||||
| const values = form.getFieldsValue(); | |||||
| return values; | |||||
| } else { | |||||
| return Promise.reject(propsError); | |||||
| } | |||||
| }, | |||||
| showDrawer(e) { | showDrawer(e) { | ||||
| if (e.item && e.item.getModel()) { | if (e.item && e.item.getModel()) { | ||||
| // console.log(e.item.getModel().in_parameters); | // console.log(e.item.getModel().in_parameters); | ||||
| @@ -83,6 +94,15 @@ const Props = forwardRef(({ onParentChange }, ref) => { | |||||
| setOpen(true); | setOpen(true); | ||||
| } | } | ||||
| }, | }, | ||||
| propClose: async () => { | |||||
| setOpen(false); | |||||
| const [openRes, propsError] = await to(setOpen(false)); | |||||
| console.log(setOpen(false)); | |||||
| }, | |||||
| // propClose() { | |||||
| // setOpen(false); | |||||
| // }, | |||||
| })); | })); | ||||
| // 选择数据集、模型 | // 选择数据集、模型 | ||||