mirror of
https://github.com/veops/cmdb.git
synced 2025-08-26 15:00:39 +08:00
feat(ui): add userPanel component
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapMutations } from 'vuex'
|
||||
import { getCompanyInfo, postCompanyInfo, putCompanyInfo } from '@/api/company'
|
||||
import SpanTitle from '../components/spanTitle.vue'
|
||||
import { mixinPermissions } from '@/utils/mixin'
|
||||
@@ -82,6 +83,7 @@ export default {
|
||||
} else {
|
||||
this.infoData = res.info
|
||||
this.getId = res.id
|
||||
this.SET_COMPANY_NAME(res?.info?.name || '')
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -122,6 +124,7 @@ export default {
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
...mapMutations(['SET_COMPANY_NAME']),
|
||||
async onSubmit() {
|
||||
this.$refs.infoData.validate(async (valid) => {
|
||||
if (valid) {
|
||||
@@ -130,6 +133,7 @@ export default {
|
||||
} else {
|
||||
await putCompanyInfo(this.getId, this.infoData)
|
||||
}
|
||||
this.SET_COMPANY_NAME(this.infoData.name || '')
|
||||
this.$message.success(this.$t('saveSuccess'))
|
||||
} else {
|
||||
this.$message.warning(this.$t('cs.companyInfo.checkInputCorrect'))
|
||||
|
@@ -2,27 +2,13 @@
|
||||
<div class="setting-person">
|
||||
<div class="setting-person-left">
|
||||
<div
|
||||
@click="
|
||||
() => {
|
||||
$refs.personForm.clearValidate()
|
||||
$nextTick(() => {
|
||||
current = '1'
|
||||
})
|
||||
}
|
||||
"
|
||||
@click="clickSideItem('1')"
|
||||
:class="{ 'setting-person-left-item': true, 'setting-person-left-item-selected': current === '1' }"
|
||||
>
|
||||
<ops-icon type="icon-shidi-yonghu" />{{ $t('cs.person.spanTitle') }}
|
||||
</div>
|
||||
<div
|
||||
@click="
|
||||
() => {
|
||||
$refs.personForm.clearValidate()
|
||||
$nextTick(() => {
|
||||
current = '2'
|
||||
})
|
||||
}
|
||||
"
|
||||
@click="clickSideItem('2')"
|
||||
:class="{ 'setting-person-left-item': true, 'setting-person-left-item-selected': current === '2' }"
|
||||
>
|
||||
<a-icon type="unlock" theme="filled" />{{ $t('cs.person.accountAndPassword') }}
|
||||
@@ -240,7 +226,14 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
beforeDestroy() {
|
||||
this.$bus.$off('changeSettingPersonCurrent', this.clickSideItemv)
|
||||
},
|
||||
mounted() {
|
||||
this.$bus.$on('changeSettingPersonCurrent', this.clickSideItem)
|
||||
if (this.$route?.query?.current) {
|
||||
this.current = this.$route.query.current
|
||||
}
|
||||
this.getAllFlatEmployees()
|
||||
this.getAllFlatDepartment()
|
||||
this.getEmployeeByUid()
|
||||
@@ -249,6 +242,12 @@ export default {
|
||||
...mapActions(['GetInfo']),
|
||||
getDepartmentName,
|
||||
getDirectorName,
|
||||
clickSideItem(type) {
|
||||
this.$refs.personForm.clearValidate()
|
||||
this.$nextTick(() => {
|
||||
this.current = type
|
||||
})
|
||||
},
|
||||
getEmployeeByUid() {
|
||||
getEmployeeByUid(this.uid).then((res) => {
|
||||
this.form = { ...res }
|
||||
|
Reference in New Issue
Block a user