@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.esm.js
CHANGED
|
@@ -647,6 +647,10 @@ async function getFieldsTemplate(fields, expand){
|
|
|
647
647
|
if(includes(['percent','time','filesize','date','datetime','boolean','number','currency', 'select', 'file', 'image', 'avatar', 'formula', 'summary', 'object', 'grid'], field.type)){
|
|
648
648
|
displayFields.push(`${field.name}`);
|
|
649
649
|
}
|
|
650
|
+
}else {
|
|
651
|
+
objectFieldName = field.name.split('.')[0];
|
|
652
|
+
fieldsName.push(objectFieldName);
|
|
653
|
+
displayFields.push(objectFieldName);
|
|
650
654
|
}
|
|
651
655
|
}
|
|
652
656
|
|
|
@@ -7922,6 +7926,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
7922
7926
|
let valueField = mainObject.key_field || '_id';
|
|
7923
7927
|
const api = await getApi(mainObject, null, fields, {count: options.queryCount, alias: 'rows', limit: top, queryOptions: `filters: {__filters}, top: {__top}, skip: {__skip}, sort: "{__sort}"`});
|
|
7924
7928
|
|
|
7929
|
+
api.url += "&objectName=${objectName}";//设计器上对象表格组件需要切换对象重新请求列表数据
|
|
7925
7930
|
if(options.isRelated){
|
|
7926
7931
|
api.url += "&recordId=${_master.recordId}";
|
|
7927
7932
|
}
|
|
@@ -8251,12 +8256,18 @@ function getReadonlyFormAdaptor(object, fields, options){
|
|
|
8251
8256
|
// }
|
|
8252
8257
|
// })
|
|
8253
8258
|
|
|
8259
|
+
var fieldNames = _$1.map(fields, function(n){return n.name});
|
|
8254
8260
|
return `
|
|
8255
8261
|
if(payload.data.data.length === 0){
|
|
8256
8262
|
var isEditor = !!${options && options.isEditor};
|
|
8257
8263
|
if(isEditor){
|
|
8264
|
+
var fieldNames = ${JSON.stringify(fieldNames)};
|
|
8265
|
+
var emptyDoc = {};//这里如果不把每个字段值设置为空的话,表单上会显示上一次表单上的字段值
|
|
8266
|
+
fieldNames.forEach(function(n){
|
|
8267
|
+
emptyDoc[n] = null;
|
|
8268
|
+
});
|
|
8258
8269
|
// 设计器中始终显示表单,有记录则显示第一条记录,没记录时显示为空表单
|
|
8259
|
-
payload.data.data = [
|
|
8270
|
+
payload.data.data = [emptyDoc];
|
|
8260
8271
|
}
|
|
8261
8272
|
else{
|
|
8262
8273
|
return {
|