feat: 添加用户登录功能
This commit is contained in:
@@ -7,39 +7,73 @@
|
||||
@reset-click="handleResetClick" /> -->
|
||||
|
||||
<!-- 列表 -->
|
||||
<page-content ref="contentRef" :content-config="contentConfig" @add-click="handleAddClick"
|
||||
@edit-click="handleEditClick" @export-click="handleExportClick" @search-click="handleSearchClick"
|
||||
@toolbar-click="handleToolbarClick" @operat-click="handleOperatClick" @filter-change="handleFilterChange">
|
||||
<page-content
|
||||
ref="contentRef"
|
||||
:content-config="contentConfig"
|
||||
@add-click="handleAddClick"
|
||||
@edit-click="handleEditClick"
|
||||
@export-click="handleExportClick"
|
||||
@search-click="handleSearchClick"
|
||||
@toolbar-click="handleToolbarClick"
|
||||
@operat-click="handleOperatClick"
|
||||
@filter-change="handleFilterChange"
|
||||
>
|
||||
<template #status="scope">
|
||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||
</el-tag>
|
||||
</template>
|
||||
|
||||
<template #slotNameimage="scope">
|
||||
<el-image
|
||||
v-if="scope.row.pic"
|
||||
:src="scope.row.pic"
|
||||
lazy
|
||||
style="width: 40px; height: 40px"
|
||||
/>
|
||||
<div v-else>无</div>
|
||||
</template>
|
||||
<template #gender="scope">
|
||||
<DictLabel v-model="scope.row[scope.prop]" code="gender" />
|
||||
</template>
|
||||
<template #mobile="scope">
|
||||
<el-text>{{ scope.row[scope.prop] }}</el-text>
|
||||
<copy-button v-if="scope.row[scope.prop]" :text="scope.row[scope.prop]" style="margin-left: 2px" />
|
||||
<copy-button
|
||||
v-if="scope.row[scope.prop]"
|
||||
:text="scope.row[scope.prop]"
|
||||
style="margin-left: 2px"
|
||||
/>
|
||||
</template>
|
||||
</page-content>
|
||||
|
||||
<!-- 新增 -->
|
||||
<page-modal ref="addModalRef" :modal-config="addModalConfig" @submit-click="handleSubmitClick">
|
||||
<page-modal
|
||||
ref="addModalRef"
|
||||
:modal-config="addModalConfig"
|
||||
@submit-click="handleSubmitClick"
|
||||
>
|
||||
<template #gender="scope">
|
||||
<Dict v-model="scope.formData[scope.prop]" code="gender" />
|
||||
</template>
|
||||
</page-modal>
|
||||
|
||||
<!-- 编辑 -->
|
||||
<page-modal ref="editModalRef" :modal-config="editModalConfig" @submit-click="handleSubmitClick">
|
||||
<page-modal
|
||||
ref="editModalRef"
|
||||
:modal-config="editModalConfig"
|
||||
@submit-click="handleSubmitClick"
|
||||
>
|
||||
<template #gender="scope">
|
||||
<Dict v-model="scope.formData[scope.prop]" code="gender" v-bind="scope.attrs" />
|
||||
</template>
|
||||
</page-modal>
|
||||
</template>
|
||||
<template v-else>
|
||||
<page-content ref="contentRef" :content-config="contentConfig2" @operat-click="handleOperatClick">
|
||||
<page-content
|
||||
ref="contentRef"
|
||||
:content-config="contentConfig2"
|
||||
@operat-click="handleOperatClick"
|
||||
>
|
||||
<template #status="scope">
|
||||
<el-tag :type="scope.row[scope.prop] == 1 ? 'success' : 'info'">
|
||||
{{ scope.row[scope.prop] == 1 ? "启用" : "禁用" }}
|
||||
@@ -96,7 +130,6 @@ async function handleEditClick(row: IObject) {
|
||||
const data = await UserAPI.getunitinfo(row.id);
|
||||
editModalRef.value?.setFormData(data);
|
||||
editModalRef.value?.setModalVisible();
|
||||
|
||||
}
|
||||
// 其他工具栏
|
||||
function handleToolbarClick(name: string) {
|
||||
|
||||
@@ -26,8 +26,8 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
||||
// },
|
||||
// exportAction: UserAPI.export,
|
||||
modifyAction: function (params) {
|
||||
console.log(1111112222222222222)
|
||||
let obj = { sort: "1", ...params }
|
||||
console.log(1111112222222222222);
|
||||
let obj = { sort: "1", ...params };
|
||||
return UserAPI.update(obj);
|
||||
},
|
||||
|
||||
@@ -44,13 +44,17 @@ const contentConfig: IContentConfig<UserPageQuery> = {
|
||||
// return res.list;
|
||||
// },
|
||||
pk: "id",
|
||||
toolbar: [
|
||||
"add",
|
||||
],
|
||||
toolbar: ["add"],
|
||||
cols: [
|
||||
// { type: "selection", width: 50, align: "center" },
|
||||
{ label: "分类名称", align: "center", prop: "name" },
|
||||
{ label: "分类图片", align: "center", prop: "pic", templet: "image" },
|
||||
{
|
||||
label: "分类图片",
|
||||
align: "center",
|
||||
prop: "pic",
|
||||
slotName: "slotNameimage",
|
||||
templet: "custom",
|
||||
},
|
||||
{
|
||||
label: "状态",
|
||||
align: "center",
|
||||
|
||||
Reference in New Issue
Block a user