31
0
Fork 0

feat: 用户模块的新增表单内容优化

develop
JINGYJ 2 years ago
parent d810b6abce
commit 0ea8281f70

@ -8,4 +8,4 @@ VITE_PUBLIC_PATH = /
VITE_ROUTER_HISTORY = "hash"
# 开发环境后端地址
VITE_APP_BASE_URL = 'http://192.168.10.13:8000'
VITE_APP_BASE_URL = 'http://192.168.10.81:8848'

@ -33,12 +33,12 @@ export type RefreshTokenResult = {
};
/** 登录 */
// export const getLogin = (data?: object) => {
// return http.request<UserResult>("post", "/login", { data });
// };
export const getLogin = (data?: object) => {
return http.request<UserResult>("post", baseUrlApi("login"), { data });
return http.request<UserResult>("post", "/login", { data });
};
// export const getLogin = (data?: object) => {
// return http.request<UserResult>("post", baseUrlApi("login"), { data });
// };
// export const getLogin = (data?: object) => {
// const AdminHostUrl = getConfig().AdminHostUrl;

@ -4,7 +4,7 @@ export default {
meta: {
icon: "lollipop",
title: "配置管理",
// showLink: false,
showLink: false,
rank: 5
},
children: [

@ -4,7 +4,7 @@ export default {
meta: {
icon: "lollipop",
title: "数据统计",
// showLink: false,
showLink: false,
rank: 4
},
children: [

@ -18,16 +18,158 @@ const props = withDefaults(defineProps<FormProps>(), {
/** 状态 */
status: null,
/** 组织 */
dept: {
id: null,
name: ""
}
deptId: null
})
});
const ruleFormRef = ref();
const newFormInline = ref(props.formInline);
// const deptList = reactive([
// {
// name: "",
// parentId: 0,
// id: 100,
// sort: 0,
// phone: "15888888888",
// principal: "@cname()",
// email: "@email",
// status: 1, // 1 0
// type: 1, // 1 2 3
// createTime: 1605456000000,
// remark: "@cparagraph(1, 3)"
// },
// {
// name: "",
// parentId: 100,
// id: 101,
// sort: 1,
// phone: "15888888888",
// principal: "@cname()",
// email: "@email",
// status: 1,
// type: 2,
// createTime: 1605456000000,
// remark: "@cparagraph(1, 3)"
// },
// {
// name: "",
// parentId: 101,
// id: 103,
// sort: 1,
// phone: "15888888888",
// principal: "@cname()",
// email: "@email",
// status: 1,
// type: 3,
// createTime: 1605456000000,
// remark: "@cparagraph(1, 3)"
// },
// {
// name: "",
// parentId: 102,
// id: 108,
// sort: 1,
// phone: "15888888888",
// principal: "@cname()",
// email: "@email",
// status: 1,
// type: 3,
// createTime: 1605456000000,
// remark: "@cparagraph(1, 3)"
// },
// {
// name: "",
// parentId: 100,
// id: 102,
// sort: 2,
// phone: "15888888888",
// principal: "@cname()",
// email: "@email",
// status: 1,
// type: 2,
// createTime: 1605456000000,
// remark: "@cparagraph(1, 3)"
// },
// {
// name: "",
// parentId: 101,
// id: 104,
// sort: 2,
// phone: "15888888888",
// principal: "@cname()",
// email: "@email",
// status: 1,
// type: 3,
// createTime: 1605456000000,
// remark: "@cparagraph(1, 3)"
// },
// {
// name: "",
// parentId: 102,
// id: 109,
// sort: 2,
// phone: "15888888888",
// principal: "@cname()",
// email: "@email",
// status: 1,
// type: 3,
// createTime: 1605456000000,
// remark: "@cparagraph(1, 3)"
// },
// {
// name: "",
// parentId: 101,
// id: 105,
// sort: 3,
// phone: "15888888888",
// principal: "@cname()",
// email: "@email",
// status: 0,
// type: 3,
// createTime: 1605456000000,
// remark: "@cparagraph(1, 3)"
// },
// {
// name: "",
// parentId: 101,
// id: 106,
// sort: 4,
// phone: "15888888888",
// principal: "@cname()",
// email: "@email",
// status: 1,
// type: 3,
// createTime: 1605456000000,
// remark: "@cparagraph(1, 3)"
// },
// {
// name: "",
// parentId: 101,
// id: 107,
// sort: 5,
// phone: "15888888888",
// principal: "@cname()",
// email: "@email",
// status: 0,
// type: 3,
// createTime: 1605456000000,
// remark: "@cparagraph(1, 3)"
// }
// ]);
// const buildTree = (data: any, parentId: number) => {
// const children = data.filter(
// (node: { parentId: number }) => node.parentId === parentId
// );
// return children.map((node: { id: any; name: any }) => {
// const { id, name } = node;
// return {
// value: id,
// label: name,
// children: buildTree(data, id)
// };
// });
// };
function getRef() {
return ruleFormRef.value;
}
@ -67,5 +209,22 @@ defineExpose({ getRef });
inactive-text="已关闭"
/>
</el-form-item>
<el-form-item label="性别" prop="sex">
<el-select v-model="newFormInline.sex" placeholder="请选择">
<el-option label="未知" :value="2" />
<el-option label="男" :value="0" />
<el-option label="女" :value="1" />
</el-select>
</el-form-item>
<!-- <el-form-item label="所属部门" prop="deptId">
<el-tree-select
v-model="newFormInline.deptId"
placeholder="请选择所属部门"
:data="buildTree(deptList, 0)"
filterable
check-strictly
:render-after-expand="false"
/>
</el-form-item> -->
</el-form>
</template>

@ -37,6 +37,7 @@ const {
confirmClick,
handleCheckAllChange,
handleCheckedCitiesChange,
resetPassword,
onSearch,
openDialog,
resetForm,
@ -162,7 +163,6 @@ console.log(allRole);
link
type="primary"
:size="size"
@click="handleUpdate(row)"
:icon="useRenderIcon(More)"
/>
<template #dropdown>
@ -173,6 +173,7 @@ console.log(allRole);
link
type="primary"
:size="size"
@click="resetPassword(row)"
:icon="useRenderIcon(Password)"
>
重置密码
@ -211,7 +212,7 @@ console.log(allRole);
v-model="checkAll"
:indeterminate="isIndeterminate"
@change="handleCheckAllChange"
class="!w-[200px]"
class="!w-[100%]"
>全部</el-checkbox
>
<el-checkbox-group

@ -163,6 +163,7 @@ export function useUser() {
function handleUpdate(row) {
console.log(row);
openDialog("编辑", row);
}
function handleDelete(row) {
@ -284,7 +285,8 @@ export function useUser() {
formInline: {
username: row?.username ?? "",
mobile: row?.mobile ?? "",
status: row?.status ?? ""
status: row?.status ?? "",
sex: row?.sex ?? ""
}
},
width: "40%",
@ -396,6 +398,26 @@ export function useUser() {
//不确定的样式
isIndeterminate.value = value.length !== allRole.value.length;
}
function resetPassword(row: { username: string; id: any }) {
ElMessageBox.prompt(
"请输入用户「" + row.username + "」的新密码",
"重置密码",
{
confirmButtonText: "确定",
cancelButtonText: "取消"
}
)
.then(({ value }) => {
if (!value) {
message(`请输入新密码`, {
type: "warning"
});
return false;
}
})
.catch(() => {});
}
onMounted(() => {
onSearch();
});
@ -415,6 +437,7 @@ export function useUser() {
confirmClick,
handleCheckAllChange,
handleCheckedCitiesChange,
resetPassword,
onSearch,
openDialog,
resetForm,

@ -7,6 +7,10 @@ interface FormItemProps {
status: number;
/** 手机 */
mobile: string;
/** 性别 */
sex: number;
/** 性别 */
deptId: number;
}
interface FormProps {
formInline: FormItemProps;

Loading…
Cancel
Save