From 3e091224ab26252d8624b42b461ba773ee8bee0f Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期日, 03 十一月 2024 19:16:31 +0800
Subject: [PATCH] update

---
 src/views/master/person/main/personPerson.vue |   57 +++++++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 47 insertions(+), 10 deletions(-)

diff --git a/src/views/master/person/main/personPerson.vue b/src/views/master/person/main/personPerson.vue
index 26aeaa0..181f165 100644
--- a/src/views/master/person/main/personPerson.vue
+++ b/src/views/master/person/main/personPerson.vue
@@ -2,7 +2,7 @@
  * @Author: lzhe lzhe@example.com
  * @Date: 2024-03-26 10:28:33
  * @LastEditors: lzhe lzhe@example.com
- * @LastEditTime: 2024-09-23 16:27:33
+ * @LastEditTime: 2024-10-09 13:56:01
  * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/master/person/main/personPerson.vue
  * @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 -->
@@ -62,7 +62,13 @@
 								:show-file-list="false"
 								:on-success="(file)=>handleAvatarSuccess(file,scope.$index)"
 								:before-upload="(file)=>beforeAvatarUpload(file,scope.$index)">
-								<img v-if="scope.row.avatar" :src="scope.row.avatar" class="avatar">
+								<div v-if="scope.row.avatar" style="position: relative;">
+									<img :src="scope.row.avatar" class="avatar">
+									<div class="el-icon-editDom">
+										<span class="el-icon-edit">缂栬緫</span>
+										<span class="el-icon-del" @click.stop="avatarDel(scope.$index)">鍒犻櫎</span>
+									</div>
+								</div>
 								<el-icon v-else class="el-icon-plus avatar-uploader-icon"><Picture /></el-icon>
 							</el-upload>
 						</template>
@@ -161,8 +167,8 @@
 	data() {
 		return {
 			authorization: {},
-			uploadUrl: "/api/blade-cps/employee/import-employee",
-			exportUrl: "/api/blade-cps/employee/export-template",
+			uploadUrl: "/api/smis/employee/import-employee",
+			exportUrl: "/api/smis/employee/export-template",
 			titleList: [],
 			delPersonModel: false,
 			searchIcon: "el-icon-search",
@@ -210,10 +216,17 @@
 		saveDialog, importTable,...ElementPlusIconsVue
 	},
 	methods: {
+		avatarDel(index) {
+			var obj = this.tableData[index];
+			obj.avatar = "";
+			this.$HTTP.post(`/api/smis/employee/submit`,obj).then(res=> {
+				this.searchPerson();
+			})
+		},
 		handleAvatarSuccess(file,index) {
 			var obj = this.tableData[index];
 			obj.avatar = file.data.link;
-			this.$HTTP.post(`/api/blade-cps/employee/submit`,obj).then(res=> {
+			this.$HTTP.post(`/api/smis/employee/submit`,obj).then(res=> {
 				this.searchPerson();
 			})
 		},
@@ -227,7 +240,7 @@
 			return isJPG;
 		},
 		getExport() {
-			this.$HTTP.get(`/api/blade-cps/employee/export-employee?` + this.$TOOL.qsStringify(this.searchData)).then(res => {
+			this.$HTTP.get(`/api/smis/employee/export-employee?` + this.$TOOL.qsStringify(this.searchData)).then(res => {
 				if (res.code == 200) {
 					window.open(res.data.link);
 				}
@@ -256,7 +269,7 @@
 			this.searchPerson();
 		},
 		getOrganizationList() {  //閮ㄩ棬
-			this.$HTTP.get(`/api/blade-cps/organization/tree?groupType=group_organization&groupCategory=1`).then(res => {
+			this.$HTTP.get(`/api/smis/organization/tree?groupType=group_organization&groupCategory=1`).then(res => {
 				if (res.code == 200) {
 					this.titleList = res.data;
 					this.titleList[0].active = true;
@@ -280,7 +293,7 @@
 			})
 		},
 		delData(type) {
-			this.$HTTP.post(`/api/blade-cps/employee/remove?ids=${this.selectId}&type=${type}`).then(res => {
+			this.$HTTP.post(`/api/smis/employee/remove?ids=${this.selectId}&type=${type}`).then(res => {
 				if (res.code == 200) {
 					this.$message.success("鎿嶄綔鎴愬姛");
 					this.delPersonModel = false;
@@ -298,7 +311,7 @@
 			this.searchPerson();
 		},
 		searchPerson() {
-			this.$HTTP.get(`/api/blade-cps/employee/list?` + this.$TOOL.qsStringify(this.searchData)).then(res => {
+			this.$HTTP.get(`/api/smis/employee/list?` + this.$TOOL.qsStringify(this.searchData)).then(res => {
 				if (res.code == 200) {
 					res.data.records.forEach(item => {
 						if (item.dictValue == "鍦ㄨ亴") {
@@ -324,7 +337,7 @@
 			})
 			this.$refs.dialogForm.validate(async (valid) => {
 				if (valid) {
-					this.$HTTP.put(`/api/blade-cps/employee/change-organization?organizationId=${this.departmentFrom.parentId}&employeeIds=${employeeIds.join(",")}`).then(res => {
+					this.$HTTP.put(`/api/smis/employee/change-organization?organizationId=${this.departmentFrom.parentId}&employeeIds=${employeeIds.join(",")}`).then(res => {
 						if (res.code == 200) {
 							this.searchPerson();
 							this.departmentVisible = false;  //閮ㄩ棬璋冩暣
@@ -597,6 +610,30 @@
 		text-align: center;
 		background-color: #c0c4cc;
 	}
+	.el-icon-editDom {
+		position: absolute;
+		left: 4px;
+		top: 56px;
+		font-weight: 700;
+		color: #409eff;
+	}
+	.el-icon-editDom span {
+		margin: 0;
+		padding: 0;
+		font-size: 12px;
+		line-height: 18px;
+		border: 1px solid #409eff;
+		background: #fff;
+		padding-left: 2px;
+    	padding-right: 2px;
+		cursor: pointer;
+	}
+	.el-icon-editDom .el-icon-edit {
+		margin-right: 4px;
+	}
+	.el-icon-editDom .el-icon-del {
+		
+	}
 	.avatar {
 		width: 80px;
 		height: 80px;

--
Gitblit v1.9.3