|
@@ -4,7 +4,6 @@
|
|
|
<van-nav-bar :title="generateTitle()" />
|
|
<van-nav-bar :title="generateTitle()" />
|
|
|
</van-sticky>
|
|
</van-sticky>
|
|
|
<div class="ibps-cell-wrapper ibps-top-wrapper">
|
|
<div class="ibps-cell-wrapper ibps-top-wrapper">
|
|
|
-
|
|
|
|
|
<!-- <van-card
|
|
<!-- <van-card
|
|
|
:thumb="avatar"
|
|
:thumb="avatar"
|
|
|
:desc="org||$t('common.company')"
|
|
:desc="org||$t('common.company')"
|
|
@@ -20,19 +19,46 @@
|
|
|
<van-tag plain size="large" type="primary">{{ position }}</van-tag>
|
|
<van-tag plain size="large" type="primary">{{ position }}</van-tag>
|
|
|
</template>
|
|
</template>
|
|
|
</van-card> -->
|
|
</van-card> -->
|
|
|
- <van-card :thumb="avatar" :desc="org||$t('common.company')" centered @click="userInfo()">
|
|
|
|
|
- <div slot="title" class="ibps-user-title">
|
|
|
|
|
|
|
+ <van-card
|
|
|
|
|
+ :thumb="avatar"
|
|
|
|
|
+ :desc="org || $t('common.company')"
|
|
|
|
|
+ centered
|
|
|
|
|
+ @click="userInfo()"
|
|
|
|
|
+ >
|
|
|
|
|
+ <div slot="title" class="ibps-user-title marginDistance">
|
|
|
<span class="ibps-user-title__name">{{ userName }}</span>
|
|
<span class="ibps-user-title__name">{{ userName }}</span>
|
|
|
- <van-tag v-if="position" plain :size="size" type="primary">{{ position }}</van-tag>
|
|
|
|
|
|
|
+ <van-tag v-if="position" plain :size="size" type="primary">
|
|
|
|
|
+ {{ position }}
|
|
|
|
|
+ </van-tag>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div slot="desc" class="ibps-user-desc alignCenter">
|
|
|
|
|
+ <span>当前部门:</span>
|
|
|
|
|
+ <!-- <van-tag v-if="position" plain type="primary"> -->
|
|
|
|
|
+ {{ mainPositionName }}
|
|
|
|
|
+ <!-- </van-tag> -->
|
|
|
|
|
+ <van-icon
|
|
|
|
|
+ name="replay"
|
|
|
|
|
+ color="#1989fa"
|
|
|
|
|
+ size="0.9em"
|
|
|
|
|
+ style="margin-left:3px"
|
|
|
|
|
+ @click.stop.prevent="onReplay"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
<div slot="desc" class="ibps-user-desc">
|
|
<div slot="desc" class="ibps-user-desc">
|
|
|
- {{ org||$t('common.company') }}
|
|
|
|
|
|
|
+ <span>所在地点:</span>
|
|
|
|
|
+ {{ org || $t('common.company') }}
|
|
|
</div>
|
|
</div>
|
|
|
</van-card>
|
|
</van-card>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<van-cell-group>
|
|
<van-cell-group>
|
|
|
- <van-cell :title="$t('platform.my.change-password.title')" icon="lock" is-link to="changePassword" :size="size" />
|
|
|
|
|
|
|
+ <van-cell
|
|
|
|
|
+ :title="$t('platform.my.change-password.title')"
|
|
|
|
|
+ icon="lock"
|
|
|
|
|
+ is-link
|
|
|
|
|
+ to="changePassword"
|
|
|
|
|
+ :size="size"
|
|
|
|
|
+ />
|
|
|
<lang-select />
|
|
<lang-select />
|
|
|
</van-cell-group>
|
|
</van-cell-group>
|
|
|
|
|
|
|
@@ -42,7 +68,6 @@
|
|
|
<!-- <van-cell :title="$t('platform.my.about')" icon-prefix="ibps-icon" icon="logo" is-link :size="size"
|
|
<!-- <van-cell :title="$t('platform.my.about')" icon-prefix="ibps-icon" icon="logo" is-link :size="size"
|
|
|
@click="about" /> -->
|
|
@click="about" /> -->
|
|
|
<switch-environment v-if="$nodeEnv === 'development'" />
|
|
<switch-environment v-if="$nodeEnv === 'development'" />
|
|
|
-
|
|
|
|
|
</van-cell-group>
|
|
</van-cell-group>
|
|
|
|
|
|
|
|
<!-- 退出登录 -->
|
|
<!-- 退出登录 -->
|
|
@@ -55,144 +80,199 @@
|
|
|
</van-col>
|
|
</van-col>
|
|
|
</van-row>
|
|
</van-row>
|
|
|
</van-cell-group>
|
|
</van-cell-group>
|
|
|
|
|
+ <!-- 更换主部门 -->
|
|
|
|
|
+ <van-action-sheet
|
|
|
|
|
+ v-model="show"
|
|
|
|
|
+ :actions="actions"
|
|
|
|
|
+ cancel-text="取消"
|
|
|
|
|
+ close-on-click-action
|
|
|
|
|
+ @cancel="onCancel"
|
|
|
|
|
+ @select="onSelect"
|
|
|
|
|
+ />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
- import { mapState } from 'vuex'
|
|
|
|
|
- import defaultImage from '@/assets/images/logo/lc.png'
|
|
|
|
|
- import { getFile } from '@/utils/image'
|
|
|
|
|
- // import LcCard from '@/components/LcCard'
|
|
|
|
|
- import LangSelect from './lang-select'
|
|
|
|
|
- import SwitchEnvironment from '@/views/system/switch-environment'
|
|
|
|
|
- import navbar from '@/mixins/navbar'
|
|
|
|
|
|
|
+import { mapState } from 'vuex'
|
|
|
|
|
+import defaultImage from '@/assets/images/logo/lc.png'
|
|
|
|
|
+import { getFile } from '@/utils/image'
|
|
|
|
|
+// import LcCard from '@/components/LcCard'
|
|
|
|
|
+import LangSelect from './lang-select'
|
|
|
|
|
+import SwitchEnvironment from '@/views/system/switch-environment'
|
|
|
|
|
+import navbar from '@/mixins/navbar'
|
|
|
|
|
|
|
|
- export default {
|
|
|
|
|
- components: {
|
|
|
|
|
- LangSelect,
|
|
|
|
|
- SwitchEnvironment
|
|
|
|
|
- },
|
|
|
|
|
- mixins: [navbar],
|
|
|
|
|
- data() {
|
|
|
|
|
- const { first = '', second = '' } = this.$store.getters.level
|
|
|
|
|
- const { userId, userList = [], deptList = [], menus, userInfo } = this.$store.getters
|
|
|
|
|
- const t1 = deptList.find(i => i.positionId === first) || {}
|
|
|
|
|
- const t2 = deptList.find(i => i.positionId === second) || {}
|
|
|
|
|
- // console.log(first, second, deptList)
|
|
|
|
|
- const locationName = second ? t1.positionName + t2.positionName : t1.positionName
|
|
|
|
|
- return {
|
|
|
|
|
- defaultImage: defaultImage,
|
|
|
|
|
- size: 'large',
|
|
|
|
|
- positionList: [],
|
|
|
|
|
- locationName
|
|
|
|
|
|
|
+export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ LangSelect,
|
|
|
|
|
+ SwitchEnvironment
|
|
|
|
|
+ },
|
|
|
|
|
+ mixins: [navbar],
|
|
|
|
|
+ data() {
|
|
|
|
|
+ const { first = '', second = '' } = this.$store.getters.level
|
|
|
|
|
+ const {
|
|
|
|
|
+ userId,
|
|
|
|
|
+ userList = [],
|
|
|
|
|
+ deptList = [],
|
|
|
|
|
+ menus,
|
|
|
|
|
+ userInfo
|
|
|
|
|
+ } = this.$store.getters
|
|
|
|
|
+ const t1 = deptList.find(i => i.positionId === first) || {}
|
|
|
|
|
+ const t2 = deptList.find(i => i.positionId === second) || {}
|
|
|
|
|
+ // console.log(first, second, deptList)
|
|
|
|
|
+ const locationName = second
|
|
|
|
|
+ ? t1.positionName + t2.positionName
|
|
|
|
|
+ : t1.positionName
|
|
|
|
|
+ return {
|
|
|
|
|
+ defaultImage: defaultImage,
|
|
|
|
|
+ size: 'large',
|
|
|
|
|
+ positionList: [],
|
|
|
|
|
+ locationName,
|
|
|
|
|
+ show: false,
|
|
|
|
|
+ actions: [],
|
|
|
|
|
+ mainPositionName: '',
|
|
|
|
|
+ mainPosition:
|
|
|
|
|
+ this.info && this.info.mainPosition ? this.info.mainPosition : null
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ computed: {
|
|
|
|
|
+ ...mapState('ibps/user', ['info']),
|
|
|
|
|
+ avatar() {
|
|
|
|
|
+ const str = '/file/getImage?attachmentId='
|
|
|
|
|
+ const photo =
|
|
|
|
|
+ this.info && this.info.employee
|
|
|
|
|
+ ? /^\d+$/.test(this.info.employee.photo)
|
|
|
|
|
+ ? str + this.info.employee.photo
|
|
|
|
|
+ : this.info.employee.photo
|
|
|
|
|
+ : null
|
|
|
|
|
+ if (this.$utils.isEmpty(photo)) {
|
|
|
|
|
+ return this.errorImage
|
|
|
}
|
|
}
|
|
|
|
|
+ return getFile(photo)
|
|
|
},
|
|
},
|
|
|
- computed: {
|
|
|
|
|
- ...mapState('ibps/user', [
|
|
|
|
|
- 'info'
|
|
|
|
|
- ]),
|
|
|
|
|
- avatar() {
|
|
|
|
|
- const str = "/file/getImage?attachmentId="
|
|
|
|
|
- const photo = this.info && this.info.employee ? (/^\d+$/.test(this.info.employee.photo) ? (str + this.info.employee.photo) : this.info.employee.photo) : null
|
|
|
|
|
- if (this.$utils.isEmpty(photo)) {
|
|
|
|
|
- return this.errorImage
|
|
|
|
|
- }
|
|
|
|
|
- return getFile(photo)
|
|
|
|
|
- },
|
|
|
|
|
- errorImage() {
|
|
|
|
|
- return defaultImage
|
|
|
|
|
- },
|
|
|
|
|
- userName() {
|
|
|
|
|
- return this.info && this.info.user ? this.info.user.fullname : ''
|
|
|
|
|
- },
|
|
|
|
|
- org() {
|
|
|
|
|
- return this.locationName
|
|
|
|
|
- },
|
|
|
|
|
- position() {
|
|
|
|
|
- const positions = this.info && this.info.positions ? this.info.positions : null
|
|
|
|
|
- const pos = []
|
|
|
|
|
- if (this.$utils.isNotEmpty(positions)) {
|
|
|
|
|
- for (var i = 0; i < positions.length; i++) {
|
|
|
|
|
- pos.push(positions[i].name)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ errorImage() {
|
|
|
|
|
+ return defaultImage
|
|
|
|
|
+ },
|
|
|
|
|
+ userName() {
|
|
|
|
|
+ return this.info && this.info.user ? this.info.user.fullname : ''
|
|
|
|
|
+ },
|
|
|
|
|
+ org() {
|
|
|
|
|
+ return this.locationName
|
|
|
|
|
+ },
|
|
|
|
|
+ position() {
|
|
|
|
|
+ const positions =
|
|
|
|
|
+ this.info && this.info.positions ? this.info.positions : null
|
|
|
|
|
+ const pos = []
|
|
|
|
|
+ if (this.$utils.isNotEmpty(positions)) {
|
|
|
|
|
+ for (var i = 0; i < positions.length; i++) {
|
|
|
|
|
+ pos.push(positions[i].name)
|
|
|
|
|
+ this.actions.push({ name: positions[i].name, obj: positions[i] })
|
|
|
}
|
|
}
|
|
|
- return pos.join(',')
|
|
|
|
|
}
|
|
}
|
|
|
|
|
+ console.log('12212121212121')
|
|
|
|
|
+ const mid = JSON.parse(localStorage.getItem('mainPosition'))
|
|
|
|
|
+ this.mainPositionName = mid
|
|
|
|
|
+ ? mid.name
|
|
|
|
|
+ : this.info && this.info.mainPosition
|
|
|
|
|
+ ? this.info.mainPosition.name
|
|
|
|
|
+ : null
|
|
|
|
|
+ this.mainPosition =
|
|
|
|
|
+ mid ||
|
|
|
|
|
+ (this.info && this.info.mainPosition ? this.info.mainPosition : null)
|
|
|
|
|
+
|
|
|
|
|
+ return pos.join(',')
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ userInfo() {
|
|
|
|
|
+ this.$router.push({ name: 'userInfo' })
|
|
|
},
|
|
},
|
|
|
- methods: {
|
|
|
|
|
- userInfo() {
|
|
|
|
|
- this.$router.push({ name: 'userInfo' })
|
|
|
|
|
- },
|
|
|
|
|
- logout() {
|
|
|
|
|
- this.$dialog.confirm({
|
|
|
|
|
|
|
+ logout() {
|
|
|
|
|
+ this.$dialog
|
|
|
|
|
+ .confirm({
|
|
|
title: this.$t('common.dialog.title'),
|
|
title: this.$t('common.dialog.title'),
|
|
|
message: this.$t('platform.my.logoutMessage')
|
|
message: this.$t('platform.my.logoutMessage')
|
|
|
- }).then(() => {
|
|
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
this.$store.dispatch('ibps/account/logout', { vm: this }).then(() => {
|
|
this.$store.dispatch('ibps/account/logout', { vm: this }).then(() => {
|
|
|
// this.$router.push({ path: '/refresh' })
|
|
// this.$router.push({ path: '/refresh' })
|
|
|
this.$router.push({ path: '/' })
|
|
this.$router.push({ path: '/' })
|
|
|
})
|
|
})
|
|
|
- }).catch(() => {
|
|
|
|
|
-
|
|
|
|
|
})
|
|
})
|
|
|
- },
|
|
|
|
|
- about() {
|
|
|
|
|
- this.$router.push({ path: '/my/aboutUs' })
|
|
|
|
|
- },
|
|
|
|
|
- help() {
|
|
|
|
|
- this.$router.push({ path: '/my/help' })
|
|
|
|
|
- },
|
|
|
|
|
- switchEnvironment() {
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .catch(() => {})
|
|
|
|
|
+ },
|
|
|
|
|
+ about() {
|
|
|
|
|
+ this.$router.push({ path: '/my/aboutUs' })
|
|
|
|
|
+ },
|
|
|
|
|
+ help() {
|
|
|
|
|
+ this.$router.push({ path: '/my/help' })
|
|
|
|
|
+ },
|
|
|
|
|
+ switchEnvironment() {},
|
|
|
|
|
+ onReplay() {
|
|
|
|
|
+ this.show = true
|
|
|
|
|
+ },
|
|
|
|
|
+ onCancel() {
|
|
|
|
|
+ this.show = false
|
|
|
|
|
+ },
|
|
|
|
|
+ onSelect(e) {
|
|
|
|
|
+ console.log(e, 'eeeeeeeeeeeeeeeeeeeee')
|
|
|
|
|
+ this.mainPositionName = e.name
|
|
|
|
|
+ this.mainPosition = e.obj
|
|
|
|
|
+ localStorage.setItem('mainPosition', JSON.stringify(this.mainPosition))
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+}
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
- .divider {
|
|
|
|
|
- height: 8px;
|
|
|
|
|
- background: #f8f8f8;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+.divider {
|
|
|
|
|
+ height: 8px;
|
|
|
|
|
+ background: #f8f8f8;
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- .my {
|
|
|
|
|
- min-height: calc(100vh - 55px);
|
|
|
|
|
- background: #f8f8f8;
|
|
|
|
|
|
|
+.my {
|
|
|
|
|
+ min-height: calc(100vh - 55px);
|
|
|
|
|
+ background: #f8f8f8;
|
|
|
|
|
|
|
|
- .ibps-top-wrapper {
|
|
|
|
|
- padding-top: 0;
|
|
|
|
|
|
|
+ .ibps-top-wrapper {
|
|
|
|
|
+ padding-top: 0;
|
|
|
|
|
|
|
|
- .ibps-user-title {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- margin: 10px 0 6px 0;
|
|
|
|
|
|
|
+ .ibps-user-title {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ margin: 10px 0 6px 0;
|
|
|
|
|
|
|
|
- .ibps-user-title__name {
|
|
|
|
|
- font-size: 20px;
|
|
|
|
|
- margin-right: 15px;
|
|
|
|
|
- color: #333333;
|
|
|
|
|
- font-weight: bold;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- .ibps-user-desc {
|
|
|
|
|
- font-size: 14px;
|
|
|
|
|
|
|
+ .ibps-user-title__name {
|
|
|
|
|
+ font-size: 20px;
|
|
|
|
|
+ margin-right: 15px;
|
|
|
color: #333333;
|
|
color: #333333;
|
|
|
|
|
+ font-weight: bold;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .van-card {
|
|
|
|
|
- background-color: #fff;
|
|
|
|
|
|
|
+ .ibps-user-desc {
|
|
|
|
|
+ font-size: 14px;
|
|
|
|
|
+ color: #333333;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- .van-card__header {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .van-card {
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
|
|
|
- .van-card__thumb {
|
|
|
|
|
- width: 58px;
|
|
|
|
|
- height: 58px;
|
|
|
|
|
- margin-right: 17px;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ .van-card__header {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ .van-card__thumb {
|
|
|
|
|
+ width: 58px;
|
|
|
|
|
+ height: 58px;
|
|
|
|
|
+ margin-right: 17px;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
-</style>
|
|
|
|
|
|
|
+}
|
|
|
|
|
+.marginDistance {
|
|
|
|
|
+ margin: 0 0 3px 0 !important;
|
|
|
|
|
+}
|
|
|
|
|
+.alignCenter {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+}
|
|
|
|
|
+</style>
|