|
@@ -60,7 +60,9 @@
|
|
|
<div class="checkbox-left">
|
|
|
<label class="checkbox-label">
|
|
|
<!-- 学校名称,显示 school.name -->
|
|
|
- <a>{{ school.name }}</a>
|
|
|
+ <el-tooltip class="item" effect="dark" :content="school.name" placement="top">
|
|
|
+ <a>{{ school.name }}</a>
|
|
|
+ </el-tooltip>
|
|
|
<a style="color: gray;font-size: 13px;margin: 0px"> - {{ school.orgName ? school.orgName :
|
|
|
'暂无组织' }}</a>
|
|
|
</label>
|
|
@@ -1060,7 +1062,7 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
//确认移动
|
|
|
- ajax_confirm() {
|
|
|
+ async ajax_confirm() {
|
|
|
// 获取选择的组织ID,确保 orgId 在调用之前已经定义
|
|
|
let orgId = this.school.OrgId || ""; // 如果没有选择组织,则为空字符串
|
|
|
|
|
@@ -1068,6 +1070,16 @@ export default {
|
|
|
const selectedSchoolObject = this.cn_school.find(
|
|
|
(school) => school.id === this.selectedSchool
|
|
|
);
|
|
|
+ console.log('selectedSchoolObject',selectedSchoolObject);
|
|
|
+
|
|
|
+ let suffix = await this.getSuffix({oid:selectedSchoolObject.id,org:selectedSchoolObject.org})
|
|
|
+ console.log(suffix);
|
|
|
+ console.log('opUser',this.opUser);
|
|
|
+
|
|
|
+ let userAcc = this.opUser.account
|
|
|
+ if (suffix) {
|
|
|
+ userAcc = this.getEmailBeforeAt(userAcc) + suffix
|
|
|
+ }
|
|
|
|
|
|
// 判断学校ID是否为空
|
|
|
if (!selectedSchoolObject || !selectedSchoolObject.id) {
|
|
@@ -1089,9 +1101,12 @@ export default {
|
|
|
u_id: this.check_user_id, // 使用this.check_user_id来获取用户id
|
|
|
o_id: orgId || "", // 选择的组织的 ID,绑定到 school.parentOrgId,如果没有选择则为空
|
|
|
s_id: selectedSchoolObject.id, // 选中的学校的id
|
|
|
+ u_acc: userAcc, //账号
|
|
|
},
|
|
|
];
|
|
|
|
|
|
+ console.log('params',params);
|
|
|
+ // return
|
|
|
// 发起请求
|
|
|
this.$ajax
|
|
|
.post(API_CONFIG.baseUrl, params)
|
|
@@ -1141,41 +1156,52 @@ export default {
|
|
|
this.getSuffix()
|
|
|
this.$forceUpdate()
|
|
|
},
|
|
|
- getSuffix() {
|
|
|
+ async getSuffix(val = '') {
|
|
|
let params = [
|
|
|
{
|
|
|
functionName: API_CONFIG.ajax_Suffix.functionName, // 调用存储过程的名称
|
|
|
- org: this.person.selectedOrg, //组织id
|
|
|
- oid: this.person.selectedSchool, //学校id
|
|
|
+ org: val.org ? val.org : this.person.selectedOrg, //组织id
|
|
|
+ oid: val.oid ? val.oid : this.person.selectedSchool, //学校id
|
|
|
},
|
|
|
];
|
|
|
|
|
|
- // 发起请求
|
|
|
- this.$ajax
|
|
|
- .post(API_CONFIG.baseUrl, params)
|
|
|
- .then((res) => {
|
|
|
- console.log('getSuffix', res)
|
|
|
- let data = res.data[0]
|
|
|
- let orgData = res.data[1]
|
|
|
-
|
|
|
- if (data.length > 0) {
|
|
|
- let ap = data[0].username
|
|
|
- this.SuffixData = this.getEmailWithAt(ap)[0]
|
|
|
- } else if (orgData.length > 0) {
|
|
|
- let ap = orgData[0].username
|
|
|
- this.SuffixData = this.getEmailWithAt(ap)[0]
|
|
|
- }
|
|
|
-
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ // 发起请求
|
|
|
+ this.$ajax
|
|
|
+ .post(API_CONFIG.baseUrl, params)
|
|
|
+ .then((res) => {
|
|
|
+ console.log('getSuffix', res)
|
|
|
+ let data = res.data[0]
|
|
|
+ let orgData = res.data[1]
|
|
|
+
|
|
|
+ if (data.length > 0) {
|
|
|
+ let ap = data[0].username
|
|
|
+ this.SuffixData = this.getEmailWithAt(ap)[0]
|
|
|
+ resolve(this.getEmailWithAt(ap)[0])
|
|
|
+ } else if (orgData.length > 0) {
|
|
|
+ let ap = orgData[0].username
|
|
|
+ this.SuffixData = this.getEmailWithAt(ap)[0]
|
|
|
+ resolve(this.getEmailWithAt(ap)[0])
|
|
|
+ }
|
|
|
+
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ reject(err)
|
|
|
+ console.error("请求失败,错误信息:", err);
|
|
|
+ });
|
|
|
})
|
|
|
- .catch((err) => {
|
|
|
- console.error("请求失败,错误信息:", err);
|
|
|
- });
|
|
|
+
|
|
|
},
|
|
|
getEmailWithAt(email) {
|
|
|
const regex = /@[^@]+$/; // 匹配最后一个 @ 及其后的内容
|
|
|
const match = email.match(regex);
|
|
|
return match ? match : '';
|
|
|
},
|
|
|
+ getEmailBeforeAt(email) {
|
|
|
+ const regex = /^[^@]+/; // 匹配从开始到第一个@之前的内容
|
|
|
+ const match = email.match(regex);
|
|
|
+ return match ? match[0] : '';
|
|
|
+ },
|
|
|
schoolChange() {
|
|
|
for (var i = 0; i < this.cn_school.length; i++) {
|
|
|
if (
|