|
@ -77,6 +77,8 @@ |
|
|
import { NsMessage } from '/nerv-lib/component'; |
|
|
import { NsMessage } from '/nerv-lib/component'; |
|
|
import { formConfig, formConfig2 } from './config'; |
|
|
import { formConfig, formConfig2 } from './config'; |
|
|
import { mockData, mockData2, treeData, treeData2 } from './mock'; |
|
|
import { mockData, mockData2, treeData, treeData2 } from './mock'; |
|
|
|
|
|
import { origanizemanage } from '/@/api/origanizemanage'; |
|
|
|
|
|
|
|
|
export default defineComponent({ |
|
|
export default defineComponent({ |
|
|
name: 'OrderListIndex', |
|
|
name: 'OrderListIndex', |
|
|
setup() { |
|
|
setup() { |
|
@ -141,12 +143,11 @@ |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const tableConfig = { |
|
|
const tableConfig = { |
|
|
// title: '企业管理', |
|
|
title: '用户管理', |
|
|
// api: { |
|
|
api: origanizemanage.userList, |
|
|
// url: '/carbon_emission/device/getGatewayList', |
|
|
params: { |
|
|
// method: 'post', |
|
|
orgId: JSON.parse(sessionStorage.getItem('userInfo')).orgId, |
|
|
// }, |
|
|
}, |
|
|
value: mockData.value, |
|
|
|
|
|
listField: 'data.records', |
|
|
listField: 'data.records', |
|
|
headerActions: [ |
|
|
headerActions: [ |
|
|
{ |
|
|
{ |
|
@ -157,10 +158,11 @@ |
|
|
opMap.type = 'add'; |
|
|
opMap.type = 'add'; |
|
|
opMap.fuc = (formData: any) => { |
|
|
opMap.fuc = (formData: any) => { |
|
|
console.log(formData, 'formData'); |
|
|
console.log(formData, 'formData'); |
|
|
mockData.value.push({ |
|
|
// origanizemanage.addUser |
|
|
id: Math.random().toString().slice(2, 6), |
|
|
// mockData.value.push({ |
|
|
...cloneDeep(formData), |
|
|
// id: Math.random().toString().slice(2, 6), |
|
|
}); |
|
|
// ...cloneDeep(formData), |
|
|
|
|
|
// }); |
|
|
}; |
|
|
}; |
|
|
visible.value = true; |
|
|
visible.value = true; |
|
|
}, |
|
|
}, |
|
@ -214,10 +216,6 @@ |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
params: { |
|
|
|
|
|
page: 0, |
|
|
|
|
|
pageSize: 10, |
|
|
|
|
|
}, |
|
|
|
|
|
columns: [ |
|
|
columns: [ |
|
|
{ |
|
|
{ |
|
|
title: '序号', |
|
|
title: '序号', |
|
@ -231,16 +229,16 @@ |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '账号', |
|
|
title: '账号', |
|
|
dataIndex: 'zhanghao', |
|
|
dataIndex: 'accountNo', |
|
|
sorter: { |
|
|
sorter: { |
|
|
compare: (a, b) => a.zhanghao - b.zhanghao, |
|
|
compare: (a, b) => a.accountNo - b.accountNo, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '姓名', |
|
|
title: '姓名', |
|
|
dataIndex: 'name', |
|
|
dataIndex: 'realName', |
|
|
sorter: { |
|
|
sorter: { |
|
|
compare: (a, b) => a.name - b.name, |
|
|
compare: (a, b) => a.realName - b.realName, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
@ -252,7 +250,7 @@ |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '手机号', |
|
|
title: '手机号', |
|
|
dataIndex: 'phone', |
|
|
dataIndex: 'telephone', |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '邮箱', |
|
|
title: '邮箱', |
|
@ -260,15 +258,30 @@ |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '组织关系', |
|
|
title: '组织关系', |
|
|
dataIndex: 'relation', |
|
|
dataIndex: 'deptInfo', |
|
|
|
|
|
customRender: (value) => { |
|
|
|
|
|
return value.record.deptInfo.orgName; |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
title: '部门角色', |
|
|
title: '部门/角色', |
|
|
dataIndex: 'role', |
|
|
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: '状态', |
|
|
title: '状态', |
|
|
dataIndex: 'status', |
|
|
dataIndex: 'userStatus', |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
columnActions: { |
|
|
columnActions: { |
|
@ -355,7 +368,7 @@ |
|
|
formConfig: { |
|
|
formConfig: { |
|
|
schemas: [ |
|
|
schemas: [ |
|
|
{ |
|
|
{ |
|
|
field: 'zhanghao', |
|
|
field: 'accountNo', |
|
|
label: '账号名', |
|
|
label: '账号名', |
|
|
component: 'NsInput', |
|
|
component: 'NsInput', |
|
|
componentProps: { |
|
|
componentProps: { |
|
@ -364,7 +377,7 @@ |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
field: 'name', |
|
|
field: 'realName', |
|
|
label: '姓名', |
|
|
label: '姓名', |
|
|
component: 'NsInput', |
|
|
component: 'NsInput', |
|
|
componentProps: { |
|
|
componentProps: { |
|
@ -373,7 +386,7 @@ |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
field: 'phone', |
|
|
field: 'telephone', |
|
|
label: '手机号', |
|
|
label: '手机号', |
|
|
component: 'NsInput', |
|
|
component: 'NsInput', |
|
|
componentProps: { |
|
|
componentProps: { |
|
@ -391,7 +404,7 @@ |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
field: 'status', |
|
|
field: 'userStatus', |
|
|
label: '用户状态', |
|
|
label: '用户状态', |
|
|
component: 'NsSelect', |
|
|
component: 'NsSelect', |
|
|
componentProps: { |
|
|
componentProps: { |
|
|