From 1aa6aec8be8351a9bfe2d7629c4a30128eccde44 Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期五, 19 七月 2024 17:27:57 +0800
Subject: [PATCH] 提交

---
 src/views/onlineEducation/systemManage/user/index.vue |   90 +++++++++++++++++++++++++++++++++++++++------
 1 files changed, 78 insertions(+), 12 deletions(-)

diff --git a/src/views/onlineEducation/systemManage/user/index.vue b/src/views/onlineEducation/systemManage/user/index.vue
index 4a0f330..4bc7af5 100644
--- a/src/views/onlineEducation/systemManage/user/index.vue
+++ b/src/views/onlineEducation/systemManage/user/index.vue
@@ -1,12 +1,40 @@
 <template>
   <div class="app-container">
-    <div style="margin-bottom: 10px">
-      <el-button
-          type="primary"
-          plain
-          icon="Plus"
-          @click="openDialog('add',{})"
-      >新增</el-button>
+    <div style="display: flex;justify-content: space-between">
+      <el-form :inline="true" style="display: flex;align-items: center;flex-wrap: wrap;" >
+        <el-form-item>
+          <el-button
+              type="primary"
+              plain
+              icon="Plus"
+              @click="openDialog('add',{})"
+          >新增</el-button>
+        </el-form-item>
+        <el-form-item label="用户名:" >
+          <el-input v-model="data.queryParams.username" placeholder="请输入用户名"></el-input>
+        </el-form-item>
+        <el-form-item label="用户类型:" >
+          <el-select v-model="data.queryParams.userType" placeholder="请选择" clearable>
+            <el-option
+                v-for="item in data.userTypeList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id">
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item >
+          <el-button
+              type="primary"
+              @click="getList"
+          >查询</el-button>
+          <el-button
+              type="primary"
+              plain
+              @click="reset"
+          >重置</el-button>
+        </el-form-item>
+      </el-form>
     </div>
     <!-- 表格数据 -->
     <el-table v-loading="loading" :data="dataList" :border="true">
@@ -41,7 +69,9 @@
 import {ElMessage, ElMessageBox} from "element-plus";
 import {delCompany, getCompany} from "@/api/onlineEducation/company";
 import userDialog from './components/userDialog.vue'
-import {getUser} from "@/api/onlineEducation/user";
+import {delUser, getUser} from "@/api/onlineEducation/user";
+import Cookies from "js-cookie";
+
 
 const { proxy } = getCurrentInstance();
 const loading = ref(false);
@@ -50,14 +80,40 @@
   queryParams: {
     pageNum: 1,
     pageSize: 10,
+    username: '',
+    userType: null
   },
   total: 0,
-  dataList: []
+  dataList: [],
+  userTypeList: [
+    {
+      id: 0,
+      name: '管理员'
+    },
+    {
+      id: 1,
+      name: '企业级'
+    },
+    {
+      id: 2,
+      name: '部门级'
+    },
+    {
+      id: 3,
+      name: '车间(岗位)级别'
+    },
+    {
+      id: 4,
+      name: '其他'
+    },
+  ]
+
 });
 
 const { queryParams, total, dataList } = toRefs(data);
-
+const userInfo = ref()
 onMounted(()=>{
+  userInfo.value = JSON.parse(Cookies.get('userInfo'))
   getList()
 })
 
@@ -83,12 +139,22 @@
 }
 
 const openDialog = (type, value) => {
+  if(userInfo.value.userType === 3){
+    ElMessage.warning('车间级用户不能新增')
+    return;
+  }
   dialogRef.value.openDialog(type, value);
 }
 
 /** 重置新增的表单以及其他数据  */
 function reset() {
-  proxy.resetForm("roleRef");
+  data.queryParams = {
+    pageNum: 1,
+    pageSize: 10,
+    username: '',
+    userType: null
+  }
+  getList()
 }
 const handleDelete = (val) => {
   ElMessageBox.confirm(
@@ -100,7 +166,7 @@
         type: 'warning',
       })
       .then( async() => {
-        const res = await delCompany(val.id)
+        const res = await delUser(val.id)
         if(res.code == 200){
           ElMessage.success('数据删除成功')
           await getList()

--
Gitblit v1.9.2