@steedos-widgets/amis-lib 1.2.26 → 1.2.27
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/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +12 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +12 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +12 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -671,6 +671,10 @@
|
|
|
671
671
|
if(_$1.includes(['percent','time','filesize','date','datetime','boolean','number','currency', 'select', 'file', 'image', 'avatar', 'formula', 'summary', 'object', 'grid'], field.type)){
|
|
672
672
|
displayFields.push(`${field.name}`);
|
|
673
673
|
}
|
|
674
|
+
}else {
|
|
675
|
+
objectFieldName = field.name.split('.')[0];
|
|
676
|
+
fieldsName.push(objectFieldName);
|
|
677
|
+
displayFields.push(objectFieldName);
|
|
674
678
|
}
|
|
675
679
|
}
|
|
676
680
|
|
|
@@ -7946,6 +7950,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
7946
7950
|
let valueField = mainObject.key_field || '_id';
|
|
7947
7951
|
const api = await getApi(mainObject, null, fields, {count: options.queryCount, alias: 'rows', limit: top, queryOptions: `filters: {__filters}, top: {__top}, skip: {__skip}, sort: "{__sort}"`});
|
|
7948
7952
|
|
|
7953
|
+
api.url += "&objectName=${objectName}";//设计器上对象表格组件需要切换对象重新请求列表数据
|
|
7949
7954
|
if(options.isRelated){
|
|
7950
7955
|
api.url += "&recordId=${_master.recordId}";
|
|
7951
7956
|
}
|
|
@@ -8275,12 +8280,18 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
8275
8280
|
// }
|
|
8276
8281
|
// })
|
|
8277
8282
|
|
|
8283
|
+
var fieldNames = ___namespace.map(fields, function(n){return n.name});
|
|
8278
8284
|
return `
|
|
8279
8285
|
if(payload.data.data.length === 0){
|
|
8280
8286
|
var isEditor = !!${options && options.isEditor};
|
|
8281
8287
|
if(isEditor){
|
|
8288
|
+
var fieldNames = ${JSON.stringify(fieldNames)};
|
|
8289
|
+
var emptyDoc = {};//这里如果不把每个字段值设置为空的话,表单上会显示上一次表单上的字段值
|
|
8290
|
+
fieldNames.forEach(function(n){
|
|
8291
|
+
emptyDoc[n] = null;
|
|
8292
|
+
});
|
|
8282
8293
|
// 设计器中始终显示表单,有记录则显示第一条记录,没记录时显示为空表单
|
|
8283
|
-
payload.data.data = [
|
|
8294
|
+
payload.data.data = [emptyDoc];
|
|
8284
8295
|
}
|
|
8285
8296
|
else{
|
|
8286
8297
|
return {
|