Ver código fonte

研发打卡修改

anderx 2 anos atrás
pai
commit
4bf2578fab

+ 2 - 0
ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -303,7 +303,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		select user_id userId, user_name userName,nick_name nickName
 		from sys_user
 		where user_id >1 and nick_name like concat('%',#{name},'%')
+		<if test="roleId!=null">
 		and user_id in (select user_id from sys_user_role where role_id = #{roleId})
+		</if>
 	</select>
 
 

+ 33 - 0
ruoyi-ui/src/views/system/user/index.vue

@@ -74,6 +74,18 @@
               end-placeholder="结束日期"
             ></el-date-picker>
           </el-form-item>
+          <template>
+            <div>
+              <el-select v-model="selectedValue" filterable placeholder="请选择">
+                <el-option
+                  v-for="item in filteredOptions"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value">
+                </el-option>
+              </el-select>
+            </div>
+          </template>
           <el-form-item>
             <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
             <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -355,6 +367,7 @@ import { listUser, getUser, delUser, addUser, updateUser, resetUserPwd, changeUs
 import { getToken } from "@/utils/auth";
 import Treeselect from "@riophae/vue-treeselect";
 import "@riophae/vue-treeselect/dist/vue-treeselect.css";
+import log from "@/views/monitor/job/log.vue";
 
 export default {
   name: "User",
@@ -394,6 +407,14 @@ export default {
       roleOptions: [],
       // 表单参数
       form: {},
+      selectedValue: '?',
+      options: [
+        { label: '选项1', value: '1' },
+        { label: '选项2', value: '2' },
+        { label: '选项3', value: '3' },
+        // 更多选项...
+      ],
+      filteredOptions: [],
       defaultProps: {
         children: "children",
         label: "label"
@@ -472,6 +493,12 @@ export default {
     // 根据名称筛选部门树
     deptName(val) {
       this.$refs.tree.filter(val);
+    },
+    selectedValue(newVal,oldVal) {
+      // 当选择值改变时,更新模糊匹配的下拉列表
+      console.log(oldVal);
+      console.log(newVal);
+      this.updateFilteredOptions(newVal);
     }
   },
   created() {
@@ -482,6 +509,12 @@ export default {
     });
   },
   methods: {
+    updateFilteredOptions(query) {
+      // 根据查询关键词,获取匹配的下拉列表数据
+      this.filteredOptions = this.options.filter(option =>
+        option.label.includes(query)
+      );
+    },
     /** 查询用户列表 */
     getList() {
       this.loading = true;