feat 添加客户登录日志
This commit is contained in:
parent
a0a9638f24
commit
bc8a3a45d9
@ -0,0 +1,38 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
/**
|
||||
* @Descripttion: 客户登录日志Api接口
|
||||
* @version: (1.0)
|
||||
* @Author: (lwh)
|
||||
* @Date: (2023-11-21)
|
||||
* @LastEditors: (lwh)
|
||||
* @LastEditTime: (2023-11-21)
|
||||
*/
|
||||
|
||||
// 客户登录日志分页查询列表
|
||||
export function customerLoginLogList(query) {
|
||||
return request({
|
||||
url: '/business/CustomerLoginLog/getCustomerLoginLogList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 客户登录日志新增或修改
|
||||
export function addOrUpdateCustomerLoginLog(data) {
|
||||
return request({
|
||||
url: '/business/CustomerLoginLog/addOrUpdateCustomerLoginLog',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
||||
|
||||
// 客户登录日志删除
|
||||
export function delCustomerLoginLog(ids) {
|
||||
return request({
|
||||
url: '/business/CustomerLoginLog/'+ ids,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||
<el-row :gutter="20">
|
||||
|
||||
<el-col :lg="12">
|
||||
<!-- <el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="自己的省市区" prop="RegionPid">
|
||||
<el-cascader class="w100" :options="dataList"
|
||||
:props="{ checkStrictly: false, value: 'regionId', label: 'regionName', emitPath: true }"
|
||||
@ -22,7 +22,7 @@
|
||||
</template>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-col> -->
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="openid" prop="customerXcxOpenid">
|
||||
@ -30,8 +30,8 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="昵称" prop="customerNickname">
|
||||
<el-input v-model="formData.customerNickname" placeholder="请输入昵称" />
|
||||
<el-form-item :label-width="labelWidth" label="用户名" prop="customerNickname">
|
||||
<el-input v-model="formData.customerNickname" placeholder="请输入用户名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
@ -39,6 +39,11 @@
|
||||
<el-input v-model="formData.customerMobilePhoneNumber" placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="密码" prop="customerPassword">
|
||||
<el-input type="password" v-model="formData.customerPassword" placeholder="请输入密码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="头像" prop="customerAvatar">
|
||||
<UploadImage ref="uploadRef" v-model="formData.customerAvatar" :data=imgData :limit="1" :fileSize="5"
|
||||
@ -53,33 +58,6 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="可用余额" prop="customerAvailableBalance">
|
||||
<el-input-number v-model.number="formData.customerAvailableBalance" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="可用积分" prop="customerAvailablePoints">
|
||||
<el-input-number v-model.number="formData.customerAvailablePoints" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="总支付金额" prop="customerTotalPaymentAmount">
|
||||
<el-input-number v-model.number="formData.customerTotalPaymentAmount" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="实际消费金额" prop="customerActualConsumptionAmount">
|
||||
<el-input-number v-model.number="formData.customerActualConsumptionAmount" controls-position="right"
|
||||
:min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="最后登录时间" prop="customerLastLoginTime">
|
||||
<el-date-picker v-model="formData.customerLastLoginTime" type="datetime" :teleported="false"
|
||||
placeholder="选择日期时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
@ -105,7 +83,7 @@ import { regionTreeList } from '@/api/business/Custom/Regions/region.js';
|
||||
// 打开弹窗时回调
|
||||
const openDialog = async () => {
|
||||
|
||||
await getTreeList()
|
||||
await getTreeList()
|
||||
await getsys_user_sex()
|
||||
|
||||
}
|
||||
@ -134,9 +112,9 @@ async function getTreeList() {
|
||||
|
||||
|
||||
function handleCascaderChange(selectedValues) {
|
||||
// 处理选中的值
|
||||
console.log(selectedValues);
|
||||
}
|
||||
// 处理选中的值
|
||||
console.log(selectedValues);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -146,6 +124,8 @@ const formRef = ref();
|
||||
const { proxy } = getCurrentInstance()
|
||||
const emits = defineEmits(["update:modelValue"]);
|
||||
const formData = reactive({
|
||||
customerGender: 0,
|
||||
customerAvatar: "https://cdn-we-retail.ym.tencent.com/miniapp/usercenter/icon-user-center-avatar@2x.png"
|
||||
});
|
||||
const props = defineProps({
|
||||
modelValue: Boolean,
|
||||
@ -158,8 +138,8 @@ const imgData = ref({
|
||||
// 验证
|
||||
const rules = reactive({
|
||||
customerGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
|
||||
customerXcxOpenid: [{ required: true, message: "openid不能为空", trigger: "blur" }],
|
||||
customerNickname: [{ required: true, message: "昵称不能为空", trigger: "blur" }],
|
||||
customerPassword: [{ required: true, message: "密码不能为空", trigger: "blur" }],
|
||||
customerMobilePhoneNumber: [{ required: true, message: "手机号不能为空", trigger: "blur" }],
|
||||
customerAvatar: [{ required: true, message: "头像不能为空", trigger: "blur" }],
|
||||
customerGender: [{ required: true, message: "性别不能为空", trigger: "change", type: "number" }],
|
||||
|
@ -7,85 +7,18 @@
|
||||
* @LastEditTime: (2023-06-05)
|
||||
-->
|
||||
<template>
|
||||
<el-dialog v-model="props.modelValue" title="小程序客户信息详情" width="900px" @closed="closeDialog" @open="openDialog">
|
||||
<el-dialog v-model="props.modelValue" title="历史登录信息" width="900px" @closed="closeDialog" @open="openDialog">
|
||||
<el-form ref="formRef" :model="formData" :disabled="true">
|
||||
|
||||
<el-row :gutter="20">
|
||||
<!-- 表格渲染 prop="对应的字段"-->
|
||||
<el-table v-loading="loading" :data="dataList" ref="tableRef" border highlight-current-row>
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
<el-table-column prop="customerNickName" label="用户名称" align="center" :show-overflow-tooltip="true" sortable />
|
||||
<el-table-column prop="createTime" label="登录时间" align="center" :show-overflow-tooltip="true" sortable />
|
||||
</el-table>
|
||||
<pagination :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="openid">
|
||||
<el-input v-model="formData.customerXcxOpenid" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="昵称">
|
||||
<el-input v-model="formData.customerNickname" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="手机号">
|
||||
<el-input v-model="formData.customerMobilePhoneNumber" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="头像">
|
||||
<UploadImage ref="uploadRef" v-model="formData.customerAvatar" :limit="1" :fileSize="5" :drag="true"
|
||||
:isShowTip="false" :isDisabled="true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="性别">
|
||||
<el-select v-model="formData.customerGender">
|
||||
<el-option v-for="item in sys_user_sex " :key="item.dictValue" :label="item.dictLabel"
|
||||
:value="parseInt(item.dictValue)"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="可用余额">
|
||||
<el-input-number v-model.number="formData.customerAvailableBalance" controls-position="right"
|
||||
:precision="2" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="可用积分">
|
||||
<el-input-number v-model.number="formData.customerAvailablePoints" controls-position="right" :precision="2" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="总支付金额">
|
||||
<el-input-number v-model.number="formData.customerTotalPaymentAmount" controls-position="right"
|
||||
:precision="2" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="实际消费金额">
|
||||
<el-input-number v-model.number="formData.customerActualConsumptionAmount" controls-position="right"
|
||||
:precision="2" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="最后登录时间">
|
||||
<el-date-picker v-model="formData.customerLastLoginTime" type="datetime" :teleported="false"
|
||||
isabledStr></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@ -93,12 +26,21 @@
|
||||
<script setup>
|
||||
import { ElMessage } from 'element-plus'
|
||||
import { reactive, ref, watch } from "vue";
|
||||
import { customerLoginLogList, delCustomerLoginLog } from '@/api/business/Custom/CustomerLoginLogs/customerLoginLog.js'
|
||||
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
customerGuid: 0
|
||||
},
|
||||
})
|
||||
const { queryParams } = toRefs(data)
|
||||
|
||||
// 打开弹窗时回调
|
||||
const openDialog = async () => {
|
||||
await getsys_user_sex()
|
||||
|
||||
getList()
|
||||
}
|
||||
|
||||
const formData = ref({
|
||||
@ -109,19 +51,27 @@ watch(props, async (v) => {
|
||||
});
|
||||
|
||||
// -业务参数
|
||||
// 性别字典选项列表
|
||||
const sys_user_sex = ref([]);
|
||||
// 数据列表
|
||||
const dataList = ref([])
|
||||
// 是否加载
|
||||
const loading = ref(true)
|
||||
|
||||
// -业务方法
|
||||
// 字典获取
|
||||
async function getsys_user_sex() {
|
||||
await proxy.getDicts('sys_user_sex').then((res) => {
|
||||
sys_user_sex.value = res.data
|
||||
})
|
||||
// 查询数据
|
||||
function getList() {
|
||||
console.log(formData.value.customerGuid);
|
||||
loading.value = true
|
||||
|
||||
queryParams.value.customerGuid = formData.value.customerGuid
|
||||
customerLoginLogList(queryParams.value).then((res) => {
|
||||
if (res.code == 200) {
|
||||
loading.value = false;
|
||||
dataList.value = res.data.result;
|
||||
total.value = res.data.totalNum;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 基础参数
|
||||
const formRef = ref();
|
||||
const labelWidth = 100;
|
||||
|
@ -11,34 +11,32 @@
|
||||
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||
<el-row :gutter="20">
|
||||
|
||||
|
||||
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="openid" prop="customerXcxOpenid">
|
||||
<el-input v-model="formData.customerXcxOpenid" placeholder="请输入openid" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="昵称" prop="customerNickname">
|
||||
<el-input v-model="formData.customerNickname" placeholder="请输入昵称" />
|
||||
<el-form-item :label-width="labelWidth" label="用户名" prop="customerNickname">
|
||||
<el-input v-model="formData.customerNickname" placeholder="请输入用户名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="手机号" prop="customerMobilePhoneNumber">
|
||||
<el-input v-model="formData.customerMobilePhoneNumber" placeholder="请输入手机号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="密码" prop="customerPassword">
|
||||
<el-input type="password" v-model="formData.customerPassword" placeholder="请输入密码" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="头像" prop="customerAvatar">
|
||||
<UploadImage ref="uploadRef" v-model="formData.customerAvatar" :data=imgData :limit="1" :fileSize="5"
|
||||
:drag="true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="性别" prop="customerGender">
|
||||
<el-select v-model="formData.customerGender" placeholder="请选择性别">
|
||||
@ -48,43 +46,6 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="可用余额" prop="customerAvailableBalance">
|
||||
<el-input-number v-model.number="formData.customerAvailableBalance" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="可用积分" prop="customerAvailablePoints">
|
||||
<el-input-number v-model.number="formData.customerAvailablePoints" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="总支付金额" prop="customerTotalPaymentAmount">
|
||||
<el-input-number v-model.number="formData.customerTotalPaymentAmount" controls-position="right" :min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="实际消费金额" prop="customerActualConsumptionAmount">
|
||||
<el-input-number v-model.number="formData.customerActualConsumptionAmount" controls-position="right"
|
||||
:min="0" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :lg="12">
|
||||
<el-form-item :label-width="labelWidth" label="最后登录时间" prop="customerLastLoginTime">
|
||||
<el-date-picker v-model="formData.customerLastLoginTime" type="datetime" :teleported="false"
|
||||
placeholder="选择日期时间"></el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
||||
@ -150,8 +111,7 @@ const imgData = ref({
|
||||
// 验证
|
||||
const rules = reactive({
|
||||
customerGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
|
||||
customerXcxOpenid: [{ required: true, message: "openid不能为空", trigger: "blur" }],
|
||||
customerNickname: [{ required: true, message: "昵称不能为空", trigger: "blur" }],
|
||||
customerNickname: [{ required: true, message: "用户名不能为空", trigger: "blur" }],
|
||||
customerMobilePhoneNumber: [{ required: true, message: "手机号不能为空", trigger: "blur" }],
|
||||
customerAvatar: [{ required: true, message: "头像不能为空", trigger: "blur" }],
|
||||
customerGender: [{ required: true, message: "性别不能为空", trigger: "change", type: "number" }],
|
||||
|
@ -44,16 +44,16 @@
|
||||
|
||||
<!-- 工具按钮 -->
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" v-hasPermi="['business:customer:addOrUpdate']" plain icon="plus" @click="AddDialogVisible = true">
|
||||
{{ $t('btn.add') }}
|
||||
</el-button>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="1.5">
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" :disabled="multiple" v-hasPermi="['business:customer:delete']" plain icon="delete" @click="handleDelete">
|
||||
{{ $t('btn.delete') }}
|
||||
</el-button>
|
||||
</el-col> -->
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="download" @click="handleExport" v-hasPermi="['business:customer:export']">
|
||||
{{ $t('btn.export') }}
|
||||
@ -66,11 +66,6 @@
|
||||
<el-table v-loading="loading" :data="dataList" ref="tableRef" highlight-current-row @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="50" align="center" />
|
||||
|
||||
<el-table-column prop="customerType" label="客户类型" align="center">
|
||||
<template #default="scope">
|
||||
<dict-tag :options=" customer_type " :value="scope.row.customerType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="customerAvatar" label="头像" align="center">
|
||||
<template #default="scope">
|
||||
<el-image preview-teleported :hide-on-click-modal="true" lazy class="table-td-thumb" fit="contain" :src="scope.row.customerAvatar.split(',')[0]" :preview-src-list="scope.row.customerAvatar.split(',')">
|
||||
@ -79,26 +74,22 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="customerXcxOpenid" label="小程序openid" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="customerNickname" label="昵称" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="customerNickname" label="用户名" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="customerMobilePhoneNumber" label="手机号" align="center" :show-overflow-tooltip="true" />
|
||||
<el-table-column prop="customerGender" label="性别" align="center">
|
||||
<template #default="scope">
|
||||
<dict-tag :options=" sys_user_sex " :value="scope.row.customerGender" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="customerAvailableBalance" label="可用余额" align="center" sortable />
|
||||
<el-table-column prop="customerAvailablePoints" label="可用积分" align="center" sortable />
|
||||
<el-table-column prop="customerTotalPaymentAmount" label="总支付金额" align="center" sortable />
|
||||
<el-table-column prop="customerActualConsumptionAmount" label="实际消费金额" align="center" sortable />
|
||||
<el-table-column prop="customerLastLoginTime" width="200" label="最后登录时间" align="center" :show-overflow-tooltip="true" sortable />
|
||||
|
||||
<el-table-column label="操作" width="250" fixed="right">
|
||||
<el-table-column label="操作" width="350" fixed="right">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" size="small" icon="edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['business:customer:addOrUpdate']">编辑</el-button>
|
||||
<!-- <el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:customer:delete']">删除</el-button> -->
|
||||
<el-button size="small" icon="view" @click="handleDetail(scope.row)">查看</el-button>
|
||||
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['business:customer:delete']">删除</el-button>
|
||||
<el-button size="small" icon="view" @click="handleDetail(scope.row)">历史登录信息</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@ -108,7 +99,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 添加 -->
|
||||
<!-- <AddDialog v-model="AddDialogVisible" :done="() => resetQuery()"></AddDialog> -->
|
||||
<AddDialog v-model="AddDialogVisible" :done="() => resetQuery()"></AddDialog>
|
||||
<!-- 编辑 -->
|
||||
<EditDialog v-model="EditDialogVisible" :data="EditDialogRow" :done="() => resetQuery()"></EditDialog>
|
||||
<!-- 详情 -->
|
||||
|
Loading…
Reference in New Issue
Block a user