Skip to content

Commit

Permalink
feat(knowledge): add file version support
Browse files Browse the repository at this point in the history
  • Loading branch information
Carrotzpc committed Apr 9, 2024
1 parent ecd6fe8 commit d8f4201
Show file tree
Hide file tree
Showing 4 changed files with 303 additions and 198 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@tenx-ui/utils": "^2.3.1",
"@umijs/max": "^4.0.42",
"@yunti/lowcode-datasource-axios-handler": "^1.0.1",
"@yuntijs/arcadia-bff-sdk": "^1.2.14",
"@yuntijs/arcadia-bff-sdk": "^1.2.16",
"@yuntijs/chat": "workspace:*",
"@yuntijs/react-markdown-lowcode-materials": "1.0.1",
"@yuntijs/request": "^1.0.0",
Expand Down
108 changes: 28 additions & 80 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions src/pages/KnowledgeCreate/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ class KnowledgeCreate$$Page extends React.Component {
} catch (error) {}
}

getCheckBox(rows) {
getCheckBox(keys, rows) {
try {
const { version } = this.state;
this.setState({
selectFiles: rows,
nextFileList: rows.map(item => {
selectFiles: keys,
nextFileList: keys.map(key => {
return {
...this.state.dataSetFileList.find(_item => _item.path === item),
...this.state.dataSetFileList.find(_item => _item.path === key),
version,
};
}),
Expand Down Expand Up @@ -330,8 +330,9 @@ class KnowledgeCreate$$Page extends React.Component {
name: version,
namespace: this.utils.getAuthData().project,
},
files: selectFiles.map(path => ({
path,
files: selectFiles.map(file => ({
path: file.path,
version: file.latestVersion,
})),
},
];
Expand Down Expand Up @@ -752,7 +753,7 @@ class KnowledgeCreate$$Page extends React.Component {
{
dataIndex: 'fileType',
key: '',
render: (text, record, index) =>
render: /* 插槽容器*/ (text, record, index) =>
(__$$context => (
<Typography.Text
__component_name="Typography.Text"
Expand All @@ -761,7 +762,7 @@ class KnowledgeCreate$$Page extends React.Component {
strong={false}
style={{ fontSize: '' }}
>
{__$$eval(() => text || '-')}
{__$$eval(() => __$$context.fileTyle || '-')}
</Typography.Text>
))(__$$createChildContext(__$$context, { text, record, index })),
title: '类型',
Expand Down Expand Up @@ -859,7 +860,7 @@ class KnowledgeCreate$$Page extends React.Component {
strong={false}
style={{ fontSize: '' }}
>
{__$$eval(() => `类型:${__$$context.getType() || '-'}`)}
{__$$eval(() => `类型:${item.fileType || '-'}`)}
</Typography.Text>
</Col>
<Col __component_name="Col" span={4}>
Expand Down
Loading

0 comments on commit d8f4201

Please sign in to comment.