Browse Source

提交

main
dinghao 6 months ago
parent
commit
778ada00fc
  1. 13
      hx-ai-intelligent/src/api/origanizemanage.ts
  2. 1
      hx-ai-intelligent/src/config/app.config.ts
  3. 6
      hx-ai-intelligent/src/view/organizationManage/usermanage/config.ts
  4. 67
      hx-ai-intelligent/src/view/organizationManage/usermanage/index.vue
  5. 4
      lib/saas/config/table.config.ts

13
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',
};

1
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 } };
});

6
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: '请输入手机号',

67
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: {

4
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: '操作',

Loading…
Cancel
Save