@steedos-widgets/amis-object 1.2.40 → 1.2.42

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.
@@ -3847,7 +3847,7 @@ async function getFieldsTemplate(fields, display){
3847
3847
  let expandFieldsQuery = "";
3848
3848
  if(expandFields.length > 0){
3849
3849
  ___default__namespace.each(expandFields, function(field){
3850
- expandFieldsQuery = expandFieldsQuery + `${field.expandInfo.fieldName}:${field.expandInfo.fieldName}__expand{${field.expandInfo.displayName}}`;
3850
+ expandFieldsQuery = expandFieldsQuery + `${field.expandInfo.fieldName}__expand{${field.expandInfo.displayName}}`;
3851
3851
  });
3852
3852
  }
3853
3853
 
@@ -6609,7 +6609,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
6609
6609
  });
6610
6610
  // 有过滤条件时只显示搜索按钮上的红点,不自动展开搜索栏
6611
6611
  if(!_.isEmpty(omitedEmptyFormValue)){
6612
- let crudService = SteedosUI.getRef(data.$scopeId).getComponentById("service_listview_" + data.objectName)
6612
+ let crudService = SteedosUI.getRef(data.$scopeId).parent.getComponentById("service_listview_" + data.objectName)
6613
6613
  crudService && crudService.setData({isFieldsFilterEmpty: false});
6614
6614
  // setData({ showFieldsFilter: true });//自动展开搜索栏
6615
6615
  }
@@ -12518,6 +12518,39 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
12518
12518
  });
12519
12519
  `;
12520
12520
 
12521
+ const onEventClickScript = `
12522
+ const data = event.data;
12523
+ const eventData = data.event;
12524
+ const appId = data.appId;
12525
+ const objectName = data.objectName;
12526
+ const eventId = data.event && data.event.id;
12527
+ doAction({
12528
+ "actionType": "link",
12529
+ "args": {
12530
+ "link": "/app/" + appId + "/" + objectName + "/view/" + eventId
12531
+ }
12532
+ });
12533
+ // doAction({
12534
+ // "actionType": "dialog",
12535
+ // "dialog": {
12536
+ // "type": "dialog",
12537
+ // "title": "",
12538
+ // "body": [
12539
+ // {
12540
+ // "type": "steedos-record-detail",
12541
+ // "objectApiName": "\${objectName}",
12542
+ // "recordId": data.event && data.event.id
12543
+ // }
12544
+ // ],
12545
+ // "closeOnEsc": false,
12546
+ // "closeOnOutside": false,
12547
+ // "showCloseButton": true,
12548
+ // "size": "lg",
12549
+ // "actions": []
12550
+ // }
12551
+ // });
12552
+ `;
12553
+
12521
12554
  const recordId = "${event.id}";
12522
12555
  const recordPermissionsApi = getCalendarRecordPermissionsApi(objectSchema, recordId);
12523
12556
  const recordSaveApi = getCalendarRecordSaveApi(objectSchema, calendarOptions);
@@ -12563,11 +12596,16 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
12563
12596
  "weight": 0,
12564
12597
  "actions": [
12565
12598
  {
12566
- "actionType": "link",
12567
- "args": {
12568
- "link": "/app/${appId}/${objectName}/view/${event.id}"
12569
- }
12570
- }
12599
+ "actionType": "custom",
12600
+ "script": onEventClickScript
12601
+ },
12602
+ // amis 升级到 3.2后,以下的"actionType": "link"方式拿不到appId和objectName了
12603
+ // {
12604
+ // "actionType": "link",
12605
+ // "args": {
12606
+ // "link": "/app/${appId}/${objectName}/view/${event.id}"
12607
+ // }
12608
+ // }
12571
12609
  ]
12572
12610
  },
12573
12611
  "eventAdd": {
@@ -13388,7 +13426,7 @@ const getRecordPermissions = async (objectName, recordId)=>{
13388
13426
  * @Author: baozhoutao@steedos.com
13389
13427
  * @Date: 2022-07-05 15:55:39
13390
13428
  * @LastEditors: liaodaxue
13391
- * @LastEditTime: 2023-06-20 14:05:50
13429
+ * @LastEditTime: 2023-08-21 14:50:21
13392
13430
  * @Description:
13393
13431
  */
13394
13432
 
@@ -13538,7 +13576,7 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
13538
13576
  globalFilter,
13539
13577
  defaults: {
13540
13578
  listSchema: {
13541
- headerToolbar:[],
13579
+ headerToolbar:["bulkActions"],
13542
13580
  columnsTogglable: false,
13543
13581
  onEvent: {
13544
13582
  [`@data.changed.${relatedObjectName}`]: {
@@ -13734,8 +13772,8 @@ async function getRelatedListSchema(
13734
13772
  /*
13735
13773
  * @Author: baozhoutao@steedos.com
13736
13774
  * @Date: 2022-07-05 15:55:39
13737
- * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
13738
- * @LastEditTime: 2023-08-04 12:27:48
13775
+ * @LastEditors: baozhoutao@steedos.com
13776
+ * @LastEditTime: 2023-08-17 18:03:51
13739
13777
  * @Description:
13740
13778
  */
13741
13779
 
@@ -14106,7 +14144,7 @@ async function getTableSchema(
14106
14144
  if(filedInfo && (filedInfo.type === 'lookup' || filedInfo.type === 'master_detail') && ___default.isString(filedInfo.reference_to) ){
14107
14145
  const rfUiSchema = await getUISchema(filedInfo.reference_to);
14108
14146
  const rfFieldInfo = rfUiSchema.fields[displayName];
14109
- fields.push(Object.assign({}, rfFieldInfo, {name: column, expand: true, expandInfo: {fieldName, displayName}}));
14147
+ fields.push(Object.assign({}, rfFieldInfo, {name: `${fieldName}__expand.${displayName}`, expand: true, expandInfo: {fieldName, displayName}}));
14110
14148
  }
14111
14149
  }else {
14112
14150
  if(uiSchema.fields[column]){
@@ -14122,7 +14160,7 @@ async function getTableSchema(
14122
14160
  const rfUiSchema = await getUISchema(filedInfo.reference_to);
14123
14161
  const rfFieldInfo = rfUiSchema.fields[displayName];
14124
14162
  fields.push(Object.assign({}, rfFieldInfo,
14125
- {name: column.field, expand: true, expandInfo: {fieldName, displayName}},
14163
+ {name: `${fieldName}__expand.${displayName}`, expand: true, expandInfo: {fieldName, displayName}},
14126
14164
  {
14127
14165
  width: column.width,
14128
14166
  wrap: column.wrap, // wrap = true 是没效果的
@@ -18680,7 +18718,7 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
18680
18718
  schemaApi: {
18681
18719
  "method": "get",
18682
18720
  "url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus"),
18683
- "adaptor": "\n try {\n console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"\";\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n })\n })\n } else {\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": _.find(tab_groups, {\"group_name\": groupName})?.default_open != false,\n \"children\": _.map(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n });\n })\n }\n\n payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav\n },\n \"id\": \"appMenuService\",\n \"body\":{\n \"type\": \"nav\",\n className: \"").concat(className, " text-black\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n }\n ]\n },\n \"@tabId.changed\":{\n \"actions\":[\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.tabId}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.tabId}\"\n }\n ]\n }\n }\n }\n };\n } catch (error) {\n console.log(`error`, error)\n }\n console.log('payload===2==>', payload)\n return payload;\n "),
18721
+ "adaptor": "\n try {\n console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"\";\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n })\n })\n } else {\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": _.find(tab_groups, {\"group_name\": groupName})?.default_open != false,\n \"children\": _.map(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n });\n })\n }\n\n payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav\n },\n \"id\": \"appMenuService\",\n \"body\":{\n \"type\": \"nav\",\n className: \"").concat(className, " text-black\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n },\n \"@tabId.changed\":{\n \"actions\":[\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.tabId}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.tabId}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n }\n }\n }\n };\n } catch (error) {\n console.log(`error`, error)\n }\n console.log('payload===2==>', payload)\n return payload;\n "),
18684
18722
  "headers": {
18685
18723
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
18686
18724
  }
@@ -18745,8 +18783,8 @@ var AmisGlobalFooter = function (props) { return __awaiter(void 0, void 0, void
18745
18783
  /*
18746
18784
  * @Author: baozhoutao@steedos.com
18747
18785
  * @Date: 2022-09-01 14:44:57
18748
- * @LastEditors: 廖大雪 2291335922@qq.com
18749
- * @LastEditTime: 2023-03-17 14:09:53
18786
+ * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
18787
+ * @LastEditTime: 2023-08-21 14:00:27
18750
18788
  * @Description:
18751
18789
  */
18752
18790
  var AmisGlobalHeaderToolbar = function (props) { return __awaiter(void 0, void 0, void 0, function () {
@@ -18891,7 +18929,7 @@ var AmisGlobalHeaderToolbar = function (props) { return __awaiter(void 0, void 0
18891
18929
  "name": "notifications",
18892
18930
  "items": {
18893
18931
  "type": "tpl",
18894
- "tpl": "<div class='flex items-center p-4 hover:bg-sky-50'><img src='<%=data.context.rootUrl + `/avatar/` + data.from%>' alt='' class='h-10 w-10 flex-none rounded-full'><div class='ml-4 flex-auto'><div class='font-medium'><span class='text-primary'><%=data.name%></span></div><div class='mt-1 text-slate-700'><%=data.body%></div><div class='mt-1 text-slate-700'><%=moment(data.created).fromNow()%><abbr class='slds-text-link slds-m-horizontal_xxx-small <%=data.is_read ? 'hidden' : ''%>' title='unread'>●</abbr></div></div></div>",
18932
+ "tpl": "<div class='flex items-center p-4 hover:bg-sky-50'>\n <img src='<%=data.context.rootUrl + \"/avatar/\" + data.from%>' alt='' class='h-10 w-10 flex-none rounded-full'>\n <div class='ml-4 flex-auto'>\n <div class='font-medium'>\n <span class='text-primary'><%=data.name%></span>\n </div>\n <div class='mt-1 text-slate-700'>\n <%=data.body%>\n </div>\n <div class='mt-1 text-slate-700'>\n <%=moment(data.created).fromNow()%>\n <abbr class='slds-text-link slds-m-horizontal_xxx-small <%=data.is_read ? 'hidden' : ''%>' title='unread'>\u25CF</abbr>\n </div>\n </div>\n </div>",
18895
18933
  "id": "u:07ece657c7b7",
18896
18934
  "onEvent": {
18897
18935
  "click": {
@@ -19442,7 +19480,7 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
19442
19480
  * @Author: baozhoutao@steedos.com
19443
19481
  * @Date: 2023-01-14 16:41:24
19444
19482
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
19445
- * @LastEditTime: 2023-08-03 13:32:08
19483
+ * @LastEditTime: 2023-08-21 10:03:05
19446
19484
  * @Description:
19447
19485
  */
19448
19486
  var getSelectFlowSchema = function (id, props) {
@@ -19594,7 +19632,7 @@ var getSelectFlowSchema = function (id, props) {
19594
19632
  "headers": {
19595
19633
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
19596
19634
  }
19597
- }, "showIcon": showIcon, "showRadio": showRadio, "onlyLeaf": true, "onEvent": onEvent, "static": !!props.static }, amis);
19635
+ }, "showIcon": showIcon, "showRadio": showRadio, "onlyLeaf": true, "onEvent": onEvent, "static": !!props.static, "onlyChildren": true }, amis);
19598
19636
  };
19599
19637
  /**
19600
19638
  *