@steedos-widgets/amis-lib 1.2.6-beta.12 → 1.2.6-beta.13
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 +18 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +18 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +18 -6
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/index.d.ts +2 -0
- package/dist/types/lib/objects.d.ts +12 -0
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -5886,6 +5886,12 @@ function getReadonlyFormAdaptor(object, fields){
|
|
|
5886
5886
|
// })
|
|
5887
5887
|
|
|
5888
5888
|
return `
|
|
5889
|
+
if(payload.data.data.length === 0){
|
|
5890
|
+
return {
|
|
5891
|
+
status: 2,
|
|
5892
|
+
msg: "无法找到记录"
|
|
5893
|
+
}
|
|
5894
|
+
}
|
|
5889
5895
|
if(payload.data.data){
|
|
5890
5896
|
var data = payload.data.data[0];
|
|
5891
5897
|
var gridAndObjectFieldsName = ${JSON.stringify(gridAndObjectFieldsName)};
|
|
@@ -6033,7 +6039,7 @@ async function getEditFormInitApi(object, recordId, fields, options){
|
|
|
6033
6039
|
|
|
6034
6040
|
return {
|
|
6035
6041
|
method: "post",
|
|
6036
|
-
url: getApi$2(),
|
|
6042
|
+
url: getApi$2() + '&objectName=${objectName}' ,
|
|
6037
6043
|
// sendOn: "!!this.recordId",
|
|
6038
6044
|
cache: API_CACHE,
|
|
6039
6045
|
requestAdaptor: `
|
|
@@ -6553,7 +6559,8 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
6553
6559
|
"eventName": `@data.changed.${objectSchema.name}`
|
|
6554
6560
|
},
|
|
6555
6561
|
"data": {
|
|
6556
|
-
"objectName": `${objectSchema.name}
|
|
6562
|
+
"objectName": `${objectSchema.name}`,
|
|
6563
|
+
"displayAs": "${displayAs}"
|
|
6557
6564
|
}
|
|
6558
6565
|
},
|
|
6559
6566
|
{
|
|
@@ -6653,7 +6660,8 @@ async function getObjectDetail(objectSchema, recordId, ctx){
|
|
|
6653
6660
|
data: {
|
|
6654
6661
|
objectName: "${event.data.__objectName}",
|
|
6655
6662
|
record: "${event.data.__record}"
|
|
6656
|
-
}
|
|
6663
|
+
},
|
|
6664
|
+
expression: "${event.data.__response.error != true}"
|
|
6657
6665
|
},
|
|
6658
6666
|
{
|
|
6659
6667
|
"actionType": "setValue",
|
|
@@ -6661,7 +6669,8 @@ async function getObjectDetail(objectSchema, recordId, ctx){
|
|
|
6661
6669
|
value: {
|
|
6662
6670
|
"recordLoaded": true,
|
|
6663
6671
|
}
|
|
6664
|
-
}
|
|
6672
|
+
},
|
|
6673
|
+
expression: "${event.data.__response.error != true}"
|
|
6665
6674
|
}
|
|
6666
6675
|
]
|
|
6667
6676
|
}
|
|
@@ -7255,7 +7264,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
7255
7264
|
if(_.isEmpty(filters)){
|
|
7256
7265
|
filters = userFilters;
|
|
7257
7266
|
}else{
|
|
7258
|
-
filters
|
|
7267
|
+
filters = [filters, 'and', userFilters]
|
|
7259
7268
|
}
|
|
7260
7269
|
}
|
|
7261
7270
|
api.data = {
|
|
@@ -8330,7 +8339,7 @@ async function getRelatedListSchema(
|
|
|
8330
8339
|
* @Author: baozhoutao@steedos.com
|
|
8331
8340
|
* @Date: 2022-07-05 15:55:39
|
|
8332
8341
|
* @LastEditors: baozhoutao@steedos.com
|
|
8333
|
-
* @LastEditTime: 2023-04-
|
|
8342
|
+
* @LastEditTime: 2023-04-28 11:11:29
|
|
8334
8343
|
* @Description:
|
|
8335
8344
|
*/
|
|
8336
8345
|
|
|
@@ -8528,6 +8537,9 @@ async function getListSchema(
|
|
|
8528
8537
|
ctx = {}
|
|
8529
8538
|
) {
|
|
8530
8539
|
const uiSchema = await getUISchema(objectName);
|
|
8540
|
+
if(!uiSchema){
|
|
8541
|
+
return {}
|
|
8542
|
+
}
|
|
8531
8543
|
const listView = find(
|
|
8532
8544
|
uiSchema.list_views,
|
|
8533
8545
|
(listView, name) => {
|