@yoooloo42/joker 1.0.214 → 1.0.216

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.esm.js CHANGED
@@ -22758,7 +22758,8 @@ const refresh = async _ref => {
22758
22758
  sort: scopeThis.query.sort,
22759
22759
  limit: scopeThis.query.pageSize,
22760
22760
  page: scopeThis.query.currentPage
22761
- }
22761
+ },
22762
+ routerInstance: scopeThis.routerInstance || null
22762
22763
  });
22763
22764
  scopeThis.tableProps.table.loading.visible = false;
22764
22765
  if (result.code === 0) {
@@ -22795,11 +22796,36 @@ const reload = async _ref2 => {
22795
22796
  ElMessage(result.code === 0 ? '数据已重载' : '数据重载错误');
22796
22797
  };
22797
22798
 
22798
- // 获取页面数据附加
22799
- const getPgData = async _ref3 => {
22799
+ // 页记录数改变
22800
+ const pageSizeChange = async _ref3 => {
22800
22801
  let {
22802
+ pageSize,
22801
22803
  scopeThis
22802
22804
  } = _ref3;
22805
+ scopeThis.query.pageSize = pageSize;
22806
+ scopeThis.query.currentPage = 1;
22807
+ await reload({
22808
+ scopeThis
22809
+ });
22810
+ };
22811
+
22812
+ // 当前页码改变
22813
+ const currentPageChange = async _ref4 => {
22814
+ let {
22815
+ currentPage,
22816
+ scopeThis
22817
+ } = _ref4;
22818
+ scopeThis.query.currentPage = currentPage;
22819
+ await reload({
22820
+ scopeThis
22821
+ });
22822
+ };
22823
+
22824
+ // 获取页面数据附加
22825
+ const getPgData = async _ref5 => {
22826
+ let {
22827
+ scopeThis
22828
+ } = _ref5;
22803
22829
  const result = await ly0request.storpro({
22804
22830
  storproName: scopeThis.storpro.getPgData,
22805
22831
  data: scopeThis.pgData && scopeThis.pgData.query ? scopeThis.pgData.query : null
@@ -22815,10 +22841,12 @@ const getPgData = async _ref3 => {
22815
22841
  };
22816
22842
 
22817
22843
  // 初始化
22818
- const init = async _ref4 => {
22844
+ const init = async _ref6 => {
22819
22845
  let {
22820
22846
  scopeThis
22821
- } = _ref4;
22847
+ } = _ref6;
22848
+ scopeThis.tableProps.table.hdlPageSizeChanged = pageSizeChange;
22849
+ scopeThis.tableProps.table.hdlCurrentPageChanged = currentPageChange;
22822
22850
  if (scopeThis.pgData) {
22823
22851
  await getPgData({
22824
22852
  scopeThis
@@ -22830,10 +22858,10 @@ const init = async _ref4 => {
22830
22858
  };
22831
22859
 
22832
22860
  // 弹出 - 查询
22833
- const popupFind = async _ref5 => {
22861
+ const popupFind = async _ref7 => {
22834
22862
  let {
22835
22863
  scopeThis
22836
- } = _ref5;
22864
+ } = _ref7;
22837
22865
  unclassified.deepClone.replaceObject(scopeThis.formData, scopeThis.query.formData);
22838
22866
  scopeThis.tableData.sort = JSON.parse(JSON.stringify(scopeThis.query.sort));
22839
22867
  scopeThis.tableData.pageSize = scopeThis.query.pageSize;
@@ -22846,10 +22874,10 @@ const popupFind = async _ref5 => {
22846
22874
  };
22847
22875
 
22848
22876
  // 弹出 - 新增一条记录
22849
- const popupInsertOne = async _ref6 => {
22877
+ const popupInsertOne = async _ref8 => {
22850
22878
  let {
22851
22879
  scopeThis
22852
- } = _ref6;
22880
+ } = _ref8;
22853
22881
  unclassified.deepClone.replaceObject(scopeThis.formData, scopeThis.insertOne.formData);
22854
22882
  unclassified.deepClone.replaceObject(scopeThis.formProps, scopeThis.insertOne.formProps);
22855
22883
  // 弹出窗口
@@ -22859,11 +22887,11 @@ const popupInsertOne = async _ref6 => {
22859
22887
  };
22860
22888
 
22861
22889
  // 弹出 - 修改一条记录
22862
- const popupUpdateOne = async _ref7 => {
22890
+ const popupUpdateOne = async _ref9 => {
22863
22891
  let {
22864
22892
  scopeThis,
22865
22893
  row
22866
- } = _ref7;
22894
+ } = _ref9;
22867
22895
  unclassified.deepClone.replaceObject(scopeThis.formData, row); // 继承行记录的值
22868
22896
  unclassified.deepClone.replaceObject(scopeThis.formProps, scopeThis.updateOne.formProps);
22869
22897
  // 弹出窗口
@@ -22873,11 +22901,11 @@ const popupUpdateOne = async _ref7 => {
22873
22901
  };
22874
22902
 
22875
22903
  // 弹出 - 详细信息
22876
- const popupDoc = async _ref8 => {
22904
+ const popupDoc = async _ref0 => {
22877
22905
  let {
22878
22906
  scopeThis,
22879
22907
  row
22880
- } = _ref8;
22908
+ } = _ref0;
22881
22909
  unclassified.deepClone.replaceObject(scopeThis.formData, row); // 继承行记录的值
22882
22910
  unclassified.deepClone.replaceObject(scopeThis.formProps, scopeThis.doc.formProps);
22883
22911
  // 弹出窗口
@@ -22887,10 +22915,10 @@ const popupDoc = async _ref8 => {
22887
22915
  };
22888
22916
 
22889
22917
  // 提交 - 查询
22890
- const submitFind = async _ref9 => {
22918
+ const submitFind = async _ref1 => {
22891
22919
  let {
22892
22920
  scopeThis
22893
- } = _ref9;
22921
+ } = _ref1;
22894
22922
  unclassified.deepClone.replaceObject(scopeThis.query.formData, scopeThis.formData);
22895
22923
  scopeThis.query.sort = JSON.parse(JSON.stringify(scopeThis.tableData.sort));
22896
22924
  scopeThis.query.pageSize = scopeThis.tableData.pageSize;
@@ -22908,10 +22936,10 @@ const submitFind = async _ref9 => {
22908
22936
  };
22909
22937
 
22910
22938
  // 提交 - 新增一条记录
22911
- const submitInsertOne = async _ref0 => {
22939
+ const submitInsertOne = async _ref10 => {
22912
22940
  let {
22913
22941
  scopeThis
22914
- } = _ref0;
22942
+ } = _ref10;
22915
22943
  try {
22916
22944
  await ElMessageBox.confirm('新增一条记录, 提交?', '提示', {
22917
22945
  confirmButtonText: '确认',
@@ -22920,7 +22948,8 @@ const submitInsertOne = async _ref0 => {
22920
22948
  });
22921
22949
  const result = await ly0request.storpro({
22922
22950
  storproName: scopeThis.storpro.insertOne,
22923
- data: scopeThis.formData
22951
+ data: scopeThis.formData,
22952
+ routerInstance: scopeThis.routerInstance || null
22924
22953
  });
22925
22954
  if (result.code === 0) {
22926
22955
  // 关闭表单窗口
@@ -22946,10 +22975,10 @@ const submitInsertOne = async _ref0 => {
22946
22975
  };
22947
22976
 
22948
22977
  // 提交 - 修改一条记录
22949
- const submitUpdateOne = async _ref1 => {
22978
+ const submitUpdateOne = async _ref11 => {
22950
22979
  let {
22951
22980
  scopeThis
22952
- } = _ref1;
22981
+ } = _ref11;
22953
22982
  try {
22954
22983
  await ElMessageBox.confirm('修改一条记录, 提交?', '提示', {
22955
22984
  confirmButtonText: '确认',
@@ -22958,7 +22987,8 @@ const submitUpdateOne = async _ref1 => {
22958
22987
  });
22959
22988
  const result = await ly0request.storpro({
22960
22989
  storproName: scopeThis.storpro.updateOne,
22961
- data: scopeThis.formData
22990
+ data: scopeThis.formData,
22991
+ routerInstance: scopeThis.routerInstance || null
22962
22992
  });
22963
22993
  if (result.code === 0) {
22964
22994
  // 关闭表单窗口
@@ -22980,11 +23010,11 @@ const submitUpdateOne = async _ref1 => {
22980
23010
  };
22981
23011
 
22982
23012
  // 提交 - 删除一条记录
22983
- const submitDeleteOne = async _ref10 => {
23013
+ const submitDeleteOne = async _ref12 => {
22984
23014
  let {
22985
23015
  scopeThis,
22986
23016
  row
22987
- } = _ref10;
23017
+ } = _ref12;
22988
23018
  try {
22989
23019
  await ElMessageBox.confirm('删除一条记录, 提交?', '警告', {
22990
23020
  confirmButtonText: '确认',
@@ -22993,7 +23023,9 @@ const submitDeleteOne = async _ref10 => {
22993
23023
  });
22994
23024
  const result = await ly0request.storpro({
22995
23025
  storproName: scopeThis.storpro.deleteOne,
22996
- data: row // 继承行记录的值
23026
+ data: row,
23027
+ // 继承行记录的值
23028
+ routerInstance: scopeThis.routerInstance || null
22997
23029
  });
22998
23030
  if (result.code === 0) {
22999
23031
  ElMessage('删除一条记录成功');
@@ -23014,6 +23046,8 @@ const submitDeleteOne = async _ref10 => {
23014
23046
  var withTable = {
23015
23047
  refresh,
23016
23048
  reload,
23049
+ pageSizeChange,
23050
+ currentPageChange,
23017
23051
  getPgData,
23018
23052
  init,
23019
23053
  popupFind,
@@ -42036,13 +42070,19 @@ const hdl = {
42036
42070
  }
42037
42071
  },
42038
42072
  pageSizeChange(pageSize) {
42039
- // 重新分页
42073
+ // 页记录数改变
42040
42074
  tableData_box.pageSize = pageSize;
42041
42075
  tableData_box.currentPage = 1;
42076
+ if(tableProps_box.table.hdlPageSizeChange){
42077
+ tableProps_box.table.hdlPageSizeChange({pageSize, scopeThis: scopeThis_box});
42078
+ }
42042
42079
  },
42043
42080
  currentPageChange(currentPage) {
42044
- // 修改当前页号
42081
+ // 当前页码改变
42045
42082
  tableData_box.currentPage = currentPage;
42083
+ if(tableProps_box.table.hdlCurrentPageChange){
42084
+ tableProps_box.table.hdlCurrentPageChange({currentPage, scopeThis: scopeThis_box});
42085
+ }
42046
42086
  }
42047
42087
  };
42048
42088