Skip to content

Commit

Permalink
fix: 2.5.4 bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri0528 committed Nov 8, 2023
1 parent a5ea50b commit ed79559
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/pages/src/components/organization/mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default {
const msg = node.activated ? this.$t('启用成功') : this.$t('停用成功');
this.isDirectory = true;
this.messageSuccess(msg);
this.$emit('updateAcitveNode');
this.$emit('updateActiveNode');
} catch (e) {
console.warn(e);
}
Expand Down
29 changes: 21 additions & 8 deletions src/pages/src/views/organization/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@handleConfigDirectory="handleClickConfig"
@addOrganization="addOrganization"
@updateScroll="updateScroll"
@updateAcitveNode="updateAcitveNode" />
@updateActiveNode="updateActiveNode" />
</div>
</div>
</div>
Expand Down Expand Up @@ -769,7 +769,7 @@ export default {
getNodeColor() {
this.currentNode = document.getElementsByClassName('tree-drag-node')[0];
},
updateAcitveNode() {
updateActiveNode() {
this.$nextTick(() => {
const activeNode = document.getElementsByClassName('show-background')[0];
if (!activeNode) return;
Expand Down Expand Up @@ -876,6 +876,7 @@ export default {
},
handlePageLimitChange(limit) {
this.paginationConfig.limit = limit;
this.paginationConfig.current = 1;
this.tableSearchKey.length ? this.handleTableSearch(this.tableSearchKey) : this.handleTableData();
},
// 选中的用户列表
Expand All @@ -899,11 +900,21 @@ export default {
// 搜索table
handleTableSearch(list) {
this.isTableDataEmpty = false;
this.basicLoading = true;
if (!list.length) return this.handleClickEmpty();
if (!this.searchFilterList.length) return;

this.basicLoading = true;
const valueList = [`category_id=${this.currentCategoryId}&page=${this.paginationConfig.current}&page_size=${this.paginationConfig.limit}`];
let key = '';

list.forEach((item) => {
if (!Array.isArray(item.values)) {
const { id, name } = item;
Object.assign(item, { values: [{ id, name }] });
// 默认搜索第一个
item.id = this.searchFilterList[0].id;
item.name = this.searchFilterList[0].name;
}
let key = '';
const value = [];
if (Object.keys(this.enumList).includes(item.id)) {
key = this.enumList[item.id];
Expand All @@ -914,7 +925,9 @@ export default {
});
valueList.push(`${key}=${value}`);
});

const params = valueList.join('&');

this.$store.dispatch('organization/getMultiConditionQuery', params).then((res) => {
if (res.result) {
this.basicLoading = false;
Expand Down Expand Up @@ -1027,7 +1040,7 @@ export default {
});
}
});
this.updateAcitveNode();
this.updateActiveNode();
},

// 重命名,添加下级组织,设置表字段弹窗操作
Expand Down Expand Up @@ -1631,7 +1644,7 @@ export default {
this.treeDataList[0].showBackground = true;
this.currentParam.item = this.treeDataList[0];
}
this.updateAcitveNode();
this.updateActiveNode();
} else {
await this.$store.dispatch('organization/deleteDepartment', { id: deleteItem.id });
this.messageSuccess(this.$t('组织删除成功'));
Expand All @@ -1649,7 +1662,7 @@ export default {
deleteItem.directParent.showBackground = true;
this.currentParam.item = deleteItem.directParent;
}
this.updateAcitveNode();
this.updateActiveNode();
}
} catch (e) {
console.warn(e);
Expand Down Expand Up @@ -1846,7 +1859,7 @@ export default {
this.filterTreeData(newDepartment, this.currentParam.item, this.currentParam.item.type === 'local');
this.currentParam.item.children.push(newDepartment);
this.handleClickTreeNode(newDepartment);
this.updateAcitveNode();
this.updateActiveNode();
} else {
const params = {
name: this.addOrganizationName,
Expand Down
17 changes: 11 additions & 6 deletions src/pages/src/views/organization/tree/OrganizationTree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
@on-drag-node="handleDragNode"
@async-load-nodes="handleClickToggle">
</bk-tree>
<div class="bottom-tree">
<div class="bottom-tree" @click="clickBottomTree">
<p :class="['bottom-tree-header', { 'show-header': isDirectory }]" @click="handleClickDirectory">
<i :class="isDirectory ? 'bk-icon icon-angle-down' : 'bk-icon icon-angle-right'"></i>{{ $t('不可用目录') }}
</p>
Expand Down Expand Up @@ -131,13 +131,18 @@ export default {
this.treeScrollTop = e.target.scrollTop;
this.$emit('updateScroll');
},
clickBottomTree() {
const bottomTreeWrap = document.querySelector('.show-content');
if (!bottomTreeWrap) return;
bottomTreeWrap.addEventListener('scroll', this.scrollChange, true);
},
handleClickToggle(item) {
this.$emit('handleClickToggle', item);
},
tpl(node) {
return <div class={[
'node-content',
`${node.showBackground ? 'show-background' : 'directory-warpper'}`,
`${node.showBackground ? 'show-background' : 'directory-wrapper'}`,
{ nodeTag: (node.configured && !node.activated && node.type) || (!node.configured && node.type) },
]}>
{node.type && !node.children.length ? <i class={'hide-icon'} /> : ''}
Expand Down Expand Up @@ -401,7 +406,7 @@ export default {
}
}
}
.directory-warpper {
.directory-wrapper {
.option {
display: flex;
.icon-more {
Expand All @@ -415,7 +420,7 @@ export default {
}
}
&:hover {
& > .tree-node > .directory-warpper {
& > .tree-node > .directory-wrapper {
.icon-more {
visibility: visible;
}
Expand All @@ -434,7 +439,7 @@ export default {
}
.tree-drag-node {
position: relative;
.directory-warpper {
.directory-wrapper {
position: relative;
line-height: 32px;
height: 32px;
Expand Down Expand Up @@ -505,7 +510,7 @@ export default {
}
}
&:hover {
& > .tree-node > .directory-warpper {
& > .tree-node > .directory-wrapper {
.option {
display: block;
align-items: center;
Expand Down
8 changes: 4 additions & 4 deletions src/pages/src/views/setting/FieldsAdd.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@
<div class="input-container">
<label v-if="fieldsInfor.type === 'one_enum'" class="king-radio">
<input
name="eg" type="radio" :value="index"
v-model="fieldsInfor.default" :class="{ 'is-checked': fieldsInfor.default === index }"
name="eg" type="radio" :value="item.id"
v-model="fieldsInfor.default" :class="{ 'is-checked': fieldsInfor.default === item.id }"
@input="handleInput">
</label>
<label v-else class="king-checkbox king-checkbox-small">
<input name="egCheckbox" type="checkbox" :value="index" v-model="fieldsInfor.default">
<input name="egCheckbox" type="checkbox" :value="item.id" v-model="fieldsInfor.default">
</label>
</div>
</div>
Expand Down Expand Up @@ -342,7 +342,7 @@ export default {
return;
}
const param = {
id: this.fieldsInfor.options.length,
id: this.fieldsInfor.options[this.fieldsInfor.options.length - 1].id + 1,
value: '',
isErrorValue: false,
};
Expand Down

0 comments on commit ed79559

Please sign in to comment.