若依系统侧边栏的树状结构

在这里插入图片描述

  <select id="selectEventUserCountList" parameterType="EventUserCount" resultMap="EventUserCountResult">
        <!--<include refid="selectEventUserCountVo"/>-->
        select * from tb_event_user_count e  LEFT JOIN sys_dept d ON e.dept_id = d.dept_id
        <where>
                <if test="deptId != null and deptId != 0">
                    AND (d.dept_id = #{deptId} OR d.dept_id IN ( SELECT d.dept_id FROM sys_dept d WHERE find_in_set(#{deptId},
                    ancestors) ))
                </if>
                <if test="userName != null  and userName != ''">
                    and user_name like concat('%', #{userName}, '%')
                </if>
        </where>
        <!-- 数据范围过滤 -->
        ${params.dataScope}
    </select>

在这里插入图片描述

   <el-row :gutter="20">
      <!--部门数据-->
      <el-col :span="2" :xs="20">
        </el-col>
 </el-row>

在这里插入图片描述

import { deptTreeSelect } from "@/api/system/user";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";

 components: { Treeselect },

在这里插入图片描述

 watch: {
    // 根据名称筛选部门树
    deptName(val) {
      this.$refs.tree.filter(val);
    }
  },

  created() {
    this.getList();
    this.getDeptTree();
  },

在这里插入图片描述

/** 查询部门下拉树结构 */
getDeptTree() {
      deptTreeSelect().then(response => {
        this.deptOptions = response.data;
      });
    },
    // 筛选节点
    filterNode(value, data) {
      if (!value) return true;
      return data.label.indexOf(value) !== -1;
    },
    // 节点单击事件
    handleNodeClick(data) {
      this.queryParams.deptId = data.id;
      this.handleQuery();
    },
  • 8
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值