@steedos-widgets/amis-object 6.3.5 → 6.3.7
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/amis-object.cjs.js +21 -8
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.js +21 -8
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.js +14 -14
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +21 -21
- package/package.json +3 -3
package/dist/amis-object.cjs.js
CHANGED
|
@@ -4371,8 +4371,8 @@ async function getPage({type, pageId = '', appId, objectName = '', recordId = ''
|
|
|
4371
4371
|
/*
|
|
4372
4372
|
* @Author: baozhoutao@steedos.com
|
|
4373
4373
|
* @Date: 2022-10-28 14:15:09
|
|
4374
|
-
* @LastEditors:
|
|
4375
|
-
* @LastEditTime:
|
|
4374
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
4375
|
+
* @LastEditTime: 2024-08-19 16:26:58
|
|
4376
4376
|
* @Description:
|
|
4377
4377
|
*/
|
|
4378
4378
|
|
|
@@ -4395,7 +4395,7 @@ async function getLookupLinkOnClick$1(field, options) {
|
|
|
4395
4395
|
const recordPage = await getPage({ type: 'record', appId: options.appId, objectName: options.objectName, formFactor: options.formFactor });
|
|
4396
4396
|
|
|
4397
4397
|
const drawerRecordDetailSchema = recordPage ? Object.assign({}, recordPage.schema, {
|
|
4398
|
-
"recordId":
|
|
4398
|
+
"recordId": field.type == "file" ? "${value}":`\${${field.name}}`,
|
|
4399
4399
|
"data": {
|
|
4400
4400
|
...recordPage.schema.data,
|
|
4401
4401
|
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
@@ -4405,7 +4405,7 @@ async function getLookupLinkOnClick$1(field, options) {
|
|
|
4405
4405
|
}) : {
|
|
4406
4406
|
"type": "steedos-record-detail",
|
|
4407
4407
|
"objectApiName": options.objectName,
|
|
4408
|
-
"recordId":
|
|
4408
|
+
"recordId": field.type == "file" ? "${value}":`\${${field.name}}`,
|
|
4409
4409
|
"showBackButton": false,
|
|
4410
4410
|
"showButtons": true,
|
|
4411
4411
|
"data": {
|
|
@@ -4501,17 +4501,18 @@ const getAmisFileReadonlySchema = async (steedosField,ctx = {})=>{
|
|
|
4501
4501
|
// <a href='<%= item.url %>' target='_self' class='block'><%= item.name %></a>
|
|
4502
4502
|
// <% });} %>`
|
|
4503
4503
|
"type": "control",
|
|
4504
|
+
"name": "",//control若存在name,内部each组件的source则会获取不到内容
|
|
4504
4505
|
"body": {
|
|
4505
4506
|
type: 'each',
|
|
4506
4507
|
placeholder: "",
|
|
4507
|
-
|
|
4508
|
+
className: steedosField.multiple ? `flex flex-col` : '',
|
|
4508
4509
|
source: `\${_display.${steedosField.name}|asArray}`,
|
|
4509
4510
|
items: {
|
|
4510
4511
|
type: 'static',
|
|
4511
4512
|
labelClassName: "hidden",
|
|
4512
4513
|
label: false,
|
|
4513
4514
|
className: 'm-0',
|
|
4514
|
-
tpl: `<a href="/app/-/cfs_files_filerecord/view/\${
|
|
4515
|
+
tpl: `<a href="/app/-/cfs_files_filerecord/view/\${value}" ${lookupATagClick}>\${name}</a>`,
|
|
4515
4516
|
// tpl: "<%= item.name >",
|
|
4516
4517
|
// onEvent: window.innerWidth < 768 ? null : REFERENCE_VALUE_ITEM_ONCLICK
|
|
4517
4518
|
onEvent: window.innerWidth < 768 ? null : await getLookupLinkOnClick$1(steedosField, {
|
|
@@ -4578,6 +4579,11 @@ const getAmisFileEditSchema = (steedosField)=>{
|
|
|
4578
4579
|
convertData.multiple = true;
|
|
4579
4580
|
convertData.joinValues = false;
|
|
4580
4581
|
convertData.extractValue = true;
|
|
4582
|
+
if(steedosField.type === 'image'){
|
|
4583
|
+
if(Steedos.isCordova() && Steedos.isCordova()){
|
|
4584
|
+
convertData.accept = "";
|
|
4585
|
+
}
|
|
4586
|
+
}
|
|
4581
4587
|
}
|
|
4582
4588
|
return convertData;
|
|
4583
4589
|
};
|
|
@@ -5158,6 +5164,8 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
5158
5164
|
_display["${field.name}"].push({
|
|
5159
5165
|
"name": event.data.result.name,
|
|
5160
5166
|
"url": event.data.result.url,
|
|
5167
|
+
"value": event.data.result.value,
|
|
5168
|
+
"_id": event.data.result.value,
|
|
5161
5169
|
"type": event.data.item.type,
|
|
5162
5170
|
"size": event.data.item.size
|
|
5163
5171
|
});
|
|
@@ -5170,6 +5178,8 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
5170
5178
|
_display["${field.name}"] = {
|
|
5171
5179
|
"name": event.data.result.name,
|
|
5172
5180
|
"url": event.data.result.url,
|
|
5181
|
+
"value": event.data.result.value,
|
|
5182
|
+
"_id": event.data.result.value,
|
|
5173
5183
|
"type": event.data.item.type,
|
|
5174
5184
|
"size": event.data.item.size
|
|
5175
5185
|
};
|
|
@@ -5615,7 +5625,7 @@ async function getTableColumns$1(object, fields, options){
|
|
|
5615
5625
|
static: true,
|
|
5616
5626
|
className,
|
|
5617
5627
|
...await getAmisFileReadonlySchema(field)
|
|
5618
|
-
}, fieldAmis
|
|
5628
|
+
}, fieldAmis);
|
|
5619
5629
|
}
|
|
5620
5630
|
else if(field.type === 'select'){
|
|
5621
5631
|
const map = getSelectMap(field.options);
|
|
@@ -6426,7 +6436,8 @@ async function getTableApi(mainObject, fields, options){
|
|
|
6426
6436
|
// PC客户端附件子表列表点击标题预览附件功能依赖了_id,所以这里拼出来
|
|
6427
6437
|
let itemKeyValue = item[key];
|
|
6428
6438
|
item[key] = value.map(function(item, index){
|
|
6429
|
-
item._id = itemKeyValue[index];
|
|
6439
|
+
item._id = typeof itemKeyValue == 'string' ? itemKeyValue : itemKeyValue[index];
|
|
6440
|
+
item.value = typeof itemKeyValue == 'string' ? itemKeyValue : itemKeyValue[index];
|
|
6430
6441
|
return item;
|
|
6431
6442
|
});
|
|
6432
6443
|
}else{
|
|
@@ -6779,6 +6790,7 @@ function getScriptForRewriteValueForFileFields(fields){
|
|
|
6779
6790
|
if(fileFields[item].multiple){
|
|
6780
6791
|
if(fileFieldDisplayValue instanceof Array){
|
|
6781
6792
|
data[item] = fileFieldDisplayValue.map((item, index)=>{
|
|
6793
|
+
item.value = fileFieldValue[index];
|
|
6782
6794
|
return {
|
|
6783
6795
|
value: fileFieldValue[index],
|
|
6784
6796
|
name: item.name,
|
|
@@ -6788,6 +6800,7 @@ function getScriptForRewriteValueForFileFields(fields){
|
|
|
6788
6800
|
});
|
|
6789
6801
|
}
|
|
6790
6802
|
}else{
|
|
6803
|
+
fileFieldDisplayValue.value = fileFieldValue;
|
|
6791
6804
|
data[item] = [{
|
|
6792
6805
|
value: fileFieldValue,
|
|
6793
6806
|
name: fileFieldDisplayValue.name,
|