From 0f8dc2f32547caa547dea9a7c06edac0192437d5 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期三, 26 六月 2024 17:57:14 +0800
Subject: [PATCH] 成员管理 搜索 分页 表格请求 启用停用

---
 Source/plt-web/plt-web-ui/src/components/actions/base/startWorkFlow.vue |   19 ++
 Source/plt-web/plt-web-ui/src/api/user/userManageApi.js                 |   23 +++
 Source/plt-web/plt-web-ui/src/views/user/userManage.js                  |   92 +++++++++++++
 Source/plt-web/plt-web-ui/src/util/basic-option.js                      |    0 
 Source/plt-web/plt-web-ui/src/util/func.js                              |    8 +
 Source/plt-web/plt-web-ui/src/api/base/startWork/index.js               |   11 +
 Source/plt-web/plt-web-ui/src/views/user/userManage.vue                 |  218 +++++++++++++++----------------
 7 files changed, 255 insertions(+), 116 deletions(-)

diff --git a/Source/plt-web/plt-web-ui/src/api/base/startWork/index.js b/Source/plt-web/plt-web-ui/src/api/base/startWork/index.js
new file mode 100644
index 0000000..388873f
--- /dev/null
+++ b/Source/plt-web/plt-web-ui/src/api/base/startWork/index.js
@@ -0,0 +1,11 @@
+import request from '@/router/axios';
+
+
+//鑾峰彇娴佺▼妯℃澘淇℃伅
+export const getTemplateByType = (params) => {
+  return request({
+    url: '/api/processDefineController/getTemplateByType',
+    method: 'get',
+    params: params,
+  });
+}
diff --git a/Source/plt-web/plt-web-ui/src/api/user/userManageApi.js b/Source/plt-web/plt-web-ui/src/api/user/userManageApi.js
new file mode 100644
index 0000000..0dacb61
--- /dev/null
+++ b/Source/plt-web/plt-web-ui/src/api/user/userManageApi.js
@@ -0,0 +1,23 @@
+import request from '@/router/axios';
+
+// 鍒楄〃鏌ヨ
+export function getDataUsers(page,limit,params) {
+  return request({
+    url: "/api/userQueryController/getDataGridUsers",
+    method: "get",
+    params:{
+      page,
+      limit,
+      ...params
+    }
+  });
+}
+
+// 鍋滅敤鍚敤
+export function stopUser(data) {
+  return request({
+    url: "/api/userQueryController/stopUser",
+    method: "post",
+    data:data
+  });
+}
diff --git a/Source/plt-web/plt-web-ui/src/components/actions/base/startWorkFlow.vue b/Source/plt-web/plt-web-ui/src/components/actions/base/startWorkFlow.vue
index ea93acf..65e9ee6 100644
--- a/Source/plt-web/plt-web-ui/src/components/actions/base/startWorkFlow.vue
+++ b/Source/plt-web/plt-web-ui/src/components/actions/base/startWorkFlow.vue
@@ -48,7 +48,7 @@
 
 <script>
 import {validatenull} from "@/util/validate";
-
+import {getTemplateByType} from "@/api/base/startWork/index"
 export default {
   name: "startWorkFlow",
   props: {
@@ -119,10 +119,23 @@
       }
     },
   },
-  mounted() {
+  created() {
     this.modelNameChange();
+    this.getWorkByType();
+  },
+  mounted() {
   },
   methods: {
+    // 鑾峰彇娴佺▼妯℃澘淇℃伅
+    getWorkByType(){
+      let params = {
+        type:'鏂囨。瀹$娴佺▼',
+        filterTemplate:""
+      }
+      getTemplateByType(params).then(res => {
+        console.log(res)
+      })
+    },
     // 鍏抽棴寮圭獥
     dialogClose() {
       this.visible = false;
@@ -151,7 +164,7 @@
       if (this.paramVOS && this.paramVOS.modelName) {
         this.saveParam.modelName = this.paramVOS.modelName;
       } else if (userInfo.content && userInfo.content.userName) {
-        this.saveParam.modelName = userInfo.content.userName + '[鍚姩娴佺▼]';
+        this.saveParam.modelName = userInfo.content.userName + '鍚姩娴佺▼';
       } else {
         this.saveParam.modelName = '';
       }
diff --git a/Source/plt-web/plt-web-ui/src/option/user/basic-option.js b/Source/plt-web/plt-web-ui/src/util/basic-option.js
similarity index 100%
rename from Source/plt-web/plt-web-ui/src/option/user/basic-option.js
rename to Source/plt-web/plt-web-ui/src/util/basic-option.js
diff --git a/Source/plt-web/plt-web-ui/src/util/func.js b/Source/plt-web/plt-web-ui/src/util/func.js
index 9c9f00d..2eb5052 100644
--- a/Source/plt-web/plt-web-ui/src/util/func.js
+++ b/Source/plt-web/plt-web-ui/src/util/func.js
@@ -39,6 +39,14 @@
   }
 
   /**
+   * 鍒ゆ柇瀵硅薄涓虹┖
+   */
+
+  static isEmptyObject(obj) {
+    return Object.keys(obj).length === 0;
+  }
+
+  /**
    * 寮鸿浆int鍨�
    * @param val
    * @param defaultValue
diff --git a/Source/plt-web/plt-web-ui/src/views/user/userManage.js b/Source/plt-web/plt-web-ui/src/views/user/userManage.js
new file mode 100644
index 0000000..ae166ce
--- /dev/null
+++ b/Source/plt-web/plt-web-ui/src/views/user/userManage.js
@@ -0,0 +1,92 @@
+export const column = [
+  {
+    label: '濮撳悕',
+    prop: 'name',
+    align:'center',
+    search:true,
+    sortable:true
+  }, {
+    label: '璐﹀彿',
+    prop: 'id',
+    align:'center',
+    search:true,
+    sortable:true
+  },
+  {
+    label: '鐘舵��',
+    prop: 'status',
+    align: 'center',
+    display:false,
+    sortable:true,
+    slot: true,
+  },
+  {
+    label: '瀵嗙爜绛栫暐',
+    prop: 'pkPasswordStrategyName',
+    sortable:true,
+    display:false,
+  },
+  {
+    label: '閿佸畾鐘舵��',
+    prop: 'lockFlag',
+    align:'center',
+    sortable:true,
+    display:false,
+  },
+  {
+    label: '鎵�灞為儴闂�',
+    prop: 'pkDepartmentName',
+    align:'center',
+    search:true,
+    sortable:true,
+    searchslot:true,
+  },
+  {
+    label: '涓撲笟',
+    prop: 'specialties',
+    align:'center',
+    sortable:true,
+  },
+  {
+    label: '瑙掕壊',
+    prop: 'pkPersonName',
+    align:'center',
+    type:'select',
+    dicUrl: 'api/roleQueryController/refDataGrid',
+    props: {
+      label: 'name',
+      value: 'oid'
+    },
+    search:true,
+    overHidden: true,
+    sortable:true,
+    display:false,
+  },
+  {
+    label: '鐢靛瓙閭欢',
+    prop: 'email',
+    align:'center',
+    sortable:true,
+  },
+  {
+    label: '鎻忚堪',
+    type:'textarea',
+    prop: 'description',
+    align:'center',
+    sortable:true,
+  },
+  {
+    label: '閮ㄩ棬棰嗗',
+    prop: 'isDeptLeader',
+    align:'center',
+    sortable:true,
+    display:false,
+  },
+  {
+    label: '鎵�灞炲瘑绾�',
+    prop: 'secretGradeText',
+    align:'center',
+    sortable:true,
+    display:false,
+  }
+];
diff --git a/Source/plt-web/plt-web-ui/src/views/user/userManage.vue b/Source/plt-web/plt-web-ui/src/views/user/userManage.vue
index 7bda956..2f0309a 100644
--- a/Source/plt-web/plt-web-ui/src/views/user/userManage.vue
+++ b/Source/plt-web/plt-web-ui/src/views/user/userManage.vue
@@ -1,131 +1,123 @@
 <template>
   <basic-container>
-    <avue-crud :data="data"
-               :option="option">
+    <avue-crud
+      :data="tableData"
+      :option="option"
+      :page.sync="page"
+      :table-loading="tableLoading"
+      @on-load="getTableList"
+      @refresh-change="handleRefresh"
+      @search-change="handleSearch"
+      @search-reset="handleReset"
+      @size-change="sizeChange"
+      @current-change="currentChange"
+    >
+      <template slot="status" slot-scope="{row}">
+        <el-tag v-if="row.status === 0" type="success">鍚敤</el-tag>
+        <el-tag v-if="row.status === 1" type="danger">鍋滅敤</el-tag>
+      </template>
+
+      <template slot="lockFlag" slot-scope="{row}">
+        <el-tag v-if="!row.lockFlag" type="success">鏈攣瀹�</el-tag>
+        <el-tag v-if="row.lockFlag" type="danger">閿佸畾</el-tag>
+      </template>
+
+      <template #menu="{row,index,size}">
+        <el-button size="small" type="text" @click="stopUserHandler(row)">
+          <span style="color: #fa3434" v-if="row.status === 0"><i class="el-icon-video-pause"></i> 鍋滅敤</span>
+          <span style="color: #55b61d" v-if="row.status === 1"><i class="el-icon-video-pause"></i> 鍚敤</span>
+        </el-button>
+      </template>
     </avue-crud>
   </basic-container>
 </template>
 
 <script>
-import basicOption from '@/option/user/basic-option'
+import basicOption from '@/util/basic-option'
+import {getDataUsers, stopUser} from '@/api/user/userManageApi'
+import {column} from "./userManage"
+import func from '@/util/func'
+
 export default {
   name: "userManage",
   data() {
     return {
-      data: [
-        {
-          id: 1,
-          name: '寮犱笁',
-          sex: '鐢�'
-        }, {
-          id: 2,
-          name: '鏉庡洓',
-          sex: '濂�'
-        },
-        {
-          id: 1,
-          name: '寮犱笁',
-          sex: '鐢�'
-        }, {
-          id: 2,
-          name: '鏉庡洓',
-          sex: '濂�'
-        },
-        {
-          id: 1,
-          name: '寮犱笁',
-          sex: '鐢�'
-        }, {
-          id: 2,
-          name: '鏉庡洓',
-          sex: '濂�'
-        }, {
-          id: 1,
-          name: '寮犱笁',
-          sex: '鐢�'
-        }, {
-          id: 2,
-          name: '鏉庡洓',
-          sex: '濂�'
-        }
-        , {
-          id: 1,
-          name: '寮犱笁',
-          sex: '鐢�'
-        }, {
-          id: 2,
-          name: '鏉庡洓',
-          sex: '濂�'
-        }
-        , {
-          id: 1,
-          name: '寮犱笁',
-          sex: '鐢�'
-        }, {
-          id: 2,
-          name: '鏉庡洓',
-          sex: '濂�'
-        }
-        , {
-          id: 1,
-          name: '寮犱笁',
-          sex: '鐢�'
-        }, {
-          id: 2,
-          name: '鏉庡洓',
-          sex: '濂�'
-        }
-        , {
-          id: 1,
-          name: '寮犱笁',
-          sex: '鐢�'
-        }, {
-          id: 2,
-          name: '鏉庡洓',
-          sex: '濂�'
-        }
-        , {
-          id: 1,
-          name: '寮犱笁',
-          sex: '鐢�'
-        }, {
-          id: 2,
-          name: '鏉庡洓',
-          sex: '濂�'
-        }
-        , {
-          id: 1,
-          name: '寮犱笁',
-          sex: '鐢�'
-        }, {
-          id: 2,
-          name: '鏉庡洓',
-          sex: '濂�'
-        }
-        , {
-          id: 1,
-          name: '寮犱笁',
-          sex: '鐢�'
-        }, {
-          id: 2,
-          name: '鏉庡洓',
-          sex: '濂�'
-        }
-      ],
+      tableLoading: false,
+      tableData: [],
       option: {
         ...basicOption,
-        column: [
-          {
-            label: '濮撳悕',
-            prop: 'name',
-            search:true
-          }, {
-            label: '鎬у埆',
-            prop: 'sex',
-            search:true
+        calcHeight: -60,
+        column: column
+      },
+      page: {
+        currentPage: 1,
+        pageSize: 10,
+        total: 0,
+        pageSizes: [10, 30, 50, 100],
+      },
+      searchParams: {},
+    }
+  },
+  created() {
+  },
+  methods: {
+    // 琛ㄦ牸璇锋眰
+    getTableList() {
+      getDataUsers(this.page.currentPage, this.page.pageSize, this.searchParams).then(res => {
+        const data = res.data.data;
+        this.tableData = data;
+        this.page.total = res.data.total;
+      });
+    },
+
+    // 琛ㄦ牸鍙充晶鍒锋柊鍥炬爣
+    handleRefresh() {
+      this.getTableList();
+    },
+
+    // 鎼滅储鏌ヨ
+    handleSearch(params, done) {
+      if (!func.isEmptyObject(params)) {
+        for (let key in params) {
+          if (params.hasOwnProperty(key)) {
+            // 鍒ゆ柇濡傛灉 key 鏄� 'pkPersonName'锛屽垯鏀逛负 'pkPerson' 鍒嗗埆涓烘樉绀哄�煎拰淇濆瓨鍊�
+            let newKey = key === 'pkPersonName' ? 'pkPerson' : key;
+            this.searchParams[`conditionMap["${newKey}"]`] = params[key];
           }
-        ]
+        }
+      } else {
+        this.searchParams = {};
       }
+      this.getTableList();
+      done();
+    },
+
+    // 閲嶇疆鎼滅储鏉′欢
+    handleReset() {
+      this.searchParams = {};
+      this.getTableList();
+    },
+
+    // 鏉℃暟
+    sizeChange(val) {
+      this.page.pageSize = val;
+    },
+
+    // 椤电爜
+    currentChange(val) {
+      this.page.currentPage = val;
+    },
+
+    // 鍋滅敤鍚敤
+    stopUserHandler(row){
+      let params = {};
+      params = {
+        idList:row.oid,
+        flag: row.status === 0 ? true : false
+      }
+      stopUser(params).then(res => {
+        console.log(res)
+      })
     }
   }
 

--
Gitblit v1.9.3