Browse Source

fix:数据集暂时取消多表关联

WanRuixiang 5 months ago
parent
commit
a2d9d25eab
1 changed files with 26 additions and 7 deletions
  1. 26 7
      src/app/pages/IndexDataSet/index.jsx

+ 26 - 7
src/app/pages/IndexDataSet/index.jsx

@@ -145,6 +145,18 @@ export const IndexDataSet = () => {
   /** 数据预览筛选条件回调 */
   const onChange = useCallback(() => {}, [])
 
+
+  /** 选择模型回调*/
+  const onChangeModal = useCallback((id) => {
+    // 获取模型明细
+    dispatch(getModalInfo({
+      id,
+      resolve(data) {
+        updateNodesState(modalToNodes(data, 1))
+      }
+    }))
+  }, [getNodesState])
+
   /** 选择模型回调*/
   const onSelectModal = useCallback((id) => {
     // 获取模型明细
@@ -153,7 +165,7 @@ export const IndexDataSet = () => {
       resolve(data) {
         updateNodesState([
           ...getNodesState,
-          ...modalToNodes(data, selected.current.length)
+          ...modalToNodes(data, selected?.current?.length)
         ])
       }
     }))
@@ -485,20 +497,27 @@ export const IndexDataSet = () => {
                   <Space style={{marginBottom: 10}}>
                     <Search placeholder={t("placeholder.keyword")} style={{width: 300}}/>
                     <Select
-                      mode="multiple"
                       style={{width: 400}}
-                      maxTagCount='responsive'
                       placeholder={t("placeholder.model")}
-                      onSelect={onSelectModal}
-                      onDeselect={onDeselectModal}
                       value={selected.current}
-                      onChange={(e) => selected.current=e}
+                      onChange={onChangeModal}
                       options={memoModals}
                     />
+                    {/*<Select*/}
+                    {/*  mode="multiple"*/}
+                    {/*  style={{width: 400}}*/}
+                    {/*  maxTagCount='responsive'*/}
+                    {/*  placeholder={t("placeholder.model")}*/}
+                    {/*  onSelect={onSelectModal}*/}
+                    {/*  onDeselect={onDeselectModal}*/}
+                    {/*  value={selected.current}*/}
+                    {/*  onChange={(e) => selected.current=e}*/}
+                    {/*  options={memoModals}*/}
+                    {/*/>*/}
                   </Space>
                   <Space style={{float: 'right'}}>
                     <Button>{t("button.auth")}</Button>
-                    <Button onClick={onDatasetSave}>{t("button.save")}</Button>
+                    <Button onClick={()=>onDatasetSave(recordRef.current)}>{t("button.save")}</Button>
                     <Button type="primary" style={{backgroundColor: '#fa541c', width: 100}}>{t("button.publish")}</Button>
                   </Space>
                   <WorkFlowPanel