阅行客电子档案
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.

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