From ef307d590b7d27791bce1b594ff16267f9b8f0f4 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期四, 21 三月 2024 17:39:52 +0800
Subject: [PATCH] 调整文件夹路径
---
src/api/fysp/evaluateApi.js | 42 +++++++++++++++++++++++++++++++++++++++---
1 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/src/api/fysp/evaluateApi.js b/src/api/fysp/evaluateApi.js
index 7e61e1f..aef8028 100644
--- a/src/api/fysp/evaluateApi.js
+++ b/src/api/fysp/evaluateApi.js
@@ -1,11 +1,47 @@
+import { Base64 } from 'js-base64';
import { $fysp } from '../index';
export default {
-
/**
* 鑾峰彇鑷姩璇勪及鍘嗗彶璁板綍
*/
- fetchAutoEvaluation(param){
- return $fysp.post(`evaluation/auto/record`, param);
+ fetchAutoEvaluation(param) {
+ return $fysp.post(`evaluation/auto/record`, param).then((res) => res.data);
+ },
+
+ /**
+ * 鏌ヨ璇勪及鎬昏鍒�
+ * @param {Object} param
+ * @returns
+ */
+ fetchEvaluationRule(param) {
+ return $fysp.post(`evaluationrule/find`, param).then((res) => res.data);
+ },
+
+ autoEvaluate(param) {
+ return $fysp.post(`evaluation/auto`, param).then((res) => res.data);
+ },
+
+ downloadAutoEvaluation(param) {
+ return $fysp
+ .post(`evaluation/auto/record/download`, param, { responseType: 'blob' })
+ .then((res) => {
+ // 鏂囨。鏈敓鎴愶紝宸插惎鍔ㄦ枃妗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