From 743044407e35a10ff824ef18cb883ac2b66e2d12 Mon Sep 17 00:00:00 2001 From: riku <risaku@163.com> Date: 星期四, 25 四月 2024 17:40:54 +0800 Subject: [PATCH] 新增自动评估细则界面 --- src/api/fysp/evaluateApi.js | 51 ++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 38 insertions(+), 13 deletions(-) diff --git a/src/api/fysp/evaluateApi.js b/src/api/fysp/evaluateApi.js index 0c75408..3cf5a71 100644 --- a/src/api/fysp/evaluateApi.js +++ b/src/api/fysp/evaluateApi.js @@ -10,6 +10,22 @@ }, /** + * 鏍规嵁宸℃煡浠诲姟鑾峰彇璇勫垎缁嗗垯 + */ + fetchItemEvaluation(subTaskId) { + const params = `?subTaskId=${subTaskId}`; + return $fysp.get(`evaluationsubrule/score${params}`).then((res) => res.data); + }, + + + /** + * 鎵归噺鏇存柊璇勫垎缁嗗垯寰楀垎 + */ + updateItemEvaluation(param) { + return $fysp.post(`itemevaluation/uplist`, param).then((res) => res.data); + }, + + /** * 鏌ヨ璇勪及鎬昏鍒� * @param {Object} param * @returns @@ -22,20 +38,29 @@ return $fysp.post(`evaluation/auto`, param).then((res) => res.data); }, - downloadAutoEvaluation(param) { + /** + * 涓嬭浇瑙勮寖鎬ц瘎浼颁笌鍒嗘瀽鎶ュ憡 + */ + downloadAutoEvaluation(param, forceUpdate) { return $fysp - .post(`evaluation/auto/record/download`, param, { responseType: 'blob' }) + .post(`evaluation/auto/record/download?forceUpdate=${forceUpdate}`, param, { responseType: 'blob' }) .then((res) => { - // return res.data; - const name = Base64.decode(res.headers.get('filename')); - const url = window.URL.createObjectURL(res.data); - const link = document.createElement('a'); - link.href = url; - link.setAttribute('download', name); - document.body.appendChild(link); - link.click(); - document.body.removeChild(link); - window.URL.revokeObjectURL(url); + // 鏂囨。鏈敓鎴愶紝宸插惎鍔ㄦ枃妗g敓鎴愬悗鍙颁换鍔� + if (res.data.type == 'application/json') { + return false + } + // 鏂囨。宸插瓨鍦紝鐩存帴涓嬭浇 + else { + const name = Base64.decode(res.headers.get('filename')); + const url = window.URL.createObjectURL(res.data); + const link = document.createElement('a'); + link.href = url; + link.setAttribute('download', name); + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); + window.URL.revokeObjectURL(url); + } }); - }, + } }; -- Gitblit v1.9.3