UserEditModal.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <template>
  2. <div class="modal fade in" role="dialog" aria-hidden="false" style="display: block;" v-if="isVisible">
  3. <div class="modal-dialog x-modal-dialog modal-lg" role="document">
  4. <div class="modal-content">
  5. <!-- tab切换 start-->
  6. <ul class="nav nav-tabs x-nav-tabs x-navbar-right hidden-xs modal-header" role="tablist">
  7. <li :class="{active: showTab === 'apps'}"><a aria-controls="userDetailModal_apps" role="tab" data-toggle="tab" @click="showBindApps()">绑定企业、应用</a></li>
  8. <li :class="{active: showTab === 'default'}"><a aria-controls="userDetailModal_info" role="tab" data-toggle="tab" @click="showTab = 'default'">详细资料</a></li>
  9. <h2 class="hidden-xs">
  10. <i class="fa fa-file-text-o"></i> {{user.realName || '姓名'}}
  11. </h2>
  12. </ul>
  13. <!-- tab切换 end-->
  14. <div role="tabpanel" id="userDetailModal_info" class="x-tab-pane" :class="{active: showTab === 'default'}">
  15. <div class="modal-body">
  16. <div class="x-group-header">
  17. <h4>个人信息</h4>
  18. </div>
  19. <dl class="dl-horizontal x-dl-horizontal">
  20. <dt>姓名</dt>
  21. <dd v-text="user.realName || '姓名'"></dd>
  22. <dt>性别</dt>
  23. <dd>男</dd>
  24. <dt>身份证号</dt>
  25. <dd v-text="user.idCard"></dd>
  26. <dt>出生日期</dt>
  27. <dd></dd>
  28. </dl>
  29. <div class="x-group-header">
  30. <h4>账户安全</h4>
  31. </div>
  32. <dl class="dl-horizontal x-dl-horizontal">
  33. <dt>绑定手机</dt>
  34. <dd>{{user.mobile}}&nbsp;<a class="x-btn-text" href="javascript:void(0)">更换</a></dd>
  35. <dt>绑定邮箱</dt>
  36. <dd v-if="!user.email">&nbsp;<a class="x-btn-text" href="javascript:void(0)">绑定</a></dd>
  37. <dd v-if="user.email">{{user.email}}&nbsp;<a class="x-btn-text" href="javascript:void(0)">更换</a></dd>
  38. </dl>
  39. <!--<div class="x-group-header">
  40. <h4>组织架构</h4>
  41. </div>
  42. <dl class="dl-horizontal x-dl-horizontal">
  43. <dt>部门</dt>
  44. <dd></dd>
  45. <dt>职称</dt>
  46. <dd>管理员</dd>
  47. </dl>-->
  48. </div>
  49. <div class="modal-footer">
  50. <button type="button" class="btn btn-blank x-btn-reset">重置密码</button>
  51. <button type="button" class="btn btn-blank" data-dismiss="modal" @click="isVisible = false">关闭</button>
  52. </div>
  53. </div>
  54. <div role="tabpanel" id="userDetailModal_apps" class="x-tab-pane" :class="{active: showTab === 'apps'}">
  55. <div class="modal-body">
  56. <div class="x-mod x-list x-list-2x" style="margin: -15px">
  57. <div class="x-mod-body">
  58. <div class="x-common-list" id="apps">
  59. <!-- users -->
  60. <div class="x-item" v-for="space in spaces">
  61. <div class="x-icon"><i class="fa fa-file-o"></i></div>
  62. <p>
  63. <span class="x-title text-info">{{space.spaceName}}</span><!--<span
  64. class="pull-right x-text-muted">b2b</span>-->
  65. </p>
  66. <div class="x-text-muted">管理员<span class="pull-right">{{space.spaceUU}}</span></div>
  67. <div class="x-title pull-right"><a type="button"
  68. class="btn btn-blank btn-synchrodata"
  69. onclick="app.synchrodata(170828)">同步数据</a><a
  70. type="button" class="btn btn-blank btn-userpwd" onclick="app.userpwd(170828)">查询密码</a>
  71. </div>
  72. </div>
  73. </div>
  74. <div class="x-empty">
  75. <i class="fa fa-coffee"></i>
  76. <p>还没有绑定任何企业或应用</p>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. <div class="modal-footer">
  82. <button type="button" class="btn btn-blank">添加到企业</button>
  83. <!--<button type="button" class="btn btn-blank">设置为管理员</button>-->
  84. <button type="button" class="btn btn-blank" data-dismiss="modal" @click="isVisible = false">关闭</button>
  85. </div>
  86. </div>
  87. </div>
  88. </div>
  89. </div>
  90. </template>
  91. <script>
  92. import axios from '@/assets/js/axios'
  93. export default {
  94. name: 'UserEditModal',
  95. props: {
  96. visible: Boolean,
  97. user: Object
  98. },
  99. data () {
  100. return {
  101. isVisible: false,
  102. showTab: 'default',
  103. spaces: []
  104. }
  105. },
  106. watch: {
  107. visible: function (value) {
  108. this.isVisible = value
  109. },
  110. isVisible: function (value) {
  111. this.$emit('update:visible', value)
  112. }
  113. },
  114. methods: {
  115. showBindApps () {
  116. const success = spaces => {
  117. this.showTab = 'apps'
  118. this.spaces = spaces
  119. console.log(spaces)
  120. }
  121. const error = response => { console.log('error', response) }
  122. axios.get(`/api/user/${this.user.userUU}/findSpacesByUser`).then(success).catch(error)
  123. }
  124. }
  125. }
  126. </script>
  127. <style scoped>
  128. </style>