86184597 by xiaomiao
1 parent bf8559de
1 /*
2 * @Author: xiaomiao 1158771342@qq.com
3 * @Date: 2023-03-09 15:24:53
4 * @LastEditors: xiaomiao 1158771342@qq.com
5 * @LastEditTime: 2023-03-20 09:21:04
6 * @FilePath: \上报\bdcjg-web\src\api\personnelManage.js
7 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
8 */
1 9
2 import { 10 import {
3 api, 11 api,
...@@ -5,7 +13,7 @@ import { ...@@ -5,7 +13,7 @@ import {
5 deleteAction, 13 deleteAction,
6 putAction 14 putAction
7 } from './manageApi' 15 } from './manageApi'
8 16 import { getParams } from './util'
9 17
10 export const updateUserPassword = (data) => { 18 export const updateUserPassword = (data) => {
11 return putAction(`${api.users}/update-password`, data) 19 return putAction(`${api.users}/update-password`, data)
...@@ -15,9 +23,41 @@ export const updateUserPassword = (data) => { ...@@ -15,9 +23,41 @@ export const updateUserPassword = (data) => {
15 export const getUserList = (params) => { 23 export const getUserList = (params) => {
16 return getAction(api.users, params) 24 return getAction(api.users, params)
17 } 25 }
18 26 export const getUserLists = (queryParam) => {
19 27 const conditionGroup = {
20 28 conditions: [{
29 property: 'code',
30 value: queryParam.code ? queryParam.code : null,
31 operator: 'LIKE'
32 },
33 {
34 property: 'name',
35 value: queryParam.name ? queryParam.name : null,
36 operator: 'LIKE'
37 }
38 ,
39 {
40 property: 'loginName',
41 value: queryParam.loginName ? queryParam.loginName : null,
42 operator: 'LIKE'
43 },
44 {
45 property: 'organizationId',
46 value: queryParam.organizationId,
47 operator: 'IN'
48 }
49 ,
50 {
51 property: 'departmentId',
52 value: queryParam.departmentId,
53 operator: 'IN'
54 }
55 ],
56 queryRelation: 'AND',
57 }
58 const params = getParams(conditionGroup)
59 return getAction(api.users, params)
60 }
21 // 重置用户密码 61 // 重置用户密码
22 // export const resetPassword = id => { 62 // export const resetPassword = id => {
23 // return putAction(`${api.users}/${id}/reset-password`) 63 // return putAction(`${api.users}/${id}/reset-password`)
......
...@@ -12,60 +12,61 @@ ...@@ -12,60 +12,61 @@
12 </div> 12 </div>
13 </template> 13 </template>
14 <script> 14 <script>
15 import { AppMain, Navbar, Sidebar, TagsView } from './components' 15 import { AppMain, Navbar, Sidebar, TagsView } from './components'
16 import ResizeMixin from './mixin/ResizeHandler' 16 import ResizeMixin from './mixin/ResizeHandler'
17 import { mapState } from 'vuex' 17 import { mapState } from 'vuex'
18 export default { 18 export default {
19 name: 'Layout', 19 name: 'Layout',
20 components: { 20 components: {
21 AppMain, 21 AppMain,
22 Navbar, 22 Navbar,
23 Sidebar, 23 Sidebar,
24 TagsView 24 TagsView
25 }, 25 },
26 created () { 26 created () {
27 this.$store.dispatch("products/setData", "BDCJGPT"); 27 console.log("hhh");
28 }, 28 this.$store.dispatch("products/setData", "BDCJGPT");
29 mixins: [ResizeMixin], 29 },
30 computed: { 30 mixins: [ResizeMixin],
31 ...mapState({ 31 computed: {
32 sidebar: state => state.app.sidebar, 32 ...mapState({
33 needTagsView: state => state.settings.tagsView, 33 sidebar: state => state.app.sidebar,
34 fixedHeader: state => state.settings.fixedHeader 34 needTagsView: state => state.settings.tagsView,
35 }) 35 fixedHeader: state => state.settings.fixedHeader
36 })
37 }
36 } 38 }
37 }
38 </script> 39 </script>
39 <style lang="scss"> 40 <style lang="scss">
40 @import "~@/styles/jgSidebar.scss"; 41 @import "~@/styles/jgSidebar.scss";
41 </style> 42 </style>
42 <style lang="scss" scoped> 43 <style lang="scss" scoped>
43 @import "~@/styles/mixin.scss"; 44 @import "~@/styles/mixin.scss";
44 45
45 .app-wrapper { 46 .app-wrapper {
46 @include clearfix; 47 @include clearfix;
47 position: relative; 48 position: relative;
48 height: 100%; 49 height: 100%;
49 width: 100%; 50 width: 100%;
50 min-width: 1280px; 51 min-width: 1280px;
51 background: url("~@/image/bg.png") no-repeat; 52 background: url("~@/image/bg.png") no-repeat;
52 background-size: 100% 100%; 53 background-size: 100% 100%;
53 padding: 12px; 54 padding: 12px;
54 box-sizing: border-box; 55 box-sizing: border-box;
55 56
56 &.mobile.openSidebar { 57 &.mobile.openSidebar {
57 position: fixed; 58 position: fixed;
58 top: 0; 59 top: 0;
60 }
59 } 61 }
60 }
61 62
62 .appMain { 63 .appMain {
63 // min-width: 1280px; 64 // min-width: 1280px;
64 height: calc(100vh - 101px) !important; 65 height: calc(100vh - 101px) !important;
65 box-sizing: border-box; 66 box-sizing: border-box;
66 67
67 .app-main { 68 .app-main {
68 height: 100%; 69 height: 100%;
70 }
69 } 71 }
70 }
71 </style> 72 </style>
......
...@@ -6,7 +6,13 @@ ...@@ -6,7 +6,13 @@
6 <Breadcrumb /> 6 <Breadcrumb />
7 </el-form-item> 7 </el-form-item>
8 <el-row class="mb-5"> 8 <el-row class="mb-5">
9 <el-col :span="2" class="btnColRight"> 9 <el-col :span="4">
10 <el-form-item label="菜单名称" prop="menuName">
11 <el-input v-model.trim="form.menuName" class="width100" clearable placeholder="菜单名称"></el-input>
12 </el-form-item>
13 </el-col>
14 <el-col :span="3" class="btnColRight">
15 <btn nativeType="cx" @click="searchQuery">查询</btn>
10 <btn nativeType="cx" @click="handleAdd()">新增菜单</btn> 16 <btn nativeType="cx" @click="handleAdd()">新增菜单</btn>
11 </el-col> 17 </el-col>
12 </el-row> 18 </el-row>
...@@ -45,11 +51,11 @@ ...@@ -45,11 +51,11 @@
45 return { 51 return {
46 isDialog: false, 52 isDialog: false,
47 tablelistData: [], 53 tablelistData: [],
54 listData: [],
48 resourceCategoryId: "", 55 resourceCategoryId: "",
49 taskData: null, 56 taskData: null,
50 form: { 57 form: {
51 job_name: "", 58 menuName: "",
52 currentPage: 1,
53 }, 59 },
54 title: "", 60 title: "",
55 queryParam: {}, 61 queryParam: {},
...@@ -96,11 +102,6 @@ ...@@ -96,11 +102,6 @@
96 ]), 102 ]),
97 data: [], 103 data: [],
98 }, 104 },
99 pageData: {
100 total: 5,
101 pageSize: 15,
102 current: 1,
103 },
104 tableUrl: api.menus, // 菜单接口地址 105 tableUrl: api.menus, // 菜单接口地址
105 meumurlid: api.subsystem,// 项目id接口地址 106 meumurlid: api.subsystem,// 项目id接口地址
106 productId: ""//项目id 107 productId: ""//项目id
...@@ -113,11 +114,48 @@ ...@@ -113,11 +114,48 @@
113 ...mapGetters(["products"]) 114 ...mapGetters(["products"])
114 }, 115 },
115 methods: { 116 methods: {
117 //查询
118 searchQuery () {
119 if (this.form.menuName) {
120 this.tablelistData = this.childrenFn(this.listData, this.form.menuName);
121 } else {
122 this.getTableList()
123 }
124 },
125 childrenFn (arr, key) {
126 const that = this;
127 let searchTree = [];
128 arr.forEach((item, index) => {
129 if (item.children != undefined && item.children.length != 0) {
130 let leaf = that.childrenFn(item.children, key);
131 if (leaf != undefined) {
132 let { name, code, resourceCategoryId, id, iproductId, operations, metadata } = item;
133 let parentObj = {
134 code, name, resourceCategoryId, id, iproductId, operations, metadata, children: leaf
135 };
136 searchTree.push(parentObj);
137 } else {
138 if (item.name.indexOf(key) != -1) {
139 searchTree.push(item);
140 }
141 }
142 } else {
143 if (item.name.indexOf(key) != -1) {
144
145 searchTree.push(item);
146 }
147 }
148 });
149 if (searchTree != undefined && searchTree.length != 0) {
150 return searchTree;
151 }
152 },
116 // 加载表格数据 153 // 加载表格数据
117 getTableList () { 154 getTableList () {
118 getMenuInfo(sessionStorage.getItem("products")).then((res) => { 155 getMenuInfo(sessionStorage.getItem("products")).then((res) => {
119 if (res.code === 200) { 156 if (res.code === 200) {
120 this.tablelistData = judgeSort(res.result) 157 this.tablelistData = judgeSort(res.result)
158 this.listData = this.tablelistData
121 } else { 159 } else {
122 this.$message.error({ message: res.message, showClose: true }) 160 this.$message.error({ message: res.message, showClose: true })
123 } 161 }
...@@ -213,13 +251,7 @@ ...@@ -213,13 +251,7 @@
213 @import "~@/styles/mixin.scss"; 251 @import "~@/styles/mixin.scss";
214 252
215 // @import "~@/styles/public.scss"; 253 // @import "~@/styles/public.scss";
216 .btnColRight { 254
217 height: 30px;
218 .button {
219 position: absolute;
220 left: 30px;
221 }
222 }
223 /deep/.el-table__expand-icon { 255 /deep/.el-table__expand-icon {
224 color: #fff; 256 color: #fff;
225 } 257 }
......
...@@ -6,7 +6,13 @@ ...@@ -6,7 +6,13 @@
6 <Breadcrumb /> 6 <Breadcrumb />
7 </el-form-item> 7 </el-form-item>
8 <el-row class="mb-5"> 8 <el-row class="mb-5">
9 <el-col :span="2" class="btnColRight"> 9 <el-col :span="4">
10 <el-form-item label="菜单名称" prop="rolesName">
11 <el-input v-model.trim="form.rolesName" class="width100" clearable placeholder="角色名称"></el-input>
12 </el-form-item>
13 </el-col>
14 <el-col :span="3" class="btnColRight">
15 <btn nativeType="cx" @click="searchQuery">查询</btn>
10 <btn nativeType="cx" @click="handleAddEdit">增加角色</btn> 16 <btn nativeType="cx" @click="handleAddEdit">增加角色</btn>
11 </el-col> 17 </el-col>
12 </el-row> 18 </el-row>
...@@ -53,10 +59,10 @@ ...@@ -53,10 +59,10 @@
53 waitMemberList: [], 59 waitMemberList: [],
54 keyList: [], 60 keyList: [],
55 listdata: [], 61 listdata: [],
62 setlistdata: [],
56 tableUrlroles: api.roles, 63 tableUrlroles: api.roles,
57 form: { 64 form: {
58 job_name: "", 65 rolesName: "",
59 currentPage: 1,
60 }, 66 },
61 // 当前所选角色id 67 // 当前所选角色id
62 roleId: "", 68 roleId: "",
...@@ -247,12 +253,33 @@ ...@@ -247,12 +253,33 @@
247 }, 253 },
248 mounted () { }, 254 mounted () { },
249 methods: { 255 methods: {
256 //查询
257 searchQuery () {
258 if (this.form.rolesName) {
259 this.listdata = this.childrenFn(this.setlistdata, this.form.rolesName);
260 } else {
261 this.getTableData()
262 }
263 },
264 childrenFn (arr, key) {
265 let searchTree = [];
266 arr.forEach((item, index) => {
267 if (item.name.indexOf(key) != -1) {
268
269 searchTree.push(item);
270 }
271 });
272 if (searchTree != undefined && searchTree.length != 0) {
273 return judgeSort(searchTree);
274 }
275 },
250 // 获取角色列表 276 // 获取角色列表
251 getTableData () { 277 getTableData () {
252 getRolesById([1, 2]) 278 getRolesById([1, 2])
253 .then((res) => { 279 .then((res) => {
254 this.listdata = res.content; 280 this.listdata = res.content;
255 this.listdata = judgeSort(this.listdata); 281 this.listdata = judgeSort(this.listdata);
282 this.setlistdata = res.content;
256 }) 283 })
257 .catch((e) => console.error(e)); 284 .catch((e) => console.error(e));
258 }, 285 },
...@@ -481,13 +508,7 @@ ...@@ -481,13 +508,7 @@
481 @import "~@/styles/mixin.scss"; 508 @import "~@/styles/mixin.scss";
482 509
483 // @import "~@/styles/public.scss"; 510 // @import "~@/styles/public.scss";
484 .btnColRight { 511
485 height: 30px;
486 .button {
487 position: absolute;
488 left: 30px;
489 }
490 }
491 /deep/.el-button.is-disabled.el-button--text { 512 /deep/.el-button.is-disabled.el-button--text {
492 width: 64px; 513 width: 64px;
493 height: 28px; 514 height: 28px;
......
...@@ -5,13 +5,27 @@ ...@@ -5,13 +5,27 @@
5 <el-form-item> 5 <el-form-item>
6 <Breadcrumb /> 6 <Breadcrumb />
7 </el-form-item> 7 </el-form-item>
8 <el-row class="mb-5"> 8 <el-row class="mt-10">
9 <!-- 按钮操作 --> 9 <el-col :span="4">
10 <el-col :span="2" class="btnColRight"> 10 <el-form-item label="用户名" prop="loginName">
11 <el-form-item> 11 <el-input v-model.trim="form.loginName" class="width100" clearable placeholder="用户名"></el-input>
12 <btn nativeType="cx" @click="handleAdd">添加人员</btn>
13 </el-form-item> 12 </el-form-item>
14 </el-col> 13 </el-col>
14 <el-col :span="4">
15 <el-form-item label="姓名" prop="name">
16 <el-input v-model.trim="form.name" class="width100" clearable placeholder="姓名"></el-input>
17 </el-form-item>
18 </el-col>
19 <el-col :span="4">
20 <el-form-item label="工号" prop="code">
21 <el-input v-model.trim="form.code" class="width100" clearable placeholder="工号"></el-input>
22 </el-form-item>
23 </el-col>
24 <!-- 操作按钮 -->
25 <el-col :span="3" class="btnColRight">
26 <btn nativeType="cx" @click="searchQuery">查询</btn>
27 <btn nativeType="cx" @click="handleAdd">添加人员</btn>
28 </el-col>
15 </el-row> 29 </el-row>
16 </el-form> 30 </el-form>
17 </div> 31 </div>
...@@ -33,7 +47,7 @@ ...@@ -33,7 +47,7 @@
33 } from "@/utils/operation"; 47 } from "@/utils/operation";
34 import { 48 import {
35 resetPassword, 49 resetPassword,
36 getUserList, 50 getUserList, getUserLists
37 } from "@/api/personnelManage"; 51 } from "@/api/personnelManage";
38 import { api, deleteAction } from '@/api/manageApi' 52 import { api, deleteAction } from '@/api/manageApi'
39 import data from "./data"; 53 import data from "./data";
...@@ -53,8 +67,9 @@ ...@@ -53,8 +67,9 @@
53 taskData: null, 67 taskData: null,
54 keyList: [], 68 keyList: [],
55 form: { 69 form: {
56 job_name: "", 70 loginName: "",
57 currentPage: 1, 71 name: "",
72 code: "",
58 }, 73 },
59 queryParam: {}, 74 queryParam: {},
60 selectType: "0", 75 selectType: "0",
...@@ -141,6 +156,7 @@ ...@@ -141,6 +156,7 @@
141 </el-button> 156 </el-button>
142 <el-button 157 <el-button
143 type="text" 158 type="text"
159 size="mini"
144 class='movebtnColor' 160 class='movebtnColor'
145 disabled={scope.row.isBottom} 161 disabled={scope.row.isBottom}
146 onClick={() => { 162 onClick={() => {
...@@ -163,7 +179,6 @@ ...@@ -163,7 +179,6 @@
163 type="text" 179 type="text"
164 size="mini" 180 size="mini"
165 class='resetbtnColor' 181 class='resetbtnColor'
166 icon="el-icon-video-pause"
167 onClick={() => { 182 onClick={() => {
168 this.resetPassword(scope.row.id); 183 this.resetPassword(scope.row.id);
169 }} 184 }}
...@@ -174,7 +189,6 @@ ...@@ -174,7 +189,6 @@
174 type="text" 189 type="text"
175 size="mini" 190 size="mini"
176 class='successColor' 191 class='successColor'
177 icon="el-icon-edit"
178 onClick={() => { 192 onClick={() => {
179 this.handleEdit(scope.row); 193 this.handleEdit(scope.row);
180 }} 194 }}
...@@ -185,7 +199,6 @@ ...@@ -185,7 +199,6 @@
185 type="text" 199 type="text"
186 size="mini" 200 size="mini"
187 class='delColor' 201 class='delColor'
188 icon="el-icon-delete"
189 onClick={() => { 202 onClick={() => {
190 this.handleDelete(scope.row.id, scope.row.name); 203 this.handleDelete(scope.row.id, scope.row.name);
191 }} 204 }}
...@@ -215,14 +228,34 @@ ...@@ -215,14 +228,34 @@
215 this.$refs.dialogForm.adds(); 228 this.$refs.dialogForm.adds();
216 this.$refs.dialogForm.title = "添加"; 229 this.$refs.dialogForm.title = "添加";
217 }, 230 },
218 getTableList () { 231 // 查询
219 this.loading = true; 232 searchQuery () {
233 console.log(" console.log(this.form);", this.form);
220 this.queryParam = { 234 this.queryParam = {
221 organizationId: this.departmentid.organizationId, 235 organizationId: this.departmentid.organizationId,
222 departmentId: this.departmentid.departmentId, 236 departmentId: this.departmentid.departmentId,
237 name: this.form.name,
238 code: this.form.code,
239 loginName: this.form.loginName,
223 }; 240 };
224 getUserList(this.queryParam).then((res) => { 241 console.log("this.queryParam", this.queryParam);
242 getUserLists(this.queryParam).then((res) => {
243 if (res.status === 1) {
244 this.loading = false;
245 this.tableData.data = res.content;
246 this.tableData.data = judgeSort(this.tableData.data);
247 console.log("this.tableData.data111111111111111", this.tableData.data);
248 } else {
249 this.$message.error({ message: res.message, showClose: true })
250 }
251 })
252 },
253 getTableList () {
254 this.loading = true;
255
256 getUserList().then((res) => {
225 if (res.status === 1) { 257 if (res.status === 1) {
258 console.log("res人员列表", res);
226 this.loading = false; 259 this.loading = false;
227 this.tableData.data = res.content; 260 this.tableData.data = res.content;
228 this.tableData.data = judgeSort(this.tableData.data); 261 this.tableData.data = judgeSort(this.tableData.data);
...@@ -295,6 +328,32 @@ ...@@ -295,6 +328,32 @@
295 } 328 }
296 }) 329 })
297 }, 330 },
331 getDepts (deptIdArr) {
332 let params = {
333 queryOptions: {
334 conditionGroup: {
335 conditions: [
336 {
337 property: "id",
338 value: deptIdArr,
339 operator: "IN",
340 },
341 ],
342 queryRelation: "AND",
343 },
344 orderBys: [],
345 },
346 };
347 getAction(api.departments, params).then(
348 (res) => {
349 let deptsList = res.content;
350 console.log(deptsList);
351 },
352 (err) => {
353 console.log("err :", err);
354 }
355 );
356 },
298 // 修改人员信息 357 // 修改人员信息
299 handleEdit (row) { 358 handleEdit (row) {
300 this.isDialog = true 359 this.isDialog = true
...@@ -331,13 +390,13 @@ ...@@ -331,13 +390,13 @@
331 </script> 390 </script>
332 <style scoped lang="scss"> 391 <style scoped lang="scss">
333 @import "~@/styles/mixin.scss"; 392 @import "~@/styles/mixin.scss";
334 .btnColRight { 393 // .btnColRight {
335 height: 30px; 394 // height: 30px;
336 .button { 395 // .button {
337 position: absolute; 396 // position: absolute;
338 left: 30px; 397 // left: 30px;
339 } 398 // }
340 } 399 // }
341 /deep/.el-button.is-disabled.el-button--text { 400 /deep/.el-button.is-disabled.el-button--text {
342 width: 64px; 401 width: 64px;
343 height: 28px; 402 height: 28px;
......