diff --git a/frontend/src/views/grading-admin/index.vue b/frontend/src/views/grading-admin/index.vue
index 923df5b07..69a6a94a2 100644
--- a/frontend/src/views/grading-admin/index.vue
+++ b/frontend/src/views/grading-admin/index.vue
@@ -61,13 +61,30 @@
-
+
+
+
+
+
+
@@ -160,13 +177,30 @@
-
+
+
+
+
+
+
@@ -279,6 +313,7 @@
import IamEditInput from '@/views/my-manage-space/components/iam-edit/input';
import IamEditMemberSelector from '@/views/my-manage-space/components/iam-edit/member-selector';
import IamEditTextarea from '@/views/my-manage-space/components/iam-edit/textarea';
+ import IamManagerEditInput from '@/components/iam-edit/input';
import IamSearchSelect from '@/components/iam-search-select';
import ManageInterviewDialog from '@/components/manage-interview-dialog';
@@ -288,6 +323,7 @@
ConfirmDialog,
ApplyDialog,
IamEditInput,
+ IamManagerEditInput,
IamEditMemberSelector,
IamEditTextarea,
IamSearchSelect,
@@ -418,6 +454,13 @@
return !['child-operate'].includes(column.property) ? 'iam-table-cell-1-cls' : '';
},
+ getMemberFilter (value) {
+ if (value.length) {
+ return _.isArray(value) ? value.map(item => item.username).join(';') : value;
+ }
+ return '--';
+ },
+
handleExpandChange (row, expandedRows) {
// if (row.id !== this.gradingAdminId) return;
this.gradingAdminId = row.id;
@@ -469,6 +512,40 @@
return JSON.parse(window.localStorage.getItem('gradeManagerList'));
},
+ handleOpenManagerEdit (payload, index) {
+ this.$set(this.tableList[index], 'isEdit', true);
+ this.$nextTick(() => {
+ const managerRef = this.$refs[`managerRef${index}`];
+ if (managerRef) {
+ managerRef.isEditable = true;
+ if (!payload.members.length) {
+ setTimeout(() => {
+ this.$refs[`managerRef${index}`].$refs.selector.focus();
+ }, 10);
+ }
+ }
+ });
+ },
+
+ handleOpenSubManagerEdit (payload, index) {
+ this.$set(payload, 'isEdit', true);
+ this.$nextTick(() => {
+ const subManagerRef = this.$refs[`subManagerRef${index}`];
+ if (subManagerRef) {
+ subManagerRef.isEditable = true;
+ if (!payload.members.length) {
+ setTimeout(() => {
+ subManagerRef.$refs.selector.focus();
+ }, 10);
+ }
+ }
+ });
+ },
+
+ handleEmptyMemberChange (index, row) {
+ row.isEdit = false;
+ },
+
async fetchGradingAdmin (isTableLoading = false) {
this.tableLoading = isTableLoading;
this.setCurrentQueryCache(this.refreshCurrentQuery());
@@ -479,9 +556,12 @@
name: this.searchValue
});
this.pagination.count = data.count || 0;
- data.results = data.results.map(e => {
- e.children = [];
- return e;
+ data.results = data.results.map((item) => {
+ item = Object.assign(item, {
+ isEdit: false,
+ children: []
+ });
+ return item;
});
this.tableList.splice(0, this.tableList.length, ...(data.results || []));
if (this.isStaff) {
diff --git a/frontend/src/views/manage-spaces/secondary-manage-space/index.vue b/frontend/src/views/manage-spaces/secondary-manage-space/index.vue
index dc7b7a95c..d5ae423c9 100644
--- a/frontend/src/views/manage-spaces/secondary-manage-space/index.vue
+++ b/frontend/src/views/manage-spaces/secondary-manage-space/index.vue
@@ -29,13 +29,30 @@
-
+
+
+
+
+
+
@@ -89,11 +106,13 @@
import { buildURLParams } from '@/common/url';
import { formatCodeData, getWindowHeight } from '@/common/util';
import IamEditMemberSelector from '@/views/my-manage-space/components/iam-edit/member-selector';
+ import IamManagerEditInput from '@/components/iam-edit/input';
export default {
name: 'secondaryManageSpace',
components: {
- IamEditMemberSelector
+ IamEditMemberSelector,
+ IamManagerEditInput
},
data () {
return {
@@ -215,6 +234,32 @@
await this.fetchGradingAdmin(true);
},
+ getMemberFilter (value) {
+ if (value.length) {
+ return Array.isArray(value) ? value.map(item => item.username).join(';') : value;
+ }
+ return '--';
+ },
+
+ handleOpenManagerEdit (payload, index) {
+ this.$set(this.tableList[index], 'isEdit', true);
+ this.$nextTick(() => {
+ const managerRef = this.$refs[`managerRef${index}`];
+ if (managerRef) {
+ managerRef.isEditable = true;
+ if (!payload.members.length) {
+ setTimeout(() => {
+ this.$refs[`managerRef${index}`].$refs.selector.focus();
+ }, 10);
+ }
+ }
+ });
+ },
+
+ handleEmptyMemberChange (index, row) {
+ row.isEdit = false;
+ },
+
handleNavAuthBoundary (payload) {
window.localStorage.setItem('iam-header-name-cache', payload.name);
this.$store.commit('updateIndex', 1);
diff --git a/frontend/src/views/my-manage-space/components/iam-edit/member-selector.vue b/frontend/src/views/my-manage-space/components/iam-edit/member-selector.vue
index c523dabdd..01016ace9 100644
--- a/frontend/src/views/my-manage-space/components/iam-edit/member-selector.vue
+++ b/frontend/src/views/my-manage-space/components/iam-edit/member-selector.vue
@@ -86,9 +86,15 @@
return ['detail', 'edit'].includes(value);
}
},
+ // 默认允许空
allowEmpty: {
type: Boolean,
default: false
+ },
+ // 编辑不允许空
+ isEditAllowEmpty: {
+ type: Boolean,
+ default: true
}
},
data () {
@@ -110,6 +116,9 @@
},
isEditMode () {
return this.mode === 'edit';
+ },
+ isAllowTrigger () {
+ return JSON.stringify(this.displayValue) !== JSON.stringify(this.value);
}
},
watch: {
@@ -169,10 +178,9 @@
handleEnter (event) {
if (!this.isEditable) return;
const { key, keyCode } = event;
- const isUpdate = JSON.stringify(this.displayValue) !== JSON.stringify(this.value);
if (key === 'Enter' && keyCode === 13) {
this.handleDefaultEmpty();
- if (isUpdate) {
+ if (this.isAllowTrigger) {
this.handleEmptyChange();
this.isEditable = false;
} else {
@@ -198,7 +206,14 @@
},
triggerChange () {
- if (JSON.stringify(this.displayValue) !== JSON.stringify(this.value)) {
+ console.log(this.isAllowTrigger, this.displayValue, '显示内容');
+ // 单独处理初始化为空但编辑不能为空数据
+ if (!this.displayValue.length && !this.isEditAllowEmpty) {
+ this.displayValue = [...this.value];
+ this.messageWarn(this.$t(`m.verify['管理员不能为空']`), 3000);
+ return;
+ }
+ if (this.isAllowTrigger) {
this.isLoading = true;
this.remoteHandler({
[this.field]: this.displayValue
@@ -229,7 +244,7 @@
handleRtxBlur () {
this.isEditable = false;
this.handleDefaultEmpty();
- if (JSON.stringify(this.displayValue) !== JSON.stringify(this.value)) {
+ if (this.isAllowTrigger) {
this.handleEmptyChange();
}
},
diff --git a/frontend/src/views/my-manage-space/index.vue b/frontend/src/views/my-manage-space/index.vue
index af9820dcb..6625b7af1 100644
--- a/frontend/src/views/my-manage-space/index.vue
+++ b/frontend/src/views/my-manage-space/index.vue
@@ -86,14 +86,30 @@
-
+
+
+
+
+
+
@@ -207,16 +223,31 @@
-
-
+
+
+
+
+
+
+
@@ -324,6 +355,7 @@
import IamEditMemberSelector from './components/iam-edit/member-selector';
import IamEditTextarea from './components/iam-edit/textarea';
import IamSearchSelect from '@/components/iam-search-select';
+ import IamManagerEditInput from '@/components/iam-edit/input';
import { buildURLParams } from '@/common/url';
import ManageInterviewDialog from '@/components/manage-interview-dialog';
// import { bus } from '@/common/bus';
@@ -336,6 +368,7 @@
IamEditMemberSelector,
IamEditTextarea,
IamSearchSelect,
+ IamManagerEditInput,
ManageInterviewDialog
},
data () {
@@ -450,6 +483,13 @@
return !['child-operate'].includes(column.property) ? 'iam-table-cell-1-cls' : '';
},
+ getMemberFilter (value) {
+ if (value.length) {
+ return _.isArray(value) ? value.map(item => item.username).join(';') : value;
+ }
+ return '--';
+ },
+
// 通过子集id找父级数据
findParentNode (id, list = [], result = []) {
for (let i = 0; i < list.length; i += 1) {
@@ -496,6 +536,40 @@
this.fetchGradingAdmin(true);
}
},
+
+ handleOpenManagerEdit (payload, index) {
+ this.$set(this.tableList[index], 'isEdit', true);
+ this.$nextTick(() => {
+ const managerRef = this.$refs[`managerRef${index}`];
+ if (managerRef) {
+ managerRef.isEditable = true;
+ if (!payload.members.length) {
+ setTimeout(() => {
+ this.$refs[`managerRef${index}`].$refs.selector.focus();
+ }, 10);
+ }
+ }
+ });
+ },
+
+ handleOpenSubManagerEdit (payload, index) {
+ this.$set(payload, 'isEdit', true);
+ this.$nextTick(() => {
+ const subManagerRef = this.$refs[`subManagerRef${index}`];
+ if (subManagerRef) {
+ subManagerRef.isEditable = true;
+ if (!payload.members.length) {
+ setTimeout(() => {
+ subManagerRef.$refs.selector.focus();
+ }, 10);
+ }
+ }
+ });
+ },
+
+ handleEmptyMemberChange (index, row) {
+ row.isEdit = false;
+ },
handleUpdateMembers (payload, index) {
this.handleUpdateManageSpace(payload, index);
@@ -618,9 +692,12 @@
name: this.searchValue
});
this.pagination.count = data.count;
- data.results = data.results.map((e) => {
- e.children = [];
- return e;
+ data.results = data.results.map((item) => {
+ item = Object.assign(item, {
+ isEdit: false,
+ children: []
+ });
+ return item;
});
this.tableList.splice(0, this.tableList.length, ...(data.results || []));
if (this.isStaff) {
diff --git a/saas/VERSION b/saas/VERSION
index b5e7929e7..44e47db8c 100644
--- a/saas/VERSION
+++ b/saas/VERSION
@@ -1 +1 @@
-1.10.37
+1.10.38
diff --git a/saas/resources/version_log/change_log.md b/saas/resources/version_log/change_log.md
index eecd488b6..9b63994a3 100644
--- a/saas/resources/version_log/change_log.md
+++ b/saas/resources/version_log/change_log.md
@@ -1,3 +1,11 @@
+
+# V1.10.38 版本更新日志
+
+### 功能优化
+* 管理空间人员选择器编辑组件支持默认为空(该管理员已离职)后可重新编辑场景
+
+---
+
# V1.10.37 版本更新日志
diff --git a/saas/resources/version_log/change_log_en.md b/saas/resources/version_log/change_log_en.md
index 0c6cdc052..a2889707c 100644
--- a/saas/resources/version_log/change_log_en.md
+++ b/saas/resources/version_log/change_log_en.md
@@ -1,3 +1,11 @@
+
+# V1.10.38 Version Update Log
+
+### Feature Enhancements
+* The management space personnel selector edit component supports re-editing the scenario after being set to empty by default (the administrator has left).
+
+---
+
# V1.10.37 Version Update Log