From ae26c28099c600d4741e8e1c2990ca52fe0b9331 Mon Sep 17 00:00:00 2001 From: linqiqi077 <865530219@qq.com> Date: Fri, 29 Mar 2024 09:50:05 +0800 Subject: [PATCH] fix: fix some data-handle and modelWarehouse detail issue --- packages/dataset-version-list/src/index.jsx | 2 +- src/pages/CreateDataHandle/index.jsx | 29 ++++++++++++++--- src/pages/ModelWarehouseDetail/index.jsx | 36 +++++++++++++++++---- 3 files changed, 55 insertions(+), 12 deletions(-) diff --git a/packages/dataset-version-list/src/index.jsx b/packages/dataset-version-list/src/index.jsx index 787558b..6157a15 100644 --- a/packages/dataset-version-list/src/index.jsx +++ b/packages/dataset-version-list/src/index.jsx @@ -134,7 +134,7 @@ class DatasetVersionList$$Component extends React.Component { } if (event.key === 'dataProcess') { return this.history.push( - `/data-handle/create?dataset=${params.dataset.name}&datasetVersion=${params.version.name}` + `/data-handle/create?dataset=${params.dataset.name}&datasetVersion=${params.version.version}` ); } if (event.key === 'import') { diff --git a/src/pages/CreateDataHandle/index.jsx b/src/pages/CreateDataHandle/index.jsx index 1603c00..7cec6cf 100644 --- a/src/pages/CreateDataHandle/index.jsx +++ b/src/pages/CreateDataHandle/index.jsx @@ -512,7 +512,7 @@ class $$Page extends React.Component { if (this.state.step3Data?.QAsplitForm?.type) { const cur = _list.find(i => i.value === this.state.step3Data.QAsplitForm.type); if (cur.provider !== 'worker') { - this.form('qa_split').setFieldState('model', { + this.form('qa_split')?.setFieldState('model', { dataSource: cur.models, }); } @@ -520,7 +520,7 @@ class $$Page extends React.Component { this.setState({ llmList: _list, }); - this.form('qa_split').setFieldState('type', { + this.form('qa_split')?.setFieldState('type', { dataSource: _list, }); }) @@ -772,10 +772,10 @@ class $$Page extends React.Component { showLlmModel: true, }, () => { - this.form('qa_split').setFieldState('model', { + this.form('qa_split')?.setFieldState('model', { dataSource: cur.models, }); - this.form('qa_split').setValues({ + this.form('qa_split')?.setValues({ model: cur.models[0]?.value, }); } @@ -1071,6 +1071,20 @@ class $$Page extends React.Component { }); } }); + const dataset = this.history.query.dataset; + const datasetVersion = this.history.query.datasetVersion; + this.setState({ + step2FormData: { + ...this.state.step2FormData, + pre_data_set_name: dataset, + pre_data_set_version: datasetVersion, + post_data_set_name: dataset, + post_data_set_version: datasetVersion, + }, + }); + if (dataset && datasetVersion) { + this.getTableList(`${dataset}-${datasetVersion}`); + } } render() { @@ -1566,7 +1580,12 @@ class $$Page extends React.Component { - + this.utils.getAuthData()?.project !== this.state.data.namespace + ), + key: 'edit', + label: '编辑', + }, + { + disabled: __$$eval( + () => this.utils.getAuthData()?.project !== this.state.data.namespace + ), + key: 'del', + label: '删除', + }, ], onClick: function () { return this.onMenuClick.apply( @@ -1062,8 +1074,20 @@ class ModelWarehouseDetail$$Page extends React.Component { disabled={false} menu={{ items: [ - { key: 'baseinfo', label: '基础信息' }, - { key: 'del', label: '删除' }, + { + disabled: __$$eval( + () => this.utils.getAuthData()?.project !== this.state.data.namespace + ), + key: 'edit', + label: '编辑', + }, + { + disabled: __$$eval( + () => this.utils.getAuthData()?.project !== this.state.data.namespace + ), + key: 'del', + label: '删除', + }, { disabled: true, key: 'deploy', label: '部署' }, ], onClick: function () { @@ -1074,7 +1098,7 @@ class ModelWarehouseDetail$$Page extends React.Component { }.bind(this), }} onClick={function () { - return this.onEdit.apply( + return this.onOpenBaseInfoModal.apply( this, Array.prototype.slice.call(arguments).concat([]) ); @@ -1090,7 +1114,7 @@ class ModelWarehouseDetail$$Page extends React.Component { strong={false} style={{ fontSize: '' }} > - 编辑 + 基础信息 )}