From f6b3015cd3d1412c3fdc0dd46677a4fed8668a51 Mon Sep 17 00:00:00 2001 From: baozhoutao Date: Mon, 25 Sep 2023 17:32:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20[Bug]:=20=E5=AE=A1=E6=89=B9=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=EF=BC=8C=E7=82=B9=E5=87=BB=E8=A1=8C=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E8=87=AA=E5=8A=A8=E9=80=89=E4=B8=AD=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=20#5499?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pages/instance_tasks_list.page.amis.json | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/services/service-workflow/main/default/pages/instance_tasks_list.page.amis.json b/services/service-workflow/main/default/pages/instance_tasks_list.page.amis.json index 82c149bcaf..1123fb2a3f 100644 --- a/services/service-workflow/main/default/pages/instance_tasks_list.page.amis.json +++ b/services/service-workflow/main/default/pages/instance_tasks_list.page.amis.json @@ -42,20 +42,7 @@ "listName": "inbox", "rowClassNameExpr": "<%=(data.is_read === false && (!data.clientIds || data.clientIds.length == 0 || !data.clientIds.includes(data._id))) ? 'unread-instance' : '' %>", "rebuildOn": "\\${flowId || categoryId}", - "crudDataFilter": "if (data && data.flowId && (data.listName == 'inbox' || 'monitor') && window.innerWidth > 768) {\r\n var api = {\r\n url: \"${context.rootUrl}/graphql\",\r\n method: \"post\",\r\n dataType: \"json\",\r\n data: {\r\n \"query\": '{flow: flows__findOne(id:\"' + data.flowId + '\"){form__expand{current}}}'\r\n },\r\n headers: {\r\n Authorization:\r\n \"Bearer ${context.tenantId},${context.authToken}\",\r\n },\r\n };\r\n return env.fetcher(api).then((result) => {\r\n if (result.data && result.data.flow && result.data.flow.form__expand.current.fields && result.data.flow.form__expand.current.fields.length > 0) {\r\n let fields = result.data.flow.form__expand.current.fields;\r\n fields.forEach(function (field) {\r\n if (field.is_list_display) {\r\n crud.columns.push({\r\n \"name\": \"instance__expand.values.\" + field.code,\r\n \"label\": field.name || field.code,\r\n \"width\": \"unset\",\r\n \"type\": \"text\",\r\n \"className\": \" whitespace-nowrap\",\r\n \"static\": true,\r\n \"options\": null\r\n });\r\n }\r\n })\r\n let schemaApiService = SteedosUI.getRef('steedosPageObjectControl').parent.getComponentById(\"instance_tasks_list_service\");\r\n schemaApiService && schemaApiService.setData({ form_fields: fields, isFlowDataDone: true });\r\n crud.api.sendOn = \"this.isFlowDataDone\";\r\n }\r\n return crud;\r\n });\r\n} else {\r\n let schemaApiService = SteedosUI.getRef('steedosPageObjectControl').parent.getComponentById(\"instance_tasks_list_service\");\r\n schemaApiService && schemaApiService.setData({ isFlowDataDone: true });\r\n crud.api.sendOn = \"this.isFlowDataDone\";\r\n return crud;\r\n}\r\n", - "crud": { - "onEvent": { - "rowClick": { - "actions": [ - { - "actionType": "custom", - "script": "const clientIds = event.data.clientIds || []; clientIds.push(event.data.item._id);doAction({actionType: 'setValue', componentId: 'service_listview_instance_tasks', args: {value: {clientIds: clientIds}}})" - } - ] - } - }, - "id": "u:af8bd61b2b28" - } + "crudDataFilter": "if (data && data.flowId && (data.listName == 'inbox' || 'monitor') && window.innerWidth > 768) {\r\n var api = {\r\n url: \"${context.rootUrl}/graphql\",\r\n method: \"post\",\r\n dataType: \"json\",\r\n data: {\r\n \"query\": '{flow: flows__findOne(id:\"' + data.flowId + '\"){form__expand{current}}}'\r\n },\r\n headers: {\r\n Authorization:\r\n \"Bearer ${context.tenantId},${context.authToken}\",\r\n },\r\n };\r\n return env.fetcher(api).then((result) => {\r\n if (result.data && result.data.flow && result.data.flow.form__expand.current.fields && result.data.flow.form__expand.current.fields.length > 0) {\r\n let fields = result.data.flow.form__expand.current.fields;\r\n fields.forEach(function (field) {\r\n if (field.is_list_display) {\r\n crud.columns.push({\r\n \"name\": \"instance__expand.values.\" + field.code,\r\n \"label\": field.name || field.code,\r\n \"width\": \"unset\",\r\n \"type\": \"text\",\r\n \"className\": \" whitespace-nowrap\",\r\n \"static\": true,\r\n \"options\": null\r\n });\r\n }\r\n })\r\n let schemaApiService = SteedosUI.getRef('steedosPageObjectControl').parent.getComponentById(\"instance_tasks_list_service\");\r\n schemaApiService && schemaApiService.setData({ form_fields: fields, isFlowDataDone: true });\r\n crud.api.sendOn = \"this.isFlowDataDone\";\r\n }\r\n return crud;\r\n });\r\n} else {\r\n let schemaApiService = SteedosUI.getRef('steedosPageObjectControl').parent.getComponentById(\"instance_tasks_list_service\");\r\n schemaApiService && schemaApiService.setData({ isFlowDataDone: true });\r\n crud.api.sendOn = \"this.isFlowDataDone\"; if(data.display == 'split'){Object.assign(crud, {\"onEvent\":{\"rowClick\":{\"actions\":[{\"actionType\":\"custom\",\"script\":\"const clientIds = event.data.clientIds || []; clientIds.push(event.data.item._id);doAction({actionType: 'setValue', componentId: 'service_listview_instance_tasks', args: {value: {clientIds: clientIds}}})\"}]}},\"id\":\"u:af8bd61b2b28\"});} ; \r\n return crud;\r\n}\r\n" }, { "type": "action",