@steedos-widgets/amis-lib 1.2.31 → 1.2.33
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 +144 -62
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +144 -62
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +144 -62
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/fields/editor.d.ts +24 -15
- package/dist/types/lib/converter/amis/fields/lookup.d.ts +5 -0
- package/dist/types/lib/converter/amis/toolbars/export_excel.d.ts +0 -1
- package/dist/types/lib/converter/amis/toolbars/setting_listview.d.ts +0 -1
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -978,6 +978,7 @@ var frontend_form_cancel$1 = "Cancel";
|
|
|
978
978
|
var frontend_form_new$1 = "New";
|
|
979
979
|
var frontend_form_edit$1 = "Edit";
|
|
980
980
|
var frontend_form_select$1 = "Select";
|
|
981
|
+
var frontend_form_please_select$1 = "Please select";
|
|
981
982
|
var frontend_form_confirm$1 = "Confirm";
|
|
982
983
|
var frontend_form_delete$1 = "Delete";
|
|
983
984
|
var frontend_form_view$1 = "view";
|
|
@@ -1059,6 +1060,7 @@ var en_us = {
|
|
|
1059
1060
|
frontend_form_new: frontend_form_new$1,
|
|
1060
1061
|
frontend_form_edit: frontend_form_edit$1,
|
|
1061
1062
|
frontend_form_select: frontend_form_select$1,
|
|
1063
|
+
frontend_form_please_select: frontend_form_please_select$1,
|
|
1062
1064
|
frontend_form_confirm: frontend_form_confirm$1,
|
|
1063
1065
|
frontend_form_delete: frontend_form_delete$1,
|
|
1064
1066
|
frontend_form_view: frontend_form_view$1,
|
|
@@ -1141,6 +1143,7 @@ var frontend_form_cancel = "取消";
|
|
|
1141
1143
|
var frontend_form_new = "新建";
|
|
1142
1144
|
var frontend_form_edit = "编辑";
|
|
1143
1145
|
var frontend_form_select = "选择";
|
|
1146
|
+
var frontend_form_please_select = "请选择";
|
|
1144
1147
|
var frontend_form_confirm = "确认";
|
|
1145
1148
|
var frontend_form_delete = "删除";
|
|
1146
1149
|
var frontend_form_view = "查看";
|
|
@@ -1223,6 +1226,7 @@ var zh_cn = {
|
|
|
1223
1226
|
frontend_form_new: frontend_form_new,
|
|
1224
1227
|
frontend_form_edit: frontend_form_edit,
|
|
1225
1228
|
frontend_form_select: frontend_form_select,
|
|
1229
|
+
frontend_form_please_select: frontend_form_please_select,
|
|
1226
1230
|
frontend_form_confirm: frontend_form_confirm,
|
|
1227
1231
|
frontend_form_delete: frontend_form_delete,
|
|
1228
1232
|
frontend_form_view: frontend_form_view,
|
|
@@ -2589,7 +2593,8 @@ const StandardButtons = {
|
|
|
2589
2593
|
} = this;
|
|
2590
2594
|
const scopeId = this.scopeId || `amis-${appId}-${objectName}-listview`;
|
|
2591
2595
|
const scope = this.scope || SteedosUI?.getRef(scopeId);
|
|
2592
|
-
|
|
2596
|
+
//https://github.com/baidu/amis/pull/6807 .parent的改动是为适应3.2getComponentById的规则改动,不影响2.9
|
|
2597
|
+
const listViewRef = scope.parent?.getComponentById(`listview_${uiSchema.name}`);
|
|
2593
2598
|
if(_.isEmpty(listViewRef.props.store.toJSON().selectedItems)){
|
|
2594
2599
|
listViewRef.handleAction({}, {
|
|
2595
2600
|
"actionType": "toast",
|
|
@@ -5134,7 +5139,8 @@ const getSettingListviewToolbarButtonSchema = ()=>{
|
|
|
5134
5139
|
"type": "dropdown-button",
|
|
5135
5140
|
"trigger": "click",
|
|
5136
5141
|
"icon": "fa fa-cog",
|
|
5137
|
-
|
|
5142
|
+
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
5143
|
+
// "tooltip": i18next.t('frontend_button_listview_control_tooltip'),
|
|
5138
5144
|
"btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded border-gray-300 text-gray-500",
|
|
5139
5145
|
"align": "right",
|
|
5140
5146
|
"visibleOn": "${!isLookup}",
|
|
@@ -5174,11 +5180,12 @@ const getDisplayAsButton = function(objectName, showDisplayAs){
|
|
|
5174
5180
|
"rightIconClassName": "m-l-sm"
|
|
5175
5181
|
}
|
|
5176
5182
|
];
|
|
5177
|
-
|
|
5183
|
+
displayAs === 'split'? i18next__default["default"].t('frontend_display_type_is_split') : i18next__default["default"].t('frontend_display_type_is_table');
|
|
5178
5184
|
return {
|
|
5179
5185
|
"type": "dropdown-button",
|
|
5180
5186
|
"icon": "fa fa-table-columns",
|
|
5181
|
-
|
|
5187
|
+
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
5188
|
+
// "tooltip": `${i18next.t('frontend_display_as')} ${displayAsLabel}`,
|
|
5182
5189
|
"btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded border-gray-300 text-gray-500",
|
|
5183
5190
|
"align": "right",
|
|
5184
5191
|
"visibleOn": "${window:innerWidth > 768 && !!!isLookup}",
|
|
@@ -5260,7 +5267,8 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
5260
5267
|
// "type": "reload",//不可以直接使用reload,因为它不会设置页码到第一页
|
|
5261
5268
|
"type": "button",
|
|
5262
5269
|
"align": "right",
|
|
5263
|
-
|
|
5270
|
+
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
5271
|
+
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
5264
5272
|
"tooltipPlacement": "top",
|
|
5265
5273
|
"className": "bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
5266
5274
|
"label": "",
|
|
@@ -5282,7 +5290,8 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
5282
5290
|
"icon": "fa fa-search",
|
|
5283
5291
|
"type": "button",
|
|
5284
5292
|
"tooltipPlacement": "top",
|
|
5285
|
-
|
|
5293
|
+
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
5294
|
+
// "tooltip": i18next.t('frontend_button_search_tooltip'),
|
|
5286
5295
|
"badge": {
|
|
5287
5296
|
"offset": [
|
|
5288
5297
|
-5,
|
|
@@ -5327,7 +5336,9 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
5327
5336
|
{
|
|
5328
5337
|
"type": "reload",
|
|
5329
5338
|
"align": "right",
|
|
5330
|
-
|
|
5339
|
+
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
5340
|
+
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
5341
|
+
"tooltip":"",
|
|
5331
5342
|
"tooltipPlacement": "top",
|
|
5332
5343
|
"className": "bg-white p-2 rounded border-gray-300 text-gray-500"
|
|
5333
5344
|
},
|
|
@@ -5337,8 +5348,9 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
5337
5348
|
filterVisible ? {
|
|
5338
5349
|
"label": i18next__default["default"].t('frontend_button_search_tooltip'),
|
|
5339
5350
|
"icon": "fa fa-search",
|
|
5340
|
-
|
|
5341
|
-
"
|
|
5351
|
+
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
5352
|
+
// "tooltip": i18next.t('frontend_button_search_tooltip'),
|
|
5353
|
+
// "tooltipPlacement": "top",
|
|
5342
5354
|
"type": "button",
|
|
5343
5355
|
"badge": {
|
|
5344
5356
|
"offset": [
|
|
@@ -5444,9 +5456,16 @@ async function getSource(field, ctx) {
|
|
|
5444
5456
|
valueField = `${ctx.fieldNamePrefix}${valueField}`;
|
|
5445
5457
|
}
|
|
5446
5458
|
data.$value = `$${valueField}`;
|
|
5447
|
-
|
|
5459
|
+
data['$'] = `$$`;
|
|
5448
5460
|
const requestAdaptor = `
|
|
5449
5461
|
var filters = [['parent', '=', null]];
|
|
5462
|
+
const filtersFunction = ${field.filtersFunction || field._filtersFunction};
|
|
5463
|
+
if(filtersFunction){
|
|
5464
|
+
const _filters = filtersFunction(filters, api.data.$);
|
|
5465
|
+
if(_filters && _filters.length > 0){
|
|
5466
|
+
filters.push(_filters);
|
|
5467
|
+
}
|
|
5468
|
+
}
|
|
5450
5469
|
api.data.query = api.data.query.replace(/{__filters}/g, JSON.stringify(filters));
|
|
5451
5470
|
var defaultValue = api.data.$value;
|
|
5452
5471
|
var optionsFiltersOp = "${field.multiple ? "in" : "="}";
|
|
@@ -6065,8 +6084,11 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
6065
6084
|
|
|
6066
6085
|
const data = {
|
|
6067
6086
|
type: getAmisStaticFieldType('picker', readonly),
|
|
6087
|
+
modalTitle: i18next__default["default"].t('frontend_form_please_select') + " " + refObjectConfig.label,
|
|
6068
6088
|
labelField: referenceTo.labelField.name,
|
|
6069
6089
|
valueField: referenceTo.valueField.name,
|
|
6090
|
+
// disabledOn: this._master目的是相关表新建时禁止编辑关联字段; this.relatedKey目的是相关表编辑时禁止编辑关联字段。
|
|
6091
|
+
disabledOn: `${readonly} || ( (this._master && (this._master.relatedKey ==='${field.name}')) || (this.relatedKey ==='${field.name}') )`,
|
|
6070
6092
|
modalMode: 'dialog', //TODO 设置 dialog 或者 drawer,用来配置弹出方式
|
|
6071
6093
|
source: source,
|
|
6072
6094
|
size: "lg",
|
|
@@ -6247,6 +6269,8 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
6247
6269
|
joinValues: false,
|
|
6248
6270
|
extractValue: true,
|
|
6249
6271
|
clearable: true,
|
|
6272
|
+
// disabledOn: this._master目的是相关表新建时禁止编辑关联字段; this.relatedKey目的是相关表编辑时禁止编辑关联字段。
|
|
6273
|
+
disabledOn: `${readonly} || ( (this._master && (this._master.relatedKey ==='${field.name}')) || (this.relatedKey ==='${field.name}') )`,
|
|
6250
6274
|
// labelField: labelField,
|
|
6251
6275
|
// valueField: valueField,
|
|
6252
6276
|
source: apiInfo,
|
|
@@ -6431,6 +6455,8 @@ async function getIdsPickerSchema(field, readonly, ctx){
|
|
|
6431
6455
|
valueField: referenceTo.valueField.name,
|
|
6432
6456
|
modalMode: 'dialog',
|
|
6433
6457
|
source: source,
|
|
6458
|
+
// disabledOn: this._master目的是相关表新建时禁止编辑关联字段; this.relatedKey目的是相关表编辑时禁止编辑关联字段。
|
|
6459
|
+
disabledOn: `${readonly} || ( (this._master && (this._master.relatedKey ==='${field.name}')) || (this.relatedKey ==='${field.name}') )`,
|
|
6434
6460
|
size: "lg",
|
|
6435
6461
|
pickerSchema: pickerSchema,
|
|
6436
6462
|
joinValues: false,
|
|
@@ -6459,7 +6485,7 @@ async function getIdsPickerSchema(field, readonly, ctx){
|
|
|
6459
6485
|
* @Author: baozhoutao@steedos.com
|
|
6460
6486
|
* @Date: 2023-01-13 17:27:54
|
|
6461
6487
|
* @LastEditors: liaodaxue
|
|
6462
|
-
* @LastEditTime: 2023-
|
|
6488
|
+
* @LastEditTime: 2023-07-24 15:23:12
|
|
6463
6489
|
* @Description:
|
|
6464
6490
|
*/
|
|
6465
6491
|
|
|
@@ -6481,21 +6507,39 @@ const getMarkdownFieldSchema = (field, readonly, ctx)=>{
|
|
|
6481
6507
|
}
|
|
6482
6508
|
}else {
|
|
6483
6509
|
return {
|
|
6484
|
-
"type": "
|
|
6510
|
+
"type": "control",
|
|
6511
|
+
"label": field.label,
|
|
6485
6512
|
"body": [
|
|
6486
6513
|
{
|
|
6487
|
-
"type": "
|
|
6488
|
-
"
|
|
6489
|
-
"
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6514
|
+
"type": "tabs",
|
|
6515
|
+
"tabsMode": "strong",
|
|
6516
|
+
"className": "steedos-markdown",
|
|
6517
|
+
"tabs": [
|
|
6518
|
+
{
|
|
6519
|
+
"title": "Write",
|
|
6520
|
+
"tab": [
|
|
6521
|
+
{
|
|
6522
|
+
"type": "editor",
|
|
6523
|
+
"name": field.name,
|
|
6524
|
+
"language": "markdown",
|
|
6525
|
+
}
|
|
6526
|
+
]
|
|
6527
|
+
},
|
|
6528
|
+
{
|
|
6529
|
+
"title": "Preview",
|
|
6530
|
+
"tab": [
|
|
6531
|
+
{
|
|
6532
|
+
"type": "markdown",
|
|
6533
|
+
"name": field.name,
|
|
6534
|
+
"options": {
|
|
6535
|
+
"linkify": true,
|
|
6536
|
+
"html": true,
|
|
6537
|
+
"breaks": true
|
|
6538
|
+
}
|
|
6539
|
+
}
|
|
6540
|
+
]
|
|
6541
|
+
}
|
|
6542
|
+
]
|
|
6499
6543
|
}
|
|
6500
6544
|
]
|
|
6501
6545
|
}
|
|
@@ -6538,8 +6582,8 @@ const getHtmlFieldSchema = (field, readonly, ctx)=>{
|
|
|
6538
6582
|
/*
|
|
6539
6583
|
* @Author: baozhoutao@steedos.com
|
|
6540
6584
|
* @Date: 2022-10-28 14:52:55
|
|
6541
|
-
* @LastEditors:
|
|
6542
|
-
* @LastEditTime: 2023-
|
|
6585
|
+
* @LastEditors: liaodaxue
|
|
6586
|
+
* @LastEditTime: 2023-07-14 17:18:42
|
|
6543
6587
|
* @Description:
|
|
6544
6588
|
*/
|
|
6545
6589
|
|
|
@@ -6571,6 +6615,8 @@ function getAmisStaticFieldType(type, readonly, options){
|
|
|
6571
6615
|
return `static-images`;
|
|
6572
6616
|
}
|
|
6573
6617
|
return `static-${type}`;
|
|
6618
|
+
}else if(type === 'url'){
|
|
6619
|
+
return "input-url"
|
|
6574
6620
|
}else {
|
|
6575
6621
|
return 'static';
|
|
6576
6622
|
}
|
|
@@ -7098,7 +7144,8 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
7098
7144
|
break;
|
|
7099
7145
|
case 'url':
|
|
7100
7146
|
convertData = {
|
|
7101
|
-
type: getAmisStaticFieldType('url', readonly, field)
|
|
7147
|
+
type: getAmisStaticFieldType('url', readonly, field),
|
|
7148
|
+
static: readonly ? true : false
|
|
7102
7149
|
};
|
|
7103
7150
|
if(readonly && field.show_as_qr){
|
|
7104
7151
|
convertData = {
|
|
@@ -7432,17 +7479,19 @@ async function getQuickEditSchema(field, options){
|
|
|
7432
7479
|
return EventType;
|
|
7433
7480
|
};
|
|
7434
7481
|
switch (field.type) {
|
|
7435
|
-
//TODO:amis的picker组件直接点击选项x时不会触发change事件,待处理
|
|
7482
|
+
//TODO: amis的picker组件直接点击选项x时不会触发change事件,待处理
|
|
7436
7483
|
case "lookup":
|
|
7437
7484
|
case "master_detail":
|
|
7485
|
+
let labelField = quickEditSchema.body[0].labelField || "label";
|
|
7486
|
+
let valueField = quickEditSchema.body[0].valueField || "value";
|
|
7438
7487
|
if (field.multiple) {
|
|
7439
7488
|
TempDisplayField = `
|
|
7440
7489
|
_display["${field.name}"] = [];
|
|
7441
|
-
event.data.
|
|
7490
|
+
event.data.selectedItems.forEach(function(item,index){
|
|
7442
7491
|
_display["${field.name}"].push(
|
|
7443
7492
|
{
|
|
7444
|
-
"label":
|
|
7445
|
-
"value":
|
|
7493
|
+
"label": item.${labelField},
|
|
7494
|
+
"value": item.${valueField},
|
|
7446
7495
|
"objectName": "${field.reference_to}"
|
|
7447
7496
|
}
|
|
7448
7497
|
)
|
|
@@ -7451,8 +7500,8 @@ async function getQuickEditSchema(field, options){
|
|
|
7451
7500
|
} else {
|
|
7452
7501
|
TempDisplayField = `
|
|
7453
7502
|
_display["${field.name}"] = {
|
|
7454
|
-
"label": event.data.
|
|
7455
|
-
"value": event.data.
|
|
7503
|
+
"label": event.data.selectedItems.${labelField},
|
|
7504
|
+
"value": event.data.selectedItems.${valueField},
|
|
7456
7505
|
"objectName": "${field.reference_to}"
|
|
7457
7506
|
}
|
|
7458
7507
|
`;
|
|
@@ -7565,10 +7614,25 @@ async function getQuickEditSchema(field, options){
|
|
|
7565
7614
|
return quickEditSchema;
|
|
7566
7615
|
}
|
|
7567
7616
|
|
|
7617
|
+
function getFieldWidth(width){
|
|
7618
|
+
const defaultWidth = "unset";//用于使table内的td标签下生成div,实现将快速编辑按钮固定在右侧的效果,并不是为了unset效果
|
|
7619
|
+
if(typeof width == 'string'){
|
|
7620
|
+
if(isNaN(width)){
|
|
7621
|
+
return width;
|
|
7622
|
+
}else {
|
|
7623
|
+
return Number(width);
|
|
7624
|
+
}
|
|
7625
|
+
}else if(typeof width == 'number'){
|
|
7626
|
+
return width;
|
|
7627
|
+
}else {
|
|
7628
|
+
return defaultWidth;
|
|
7629
|
+
}
|
|
7630
|
+
}
|
|
7631
|
+
|
|
7568
7632
|
async function getTableColumns(fields, options){
|
|
7569
7633
|
const columns = [{name: '_index',type: 'text', width: 32, placeholder: ""}];
|
|
7570
7634
|
const allowEdit = options.permissions?.allowEdit && options.permissions?.modifyAllRecords && !options.isLookup && options.enable_inline_edit != false;
|
|
7571
|
-
|
|
7635
|
+
|
|
7572
7636
|
for (const field of fields) {
|
|
7573
7637
|
//增加quickEdit属性,实现快速编辑
|
|
7574
7638
|
const quickEditSchema = allowEdit ? await getQuickEditSchema(field, options) : allowEdit;
|
|
@@ -7616,7 +7680,7 @@ async function getTableColumns(fields, options){
|
|
|
7616
7680
|
type: "switch",
|
|
7617
7681
|
name: field.name,
|
|
7618
7682
|
label: field.label,
|
|
7619
|
-
width: field.width
|
|
7683
|
+
width: getFieldWidth(field.width),
|
|
7620
7684
|
toggled: field.toggled,
|
|
7621
7685
|
static: true,
|
|
7622
7686
|
className:"whitespace-nowrap",
|
|
@@ -7627,7 +7691,7 @@ async function getTableColumns(fields, options){
|
|
|
7627
7691
|
type: "switch",
|
|
7628
7692
|
name: field.name,
|
|
7629
7693
|
label: field.label,
|
|
7630
|
-
width: field.width
|
|
7694
|
+
width: getFieldWidth(field.width),
|
|
7631
7695
|
toggled: field.toggled,
|
|
7632
7696
|
quickEdit: quickEditSchema,
|
|
7633
7697
|
static: true,
|
|
@@ -7647,7 +7711,7 @@ async function getTableColumns(fields, options){
|
|
|
7647
7711
|
label: field.label,
|
|
7648
7712
|
map: map,
|
|
7649
7713
|
sortable: field.sortable,
|
|
7650
|
-
width: field.width
|
|
7714
|
+
width: getFieldWidth(field.width),
|
|
7651
7715
|
toggled: field.toggled,
|
|
7652
7716
|
className,
|
|
7653
7717
|
static: true,
|
|
@@ -7661,8 +7725,12 @@ async function getTableColumns(fields, options){
|
|
|
7661
7725
|
type = 'tpl';
|
|
7662
7726
|
}else if(field.type === 'html'){
|
|
7663
7727
|
type = 'markdown';
|
|
7664
|
-
}else if(field.type === 'url'
|
|
7665
|
-
|
|
7728
|
+
}else if(field.type === 'url'){
|
|
7729
|
+
if(field.show_as_qr){
|
|
7730
|
+
type = 'qr-code';
|
|
7731
|
+
}else {
|
|
7732
|
+
type = 'input-url';
|
|
7733
|
+
}
|
|
7666
7734
|
}
|
|
7667
7735
|
let className = "";
|
|
7668
7736
|
if(field.type === 'textarea'){
|
|
@@ -7677,7 +7745,7 @@ async function getTableColumns(fields, options){
|
|
|
7677
7745
|
label: field.label,
|
|
7678
7746
|
sortable: field.sortable,
|
|
7679
7747
|
// searchable: field.searchable,
|
|
7680
|
-
width: field.width
|
|
7748
|
+
width: getFieldWidth(field.width),
|
|
7681
7749
|
type: type,
|
|
7682
7750
|
tpl: tpl,
|
|
7683
7751
|
toggled: field.toggled,
|
|
@@ -7975,14 +8043,7 @@ async function getTableOperation(ctx){
|
|
|
7975
8043
|
onOpenApi: {
|
|
7976
8044
|
url: `\${context.rootUrl}/service/api/@\${objectName}/recordPermissions/\${_id}`,
|
|
7977
8045
|
method: "get",
|
|
7978
|
-
|
|
7979
|
-
$: "$$",
|
|
7980
|
-
objectName: "${objectName}",
|
|
7981
|
-
listViewId: "${listViewId}",
|
|
7982
|
-
appId: "${appId}",
|
|
7983
|
-
formFactor: "${formFactor}",
|
|
7984
|
-
context: `\${context}`
|
|
7985
|
-
},
|
|
8046
|
+
requestAdaptor: "api.data={}; return api;",
|
|
7986
8047
|
headers: {
|
|
7987
8048
|
Authorization: "Bearer ${context.tenantId},${context.authToken}"
|
|
7988
8049
|
},
|
|
@@ -8346,7 +8407,8 @@ async function getTableApi(mainObject, fields, options){
|
|
|
8346
8407
|
|
|
8347
8408
|
const setDataToComponentId = "${setDataToComponentId}";
|
|
8348
8409
|
if(setDataToComponentId){
|
|
8349
|
-
|
|
8410
|
+
//https://github.com/baidu/amis/pull/6807 .parent的改动是为适应3.2getComponentById的规则改动,不影响2.9
|
|
8411
|
+
SteedosUI.getRef(api.body.$self.$scopeId)?.parent?.getComponentById(setDataToComponentId)?.setData({$count: payload.data.count})
|
|
8350
8412
|
};
|
|
8351
8413
|
${options.adaptor || ''}
|
|
8352
8414
|
return payload;
|
|
@@ -9038,17 +9100,18 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
|
|
|
9038
9100
|
"objectApiName": "\${objectName}",
|
|
9039
9101
|
"mode": "edit",
|
|
9040
9102
|
"defaultData": doc,
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
}
|
|
9103
|
+
//改回为通用的提交事件
|
|
9104
|
+
// "onEvent": {
|
|
9105
|
+
// "submitSucc": {
|
|
9106
|
+
// "weight": 0,
|
|
9107
|
+
// "actions": [
|
|
9108
|
+
// {
|
|
9109
|
+
// "actionType": "custom",
|
|
9110
|
+
// "script": "event.data.view?.calendar.refetchEvents();"
|
|
9111
|
+
// }
|
|
9112
|
+
// ]
|
|
9113
|
+
// }
|
|
9114
|
+
// }
|
|
9052
9115
|
}
|
|
9053
9116
|
],
|
|
9054
9117
|
"closeOnEsc": false,
|
|
@@ -9177,6 +9240,20 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
|
|
|
9177
9240
|
"script": "console.log('eventsSet'); console.log(event);"
|
|
9178
9241
|
}
|
|
9179
9242
|
]
|
|
9243
|
+
},
|
|
9244
|
+
"getRef": {
|
|
9245
|
+
"weight": 0,
|
|
9246
|
+
"actions": [
|
|
9247
|
+
{
|
|
9248
|
+
"componentId": `service_${options.id}`,
|
|
9249
|
+
"args": {
|
|
9250
|
+
"value":{
|
|
9251
|
+
"calendarRef": "${event.data.calendarRef}"
|
|
9252
|
+
}
|
|
9253
|
+
},
|
|
9254
|
+
"actionType": "setValue",
|
|
9255
|
+
}
|
|
9256
|
+
]
|
|
9180
9257
|
}
|
|
9181
9258
|
};
|
|
9182
9259
|
|
|
@@ -9212,6 +9289,7 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
|
|
|
9212
9289
|
const amisSchema = {
|
|
9213
9290
|
"type": "steedos-fullcalendar",
|
|
9214
9291
|
"label": "",
|
|
9292
|
+
"id": options.id,
|
|
9215
9293
|
"name": "fullcalendar",
|
|
9216
9294
|
"placeholder":"${additionalFilters}",//用于触发reload
|
|
9217
9295
|
"editable": permissions.allowEdit,
|
|
@@ -9234,7 +9312,7 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
|
|
|
9234
9312
|
* @Author: baozhoutao@steedos.com
|
|
9235
9313
|
* @Date: 2022-05-26 16:02:08
|
|
9236
9314
|
* @LastEditors: liaodaxue
|
|
9237
|
-
* @LastEditTime: 2023-
|
|
9315
|
+
* @LastEditTime: 2023-07-12 15:45:55
|
|
9238
9316
|
* @Description:
|
|
9239
9317
|
*/
|
|
9240
9318
|
|
|
@@ -9293,7 +9371,11 @@ const getSection = async (formFields, permissionFields, fieldSchemaArray, sectio
|
|
|
9293
9371
|
|
|
9294
9372
|
// fieldSet 已支持显隐控制
|
|
9295
9373
|
const sectionFieldsVisibleOn = ___namespace.map(___namespace.compact(___namespace.map(fieldSetBody, 'visibleOn')), (visibleOn) => {
|
|
9296
|
-
|
|
9374
|
+
let visible = visibleOn;
|
|
9375
|
+
if(visible.indexOf('${')>-1){
|
|
9376
|
+
visible = visible.substring(visible.indexOf('{')+1, visible.indexOf('}'));
|
|
9377
|
+
}
|
|
9378
|
+
return visible ? "("+visible+")" : visible;
|
|
9297
9379
|
});
|
|
9298
9380
|
|
|
9299
9381
|
let section = {
|