Files
wwjcloud-nest-v1/admin-vben/apps/web-antd/src/views/channel/weapp/code/data.ts

120 lines
2.6 KiB
TypeScript
Raw Normal View History

import type { VxeGridProps } from '#/adapter/vxe-table';
export interface WeappCodeApi {
setWeappVersion: (data: any) => Promise<any>;
getWeappVersionList: (params: any) => Promise<any>;
getWeappUploadLog: (params: { task_key: string }) => Promise<any>;
getWeappPreview: () => Promise<any>;
uploadVersion: (data: any) => Promise<any>;
siteWeappCommit: (data: any) => Promise<any>;
undoAudit: (data: any) => Promise<any>;
}
export interface VersionItem {
id: number;
site_id: number;
version: string;
version_desc: string;
upload_time: number;
audit_time: number;
audit_result: string;
audit_id: string;
status: number;
task_key: string;
create_time: number;
}
export const gridSchema: VxeGridProps = {
stripe: true,
showHeaderOverflow: true,
showOverflow: true,
height: 'auto',
rowConfig: {
isHover: true,
isCurrent: true,
},
columnConfig: {
resizable: true,
},
columns: [
{
type: 'seq',
width: 50,
title: '序号',
},
{
field: 'version',
title: '版本号',
minWidth: 120,
},
{
field: 'version_desc',
title: '版本描述',
minWidth: 200,
},
{
field: 'status',
title: '状态',
width: 100,
slots: {
default: 'status',
},
},
{
field: 'upload_time',
title: '上传时间',
width: 180,
formatter: ({ cellValue }) => {
return cellValue ? new Date(cellValue * 1000).toLocaleString() : '-';
},
},
{
field: 'audit_time',
title: '审核时间',
width: 180,
formatter: ({ cellValue }) => {
return cellValue ? new Date(cellValue * 1000).toLocaleString() : '-';
},
},
{
field: 'audit_result',
title: '审核结果',
minWidth: 200,
slots: {
default: 'auditResult',
},
},
{
title: '操作',
width: 200,
fixed: 'right',
slots: {
default: 'actions',
},
},
],
toolbarConfig: {
custom: true,
refresh: true,
zoom: true,
},
proxyConfig: {
ajax: {
query: async ({ page }, formValues) => {
// This will be implemented in the component
return { result: [], total: 0 };
},
},
},
};
export const statusMap = {
0: { text: '草稿', color: 'default' },
1: { text: '上传中', color: 'processing' },
2: { text: '上传成功', color: 'success' },
3: { text: '审核中', color: 'processing' },
4: { text: '审核成功', color: 'success' },
5: { text: '审核失败', color: 'error' },
6: { text: '发布成功', color: 'success' },
7: { text: '发布失败', color: 'error' },
};