@ibiz-template/mob-vue3-components 0.0.1-alpha.22 → 0.0.1-alpha.24
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/dist/index.min.css +1 -1
- package/dist/index.system.min.js +2 -2
- package/dist/index.system.min.js.map +1 -1
- package/es/control/form/edit-form/edit-form.d.ts +16 -1
- package/es/control/form/edit-form/edit-form.mjs +26 -8
- package/es/control/form/edit-form/index.d.ts +15 -0
- package/es/control/form/form/form.d.ts +1 -5
- package/es/control/form/form/form.mjs +39 -15
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.css +1 -0
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.d.ts +7 -6
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.mjs +51 -58
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-md/form-mdctrl-md.css +1 -0
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-md/form-mdctrl-md.d.ts +19 -0
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-md/form-mdctrl-md.mjs +79 -0
- package/es/control/form/form-detail/form-mdctrl/{form-mdctrl-data-view/form-mdctrl-data-view.d.ts → form-mdctrl-repeater/form-mdctrl-repeater.d.ts} +5 -7
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater.mjs +50 -0
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-multi-form/repeater-multi-form.d.ts +19 -0
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-multi-form/repeater-multi-form.mjs +59 -0
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.css +1 -0
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.d.ts +29 -0
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.mjs +54 -0
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl.css +1 -0
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl.d.ts +4 -2
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl.mjs +40 -54
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl.provider.mjs +21 -2
- package/es/control/form/form-detail/form-mdctrl/index.d.ts +2 -4
- package/es/control/form/form-detail/form-mdctrl/index.mjs +10 -1
- package/es/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.css +1 -0
- package/es/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.d.ts +40 -0
- package/es/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.mjs +94 -0
- package/es/control/form/form-detail/index.mjs +0 -1
- package/es/control/form/index.mjs +0 -1
- package/es/control/index.mjs +0 -1
- package/es/editor/upload/upload-editor.controller.mjs +2 -17
- package/es/panel-component/panel-button/index.d.ts +1 -1
- package/es/panel-component/panel-button/panel-button.d.ts +1 -1
- package/es/view/login-view/login-view.mjs +1 -1
- package/lib/control/form/edit-form/edit-form.cjs +26 -8
- package/lib/control/form/form/form.cjs +38 -14
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.cjs +48 -58
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-form/form-mdctrl-form.css +1 -0
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-md/form-mdctrl-md.cjs +81 -0
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-md/form-mdctrl-md.css +1 -0
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater.cjs +52 -0
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-multi-form/repeater-multi-form.cjs +61 -0
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.cjs +56 -0
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-single-form/repeater-single-form.css +1 -0
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl.cjs +38 -52
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl.css +1 -0
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl.provider.cjs +20 -1
- package/lib/control/form/form-detail/form-mdctrl/index.cjs +9 -1
- package/lib/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.cjs +96 -0
- package/lib/control/form/form-detail/form-mdctrl/mdctrl-container/mdctrl-container.css +1 -0
- package/lib/control/form/form-detail/index.cjs +0 -2
- package/lib/control/form/index.cjs +0 -2
- package/lib/control/index.cjs +0 -2
- package/lib/editor/upload/upload-editor.controller.cjs +1 -16
- package/lib/view/login-view/login-view.cjs +1 -1
- package/package.json +6 -6
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-container/form-mdctrl-container.css +0 -1
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-container/form-mdctrl-container.d.ts +0 -36
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-container/form-mdctrl-container.mjs +0 -66
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-data-view/form-mdctrl-data-view.mjs +0 -68
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-list/form-mdctrl-list.d.ts +0 -17
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-list/form-mdctrl-list.mjs +0 -68
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-shell.d.ts +0 -72
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-shell.mjs +0 -157
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form.d.ts +0 -17
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form.mjs +0 -57
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.d.ts +0 -17
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.mjs +0 -55
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-container/form-mdctrl-container.cjs +0 -71
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-container/form-mdctrl-container.css +0 -1
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-data-view/form-mdctrl-data-view.cjs +0 -73
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-list/form-mdctrl-list.cjs +0 -73
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form-shell.cjs +0 -159
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form/form-mdctrl-repeater-form.cjs +0 -62
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/form-mdctrl-repeater-form-one/form-mdctrl-repeater-form-one.cjs +0 -60
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { EventBase, FormMDCtrlRepeaterController } from '@ibiz-template/runtime';
|
|
3
|
+
import './repeater-single-form.scss';
|
|
4
|
+
export declare const RepeaterSingleForm: import("vue").DefineComponent<{
|
|
5
|
+
data: {
|
|
6
|
+
type: PropType<IData>;
|
|
7
|
+
required: true;
|
|
8
|
+
};
|
|
9
|
+
controller: {
|
|
10
|
+
type: typeof FormMDCtrlRepeaterController;
|
|
11
|
+
required: true;
|
|
12
|
+
};
|
|
13
|
+
}, {
|
|
14
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
15
|
+
onFormDataChange: (event: EventBase) => void;
|
|
16
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
+
change: (_value: IData) => true;
|
|
18
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
data: {
|
|
20
|
+
type: PropType<IData>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
controller: {
|
|
24
|
+
type: typeof FormMDCtrlRepeaterController;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
}>> & {
|
|
28
|
+
onChange?: ((_value: IData) => any) | undefined;
|
|
29
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { resolveComponent, createVNode, defineComponent } from 'vue';
|
|
2
|
+
import { FormMDCtrlRepeaterController } from '@ibiz-template/runtime';
|
|
3
|
+
import { RuntimeError } from '@ibiz-template/core';
|
|
4
|
+
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
5
|
+
import './repeater-single-form.css';
|
|
6
|
+
|
|
7
|
+
"use strict";
|
|
8
|
+
const RepeaterSingleForm = /* @__PURE__ */ defineComponent({
|
|
9
|
+
name: "IBizRepeaterSingleForm",
|
|
10
|
+
props: {
|
|
11
|
+
data: {
|
|
12
|
+
type: Object,
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
controller: {
|
|
16
|
+
type: FormMDCtrlRepeaterController,
|
|
17
|
+
required: true
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
emits: {
|
|
21
|
+
change: (_value) => true
|
|
22
|
+
},
|
|
23
|
+
setup(_props, {
|
|
24
|
+
emit
|
|
25
|
+
}) {
|
|
26
|
+
const ns = useNamespace("repeater-single-form");
|
|
27
|
+
const onFormDataChange = (event) => {
|
|
28
|
+
const formData = {
|
|
29
|
+
...event.data[0]
|
|
30
|
+
};
|
|
31
|
+
emit("change", formData);
|
|
32
|
+
};
|
|
33
|
+
return {
|
|
34
|
+
ns,
|
|
35
|
+
onFormDataChange
|
|
36
|
+
};
|
|
37
|
+
},
|
|
38
|
+
render() {
|
|
39
|
+
if (!this.controller.repeatedForm) {
|
|
40
|
+
throw new RuntimeError("\u6CA1\u6709repeatedForm");
|
|
41
|
+
}
|
|
42
|
+
return createVNode(resolveComponent("iBizControlShell"), {
|
|
43
|
+
"class": this.ns.b(),
|
|
44
|
+
"context": this.controller.context,
|
|
45
|
+
"params": this.controller.params,
|
|
46
|
+
"modelData": this.controller.repeatedForm,
|
|
47
|
+
"isSimple": true,
|
|
48
|
+
"data": this.data,
|
|
49
|
+
"onFormDataChange": this.onFormDataChange
|
|
50
|
+
}, null);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export { RepeaterSingleForm };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-form-mdctrl{--ibiz-form-mdctrl-header-height:32px;--ibiz-form-mdctrl-header-bg-color:var(--ibiz-color-bg-1);--ibiz-form-mdctrl-header-padding:var(--ibiz-spacing-base);--ibiz-form-mdctrl-header-border-color:var(--ibiz-color-border);--ibiz-form-mdctrl-caption-text-color:var(--ibiz-color-text-0);--ibiz-form-mdctrl-caption-font-size:var(--ibiz-font-size-header-6);--ibiz-form-mdctrl-caption-font-weight:var(--ibiz-font-weight-bold)}.ibiz-form-mdctrl__title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--ibiz-form-mdctrl-caption-font-size);font-weight:var(--ibiz-form-mdctrl-caption-font-weight);color:var(--ibiz-form-mdctrl-caption-text-color)}.ibiz-form-mdctrl-header{padding:var(--ibiz-form-mdctrl-header-padding);line-height:var(--ibiz-form-mdctrl-header-height)}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { PropType
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
2
|
import { IDEFormMDCtrl } from '@ibiz/model-core';
|
|
3
3
|
import { FormMDCtrlController } from '@ibiz-template/runtime';
|
|
4
|
+
import './form-mdctrl.scss';
|
|
4
5
|
export declare const FormMDCtrl: import("vue").DefineComponent<{
|
|
5
6
|
modelData: {
|
|
6
7
|
type: PropType<IDEFormMDCtrl>;
|
|
@@ -12,7 +13,8 @@ export declare const FormMDCtrl: import("vue").DefineComponent<{
|
|
|
12
13
|
};
|
|
13
14
|
}, {
|
|
14
15
|
c: FormMDCtrlController;
|
|
15
|
-
|
|
16
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
17
|
+
hasCaption: boolean | undefined;
|
|
16
18
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
19
|
modelData: {
|
|
18
20
|
type: PropType<IDEFormMDCtrl>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useController } from '@ibiz-template/vue3-util';
|
|
1
|
+
import { createTextVNode, createVNode, resolveComponent, defineComponent } from 'vue';
|
|
2
|
+
import { useNamespace, useController } from '@ibiz-template/vue3-util';
|
|
3
3
|
import { FormMDCtrlController } from '@ibiz-template/runtime';
|
|
4
|
+
import './form-mdctrl.css';
|
|
4
5
|
|
|
5
6
|
"use strict";
|
|
6
7
|
const FormMDCtrl = /* @__PURE__ */ defineComponent({
|
|
@@ -16,65 +17,50 @@ const FormMDCtrl = /* @__PURE__ */ defineComponent({
|
|
|
16
17
|
}
|
|
17
18
|
},
|
|
18
19
|
setup(props) {
|
|
20
|
+
const ns = useNamespace("form-mdctrl");
|
|
19
21
|
useController(props.controller);
|
|
20
22
|
const c = props.controller;
|
|
21
|
-
const
|
|
22
|
-
switch (c.model.detailStyle) {
|
|
23
|
-
case "STYLE2":
|
|
24
|
-
return createVNode(resolveComponent("iBizFormMDCtrlRepeaterGrid"), {
|
|
25
|
-
"controller": c.mdCtrlContentController
|
|
26
|
-
}, null);
|
|
27
|
-
case "STYLE3":
|
|
28
|
-
return createVNode(resolveComponent("iBizFormMDCtrlRepeaterFormOne"), {
|
|
29
|
-
"controller": c.mdCtrlContentController
|
|
30
|
-
}, null);
|
|
31
|
-
default:
|
|
32
|
-
return createVNode(resolveComponent("iBizFormMDCtrlRepeaterForm"), {
|
|
33
|
-
"controller": c.mdCtrlContentController
|
|
34
|
-
}, null);
|
|
35
|
-
}
|
|
36
|
-
};
|
|
23
|
+
const hasCaption = c.model.showCaption && !!c.model.caption;
|
|
37
24
|
return {
|
|
38
25
|
c,
|
|
39
|
-
|
|
26
|
+
ns,
|
|
27
|
+
hasCaption
|
|
40
28
|
};
|
|
41
29
|
},
|
|
42
30
|
render() {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
};
|
|
77
|
-
return renderContentByType();
|
|
31
|
+
const {
|
|
32
|
+
model
|
|
33
|
+
} = this.c;
|
|
34
|
+
let content;
|
|
35
|
+
switch (model.contentType) {
|
|
36
|
+
case "GRID":
|
|
37
|
+
case "LIST":
|
|
38
|
+
case "DATAVIEW":
|
|
39
|
+
content = createVNode(resolveComponent("iBizFormMDCtrlMD"), {
|
|
40
|
+
"controller": this.c
|
|
41
|
+
}, null);
|
|
42
|
+
break;
|
|
43
|
+
case "FORM":
|
|
44
|
+
content = createVNode(resolveComponent("iBizFormMDCtrlForm"), {
|
|
45
|
+
"controller": this.c
|
|
46
|
+
}, null);
|
|
47
|
+
break;
|
|
48
|
+
case "REPEATER":
|
|
49
|
+
content = createVNode(resolveComponent("iBizFormMDCtrlRepeater"), {
|
|
50
|
+
"controller": this.c
|
|
51
|
+
}, null);
|
|
52
|
+
break;
|
|
53
|
+
default:
|
|
54
|
+
createVNode("div", null, [model.contentType, createTextVNode("\u6682\u672A\u652F\u6301")]);
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
return createVNode("div", {
|
|
58
|
+
"class": [this.ns.b(), this.ns.m(this.modelData.codeName), ...this.controller.containerClass, this.hasCaption ? this.ns.m("show-caption") : ""]
|
|
59
|
+
}, [this.hasCaption && createVNode("div", {
|
|
60
|
+
"class": this.ns.b("header")
|
|
61
|
+
}, [createVNode("span", {
|
|
62
|
+
"class": this.ns.e("title")
|
|
63
|
+
}, [this.c.model.caption])]), content]);
|
|
78
64
|
}
|
|
79
65
|
});
|
|
80
66
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModelError } from '@ibiz-template/core';
|
|
2
|
+
import { FormMDCtrlRepeaterController, FormMDCtrlFormController, FormMDCtrlMDController } from '@ibiz-template/runtime';
|
|
2
3
|
|
|
3
4
|
"use strict";
|
|
4
5
|
var __defProp = Object.defineProperty;
|
|
@@ -12,7 +13,25 @@ class FormMDCtrlProvider {
|
|
|
12
13
|
__publicField(this, "component", "IBizFormMDCtrl");
|
|
13
14
|
}
|
|
14
15
|
async createController(detailModel, form, parent) {
|
|
15
|
-
|
|
16
|
+
let c;
|
|
17
|
+
switch (detailModel.contentType) {
|
|
18
|
+
case "LIST":
|
|
19
|
+
case "GRID":
|
|
20
|
+
case "DATAVIEW":
|
|
21
|
+
c = new FormMDCtrlMDController(detailModel, form, parent);
|
|
22
|
+
break;
|
|
23
|
+
case "FORM":
|
|
24
|
+
c = new FormMDCtrlFormController(detailModel, form, parent);
|
|
25
|
+
break;
|
|
26
|
+
case "REPEATER":
|
|
27
|
+
c = new FormMDCtrlRepeaterController(detailModel, form, parent);
|
|
28
|
+
break;
|
|
29
|
+
default:
|
|
30
|
+
throw new ModelError(
|
|
31
|
+
detailModel,
|
|
32
|
+
`\u6682\u672A\u652F\u6301\u5185\u5BB9\u7C7B\u578B\u4E3A${detailModel.contentType}`
|
|
33
|
+
);
|
|
34
|
+
}
|
|
16
35
|
await c.init();
|
|
17
36
|
return c;
|
|
18
37
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from './form-mdctrl.provider';
|
|
2
1
|
export declare const IBizFormMDCtrl: import("@ibiz-template/vue3-util").TypeWithInstall<import("vue").DefineComponent<{
|
|
3
2
|
modelData: {
|
|
4
3
|
type: import("vue").PropType<import("@ibiz/model-core").IDEFormMDCtrl>;
|
|
@@ -10,9 +9,8 @@ export declare const IBizFormMDCtrl: import("@ibiz-template/vue3-util").TypeWith
|
|
|
10
9
|
};
|
|
11
10
|
}, {
|
|
12
11
|
c: import("@ibiz-template/runtime").FormMDCtrlController;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}> | undefined;
|
|
12
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
13
|
+
hasCaption: boolean | undefined;
|
|
16
14
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
15
|
modelData: {
|
|
18
16
|
type: import("vue").PropType<import("@ibiz/model-core").IDEFormMDCtrl>;
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
import { registerFormDetailProvider } from '@ibiz-template/runtime';
|
|
2
2
|
import { withInstall } from '@ibiz-template/vue3-util';
|
|
3
3
|
import { FormMDCtrl } from './form-mdctrl.mjs';
|
|
4
|
+
import { FormMDCtrlForm } from './form-mdctrl-form/form-mdctrl-form.mjs';
|
|
5
|
+
import { FormMDCtrlMD } from './form-mdctrl-md/form-mdctrl-md.mjs';
|
|
6
|
+
import { FormMDCtrlRepeater } from './form-mdctrl-repeater/form-mdctrl-repeater.mjs';
|
|
4
7
|
import { FormMDCtrlProvider } from './form-mdctrl.provider.mjs';
|
|
8
|
+
import { MDCtrlContainer } from './mdctrl-container/mdctrl-container.mjs';
|
|
5
9
|
|
|
6
10
|
"use strict";
|
|
7
11
|
const IBizFormMDCtrl = withInstall(FormMDCtrl, function(v) {
|
|
12
|
+
v.component(FormMDCtrl.name, FormMDCtrl);
|
|
13
|
+
v.component(FormMDCtrlForm.name, FormMDCtrlForm);
|
|
14
|
+
v.component(FormMDCtrlMD.name, FormMDCtrlMD);
|
|
15
|
+
v.component(FormMDCtrlRepeater.name, FormMDCtrlRepeater);
|
|
16
|
+
v.component(MDCtrlContainer.name, MDCtrlContainer);
|
|
8
17
|
registerFormDetailProvider("MDCTRL", () => new FormMDCtrlProvider());
|
|
9
18
|
});
|
|
10
19
|
|
|
11
|
-
export {
|
|
20
|
+
export { IBizFormMDCtrl, IBizFormMDCtrl as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-mdctrl-container{display:flex;flex-direction:column;gap:10px;padding:var(--ibiz-spacing-tight) 0}.ibiz-mdctrl-container-item__form{flex-grow:1}.ibiz-mdctrl-container-item-actions{flex-shrink:0;width:100%;text-align:center}.ibiz-mdctrl-container-item-actions .van-button+.van-button{margin-left:0}.ibiz-mdctrl-container-item-actions__btn{width:calc(100% - var(--ibiz-spacing-base) * 2);margin:0 var(--ibiz-spacing-base)}.ibiz-mdctrl-container-no-data{width:100%;display:flex;justify-content:flex-end}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import './mdctrl-container.scss';
|
|
3
|
+
export declare const MDCtrlContainer: import("vue").DefineComponent<{
|
|
4
|
+
enableCreate: {
|
|
5
|
+
type: BooleanConstructor;
|
|
6
|
+
required: true;
|
|
7
|
+
};
|
|
8
|
+
enableDelete: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
items: {
|
|
13
|
+
type: PropType<IData[]>;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
18
|
+
showActions: import("vue").ComputedRef<boolean>;
|
|
19
|
+
renderAddBtn: () => JSX.Element;
|
|
20
|
+
renderRemoveBtn: (item: IData, index: number) => JSX.Element | null;
|
|
21
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
22
|
+
addClick: () => true;
|
|
23
|
+
removeClick: (_data: IData, _index: number) => true;
|
|
24
|
+
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
25
|
+
enableCreate: {
|
|
26
|
+
type: BooleanConstructor;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
enableDelete: {
|
|
30
|
+
type: BooleanConstructor;
|
|
31
|
+
required: true;
|
|
32
|
+
};
|
|
33
|
+
items: {
|
|
34
|
+
type: PropType<IData[]>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
}>> & {
|
|
38
|
+
onAddClick?: (() => any) | undefined;
|
|
39
|
+
onRemoveClick?: ((_data: IData, _index: number) => any) | undefined;
|
|
40
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { computed, resolveComponent, createTextVNode, createVNode, defineComponent } from 'vue';
|
|
2
|
+
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
3
|
+
import './mdctrl-container.css';
|
|
4
|
+
|
|
5
|
+
"use strict";
|
|
6
|
+
const MDCtrlContainer = /* @__PURE__ */ defineComponent({
|
|
7
|
+
name: "IBizMDCtrlContainer",
|
|
8
|
+
props: {
|
|
9
|
+
enableCreate: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
enableDelete: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
items: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
emits: {
|
|
23
|
+
addClick: () => true,
|
|
24
|
+
removeClick: (_data, _index) => true
|
|
25
|
+
},
|
|
26
|
+
setup(props, {
|
|
27
|
+
emit
|
|
28
|
+
}) {
|
|
29
|
+
const ns = useNamespace("mdctrl-container");
|
|
30
|
+
const showActions = computed(() => {
|
|
31
|
+
return props.enableCreate || props.enableDelete;
|
|
32
|
+
});
|
|
33
|
+
const renderAddBtn = () => {
|
|
34
|
+
return createVNode(resolveComponent("van-button"), {
|
|
35
|
+
"class": [ns.be("item-actions", "create"), ns.be("item-actions", "btn")],
|
|
36
|
+
"size": "small",
|
|
37
|
+
"onClick": () => emit("addClick"),
|
|
38
|
+
"type": "primary"
|
|
39
|
+
}, {
|
|
40
|
+
default: () => [createTextVNode("\u6DFB\u52A0")]
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const renderRemoveBtn = (item, index) => {
|
|
44
|
+
if (!props.enableDelete) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
if (ibiz.config.form.mdCtrlConfirmBeforeRemove) {
|
|
48
|
+
return createVNode(resolveComponent("van-button"), {
|
|
49
|
+
"class": [ns.be("item-actions", "remove"), ns.be("item-actions", "btn")],
|
|
50
|
+
"size": "small",
|
|
51
|
+
"type": "danger",
|
|
52
|
+
"onClick": () => {
|
|
53
|
+
emit("removeClick", item, index);
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
default: () => [createTextVNode("\u5220\u9664")]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return createVNode(resolveComponent("van-button"), {
|
|
60
|
+
"class": [ns.be("item-actions", "remove"), ns.be("item-actions", "btn")],
|
|
61
|
+
"type": "danger",
|
|
62
|
+
"size": "small",
|
|
63
|
+
"onClick": () => {
|
|
64
|
+
emit("removeClick", item, index);
|
|
65
|
+
}
|
|
66
|
+
}, {
|
|
67
|
+
default: () => [createTextVNode("\u5220\u9664")]
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
return {
|
|
71
|
+
ns,
|
|
72
|
+
showActions,
|
|
73
|
+
renderAddBtn,
|
|
74
|
+
renderRemoveBtn
|
|
75
|
+
};
|
|
76
|
+
},
|
|
77
|
+
render() {
|
|
78
|
+
return createVNode("div", {
|
|
79
|
+
"class": this.ns.b()
|
|
80
|
+
}, [this.enableCreate && this.renderAddBtn(), this.items.map((item, index) => {
|
|
81
|
+
const formComponent = this.$slots.item ? this.$slots.item({
|
|
82
|
+
data: item,
|
|
83
|
+
index
|
|
84
|
+
}) : createVNode("div", null, [createTextVNode("\u672A\u63D0\u4F9Bitem\u63D2\u69FD")]);
|
|
85
|
+
return createVNode("div", {
|
|
86
|
+
"class": this.ns.b("item")
|
|
87
|
+
}, [formComponent, this.showActions && createVNode("div", {
|
|
88
|
+
"class": this.ns.b("item-actions")
|
|
89
|
+
}, [this.renderRemoveBtn(item, index)])]);
|
|
90
|
+
})]);
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
export { MDCtrlContainer };
|
|
@@ -17,6 +17,5 @@ export { FormDRUIPartProvider } from './form-druipart/form-druipart.provider.mjs
|
|
|
17
17
|
export { FormRawItemProvider } from './form-rawitem/form-rawitem.provider.mjs';
|
|
18
18
|
export { FormTabPanelProvider } from './form-tab-panel/form-tab-panel.provider.mjs';
|
|
19
19
|
export { FormTabPageProvider } from './form-tab-page/form-tab-page.provider.mjs';
|
|
20
|
-
export { FormMDCtrlProvider } from './form-mdctrl/form-mdctrl.provider.mjs';
|
|
21
20
|
|
|
22
21
|
"use strict";
|
|
@@ -21,7 +21,6 @@ export { FormTabPanelProvider } from './form-detail/form-tab-panel/form-tab-pane
|
|
|
21
21
|
export { IBizFormTabPanel } from './form-detail/form-tab-panel/index.mjs';
|
|
22
22
|
export { FormTabPageProvider } from './form-detail/form-tab-page/form-tab-page.provider.mjs';
|
|
23
23
|
export { IBizFormTabPage } from './form-detail/form-tab-page/index.mjs';
|
|
24
|
-
export { FormMDCtrlProvider } from './form-detail/form-mdctrl/form-mdctrl.provider.mjs';
|
|
25
24
|
export { IBizFormMDCtrl } from './form-detail/form-mdctrl/index.mjs';
|
|
26
25
|
|
|
27
26
|
"use strict";
|
package/es/control/index.mjs
CHANGED
|
@@ -41,7 +41,6 @@ export { FormTabPanelProvider } from './form/form-detail/form-tab-panel/form-tab
|
|
|
41
41
|
export { IBizFormTabPanel } from './form/form-detail/form-tab-panel/index.mjs';
|
|
42
42
|
export { FormTabPageProvider } from './form/form-detail/form-tab-page/form-tab-page.provider.mjs';
|
|
43
43
|
export { IBizFormTabPage } from './form/form-detail/form-tab-page/index.mjs';
|
|
44
|
-
export { FormMDCtrlProvider } from './form/form-detail/form-mdctrl/form-mdctrl.provider.mjs';
|
|
45
44
|
export { IBizFormMDCtrl } from './form/form-detail/form-mdctrl/index.mjs';
|
|
46
45
|
export { IBizEditFormControl } from './form/edit-form/index.mjs';
|
|
47
46
|
export { IBizFormControl } from './form/form/index.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RuntimeModelError
|
|
1
|
+
import { RuntimeModelError } from '@ibiz-template/core';
|
|
2
2
|
import { EditorController, convertNavData } from '@ibiz-template/runtime';
|
|
3
3
|
import qs from 'qs';
|
|
4
4
|
|
|
@@ -121,22 +121,7 @@ class UploadEditorController extends EditorController {
|
|
|
121
121
|
* @param {IData} file
|
|
122
122
|
*/
|
|
123
123
|
fileDownload(file) {
|
|
124
|
-
ibiz.
|
|
125
|
-
method: "get",
|
|
126
|
-
responseType: "blob",
|
|
127
|
-
baseURL: ""
|
|
128
|
-
// 已经有baseURL了,这里无需再写
|
|
129
|
-
}).then((response) => {
|
|
130
|
-
if (response.status !== 200) {
|
|
131
|
-
throw new RuntimeError("\u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25");
|
|
132
|
-
}
|
|
133
|
-
if (!response.data) {
|
|
134
|
-
throw new RuntimeError("\u6587\u4EF6\u6D41\u6570\u636E\u4E0D\u5B58\u5728");
|
|
135
|
-
} else {
|
|
136
|
-
const fileName = file.name;
|
|
137
|
-
downloadFileFromBlob(response.data, fileName);
|
|
138
|
-
}
|
|
139
|
-
});
|
|
124
|
+
ibiz.platform.download(file.url, file.name);
|
|
140
125
|
}
|
|
141
126
|
}
|
|
142
127
|
|
|
@@ -12,7 +12,7 @@ export declare const IBizPanelButton: import("@ibiz-template/vue3-util").TypeWit
|
|
|
12
12
|
}, {
|
|
13
13
|
ns: import("@ibiz-template/core").Namespace;
|
|
14
14
|
captionText: import("vue").ComputedRef<any>;
|
|
15
|
-
buttonType: import("vue").ComputedRef<"default" | "text" | "primary" | "
|
|
15
|
+
buttonType: import("vue").ComputedRef<"default" | "text" | "primary" | "danger" | "success" | "warning">;
|
|
16
16
|
showCaption: boolean | undefined;
|
|
17
17
|
sysImage: import("@ibiz/model-core").ISysImage | undefined;
|
|
18
18
|
codeName: string | undefined;
|
|
@@ -14,7 +14,7 @@ export declare const PanelButton: import("vue").DefineComponent<{
|
|
|
14
14
|
}, {
|
|
15
15
|
ns: import("@ibiz-template/core").Namespace;
|
|
16
16
|
captionText: import("vue").ComputedRef<any>;
|
|
17
|
-
buttonType: import("vue").ComputedRef<"default" | "text" | "primary" | "
|
|
17
|
+
buttonType: import("vue").ComputedRef<"default" | "text" | "primary" | "danger" | "success" | "warning">;
|
|
18
18
|
showCaption: boolean | undefined;
|
|
19
19
|
sysImage: import("@ibiz/model-core").ISysImage | undefined;
|
|
20
20
|
codeName: string | undefined;
|
|
@@ -30,7 +30,7 @@ const LoginView = /* @__PURE__ */ defineComponent({
|
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
32
|
loading.value = true;
|
|
33
|
-
const bol = await ibiz.
|
|
33
|
+
const bol = await ibiz.platform.login(loginData.username, loginData.password);
|
|
34
34
|
if (bol) {
|
|
35
35
|
window.location.hash = ru;
|
|
36
36
|
window.location.reload();
|
|
@@ -20,6 +20,9 @@ const EditFormControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
20
20
|
type: Object,
|
|
21
21
|
default: () => ({})
|
|
22
22
|
},
|
|
23
|
+
provider: {
|
|
24
|
+
type: Object
|
|
25
|
+
},
|
|
23
26
|
isSimple: {
|
|
24
27
|
type: Boolean,
|
|
25
28
|
required: false
|
|
@@ -27,17 +30,32 @@ const EditFormControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
27
30
|
data: {
|
|
28
31
|
type: Object,
|
|
29
32
|
required: false
|
|
33
|
+
},
|
|
34
|
+
loadDefault: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: true
|
|
30
37
|
}
|
|
31
38
|
},
|
|
32
|
-
setup() {
|
|
33
|
-
const c = vue3Util.useControlController((...args) => new runtime.EditFormController(...args)
|
|
34
|
-
|
|
35
|
-
if (newVal && newVal !== oldVal) {
|
|
36
|
-
c.state.isLoaded = true;
|
|
37
|
-
}
|
|
38
|
-
}, {
|
|
39
|
-
immediate: true
|
|
39
|
+
setup(props) {
|
|
40
|
+
const c = vue3Util.useControlController((...args) => new runtime.EditFormController(...args), {
|
|
41
|
+
excludePropsKeys: ["data"]
|
|
40
42
|
});
|
|
43
|
+
if (props.isSimple) {
|
|
44
|
+
c.evt.on("onMounted", () => {
|
|
45
|
+
c.setSimpleData(props.data || {});
|
|
46
|
+
});
|
|
47
|
+
vue.watch(() => props.data, (newVal) => {
|
|
48
|
+
const changeVal = newVal || {};
|
|
49
|
+
const find = Object.keys(c.data).find((key) => {
|
|
50
|
+
return changeVal[key] !== c.data[key];
|
|
51
|
+
});
|
|
52
|
+
if (find) {
|
|
53
|
+
c.setSimpleData(changeVal);
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
deep: true
|
|
57
|
+
});
|
|
58
|
+
}
|
|
41
59
|
const ns = vue3Util.useNamespace(`control-${c.model.controlType.toLowerCase()}`);
|
|
42
60
|
c.evt.on("onCreated", () => {
|
|
43
61
|
const keys = Object.keys(c.details);
|
|
@@ -6,6 +6,9 @@ var vue3Util = require('@ibiz-template/vue3-util');
|
|
|
6
6
|
require('./form.css');
|
|
7
7
|
|
|
8
8
|
"use strict";
|
|
9
|
+
function _isSlot(s) {
|
|
10
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
|
|
11
|
+
}
|
|
9
12
|
const FormControl = /* @__PURE__ */ vue.defineComponent({
|
|
10
13
|
name: "IBizFormControl",
|
|
11
14
|
props: {
|
|
@@ -79,23 +82,44 @@ const FormControl = /* @__PURE__ */ vue.defineComponent({
|
|
|
79
82
|
};
|
|
80
83
|
},
|
|
81
84
|
render() {
|
|
85
|
+
const {
|
|
86
|
+
state,
|
|
87
|
+
model,
|
|
88
|
+
controlPanel
|
|
89
|
+
} = this.c;
|
|
90
|
+
const {
|
|
91
|
+
isCreated
|
|
92
|
+
} = state;
|
|
93
|
+
const slots = {};
|
|
94
|
+
if (isCreated) {
|
|
95
|
+
if (this.$slots.default) {
|
|
96
|
+
slots.default = () => {
|
|
97
|
+
return this.$slots.default({
|
|
98
|
+
...this.slotProps
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
} else {
|
|
102
|
+
const key = controlPanel ? model.name : "default";
|
|
103
|
+
slots[key] = () => {
|
|
104
|
+
return vue.createVNode(vue.resolveComponent("iBizFormPage"), {
|
|
105
|
+
"modelData": this.c.model,
|
|
106
|
+
"controller": this.c
|
|
107
|
+
}, {
|
|
108
|
+
default: () => {
|
|
109
|
+
var _a;
|
|
110
|
+
return [(_a = this.c.model.deformPages) == null ? void 0 : _a.map((page) => {
|
|
111
|
+
return this.renderByDetailType(page);
|
|
112
|
+
})];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
82
118
|
return vue.createVNode(vue.resolveComponent("iBizControlBase"), {
|
|
83
119
|
"class": [this.ns.b()],
|
|
84
120
|
"controller": this.c
|
|
85
|
-
}, {
|
|
86
|
-
default: () => [
|
|
87
|
-
...this.slotProps
|
|
88
|
-
}) : vue.createVNode(vue.resolveComponent("iBizFormPage"), {
|
|
89
|
-
"modelData": this.c.model,
|
|
90
|
-
"controller": this.c
|
|
91
|
-
}, {
|
|
92
|
-
default: () => {
|
|
93
|
-
var _a;
|
|
94
|
-
return [(_a = this.c.model.deformPages) == null ? void 0 : _a.map((page) => {
|
|
95
|
-
return this.renderByDetailType(page);
|
|
96
|
-
})];
|
|
97
|
-
}
|
|
98
|
-
}), this.$slots.searchFooter && this.$slots.searchFooter({})]]
|
|
121
|
+
}, _isSlot(slots) ? slots : {
|
|
122
|
+
default: () => [slots]
|
|
99
123
|
});
|
|
100
124
|
}
|
|
101
125
|
});
|