From 778ada00fc1dc32e274ae1a90e18c1720bfb6325 Mon Sep 17 00:00:00 2001 From: dinghao <2639919794@qq.com> Date: Tue, 28 May 2024 18:00:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hx-ai-intelligent/src/api/origanizemanage.ts | 13 +---- hx-ai-intelligent/src/config/app.config.ts | 1 + .../view/organizationManage/usermanage/config.ts | 6 +- .../view/organizationManage/usermanage/index.vue | 67 +++++++++++++--------- lib/saas/config/table.config.ts | 4 +- 5 files changed, 48 insertions(+), 43 deletions(-) diff --git a/hx-ai-intelligent/src/api/origanizemanage.ts b/hx-ai-intelligent/src/api/origanizemanage.ts index 93a68c1..00475b0 100644 --- a/hx-ai-intelligent/src/api/origanizemanage.ts +++ b/hx-ai-intelligent/src/api/origanizemanage.ts @@ -1,13 +1,4 @@ -// import request from '@/utils/request'; - -// export function login(data) { -// return request({ -// url: '/carbon-smart/api/user/queryUserByPage', -// method: 'post', -// data, -// }); -// } - export const origanizemanage = { - list: '/carbon-smart/api/user/queryUserByPage', + userList: '/carbon-smart/api/user/queryUserByPage', + addUser: '/carbon-smart/api/user/save', }; diff --git a/hx-ai-intelligent/src/config/app.config.ts b/hx-ai-intelligent/src/config/app.config.ts index 2c34c92..62c819b 100644 --- a/hx-ai-intelligent/src/config/app.config.ts +++ b/hx-ai-intelligent/src/config/app.config.ts @@ -73,6 +73,7 @@ export const appConfig = { accountCode: 'userId', accountName: 'realName', accountRealName: 'realName', + orgId: 'orgId', }); return { data: { ...trD } }; }); diff --git a/hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts b/hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts index 01b375e..ab87f71 100644 --- a/hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts +++ b/hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts @@ -13,7 +13,7 @@ export const formConfig = [ schemas: [ { label: '账号', - field: 'zhanghao', + field: 'accountNo', component: 'NsInput', componentProps: { placeholder: '请输入账号', @@ -28,7 +28,7 @@ export const formConfig = [ }, { label: '姓名', - field: 'name', + field: 'realName', component: 'NsInput', componentProps: { placeholder: '请输入姓名', @@ -55,7 +55,7 @@ export const formConfig = [ }, { label: '手机号', - field: 'phone', + field: 'telephone', component: 'NsInput', componentProps: { placeholder: '请输入手机号', diff --git a/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue b/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue index 13bccce..7f3dd36 100644 --- a/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue +++ b/hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue @@ -77,6 +77,8 @@ import { NsMessage } from '/nerv-lib/component'; import { formConfig, formConfig2 } from './config'; import { mockData, mockData2, treeData, treeData2 } from './mock'; + import { origanizemanage } from '/@/api/origanizemanage'; + export default defineComponent({ name: 'OrderListIndex', setup() { @@ -141,12 +143,11 @@ }; const tableConfig = { - // title: '企业管理', - // api: { - // url: '/carbon_emission/device/getGatewayList', - // method: 'post', - // }, - value: mockData.value, + title: '用户管理', + api: origanizemanage.userList, + params: { + orgId: JSON.parse(sessionStorage.getItem('userInfo')).orgId, + }, listField: 'data.records', headerActions: [ { @@ -157,10 +158,11 @@ opMap.type = 'add'; opMap.fuc = (formData: any) => { console.log(formData, 'formData'); - mockData.value.push({ - id: Math.random().toString().slice(2, 6), - ...cloneDeep(formData), - }); + // origanizemanage.addUser + // mockData.value.push({ + // id: Math.random().toString().slice(2, 6), + // ...cloneDeep(formData), + // }); }; visible.value = true; }, @@ -214,10 +216,6 @@ }, }, ], - params: { - page: 0, - pageSize: 10, - }, columns: [ { title: '序号', @@ -231,16 +229,16 @@ }, { title: '账号', - dataIndex: 'zhanghao', + dataIndex: 'accountNo', sorter: { - compare: (a, b) => a.zhanghao - b.zhanghao, + compare: (a, b) => a.accountNo - b.accountNo, }, }, { title: '姓名', - dataIndex: 'name', + dataIndex: 'realName', sorter: { - compare: (a, b) => a.name - b.name, + compare: (a, b) => a.realName - b.realName, }, }, { @@ -252,7 +250,7 @@ }, { title: '手机号', - dataIndex: 'phone', + dataIndex: 'telephone', }, { title: '邮箱', @@ -260,15 +258,30 @@ }, { title: '组织关系', - dataIndex: 'relation', + dataIndex: 'deptInfo', + customRender: (value) => { + return value.record.deptInfo.orgName; + }, }, { - title: '部门角色', - dataIndex: 'role', + title: '部门/角色', + dataIndex: 'orgInfo', + customRender: (value) => { + // // console.log(value.record.orgInfo.orgName, 'ss'); + // console.log( + // value.record.userRoleList.map((item) => { + // return `${value.record.orgInfo.orgName}/${item.roleName}`; + // }), + // ); + // value.record.userRoleList.map((item) => { + // return `${value.record.orgInfo.orgName}/${item.roleName}`; + // }); + // return `${value.record.orgInfo.orgName}/`; + }, }, { title: '状态', - dataIndex: 'status', + dataIndex: 'userStatus', }, ], columnActions: { @@ -355,7 +368,7 @@ formConfig: { schemas: [ { - field: 'zhanghao', + field: 'accountNo', label: '账号名', component: 'NsInput', componentProps: { @@ -364,7 +377,7 @@ }, }, { - field: 'name', + field: 'realName', label: '姓名', component: 'NsInput', componentProps: { @@ -373,7 +386,7 @@ }, }, { - field: 'phone', + field: 'telephone', label: '手机号', component: 'NsInput', componentProps: { @@ -391,7 +404,7 @@ }, }, { - field: 'status', + field: 'userStatus', label: '用户状态', component: 'NsSelect', componentProps: { diff --git a/lib/saas/config/table.config.ts b/lib/saas/config/table.config.ts index 13f8812..a03e63a 100644 --- a/lib/saas/config/table.config.ts +++ b/lib/saas/config/table.config.ts @@ -5,11 +5,11 @@ export const tableConfig = { listField: 'data.records', // 数据集合 totalField: 'data.total', // 数据总数 - pageFieldOffset: 1, //前端页码1开始,后端0 偏移量 1 + pageFieldOffset: 0, //前端页码1开始,后端0 偏移量 1 pageSizeOptions: ['10', '20', '40'], // 分页设置种类 defaultPageSize: 10, // 默认每页数量 paramsPageSizeField: 'pageSize', - paramsPageField: 'pageNumber', + paramsPageField: 'pageNum', paramsOrderField: 'order', columnActions: { title: '操作',