新增部分功能

This commit is contained in:
weipengfei 2024-06-28 18:13:41 +08:00
parent e5fcc19886
commit 41b3de58fd
32 changed files with 1077 additions and 9 deletions

26
src/api/log.ts Normal file
View File

@ -0,0 +1,26 @@
import request from '@/utils/request'
// 系统日志表列表
export function apiLogLists(params: any) {
return request.get({ url: '/setting/system/log/lists', params })
}
// 添加系统日志表
export function apiLogAdd(params: any) {
return request.post({ url: '/setting/system/log/add', params })
}
// 编辑系统日志表
export function apiLogEdit(params: any) {
return request.post({ url: '/setting/system/log/edit', params })
}
// 删除系统日志表
export function apiLogDelete(params: any) {
return request.post({ url: '/setting/system/log/delete', params })
}
// 系统日志表详情
export function apiLogDetail(params: any) {
return request.get({ url: '/setting/system/log/detail', params })
}

View File

@ -0,0 +1,26 @@
import request from '@/utils/request'
// 用户商品储存列表
export function apiUserProductStorageLists(params: any) {
return request.get({ url: '/user_product_storage/userproductstorage/lists', params })
}
// 添加用户商品储存
export function apiUserProductStorageAdd(params: any) {
return request.post({ url: '/user_product_storage/userproductstorage/add', params })
}
// 编辑用户商品储存
export function apiUserProductStorageEdit(params: any) {
return request.post({ url: '/user_product_storage/userproductstorage/edit', params })
}
// 删除用户商品储存
export function apiUserProductStorageDelete(params: any) {
return request.post({ url: '/user_product_storage/userproductstorage/delete', params })
}
// 用户商品储存详情
export function apiUserProductStorageDetail(params: any) {
return request.get({ url: '/user_product_storage/userproductstorage/detail', params })
}

View File

@ -0,0 +1,26 @@
import request from '@/utils/request'
// 用户商品储存操作日志列表
export function apiUserProductStorageLogLists(params: any) {
return request.get({ url: '/user_product_storage_log/userproductstoragelog/lists', params })
}
// 添加用户商品储存操作日志
export function apiUserProductStorageLogAdd(params: any) {
return request.post({ url: '/user_product_storage_log/userproductstoragelog/add', params })
}
// 编辑用户商品储存操作日志
export function apiUserProductStorageLogEdit(params: any) {
return request.post({ url: '/user_product_storage_log/userproductstoragelog/edit', params })
}
// 删除用户商品储存操作日志
export function apiUserProductStorageLogDelete(params: any) {
return request.post({ url: '/user_product_storage_log/userproductstoragelog/delete', params })
}
// 用户商品储存操作日志详情
export function apiUserProductStorageLogDetail(params: any) {
return request.get({ url: '/user_product_storage_log/userproductstoragelog/detail', params })
}

View File

@ -1,12 +1,13 @@
<template> <template>
<el-date-picker <el-date-picker
v-model="content" v-model="content"
type="datetimerange" :type="type"
range-separator="-" range-separator="-"
start-placeholder="开始时间" start-placeholder="开始时间"
end-placeholder="结束时间" end-placeholder="结束时间"
value-format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
clearable clearable
@change="change"
></el-date-picker> ></el-date-picker>
</template> </template>
@ -18,13 +19,19 @@ const props = withDefaults(
defineProps<{ defineProps<{
startTime?: string startTime?: string
endTime?: string endTime?: string
type?: string
}>(), }>(),
{ {
startTime: '', startTime: '',
endTime: '' endTime: '',
type: 'datetimerange'
} }
) )
const emit = defineEmits(['update:startTime', 'update:endTime']) const emit = defineEmits(['update:startTime', 'update:endTime', 'change'])
const change = (e: any)=>{
emit('change', e)
}
const content = computed<any>({ const content = computed<any>({
get: () => { get: () => {

View File

@ -15,7 +15,7 @@
<el-select v-model="queryParams.user_id" filterable remote reserve-keyword placeholder="输入用户名称搜索" <el-select v-model="queryParams.user_id" filterable remote reserve-keyword placeholder="输入用户名称搜索"
remote-show-suffix :remote-method="remoteMethodUser" :loading="userloading" style="width: 240px" remote-show-suffix :remote-method="remoteMethodUser" :loading="userloading" style="width: 240px"
@change="resetPage"> @change="resetPage">
<el-option v-for="item in userList" :key="item.id" :label="item.nickname" :value="item.id" /> <el-option v-for="item in userList" :key="item.id" :label="`${item.nickname} (ID:${item.id})`" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<!-- <el-form-item label="创建时间" prop="create_time"> <!-- <el-form-item label="创建时间" prop="create_time">
@ -168,18 +168,18 @@ const remoteMethod = (e: string = '') => {
const userloading = ref(false); const userloading = ref(false);
const userList = ref([]); const userList = ref([]);
const remoteMethodUser = (e: string = '') => { const remoteMethodUser = (e: string = '') => {
storeloading.value = true; userloading.value = true;
apiUserLists({ apiUserLists({
nickname: e, nickname: e,
page_size: 50 page_size: 50
}).then(res => { }).then(res => {
userList.value = res.lists; userList.value = res.lists;
setTimeout(() => { setTimeout(() => {
storeloading.value = false; userloading.value = false;
}, 300) }, 300)
}).catch(err => { }).catch(err => {
setTimeout(() => { setTimeout(() => {
storeloading.value = false; userloading.value = false;
}, 300) }, 300)
}) })
} }

View File

@ -0,0 +1,82 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
title="详情"
:async="true"
width="550px"
:cancelButtonText="false"
:confirmButtonText="false"
>
<el-form ref="formRef" :model="formData" label-width="90px">
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="userProductStorageDETAILS">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiUserProductStorageAdd, apiUserProductStorageEdit, apiUserProductStorageDetail } from '@/api/user_product_storage'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
//
const formData = reactive({
id: '',
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
//@ts-ignore
formData.create_time = timeFormat(formData.create_time,'yyyy-mm-dd hh:MM:ss')
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiUserProductStorageDetail({
id: row.id
})
setFormData(data)
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -0,0 +1,104 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
:title="popupTitle"
:async="true"
width="550px"
@confirm="handleSubmit"
@close="handleClose"
>
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="userProductStorageEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiUserProductStorageAdd, apiUserProductStorageEdit, apiUserProductStorageDetail } from '@/api/user_product_storage'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑用户商品储存' : '新增用户商品储存'
})
//
const formData = reactive({
id: '',
})
//
const formRules = reactive<any>({
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
//@ts-ignore
formData.create_time = timeFormat(formData.create_time,'yyyy-mm-dd hh:MM:ss')
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiUserProductStorageDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiUserProductStorageEdit(data)
: await apiUserProductStorageAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -0,0 +1,188 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form
class="mb-[-16px]"
:model="queryParams"
inline
>
<el-form-item label="用户" prop="uid">
<!-- <el-input class="w-[280px]" v-model="queryParams.uid" clearable placeholder="请输入用户" /> -->
<el-select v-model="queryParams.uid" filterable remote reserve-keyword placeholder="输入用户名称搜索"
remote-show-suffix :remote-method="remoteMethodUser" :loading="userloading" style="width: 240px"
@change="resetPage">
<el-option v-for="item in userList" :key="item.id" :label="`${item.nickname} (ID:${item.id})`" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="订单id" prop="oid">
<el-input class="w-[280px]" v-model="queryParams.oid" clearable placeholder="请输入订单id" @keydown.enter="resetPage" @clear="resetPage" />
</el-form-item>
<!-- <el-form-item label="商品" prop="product_id">
<el-input class="w-[280px]" v-model="queryParams.product_id" clearable placeholder="请输入商品" />
</el-form-item> -->
<el-form-item label="" prop="create_time">
<daterange-picker
v-model:startTime="queryParams.start_time"
v-model:endTime="queryParams.end_time"
type="daterange"
@change="resetPage"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<!-- <el-button v-perms="['user_product_storage.user_product_storage/add']" type="primary" @click="handleAdd">
<template #icon>
<icon name="el-icon-Plus" />
</template>
新增
</el-button>
<el-button
v-perms="['user_product_storage.user_product_storage/delete']"
:disabled="!selectData.length"
@click="handleDelete(selectData)"
>
删除
</el-button> -->
<div>
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" /> -->
<el-table-column label="用户" prop="nickname" show-overflow-tooltip />
<el-table-column label="订单id" prop="oid" show-overflow-tooltip />
<el-table-column label="商品" prop="store_name" show-overflow-tooltip />
<el-table-column label="数量" prop="nums" show-overflow-tooltip />
<el-table-column label="状态" prop="status_name" show-overflow-tooltip />
<el-table-column label="创建时间" prop="create_time" show-overflow-tooltip />
<el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }">
<router-link :to="{
path: 'user_product_storage_log',
query:{
oid: row.oid,
product_id: row.product_id
}
}" class="ml-4" v-perms="['user_product_storage.user_product_storage/edit']">
<el-button type="primary" link>
详情
</el-button>
</router-link>
<!-- <el-button
v-perms="['user_product_storage.user_product_storage/edit']"
type="primary"
link
@click="handleEdit(row)"
>
编辑
</el-button>
<el-button
v-perms="['user_product_storage.user_product_storage/delete']"
type="danger"
link
@click="handleDelete(row.id)"
>
删除
</el-button> -->
</template>
</el-table-column>
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
</div>
</template>
<script lang="ts" setup name="userProductStorageLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiUserProductStorageLists, apiUserProductStorageDelete } from '@/api/user_product_storage'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import { apiUserLists } from '@/api/user'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
//
const queryParams = reactive({
uid: '',
oid: '',
product_id: '',
create_time: '',
start_time: '',
end_time: ''
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiUserProductStorageLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiUserProductStorageDelete({ id })
getLists()
}
getLists()
const userloading = ref(false);
const userList = ref([]);
const remoteMethodUser = (e: string = '') => {
userloading.value = true;
apiUserLists({
nickname: e,
page_size: 50
}).then(res => {
userList.value = res.lists;
setTimeout(() => {
userloading.value = false;
}, 300)
}).catch(err => {
setTimeout(() => {
userloading.value = false;
}, 300)
})
}
</script>

View File

@ -0,0 +1,82 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
title="详情"
:async="true"
width="550px"
:cancelButtonText="false"
:confirmButtonText="false"
>
<el-form ref="formRef" :model="formData" label-width="90px">
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="userProductStorageLogDETAILS">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiUserProductStorageLogAdd, apiUserProductStorageLogEdit, apiUserProductStorageLogDetail } from '@/api/user_product_storage_log'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
//
const formData = reactive({
id: '',
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
//@ts-ignore
formData.create_time = timeFormat(formData.create_time,'yyyy-mm-dd hh:MM:ss')
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiUserProductStorageLogDetail({
id: row.id
})
setFormData(data)
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -0,0 +1,104 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
:title="popupTitle"
:async="true"
width="550px"
@confirm="handleSubmit"
@close="handleClose"
>
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="userProductStorageLogEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiUserProductStorageLogAdd, apiUserProductStorageLogEdit, apiUserProductStorageLogDetail } from '@/api/user_product_storage_log'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑用户商品储存操作日志' : '新增用户商品储存操作日志'
})
//
const formData = reactive({
id: '',
})
//
const formRules = reactive<any>({
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
//@ts-ignore
formData.create_time = timeFormat(formData.create_time,'yyyy-mm-dd hh:MM:ss')
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiUserProductStorageLogDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiUserProductStorageLogEdit(data)
: await apiUserProductStorageLogAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -0,0 +1,112 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form
class="mb-[-16px]"
:model="queryParams"
inline
>
<el-form-item label="" prop="create_time">
<daterange-picker
v-model:startTime="queryParams.start_time"
v-model:endTime="queryParams.end_time"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div>
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column label="订单id" prop="oid" show-overflow-tooltip />
<el-table-column label="用户" prop="nickname" show-overflow-tooltip />
<el-table-column label="商品" prop="store_name" show-overflow-tooltip />
<el-table-column label="门店" prop="system_store_name" show-overflow-tooltip />
<el-table-column label="状态" prop="financial_pm" show-overflow-tooltip />
<el-table-column label="数量" prop="nums" show-overflow-tooltip />
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
</div>
</template>
<script lang="ts" setup name="userProductStorageLogLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiUserProductStorageLogLists, apiUserProductStorageLogDelete } from '@/api/user_product_storage_log'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
import { useRoute } from "vue-router"
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
//
const queryParams = reactive({
create_time: '',
start_time: '',
end_time: '',
oid: '',
product_id: '',
})
const route = useRoute();
if(route.query?.oid){
queryParams.oid = route.query.oid;
queryParams.product_id = route.query.product_id;
}
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiUserProductStorageLogLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiUserProductStorageLogDelete({ id })
getLists()
}
getLists()
</script>

View File

@ -0,0 +1,82 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
title="详情"
:async="true"
width="550px"
:cancelButtonText="false"
:confirmButtonText="false"
>
<el-form ref="formRef" :model="formData" label-width="90px">
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="logDETAILS">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiLogAdd, apiLogEdit, apiLogDetail } from '@/api/log'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
//
const formData = reactive({
id: '',
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
//@ts-ignore
formData.create_time = timeFormat(formData.create_time,'yyyy-mm-dd hh:MM:ss')
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiLogDetail({
id: row.id
})
setFormData(data)
}
//
const open = () => {
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -0,0 +1,104 @@
<template>
<div class="edit-popup">
<popup
ref="popupRef"
:title="popupTitle"
:async="true"
width="550px"
@confirm="handleSubmit"
@close="handleClose"
>
<el-form ref="formRef" :model="formData" label-width="90px" :rules="formRules">
</el-form>
</popup>
</div>
</template>
<script lang="ts" setup name="logEdit">
import type { FormInstance } from 'element-plus'
import Popup from '@/components/popup/index.vue'
import { apiLogAdd, apiLogEdit, apiLogDetail } from '@/api/log'
import { timeFormat } from '@/utils/util'
import type { PropType } from 'vue'
defineProps({
dictData: {
type: Object as PropType<Record<string, any[]>>,
default: () => ({})
}
})
const emit = defineEmits(['success', 'close'])
const formRef = shallowRef<FormInstance>()
const popupRef = shallowRef<InstanceType<typeof Popup>>()
const mode = ref('add')
//
const popupTitle = computed(() => {
return mode.value == 'edit' ? '编辑系统日志表' : '新增系统日志表'
})
//
const formData = reactive({
id: '',
})
//
const formRules = reactive<any>({
})
//
const setFormData = async (data: Record<any, any>) => {
for (const key in formData) {
if (data[key] != null && data[key] != undefined) {
//@ts-ignore
formData[key] = data[key]
}
}
//@ts-ignore
formData.create_time = timeFormat(formData.create_time,'yyyy-mm-dd hh:MM:ss')
}
const getDetail = async (row: Record<string, any>) => {
const data = await apiLogDetail({
id: row.id
})
setFormData(data)
}
//
const handleSubmit = async () => {
await formRef.value?.validate()
const data = { ...formData, }
mode.value == 'edit'
? await apiLogEdit(data)
: await apiLogAdd(data)
popupRef.value?.close()
emit('success')
}
//
const open = (type = 'add') => {
mode.value = type
popupRef.value?.open()
}
//
const handleClose = () => {
emit('close')
}
defineExpose({
open,
setFormData,
getDetail
})
</script>

View File

@ -0,0 +1,118 @@
<template>
<div>
<el-card class="!border-none mb-4" shadow="never">
<el-form
class="mb-[-16px]"
:model="queryParams"
inline
>
<el-form-item label="管理员ID" prop="admin_id">
<el-input class="w-[280px]" v-model="queryParams.admin_id" clearable placeholder="请输入管理员ID" />
</el-form-item>
<el-form-item label="管理员名称" prop="admin_name">
<el-input class="w-[280px]" v-model="queryParams.admin_name" clearable placeholder="请输入管理员名称" />
</el-form-item>
<el-form-item label="访问链接" prop="url">
<el-input class="w-[280px]" v-model="queryParams.url" clearable placeholder="请输入访问链接" />
</el-form-item>
<el-form-item label="创建时间" prop="create_time">
<daterange-picker
v-model:startTime="queryParams.start_time"
v-model:endTime="queryParams.end_time"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="resetPage">查询</el-button>
<el-button @click="resetParams">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="!border-none" v-loading="pager.loading" shadow="never">
<div>
<el-table :data="pager.lists" @selection-change="handleSelectionChange">
<el-table-column label="ID" prop="id" show-overflow-tooltip />
<el-table-column label="管理员ID" prop="admin_id" show-overflow-tooltip />
<el-table-column label="管理员名称" prop="admin_name" show-overflow-tooltip />
<!-- <el-table-column label="管理员账号" prop="account" show-overflow-tooltip /> -->
<el-table-column label="操作名称" prop="action" show-overflow-tooltip />
<el-table-column label="请求方式" prop="type" show-overflow-tooltip />
<el-table-column label="访问链接" prop="url" show-overflow-tooltip />
<el-table-column label="请求数据" prop="params" show-overflow-tooltip />
<el-table-column label="请求结果" prop="result" show-overflow-tooltip />
<el-table-column label="ip地址" prop="ip" show-overflow-tooltip />
</el-table>
</div>
<div class="flex mt-4 justify-end">
<pagination v-model="pager" @change="getLists" />
</div>
</el-card>
<edit-popup v-if="showEdit" ref="editRef" :dict-data="dictData" @success="getLists" @close="showEdit = false" />
</div>
</template>
<script lang="ts" setup name="logLists">
import { usePaging } from '@/hooks/usePaging'
import { useDictData } from '@/hooks/useDictOptions'
import { apiLogLists, apiLogDelete } from '@/api/log'
import { timeFormat } from '@/utils/util'
import feedback from '@/utils/feedback'
import EditPopup from './edit.vue'
const editRef = shallowRef<InstanceType<typeof EditPopup>>()
//
const showEdit = ref(false)
//
const queryParams = reactive({
admin_id: '',
admin_name: '',
url: '',
create_time: '',
start_time: '',
end_time: ''
})
//
const selectData = ref<any[]>([])
//
const handleSelectionChange = (val: any[]) => {
selectData.value = val.map(({ id }) => id)
}
//
const { dictData } = useDictData('')
//
const { pager, getLists, resetParams, resetPage } = usePaging({
fetchFun: apiLogLists,
params: queryParams
})
//
const handleAdd = async () => {
showEdit.value = true
await nextTick()
editRef.value?.open('add')
}
//
const handleEdit = async (data: any) => {
showEdit.value = true
await nextTick()
editRef.value?.open('edit')
editRef.value?.setFormData(data)
}
//
const handleDelete = async (id: number | any[]) => {
await feedback.confirm('确定要删除?')
await apiLogDelete({ id })
getLists()
}
getLists()
</script>

View File

@ -277,6 +277,12 @@ const basicList = reactive([
icon: 'RectangleCopy32', icon: 'RectangleCopy32',
num: 0, num: 0,
}, },
{
name: '可用消耗资金',
type: 'attrition_amount',
icon: 'RectangleCopy61',
num: 0,
},
]) ])
const startEndTime = ref([new Date(), new Date()]); const startEndTime = ref([new Date(), new Date()]);
const store_id = ref(''); const store_id = ref('');

View File

@ -33,7 +33,7 @@
<el-descriptions-item label="采购款">{{ formData.purchase_funds }}</el-descriptions-item> <el-descriptions-item label="采购款">{{ formData.purchase_funds }}</el-descriptions-item>
<el-descriptions-item label="用户余额">{{ formData.now_money }}</el-descriptions-item> <el-descriptions-item label="用户余额">{{ formData.now_money }}</el-descriptions-item>
<el-descriptions-item label="累计充值金额">{{ formData.total_recharge_amount }}</el-descriptions-item> <el-descriptions-item label="累计充值金额">{{ formData.total_recharge_amount }}</el-descriptions-item>
<el-descriptions-item label="用户地址" :span="2">{{ formData.user_address }}</el-descriptions-item> <el-descriptions-item label="用户地址" :span="2">{{ formData.format_address }}</el-descriptions-item>
<el-descriptions-item label="创建时间" :span="2">{{ formData.create_time }}</el-descriptions-item> <el-descriptions-item label="创建时间" :span="2">{{ formData.create_time }}</el-descriptions-item>
</el-descriptions> </el-descriptions>
</el-tab-pane> </el-tab-pane>
@ -101,6 +101,7 @@ const formData = reactive({
"channel": "", "channel": "",
"create_time": "", "create_time": "",
"purchase_funds": "", "purchase_funds": "",
"format_address": "",
"label_id": 0, "label_id": 0,
"integral": "", "integral": "",
"vip_name": "", "vip_name": "",

View File

@ -61,7 +61,7 @@
<el-table-column label="采购款" prop="purchase_funds" /> <el-table-column label="采购款" prop="purchase_funds" />
<el-table-column label="用户余额" prop="now_money" /> <el-table-column label="用户余额" prop="now_money" />
<el-table-column label="累计充值" prop="total_recharge_amount" /> <el-table-column label="累计充值" prop="total_recharge_amount" />
<el-table-column label="地址" prop="user_address" /> <el-table-column label="地址" prop="format_address" width="150" />
<el-table-column label="操作" width="120" fixed="right"> <el-table-column label="操作" width="120" fixed="right">
<template #default="{ row }"> <template #default="{ row }">
<el-button v-perms="['user.user/edit']" type="primary" link @click="handleEdit(row)"> <el-button v-perms="['user.user/edit']" type="primary" link @click="handleEdit(row)">