@cniot/mdd-editor 0.2.0-beta.5 → 0.2.0-beta.50

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.
Files changed (74) hide show
  1. package/README.MD +205 -9
  2. package/build/index.cjs.js +27 -19
  3. package/build/index.es.js +3686 -739
  4. package/build/style.css +1 -1
  5. package/package.json +1 -1
  6. package/src/components/address-select/formily.jsx +1 -1
  7. package/src/components/ajax-schema-form/formily-table-form-proxy.jsx +1 -1
  8. package/src/components/ajax-schema-form/formily.jsx +1 -1
  9. package/src/components/ajax-schema-form/table-form-proxy.jsx +1 -1
  10. package/src/components/ajax-schema-form/table-form.jsx +1 -1
  11. package/src/components/data-source-select/formily.jsx +1 -1
  12. package/src/components/dynamic-value/base/formily.jsx +1 -1
  13. package/src/components/dynamic-value/date/formily.jsx +1 -1
  14. package/src/components/formily-select/index.tsx +1 -1
  15. package/src/components/params-select/formily.jsx +1 -1
  16. package/src/components/time-range/formily.jsx +1 -1
  17. package/src/hooks/useSchema.jsx +5 -5
  18. package/src/hooks/useSwagger.jsx +2 -2
  19. package/src/schema/base-schema/AjaxSchema.js +1 -1
  20. package/src/schema/base-schema/AjaxSchemaQueue.js +1 -1
  21. package/src/schema/blocks/edit-table.js +57 -0
  22. package/src/schema/blocks/filter.js +49 -0
  23. package/src/schema/blocks/form.js +49 -0
  24. package/src/schema/blocks/index.js +101 -0
  25. package/src/schema/blocks/table.js +57 -0
  26. package/src/schema/detail/detail-item.js +8 -2
  27. package/src/schema/detail/index.js +26 -18
  28. package/src/schema/edit-table/header-toolbar.js +1 -1
  29. package/src/schema/edit-table/index.js +10 -5
  30. package/src/schema/edit-table/table.js +10 -2
  31. package/src/schema/formily-form/data-source.js +1 -1
  32. package/src/schema/formily-form/form-schema.js +1 -1
  33. package/src/schema/formily-form/index.js +8 -8
  34. package/src/schema/formily-form-v2/form-info.js +2 -2
  35. package/src/schema/formily-form-v2/form-items.js +1 -1
  36. package/src/schema/formily-form-v2/index.js +3 -3
  37. package/src/schema/ftp/data-source.js +1 -1
  38. package/src/schema/ftp/filter.js +2 -2
  39. package/src/schema/ftp/header-toolbar.js +1 -1
  40. package/src/schema/ftp/index.js +4 -4
  41. package/src/schema/ftp/middle-item.js +1 -1
  42. package/src/schema/ftp/table.js +9 -3
  43. package/src/schema/util.js +3 -3
  44. package/src/services/index.js +1 -1
  45. package/src/template/blocks/EditTable.jsx +62 -0
  46. package/src/template/blocks/Filter.jsx +137 -0
  47. package/src/template/blocks/Form.jsx +136 -0
  48. package/src/template/blocks/Table.jsx +79 -0
  49. package/src/template/blocks/index.module.scss +33 -0
  50. package/src/template/const.js +18 -1
  51. package/src/template/detail/DetailItems.jsx +14 -1
  52. package/src/template/detail/components/Actions.jsx +1 -1
  53. package/src/template/detail/components/DetailCard.jsx +8 -5
  54. package/src/template/detail/components/DetailColumns.jsx +296 -0
  55. package/src/template/detail/components/DetailColumns.module.scss +18 -0
  56. package/src/template/detail/components/DetailCustom.jsx +2 -2
  57. package/src/template/detail/components/DetailTable.jsx +13 -8
  58. package/src/template/detail/components/MultiAjaxSchemaForm.jsx +1 -1
  59. package/src/template/edit-table/HeaderToolbar.jsx +3 -2
  60. package/src/template/edit-table/Table.jsx +56 -3
  61. package/src/template/formily-form-v2/FormInfo.jsx +1 -1
  62. package/src/template/formily-form-v2/FormItems.jsx +4 -8
  63. package/src/template/formilyform/components/AsyncDataSourceSetter/index.tsx +1 -1
  64. package/src/template/formilyform/components/SubmitActionSetter/index.tsx +1 -1
  65. package/src/template/ftp/DataSource.jsx +1 -1
  66. package/src/template/ftp/Filter.jsx +7 -4
  67. package/src/template/ftp/HeaderToolbar.jsx +1 -1
  68. package/src/template/ftp/Middle.jsx +4 -4
  69. package/src/template/ftp/Table.jsx +123 -9
  70. package/src/template/simple-ftp/Table.jsx +2 -2
  71. package/src/toolbar.jsx +6 -3
  72. package/src/utils/buildFieldsToCompJson.js +3 -3
  73. package/src/utils/persistentStorage.js +1 -1
  74. package/src/utils/swagger/api2SchemaFromSwagger.js +11 -5
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
- import { Form, Dialog, Switch, CnMessage, Input, Icon } from '@cainiaofe/cn-ui';
3
- import MddTableForm from '@src/components/mdd-table-form';
2
+ import { Form, Dialog, Switch, CnMessage, Input, Icon, NumberPicker } from '@cainiaofe/cn-ui';
3
+ import MddTableForm from '$src/components/mdd-table-form';
4
4
  import MultiAjaxSchemaForm from './MultiAjaxSchemaForm';
5
- import useSwagger from '@src/hooks/useSwagger';
6
- import buildSwaggerApiJson from '@src/utils/buildSwaggerApiJson';
7
- import buildFieldsToCompJson from '@src/utils/buildFieldsToCompJson';
8
- import MddForm from '@src/components/mdd-form';
5
+ import useSwagger from '$src/hooks/useSwagger';
6
+ import buildSwaggerApiJson from '$src/utils/buildSwaggerApiJson';
7
+ import buildFieldsToCompJson from '$src/utils/buildFieldsToCompJson';
8
+ import MddForm from '$src/components/mdd-form';
9
9
  import ActionPanel from './Actions';
10
10
  import { columnsTypeOptionsWithCnTable } from '../../const';
11
11
 
@@ -141,13 +141,18 @@ export default function DetailTable(props) {
141
141
  onChange={({ index, record }) => onPaginationChangeHandle({ index, record })}
142
142
  />
143
143
 
144
- <Form.Item labelAlign="left" label="是否影藏通用顶部操作区:" name="hideCommonToolbar">
144
+ <Form.Item labelAlign="left" label="是否隐藏通用顶部操作区:" name="hideCommonToolbar">
145
145
  <Switch autoWidth size="small" defaultChecked={data.get('hideCommonToolbar')} />
146
146
  </Form.Item>
147
147
 
148
148
  <div style={{ marginLeft: '10px', marginBottom: 8 }}>
149
149
  <label>最大高度:</label>
150
- <Input value={data.get('maxHeight')} size="small" onChange={(v) => tablePropsChange('maxHeight', v)} />
150
+ <NumberPicker
151
+ value={data.get('maxHeight')}
152
+ size="small"
153
+ onChange={(v) => tablePropsChange('maxHeight', v)}
154
+ min={0}
155
+ />
151
156
  <span className="mdd-tip">
152
157
  <Icon type="prompt" /> 该属性可以实现一屏展示,支持calc函数,eg: calc(100vh - 100px)
153
158
  </span>
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Icon, Button, Box } from '@cainiaofe/cn-ui';
3
- import AjaxSchemaForm from '@src/components/ajax-schema-form';
3
+ import AjaxSchemaForm from '$src/components/ajax-schema-form';
4
4
 
5
5
  // schema 是 detail-item 对象
6
6
  /**
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import MddTableForm from '@src/components/mdd-table-form';
2
+ import MddTableForm from '$src/components/mdd-table-form';
3
3
 
4
4
  export default function HeaderToolbarPanel({ schema }) {
5
5
  const mddFormRef = React.useRef();
@@ -19,7 +19,8 @@ export default function HeaderToolbarPanel({ schema }) {
19
19
  const onAddHandle = () => {
20
20
  schema.add(
21
21
  {
22
- type: 'batch-add',
22
+ // type: 'batch-add',
23
+ type: 'editButton',
23
24
  label: '批量新增',
24
25
  action: {
25
26
  type: 'drawer', // 目前必须是 drawer
@@ -1,6 +1,6 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { Input, Switch, Icon } from '@cainiaofe/cn-ui';
3
- import MddTableForm from '@src/components/mdd-table-form';
2
+ import { Input, Switch, Icon, NumberPicker } from '@cainiaofe/cn-ui';
3
+ import MddTableForm from '$src/components/mdd-table-form';
4
4
  import { columnsTypeOptionsWithEditCnTable } from '../const';
5
5
 
6
6
  export default function TablePanel({ schema, swaggerFields = [] }) {
@@ -15,6 +15,8 @@ export default function TablePanel({ schema, swaggerFields = [] }) {
15
15
  const primaryKey = schema.get('primaryKey');
16
16
  // 批量操作
17
17
  const columns = schema.get('columns');
18
+ // 显示序号
19
+ const showIndex = schema.get('showIndex');
18
20
 
19
21
  const onAddHandle = (key) => {
20
22
  switch (key) {
@@ -47,6 +49,11 @@ export default function TablePanel({ schema, swaggerFields = [] }) {
47
49
  schema.update('', value, 'primaryKey');
48
50
  };
49
51
 
52
+ // 基础属性变更
53
+ const onBaseInfoChange = (key, value) => {
54
+ schema.update('', value, key);
55
+ };
56
+
50
57
  return (
51
58
  <div>
52
59
  <div style={{ marginLeft: '10px', marginBottom: 8 }}>
@@ -69,11 +76,57 @@ export default function TablePanel({ schema, swaggerFields = [] }) {
69
76
 
70
77
  <div style={{ marginLeft: '10px', marginBottom: 8 }}>
71
78
  <label>最大高度:</label>
72
- <Input value={schema.get('maxHeight')} size="small" onChange={(v) => schema.update('', v, 'maxHeight')} />
79
+ <NumberPicker
80
+ value={schema.get('maxHeight')}
81
+ size="small"
82
+ onChange={(v) => schema.update('', v, 'maxHeight')}
83
+ min={0}
84
+ />
73
85
  <span className="mdd-tip">
74
86
  <Icon type="prompt" /> 该属性可以实现一屏展示,支持calc函数,eg: calc(100vh - 100px)
75
87
  </span>
76
88
  </div>
89
+
90
+ <div style={{ marginLeft: '10px', marginBottom: 8 }}>
91
+ <label>是否显示序号:</label>
92
+ <Switch autoWidth checked={showIndex} size="small" onChange={(v) => onBaseInfoChange('showIndex', v)} />
93
+ <span className="mdd-tip">
94
+ <Icon type="prompt" /> 纯前端自动序号{' '}
95
+ </span>
96
+ </div>
97
+ <div style={{ marginLeft: '10px', marginBottom: 8 }}>
98
+ <label>是否开启虚拟滚动:</label>
99
+ <Switch
100
+ autoWidth
101
+ checked={schema.get('useVirtual')}
102
+ size="small"
103
+ onChange={(v) => onBaseInfoChange('useVirtual', v)}
104
+ />
105
+ </div>
106
+ <div style={{ marginLeft: '10px', marginBottom: 8 }}>
107
+ <label>是否开启自动列宽:</label>
108
+ <Switch
109
+ autoWidth
110
+ checked={schema.get('columnsAutoWidth')}
111
+ size="small"
112
+ onChange={(v) => onBaseInfoChange('columnsAutoWidth', v)}
113
+ />
114
+ <span className="mdd-tip">
115
+ <Icon type="prompt" /> 如果有性能问题可以关闭该属性,同时手动设置列宽
116
+ </span>
117
+ </div>
118
+ <div style={{ marginLeft: '10px', marginBottom: 8 }}>
119
+ <label>是否隐藏通用顶部操作区:</label>
120
+ <Switch
121
+ autoWidth
122
+ checked={schema.get('hideCommonToolbar')}
123
+ size="small"
124
+ onChange={(v) => onBaseInfoChange('hideCommonToolbar', v)}
125
+ />
126
+ <span className="mdd-tip">
127
+ <Icon type="prompt" /> 是否隐藏table顶部操作区的通用操作按钮,比如全屏、斑马线、列设置、尺寸等
128
+ </span>
129
+ </div>
77
130
  </div>
78
131
  );
79
132
  }
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { Form, NumberPicker, Select, Switch, Input } from '@cainiaofe/cn-ui';
3
- import MddForm from '@src/components/mdd-form';
3
+ import MddForm from '$src/components/mdd-form';
4
4
 
5
5
  const labelDataSource = [
6
6
  {
@@ -1,11 +1,7 @@
1
1
  import React from 'react';
2
- import MddTableForm, { PenetrateTypes } from '@src/components/mdd-table-form';
3
- import { componentOptions } from '../const';
4
- import { propFields } from '@src/common/comp-schema/fields/propFields';
5
-
6
- const FormComponentOptions = [...componentOptions];
7
- FormComponentOptions.splice(3, 0, { value: 'input-password', label: '密码输入框' });
8
- // FormComponentOptions.splice(8, 1); // 表单去除级联选择器
2
+ import MddTableForm, { PenetrateTypes } from '$src/components/mdd-table-form';
3
+ import { FormComponentOptions } from '../const';
4
+ import { propFields } from '$src/common/comp-schema/fields/propFields';
9
5
 
10
6
  export default function FormItemsPanel({ schema, swaggerFields = [] }) {
11
7
  const mddFormRef = React.useRef();
@@ -56,7 +52,7 @@ export default function FormItemsPanel({ schema, swaggerFields = [] }) {
56
52
  ref={mddFormRef}
57
53
  data={fields || []}
58
54
  penetrateType={PenetrateTypes.FORM}
59
- componentOptions={FormComponentOptions}
55
+ componentOptions={[...FormComponentOptions, , { value: 'blocks-form', label: '表单区块' }]}
60
56
  swaggerFieldDataSource={swaggerFields}
61
57
  title="配置表单项"
62
58
  onAdd={onAddHandle}
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  // import { Modal, Button } from 'antd';
3
3
 
4
- import DataSourceSelect from '@src/components/data-source-select';
4
+ import DataSourceSelect from '$src/components/data-source-select';
5
5
 
6
6
  // const AsyncDataSourceSetter = observer((props) => {
7
7
  // const [visible, setVisible] = useState(false);
@@ -1,7 +1,7 @@
1
1
  import React, { useState } from 'react';
2
2
  // import { Modal, Button } from 'antd';
3
3
 
4
- import ParamsSelect from '@src/components/params-select';
4
+ import ParamsSelect from '$src/components/params-select';
5
5
 
6
6
  // const SubmitActionSetter = observer((props) => {
7
7
  // const [visible, setVisible] = useState(false);
@@ -1,5 +1,5 @@
1
1
  import React, { useCallback } from 'react';
2
- import DataSourceSelect from '@src/components/data-source-select';
2
+ import DataSourceSelect from '$src/components/data-source-select';
3
3
 
4
4
  function DataSource({ schema }) {
5
5
  const [_, forceUpdate] = React.useState({});
@@ -1,10 +1,10 @@
1
1
  import React from 'react';
2
2
  import { Form, NumberPicker, Select, Input, Switch } from '@cainiaofe/cn-ui';
3
- import MddTableForm, { PenetrateTypes } from '@src/components/mdd-table-form';
4
- import MddForm from '@src/components/mdd-form';
3
+ import MddTableForm, { PenetrateTypes } from '$src/components/mdd-table-form';
4
+ import MddForm from '$src/components/mdd-form';
5
5
  import { componentOptions } from '../const';
6
6
 
7
- import { propFields } from '@src/common/comp-schema/fields/propFields';
7
+ import { propFields } from '$src/common/comp-schema/fields/propFields';
8
8
 
9
9
  const labelDataSource = [
10
10
  {
@@ -121,7 +121,7 @@ export default function FilterPanel({ schema, swaggerFields = [] }) {
121
121
  ref={mddFormRef}
122
122
  data={fields}
123
123
  penetrateType={PenetrateTypes.FILTER}
124
- componentOptions={componentOptions}
124
+ componentOptions={[...componentOptions, { value: 'blocks-filter', label: '筛选项区块' }]}
125
125
  title="配置查询条件"
126
126
  onAdd={onAddHandle}
127
127
  onRemove={onRemoveHandle}
@@ -140,6 +140,9 @@ export default function FilterPanel({ schema, swaggerFields = [] }) {
140
140
  schema.set(item.name, item.value);
141
141
  }}
142
142
  >
143
+ <Form.Item label="默认展开:" name="defaultExpand" help="仅在 新版布局中生效">
144
+ <Switch defaultChecked={schema.get('defaultExpand')} />
145
+ </Form.Item>
143
146
  <Form.Item label="文本位置:" name="labelAlign">
144
147
  <Select dataSource={labelDataSource} defaultValue={schema.get('labelAlign')} />
145
148
  </Form.Item>
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import MddTableForm from '@src/components/mdd-table-form';
2
+ import MddTableForm from '$src/components/mdd-table-form';
3
3
 
4
4
  export default function HeaderToolbarPanel({ schema, moduleMap }) {
5
5
  const mddFormRef = React.useRef();
@@ -2,11 +2,11 @@
2
2
  * 中间模块区
3
3
  */
4
4
  import React from 'react';
5
- import MddTableSimpleArray from '@src/components/mdd-table-simple-array';
6
- import TableFromProxy from '@src/components/ajax-schema-form/table-form-proxy';
5
+ import MddTableSimpleArray from '$src/components/mdd-table-simple-array';
6
+ import TableFromProxy from '$src/components/ajax-schema-form/table-form-proxy';
7
7
  import { Select, Input, Icon } from '@cainiaofe/cn-ui';
8
- import AjaxSchemaForm from '@src/components/ajax-schema-form';
9
- import DynamicValueBase from '@src/components/dynamic-value/base';
8
+ import AjaxSchemaForm from '$src/components/ajax-schema-form';
9
+ import DynamicValueBase from '$src/components/dynamic-value/base';
10
10
 
11
11
  import styles from './index.module.scss';
12
12
 
@@ -1,14 +1,15 @@
1
1
  import React, { useEffect, useState } from 'react';
2
- import { Input, Switch, Icon, NumberPicker } from '@cainiaofe/cn-ui';
3
- import MddTableForm from '@src/components/mdd-table-form';
4
- import MddForm from '@src/components/mdd-form';
5
- import AjaxSchemaForm from '@src/components/ajax-schema-form';
2
+ import { Input, Switch, Icon, NumberPicker, CnSwitch, CnTooltip } from '@cainiaofe/cn-ui';
3
+ import MddTableForm from '$src/components/mdd-table-form';
4
+ import MddForm from '$src/components/mdd-form';
5
+ import AjaxSchemaForm from '$src/components/ajax-schema-form';
6
6
  import { columnsTypeOptionsWithCnTable } from '../const';
7
7
 
8
8
  export default function TablePanel({ schema, swaggerFields = [] }) {
9
9
  const columnMddFormRef = React.useRef();
10
10
  const bulkMddFormRef = React.useRef();
11
11
  const operateMddFormRef = React.useRef();
12
+ const rowDoubleClickRef = React.useRef();
12
13
 
13
14
  const [_, forceUpdate] = useState({});
14
15
  const [visibleRowDetail, setVisibleRowDetail] = useState(!!schema.get('rowDetailModule')?.path);
@@ -27,13 +28,17 @@ export default function TablePanel({ schema, swaggerFields = [] }) {
27
28
  const columns = schema.get('columns');
28
29
  // 操作列
29
30
  const actionColumns = schema.get('actionColumns');
31
+ // 行双击配置
32
+ const rowDoubleClick = schema.get('rowDoubleClick');
30
33
  const pagination = schema.get('pagination');
31
34
  // 树形
32
35
  const tree = schema.get('tree');
33
36
  // 显示序号
34
37
  const showIndex = schema.get('showIndex');
35
- // 影藏底部操作区
38
+ // 隐藏底部操作区
36
39
  const hideCommonToolbar = schema.get('hideCommonToolbar');
40
+ // 操作列按钮最长字符数
41
+ const actionMaxCharNum = schema.get('actionMaxCharNum');
37
42
  // 操作列宽度
38
43
  const actionWidth = schema.get('actionWidth');
39
44
  // 是否显示多选
@@ -42,6 +47,8 @@ export default function TablePanel({ schema, swaggerFields = [] }) {
42
47
  const rowDetailModule = schema.get('rowDetailModule');
43
48
  // 远程排序
44
49
  const remoteSort = schema.get('remoteSort');
50
+ // 父子节点级联勾选
51
+ const treeLinkageCheck = schema.get('treeLinkageCheck');
45
52
 
46
53
  // 加载子节点数据源面板
47
54
  const loadChildrenDataApiPanel = schema.getLoadChildrenDataApiPanel();
@@ -98,6 +105,23 @@ export default function TablePanel({ schema, swaggerFields = [] }) {
98
105
  );
99
106
  operateMddFormRef.current?.updateData(schema.get('actionColumns'));
100
107
  break;
108
+ case 'rowDoubleClick':
109
+ // 操作列,默认带上当前行对象
110
+ schema.add(
111
+ {
112
+ type: 'button',
113
+ action: {
114
+ type: 'url',
115
+ params: {
116
+ record: '$TABLE.RECORD_DATA',
117
+ },
118
+ },
119
+ },
120
+ 'rowDoubleClick',
121
+ true,
122
+ );
123
+ rowDoubleClickRef.current?.updateData(schema.get('rowDoubleClick'));
124
+ break;
101
125
  default:
102
126
  break;
103
127
  }
@@ -111,6 +135,8 @@ export default function TablePanel({ schema, swaggerFields = [] }) {
111
135
  columnMddFormRef.current?.updateData(schema.get('columns'));
112
136
  } else if (key === 'actionColumns') {
113
137
  operateMddFormRef.current?.updateData(schema.get('actionColumns'));
138
+ } else if (key === 'rowDoubleClick') {
139
+ rowDoubleClickRef.current?.updateData(schema.get('rowDoubleClick'));
114
140
  }
115
141
  };
116
142
 
@@ -118,6 +144,10 @@ export default function TablePanel({ schema, swaggerFields = [] }) {
118
144
  schema.update(index, record, key, true);
119
145
  };
120
146
 
147
+ const onActionMaxCharNum = (value) => {
148
+ schema.update('', value ? Number(value) : '', 'actionMaxCharNum');
149
+ };
150
+
121
151
  const onActionWidthChange = (value) => {
122
152
  schema.update('', value ? Number(value) : '', 'actionWidth');
123
153
  };
@@ -178,6 +208,39 @@ export default function TablePanel({ schema, swaggerFields = [] }) {
178
208
  schema.setItemAll(newList, 'actionColumns', true);
179
209
  }}
180
210
  />
211
+ <MddTableForm
212
+ ref={rowDoubleClickRef}
213
+ data={rowDoubleClick}
214
+ title={() => (
215
+ <div style={{ display: 'flex', alignItems: 'center', gap: 6 }}>
216
+ 配置行双击事件
217
+ <CnSwitch
218
+ size="small"
219
+ checked={schema.get('rowDoubleClick')?.length > 0}
220
+ onChange={(checked) => {
221
+ if (checked) onAddHandle('rowDoubleClick');
222
+ else onRemoveHandle(0, 'rowDoubleClick');
223
+ }}
224
+ />
225
+ <CnTooltip trigger={<Icon type="prompt" />}>
226
+ 行双击事件 和 操作列按钮 配置保持一致,下面 关于按钮的配置 均会失效,请只关注 双击 要执行的事件本身
227
+ </CnTooltip>
228
+ </div>
229
+ )}
230
+ titleType={[]}
231
+ draggable={false}
232
+ titleRender={() => '行双击 事件配置'}
233
+ onRemove={() => {}}
234
+ onChange={({ index, record }) => onChangeHandle({ index, record }, 'rowDoubleClick')}
235
+ />
236
+ <div style={{ marginLeft: '10px', marginBottom: 8 }}>
237
+ <label>操作列按钮最长字符数:</label>
238
+ <NumberPicker value={actionMaxCharNum} size="small" onChange={onActionMaxCharNum} min={1} max={10} />
239
+ <span className="mdd-tip">
240
+ <Icon type="prompt" /> 超长部分会显示为“...”[注意:需全局开启配置后 此项生效;在低版本 CN-UI 上不生效,如
241
+ 实施工作台;可能会对一码多端效果造成影响,慎用]
242
+ </span>
243
+ </div>
181
244
  <div style={{ marginLeft: '10px', marginBottom: 8 }}>
182
245
  <label>操作列宽度:</label>
183
246
  <Input value={actionWidth} size="small" onChange={onActionWidthChange} />
@@ -187,7 +250,12 @@ export default function TablePanel({ schema, swaggerFields = [] }) {
187
250
  </div>
188
251
  <div style={{ marginLeft: '10px', marginBottom: 8 }}>
189
252
  <label>最大高度:</label>
190
- <Input value={schema.get('maxHeight')} size="small" onChange={(v) => onBaseInfoChange('maxHeight', v)} />
253
+ <NumberPicker
254
+ value={schema.get('maxHeight')}
255
+ size="small"
256
+ onChange={(v) => onBaseInfoChange('maxHeight', v)}
257
+ min={0}
258
+ />
191
259
  <span className="mdd-tip">
192
260
  <Icon type="prompt" /> 该属性可以实现一屏展示,支持calc函数,eg: calc(100vh - 100px)
193
261
  </span>
@@ -226,7 +294,23 @@ export default function TablePanel({ schema, swaggerFields = [] }) {
226
294
  </span>
227
295
  </div>
228
296
  {tree && (
229
- <div style={{ marginLeft: '10px', marginBottom: 8, display: 'flex' }}>
297
+ <div style={{ marginLeft: '20px', marginBottom: 8, display: 'flex' }}>
298
+ <label>父子节点级联勾选:</label>
299
+ <Switch
300
+ autoWidth
301
+ checked={treeLinkageCheck}
302
+ size="small"
303
+ onChange={(v) => onBaseInfoChange('treeLinkageCheck', v)}
304
+ />
305
+
306
+ <span className="mdd-tip">
307
+ <Icon type="prompt" />{' '}
308
+ 父节点勾选默认会勾选所有子节点,子节点勾选默认会勾上父节点【必须配置唯一主键,不支持异步数据】
309
+ </span>
310
+ </div>
311
+ )}
312
+ {tree && (
313
+ <div style={{ marginLeft: '20px', marginBottom: 8, display: 'flex' }}>
230
314
  <label>子节点懒加载配置:</label>
231
315
  <div>
232
316
  <AjaxSchemaForm schema={loadChildrenDataApiPanel} isSelectType={false} />
@@ -236,6 +320,7 @@ export default function TablePanel({ schema, swaggerFields = [] }) {
236
320
  </div>
237
321
  </div>
238
322
  )}
323
+
239
324
  <div style={{ marginLeft: '10px', marginBottom: 8 }}>
240
325
  <label>是否显示序号:</label>
241
326
  <Switch autoWidth checked={showIndex} size="small" onChange={(v) => onBaseInfoChange('showIndex', v)} />
@@ -244,7 +329,7 @@ export default function TablePanel({ schema, swaggerFields = [] }) {
244
329
  </span>
245
330
  </div>
246
331
  <div style={{ marginLeft: '10px', marginBottom: 8 }}>
247
- <label>是否影藏通用顶部操作区:</label>
332
+ <label>是否隐藏通用顶部操作区:</label>
248
333
  <Switch
249
334
  autoWidth
250
335
  checked={hideCommonToolbar}
@@ -252,7 +337,7 @@ export default function TablePanel({ schema, swaggerFields = [] }) {
252
337
  onChange={(v) => onBaseInfoChange('hideCommonToolbar', v)}
253
338
  />
254
339
  <span className="mdd-tip">
255
- <Icon type="prompt" /> 是否影藏table顶部操作区的通用操作按钮,比如全屏、斑马线、列设置、尺寸等
340
+ <Icon type="prompt" /> 是否隐藏table顶部操作区的通用操作按钮,比如全屏、斑马线、列设置、尺寸等
256
341
  </span>
257
342
  </div>
258
343
  <div style={{ marginLeft: '10px', marginBottom: 8 }}>
@@ -283,6 +368,35 @@ export default function TablePanel({ schema, swaggerFields = [] }) {
283
368
  <Icon type="prompt" /> 纯前端筛选
284
369
  </span>
285
370
  </div>
371
+
372
+ <div style={{ marginLeft: '10px', marginBottom: 8 }}>
373
+ <label>是否开启多维指标排序:</label>
374
+ <Switch
375
+ autoWidth
376
+ checked={schema.get('customSort')}
377
+ size="small"
378
+ onChange={(v) => {
379
+ onBaseInfoChange('customSort', v);
380
+ !v && onBaseInfoChange('customSortStorage', '');
381
+ }}
382
+ />
383
+ <span className="mdd-tip">
384
+ <Icon type="prompt" /> 纯前端排序
385
+ </span>
386
+
387
+ {schema.get('customSort') && (
388
+ <Input
389
+ style={{ marginLeft: 8 }}
390
+ value={schema.get('customSortStorage')}
391
+ size="small"
392
+ placeholder="跟随页面缓存"
393
+ onChange={(v) => {
394
+ onBaseInfoChange('customSortStorage', v);
395
+ }}
396
+ />
397
+ )}
398
+ </div>
399
+
286
400
  <div style={{ marginLeft: '10px', marginBottom: 8 }}>
287
401
  <label>是否开启列头复制:</label>
288
402
  <Switch autoWidth checked={schema.get('copy')} size="small" onChange={(v) => onBaseInfoChange('copy', v)} />
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { Input, Switch, Icon, NumberPicker } from '@cainiaofe/cn-ui';
3
- import MddTableForm from '@src/components/mdd-table-form';
4
- import MddForm from '@src/components/mdd-form';
3
+ import MddTableForm from '$src/components/mdd-table-form';
4
+ import MddForm from '$src/components/mdd-form';
5
5
  import { columnsTypeOptionsWithCnTable } from '../const';
6
6
 
7
7
  export default function TablePanel({ schema }) {
package/src/toolbar.jsx CHANGED
@@ -1,13 +1,16 @@
1
1
  import React from 'react';
2
2
  import { Dialog, CnIcon, CnButton, CnTooltip, CnDrawer, CnTab, CnTabItem, CnCard } from '@cainiaofe/cn-ui';
3
3
  import MDDRenderEngine, { JSONWatch } from '@cniot/mdd-render-engine';
4
- import Monaco from '@src/components/ajax-schema-form/monaco';
4
+ import Monaco from '$src/components/ajax-schema-form/monaco';
5
5
 
6
- import { EVENT_KEY } from '@src/common/const';
6
+ import { EVENT_KEY } from '$src/common/const';
7
7
 
8
8
  import './index.less';
9
9
 
10
- const isDebug = window?.location?.search?.indexOf('debug') >= 0;
10
+ // window.localStorage.__l4_location_search_debug__ = true; // 调试使用
11
+ // window.localStorage.__l4_ftp_filter_expand__ = true; // 调试使用
12
+ const isDebug =
13
+ window?.location?.search?.indexOf('debug') >= 0 || window.localStorage?.__l4_location_search_debug__ === 'true';
11
14
 
12
15
  /**
13
16
  * 顶部操作区
@@ -1,6 +1,6 @@
1
- import { SWAGGER_DT } from '@src/common/const';
2
- import { calcWordWidth } from '@src/utils';
3
- import { propFields } from '@src/common/comp-schema/fields/propFields';
1
+ import { SWAGGER_DT } from '$src/common/const';
2
+ import { calcWordWidth } from '$src/utils';
3
+ import { propFields } from '$src/common/comp-schema/fields/propFields';
4
4
 
5
5
  // 不生成字段 黑名单
6
6
  const REMOVE_FIELDS_NAME = ['page', 'pageSize', 'pageNo', 'currentPage', 'userContext'];
@@ -1,5 +1,5 @@
1
1
  // 用于LS储存
2
- import { PERSISTENT_STORE_LS_KEY } from '@src/common/const';
2
+ import { PERSISTENT_STORE_LS_KEY } from '$src/common/const';
3
3
 
4
4
  class PersistentStorage {
5
5
  constructor() {
@@ -1,8 +1,8 @@
1
1
  import merge from 'lodash/merge';
2
- import buildSwaggerApiJson from '@src/utils/buildSwaggerApiJson';
3
- import buildFieldsToCompJson from '@src/utils/buildFieldsToCompJson';
4
- import jsonSchemaRefParser from '@src/utils/jsonSchemaRefParser';
5
- import { getDefaultFomrLabelAlign } from '@src/utils';
2
+ import buildSwaggerApiJson from '$src/utils/buildSwaggerApiJson';
3
+ import buildFieldsToCompJson from '$src/utils/buildFieldsToCompJson';
4
+ import jsonSchemaRefParser from '$src/utils/jsonSchemaRefParser';
5
+ import { getDefaultFomrLabelAlign } from '$src/utils';
6
6
 
7
7
  /** 将swaggerjson 转换成前端能用的swagger对象 */
8
8
  export function getSwaggerInfoFromJson(swaggerJson) {
@@ -186,10 +186,16 @@ export function api2SchemaFromSwaggerApiInfo(api, schemaType, apiInfo, extraSche
186
186
  },
187
187
  tree: false,
188
188
  showIndex: false,
189
- hideCommonToolbar: false,
189
+ hideCommonToolbar: true,
190
190
  },
191
191
  headerToolbar: [],
192
192
  };
193
+ } else if (schemaType?.startsWith('blocks-')) {
194
+ result.type = 'blocks';
195
+ result.body = {
196
+ type: schemaType,
197
+ blocks: [],
198
+ };
193
199
  }
194
200
 
195
201
  return merge(result, extraSchema);