@dt-frames/ui 1.0.19 → 1.0.20
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.
|
@@ -90,6 +90,7 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
90
90
|
registerForm: (formInstance: import("../../../forms").FormActionType) => void;
|
|
91
91
|
getFormValues: () => Recordable<any>;
|
|
92
92
|
setFormValues: (values: Recordable<any>) => Promise<void>;
|
|
93
|
+
validate: (nameList?: (string | number)[]) => Promise<any>;
|
|
93
94
|
handleSave: () => void;
|
|
94
95
|
DtForm: import("vue").DefineComponent<{
|
|
95
96
|
mode: {
|
package/es/index.js
CHANGED
|
@@ -5219,7 +5219,11 @@ var _sfc_main$J = defineComponent({
|
|
|
5219
5219
|
}
|
|
5220
5220
|
if (isFunction(render2)) {
|
|
5221
5221
|
let afterRenderData = render2(record, index, text);
|
|
5222
|
-
|
|
5222
|
+
if (afterRenderData.__v_isRef) {
|
|
5223
|
+
renderText = afterRenderData;
|
|
5224
|
+
} else {
|
|
5225
|
+
renderText.value = isVnode(afterRenderData) ? createVNode(Fragment, null, [afterRenderData]) : afterRenderData;
|
|
5226
|
+
}
|
|
5223
5227
|
}
|
|
5224
5228
|
}
|
|
5225
5229
|
renderCell();
|
|
@@ -7132,7 +7136,7 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
7132
7136
|
]),
|
|
7133
7137
|
destroyOnClose: true
|
|
7134
7138
|
});
|
|
7135
|
-
const [registerForm, { getFormValues, setFormValues }] = useForm({
|
|
7139
|
+
const [registerForm, { getFormValues, setFormValues, validate }] = useForm({
|
|
7136
7140
|
...props.formProps || {},
|
|
7137
7141
|
schemas: props.schemas,
|
|
7138
7142
|
mode: "dialog"
|
|
@@ -7146,8 +7150,11 @@ const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
|
7146
7150
|
var _a;
|
|
7147
7151
|
if (props.curd && isFunction((_a = props.curd) == null ? void 0 : _a.onAdd)) {
|
|
7148
7152
|
let obj = Object.assign({}, props.formsVal.value || {}, getFormValues());
|
|
7149
|
-
|
|
7150
|
-
|
|
7153
|
+
validate().then((rsp) => {
|
|
7154
|
+
let pro = obj.id ? props.curd.onUpdate(obj) : props.curd.onAdd(obj);
|
|
7155
|
+
pro == null ? void 0 : pro.then((rsp2) => closeModal());
|
|
7156
|
+
}).catch((err) => {
|
|
7157
|
+
});
|
|
7151
7158
|
}
|
|
7152
7159
|
}
|
|
7153
7160
|
return (_ctx, _cache) => {
|