|
@ -24,7 +24,7 @@ |
|
|
'separator', |
|
|
'separator', |
|
|
{ |
|
|
{ |
|
|
name: 'setPassword', |
|
|
name: 'setPassword', |
|
|
label: t('system.user.action.setPassword'), |
|
|
label: $t('system.user.action.setPassword'), |
|
|
icon: 'bi-shield-check', |
|
|
icon: 'bi-shield-check', |
|
|
enableIf: function (selecteds) { |
|
|
enableIf: function (selecteds) { |
|
|
return selecteds.length > 0; |
|
|
return selecteds.length > 0; |
|
@ -35,7 +35,7 @@ |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: 'setAllPassword', |
|
|
name: 'setAllPassword', |
|
|
label: t('system.user.action.setAllPassword'), |
|
|
label: $t('system.user.action.setAllPassword'), |
|
|
icon: 'bi-shield', |
|
|
icon: 'bi-shield', |
|
|
enableIf: function (selecteds) { |
|
|
enableIf: function (selecteds) { |
|
|
return true; |
|
|
return true; |
|
@ -47,7 +47,7 @@ |
|
|
'separator', |
|
|
'separator', |
|
|
{ |
|
|
{ |
|
|
name: 'resetPassword', |
|
|
name: 'resetPassword', |
|
|
label: t('system.user.action.resetPassword'), |
|
|
label: $t('system.user.action.resetPassword'), |
|
|
icon: 'bi-shield-fill-check', |
|
|
icon: 'bi-shield-fill-check', |
|
|
enableIf: function (selecteds) { |
|
|
enableIf: function (selecteds) { |
|
|
return selecteds.length > 0; |
|
|
return selecteds.length > 0; |
|
@ -63,16 +63,16 @@ |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: 'resetAllPassword', |
|
|
name: 'resetAllPassword', |
|
|
label: t('system.user.action.resetAllPassword'), |
|
|
label: $t('system.user.action.resetAllPassword'), |
|
|
icon: 'bi-shield-fill', |
|
|
icon: 'bi-shield-fill', |
|
|
enableIf: function (selecteds) { |
|
|
enableIf: function (selecteds) { |
|
|
return true; |
|
|
return true; |
|
|
}, |
|
|
}, |
|
|
click: function () { |
|
|
click: function () { |
|
|
DialogManager.confirm(t('system.user.confirm.resetAllPassword'), () => { |
|
|
DialogManager.confirm($t('system.user.confirm.resetAllPassword'), () => { |
|
|
axios.post(Environment.apiContextPath('/api/system/user/resetAllPassword')).then(() => { |
|
|
axios.post(Environment.apiContextPath('/api/system/user/resetAllPassword')).then(() => { |
|
|
setPasswordDialogRef.value.hide(); |
|
|
setPasswordDialogRef.value.hide(); |
|
|
NotifyManager.info(t('operationSuccess')); |
|
|
NotifyManager.info($t('operationSuccess')); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
@ -84,11 +84,11 @@ |
|
|
:data-url="Environment.apiContextPath('/api/system/user')" |
|
|
:data-url="Environment.apiContextPath('/api/system/user')" |
|
|
row-key="id" |
|
|
row-key="id" |
|
|
:columns="[ |
|
|
:columns="[ |
|
|
{ name: 'loginName', label: t('loginName') }, |
|
|
{ name: 'loginName', label: $t('loginName') }, |
|
|
{ name: 'userName', label: t('userName') }, |
|
|
{ name: 'userName', label: $t('userName') }, |
|
|
{ |
|
|
{ |
|
|
name: 'status', |
|
|
name: 'status', |
|
|
label: t('status'), |
|
|
label: $t('status'), |
|
|
format: (value, row) => { |
|
|
format: (value, row) => { |
|
|
return { |
|
|
return { |
|
|
componentType: UserStatusTag, |
|
|
componentType: UserStatusTag, |
|
@ -96,9 +96,9 @@ |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
{ name: 'dataComeFrom', label: t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) }, |
|
|
{ name: 'dataComeFrom', label: $t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) }, |
|
|
{ name: 'lastModifier', label: t('lastModifier') }, |
|
|
{ name: 'lastModifier', label: $t('lastModifier') }, |
|
|
{ name: 'lastModifyDate', label: t('lastModifyDate'), format: Formater.dateOnly() }, |
|
|
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.dateOnly() }, |
|
|
]" |
|
|
]" |
|
|
:editor="{ |
|
|
:editor="{ |
|
|
dialog: { |
|
|
dialog: { |
|
@ -108,33 +108,33 @@ |
|
|
form: { |
|
|
form: { |
|
|
colsNum: 4, |
|
|
colsNum: 4, |
|
|
fields: [ |
|
|
fields: [ |
|
|
{ name: 'loginName', label: t('loginName'), type: 'text', required: true, colspan: 4 }, |
|
|
{ name: 'loginName', label: $t('loginName'), type: 'text', required: true, colspan: 4 }, |
|
|
{ name: 'userName', label: t('userName'), type: 'text', required: true, colspan: 4 }, |
|
|
{ name: 'userName', label: $t('userName'), type: 'text', required: true, colspan: 4 }, |
|
|
{ name: 'description', label: t('description'), type: 'textarea', rows: 1, colspan: 4 }, |
|
|
{ name: 'description', label: $t('description'), type: 'textarea', rows: 1, colspan: 4 }, |
|
|
{ name: 'password', label: t('password'), type: 'password', colspan: 4 }, |
|
|
{ name: 'password', label: $t('password'), type: 'password', colspan: 4 }, |
|
|
{ |
|
|
{ |
|
|
name: 'confirmPassword', |
|
|
name: 'confirmPassword', |
|
|
label: t('confirmPassword'), |
|
|
label: $t('confirmPassword'), |
|
|
type: 'password', |
|
|
type: 'password', |
|
|
colspan: 4, |
|
|
colspan: 4, |
|
|
rules: [ |
|
|
rules: [ |
|
|
(value) => { |
|
|
(value) => { |
|
|
return Tools.stringEquals(userGridRef.getAddEditFormRef().value.getData().password, value) |
|
|
return Tools.stringEquals(userGridRef.getAddEditFormRef().value.getData().password, value) |
|
|
? true |
|
|
? true |
|
|
: t('passwordAndConfirmPasswordMustEqual'); |
|
|
: $t('passwordAndConfirmPasswordMustEqual'); |
|
|
}, |
|
|
}, |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
|
{ name: 'mobile', label: t('mobile'), type: 'text', colsFirst: true, colspan: 4 }, |
|
|
{ name: 'mobile', label: $t('mobile'), type: 'text', colsFirst: true, colspan: 4 }, |
|
|
{ name: 'phone', label: t('phone'), type: 'text', colsFirst: true, colspan: 4 }, |
|
|
{ name: 'phone', label: $t('phone'), type: 'text', colsFirst: true, colspan: 4 }, |
|
|
{ name: 'email', label: t('email'), type: 'text', colsFirst: true, colspan: 4 }, |
|
|
{ name: 'email', label: $t('email'), type: 'text', colsFirst: true, colspan: 4 }, |
|
|
{ name: 'weixin', label: t('weixin'), type: 'text', colsFirst: true, colspan: 4 }, |
|
|
{ name: 'weixin', label: $t('weixin'), type: 'text', colsFirst: true, colspan: 4 }, |
|
|
{ name: 'qq', label: t('qq'), type: 'text', colsFirst: true, colspan: 4 }, |
|
|
{ name: 'qq', label: $t('qq'), type: 'text', colsFirst: true, colspan: 4 }, |
|
|
|
|
|
|
|
|
{ name: 'enable', label: t('enable'), type: 'checkbox', defaultValue: true }, |
|
|
{ name: 'enable', label: $t('enable'), type: 'checkbox', defaultValue: true }, |
|
|
{ name: 'accountExpired', label: t('accountExpired'), type: 'checkbox', defaultValue: false }, |
|
|
{ name: 'accountExpired', label: $t('accountExpired'), type: 'checkbox', defaultValue: false }, |
|
|
{ name: 'accountLocked', label: t('accountLocked'), type: 'checkbox', defaultValue: false }, |
|
|
{ name: 'accountLocked', label: $t('accountLocked'), type: 'checkbox', defaultValue: false }, |
|
|
{ name: 'credentialsExpired', label: t('credentialsExpired'), type: 'checkbox', defaultValue: false }, |
|
|
{ name: 'credentialsExpired', label: $t('credentialsExpired'), type: 'checkbox', defaultValue: false }, |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
|
}" |
|
|
}" |
|
@ -142,39 +142,34 @@ |
|
|
panel: { |
|
|
panel: { |
|
|
columnNum: 1, |
|
|
columnNum: 1, |
|
|
fields: [ |
|
|
fields: [ |
|
|
{ name: 'id', label: t('id') }, |
|
|
{ name: 'id', label: $t('id') }, |
|
|
{ name: 'loginName', label: t('loginName') }, |
|
|
{ name: 'loginName', label: $t('loginName') }, |
|
|
{ name: 'userName', label: t('userName') }, |
|
|
{ name: 'userName', label: $t('userName') }, |
|
|
{ name: 'description', label: t('description') }, |
|
|
{ name: 'description', label: $t('description') }, |
|
|
{ name: 'enable', label: t('enable'), format: Formater.yesNo() }, |
|
|
{ name: 'enable', label: $t('enable'), format: Formater.yesNo() }, |
|
|
{ name: 'accountExpired', label: t('accountExpired'), format: Formater.yesNo() }, |
|
|
{ name: 'accountExpired', label: $t('accountExpired'), format: Formater.yesNo() }, |
|
|
{ name: 'accountLocked', label: t('accountLocked'), format: Formater.yesNo() }, |
|
|
{ name: 'accountLocked', label: $t('accountLocked'), format: Formater.yesNo() }, |
|
|
{ name: 'credentialsExpired', label: t('credentialsExpired'), format: Formater.yesNo() }, |
|
|
{ name: 'credentialsExpired', label: $t('credentialsExpired'), format: Formater.yesNo() }, |
|
|
{ name: 'email', label: t('email') }, |
|
|
{ name: 'email', label: $t('email') }, |
|
|
{ name: 'phone', label: t('phone') }, |
|
|
{ name: 'phone', label: $t('phone') }, |
|
|
{ name: 'mobile', label: t('mobile') }, |
|
|
{ name: 'mobile', label: $t('mobile') }, |
|
|
{ name: 'weixin', label: t('weixin') }, |
|
|
{ name: 'weixin', label: $t('weixin') }, |
|
|
{ name: 'qq', label: t('qq') }, |
|
|
{ name: 'qq', label: $t('qq') }, |
|
|
{ name: 'dataComeFrom', label: t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) }, |
|
|
{ name: 'dataComeFrom', label: $t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) }, |
|
|
{ name: 'creator', label: t('creator') }, |
|
|
{ name: 'creator', label: $t('creator') }, |
|
|
{ name: 'createDate', label: t('createDate') }, |
|
|
{ name: 'createDate', label: $t('createDate') }, |
|
|
{ name: 'lastModifier', label: t('lastModifier') }, |
|
|
{ name: 'lastModifier', label: $t('lastModifier') }, |
|
|
{ name: 'lastModifyDate', label: t('lastModifyDate') }, |
|
|
{ name: 'lastModifyDate', label: $t('lastModifyDate') }, |
|
|
{ name: 'corporationCode', label: t('corporationCode') }, |
|
|
{ name: 'corporationCode', label: $t('corporationCode') }, |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
|
}" |
|
|
}" |
|
|
@row-click=" |
|
|
@row-click=" |
|
|
(evt, row, index) => { |
|
|
(evt, row, index) => { |
|
|
|
|
|
console.log(row.id); |
|
|
currentSelectedUserId = row.id; |
|
|
currentSelectedUserId = row.id; |
|
|
if (roleGridRef) { |
|
|
roleGridRef?.refresh(); |
|
|
roleGridRef.setFetchDataUrl(Environment.apiContextPath('/api/system/role/queryRolesByUser?userId=') + row.id); |
|
|
orgTreeGridRef?.refresh(); |
|
|
roleGridRef.refresh(); |
|
|
|
|
|
} |
|
|
|
|
|
if (orgTreeGridRef) { |
|
|
|
|
|
orgTreeGridRef.setFetchDataUrl(Environment.apiContextPath('/api/system/org/listAllOrgsWithSelectedStatusByUser?userId=') + row.id); |
|
|
|
|
|
orgTreeGridRef.refresh(); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
" |
|
|
" |
|
|
></w-grid> |
|
|
></w-grid> |
|
@ -215,7 +210,7 @@ |
|
|
}, |
|
|
}, |
|
|
{ |
|
|
{ |
|
|
name: 'addAllRole', |
|
|
name: 'addAllRole', |
|
|
label: t('system.role.action.addAllRole'), |
|
|
label: $t('system.role.action.addAllRole'), |
|
|
enableIf: () => { |
|
|
enableIf: () => { |
|
|
if (userGridRef) { |
|
|
if (userGridRef) { |
|
|
return userGridRef.getSelectedRows().length > 0; |
|
|
return userGridRef.getSelectedRows().length > 0; |
|
@ -225,7 +220,7 @@ |
|
|
click: () => { |
|
|
click: () => { |
|
|
const selectedUser = userGridRef.getSelectedRows()[0]; |
|
|
const selectedUser = userGridRef.getSelectedRows()[0]; |
|
|
DialogManager.confirm( |
|
|
DialogManager.confirm( |
|
|
t('system.role.action.addAllRole.confirm', { userLoginName: selectedUser.loginName, userName: selectedUser.userName }), |
|
|
$t('system.role.action.addAllRole.confirm', { userLoginName: selectedUser.loginName, userName: selectedUser.userName }), |
|
|
() => { |
|
|
() => { |
|
|
axios |
|
|
axios |
|
|
.post(Environment.apiContextPath('/api/system/user/addAllRoles'), { |
|
|
.post(Environment.apiContextPath('/api/system/user/addAllRoles'), { |
|
@ -244,7 +239,7 @@ |
|
|
'separator', |
|
|
'separator', |
|
|
{ |
|
|
{ |
|
|
name: 'removeRole', |
|
|
name: 'removeRole', |
|
|
label: t('system.role.action.removeRole'), |
|
|
label: $t('system.role.action.removeRole'), |
|
|
enableIf: () => { |
|
|
enableIf: () => { |
|
|
if (userGridRef && roleGridRef) { |
|
|
if (userGridRef && roleGridRef) { |
|
|
return userGridRef.getSelectedRows().length > 0 && roleGridRef.getSelectedRows().length > 0; |
|
|
return userGridRef.getSelectedRows().length > 0 && roleGridRef.getSelectedRows().length > 0; |
|
@ -315,7 +310,7 @@ |
|
|
{ |
|
|
{ |
|
|
width: 60, |
|
|
width: 60, |
|
|
name: 'status', |
|
|
name: 'status', |
|
|
label: t('status'), |
|
|
label: $t('status'), |
|
|
format: (value, row) => { |
|
|
format: (value, row) => { |
|
|
return { |
|
|
return { |
|
|
componentType: RoleStatusTag, |
|
|
componentType: RoleStatusTag, |
|
@ -328,17 +323,17 @@ |
|
|
panel: { |
|
|
panel: { |
|
|
columnNum: 1, |
|
|
columnNum: 1, |
|
|
fields: [ |
|
|
fields: [ |
|
|
{ name: 'id', label: t('id') }, |
|
|
{ name: 'id', label: $t('id') }, |
|
|
{ name: 'code', label: t('code') }, |
|
|
{ name: 'code', label: $t('code') }, |
|
|
{ name: 'name', label: t('name') }, |
|
|
{ name: 'name', label: $t('name') }, |
|
|
{ name: 'description', label: t('description') }, |
|
|
{ name: 'description', label: $t('description') }, |
|
|
{ name: 'enable', label: t('enable'), format: Formater.yesNo() }, |
|
|
{ name: 'enable', label: $t('enable'), format: Formater.yesNo() }, |
|
|
{ name: 'dataComeFrom', label: t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) }, |
|
|
{ name: 'dataComeFrom', label: $t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) }, |
|
|
{ name: 'creator', label: t('creator') }, |
|
|
{ name: 'creator', label: $t('creator') }, |
|
|
{ name: 'createDate', label: t('createDate') }, |
|
|
{ name: 'createDate', label: $t('createDate') }, |
|
|
{ name: 'lastModifier', label: t('lastModifier') }, |
|
|
{ name: 'lastModifier', label: $t('lastModifier') }, |
|
|
{ name: 'lastModifyDate', label: t('lastModifyDate') }, |
|
|
{ name: 'lastModifyDate', label: $t('lastModifyDate') }, |
|
|
{ name: 'corporationCode', label: t('corporationCode') }, |
|
|
{ name: 'corporationCode', label: $t('corporationCode') }, |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
|
}" |
|
|
}" |
|
@ -359,7 +354,14 @@ |
|
|
{ |
|
|
{ |
|
|
name: 'save', |
|
|
name: 'save', |
|
|
label: $t('save'), |
|
|
label: $t('save'), |
|
|
click: () => {}, |
|
|
click: () => { |
|
|
|
|
|
axios |
|
|
|
|
|
.post(Environment.apiContextPath('/api/system/user/updateOrgs'), { |
|
|
|
|
|
one: currentSelectedUserId, |
|
|
|
|
|
many: orgTreeGridRef.value.getTicked(), |
|
|
|
|
|
}) |
|
|
|
|
|
.then((response) => {}); |
|
|
|
|
|
}, |
|
|
}, |
|
|
}, |
|
|
'view', |
|
|
'view', |
|
|
]" |
|
|
]" |
|
@ -375,7 +377,7 @@ |
|
|
{ |
|
|
{ |
|
|
width: 60, |
|
|
width: 60, |
|
|
name: 'status', |
|
|
name: 'status', |
|
|
label: t('status'), |
|
|
label: $t('status'), |
|
|
format: (value, row) => { |
|
|
format: (value, row) => { |
|
|
return { |
|
|
return { |
|
|
componentType: RoleStatusTag, |
|
|
componentType: RoleStatusTag, |
|
@ -388,17 +390,17 @@ |
|
|
panel: { |
|
|
panel: { |
|
|
columnNum: 1, |
|
|
columnNum: 1, |
|
|
fields: [ |
|
|
fields: [ |
|
|
{ name: 'id', label: t('id') }, |
|
|
{ name: 'id', label: $t('id') }, |
|
|
{ name: 'code', label: t('code') }, |
|
|
{ name: 'code', label: $t('code') }, |
|
|
{ name: 'name', label: t('name') }, |
|
|
{ name: 'name', label: $t('name') }, |
|
|
{ name: 'description', label: t('description') }, |
|
|
{ name: 'description', label: $t('description') }, |
|
|
{ name: 'enable', label: t('enable'), format: Formater.yesNo() }, |
|
|
{ name: 'enable', label: $t('enable'), format: Formater.yesNo() }, |
|
|
{ name: 'dataComeFrom', label: t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) }, |
|
|
{ name: 'dataComeFrom', label: $t('dataComeFrom'), format: Formater.enum(DataComeFromEnum) }, |
|
|
{ name: 'creator', label: t('creator') }, |
|
|
{ name: 'creator', label: $t('creator') }, |
|
|
{ name: 'createDate', label: t('createDate') }, |
|
|
{ name: 'createDate', label: $t('createDate') }, |
|
|
{ name: 'lastModifier', label: t('lastModifier') }, |
|
|
{ name: 'lastModifier', label: $t('lastModifier') }, |
|
|
{ name: 'lastModifyDate', label: t('lastModifyDate') }, |
|
|
{ name: 'lastModifyDate', label: $t('lastModifyDate') }, |
|
|
{ name: 'corporationCode', label: t('corporationCode') }, |
|
|
{ name: 'corporationCode', label: $t('corporationCode') }, |
|
|
], |
|
|
], |
|
|
}, |
|
|
}, |
|
|
}" |
|
|
}" |
|
@ -413,15 +415,12 @@ |
|
|
</template> |
|
|
</template> |
|
|
<script setup lang="ts"> |
|
|
<script setup lang="ts"> |
|
|
import { ref } from 'vue'; |
|
|
import { ref } from 'vue'; |
|
|
import { useI18n } from 'vue-i18n'; |
|
|
|
|
|
import { Environment, axios, EnumTools, NotifyManager, DialogManager, Formater, Options, Tools } from 'platform-core'; |
|
|
import { Environment, axios, EnumTools, NotifyManager, DialogManager, Formater, Options, Tools } from 'platform-core'; |
|
|
import SelectRoleDialog from './SelectRoleDialog.vue'; |
|
|
import SelectRoleDialog from './SelectRoleDialog.vue'; |
|
|
import SetPasswordDialog from './SetPasswordDialog.vue'; |
|
|
import SetPasswordDialog from './SetPasswordDialog.vue'; |
|
|
import UserStatusTag from './UserStatusTag.vue'; |
|
|
import UserStatusTag from './UserStatusTag.vue'; |
|
|
import RoleStatusTag from './RoleStatusTag.vue'; |
|
|
import RoleStatusTag from './RoleStatusTag.vue'; |
|
|
|
|
|
|
|
|
const { t } = useI18n(); |
|
|
|
|
|
|
|
|
|
|
|
const userGridRef = ref(); |
|
|
const userGridRef = ref(); |
|
|
const roleGridRef = ref(); |
|
|
const roleGridRef = ref(); |
|
|
const orgTreeGridRef = ref(); |
|
|
const orgTreeGridRef = ref(); |
|
@ -431,22 +430,5 @@ const selectedTabRef = ref('role'); |
|
|
const setPasswordDialogRef = ref(); |
|
|
const setPasswordDialogRef = ref(); |
|
|
|
|
|
|
|
|
const DataComeFromEnum = await EnumTools.fetch('io.sc.platform.orm.api.enums.DataComeFrom'); |
|
|
const DataComeFromEnum = await EnumTools.fetch('io.sc.platform.orm.api.enums.DataComeFrom'); |
|
|
const currentSelectedUserId = ref(); |
|
|
const currentSelectedUserId = ref(''); |
|
|
|
|
|
|
|
|
const orgConfigure = { |
|
|
|
|
|
actions: [ |
|
|
|
|
|
{ |
|
|
|
|
|
name: 'save', |
|
|
|
|
|
label: '保存', |
|
|
|
|
|
click: () => { |
|
|
|
|
|
axios |
|
|
|
|
|
.post(Environment.apiContextPath('/api/system/user/updateOrgs'), { |
|
|
|
|
|
one: userGridRef.value.getSelectedRows()[0].id, |
|
|
|
|
|
many: orgTreeGridRef.value.getTicked(), |
|
|
|
|
|
}) |
|
|
|
|
|
.then((response) => {}); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
], |
|
|
|
|
|
}; |
|
|
|
|
|
</script> |
|
|
</script> |
|
|