From 12af4f5fb8cae34eaecafe4bb4d2f5cedaf637ea Mon Sep 17 00:00:00 2001 From: wangyidong Date: Sat, 13 Jul 2024 10:37:53 +0800 Subject: [PATCH] * [perf story #59018] ajax response gantt drag event for validateResources function for gantt wg. --- lib/zin/wg/gantt/js/v1.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/lib/zin/wg/gantt/js/v1.js b/lib/zin/wg/gantt/js/v1.js index 4cf1891a45..a5194f5530 100644 --- a/lib/zin/wg/gantt/js/v1.js +++ b/lib/zin/wg/gantt/js/v1.js @@ -304,6 +304,26 @@ function validateResources(id) if(type == 'task') itemID = task.id.split("-")[1]; if(type == 'plan') itemID = task.id; if(type == 'point') itemID = task.id.split("-")[2]; - + let postData = { + 'id' : itemID, + 'startDate' : from.toLocaleDateString('en-CA'), + 'endDate' : to.toLocaleDateString('en-CA'), + 'type' : type + }; + $.ajax({ + url: $.createLink('programplan', 'ajaxResponseGanttDragEvent'), + dataType: "json", + async: false, + data: postData, + type: "post", + success: function(response) + { + if(response.result == 'fail' && response.message) + { + zui.Messager.show({content: response.message, type: 'danger-outline', icon: 'exclamation-sign'}); + flag = false; + } + } + }); return flag; }