阅行客电子档案
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

392 lines
12 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="app-container category-container">
  3. <div class="container-main">
  4. <div class="elect-cont-left">
  5. <div class="container-left">
  6. <span class="right-top-line" />
  7. <span class="left-bottom-line" />
  8. <div class="user-content">
  9. <h4 class="info-title">个人信息</h4>
  10. <div class="el-upload">
  11. <div class="user-img-cover">
  12. <img :src="user.avatarName ? baseApi + '/avatar/' + user.avatarName : Avatar" title="点击上传头像" class="avatar" :onerror="defaultImg" @click="toggleShow">
  13. </div>
  14. <myUpload
  15. v-model="show"
  16. :headers="headers"
  17. :url="updateAvatarApi"
  18. @crop-upload-success="cropUploadSuccess"
  19. />
  20. </div>
  21. <ul class="user-info">
  22. <li><p><i class="iconfont icon-zhanghao" />账号</p><div class="user-right">{{ user.username }}</div></li>
  23. <li><p><i class="iconfont icon-yonghuming" style="font-size: 13px;" />用户名</p><div class="user-right">{{ user.nickName }}</div></li>
  24. <li><p><i class="iconfont icon-xingbie" />性别</p><div class="user-right">{{ user.gender ? user.gender : '-' }}</div></li>
  25. <li><p><i class="iconfont icon-yonghujiaose" style="font-size: 12px;" />用户角色</p><div class="user-right"><span v-for="item in user.roles" :key="item.id">{{ item.name }}</span></div></li>
  26. <li><p><i class="iconfont icon-suoshuquanzong" />所属全宗</p><div class="user-right">{{ user.fonds ? user.fonds.fondsName : '/' }}</div></li>
  27. <li><p><i class="iconfont icon-suoshubumen" />所属部门</p><div class="user-right">{{ user.dept ? user.dept.deptsName : '/' }}</div></li>
  28. <li><p><i class="iconfont icon-shoujihaoma" />手机号码</p><div class="user-right">{{ user.email ? user.phone : '-' }}</div></li>
  29. <li><p><i class="iconfont icon-yonghuyouxiang" style="font-size: 12px;" />用户邮箱</p><div class="user-right">{{ user.email ? user.email : '-' }}</div></li>
  30. <li><p><i class="iconfont icon-yanzhengma" />安全设置</p><div class="user-right"><a @click="$refs.pass.dialog = true">修改密码</a></div></li>
  31. </ul>
  32. </div>
  33. </div>
  34. </div>
  35. <div class="elect-cont-right">
  36. <div class="container-right tab-content">
  37. <span class="right-top-line" />
  38. <span class="left-bottom-line" />
  39. <ul class="tab-nav">
  40. <li :class="{'active-tab-nav': activeIndex == 0}" @click="handleClick(0)">用户资料<i /></li>
  41. <li :class="{'active-tab-nav': activeIndex == 1}" @click="handleClick(1)">消息中心<i /></li>
  42. <li :class="{'active-tab-nav': activeIndex == 2}" @click="handleClick(2)">流程中心<i /></li>
  43. <li :class="{'active-tab-nav': activeIndex == 3}" @click="handleClick(3)">操作日志<i /></li>
  44. <!-- 最右侧装饰img -->
  45. <span class="tab-right-img" />
  46. </ul>
  47. <div v-if="activeIndex == 0" class="tab-item">
  48. <el-form ref="form" class="tab-form" :model="form" :rules="rules" size="small" label-width="100px">
  49. <el-form-item label="用户名" prop="nickName">
  50. <el-input v-model="form.nickName" style="width: 324px" />
  51. <span class="form-tip">用户昵称不作为登录使用</span>
  52. </el-form-item>
  53. <el-form-item label="手机号码" prop="phone">
  54. <el-input v-model="form.phone" style="width: 324px" />
  55. <span class="form-tip">手机号码不能重复</span>
  56. </el-form-item>
  57. <el-form-item label="用户邮箱" prop="email">
  58. <el-input v-model="form.email" style="width: 324px" />
  59. </el-form-item>
  60. <el-form-item label="性别" prop="gender">
  61. <el-radio-group v-model="form.gender" style="width: 178px">
  62. <el-radio label="男"></el-radio>
  63. <el-radio label="女"></el-radio>
  64. </el-radio-group>
  65. </el-form-item>
  66. <el-form-item>
  67. <el-button class="user-submit" :loading="saveLoading" size="mini" type="primary" @click="doSubmit">保存</el-button>
  68. </el-form-item>
  69. </el-form>
  70. </div>
  71. <!-- 消息中心 -->
  72. <div v-if="activeIndex == 1" class="tab-item">
  73. <messageCenter />
  74. </div>
  75. <!-- 流程中心 -->
  76. <processCenter v-if="activeIndex == 2" />
  77. <!-- 操作日志 -->
  78. <div v-if="activeIndex == 3" class="tab-item" style="padding-left: 20px;">
  79. <OperateLog :is-center="isCenter" />
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. <updateEmail ref="email" :email="user.email" />
  85. <updatePass ref="pass" />
  86. </div>
  87. </template>
  88. <script>
  89. import myUpload from 'vue-image-crop-upload/upload-2.vue'
  90. import { mapGetters } from 'vuex'
  91. import updatePass from './center/updatePass'
  92. import updateEmail from './center/updateEmail'
  93. import { getToken } from '@/utils/auth'
  94. import store from '@/store'
  95. import { isvalidPhone } from '@/utils/validate'
  96. import crud from '@/mixins/crud'
  97. import { editUser } from '@/api/system/user'
  98. import Avatar from '@/assets/images/avatar.png'
  99. import messageCenter from './messageCenter/index.vue'
  100. import processCenter from './processCenter/index.vue'
  101. import OperateLog from '@/views/system/log/operateLog/index'
  102. export default {
  103. name: 'Center',
  104. components: { updatePass, updateEmail, myUpload, messageCenter, processCenter, OperateLog },
  105. mixins: [crud],
  106. data() {
  107. // 自定义验证
  108. const validPhone = (rule, value, callback) => {
  109. if (!value) {
  110. callback(new Error('请输入电话号码'))
  111. } else if (!isvalidPhone(value)) {
  112. callback(new Error('请输入正确的11位手机号码'))
  113. } else {
  114. callback()
  115. }
  116. }
  117. return {
  118. defaultImg: 'this.src="' + require('@/assets/images/avatar.png') + '"',
  119. show: false,
  120. Avatar: Avatar,
  121. activeIndex: 0,
  122. saveLoading: false,
  123. headers: {
  124. 'Authorization': getToken()
  125. },
  126. form: {},
  127. query: {
  128. keyword: null,
  129. createTime: []
  130. },
  131. rules: {
  132. nickName: [
  133. { required: true, message: '请输入用户昵称', trigger: 'blur' },
  134. { min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
  135. ],
  136. phone: [
  137. { required: true, trigger: 'blur', validator: validPhone }
  138. ],
  139. gender: [
  140. { required: true, message: '请选择性别', trigger: 'change' }
  141. ]
  142. },
  143. isCenter: true
  144. }
  145. },
  146. computed: {
  147. ...mapGetters([
  148. 'user',
  149. 'updateAvatarApi',
  150. 'baseApi'
  151. ])
  152. },
  153. watch: {
  154. '$route'(val, from) { // 监听到路由(参数)改变
  155. if (this.$route.query) {
  156. this.activeIndex = this.$route.query.activeIndex
  157. }
  158. }
  159. },
  160. created() {
  161. this.form = { userId: this.user.id, nickName: this.user.nickName, gender: this.user.gender, phone: this.user.phone, email: this.user.email }
  162. store.dispatch('GetInfo').then(() => {})
  163. if (this.$route.query) {
  164. this.activeIndex = this.$route.query.activeIndex
  165. }
  166. },
  167. methods: {
  168. toggleShow() {
  169. this.show = !this.show
  170. },
  171. handleClick(index) {
  172. this.activeIndex = index
  173. if (this.activeIndex === 2) {
  174. this.init()
  175. }
  176. },
  177. beforeInit() {
  178. this.url = 'api/logs/user'
  179. return true
  180. },
  181. cropUploadSuccess(jsonData, field) {
  182. store.dispatch('GetInfo').then(() => {})
  183. },
  184. doSubmit() {
  185. if (this.$refs['form']) {
  186. this.$refs['form'].validate((valid) => {
  187. if (valid) {
  188. this.saveLoading = true
  189. editUser(this.form).then(() => {
  190. this.editSuccessNotify()
  191. store.dispatch('GetInfo').then(() => {})
  192. this.saveLoading = false
  193. }).catch(() => {
  194. this.saveLoading = false
  195. })
  196. }
  197. })
  198. }
  199. }
  200. }
  201. }
  202. </script>
  203. <style lang="scss" scoped>
  204. @import "~@/assets/styles/mixin.scss";
  205. .app-container{
  206. margin: 0 20px !important;
  207. }
  208. @mixin info-title-style{
  209. [data-theme="dark"] & {
  210. color: #fff;
  211. background-color: #02255F;
  212. }
  213. [data-theme="light"] & {
  214. color: #0C0E1E;
  215. border-bottom: 1px solid #EDEFF3;
  216. }
  217. }
  218. .container-main{
  219. position: relative;
  220. margin-top: 90px;
  221. z-index: 9;
  222. }
  223. .operateLog-main{
  224. height: calc(100vh - 300px);
  225. }
  226. .elect-cont-left{
  227. width: 368px !important;
  228. padding: 0 !important;
  229. }
  230. [data-theme=dark] .elect-cont-left .container-left{
  231. min-height: calc(100vh - 247px) !important;
  232. }
  233. [data-theme=dark] .elect-cont-right .container-right {
  234. min-height: calc(100vh - 288px) !important;
  235. }
  236. [data-theme=light] .elect-cont-right {
  237. padding: 20px 20px 0 0 !important;
  238. }
  239. [data-theme=light] .elect-cont-left .container-left{
  240. min-height: calc(100vh - 260px) !important;
  241. }
  242. [data-theme=light] .elect-cont-right .container-right {
  243. min-height: calc(100vh - 250px) !important;
  244. }
  245. [data-theme=dark] .category-container .tab-content .head-container{
  246. margin: 20px 0 !important;
  247. }
  248. .user-content{
  249. color: #fff;
  250. .iconfont{
  251. margin-right: 12px;
  252. }
  253. }
  254. .info-title{
  255. height: 56px;
  256. line-height: 56px;
  257. font-size: 16px;
  258. font-weight: bold;
  259. text-align: center;
  260. @include info-title-style;
  261. }
  262. .el-upload{
  263. display: block;
  264. width: 148px;
  265. height: 148px;
  266. border-radius: 50%;
  267. margin: 40px auto 60px auto;
  268. overflow: hidden;
  269. .user-img-cover{
  270. width: 148px;
  271. height: 148px;
  272. line-height: 148px;
  273. }
  274. .avatar {
  275. width: 100%;
  276. height: 100%;
  277. }
  278. }
  279. @mixin user-info-list-style{
  280. [data-theme="dark"] & {
  281. color: #fff;
  282. & li{
  283. border-bottom: 1px solid #113D72;
  284. }
  285. & .user-right {
  286. a{
  287. color: #3A99FD;
  288. }
  289. }
  290. }
  291. [data-theme="light"] & {
  292. color: #545B65;
  293. & li{
  294. border-bottom: 1px solid #F5F9FC;
  295. }
  296. & .user-right {
  297. color: #0C0E1E;
  298. a{
  299. color: #0348F3;
  300. }
  301. }
  302. }
  303. }
  304. .user-info {
  305. padding: 0 20px;
  306. list-style: none;
  307. @include user-info-list-style;
  308. li{
  309. display: flex;
  310. justify-content: space-between;
  311. align-items: center;
  312. font-size: 14px;
  313. // height: 41px;
  314. line-height: 34px;
  315. }
  316. .user-right {
  317. a{
  318. margin-left: 20px;
  319. }
  320. span{
  321. display: block;
  322. text-align: right;
  323. line-height: 30px;
  324. }
  325. }
  326. }
  327. // [data-theme=dark] .tab-item {
  328. // height: calc(100vh - 232px);
  329. // }
  330. [data-theme=light] .tab-item {
  331. // height: calc(100vh - 193px);
  332. ::v-deep .el-form.tab-form{
  333. margin-top: 40px;
  334. }
  335. .user-submit{
  336. color: #fff;
  337. background-color: #0348F3;
  338. }
  339. }
  340. .tab-item{
  341. ::v-deep .el-form{
  342. .el-form-item__label.el-form-item__label{
  343. @include setting-item-font;
  344. }
  345. .form-tip{
  346. margin-left: 11px;
  347. font-size: 12px;
  348. color: #A6ADB6;
  349. }
  350. .user-submit{
  351. width: 76px;
  352. }
  353. }
  354. }
  355. .user-header-search{
  356. margin-bottom: 20px;
  357. .filter-search{
  358. margin-right: 0;
  359. @include btn_blue_style;
  360. &:hover{
  361. @include btn_blue_hover;
  362. }
  363. }
  364. .filter-refresh{
  365. @include btn_white_style;
  366. &:hover{
  367. @include btn_white_hover;
  368. }
  369. }
  370. }
  371. input:-webkit-autofill,
  372. textarea:-webkit-autofill,
  373. select:-webkit-autofill {
  374. -webkit-text-fill-color: #fff !important;
  375. background-color: transparent;
  376. transition: background-color 50000s ease-in-out 0s;
  377. }
  378. input {
  379. background-color: transparent;
  380. }
  381. // .el-pagination{
  382. // margin: 20px 0 10px 0 !important
  383. // }
  384. </style>