|
@@ -1,5 +1,4 @@
|
|
|
import { $httpWithMsg } from "../../plugins/axios";
|
|
|
-import Vue from "vue";
|
|
|
import { QUESTION_API } from "@/constants/constants.js";
|
|
|
|
|
|
export const questionTeacherQueryApi = () => {
|
|
@@ -11,18 +10,23 @@ export const courseQueryApi = (name) => {
|
|
|
});
|
|
|
};
|
|
|
// card-mamage
|
|
|
-export const cardListApi = (datas, { pageNo, pageSize }) => {
|
|
|
- return $httpWithMsg.get(`${QUESTION_API}/card-list/${pageNo}/${pageSize}`, {
|
|
|
+export const cardListApi = (datas) => {
|
|
|
+ return $httpWithMsg.post(`${QUESTION_API}/card/page`, {
|
|
|
params: datas,
|
|
|
});
|
|
|
};
|
|
|
-export const cardDeleteApi = (cardId) => {
|
|
|
- return $httpWithMsg.get(QUESTION_API + "/card-list", {
|
|
|
- params: { id: cardId },
|
|
|
+export const cardDeleteApi = (ids) => {
|
|
|
+ return $httpWithMsg.post(QUESTION_API + "/card/delete", {
|
|
|
+ params: { ids },
|
|
|
+ });
|
|
|
+};
|
|
|
+export const cardDownloadApi = (ids) => {
|
|
|
+ return $httpWithMsg.post(QUESTION_API + "/card/download", {
|
|
|
+ params: { ids },
|
|
|
});
|
|
|
};
|
|
|
export const cardEnableApi = ({ id, enable }) => {
|
|
|
- return $httpWithMsg.get(QUESTION_API + "/card-list", {
|
|
|
+ return $httpWithMsg.post(QUESTION_API + "/card/toggle", {
|
|
|
params: { id, enable },
|
|
|
});
|
|
|
};
|
|
@@ -30,55 +34,68 @@ export const cardUpdateApi = (datas) => {
|
|
|
return $httpWithMsg.post(QUESTION_API + "/card-list", datas);
|
|
|
};
|
|
|
// card-head-manage
|
|
|
-export const cardHeadListApi = (datas, { pageNo, pageSize }) => {
|
|
|
- return $httpWithMsg.get(`${QUESTION_API}/card-list/${pageNo}/${pageSize}`, {
|
|
|
+export const cardHeadListApi = (datas) => {
|
|
|
+ return $httpWithMsg.post(`${QUESTION_API}/card/head/page`, {
|
|
|
params: datas,
|
|
|
});
|
|
|
};
|
|
|
-export const cardHeadDeleteApi = (cardHeadId) => {
|
|
|
- return $httpWithMsg.get(QUESTION_API + "/card-list", {
|
|
|
- params: { id: cardHeadId },
|
|
|
+export const cardHeadDeleteApi = (ids) => {
|
|
|
+ return $httpWithMsg.post(QUESTION_API + "/card/head/delete", {
|
|
|
+ params: { ids },
|
|
|
});
|
|
|
};
|
|
|
export const cardHeadDetailApi = (cardHeadId) => {
|
|
|
- return $httpWithMsg.get(QUESTION_API + "/card-list", {
|
|
|
+ return $httpWithMsg.post(QUESTION_API + "/card/head/find", {
|
|
|
params: { id: cardHeadId },
|
|
|
});
|
|
|
};
|
|
|
export const cardHeadUpdateApi = (datas) => {
|
|
|
- return $httpWithMsg.post(QUESTION_API + "/card-list", datas);
|
|
|
+ return $httpWithMsg.post(QUESTION_API + "/card/head/save", datas);
|
|
|
};
|
|
|
export const cardHeadEnableApi = ({ id, enable }) => {
|
|
|
- return $httpWithMsg.get(QUESTION_API + "/card-list", {
|
|
|
+ return $httpWithMsg.post(QUESTION_API + "/card/head/toggle", {
|
|
|
params: { id, enable },
|
|
|
});
|
|
|
};
|
|
|
+export const cardTemplateListApi = () => {
|
|
|
+ return $httpWithMsg.post(QUESTION_API + "/card/template/list", {});
|
|
|
+};
|
|
|
|
|
|
// card-edit
|
|
|
export const cardConfigInfos = () => {
|
|
|
- return Promise.resolve({
|
|
|
- id: "173438690998091776",
|
|
|
- createId: "173437828976345088",
|
|
|
- createTime: 1632291806278,
|
|
|
- updateId: null,
|
|
|
- updateTime: 1632291806278,
|
|
|
- name: "测试题卡规则1-版头名称",
|
|
|
- cardTitle: "测试题卡规则1-题卡标题",
|
|
|
- attention:
|
|
|
- "测试题卡规则1-注意事项\n测试题卡规则1-注意事项\n测试题卡规则1-注意事项",
|
|
|
- objectiveAttention: "测试题卡规则1-客观题-注意事项",
|
|
|
- subjectiveAttention: "测试题卡规则1-主观题-注意事项",
|
|
|
- templateType: "GRADUATE",
|
|
|
+ return $httpWithMsg.post(QUESTION_API + "/card/head/get", {});
|
|
|
+
|
|
|
+ // return Promise.resolve({
|
|
|
+ // id: "173438690998091776",
|
|
|
+ // createId: "173437828976345088",
|
|
|
+ // createTime: 1632291806278,
|
|
|
+ // updateId: null,
|
|
|
+ // updateTime: 1632291806278,
|
|
|
+ // name: "测试题卡规则1-版头名称",
|
|
|
+ // cardTitle: "测试题卡规则1-题卡标题",
|
|
|
+ // attention:
|
|
|
+ // "测试题卡规则1-注意事项\n测试题卡规则1-注意事项\n测试题卡规则1-注意事项",
|
|
|
+ // objectiveAttention: "测试题卡规则1-客观题-注意事项",
|
|
|
+ // subjectiveAttention: "测试题卡规则1-主观题-注意事项",
|
|
|
+ // templateType: "GRADUATE",
|
|
|
+ // });
|
|
|
+};
|
|
|
+export const cardDetail = (cardId) => {
|
|
|
+ return $httpWithMsg.post(QUESTION_API + "/card/find", {
|
|
|
+ params: { id: cardId },
|
|
|
});
|
|
|
};
|
|
|
-export const cardDetail = () => {
|
|
|
- const cardData = Vue.ls.get("cardData", {});
|
|
|
- return Promise.resolve(cardData);
|
|
|
+export const cardDetailByPaperId = (paperId) => {
|
|
|
+ return $httpWithMsg.post(QUESTION_API + "/card/paper", {
|
|
|
+ params: { paperId },
|
|
|
+ });
|
|
|
};
|
|
|
|
|
|
export const saveCard = (datas) => {
|
|
|
- window.sessionStorage.setItem("cardData", JSON.stringify(datas));
|
|
|
- return Promise.resolve("11");
|
|
|
+ return $httpWithMsg.post(QUESTION_API + "/card/save/structure", datas);
|
|
|
+};
|
|
|
+export const saveCardByPaper = (datas) => {
|
|
|
+ return $httpWithMsg.post(QUESTION_API + "/card/save/paper", datas);
|
|
|
};
|
|
|
export const paperDetailApi = (paperId) => {
|
|
|
return $httpWithMsg.get(`${QUESTION_API}/paper/${paperId}`, {});
|