@cniot/mdd-editor 0.2.0-beta.30 → 0.2.0-beta.31
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/README.MD +3 -0
- package/build/index.cjs.js +11 -11
- package/build/index.es.js +26 -21
- package/package.json +1 -1
- package/src/schema/detail/detail-item.js +6 -4
- package/src/template/detail/components/DetailColumns.jsx +49 -44
package/build/index.es.js
CHANGED
|
@@ -3468,7 +3468,8 @@ class DetailItemSchema extends JSONWatch {
|
|
|
3468
3468
|
current = 1,
|
|
3469
3469
|
columnsDirection = "row",
|
|
3470
3470
|
columnsBoxes = [],
|
|
3471
|
-
|
|
3471
|
+
height = 100,
|
|
3472
|
+
hideCard = true,
|
|
3472
3473
|
...more2
|
|
3473
3474
|
} = props || {};
|
|
3474
3475
|
super({
|
|
@@ -3489,7 +3490,8 @@ class DetailItemSchema extends JSONWatch {
|
|
|
3489
3490
|
current,
|
|
3490
3491
|
columnsDirection,
|
|
3491
3492
|
columnsBoxes,
|
|
3492
|
-
|
|
3493
|
+
height,
|
|
3494
|
+
hideCard,
|
|
3493
3495
|
...more2
|
|
3494
3496
|
});
|
|
3495
3497
|
}
|
|
@@ -26001,7 +26003,7 @@ const { Panel: Panel$2 } = Collapse;
|
|
|
26001
26003
|
const TitleRender$1 = (props) => {
|
|
26002
26004
|
const ref = useRef(null);
|
|
26003
26005
|
const { data, onSortUpdate, index: index2, draggable, onRemove, onChange, customRender = () => {
|
|
26004
|
-
} } = props;
|
|
26006
|
+
}, otherInfo } = props;
|
|
26005
26007
|
const { dataMap, getModule } = useModule$1();
|
|
26006
26008
|
const moduleDataSource = getModule("$ModuleDataSource");
|
|
26007
26009
|
const [{ isOver }, drop] = useDrop({
|
|
@@ -26040,7 +26042,7 @@ const TitleRender$1 = (props) => {
|
|
|
26040
26042
|
className: cls,
|
|
26041
26043
|
style: { cursor: draggable ? "move" : "default", opacity },
|
|
26042
26044
|
onClick: (e) => e.stopPropagation()
|
|
26043
|
-
}, customRender && customRender({ data, index: index2, onChange, moduleDataSource }), /* @__PURE__ */ React$1.createElement(Icon, {
|
|
26045
|
+
}, customRender && customRender({ data, index: index2, onChange, moduleDataSource, otherInfo }), /* @__PURE__ */ React$1.createElement(Icon, {
|
|
26044
26046
|
type: "close",
|
|
26045
26047
|
size: "small",
|
|
26046
26048
|
className: styles$9.itemClose,
|
|
@@ -26061,7 +26063,8 @@ function MddTableSimpleArray(props) {
|
|
|
26061
26063
|
onRemove,
|
|
26062
26064
|
draggable = true,
|
|
26063
26065
|
titleRender,
|
|
26064
|
-
contentRender: contentRender2
|
|
26066
|
+
contentRender: contentRender2,
|
|
26067
|
+
otherInfo
|
|
26065
26068
|
} = props;
|
|
26066
26069
|
const onSortUpdate = useCallback(
|
|
26067
26070
|
(dragIndex, hoverIndex) => {
|
|
@@ -26106,11 +26109,12 @@ function MddTableSimpleArray(props) {
|
|
|
26106
26109
|
onRemove: () => onRemove(idx),
|
|
26107
26110
|
data: item,
|
|
26108
26111
|
onSortUpdate,
|
|
26109
|
-
customRender: titleRender
|
|
26112
|
+
customRender: titleRender,
|
|
26113
|
+
otherInfo
|
|
26110
26114
|
})
|
|
26111
26115
|
}, /* @__PURE__ */ React$1.createElement("div", {
|
|
26112
26116
|
className: styles$9.collapseContent
|
|
26113
|
-
}, contentRender2({ data: item, index: idx, onChange: onTableArrayChange })));
|
|
26117
|
+
}, contentRender2({ data: item, index: idx, onChange: onTableArrayChange, otherInfo })));
|
|
26114
26118
|
})))), /* @__PURE__ */ React$1.createElement("div", {
|
|
26115
26119
|
className: styles$9.tableArrayBottom
|
|
26116
26120
|
}, /* @__PURE__ */ React$1.createElement(Button, {
|
|
@@ -27237,7 +27241,7 @@ function DetailColumns(props) {
|
|
|
27237
27241
|
data.add(
|
|
27238
27242
|
{
|
|
27239
27243
|
moduleName: "",
|
|
27240
|
-
|
|
27244
|
+
hideSelfCard: true,
|
|
27241
27245
|
params: [],
|
|
27242
27246
|
canUpdateOtherColumns: true,
|
|
27243
27247
|
canBeUpdated: true
|
|
@@ -27314,13 +27318,14 @@ function DetailColumns(props) {
|
|
|
27314
27318
|
forceUpdate({});
|
|
27315
27319
|
},
|
|
27316
27320
|
onAdd: onAddHandle,
|
|
27317
|
-
onRemove: (index2) => onRemoveHandle(index2)
|
|
27321
|
+
onRemove: (index2) => onRemoveHandle(index2),
|
|
27322
|
+
otherInfo: { columnsDirection: data.get("columnsDirection") }
|
|
27318
27323
|
})), data.get("hideCardTitle") ? null : /* @__PURE__ */ React$1.createElement(ActionsPanel, {
|
|
27319
27324
|
schema: data
|
|
27320
27325
|
}));
|
|
27321
27326
|
}
|
|
27322
27327
|
function customTitleRender$1(props) {
|
|
27323
|
-
const { data, index: index2, onChange, moduleDataSource } = props;
|
|
27328
|
+
const { data, index: index2, onChange, moduleDataSource, otherInfo = {} } = props;
|
|
27324
27329
|
return /* @__PURE__ */ React$1.createElement("div", {
|
|
27325
27330
|
className: styles$5.title
|
|
27326
27331
|
}, /* @__PURE__ */ React$1.createElement("div", {
|
|
@@ -27337,7 +27342,7 @@ function customTitleRender$1(props) {
|
|
|
27337
27342
|
dataSource: (moduleDataSource == null ? void 0 : moduleDataSource.l4ModuleOptions) || moduleDataSource || [],
|
|
27338
27343
|
value: data == null ? void 0 : data.moduleName,
|
|
27339
27344
|
onChange: (v2) => onChange({ ...data, moduleName: v2 })
|
|
27340
|
-
})), /* @__PURE__ */ React$1.createElement("div", {
|
|
27345
|
+
})), (otherInfo == null ? void 0 : otherInfo.columnsDirection) === "row" && /* @__PURE__ */ React$1.createElement("div", {
|
|
27341
27346
|
className: styles$5.titleItem
|
|
27342
27347
|
}, /* @__PURE__ */ React$1.createElement("label", {
|
|
27343
27348
|
className: styles$5.titleItemLabel
|
|
@@ -27368,16 +27373,8 @@ function contentRender(props) {
|
|
|
27368
27373
|
});
|
|
27369
27374
|
}
|
|
27370
27375
|
const ContentRender = (props) => {
|
|
27371
|
-
const { data, index: index2, onChange } = props;
|
|
27372
|
-
return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, /* @__PURE__ */ React$1.createElement(Form.Item, {
|
|
27373
|
-
wrapperCol: { span: 20 },
|
|
27374
|
-
labelCol: { span: 4 },
|
|
27375
|
-
label: "\u9690\u85CF \u5F53\u524D\u680F \u5361\u7247",
|
|
27376
|
-
name: ""
|
|
27377
|
-
}, /* @__PURE__ */ React$1.createElement(CnSwitch, {
|
|
27378
|
-
defaultChecked: data == null ? void 0 : data.hideSelfCard,
|
|
27379
|
-
onChange: (v2) => onChange({ index: index2, record: { ...data, hideSelfCard: v2 } })
|
|
27380
|
-
})), /* @__PURE__ */ React$1.createElement(Form.Item, {
|
|
27376
|
+
const { data, index: index2, onChange, otherInfo = {} } = props;
|
|
27377
|
+
return /* @__PURE__ */ React$1.createElement(React$1.Fragment, null, (otherInfo == null ? void 0 : otherInfo.columnsDirection) === "column" && /* @__PURE__ */ React$1.createElement(Form.Item, {
|
|
27381
27378
|
wrapperCol: { span: 20 },
|
|
27382
27379
|
labelCol: { span: 4 },
|
|
27383
27380
|
label: "\u9AD8\u5EA6",
|
|
@@ -27411,6 +27408,14 @@ const ContentRender = (props) => {
|
|
|
27411
27408
|
valueTitle: "value(\u53C2\u6570\u503C) - .$ALL \u53EF\u83B7\u53D6\u6574\u4E2A\u52A8\u6001\u5BF9\u8C61",
|
|
27412
27409
|
value: data == null ? void 0 : data.params,
|
|
27413
27410
|
onChange: (v2) => onChange({ index: index2, record: { ...data, params: v2 } })
|
|
27411
|
+
})), /* @__PURE__ */ React$1.createElement(Form.Item, {
|
|
27412
|
+
wrapperCol: { span: 20 },
|
|
27413
|
+
labelCol: { span: 4 },
|
|
27414
|
+
label: "\u9690\u85CF \u5F53\u524D\u680F \u5361\u7247",
|
|
27415
|
+
name: ""
|
|
27416
|
+
}, /* @__PURE__ */ React$1.createElement(CnSwitch, {
|
|
27417
|
+
defaultChecked: data == null ? void 0 : data.hideSelfCard,
|
|
27418
|
+
onChange: (v2) => onChange({ index: index2, record: { ...data, hideSelfCard: v2 } })
|
|
27414
27419
|
})), /* @__PURE__ */ React$1.createElement(Collapse, {
|
|
27415
27420
|
accordion: true
|
|
27416
27421
|
}, /* @__PURE__ */ React$1.createElement(Panel, {
|
package/package.json
CHANGED
|
@@ -20,7 +20,8 @@ export default class DetailItemSchema extends JSONWatch {
|
|
|
20
20
|
current = 1, // 步骤条,当前步数
|
|
21
21
|
columnsDirection = 'row', // 分栏组件 方向,默认横向分栏
|
|
22
22
|
columnsBoxes = [],
|
|
23
|
-
|
|
23
|
+
height = 100,
|
|
24
|
+
hideCard = true,
|
|
24
25
|
...more
|
|
25
26
|
} = props || {};
|
|
26
27
|
super({
|
|
@@ -41,7 +42,8 @@ export default class DetailItemSchema extends JSONWatch {
|
|
|
41
42
|
current,
|
|
42
43
|
columnsDirection,
|
|
43
44
|
columnsBoxes,
|
|
44
|
-
|
|
45
|
+
height,
|
|
46
|
+
hideCard,
|
|
45
47
|
...more,
|
|
46
48
|
});
|
|
47
49
|
}
|
|
@@ -143,7 +145,7 @@ export default class DetailItemSchema extends JSONWatch {
|
|
|
143
145
|
* {array} actionColumns 操作列
|
|
144
146
|
* {object} pagination 分页
|
|
145
147
|
*/
|
|
146
|
-
if (['columnsBoxes','columns', 'actionColumns', 'bulkActions'].includes(key)) {
|
|
148
|
+
if (['columnsBoxes', 'columns', 'actionColumns', 'bulkActions'].includes(key)) {
|
|
147
149
|
this.data[key].splice(index, 1, record);
|
|
148
150
|
} else {
|
|
149
151
|
this.data[key] = record;
|
|
@@ -195,5 +197,5 @@ export default class DetailItemSchema extends JSONWatch {
|
|
|
195
197
|
this.emit('$updated');
|
|
196
198
|
}
|
|
197
199
|
|
|
198
|
-
delete() {
|
|
200
|
+
delete() {}
|
|
199
201
|
}
|
|
@@ -45,7 +45,7 @@ export default function DetailColumns(props) {
|
|
|
45
45
|
data.add(
|
|
46
46
|
{
|
|
47
47
|
moduleName: '',
|
|
48
|
-
|
|
48
|
+
hideSelfCard: true,
|
|
49
49
|
params: [],
|
|
50
50
|
canUpdateOtherColumns: true,
|
|
51
51
|
canBeUpdated: true,
|
|
@@ -106,6 +106,7 @@ export default function DetailColumns(props) {
|
|
|
106
106
|
}}
|
|
107
107
|
onAdd={onAddHandle}
|
|
108
108
|
onRemove={(index) => onRemoveHandle(index)}
|
|
109
|
+
otherInfo={{ columnsDirection: data.get('columnsDirection') }}
|
|
109
110
|
// onRemove={onRemoveHandle}
|
|
110
111
|
/>
|
|
111
112
|
</Form.Item>
|
|
@@ -115,7 +116,7 @@ export default function DetailColumns(props) {
|
|
|
115
116
|
}
|
|
116
117
|
|
|
117
118
|
function customTitleRender(props) {
|
|
118
|
-
const { data, index, onChange, moduleDataSource } = props;
|
|
119
|
+
const { data, index, onChange, moduleDataSource, otherInfo = {} } = props;
|
|
119
120
|
|
|
120
121
|
return (
|
|
121
122
|
<div className={styles.title}>
|
|
@@ -133,28 +134,30 @@ function customTitleRender(props) {
|
|
|
133
134
|
onChange={(v) => onChange({ ...data, moduleName: v })}
|
|
134
135
|
/>
|
|
135
136
|
</div>
|
|
136
|
-
|
|
137
|
-
<
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
137
|
+
{otherInfo?.columnsDirection === 'row' && (
|
|
138
|
+
<div className={styles.titleItem}>
|
|
139
|
+
<label className={styles.titleItemLabel}>
|
|
140
|
+
<Balloon
|
|
141
|
+
trigger={
|
|
142
|
+
<div style={{ display: 'flex', alignItems: 'center' }}>
|
|
143
|
+
占列数 <Icon type="help" size="small" />
|
|
144
|
+
</div>
|
|
145
|
+
}
|
|
146
|
+
align="t"
|
|
147
|
+
>
|
|
148
|
+
<b>左右布局时,占列数之和应为24</b>
|
|
149
|
+
</Balloon>
|
|
150
|
+
</label>
|
|
151
|
+
<CnNumberPicker
|
|
152
|
+
size="small"
|
|
153
|
+
min={0}
|
|
154
|
+
max={24}
|
|
155
|
+
value={data?.cols}
|
|
156
|
+
onChange={(v) => onChange({ ...data, cols: v })}
|
|
157
|
+
placeholder="占列数 之和应为24"
|
|
158
|
+
/>
|
|
159
|
+
</div>
|
|
160
|
+
)}
|
|
158
161
|
</div>
|
|
159
162
|
);
|
|
160
163
|
}
|
|
@@ -169,30 +172,26 @@ function contentRender(props) {
|
|
|
169
172
|
}
|
|
170
173
|
|
|
171
174
|
const ContentRender = (props) => {
|
|
172
|
-
const { data, index, onChange } = props;
|
|
175
|
+
const { data, index, onChange, otherInfo = {} } = props;
|
|
173
176
|
// const [_, forceUpdate] = React.useState({});
|
|
174
177
|
|
|
175
178
|
return (
|
|
176
179
|
<>
|
|
177
|
-
|
|
178
|
-
<
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
<CnTooltip trigger={<Icon type="prompt" style={{ marginLeft: 6 }} />}>
|
|
193
|
-
仅在上下布局中生效:0-100 的整数,0 表示自动高度
|
|
194
|
-
</CnTooltip>
|
|
195
|
-
</Form.Item>
|
|
180
|
+
{otherInfo?.columnsDirection === 'column' && (
|
|
181
|
+
<Form.Item wrapperCol={{ span: 20 }} labelCol={{ span: 4 }} label="高度" name="">
|
|
182
|
+
<CnNumberPicker
|
|
183
|
+
min={0}
|
|
184
|
+
max={100}
|
|
185
|
+
innerAfter="%"
|
|
186
|
+
style={{ width: 90 }}
|
|
187
|
+
defaultValue={data?.height}
|
|
188
|
+
onChange={(v) => onChange({ index, record: { ...data, height: v } })}
|
|
189
|
+
/>
|
|
190
|
+
<CnTooltip trigger={<Icon type="prompt" style={{ marginLeft: 6 }} />}>
|
|
191
|
+
仅在上下布局中生效:0-100 的整数,0 表示自动高度
|
|
192
|
+
</CnTooltip>
|
|
193
|
+
</Form.Item>
|
|
194
|
+
)}
|
|
196
195
|
<Form.Item
|
|
197
196
|
name=""
|
|
198
197
|
wrapperCol={{ span: 20 }}
|
|
@@ -220,6 +219,12 @@ const ContentRender = (props) => {
|
|
|
220
219
|
onChange={(v) => onChange({ index, record: { ...data, params: v } })}
|
|
221
220
|
/>
|
|
222
221
|
</Form.Item>
|
|
222
|
+
<Form.Item wrapperCol={{ span: 20 }} labelCol={{ span: 4 }} label="隐藏 当前栏 卡片" name="">
|
|
223
|
+
<CnSwitch
|
|
224
|
+
defaultChecked={data?.hideSelfCard}
|
|
225
|
+
onChange={(v) => onChange({ index, record: { ...data, hideSelfCard: v } })}
|
|
226
|
+
/>
|
|
227
|
+
</Form.Item>
|
|
223
228
|
<Collapse accordion>
|
|
224
229
|
<Panel
|
|
225
230
|
title={
|