@steedos-widgets/sortable 6.3.0-beta.9 → 6.3.0
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/assets.json +5 -5
- package/dist/sortable.cjs.js +284 -133
- package/dist/sortable.cjs.js.map +1 -1
- package/dist/sortable.esm.js +284 -133
- package/dist/sortable.esm.js.map +1 -1
- package/dist/sortable.umd.js +284 -133
- package/package.json +3 -3
package/dist/sortable.esm.js
CHANGED
|
@@ -54126,9 +54126,9 @@ function getSelectMap(selectOptions){
|
|
|
54126
54126
|
}
|
|
54127
54127
|
|
|
54128
54128
|
function getNameTplUrl(field, ctx){
|
|
54129
|
-
if(ctx.objectName === 'cms_files'){
|
|
54130
|
-
|
|
54131
|
-
}
|
|
54129
|
+
// if(ctx.objectName === 'cms_files'){
|
|
54130
|
+
// return "${(versions[0] && versions[0].url) ? versions[0].url+'?download=true' : context.rootUrl+'/api/files/files/'+versions[0]+'?download=true'}"
|
|
54131
|
+
// }
|
|
54132
54132
|
const href = Router.getObjectDetailPath({
|
|
54133
54133
|
...ctx, formFactor: ctx.formFactor, appId: "${appId}", objectName: ctx.objectName || "${objectName}", recordId: `\${${ctx.idFieldName}}`
|
|
54134
54134
|
});
|
|
@@ -54143,7 +54143,7 @@ function getNameTpl(field, ctx){
|
|
|
54143
54143
|
}
|
|
54144
54144
|
let nameLabel = field.name;
|
|
54145
54145
|
//若字段类型是lookup,则按照相关表tpl的label规则显示;若是其它类型,则显示_display或字段本身的值
|
|
54146
|
-
if (field.type == "lookup") {
|
|
54146
|
+
if (field.type == "lookup" || field.type == "master_detail") {
|
|
54147
54147
|
if(!field.reference_to && (field.optionsFunction || field._optionsFunction || field.options)){
|
|
54148
54148
|
if(!field.isTableField){
|
|
54149
54149
|
nameLabel = `\${${field.name}__label}`;
|
|
@@ -54318,12 +54318,15 @@ async function getFieldTpl (field, options){
|
|
|
54318
54318
|
}
|
|
54319
54319
|
}
|
|
54320
54320
|
|
|
54321
|
-
async function getFieldsTemplate(fields, display){
|
|
54321
|
+
async function getFieldsTemplate(object, fields, display){
|
|
54322
54322
|
let expandFields = [];
|
|
54323
54323
|
if(display != false){
|
|
54324
54324
|
display = true;
|
|
54325
54325
|
}
|
|
54326
54326
|
let fieldsName = ['_id'];
|
|
54327
|
+
if(!object.datasource || object.datasource === 'default' || object.datasource === 'meteor'){
|
|
54328
|
+
fieldsName.push('space');
|
|
54329
|
+
}
|
|
54327
54330
|
let displayFields = [];
|
|
54328
54331
|
let fieldsArr = [];
|
|
54329
54332
|
if(lodash.exports.isArray(fields)){
|
|
@@ -54409,7 +54412,7 @@ async function getFindQuery(object, recordId, fields, options){
|
|
|
54409
54412
|
// return item.replace(/^{/,"").replace(/}$/,"");
|
|
54410
54413
|
// }).join(",")) : "";
|
|
54411
54414
|
|
|
54412
|
-
const fieldsTemplate = `${await getFieldsTemplate(fields, options.expand)}${treeFields}${cfsFields}`;
|
|
54415
|
+
const fieldsTemplate = `${await getFieldsTemplate(object, fields, options.expand)}${treeFields}${cfsFields}`;
|
|
54413
54416
|
|
|
54414
54417
|
return {
|
|
54415
54418
|
orderBy: "${orderBy}",
|
|
@@ -54424,7 +54427,7 @@ async function getFindQuery(object, recordId, fields, options){
|
|
|
54424
54427
|
function getApi$2 (isMobile){
|
|
54425
54428
|
if(isMobile);else {
|
|
54426
54429
|
// return __meteor_runtime_config__.ROOT_URL_PATH_PREFIX + "/graphql"
|
|
54427
|
-
return `\${context.rootUrl}/graphql?reload=\${additionalFilters}`
|
|
54430
|
+
return `\${context.rootUrl}/graphql?reload=\${additionalFilters|join}`
|
|
54428
54431
|
}
|
|
54429
54432
|
}
|
|
54430
54433
|
|
|
@@ -54492,6 +54495,29 @@ function getAmisStaticFieldType(type, readonly, options){
|
|
|
54492
54495
|
}
|
|
54493
54496
|
}
|
|
54494
54497
|
|
|
54498
|
+
/*
|
|
54499
|
+
* @Author: baozhoutao@steedos.com
|
|
54500
|
+
* @Date: 2022-07-13 15:18:03
|
|
54501
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
54502
|
+
* @LastEditTime: 2023-04-11 10:34:26
|
|
54503
|
+
* @Description:
|
|
54504
|
+
*/
|
|
54505
|
+
|
|
54506
|
+
async function getPage({type, pageId = '', appId, objectName = '', recordId = '', formFactor = 'LARGE'}){
|
|
54507
|
+
const api = `/api/pageSchema/${type}?app=${appId}&objectApiName=${objectName}&recordId=${recordId}&pageId=${pageId}&formFactor=${formFactor}`;
|
|
54508
|
+
const page = await fetchAPI(api);
|
|
54509
|
+
if (page && page.schema) {
|
|
54510
|
+
page.schema = JSON.parse(page.schema);
|
|
54511
|
+
if(page.schema.data){
|
|
54512
|
+
delete page.schema.data.recordId;
|
|
54513
|
+
delete page.schema.data.objectName;
|
|
54514
|
+
delete page.schema.data.context;
|
|
54515
|
+
delete page.schema.data.global;
|
|
54516
|
+
}
|
|
54517
|
+
return page;
|
|
54518
|
+
}
|
|
54519
|
+
}
|
|
54520
|
+
|
|
54495
54521
|
/*
|
|
54496
54522
|
* @Author: baozhoutao@steedos.com
|
|
54497
54523
|
* @Date: 2022-10-28 14:15:09
|
|
@@ -54515,9 +54541,74 @@ const getAmisFieldType$1 = (steedosField, readonly)=>{
|
|
|
54515
54541
|
return getAmisStaticFieldType(steedosField.type === 'avatar' ? 'image' : steedosField.type, readonly, {multiple: steedosField.multiple});
|
|
54516
54542
|
};
|
|
54517
54543
|
|
|
54518
|
-
|
|
54544
|
+
async function getLookupLinkOnClick(field, options) {
|
|
54545
|
+
const recordPage = await getPage({ type: 'record', appId: options.appId, objectName: options.objectName, formFactor: options.formFactor });
|
|
54546
|
+
|
|
54547
|
+
const drawerRecordDetailSchema = recordPage ? Object.assign({}, recordPage.schema, {
|
|
54548
|
+
"recordId": "${value}",
|
|
54549
|
+
"data": {
|
|
54550
|
+
...recordPage.schema.data,
|
|
54551
|
+
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
54552
|
+
"recordLoaded": false, // 重置数据加载状态
|
|
54553
|
+
"objectName": options.objectName,
|
|
54554
|
+
}
|
|
54555
|
+
}) : {
|
|
54556
|
+
"type": "steedos-record-detail",
|
|
54557
|
+
"objectApiName": options.objectName,
|
|
54558
|
+
"recordId": "${value}",
|
|
54559
|
+
"showBackButton": false,
|
|
54560
|
+
"showButtons": true,
|
|
54561
|
+
"data": {
|
|
54562
|
+
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
54563
|
+
"recordLoaded": false, // 重置数据加载状态
|
|
54564
|
+
}
|
|
54565
|
+
};
|
|
54566
|
+
return {
|
|
54567
|
+
"click": {
|
|
54568
|
+
"actions": [
|
|
54569
|
+
// {
|
|
54570
|
+
// "type": "custom",
|
|
54571
|
+
// "script": `
|
|
54572
|
+
// let fileRecordId = url.match(${regFileRecordId})[2];
|
|
54573
|
+
// console.log('fileRecordId:',fileRecordId);
|
|
54574
|
+
// event.data.recordId = fileRecordId;
|
|
54575
|
+
// `,
|
|
54576
|
+
// },
|
|
54577
|
+
{
|
|
54578
|
+
"actionType": "drawer",
|
|
54579
|
+
"drawer": {
|
|
54580
|
+
"type": "drawer",
|
|
54581
|
+
"title": " ",
|
|
54582
|
+
"headerClassName": "hidden",
|
|
54583
|
+
"size": "lg",
|
|
54584
|
+
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
54585
|
+
"closeOnEsc": true,
|
|
54586
|
+
"closeOnOutside": true,
|
|
54587
|
+
"resizable": true,
|
|
54588
|
+
"actions": [],
|
|
54589
|
+
"body": [
|
|
54590
|
+
drawerRecordDetailSchema
|
|
54591
|
+
],
|
|
54592
|
+
"className": "steedos-record-detail-drawer app-popover"
|
|
54593
|
+
},
|
|
54594
|
+
"preventDefault": true
|
|
54595
|
+
}
|
|
54596
|
+
]
|
|
54597
|
+
}
|
|
54598
|
+
}
|
|
54599
|
+
}
|
|
54600
|
+
|
|
54601
|
+
const getAmisFileReadonlySchema = async (steedosField,ctx = {})=>{
|
|
54519
54602
|
const type = steedosField.type;
|
|
54603
|
+
const { appId, formFactor } = ctx.amisData || {};
|
|
54520
54604
|
const amisFieldType = getAmisFieldType$1(steedosField, true);
|
|
54605
|
+
|
|
54606
|
+
let lookupATagClick = 'onclick="return false;"';
|
|
54607
|
+
|
|
54608
|
+
if(window.innerWidth < 768){
|
|
54609
|
+
lookupATagClick = "";
|
|
54610
|
+
}
|
|
54611
|
+
|
|
54521
54612
|
if(_.includes(['avatar','image'], type)){
|
|
54522
54613
|
return {
|
|
54523
54614
|
type: amisFieldType,
|
|
@@ -54552,13 +54643,34 @@ const getAmisFileReadonlySchema = (steedosField)=>{
|
|
|
54552
54643
|
}
|
|
54553
54644
|
}
|
|
54554
54645
|
} : {
|
|
54555
|
-
type: amisFieldType,
|
|
54556
|
-
tpl: `
|
|
54557
|
-
|
|
54558
|
-
|
|
54559
|
-
|
|
54560
|
-
|
|
54561
|
-
|
|
54646
|
+
// type: amisFieldType,
|
|
54647
|
+
// tpl: `
|
|
54648
|
+
// <% let fileData = data._display.${steedosField.name}; if (fileData) { %>
|
|
54649
|
+
// <% if(!Array.isArray(fileData)){ fileData = [fileData]} %>
|
|
54650
|
+
// <% fileData.forEach(function(item) { %>
|
|
54651
|
+
// <a href='<%= item.url %>' target='_self' class='block'><%= item.name %></a>
|
|
54652
|
+
// <% });} %>`
|
|
54653
|
+
"type": "control",
|
|
54654
|
+
"body": {
|
|
54655
|
+
type: 'each',
|
|
54656
|
+
placeholder: "",
|
|
54657
|
+
// className: `steedos-field-lookup-each flex flex-wrap gap-2`,
|
|
54658
|
+
source: `\${_display.${steedosField.name}|asArray}`,
|
|
54659
|
+
items: {
|
|
54660
|
+
type: 'static',
|
|
54661
|
+
labelClassName: "hidden",
|
|
54662
|
+
label: false,
|
|
54663
|
+
className: 'm-0',
|
|
54664
|
+
tpl: `<a href="/app/-/cfs_files_filerecord/view/\${value}" ${lookupATagClick}>\${name}</a>`,
|
|
54665
|
+
// tpl: "<%= item.name >",
|
|
54666
|
+
// onEvent: window.innerWidth < 768 ? null : REFERENCE_VALUE_ITEM_ONCLICK
|
|
54667
|
+
onEvent: window.innerWidth < 768 ? null : await getLookupLinkOnClick(steedosField, {
|
|
54668
|
+
appId,
|
|
54669
|
+
objectName: "cfs_files_filerecord",
|
|
54670
|
+
formFactor
|
|
54671
|
+
})
|
|
54672
|
+
}
|
|
54673
|
+
}
|
|
54562
54674
|
}
|
|
54563
54675
|
}
|
|
54564
54676
|
};
|
|
@@ -54620,8 +54732,8 @@ const getAmisFileEditSchema = (steedosField)=>{
|
|
|
54620
54732
|
return convertData;
|
|
54621
54733
|
};
|
|
54622
54734
|
|
|
54623
|
-
const getAmisFileSchema = (steedosField, readonly)=>{
|
|
54624
|
-
return readonly ? getAmisFileReadonlySchema(steedosField) : getAmisFileEditSchema(steedosField);
|
|
54735
|
+
const getAmisFileSchema = async (steedosField, readonly, ctx)=>{
|
|
54736
|
+
return readonly ? await getAmisFileReadonlySchema(steedosField,ctx) : getAmisFileEditSchema(steedosField);
|
|
54625
54737
|
};
|
|
54626
54738
|
|
|
54627
54739
|
var frontend_field_group_generalization$1 = "General";
|
|
@@ -54638,6 +54750,7 @@ var frontend_form_confirm$1 = "Confirm";
|
|
|
54638
54750
|
var frontend_form_delete$1 = "Delete";
|
|
54639
54751
|
var frontend_form_view$1 = "view";
|
|
54640
54752
|
var frontend_form_details$1 = "details";
|
|
54753
|
+
var frontend_form_validation_failed_url$1 = "The URL format is incorrect";
|
|
54641
54754
|
var frontend_delete_confirm_text$1 = "Are you sure you want to delete this item?";
|
|
54642
54755
|
var frontend_delete_many_selected_required$1 = "Please select the item to be deleted";
|
|
54643
54756
|
var frontend_delete_many_confirm_text$1 = "Are you sure you want to delete?";
|
|
@@ -54694,6 +54807,7 @@ var frontend_setup$1 = "Setup";
|
|
|
54694
54807
|
var frontend_notifications$1 = "Notifications";
|
|
54695
54808
|
var frontend_notifications_allread$1 = "Mark all as read";
|
|
54696
54809
|
var frontend_notifications_allread_message$1 = "All marked as read";
|
|
54810
|
+
var frontend_notifications_close_dialog$1 = "Close";
|
|
54697
54811
|
var frontend_profile$1 = "Profile";
|
|
54698
54812
|
var switch_space$1 = "Switch Space";
|
|
54699
54813
|
var frontend_about$1 = "About";
|
|
@@ -54726,6 +54840,7 @@ var en_us = {
|
|
|
54726
54840
|
frontend_form_delete: frontend_form_delete$1,
|
|
54727
54841
|
frontend_form_view: frontend_form_view$1,
|
|
54728
54842
|
frontend_form_details: frontend_form_details$1,
|
|
54843
|
+
frontend_form_validation_failed_url: frontend_form_validation_failed_url$1,
|
|
54729
54844
|
frontend_delete_confirm_text: frontend_delete_confirm_text$1,
|
|
54730
54845
|
frontend_delete_many_selected_required: frontend_delete_many_selected_required$1,
|
|
54731
54846
|
frontend_delete_many_confirm_text: frontend_delete_many_confirm_text$1,
|
|
@@ -54782,6 +54897,7 @@ var en_us = {
|
|
|
54782
54897
|
frontend_notifications: frontend_notifications$1,
|
|
54783
54898
|
frontend_notifications_allread: frontend_notifications_allread$1,
|
|
54784
54899
|
frontend_notifications_allread_message: frontend_notifications_allread_message$1,
|
|
54900
|
+
frontend_notifications_close_dialog: frontend_notifications_close_dialog$1,
|
|
54785
54901
|
frontend_profile: frontend_profile$1,
|
|
54786
54902
|
switch_space: switch_space$1,
|
|
54787
54903
|
frontend_about: frontend_about$1,
|
|
@@ -54815,6 +54931,7 @@ var frontend_form_confirm = "确认";
|
|
|
54815
54931
|
var frontend_form_delete = "删除";
|
|
54816
54932
|
var frontend_form_view = "查看";
|
|
54817
54933
|
var frontend_form_details = "详情";
|
|
54934
|
+
var frontend_form_validation_failed_url = "URL 格式不正确";
|
|
54818
54935
|
var frontend_delete_confirm_text = "确定要删除此项目?";
|
|
54819
54936
|
var frontend_delete_many_selected_required = "请选择要删除的项";
|
|
54820
54937
|
var frontend_delete_many_confirm_text = "确定要删除吗?";
|
|
@@ -54872,6 +54989,7 @@ var frontend_setup = "设置";
|
|
|
54872
54989
|
var frontend_notifications = "通知";
|
|
54873
54990
|
var frontend_notifications_allread = "全部标记为已读";
|
|
54874
54991
|
var frontend_notifications_allread_message = "已全部标记为已读";
|
|
54992
|
+
var frontend_notifications_close_dialog = "关闭";
|
|
54875
54993
|
var frontend_profile = "个人资料";
|
|
54876
54994
|
var switch_space = "切换工作区";
|
|
54877
54995
|
var frontend_about = "关于";
|
|
@@ -54904,6 +55022,7 @@ var zh_cn = {
|
|
|
54904
55022
|
frontend_form_delete: frontend_form_delete,
|
|
54905
55023
|
frontend_form_view: frontend_form_view,
|
|
54906
55024
|
frontend_form_details: frontend_form_details,
|
|
55025
|
+
frontend_form_validation_failed_url: frontend_form_validation_failed_url,
|
|
54907
55026
|
frontend_delete_confirm_text: frontend_delete_confirm_text,
|
|
54908
55027
|
frontend_delete_many_selected_required: frontend_delete_many_selected_required,
|
|
54909
55028
|
frontend_delete_many_confirm_text: frontend_delete_many_confirm_text,
|
|
@@ -54961,6 +55080,7 @@ var zh_cn = {
|
|
|
54961
55080
|
frontend_notifications: frontend_notifications,
|
|
54962
55081
|
frontend_notifications_allread: frontend_notifications_allread,
|
|
54963
55082
|
frontend_notifications_allread_message: frontend_notifications_allread_message,
|
|
55083
|
+
frontend_notifications_close_dialog: frontend_notifications_close_dialog,
|
|
54964
55084
|
frontend_profile: frontend_profile,
|
|
54965
55085
|
switch_space: switch_space,
|
|
54966
55086
|
frontend_about: frontend_about,
|
|
@@ -55133,7 +55253,12 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
55133
55253
|
break;
|
|
55134
55254
|
case "percent":
|
|
55135
55255
|
TempDisplayField = `
|
|
55136
|
-
|
|
55256
|
+
if(event.data.value){
|
|
55257
|
+
_display["${field.name}"] = event.data.value.toFixed(${field.scale}) + '%';
|
|
55258
|
+
} else {
|
|
55259
|
+
_display["${field.name}"] = event.data.value;
|
|
55260
|
+
}
|
|
55261
|
+
|
|
55137
55262
|
`;
|
|
55138
55263
|
quickEditSchema.body[0].onEvent["change"] = quickEditOnEvent(TempDisplayField);
|
|
55139
55264
|
break;
|
|
@@ -55477,6 +55602,60 @@ function getFieldWidth(width){
|
|
|
55477
55602
|
}
|
|
55478
55603
|
}
|
|
55479
55604
|
|
|
55605
|
+
async function getColumnItemOnClick(field, options){
|
|
55606
|
+
const recordPage = await getPage({ type: 'record', appId: options.appId, objectName: options.objectName, formFactor: options.formFactor });
|
|
55607
|
+
const drawerRecordDetailSchema = recordPage ? Object.assign({}, recordPage.schema, {
|
|
55608
|
+
"recordId": `\${${options.idFieldName}}`,
|
|
55609
|
+
"data": {
|
|
55610
|
+
...recordPage.schema.data,
|
|
55611
|
+
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
55612
|
+
"recordLoaded": false, // 重置数据加载状态
|
|
55613
|
+
"recordId": `\${${options.idFieldName}}`//审批微页面依赖了作用域中的recordId
|
|
55614
|
+
}
|
|
55615
|
+
}) : {
|
|
55616
|
+
"type": "steedos-record-detail",
|
|
55617
|
+
"objectApiName": "${objectName}",
|
|
55618
|
+
"recordId": `\${${options.idFieldName}}`,
|
|
55619
|
+
"showBackButton": false,
|
|
55620
|
+
"showButtons": true,
|
|
55621
|
+
"data": {
|
|
55622
|
+
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
55623
|
+
"recordLoaded": false, // 重置数据加载状态
|
|
55624
|
+
}
|
|
55625
|
+
};
|
|
55626
|
+
|
|
55627
|
+
if(!(field.is_name || field.name === options.labelFieldName)){
|
|
55628
|
+
drawerRecordDetailSchema.objectApiName = field.reference_to;
|
|
55629
|
+
drawerRecordDetailSchema.recordId = `\${_display.${field.name}.value}`;
|
|
55630
|
+
}
|
|
55631
|
+
return {
|
|
55632
|
+
"click": {
|
|
55633
|
+
"actions": [
|
|
55634
|
+
{
|
|
55635
|
+
"actionType": "drawer",
|
|
55636
|
+
"drawer": {
|
|
55637
|
+
"type": "drawer",
|
|
55638
|
+
"title": " ",
|
|
55639
|
+
"headerClassName": "hidden",
|
|
55640
|
+
"size": "lg",
|
|
55641
|
+
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
55642
|
+
"closeOnEsc": true,
|
|
55643
|
+
"closeOnOutside": true,
|
|
55644
|
+
"resizable": true,
|
|
55645
|
+
"actions": [],
|
|
55646
|
+
"body": [
|
|
55647
|
+
drawerRecordDetailSchema
|
|
55648
|
+
],
|
|
55649
|
+
"className": "steedos-record-detail-drawer app-popover",
|
|
55650
|
+
"id": "u:fc5f055afa8c"
|
|
55651
|
+
},
|
|
55652
|
+
"preventDefault": true
|
|
55653
|
+
}
|
|
55654
|
+
]
|
|
55655
|
+
}
|
|
55656
|
+
};
|
|
55657
|
+
}
|
|
55658
|
+
|
|
55480
55659
|
async function getTableColumns(object, fields, options){
|
|
55481
55660
|
const columns = [];
|
|
55482
55661
|
if(!options.isLookup && !options.isInputTable){
|
|
@@ -55516,7 +55695,10 @@ async function getTableColumns(object, fields, options){
|
|
|
55516
55695
|
delete fieldAmis?.className;
|
|
55517
55696
|
|
|
55518
55697
|
let columnItem;
|
|
55519
|
-
|
|
55698
|
+
|
|
55699
|
+
// PC客户端点击名称字段直接预览
|
|
55700
|
+
let isNode = !!(window && window.nw && window.nw.require);
|
|
55701
|
+
if((field.is_name || field.name === options.labelFieldName) && options.objectName === 'cms_files' && isNode){
|
|
55520
55702
|
const previewFileScript = `
|
|
55521
55703
|
var data = event.data;
|
|
55522
55704
|
var file_name = data.versions ? data.name : "${field.label}";
|
|
@@ -55531,20 +55713,20 @@ async function getTableColumns(object, fields, options){
|
|
|
55531
55713
|
"onEvent": {
|
|
55532
55714
|
"click": {
|
|
55533
55715
|
"actions": [
|
|
55534
|
-
{
|
|
55535
|
-
|
|
55536
|
-
|
|
55537
|
-
|
|
55538
|
-
|
|
55539
|
-
|
|
55540
|
-
|
|
55541
|
-
|
|
55542
|
-
|
|
55543
|
-
|
|
55544
|
-
|
|
55545
|
-
|
|
55546
|
-
|
|
55547
|
-
},
|
|
55716
|
+
// {
|
|
55717
|
+
// "args": {
|
|
55718
|
+
// "api": {
|
|
55719
|
+
// "url": "${(versions[0] && versions[0].url) ? versions[0].url+'?download=true' : context.rootUrl+'/api/files/files/'+versions[0]+'?download=true'}",
|
|
55720
|
+
// "method": "get",
|
|
55721
|
+
// "headers": {
|
|
55722
|
+
// "Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
55723
|
+
// }
|
|
55724
|
+
// }
|
|
55725
|
+
// },
|
|
55726
|
+
// "actionType": "download",
|
|
55727
|
+
// // "expression": "!!!window?.nw?.require"//浏览器上直接下载
|
|
55728
|
+
// "expression": "!!!(window && window.nw && window.nw.require)"//浏览器上直接下载
|
|
55729
|
+
// },
|
|
55548
55730
|
{
|
|
55549
55731
|
"args": {},
|
|
55550
55732
|
"actionType": "custom",
|
|
@@ -55575,7 +55757,7 @@ async function getTableColumns(object, fields, options){
|
|
|
55575
55757
|
toggled: field.toggled,
|
|
55576
55758
|
static: true,
|
|
55577
55759
|
className,
|
|
55578
|
-
...getAmisFileReadonlySchema(field)
|
|
55760
|
+
...await getAmisFileReadonlySchema(field)
|
|
55579
55761
|
}, fieldAmis, {name: field.name});
|
|
55580
55762
|
}
|
|
55581
55763
|
else if(field.type === 'select'){
|
|
@@ -55642,51 +55824,7 @@ async function getTableColumns(object, fields, options){
|
|
|
55642
55824
|
}
|
|
55643
55825
|
|
|
55644
55826
|
if(window.innerWidth >= 768 && ((field.is_name || field.name === options.labelFieldName) || ((field.type == 'lookup' || field.type == 'master_detail') && lodash.exports.isString(field.reference_to) && field.multiple != true)) && options.isRelated){
|
|
55645
|
-
|
|
55646
|
-
const drawerRecordDetailSchema = {
|
|
55647
|
-
"type": "steedos-record-detail",
|
|
55648
|
-
"objectApiName": "${objectName}",
|
|
55649
|
-
"recordId": `\${${options.idFieldName}}`,
|
|
55650
|
-
"showBackButton": false,
|
|
55651
|
-
"showButtons": true,
|
|
55652
|
-
"data": {
|
|
55653
|
-
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
55654
|
-
"recordLoaded": false, // 重置数据加载状态
|
|
55655
|
-
}
|
|
55656
|
-
};
|
|
55657
|
-
|
|
55658
|
-
|
|
55659
|
-
if(!(field.is_name || field.name === options.labelFieldName)){
|
|
55660
|
-
drawerRecordDetailSchema.objectApiName = field.reference_to;
|
|
55661
|
-
drawerRecordDetailSchema.recordId = `\${_display.${field.name}.value}`;
|
|
55662
|
-
}
|
|
55663
|
-
|
|
55664
|
-
columnItem.onEvent = {
|
|
55665
|
-
"click": {
|
|
55666
|
-
"actions": [
|
|
55667
|
-
{
|
|
55668
|
-
"actionType": "drawer",
|
|
55669
|
-
"drawer": {
|
|
55670
|
-
"type": "drawer",
|
|
55671
|
-
"title": " ",
|
|
55672
|
-
"headerClassName": "hidden",
|
|
55673
|
-
"size": "lg",
|
|
55674
|
-
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
55675
|
-
"closeOnEsc": true,
|
|
55676
|
-
"closeOnOutside": true,
|
|
55677
|
-
"resizable": true,
|
|
55678
|
-
"actions": [],
|
|
55679
|
-
"body": [
|
|
55680
|
-
drawerRecordDetailSchema
|
|
55681
|
-
],
|
|
55682
|
-
"className": "steedos-record-detail-drawer app-popover",
|
|
55683
|
-
"id": "u:fc5f055afa8c"
|
|
55684
|
-
},
|
|
55685
|
-
"preventDefault": true
|
|
55686
|
-
}
|
|
55687
|
-
]
|
|
55688
|
-
}
|
|
55689
|
-
};
|
|
55827
|
+
columnItem.onEvent = await getColumnItemOnClick(field, options);
|
|
55690
55828
|
}
|
|
55691
55829
|
|
|
55692
55830
|
}
|
|
@@ -55899,17 +56037,23 @@ async function getMobileTableColumns(fields, options){
|
|
|
55899
56037
|
onEvent: {
|
|
55900
56038
|
"click": {
|
|
55901
56039
|
"actions": [
|
|
56040
|
+
// {
|
|
56041
|
+
// "args": {
|
|
56042
|
+
// "api": {
|
|
56043
|
+
// "url": url,
|
|
56044
|
+
// "method": "get",
|
|
56045
|
+
// "headers": {
|
|
56046
|
+
// "Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
56047
|
+
// }
|
|
56048
|
+
// }
|
|
56049
|
+
// },
|
|
56050
|
+
// "actionType": "download"
|
|
56051
|
+
// }
|
|
55902
56052
|
{
|
|
56053
|
+
"actionType": "link",
|
|
55903
56054
|
"args": {
|
|
55904
|
-
"
|
|
55905
|
-
|
|
55906
|
-
"method": "get",
|
|
55907
|
-
"headers": {
|
|
55908
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
55909
|
-
}
|
|
55910
|
-
}
|
|
55911
|
-
},
|
|
55912
|
-
"actionType": "download"
|
|
56055
|
+
"link": url
|
|
56056
|
+
}
|
|
55913
56057
|
}
|
|
55914
56058
|
],
|
|
55915
56059
|
"weight": 0
|
|
@@ -56406,16 +56550,6 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
56406
56550
|
data: formSchema
|
|
56407
56551
|
};
|
|
56408
56552
|
`;
|
|
56409
|
-
const onDialogCancelScript = `
|
|
56410
|
-
// 这里加setTimeout是因为amis的Bug,它会先触发cancel事件执行此脚本关闭父窗口然后再关闭子窗口
|
|
56411
|
-
// 正确的顺序应该是先关闭子窗口再关闭父窗口,顺序错了会造成第二次点击新建按钮的时候异常
|
|
56412
|
-
setTimeout(function(){
|
|
56413
|
-
doAction({
|
|
56414
|
-
"actionType": "cancel",
|
|
56415
|
-
"componentId": "object_actions_drawer_${uiSchema.name}"
|
|
56416
|
-
});
|
|
56417
|
-
}, 200);
|
|
56418
|
-
`;
|
|
56419
56553
|
const getSelectedRowsScript = `
|
|
56420
56554
|
const isLookup = event.data.isLookup;
|
|
56421
56555
|
if(isLookup){
|
|
@@ -56505,17 +56639,6 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
56505
56639
|
"closeOnEsc": false,
|
|
56506
56640
|
"closeOnOutside": false,
|
|
56507
56641
|
"size": "lg",
|
|
56508
|
-
"onEvent": {
|
|
56509
|
-
"cancel": {
|
|
56510
|
-
"actions": [
|
|
56511
|
-
{
|
|
56512
|
-
"actionType": "custom",
|
|
56513
|
-
"script": onDialogCancelScript,
|
|
56514
|
-
"expression": "${window:innerWidth < 768}",
|
|
56515
|
-
}
|
|
56516
|
-
]
|
|
56517
|
-
}
|
|
56518
|
-
},
|
|
56519
56642
|
"actions": [
|
|
56520
56643
|
{
|
|
56521
56644
|
type: 'button',
|
|
@@ -57153,21 +57276,11 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
57153
57276
|
};
|
|
57154
57277
|
}
|
|
57155
57278
|
|
|
57156
|
-
|
|
57157
|
-
/**
|
|
57158
|
-
* 列表视图顶部放大镜过滤条件栏amisSchema
|
|
57159
|
-
* @param {*} objectSchema 对象UISchema
|
|
57160
|
-
* @returns amisSchema
|
|
57161
|
-
*/
|
|
57162
|
-
async function getObjectListHeaderFieldsFilterBar(objectSchema, listViewName, ctx) {
|
|
57163
|
-
const fieldsFilterBarSchema = await getObjectFieldsFilterBarSchema(objectSchema, ctx);
|
|
57164
|
-
return fieldsFilterBarSchema;
|
|
57165
|
-
}
|
|
57166
|
-
|
|
57167
57279
|
const getNewListviewButtonSchema = ()=>{
|
|
57168
57280
|
return {
|
|
57169
57281
|
"type": "button",
|
|
57170
57282
|
"label": instance.t('frontend_listview_control_new_label'),
|
|
57283
|
+
"className": "steedos-listview-new-button",
|
|
57171
57284
|
"onEvent": {
|
|
57172
57285
|
"click": {
|
|
57173
57286
|
"weight": 0,
|
|
@@ -57374,6 +57487,17 @@ function fieldsExtend$5(){
|
|
|
57374
57487
|
}
|
|
57375
57488
|
}
|
|
57376
57489
|
|
|
57490
|
+
|
|
57491
|
+
/**
|
|
57492
|
+
* 列表视图顶部放大镜过滤条件栏amisSchema
|
|
57493
|
+
* @param {*} objectSchema 对象UISchema
|
|
57494
|
+
* @returns amisSchema
|
|
57495
|
+
*/
|
|
57496
|
+
async function getObjectListHeaderFieldsFilterBar(objectSchema, listViewName, ctx) {
|
|
57497
|
+
const fieldsFilterBarSchema = await getObjectFieldsFilterBarSchema(objectSchema, ctx);
|
|
57498
|
+
return fieldsFilterBarSchema;
|
|
57499
|
+
}
|
|
57500
|
+
|
|
57377
57501
|
const getCopyListviewButtonSchema = ()=>{
|
|
57378
57502
|
return {
|
|
57379
57503
|
"type": "button",
|
|
@@ -58339,6 +58463,10 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
58339
58463
|
// const scope = event.context.scoped;
|
|
58340
58464
|
// 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
|
|
58341
58465
|
// 点击取消按钮后继续在表单项中输入过滤条件且最后没有点击回车按键或点击表单项搜索按钮的话,在快速搜索中点击回车按钮提交搜索会所顶部搜索表单中的字段值清空
|
|
58466
|
+
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
58467
|
+
if(!filterForm){
|
|
58468
|
+
return;
|
|
58469
|
+
}
|
|
58342
58470
|
let isLookup = event.data.isLookup;
|
|
58343
58471
|
let __lookupField = event.data.__lookupField;
|
|
58344
58472
|
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
@@ -58349,9 +58477,8 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
58349
58477
|
}
|
|
58350
58478
|
__changedFilterFormValuesKey += lookupTag;
|
|
58351
58479
|
}
|
|
58352
|
-
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
58353
58480
|
setTimeout(function(){
|
|
58354
|
-
filterForm.setValues(event.data[__changedFilterFormValuesKey]);
|
|
58481
|
+
filterForm && filterForm.setValues(event.data[__changedFilterFormValuesKey]);
|
|
58355
58482
|
}, 500);
|
|
58356
58483
|
`;
|
|
58357
58484
|
|
|
@@ -59718,7 +59845,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59718
59845
|
}
|
|
59719
59846
|
|
|
59720
59847
|
var fieldFilters = ${JSON.stringify(field.filters)};
|
|
59721
|
-
var currentAmis = amisRequire('amis');
|
|
59848
|
+
var currentAmis = (window.amisRequire && window.amisRequire('amis')) || Amis;
|
|
59722
59849
|
//递归fieldFilters数组,检查每一个元素,判断若是公式,就仅把它解析
|
|
59723
59850
|
function traverseNestedArray(arr) {
|
|
59724
59851
|
for (let i = 0; i < arr.length; i++) {
|
|
@@ -59729,7 +59856,11 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59729
59856
|
// 如果当前元素不是数组,则处理该元素
|
|
59730
59857
|
// 下面正则用于匹配amis公式\${}
|
|
59731
59858
|
if(/\\\$\\\{([^}]*)\\\}/.test(arr[i])) {
|
|
59732
|
-
|
|
59859
|
+
try{
|
|
59860
|
+
arr[i] = currentAmis.evaluate(arr[i], api.context);
|
|
59861
|
+
}catch(ex){
|
|
59862
|
+
console.error("运行lookup过滤公式时出现错误:",ex);
|
|
59863
|
+
}
|
|
59733
59864
|
}
|
|
59734
59865
|
}
|
|
59735
59866
|
}
|
|
@@ -59890,8 +60021,8 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59890
60021
|
const isAllowCreate = refObjectConfig.permissions.allowCreate;
|
|
59891
60022
|
const isCreate = lodash.exports.isBoolean(field.create) ? field.create : true;
|
|
59892
60023
|
// lookup字段配置过滤条件就强制不显示新建按钮
|
|
59893
|
-
let
|
|
59894
|
-
if (isAllowCreate && isCreate && !
|
|
60024
|
+
let hasFilters = !lodash.exports.isEmpty(field.filters) || !!field.filtersFunction || !!field._filtersFunction;
|
|
60025
|
+
if (isAllowCreate && isCreate && !hasFilters) {
|
|
59895
60026
|
const new_button = await getSchema$5(refObjectConfig, { appId: ctx.appId, objectName: refObjectConfig.name, formFactor: ctx.formFactor });
|
|
59896
60027
|
new_button.align = "right";
|
|
59897
60028
|
// 保持快速搜索放在最左侧,新建按钮往里插,而不是push到最后
|
|
@@ -60135,7 +60266,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
60135
60266
|
// }
|
|
60136
60267
|
|
|
60137
60268
|
var fieldFilters = ${JSON.stringify(field.filters)};
|
|
60138
|
-
var currentAmis = amisRequire('amis');
|
|
60269
|
+
var currentAmis = (window.amisRequire && window.amisRequire('amis')) || Amis;
|
|
60139
60270
|
//递归fieldFilters数组,检查每一个元素,判断若是公式,就仅把它解析
|
|
60140
60271
|
function traverseNestedArray(arr) {
|
|
60141
60272
|
for (let i = 0; i < arr.length; i++) {
|
|
@@ -60146,7 +60277,11 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
60146
60277
|
// 如果当前元素不是数组,则处理该元素
|
|
60147
60278
|
// 下面正则用于匹配amis公式\${}
|
|
60148
60279
|
if(/\\\$\\\{([^}]*)\\\}/.test(arr[i])) {
|
|
60149
|
-
|
|
60280
|
+
try{
|
|
60281
|
+
arr[i] = currentAmis.evaluate(arr[i], api.context);
|
|
60282
|
+
}catch(ex){
|
|
60283
|
+
console.error("运行lookup过滤公式时出现错误:",ex);
|
|
60284
|
+
}
|
|
60150
60285
|
}
|
|
60151
60286
|
}
|
|
60152
60287
|
}
|
|
@@ -60554,8 +60689,8 @@ if(typeof window != 'undefined'){
|
|
|
60554
60689
|
/*
|
|
60555
60690
|
* @Author: baozhoutao@steedos.com
|
|
60556
60691
|
* @Date: 2023-01-13 17:27:54
|
|
60557
|
-
* @LastEditors:
|
|
60558
|
-
* @LastEditTime: 2024-
|
|
60692
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
60693
|
+
* @LastEditTime: 2024-06-07 13:39:34
|
|
60559
60694
|
* @Description:
|
|
60560
60695
|
*/
|
|
60561
60696
|
|
|
@@ -60592,6 +60727,7 @@ const getMarkdownFieldSchema = (field, readonly, ctx)=>{
|
|
|
60592
60727
|
"name": field.name,
|
|
60593
60728
|
"labelClassName": "none",
|
|
60594
60729
|
"language": "markdown",
|
|
60730
|
+
"options": field.amis ? field.amis.editorOptions : null
|
|
60595
60731
|
}
|
|
60596
60732
|
]
|
|
60597
60733
|
},
|
|
@@ -61141,6 +61277,21 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
61141
61277
|
type: getAmisStaticFieldType('url', readonly, field),
|
|
61142
61278
|
static: readonly ? true : false
|
|
61143
61279
|
};
|
|
61280
|
+
if(!readonly){
|
|
61281
|
+
// amis input-url控件不支持相对路径,这里支持下
|
|
61282
|
+
// 如果要使用amis原生input-url控件的默认的isUrl验证效果或自定义字段validations效果,配置字段的amis.validations属性即可,配置为null或空字符串则使用amis默认的isUrl效果
|
|
61283
|
+
let fieldAmisValidations = field.amis?.validations;
|
|
61284
|
+
if(typeof fieldAmisValidations === "undefined"){
|
|
61285
|
+
Object.assign(convertData, {
|
|
61286
|
+
"validations": {
|
|
61287
|
+
"matchRegexp": "^((http:\\/\\/|https:\\/\\/|ftp:\\/\\/|sftp:\\/\\/)+([^\\s\\/\\.]+(\\.[^\\s\\/\\.]+)+))*(\\/[^\\s\\.\\/]+)*$"
|
|
61288
|
+
},
|
|
61289
|
+
"validationErrors": {
|
|
61290
|
+
"matchRegexp": instance.t('frontend_form_validation_failed_url')//"URL 格式不正确"
|
|
61291
|
+
}
|
|
61292
|
+
});
|
|
61293
|
+
}
|
|
61294
|
+
}
|
|
61144
61295
|
if(readonly && field.show_as_qr){
|
|
61145
61296
|
convertData = {
|
|
61146
61297
|
type: "control",
|
|
@@ -61206,13 +61357,13 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
61206
61357
|
};
|
|
61207
61358
|
break;
|
|
61208
61359
|
case 'avatar':
|
|
61209
|
-
convertData = getAmisFileSchema(field, readonly);
|
|
61360
|
+
convertData = await getAmisFileSchema(field, readonly, ctx);
|
|
61210
61361
|
break;
|
|
61211
61362
|
case 'image':
|
|
61212
|
-
convertData = getAmisFileSchema(field, readonly);
|
|
61363
|
+
convertData = await getAmisFileSchema(field, readonly, ctx);
|
|
61213
61364
|
break;
|
|
61214
61365
|
case 'file':
|
|
61215
|
-
convertData = getAmisFileSchema(field, readonly);
|
|
61366
|
+
convertData = await getAmisFileSchema(field, readonly, ctx);
|
|
61216
61367
|
break;
|
|
61217
61368
|
case 'formula':
|
|
61218
61369
|
if(readonly){
|