Explorar o código

feat: 中间表信息

Leo hai 1 ano
pai
achega
63fe167b50

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 0
dagtest2.dag


+ 1 - 1
packages/filebrowser/src/api/datamanage.ts

@@ -31,7 +31,7 @@ export const tableContent = (params: ITableContent): any =>
     method: 'get'
   });
 
-export const uploadTableStatus = (id: number): any =>
+export const tableInfo = (id: number): any =>
   request({
     url: `/jpt/datamanagement/info?id=${id}`,
     method: 'get'

+ 2 - 6
packages/filebrowser/src/datamanage.tsx

@@ -1,9 +1,5 @@
 import React, { useEffect } from 'react';
-import {
-  deleteDataMgmt,
-  getDataMgmtList,
-  uploadTableStatus
-} from './api/datamanage';
+import { deleteDataMgmt, getDataMgmtList, tableInfo } from './api/datamanage';
 import Menu from '@mui/material/Menu';
 import MenuItem from '@mui/material/MenuItem';
 import fileIcon from '../style/img/table.png';
@@ -84,7 +80,7 @@ const DataManage: React.FC<IProps> = props => {
   const fetchTableStatus = async (table: any) => {
     console.log(table);
     if (table.status === 1) {
-      const { data } = await uploadTableStatus(table.id);
+      const { data } = await tableInfo(table.id);
       if (data.code === 200) {
         switch (data.data.status) {
           case 1:

+ 9 - 21
packages/filebrowser/src/dataview.tsx

@@ -37,41 +37,29 @@ export const DagDataView: React.FC<IProps> = ({ data, info, changePage }) => {
   return (
     <div className="dataview_wrapper">
       <div className="dataview_info">
-        <div className="table_name">{info.table_name}</div>
+        <div className="table_name">{info.name}</div>
         <div className="dataview_row">
           <div className="dataview_item">
-            <span className="dataview_label">数据类型</span>
-            {info.data_type}
+            <span className="dataview_label">创建人</span>
+            {info.user_name}
           </div>
           <div className="dataview_item">
-            <span className="dataview_label">完整性</span>
-            {info.integrity}
+            <span className="dataview_label">共享信息</span>
+            {info.share_status ? '是' : '否'}
           </div>
           <div className="dataview_item">
             <span className="dataview_label">数据条数</span>
             {tableData.length}
           </div>
-        </div>
-        <div className="dataview_row">
-          <div className="dataview_item">
-            <span className="dataview_label">存储位置</span>
-            {info.storage_location}
-          </div>
-          <div className="dataview_item">
-            <span className="dataview_label">创建人</span>
-            {info.user_name}
-          </div>
-          <div className="dataview_item">
-            <span className="dataview_label">占用存储</span>
-            {info.storage_usage}
-          </div>
-        </div>
-        <div className="dataview_row">
           <div className="dataview_item">
             <span className="dataview_label">创建时间</span>
             {moment(info.create_time * 1000).format('YYYY-MM-DD HH:mm')}
           </div>
         </div>
+        <div className="dataview_row">
+          <span className="dataview_label">存储路径</span>
+          {info.location}
+        </div>
       </div>
       <div className="table_title">数据预览</div>
       <div className="table_toolbar">

+ 14 - 2
packages/filebrowser/src/dataviewwidget.tsx

@@ -2,16 +2,27 @@ import React from 'react';
 import { ReactWidget } from '@jupyterlab/apputils';
 import { Widget } from '@lumino/widgets';
 import { DagDataView } from './dataview';
-import { tableContent } from './api/datamanage';
+import { tableContent, tableInfo } from './api/datamanage';
 import { message } from 'antd';
 
 class DataTableWidget extends ReactWidget {
   constructor(table: any, options?: Widget.IOptions) {
     super(options);
     void this._requestData(table, 1, 100);
+    void this._tableInfo(table);
     this._table = table;
   }
 
+  private _tableInfo = async (table: any) => {
+    const { data } = await tableInfo(table.id);
+    if (data.code === 200) {
+      this._info = data.data;
+    } else {
+      void message.error(data.msg);
+    }
+    this.update();
+  };
+
   private _requestData = async (table: any, page: number, size: number) => {
     const { data } = await tableContent({
       table_name: table.table_name,
@@ -31,7 +42,7 @@ class DataTableWidget extends ReactWidget {
     return (
       <DagDataView
         data={this._data}
-        info={this._table}
+        info={this._info}
         changePage={(page, size) => this._requestData(this._table, page, size)}
       />
     );
@@ -39,6 +50,7 @@ class DataTableWidget extends ReactWidget {
 
   private _data: any | null = null;
   private _table: any;
+  private _info: any | null = null;
 }
 
 export default DataTableWidget;

+ 1 - 1
packages/filebrowser/style/dataview.css

@@ -9,10 +9,10 @@
 }
 .dataview_row {
   display: flex;
+  padding: 20px 0;
 }
 .dataview_item {
   width: 33%;
-  padding: 20px 0;
   font-size: 12px;
   font-family: PingFangSC-Medium, PingFang SC;
   font-weight: 500;

+ 1 - 1
packages/yili-dag/style/MediateDataInfo.css

@@ -9,10 +9,10 @@
 }
 .dataview_row {
   display: flex;
+  padding: 20px 0;
 }
 .dataview_item {
   width: 33%;
-  padding: 20px 0;
   font-size: 12px;
   font-family: PingFangSC-Medium, PingFang SC;
   font-weight: 500;

+ 1 - 1
packages/yili-dag/style/base.css

@@ -13,5 +13,5 @@
 
 @import url('./AlgoNode.css');
 @import url('./Dag.css');
-@import url('./MediateDataInfo.css');
+/* @import url('./MediateDataInfo.css'); */
 @import url('./ScriptNodeInfo.css');

Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio