diff --git a/ruoyi-ui/src/components/DeptTree/index.vue b/ruoyi-ui/src/components/DeptTree/index.vue index feb707f..0578f4b 100644 --- a/ruoyi-ui/src/components/DeptTree/index.vue +++ b/ruoyi-ui/src/components/DeptTree/index.vue @@ -8,6 +8,11 @@ placeholder="请选择组织部门" @select="handleDeptSelect" /> + + + {{ child.deptName }} + + @@ -15,18 +20,25 @@ import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import to from "@/utils/await-to.js"; -import { listDept} from "@/api/system/dept"; +import { listDept } from "@/api/system/dept"; export default { name: "DeptTree", components: { Treeselect, }, + props: { + showQuickGroup: { + type: Boolean, + default: false, + }, + }, data() { return { deptId: "", // 部门树数据 deptList: [], + firstChildList: [], normalizer(node) { return { id: node.deptId, @@ -56,11 +68,14 @@ export default { // this.$message.error("默认企业配置错误,请配置sys.user.defaultFactoryId"); // } // }, + quickSelect(child) { + this.deptId = child.deptId; + this.$emit("deptChange", child); + }, async initDeptList() { const [err, response] = await to( listDept({ deptName: undefined, - }) ); if (err) { @@ -71,7 +86,8 @@ export default { if (response.code === 200) { this.deptList = this.handleTree(response.data, "deptId"); this.deptId = this.deptList[0].deptId; - this.$emit("deptChange", this.deptList[0]); + this.firstChildList = this.deptList[0].children; + this.$emit("deptChange", this.deptList[0]); } else { console.error(response); this.$message.error(response.msg); @@ -85,4 +101,14 @@ export default { }; - + diff --git a/ruoyi-ui/src/views/dataStatistics/realtime/search-bar.vue b/ruoyi-ui/src/views/dataStatistics/realtime/search-bar.vue index 382aba6..2ce708e 100644 --- a/ruoyi-ui/src/views/dataStatistics/realtime/search-bar.vue +++ b/ruoyi-ui/src/views/dataStatistics/realtime/search-bar.vue @@ -1,24 +1,21 @@ @@ -36,13 +33,6 @@ export default { // chooseDept:null, deptId: "", dateValue: [], - normalizer(node) { - return { - id: node.deptId, - label: node.deptName, - children: node.children, - }; - }, }; }, mounted() { @@ -64,8 +54,8 @@ export default { ]; }, handleRadioDeptChange(value) { - this.deptId = value - this.emitChange(); + this.deptId = value; + this.emitChange(); }, handleDeptChange(value) { this.deptId = value.deptId;