@airpower/web 0.3.2 → 0.3.3
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/components/table/Table.vue.d.ts +22 -12
- package/dist/main.js +146 -16
- package/package.json +1 -1
|
@@ -14,6 +14,7 @@ declare const _default: <E extends RootEntity, S extends AbstractCurdService<E>>
|
|
|
14
14
|
props: __VLS_PrettifyLocal<Pick<Partial<{
|
|
15
15
|
loading: boolean;
|
|
16
16
|
entity: ITransformerConstructor<E>;
|
|
17
|
+
onSearch: (request: QueryRequestPage<E>) => void;
|
|
17
18
|
autoHeight: boolean;
|
|
18
19
|
selectList: E[];
|
|
19
20
|
emptyText: string;
|
|
@@ -67,6 +68,15 @@ declare const _default: <E extends RootEntity, S extends AbstractCurdService<E>>
|
|
|
67
68
|
importUrl: string;
|
|
68
69
|
importTemplateUrl: string;
|
|
69
70
|
fileEntity: ITransformerConstructor<IFile & RootEntity>;
|
|
71
|
+
onAdd: () => void;
|
|
72
|
+
onDetail: (row: E) => void;
|
|
73
|
+
onDelete: (row: E) => void;
|
|
74
|
+
onEdit: (row: E) => void;
|
|
75
|
+
onSelected: (list: E[]) => void;
|
|
76
|
+
onAddRow: (row: E) => void;
|
|
77
|
+
onSortChange: (sort?: QuerySort) => void;
|
|
78
|
+
onDisable: (row: E) => void;
|
|
79
|
+
onEnable: (row: E) => void;
|
|
70
80
|
}> & Omit<{
|
|
71
81
|
readonly loading: boolean;
|
|
72
82
|
readonly autoHeight: boolean;
|
|
@@ -97,6 +107,7 @@ declare const _default: <E extends RootEntity, S extends AbstractCurdService<E>>
|
|
|
97
107
|
readonly showImport: boolean;
|
|
98
108
|
readonly showExport: boolean;
|
|
99
109
|
readonly entity?: ITransformerConstructor<E> | undefined;
|
|
110
|
+
readonly onSearch?: ((request: QueryRequestPage<E>) => void) | undefined;
|
|
100
111
|
readonly emptyText?: string | undefined;
|
|
101
112
|
readonly service?: CurdServiceConstructor<E, S> | undefined;
|
|
102
113
|
readonly addPermission?: string | undefined;
|
|
@@ -124,17 +135,16 @@ declare const _default: <E extends RootEntity, S extends AbstractCurdService<E>>
|
|
|
124
135
|
readonly importUrl?: string | undefined;
|
|
125
136
|
readonly importTemplateUrl?: string | undefined;
|
|
126
137
|
readonly fileEntity?: ITransformerConstructor<IFile & RootEntity> | undefined;
|
|
127
|
-
readonly onAdd?: (() =>
|
|
128
|
-
readonly
|
|
129
|
-
readonly
|
|
130
|
-
readonly
|
|
131
|
-
readonly
|
|
132
|
-
readonly
|
|
133
|
-
readonly
|
|
134
|
-
readonly
|
|
135
|
-
readonly
|
|
136
|
-
|
|
137
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "loading" | "entity" | "autoHeight" | "selectList" | "emptyText" | "addPermission" | "searchParams" | "useHook" | "disablePage" | "hideAdd" | "editPermission" | "disablePermission" | "enablePermission" | "detailPermission" | "deletePermission" | "addRowPermission" | "exportPermission" | "importPermission" | "dataList" | "columnList" | "hideEdit" | "disableEdit" | "disableAddRow" | "disableChangeStatus" | "disableDetail" | "disableDelete" | "disableRow" | "hideDelete" | "selectable" | "showSelect" | "showEnableAndDisable" | "hideIndex" | "fieldCacheKey" | "hideColumnSelector" | "ctrlWidth" | "hideCtrl" | "showDetail" | "showAddRow" | "customDelete" | "deleteTitle" | "deleteContent" | "showImport" | "importTitle" | "exportParam" | "showExport" | "defaultFilter" | "importUrl" | "importTemplateUrl" | "fileEntity">, "onSearch" | "service" | "onAdd" | "onDelete" | "onDisable" | "onEnable" | "onDetail" | "onEdit" | "onSelectChanged" | "onAddRow" | "onSortChanged" | ("loading" | "entity" | "autoHeight" | "selectList" | "emptyText" | "addPermission" | "searchParams" | "useHook" | "disablePage" | "hideAdd" | "editPermission" | "disablePermission" | "enablePermission" | "detailPermission" | "deletePermission" | "addRowPermission" | "exportPermission" | "importPermission" | "dataList" | "columnList" | "hideEdit" | "disableEdit" | "disableAddRow" | "disableChangeStatus" | "disableDetail" | "disableDelete" | "disableRow" | "hideDelete" | "selectable" | "showSelect" | "showEnableAndDisable" | "hideIndex" | "fieldCacheKey" | "hideColumnSelector" | "ctrlWidth" | "hideCtrl" | "showDetail" | "showAddRow" | "customDelete" | "deleteTitle" | "deleteContent" | "showImport" | "importTitle" | "exportParam" | "showExport" | "defaultFilter" | "importUrl" | "importTemplateUrl" | "fileEntity")> & {} & Partial<{}>> & import('vue').PublicProps;
|
|
138
|
+
readonly onAdd?: (() => void) | undefined;
|
|
139
|
+
readonly onDetail?: ((row: E) => void) | undefined;
|
|
140
|
+
readonly onDelete?: ((row: E) => void) | undefined;
|
|
141
|
+
readonly onEdit?: ((row: E) => void) | undefined;
|
|
142
|
+
readonly onSelected?: ((list: E[]) => void) | undefined;
|
|
143
|
+
readonly onAddRow?: ((row: E) => void) | undefined;
|
|
144
|
+
readonly onSortChange?: ((sort?: QuerySort) => void) | undefined;
|
|
145
|
+
readonly onDisable?: ((row: E) => void) | undefined;
|
|
146
|
+
readonly onEnable?: ((row: E) => void) | undefined;
|
|
147
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, "loading" | "entity" | "onSearch" | "autoHeight" | "selectList" | "emptyText" | "addPermission" | "searchParams" | "useHook" | "disablePage" | "hideAdd" | "editPermission" | "disablePermission" | "enablePermission" | "detailPermission" | "deletePermission" | "addRowPermission" | "exportPermission" | "importPermission" | "dataList" | "columnList" | "hideEdit" | "disableEdit" | "disableAddRow" | "disableChangeStatus" | "disableDetail" | "disableDelete" | "disableRow" | "hideDelete" | "selectable" | "showSelect" | "showEnableAndDisable" | "hideIndex" | "fieldCacheKey" | "hideColumnSelector" | "ctrlWidth" | "hideCtrl" | "showDetail" | "showAddRow" | "customDelete" | "deleteTitle" | "deleteContent" | "showImport" | "importTitle" | "exportParam" | "showExport" | "defaultFilter" | "importUrl" | "importTemplateUrl" | "fileEntity" | "onAdd" | "onDetail" | "onDelete" | "onEdit" | "onSelected" | "onAddRow" | "onSortChange" | "onDisable" | "onEnable">, "service" | ("loading" | "entity" | "onSearch" | "autoHeight" | "selectList" | "emptyText" | "addPermission" | "searchParams" | "useHook" | "disablePage" | "hideAdd" | "editPermission" | "disablePermission" | "enablePermission" | "detailPermission" | "deletePermission" | "addRowPermission" | "exportPermission" | "importPermission" | "dataList" | "columnList" | "hideEdit" | "disableEdit" | "disableAddRow" | "disableChangeStatus" | "disableDetail" | "disableDelete" | "disableRow" | "hideDelete" | "selectable" | "showSelect" | "showEnableAndDisable" | "hideIndex" | "fieldCacheKey" | "hideColumnSelector" | "ctrlWidth" | "hideCtrl" | "showDetail" | "showAddRow" | "customDelete" | "deleteTitle" | "deleteContent" | "showImport" | "importTitle" | "exportParam" | "showExport" | "defaultFilter" | "importUrl" | "importTemplateUrl" | "fileEntity" | "onAdd" | "onDetail" | "onDelete" | "onEdit" | "onSelected" | "onAddRow" | "onSortChange" | "onDisable" | "onEnable")> & {} & Partial<{}>> & import('vue').PublicProps;
|
|
138
148
|
expose(exposed: import('vue').ShallowUnwrapRef<{
|
|
139
149
|
resetSearch: () => void;
|
|
140
150
|
search: () => void;
|
|
@@ -164,7 +174,7 @@ declare const _default: <E extends RootEntity, S extends AbstractCurdService<E>>
|
|
|
164
174
|
afterPage?(_: {}): any;
|
|
165
175
|
footerRight?(_: {}): any;
|
|
166
176
|
};
|
|
167
|
-
emit:
|
|
177
|
+
emit: {};
|
|
168
178
|
}>) => import('vue').VNode & {
|
|
169
179
|
__ctx?: Awaited<typeof __VLS_setup>;
|
|
170
180
|
};
|
package/dist/main.js
CHANGED
|
@@ -17827,12 +17827,80 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
17827
17827
|
fileEntity: {
|
|
17828
17828
|
type: Function,
|
|
17829
17829
|
default: void 0
|
|
17830
|
+
},
|
|
17831
|
+
/**
|
|
17832
|
+
* # 自定义添加事件
|
|
17833
|
+
*/
|
|
17834
|
+
onAdd: {
|
|
17835
|
+
type: Function,
|
|
17836
|
+
default: void 0
|
|
17837
|
+
},
|
|
17838
|
+
/**
|
|
17839
|
+
* # 自定义详情事件
|
|
17840
|
+
*/
|
|
17841
|
+
onDetail: {
|
|
17842
|
+
type: Function,
|
|
17843
|
+
default: void 0
|
|
17844
|
+
},
|
|
17845
|
+
/**
|
|
17846
|
+
* # 自定义删除事件
|
|
17847
|
+
*/
|
|
17848
|
+
onDelete: {
|
|
17849
|
+
type: Function,
|
|
17850
|
+
default: void 0
|
|
17851
|
+
},
|
|
17852
|
+
/**
|
|
17853
|
+
* # 自定义编辑事件
|
|
17854
|
+
*/
|
|
17855
|
+
onEdit: {
|
|
17856
|
+
type: Function,
|
|
17857
|
+
default: void 0
|
|
17858
|
+
},
|
|
17859
|
+
/**
|
|
17860
|
+
* # 选择变更事件
|
|
17861
|
+
*/
|
|
17862
|
+
onSelected: {
|
|
17863
|
+
type: Function,
|
|
17864
|
+
default: void 0
|
|
17865
|
+
},
|
|
17866
|
+
/**
|
|
17867
|
+
* # 行添加事件
|
|
17868
|
+
*/
|
|
17869
|
+
onAddRow: {
|
|
17870
|
+
type: Function,
|
|
17871
|
+
default: void 0
|
|
17872
|
+
},
|
|
17873
|
+
/**
|
|
17874
|
+
* # 排序变更事件
|
|
17875
|
+
*/
|
|
17876
|
+
onSortChange: {
|
|
17877
|
+
type: Function,
|
|
17878
|
+
default: void 0
|
|
17879
|
+
},
|
|
17880
|
+
/**
|
|
17881
|
+
* # 禁用事件
|
|
17882
|
+
*/
|
|
17883
|
+
onDisable: {
|
|
17884
|
+
type: Function,
|
|
17885
|
+
default: void 0
|
|
17886
|
+
},
|
|
17887
|
+
/**
|
|
17888
|
+
* # 启用事件
|
|
17889
|
+
*/
|
|
17890
|
+
onEnable: {
|
|
17891
|
+
type: Function,
|
|
17892
|
+
default: void 0
|
|
17893
|
+
},
|
|
17894
|
+
/**
|
|
17895
|
+
* # 搜索事件
|
|
17896
|
+
*/
|
|
17897
|
+
onSearch: {
|
|
17898
|
+
type: Function,
|
|
17899
|
+
default: void 0
|
|
17830
17900
|
}
|
|
17831
17901
|
},
|
|
17832
|
-
|
|
17833
|
-
setup(__props, { expose: __expose, emit: __emit }) {
|
|
17902
|
+
setup(__props, { expose: __expose }) {
|
|
17834
17903
|
const props = __props;
|
|
17835
|
-
const emits = __emit;
|
|
17836
17904
|
__expose({
|
|
17837
17905
|
resetSearch: onReset,
|
|
17838
17906
|
search: onSearch
|
|
@@ -17934,7 +18002,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
17934
18002
|
}
|
|
17935
18003
|
async function handleDelete(item) {
|
|
17936
18004
|
if (props.customDelete) {
|
|
17937
|
-
|
|
18005
|
+
if (props.onDelete) {
|
|
18006
|
+
props.onDelete(item);
|
|
18007
|
+
} else if (hook) {
|
|
18008
|
+
hook.onDelete(item);
|
|
18009
|
+
}
|
|
17938
18010
|
return;
|
|
17939
18011
|
}
|
|
17940
18012
|
try {
|
|
@@ -17954,7 +18026,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
17954
18026
|
cancelButtonText: WebI18n.get().Cancel,
|
|
17955
18027
|
type: "warning"
|
|
17956
18028
|
});
|
|
17957
|
-
|
|
18029
|
+
if (props.onDelete) {
|
|
18030
|
+
props.onDelete(item);
|
|
18031
|
+
} else if (hook) {
|
|
18032
|
+
hook.onDelete(item);
|
|
18033
|
+
}
|
|
17958
18034
|
} catch (e) {
|
|
17959
18035
|
console.error(e);
|
|
17960
18036
|
}
|
|
@@ -17983,16 +18059,24 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
17983
18059
|
selectAll.push(find);
|
|
17984
18060
|
}
|
|
17985
18061
|
});
|
|
17986
|
-
|
|
18062
|
+
if (props.onSelected) {
|
|
18063
|
+
props.onSelected(selectAll);
|
|
18064
|
+
} else if (hook) {
|
|
18065
|
+
hook.onSelected(selectAll);
|
|
18066
|
+
}
|
|
17987
18067
|
}
|
|
17988
18068
|
function handleSortChanged(data) {
|
|
18069
|
+
let callback;
|
|
17989
18070
|
if (data.prop && data.order) {
|
|
17990
18071
|
const sort = new QuerySort();
|
|
17991
18072
|
sort.field = data.prop;
|
|
17992
18073
|
sort.direction = data.order === "descending" ? "desc" : "asc";
|
|
17993
|
-
|
|
17994
|
-
}
|
|
17995
|
-
|
|
18074
|
+
callback = sort;
|
|
18075
|
+
}
|
|
18076
|
+
if (props.onSortChange) {
|
|
18077
|
+
props.onSortChange(callback);
|
|
18078
|
+
} else if (hook) {
|
|
18079
|
+
hook.onSortChanged(callback);
|
|
17996
18080
|
}
|
|
17997
18081
|
}
|
|
17998
18082
|
function getRowEntity(scope) {
|
|
@@ -18039,6 +18123,48 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18039
18123
|
}
|
|
18040
18124
|
return WebConfig.apiUrl + url;
|
|
18041
18125
|
}
|
|
18126
|
+
function handleAdd() {
|
|
18127
|
+
if (props.onAdd) {
|
|
18128
|
+
props.onAdd();
|
|
18129
|
+
} else if (hook) {
|
|
18130
|
+
hook.onAdd();
|
|
18131
|
+
}
|
|
18132
|
+
}
|
|
18133
|
+
function handleAddRow(row) {
|
|
18134
|
+
if (props.onAddRow) {
|
|
18135
|
+
props.onAddRow(row);
|
|
18136
|
+
} else if (hook && hook.onAddRow) {
|
|
18137
|
+
hook.onAddRow(row);
|
|
18138
|
+
}
|
|
18139
|
+
}
|
|
18140
|
+
function handleEdit(row) {
|
|
18141
|
+
if (props.onEdit) {
|
|
18142
|
+
props.onEdit(row);
|
|
18143
|
+
} else if (hook) {
|
|
18144
|
+
hook.onEdit(row);
|
|
18145
|
+
}
|
|
18146
|
+
}
|
|
18147
|
+
function handleDetail(row) {
|
|
18148
|
+
if (props.onDetail) {
|
|
18149
|
+
props.onDetail(row);
|
|
18150
|
+
} else if (hook) {
|
|
18151
|
+
hook.onDetail(row);
|
|
18152
|
+
}
|
|
18153
|
+
}
|
|
18154
|
+
function handleDisable(row) {
|
|
18155
|
+
if (props.onDisable) {
|
|
18156
|
+
props.onDisable(row);
|
|
18157
|
+
} else if (hook) {
|
|
18158
|
+
hook.onDisable(row);
|
|
18159
|
+
}
|
|
18160
|
+
}
|
|
18161
|
+
function handleEnable(row) {
|
|
18162
|
+
if (props.onEnable) {
|
|
18163
|
+
props.onEnable(row);
|
|
18164
|
+
} else if (hook) {
|
|
18165
|
+
hook.onEnable(row);
|
|
18166
|
+
}
|
|
18167
|
+
}
|
|
18042
18168
|
async function onImport() {
|
|
18043
18169
|
let url = props.importUrl;
|
|
18044
18170
|
if (!url) {
|
|
@@ -18117,7 +18243,11 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18117
18243
|
if (request.value.page) {
|
|
18118
18244
|
request.value.page.pageNum = 1;
|
|
18119
18245
|
}
|
|
18120
|
-
|
|
18246
|
+
if (props.onSearch) {
|
|
18247
|
+
props.onSearch(request.value);
|
|
18248
|
+
} else if (hook) {
|
|
18249
|
+
hook.onSearch(request.value);
|
|
18250
|
+
}
|
|
18121
18251
|
}
|
|
18122
18252
|
return (_ctx, _cache) => {
|
|
18123
18253
|
const _directive_loading = resolveDirective("loading");
|
|
@@ -18136,7 +18266,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18136
18266
|
permission: __props.addPermission || unref(PermissionUtil).get(unref(EntityClass), unref(PermissionAction).ADD),
|
|
18137
18267
|
icon: "ADD",
|
|
18138
18268
|
primary: "",
|
|
18139
|
-
onClick: _cache[0] || (_cache[0] = ($event) =>
|
|
18269
|
+
onClick: _cache[0] || (_cache[0] = ($event) => handleAdd())
|
|
18140
18270
|
}, {
|
|
18141
18271
|
default: withCtx(() => [
|
|
18142
18272
|
createTextVNode(toDisplayString(unref(modelConfig).addTitle || unref(WebI18n).get().Add), 1)
|
|
@@ -18350,7 +18480,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18350
18480
|
key: 0,
|
|
18351
18481
|
disabled: unref(isAddRowDisabled)(getRowEntity(scope)),
|
|
18352
18482
|
underline: false,
|
|
18353
|
-
onClick: ($event) =>
|
|
18483
|
+
onClick: ($event) => handleAddRow(getRowEntity(scope))
|
|
18354
18484
|
}, {
|
|
18355
18485
|
default: withCtx(() => [
|
|
18356
18486
|
createTextVNode(toDisplayString(unref(WebI18n).get().Add), 1)
|
|
@@ -18361,7 +18491,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18361
18491
|
key: 1,
|
|
18362
18492
|
disabled: unref(isEditDisabled)(getRowEntity(scope)),
|
|
18363
18493
|
underline: false,
|
|
18364
|
-
onClick: ($event) =>
|
|
18494
|
+
onClick: ($event) => handleEdit(getRowEntity(scope))
|
|
18365
18495
|
}, {
|
|
18366
18496
|
default: withCtx(() => [
|
|
18367
18497
|
createTextVNode(toDisplayString(unref(WebI18n).get().Update), 1)
|
|
@@ -18372,7 +18502,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18372
18502
|
key: 2,
|
|
18373
18503
|
disabled: unref(isDetailDisabled)(getRowEntity(scope)),
|
|
18374
18504
|
underline: false,
|
|
18375
|
-
onClick: ($event) =>
|
|
18505
|
+
onClick: ($event) => handleDetail(getRowEntity(scope))
|
|
18376
18506
|
}, {
|
|
18377
18507
|
default: withCtx(() => [
|
|
18378
18508
|
createTextVNode(toDisplayString(unref(WebI18n).get().Detail), 1)
|
|
@@ -18384,7 +18514,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18384
18514
|
key: 0,
|
|
18385
18515
|
disabled: unref(isDisableChangeStatus)(getRowEntity(scope)),
|
|
18386
18516
|
underline: false,
|
|
18387
|
-
onClick: ($event) =>
|
|
18517
|
+
onClick: ($event) => handleEnable(getRowEntity(scope))
|
|
18388
18518
|
}, {
|
|
18389
18519
|
default: withCtx(() => [
|
|
18390
18520
|
createTextVNode(toDisplayString(unref(WebI18n).get().Enable), 1)
|
|
@@ -18395,7 +18525,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
18395
18525
|
disabled: unref(isDisableChangeStatus)(getRowEntity(scope)),
|
|
18396
18526
|
underline: false,
|
|
18397
18527
|
type: "warning",
|
|
18398
|
-
onClick: ($event) =>
|
|
18528
|
+
onClick: ($event) => handleDisable(getRowEntity(scope))
|
|
18399
18529
|
}, {
|
|
18400
18530
|
default: withCtx(() => [
|
|
18401
18531
|
createTextVNode(toDisplayString(unref(WebI18n).get().Disable), 1)
|