@ibiz-template/vue3-components 0.3.2 → 0.3.4
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-OcHgH3lj.js +14 -0
- package/dist/index-OcHgH3lj.js.map +1 -0
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{xlsx-util-dxEbPtZK.js → xlsx-util-SHuu4UVN.js} +2 -2
- package/dist/{xlsx-util-dxEbPtZK.js.map → xlsx-util-SHuu4UVN.js.map} +1 -1
- package/es/common/data-import/data-import.css +1 -1
- package/es/common/data-import/data-import.d.ts +10 -1
- package/es/common/data-import/data-import.mjs +23 -7
- package/es/control/calendar/calendar.css +1 -1
- package/es/control/calendar/calendar.mjs +134 -90
- package/es/control/form/form/form.mjs +39 -15
- package/es/control/form/search-form/search-form.css +1 -1
- package/es/control/form/search-form/search-form.mjs +3 -32
- package/es/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.d.ts +1 -1
- package/es/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.mjs +1 -1
- package/es/control/grid/grid-column/grid-field-edit-column/index.d.ts +1 -1
- package/es/control/panel/panel/index.d.ts +6 -0
- package/es/control/panel/panel/panel.d.ts +7 -1
- package/es/control/panel/panel/panel.mjs +4 -1
- package/es/control/panel/view-layout-panel/index.d.ts +6 -0
- package/es/control/panel/view-layout-panel/view-layout-panel.d.ts +7 -1
- package/es/control/panel/view-layout-panel/view-layout-panel.mjs +4 -1
- package/es/control/tab-exp-panel/tab-exp-panel.css +1 -1
- package/es/control/toolbar/toolbar.mjs +1 -0
- package/es/panel-component/index.mjs +2 -0
- package/es/panel-component/nav-pos-index/nav-pos-index.controller.mjs +3 -4
- package/es/panel-component/searchform-buttons/index.d.ts +25 -0
- package/es/panel-component/searchform-buttons/index.mjs +18 -0
- package/es/panel-component/searchform-buttons/searchform-buttons.controller.d.ts +38 -0
- package/es/panel-component/searchform-buttons/searchform-buttons.controller.mjs +67 -0
- package/es/panel-component/searchform-buttons/searchform-buttons.css +1 -0
- package/es/panel-component/searchform-buttons/searchform-buttons.d.ts +28 -0
- package/es/panel-component/searchform-buttons/searchform-buttons.mjs +63 -0
- package/es/panel-component/searchform-buttons/searchform-buttons.provider.d.ts +15 -0
- package/es/panel-component/searchform-buttons/searchform-buttons.provider.mjs +21 -0
- package/lib/common/data-import/data-import.cjs +23 -7
- package/lib/common/data-import/data-import.css +1 -1
- package/lib/control/calendar/calendar.cjs +133 -89
- package/lib/control/calendar/calendar.css +1 -1
- package/lib/control/form/form/form.cjs +38 -14
- package/lib/control/form/search-form/search-form.cjs +2 -31
- package/lib/control/form/search-form/search-form.css +1 -1
- package/lib/control/grid/grid-column/grid-field-edit-column/grid-field-edit-column.cjs +1 -1
- package/lib/control/panel/panel/panel.cjs +4 -1
- package/lib/control/panel/view-layout-panel/view-layout-panel.cjs +4 -1
- package/lib/control/tab-exp-panel/tab-exp-panel.css +1 -1
- package/lib/control/toolbar/toolbar.cjs +1 -0
- package/lib/panel-component/index.cjs +2 -0
- package/lib/panel-component/nav-pos-index/nav-pos-index.controller.cjs +3 -4
- package/lib/panel-component/searchform-buttons/index.cjs +23 -0
- package/lib/panel-component/searchform-buttons/searchform-buttons.cjs +65 -0
- package/lib/panel-component/searchform-buttons/searchform-buttons.controller.cjs +69 -0
- package/lib/panel-component/searchform-buttons/searchform-buttons.css +1 -0
- package/lib/panel-component/searchform-buttons/searchform-buttons.provider.cjs +23 -0
- package/package.json +9 -9
- package/dist/index-bG6JVwfZ.js +0 -14
- package/dist/index-bG6JVwfZ.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropType, VNode } from 'vue';
|
|
2
2
|
import { IPanelItem, IViewLayoutPanel } from '@ibiz/model-core';
|
|
3
3
|
import './view-layout-panel.scss';
|
|
4
|
-
import { IControlProvider, IPanelItemController, IPanelItemProvider, ViewLayoutPanelController } from '@ibiz-template/runtime';
|
|
4
|
+
import { IController, IControlProvider, IPanelItemController, IPanelItemProvider, ViewLayoutPanelController } from '@ibiz-template/runtime';
|
|
5
5
|
/**
|
|
6
6
|
* 视图布局面板组件
|
|
7
7
|
*/
|
|
@@ -21,6 +21,9 @@ export declare const ViewLayoutPanelControl: import("vue").DefineComponent<{
|
|
|
21
21
|
provider: {
|
|
22
22
|
type: PropType<IControlProvider>;
|
|
23
23
|
};
|
|
24
|
+
container: {
|
|
25
|
+
type: PropType<IController<import("@ibiz/model-core").IModelObject, object, import("@ibiz-template/runtime").IComponentEvent>>;
|
|
26
|
+
};
|
|
24
27
|
data: PropType<IData>;
|
|
25
28
|
}, {
|
|
26
29
|
c: ViewLayoutPanelController;
|
|
@@ -49,6 +52,9 @@ export declare const ViewLayoutPanelControl: import("vue").DefineComponent<{
|
|
|
49
52
|
provider: {
|
|
50
53
|
type: PropType<IControlProvider>;
|
|
51
54
|
};
|
|
55
|
+
container: {
|
|
56
|
+
type: PropType<IController<import("@ibiz/model-core").IModelObject, object, import("@ibiz-template/runtime").IComponentEvent>>;
|
|
57
|
+
};
|
|
52
58
|
data: PropType<IData>;
|
|
53
59
|
}>>, {
|
|
54
60
|
params: IParams;
|
|
@@ -25,12 +25,15 @@ const ViewLayoutPanelControl = /* @__PURE__ */ defineComponent({
|
|
|
25
25
|
provider: {
|
|
26
26
|
type: Object
|
|
27
27
|
},
|
|
28
|
+
container: {
|
|
29
|
+
type: Object
|
|
30
|
+
},
|
|
28
31
|
data: Object
|
|
29
32
|
},
|
|
30
33
|
setup(props, {
|
|
31
34
|
slots
|
|
32
35
|
}) {
|
|
33
|
-
const c = useControlController((...args) => new ViewLayoutPanelController(...args));
|
|
36
|
+
const c = useControlController((...args) => new ViewLayoutPanelController(...args, props.container));
|
|
34
37
|
const ns = useNamespace(`control-${c.model.controlType.toLowerCase()}`);
|
|
35
38
|
watch(() => props.data, (newVal) => {
|
|
36
39
|
if (newVal) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-control-tabexppanel .el-tabs .el-tabs__header{margin:0}.ibiz-control-tabexppanel .el-tabs .el-tabs__header .el-tabs__nav-wrap{margin:0}.ibiz-control-tabexppanel .el-tabs .el-tabs__header .el-tabs__nav-wrap .el-tabs__nav .el-tabs__active-bar{background-color:var(--ibiz-color-primary)}.ibiz-control-tabexppanel .el-tabs .el-tabs__header .el-tabs__nav-wrap .el-tabs__nav .el-tabs__item{font-size:var(--ibiz-font-size-regular);color:var(--ibiz-color-text-2)}.ibiz-control-tabexppanel .el-tabs .el-tabs__header .el-tabs__nav-wrap .el-tabs__nav .el-tabs__item:hover{color:var(--ibiz-color-text-0)}.ibiz-control-tabexppanel .el-tabs .el-tabs__header .el-tabs__nav-wrap .el-tabs__nav .el-tabs__item.is-active{color:var(--ibiz-color-primary)}.ibiz-control-tabexppanel .el-tabs .el-tabs__header .el-tabs__nav-wrap .el-tabs__nav .el-tabs__item.is-top:
|
|
1
|
+
.ibiz-control-tabexppanel .el-tabs .el-tabs__header{margin:0}.ibiz-control-tabexppanel .el-tabs .el-tabs__header .el-tabs__nav-wrap{margin:0}.ibiz-control-tabexppanel .el-tabs .el-tabs__header .el-tabs__nav-wrap .el-tabs__nav .el-tabs__active-bar{background-color:var(--ibiz-color-primary)}.ibiz-control-tabexppanel .el-tabs .el-tabs__header .el-tabs__nav-wrap .el-tabs__nav .el-tabs__item{font-size:var(--ibiz-font-size-regular);color:var(--ibiz-color-text-2)}.ibiz-control-tabexppanel .el-tabs .el-tabs__header .el-tabs__nav-wrap .el-tabs__nav .el-tabs__item:hover{color:var(--ibiz-color-text-0)}.ibiz-control-tabexppanel .el-tabs .el-tabs__header .el-tabs__nav-wrap .el-tabs__nav .el-tabs__item.is-active{color:var(--ibiz-color-primary)}.ibiz-control-tabexppanel .el-tabs .el-tabs__header .el-tabs__nav-wrap .el-tabs__nav .el-tabs__item.is-top:last-child{padding-right:0}.ibiz-control-tabexppanel .el-tabs.el-tabs--bottom,.ibiz-control-tabexppanel .el-tabs.el-tabs--top{padding-left:var(--ibiz-spacing-base)}
|
|
@@ -86,6 +86,7 @@ const ToolbarControl = /* @__PURE__ */ defineComponent({
|
|
|
86
86
|
const actionId = item.uiactionId;
|
|
87
87
|
if (actionId === "exportexcel") {
|
|
88
88
|
return createVNode(IBizExportExcel, {
|
|
89
|
+
"class": [ns.e("item"), ns.e("item-deuiaction")],
|
|
89
90
|
"item": item,
|
|
90
91
|
"btnContent": btnContent,
|
|
91
92
|
"size": btnSize.value,
|
|
@@ -17,6 +17,7 @@ import { IBizPanelRememberMe } from './panel-remember-me/index.mjs';
|
|
|
17
17
|
import { IBizIndexActions } from './index-actions/index.mjs';
|
|
18
18
|
import { IBizPanelContainerGroup } from './panel-container-group/index.mjs';
|
|
19
19
|
import { IBizUserMessage } from './user-message/index.mjs';
|
|
20
|
+
import { IBizSearchFormButtons } from './searchform-buttons/index.mjs';
|
|
20
21
|
export { NavPosIndexState } from './nav-pos-index/nav-pos-index.state.mjs';
|
|
21
22
|
export { NavPosIndexController } from './nav-pos-index/nav-pos-index.controller.mjs';
|
|
22
23
|
export { PanelButtonController } from './panel-button/panel-button.controller.mjs';
|
|
@@ -54,6 +55,7 @@ const IBizPanelComponents = {
|
|
|
54
55
|
v.use(IBizPanelContainerGroup);
|
|
55
56
|
v.use(IBizUserMessage);
|
|
56
57
|
v.use(IBizPanelContainerImage);
|
|
58
|
+
v.use(IBizSearchFormButtons);
|
|
57
59
|
}
|
|
58
60
|
};
|
|
59
61
|
|
|
@@ -94,15 +94,11 @@ class NavPosIndexController extends PanelItemController {
|
|
|
94
94
|
currentKey,
|
|
95
95
|
fullPath
|
|
96
96
|
}) {
|
|
97
|
-
if (currentKey === "") {
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
97
|
const isCurrentKeyChange = this.state.currentKey !== currentKey;
|
|
101
98
|
if (isCurrentKeyChange) {
|
|
102
99
|
if (this.state.cacheKeys.includes(currentKey) && this.router && this.router.currentRoute.value.matched.length === this.routeDepth + 1) {
|
|
103
100
|
const lastFullPath = this.state.navViewMsgs[currentKey].fullPath;
|
|
104
101
|
if (lastFullPath !== fullPath) {
|
|
105
|
-
console.log("redirect to lastFullPath", lastFullPath);
|
|
106
102
|
setTimeout(() => {
|
|
107
103
|
this.router.push({ path: lastFullPath });
|
|
108
104
|
}, 0);
|
|
@@ -114,6 +110,9 @@ class NavPosIndexController extends PanelItemController {
|
|
|
114
110
|
this.navTabs.state.currentKey = currentKey;
|
|
115
111
|
}
|
|
116
112
|
}
|
|
113
|
+
if (currentKey === "") {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
117
116
|
const index = this.state.operateSort.indexOf(currentKey);
|
|
118
117
|
if (index !== -1) {
|
|
119
118
|
this.state.operateSort.splice(index, 1);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const IBizSearchFormButtons: import("@ibiz-template/vue3-util").TypeWithInstall<import("vue").DefineComponent<{
|
|
2
|
+
modelData: {
|
|
3
|
+
type: import("vue").PropType<import("@ibiz/model-core").IPanelRawItem>;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
controller: {
|
|
7
|
+
type: typeof import("./searchform-buttons.controller").SearchFormButtonsController;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
}, {
|
|
11
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
12
|
+
c: import("./searchform-buttons.controller").SearchFormButtonsController;
|
|
13
|
+
onSearchButtonClick: () => void;
|
|
14
|
+
onResetButtonClick: () => void;
|
|
15
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
16
|
+
modelData: {
|
|
17
|
+
type: import("vue").PropType<import("@ibiz/model-core").IPanelRawItem>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
controller: {
|
|
21
|
+
type: typeof import("./searchform-buttons.controller").SearchFormButtonsController;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
}>>, {}, {}>>;
|
|
25
|
+
export default IBizSearchFormButtons;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { registerPanelItemProvider } from '@ibiz-template/runtime';
|
|
2
|
+
import { withInstall } from '@ibiz-template/vue3-util';
|
|
3
|
+
import { SearchFormButtons } from './searchform-buttons.mjs';
|
|
4
|
+
import { SearchFormButtonsProvider } from './searchform-buttons.provider.mjs';
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
const IBizSearchFormButtons = withInstall(
|
|
8
|
+
SearchFormButtons,
|
|
9
|
+
function(v) {
|
|
10
|
+
v.component(SearchFormButtons.name, SearchFormButtons);
|
|
11
|
+
registerPanelItemProvider(
|
|
12
|
+
"RAWITEM_SEARCHFORM_BUTTONS",
|
|
13
|
+
() => new SearchFormButtonsProvider()
|
|
14
|
+
);
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export { IBizSearchFormButtons, IBizSearchFormButtons as default };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ISearchFormController, PanelItemController } from '@ibiz-template/runtime';
|
|
2
|
+
/**
|
|
3
|
+
* 搜索表单按钮控制器
|
|
4
|
+
* @author lxm
|
|
5
|
+
* @date 2023-11-21 02:18:14
|
|
6
|
+
* @export
|
|
7
|
+
* @class SearchFormButtonsController
|
|
8
|
+
* @extends {PanelItemController}
|
|
9
|
+
*/
|
|
10
|
+
export declare class SearchFormButtonsController extends PanelItemController {
|
|
11
|
+
/**
|
|
12
|
+
* 搜索按钮样式
|
|
13
|
+
* @author lxm
|
|
14
|
+
* @date 2023-11-21 03:25:31
|
|
15
|
+
* @type {(string | 'DEFAULT' | 'NONE' | 'SEARCHONLY' | 'USER' | 'USER2')}
|
|
16
|
+
*/
|
|
17
|
+
get searchButtonStyle(): string;
|
|
18
|
+
/**
|
|
19
|
+
* 搜索表单控制器
|
|
20
|
+
* @author lxm
|
|
21
|
+
* @date 2023-11-21 04:32:58
|
|
22
|
+
* @type {ISearchFormController}
|
|
23
|
+
*/
|
|
24
|
+
searchFrom: ISearchFormController;
|
|
25
|
+
protected onInit(): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* 点击搜索按钮
|
|
28
|
+
* @author lxm
|
|
29
|
+
* @date 2023-11-21 04:31:55
|
|
30
|
+
*/
|
|
31
|
+
onSearchButtonClick(): void;
|
|
32
|
+
/**
|
|
33
|
+
* 点击重置按钮
|
|
34
|
+
* @author lxm
|
|
35
|
+
* @date 2023-11-21 04:32:09
|
|
36
|
+
*/
|
|
37
|
+
onResetButtonClick(): void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { RuntimeError } from '@ibiz-template/core';
|
|
2
|
+
import { PanelItemController, UIActionUtil } from '@ibiz-template/runtime';
|
|
3
|
+
|
|
4
|
+
"use strict";
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __publicField = (obj, key, value) => {
|
|
8
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
9
|
+
return value;
|
|
10
|
+
};
|
|
11
|
+
class SearchFormButtonsController extends PanelItemController {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
/**
|
|
15
|
+
* 搜索表单控制器
|
|
16
|
+
* @author lxm
|
|
17
|
+
* @date 2023-11-21 04:32:58
|
|
18
|
+
* @type {ISearchFormController}
|
|
19
|
+
*/
|
|
20
|
+
__publicField(this, "searchFrom");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* 搜索按钮样式
|
|
24
|
+
* @author lxm
|
|
25
|
+
* @date 2023-11-21 03:25:31
|
|
26
|
+
* @type {(string | 'DEFAULT' | 'NONE' | 'SEARCHONLY' | 'USER' | 'USER2')}
|
|
27
|
+
*/
|
|
28
|
+
get searchButtonStyle() {
|
|
29
|
+
return this.searchFrom.model.searchButtonStyle || "DEFAULT";
|
|
30
|
+
}
|
|
31
|
+
async onInit() {
|
|
32
|
+
await super.onInit();
|
|
33
|
+
const searchFrom = this.panel.container;
|
|
34
|
+
if (!searchFrom) {
|
|
35
|
+
throw new RuntimeError("\u5F53\u524D\u89C6\u56FE\u91CC\u6CA1\u6709\u627E\u5230\u53EBsearchform\u7684\u641C\u7D22\u8868\u5355");
|
|
36
|
+
}
|
|
37
|
+
this.searchFrom = searchFrom;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 点击搜索按钮
|
|
41
|
+
* @author lxm
|
|
42
|
+
* @date 2023-11-21 04:31:55
|
|
43
|
+
*/
|
|
44
|
+
onSearchButtonClick() {
|
|
45
|
+
UIActionUtil.execAndResolved("search", {
|
|
46
|
+
context: this.panel.context,
|
|
47
|
+
params: this.panel.params,
|
|
48
|
+
data: [],
|
|
49
|
+
view: this.panel.view
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 点击重置按钮
|
|
54
|
+
* @author lxm
|
|
55
|
+
* @date 2023-11-21 04:32:09
|
|
56
|
+
*/
|
|
57
|
+
onResetButtonClick() {
|
|
58
|
+
UIActionUtil.execAndResolved("reset", {
|
|
59
|
+
context: this.panel.context,
|
|
60
|
+
params: this.panel.params,
|
|
61
|
+
data: [],
|
|
62
|
+
view: this.panel.view
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export { SearchFormButtonsController };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-searchform-buttons{--ibiz-searchform-buttons-height:40px;height:var(--ibiz-searchform-buttons-height);margin-top:var(--ibiz-spacing-tight);margin-left:var(--ibiz-spacing-tight)}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import './searchform-buttons.scss';
|
|
3
|
+
import { IPanelRawItem } from '@ibiz/model-core';
|
|
4
|
+
import { SearchFormButtonsController } from './searchform-buttons.controller';
|
|
5
|
+
export declare const SearchFormButtons: import("vue").DefineComponent<{
|
|
6
|
+
modelData: {
|
|
7
|
+
type: PropType<IPanelRawItem>;
|
|
8
|
+
required: true;
|
|
9
|
+
};
|
|
10
|
+
controller: {
|
|
11
|
+
type: typeof SearchFormButtonsController;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
}, {
|
|
15
|
+
ns: import("@ibiz-template/core").Namespace;
|
|
16
|
+
c: SearchFormButtonsController;
|
|
17
|
+
onSearchButtonClick: () => void;
|
|
18
|
+
onResetButtonClick: () => void;
|
|
19
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
modelData: {
|
|
21
|
+
type: PropType<IPanelRawItem>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
controller: {
|
|
25
|
+
type: typeof SearchFormButtonsController;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
}>>, {}, {}>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { resolveComponent, createTextVNode, createVNode, defineComponent } from 'vue';
|
|
2
|
+
import { useNamespace } from '@ibiz-template/vue3-util';
|
|
3
|
+
import './searchform-buttons.css';
|
|
4
|
+
import { SearchFormButtonsController } from './searchform-buttons.controller.mjs';
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
const SearchFormButtons = /* @__PURE__ */ defineComponent({
|
|
8
|
+
name: "IBizSearchFormButtons",
|
|
9
|
+
props: {
|
|
10
|
+
modelData: {
|
|
11
|
+
type: Object,
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
controller: {
|
|
15
|
+
type: SearchFormButtonsController,
|
|
16
|
+
required: true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
setup(prop) {
|
|
20
|
+
const ns = useNamespace("searchform-buttons");
|
|
21
|
+
const c = prop.controller;
|
|
22
|
+
const onSearchButtonClick = () => {
|
|
23
|
+
c.onSearchButtonClick();
|
|
24
|
+
};
|
|
25
|
+
const onResetButtonClick = () => {
|
|
26
|
+
c.onResetButtonClick();
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
ns,
|
|
30
|
+
c,
|
|
31
|
+
onSearchButtonClick,
|
|
32
|
+
onResetButtonClick
|
|
33
|
+
};
|
|
34
|
+
},
|
|
35
|
+
render() {
|
|
36
|
+
return createVNode("div", {
|
|
37
|
+
"class": [this.ns.b(), this.ns.m(this.modelData.id), ...this.controller.containerClass]
|
|
38
|
+
}, [this.controller.searchButtonStyle === "SEARCHONLY" ? createVNode(resolveComponent("el-button"), {
|
|
39
|
+
"onClick": this.onSearchButtonClick
|
|
40
|
+
}, {
|
|
41
|
+
default: () => [createTextVNode("\u641C\u7D22")]
|
|
42
|
+
}) : createVNode(resolveComponent("el-dropdown"), {
|
|
43
|
+
"split-button": true,
|
|
44
|
+
"type": "primary",
|
|
45
|
+
"onClick": this.onSearchButtonClick
|
|
46
|
+
}, {
|
|
47
|
+
default: () => createVNode("span", {
|
|
48
|
+
"class": this.ns.b("label")
|
|
49
|
+
}, [createTextVNode("\u641C\u7D22")]),
|
|
50
|
+
dropdown: () => {
|
|
51
|
+
return createVNode(resolveComponent("el-dropdown-menu"), null, {
|
|
52
|
+
default: () => [createVNode(resolveComponent("el-dropdown-item"), {
|
|
53
|
+
"onClick": this.onResetButtonClick
|
|
54
|
+
}, {
|
|
55
|
+
default: () => [createTextVNode("\u91CD\u7F6E")]
|
|
56
|
+
})]
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
})]);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export { SearchFormButtons };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { IPanelItemProvider, PanelController, PanelItemController } from '@ibiz-template/runtime';
|
|
2
|
+
import { IPanelItem } from '@ibiz/model-core';
|
|
3
|
+
/**
|
|
4
|
+
* 搜索表单按钮适配器
|
|
5
|
+
*
|
|
6
|
+
* @author lxm
|
|
7
|
+
* @date 2022-09-19 22:09:03
|
|
8
|
+
* @export
|
|
9
|
+
* @class SearchFormButtonsProvider
|
|
10
|
+
* @implements {EditorProvider}
|
|
11
|
+
*/
|
|
12
|
+
export declare class SearchFormButtonsProvider implements IPanelItemProvider {
|
|
13
|
+
component: string;
|
|
14
|
+
createController(panelItem: IPanelItem, panel: PanelController, parent: PanelItemController | undefined): Promise<PanelItemController>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SearchFormButtonsController } from './searchform-buttons.controller.mjs';
|
|
2
|
+
|
|
3
|
+
"use strict";
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __publicField = (obj, key, value) => {
|
|
7
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
8
|
+
return value;
|
|
9
|
+
};
|
|
10
|
+
class SearchFormButtonsProvider {
|
|
11
|
+
constructor() {
|
|
12
|
+
__publicField(this, "component", "IBizSearchFormButtons");
|
|
13
|
+
}
|
|
14
|
+
async createController(panelItem, panel, parent) {
|
|
15
|
+
const c = new SearchFormButtonsController(panelItem, panel, parent);
|
|
16
|
+
await c.init();
|
|
17
|
+
return c;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { SearchFormButtonsProvider };
|
|
@@ -16,6 +16,10 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
16
16
|
appDataEntity: {
|
|
17
17
|
type: Object,
|
|
18
18
|
required: true
|
|
19
|
+
},
|
|
20
|
+
dataImport: {
|
|
21
|
+
type: Object,
|
|
22
|
+
required: false
|
|
19
23
|
}
|
|
20
24
|
},
|
|
21
25
|
setup(props) {
|
|
@@ -25,6 +29,7 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
25
29
|
state: "ready",
|
|
26
30
|
message: ""
|
|
27
31
|
});
|
|
32
|
+
const errorMessage = vue.ref("");
|
|
28
33
|
const isLoading = vue.ref(false);
|
|
29
34
|
const onCancelButtonClick = () => {
|
|
30
35
|
props.dismiss();
|
|
@@ -34,20 +39,21 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
34
39
|
if (!obj.files) {
|
|
35
40
|
return;
|
|
36
41
|
}
|
|
42
|
+
errorMessage.value = "";
|
|
37
43
|
const selectedFile = obj.files[0];
|
|
38
44
|
obj.value = null;
|
|
39
45
|
let result;
|
|
40
46
|
isLoading.value = true;
|
|
41
47
|
try {
|
|
42
48
|
if (ibiz.env.enableMqtt) {
|
|
43
|
-
runtime.asyncImportData(selectedFile, props.appDataEntity);
|
|
49
|
+
runtime.asyncImportData(selectedFile, props.appDataEntity, props.dataImport);
|
|
44
50
|
ibiz.notification.info({
|
|
45
51
|
desc: "\u5F00\u59CB\u5BFC\u5165\uFF0C\u8BE6\u7EC6\u8FDB\u5EA6\u548C\u7ED3\u679C\u8BF7\u770B\u5E94\u7528\u901A\u77E5"
|
|
46
52
|
});
|
|
47
53
|
onCancelButtonClick();
|
|
48
54
|
return;
|
|
49
55
|
}
|
|
50
|
-
result = await runtime.importData(selectedFile, props.appDataEntity);
|
|
56
|
+
result = await runtime.importData(selectedFile, props.appDataEntity, props.dataImport);
|
|
51
57
|
ibiz.mc.command.send({
|
|
52
58
|
srfdecodename: props.appDataEntity.codeName
|
|
53
59
|
}, "OBJECTCREATED");
|
|
@@ -61,18 +67,25 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
61
67
|
const errorNum = total - success;
|
|
62
68
|
message.value.state = _message ? "error" : "over";
|
|
63
69
|
message.value.message = _message || `\u5171\u8BA1\u5BFC\u5165\u6570\u636E ${totalNum} \u6761\uFF0C\u9519\u8BEF[${errorNum}]\uFF0C\u6210\u529F[${successNum}]`;
|
|
70
|
+
} catch (error) {
|
|
71
|
+
if (error instanceof Error) {
|
|
72
|
+
errorMessage.value = error.message;
|
|
73
|
+
}
|
|
64
74
|
} finally {
|
|
65
75
|
isLoading.value = false;
|
|
66
76
|
}
|
|
67
77
|
};
|
|
68
78
|
const onLinkClick = async () => {
|
|
69
|
-
var _a;
|
|
70
|
-
|
|
79
|
+
var _a, _b;
|
|
80
|
+
let templateUrl = `${props.appDataEntity.codeName2.toLowerCase()}/importtemplate`;
|
|
81
|
+
if ((_a = props.dataImport) == null ? void 0 : _a.codeName) {
|
|
82
|
+
templateUrl += `?srfimporttag=${props.dataImport.codeName}`;
|
|
83
|
+
}
|
|
71
84
|
const res = await ibiz.net.request(templateUrl, {
|
|
72
85
|
responseType: "blob"
|
|
73
86
|
});
|
|
74
87
|
if (res.status === 200) {
|
|
75
|
-
let fileName = ((
|
|
88
|
+
let fileName = ((_b = res.headers["content-disposition"].split(";").find((str) => str.indexOf("filename=") !== -1)) == null ? void 0 : _b.slice(9)) || "";
|
|
76
89
|
fileName = decodeURIComponent(fileName);
|
|
77
90
|
const blob = new Blob([res.data], {
|
|
78
91
|
type: "application/vnd.ms-excel"
|
|
@@ -98,7 +111,8 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
98
111
|
onFileChange,
|
|
99
112
|
inputUpLoad,
|
|
100
113
|
isLoading,
|
|
101
|
-
message
|
|
114
|
+
message,
|
|
115
|
+
errorMessage
|
|
102
116
|
};
|
|
103
117
|
},
|
|
104
118
|
render() {
|
|
@@ -126,7 +140,9 @@ const DataImport = /* @__PURE__ */ vue.defineComponent({
|
|
|
126
140
|
"class": this.ns.be("message", "title")
|
|
127
141
|
}, [vue.createTextVNode("\u5BFC\u5165\u7ED3\u679C")]), vue.createVNode("div", {
|
|
128
142
|
"class": [this.ns.be("message", "content"), this.ns.is("error", this.message.state === "error")]
|
|
129
|
-
}, [this.message.message])]), vue.createVNode("div", {
|
|
143
|
+
}, [this.message.message])]), this.errorMessage && vue.createVNode("div", {
|
|
144
|
+
"class": this.ns.b("error-message")
|
|
145
|
+
}, [this.errorMessage]), vue.createVNode("div", {
|
|
130
146
|
"class": this.ns.e("template-container")
|
|
131
147
|
}, [vue.createVNode("div", {
|
|
132
148
|
"class": this.ns.e("template-description")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.ibiz-data-import{display:flex;flex-flow:column nowrap;width:544px;height:368px;padding:20px;background:var(--ibiz-color-bg-1)}.ibiz-data-import__caption{margin-bottom:16px;font-size:var(--ibiz-font-size-large);font-weight:600;color:var(--ibiz-text-color)}.ibiz-data-import__template-container{padding:16px 12px 0;margin-bottom:16px}.ibiz-data-import__template-link{color:#57a3fd;cursor:pointer}.ibiz-data-import__link-icon{height:19px;margin-right:2px;vertical-align:bottom}.ibiz-data-import__button-bar{margin-right:20px;text-align:right}.ibiz-data-import__button-bar .ivu-btn{margin-left:8px}.ibiz-data-import-upload{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;flex-grow:1;cursor:pointer;background:var(--ibiz-color-bg-1);border:1px dashed var(--ibiz-color-border);border-radius:4px}.ibiz-data-import-upload__img{width:50px;height:50px;margin-bottom:20px}.ibiz-data-import-message{display:flex;flex-flow:column nowrap;flex-grow:1;padding:8px 16px;overflow:auto;cursor:pointer;background:var(--ibiz-color-bg-1);border:1px dashed var(--ibiz-color-border);border-radius:4px}.ibiz-data-import-message__title{font-size:var(--ibiz-font-size-medium);font-weight:600}.ibiz-data-import-message__content{padding-left:16px}.ibiz-data-import-message__content.is-error{color:var(--ibiz-color-danger)}
|
|
1
|
+
.ibiz-data-import{display:flex;flex-flow:column nowrap;width:544px;height:368px;padding:20px;background:var(--ibiz-color-bg-1)}.ibiz-data-import__caption{margin-bottom:16px;font-size:var(--ibiz-font-size-large);font-weight:600;color:var(--ibiz-text-color)}.ibiz-data-import__template-container{padding:16px 12px 0;margin-bottom:16px}.ibiz-data-import__template-link{color:#57a3fd;cursor:pointer}.ibiz-data-import__link-icon{height:19px;margin-right:2px;vertical-align:bottom}.ibiz-data-import__button-bar{margin-right:20px;text-align:right}.ibiz-data-import__button-bar .ivu-btn{margin-left:8px}.ibiz-data-import-upload{display:flex;flex-flow:column nowrap;align-items:center;justify-content:center;flex-grow:1;cursor:pointer;background:var(--ibiz-color-bg-1);border:1px dashed var(--ibiz-color-border);border-radius:4px}.ibiz-data-import-upload__img{width:50px;height:50px;margin-bottom:20px}.ibiz-data-import-message{display:flex;flex-flow:column nowrap;flex-grow:1;padding:8px 16px;overflow:auto;cursor:pointer;background:var(--ibiz-color-bg-1);border:1px dashed var(--ibiz-color-border);border-radius:4px}.ibiz-data-import-message__title{font-size:var(--ibiz-font-size-medium);font-weight:600}.ibiz-data-import-message__content{padding-left:16px}.ibiz-data-import-message__content.is-error{color:var(--ibiz-color-danger)}.ibiz-data-import-error-message{padding:var(--ibiz-spacing-base) var(--ibiz-spacing-base-tight) 0;color:var(--ibiz-color-danger)}
|