cnhis-design-vue 3.1.17-beta.5 → 3.1.17-beta.8
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/es/packages/big-table/index.d.ts +6 -8
- package/es/packages/big-table/src/BigTable.vue.d.ts +11 -15
- package/es/packages/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +8 -6
- package/es/packages/big-table/src/components/edit-form/edit-date.js +15 -2
- package/es/packages/big-table/src/components/edit-form/edit-input.js +14 -3
- package/es/packages/big-table/src/components/edit-form/edit-select.d.ts +1 -1
- package/es/packages/big-table/src/components/edit-form/edit-select.js +14 -3
- package/es/packages/big-table/src/components/edit-form/edit-separate.js +12 -11
- package/es/packages/big-table/src/components/edit-form/edit-separate.vue.d.ts +13 -1
- package/es/packages/big-table/src/components/edit-form/edit-time.js +15 -2
- package/es/packages/big-table/src/hooks/useEdit.d.ts +14 -8
- package/es/packages/big-table/src/hooks/useEdit.js +0 -20
- package/es/packages/big-table/style/index.css +6 -0
- package/es/packages/fabric-chart/src/hooks/useLeft.js +4 -3
- package/es/packages/field-set/index.d.ts +22 -26
- package/es/packages/field-set/src/FieldSet.js +107 -43
- package/es/packages/field-set/src/FieldSet.vue.d.ts +18 -26
- package/es/packages/field-set/style/index.css +5 -5
- package/es/packages/form-config/style/index.css +13 -2
- package/es/packages/form-render/src/components/renderer/formItem.js +2 -2
- package/es/packages/form-render/src/components/renderer/inputNumber.d.ts +16 -2
- package/es/packages/form-render/src/components/renderer/inputNumber.js +31 -4
- package/es/packages/form-render/src/hooks/useCommonInjection.js +4 -1
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +4 -6
- package/es/packages/form-render/src/hooks/useFormValidator.js +20 -5
- package/es/packages/form-render/src/utils/dom.js +2 -2
- package/es/packages/form-render/src/utils/index.js +1 -1
- package/es/packages/form-render/src/utils/schema.d.ts +1 -1
- package/es/packages/form-render/src/utils/schema.js +4 -4
- package/es/packages/index.css +24 -7
- package/es/packages/scale-view/src/hooks/use-component.d.ts +1 -1
- package/es/packages/select-label/index.d.ts +2 -2
- package/es/packages/select-label/src/LabelFormContent.vue.d.ts +1 -1
- package/es/packages/select-label/src/SelectLabel.vue.d.ts +1 -1
- package/es/src/utils/colorLog.d.ts +31 -0
- package/es/src/utils/colorLog.js +44 -0
- package/package.json +3 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, reactive, onMounted, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, normalizeClass, createCommentVNode, createBlock,
|
|
1
|
+
import { defineComponent, ref, computed, reactive, onMounted, openBlock, createElementBlock, normalizeStyle, createVNode, unref, withCtx, createElementVNode, normalizeClass, createCommentVNode, createBlock, toDisplayString, withDirectives, vShow, renderSlot, createTextVNode } from 'vue';
|
|
2
2
|
import { NSpin, NCheckbox, NTooltip, NSelect, NInput, NInputNumber, NButton } from 'naive-ui';
|
|
3
3
|
import Draggable from 'vuedraggable';
|
|
4
4
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.js';
|
|
@@ -17,26 +17,44 @@ const _hoisted_8 = /* @__PURE__ */ createTextVNode(" \u6392\u5E8F ");
|
|
|
17
17
|
const _hoisted_9 = /* @__PURE__ */ createElementVNode("span", { class: "width-showed" }, "\u56FA\u5B9A", -1);
|
|
18
18
|
const _hoisted_10 = /* @__PURE__ */ createElementVNode("span", { class: "width-word" }, "\u81EA\u5B9A\u4E49\u6807\u9898", -1);
|
|
19
19
|
const _hoisted_11 = /* @__PURE__ */ createElementVNode("span", { class: "width-showed" }, "\u5217\u5BBD", -1);
|
|
20
|
-
const _hoisted_12 =
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
const _hoisted_12 = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "width-show"
|
|
23
|
+
};
|
|
24
|
+
const _hoisted_13 = /* @__PURE__ */ createTextVNode(" \u7F16\u8F91 ");
|
|
25
|
+
const _hoisted_14 = {
|
|
26
|
+
key: 1,
|
|
27
|
+
class: "width-show"
|
|
28
|
+
};
|
|
29
|
+
const _hoisted_15 = /* @__PURE__ */ createTextVNode(" \u5FC5\u586B ");
|
|
30
|
+
const _hoisted_16 = ["onClick"];
|
|
31
|
+
const _hoisted_17 = { class: "width-show drag-icon-wrap" };
|
|
32
|
+
const _hoisted_18 = /* @__PURE__ */ createElementVNode("span", {
|
|
23
33
|
class: "iconfont icon-a-menzhenyishengzhanxitongtubiaotuozhuai",
|
|
24
34
|
style: { "color": "#000" }
|
|
25
35
|
}, null, -1);
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
36
|
+
const _hoisted_19 = /* @__PURE__ */ createElementVNode("span", null, "\u62D6\u62FD\u8C03\u6574\u987A\u5E8F", -1);
|
|
37
|
+
const _hoisted_20 = /* @__PURE__ */ createElementVNode("span", { style: { "width": "14px", "margin-right": "6px" } }, null, -1);
|
|
38
|
+
const _hoisted_21 = { class: "width-show" };
|
|
39
|
+
const _hoisted_22 = { class: "width-show" };
|
|
40
|
+
const _hoisted_23 = { class: "width-showed" };
|
|
41
|
+
const _hoisted_24 = { class: "width-word" };
|
|
42
|
+
const _hoisted_25 = { class: "width-showed" };
|
|
43
|
+
const _hoisted_26 = {
|
|
44
|
+
key: 0,
|
|
45
|
+
class: "width-show"
|
|
46
|
+
};
|
|
47
|
+
const _hoisted_27 = {
|
|
48
|
+
key: 1,
|
|
49
|
+
class: "width-show"
|
|
50
|
+
};
|
|
51
|
+
const _hoisted_28 = {
|
|
34
52
|
key: 0,
|
|
35
53
|
class: "check-options"
|
|
36
54
|
};
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
55
|
+
const _hoisted_29 = { class: "btn-operate" };
|
|
56
|
+
const _hoisted_30 = /* @__PURE__ */ createTextVNode("\u53D6\u6D88");
|
|
57
|
+
const _hoisted_31 = /* @__PURE__ */ createTextVNode("\u4FDD\u5B58");
|
|
40
58
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
41
59
|
__name: "FieldSet",
|
|
42
60
|
props: {
|
|
@@ -46,14 +64,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
46
64
|
return [];
|
|
47
65
|
}
|
|
48
66
|
},
|
|
49
|
-
menuSource: {
|
|
50
|
-
type: String,
|
|
51
|
-
default: ""
|
|
52
|
-
},
|
|
53
|
-
drawerDirection: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: "right"
|
|
56
|
-
},
|
|
57
67
|
footerFlag: {
|
|
58
68
|
type: Boolean,
|
|
59
69
|
default: true
|
|
@@ -61,6 +71,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
61
71
|
type: {
|
|
62
72
|
type: String,
|
|
63
73
|
default: "old"
|
|
74
|
+
},
|
|
75
|
+
isEdit: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false
|
|
64
78
|
}
|
|
65
79
|
},
|
|
66
80
|
emits: ["onSave", "onClose"],
|
|
@@ -108,7 +122,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
108
122
|
spinning: false,
|
|
109
123
|
isCustomSearch: true,
|
|
110
124
|
clickItem: {},
|
|
111
|
-
fields: realityFields.value
|
|
125
|
+
fields: realityFields.value,
|
|
126
|
+
widthShow: "10%",
|
|
127
|
+
widthLarge: "20%"
|
|
112
128
|
});
|
|
113
129
|
const leftStyle = (ele) => {
|
|
114
130
|
return {
|
|
@@ -135,7 +151,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
135
151
|
sortable: item.sort,
|
|
136
152
|
title: item.alias || item.title,
|
|
137
153
|
fixed: item.fixedWay,
|
|
138
|
-
minWidth: item.columnWidth
|
|
154
|
+
minWidth: item.columnWidth,
|
|
155
|
+
...props.isEdit ? {
|
|
156
|
+
required: item.required,
|
|
157
|
+
editable: item.editable
|
|
158
|
+
} : {}
|
|
139
159
|
});
|
|
140
160
|
});
|
|
141
161
|
}
|
|
@@ -172,8 +192,15 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
172
192
|
const handleFieldClick = (item) => {
|
|
173
193
|
state.clickItem = item;
|
|
174
194
|
};
|
|
195
|
+
function setWidth() {
|
|
196
|
+
if (props.isEdit) {
|
|
197
|
+
state.widthShow = "9%";
|
|
198
|
+
state.widthLarge = "15%";
|
|
199
|
+
}
|
|
200
|
+
}
|
|
175
201
|
onMounted(() => {
|
|
176
202
|
hideTab();
|
|
203
|
+
setWidth();
|
|
177
204
|
});
|
|
178
205
|
expose({
|
|
179
206
|
getTableFields
|
|
@@ -182,7 +209,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
182
209
|
return openBlock(), createElementBlock("div", {
|
|
183
210
|
ref_key: "settingView",
|
|
184
211
|
ref: settingView,
|
|
185
|
-
class: "c-field-set"
|
|
212
|
+
class: "c-field-set",
|
|
213
|
+
style: normalizeStyle({ "--width-show": state.widthShow, "--width-large": state.widthLarge })
|
|
186
214
|
}, [
|
|
187
215
|
createVNode(unref(NSpin), {
|
|
188
216
|
show: state.spinning,
|
|
@@ -221,7 +249,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
221
249
|
createCommentVNode(" \u81EA\u5B9A\u4E49\u6807\u9898 "),
|
|
222
250
|
_hoisted_10,
|
|
223
251
|
createCommentVNode(" \u5217\u5BBD "),
|
|
224
|
-
_hoisted_11
|
|
252
|
+
_hoisted_11,
|
|
253
|
+
createCommentVNode(" \u53EF\u7F16\u8F91 "),
|
|
254
|
+
__props.isEdit ? (openBlock(), createElementBlock("span", _hoisted_12, [
|
|
255
|
+
showCheckBox("editable") ? (openBlock(), createBlock(unref(NCheckbox), {
|
|
256
|
+
key: 0,
|
|
257
|
+
checked: calculateCheck("editable"),
|
|
258
|
+
"onUpdate:checked": _cache[2] || (_cache[2] = ($event) => handleAllCheck($event, "editable"))
|
|
259
|
+
}, null, 8, ["checked"])) : createCommentVNode("v-if", true),
|
|
260
|
+
_hoisted_13
|
|
261
|
+
])) : createCommentVNode("v-if", true),
|
|
262
|
+
createCommentVNode(" \u662F\u5426\u5FC5\u586B "),
|
|
263
|
+
__props.isEdit ? (openBlock(), createElementBlock("span", _hoisted_14, [
|
|
264
|
+
showCheckBox("required") ? (openBlock(), createBlock(unref(NCheckbox), {
|
|
265
|
+
key: 0,
|
|
266
|
+
checked: calculateCheck("required"),
|
|
267
|
+
"onUpdate:checked": _cache[3] || (_cache[3] = ($event) => handleAllCheck($event, "required"))
|
|
268
|
+
}, null, 8, ["checked"])) : createCommentVNode("v-if", true),
|
|
269
|
+
_hoisted_15
|
|
270
|
+
])) : createCommentVNode("v-if", true)
|
|
225
271
|
], 2),
|
|
226
272
|
createElementVNode("div", {
|
|
227
273
|
ref: "setShow",
|
|
@@ -239,13 +285,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
239
285
|
style: normalizeStyle(leftStyle(element)),
|
|
240
286
|
onClick: ($event) => handleFieldClick(element)
|
|
241
287
|
}, [
|
|
242
|
-
createElementVNode("span",
|
|
288
|
+
createElementVNode("span", _hoisted_17, [
|
|
243
289
|
createVNode(unref(NTooltip), { trigger: "hover" }, {
|
|
244
290
|
trigger: withCtx(() => [
|
|
245
|
-
|
|
291
|
+
_hoisted_18
|
|
246
292
|
]),
|
|
247
293
|
default: withCtx(() => [
|
|
248
|
-
|
|
294
|
+
_hoisted_19
|
|
249
295
|
]),
|
|
250
296
|
_: 1
|
|
251
297
|
})
|
|
@@ -254,11 +300,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
254
300
|
createElementVNode("span", {
|
|
255
301
|
class: normalizeClass(["width-large title-item", { blue: element.extraField }])
|
|
256
302
|
}, [
|
|
257
|
-
|
|
303
|
+
_hoisted_20,
|
|
258
304
|
createElementVNode("span", null, toDisplayString(element.title), 1)
|
|
259
305
|
], 2),
|
|
260
306
|
createCommentVNode(" \u663E\u793A "),
|
|
261
|
-
createElementVNode("span",
|
|
307
|
+
createElementVNode("span", _hoisted_21, [
|
|
262
308
|
withDirectives(createVNode(unref(NCheckbox), {
|
|
263
309
|
checked: element.show,
|
|
264
310
|
"onUpdate:checked": ($event) => element.show = $event
|
|
@@ -267,7 +313,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
267
313
|
])
|
|
268
314
|
]),
|
|
269
315
|
createCommentVNode(" \u6392\u5E8F "),
|
|
270
|
-
createElementVNode("span",
|
|
316
|
+
createElementVNode("span", _hoisted_22, [
|
|
271
317
|
withDirectives(createVNode(unref(NCheckbox), {
|
|
272
318
|
checked: element.sort,
|
|
273
319
|
"onUpdate:checked": ($event) => element.sort = $event,
|
|
@@ -277,7 +323,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
277
323
|
])
|
|
278
324
|
]),
|
|
279
325
|
createCommentVNode(" \u56FA\u5B9A "),
|
|
280
|
-
createElementVNode("span",
|
|
326
|
+
createElementVNode("span", _hoisted_23, [
|
|
281
327
|
createVNode(unref(NSelect), {
|
|
282
328
|
value: element.fixedWay,
|
|
283
329
|
"onUpdate:value": ($event) => element.fixedWay = $event,
|
|
@@ -286,7 +332,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
286
332
|
}, null, 8, ["value", "onUpdate:value"])
|
|
287
333
|
]),
|
|
288
334
|
createCommentVNode(" \u81EA\u5B9A\u4E49\u6807\u9898 "),
|
|
289
|
-
createElementVNode("span",
|
|
335
|
+
createElementVNode("span", _hoisted_24, [
|
|
290
336
|
withDirectives(createVNode(unref(NInput), {
|
|
291
337
|
value: element.alias,
|
|
292
338
|
"onUpdate:value": ($event) => element.alias = $event,
|
|
@@ -296,28 +342,46 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
296
342
|
])
|
|
297
343
|
]),
|
|
298
344
|
createCommentVNode(" \u5217\u5BBD "),
|
|
299
|
-
createElementVNode("span",
|
|
345
|
+
createElementVNode("span", _hoisted_25, [
|
|
300
346
|
createVNode(unref(NInputNumber), {
|
|
301
347
|
value: element.columnWidth,
|
|
302
348
|
"onUpdate:value": ($event) => element.columnWidth = $event,
|
|
303
349
|
style: { width: "120px" }
|
|
304
350
|
}, null, 8, ["value", "onUpdate:value"])
|
|
305
|
-
])
|
|
306
|
-
|
|
351
|
+
]),
|
|
352
|
+
createCommentVNode(" \u662F\u5426\u53EF\u7F16\u8F91 "),
|
|
353
|
+
__props.isEdit ? (openBlock(), createElementBlock("span", _hoisted_26, [
|
|
354
|
+
withDirectives(createVNode(unref(NCheckbox), {
|
|
355
|
+
checked: element.editable,
|
|
356
|
+
"onUpdate:checked": ($event) => element.editable = $event
|
|
357
|
+
}, null, 8, ["checked", "onUpdate:checked"]), [
|
|
358
|
+
[vShow, element.id != "0001"]
|
|
359
|
+
])
|
|
360
|
+
])) : createCommentVNode("v-if", true),
|
|
361
|
+
createCommentVNode(" \u662F\u5426\u5FC5\u586B "),
|
|
362
|
+
__props.isEdit ? (openBlock(), createElementBlock("span", _hoisted_27, [
|
|
363
|
+
withDirectives(createVNode(unref(NCheckbox), {
|
|
364
|
+
checked: element.required,
|
|
365
|
+
"onUpdate:checked": ($event) => element.required = $event
|
|
366
|
+
}, null, 8, ["checked", "onUpdate:checked"]), [
|
|
367
|
+
[vShow, element.id != "0001"]
|
|
368
|
+
])
|
|
369
|
+
])) : createCommentVNode("v-if", true)
|
|
370
|
+
], 12, _hoisted_16)
|
|
307
371
|
]),
|
|
308
372
|
_: 1
|
|
309
373
|
}, 8, ["list"])
|
|
310
374
|
], 2)
|
|
311
375
|
]),
|
|
312
|
-
props.footerFlag ? (openBlock(), createElementBlock("div",
|
|
313
|
-
createElementVNode("div",
|
|
376
|
+
props.footerFlag ? (openBlock(), createElementBlock("div", _hoisted_28, [
|
|
377
|
+
createElementVNode("div", _hoisted_29, [
|
|
314
378
|
renderSlot(_ctx.$slots, "footer", {}, () => [
|
|
315
379
|
createVNode(unref(NButton), {
|
|
316
380
|
style: { "margin-right": "8px" },
|
|
317
381
|
onClick: onCancle
|
|
318
382
|
}, {
|
|
319
383
|
default: withCtx(() => [
|
|
320
|
-
|
|
384
|
+
_hoisted_30
|
|
321
385
|
]),
|
|
322
386
|
_: 1
|
|
323
387
|
}),
|
|
@@ -326,7 +390,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
326
390
|
onClick: handleFieldSave
|
|
327
391
|
}, {
|
|
328
392
|
default: withCtx(() => [
|
|
329
|
-
|
|
393
|
+
_hoisted_31
|
|
330
394
|
]),
|
|
331
395
|
_: 1
|
|
332
396
|
})
|
|
@@ -337,7 +401,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
337
401
|
]),
|
|
338
402
|
_: 3
|
|
339
403
|
}, 8, ["show"])
|
|
340
|
-
],
|
|
404
|
+
], 4);
|
|
341
405
|
};
|
|
342
406
|
}
|
|
343
407
|
});
|
|
@@ -9,6 +9,8 @@ declare type Ifields = {
|
|
|
9
9
|
fixedShow: boolean;
|
|
10
10
|
fixedWay: 'NONE' | 'LEFT' | 'RIGHT';
|
|
11
11
|
columnWidth: number;
|
|
12
|
+
editable: boolean;
|
|
13
|
+
required: boolean;
|
|
12
14
|
[key: string]: any;
|
|
13
15
|
};
|
|
14
16
|
declare type Istate = {
|
|
@@ -18,20 +20,14 @@ declare type Istate = {
|
|
|
18
20
|
[key: string]: any;
|
|
19
21
|
};
|
|
20
22
|
fields: Ifields[];
|
|
23
|
+
widthShow: string;
|
|
24
|
+
widthLarge: string;
|
|
21
25
|
};
|
|
22
26
|
declare const _default: import("vue").DefineComponent<{
|
|
23
27
|
fields: {
|
|
24
28
|
type: PropType<any[]>;
|
|
25
29
|
default: () => never[];
|
|
26
30
|
};
|
|
27
|
-
menuSource: {
|
|
28
|
-
type: StringConstructor;
|
|
29
|
-
default: string;
|
|
30
|
-
};
|
|
31
|
-
drawerDirection: {
|
|
32
|
-
type: StringConstructor;
|
|
33
|
-
default: string;
|
|
34
|
-
};
|
|
35
31
|
footerFlag: {
|
|
36
32
|
type: BooleanConstructor;
|
|
37
33
|
default: boolean;
|
|
@@ -40,6 +36,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
40
36
|
type: StringConstructor;
|
|
41
37
|
default: string;
|
|
42
38
|
};
|
|
39
|
+
isEdit: {
|
|
40
|
+
type: BooleanConstructor;
|
|
41
|
+
default: boolean;
|
|
42
|
+
};
|
|
43
43
|
}, {
|
|
44
44
|
fieldsMapping: Record<string, string>;
|
|
45
45
|
selectOptions: Record<string, string>[];
|
|
@@ -50,14 +50,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
50
50
|
type: PropType<any[]>;
|
|
51
51
|
default: () => never[];
|
|
52
52
|
};
|
|
53
|
-
menuSource: {
|
|
54
|
-
type: StringConstructor;
|
|
55
|
-
default: string;
|
|
56
|
-
};
|
|
57
|
-
drawerDirection: {
|
|
58
|
-
type: StringConstructor;
|
|
59
|
-
default: string;
|
|
60
|
-
};
|
|
61
53
|
footerFlag: {
|
|
62
54
|
type: BooleanConstructor;
|
|
63
55
|
default: boolean;
|
|
@@ -66,6 +58,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
66
58
|
type: StringConstructor;
|
|
67
59
|
default: string;
|
|
68
60
|
};
|
|
61
|
+
isEdit: {
|
|
62
|
+
type: BooleanConstructor;
|
|
63
|
+
default: boolean;
|
|
64
|
+
};
|
|
69
65
|
}>> & {
|
|
70
66
|
onOnSave?: ((...args: any[]) => any) | undefined;
|
|
71
67
|
onOnClose?: ((...args: any[]) => any) | undefined;
|
|
@@ -83,6 +79,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
83
79
|
calculateCheck: (key: string) => boolean;
|
|
84
80
|
handleAllCheck: (e: boolean, key: string) => void;
|
|
85
81
|
handleFieldClick: (item: Ifields) => void;
|
|
82
|
+
setWidth: () => void;
|
|
86
83
|
NButton: import("vue").DefineComponent<{
|
|
87
84
|
readonly color: StringConstructor;
|
|
88
85
|
readonly textColor: StringConstructor;
|
|
@@ -6959,14 +6956,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6959
6956
|
type: PropType<any[]>;
|
|
6960
6957
|
default: () => never[];
|
|
6961
6958
|
};
|
|
6962
|
-
menuSource: {
|
|
6963
|
-
type: StringConstructor;
|
|
6964
|
-
default: string;
|
|
6965
|
-
};
|
|
6966
|
-
drawerDirection: {
|
|
6967
|
-
type: StringConstructor;
|
|
6968
|
-
default: string;
|
|
6969
|
-
};
|
|
6970
6959
|
footerFlag: {
|
|
6971
6960
|
type: BooleanConstructor;
|
|
6972
6961
|
default: boolean;
|
|
@@ -6975,14 +6964,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6975
6964
|
type: StringConstructor;
|
|
6976
6965
|
default: string;
|
|
6977
6966
|
};
|
|
6967
|
+
isEdit: {
|
|
6968
|
+
type: BooleanConstructor;
|
|
6969
|
+
default: boolean;
|
|
6970
|
+
};
|
|
6978
6971
|
}>> & {
|
|
6979
6972
|
onOnSave?: ((...args: any[]) => any) | undefined;
|
|
6980
6973
|
onOnClose?: ((...args: any[]) => any) | undefined;
|
|
6981
6974
|
}, {
|
|
6982
6975
|
type: string;
|
|
6983
6976
|
fields: any[];
|
|
6984
|
-
menuSource: string;
|
|
6985
|
-
drawerDirection: string;
|
|
6986
6977
|
footerFlag: boolean;
|
|
6978
|
+
isEdit: boolean;
|
|
6987
6979
|
}>;
|
|
6988
6980
|
export default _default;
|
|
@@ -100,10 +100,10 @@
|
|
|
100
100
|
}
|
|
101
101
|
.c-field-set .width-show {
|
|
102
102
|
display: inline-block;
|
|
103
|
-
width: 10%;
|
|
104
103
|
overflow: hidden;
|
|
105
104
|
white-space: nowrap;
|
|
106
105
|
text-overflow: ellipsis;
|
|
106
|
+
width: var(--width-show);
|
|
107
107
|
}
|
|
108
108
|
.c-field-set .drag-icon-wrap {
|
|
109
109
|
width: 5% !important;
|
|
@@ -112,28 +112,28 @@
|
|
|
112
112
|
}
|
|
113
113
|
.c-field-set .width-showed {
|
|
114
114
|
display: inline-block;
|
|
115
|
-
width: 15%;
|
|
116
115
|
overflow: hidden;
|
|
117
116
|
white-space: nowrap;
|
|
118
117
|
text-overflow: ellipsis;
|
|
118
|
+
width: 15%;
|
|
119
119
|
}
|
|
120
120
|
.c-field-set .width-showed select {
|
|
121
121
|
width: 90% !important;
|
|
122
122
|
}
|
|
123
123
|
.c-field-set .width-word {
|
|
124
124
|
display: inline-block;
|
|
125
|
-
width: 20%;
|
|
126
|
-
line-height: 52px;
|
|
127
125
|
overflow: hidden;
|
|
128
126
|
white-space: nowrap;
|
|
127
|
+
width: var(--width-large);
|
|
128
|
+
line-height: 52px;
|
|
129
129
|
}
|
|
130
130
|
.c-field-set .width-word input {
|
|
131
131
|
width: 90% !important;
|
|
132
132
|
}
|
|
133
133
|
.c-field-set .width-large {
|
|
134
134
|
display: inline-block;
|
|
135
|
-
width: 20%;
|
|
136
135
|
overflow: hidden;
|
|
137
136
|
white-space: nowrap;
|
|
138
137
|
text-overflow: ellipsis;
|
|
138
|
+
width: var(--width-large);
|
|
139
139
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
padding: 16px;
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
flex-shrink: 0;
|
|
9
|
+
border-radius: 8px;
|
|
9
10
|
width: 200px;
|
|
10
11
|
}
|
|
11
12
|
.form-config__materialHeader {
|
|
@@ -18,6 +19,8 @@
|
|
|
18
19
|
padding: 16px;
|
|
19
20
|
box-sizing: border-box;
|
|
20
21
|
flex-shrink: 0;
|
|
22
|
+
border-radius: 8px;
|
|
23
|
+
border: 1px dashed rgba(128, 128, 128, 0.35);
|
|
21
24
|
overflow-y: auto;
|
|
22
25
|
max-height: var(--max-height);
|
|
23
26
|
min-height: 200px;
|
|
@@ -27,12 +30,14 @@
|
|
|
27
30
|
}
|
|
28
31
|
.form-config__materialContentItem {
|
|
29
32
|
cursor: move;
|
|
33
|
+
justify-content: flex-start;
|
|
30
34
|
grid-column: span var(--item-column) / span var(--item-column);
|
|
31
35
|
}
|
|
32
36
|
.form-config__displayWrapper {
|
|
33
37
|
padding: 16px;
|
|
34
38
|
box-sizing: border-box;
|
|
35
39
|
flex-shrink: 0;
|
|
40
|
+
border-radius: 8px;
|
|
36
41
|
min-width: 400px;
|
|
37
42
|
flex: 1;
|
|
38
43
|
padding: 16px 0;
|
|
@@ -47,6 +52,8 @@
|
|
|
47
52
|
padding: 16px;
|
|
48
53
|
box-sizing: border-box;
|
|
49
54
|
flex-shrink: 0;
|
|
55
|
+
border-radius: 8px;
|
|
56
|
+
border: 1px dashed rgba(128, 128, 128, 0.35);
|
|
50
57
|
overflow-y: auto;
|
|
51
58
|
max-height: var(--max-height);
|
|
52
59
|
height: fit-content;
|
|
@@ -62,6 +69,7 @@
|
|
|
62
69
|
padding: 16px;
|
|
63
70
|
box-sizing: border-box;
|
|
64
71
|
flex-shrink: 0;
|
|
72
|
+
border-radius: 8px;
|
|
65
73
|
width: 240px;
|
|
66
74
|
}
|
|
67
75
|
.form-config__configHeader {
|
|
@@ -74,7 +82,10 @@
|
|
|
74
82
|
padding: 16px;
|
|
75
83
|
box-sizing: border-box;
|
|
76
84
|
flex-shrink: 0;
|
|
85
|
+
border-radius: 8px;
|
|
86
|
+
border: 1px dashed rgba(128, 128, 128, 0.35);
|
|
77
87
|
overflow-y: auto;
|
|
88
|
+
border: none;
|
|
78
89
|
max-height: var(--max-height);
|
|
79
90
|
}
|
|
80
91
|
.form-config__renderer {
|
|
@@ -87,7 +98,7 @@
|
|
|
87
98
|
width: 100%;
|
|
88
99
|
display: flex;
|
|
89
100
|
align-items: center;
|
|
90
|
-
padding: 8px;
|
|
101
|
+
padding: 8px 0;
|
|
91
102
|
box-sizing: border-box;
|
|
92
103
|
user-select: none;
|
|
93
104
|
position: relative;
|
|
@@ -143,5 +154,5 @@
|
|
|
143
154
|
visibility: hidden;
|
|
144
155
|
top: 50%;
|
|
145
156
|
transform: translateY(-50%);
|
|
146
|
-
right:
|
|
157
|
+
right: 4px;
|
|
147
158
|
}
|
|
@@ -4,7 +4,7 @@ import { useField, connect, mapProps } from '@formily/vue';
|
|
|
4
4
|
import { NFormItem } from 'naive-ui';
|
|
5
5
|
import AnnotationEdit from '../../../../../packages/annotation-edit';
|
|
6
6
|
import { InjectionAnnotation, InjectionFormUUID } from '../../../../../packages/form-render/src/constants';
|
|
7
|
-
import {
|
|
7
|
+
import { dotEscape } from '../../../../../packages/form-render/src/utils';
|
|
8
8
|
|
|
9
9
|
const script = defineComponent({
|
|
10
10
|
props: {
|
|
@@ -42,7 +42,7 @@ const script = defineComponent({
|
|
|
42
42
|
const field = useField();
|
|
43
43
|
const uuid = inject(InjectionFormUUID);
|
|
44
44
|
const id = computed(() => {
|
|
45
|
-
return
|
|
45
|
+
return dotEscape(`${uuid}-${field.value.path.toString()}`);
|
|
46
46
|
});
|
|
47
47
|
function renderLabel() {
|
|
48
48
|
return showLabel.value ? createVNode("section", {
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import { Func } from '../../../../../../es/src/types';
|
|
2
|
+
import { PropType } from 'vue';
|
|
1
3
|
export declare const INPUT_NUMBER: import("vue").DefineComponent<{
|
|
2
|
-
|
|
4
|
+
value: {
|
|
5
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
6
|
+
};
|
|
7
|
+
onChange: {
|
|
8
|
+
type: PropType<Func<any[], any>>;
|
|
9
|
+
required: true;
|
|
10
|
+
};
|
|
3
11
|
prefix: {
|
|
4
12
|
type: StringConstructor;
|
|
5
13
|
};
|
|
@@ -7,7 +15,13 @@ export declare const INPUT_NUMBER: import("vue").DefineComponent<{
|
|
|
7
15
|
type: StringConstructor;
|
|
8
16
|
};
|
|
9
17
|
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10
|
-
|
|
18
|
+
value: {
|
|
19
|
+
type: (NumberConstructor | StringConstructor)[];
|
|
20
|
+
};
|
|
21
|
+
onChange: {
|
|
22
|
+
type: PropType<Func<any[], any>>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
11
25
|
prefix: {
|
|
12
26
|
type: StringConstructor;
|
|
13
27
|
};
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import { defineComponent, createVNode } from 'vue';
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, watch, computed, createVNode } from 'vue';
|
|
2
|
+
import { isString, isNumber } from 'lodash-es';
|
|
3
|
+
import { useCommonInjection } from '../../../../../packages/form-render/src/hooks/useCommonInjection';
|
|
4
|
+
import { createInputSlot, parseNumberFromMaybeString } from '../../utils/index.js';
|
|
3
5
|
import { connect, mapProps } from '@formily/vue';
|
|
4
6
|
import { NInputNumber } from 'naive-ui';
|
|
5
7
|
import { assignUpdateValue } from '../../utils/schema.js';
|
|
6
8
|
|
|
7
9
|
const script = defineComponent({
|
|
8
10
|
props: {
|
|
9
|
-
|
|
11
|
+
value: {
|
|
12
|
+
type: [Number, String]
|
|
13
|
+
},
|
|
14
|
+
onChange: {
|
|
15
|
+
type: Function,
|
|
16
|
+
required: true
|
|
17
|
+
},
|
|
10
18
|
prefix: {
|
|
11
19
|
type: String
|
|
12
20
|
},
|
|
@@ -16,8 +24,27 @@ const script = defineComponent({
|
|
|
16
24
|
},
|
|
17
25
|
setup(props) {
|
|
18
26
|
const _slots = createInputSlot(props);
|
|
27
|
+
useCommonInjection().injectValueValidate(() => props.value);
|
|
28
|
+
watch(() => props.value, (value) => {
|
|
29
|
+
if (value == null)
|
|
30
|
+
return;
|
|
31
|
+
if (!isString(value) && !isNumber(value) || Number.isNaN(+value))
|
|
32
|
+
return props.onChange(null);
|
|
33
|
+
props.onChange(+value);
|
|
34
|
+
});
|
|
35
|
+
const valueRef = computed({
|
|
36
|
+
get: () => parseNumberFromMaybeString(props.value),
|
|
37
|
+
set: (v) => {
|
|
38
|
+
var _a;
|
|
39
|
+
return (_a = props.onChange) == null ? void 0 : _a.call(props, v);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
19
42
|
return () => {
|
|
20
|
-
return createVNode(NInputNumber,
|
|
43
|
+
return createVNode(NInputNumber, {
|
|
44
|
+
"value": valueRef.value,
|
|
45
|
+
"onUpdate:value": ($event) => valueRef.value = $event,
|
|
46
|
+
"show-button": false
|
|
47
|
+
}, _slots.value);
|
|
21
48
|
};
|
|
22
49
|
}
|
|
23
50
|
});
|
|
@@ -7,7 +7,10 @@ function useCommonInjection() {
|
|
|
7
7
|
const { field } = useFormField();
|
|
8
8
|
watch(traverser, () => {
|
|
9
9
|
var _a, _b;
|
|
10
|
-
|
|
10
|
+
try {
|
|
11
|
+
isField(field.value) && field.value.visited && ((_b = (_a = field.value).validate) == null ? void 0 : _b.call(_a));
|
|
12
|
+
} catch (e) {
|
|
13
|
+
}
|
|
11
14
|
});
|
|
12
15
|
}
|
|
13
16
|
function injectValueWatchFromEmpty(traverser, trigger) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isObject } from '@vueuse/core';
|
|
2
|
-
import { cloneDeep, pick } from 'lodash-es';
|
|
2
|
+
import { cloneDeep, omit, pick } from 'lodash-es';
|
|
3
3
|
import { useFormValidator, useFieldNormalize } from '../../../../packages/form-render';
|
|
4
4
|
import { arrayed, parseNumberFromMaybeString, formRenderLog } from '../utils/index.js';
|
|
5
5
|
import { fieldKeyEscape, createLinebarId } from '../utils/schema.js';
|
|
@@ -20,9 +20,9 @@ function useFieldListAdaptor(collector) {
|
|
|
20
20
|
clearable: item.is_empty === "0",
|
|
21
21
|
...item.componentProps || {},
|
|
22
22
|
onBlur(...args) {
|
|
23
|
-
var _a2;
|
|
23
|
+
var _a2, _b;
|
|
24
24
|
collector.trigger(item.val_key, "blur");
|
|
25
|
-
(_a2 = item.componentProps) == null ? void 0 : _a2.onBlur(...args);
|
|
25
|
+
(_b = (_a2 = item.componentProps) == null ? void 0 : _a2.onBlur) == null ? void 0 : _b.call(_a2, ...args);
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
"x-display": item.is_show === "0" ? "hidden" : "visible",
|
|
@@ -122,8 +122,6 @@ function useFieldListAdaptor(collector) {
|
|
|
122
122
|
const { decimal_length, validate } = item;
|
|
123
123
|
Object.assign(schema["x-component-props"], {
|
|
124
124
|
precision: decimal_length || (validate == null ? void 0 : validate.decimal_length),
|
|
125
|
-
max: validate == null ? void 0 : validate.max_value,
|
|
126
|
-
min: validate == null ? void 0 : validate.min_value,
|
|
127
125
|
prefix: item.prefix,
|
|
128
126
|
suffix: item.suffix
|
|
129
127
|
});
|
|
@@ -142,7 +140,7 @@ function useFieldListAdaptor(collector) {
|
|
|
142
140
|
const createCustomSchema = (item) => {
|
|
143
141
|
const schema = createStandardSchema(item);
|
|
144
142
|
Object.assign(schema["x-component-props"], {
|
|
145
|
-
fieldItem: item
|
|
143
|
+
fieldItem: omit(item, ["reactions"])
|
|
146
144
|
});
|
|
147
145
|
return schema;
|
|
148
146
|
};
|