|
|
@@ -23,7 +23,11 @@
|
|
|
@change="onUpload"
|
|
|
>
|
|
|
</div>
|
|
|
- <div class="u-bold">{{ name }}</div>
|
|
|
+ <div class="c-profile__name has-top-padding">{{ name }}</div>
|
|
|
+ <div class="u-relative has-top-padding">
|
|
|
+ <i class="el-icon-user" />
|
|
|
+ {{ role }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div
|
|
|
v-loading="loading"
|
|
|
@@ -35,46 +39,72 @@
|
|
|
/>
|
|
|
<div
|
|
|
v-else
|
|
|
- class="c-grid-form mini has-padding"
|
|
|
+ class="has-padding"
|
|
|
>
|
|
|
- <span class="c-grid-form__label">手机:</span>
|
|
|
- <div>
|
|
|
- <el-input
|
|
|
- v-model="phone"
|
|
|
- maxlength="11"
|
|
|
- @change="onPhoneChange"
|
|
|
- @keydown.enter="$event.target.blur()"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <span class="c-grid-form__label">邮箱:</span>
|
|
|
- <div>
|
|
|
- <el-input
|
|
|
- v-model="email"
|
|
|
- maxlength="50"
|
|
|
- @change="onEmailChange"
|
|
|
- @keydown.enter="$event.target.blur()"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div class="c-grid-form__label" />
|
|
|
<div class="l-flex--row">
|
|
|
- <i class="o-wechat" />
|
|
|
- <div
|
|
|
- class="has-padding u-pointer"
|
|
|
- :class="color"
|
|
|
- @click="onClickWechat"
|
|
|
- >
|
|
|
- {{ tip }}
|
|
|
+ <label class="c-grid-form__label">手机:</label>
|
|
|
+ <div>
|
|
|
+ <el-input
|
|
|
+ v-model="phone"
|
|
|
+ maxlength="11"
|
|
|
+ @change="onPhoneChange"
|
|
|
+ @keydown.enter="$event.target.blur()"
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="c-grid-form__label" />
|
|
|
- <div class="l-flex--row">
|
|
|
- <i class="o-wechat" />
|
|
|
- <div
|
|
|
- class="has-padding u-pointer"
|
|
|
- :class="appletColor"
|
|
|
- @click="onClickApplet"
|
|
|
- >
|
|
|
- {{ appletTip }}
|
|
|
+ <div class="l-flex--row has-padding--v">
|
|
|
+ <label class="c-grid-form__label">邮箱:</label>
|
|
|
+ <div>
|
|
|
+ <el-input
|
|
|
+ v-model="email"
|
|
|
+ maxlength="50"
|
|
|
+ @change="onEmailChange"
|
|
|
+ @keydown.enter="$event.target.blur()"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="l-flex--row has-top-padding">
|
|
|
+ <div class="o-app">
|
|
|
+ <i class="o-icon wechat has-bg" />
|
|
|
+ <template v-if="wechat">
|
|
|
+ <div class="l-flex--row">
|
|
|
+ <div class="c-sibling-item u-color--info light">已绑定</div>
|
|
|
+ <div
|
|
|
+ class="c-sibling-item u-pointer"
|
|
|
+ @click="onClickWechat"
|
|
|
+ >
|
|
|
+ 解绑
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div
|
|
|
+ v-else
|
|
|
+ class="u-pointer"
|
|
|
+ @click="onClickWechat"
|
|
|
+ >
|
|
|
+ 绑定微信
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="o-app">
|
|
|
+ <i class="o-icon applet has-bg" />
|
|
|
+ <template v-if="applet">
|
|
|
+ <div class="l-flex--row">
|
|
|
+ <div class="c-sibling-item u-color--info light">已绑定</div>
|
|
|
+ <div
|
|
|
+ class="c-sibling-item u-pointer"
|
|
|
+ @click="onClickApplet"
|
|
|
+ >
|
|
|
+ 解绑
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <div
|
|
|
+ v-else
|
|
|
+ class="u-pointer"
|
|
|
+ @click="onClickApplet"
|
|
|
+ >
|
|
|
+ 绑定小程序
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -87,7 +117,7 @@
|
|
|
>
|
|
|
<div class="c-wechat has-padding">
|
|
|
<div class="l-flex--row center has-bottom-padding">
|
|
|
- <i class="c-sibling-item o-wechat" />
|
|
|
+ <i class="c-sibling-item o-icon medium wechat has-bg" />
|
|
|
<span class="c-sibling-item u-color--black u-bold">请使用微信扫一扫</span>
|
|
|
</div>
|
|
|
<div
|
|
|
@@ -107,7 +137,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { mapState } from 'vuex'
|
|
|
+import { mapGetters } from 'vuex'
|
|
|
import {
|
|
|
userinfo,
|
|
|
updateUser,
|
|
|
@@ -146,25 +176,30 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState('user', ['name']),
|
|
|
+ ...mapGetters([
|
|
|
+ 'name',
|
|
|
+ 'isSuperAdmin',
|
|
|
+ 'isTenantAdmin',
|
|
|
+ 'isGroupAdmin'
|
|
|
+ ]),
|
|
|
avatarStyle () {
|
|
|
const avatar = this.avatar
|
|
|
return avatar ? { backgroundImage: `url("${avatar}")` } : null
|
|
|
},
|
|
|
- tip () {
|
|
|
- return this.wechat ? '解除公众号绑定' : '绑定公众号'
|
|
|
- },
|
|
|
- color () {
|
|
|
- return this.wechat ? 'u-color--error' : 'u-color--primary'
|
|
|
- },
|
|
|
- appletTip () {
|
|
|
- return this.applet ? '解除小程序绑定' : '绑定小程序'
|
|
|
- },
|
|
|
- appletColor () {
|
|
|
- return this.applet ? 'u-color--error' : 'u-color--primary'
|
|
|
- },
|
|
|
qrOptions () {
|
|
|
return this[this.qrType]
|
|
|
+ },
|
|
|
+ role () {
|
|
|
+ if (this.isSuperAdmin) {
|
|
|
+ return '超级管理员'
|
|
|
+ }
|
|
|
+ if (this.isTenantAdmin) {
|
|
|
+ return '管理员'
|
|
|
+ }
|
|
|
+ if (this.isGroupAdmin) {
|
|
|
+ return '主管'
|
|
|
+ }
|
|
|
+ return '员工'
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
@@ -457,12 +492,14 @@ export default {
|
|
|
overflow: hidden;
|
|
|
|
|
|
&__header {
|
|
|
- justify-content: space-between;
|
|
|
- height: 140px;
|
|
|
color: #fff;
|
|
|
line-height: 1;
|
|
|
background-color: $blue;
|
|
|
}
|
|
|
+
|
|
|
+ &__name {
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.o-avatar {
|
|
|
@@ -497,11 +534,33 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-.o-wechat {
|
|
|
- display: inline-block;
|
|
|
- width: 32px;
|
|
|
- height: 32px;
|
|
|
- background: url("~@/assets/icon_wechat.png") 0 0 / 100% 100% no-repeat;
|
|
|
+.el-icon-user {
|
|
|
+ position: absolute;
|
|
|
+ left: -32px;
|
|
|
+}
|
|
|
+
|
|
|
+.o-app {
|
|
|
+ display: inline-flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ width: 128px;
|
|
|
+ color: $blue;
|
|
|
+ font-size: 16px;
|
|
|
+
|
|
|
+ .o-icon {
|
|
|
+ margin-bottom: $spacing;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.o-icon {
|
|
|
+ &.wechat {
|
|
|
+ background-image: url("~@/assets/icon_wechat.png");
|
|
|
+ }
|
|
|
+
|
|
|
+ &.applet {
|
|
|
+ background-image: url("~@/assets/icon_applet.png");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
.c-wechat {
|