churf
2023-08-28 10d938414e5ea67fe3d211d91a59da1f75ddf609
eladmin-web-master/src/views/task/task/index.vue
@@ -57,14 +57,14 @@
            :value="item"
          />
        </el-select>
        <el-select v-model="query.userIds" multiple collapse-tags filterable clearable placeholder="所属员工" style="width: 185px;" class="filter-item">
          <el-option
            v-for="item in users"
            :key="item.id"
            :label="item.nickName"
            :value="item.id"
        <div class="block">
          <el-cascader
            :options="options"
            :props="props"
            collapse-tags
            clearable
          />
        </el-select>
        </div>
        <rrOperation :crud="crud" />
      </div>
      <!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
@@ -261,6 +261,7 @@
      }
    }
    return {
      props: { multiple: true },
      permission: {
        add: ['admin', 'task:add'],
        edit: ['admin', 'task:edit'],
@@ -354,7 +355,11 @@
      // tag标签
      inputVisible: false,
      inputValue: null,
      containUserList: []
      containUserList: [],
      options: [],
      deptList: [],
      jobList: [],
      userList: []
    }
  },
  created() {
@@ -404,6 +409,7 @@
      const userRolesLevel = this.$store.state.user.user.roles.map(({ level }) => level)
      // 用户最大角色级别
      this.userRolesLevelMin = Math.min(...userRolesLevel)
      return true
    },
    [CRUD.HOOK.beforeSubmit]() {
@@ -484,6 +490,10 @@
        // 用户列表
        this.users = res
      })
      crudUser.getUserDept().then(res => {
        this.options = res
      })
    },
    getUserNameById(userId) {
      const userList = this.users.filter(user => user.id === userId)