feat: app功能基本实现
This commit is contained in:
@@ -20,14 +20,10 @@ import { type PaginationProps } from "@pureadmin/table";
|
||||
import { reactive, ref, computed, onMounted, toRaw, h } from "vue";
|
||||
import { CommonUtils } from "@/utils/common";
|
||||
import { addDialog } from "@/components/ReDialog";
|
||||
import { handleTree, setDisabledForTreeOptions } from "@/utils/tree";
|
||||
import { getDeptListApi } from "@/api/system/dept";
|
||||
import { getPostListApi } from "@/api/system/post";
|
||||
import { getRoleListApi } from "@/api/system/role";
|
||||
|
||||
export function useHook() {
|
||||
const searchFormParams = reactive<UserQuery>({
|
||||
deptId: null,
|
||||
phoneNumber: undefined,
|
||||
status: undefined,
|
||||
username: undefined,
|
||||
@@ -47,8 +43,6 @@ export function useHook() {
|
||||
background: true
|
||||
});
|
||||
|
||||
const deptTreeList = ref([]);
|
||||
const postOptions = ref([]);
|
||||
const roleOptions = ref([]);
|
||||
|
||||
const columns: TableColumnList = [
|
||||
@@ -82,17 +76,6 @@ export function useHook() {
|
||||
</el-tag>
|
||||
)
|
||||
},
|
||||
{
|
||||
label: "部门ID",
|
||||
prop: "deptId",
|
||||
minWidth: 130,
|
||||
hide: true
|
||||
},
|
||||
{
|
||||
label: "部门",
|
||||
prop: "deptName",
|
||||
minWidth: 130
|
||||
},
|
||||
{
|
||||
label: "手机号码",
|
||||
prop: "phoneNumber",
|
||||
@@ -252,18 +235,14 @@ export function useHook() {
|
||||
userId: row?.userId ?? 0,
|
||||
username: row?.username ?? "",
|
||||
nickname: row?.nickname ?? "",
|
||||
deptId: row?.deptId ?? undefined,
|
||||
phoneNumber: row?.phoneNumber ?? "",
|
||||
email: row?.email ?? "",
|
||||
password: title == "新增" ? "" : undefined,
|
||||
sex: row?.sex ?? undefined,
|
||||
status: row?.status ?? undefined,
|
||||
postId: row?.postId ?? undefined,
|
||||
roleId: row?.roleId ?? undefined,
|
||||
remark: row?.remark ?? ""
|
||||
},
|
||||
deptOptions: deptTreeList,
|
||||
postOptions: postOptions,
|
||||
roleOptions: roleOptions
|
||||
},
|
||||
|
||||
@@ -356,15 +335,6 @@ export function useHook() {
|
||||
|
||||
onMounted(async () => {
|
||||
onSearch();
|
||||
const deptResponse = await getDeptListApi();
|
||||
deptTreeList.value = await setDisabledForTreeOptions(
|
||||
handleTree(deptResponse.data),
|
||||
"status"
|
||||
);
|
||||
|
||||
const postResponse = await getPostListApi({});
|
||||
postOptions.value = postResponse.data.rows;
|
||||
|
||||
const roleResponse = await getRoleListApi({});
|
||||
roleOptions.value = roleResponse.data.rows;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user