@steedos-widgets/amis-lib 6.10.2-beta.1 → 6.10.2-beta.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/index.esm.js CHANGED
@@ -5054,12 +5054,15 @@ async function getTableApi(mainObject, fields, options){
5054
5054
  let selfData = JSON.parse(JSON.stringify(api.data.$self));
5055
5055
  // 保留一份初始data,以供自定义发送适配器中获取原始数据。
5056
5056
  const data = _.cloneDeep(api.data);
5057
+ let needToStoreListViewProps;
5057
5058
  try{
5058
5059
  // TODO: 不应该直接在这里取localStorage,应该从外面传入
5059
5060
  const listName = api.data.listName;
5061
+ // 只有在列表页面中才需要存储和读取本地存储中的参数,相关子表组件不需要
5062
+ needToStoreListViewProps = !!listName && !api.body.$self._isRelated;
5060
5063
  const listViewPropsStoreKey = location.pathname + "/crud";
5061
5064
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
5062
- if(localListViewProps){
5065
+ if(needToStoreListViewProps && localListViewProps){
5063
5066
  localListViewProps = JSON.parse(localListViewProps);
5064
5067
  selfData = Object.assign({}, localListViewProps, selfData);
5065
5068
  if(!api.data.filter){
@@ -5201,7 +5204,7 @@ async function getTableApi(mainObject, fields, options){
5201
5204
 
5202
5205
  //写入本次存储filters、sort
5203
5206
  const listViewPropsStoreKey = location.pathname + "/crud/query";
5204
- sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify({
5207
+ needToStoreListViewProps && sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify({
5205
5208
  filters: filters,
5206
5209
  sort: sort.trim(),
5207
5210
  pageSize: pageSize,
@@ -5308,9 +5311,12 @@ async function getTableApi(mainObject, fields, options){
5308
5311
  }
5309
5312
 
5310
5313
 
5314
+ let needToStoreListViewProps;
5311
5315
  try{
5312
5316
  // TODO: 不应该直接在这里取localStorage,应该从外面传入
5313
5317
  const listName = api.body.listName;
5318
+ // 只有在列表页面中才需要存储和读取本地存储中的参数,相关子表组件不需要
5319
+ needToStoreListViewProps = !!listName && !api.body.$self._isRelated;
5314
5320
  const listViewPropsStoreKey = location.pathname + "/crud";
5315
5321
  /**
5316
5322
  * localListViewProps规范来自crud请求api中api.data.$self参数值的。
@@ -5322,7 +5328,7 @@ async function getTableApi(mainObject, fields, options){
5322
5328
  * orderBy:排序字段
5323
5329
  * orderDir:排序方向
5324
5330
  */
5325
- let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
5331
+ let localListViewProps = needToStoreListViewProps && sessionStorage.getItem(listViewPropsStoreKey);
5326
5332
  let selfData = JSON.parse(JSON.stringify(api.body.$self));
5327
5333
  if(localListViewProps){
5328
5334
  localListViewProps = JSON.parse(localListViewProps);
@@ -5340,7 +5346,7 @@ async function getTableApi(mainObject, fields, options){
5340
5346
 
5341
5347
  delete selfData.context;
5342
5348
  delete selfData.global;
5343
- sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify(selfData));
5349
+ needToStoreListViewProps && sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify(selfData));
5344
5350
  // 返回页码到UI界面
5345
5351
  payload.data.page= selfData.page;
5346
5352
  }
@@ -6784,7 +6790,7 @@ const parseSingleExpression = function (func, formData, dataPath, global, userSe
6784
6790
  * @Author: baozhoutao@steedos.com
6785
6791
  * @Date: 2022-11-01 15:51:00
6786
6792
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
6787
- * @LastEditTime: 2025-07-22 14:29:15
6793
+ * @LastEditTime: 2025-10-14 15:53:35
6788
6794
  * @Description:
6789
6795
  */
6790
6796
 
@@ -6937,7 +6943,7 @@ const getSchema$5 = async (uiSchema, ctx) => {
6937
6943
  }
6938
6944
  ],
6939
6945
  "showCloseButton": true,
6940
- "id": "u:e11347411d2d",
6946
+ "id": "u:standard_new_dialog",
6941
6947
  "closeOnEsc": false,
6942
6948
  "closeOnOutside": false,
6943
6949
  "size": "lg",
@@ -6954,7 +6960,22 @@ const getSchema$5 = async (uiSchema, ctx) => {
6954
6960
  actionType: 'confirm',
6955
6961
  close: false,
6956
6962
  id: "confirmAndNew",
6957
- className: 'form-btn-save_and_new'
6963
+ className: 'form-btn-save_and_new',
6964
+ "onEvent": {
6965
+ "click": {
6966
+ "actions": [
6967
+ {
6968
+ "actionType": "setValue",
6969
+ "componentId": "u:standard_new_dialog",
6970
+ "args": {
6971
+ "value": {
6972
+ "__saveAndNewRecord": true
6973
+ }
6974
+ }
6975
+ }
6976
+ ]
6977
+ }
6978
+ }
6958
6979
  },
6959
6980
  {
6960
6981
  type: 'button',