@steedos-widgets/amis-lib 3.6.12 → 3.6.14

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
@@ -1072,7 +1072,7 @@ function getRecordPermissionsQuery(object, recordId, options){
1072
1072
  function getApi$2 (isMobile){
1073
1073
  if(isMobile);else {
1074
1074
  // return __meteor_runtime_config__.ROOT_URL_PATH_PREFIX + "/graphql"
1075
- return `\${context.rootUrl}/graphql?reload=\${additionalFilters}`
1075
+ return `\${context.rootUrl}/graphql?reload=\${additionalFilters|join}`
1076
1076
  }
1077
1077
  }
1078
1078
 
@@ -2171,7 +2171,7 @@ async function getTableColumns(object, fields, options){
2171
2171
  var file_id = data.versions && data.versions[0] && data.versions[0]._id;
2172
2172
  window.previewFile && window.previewFile({file_name, file_id});
2173
2173
  `;
2174
- columnItem = {
2174
+ columnItem = Object.assign({}, {
2175
2175
  "type": "button",
2176
2176
  "label": `<%=data.versions ? data.name : "${field.label}"%>`,
2177
2177
  className,
@@ -2203,7 +2203,7 @@ async function getTableColumns(object, fields, options){
2203
2203
  ]
2204
2204
  }
2205
2205
  }
2206
- };
2206
+ }, fieldAmis);
2207
2207
  }else if(field.type === 'toggle'){
2208
2208
  columnItem = Object.assign({}, {
2209
2209
  type: "switch",
@@ -8283,6 +8283,10 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
8283
8283
  // const scope = event.context.scoped;
8284
8284
  // 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
8285
8285
  // 点击取消按钮后继续在表单项中输入过滤条件且最后没有点击回车按键或点击表单项搜索按钮的话,在快速搜索中点击回车按钮提交搜索会所顶部搜索表单中的字段值清空
8286
+ let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
8287
+ if(!filterForm){
8288
+ return;
8289
+ }
8286
8290
  let isLookup = event.data.isLookup;
8287
8291
  let __lookupField = event.data.__lookupField;
8288
8292
  let __changedFilterFormValuesKey = "__changedFilterFormValues";
@@ -8293,9 +8297,8 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
8293
8297
  }
8294
8298
  __changedFilterFormValuesKey += lookupTag;
8295
8299
  }
8296
- let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
8297
8300
  setTimeout(function(){
8298
- filterForm.setValues(event.data[__changedFilterFormValuesKey]);
8301
+ filterForm && filterForm.setValues(event.data[__changedFilterFormValuesKey]);
8299
8302
  }, 500);
8300
8303
  `;
8301
8304
 
@@ -11836,7 +11839,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
11836
11839
  var optionsFilters = [["${valueFieldKey}", optionsFiltersOp, []]];
11837
11840
  if (defaultValue && !api.data.$term) {
11838
11841
  const defaultValueOptionsQueryData = ${JSON.stringify(defaultValueOptionsQueryData)};
11839
- const defaultValueOptionsQuery = defaultValueOptionsQueryData?.query?.replace(/^{/,"").replace(/}$/,"");
11842
+ const defaultValueOptionsQuery = defaultValueOptionsQueryData && defaultValueOptionsQueryData.query && defaultValueOptionsQueryData.query.replace(/^{/,"").replace(/}$/,"");
11840
11843
  // 字段值单独请求,没值的时候在请求中返回空
11841
11844
  optionsFilters = [["${valueFieldKey}", optionsFiltersOp, defaultValue]];
11842
11845
  if(filters.length > 0){