refactor:基于 lint 处理排版
This commit is contained in:
@@ -279,7 +279,7 @@ export function useGridFormSchema(): VbenFormSchema[] {
|
||||
}
|
||||
|
||||
/** 列表的字段 */
|
||||
export function useGridColumns<T = SystemUserApi.SystemUser>(
|
||||
export function useGridColumns<T = SystemUserApi.User>(
|
||||
onActionClick: OnActionClickFn<T>,
|
||||
onStatusChange?: (
|
||||
newStatus: number,
|
||||
|
||||
@@ -65,7 +65,7 @@ async function onExport() {
|
||||
|
||||
/** 选择部门 */
|
||||
const searchDeptId = ref<number | undefined>(undefined);
|
||||
async function onDeptSelect(dept: SystemDeptApi.SystemDept) {
|
||||
async function onDeptSelect(dept: SystemDeptApi.Dept) {
|
||||
searchDeptId.value = dept.id;
|
||||
onRefresh();
|
||||
}
|
||||
@@ -81,12 +81,12 @@ function onImport() {
|
||||
}
|
||||
|
||||
/** 编辑用户 */
|
||||
function onEdit(row: SystemUserApi.SystemUser) {
|
||||
function onEdit(row: SystemUserApi.User) {
|
||||
formModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 删除用户 */
|
||||
async function onDelete(row: SystemUserApi.SystemUser) {
|
||||
async function onDelete(row: SystemUserApi.User) {
|
||||
const hideLoading = message.loading({
|
||||
content: $t('ui.actionMessage.deleting', [row.username]),
|
||||
duration: 0,
|
||||
@@ -105,12 +105,12 @@ async function onDelete(row: SystemUserApi.SystemUser) {
|
||||
}
|
||||
|
||||
/** 重置密码 */
|
||||
function onResetPassword(row: SystemUserApi.SystemUser) {
|
||||
function onResetPassword(row: SystemUserApi.User) {
|
||||
resetPasswordModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
/** 分配角色 */
|
||||
function onAssignRole(row: SystemUserApi.SystemUser) {
|
||||
function onAssignRole(row: SystemUserApi.User) {
|
||||
assignRoleModalApi.setData(row).open();
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ function onAssignRole(row: SystemUserApi.SystemUser) {
|
||||
/** 更新用户状态 */
|
||||
async function onStatusChange(
|
||||
newStatus: number,
|
||||
row: SystemUserApi.SystemUser,
|
||||
row: SystemUserApi.User,
|
||||
): Promise<boolean | undefined> {
|
||||
return new Promise((resolve, reject) => {
|
||||
Modal.confirm({
|
||||
@@ -147,10 +147,7 @@ async function onStatusChange(
|
||||
}
|
||||
|
||||
/** 表格操作按钮的回调函数 */
|
||||
function onActionClick({
|
||||
code,
|
||||
row,
|
||||
}: OnActionClickParams<SystemUserApi.SystemUser>) {
|
||||
function onActionClick({ code, row }: OnActionClickParams<SystemUserApi.User>) {
|
||||
switch (code) {
|
||||
case 'assign-role': {
|
||||
onAssignRole(row);
|
||||
@@ -198,7 +195,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
refresh: { code: 'query' },
|
||||
search: true,
|
||||
},
|
||||
} as VxeTableGridOptions<SystemUserApi.SystemUser>,
|
||||
} as VxeTableGridOptions<SystemUserApi.User>,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemUserApi.SystemUser>();
|
||||
const data = modalApi.getData<SystemUserApi.User>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import { getSimpleDeptList } from '#/api/system/dept';
|
||||
import { handleTree } from '#/utils/tree';
|
||||
|
||||
const emit = defineEmits(['select']);
|
||||
const deptList = ref<SystemDeptApi.SystemDept[]>([]); // 部门列表
|
||||
const deptList = ref<SystemDeptApi.Dept[]>([]); // 部门列表
|
||||
const deptTree = ref<any[]>([]); // 部门树
|
||||
const expandedKeys = ref<number[]>([]); // 展开的节点
|
||||
const loading = ref(false); // 加载状态
|
||||
|
||||
@@ -14,7 +14,7 @@ import { $t } from '#/locales';
|
||||
import { useFormSchema } from '../data';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
const formData = ref<SystemUserApi.SystemUser>();
|
||||
const formData = ref<SystemUserApi.User>();
|
||||
const getTitle = computed(() => {
|
||||
return formData.value?.id
|
||||
? $t('ui.actionTitle.edit', ['用户'])
|
||||
@@ -35,7 +35,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
}
|
||||
modalApi.lock();
|
||||
// 提交表单
|
||||
const data = (await formApi.getValues()) as SystemUserApi.SystemUser;
|
||||
const data = (await formApi.getValues()) as SystemUserApi.User;
|
||||
try {
|
||||
await (formData.value?.id ? updateUser(data) : createUser(data));
|
||||
// 关闭并提示
|
||||
@@ -54,7 +54,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemUserApi.SystemUser>();
|
||||
const data = modalApi.getData<SystemUserApi.User>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
return;
|
||||
}
|
||||
// 加载数据
|
||||
const data = modalApi.getData<SystemUserApi.SystemUser>();
|
||||
const data = modalApi.getData<SystemUserApi.User>();
|
||||
if (!data || !data.id) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user