@steedos-widgets/sortable 6.3.0-beta.8 → 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.cjs.js
CHANGED
|
@@ -54130,9 +54130,9 @@ function getSelectMap(selectOptions){
|
|
|
54130
54130
|
}
|
|
54131
54131
|
|
|
54132
54132
|
function getNameTplUrl(field, ctx){
|
|
54133
|
-
if(ctx.objectName === 'cms_files'){
|
|
54134
|
-
|
|
54135
|
-
}
|
|
54133
|
+
// if(ctx.objectName === 'cms_files'){
|
|
54134
|
+
// return "${(versions[0] && versions[0].url) ? versions[0].url+'?download=true' : context.rootUrl+'/api/files/files/'+versions[0]+'?download=true'}"
|
|
54135
|
+
// }
|
|
54136
54136
|
const href = Router.getObjectDetailPath({
|
|
54137
54137
|
...ctx, formFactor: ctx.formFactor, appId: "${appId}", objectName: ctx.objectName || "${objectName}", recordId: `\${${ctx.idFieldName}}`
|
|
54138
54138
|
});
|
|
@@ -54147,7 +54147,7 @@ function getNameTpl(field, ctx){
|
|
|
54147
54147
|
}
|
|
54148
54148
|
let nameLabel = field.name;
|
|
54149
54149
|
//若字段类型是lookup,则按照相关表tpl的label规则显示;若是其它类型,则显示_display或字段本身的值
|
|
54150
|
-
if (field.type == "lookup") {
|
|
54150
|
+
if (field.type == "lookup" || field.type == "master_detail") {
|
|
54151
54151
|
if(!field.reference_to && (field.optionsFunction || field._optionsFunction || field.options)){
|
|
54152
54152
|
if(!field.isTableField){
|
|
54153
54153
|
nameLabel = `\${${field.name}__label}`;
|
|
@@ -54322,12 +54322,15 @@ async function getFieldTpl (field, options){
|
|
|
54322
54322
|
}
|
|
54323
54323
|
}
|
|
54324
54324
|
|
|
54325
|
-
async function getFieldsTemplate(fields, display){
|
|
54325
|
+
async function getFieldsTemplate(object, fields, display){
|
|
54326
54326
|
let expandFields = [];
|
|
54327
54327
|
if(display != false){
|
|
54328
54328
|
display = true;
|
|
54329
54329
|
}
|
|
54330
54330
|
let fieldsName = ['_id'];
|
|
54331
|
+
if(!object.datasource || object.datasource === 'default' || object.datasource === 'meteor'){
|
|
54332
|
+
fieldsName.push('space');
|
|
54333
|
+
}
|
|
54331
54334
|
let displayFields = [];
|
|
54332
54335
|
let fieldsArr = [];
|
|
54333
54336
|
if(lodash.exports.isArray(fields)){
|
|
@@ -54413,7 +54416,7 @@ async function getFindQuery(object, recordId, fields, options){
|
|
|
54413
54416
|
// return item.replace(/^{/,"").replace(/}$/,"");
|
|
54414
54417
|
// }).join(",")) : "";
|
|
54415
54418
|
|
|
54416
|
-
const fieldsTemplate = `${await getFieldsTemplate(fields, options.expand)}${treeFields}${cfsFields}`;
|
|
54419
|
+
const fieldsTemplate = `${await getFieldsTemplate(object, fields, options.expand)}${treeFields}${cfsFields}`;
|
|
54417
54420
|
|
|
54418
54421
|
return {
|
|
54419
54422
|
orderBy: "${orderBy}",
|
|
@@ -54428,7 +54431,7 @@ async function getFindQuery(object, recordId, fields, options){
|
|
|
54428
54431
|
function getApi$2 (isMobile){
|
|
54429
54432
|
if(isMobile);else {
|
|
54430
54433
|
// return __meteor_runtime_config__.ROOT_URL_PATH_PREFIX + "/graphql"
|
|
54431
|
-
return `\${context.rootUrl}/graphql?reload=\${additionalFilters}`
|
|
54434
|
+
return `\${context.rootUrl}/graphql?reload=\${additionalFilters|join}`
|
|
54432
54435
|
}
|
|
54433
54436
|
}
|
|
54434
54437
|
|
|
@@ -54496,6 +54499,29 @@ function getAmisStaticFieldType(type, readonly, options){
|
|
|
54496
54499
|
}
|
|
54497
54500
|
}
|
|
54498
54501
|
|
|
54502
|
+
/*
|
|
54503
|
+
* @Author: baozhoutao@steedos.com
|
|
54504
|
+
* @Date: 2022-07-13 15:18:03
|
|
54505
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
54506
|
+
* @LastEditTime: 2023-04-11 10:34:26
|
|
54507
|
+
* @Description:
|
|
54508
|
+
*/
|
|
54509
|
+
|
|
54510
|
+
async function getPage({type, pageId = '', appId, objectName = '', recordId = '', formFactor = 'LARGE'}){
|
|
54511
|
+
const api = `/api/pageSchema/${type}?app=${appId}&objectApiName=${objectName}&recordId=${recordId}&pageId=${pageId}&formFactor=${formFactor}`;
|
|
54512
|
+
const page = await fetchAPI(api);
|
|
54513
|
+
if (page && page.schema) {
|
|
54514
|
+
page.schema = JSON.parse(page.schema);
|
|
54515
|
+
if(page.schema.data){
|
|
54516
|
+
delete page.schema.data.recordId;
|
|
54517
|
+
delete page.schema.data.objectName;
|
|
54518
|
+
delete page.schema.data.context;
|
|
54519
|
+
delete page.schema.data.global;
|
|
54520
|
+
}
|
|
54521
|
+
return page;
|
|
54522
|
+
}
|
|
54523
|
+
}
|
|
54524
|
+
|
|
54499
54525
|
/*
|
|
54500
54526
|
* @Author: baozhoutao@steedos.com
|
|
54501
54527
|
* @Date: 2022-10-28 14:15:09
|
|
@@ -54519,9 +54545,74 @@ const getAmisFieldType$1 = (steedosField, readonly)=>{
|
|
|
54519
54545
|
return getAmisStaticFieldType(steedosField.type === 'avatar' ? 'image' : steedosField.type, readonly, {multiple: steedosField.multiple});
|
|
54520
54546
|
};
|
|
54521
54547
|
|
|
54522
|
-
|
|
54548
|
+
async function getLookupLinkOnClick(field, options) {
|
|
54549
|
+
const recordPage = await getPage({ type: 'record', appId: options.appId, objectName: options.objectName, formFactor: options.formFactor });
|
|
54550
|
+
|
|
54551
|
+
const drawerRecordDetailSchema = recordPage ? Object.assign({}, recordPage.schema, {
|
|
54552
|
+
"recordId": "${value}",
|
|
54553
|
+
"data": {
|
|
54554
|
+
...recordPage.schema.data,
|
|
54555
|
+
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
54556
|
+
"recordLoaded": false, // 重置数据加载状态
|
|
54557
|
+
"objectName": options.objectName,
|
|
54558
|
+
}
|
|
54559
|
+
}) : {
|
|
54560
|
+
"type": "steedos-record-detail",
|
|
54561
|
+
"objectApiName": options.objectName,
|
|
54562
|
+
"recordId": "${value}",
|
|
54563
|
+
"showBackButton": false,
|
|
54564
|
+
"showButtons": true,
|
|
54565
|
+
"data": {
|
|
54566
|
+
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
54567
|
+
"recordLoaded": false, // 重置数据加载状态
|
|
54568
|
+
}
|
|
54569
|
+
};
|
|
54570
|
+
return {
|
|
54571
|
+
"click": {
|
|
54572
|
+
"actions": [
|
|
54573
|
+
// {
|
|
54574
|
+
// "type": "custom",
|
|
54575
|
+
// "script": `
|
|
54576
|
+
// let fileRecordId = url.match(${regFileRecordId})[2];
|
|
54577
|
+
// console.log('fileRecordId:',fileRecordId);
|
|
54578
|
+
// event.data.recordId = fileRecordId;
|
|
54579
|
+
// `,
|
|
54580
|
+
// },
|
|
54581
|
+
{
|
|
54582
|
+
"actionType": "drawer",
|
|
54583
|
+
"drawer": {
|
|
54584
|
+
"type": "drawer",
|
|
54585
|
+
"title": " ",
|
|
54586
|
+
"headerClassName": "hidden",
|
|
54587
|
+
"size": "lg",
|
|
54588
|
+
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
54589
|
+
"closeOnEsc": true,
|
|
54590
|
+
"closeOnOutside": true,
|
|
54591
|
+
"resizable": true,
|
|
54592
|
+
"actions": [],
|
|
54593
|
+
"body": [
|
|
54594
|
+
drawerRecordDetailSchema
|
|
54595
|
+
],
|
|
54596
|
+
"className": "steedos-record-detail-drawer app-popover"
|
|
54597
|
+
},
|
|
54598
|
+
"preventDefault": true
|
|
54599
|
+
}
|
|
54600
|
+
]
|
|
54601
|
+
}
|
|
54602
|
+
}
|
|
54603
|
+
}
|
|
54604
|
+
|
|
54605
|
+
const getAmisFileReadonlySchema = async (steedosField,ctx = {})=>{
|
|
54523
54606
|
const type = steedosField.type;
|
|
54607
|
+
const { appId, formFactor } = ctx.amisData || {};
|
|
54524
54608
|
const amisFieldType = getAmisFieldType$1(steedosField, true);
|
|
54609
|
+
|
|
54610
|
+
let lookupATagClick = 'onclick="return false;"';
|
|
54611
|
+
|
|
54612
|
+
if(window.innerWidth < 768){
|
|
54613
|
+
lookupATagClick = "";
|
|
54614
|
+
}
|
|
54615
|
+
|
|
54525
54616
|
if(_.includes(['avatar','image'], type)){
|
|
54526
54617
|
return {
|
|
54527
54618
|
type: amisFieldType,
|
|
@@ -54556,13 +54647,34 @@ const getAmisFileReadonlySchema = (steedosField)=>{
|
|
|
54556
54647
|
}
|
|
54557
54648
|
}
|
|
54558
54649
|
} : {
|
|
54559
|
-
type: amisFieldType,
|
|
54560
|
-
tpl: `
|
|
54561
|
-
|
|
54562
|
-
|
|
54563
|
-
|
|
54564
|
-
|
|
54565
|
-
|
|
54650
|
+
// type: amisFieldType,
|
|
54651
|
+
// tpl: `
|
|
54652
|
+
// <% let fileData = data._display.${steedosField.name}; if (fileData) { %>
|
|
54653
|
+
// <% if(!Array.isArray(fileData)){ fileData = [fileData]} %>
|
|
54654
|
+
// <% fileData.forEach(function(item) { %>
|
|
54655
|
+
// <a href='<%= item.url %>' target='_self' class='block'><%= item.name %></a>
|
|
54656
|
+
// <% });} %>`
|
|
54657
|
+
"type": "control",
|
|
54658
|
+
"body": {
|
|
54659
|
+
type: 'each',
|
|
54660
|
+
placeholder: "",
|
|
54661
|
+
// className: `steedos-field-lookup-each flex flex-wrap gap-2`,
|
|
54662
|
+
source: `\${_display.${steedosField.name}|asArray}`,
|
|
54663
|
+
items: {
|
|
54664
|
+
type: 'static',
|
|
54665
|
+
labelClassName: "hidden",
|
|
54666
|
+
label: false,
|
|
54667
|
+
className: 'm-0',
|
|
54668
|
+
tpl: `<a href="/app/-/cfs_files_filerecord/view/\${value}" ${lookupATagClick}>\${name}</a>`,
|
|
54669
|
+
// tpl: "<%= item.name >",
|
|
54670
|
+
// onEvent: window.innerWidth < 768 ? null : REFERENCE_VALUE_ITEM_ONCLICK
|
|
54671
|
+
onEvent: window.innerWidth < 768 ? null : await getLookupLinkOnClick(steedosField, {
|
|
54672
|
+
appId,
|
|
54673
|
+
objectName: "cfs_files_filerecord",
|
|
54674
|
+
formFactor
|
|
54675
|
+
})
|
|
54676
|
+
}
|
|
54677
|
+
}
|
|
54566
54678
|
}
|
|
54567
54679
|
}
|
|
54568
54680
|
};
|
|
@@ -54624,8 +54736,8 @@ const getAmisFileEditSchema = (steedosField)=>{
|
|
|
54624
54736
|
return convertData;
|
|
54625
54737
|
};
|
|
54626
54738
|
|
|
54627
|
-
const getAmisFileSchema = (steedosField, readonly)=>{
|
|
54628
|
-
return readonly ? getAmisFileReadonlySchema(steedosField) : getAmisFileEditSchema(steedosField);
|
|
54739
|
+
const getAmisFileSchema = async (steedosField, readonly, ctx)=>{
|
|
54740
|
+
return readonly ? await getAmisFileReadonlySchema(steedosField,ctx) : getAmisFileEditSchema(steedosField);
|
|
54629
54741
|
};
|
|
54630
54742
|
|
|
54631
54743
|
var frontend_field_group_generalization$1 = "General";
|
|
@@ -54642,6 +54754,7 @@ var frontend_form_confirm$1 = "Confirm";
|
|
|
54642
54754
|
var frontend_form_delete$1 = "Delete";
|
|
54643
54755
|
var frontend_form_view$1 = "view";
|
|
54644
54756
|
var frontend_form_details$1 = "details";
|
|
54757
|
+
var frontend_form_validation_failed_url$1 = "The URL format is incorrect";
|
|
54645
54758
|
var frontend_delete_confirm_text$1 = "Are you sure you want to delete this item?";
|
|
54646
54759
|
var frontend_delete_many_selected_required$1 = "Please select the item to be deleted";
|
|
54647
54760
|
var frontend_delete_many_confirm_text$1 = "Are you sure you want to delete?";
|
|
@@ -54698,6 +54811,7 @@ var frontend_setup$1 = "Setup";
|
|
|
54698
54811
|
var frontend_notifications$1 = "Notifications";
|
|
54699
54812
|
var frontend_notifications_allread$1 = "Mark all as read";
|
|
54700
54813
|
var frontend_notifications_allread_message$1 = "All marked as read";
|
|
54814
|
+
var frontend_notifications_close_dialog$1 = "Close";
|
|
54701
54815
|
var frontend_profile$1 = "Profile";
|
|
54702
54816
|
var switch_space$1 = "Switch Space";
|
|
54703
54817
|
var frontend_about$1 = "About";
|
|
@@ -54730,6 +54844,7 @@ var en_us = {
|
|
|
54730
54844
|
frontend_form_delete: frontend_form_delete$1,
|
|
54731
54845
|
frontend_form_view: frontend_form_view$1,
|
|
54732
54846
|
frontend_form_details: frontend_form_details$1,
|
|
54847
|
+
frontend_form_validation_failed_url: frontend_form_validation_failed_url$1,
|
|
54733
54848
|
frontend_delete_confirm_text: frontend_delete_confirm_text$1,
|
|
54734
54849
|
frontend_delete_many_selected_required: frontend_delete_many_selected_required$1,
|
|
54735
54850
|
frontend_delete_many_confirm_text: frontend_delete_many_confirm_text$1,
|
|
@@ -54786,6 +54901,7 @@ var en_us = {
|
|
|
54786
54901
|
frontend_notifications: frontend_notifications$1,
|
|
54787
54902
|
frontend_notifications_allread: frontend_notifications_allread$1,
|
|
54788
54903
|
frontend_notifications_allread_message: frontend_notifications_allread_message$1,
|
|
54904
|
+
frontend_notifications_close_dialog: frontend_notifications_close_dialog$1,
|
|
54789
54905
|
frontend_profile: frontend_profile$1,
|
|
54790
54906
|
switch_space: switch_space$1,
|
|
54791
54907
|
frontend_about: frontend_about$1,
|
|
@@ -54819,6 +54935,7 @@ var frontend_form_confirm = "确认";
|
|
|
54819
54935
|
var frontend_form_delete = "删除";
|
|
54820
54936
|
var frontend_form_view = "查看";
|
|
54821
54937
|
var frontend_form_details = "详情";
|
|
54938
|
+
var frontend_form_validation_failed_url = "URL 格式不正确";
|
|
54822
54939
|
var frontend_delete_confirm_text = "确定要删除此项目?";
|
|
54823
54940
|
var frontend_delete_many_selected_required = "请选择要删除的项";
|
|
54824
54941
|
var frontend_delete_many_confirm_text = "确定要删除吗?";
|
|
@@ -54876,6 +54993,7 @@ var frontend_setup = "设置";
|
|
|
54876
54993
|
var frontend_notifications = "通知";
|
|
54877
54994
|
var frontend_notifications_allread = "全部标记为已读";
|
|
54878
54995
|
var frontend_notifications_allread_message = "已全部标记为已读";
|
|
54996
|
+
var frontend_notifications_close_dialog = "关闭";
|
|
54879
54997
|
var frontend_profile = "个人资料";
|
|
54880
54998
|
var switch_space = "切换工作区";
|
|
54881
54999
|
var frontend_about = "关于";
|
|
@@ -54908,6 +55026,7 @@ var zh_cn = {
|
|
|
54908
55026
|
frontend_form_delete: frontend_form_delete,
|
|
54909
55027
|
frontend_form_view: frontend_form_view,
|
|
54910
55028
|
frontend_form_details: frontend_form_details,
|
|
55029
|
+
frontend_form_validation_failed_url: frontend_form_validation_failed_url,
|
|
54911
55030
|
frontend_delete_confirm_text: frontend_delete_confirm_text,
|
|
54912
55031
|
frontend_delete_many_selected_required: frontend_delete_many_selected_required,
|
|
54913
55032
|
frontend_delete_many_confirm_text: frontend_delete_many_confirm_text,
|
|
@@ -54965,6 +55084,7 @@ var zh_cn = {
|
|
|
54965
55084
|
frontend_notifications: frontend_notifications,
|
|
54966
55085
|
frontend_notifications_allread: frontend_notifications_allread,
|
|
54967
55086
|
frontend_notifications_allread_message: frontend_notifications_allread_message,
|
|
55087
|
+
frontend_notifications_close_dialog: frontend_notifications_close_dialog,
|
|
54968
55088
|
frontend_profile: frontend_profile,
|
|
54969
55089
|
switch_space: switch_space,
|
|
54970
55090
|
frontend_about: frontend_about,
|
|
@@ -55137,7 +55257,12 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
55137
55257
|
break;
|
|
55138
55258
|
case "percent":
|
|
55139
55259
|
TempDisplayField = `
|
|
55140
|
-
|
|
55260
|
+
if(event.data.value){
|
|
55261
|
+
_display["${field.name}"] = event.data.value.toFixed(${field.scale}) + '%';
|
|
55262
|
+
} else {
|
|
55263
|
+
_display["${field.name}"] = event.data.value;
|
|
55264
|
+
}
|
|
55265
|
+
|
|
55141
55266
|
`;
|
|
55142
55267
|
quickEditSchema.body[0].onEvent["change"] = quickEditOnEvent(TempDisplayField);
|
|
55143
55268
|
break;
|
|
@@ -55481,6 +55606,60 @@ function getFieldWidth(width){
|
|
|
55481
55606
|
}
|
|
55482
55607
|
}
|
|
55483
55608
|
|
|
55609
|
+
async function getColumnItemOnClick(field, options){
|
|
55610
|
+
const recordPage = await getPage({ type: 'record', appId: options.appId, objectName: options.objectName, formFactor: options.formFactor });
|
|
55611
|
+
const drawerRecordDetailSchema = recordPage ? Object.assign({}, recordPage.schema, {
|
|
55612
|
+
"recordId": `\${${options.idFieldName}}`,
|
|
55613
|
+
"data": {
|
|
55614
|
+
...recordPage.schema.data,
|
|
55615
|
+
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
55616
|
+
"recordLoaded": false, // 重置数据加载状态
|
|
55617
|
+
"recordId": `\${${options.idFieldName}}`//审批微页面依赖了作用域中的recordId
|
|
55618
|
+
}
|
|
55619
|
+
}) : {
|
|
55620
|
+
"type": "steedos-record-detail",
|
|
55621
|
+
"objectApiName": "${objectName}",
|
|
55622
|
+
"recordId": `\${${options.idFieldName}}`,
|
|
55623
|
+
"showBackButton": false,
|
|
55624
|
+
"showButtons": true,
|
|
55625
|
+
"data": {
|
|
55626
|
+
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
55627
|
+
"recordLoaded": false, // 重置数据加载状态
|
|
55628
|
+
}
|
|
55629
|
+
};
|
|
55630
|
+
|
|
55631
|
+
if(!(field.is_name || field.name === options.labelFieldName)){
|
|
55632
|
+
drawerRecordDetailSchema.objectApiName = field.reference_to;
|
|
55633
|
+
drawerRecordDetailSchema.recordId = `\${_display.${field.name}.value}`;
|
|
55634
|
+
}
|
|
55635
|
+
return {
|
|
55636
|
+
"click": {
|
|
55637
|
+
"actions": [
|
|
55638
|
+
{
|
|
55639
|
+
"actionType": "drawer",
|
|
55640
|
+
"drawer": {
|
|
55641
|
+
"type": "drawer",
|
|
55642
|
+
"title": " ",
|
|
55643
|
+
"headerClassName": "hidden",
|
|
55644
|
+
"size": "lg",
|
|
55645
|
+
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
55646
|
+
"closeOnEsc": true,
|
|
55647
|
+
"closeOnOutside": true,
|
|
55648
|
+
"resizable": true,
|
|
55649
|
+
"actions": [],
|
|
55650
|
+
"body": [
|
|
55651
|
+
drawerRecordDetailSchema
|
|
55652
|
+
],
|
|
55653
|
+
"className": "steedos-record-detail-drawer app-popover",
|
|
55654
|
+
"id": "u:fc5f055afa8c"
|
|
55655
|
+
},
|
|
55656
|
+
"preventDefault": true
|
|
55657
|
+
}
|
|
55658
|
+
]
|
|
55659
|
+
}
|
|
55660
|
+
};
|
|
55661
|
+
}
|
|
55662
|
+
|
|
55484
55663
|
async function getTableColumns(object, fields, options){
|
|
55485
55664
|
const columns = [];
|
|
55486
55665
|
if(!options.isLookup && !options.isInputTable){
|
|
@@ -55520,7 +55699,10 @@ async function getTableColumns(object, fields, options){
|
|
|
55520
55699
|
delete fieldAmis?.className;
|
|
55521
55700
|
|
|
55522
55701
|
let columnItem;
|
|
55523
|
-
|
|
55702
|
+
|
|
55703
|
+
// PC客户端点击名称字段直接预览
|
|
55704
|
+
let isNode = !!(window && window.nw && window.nw.require);
|
|
55705
|
+
if((field.is_name || field.name === options.labelFieldName) && options.objectName === 'cms_files' && isNode){
|
|
55524
55706
|
const previewFileScript = `
|
|
55525
55707
|
var data = event.data;
|
|
55526
55708
|
var file_name = data.versions ? data.name : "${field.label}";
|
|
@@ -55535,20 +55717,20 @@ async function getTableColumns(object, fields, options){
|
|
|
55535
55717
|
"onEvent": {
|
|
55536
55718
|
"click": {
|
|
55537
55719
|
"actions": [
|
|
55538
|
-
{
|
|
55539
|
-
|
|
55540
|
-
|
|
55541
|
-
|
|
55542
|
-
|
|
55543
|
-
|
|
55544
|
-
|
|
55545
|
-
|
|
55546
|
-
|
|
55547
|
-
|
|
55548
|
-
|
|
55549
|
-
|
|
55550
|
-
|
|
55551
|
-
},
|
|
55720
|
+
// {
|
|
55721
|
+
// "args": {
|
|
55722
|
+
// "api": {
|
|
55723
|
+
// "url": "${(versions[0] && versions[0].url) ? versions[0].url+'?download=true' : context.rootUrl+'/api/files/files/'+versions[0]+'?download=true'}",
|
|
55724
|
+
// "method": "get",
|
|
55725
|
+
// "headers": {
|
|
55726
|
+
// "Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
55727
|
+
// }
|
|
55728
|
+
// }
|
|
55729
|
+
// },
|
|
55730
|
+
// "actionType": "download",
|
|
55731
|
+
// // "expression": "!!!window?.nw?.require"//浏览器上直接下载
|
|
55732
|
+
// "expression": "!!!(window && window.nw && window.nw.require)"//浏览器上直接下载
|
|
55733
|
+
// },
|
|
55552
55734
|
{
|
|
55553
55735
|
"args": {},
|
|
55554
55736
|
"actionType": "custom",
|
|
@@ -55579,7 +55761,7 @@ async function getTableColumns(object, fields, options){
|
|
|
55579
55761
|
toggled: field.toggled,
|
|
55580
55762
|
static: true,
|
|
55581
55763
|
className,
|
|
55582
|
-
...getAmisFileReadonlySchema(field)
|
|
55764
|
+
...await getAmisFileReadonlySchema(field)
|
|
55583
55765
|
}, fieldAmis, {name: field.name});
|
|
55584
55766
|
}
|
|
55585
55767
|
else if(field.type === 'select'){
|
|
@@ -55646,51 +55828,7 @@ async function getTableColumns(object, fields, options){
|
|
|
55646
55828
|
}
|
|
55647
55829
|
|
|
55648
55830
|
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){
|
|
55649
|
-
|
|
55650
|
-
const drawerRecordDetailSchema = {
|
|
55651
|
-
"type": "steedos-record-detail",
|
|
55652
|
-
"objectApiName": "${objectName}",
|
|
55653
|
-
"recordId": `\${${options.idFieldName}}`,
|
|
55654
|
-
"showBackButton": false,
|
|
55655
|
-
"showButtons": true,
|
|
55656
|
-
"data": {
|
|
55657
|
-
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
55658
|
-
"recordLoaded": false, // 重置数据加载状态
|
|
55659
|
-
}
|
|
55660
|
-
};
|
|
55661
|
-
|
|
55662
|
-
|
|
55663
|
-
if(!(field.is_name || field.name === options.labelFieldName)){
|
|
55664
|
-
drawerRecordDetailSchema.objectApiName = field.reference_to;
|
|
55665
|
-
drawerRecordDetailSchema.recordId = `\${_display.${field.name}.value}`;
|
|
55666
|
-
}
|
|
55667
|
-
|
|
55668
|
-
columnItem.onEvent = {
|
|
55669
|
-
"click": {
|
|
55670
|
-
"actions": [
|
|
55671
|
-
{
|
|
55672
|
-
"actionType": "drawer",
|
|
55673
|
-
"drawer": {
|
|
55674
|
-
"type": "drawer",
|
|
55675
|
-
"title": " ",
|
|
55676
|
-
"headerClassName": "hidden",
|
|
55677
|
-
"size": "lg",
|
|
55678
|
-
"bodyClassName": "p-0 m-0",
|
|
55679
|
-
"closeOnEsc": true,
|
|
55680
|
-
"closeOnOutside": true,
|
|
55681
|
-
"resizable": true,
|
|
55682
|
-
"actions": [],
|
|
55683
|
-
"body": [
|
|
55684
|
-
drawerRecordDetailSchema
|
|
55685
|
-
],
|
|
55686
|
-
"className": "steedos-record-detail-drawer app-popover",
|
|
55687
|
-
"id": "u:fc5f055afa8c"
|
|
55688
|
-
},
|
|
55689
|
-
"preventDefault": true
|
|
55690
|
-
}
|
|
55691
|
-
]
|
|
55692
|
-
}
|
|
55693
|
-
};
|
|
55831
|
+
columnItem.onEvent = await getColumnItemOnClick(field, options);
|
|
55694
55832
|
}
|
|
55695
55833
|
|
|
55696
55834
|
}
|
|
@@ -55903,17 +56041,23 @@ async function getMobileTableColumns(fields, options){
|
|
|
55903
56041
|
onEvent: {
|
|
55904
56042
|
"click": {
|
|
55905
56043
|
"actions": [
|
|
56044
|
+
// {
|
|
56045
|
+
// "args": {
|
|
56046
|
+
// "api": {
|
|
56047
|
+
// "url": url,
|
|
56048
|
+
// "method": "get",
|
|
56049
|
+
// "headers": {
|
|
56050
|
+
// "Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
56051
|
+
// }
|
|
56052
|
+
// }
|
|
56053
|
+
// },
|
|
56054
|
+
// "actionType": "download"
|
|
56055
|
+
// }
|
|
55906
56056
|
{
|
|
56057
|
+
"actionType": "link",
|
|
55907
56058
|
"args": {
|
|
55908
|
-
"
|
|
55909
|
-
|
|
55910
|
-
"method": "get",
|
|
55911
|
-
"headers": {
|
|
55912
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
55913
|
-
}
|
|
55914
|
-
}
|
|
55915
|
-
},
|
|
55916
|
-
"actionType": "download"
|
|
56059
|
+
"link": url
|
|
56060
|
+
}
|
|
55917
56061
|
}
|
|
55918
56062
|
],
|
|
55919
56063
|
"weight": 0
|
|
@@ -56410,16 +56554,6 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
56410
56554
|
data: formSchema
|
|
56411
56555
|
};
|
|
56412
56556
|
`;
|
|
56413
|
-
const onDialogCancelScript = `
|
|
56414
|
-
// 这里加setTimeout是因为amis的Bug,它会先触发cancel事件执行此脚本关闭父窗口然后再关闭子窗口
|
|
56415
|
-
// 正确的顺序应该是先关闭子窗口再关闭父窗口,顺序错了会造成第二次点击新建按钮的时候异常
|
|
56416
|
-
setTimeout(function(){
|
|
56417
|
-
doAction({
|
|
56418
|
-
"actionType": "cancel",
|
|
56419
|
-
"componentId": "object_actions_drawer_${uiSchema.name}"
|
|
56420
|
-
});
|
|
56421
|
-
}, 200);
|
|
56422
|
-
`;
|
|
56423
56557
|
const getSelectedRowsScript = `
|
|
56424
56558
|
const isLookup = event.data.isLookup;
|
|
56425
56559
|
if(isLookup){
|
|
@@ -56509,17 +56643,6 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
56509
56643
|
"closeOnEsc": false,
|
|
56510
56644
|
"closeOnOutside": false,
|
|
56511
56645
|
"size": "lg",
|
|
56512
|
-
"onEvent": {
|
|
56513
|
-
"cancel": {
|
|
56514
|
-
"actions": [
|
|
56515
|
-
{
|
|
56516
|
-
"actionType": "custom",
|
|
56517
|
-
"script": onDialogCancelScript,
|
|
56518
|
-
"expression": "${window:innerWidth < 768}",
|
|
56519
|
-
}
|
|
56520
|
-
]
|
|
56521
|
-
}
|
|
56522
|
-
},
|
|
56523
56646
|
"actions": [
|
|
56524
56647
|
{
|
|
56525
56648
|
type: 'button',
|
|
@@ -57157,21 +57280,11 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
57157
57280
|
};
|
|
57158
57281
|
}
|
|
57159
57282
|
|
|
57160
|
-
|
|
57161
|
-
/**
|
|
57162
|
-
* 列表视图顶部放大镜过滤条件栏amisSchema
|
|
57163
|
-
* @param {*} objectSchema 对象UISchema
|
|
57164
|
-
* @returns amisSchema
|
|
57165
|
-
*/
|
|
57166
|
-
async function getObjectListHeaderFieldsFilterBar(objectSchema, listViewName, ctx) {
|
|
57167
|
-
const fieldsFilterBarSchema = await getObjectFieldsFilterBarSchema(objectSchema, ctx);
|
|
57168
|
-
return fieldsFilterBarSchema;
|
|
57169
|
-
}
|
|
57170
|
-
|
|
57171
57283
|
const getNewListviewButtonSchema = ()=>{
|
|
57172
57284
|
return {
|
|
57173
57285
|
"type": "button",
|
|
57174
57286
|
"label": instance.t('frontend_listview_control_new_label'),
|
|
57287
|
+
"className": "steedos-listview-new-button",
|
|
57175
57288
|
"onEvent": {
|
|
57176
57289
|
"click": {
|
|
57177
57290
|
"weight": 0,
|
|
@@ -57378,6 +57491,17 @@ function fieldsExtend$5(){
|
|
|
57378
57491
|
}
|
|
57379
57492
|
}
|
|
57380
57493
|
|
|
57494
|
+
|
|
57495
|
+
/**
|
|
57496
|
+
* 列表视图顶部放大镜过滤条件栏amisSchema
|
|
57497
|
+
* @param {*} objectSchema 对象UISchema
|
|
57498
|
+
* @returns amisSchema
|
|
57499
|
+
*/
|
|
57500
|
+
async function getObjectListHeaderFieldsFilterBar(objectSchema, listViewName, ctx) {
|
|
57501
|
+
const fieldsFilterBarSchema = await getObjectFieldsFilterBarSchema(objectSchema, ctx);
|
|
57502
|
+
return fieldsFilterBarSchema;
|
|
57503
|
+
}
|
|
57504
|
+
|
|
57381
57505
|
const getCopyListviewButtonSchema = ()=>{
|
|
57382
57506
|
return {
|
|
57383
57507
|
"type": "button",
|
|
@@ -58343,6 +58467,10 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
58343
58467
|
// const scope = event.context.scoped;
|
|
58344
58468
|
// 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
|
|
58345
58469
|
// 点击取消按钮后继续在表单项中输入过滤条件且最后没有点击回车按键或点击表单项搜索按钮的话,在快速搜索中点击回车按钮提交搜索会所顶部搜索表单中的字段值清空
|
|
58470
|
+
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
58471
|
+
if(!filterForm){
|
|
58472
|
+
return;
|
|
58473
|
+
}
|
|
58346
58474
|
let isLookup = event.data.isLookup;
|
|
58347
58475
|
let __lookupField = event.data.__lookupField;
|
|
58348
58476
|
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
@@ -58353,9 +58481,8 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
58353
58481
|
}
|
|
58354
58482
|
__changedFilterFormValuesKey += lookupTag;
|
|
58355
58483
|
}
|
|
58356
|
-
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
58357
58484
|
setTimeout(function(){
|
|
58358
|
-
filterForm.setValues(event.data[__changedFilterFormValuesKey]);
|
|
58485
|
+
filterForm && filterForm.setValues(event.data[__changedFilterFormValuesKey]);
|
|
58359
58486
|
}, 500);
|
|
58360
58487
|
`;
|
|
58361
58488
|
|
|
@@ -59722,7 +59849,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59722
59849
|
}
|
|
59723
59850
|
|
|
59724
59851
|
var fieldFilters = ${JSON.stringify(field.filters)};
|
|
59725
|
-
var currentAmis = amisRequire('amis');
|
|
59852
|
+
var currentAmis = (window.amisRequire && window.amisRequire('amis')) || Amis;
|
|
59726
59853
|
//递归fieldFilters数组,检查每一个元素,判断若是公式,就仅把它解析
|
|
59727
59854
|
function traverseNestedArray(arr) {
|
|
59728
59855
|
for (let i = 0; i < arr.length; i++) {
|
|
@@ -59733,7 +59860,11 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59733
59860
|
// 如果当前元素不是数组,则处理该元素
|
|
59734
59861
|
// 下面正则用于匹配amis公式\${}
|
|
59735
59862
|
if(/\\\$\\\{([^}]*)\\\}/.test(arr[i])) {
|
|
59736
|
-
|
|
59863
|
+
try{
|
|
59864
|
+
arr[i] = currentAmis.evaluate(arr[i], api.context);
|
|
59865
|
+
}catch(ex){
|
|
59866
|
+
console.error("运行lookup过滤公式时出现错误:",ex);
|
|
59867
|
+
}
|
|
59737
59868
|
}
|
|
59738
59869
|
}
|
|
59739
59870
|
}
|
|
@@ -59894,8 +60025,8 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
59894
60025
|
const isAllowCreate = refObjectConfig.permissions.allowCreate;
|
|
59895
60026
|
const isCreate = lodash.exports.isBoolean(field.create) ? field.create : true;
|
|
59896
60027
|
// lookup字段配置过滤条件就强制不显示新建按钮
|
|
59897
|
-
let
|
|
59898
|
-
if (isAllowCreate && isCreate && !
|
|
60028
|
+
let hasFilters = !lodash.exports.isEmpty(field.filters) || !!field.filtersFunction || !!field._filtersFunction;
|
|
60029
|
+
if (isAllowCreate && isCreate && !hasFilters) {
|
|
59899
60030
|
const new_button = await getSchema$5(refObjectConfig, { appId: ctx.appId, objectName: refObjectConfig.name, formFactor: ctx.formFactor });
|
|
59900
60031
|
new_button.align = "right";
|
|
59901
60032
|
// 保持快速搜索放在最左侧,新建按钮往里插,而不是push到最后
|
|
@@ -60139,7 +60270,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
60139
60270
|
// }
|
|
60140
60271
|
|
|
60141
60272
|
var fieldFilters = ${JSON.stringify(field.filters)};
|
|
60142
|
-
var currentAmis = amisRequire('amis');
|
|
60273
|
+
var currentAmis = (window.amisRequire && window.amisRequire('amis')) || Amis;
|
|
60143
60274
|
//递归fieldFilters数组,检查每一个元素,判断若是公式,就仅把它解析
|
|
60144
60275
|
function traverseNestedArray(arr) {
|
|
60145
60276
|
for (let i = 0; i < arr.length; i++) {
|
|
@@ -60150,7 +60281,11 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
60150
60281
|
// 如果当前元素不是数组,则处理该元素
|
|
60151
60282
|
// 下面正则用于匹配amis公式\${}
|
|
60152
60283
|
if(/\\\$\\\{([^}]*)\\\}/.test(arr[i])) {
|
|
60153
|
-
|
|
60284
|
+
try{
|
|
60285
|
+
arr[i] = currentAmis.evaluate(arr[i], api.context);
|
|
60286
|
+
}catch(ex){
|
|
60287
|
+
console.error("运行lookup过滤公式时出现错误:",ex);
|
|
60288
|
+
}
|
|
60154
60289
|
}
|
|
60155
60290
|
}
|
|
60156
60291
|
}
|
|
@@ -60558,8 +60693,8 @@ if(typeof window != 'undefined'){
|
|
|
60558
60693
|
/*
|
|
60559
60694
|
* @Author: baozhoutao@steedos.com
|
|
60560
60695
|
* @Date: 2023-01-13 17:27:54
|
|
60561
|
-
* @LastEditors:
|
|
60562
|
-
* @LastEditTime: 2024-
|
|
60696
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
60697
|
+
* @LastEditTime: 2024-06-07 13:39:34
|
|
60563
60698
|
* @Description:
|
|
60564
60699
|
*/
|
|
60565
60700
|
|
|
@@ -60596,6 +60731,7 @@ const getMarkdownFieldSchema = (field, readonly, ctx)=>{
|
|
|
60596
60731
|
"name": field.name,
|
|
60597
60732
|
"labelClassName": "none",
|
|
60598
60733
|
"language": "markdown",
|
|
60734
|
+
"options": field.amis ? field.amis.editorOptions : null
|
|
60599
60735
|
}
|
|
60600
60736
|
]
|
|
60601
60737
|
},
|
|
@@ -61145,6 +61281,21 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
61145
61281
|
type: getAmisStaticFieldType('url', readonly, field),
|
|
61146
61282
|
static: readonly ? true : false
|
|
61147
61283
|
};
|
|
61284
|
+
if(!readonly){
|
|
61285
|
+
// amis input-url控件不支持相对路径,这里支持下
|
|
61286
|
+
// 如果要使用amis原生input-url控件的默认的isUrl验证效果或自定义字段validations效果,配置字段的amis.validations属性即可,配置为null或空字符串则使用amis默认的isUrl效果
|
|
61287
|
+
let fieldAmisValidations = field.amis?.validations;
|
|
61288
|
+
if(typeof fieldAmisValidations === "undefined"){
|
|
61289
|
+
Object.assign(convertData, {
|
|
61290
|
+
"validations": {
|
|
61291
|
+
"matchRegexp": "^((http:\\/\\/|https:\\/\\/|ftp:\\/\\/|sftp:\\/\\/)+([^\\s\\/\\.]+(\\.[^\\s\\/\\.]+)+))*(\\/[^\\s\\.\\/]+)*$"
|
|
61292
|
+
},
|
|
61293
|
+
"validationErrors": {
|
|
61294
|
+
"matchRegexp": instance.t('frontend_form_validation_failed_url')//"URL 格式不正确"
|
|
61295
|
+
}
|
|
61296
|
+
});
|
|
61297
|
+
}
|
|
61298
|
+
}
|
|
61148
61299
|
if(readonly && field.show_as_qr){
|
|
61149
61300
|
convertData = {
|
|
61150
61301
|
type: "control",
|
|
@@ -61210,13 +61361,13 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
61210
61361
|
};
|
|
61211
61362
|
break;
|
|
61212
61363
|
case 'avatar':
|
|
61213
|
-
convertData = getAmisFileSchema(field, readonly);
|
|
61364
|
+
convertData = await getAmisFileSchema(field, readonly, ctx);
|
|
61214
61365
|
break;
|
|
61215
61366
|
case 'image':
|
|
61216
|
-
convertData = getAmisFileSchema(field, readonly);
|
|
61367
|
+
convertData = await getAmisFileSchema(field, readonly, ctx);
|
|
61217
61368
|
break;
|
|
61218
61369
|
case 'file':
|
|
61219
|
-
convertData = getAmisFileSchema(field, readonly);
|
|
61370
|
+
convertData = await getAmisFileSchema(field, readonly, ctx);
|
|
61220
61371
|
break;
|
|
61221
61372
|
case 'formula':
|
|
61222
61373
|
if(readonly){
|