Browse Source

添加修改

tianyunperfect 5 years ago
parent
commit
d245db1ada

+ 17 - 4
src/pages/ModelList/index.tsx

@@ -83,6 +83,7 @@ const TableList: React.FC<{}> = () => {
       title: '模型类型',
       dataIndex: 'modelType',
       hideInSearch: true,
+      width: 120,
       rules: [
         {
           required: true,
@@ -105,6 +106,8 @@ const TableList: React.FC<{}> = () => {
     {
       title: '模型名称',
       dataIndex: 'modelName',
+      width: 150,
+      copyable: true,
       rules: [
         {
           required: true,
@@ -116,6 +119,8 @@ const TableList: React.FC<{}> = () => {
       title: '模型文件',
       dataIndex: 'modelFile',
       hideInSearch: true,
+      width: 200,
+      copyable: true,
       rules: [
         {
           required: true,
@@ -127,6 +132,8 @@ const TableList: React.FC<{}> = () => {
       title: '向量文件',
       dataIndex: 'vocabFile',
       hideInSearch: true,
+      width: 200,
+      copyable: true,
       rules: [
         {
           required: true,
@@ -138,6 +145,8 @@ const TableList: React.FC<{}> = () => {
       title: '标签文件',
       dataIndex: 'labelFile',
       hideInSearch: true,
+      width: 200,
+      copyable: true,
       rules: [
         {
           required: true,
@@ -149,6 +158,7 @@ const TableList: React.FC<{}> = () => {
       title: '必包含',
       dataIndex: 'mustTag',
       hideInSearch: true,
+      copyable: true,
       formItemProps: {
         placeholder: '逗号分隔'
       },
@@ -158,6 +168,7 @@ const TableList: React.FC<{}> = () => {
       title: '必不包含',
       dataIndex: 'mustNotTag',
       hideInSearch: true,
+      copyable: true,
       formItemProps: {
         placeholder: '逗号分隔'
       },
@@ -193,6 +204,7 @@ const TableList: React.FC<{}> = () => {
       title: '纯文本',
       dataIndex: 'onlyWord',
       hideInSearch: true,
+      hideInTable: true,
       renderFormItem: () => {
         return (
           <Radio.Group>
@@ -214,19 +226,20 @@ const TableList: React.FC<{}> = () => {
       renderFormItem: () => {
         return (
           <Radio.Group>
-            <Radio value="0">区分</Radio>
-            <Radio value="1">不分区</Radio>
+            <Radio value={0}>区分</Radio>
+            <Radio value={1}>不分区</Radio>
           </Radio.Group>
         );
       },
       valueEnum: {
-        "0": {text: '区分'},
-        "1": {text: '不分区'},
+        0: {text: '区分'},
+        1: {text: '不分区'},
       },
     },
 
     {
       title: '操作',
+      width: 200,
       dataIndex: 'option',
       valueType: 'option',
       render: (_, record,index,action) => (

+ 2 - 1
src/pages/ServiceList/_mock.ts

@@ -10,11 +10,12 @@ const genList = (current: number, pageSize: number) => {
   for (let i = 0; i < pageSize; i += 1) {
     const index = (current - 1) * 10 + i;
     tableListDataSource.push({
+      msg: "为学者日益", success: "成功",
       id: index,
       serviceIp: `${index}name`,
       modelName: `${index}name`,
       modelVersion: `${new Date()}`,
-      currentVersion: `${new Date()}`,
+      currentVersion: `${new Date()}`
     });
   }
   tableListDataSource.reverse();

+ 2 - 0
src/pages/ServiceList/data.d.ts

@@ -5,6 +5,8 @@ export interface TableListItem {
   modelName: string;
   modelVersion: string;
   currentVersion: string;
+  success:string;
+  msg:string;
 }
 // 分页参数
 export interface TableListPagination {

+ 44 - 1
src/pages/ServiceList/index.tsx

@@ -1,4 +1,4 @@
-import { message } from 'antd';
+import { message, Tooltip, Radio } from 'antd';
 import React, { useRef, useState } from 'react';
 import { PageHeaderWrapper } from '@ant-design/pro-layout';
 import ProTable, { ActionType, ProColumns } from '@ant-design/pro-table';
@@ -33,21 +33,27 @@ const TableList: React.FC<{}> = () => {
     {
       title: '服务IP',
       dataIndex: 'serviceIp',
+      width: 150,
+      copyable: true,
     },
     {
       title: '模型名称',
       dataIndex: 'modelName',
+      width: 150,
+      copyable: true,
     },
     {
       title: '模型版本',
       dataIndex: 'modelVersion',
       valueType: 'dateTime',
+      width: 200,
       hideInSearch: true,
     },
     {
       title: '当前版本',
       dataIndex: 'currentVersion',
       valueType: 'dateTime',
+      width: 220,
       hideInSearch: true,
       render: (text, row)=>{
         if (row.currentVersion !== row.modelVersion) {
@@ -57,9 +63,46 @@ const TableList: React.FC<{}> = () => {
 
       }
     },
+    {
+      title: '启动状态',
+      dataIndex: 'success',
+      copyable: true,
+      width: 100,
+      renderFormItem: () => {
+        return (
+          <Radio.Group>
+            <Radio value="成功">成功</Radio>
+            <Radio value="失败">失败</Radio>
+          </Radio.Group>
+        );
+      },
+      valueEnum: {
+        "成功": { text: "成功", status: 'Success' },
+        "失败": { text: "失败", status: 'Error' }
+      },
+    },
+    {
+      title: '启动信息',
+      dataIndex: 'msg',
+      hideInSearch: true,
+      valueType: 'text',
+      width: 200,
+      render: (text, row) => {
+        if (!row.msg) {
+          row.msg = '';
+        }
+
+        return (<>
+          <Tooltip title={row.msg}>
+            <span>{row.msg.substring(0, 10)}</span>
+          </Tooltip>
+        </>);
+      },
+    },
     {
       title: '操作',
       dataIndex: 'option',
+      width: 100,
       valueType: 'option',
       render: (_, record,index,action) => (
         <>