1
pyt
2025-01-08 ddedba1e8eaa898ea0fae71ed594392fe7e5a213
1
2个文件已修改
43 ■■■■■ 已修改文件
src/component/Header.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/component/userInfo.vue 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/component/Header.vue
@@ -5,7 +5,7 @@
            <div class="flex a-center j-between">
                <div @click="userInfoShow = true" class="flex a-center mr--55 shrink0 pointer">
                    <div class="mr--24 fs--20 font-bold shrink0 color2">{{ userInfo.userName }}</div>
                    <img @click="$emit('edit')" src="../assets/img/bianji@2x.png" class="w--23 h--23" />
                    <img src="../assets/img/bianji@2x.png" class="w--23 h--23" />
                </div>
                <img @click="logOutShow = true" src="../assets/img/tuichu@2x.png" class="w--40 h--40 shrink0 pointer" />
            </div>
src/component/userInfo.vue
@@ -1,7 +1,8 @@
<template>
    <el-dialog :visible.sync="show" :show-close="false" width="80%" top="51px" :close-on-click-modal="false">
    <el-dialog :visible.sync="show" :show-close="false" width="80%" top="51px" :close-on-click-modal="false"
        append-to-body @open="open">
        <div class="content">
            <el-form label-position="left" label-width="120px" :model="form" :rules="rules">
            <el-form label-position="left" label-width="120px" ref="form" :model="form" :rules="rules">
                <div class="title">个人信息</div>
                <div class="company">所属公司:{{ userInfo.companyName }}</div>
                <el-row :gutter="90" class="companyForm">
@@ -83,7 +84,7 @@
            </el-form>
            <div class="btns">
                <el-button @click="$emit('close')">关闭</el-button>
                <el-button type="primary">保存</el-button>
                <el-button type="primary" @click="submit">保存</el-button>
            </div>
        </div>
    </el-dialog>
@@ -114,19 +115,35 @@
        ...mapState(['userInfo'])
    },
    watch: {
        show(val) {
            if (val) {
                this.form = {
                    userName: this.userInfo.userName,
                    phone: this.userInfo.phone,
                    userEmail: this.userInfo.userEmail,
                    otherEmails: this.userInfo.otherEmails,
                    contactInfoList: this.userInfo.contactInfoList,
        'show': {
            handler(val) {
                if (val) {
                    this.open()
                }
            }
            },
            immediate: true
        }
    },
    methods: {
        // 提交
        submit() {
            this.$refs.form.validate((valid) => {
                if (valid) {
                    console.log(this.form);
                }
            })
        },
        // 打开
        open() {
            let userInfo = JSON.parse(JSON.stringify(this.userInfo));
            this.form = {
                userName: userInfo.userName,
                phone: userInfo.phone,
                userEmail: userInfo.userEmail,
                otherEmails: userInfo.otherEmails,
                contactInfoList: userInfo.contactInfoList,
            }
        },
        // 新增其他邮箱
        addEmail() {
            this.form.otherEmails.push({