From 90b6b8c9e342d07e8a7121d732900287d997a8b6 Mon Sep 17 00:00:00 2001
From: feige <791364011@qq.com>
Date: 星期一, 03 三月 2025 22:57:35 +0800
Subject: [PATCH] Merge branch 'master' of http://47.93.189.255:8099/r/zhangshi_app_web
---
ruoyi-ui/src/views/system/user/profile/index.vue | 442 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 418 insertions(+), 24 deletions(-)
diff --git a/ruoyi-ui/src/views/system/user/profile/index.vue b/ruoyi-ui/src/views/system/user/profile/index.vue
index ad530f9..f728a33 100644
--- a/ruoyi-ui/src/views/system/user/profile/index.vue
+++ b/ruoyi-ui/src/views/system/user/profile/index.vue
@@ -1,53 +1,59 @@
<template>
- <div class="app-container">
+ <div class="app-container" style="background-color: #FEF7FC;">
<el-row :gutter="20">
- <el-col :span="6" :xs="24">
- <el-card class="box-card">
+ <el-col :span="8" :xs="24" >
+ <el-card class="box-card" style="background-color: #EBF4FE;">
<div slot="header" class="clearfix">
<span>涓汉淇℃伅</span>
</div>
<div>
<div class="text-center">
- <userAvatar :user="user" />
- </div>
+ <el-avatar shape="square" style="width: 200px;;height: 200px;" >
+ <el-image
+ :src="'https://www.bendudu.com:8080/'+ user.url"
+ :fit="fit" style="width: 100%;height: 100%;border-radius: 0px 0px 0px 0px;opacity: 1;border: 1px solid rgba(0,0,0,0.5);"
+ ></el-image>
+
+
+ </el-avatar> </div >
<ul class="list-group list-group-striped">
<li class="list-group-item">
- <svg-icon icon-class="user" />鐢ㄦ埛鍚嶇О
- <div class="pull-right">{{ user.userName }}</div>
+ 鐢ㄦ埛鍚嶇О
+ <div class="pull-right">{{ user.nickName }}</div>
</li>
<li class="list-group-item">
- <svg-icon icon-class="phone" />鎵嬫満鍙风爜
- <div class="pull-right">{{ user.phonenumber }}</div>
+ 鎵嬫満鍙风爜
+ <div class="pull-right">{{ user.phoneNumber }}</div>
</li>
<li class="list-group-item">
- <svg-icon icon-class="email" />鐢ㄦ埛閭
+ 鐢ㄦ埛閭
<div class="pull-right">{{ user.email }}</div>
</li>
<li class="list-group-item">
- <svg-icon icon-class="tree" />鎵�灞為儴闂�
- <div class="pull-right" v-if="user.dept">{{ user.dept.deptName }} / {{ postGroup }}</div>
+ 鎵�灞炲搴�
+ <div class="pull-right" >{{ user.familyName }} </div>
</li>
<li class="list-group-item">
- <svg-icon icon-class="peoples" />鎵�灞炶鑹�
- <div class="pull-right">{{ roleGroup }}</div>
+ 鎵�灞炶鑹�
+ <div class="pull-right">{{ user.roleName }}</div>
</li>
<li class="list-group-item">
- <svg-icon icon-class="date" />鍒涘缓鏃ユ湡
+ 鍒涘缓鏃ユ湡
<div class="pull-right">{{ user.createTime }}</div>
</li>
</ul>
</div>
</el-card>
</el-col>
- <el-col :span="18" :xs="24">
- <el-card>
+ <el-col :span="16" :xs="24" >
+ <el-card style="background-color: #FFF5F7;">
<div slot="header" class="clearfix">
<span>鍩烘湰璧勬枡</span>
</div>
- <el-tabs v-model="activeTab">
- <el-tab-pane label="鍩烘湰璧勬枡" name="userinfo">
+ <el-tabs v-model="activeTab" >
+ <!-- <el-tab-pane label="鍩烘湰璧勬枡" name="userinfo">
<userInfo :user="user" />
- </el-tab-pane>
+ </el-tab-pane> -->
<el-tab-pane label="淇敼瀵嗙爜" name="resetPwd">
<resetPwd />
</el-tab-pane>
@@ -55,37 +61,425 @@
</el-card>
</el-col>
</el-row>
+ <div style="padding-top: 20px; background-color: #F4FFF8;">
+
+ <el-divider></el-divider>
+ <div v-if="roleJudge">
+ <el-form ref="form" :model="form" :rules="rules" label-width="100px">
+ <el-row>
+ <el-col :span="10" :xs="24">
+ <el-form-item label="鑿滃崟鏉冮檺">
+ <el-tree
+ class="tree-border"
+ :data="menuOptions"
+ show-checkbox
+ ref="authr"
+ node-key="id"
+:default-expand-all="true"
+
+ empty-text="鍔犺浇涓紝璇风◢鍊�"
+ :props="defaultProps"
+ ></el-tree> </el-form-item>
+ </el-col>
+ <el-col :span="4" :xs="24" type="flex" align="middle">鍙互鎺堟潈鐩稿叧浜哄憳</el-col>
+ <el-col :span="10" :xs="24">
+ <el-tree
+ class="tree-border"
+ :data="menuOptions1"
+ show-checkbox
+ ref="peoInfo"
+ node-key="id"
+
+ empty-text="鍔犺浇涓紝璇风◢鍊�"
+ :props="defaultProps"
+ ></el-tree>
+ </el-col>
+</el-row>
+<el-button type="primary" @click="upAuthority">鎺堟潈</el-button>
+ </el-form>
+ </div>
+ <el-divider></el-divider>
+ <div v-if="roleJudge">
+ <el-form>
+ <el-row>
+ <el-col :span="10" :xs="24">
+ <el-form-item label="鏀跺洖鏉冮檺">
+ <el-select v-model="st" placeholder="璇烽�夋嫨鑿滃崟" @change="handleChange">
+ <el-option v-for="mo in menuOptions2" :label="mo.label" :value="mo.id" :key="mo.id"></el-option>
+ </el-select>
+
+
+ </el-form-item>
+ </el-col>
+ <el-col :span="4" :xs="24" class="centered">宸茬粡鎺堟潈鐩稿叧浜哄憳</el-col>
+ <el-col :span="10" :xs="24">
+ <el-form-item label="宸茬粡鎺堟潈鐩稿叧鎴愬憳">
+ <el-tree
+ class="tree-border"
+ :data="menuOptionsp"
+ show-checkbox
+ ref="spp"
+ node-key="id"
+ :default-expand-all="true"
+
+ empty-text="鍔犺浇涓紝璇风◢鍊�"
+ :props="defaultProps"
+ ></el-tree> </el-form-item>
+ </el-col>
+ </el-row>
+ <el-button type="primary" @click="deleteAuthority">鏀跺洖鎺堟潈</el-button>
+ </el-form>
+ </div>
+ </div>
+
+
</div>
+
</template>
<script>
import userAvatar from "./userAvatar";
import userInfo from "./userInfo";
import resetPwd from "./resetPwd";
-import { getUserProfile } from "@/api/system/user";
+import { getAllInfo,getUserProfile ,getSelfPermission,getFamilyids,setAuority
+,getUserByFidAid,deleteUserByFidAid} from "@/api/system/user";
+import { getIndividualList } from "@/api/self";
+import {updateFamilyevent} from "@/api/bignote";
export default {
name: "Profile",
components: { userAvatar, userInfo, resetPwd },
data() {
return {
+ roleJudge:false,
+ formDat: {
+ familyName: undefined,
+ modelName: undefined,
+ },
+ fid: undefined,
+ st: undefined,
+ menuOptionsp:[
+ {
+ id: 1,
+ label: '瀹跺涵鎴愬憳',
+ children:[]
+ }
+ ],
+ menuOptions2:[
+ {
+ id: 2000,
+ label: '瀹跺涵璧勪骇绠$悊',
+
+ },
+ {
+ id: 2012,
+ label: '瀹跺ぇ浜嬭',
+ },
+ { id:2016,
+ label: '瀹跺涵璁惧',
+ },
+ {
+ id: 2004,
+ label: '鏀惰棌鍜岃崳瑾�',
+
+ },
+ {
+ id: 2029,
+ label: '瀹跺涵灏忓尰鐢�',
+ },
+ { id:2024,
+ label: '淇濇磥鏀剁撼',
+ },
+ {
+ id: 2021,
+ label: '閫氳褰�',
+ },
+ { id:2033,
+ label: '榄呭疇',
+ },
+ {id:2008,
+ label: '瀹跺涵鏀舵敮鍙拌处',
+ }
+ ],
+ menuOptions1:[
+ {
+ id: 1,
+ label: '瀹跺涵鎴愬憳',
+ children:[]
+ }
+ ],
+ menuOptions:[
+ {
+ id: 1,
+ label: '瀹跺涵妯″潡',
+ children: [
+ {
+ id: 2000,
+ label: '瀹跺涵璧勪骇绠$悊',
+
+ },
+ {
+ id: 2012,
+ label: '瀹跺ぇ浜嬭',
+ },
+ { id:2016,
+ label: '瀹跺涵璁惧',
+ },
+ {
+ id: 2004,
+ label: '鏀惰棌鍜岃崳瑾�',
+
+ },
+ {
+ id: 2029,
+ label: '瀹跺涵灏忓尰鐢�',
+ },
+ { id:2024,
+ label: '淇濇磥鏀剁撼',
+ },
+ {
+ id: 2021,
+ label: '閫氳褰�',
+ },
+ { id:2033,
+ label: '榄呭疇',
+ },
+ {id:2008,
+ label: '瀹跺涵鏀舵敮鍙拌处',
+ }
+ ],
+ },
+ ],
+ FaimlyList:undefined,
+ FaimlyList1:undefined,
+ selectedFamily: "涓�鍙峰搴�",
+ id:'',
+ command1:undefined,
+ selectedTab:"瀹舵牴缃�",// 鍒濆鍖栭�変腑鐨勫搴负绌哄瓧绗︿覆
+ selectedTab1:"瀹舵牴缃�",// 鍒濆鍖栭�変腑鐨勫搴负绌哄瓧绗︿覆
+ SelfPermission:undefined,
+ SelfPermissionList:{
+ insert:undefined,
+ delete:undefined,
+ search:undefined,
+ update:undefined,
+ },
user: {},
roleGroup: {},
postGroup: {},
- activeTab: "userinfo"
+ activeTab: "resetPwd",
+ activeTab1:"瀹舵牴缃�"
};
},
+
created() {
this.getUser();
+ this.getList();
},
methods: {
- getUser() {
- getUserProfile().then(response => {
+ deleteAuthority(){
+ // alert(this.st)
+ let uidKeys = this.$refs.spp.getCheckedKeys();
+ let auIds = []
+ auIds.push(this.st)
+ let data = {
+ uids: uidKeys,
+ fid: this.fid,
+ authoritys: auIds
+ }
+ let _this = this
+ if(this.st!=undefined&&uidKeys.length!=0){
+ deleteUserByFidAid(data).then(response=>{
+ this.$modal.msgSuccess(response.msg)
+ let data = {
+ "fid": _this.fid,
+ "authority": _this.st
+ }
+ // alert(data.authority)
+ // let _this = this
+ this.menuOptionsp[0]['children'] = []
+ getUserByFidAid(data).then(response=>{
+ console.log(response)
+ let fams = response.data;
+ for(let i = 0 ; i < fams.length; i++)
+ _this.menuOptionsp[0]['children'].push({id:fams[i].userId,label:fams[i].nickName })
+
+ })
+ })
+ }
+ else{
+ this.$modal.msgSuccess("鏉冮檺鎴栬鎺堟潈浜轰笉鑳戒负绌猴紒")
+ }
+ },
+ getDeptAllCheckedKeys() {
+ // 鐩墠琚�変腑鐨勯儴闂ㄨ妭鐐�
+ let checkedKeys = this.$refs.authr.getCheckedKeys();
+ // console.log(checkedKeys)
+ },
+ upAuthority(){
+ let checkedKeys = this.$refs.authr.getCheckedKeys();
+ let peoKeys = this.$refs.peoInfo.getCheckedKeys();
+ console.log(peoKeys)
+ console.log(checkedKeys)
+
+ //alert(this.fid)
+ // alert(checkedKeys.length)
+
+ // this.getDeptAllCheckedKeys()
+ if(checkedKeys.length!=0&&peoKeys.length!=0)
+ {
+ let data = {
+ uids: peoKeys,
+ fid: this.fid,
+ authoritys: checkedKeys
+ }
+ // console.log(data)
+ // alert(123)
+ setAuority(data).then(response=>{
+ // console.log(response)
+ this.$modal.msgSuccess(response.msg)
+ // alert(response.data)
+ })
+ }
+ else{
+ this.$modal.msgSuccess("鏉冮檺鎴栬鎺堟潈浜轰笉鑳戒负绌猴紒");
+ }
+ },
+ handleChange(value){
+
+ let data = {
+ "fid": this.fid,
+ "authority": value
+ }
+ this.menuOptionsp[0]['children'] = []
+ // alert(data.authority)
+ let _this = this
+ getUserByFidAid(data).then(response=>{
+ console.log(response)
+ let fams = response.data;
+ for(let i = 0 ; i < fams.length; i++)
+ _this.menuOptionsp[0]['children'].push({id:fams[i].userId,label:fams[i].nickName })
+
+ })
+ },
+ handleTabClick(tab) {
+ this.selectedTab = tab.label;
+ if (this.selectedFamily && this.selectedTab) {
+ this.getList();
+ }
+ },
+ handleTabClick1(tab) {
+ this.selectedTab1 = tab.label;
+ },
+ handleDropdownCommand(command) {
+ // this.selectedFamily = command; // 鏇存柊閫変腑鐨勫搴�
+ // console.log(this.selectedFamily)
+ // // 妫�鏌ヤ笅鎷夎彍鍗曞拰鍒囩墖椤甸潰鏄惁閮借閫変腑
+ // if (this.selectedFamily && this.selectedTab) {
+ // this.getList();
+ // }
+ },
+ handleDropdownCommand1(command1) {
+ // this.command1= command1;
+ // console.log(command1)
+ // let id = null;
+ // if (command1 == '涓�鍙峰搴�') {
+ // id = 1;
+ // } else if (command1 == '浜屽彿瀹跺涵') {
+ // id = 2;
+ // } else if (command1 == '涓夊彿瀹跺涵') {
+ // id = 3;
+ // } else if (command1 == '鍥涘彿瀹跺涵') {
+ // id = 4;
+ // }
+ // if (id) {
+ // this.getUser(parseInt(id)); // 灏唅d杞崲涓烘暟瀛楃被鍨�
+ // }
+ },
+
+
+ getUser(id) {
+
+ // getUserProfile().then(response => {
+ // this.user = response.data;
+ // this.roleGroup = response.roleGroup;
+ // this.postGroup = response.postGroup;
+ // });
+
+ // getFamilyids(id).then(response => {
+ // console.log(id)
+ // // this.FaimlyList = response.data;
+ // console.log("鎵撳嵃瀹跺涵鎴愬憳搴忓垪"+id)
+ // console.log(this.FaimlyList)
+ // });
+ // alert(id)
+ getIndividualList().then(response => {
this.user = response.data;
+ console.log(this.user,'useruseruser')
+ if(response.data.roleId==3)
+ this.roleJudge = true;
+ // alert(890)
+ this.fid = response.data.familyId
+ // alert(this.fid)
this.roleGroup = response.roleGroup;
this.postGroup = response.postGroup;
});
+ // if (this.user.familyName='涓�鍙峰搴�'){
+ // id=1;
+ // getFamilyids(id).then(response => {
+ // console.log(id)
+ // this.FaimlyList1 = response.data;
+ // console.log("鎵撳嵃瀹跺涵鎴愬憳搴忓垪"+id)
+ // console.log(this.FaimlyList)
+ // });
+ // }
+
+
+
+ },
+ getList() {
+
+ let _this = this
+ let clanId = this.$store.state.user.clanId
+ if(clanId==null)
+ return
+ getAllInfo(clanId).then(response=>{
+ let fams = response.data
+ // console.log(fams)
+ // console.log("++++++++++++++++++++++++==")
+ for(let i = 0; i < fams.length; i++)
+ _this.menuOptions1[0]['children'].push({id:fams[i].userId,label:fams[i].nickName })
+ })
+// var formData ={
+// "familyName": this.selectedFamily,
+// "modelName":this.selectedTab,
+// }
+
+// var jsonString = JSON.stringify(formData);
+// // console.log(jsonString);
+
+// getSelfPermission(jsonString).then(response => {
+// this.SelfPermissionList = response.data;
+// console.log(this.SelfPermissionList)
+// });
+
}
}
+
};
</script>
+<style>
+.container {
+ display: flex;
+}
+.centered {
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ text-align: center;
+}
+.el-icon-arrow-down {
+ font-size: 12px;
+}
+</style>
--
Gitblit v1.9.1