@vue-start/pro 0.4.2 → 0.4.5
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.d.ts +6 -5
- package/dist/index.es.js +101 -71
- package/dist/index.js +101 -70
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -382,7 +382,7 @@ declare const proTableProps: () => {
|
|
|
382
382
|
};
|
|
383
383
|
};
|
|
384
384
|
declare type ProTableProps = Partial<ExtractPropTypes<ReturnType<typeof proTableProps>>>;
|
|
385
|
-
declare const createTable: (Table: any, Props?: any) => any;
|
|
385
|
+
declare const createTable: (Table: any, Props?: any, tableMethods?: string[] | undefined) => any;
|
|
386
386
|
|
|
387
387
|
declare type TPageState = {
|
|
388
388
|
page: number;
|
|
@@ -464,6 +464,7 @@ declare const proCurdProps: () => {
|
|
|
464
464
|
};
|
|
465
465
|
};
|
|
466
466
|
declare type CurdProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdProps>>>;
|
|
467
|
+
declare const CurdMethods: string[];
|
|
467
468
|
declare type ProCurdProps = CurdProps & Omit<ProModuleProps, "state" | "requests"> & {
|
|
468
469
|
curdState?: UnwrapNestedRefs<ICurdState>;
|
|
469
470
|
};
|
|
@@ -585,7 +586,7 @@ declare const proCurdAddOrEditProps: () => {
|
|
|
585
586
|
};
|
|
586
587
|
};
|
|
587
588
|
declare type ProCurdAddOrEditProps = Partial<ExtractPropTypes<ReturnType<typeof proCurdAddOrEditProps>>>;
|
|
588
|
-
declare const createCurdForm: (Form: any, Button: any, convertFormProps?: ((curdState: ICurdState) => Record<string, any>) | undefined) => any;
|
|
589
|
+
declare const createCurdForm: (Form: any, Button: any, convertFormProps?: ((curdState: ICurdState) => Record<string, any>) | undefined, formMethods?: string[] | undefined) => any;
|
|
589
590
|
|
|
590
591
|
declare const proCurdListProps: () => {
|
|
591
592
|
/**
|
|
@@ -733,7 +734,7 @@ declare const proFormProps: () => {
|
|
|
733
734
|
};
|
|
734
735
|
};
|
|
735
736
|
declare type ProFormProps = Partial<ExtractPropTypes<ReturnType<typeof proFormProps>>>;
|
|
736
|
-
declare const createForm: (Form: any, Grid: any) => any;
|
|
737
|
+
declare const createForm: (Form: any, Grid: any, formMethods: string[]) => any;
|
|
737
738
|
|
|
738
739
|
declare enum SearchMode {
|
|
739
740
|
AUTO = "AUTO",
|
|
@@ -788,7 +789,7 @@ declare type ProSearchFormProps = Partial<ExtractPropTypes<ReturnType<typeof pro
|
|
|
788
789
|
* 该组件只是个模式,最终返回null,不做任何渲染,应配合着ProForm的包装类一起使用
|
|
789
790
|
* 针对传入的model(监听对象)做相应的finish(回调)处理
|
|
790
791
|
*/
|
|
791
|
-
declare const createSearchForm: (Form: any, Props: any) => any;
|
|
792
|
+
declare const createSearchForm: (Form: any, Props: any, formMethods: string[]) => any;
|
|
792
793
|
|
|
793
794
|
interface FormItemProps {
|
|
794
795
|
name?: string | number | (string | number)[];
|
|
@@ -961,4 +962,4 @@ declare const generateId: () => string;
|
|
|
961
962
|
*/
|
|
962
963
|
declare const createExpose: (methods: string[], targetRef: Ref$1) => {};
|
|
963
964
|
|
|
964
|
-
export { BooleanObjType, BooleanRulesObjType, CurdAction, CurdAddAction, CurdCurrentMode, CurdSubAction, FieldNames, FormItemProps, GridProps, ICurdAction, ICurdAddAction, ICurdCurrentMode, ICurdOperateOpts, ICurdState, ICurdSubAction, IElementConfig, IHighConfig, IListData, IOperateItem, IProCurdProvide, IProFormProvideExtra, IProModuleProvide, IProTableProvide, IProTableProvideExtra, IRequestOpts, ISearchMode, ITableOperate, InternalNamePath, NamePath, ProCurd, ProCurdAddOrEditProps, ProCurdListProps, ProCurdProps, ProFormItemProps, ProFormListProps, ProFormProps, ProModalCurd, ProModalCurdProps, ProModule, ProModuleProps, ProPageCurd, ProPageCurdProps, ProSearchFormProps, ProTableProps, RequestAction, SearchMode, TActionEvent, TActionState, TColumn, TColumns, TCurdActionEvent, TData, TDefaultValueType, TElementMap, TOption, TOptions, TPageState, TTableColumn, TTableColumns, TValueType, Wrapper, convertPathToList, createCurdDesc, createCurdForm, createCurdList, createExpose, createForm, createFormItemCompFn, createFormList, createGrid, createSearchForm, createTable, defaultPage, findTargetInTree, findTargetListInTree, generateId, getColumnFormItemName, getColumnValueType, getFirstPropName, getFormItemEl, getItemEl, getValidValues, mergeStateToList, provideProCurd, provideProFormList, provideProModule, renderElement, renderElements, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProCurd, useProForm, useProFormList, useProModule, useProTable };
|
|
965
|
+
export { BooleanObjType, BooleanRulesObjType, CurdAction, CurdAddAction, CurdCurrentMode, CurdMethods, CurdSubAction, FieldNames, FormItemProps, GridProps, ICurdAction, ICurdAddAction, ICurdCurrentMode, ICurdOperateOpts, ICurdState, ICurdSubAction, IElementConfig, IHighConfig, IListData, IOperateItem, IProCurdProvide, IProFormProvideExtra, IProModuleProvide, IProTableProvide, IProTableProvideExtra, IRequestOpts, ISearchMode, ITableOperate, InternalNamePath, NamePath, ProCurd, ProCurdAddOrEditProps, ProCurdListProps, ProCurdProps, ProFormItemProps, ProFormListProps, ProFormProps, ProModalCurd, ProModalCurdProps, ProModule, ProModuleProps, ProPageCurd, ProPageCurdProps, ProSearchFormProps, ProTableProps, RequestAction, SearchMode, TActionEvent, TActionState, TColumn, TColumns, TCurdActionEvent, TData, TDefaultValueType, TElementMap, TOption, TOptions, TPageState, TTableColumn, TTableColumns, TValueType, Wrapper, convertPathToList, createCurdDesc, createCurdForm, createCurdList, createExpose, createForm, createFormItemCompFn, createFormList, createGrid, createSearchForm, createTable, defaultPage, findTargetInTree, findTargetListInTree, generateId, getColumnFormItemName, getColumnValueType, getFirstPropName, getFormItemEl, getItemEl, getValidValues, mergeStateToList, provideProCurd, provideProFormList, provideProModule, renderElement, renderElements, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProCurd, useProForm, useProFormList, useProModule, useProTable };
|
package/dist/index.es.js
CHANGED
|
@@ -989,6 +989,7 @@ var proCurdProps = function proCurdProps() {
|
|
|
989
989
|
};
|
|
990
990
|
};
|
|
991
991
|
|
|
992
|
+
var CurdMethods = ["sendCurdEvent", "refreshList", "sendEvent", "sendRequest"];
|
|
992
993
|
var Curd = defineComponent({
|
|
993
994
|
props: _objectSpread2({}, proCurdProps()),
|
|
994
995
|
setup: function setup(props, _ref) {
|
|
@@ -1168,7 +1169,6 @@ var Curd = defineComponent({
|
|
|
1168
1169
|
});
|
|
1169
1170
|
expose({
|
|
1170
1171
|
sendCurdEvent: sendCurdEvent,
|
|
1171
|
-
getOperate: getOperate,
|
|
1172
1172
|
refreshList: handleSearch
|
|
1173
1173
|
});
|
|
1174
1174
|
return function () {
|
|
@@ -1250,8 +1250,30 @@ var ProCurd = defineComponent({
|
|
|
1250
1250
|
});
|
|
1251
1251
|
var moduleKeys = keys(omit(ProModule.props, "state", "requests"));
|
|
1252
1252
|
expose({
|
|
1253
|
-
|
|
1254
|
-
|
|
1253
|
+
sendCurdEvent: function sendCurdEvent(event) {
|
|
1254
|
+
var _curdRef$value;
|
|
1255
|
+
|
|
1256
|
+
(_curdRef$value = curdRef.value) === null || _curdRef$value === void 0 ? void 0 : _curdRef$value.sendCurdEvent(event);
|
|
1257
|
+
},
|
|
1258
|
+
refreshList: function refreshList(extra) {
|
|
1259
|
+
var _curdRef$value2;
|
|
1260
|
+
|
|
1261
|
+
(_curdRef$value2 = curdRef.value) === null || _curdRef$value2 === void 0 ? void 0 : _curdRef$value2.refreshList(extra);
|
|
1262
|
+
},
|
|
1263
|
+
sendEvent: function sendEvent(action) {
|
|
1264
|
+
var _moduleRef$value;
|
|
1265
|
+
|
|
1266
|
+
(_moduleRef$value = moduleRef.value) === null || _moduleRef$value === void 0 ? void 0 : _moduleRef$value.sendEvent(action);
|
|
1267
|
+
},
|
|
1268
|
+
sendRequest: function sendRequest(requestNameOrAction) {
|
|
1269
|
+
var _moduleRef$value2;
|
|
1270
|
+
|
|
1271
|
+
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1272
|
+
params[_key - 1] = arguments[_key];
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
(_moduleRef$value2 = moduleRef.value) === null || _moduleRef$value2 === void 0 ? void 0 : _moduleRef$value2.sendEvent.apply(_moduleRef$value2, [requestNameOrAction].concat(params));
|
|
1276
|
+
}
|
|
1255
1277
|
});
|
|
1256
1278
|
return function () {
|
|
1257
1279
|
return createVNode(ProModule, mergeProps({
|
|
@@ -1280,8 +1302,8 @@ var modalCurdProps = function modalCurdProps() {
|
|
|
1280
1302
|
};
|
|
1281
1303
|
};
|
|
1282
1304
|
|
|
1283
|
-
/**
|
|
1284
|
-
* 事件处理
|
|
1305
|
+
/**
|
|
1306
|
+
* 事件处理
|
|
1285
1307
|
*/
|
|
1286
1308
|
var ModalCurd = defineComponent({
|
|
1287
1309
|
props: _objectSpread2({}, modalCurdProps()),
|
|
@@ -1437,12 +1459,17 @@ var ModalCurd = defineComponent({
|
|
|
1437
1459
|
var ProModalCurd = defineComponent({
|
|
1438
1460
|
props: _objectSpread2(_objectSpread2({}, ProCurd.props), ModalCurd.props),
|
|
1439
1461
|
setup: function setup(props, _ref4) {
|
|
1440
|
-
var slots = _ref4.slots
|
|
1462
|
+
var slots = _ref4.slots,
|
|
1463
|
+
expose = _ref4.expose;
|
|
1464
|
+
var curdRef = ref();
|
|
1465
|
+
expose(createExpose(CurdMethods, curdRef));
|
|
1441
1466
|
var invalidKeys = keys(ModalCurd.props);
|
|
1442
1467
|
return function () {
|
|
1443
1468
|
var _slots$default;
|
|
1444
1469
|
|
|
1445
|
-
return createVNode(ProCurd,
|
|
1470
|
+
return createVNode(ProCurd, mergeProps({
|
|
1471
|
+
"ref": curdRef
|
|
1472
|
+
}, omit(props, invalidKeys)), {
|
|
1446
1473
|
"default": function _default() {
|
|
1447
1474
|
return [createVNode(ModalCurd, pick(props, invalidKeys), null), (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)];
|
|
1448
1475
|
}
|
|
@@ -1474,7 +1501,8 @@ var PageCurd = defineComponent({
|
|
|
1474
1501
|
|
|
1475
1502
|
var _useProCurd = useProCurd(),
|
|
1476
1503
|
rowKey = _useProCurd.rowKey,
|
|
1477
|
-
curdState = _useProCurd.curdState
|
|
1504
|
+
curdState = _useProCurd.curdState,
|
|
1505
|
+
refreshList = _useProCurd.refreshList;
|
|
1478
1506
|
|
|
1479
1507
|
var dealList = function dealList(subAction) {
|
|
1480
1508
|
if (subAction === CurdSubAction.PAGE) {
|
|
@@ -1560,6 +1588,13 @@ var PageCurd = defineComponent({
|
|
|
1560
1588
|
}
|
|
1561
1589
|
};
|
|
1562
1590
|
|
|
1591
|
+
var dealDelete = function dealDelete(subAction) {
|
|
1592
|
+
if (subAction === CurdSubAction.SUCCESS) {
|
|
1593
|
+
//刷新列表
|
|
1594
|
+
refreshList();
|
|
1595
|
+
}
|
|
1596
|
+
};
|
|
1597
|
+
|
|
1563
1598
|
useModuleEvent(function (_ref3) {
|
|
1564
1599
|
var type = _ref3.type,
|
|
1565
1600
|
payload = _ref3.payload,
|
|
@@ -1599,6 +1634,10 @@ var PageCurd = defineComponent({
|
|
|
1599
1634
|
record: record
|
|
1600
1635
|
});
|
|
1601
1636
|
break;
|
|
1637
|
+
|
|
1638
|
+
case CurdAction.DELETE:
|
|
1639
|
+
dealDelete(subAction);
|
|
1640
|
+
break;
|
|
1602
1641
|
}
|
|
1603
1642
|
});
|
|
1604
1643
|
return function () {
|
|
@@ -1609,12 +1648,17 @@ var PageCurd = defineComponent({
|
|
|
1609
1648
|
var ProPageCurd = defineComponent({
|
|
1610
1649
|
props: _objectSpread2(_objectSpread2({}, ProCurd.props), PageCurd.props),
|
|
1611
1650
|
setup: function setup(props, _ref4) {
|
|
1612
|
-
var slots = _ref4.slots
|
|
1651
|
+
var slots = _ref4.slots,
|
|
1652
|
+
expose = _ref4.expose;
|
|
1653
|
+
var curdRef = ref();
|
|
1654
|
+
expose(createExpose(CurdMethods, curdRef));
|
|
1613
1655
|
var invalidKeys = keys(PageCurd.props);
|
|
1614
1656
|
return function () {
|
|
1615
1657
|
var _slots$default;
|
|
1616
1658
|
|
|
1617
|
-
return createVNode(ProCurd,
|
|
1659
|
+
return createVNode(ProCurd, mergeProps({
|
|
1660
|
+
"ref": curdRef
|
|
1661
|
+
}, omit(props, invalidKeys)), {
|
|
1618
1662
|
"default": function _default() {
|
|
1619
1663
|
return [createVNode(PageCurd, pick(props, invalidKeys), null), (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)];
|
|
1620
1664
|
}
|
|
@@ -1720,7 +1764,7 @@ var proCurdAddOrEditProps = function proCurdAddOrEditProps() {
|
|
|
1720
1764
|
};
|
|
1721
1765
|
};
|
|
1722
1766
|
|
|
1723
|
-
var createCurdForm = function createCurdForm(Form, Button, convertFormProps) {
|
|
1767
|
+
var createCurdForm = function createCurdForm(Form, Button, convertFormProps, formMethods) {
|
|
1724
1768
|
return defineComponent({
|
|
1725
1769
|
inheritAttrs: false,
|
|
1726
1770
|
props: _objectSpread2(_objectSpread2({}, Form.props), proCurdAddOrEditProps()),
|
|
@@ -1783,13 +1827,7 @@ var createCurdForm = function createCurdForm(Form, Button, convertFormProps) {
|
|
|
1783
1827
|
(_formRef$value2 = formRef.value) === null || _formRef$value2 === void 0 ? void 0 : _formRef$value2.submit();
|
|
1784
1828
|
};
|
|
1785
1829
|
|
|
1786
|
-
expose(
|
|
1787
|
-
submit: function submit() {
|
|
1788
|
-
var _formRef$value3;
|
|
1789
|
-
|
|
1790
|
-
(_formRef$value3 = formRef.value) === null || _formRef$value3 === void 0 ? void 0 : _formRef$value3.submit();
|
|
1791
|
-
}
|
|
1792
|
-
});
|
|
1830
|
+
expose(createExpose(formMethods, formRef));
|
|
1793
1831
|
return function () {
|
|
1794
1832
|
var _slots$divide, _slots$operateStart, _slots$operateCenter, _slots$operateEnd, _slots$default;
|
|
1795
1833
|
|
|
@@ -1832,8 +1870,8 @@ var createCurdForm = function createCurdForm(Form, Button, convertFormProps) {
|
|
|
1832
1870
|
|
|
1833
1871
|
var proCurdListProps = function proCurdListProps() {
|
|
1834
1872
|
return {
|
|
1835
|
-
/**
|
|
1836
|
-
* extra 是否放到SearchForm中
|
|
1873
|
+
/**
|
|
1874
|
+
* extra 是否放到SearchForm中
|
|
1837
1875
|
*/
|
|
1838
1876
|
extraInSearch: {
|
|
1839
1877
|
type: Boolean,
|
|
@@ -1936,9 +1974,29 @@ var createCurdList = function createCurdList(SearchForm, Table) {
|
|
|
1936
1974
|
};
|
|
1937
1975
|
|
|
1938
1976
|
return function () {
|
|
1939
|
-
var _props$searchProps, _slots$divide,
|
|
1977
|
+
var _curdState$listData, _props$searchProps, _slots$divide, _slots$divide2, _slots$footerStart, _slots$pagination, _curdState$listData2, _slots$footerEnd;
|
|
1940
1978
|
|
|
1941
1979
|
var tableProps = props.tableProps;
|
|
1980
|
+
|
|
1981
|
+
var rewriteTableProps = _objectSpread2(_objectSpread2({
|
|
1982
|
+
elementMap: elementMap
|
|
1983
|
+
}, omit(tableProps, "slots", "operate")), {}, {
|
|
1984
|
+
operate: mergeWith({
|
|
1985
|
+
items: tableOperateItems
|
|
1986
|
+
}, tableProps === null || tableProps === void 0 ? void 0 : tableProps.operate, function (objValue, srcValue) {
|
|
1987
|
+
if (isArray(objValue) && isArray(srcValue)) {
|
|
1988
|
+
return concat(objValue, convertOperateItems(srcValue));
|
|
1989
|
+
}
|
|
1990
|
+
}),
|
|
1991
|
+
paginationState: {
|
|
1992
|
+
page: pageState.page,
|
|
1993
|
+
pageSize: pageState.pageSize
|
|
1994
|
+
},
|
|
1995
|
+
columns: tableColumns.value,
|
|
1996
|
+
loading: curdState.listLoading,
|
|
1997
|
+
dataSource: (_curdState$listData = curdState.listData) === null || _curdState$listData === void 0 ? void 0 : _curdState$listData.dataSource
|
|
1998
|
+
});
|
|
1999
|
+
|
|
1942
2000
|
var extra = slots.extra ? createVNode("div", {
|
|
1943
2001
|
"class": "pro-curd-list-extra"
|
|
1944
2002
|
}, [slots.extra()]) : null;
|
|
@@ -1951,24 +2009,7 @@ var createCurdList = function createCurdList(SearchForm, Table) {
|
|
|
1951
2009
|
"default": function _default() {
|
|
1952
2010
|
return [props.extraInSearch && extra];
|
|
1953
2011
|
}
|
|
1954
|
-
}, (_props$searchProps = props.searchProps) === null || _props$searchProps === void 0 ? void 0 : _props$searchProps.slots)), (_slots$divide = slots.divide) === null || _slots$divide === void 0 ? void 0 : _slots$divide.call(slots), !props.extraInSearch && extra, slots.table ? slots.table() : createVNode(Table,
|
|
1955
|
-
"elementMap": elementMap
|
|
1956
|
-
}, omit(tableProps, "slots", "operate"), {
|
|
1957
|
-
"operate": mergeWith({
|
|
1958
|
-
items: tableOperateItems
|
|
1959
|
-
}, tableProps === null || tableProps === void 0 ? void 0 : tableProps.operate, function (objValue, srcValue) {
|
|
1960
|
-
if (isArray(objValue) && isArray(srcValue)) {
|
|
1961
|
-
return concat(objValue, convertOperateItems(srcValue));
|
|
1962
|
-
}
|
|
1963
|
-
}),
|
|
1964
|
-
"paginationState": {
|
|
1965
|
-
page: pageState.page,
|
|
1966
|
-
pageSize: pageState.pageSize
|
|
1967
|
-
},
|
|
1968
|
-
"columns": tableColumns.value,
|
|
1969
|
-
"loading": curdState.listLoading,
|
|
1970
|
-
"dataSource": (_curdState$listData = curdState.listData) === null || _curdState$listData === void 0 ? void 0 : _curdState$listData.dataSource
|
|
1971
|
-
}), tableProps === null || tableProps === void 0 ? void 0 : tableProps.slots), (_slots$divide2 = slots.divide2) === null || _slots$divide2 === void 0 ? void 0 : _slots$divide2.call(slots), createVNode("div", {
|
|
2012
|
+
}, (_props$searchProps = props.searchProps) === null || _props$searchProps === void 0 ? void 0 : _props$searchProps.slots)), (_slots$divide = slots.divide) === null || _slots$divide === void 0 ? void 0 : _slots$divide.call(slots), !props.extraInSearch && extra, slots.table ? slots.table(rewriteTableProps) : createVNode(Table, rewriteTableProps, tableProps === null || tableProps === void 0 ? void 0 : tableProps.slots), (_slots$divide2 = slots.divide2) === null || _slots$divide2 === void 0 ? void 0 : _slots$divide2.call(slots), createVNode("div", {
|
|
1972
2013
|
"class": "pro-curd-list-footer"
|
|
1973
2014
|
}, [(_slots$footerStart = slots.footerStart) === null || _slots$footerStart === void 0 ? void 0 : _slots$footerStart.call(slots), (_slots$pagination = slots.pagination) === null || _slots$pagination === void 0 ? void 0 : _slots$pagination.call(slots, pageState, (_curdState$listData2 = curdState.listData) === null || _curdState$listData2 === void 0 ? void 0 : _curdState$listData2.total, handleSearch), (_slots$footerEnd = slots.footerEnd) === null || _slots$footerEnd === void 0 ? void 0 : _slots$footerEnd.call(slots)])]);
|
|
1974
2015
|
};
|
|
@@ -2182,7 +2223,7 @@ var proFormProps = function proFormProps() {
|
|
|
2182
2223
|
};
|
|
2183
2224
|
};
|
|
2184
2225
|
|
|
2185
|
-
var createForm = function createForm(Form, Grid) {
|
|
2226
|
+
var createForm = function createForm(Form, Grid, formMethods) {
|
|
2186
2227
|
return defineComponent({
|
|
2187
2228
|
inheritAttrs: false,
|
|
2188
2229
|
props: _objectSpread2(_objectSpread2(_objectSpread2({}, Form.props), proFormProps()), omit(Grid.props, "items")),
|
|
@@ -2234,22 +2275,7 @@ var createForm = function createForm(Form, Grid) {
|
|
|
2234
2275
|
};
|
|
2235
2276
|
|
|
2236
2277
|
var formRef = ref();
|
|
2237
|
-
expose(
|
|
2238
|
-
submit: function submit() {
|
|
2239
|
-
var _formRef$value;
|
|
2240
|
-
|
|
2241
|
-
(_formRef$value = formRef.value) === null || _formRef$value === void 0 ? void 0 : _formRef$value.submit();
|
|
2242
|
-
},
|
|
2243
|
-
resetFields: function resetFields() {
|
|
2244
|
-
var _formRef$value2;
|
|
2245
|
-
|
|
2246
|
-
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2247
|
-
params[_key] = arguments[_key];
|
|
2248
|
-
}
|
|
2249
|
-
|
|
2250
|
-
(_formRef$value2 = formRef.value) === null || _formRef$value2 === void 0 ? void 0 : _formRef$value2.resetFields.apply(_formRef$value2, params);
|
|
2251
|
-
}
|
|
2252
|
-
});
|
|
2278
|
+
expose(createExpose(formMethods, formRef));
|
|
2253
2279
|
provideProForm(_objectSpread2({
|
|
2254
2280
|
formState: formState,
|
|
2255
2281
|
showState: showState,
|
|
@@ -2361,11 +2387,12 @@ var proSearchFormProps = function proSearchFormProps() {
|
|
|
2361
2387
|
* 该组件只是个模式,最终返回null,不做任何渲染,应配合着ProForm的包装类一起使用
|
|
2362
2388
|
* 针对传入的model(监听对象)做相应的finish(回调)处理
|
|
2363
2389
|
*/
|
|
2364
|
-
var createSearchForm = function createSearchForm(Form, Props) {
|
|
2390
|
+
var createSearchForm = function createSearchForm(Form, Props, formMethods) {
|
|
2365
2391
|
return defineComponent({
|
|
2366
2392
|
props: _objectSpread2(_objectSpread2(_objectSpread2({}, Form.props), Props), proSearchFormProps()),
|
|
2367
2393
|
setup: function setup(props, _ref) {
|
|
2368
|
-
var slots = _ref.slots
|
|
2394
|
+
var slots = _ref.slots,
|
|
2395
|
+
expose = _ref.expose;
|
|
2369
2396
|
var formState = props.model || reactive({});
|
|
2370
2397
|
var valueTypeSet = new Set(props.debounceTypes); //根据column valueType 算出默认需要debounce处理的属性集合
|
|
2371
2398
|
|
|
@@ -2377,6 +2404,7 @@ var createSearchForm = function createSearchForm(Form, Props) {
|
|
|
2377
2404
|
return getColumnFormItemName(column);
|
|
2378
2405
|
});
|
|
2379
2406
|
var formRef = ref();
|
|
2407
|
+
expose(createExpose(formMethods, formRef));
|
|
2380
2408
|
|
|
2381
2409
|
var handleFinish = function handleFinish() {
|
|
2382
2410
|
var _formRef$value;
|
|
@@ -2533,8 +2561,8 @@ var proTableProps = function proTableProps() {
|
|
|
2533
2561
|
type: String
|
|
2534
2562
|
},
|
|
2535
2563
|
|
|
2536
|
-
/**
|
|
2537
|
-
* 公共column,会merge到columns item中
|
|
2564
|
+
/**
|
|
2565
|
+
* 公共column,会merge到columns item中
|
|
2538
2566
|
*/
|
|
2539
2567
|
column: {
|
|
2540
2568
|
type: Object
|
|
@@ -2547,29 +2575,29 @@ var proTableProps = function proTableProps() {
|
|
|
2547
2575
|
type: Object
|
|
2548
2576
|
},
|
|
2549
2577
|
|
|
2550
|
-
/**
|
|
2551
|
-
* 展示控件集合,readonly模式下使用这些组件渲染
|
|
2578
|
+
/**
|
|
2579
|
+
* 展示控件集合,readonly模式下使用这些组件渲染
|
|
2552
2580
|
*/
|
|
2553
2581
|
elementMap: {
|
|
2554
2582
|
type: Object
|
|
2555
2583
|
},
|
|
2556
2584
|
|
|
2557
|
-
/**
|
|
2558
|
-
* 序号
|
|
2585
|
+
/**
|
|
2586
|
+
* 序号
|
|
2559
2587
|
*/
|
|
2560
2588
|
serialNumber: {
|
|
2561
2589
|
type: Boolean
|
|
2562
2590
|
},
|
|
2563
2591
|
|
|
2564
|
-
/**
|
|
2565
|
-
* 分页
|
|
2592
|
+
/**
|
|
2593
|
+
* 分页
|
|
2566
2594
|
*/
|
|
2567
2595
|
paginationState: {
|
|
2568
2596
|
type: Object
|
|
2569
2597
|
},
|
|
2570
2598
|
|
|
2571
|
-
/**
|
|
2572
|
-
* provide传递
|
|
2599
|
+
/**
|
|
2600
|
+
* provide传递
|
|
2573
2601
|
*/
|
|
2574
2602
|
provideExtra: {
|
|
2575
2603
|
type: Object
|
|
@@ -2577,11 +2605,12 @@ var proTableProps = function proTableProps() {
|
|
|
2577
2605
|
};
|
|
2578
2606
|
};
|
|
2579
2607
|
|
|
2580
|
-
var createTable = function createTable(Table, Props) {
|
|
2608
|
+
var createTable = function createTable(Table, Props, tableMethods) {
|
|
2581
2609
|
return defineComponent({
|
|
2582
2610
|
props: _objectSpread2(_objectSpread2(_objectSpread2({}, Table.props), Props), proTableProps()),
|
|
2583
2611
|
setup: function setup(props, _ref) {
|
|
2584
|
-
var slots = _ref.slots
|
|
2612
|
+
var slots = _ref.slots,
|
|
2613
|
+
expose = _ref.expose;
|
|
2585
2614
|
|
|
2586
2615
|
var createNumberColumn = function createNumberColumn() {
|
|
2587
2616
|
return _objectSpread2(_objectSpread2({
|
|
@@ -2696,6 +2725,7 @@ var createTable = function createTable(Table, Props) {
|
|
|
2696
2725
|
columns: columns,
|
|
2697
2726
|
tableRef: tableRef
|
|
2698
2727
|
}, props.provideExtra));
|
|
2728
|
+
expose(createExpose(tableMethods || [], tableRef));
|
|
2699
2729
|
var invalidKeys = keys(proTableProps());
|
|
2700
2730
|
return function () {
|
|
2701
2731
|
return createVNode(Table, mergeProps({
|
|
@@ -2708,4 +2738,4 @@ var createTable = function createTable(Table, Props) {
|
|
|
2708
2738
|
});
|
|
2709
2739
|
};
|
|
2710
2740
|
|
|
2711
|
-
export { CurdAction, CurdAddAction, CurdCurrentMode, CurdSubAction, ProCurd, ProModalCurd, ProModule, ProPageCurd, RequestAction, SearchMode, Wrapper, convertPathToList, createCurdDesc, createCurdForm, createCurdList, createExpose, createForm, createFormItemCompFn, createFormList, createGrid, createSearchForm, createTable, defaultPage, findTargetInTree, findTargetListInTree, generateId, getColumnFormItemName, getColumnValueType, getFirstPropName, getFormItemEl, getItemEl, getValidValues, mergeStateToList, provideProCurd, provideProFormList, provideProModule, renderElement, renderElements, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProCurd, useProForm, useProFormList, useProModule, useProTable };
|
|
2741
|
+
export { CurdAction, CurdAddAction, CurdCurrentMode, CurdMethods, CurdSubAction, ProCurd, ProModalCurd, ProModule, ProPageCurd, RequestAction, SearchMode, Wrapper, convertPathToList, createCurdDesc, createCurdForm, createCurdList, createExpose, createForm, createFormItemCompFn, createFormList, createGrid, createSearchForm, createTable, defaultPage, findTargetInTree, findTargetListInTree, generateId, getColumnFormItemName, getColumnValueType, getFirstPropName, getFormItemEl, getItemEl, getValidValues, mergeStateToList, provideProCurd, provideProFormList, provideProModule, renderElement, renderElements, useComposeRequestActor, useDoneRequestActor, useFailedRequestActor, useModuleEvent, useProCurd, useProForm, useProFormList, useProModule, useProTable };
|
package/dist/index.js
CHANGED
|
@@ -993,6 +993,7 @@ var proCurdProps = function proCurdProps() {
|
|
|
993
993
|
};
|
|
994
994
|
};
|
|
995
995
|
|
|
996
|
+
var CurdMethods = ["sendCurdEvent", "refreshList", "sendEvent", "sendRequest"];
|
|
996
997
|
var Curd = vue.defineComponent({
|
|
997
998
|
props: _objectSpread2({}, proCurdProps()),
|
|
998
999
|
setup: function setup(props, _ref) {
|
|
@@ -1172,7 +1173,6 @@ var Curd = vue.defineComponent({
|
|
|
1172
1173
|
});
|
|
1173
1174
|
expose({
|
|
1174
1175
|
sendCurdEvent: sendCurdEvent,
|
|
1175
|
-
getOperate: getOperate,
|
|
1176
1176
|
refreshList: handleSearch
|
|
1177
1177
|
});
|
|
1178
1178
|
return function () {
|
|
@@ -1254,8 +1254,30 @@ var ProCurd = vue.defineComponent({
|
|
|
1254
1254
|
});
|
|
1255
1255
|
var moduleKeys = lodash.keys(lodash.omit(ProModule.props, "state", "requests"));
|
|
1256
1256
|
expose({
|
|
1257
|
-
|
|
1258
|
-
|
|
1257
|
+
sendCurdEvent: function sendCurdEvent(event) {
|
|
1258
|
+
var _curdRef$value;
|
|
1259
|
+
|
|
1260
|
+
(_curdRef$value = curdRef.value) === null || _curdRef$value === void 0 ? void 0 : _curdRef$value.sendCurdEvent(event);
|
|
1261
|
+
},
|
|
1262
|
+
refreshList: function refreshList(extra) {
|
|
1263
|
+
var _curdRef$value2;
|
|
1264
|
+
|
|
1265
|
+
(_curdRef$value2 = curdRef.value) === null || _curdRef$value2 === void 0 ? void 0 : _curdRef$value2.refreshList(extra);
|
|
1266
|
+
},
|
|
1267
|
+
sendEvent: function sendEvent(action) {
|
|
1268
|
+
var _moduleRef$value;
|
|
1269
|
+
|
|
1270
|
+
(_moduleRef$value = moduleRef.value) === null || _moduleRef$value === void 0 ? void 0 : _moduleRef$value.sendEvent(action);
|
|
1271
|
+
},
|
|
1272
|
+
sendRequest: function sendRequest(requestNameOrAction) {
|
|
1273
|
+
var _moduleRef$value2;
|
|
1274
|
+
|
|
1275
|
+
for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1276
|
+
params[_key - 1] = arguments[_key];
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
(_moduleRef$value2 = moduleRef.value) === null || _moduleRef$value2 === void 0 ? void 0 : _moduleRef$value2.sendEvent.apply(_moduleRef$value2, [requestNameOrAction].concat(params));
|
|
1280
|
+
}
|
|
1259
1281
|
});
|
|
1260
1282
|
return function () {
|
|
1261
1283
|
return vue.createVNode(ProModule, vue.mergeProps({
|
|
@@ -1284,8 +1306,8 @@ var modalCurdProps = function modalCurdProps() {
|
|
|
1284
1306
|
};
|
|
1285
1307
|
};
|
|
1286
1308
|
|
|
1287
|
-
/**
|
|
1288
|
-
* 事件处理
|
|
1309
|
+
/**
|
|
1310
|
+
* 事件处理
|
|
1289
1311
|
*/
|
|
1290
1312
|
var ModalCurd = vue.defineComponent({
|
|
1291
1313
|
props: _objectSpread2({}, modalCurdProps()),
|
|
@@ -1441,12 +1463,17 @@ var ModalCurd = vue.defineComponent({
|
|
|
1441
1463
|
var ProModalCurd = vue.defineComponent({
|
|
1442
1464
|
props: _objectSpread2(_objectSpread2({}, ProCurd.props), ModalCurd.props),
|
|
1443
1465
|
setup: function setup(props, _ref4) {
|
|
1444
|
-
var slots = _ref4.slots
|
|
1466
|
+
var slots = _ref4.slots,
|
|
1467
|
+
expose = _ref4.expose;
|
|
1468
|
+
var curdRef = vue.ref();
|
|
1469
|
+
expose(createExpose(CurdMethods, curdRef));
|
|
1445
1470
|
var invalidKeys = lodash.keys(ModalCurd.props);
|
|
1446
1471
|
return function () {
|
|
1447
1472
|
var _slots$default;
|
|
1448
1473
|
|
|
1449
|
-
return vue.createVNode(ProCurd,
|
|
1474
|
+
return vue.createVNode(ProCurd, vue.mergeProps({
|
|
1475
|
+
"ref": curdRef
|
|
1476
|
+
}, lodash.omit(props, invalidKeys)), {
|
|
1450
1477
|
"default": function _default() {
|
|
1451
1478
|
return [vue.createVNode(ModalCurd, lodash.pick(props, invalidKeys), null), (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)];
|
|
1452
1479
|
}
|
|
@@ -1478,7 +1505,8 @@ var PageCurd = vue.defineComponent({
|
|
|
1478
1505
|
|
|
1479
1506
|
var _useProCurd = useProCurd(),
|
|
1480
1507
|
rowKey = _useProCurd.rowKey,
|
|
1481
|
-
curdState = _useProCurd.curdState
|
|
1508
|
+
curdState = _useProCurd.curdState,
|
|
1509
|
+
refreshList = _useProCurd.refreshList;
|
|
1482
1510
|
|
|
1483
1511
|
var dealList = function dealList(subAction) {
|
|
1484
1512
|
if (subAction === exports.CurdSubAction.PAGE) {
|
|
@@ -1564,6 +1592,13 @@ var PageCurd = vue.defineComponent({
|
|
|
1564
1592
|
}
|
|
1565
1593
|
};
|
|
1566
1594
|
|
|
1595
|
+
var dealDelete = function dealDelete(subAction) {
|
|
1596
|
+
if (subAction === exports.CurdSubAction.SUCCESS) {
|
|
1597
|
+
//刷新列表
|
|
1598
|
+
refreshList();
|
|
1599
|
+
}
|
|
1600
|
+
};
|
|
1601
|
+
|
|
1567
1602
|
useModuleEvent(function (_ref3) {
|
|
1568
1603
|
var type = _ref3.type,
|
|
1569
1604
|
payload = _ref3.payload,
|
|
@@ -1603,6 +1638,10 @@ var PageCurd = vue.defineComponent({
|
|
|
1603
1638
|
record: record
|
|
1604
1639
|
});
|
|
1605
1640
|
break;
|
|
1641
|
+
|
|
1642
|
+
case exports.CurdAction.DELETE:
|
|
1643
|
+
dealDelete(subAction);
|
|
1644
|
+
break;
|
|
1606
1645
|
}
|
|
1607
1646
|
});
|
|
1608
1647
|
return function () {
|
|
@@ -1613,12 +1652,17 @@ var PageCurd = vue.defineComponent({
|
|
|
1613
1652
|
var ProPageCurd = vue.defineComponent({
|
|
1614
1653
|
props: _objectSpread2(_objectSpread2({}, ProCurd.props), PageCurd.props),
|
|
1615
1654
|
setup: function setup(props, _ref4) {
|
|
1616
|
-
var slots = _ref4.slots
|
|
1655
|
+
var slots = _ref4.slots,
|
|
1656
|
+
expose = _ref4.expose;
|
|
1657
|
+
var curdRef = vue.ref();
|
|
1658
|
+
expose(createExpose(CurdMethods, curdRef));
|
|
1617
1659
|
var invalidKeys = lodash.keys(PageCurd.props);
|
|
1618
1660
|
return function () {
|
|
1619
1661
|
var _slots$default;
|
|
1620
1662
|
|
|
1621
|
-
return vue.createVNode(ProCurd,
|
|
1663
|
+
return vue.createVNode(ProCurd, vue.mergeProps({
|
|
1664
|
+
"ref": curdRef
|
|
1665
|
+
}, lodash.omit(props, invalidKeys)), {
|
|
1622
1666
|
"default": function _default() {
|
|
1623
1667
|
return [vue.createVNode(PageCurd, lodash.pick(props, invalidKeys), null), (_slots$default = slots["default"]) === null || _slots$default === void 0 ? void 0 : _slots$default.call(slots)];
|
|
1624
1668
|
}
|
|
@@ -1724,7 +1768,7 @@ var proCurdAddOrEditProps = function proCurdAddOrEditProps() {
|
|
|
1724
1768
|
};
|
|
1725
1769
|
};
|
|
1726
1770
|
|
|
1727
|
-
var createCurdForm = function createCurdForm(Form, Button, convertFormProps) {
|
|
1771
|
+
var createCurdForm = function createCurdForm(Form, Button, convertFormProps, formMethods) {
|
|
1728
1772
|
return vue.defineComponent({
|
|
1729
1773
|
inheritAttrs: false,
|
|
1730
1774
|
props: _objectSpread2(_objectSpread2({}, Form.props), proCurdAddOrEditProps()),
|
|
@@ -1787,13 +1831,7 @@ var createCurdForm = function createCurdForm(Form, Button, convertFormProps) {
|
|
|
1787
1831
|
(_formRef$value2 = formRef.value) === null || _formRef$value2 === void 0 ? void 0 : _formRef$value2.submit();
|
|
1788
1832
|
};
|
|
1789
1833
|
|
|
1790
|
-
expose(
|
|
1791
|
-
submit: function submit() {
|
|
1792
|
-
var _formRef$value3;
|
|
1793
|
-
|
|
1794
|
-
(_formRef$value3 = formRef.value) === null || _formRef$value3 === void 0 ? void 0 : _formRef$value3.submit();
|
|
1795
|
-
}
|
|
1796
|
-
});
|
|
1834
|
+
expose(createExpose(formMethods, formRef));
|
|
1797
1835
|
return function () {
|
|
1798
1836
|
var _slots$divide, _slots$operateStart, _slots$operateCenter, _slots$operateEnd, _slots$default;
|
|
1799
1837
|
|
|
@@ -1836,8 +1874,8 @@ var createCurdForm = function createCurdForm(Form, Button, convertFormProps) {
|
|
|
1836
1874
|
|
|
1837
1875
|
var proCurdListProps = function proCurdListProps() {
|
|
1838
1876
|
return {
|
|
1839
|
-
/**
|
|
1840
|
-
* extra 是否放到SearchForm中
|
|
1877
|
+
/**
|
|
1878
|
+
* extra 是否放到SearchForm中
|
|
1841
1879
|
*/
|
|
1842
1880
|
extraInSearch: {
|
|
1843
1881
|
type: Boolean,
|
|
@@ -1940,9 +1978,29 @@ var createCurdList = function createCurdList(SearchForm, Table) {
|
|
|
1940
1978
|
};
|
|
1941
1979
|
|
|
1942
1980
|
return function () {
|
|
1943
|
-
var _props$searchProps, _slots$divide,
|
|
1981
|
+
var _curdState$listData, _props$searchProps, _slots$divide, _slots$divide2, _slots$footerStart, _slots$pagination, _curdState$listData2, _slots$footerEnd;
|
|
1944
1982
|
|
|
1945
1983
|
var tableProps = props.tableProps;
|
|
1984
|
+
|
|
1985
|
+
var rewriteTableProps = _objectSpread2(_objectSpread2({
|
|
1986
|
+
elementMap: elementMap
|
|
1987
|
+
}, lodash.omit(tableProps, "slots", "operate")), {}, {
|
|
1988
|
+
operate: lodash.mergeWith({
|
|
1989
|
+
items: tableOperateItems
|
|
1990
|
+
}, tableProps === null || tableProps === void 0 ? void 0 : tableProps.operate, function (objValue, srcValue) {
|
|
1991
|
+
if (lodash.isArray(objValue) && lodash.isArray(srcValue)) {
|
|
1992
|
+
return lodash.concat(objValue, convertOperateItems(srcValue));
|
|
1993
|
+
}
|
|
1994
|
+
}),
|
|
1995
|
+
paginationState: {
|
|
1996
|
+
page: pageState.page,
|
|
1997
|
+
pageSize: pageState.pageSize
|
|
1998
|
+
},
|
|
1999
|
+
columns: tableColumns.value,
|
|
2000
|
+
loading: curdState.listLoading,
|
|
2001
|
+
dataSource: (_curdState$listData = curdState.listData) === null || _curdState$listData === void 0 ? void 0 : _curdState$listData.dataSource
|
|
2002
|
+
});
|
|
2003
|
+
|
|
1946
2004
|
var extra = slots.extra ? vue.createVNode("div", {
|
|
1947
2005
|
"class": "pro-curd-list-extra"
|
|
1948
2006
|
}, [slots.extra()]) : null;
|
|
@@ -1955,24 +2013,7 @@ var createCurdList = function createCurdList(SearchForm, Table) {
|
|
|
1955
2013
|
"default": function _default() {
|
|
1956
2014
|
return [props.extraInSearch && extra];
|
|
1957
2015
|
}
|
|
1958
|
-
}, (_props$searchProps = props.searchProps) === null || _props$searchProps === void 0 ? void 0 : _props$searchProps.slots)), (_slots$divide = slots.divide) === null || _slots$divide === void 0 ? void 0 : _slots$divide.call(slots), !props.extraInSearch && extra, slots.table ? slots.table() : vue.createVNode(Table, vue.
|
|
1959
|
-
"elementMap": elementMap
|
|
1960
|
-
}, lodash.omit(tableProps, "slots", "operate"), {
|
|
1961
|
-
"operate": lodash.mergeWith({
|
|
1962
|
-
items: tableOperateItems
|
|
1963
|
-
}, tableProps === null || tableProps === void 0 ? void 0 : tableProps.operate, function (objValue, srcValue) {
|
|
1964
|
-
if (lodash.isArray(objValue) && lodash.isArray(srcValue)) {
|
|
1965
|
-
return lodash.concat(objValue, convertOperateItems(srcValue));
|
|
1966
|
-
}
|
|
1967
|
-
}),
|
|
1968
|
-
"paginationState": {
|
|
1969
|
-
page: pageState.page,
|
|
1970
|
-
pageSize: pageState.pageSize
|
|
1971
|
-
},
|
|
1972
|
-
"columns": tableColumns.value,
|
|
1973
|
-
"loading": curdState.listLoading,
|
|
1974
|
-
"dataSource": (_curdState$listData = curdState.listData) === null || _curdState$listData === void 0 ? void 0 : _curdState$listData.dataSource
|
|
1975
|
-
}), tableProps === null || tableProps === void 0 ? void 0 : tableProps.slots), (_slots$divide2 = slots.divide2) === null || _slots$divide2 === void 0 ? void 0 : _slots$divide2.call(slots), vue.createVNode("div", {
|
|
2016
|
+
}, (_props$searchProps = props.searchProps) === null || _props$searchProps === void 0 ? void 0 : _props$searchProps.slots)), (_slots$divide = slots.divide) === null || _slots$divide === void 0 ? void 0 : _slots$divide.call(slots), !props.extraInSearch && extra, slots.table ? slots.table(rewriteTableProps) : vue.createVNode(Table, rewriteTableProps, tableProps === null || tableProps === void 0 ? void 0 : tableProps.slots), (_slots$divide2 = slots.divide2) === null || _slots$divide2 === void 0 ? void 0 : _slots$divide2.call(slots), vue.createVNode("div", {
|
|
1976
2017
|
"class": "pro-curd-list-footer"
|
|
1977
2018
|
}, [(_slots$footerStart = slots.footerStart) === null || _slots$footerStart === void 0 ? void 0 : _slots$footerStart.call(slots), (_slots$pagination = slots.pagination) === null || _slots$pagination === void 0 ? void 0 : _slots$pagination.call(slots, pageState, (_curdState$listData2 = curdState.listData) === null || _curdState$listData2 === void 0 ? void 0 : _curdState$listData2.total, handleSearch), (_slots$footerEnd = slots.footerEnd) === null || _slots$footerEnd === void 0 ? void 0 : _slots$footerEnd.call(slots)])]);
|
|
1978
2019
|
};
|
|
@@ -2186,7 +2227,7 @@ var proFormProps = function proFormProps() {
|
|
|
2186
2227
|
};
|
|
2187
2228
|
};
|
|
2188
2229
|
|
|
2189
|
-
var createForm = function createForm(Form, Grid) {
|
|
2230
|
+
var createForm = function createForm(Form, Grid, formMethods) {
|
|
2190
2231
|
return vue.defineComponent({
|
|
2191
2232
|
inheritAttrs: false,
|
|
2192
2233
|
props: _objectSpread2(_objectSpread2(_objectSpread2({}, Form.props), proFormProps()), lodash.omit(Grid.props, "items")),
|
|
@@ -2238,22 +2279,7 @@ var createForm = function createForm(Form, Grid) {
|
|
|
2238
2279
|
};
|
|
2239
2280
|
|
|
2240
2281
|
var formRef = vue.ref();
|
|
2241
|
-
expose(
|
|
2242
|
-
submit: function submit() {
|
|
2243
|
-
var _formRef$value;
|
|
2244
|
-
|
|
2245
|
-
(_formRef$value = formRef.value) === null || _formRef$value === void 0 ? void 0 : _formRef$value.submit();
|
|
2246
|
-
},
|
|
2247
|
-
resetFields: function resetFields() {
|
|
2248
|
-
var _formRef$value2;
|
|
2249
|
-
|
|
2250
|
-
for (var _len = arguments.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2251
|
-
params[_key] = arguments[_key];
|
|
2252
|
-
}
|
|
2253
|
-
|
|
2254
|
-
(_formRef$value2 = formRef.value) === null || _formRef$value2 === void 0 ? void 0 : _formRef$value2.resetFields.apply(_formRef$value2, params);
|
|
2255
|
-
}
|
|
2256
|
-
});
|
|
2282
|
+
expose(createExpose(formMethods, formRef));
|
|
2257
2283
|
provideProForm(_objectSpread2({
|
|
2258
2284
|
formState: formState,
|
|
2259
2285
|
showState: showState,
|
|
@@ -2365,11 +2391,12 @@ var proSearchFormProps = function proSearchFormProps() {
|
|
|
2365
2391
|
* 该组件只是个模式,最终返回null,不做任何渲染,应配合着ProForm的包装类一起使用
|
|
2366
2392
|
* 针对传入的model(监听对象)做相应的finish(回调)处理
|
|
2367
2393
|
*/
|
|
2368
|
-
var createSearchForm = function createSearchForm(Form, Props) {
|
|
2394
|
+
var createSearchForm = function createSearchForm(Form, Props, formMethods) {
|
|
2369
2395
|
return vue.defineComponent({
|
|
2370
2396
|
props: _objectSpread2(_objectSpread2(_objectSpread2({}, Form.props), Props), proSearchFormProps()),
|
|
2371
2397
|
setup: function setup(props, _ref) {
|
|
2372
|
-
var slots = _ref.slots
|
|
2398
|
+
var slots = _ref.slots,
|
|
2399
|
+
expose = _ref.expose;
|
|
2373
2400
|
var formState = props.model || vue.reactive({});
|
|
2374
2401
|
var valueTypeSet = new Set(props.debounceTypes); //根据column valueType 算出默认需要debounce处理的属性集合
|
|
2375
2402
|
|
|
@@ -2381,6 +2408,7 @@ var createSearchForm = function createSearchForm(Form, Props) {
|
|
|
2381
2408
|
return getColumnFormItemName(column);
|
|
2382
2409
|
});
|
|
2383
2410
|
var formRef = vue.ref();
|
|
2411
|
+
expose(createExpose(formMethods, formRef));
|
|
2384
2412
|
|
|
2385
2413
|
var handleFinish = function handleFinish() {
|
|
2386
2414
|
var _formRef$value;
|
|
@@ -2537,8 +2565,8 @@ var proTableProps = function proTableProps() {
|
|
|
2537
2565
|
type: String
|
|
2538
2566
|
},
|
|
2539
2567
|
|
|
2540
|
-
/**
|
|
2541
|
-
* 公共column,会merge到columns item中
|
|
2568
|
+
/**
|
|
2569
|
+
* 公共column,会merge到columns item中
|
|
2542
2570
|
*/
|
|
2543
2571
|
column: {
|
|
2544
2572
|
type: Object
|
|
@@ -2551,29 +2579,29 @@ var proTableProps = function proTableProps() {
|
|
|
2551
2579
|
type: Object
|
|
2552
2580
|
},
|
|
2553
2581
|
|
|
2554
|
-
/**
|
|
2555
|
-
* 展示控件集合,readonly模式下使用这些组件渲染
|
|
2582
|
+
/**
|
|
2583
|
+
* 展示控件集合,readonly模式下使用这些组件渲染
|
|
2556
2584
|
*/
|
|
2557
2585
|
elementMap: {
|
|
2558
2586
|
type: Object
|
|
2559
2587
|
},
|
|
2560
2588
|
|
|
2561
|
-
/**
|
|
2562
|
-
* 序号
|
|
2589
|
+
/**
|
|
2590
|
+
* 序号
|
|
2563
2591
|
*/
|
|
2564
2592
|
serialNumber: {
|
|
2565
2593
|
type: Boolean
|
|
2566
2594
|
},
|
|
2567
2595
|
|
|
2568
|
-
/**
|
|
2569
|
-
* 分页
|
|
2596
|
+
/**
|
|
2597
|
+
* 分页
|
|
2570
2598
|
*/
|
|
2571
2599
|
paginationState: {
|
|
2572
2600
|
type: Object
|
|
2573
2601
|
},
|
|
2574
2602
|
|
|
2575
|
-
/**
|
|
2576
|
-
* provide传递
|
|
2603
|
+
/**
|
|
2604
|
+
* provide传递
|
|
2577
2605
|
*/
|
|
2578
2606
|
provideExtra: {
|
|
2579
2607
|
type: Object
|
|
@@ -2581,11 +2609,12 @@ var proTableProps = function proTableProps() {
|
|
|
2581
2609
|
};
|
|
2582
2610
|
};
|
|
2583
2611
|
|
|
2584
|
-
var createTable = function createTable(Table, Props) {
|
|
2612
|
+
var createTable = function createTable(Table, Props, tableMethods) {
|
|
2585
2613
|
return vue.defineComponent({
|
|
2586
2614
|
props: _objectSpread2(_objectSpread2(_objectSpread2({}, Table.props), Props), proTableProps()),
|
|
2587
2615
|
setup: function setup(props, _ref) {
|
|
2588
|
-
var slots = _ref.slots
|
|
2616
|
+
var slots = _ref.slots,
|
|
2617
|
+
expose = _ref.expose;
|
|
2589
2618
|
|
|
2590
2619
|
var createNumberColumn = function createNumberColumn() {
|
|
2591
2620
|
return _objectSpread2(_objectSpread2({
|
|
@@ -2700,6 +2729,7 @@ var createTable = function createTable(Table, Props) {
|
|
|
2700
2729
|
columns: columns,
|
|
2701
2730
|
tableRef: tableRef
|
|
2702
2731
|
}, props.provideExtra));
|
|
2732
|
+
expose(createExpose(tableMethods || [], tableRef));
|
|
2703
2733
|
var invalidKeys = lodash.keys(proTableProps());
|
|
2704
2734
|
return function () {
|
|
2705
2735
|
return vue.createVNode(Table, vue.mergeProps({
|
|
@@ -2712,6 +2742,7 @@ var createTable = function createTable(Table, Props) {
|
|
|
2712
2742
|
});
|
|
2713
2743
|
};
|
|
2714
2744
|
|
|
2745
|
+
exports.CurdMethods = CurdMethods;
|
|
2715
2746
|
exports.ProCurd = ProCurd;
|
|
2716
2747
|
exports.ProModalCurd = ProModalCurd;
|
|
2717
2748
|
exports.ProModule = ProModule;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-start/pro",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "zx <zxpstudy@163.com>",
|
|
6
6
|
"homepage": "https://github.com/zxeryu/vue-start#readme",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"vue": ">=3.x",
|
|
33
33
|
"vue-router": ">=4.x"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "817582dc319eea2d525e93234e02185d0844a207"
|
|
36
36
|
}
|