@steedos-widgets/amis-lib 6.3.13-beta.9 → 6.3.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/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +53 -27
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +53 -27
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +20 -20
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/router.d.ts +0 -22
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1367,7 +1367,7 @@ const getAmisFileReadonlySchema = async (steedosField,ctx = {})=>{
|
|
|
1367
1367
|
type: 'each',
|
|
1368
1368
|
placeholder: "",
|
|
1369
1369
|
className: steedosField.multiple ? `flex flex-col` : '',
|
|
1370
|
-
source: `\${
|
|
1370
|
+
source: `\${${steedosField.name}|asArray}`,
|
|
1371
1371
|
items: {
|
|
1372
1372
|
type: 'static',
|
|
1373
1373
|
labelClassName: "hidden",
|
|
@@ -2347,7 +2347,7 @@ async function getColumnItemOnClick(field, options){
|
|
|
2347
2347
|
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
2348
2348
|
"recordLoaded": false, // 重置数据加载状态
|
|
2349
2349
|
"recordId": `\${${options.idFieldName}}`,//审批微页面依赖了作用域中的recordId
|
|
2350
|
-
"
|
|
2350
|
+
"_lookupObjectName": options.objectName
|
|
2351
2351
|
}
|
|
2352
2352
|
}) : {
|
|
2353
2353
|
"type": "steedos-record-detail",
|
|
@@ -2358,7 +2358,7 @@ async function getColumnItemOnClick(field, options){
|
|
|
2358
2358
|
"data": {
|
|
2359
2359
|
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
2360
2360
|
"recordLoaded": false, // 重置数据加载状态
|
|
2361
|
-
"
|
|
2361
|
+
"_lookupObjectName": options.objectName
|
|
2362
2362
|
}
|
|
2363
2363
|
};
|
|
2364
2364
|
|
|
@@ -2531,7 +2531,7 @@ async function getTableColumns(object, fields, options){
|
|
|
2531
2531
|
body: {
|
|
2532
2532
|
type: "steedos-field",
|
|
2533
2533
|
static: true,
|
|
2534
|
-
|
|
2534
|
+
isLookupInTable: true,
|
|
2535
2535
|
config: {
|
|
2536
2536
|
type: "lookup",
|
|
2537
2537
|
reference_to: field.reference_to,
|
|
@@ -3305,6 +3305,16 @@ async function getTableApi(mainObject, fields, options){
|
|
|
3305
3305
|
return api;
|
|
3306
3306
|
`;
|
|
3307
3307
|
api.adaptor = `
|
|
3308
|
+
|
|
3309
|
+
if(payload.errors && payload.errors.length > 0){
|
|
3310
|
+
return {
|
|
3311
|
+
status: 500,
|
|
3312
|
+
msg: payload.errors[0].message,
|
|
3313
|
+
data: {}
|
|
3314
|
+
}
|
|
3315
|
+
}
|
|
3316
|
+
|
|
3317
|
+
|
|
3308
3318
|
let fields = ${JSON.stringify(_$1.map(fields, 'name'))};
|
|
3309
3319
|
// 这里把行数据中所有为空的字段值配置为空字符串,是因为amis有bug:crud的columns中的列如果type为static-前缀的话,行数据中该字段为空的话会显示为父作用域中同名变量值,见:https://github.com/baidu/amis/issues/9556
|
|
3310
3320
|
(payload.data.rows || []).forEach((itemRow) => {
|
|
@@ -3347,10 +3357,13 @@ async function getTableApi(mainObject, fields, options){
|
|
|
3347
3357
|
// item[key] = value
|
|
3348
3358
|
// PC客户端附件子表列表点击标题预览附件功能依赖了_id,所以这里拼出来
|
|
3349
3359
|
let itemKeyValue = item[key];
|
|
3350
|
-
item[key] = value.map(function(
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3360
|
+
item[key] = value.map(function(curValue, index){
|
|
3361
|
+
let fileId = typeof itemKeyValue == 'string' ? itemKeyValue : itemKeyValue[index];
|
|
3362
|
+
// 克隆一份对象,避免下方value递归污染curValue
|
|
3363
|
+
let result = _.clone(curValue);
|
|
3364
|
+
result._id = fileId;
|
|
3365
|
+
result.value = fileId;
|
|
3366
|
+
return result;
|
|
3354
3367
|
});
|
|
3355
3368
|
}else{
|
|
3356
3369
|
item[key] = _.map(value, (item)=>{
|
|
@@ -4869,8 +4882,8 @@ const parseSingleExpression = function (func, formData, dataPath, global, userSe
|
|
|
4869
4882
|
/*
|
|
4870
4883
|
* @Author: baozhoutao@steedos.com
|
|
4871
4884
|
* @Date: 2022-11-01 15:51:00
|
|
4872
|
-
* @LastEditors:
|
|
4873
|
-
* @LastEditTime:
|
|
4885
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
4886
|
+
* @LastEditTime: 2025-07-22 14:49:16
|
|
4874
4887
|
* @Description:
|
|
4875
4888
|
*/
|
|
4876
4889
|
|
|
@@ -4945,7 +4958,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
4945
4958
|
}
|
|
4946
4959
|
const uiSchema = event.data.uiSchema;
|
|
4947
4960
|
const objectName = event.data.objectName;
|
|
4948
|
-
const
|
|
4961
|
+
const crudId = event.data.crudId || "listview_" + objectName;
|
|
4962
|
+
const listViewRef = event.context.scoped.getComponentById(crudId);
|
|
4949
4963
|
const selectedItems = listViewRef && listViewRef.props.store.toJSON().selectedItems || [];
|
|
4950
4964
|
event.data.selectedIds = _.map(selectedItems, uiSchema.idFieldName || '_id');
|
|
4951
4965
|
`;
|
|
@@ -5067,8 +5081,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5067
5081
|
/*
|
|
5068
5082
|
* @Author: baozhoutao@steedos.com
|
|
5069
5083
|
* @Date: 2022-11-01 15:49:58
|
|
5070
|
-
* @LastEditors:
|
|
5071
|
-
* @LastEditTime:
|
|
5084
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5085
|
+
* @LastEditTime: 2025-07-14 15:52:24
|
|
5072
5086
|
* @Description:
|
|
5073
5087
|
*/
|
|
5074
5088
|
|
|
@@ -5224,12 +5238,12 @@ const getSchema$3 = (uiSchema)=>{
|
|
|
5224
5238
|
{
|
|
5225
5239
|
"actionType": "broadcast",
|
|
5226
5240
|
"args": {
|
|
5227
|
-
"eventName": "@data.changed.${
|
|
5241
|
+
"eventName": "@data.changed.${_lookupObjectName}"
|
|
5228
5242
|
},
|
|
5229
5243
|
"data": {
|
|
5230
|
-
"objectName": "${
|
|
5244
|
+
"objectName": "${_lookupObjectName}"
|
|
5231
5245
|
},
|
|
5232
|
-
"expression": `\${
|
|
5246
|
+
"expression": `\${_lookupObjectName != '${uiSchema.name}' && _lookupObjectName}`
|
|
5233
5247
|
}
|
|
5234
5248
|
]
|
|
5235
5249
|
}
|
|
@@ -5488,8 +5502,8 @@ const getSchema = async (uiSchema, ctx) => {
|
|
|
5488
5502
|
/*
|
|
5489
5503
|
* @Author: baozhoutao@steedos.com
|
|
5490
5504
|
* @Date: 2022-11-01 15:53:07
|
|
5491
|
-
* @LastEditors:
|
|
5492
|
-
* @LastEditTime:
|
|
5505
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5506
|
+
* @LastEditTime: 2025-07-22 14:49:34
|
|
5493
5507
|
* @Description:
|
|
5494
5508
|
*/
|
|
5495
5509
|
|
|
@@ -5519,12 +5533,13 @@ const StandardButtons = {
|
|
|
5519
5533
|
const {
|
|
5520
5534
|
appId,
|
|
5521
5535
|
objectName,
|
|
5522
|
-
uiSchema
|
|
5536
|
+
uiSchema,
|
|
5537
|
+
record
|
|
5523
5538
|
} = this;
|
|
5524
5539
|
const scopeId = this.scopeId || `amis-${appId}-${objectName}-listview`;
|
|
5525
5540
|
const scope = this.scope || SteedosUI?.getRef(scopeId);
|
|
5526
|
-
|
|
5527
|
-
const listViewRef = scope.parent?.getComponentById(
|
|
5541
|
+
const crudId = record?.crudId || `listview_${uiSchema.name}`;
|
|
5542
|
+
const listViewRef = scope.parent?.getComponentById(crudId);
|
|
5528
5543
|
if(_.isEmpty(listViewRef.props.store.toJSON().selectedItems)){
|
|
5529
5544
|
listViewRef.handleAction({}, {
|
|
5530
5545
|
"actionType": "toast",
|
|
@@ -9964,16 +9979,16 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
9964
9979
|
},
|
|
9965
9980
|
"expression": `\${_master.objectName != '${objectSchema.name}' && _master.objectName}`
|
|
9966
9981
|
},
|
|
9967
|
-
//
|
|
9982
|
+
// 列表视图、对象表格、对象表单组件上的lookup字段,点开右侧弹出drawer窗口,修改记录后刷新列表
|
|
9968
9983
|
{
|
|
9969
9984
|
"actionType": "broadcast",
|
|
9970
9985
|
"args": {
|
|
9971
|
-
"eventName": "@data.changed.${
|
|
9986
|
+
"eventName": "@data.changed.${_lookupObjectName}"
|
|
9972
9987
|
},
|
|
9973
9988
|
"data": {
|
|
9974
|
-
"objectName": "${
|
|
9989
|
+
"objectName": "${_lookupObjectName}"
|
|
9975
9990
|
},
|
|
9976
|
-
"expression": `\${
|
|
9991
|
+
"expression": `\${_lookupObjectName != '${objectSchema.name}' && _lookupObjectName}`
|
|
9977
9992
|
},
|
|
9978
9993
|
...submitSuccActions,
|
|
9979
9994
|
// {
|
|
@@ -12497,7 +12512,13 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
12497
12512
|
"__lookupField": {
|
|
12498
12513
|
"name": field.name,
|
|
12499
12514
|
"reference_to": refObjectConfig.name,
|
|
12500
|
-
"reference_to_field": field.reference_to_field
|
|
12515
|
+
"reference_to_field": field.reference_to_field,
|
|
12516
|
+
"filters": field.filters,
|
|
12517
|
+
"filtersFunction": field.filtersFunction,
|
|
12518
|
+
"_filtersFunction": field._filtersFunction,
|
|
12519
|
+
"inFilterForm": ctx.inFilterForm,
|
|
12520
|
+
"listviewFilter": listviewFilter,
|
|
12521
|
+
"listviewFiltersFunction": listviewFiltersFunction
|
|
12501
12522
|
}
|
|
12502
12523
|
});
|
|
12503
12524
|
|
|
@@ -14174,7 +14195,8 @@ async function getFieldSearchable(perField, permissionFields, ctx){
|
|
|
14174
14195
|
_field.removable = false;
|
|
14175
14196
|
_field.value = [null,null];
|
|
14176
14197
|
_field.items = {
|
|
14177
|
-
type: "input-number"
|
|
14198
|
+
type: "input-number",
|
|
14199
|
+
clearValueOnEmpty: true
|
|
14178
14200
|
};
|
|
14179
14201
|
_field.is_wide = true;
|
|
14180
14202
|
fieldNamePrefix = `${fieldNamePrefix}between__`;
|
|
@@ -14222,6 +14244,10 @@ async function getFieldSearchable(perField, permissionFields, ctx){
|
|
|
14222
14244
|
delete _field.amis.hidden;
|
|
14223
14245
|
delete _field.amis.hiddenOn;
|
|
14224
14246
|
delete _field.amis.autoFill;
|
|
14247
|
+
if(_field.type.indexOf("-range") > -1 || _field.type === 'input-array'){
|
|
14248
|
+
// 范围类型不允许变更type,否则会因为某些属性兼容性问题报错页面奔溃,比如input-date-range类型有shortcuts属性,改为input-date后其shortcuts属性有兼容性问题
|
|
14249
|
+
delete _field.amis.type;
|
|
14250
|
+
}
|
|
14225
14251
|
}
|
|
14226
14252
|
|
|
14227
14253
|
const amisField = await convertSFieldToAmisField(_field, false, Object.assign({}, ctx, {fieldNamePrefix: fieldNamePrefix, required: false, showSystemFields: true, inFilterForm: true}));
|