dukai il y a 3 ans
Parent
commit
8a7bfc3457

+ 23 - 8
src/views/system/employeenInfo/index.vue

@@ -9,8 +9,8 @@
 					<el-input v-model="queryParams.phonenumber" placeholder="请输入电话号码" clearable size="small" style="width: 240px" @keyup.enter.native="handleQuery" />
 				</el-form-item>
 				<el-form-item>
-					<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-					<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+					<el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
+					<el-button icon="el-icon-refresh" size="small" @click="resetQuery">重置</el-button>
 				</el-form-item>
 			</el-form>
 		</div>
@@ -24,22 +24,22 @@
 					</div>
 					<!-- 操作 -->
 					<div class="actions">
-						<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:user:add']">添加</el-button>
+						<el-button type="primary" icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['system:user:add']">添加</el-button>
 						<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['system:user:export']">导出</el-button>
 						<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="handleImport" v-hasPermi="['system:user:import']" style="margin-right: 10px">导入</el-button>
 						<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
 					</div>
 				</div>
 				<!-- 员工列表 -->
-				<el-table v-loading="loading" border :data="userList">
+				<el-table v-loading="loading" border :data="userList" >
 					<el-table-column label="序号" align="center" prop="userId" v-if="columns[0].visible" width="60">
 						<template slot-scope="scope">
 							<span>{{ scope.$index + 1 }}</span>
 						</template>
 					</el-table-column>
-					<el-table-column label="头像" align="center" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" width="90" >
-						<template>
-							<span></span>
+					<el-table-column label="头像" align="center" v-if="columns[1].visible" width="60">
+						<template slot-scope="scope">
+							<img v-bind:src="$store.getters.avatar" class="img-circle img_height" @click="modifyAvatar(scope.row)"/>
 						</template>
 					</el-table-column>
 					<el-table-column label="姓名" align="center" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" width="120" />
@@ -575,6 +575,9 @@
 			</div>
 			<el-input type="textarea" :rows="3" readonly placeholder="请输入内容"> </el-input>
 		</el-dialog>
+
+		<!-- 修改头像对话框 -->
+		<userAvatar ref="userAvatar" />
 	</div>
 </template>
 
@@ -582,6 +585,7 @@
 import { listUser, getUser, delUser, addUser, updateUser } from '@/api/system/user'
 import { getToken } from '@/utils/auth'
 import { treeselect } from '@/api/system/dept'
+import userAvatar from './profile/userAvatar.vue'
 import Treeselect from '@riophae/vue-treeselect'
 import TreeChoice from '@/components/treeChoice/index.vue'
 import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@@ -589,7 +593,7 @@ import '@riophae/vue-treeselect/dist/vue-treeselect.css'
 export default {
 	name: 'User',
 	dicts: ['sys_normal_disable', 'sys_user_sex'],
-	components: { Treeselect, TreeChoice },
+	components: { Treeselect, TreeChoice, userAvatar },
 	data() {
 		return {
 			// 遮罩层
@@ -792,6 +796,11 @@ export default {
 			this.accountShow = false
 			this.basicsShow = true
 		},
+		// 修改头像
+		modifyAvatar(row) {
+			// console.log(123)
+			this.$refs.userAvatar.editCropper()
+		},
 		/** 修改按钮操作 */
 		handleUpdate(row) {
 			this.reset()
@@ -916,6 +925,12 @@ export default {
 	overflow: auto;
 	height: 600px;
 }
+.img_height{
+	height: 32px;
+	width: 32px;
+	vertical-align: middle;
+	cursor: pointer;
+}
 .el-col-lg-4-8 {
 	width: 20%;
 }

+ 1 - 1
src/views/system/employeenInfo/profile/userAvatar.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <div class="user-info-head" @click="editCropper()"><img v-bind:src="options.img" title="点击上传头像" class="img-circle img-lg" /></div>
+    <!-- <div class="user-info-head" @click="editCropper()"><img v-bind:src="options.img" title="点击上传头像" class="img-circle img-lg" /></div> -->
     <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body @opened="modalOpened"  @close="closeDialog">
       <el-row>
         <el-col :xs="24" :md="12" :style="{height: '350px'}">