@vue-start/pro 0.4.4 → 0.4.6

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.es.js CHANGED
@@ -1119,6 +1119,11 @@ var Curd = defineComponent({
1119
1119
  }
1120
1120
 
1121
1121
  return;
1122
+ } //非 CurdAction 五种操作的其他请求
1123
+
1124
+
1125
+ if (action && type === CurdSubAction.EXECUTE) {
1126
+ sendRequest(action, values);
1122
1127
  }
1123
1128
  });
1124
1129
  var operateMap = reduce(props.operates, function (pair, item) {
@@ -1244,9 +1249,13 @@ var ProCurd = defineComponent({
1244
1249
  }), _curdOperateOpts);
1245
1250
  /****************************** columns分类 *************************************/
1246
1251
 
1247
- var requests = map(props.operates, function (item) {
1252
+ var operates = map(props.operates, function (item) {
1248
1253
  var curdOpts = get(curdOperateOpts, item.action);
1249
1254
  return _objectSpread2(_objectSpread2({}, curdOpts), item);
1255
+ }); //只取配置actor的项
1256
+
1257
+ var requests = filter$1(operates, function (item) {
1258
+ return item.actor;
1250
1259
  });
1251
1260
  var moduleKeys = keys(omit(ProModule.props, "state", "requests"));
1252
1261
  expose({
@@ -1286,7 +1295,7 @@ var ProCurd = defineComponent({
1286
1295
  return [createVNode(Curd, mergeProps({
1287
1296
  "ref": curdRef
1288
1297
  }, omit.apply(void 0, [props].concat(_toConsumableArray(moduleKeys), ["curdState", "operates"])), {
1289
- "operates": requests
1298
+ "operates": operates
1290
1299
  }), slots)];
1291
1300
  }
1292
1301
  });
@@ -1501,7 +1510,8 @@ var PageCurd = defineComponent({
1501
1510
 
1502
1511
  var _useProCurd = useProCurd(),
1503
1512
  rowKey = _useProCurd.rowKey,
1504
- curdState = _useProCurd.curdState;
1513
+ curdState = _useProCurd.curdState,
1514
+ refreshList = _useProCurd.refreshList;
1505
1515
 
1506
1516
  var dealList = function dealList(subAction) {
1507
1517
  if (subAction === CurdSubAction.PAGE) {
@@ -1587,6 +1597,13 @@ var PageCurd = defineComponent({
1587
1597
  }
1588
1598
  };
1589
1599
 
1600
+ var dealDelete = function dealDelete(subAction) {
1601
+ if (subAction === CurdSubAction.SUCCESS) {
1602
+ //刷新列表
1603
+ refreshList();
1604
+ }
1605
+ };
1606
+
1590
1607
  useModuleEvent(function (_ref3) {
1591
1608
  var type = _ref3.type,
1592
1609
  payload = _ref3.payload,
@@ -1626,6 +1643,10 @@ var PageCurd = defineComponent({
1626
1643
  record: record
1627
1644
  });
1628
1645
  break;
1646
+
1647
+ case CurdAction.DELETE:
1648
+ dealDelete(subAction);
1649
+ break;
1629
1650
  }
1630
1651
  });
1631
1652
  return function () {
@@ -1962,7 +1983,7 @@ var createCurdList = function createCurdList(SearchForm, Table) {
1962
1983
  };
1963
1984
 
1964
1985
  return function () {
1965
- var _curdState$listData, _props$searchProps, _slots$divide, _slots$divide2, _slots$footerStart, _slots$pagination, _curdState$listData2, _slots$footerEnd;
1986
+ var _curdState$listData, _slots$start, _props$searchProps, _slots$divide, _slots$divide2, _slots$footerStart, _slots$pagination, _curdState$listData2, _slots$footerEnd, _slots$end;
1966
1987
 
1967
1988
  var tableProps = props.tableProps;
1968
1989
 
@@ -1988,7 +2009,9 @@ var createCurdList = function createCurdList(SearchForm, Table) {
1988
2009
  var extra = slots.extra ? createVNode("div", {
1989
2010
  "class": "pro-curd-list-extra"
1990
2011
  }, [slots.extra()]) : null;
1991
- return createVNode(Fragment, null, [createVNode(SearchForm, mergeProps({
2012
+ return createVNode(Fragment, null, [(_slots$start = slots.start) === null || _slots$start === void 0 ? void 0 : _slots$start.call(slots), slots.search ? slots.search({
2013
+ executeSearchWithResetPage: executeSearchWithResetPage
2014
+ }) : createVNode(SearchForm, mergeProps({
1992
2015
  "formElementMap": formElementMap
1993
2016
  }, omit(props.searchProps, "slots"), {
1994
2017
  "columns": searchColumns.value,
@@ -1999,7 +2022,7 @@ var createCurdList = function createCurdList(SearchForm, Table) {
1999
2022
  }
2000
2023
  }, (_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", {
2001
2024
  "class": "pro-curd-list-footer"
2002
- }, [(_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)])]);
2025
+ }, [(_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)]), (_slots$end = slots.end) === null || _slots$end === void 0 ? void 0 : _slots$end.call(slots)]);
2003
2026
  };
2004
2027
  }
2005
2028
  });
package/dist/index.js CHANGED
@@ -1123,6 +1123,11 @@ var Curd = vue.defineComponent({
1123
1123
  }
1124
1124
 
1125
1125
  return;
1126
+ } //非 CurdAction 五种操作的其他请求
1127
+
1128
+
1129
+ if (action && type === exports.CurdSubAction.EXECUTE) {
1130
+ sendRequest(action, values);
1126
1131
  }
1127
1132
  });
1128
1133
  var operateMap = lodash.reduce(props.operates, function (pair, item) {
@@ -1248,9 +1253,13 @@ var ProCurd = vue.defineComponent({
1248
1253
  }), _curdOperateOpts);
1249
1254
  /****************************** columns分类 *************************************/
1250
1255
 
1251
- var requests = lodash.map(props.operates, function (item) {
1256
+ var operates = lodash.map(props.operates, function (item) {
1252
1257
  var curdOpts = lodash.get(curdOperateOpts, item.action);
1253
1258
  return _objectSpread2(_objectSpread2({}, curdOpts), item);
1259
+ }); //只取配置actor的项
1260
+
1261
+ var requests = lodash.filter(operates, function (item) {
1262
+ return item.actor;
1254
1263
  });
1255
1264
  var moduleKeys = lodash.keys(lodash.omit(ProModule.props, "state", "requests"));
1256
1265
  expose({
@@ -1290,7 +1299,7 @@ var ProCurd = vue.defineComponent({
1290
1299
  return [vue.createVNode(Curd, vue.mergeProps({
1291
1300
  "ref": curdRef
1292
1301
  }, lodash.omit.apply(void 0, [props].concat(_toConsumableArray(moduleKeys), ["curdState", "operates"])), {
1293
- "operates": requests
1302
+ "operates": operates
1294
1303
  }), slots)];
1295
1304
  }
1296
1305
  });
@@ -1505,7 +1514,8 @@ var PageCurd = vue.defineComponent({
1505
1514
 
1506
1515
  var _useProCurd = useProCurd(),
1507
1516
  rowKey = _useProCurd.rowKey,
1508
- curdState = _useProCurd.curdState;
1517
+ curdState = _useProCurd.curdState,
1518
+ refreshList = _useProCurd.refreshList;
1509
1519
 
1510
1520
  var dealList = function dealList(subAction) {
1511
1521
  if (subAction === exports.CurdSubAction.PAGE) {
@@ -1591,6 +1601,13 @@ var PageCurd = vue.defineComponent({
1591
1601
  }
1592
1602
  };
1593
1603
 
1604
+ var dealDelete = function dealDelete(subAction) {
1605
+ if (subAction === exports.CurdSubAction.SUCCESS) {
1606
+ //刷新列表
1607
+ refreshList();
1608
+ }
1609
+ };
1610
+
1594
1611
  useModuleEvent(function (_ref3) {
1595
1612
  var type = _ref3.type,
1596
1613
  payload = _ref3.payload,
@@ -1630,6 +1647,10 @@ var PageCurd = vue.defineComponent({
1630
1647
  record: record
1631
1648
  });
1632
1649
  break;
1650
+
1651
+ case exports.CurdAction.DELETE:
1652
+ dealDelete(subAction);
1653
+ break;
1633
1654
  }
1634
1655
  });
1635
1656
  return function () {
@@ -1966,7 +1987,7 @@ var createCurdList = function createCurdList(SearchForm, Table) {
1966
1987
  };
1967
1988
 
1968
1989
  return function () {
1969
- var _curdState$listData, _props$searchProps, _slots$divide, _slots$divide2, _slots$footerStart, _slots$pagination, _curdState$listData2, _slots$footerEnd;
1990
+ var _curdState$listData, _slots$start, _props$searchProps, _slots$divide, _slots$divide2, _slots$footerStart, _slots$pagination, _curdState$listData2, _slots$footerEnd, _slots$end;
1970
1991
 
1971
1992
  var tableProps = props.tableProps;
1972
1993
 
@@ -1992,7 +2013,9 @@ var createCurdList = function createCurdList(SearchForm, Table) {
1992
2013
  var extra = slots.extra ? vue.createVNode("div", {
1993
2014
  "class": "pro-curd-list-extra"
1994
2015
  }, [slots.extra()]) : null;
1995
- return vue.createVNode(vue.Fragment, null, [vue.createVNode(SearchForm, vue.mergeProps({
2016
+ return vue.createVNode(vue.Fragment, null, [(_slots$start = slots.start) === null || _slots$start === void 0 ? void 0 : _slots$start.call(slots), slots.search ? slots.search({
2017
+ executeSearchWithResetPage: executeSearchWithResetPage
2018
+ }) : vue.createVNode(SearchForm, vue.mergeProps({
1996
2019
  "formElementMap": formElementMap
1997
2020
  }, lodash.omit(props.searchProps, "slots"), {
1998
2021
  "columns": searchColumns.value,
@@ -2003,7 +2026,7 @@ var createCurdList = function createCurdList(SearchForm, Table) {
2003
2026
  }
2004
2027
  }, (_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", {
2005
2028
  "class": "pro-curd-list-footer"
2006
- }, [(_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)])]);
2029
+ }, [(_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)]), (_slots$end = slots.end) === null || _slots$end === void 0 ? void 0 : _slots$end.call(slots)]);
2007
2030
  };
2008
2031
  }
2009
2032
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue-start/pro",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
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": "4cadd260951f249478eabe6e9b21bdbeb802de4c"
35
+ "gitHead": "402c2cfa12b15d009ff6cb6cc46f672178ef21f0"
36
36
  }