Forráskód Böngészése

编辑系统用户基本信息

natasha 1 éve
szülő
commit
7e96f1ad09

+ 924 - 0
src/components/Setting.vue

@@ -0,0 +1,924 @@
+<template>
+  <div class="setting">
+    <template v-if="!settingFlag">
+        <div class="setting-top">
+            <div class="avator-box">
+            <el-image
+                :src="info.sys_user.image_url?info.sys_user.image_url:require('../assets/avatar.png')"
+                fit="contain">
+            </el-image>
+            <a @click="toggleShow" class="img-crop">
+                <svg-icon icon-class="camera"></svg-icon>
+            </a>
+            </div>
+            <div class="center">
+                <div class="info-items">
+                    <label>用户名:</label>
+                    <span>{{info.sys_user.user_name}}</span>
+                </div>
+                <div class="info-items">
+                    <label>手机号码:</label>
+                    <span>{{info.sys_user.phone.substring(0,3)+'******'+info.sys_user.phone.substring(9,11)}}</span>
+                </div>
+                <div class="info-items">
+                    <label>账号ID:</label>
+                    <span>{{info.sys_user.id}}</span>
+                </div>
+                <div class="info-items">
+                    <label>邮箱:</label>
+                    <span>{{info.sys_user.email}}</span>
+                </div>
+                <div class="info-items">
+                    <label>{{page==='editPerson'?'创建时间:':'注册时间:'}}</label>
+                    <span>{{info.sys_user.create_time}}</span>
+                </div>
+            </div>
+        </div>
+        <div class="setting-bottom">
+            <div class="tabs-box">
+                <a :class="[tabsIndex===0?'active':'']" @click="handleChangeTabs(0)">基本信息</a>
+                <a :class="[tabsIndex===1?'active':'']" @click="handleChangeTabs(1)">安全设置</a>
+                <a :class="[tabsIndex===2?'active':'']" @click="handleChangeTabs(2)">{{page==='editPerson'?'我的权限':'权限设置'}}</a>
+            </div>
+            <template v-if="tabsIndex===0">
+                <el-form :model="infoForm" :rules="rules" ref="ruleForm" label-width="150px" class="setting-form">
+                    <el-form-item label="用户名" prop="name">
+                        <el-input v-model="infoForm.name" disabled placeholder="请输入用户名"></el-input>
+                    </el-form-item>
+                    <el-form-item label="真实姓名" prop="realName">
+                        <el-input v-model="infoForm.realName" placeholder="请输入真实姓名" @blur="handleTrim('infoForm','realName')"></el-input>
+                    </el-form-item>
+                    <el-form-item label="性别" prop="sex">
+                        <el-radio-group v-model="infoForm.sex">
+                            <el-radio :label="1">男</el-radio>
+                            <el-radio :label="0">女</el-radio>
+                        </el-radio-group>
+                    </el-form-item>
+                    <el-form-item label="所在省市" prop="selectedOptions">
+                        <el-cascader
+                            size="medium"
+                            :options="provinceAndCityData"
+                            v-model="infoForm.selectedOptions"
+                            @change="handleCity">
+                        </el-cascader>
+                    </el-form-item>
+                    <el-form-item label="备注" prop="desc">
+                        <el-input type="textarea" v-model="infoForm.desc" placeholder="请输入备注" maxlength="100" :rows="4" show-word-limit @blur="handleTrim('infoForm','desc')"></el-input>
+                    </el-form-item>
+                    <el-form-item>
+                        <el-button type="primary" @click="onSubmit('ruleForm')" size="small" :loading="loading">保存</el-button>
+                        <el-button @click="onCancel('ruleForm')" size="small">取消</el-button>
+                    </el-form-item>
+                </el-form>
+            </template>
+            <template v-if="tabsIndex===1&&page==='editPerson'">
+                <div class="safe-items">
+                    <label>登录密码</label>
+                    <div class="safe-items-right">
+                        <p class="hasContent">
+                            已设置。密码至少6位字符,支持数字和字母,且必须同时包含数字和大小写字母。
+                        </p>
+                        <!-- <p v-else class="noContent">
+                        您暂未设置密码,密码可以有效的保护账号的安全。 
+                        </p> -->
+                        <a @click="handleSetting('passwordFlag')">{{'修改'}}</a>
+                    </div>
+                </div>
+                <div class="safe-items">
+                    <label>绑定手机</label>
+                    <div class="safe-items-right">
+                        <p v-if="info.sys_user.phone" class="hasContent">
+                            已绑定: {{info.sys_user.phone.substring(0,3)+'******'+info.sys_user.phone.substring(9,11)}}
+                        </p>
+                        <p v-else class="noContent">
+                        您暂未绑定手机,绑定手机可以有效的保护账号的安全。 
+                        </p>
+                        <a @click="handleSetting('phoneFlag')">{{info.sys_user.phone?'修改':'设置'}}</a>
+                    </div>
+                </div>
+                <div class="safe-items">
+                    <label>绑定邮箱</label>
+                    <div class="safe-items-right">
+                        <p v-if="info.sys_user.email" class="hasContent">
+                            已绑定: {{info.sys_user.email}}
+                        </p>
+                        <p v-else class="noContent">
+                        您暂未设置邮箱,绑定邮箱可以用来找回密码、接收通知等。
+                        </p>
+                        <a @click="handleSetting('emailFlag')">{{info.sys_user.email?'修改':'设置'}}</a>
+                    </div>
+                </div>
+            </template>
+            <template v-if="tabsIndex===2">
+                <table class="step-table">
+                        <tr>
+                            <td rowspan="2" class="step-table-header">管理权限</td>
+                            <td>系统用户</td>
+                            <td>机构管理</td>
+                        </tr>
+                        <tr>
+                            <td><el-checkbox v-model="manageAuth" :label="10001"><br/></el-checkbox></td>
+                            <td><el-checkbox v-model="manageAuth" :label="10002"><br/></el-checkbox></td>
+                        </tr>
+                    </table>
+                    <table class="step-table">
+                        <tr>
+                            <td rowspan="2" class="step-table-header">内容权限</td>
+                            <td class="td1">报纸管理</td>
+                            <td class="td1">画刊管理</td>
+                            <td class="td1">专辑管理</td>
+                            <td class="td1">评测管理</td>
+                            <td class="td1">练习册管理</td>
+                            <td class="td1">课程管理</td>
+                            <td class="td1">广告管理</td>
+                        </tr>
+                        <tr>
+                            <td class="td1"><el-checkbox v-model="manageAuth" :label="20001"><br/></el-checkbox></td>
+                            <td class="td1"><el-checkbox v-model="manageAuth" :label="20002"><br/></el-checkbox></td>
+                            <td class="td1"><el-checkbox v-model="manageAuth" :label="20003"><br/></el-checkbox></td>
+                            <td class="td1"><el-checkbox v-model="manageAuth" :label="20004"><br/></el-checkbox></td>
+                            <td class="td1"><el-checkbox v-model="manageAuth" :label="20005"><br/></el-checkbox></td>
+                            <td class="td1"><el-checkbox v-model="manageAuth" :label="20006"><br/></el-checkbox></td>
+                            <td class="td1"><el-checkbox v-model="manageAuth" :label="20007"><br/></el-checkbox></td>
+                        </tr>
+                    </table>
+                    <table class="step-table">
+                        <tr>
+                            <td rowspan="2" class="step-table-header">兑换码权限</td>
+                            <td>生成兑换码</td>
+                            <td>查看兑换码使用情况</td>
+                        </tr>
+                        <tr>
+                            <td><el-checkbox v-model="manageAuth" :label="30001"><br/></el-checkbox></td>
+                            <td>
+                                <el-radio-group v-model="codeAuth.viewCode">
+                                    <el-radio :label="1">全部</el-radio>
+                                    <el-radio :label="0">自己生成的</el-radio>
+                                </el-radio-group>
+                            </td>
+                        </tr>
+                    </table>
+                    <table class="step-table">
+                        <tr>
+                            <td rowspan="2" class="step-table-header">财务权限</td>
+                            <td>查看数据</td>
+                            <td>导出数据</td>
+                            <td>授权地区</td>
+                        </tr>
+                        <tr>
+                            <td><el-checkbox v-model="manageAuth" :label="40001"><br/></el-checkbox></td>
+                            <td><el-checkbox v-model="manageAuth" :label="40002"><br/></el-checkbox></td>
+                            <td>
+                                <el-cascader
+                                    class="step-cascader"
+                                    size="medium"
+                                    :props="props"
+                                    collapse-tags
+                                    clearable
+                                    :options="provinceAndCityData"
+                                    v-model="financeAuth.selectedOptions"
+                                    @change="handleCity">
+                                </el-cascader>
+                            </td>
+                        </tr>
+                    </table>
+            </template>
+        </div>
+    </template>
+    <div class="setting-iframe" v-if="settingFlag&&passwordFlag">
+        <p class="title">
+            <i class="el-icon-arrow-left" @click="handleSetting('passwordFlag')"></i>
+            修改登录密码
+        </p>
+        <el-form :model="passwordForm" :rules="rulesPassword" ref="passwordForm" label-width="100px" class="passwordForm">
+            <!-- <el-form-item label="原始密码" prop="oldPwd">
+                <el-input v-model="passwordForm.oldPwd" :type="oldPwdFlag?'text':'password'" autocomplete="off" placeholder="请输入密码" >
+                    <i slot="suffix" class="el-icon-view show-icon" @click="changeIcon('oldPwdFlag')" v-if="oldPwdFlag"></i>
+                    <i slot="suffix" class="show-icon" @click="changeIcon('oldPwdFlag')" v-else>
+                        <svg-icon icon-class="eye-invisible"></svg-icon>
+                    </i>
+                </el-input>
+            </el-form-item> -->
+            <el-form-item label="修改密码" prop="newPwd">
+                <el-input v-model="passwordForm.newPwd" :type="newPwdFlag?'text':'password'" autocomplete="off" placeholder="请输入密码" @blur="handleTrim('passwordForm','newPwd')" >
+                    <i slot="suffix" class="el-icon-view show-icon" @click="changeIcon('newPwdFlag')" v-if="newPwdFlag"></i>
+                    <i slot="suffix" class="show-icon" @click="changeIcon('newPwdFlag')" v-else>
+                        <svg-icon icon-class="eye-invisible"></svg-icon>
+                    </i>
+                </el-input>
+                <p class="tips">不少于6位,且必须同时包含数字和大小写字母</p>
+            </el-form-item>
+            <el-form-item label="再次输入" prop="confirmPwd">
+                <el-input v-model="passwordForm.confirmPwd" :type="comfirmPwdFlag?'text':'password'" autocomplete="off" placeholder="请输入密码" @blur="handleTrim('passwordForm','confirmPwd')" >
+                    <i slot="suffix" class="el-icon-view show-icon" @click="changeIcon('comfirmPwdFlag')" v-if="comfirmPwdFlag"></i>
+                    <i slot="suffix" class="show-icon" @click="changeIcon('comfirmPwdFlag')" v-else>
+                        <svg-icon icon-class="eye-invisible"></svg-icon>
+                    </i>
+                </el-input>
+            </el-form-item>
+            <el-form-item>
+                <el-button type="primary" @click="onSubmitPassword('passwordForm')" size="small" :loading="loading">保存</el-button>
+                <el-button @click="onCancel('passwordForm')" size="small">取消</el-button>
+            </el-form-item>
+        </el-form>
+    </div>
+    <div class="setting-iframe" v-if="settingFlag&&phoneFlag">
+        <p class="title">
+            <i class="el-icon-arrow-left" @click="handleSetting('phoneFlag')"></i>
+            修改绑定手机
+        </p>
+        <el-form :model="phoneForm" :rules="rulesPhone" ref="phoneForm" label-width="100px" class="phoneForm">
+            <el-form-item label="原手机号" prop="oldPhone">
+                <el-input v-model="phoneForm.oldPhone" autocomplete="off" placeholder="请输入完整手机号" @blur="handleTrim('phoneForm','oldPhone')" >
+                    <template slot="prepend">+86</template>
+                </el-input>
+            </el-form-item>
+            <el-form-item label="新手机号" prop="newPhone">
+                <el-input v-model="phoneForm.newPhone" autocomplete="off" placeholder="请输入完整手机号" @blur="handleTrim('phoneForm','newPhone')" >
+                    <template slot="prepend">+86</template>
+                </el-input>
+            </el-form-item>
+            <el-form-item>
+                <el-button type="primary" @click="onSubmitPhone('phoneForm')" size="small" :loading="loading">保存</el-button>
+                <el-button @click="onCancel('phoneForm')" size="small">取消</el-button>
+            </el-form-item>
+        </el-form>
+    </div>
+    <div class="setting-iframe" v-if="settingFlag&&emailFlag">
+        <p class="title">
+            <i class="el-icon-arrow-left" @click="handleSetting('emailFlag')"></i>
+            修改安全邮箱
+        </p>
+        <el-form :model="emailForm" :rules="rulesEmail" ref="emailForm" label-width="100px" class="emailForm">
+            <el-form-item label="原邮箱" prop="email">
+                <el-input v-model="emailForm.email" autocomplete="off" placeholder="请输入邮箱地址" @blur="handleTrim('emailForm','email')" >
+                </el-input>
+            </el-form-item>
+            <el-form-item label="新邮箱" prop="newEmail">
+                <el-input v-model="emailForm.newEmail" autocomplete="off" placeholder="请输入邮箱地址" @blur="handleTrim('emailForm','newEmail')" >
+                </el-input>
+            </el-form-item>
+            <el-form-item>
+                <el-button type="primary" @click="onSubmitPhone('emailForm')" size="small" :loading="loading">保存</el-button>
+                <el-button @click="onCancel('emailForm')" size="small">取消</el-button>
+            </el-form-item>
+        </el-form>
+    </div>
+  </div>
+</template>
+
+<script>
+//这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+//例如:import 《组件名称》from ‘《组件路径》';
+import {
+  provinceAndCityData
+} from "element-china-area-data";
+import { getLogin } from "@/api/ajax";
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: { },
+  props: ["page","info"],
+  data() {
+    //这里存放数据
+    const validatePass = (rule, value, callback) => {
+        if (value === '') {
+            callback(new Error('请输入密码'));
+        } else {
+            let reg = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z\d]{6,16}$/;
+            let result = reg.test(value);
+            if (result) {
+                callback();
+            } else {
+                callback(new Error('密码必须同时包含数字和大小写字母'));
+            }
+            
+        }
+    };
+    const validatePass2 = (rule, value, callback) => {
+        if (value === '') {
+          callback(new Error('请再次输入密码'));
+        } else if (value !== this.passwordForm.newPwd) {
+          callback(new Error('两次输入密码不一致!'));
+        } else {
+          callback();
+        }
+    };
+    const validatePhone = (rule, value, callback) => {
+        if (value === '') {
+            callback(new Error('请输入手机号'));
+        } else {
+            let reg = /^1[3-9]\d{9}$/;
+            let result = reg.test(value);
+            if (result) {
+                callback();
+            } else {
+                callback(new Error('请输入正确的手机号'));
+            }
+        }
+    };
+    const validateEmail = (rule, value, callback) => {
+        if (value === '') {
+            callback(new Error('请输入邮箱地址'));
+        } else {
+            let reg = /^[a-zA-Z0-9_\.-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
+            let result = reg.test(value);
+            if (result) {
+                callback();
+            } else {
+                callback(new Error('请输入正确的邮箱地址'));
+            }
+        }
+    };
+    return {
+        provinceAndCityData,
+        show: false, // 编辑头像flag
+        tabsIndex: 0,
+        infoForm:{
+            name:JSON.parse(JSON.stringify(this.info.sys_user.user_name)),
+            realName:JSON.parse(JSON.stringify(this.info.sys_user.real_name)),
+            sex:JSON.parse(JSON.stringify(this.info.sys_user.sex)),
+            // selectedOptions: JSON.parse(JSON.stringify(this.info.sys_user.city_id)),
+            desc:JSON.parse(JSON.stringify(this.info.sys_user.memo)),
+            selectedOptions: '0302',
+        },
+        rules: {
+            name: [
+                { required: true, message: '请输入用户名', trigger: 'blur' }
+            ],
+            // selectedOptions: [
+            //     { type: 'array', required: true, message: '请选择所在省市', trigger: 'change' }
+            // ],
+            realName:[
+                { required: true, message: '请输入真实姓名', trigger: 'blur' },
+            ],
+            sex:[
+                { required: true, message: '请选择性别', trigger: 'change' },
+            ],
+        },
+        settingFlag: false, // 修改设置
+        passwordFlag: false, // 修改密码
+        phoneFlag: false, // 修改手机
+        emailFlag: false, // 修改邮箱
+        passwordForm:{
+            oldPwd:'', // 旧密码
+            newPwd:'', // 新密码
+            confirmPwd:'' // 确认密码
+        },
+        rulesPassword:{
+            oldPwd:[
+                { required: true, message: '请输入原始密码', trigger: 'blur' }
+            ],
+            newPwd:[
+                { required: true, validator: validatePass, trigger: 'blur' },
+                { min: 6, max: 16, message: '请输入 6-16 位密码,且必须同时包含数字和大小写字母', trigger:'change' },
+            ],
+            confirmPwd:[
+                { required: true, validator: validatePass2, trigger: 'blur' }
+            ]
+        },
+        oldPwdFlag: false, // 查看旧密码
+        newPwdFlag: false, // 查看新密码
+        comfirmPwdFlag: false, // 查看确认密码
+        phoneForm:{
+            oldPhone:'', // 旧手机
+            oldCode:'',  // 旧手机验证码
+            newPhone:'', // 新手机
+            newCode:'', // 新手机验证码
+        },
+        rulesPhone:{
+            oldPhone:[
+                { required: true, validator: validatePhone, trigger: 'blur' },
+            ],
+            oldCode:[
+                { required: true, message: '请输入验证码', trigger: 'blur' }
+            ],
+            newPhone:[
+                { required: true, validator: validatePhone, trigger: 'blur' },
+            ],
+            newCode:[
+                { required: true, message: '请输入验证码', trigger: 'blur' }
+            ]
+        },
+        time: 60, //获取验证码的时间
+        verificationCodeShow: false, //是否已经获取了验证码
+        times: 60, //获取验证码的时间
+        verificationCodesShow: false, //是否已经获取了验证码
+        timee: 60, //获取验证码的时间
+        verificationCodeeShow: false, //是否已经获取了验证码
+        emailForm:{
+            email:'',
+            newEmail:''
+        },
+        rulesEmail:{
+            email:[
+                { required: true, validator: validateEmail, trigger: 'blur' },
+            ],
+            newEmail:[
+                { required: true, validator: validateEmail, trigger: 'blur' }
+            ]
+        },
+        manageAuth:JSON.parse(JSON.stringify(this.info.popedom_code_list)), // 管理权限
+        codeAuth:{
+            auth:[],
+            viewCode:JSON.parse(JSON.stringify(this.info.data_scope.discount_code_view_scope))
+        }, // 兑换码权限
+        financeAuth:{
+            auth: [],
+            selectedOptions:JSON.parse(JSON.stringify(this.info.data_scope.finance_popedom_data_scope))
+        }, // 财务权限
+        props: { multiple: true },
+        loading: false,
+        id:this.$route.query.id?this.$route.query.id:'',
+    }
+  },
+  //计算属性 类似于data概念
+  computed: {},
+  //监控data中数据变化
+  watch: {
+
+  },
+  //方法集合
+  methods: {
+    // 编辑头像
+    toggleShow() {
+      this.show = !this.show;
+    },
+    // 切换tabs
+    handleChangeTabs(value){
+        this.tabsIndex = value
+    },
+    // 级联选择器
+    handleCity(value){
+        console.log(value)
+    },
+    // 提交表单
+    onSubmit(formName){
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            let MethodName = "/OrgServer/Manager/SysUserManager/UpdateSysUser_BaseInfo";
+            let data = {
+                id: this.id,
+                user_name: this.infoForm.name,
+                real_name: this.infoForm.realName,
+                sex: this.infoForm.sex,
+                city_id: this.infoForm.selectedOptions,
+                memo: this.infoForm.desc
+            }
+            getLogin(MethodName, data)
+            .then((res) => {
+                this.loading = false
+                if(res.status===1){
+                    this.$emit("getInfo")
+                }
+            }).catch((res) =>{
+                this.loading = false
+            })
+          } else {
+            return false;
+          }
+        });
+    },
+    // 取消 恢复到修改前状态
+    onCancel(formName){
+        this.$refs[formName].resetFields();
+    },
+    // 修改设置
+    handleSetting(flag){
+        this.settingFlag = !this.settingFlag
+        this[flag] = !this[flag]
+    },
+    changeIcon(flag){
+        this[flag] = !this[flag]
+    },
+    // 修改密码提交表单
+    onSubmitPassword(formName){
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            alert('submit!');
+          } else {
+            console.log('error submit!!');
+            return false;
+          }
+        });
+    },
+    // 修改手机提交表单
+    onSubmitPhone(formName){
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            alert('submit!');
+          } else {
+            console.log('error submit!!');
+            return false;
+          }
+        });
+    },
+    // 发送验证码
+    sendCode(time,phone,flag,obj){
+        let this_ = this;
+        if(this_[time] != 60){
+            return
+        }
+        let timer;
+        // 修改手机号
+        if(!obj){
+            if (this_.phoneForm[phone]) {
+                let reg = /^1[3-9]\d{9}$/;
+                let result = reg.test(this_.phoneForm[phone]);
+                if (!result) {
+                    this_.$message.warning('请输入正确的手机号');
+                    return
+                }
+                this_[flag] = true;
+                timer = setInterval(() => {
+                    this_[time]--;
+                    if (this_[time] == 0) {
+                        this_[flag] = false;
+                        clearInterval(timer);
+                        timer = null;
+                        this_[time] = 60;
+                    }
+                }, 1000);
+                // let MethodName = "user_manager-SendVerificationCode";
+                // let data = {
+                // verification_type: 'EMAIL',
+                // phone_or_email: this_.loginForm.username,
+                // };
+                // getLogin(MethodName, data).then((res) => {
+                // }).catch(()=>{
+                //     this_[flag] = false;
+                //     clearInterval(timer);
+                //     timer = null;
+                //     this_[time] = 60;
+                // });
+            } else {
+                this_.$message.warning('请先输入手机号');
+            }
+        }else{
+            // 修改邮箱
+            if (this_.emailForm[phone]) {
+                let reg = /^[a-zA-Z0-9_\.-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/;
+                let result = reg.test(this_.emailForm[phone]);
+                if (!result) {
+                    this_.$message.warning('请输入正确的邮箱地址');
+                    return
+                }
+                this_[flag] = true;
+                timer = setInterval(() => {
+                    this_[time]--;
+                    if (this_[time] == 0) {
+                        this_[flag] = false;
+                        clearInterval(timer);
+                        timer = null;
+                        this_[time] = 60;
+                    }
+                }, 1000);
+                // let MethodName = "user_manager-SendVerificationCode";
+                // let data = {
+                // verification_type: 'EMAIL',
+                // phone_or_email: this_.loginForm.username,
+                // };
+                // getLogin(MethodName, data).then((res) => {
+                // }).catch(()=>{
+                //     this_[flag] = false;
+                //     clearInterval(timer);
+                //     timer = null;
+                //     this_[time] = 60;
+                // });
+            } else {
+                this_.$message.warning('请先输入邮箱');
+            }
+        }
+    },
+    // 去掉前后空格
+    handleTrim(form,fild){
+        this[form][fild] = this[form][fild].trim()
+    },
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+  },
+  //生命周期-创建之前
+  beforeCreated() { },
+  //生命周期-挂载之前
+  beforeMount() { },
+  //生命周期-更新之前
+  beforUpdate() { },
+  //生命周期-更新之后
+  updated() { },
+  //生命周期-销毁之前
+  beforeDestory() { },
+  //生命周期-销毁完成
+  destoryed() { },
+  //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() { }
+}
+</script>
+<style lang="scss" scoped>
+/* @import url(); 引入css类 */
+.setting{
+    height: 100%;
+    &-top{
+        margin: 0 0 12px 0;
+        background: #FFFFFF;
+        border-radius: 8px;
+        display: flex;
+        align-items: center;
+        width: 100%;
+        padding: 22px 40px;
+        .avator-box{
+            width: 96px;
+            height: 96px;
+            position: relative;
+            .img-crop{
+                position: absolute;
+                // padding: 4px;
+                width: 30px;
+                height: 30px;
+                right: -4px;
+                bottom: -4px;
+                background: #F2F3F5;
+                border-radius: 50%;
+                display: block;
+                text-align: center;
+                padding: 7px;
+                font-size: 0;
+                border: 2px solid #FFFFFF;
+                .svg-icon{
+                    width: 12px;
+                    height: 12px;
+                    color: #165DFF;
+                }
+            }
+            .el-image{
+                border-radius: 50%;
+                overflow: hidden;
+            }
+        }
+        .center{
+            flex: 1;
+            display: flex;
+            flex-flow: wrap;
+            margin-top: 12px;
+            .info-items{
+                margin-bottom: 12px;
+                width: 40%;
+            }
+            label{
+                font-weight: 400;
+                font-size: 14px;
+                line-height: 22px;
+                color: #86909C;
+                width: 156px;
+                text-align: right;
+                display: inline-block;
+                padding-right: 10px;
+            }
+            span{
+                font-size: 14px;
+                line-height: 22px;
+                color: #1D2129;
+            }
+        }
+    }
+    &-bottom{
+        padding: 24px;
+        background: #FFFFFF;
+        border-radius: 4px;
+        min-height: calc(100vh - 270px);
+        .tabs-box{
+            display: flex;
+            padding-bottom: 16px;
+            a{
+                font-size: 14px;
+                line-height: 22px;
+                color: #4E5969;
+                border-radius: 100px;
+                padding: 5px 16px;
+                margin-right: 12px;
+                &:hover{
+                    background: #F2F3F5;
+                }
+                &.active{
+                    background: #F2F3F5;
+                    font-weight: 500;
+                    color: #165DFF;
+                }
+            }
+        }
+        .btn{
+            margin-left: 16px;
+        }
+        .safe-items{
+            display: flex;
+            width: 100%;
+            padding: 30px 20px 13px 20px;
+            label{
+                font-weight: 500;
+                font-size: 14px;
+                line-height: 22px;
+                color: #4E5969;
+            }
+            &-right{
+                border-bottom: 1px solid #E5E6EB;
+                padding-bottom: 20px;
+                flex: 1;
+                margin-left: 16px;
+                display: flex;
+                justify-content: space-between;
+                p{
+                    margin: 0;
+                    font-weight: 400;
+                    font-size: 14px;
+                    line-height: 22px;
+                    color: #4E5969;
+                    &.noContent{
+                        color: #86909C;
+                    }
+                }
+                a{
+                    font-weight: 400;
+                    font-size: 14px;
+                    line-height: 22px;
+                    color: #165DFF;
+                }
+            }
+        }
+    }
+    &-iframe{
+        width: 100%;
+        height: 100%;
+        background: #FFFFFF;
+        padding: 24px;
+        .title{
+            margin: 0;
+            font-weight: 400;
+            font-size: 20px;
+            line-height: 28px;
+            color: #000000;
+            .el-icon-arrow-left{
+                margin-right: 8px;
+                cursor: pointer;
+            }
+        }
+        .passwordForm,.phoneForm,.emailForm{
+            padding-top: 40px;
+            .show-icon{
+                cursor: pointer;
+                color: #4E5969;
+            }
+        }
+        .code-input{
+            width: 268px;
+            .el-input__inner{
+                border-radius: 2px 0 0 2px;
+            }
+        }
+    }
+}
+.step-table{
+    border: 1px solid #E5E6EB;
+    border-collapse: collapse;
+    font-size: 14px;
+    line-height: 22px;
+    color: #1D2129;
+    text-align: center;
+    margin-bottom: 24px;
+    &-header{
+        background: #F7F8FA;
+        width: 120px !important;
+        color: #86909C;
+        font-weight: 500;
+    }
+    td{
+        height: 40px;
+        width: 260px;
+        border: 1px solid #E5E6EB;
+        &.td1{
+            width: 130px;
+        }
+    }
+    .step-cascader{
+        width: 250px;
+        height: 32px;
+        line-height: 32px;
+    }
+}
+.tips{
+    margin: 0;
+    color: #86909C;
+    font-size: 12px;
+    line-height: 20px;
+}
+</style>
+<style lang="scss">
+.setting{
+    .el-input,.el-textarea{
+        width: 360px;
+    }
+    .el-input__inner{
+        height: 32px;
+        color: #1D2129;
+        background: #F2F3F5;
+        border: none;
+    }
+    .el-textarea__inner,.el-input-group__prepend{
+        color: #1D2129;
+        background: #F2F3F5;
+        border: none;
+    }
+    .el-input__count{
+        background: #F2F3F5;
+    }
+    .el-form-item__label{
+        font-weight: 400;
+        font-size: 14px;
+        line-height: 32px;
+        color: #4E5969;
+    }
+    .el-form-item__content,.el-input__icon{
+        line-height: 32px;
+        color: #4E5969 !important;
+    }
+    .el-form-item{
+        margin-bottom: 20px;
+    }
+    .el-radio__input.is-checked+.el-radio__label{
+        color: #165DFF;
+    }
+    .el-radio__input.is-checked .el-radio__inner{
+        background: #165DFF;
+        border-color: #165DFF;
+    }
+    .el-button--primary{
+        background: #165DFF;
+        border-color: #165DFF;
+        border-radius: 2px;
+        &:hover{
+            background: #4080FF;
+            border-color: #4080FF;
+        }
+        &:focus{
+            background: #0E42D2;
+            border-color: #0E42D2;
+        }
+    }
+    .el-button--default{
+        background: #F2F3F5;
+        border-radius: 2px;
+        border: none;
+        color: #4E5969;
+        height: 32px;
+        &:hover{
+            background: #E5E6EB;
+        }
+        &:focus{
+            background: #C9CDD4;
+        }
+    }
+    .setting-form{
+        padding-top: 26px;
+    }
+    .code-box{
+        .el-form-item__content{
+            display: flex;
+        }
+    }
+    .code-input{
+        height: 32px;
+        .el-input__inner{
+            border-radius: 4px 0 0 4px;
+        }
+    }
+    .sendCode{
+        border-radius: 0 4px 4px 0;
+        margin-top: 1px;
+        width: 92px;
+    }
+    .el-input-group__prepend{
+        width: 54px;
+        height: 32px;
+        border: none;
+        background: #F2F3F5;
+        border-radius: 2px 0px 0px 2px;
+        line-height: 32px;
+        text-align: center;
+        padding: 0;
+    }
+    .el-input-group--prepend{
+        display: flex;
+        .el-input__inner{
+            margin-left: 8px;
+            flex: 1;
+        }
+    }
+    .step-cascader{
+        .el-input{
+            width: 100% !important;
+        }
+    }
+}
+</style>

+ 3 - 0
src/icons/svg/camera.svg

@@ -0,0 +1,3 @@
+<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path fill-rule="evenodd" clip-rule="evenodd" d="M3.76824 1.84549C3.87411 1.63375 4.09052 1.5 4.32725 1.5H7.67275C7.90948 1.5 8.12589 1.63375 8.23176 1.84549L8.55902 2.5H10.25C10.6642 2.5 11 2.83579 11 3.25V9.75C11 10.1642 10.6642 10.5 10.25 10.5H1.75C1.33579 10.5 1 10.1642 1 9.75V3.25C1 2.83579 1.33579 2.5 1.75 2.5H3.44098L3.76824 1.84549ZM2 3.5V9.5H10V3.5H2ZM6 5.25C5.30964 5.25 4.75 5.80964 4.75 6.5C4.75 7.19036 5.30964 7.75 6 7.75C6.69036 7.75 7.25 7.19036 7.25 6.5C7.25 5.80964 6.69036 5.25 6 5.25ZM3.75 6.5C3.75 5.25736 4.75736 4.25 6 4.25C7.24264 4.25 8.25 5.25736 8.25 6.5C8.25 7.74264 7.24264 8.75 6 8.75C4.75736 8.75 3.75 7.74264 3.75 6.5Z" fill="currentColor"/>
+</svg>

+ 5 - 0
src/router/index.js

@@ -104,6 +104,11 @@ export const constantRoutes = [{
         component: () =>
             import ('@/views/newspaper_manage/CreateNewspaper.vue')
     },
+    {
+        path: '/editPerson',
+        component: () =>
+            import ('@/views/people_manage/EditPerson.vue')
+    },
     // 404 page must be placed at the end !!!
     { path: '*', redirect: '/', hidden: true }
 ]

+ 1 - 141
src/views/organize_manage/PersonList.vue

@@ -421,147 +421,7 @@ export default {
                 color:'#F53F3F'
             }
         },
-        tableData:[
-            {
-                id:'1',
-                userName:'admin',
-                realName:'超级管理员',
-                sex:'0',
-                type:'0', // 0 管理员 1 平台管理员 2 内容管理员 3 财务管理员 4 兑换码管理员
-                email:'d.dkemi@kqtdgbo.tj',
-                phone:'13082684216',
-                status:'1',
-                data:'2018-02-03',
-                img:''
-            },
-            {
-                id:'2',
-                userName:'赵萸艳',
-                realName:'赵萸艳',
-                sex:'1',
-                type:'1', // 0 管理员 1 平台管理员 2 内容管理员 3 财务管理员 4 兑换码管理员
-                email:'a.ghwrgoh@hlfh.nu',
-                phone:'13273549500',
-                status:'0',
-                data:'2018-02-03',
-                img:require('../../assets/abandon/touxiang1.png')
-            },
-            {
-                id:'3',
-                userName:'赵萸艳',
-                realName:'赵萸艳',
-                sex:'1',
-                type:'2', // 0 管理员 1 平台管理员 2 内容管理员 3 财务管理员 4 兑换码管理员
-                email:'a.ghwrgoh@hlfh.nu',
-                phone:'13273549500',
-                status:'1',
-                data:'2018-02-03',
-                img:require('../../assets/abandon/touxiang1.png')
-            },
-            {
-                id:'4',
-                userName:'赵萸艳',
-                realName:'赵萸艳',
-                sex:'1',
-                type:'4', // 0 管理员 1 平台管理员 2 内容管理员 3 财务管理员 4 兑换码管理员
-                email:'a.ghwrgoh@hlfh.nu',
-                phone:'13273549500',
-                status:'0',
-                data:'2018-02-03',
-                img:require('../../assets/abandon/touxiang1.png')
-            },
-            {
-                id:'5',
-                userName:'admin',
-                realName:'超级管理员',
-                sex:'0',
-                type:'0', // 0 管理员 1 平台管理员 2 内容管理员 3 财务管理员 4 兑换码管理员
-                email:'d.dkemi@kqtdgbo.tj',
-                phone:'13082684216',
-                status:'1',
-                data:'2018-02-03',
-                img:''
-            },
-            {
-                id:'6',
-                userName:'赵萸艳',
-                realName:'赵萸艳',
-                sex:'1',
-                type:'1', // 0 管理员 1 平台管理员 2 内容管理员 3 财务管理员 4 兑换码管理员
-                email:'a.ghwrgoh@hlfh.nu',
-                phone:'13273549500',
-                status:'0',
-                data:'2018-02-03',
-                img:require('../../assets/abandon/touxiang1.png')
-            },
-            {
-                id:'7',
-                userName:'赵萸艳',
-                realName:'赵萸艳',
-                sex:'1',
-                type:'2', // 0 管理员 1 平台管理员 2 内容管理员 3 财务管理员 4 兑换码管理员
-                email:'a.ghwrgoh@hlfh.nu',
-                phone:'13273549500',
-                status:'1',
-                data:'2018-02-03',
-                img:require('../../assets/abandon/touxiang1.png')
-            },
-            {
-                userName:'赵萸艳',
-                realName:'赵萸艳',
-                sex:'1',
-                type:'4', // 0 管理员 1 平台管理员 2 内容管理员 3 财务管理员 4 兑换码管理员
-                email:'a.ghwrgoh@hlfh.nu',
-                phone:'13273549500',
-                status:'0',
-                data:'2018-02-03',
-                img:require('../../assets/abandon/touxiang1.png')
-            },
-            {
-                userName:'admin',
-                realName:'超级管理员',
-                sex:'0',
-                type:'0', // 0 管理员 1 平台管理员 2 内容管理员 3 财务管理员 4 兑换码管理员
-                email:'d.dkemi@kqtdgbo.tj',
-                phone:'13082684216',
-                status:'1',
-                data:'2018-02-03',
-                img:''
-            },
-            {
-                userName:'赵萸艳',
-                realName:'赵萸艳',
-                sex:'1',
-                type:'1', // 0 管理员 1 平台管理员 2 内容管理员 3 财务管理员 4 兑换码管理员
-                email:'a.ghwrgoh@hlfh.nu',
-                phone:'13273549500',
-                status:'0',
-                data:'2018-02-03',
-                img:require('../../assets/abandon/touxiang1.png')
-            },
-            {
-                userName:'赵萸艳',
-                realName:'赵萸艳',
-                sex:'1',
-                type:'2', // 0 管理员 1 平台管理员 2 内容管理员 3 财务管理员 4 兑换码管理员
-                email:'a.ghwrgoh@hlfh.nu',
-                phone:'13273549500',
-                status:'1',
-                data:'2018-02-03',
-                img:require('../../assets/abandon/touxiang1.png')
-            },
-            {
-                userName:'赵萸艳',
-                realName:'赵萸艳',
-                sex:'1',
-                type:'4', // 0 管理员 1 平台管理员 2 内容管理员 3 财务管理员 4 兑换码管理员
-                email:'a.ghwrgoh@hlfh.nu',
-                phone:'13273549500',
-                status:'0',
-                data:'2018-02-03',
-                img:require('../../assets/abandon/touxiang1.png')
-            },
-        ],
+        tableData:[],
         pageSize: window.localStorage.getItem('pageSizec')?Number(window.localStorage.getItem('pageSize-people')):10, 
         pageNumber: window.localStorage.getItem('pageNumber-people')?Number(window.localStorage.getItem('pageNumber-people')):1,
         tableHeight: "", // 表格高度

+ 1 - 1
src/views/organize_manage/index.vue

@@ -81,7 +81,7 @@
                         width="112">
                     </el-table-column>
                     <el-table-column
-                        prop="person_count"
+                        prop="person_count_audited"
                         label="成员数"
                         width="85">
                     </el-table-column>

+ 146 - 65
src/views/people_manage/CreatePerson.vue

@@ -27,27 +27,23 @@
             </div>
             <div class="create-bottom">
                 <el-form :model="registerForm" :rules="rulesRegister" ref="registerForm" label-width="100px" class="registerForm" v-if="stepIndex===0">
-                    <el-form-item label="头像" prop="avatar">
-                        <el-upload
-                            class="avatar-uploader"
-                            action="https://jsonplaceholder.typicode.com/posts/"
-                            :show-file-list="false"
-                            :on-success="handleAvatarSuccess"
-                            :before-upload="beforeAvatarUpload">
-                            <el-image v-if="registerForm.avatar" :src="registerForm.avatar" fit="contain"></el-image>
-                            <i v-else class="el-icon-plus avatar-uploader-icon">Upload</i>
-                        </el-upload>
+                    <el-form-item label="头像" prop="cover_image_url">
+                        <upload :datafileList="registerForm.cover_image_list" :changeFillId="handleAvatarSuccess" :fileName="'cover'" :showList="true" uploadType="image" :filleNumber="1" v-if="!registerForm.cover_image_url" />
+                        <div class="cover-box" v-else @mouseover="Imagemouseover('coverFlag',true)" @mouseout="Imagemouseover('coverFlag',false)">
+                            <el-image :src="registerForm.cover_image_url" fit="contain" style="max-width:200px;max-height:200px;"></el-image>
+                            <p v-show="coverFlag" @click="handleDeleteFile('cover',0)"><i class="el-icon-delete"></i></p>
+                        </div>
                     </el-form-item>
                     <el-form-item label="用户名" prop="name">
-                        <el-input v-model="registerForm.name" placeholder="请输入用户名"></el-input>
+                        <el-input v-model="registerForm.name" placeholder="请输入用户名" @blur="handleTrim('registerForm','name')" ></el-input>
                     </el-form-item>
                     <el-form-item label="真实姓名" prop="realName">
-                        <el-input v-model="registerForm.realName" placeholder="请输入真实姓名"></el-input>
+                        <el-input v-model="registerForm.realName" placeholder="请输入真实姓名" @blur="handleTrim('registerForm','realName')"></el-input>
                     </el-form-item>
                     <el-form-item label="性别" prop="sex">
                         <el-radio-group v-model="registerForm.sex">
-                            <el-radio label="0">男</el-radio>
-                            <el-radio label="1">女</el-radio>
+                            <el-radio :label="1">男</el-radio>
+                            <el-radio :label="0">女</el-radio>
                         </el-radio-group>
                     </el-form-item>
                     <el-form-item label="所在省市" prop="selectedOptions">
@@ -59,20 +55,20 @@
                         </el-cascader>
                     </el-form-item>
                     <el-form-item label="备注" prop="desc">
-                        <el-input type="textarea" v-model="registerForm.desc" placeholder="请输入备注" maxlength="100" :rows="4" show-word-limit></el-input>
+                        <el-input type="textarea" v-model="registerForm.desc" placeholder="请输入备注" maxlength="100" :rows="4" show-word-limit @blur="handleTrim('registerForm','desc')"></el-input>
                     </el-form-item>
                     <el-divider content-position="left"></el-divider>
                     <el-form-item label="手机号" prop="phone">
-                        <el-input v-model="registerForm.phone" autocomplete="off" placeholder="请输入完整手机号" >
+                        <el-input v-model="registerForm.phone" autocomplete="off" placeholder="请输入完整手机号" @blur="handleTrim('registerForm','phone')" >
                             <template slot="prepend">+86</template>
                         </el-input>
                     </el-form-item>
                     <el-form-item label="邮箱" prop="email">
-                        <el-input v-model="registerForm.email" autocomplete="off" placeholder="请输入邮箱地址" >
+                        <el-input v-model="registerForm.email" autocomplete="off" placeholder="请输入邮箱地址" @blur="handleTrim('registerForm','email')" >
                         </el-input>
                     </el-form-item>
                     <el-form-item label="账号密码" prop="newPwd">
-                        <el-input v-model="registerForm.newPwd" :type="newPwdFlag?'text':'password'" autocomplete="off" placeholder="请输入密码" >
+                        <el-input v-model="registerForm.newPwd" :type="newPwdFlag?'text':'password'" autocomplete="off" placeholder="请输入密码" @blur="handleTrim('registerForm','newPwd')" >
                             <i slot="suffix" class="el-icon-view show-icon" @click="changeIcon('newPwdFlag')" v-if="newPwdFlag"></i>
                             <i slot="suffix" class="show-icon" @click="changeIcon('newPwdFlag')" v-else>
                                 <svg-icon icon-class="eye-invisible"></svg-icon>
@@ -81,7 +77,7 @@
                         <p class="tips">不少于6位,且必须同时包含数字和大小写字母</p>
                     </el-form-item>
                     <el-form-item label="再次输入" prop="confirmPwd">
-                        <el-input v-model="registerForm.confirmPwd" :type="comfirmPwdFlag?'text':'password'" autocomplete="off" placeholder="请输入密码" >
+                        <el-input v-model="registerForm.confirmPwd" :type="comfirmPwdFlag?'text':'password'" autocomplete="off" placeholder="请输入密码" @blur="handleTrim('registerForm','confirmPwd')" >
                             <i slot="suffix" class="el-icon-view show-icon" @click="changeIcon('comfirmPwdFlag')" v-if="comfirmPwdFlag"></i>
                             <i slot="suffix" class="show-icon" @click="changeIcon('comfirmPwdFlag')" v-else>
                                 <svg-icon icon-class="eye-invisible"></svg-icon>
@@ -98,8 +94,8 @@
                             <td>机构管理</td>
                         </tr>
                         <tr>
-                            <td><el-checkbox v-model="manageAuth" label="people_manage"><br/></el-checkbox></td>
-                            <td><el-checkbox v-model="manageAuth" label="organiza_manage"><br/></el-checkbox></td>
+                            <td><el-checkbox v-model="manageAuth" :label="10001"><br/></el-checkbox></td>
+                            <td><el-checkbox v-model="manageAuth" :label="10002"><br/></el-checkbox></td>
                         </tr>
                     </table>
                     <table class="step-table">
@@ -114,13 +110,13 @@
                             <td class="td1">广告管理</td>
                         </tr>
                         <tr>
-                            <td class="td1"><el-checkbox v-model="contentAuth" label="flow_manage"><br/></el-checkbox></td>
-                            <td class="td1"><el-checkbox v-model="contentAuth" label="pictorial_manage"><br/></el-checkbox></td>
-                            <td class="td1"><el-checkbox v-model="contentAuth" label="album_manage"><br/></el-checkbox></td>
-                            <td class="td1"><el-checkbox v-model="contentAuth" label="evaluation_manage"><br/></el-checkbox></td>
-                            <td class="td1"><el-checkbox v-model="contentAuth" label="workbook_manage"><br/></el-checkbox></td>
-                            <td class="td1"><el-checkbox v-model="contentAuth" label="course_manage"><br/></el-checkbox></td>
-                            <td class="td1"><el-checkbox v-model="contentAuth" label="advertise_manage"><br/></el-checkbox></td>
+                            <td class="td1"><el-checkbox v-model="manageAuth" :label="20001"><br/></el-checkbox></td>
+                            <td class="td1"><el-checkbox v-model="manageAuth" :label="20002"><br/></el-checkbox></td>
+                            <td class="td1"><el-checkbox v-model="manageAuth" :label="20003"><br/></el-checkbox></td>
+                            <td class="td1"><el-checkbox v-model="manageAuth" :label="20004"><br/></el-checkbox></td>
+                            <td class="td1"><el-checkbox v-model="manageAuth" :label="20005"><br/></el-checkbox></td>
+                            <td class="td1"><el-checkbox v-model="manageAuth" :label="20006"><br/></el-checkbox></td>
+                            <td class="td1"><el-checkbox v-model="manageAuth" :label="20007"><br/></el-checkbox></td>
                         </tr>
                     </table>
                     <table class="step-table">
@@ -130,11 +126,11 @@
                             <td>查看兑换码使用情况</td>
                         </tr>
                         <tr>
-                            <td><el-checkbox v-model="codeAuth.auth" label="creatd_code"><br/></el-checkbox></td>
+                            <td><el-checkbox v-model="manageAuth" :label="30001"><br/></el-checkbox></td>
                             <td>
                                 <el-radio-group v-model="codeAuth.viewCode">
-                                    <el-radio label="all">全部</el-radio>
-                                    <el-radio label="self">自己生成的</el-radio>
+                                    <el-radio :label="1">全部</el-radio>
+                                    <el-radio :label="0">自己生成的</el-radio>
                                 </el-radio-group>
                             </td>
                         </tr>
@@ -147,8 +143,8 @@
                             <td>授权地区</td>
                         </tr>
                         <tr>
-                            <td><el-checkbox v-model="financeAuth.auth" label="view_data"><br/></el-checkbox></td>
-                            <td><el-checkbox v-model="financeAuth.auth" label="export_data"><br/></el-checkbox></td>
+                            <td><el-checkbox v-model="manageAuth" :label="40001"><br/></el-checkbox></td>
+                            <td><el-checkbox v-model="manageAuth" :label="40002"><br/></el-checkbox></td>
                             <td>
                                 <el-cascader
                                     class="step-cascader"
@@ -187,10 +183,12 @@ import Breadcrumb from '../../components/Breadcrumb.vue';
 import {
   provinceAndCityData
 } from "element-china-area-data";
+import Upload from "../../components/Upload.vue"
+import { getLogin } from "@/api/ajax";
 
 export default {
   //import引入的组件需要注入到对象中才能使用
-  components: { Header, NavMenu, Breadcrumb },
+  components: { Header, NavMenu, Breadcrumb, Upload },
   props: {},
   data() {
     //这里存放数据
@@ -216,7 +214,7 @@ export default {
             if (result) {
                 callback();
             } else {
-                callback(new Error('密码只能包含数字和字母'));
+                callback(new Error('密码必须同时包含数字和大小写字母'));
             }
             
         }
@@ -262,11 +260,13 @@ export default {
         provinceAndCityData,
         props: { multiple: true },
         registerForm:{
-            avatar: '',
+            cover_image_url: '',
+            cover_image_list: [],
+            cover_image_id: null,
             name:'',
             realName:'',
-            sex:'0',
-            selectedOptions:[],
+            sex:1,
+            selectedOptions:'0305',
             desc:'',
             phone:'',
             email:'',
@@ -286,9 +286,9 @@ export default {
             sex:[
                 { required: true, message: '请选择性别', trigger: 'change' },
             ],
-            selectedOptions: [
-                { type: 'array', required: true, message: '请选择所在省市', trigger: 'change' }
-            ],
+            // selectedOptions: [
+            //     { type: 'array', required: true, message: '请选择所在省市', trigger: 'change' }
+            // ],
             phone:[
                 { required: true, validator: validatePhone, trigger: 'blur' }
             ],
@@ -315,12 +315,13 @@ export default {
         contentAuth:[], // 内容权限
         codeAuth:{
             auth:[],
-            viewCode:''
+            viewCode:0
         }, // 兑换码权限
         financeAuth:{
             auth: [],
-            selectedOptions:[]
+            selectedOptions:''
         }, // 财务权限
+        coverFlag: false,
     }
   },
   //计算属性 类似于data概念
@@ -338,28 +339,28 @@ export default {
         if(type=='-'){
             if(this.stepIndex>0) this.stepIndex--
         }else{
-            if(this.stepIndex<2) this.stepIndex++
+            if(this.stepIndex===0){
+                this.$refs['registerForm'].validate((valid) => {
+                    if (valid) {
+                        this.stepIndex++
+                    } else {
+                        return false;
+                    }
+                });
+            }else if(this.stepIndex===1){
+                this.handleAdd()
+            }
         }
     },
-    handleAvatarSuccess(res, file) {
-        this.registerForm.avatar = URL.createObjectURL(file.raw);
-      },
-      beforeAvatarUpload(file) {
-        const isLt2M = file.size / 1024 / 1024 < 2;
-        if (!isLt2M) {
-          this.$message.error('上传头像图片大小不能超过 2MB!');
-        }
-        return isLt2M;
-      },
-      // 级联选择器
-      handleCity(value){
+    // 级联选择器
+    handleCity(value){
         console.log(value)
-      },
-      changeIcon(flag){
+    },
+    changeIcon(flag){
         this[flag] = !this[flag]
-      },
-      // 返回列表
-      handleback(){
+    },
+    // 返回列表
+    handleback(){
         localStorage.setItem("pageNumber",1)
         this.$router.push({
             path: "/people_manage",
@@ -367,12 +368,73 @@ export default {
                 
             },
         });
-      },
-       //继续创建
-       handleCreate(){
+    },
+    //继续创建
+    handleCreate(){
         this.$router.replace('/createPerson')
         location.reload()
-       }
+    },
+    handleAvatarSuccess(fileList,name) {
+        if(name==='cover'){
+            this.registerForm.cover_image_list = fileList
+            this.registerForm.cover_image_id = fileList[0]&&fileList[0].response&&fileList[0].response.file_info_list&&fileList[0].response.file_info_list[0]?fileList[0].response.file_info_list[0].file_id:''
+            this.registerForm.cover_image_url = fileList[0]&&fileList[0].response&&fileList[0].response.file_info_list&&fileList[0].response.file_info_list[0]?fileList[0].response.file_info_list[0].file_url:''
+        }
+    },
+    Imagemouseover(item,flag) {
+      this[item] = flag
+    },
+    handleDeleteFile(item,i) {
+      this.$confirm("确定删除吗?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      }).then(() => {
+        if(item==='cover'){
+            this.registerForm.cover_image_list.splice(i, 1);
+            this.registerForm.cover_image_url = ''
+            this.registerForm.cover_image_id = null
+        }
+      });
+    },
+    handleAdd(){
+        let MethodName = "/OrgServer/Manager/SysUserManager/AddSysUser";
+        let form = this.registerForm
+        let data = {
+            sys_user:{
+                image_id: form.cover_image_id,
+                user_name: form.name,
+                real_name: form.realName,
+                sex: form.sex,
+                city_id: form.selectedOptions,
+                email: form.email,
+                phone: form.phone,
+                memo: form.desc,
+                password: form.newPwd
+            },
+            popedom_code_list: this.manageAuth,
+            data_scope:{
+                discount_code_view_scope: this.codeAuth.viewCode,
+                finance_popedom_data_scope: {
+                    province_id_list:['03'],
+                    city_id_list:['05'],
+                }
+            }
+        }
+        getLogin(MethodName, data)
+        .then((res) => {
+            if(res.status===1){
+               this.stepIndex++
+            }
+        })
+        .catch(() => {
+            this.loading = false
+        });
+    },
+    // 去掉前后空格
+    handleTrim(form,fild){
+        this[form][fild] = this[form][fild].trim()
+    },
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
@@ -458,6 +520,25 @@ export default {
         }
     }
 }
+.cover-box{
+    position: relative;
+    width: 200px;
+    height: 200px;
+    p{
+        position: absolute;
+        bottom: 0;
+        left: 0;
+        width: 100%;
+        height: 200px;
+        line-height: 200px;
+        font-size: 20px;
+        text-align: center;
+        cursor: pointer;
+        background: rgba(0, 0, 0, 0.3);
+        color: #F2F3F5;
+        margin: 0;
+    }
+}
 </style>
 
 <style lang="scss">

+ 123 - 0
src/views/people_manage/EditPerson.vue

@@ -0,0 +1,123 @@
+<template>
+  <div class="manage-root edit-person" v-if="info">
+    <Header />
+    <div class="manage-root-contain">
+        <nav-menu class="manage-root-contain-left" :activeMenuIndex="activeMenuIndex"></nav-menu>
+        <div class="manage-root-contain-right personnel-manage-right">
+            <breadcrumb :breadcrumbList="breadcrumbList" class="breadcrumb-box"></breadcrumb>
+            <setting page="editPerson" :info="info" @getInfo="getInfo"></setting>
+        </div>
+    </div>
+  </div>
+</template>
+
+<script>
+//这里可以导入其它文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+//例如:import 《组件名称》from ‘《组件路径》';
+import Header from "../../components/Header.vue";
+import NavMenu from "../../components/NavMenu.vue"
+import Breadcrumb from '../../components/Breadcrumb.vue';
+import Setting from "../../components/Setting.vue"
+import {
+  provinceAndCityData
+} from "element-china-area-data";
+import { getLogin } from "@/api/ajax";
+
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: { Header, NavMenu, Breadcrumb, Setting },
+  props: {},
+  data() {
+    //这里存放数据
+    return {
+        provinceAndCityData,
+        activeMenuIndex: "organize_manage",
+        breadcrumbList:[
+            {
+                icon:'contacts-line',
+                url:'',
+                text:''
+            },
+            {
+                icon:'',
+                url:'',
+                text:'系统用户'
+            },
+            {
+                icon:'',
+                url:'',
+                text:'编辑'
+            }
+        ],
+        tableHeight: "", // 表格高度
+        id:this.$route.query.id?this.$route.query.id:'',
+        info: null
+    }
+  },
+  //计算属性 类似于data概念
+  computed: {
+    
+  },
+  //监控data中数据变化
+  watch: {},
+  //方法集合
+  methods: {
+    //计算table高度(动态设置table高度)
+    getTableHeight() {
+      let tableH = 434; //距离页面下方的高度
+      let tableHeightDetil = window.innerHeight - tableH;
+      if (tableHeightDetil <= 300) {
+        this.tableHeight = 300;
+      } else {
+        this.tableHeight = window.innerHeight - tableH;
+      }
+    },
+    // 获取机构信息
+    getInfo(){
+        let MethodName = "/OrgServer/Manager/SysUserManager/GetSysUserInfo";
+        let data = {
+            id: this.id,
+        }
+        getLogin(MethodName, data)
+        .then((res) => {
+            if(res.status===1){
+                this.info = res
+            }
+        })
+        .catch(() => {
+            
+        });
+    },
+  },
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    this.getTableHeight();
+    if(this.id){
+        this.getInfo()
+    }
+    
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {
+
+  },
+  //生命周期-创建之前
+  beforeCreated() { },
+  //生命周期-挂载之前
+  beforeMount() { },
+  //生命周期-更新之前
+  beforUpdate() { },
+  //生命周期-更新之后
+  updated() { },
+  //生命周期-销毁之前
+  beforeDestory() { },
+  //生命周期-销毁完成
+  destoryed() { },
+  //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() { }
+}
+</script>
+<style lang="scss" scoped>
+/* @import url(); 引入css类 */
+
+</style>

+ 16 - 9
src/views/people_manage/index.vue

@@ -92,7 +92,7 @@
                         <template slot-scope="scope">
                             <div class="status-box">
                                 <span :style="{background:statusList[scope.row.status].bg}"></span>
-                                <b :style="{color:statusList[scope.row.status].color}">{{scope.row.status_name}}</b>
+                                <b :style="{color:statusList[scope.row.status].color}">{{statusList[scope.row.status].text}}</b>
                             </div>
                         </template>
                     </el-table-column>
@@ -193,12 +193,12 @@ export default {
             }
         ],
         statusList:{
-            '1':{
+            1:{
                 text:'正常',
                 bg:'#165DFF',
                 color:''
             },
-            '0':{
+            0:{
                 text:'停用',
                 bg:'#F53F3F',
                 color:'#F53F3F'
@@ -260,12 +260,19 @@ export default {
         // 点击时记录页码和每页条数
         window.localStorage.setItem('pageSize',this.pageSize)
         window.localStorage.setItem('pageNumber',this.pageNumber)
-        this.$router.push({
-            path: "/createPerson",
-            query: {
-                id: row?row.id:''
-            },
-        });
+        if(row&&row.id){
+            this.$router.push({
+                path: "/editPerson",
+                query: {
+                    id: row?row.id:''
+                },
+            });
+        }else{
+            this.$router.push({
+                path: "/createPerson"
+            });
+        }
+        
     },
     // 停用 启用
     handleUp(row, index) {