From 091618590e16bc7e3f989944494b49ab6e98b626 Mon Sep 17 00:00:00 2001 From: “dzb” <2632970487@qq.com> Date: 星期三, 21 九月 2022 09:50:49 +0800 Subject: [PATCH] 注册、查看、修改组件顶部背景色改为白色 --- src/views/systemSetting/baseSetting/user/updateUser/index.vue | 172 +++++++++++++++++++++++++++++++-------------------------- 1 files changed, 94 insertions(+), 78 deletions(-) diff --git a/src/views/systemSetting/baseSetting/user/updateUser/index.vue b/src/views/systemSetting/baseSetting/user/updateUser/index.vue index 72f9605..eabcd01 100644 --- a/src/views/systemSetting/baseSetting/user/updateUser/index.vue +++ b/src/views/systemSetting/baseSetting/user/updateUser/index.vue @@ -1,24 +1,21 @@ <template> - <div class="createUser"> - <header> - <div class="headerTitle">鏂板璐︽埛</div> - <div class="headerTip"> - <span>*</span> - <label>涓哄繀濉」</label> - </div> - </header> + <div class="updateUser"> + <!-- <header> + <div class="headerTitle">{{updateFlag ? '淇敼鐢ㄦ埛閮ㄩ棬淇℃伅' :'鏌ョ湅鐢ㄦ埛淇℃伅'}}</div> + </header> --> <main> - <div class="mainTitle">鍩虹淇℃伅</div> + <!-- <div class="mainTitle">鍩虹淇℃伅</div> --> <div class="mainContent"> <el-form ref="user" label-width="140px" autoComplete="on" :model="user" :rules="createUserRules" label-position="right"> <!-- 鐢ㄦ埛鍚嶇О --> - <el-form-item class="optionItem" label="鐢ㄦ埛鍚嶇О:" prop="nickName"> - <el-input v-model="user.nick_name" placeholder="濉啓鐢ㄦ埛鍚嶇О"></el-input> + <el-form-item class="optionItem" label="鐢ㄦ埛鍚嶇О:" prop="username"> + <el-input v-model="user.username" placeholder="濉啓鐢ㄦ埛鍚嶇О" :disabled="true"></el-input> </el-form-item> <!-- 鐢ㄦ埛瀵嗙爜 --> <el-form-item class="optionItems" label="鐢ㄦ埛瀵嗙爜:" prop="password"> - <el-input v-model="user.password" type="password" placeholder="璇疯緭鍏ョ敤鎴峰瘑鐮�"></el-input> + <el-input v-model="user.password" type="password" placeholder="璇疯緭鍏ョ敤鎴峰瘑鐮�" :disabled="true"> + </el-input> </el-form-item> <!-- 鎵�灞炵敤鎴峰鍚� --> <!-- <el-form-item class="optionItem" label="鎵�灞炵敤鎴峰鍚�:" prop="true_name"> @@ -33,18 +30,18 @@ </el-form-item> --> <!-- 鏄惁鍏氬憳 --> <el-form-item class="optionItem" label="鏄惁鍏氬憳:" prop="isDy"> - <el-radio-group v-model="user.member"> + <el-radio-group v-model="user.isDy" disabled> <el-radio :label="1">鏄�</el-radio> <el-radio :label="0">鍚�</el-radio> </el-radio-group> </el-form-item> <!-- 鎵�灞炴墜鏈哄彿鐮� --> <el-form-item class="optionItem" label="鎵�灞炴墜鏈哄彿鐮�:" prop="mobile"> - <el-input v-model="user.phone" placeholder="璇峰~鍐欐墜鏈哄彿鐮�"></el-input> + <el-input v-model="user.mobile" placeholder="璇峰~鍐欐墜鏈哄彿鐮�" :disabled="true"></el-input> </el-form-item> <!-- 閭鍦板潃 --> <el-form-item class="optionItem" label="閭鍦板潃:" prop="email"> - <el-input v-model="user.mail" placeholder="璇峰~鍐欓偖绠卞湴鍧�"></el-input> + <el-input v-model="user.email" placeholder="璇峰~鍐欓偖绠卞湴鍧�" :disabled="true"></el-input> </el-form-item> <!-- 閫夋嫨瑙掕壊 --> <!-- <el-form-item class="optionItem" label="閫夋嫨瑙掕壊:" prop="role"> @@ -56,14 +53,13 @@ </el-form-item> --> <!-- 鐢ㄦ埛绫诲瀷 --> <el-form-item class="optionItem" label="鐢ㄦ埛绫诲瀷:" prop="userType"> - <el-select v-model="user.type" placeholder="璇烽�夋嫨鐢ㄦ埛绫诲瀷"> - <el-option v-for="item in typeList" :key="item.name" :label="item.name" :value="item.value" - :disabled="item.disabled"> + <el-select v-model="user.userType" placeholder="璇烽�夋嫨鐢ㄦ埛绫诲瀷" disabled> + <el-option v-for="item in typeList" :key="item.name" :label="item.name" :value="item.value"> </el-option> </el-select> </el-form-item> <!-- 搴ф満/鍒嗘満 --> - <el-form-item class="optionItem" label="搴ф満/鍒嗘満:" prop="zj"> + <!-- <el-form-item class="optionItem" label="搴ф満/鍒嗘満:" prop="zj"> <div class="optionHandleSp"> <el-input class="areaNumber" v-model="user.zj.areaNumber" placeholder="鐢佃瘽鍖哄彿"> </el-input> @@ -72,19 +68,19 @@ <el-input class="moreNumber" v-model="user.zj.moreNumber" placeholder="鍒嗘満鍙风爜"> </el-input> </div> - </el-form-item> + </el-form-item> --> <!-- 鎵�灞為儴闂� --> <el-form-item class="optionItem" label="鎵�灞為儴闂�:" prop="departmentId"> - <el-select v-model="user.department" placeholder="璇烽�夋嫨鎵�灞為儴闂�"> - <el-option v-for="item in typeList" :key="item.name" :label="item.departName" :value="item.id"> + <el-select v-model="user.department" placeholder="璇烽�夋嫨鎵�灞為儴闂�" :disabled="!updateFlag"> + <el-option v-for="item in typeList" :key="item.name" :label="item.departName" + :value="item.id"> </el-option> </el-select> </el-form-item> <!-- 褰撳墠鑱屽姟 --> <el-form-item class="optionItem" label="褰撳墠鑱屽姟:" prop="jobTitle"> - <el-select v-model="user.work" placeholder="璇烽�夋嫨褰撳墠鑱屽姟"> - <el-option v-for="item in typeList" :key="item.name" :label="item.name" :value="item.value" - :disabled="item.disabled"> + <el-select v-model="user.work" placeholder="璇烽�夋嫨褰撳墠鑱屽姟" disabled> + <el-option v-for="item in typeList" :key="item.name" :label="item.name" :value="item.value"> </el-option> </el-select> </el-form-item> @@ -96,9 +92,11 @@ <!-- <el-form-item class="optionItem" label="濉啓鎵�灞瀒p鍦板潃:" prop="ip"> <el-input v-model="user.ip" placeholder="璇峰~鍐欐墍灞瀒p鍦板潃"></el-input> </el-form-item> --> - <el-form-item class="optionBtn"> - <el-button type="primary" class="btn submit" @click.native.prevent="handleUser">鎻愪氦</el-button> - <el-button class="btn reset">閲嶇疆</el-button> + <el-form-item v-if="updateFlag"> + <div class="optionBtn"> + <el-button type="primary" class="btn submit" @click.native.prevent="handleUser">鎻愪氦 + </el-button> + </div> </el-form-item> </el-form> @@ -119,7 +117,7 @@ callback(new Error("璇峰~鍐欑櫥褰曞瘑鐮�")); } else { const rep = /^\w+$/; - if(!rep.test(value)){ + if (!rep.test(value)) { callback(new Error("瀵嗙爜鍙兘鏄互鏁板瓧銆�26涓嫳鏂囧瓧姣嶆垨鑰呬笅鍒掔嚎缁勬垚鐨勫瓧绗︿覆")); } } @@ -129,7 +127,7 @@ callback(new Error("璇峰~鍐欑敤鎴峰鍚�")); } else { const rep = /^[\u4E00-\u9FA5]{2,4}$/; - if(!rep.test(value)){ + if (!rep.test(value)) { callback("璇疯緭鍏ユ纭殑鐢ㄦ埛濮撳悕"); } } @@ -139,7 +137,7 @@ callback(new Error("璇峰~鍐欐墜鏈哄彿鐮�")); } else { const rep = /(^1[3|4|5|7|8|9]\d{9}$)|(^09\d{8}$)/ - if(!rep.test(value)){ + if (!rep.test(value)) { callback("璇疯緭鍏ユ纭殑鎵嬫満鍙风爜"); } } @@ -147,7 +145,7 @@ const validateMail = (rule, value, callback) => { if (value) { const rep = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/; - if(!rep.test(value)){ + if (!rep.test(value)) { callback(new Error("璇疯緭鍏ユ纭殑閭")) } } @@ -265,8 +263,9 @@ typeList: [] } }, - created() { - const that = this ; + created() { + const that = this; + this.user = JSON.parse(JSON.stringify(that.userInfo)); // 鑾峰彇瑙掕壊鍒楄〃 // this.$axios.get('') // 鑾峰彇鐢ㄦ埛绫诲瀷鍒楄〃 @@ -274,64 +273,67 @@ // console.log(res); // }) // 鑾峰彇鍏ㄩ儴閮ㄩ棬鍒楄〃 - this.$axios.get('sccg/depart/page').then(res=>{ + this.$axios.get('sccg/depart/page').then(res => { that.typeList = res.data.records; }) }, methods: { handleUser() { - const that = this; - console.log(this.user); - // this.$axios.post('sccg/admin/register',that.user).then(res=>{ - // console.log(res); - // }) + const { user } = this; + this.$axios.post('sccg/depart/status', { + id: user.departmentId, + status: user.status ? 1 : 0, + }).then(res => { + console.log(res); + }) } }, - props:[] + props: ['userInfo', 'updateFlag'] } </script> -<style lang="scss" scpoed> -.createUser { +<style lang="scss" scoped> +.updateUser { border-radius: 1px; - // min-width: 1024px; - // min-height: 1450px; - background-color: #fff; + background-color: #09152f; - header { - display: flex; - justify-content: space-between; - height: 60px; - line-height: 60px; - padding: 0 20px; - .headerTitle { - font-weight: 600; - color: #666; - } + // header { + // display: flex; + // justify-content: center; + // height: 60px; + // line-height: 60px; + // padding: 0 20px; + // border: 1px solid #fff; + // .headerTitle { + // color: #4b9bb7; + // font-weight: 600; + // } - .headerTip span { - color: #ff3b6c; - } + // .headerTip span { + // color: #ff3b6c; + // } - .headerTip label { - color: #999999; - } - } + // .headerTip label { + // color: #4b9bb7; + // } + // } main { - border-top: 1px solid #f0f2f5; + // border: 1px solid #fff; text-align: left; padding: 0 55px; - .mainTitle { - // margin-left: 60px; - color: #666; - font-weight: 600; - line-height: 100px; - font-size: 14px; - } + background-color: #09152f; + padding-bottom: 50px; + // .mainTitle { + // color: #4b9bb7; + // font-weight: 600; + // line-height: 100px; + // font-size: 14px; + // } .mainContent { display: flex; justify-content: center; + padding-top: 50px; .el-form-item__content { width: 400px; @@ -339,20 +341,25 @@ width: 100%; } } - .optionHandleSp{ + + .optionHandleSp { display: flex; - .areaNumber,.moreNumber{ + + .areaNumber, + .moreNumber { flex: 1; } - .telNumber{ + + .telNumber { flex: 2; } } - .optionBtn{ + + .optionBtn { display: flex; - justify-content: center; - margin-top: 80px; - .btn{ + margin-top: 20px; + + .btn { padding: 12px 50px; } } @@ -360,4 +367,13 @@ } } } + +.updateUser::v-deep .el-form-item__label { + color: #4b9bb7; +} + +.updateUser::v-deep .el-input__inner { + background-color: #09152f; + border: 1px solid #17324c; +} </style> \ No newline at end of file -- Gitblit v1.8.0