roleManage.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <template>
  2. <div class="record-warp">
  3. <div class="record-main">
  4. <!-- <el-row>
  5. <el-col :span="24">
  6. <div class="search-head">
  7. <span>用户名:</span>
  8. <el-input v-model="name" clearable placeholder="请输入用户名"></el-input
  9. >&nbsp;&nbsp;&nbsp;&nbsp;
  10. <span>用户昵称:</span>
  11. <el-input v-model="userName" clearable placeholder="请输入用户昵称"></el-input
  12. >&nbsp;&nbsp;
  13. <el-button type="primary" icon="el-icon-search" @click="searchTarget"
  14. >搜索</el-button
  15. >
  16. <el-button type="primary" icon="el-icon-delete-solid" @click="clearSearch"
  17. >清空</el-button
  18. >
  19. </div>
  20. </el-col>
  21. </el-row> -->
  22. <div class="table-content">
  23. <el-table
  24. :data="tableData"
  25. :row-style="{ height: '0px' }"
  26. :cell-style="{ padding: '5px' }"
  27. >
  28. <!-- <el-table-column prop="name" label="姓名" align="center" width="" show-overflow-tooltip>
  29. </el-table-column> -->
  30. <el-table-column
  31. prop="roleName"
  32. label="角色名称"
  33. align="center"
  34. width=""
  35. ></el-table-column>
  36. <el-table-column
  37. prop="roleId"
  38. label="角色编码"
  39. align="center"
  40. width=""
  41. :formatter="formatterRole"
  42. show-overflow-tooltip
  43. >
  44. </el-table-column>
  45. </el-table>
  46. </div>
  47. <el-pagination
  48. small
  49. background
  50. @current-change="handleCurrentChange"
  51. :current-page.sync="pageNum"
  52. layout="total, prev, pager, next"
  53. :page-size="pageSize"
  54. :total="total"
  55. >
  56. </el-pagination>
  57. <!-- <el-pagination small background layout="total prev, pager, next" :total="36">
  58. </el-pagination> -->
  59. </div>
  60. </div>
  61. </template>
  62. <script>
  63. import { oSessionStorage } from "../../utils/utils";
  64. export default {
  65. name: "userManage",
  66. components: {},
  67. data() {
  68. return {
  69. centerDialogVisible: false,
  70. editUserFlag: false,
  71. startTime: "",
  72. endTime: "",
  73. value1: null,
  74. total: 2,
  75. pageSize: 10,
  76. pageNum: 1,
  77. keyword: "",
  78. tableData: [],
  79. userInfo: {}, //用户信息
  80. userId: "", //用户id
  81. name: "", //根据名称搜索
  82. userName: "", //根据昵称搜索
  83. hospitalOrDepartment: "", //医院科室
  84. invitationCode: "",
  85. roleType: "0",
  86. type: 0,
  87. view: {
  88. name: "",
  89. userName: "",
  90. channelId: "",
  91. role: "",
  92. },
  93. };
  94. },
  95. created() {},
  96. mounted() {
  97. this.userInfo = JSON.parse(oSessionStorage.getItem("userInfo"));
  98. this.invitationCode = this.userInfo.invitationCode;
  99. //判断是超级管理员吗
  100. if (this.userInfo.roleType == "1") {
  101. this.type = 0;
  102. } else if (this.userInfo.roleType == "3") {
  103. //如果登录的是代理用户
  104. this.type = 4;
  105. } else if (this.userInfo.roleType == "2") {
  106. this.type = 5;
  107. }
  108. if (this.$route.query.invitationCode) {
  109. this.invitationCode = this.$route.query.invitationCode;
  110. this.type = this.$route.query.type;
  111. }
  112. if (!this.userInfo) {
  113. //如果用户信息不存在跳转登陆页
  114. this.$router.push({ path: "/" });
  115. }
  116. this.searchTarget();
  117. },
  118. methods: {
  119. handleCurrentChange(val) {
  120. this.pageNum = val;
  121. this.searchList();
  122. },
  123. //根据现有情况进行搜索
  124. searchList() {
  125. // let url =``
  126. this.$http.get(`/role/find`, {}, (res) => {
  127. // console.log(res,'用户测试记录')
  128. if (res && res.code == 200) {
  129. this.tableData = res.data;
  130. } else {
  131. // this.$toast.fail(res.msg);
  132. this.$message.error(res.msg);
  133. }
  134. });
  135. },
  136. searchTarget() {
  137. this.pageNum = 1;
  138. this.searchList();
  139. },
  140. //跳转首页
  141. goHome() {
  142. this.$router.push({ path: "/home" });
  143. },
  144. //跳转记录页
  145. goRecord() {
  146. this.$router.push({ path: "/record" });
  147. },
  148. //退出登陆
  149. logout() {
  150. oSessionStorage.removeItem("userInfo");
  151. oSessionStorage.removeItem("token");
  152. this.$router.push({ path: "/" });
  153. },
  154. //点击日历获取日期
  155. getDate(param) {
  156. // console.log(param,"日期。。。")
  157. this.userRecord(param.dateStr);
  158. },
  159. //点击获取月出勤次数
  160. getTimes(param) {
  161. this.monthTimes = param;
  162. },
  163. // 用户测试记录显示
  164. userRecord(date) {
  165. this.$http.get(
  166. `gameRecord/findListByUserIdAndDate/${this.userId}/${date}`,
  167. {},
  168. (res) => {
  169. // console.log(res,'用户测试记录')
  170. if (res && res.code == 200) {
  171. this.listData = res.data;
  172. } else {
  173. this.$toast.fail(res.msg);
  174. }
  175. }
  176. );
  177. },
  178. },
  179. };
  180. </script>
  181. <style lang="less" scoped>
  182. @import "../../styles/theme.less";
  183. .record-warp {
  184. width: 100%;
  185. height: 80vh;
  186. //background: url(../../assets/img/index/19.png) no-repeat center;
  187. //background-size: 100% 100%;
  188. position: relative;
  189. .record-main {
  190. width: 100%;
  191. height: 100%;
  192. box-sizing: border-box;
  193. overflow-y: auto;
  194. .search-head {
  195. width: 100%;
  196. display: flex;
  197. flex-direction: row;
  198. justify-content: flex-start;
  199. align-items: center;
  200. .zc-title {
  201. color: #606266;
  202. font-size: 14px;
  203. }
  204. }
  205. .table-content {
  206. margin: 10px 0;
  207. }
  208. }
  209. }
  210. .add_user_class {
  211. margin-top: 10px;
  212. }
  213. .user_out {
  214. display: flex;
  215. width: 100%;
  216. align-items: center;
  217. border: 1px solid #eeeeef;
  218. line-height: 50px;
  219. margin-top: 10px;
  220. }
  221. .user_out_sub {
  222. flex: 1;
  223. background-color: #fafafa;
  224. text-align: center;
  225. // color:#ffffff
  226. }
  227. .user_out_subNext {
  228. padding-left: 10px;
  229. flex: 3;
  230. }
  231. </style>