api.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { $httpWithMsg } from "../../plugins/axios";
  2. import { QUESTION_API } from "@/constants/constants.js";
  3. // paper-template-mamage
  4. export const paperTemplatePageListApi = (datas) => {
  5. return $httpWithMsg.post(
  6. `${QUESTION_API}/paper_template/page`,
  7. {},
  8. { params: datas }
  9. );
  10. };
  11. export const paperTemplateListApi = (exportTemplateType) => {
  12. return $httpWithMsg.post(
  13. `${QUESTION_API}/paper_template/list`,
  14. {},
  15. {
  16. params: { exportTemplateType },
  17. }
  18. );
  19. };
  20. export const paperTemplateDetailApi = (tid) => {
  21. return $httpWithMsg.post(
  22. `${QUESTION_API}/paper_template/find_by_id`,
  23. {},
  24. {
  25. params: { id: tid },
  26. }
  27. );
  28. };
  29. export const savePaperTemplateApi = (datas) => {
  30. return $httpWithMsg.post(QUESTION_API + "/paper_template/save", datas);
  31. };
  32. export const paperTemplateEnableApi = ({ id, enable }) => {
  33. return $httpWithMsg.post(
  34. QUESTION_API + "/paper_template/enable",
  35. {},
  36. {
  37. params: { id, enable },
  38. }
  39. );
  40. };
  41. export const paperTemplateDeleteApi = (ids) => {
  42. return $httpWithMsg.post(
  43. QUESTION_API + "/paper_template/delete",
  44. {},
  45. {
  46. params: { idList: ids.join() },
  47. }
  48. );
  49. };
  50. export const paperPdfDownloadApi = (datas) => {
  51. return $httpWithMsg.post(QUESTION_API + "/paper/download_pdf", datas, {
  52. responseType: "blob",
  53. });
  54. };