1.区服列表增加刷新按钮;2.翻译列表UI优化;3.邮件列表UI优化
Some checks are pending
CI / Test (ubuntu-latest) (push) Waiting to run
CI / Test (windows-latest) (push) Waiting to run
CI / Lint (ubuntu-latest) (push) Waiting to run
CI / Lint (windows-latest) (push) Waiting to run
CI / Check (ubuntu-latest) (push) Waiting to run
CI / Check (windows-latest) (push) Waiting to run
CI / CI OK (push) Blocked by required conditions
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Deploy Website on push / Deploy Push Playground Ftp (push) Waiting to run
Deploy Website on push / Deploy Push Docs Ftp (push) Waiting to run
Deploy Website on push / Deploy Push Antd Ftp (push) Waiting to run
Deploy Website on push / Deploy Push Element Ftp (push) Waiting to run
Deploy Website on push / Deploy Push Naive Ftp (push) Waiting to run
Release Drafter / update_release_draft (push) Waiting to run
Some checks are pending
CI / Test (ubuntu-latest) (push) Waiting to run
CI / Test (windows-latest) (push) Waiting to run
CI / Lint (ubuntu-latest) (push) Waiting to run
CI / Lint (windows-latest) (push) Waiting to run
CI / Check (ubuntu-latest) (push) Waiting to run
CI / Check (windows-latest) (push) Waiting to run
CI / CI OK (push) Blocked by required conditions
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Waiting to run
Deploy Website on push / Deploy Push Playground Ftp (push) Waiting to run
Deploy Website on push / Deploy Push Docs Ftp (push) Waiting to run
Deploy Website on push / Deploy Push Antd Ftp (push) Waiting to run
Deploy Website on push / Deploy Push Element Ftp (push) Waiting to run
Deploy Website on push / Deploy Push Naive Ftp (push) Waiting to run
Release Drafter / update_release_draft (push) Waiting to run
This commit is contained in:
parent
ae7c75abc5
commit
8b5a7d28b8
@ -12,6 +12,7 @@ import { AccessControl } from '@vben/access';
|
||||
import dayjs from 'dayjs';
|
||||
import { $t } from '#/locales'
|
||||
const appId = ref<number>(1);
|
||||
const refreshCurrentAppLoading = ref(false);
|
||||
const [BaseForm, BaseFormApi] = useVbenForm({
|
||||
// 所有表单项共用,可单独在表单内覆盖
|
||||
commonConfig: {
|
||||
@ -103,14 +104,18 @@ const appList = ref<AppData[]>([]);
|
||||
const ServerList = ref<ServerData[]>([]);
|
||||
const reload = ref(false);
|
||||
const reloadReview = ref(false);
|
||||
onMounted(async () => {
|
||||
try {
|
||||
|
||||
async function syncCurrentAppInfo(selectedAppId?: number) {
|
||||
const response = await getAppListApi();
|
||||
appList.value = Array.isArray(response) ? response : [];
|
||||
const app = appList.value[0];
|
||||
if (!app) return;
|
||||
const updateTime = dayjs((app.Update ?? 0) * 1000).format('YYYY-MM-DD HH:mm:ss')
|
||||
BaseFormApi.setFieldValue("update", updateTime)
|
||||
const targetAppId = selectedAppId ?? appId.value ?? appList.value[0]?.AppId;
|
||||
const app = appList.value.find((item) => item.AppId === targetAppId) ?? appList.value[0];
|
||||
if (!app) {
|
||||
ServerList.value = [];
|
||||
return;
|
||||
}
|
||||
|
||||
appId.value = app.AppId;
|
||||
BaseFormApi.updateSchema([
|
||||
{
|
||||
component: 'Select',
|
||||
@ -123,8 +128,39 @@ onMounted(async () => {
|
||||
fieldName: 'fieldOptions',
|
||||
},
|
||||
]);
|
||||
BaseFormApi.setFieldValue('fieldOptions', app.AppId);
|
||||
BaseFormApi.setFieldValue(
|
||||
'update',
|
||||
dayjs((app.Update ?? 0) * 1000).format('YYYY-MM-DD HH:mm:ss'),
|
||||
);
|
||||
const serverResponse = await getServerListApi({ AppId: app.AppId });
|
||||
ServerList.value = Array.isArray(serverResponse) ? serverResponse : [];
|
||||
}
|
||||
|
||||
async function refreshCurrentAppInfo(showSuccess = true) {
|
||||
refreshCurrentAppLoading.value = true;
|
||||
try {
|
||||
const value = await BaseFormApi.getValues();
|
||||
await syncCurrentAppInfo(value.fieldOptions);
|
||||
if (showSuccess) {
|
||||
notification.success({
|
||||
duration: 5,
|
||||
message: '当前APP信息已刷新',
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
notification.error({
|
||||
duration: 5,
|
||||
message: '刷新当前APP信息失败',
|
||||
});
|
||||
} finally {
|
||||
refreshCurrentAppLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
await syncCurrentAppInfo();
|
||||
// setInterval(async () => {
|
||||
// const serverResponse = await getServerListApi({ AppId: appId.value });
|
||||
// ServerList.value = Array.isArray(serverResponse) ? serverResponse : [];
|
||||
@ -181,12 +217,7 @@ async function update() {
|
||||
duration: 10,
|
||||
message: "服务器更新成功"
|
||||
})
|
||||
const response = await getAppListApi();
|
||||
appList.value = Array.isArray(response) ? response : [];
|
||||
const app = appList.value.find((item) => item.AppId === Value.fieldOptions);
|
||||
if (!app) return;
|
||||
const updateTime = dayjs((app.Update ?? 0) * 1000).format('YYYY-MM-DD HH:mm:ss')
|
||||
BaseFormApi.setFieldValue("update", updateTime)
|
||||
await syncCurrentAppInfo(Value.fieldOptions);
|
||||
} catch (e) {
|
||||
reload.value = false;
|
||||
notification.error({
|
||||
@ -206,12 +237,7 @@ async function updateReview() {
|
||||
duration: 10,
|
||||
message: "服务器更新成功"
|
||||
})
|
||||
const response = await getAppListApi();
|
||||
appList.value = Array.isArray(response) ? response : [];
|
||||
const app = appList.value.find((item) => item.AppId === Value.fieldOptions);
|
||||
if (!app) return;
|
||||
const updateTime = dayjs((app.Update ?? 0) * 1000).format('YYYY-MM-DD HH:mm:ss')
|
||||
BaseFormApi.setFieldValue("update", updateTime)
|
||||
await syncCurrentAppInfo(Value.fieldOptions);
|
||||
} catch (e) {
|
||||
reloadReview.value = false;
|
||||
notification.error({
|
||||
@ -231,6 +257,9 @@ async function updateReview() {
|
||||
<AccessControl :codes="['super']" type="role">
|
||||
<Button type="primary" @click="addServer">新增</Button>
|
||||
</AccessControl>
|
||||
<Button type="default" @click="refreshCurrentAppInfo()" :loading="refreshCurrentAppLoading">
|
||||
刷新当前APP信息
|
||||
</Button>
|
||||
<Button type="primary" @click="confirmUpdate" :loading="reload"> 更新游戏文件 </Button>
|
||||
<AccessControl :codes="['super']" type="role">
|
||||
<Button type="primary" @click="confirmUpdateReview" :loading="reloadReview"> 更新review环境 </Button>
|
||||
|
||||
@ -583,6 +583,19 @@ function characterLimitColor(row: languageType, columnName : string) {
|
||||
</script>
|
||||
|
||||
<style lang="css">
|
||||
.language-delete-btn {
|
||||
border: none;
|
||||
border-radius: 10px;
|
||||
background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
|
||||
box-shadow: 0 10px 20px rgb(220 38 38 / 22%);
|
||||
}
|
||||
|
||||
.language-delete-btn:hover,
|
||||
.language-delete-btn:focus {
|
||||
background: linear-gradient(135deg, #f87171 0%, #dc2626 100%) !important;
|
||||
box-shadow: 0 14px 24px rgb(220 38 38 / 28%) !important;
|
||||
}
|
||||
|
||||
.row-green {
|
||||
background-color: #0ea800;
|
||||
}
|
||||
@ -627,7 +640,7 @@ function characterLimitColor(row: languageType, columnName : string) {
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<AccessControl :codes="['super', 'admin']" type="role">
|
||||
<Button type="primary" @click="deleteRow(row)">删除</Button>
|
||||
<Button danger type="primary" class="language-delete-btn" @click="deleteRow(row)">删除</Button>
|
||||
</AccessControl>
|
||||
</template>
|
||||
</Grid>
|
||||
|
||||
@ -101,7 +101,7 @@ const gridOptions: VxeGridProps<MailData> = {
|
||||
{ field: 'create_time', title: '创建时间' },
|
||||
{ slots: { default: 'action' }, title: '操作', width: 100 },
|
||||
],
|
||||
height: 'auto',
|
||||
minHeight: '650px',
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
response: {
|
||||
@ -127,7 +127,7 @@ const gridOptions: VxeGridProps<MailData> = {
|
||||
};
|
||||
const gridEvents: VxeGridListeners<MailData> = {
|
||||
cellClick: ({ row, column }) => {
|
||||
if (column.field === 'action') {
|
||||
if (column.field !== 'mail_id') {
|
||||
return;
|
||||
}
|
||||
AddMailApi2.setData(row);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user