@fe-free/core 1.3.3 → 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @fe-free/core
2
2
 
3
+ ## 1.3.4
4
+
5
+ ### Patch Changes
6
+
7
+ - feat: crud
8
+ - @fe-free/tool@1.3.4
9
+
3
10
  ## 1.3.3
4
11
 
5
12
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fe-free/core",
3
- "version": "1.3.3",
3
+ "version": "1.3.4",
4
4
  "description": "",
5
5
  "main": "./src/index.ts",
6
6
  "author": "",
@@ -29,7 +29,7 @@
29
29
  "react-syntax-highlighter": "^15.5.0",
30
30
  "vanilla-jsoneditor": "^0.23.1",
31
31
  "zustand": "^4.5.4",
32
- "@fe-free/tool": "1.3.3"
32
+ "@fe-free/tool": "1.3.4"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@ant-design/pro-components": "^2.8.7",
package/src/crud/crud.tsx CHANGED
@@ -106,7 +106,10 @@ function CRUDComponent<
106
106
  />
107
107
  )}
108
108
  {actions.includes('read_detail') && (
109
- <a href={`./detail/${record[detailIdIndex || 'id']}`} target={readProps?.target}>
109
+ <a
110
+ href={`${window.location.pathname}/detail/${record[detailIdIndex || 'id']}`}
111
+ target={readProps?.target}
112
+ >
110
113
  {readProps?.operateText || '查看'}
111
114
  </a>
112
115
  )}
@@ -166,6 +169,7 @@ function CRUDComponent<
166
169
  const toolBarRender = useCallback(
167
170
  (...args) =>
168
171
  [
172
+ <div key="placeholder" />,
169
173
  // @ts-ignore
170
174
  ...(tableProps.toolBarRender ? tableProps.toolBarRender(...args) : []),
171
175
  actions.includes('create') && (
@@ -8,3 +8,9 @@
8
8
  }
9
9
  }
10
10
  }
11
+
12
+ .crud-of-simple {
13
+ .ant-pro-table-list-toolbar {
14
+ border-bottom: 1px solid #f0f0f0;
15
+ }
16
+ }
@@ -7,12 +7,18 @@ function useTips<DataSource, Key>(props: CRUDProps<DataSource, Key>) {
7
7
  if (!props.requestCreateByValues) {
8
8
  console.warn('actions 包含 create 时,需要传递 requestCreateByValues');
9
9
  }
10
+ if (!props.detailForm) {
11
+ console.warn('actions 包含 create 时,需要传递 detailForm');
12
+ }
10
13
  }
11
14
 
12
15
  if (props.actions.includes('read')) {
13
16
  if (!props.requestGetByRecord) {
14
17
  console.warn('actions 包含 read 时,需要传递 requestGetByRecord');
15
18
  }
19
+ if (!props.detailForm) {
20
+ console.warn('actions 包含 read 时,需要传递 detailForm');
21
+ }
16
22
  }
17
23
 
18
24
  if (props.actions.includes('update')) {
@@ -21,6 +27,9 @@ function useTips<DataSource, Key>(props: CRUDProps<DataSource, Key>) {
21
27
  'actions 包含 update 时,需要传递 requestGetByRecord 和 requestUpdateByValues',
22
28
  );
23
29
  }
30
+ if (!props.detailForm) {
31
+ console.warn('actions 包含 update 时,需要传递 detailForm');
32
+ }
24
33
  }
25
34
 
26
35
  if (props.actions.includes('delete')) {