user_teacher.js 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. import request from '@/utils/request'
  2. import { praseStrEmpty } from "@/utils/ruoyi";
  3. // 查询用户列表
  4. export function listUser(query) {
  5. return request({
  6. url: '/system/user/teacher/list',
  7. method: 'get',
  8. params: query
  9. })
  10. }
  11. // 查询教职工下拉列表
  12. export function optionUser(data) {
  13. return request({
  14. url: '/system/user/teacher/option',
  15. method: 'post',
  16. data: data
  17. })
  18. }
  19. // 查询用户详细
  20. export function getUser(userId) {
  21. return request({
  22. url: '/system/user/teacher/' + praseStrEmpty(userId),
  23. method: 'get'
  24. })
  25. }
  26. // 新增用户
  27. export function addUser(data) {
  28. return request({
  29. url: '/system/user/teacher',
  30. method: 'post',
  31. data: data
  32. })
  33. }
  34. // 修改用户
  35. export function updateUser(data) {
  36. return request({
  37. url: '/system/user/teacher',
  38. method: 'put',
  39. data: data
  40. })
  41. }
  42. // 删除用户
  43. export function delUser(userId) {
  44. return request({
  45. url: '/system/user/teacher/' + userId,
  46. method: 'delete'
  47. })
  48. }
  49. // 用户密码重置
  50. export function resetUserPwd(userId, password) {
  51. const data = {
  52. userId,
  53. password
  54. }
  55. return request({
  56. url: '/system/user/teacher/resetPwd',
  57. method: 'put',
  58. data: data
  59. })
  60. }
  61. // 用户状态修改
  62. export function changeUserStatus(userId, status) {
  63. const data = {
  64. userId,
  65. status
  66. }
  67. return request({
  68. url: '/system/user/teacher/changeStatus',
  69. method: 'put',
  70. data: data
  71. })
  72. }
  73. // 查询用户个人信息
  74. export function getUserProfile() {
  75. return request({
  76. url: '/system/user/teacher/profile',
  77. method: 'get'
  78. })
  79. }
  80. // 修改用户个人信息
  81. export function updateUserProfile(data) {
  82. return request({
  83. url: '/system/user/teacher/profile',
  84. method: 'put',
  85. data: data
  86. })
  87. }
  88. // 用户密码重置
  89. export function updateUserPwd(oldPassword, newPassword) {
  90. const data = {
  91. oldPassword,
  92. newPassword
  93. }
  94. return request({
  95. url: '/system/user/teacher/profile/updatePwd',
  96. method: 'put',
  97. params: data
  98. })
  99. }
  100. // 用户头像上传
  101. export function uploadAvatar(data) {
  102. return request({
  103. url: '/system/user/teacher/profile/avatar',
  104. method: 'post',
  105. data: data
  106. })
  107. }
  108. // 查询授权角色
  109. export function getAuthRole(userId) {
  110. return request({
  111. url: '/system/user/teacher/authRole/' + userId,
  112. method: 'get'
  113. })
  114. }
  115. // 保存授权角色
  116. export function updateAuthRole(data) {
  117. return request({
  118. url: '/system/user/teacher/authRole',
  119. method: 'put',
  120. params: data
  121. })
  122. }
  123. //教职工启用停用接口
  124. export function putUserTeacher(data) {
  125. return request({
  126. url: '/system/user/teacher',
  127. method: 'put',
  128. data: data
  129. })
  130. }
  131. //删除教职工
  132. export function delTeacher(userId) {
  133. return request({
  134. url: '/system/user/teacher/' + userId,
  135. method: 'delete'
  136. })
  137. }
  138. //重置教职工密码
  139. export function teacherResetPwd(data) {
  140. return request({
  141. url: '/system/user/teacher/resetPwd',
  142. method: 'put',
  143. data: data
  144. })
  145. }
  146. //新增部门
  147. export function addDeptByTeacher(data) {
  148. return request({
  149. url: '/system/dept/addDeptByTeacher',
  150. method: 'post',
  151. data: data
  152. })
  153. }
  154. //编辑部门
  155. export function putDeptByTeacher(data) {
  156. return request({
  157. url: '/system/dept',
  158. method: 'put',
  159. data: data
  160. })
  161. }
  162. //编辑部门名称
  163. export function updateDeptName(data) {
  164. return request({
  165. url: '/system/dept/updateDeptName',
  166. method: 'put',
  167. data: data
  168. })
  169. }
  170. //部门位置移动
  171. export function editDeptOrder(data) {
  172. return request({
  173. url: '/system/dept/editDeptOrder',
  174. method: 'put',
  175. data: data
  176. })
  177. }
  178. //删除部门
  179. export function delDept(deptId) {
  180. return request({
  181. url: '/system/dept/'+deptId,
  182. method: 'delete',
  183. })
  184. }
  185. //部门添加人员
  186. export function editUserByDept(data) {
  187. return request({
  188. url: '/system/user/teacher/editUserByDept',
  189. method: 'put',
  190. data: data
  191. })
  192. }
  193. //查询教师详情接口
  194. export function getTeacherInfo(userId) {
  195. return request({
  196. url: '/system/user/teacher/' + userId,
  197. method: 'get'
  198. })
  199. }
  200. //查询身份列表
  201. export function optionselect(query) {
  202. return request({
  203. url: '/system/post/optionselect',
  204. method: 'get',
  205. params: query
  206. })
  207. }
  208. //字段模糊搜索
  209. export function getVaguet(query) {
  210. return request({
  211. url: '/system/dict/data/getVague',
  212. method: 'get',
  213. params: query
  214. })
  215. }
  216. //根据用户查询权限
  217. export function userPermit(userId) {
  218. return request({
  219. url: '/system/permit/userPermit/'+userId,
  220. method: 'get',
  221. })
  222. }
  223. //新增教职工
  224. export function addUserTeacher(data) {
  225. return request({
  226. url: '/system/user/teacher',
  227. method: 'post',
  228. data:data
  229. })
  230. }
  231. //编辑教职工
  232. export function putUserTeacherNew(data) {
  233. return request({
  234. url: '/system/user/teacher',
  235. method: 'put',
  236. data:data
  237. })
  238. }
  239. //教职工在职离职联动启用停用
  240. export function editNatureLinkage(data) {
  241. return request({
  242. url: '/system/user/teacher/editNatureLinkage',
  243. method: 'put',
  244. data: data
  245. })
  246. }
  247. // 查询部门下拉树结构
  248. export function treeselect(query) {
  249. return request({
  250. url: '/system/dept/treeselect',
  251. method: 'get',
  252. params: query
  253. })
  254. }
  255. //批量获取老师数据
  256. export function teacherBatchSelect(data) {
  257. return request({
  258. url: 'system/user/teacher/batchSelect/'+data,
  259. method: 'post',
  260. })
  261. }
  262. //批量修改老师卡号
  263. export function teacherUpdateCardNum(data) {
  264. return request({
  265. url: '/system/user/teacher/updateCardNum',
  266. method: 'put',
  267. data: data
  268. })
  269. }