版本更新
This commit is contained in:
parent
532e8dbce4
commit
acfff278c9
@ -3,10 +3,16 @@ import { requestClient } from '#/api/request';
|
||||
export interface UserData {
|
||||
data: object[];
|
||||
total: number;
|
||||
sum : number;
|
||||
psum : number;
|
||||
nsum : number;
|
||||
}
|
||||
export interface UserLogAssetParam {
|
||||
Id: number;
|
||||
Event?: string;
|
||||
StartTime?: number;
|
||||
EndTime?: number;
|
||||
ItemId?: number;
|
||||
PageSize: number;
|
||||
CurrentPage: number;
|
||||
AppId?: number;
|
||||
|
||||
@ -14,6 +14,7 @@ export interface MailData {
|
||||
end_time: number;
|
||||
register_time: number;
|
||||
mail_type: number;
|
||||
send_type: number;
|
||||
to_uids :string;
|
||||
create_time?: number;
|
||||
}
|
||||
@ -35,4 +36,4 @@ export async function addMailApi(data:MailData) {
|
||||
|
||||
export async function deleteMailApi(AppId:number, ServerId:number, mail_id:number) {
|
||||
return requestClient.post('/mail/delete', {mail_id:mail_id, AppId:AppId, ServerId:ServerId});
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +25,10 @@ export async function getUserListApi(data : UserListParam) {
|
||||
return requestClient.post<UserData>('/user/list', data);
|
||||
}
|
||||
|
||||
export async function userGmApi(data : object) {
|
||||
return requestClient.post('/user/gm', data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ onMounted(async () => {
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
max: 80_000,
|
||||
max: 5_000,
|
||||
splitArea: {
|
||||
show: true,
|
||||
},
|
||||
|
||||
@ -60,6 +60,24 @@ const [Form, FormApi] = useVbenForm({
|
||||
fieldName: 'mail_type',
|
||||
defaultValue: 1,
|
||||
label: '邮件类型',
|
||||
componentProps: {
|
||||
options :[
|
||||
{
|
||||
label: '节日邮件',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: '普通邮件',
|
||||
value:1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
fieldName: 'send_type',
|
||||
defaultValue: 1,
|
||||
label: '邮件发送类型',
|
||||
componentProps: {
|
||||
options :[
|
||||
{
|
||||
@ -111,7 +129,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
Items: modalData.items,
|
||||
start_time: 0 ,
|
||||
register_time: modalData.register_time ,
|
||||
mail_type: modalData.mail_type,
|
||||
mail_type: modalData.mail_type==1 ? '全服邮件' : '个人邮件',
|
||||
ToUids: modalData.to_uids,
|
||||
})
|
||||
FormApi.updateSchema([
|
||||
@ -121,7 +139,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
fieldName: 'Title',
|
||||
},
|
||||
{
|
||||
component: 'Input',
|
||||
component: 'Textarea',
|
||||
disabled: true,
|
||||
fieldName: 'Content',
|
||||
},
|
||||
@ -159,7 +177,7 @@ defineOptions({
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<Modal :width="800" title="添加邮件">
|
||||
<Modal :width="800" title="邮件详情">
|
||||
<Form />
|
||||
</Modal>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@ -62,6 +62,24 @@ const [Form, FormApi] = useVbenForm({
|
||||
fieldName: 'mail_type',
|
||||
defaultValue: 1,
|
||||
label: '邮件类型',
|
||||
componentProps: {
|
||||
options :[
|
||||
{
|
||||
label: '节日邮件',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: '普通邮件',
|
||||
value:1
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
fieldName: 'send_type',
|
||||
defaultValue: 1,
|
||||
label: '邮件发送类型',
|
||||
componentProps: {
|
||||
options :[
|
||||
{
|
||||
@ -112,6 +130,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
const end_time = values.start_time && values.start_time.length > 0 ? dayjs(values.start_time[1]).unix() : 0;
|
||||
const register_time = values.register_time ? dayjs(values.register_time).unix() : 0;
|
||||
const mail_type = values.mail_type;
|
||||
const send_type = values.send_type;
|
||||
const Title = values.Title;
|
||||
const Content = values.Content;
|
||||
const Items = values.Items;
|
||||
@ -128,6 +147,7 @@ const [Modal, modalApi] = useVbenModal({
|
||||
end_time:end_time,
|
||||
register_time:register_time,
|
||||
mail_type:mail_type,
|
||||
send_type:send_type,
|
||||
}
|
||||
await addMailApi(param);
|
||||
modalApi.close();
|
||||
@ -143,4 +163,4 @@ defineOptions({
|
||||
<Modal :width="800" title="添加邮件">
|
||||
<Form />
|
||||
</Modal>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@ -75,7 +75,8 @@ const gridOptions: VxeGridProps<MailData> = {
|
||||
{ field: 'content', title: '邮件内容' },
|
||||
{ field: 'items', title: '道具' },
|
||||
|
||||
{ field: 'mail_type', title: '邮件类型' , formatter: ({ cellValue }) => cellValue == 1 ? '全服邮件' : '个人邮件'},
|
||||
{ field: 'mail_type', title: '邮件类型' , formatter: ({ cellValue }) => cellValue == 1 ? '普通邮件' : '节日邮件'},
|
||||
{ field: 'send_type', title: '邮件发送类型' , formatter: ({ cellValue }) => cellValue == 1 ? '全服邮件' : '个人邮件'},
|
||||
{ field: 'to_uids', title: '接收者' },
|
||||
{ field: 'create_time', title: '创建时间' },
|
||||
{slots: { default: 'action' }, title: '操作', width: 100},
|
||||
@ -90,10 +91,6 @@ const gridOptions: VxeGridProps<MailData> = {
|
||||
ajax: {
|
||||
query: async ({page}, formValues) => {
|
||||
let AppId = parseInt(formValues.AppId, 10);
|
||||
let ServerId = parseInt(formValues.ServerId, 10);
|
||||
if (AppId == 0 || ServerId == 0){
|
||||
return
|
||||
}
|
||||
return await getMailListApi({
|
||||
AppId :AppId,
|
||||
ServerId:formValues.ServerId,
|
||||
@ -203,4 +200,4 @@ async function deleteRow(row: MailData) {
|
||||
</template>
|
||||
</Grid>
|
||||
</Page>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@ -3,10 +3,11 @@ import { Page } from '@vben/common-ui';
|
||||
|
||||
import { getUserLogAssetApi } from '#/api/core/log';
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
import { inject } from 'vue';
|
||||
import { inject, ref } from 'vue';
|
||||
import { globalState } from '#/store/globalState';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import type { VbenFormProps } from '#/adapter/form';
|
||||
import dayjs from 'dayjs';
|
||||
const state = inject('globalState', globalState);
|
||||
|
||||
interface RowType {
|
||||
@ -40,7 +41,22 @@ const formatItemName = (cellValue: number) => {
|
||||
return cellValue;
|
||||
}
|
||||
}
|
||||
const date = dayjs();
|
||||
const d = ref({
|
||||
sum : 0,
|
||||
psum : 0,
|
||||
nsum : 0,
|
||||
});
|
||||
const startDate = dayjs().startOf('day');
|
||||
const formOptions: VbenFormProps = {
|
||||
// 所有表单项共用,可单独在表单内覆盖
|
||||
commonConfig: {
|
||||
// 所有表单项
|
||||
componentProps: {
|
||||
class: 'w-full',
|
||||
},
|
||||
},
|
||||
layout: 'horizontal',
|
||||
// 默认展开
|
||||
collapsed: false,
|
||||
schema: [
|
||||
@ -52,7 +68,68 @@ const formOptions: VbenFormProps = {
|
||||
defaultValue: state.uid,
|
||||
fieldName: 'Uid',
|
||||
label: 'Uid',
|
||||
}
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
defaultValue: startDate,
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD',
|
||||
},
|
||||
fieldName: 'StartTime',
|
||||
label: '开始时间',
|
||||
},
|
||||
{
|
||||
component: 'TimePicker',
|
||||
componentProps: {
|
||||
placeholder: '时间',
|
||||
},
|
||||
fieldName: 'StartTime',
|
||||
label: '--',
|
||||
wrapperClass: 'col-span-3 col-start-2',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '增加', value: 'gain' },
|
||||
{ label: '减少', value: 'consume' },
|
||||
],
|
||||
allowClear: true,
|
||||
},
|
||||
fieldName: 'Event',
|
||||
label: '变化类型',
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
defaultValue: date,
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD',
|
||||
},
|
||||
fieldName: 'EndTime',
|
||||
label: '结束时间',
|
||||
},
|
||||
{
|
||||
component: 'TimePicker',
|
||||
componentProps: {
|
||||
placeholder: '时间',
|
||||
},
|
||||
fieldName: 'EndTime',
|
||||
label: '--',
|
||||
wrapperClass: 'col-span-3 col-start-2',
|
||||
},
|
||||
{
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: [
|
||||
{ label: '能量', value: 100001 },
|
||||
{ label: '宠物币', value: '100002' },
|
||||
{ label: '钻石', value: '100003' },
|
||||
],
|
||||
allowClear: true,
|
||||
},
|
||||
fieldName: 'ItemId',
|
||||
label: '道具id',
|
||||
},
|
||||
],
|
||||
// 控制表单是否显示折叠按钮
|
||||
showCollapseButton: true,
|
||||
@ -74,6 +151,14 @@ const gridOptions: VxeGridProps<RowType> = {
|
||||
{ field: 'timestamp', title: '时间', formatter: ({ cellValue }) => new Date(cellValue*1000).toLocaleString()},
|
||||
],
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
toolbarConfig: {
|
||||
custom: true,
|
||||
export: true,
|
||||
// import: true,
|
||||
refresh: true,
|
||||
zoom: true,
|
||||
},
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
response: {
|
||||
@ -88,12 +173,20 @@ const gridOptions: VxeGridProps<RowType> = {
|
||||
}
|
||||
|
||||
state.uid = uid;
|
||||
return await getUserLogAssetApi({
|
||||
const ItemId = parseInt(formValues.ItemId, 10);
|
||||
const r = await getUserLogAssetApi({
|
||||
Id: uid,
|
||||
Event :"",
|
||||
Event :formValues.Event,
|
||||
StartTime: formValues.StartTime,
|
||||
EndTime: formValues.EndTime,
|
||||
ItemId: ItemId,
|
||||
CurrentPage: page.currentPage,
|
||||
PageSize: page.pageSize,
|
||||
});
|
||||
d.value.sum = r.sum;
|
||||
d.value.psum = r.psum;
|
||||
d.value.nsum = r.nsum;
|
||||
return r
|
||||
},
|
||||
},
|
||||
},
|
||||
@ -109,6 +202,12 @@ const [Grid] = useVbenVxeGrid({ formOptions, gridOptions });
|
||||
|
||||
<template>
|
||||
<Page auto-content-height>
|
||||
<Grid />
|
||||
<Grid>
|
||||
<template #toolbar-tools>
|
||||
总数:<span style="margin-right: 10px;margin-left: 5px;"> {{ d.sum }} </span>
|
||||
正数和: <span style="margin-right: 10px;margin-left: 5px;color:green">{{ d.psum }} </span>
|
||||
负数和: <span style="color: red;margin-left: 5px;">{{ d.nsum }} </span>
|
||||
</template>
|
||||
</Grid>
|
||||
</Page>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@ -3,15 +3,17 @@
|
||||
import { getUserlogEventApi } from '#/api/core/log';
|
||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||
|
||||
import { inject } from 'vue';
|
||||
import { inject, ref } from 'vue';
|
||||
import { globalState } from '#/store/globalState';
|
||||
import { $t } from '#/locales';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import type { VbenFormProps } from '#/adapter/form';
|
||||
import { Page } from '@vben/common-ui';
|
||||
import dayjs from 'dayjs';
|
||||
const state = inject('globalState', globalState);
|
||||
|
||||
|
||||
const date = dayjs();
|
||||
const startDate = dayjs().startOf('day');
|
||||
interface RowType {
|
||||
Uid: string;
|
||||
Event: string;
|
||||
@ -39,7 +41,45 @@ const formOptions: VbenFormProps = {
|
||||
defaultValue: state.Event,
|
||||
fieldName: 'Event',
|
||||
label: '事件类型',
|
||||
}
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
defaultValue: startDate,
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD',
|
||||
},
|
||||
fieldName: 'StartTime',
|
||||
label: '开始时间',
|
||||
formItemClass: 'col-start-1',
|
||||
},
|
||||
{
|
||||
component: 'TimePicker',
|
||||
componentProps: {
|
||||
placeholder: '时间',
|
||||
},
|
||||
fieldName: 'StartTime',
|
||||
label: '--',
|
||||
|
||||
},
|
||||
{
|
||||
component: 'DatePicker',
|
||||
defaultValue: date,
|
||||
componentProps: {
|
||||
format: 'YYYY-MM-DD',
|
||||
},
|
||||
fieldName: 'EndTime',
|
||||
label: '结束时间',
|
||||
|
||||
},
|
||||
{
|
||||
component: 'TimePicker',
|
||||
componentProps: {
|
||||
placeholder: '时间',
|
||||
},
|
||||
fieldName: 'EndTime',
|
||||
label: '--',
|
||||
|
||||
},
|
||||
],
|
||||
// 控制表单是否显示折叠按钮
|
||||
showCollapseButton: true,
|
||||
@ -50,7 +90,7 @@ const formOptions: VbenFormProps = {
|
||||
submitOnChange: false,
|
||||
// 按下回车时是否提交表单
|
||||
submitOnEnter: false,
|
||||
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-4',
|
||||
}
|
||||
const gridOptions: VxeGridProps<RowType> = {
|
||||
columns: [
|
||||
@ -79,6 +119,8 @@ const gridOptions: VxeGridProps<RowType> = {
|
||||
return await getUserlogEventApi({
|
||||
Id: Uid,
|
||||
Event: formValues.Event,
|
||||
StartTime: formValues.StartTime,
|
||||
EndTime: formValues.EndTime,
|
||||
CurrentPage: page.currentPage,
|
||||
PageSize: page.pageSize,
|
||||
});
|
||||
@ -99,4 +141,4 @@ const [Grid] = useVbenVxeGrid({ formOptions, gridOptions });
|
||||
<Page auto-content-height>
|
||||
<Grid />
|
||||
</Page>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
@ -3,6 +3,7 @@ import { ref } from 'vue';
|
||||
import { useVbenModal, useVbenForm } from '@vben/common-ui';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { getUserlogInfoApi } from '#/api/core/log';
|
||||
import { userGmApi } from '#/api/core/user';
|
||||
import type {
|
||||
WorkbenchProjectItem,
|
||||
|
||||
@ -54,12 +55,14 @@ const [BaseForm] = useVbenForm({
|
||||
}
|
||||
],
|
||||
handleSubmit: async (values) => {
|
||||
console.log('values:', values);
|
||||
const cv = modalApi.getData<Record<string, any>>();
|
||||
console.log('cv:', cv);
|
||||
// 提交表单
|
||||
// await addServer(values.AppId, values.ServerId, values.ServerName, values.Status, dateTime);
|
||||
// modalApi.close();
|
||||
const r = await userGmApi({
|
||||
Uid: cv.uid,
|
||||
AppId: cv.AppId,
|
||||
ServerId: cv.ServerId,
|
||||
Command: values.gm,
|
||||
});
|
||||
message.success(r.Msg);
|
||||
},
|
||||
showDefaultActions: true,
|
||||
// 大屏一行显示3个,中屏一行显示2个,小屏一行显示1个
|
||||
|
||||
Loading…
Reference in New Issue
Block a user