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 dayjs from 'dayjs';
|
||||||
import { $t } from '#/locales'
|
import { $t } from '#/locales'
|
||||||
const appId = ref<number>(1);
|
const appId = ref<number>(1);
|
||||||
|
const refreshCurrentAppLoading = ref(false);
|
||||||
const [BaseForm, BaseFormApi] = useVbenForm({
|
const [BaseForm, BaseFormApi] = useVbenForm({
|
||||||
// 所有表单项共用,可单独在表单内覆盖
|
// 所有表单项共用,可单独在表单内覆盖
|
||||||
commonConfig: {
|
commonConfig: {
|
||||||
@ -103,28 +104,63 @@ const appList = ref<AppData[]>([]);
|
|||||||
const ServerList = ref<ServerData[]>([]);
|
const ServerList = ref<ServerData[]>([]);
|
||||||
const reload = ref(false);
|
const reload = ref(false);
|
||||||
const reloadReview = ref(false);
|
const reloadReview = ref(false);
|
||||||
|
|
||||||
|
async function syncCurrentAppInfo(selectedAppId?: number) {
|
||||||
|
const response = await getAppListApi();
|
||||||
|
appList.value = Array.isArray(response) ? response : [];
|
||||||
|
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',
|
||||||
|
componentProps: {
|
||||||
|
options: appList.value.map((item) => ({
|
||||||
|
label: $t('page.server.' + item.AppName),
|
||||||
|
value: item.AppId,
|
||||||
|
})),
|
||||||
|
},
|
||||||
|
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 () => {
|
onMounted(async () => {
|
||||||
try {
|
try {
|
||||||
const response = await getAppListApi();
|
await syncCurrentAppInfo();
|
||||||
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)
|
|
||||||
BaseFormApi.updateSchema([
|
|
||||||
{
|
|
||||||
component: 'Select',
|
|
||||||
componentProps: {
|
|
||||||
options: appList.value.map((item) => ({
|
|
||||||
label: $t('page.server.' + item.AppName),
|
|
||||||
value: item.AppId,
|
|
||||||
})),
|
|
||||||
},
|
|
||||||
fieldName: 'fieldOptions',
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const serverResponse = await getServerListApi({ AppId: app.AppId });
|
|
||||||
ServerList.value = Array.isArray(serverResponse) ? serverResponse : [];
|
|
||||||
// setInterval(async () => {
|
// setInterval(async () => {
|
||||||
// const serverResponse = await getServerListApi({ AppId: appId.value });
|
// const serverResponse = await getServerListApi({ AppId: appId.value });
|
||||||
// ServerList.value = Array.isArray(serverResponse) ? serverResponse : [];
|
// ServerList.value = Array.isArray(serverResponse) ? serverResponse : [];
|
||||||
@ -181,12 +217,7 @@ async function update() {
|
|||||||
duration: 10,
|
duration: 10,
|
||||||
message: "服务器更新成功"
|
message: "服务器更新成功"
|
||||||
})
|
})
|
||||||
const response = await getAppListApi();
|
await syncCurrentAppInfo(Value.fieldOptions);
|
||||||
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)
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
reload.value = false;
|
reload.value = false;
|
||||||
notification.error({
|
notification.error({
|
||||||
@ -206,12 +237,7 @@ async function updateReview() {
|
|||||||
duration: 10,
|
duration: 10,
|
||||||
message: "服务器更新成功"
|
message: "服务器更新成功"
|
||||||
})
|
})
|
||||||
const response = await getAppListApi();
|
await syncCurrentAppInfo(Value.fieldOptions);
|
||||||
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)
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
reloadReview.value = false;
|
reloadReview.value = false;
|
||||||
notification.error({
|
notification.error({
|
||||||
@ -231,6 +257,9 @@ async function updateReview() {
|
|||||||
<AccessControl :codes="['super']" type="role">
|
<AccessControl :codes="['super']" type="role">
|
||||||
<Button type="primary" @click="addServer">新增</Button>
|
<Button type="primary" @click="addServer">新增</Button>
|
||||||
</AccessControl>
|
</AccessControl>
|
||||||
|
<Button type="default" @click="refreshCurrentAppInfo()" :loading="refreshCurrentAppLoading">
|
||||||
|
刷新当前APP信息
|
||||||
|
</Button>
|
||||||
<Button type="primary" @click="confirmUpdate" :loading="reload"> 更新游戏文件 </Button>
|
<Button type="primary" @click="confirmUpdate" :loading="reload"> 更新游戏文件 </Button>
|
||||||
<AccessControl :codes="['super']" type="role">
|
<AccessControl :codes="['super']" type="role">
|
||||||
<Button type="primary" @click="confirmUpdateReview" :loading="reloadReview"> 更新review环境 </Button>
|
<Button type="primary" @click="confirmUpdateReview" :loading="reloadReview"> 更新review环境 </Button>
|
||||||
|
|||||||
@ -583,6 +583,19 @@ function characterLimitColor(row: languageType, columnName : string) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="css">
|
<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 {
|
.row-green {
|
||||||
background-color: #0ea800;
|
background-color: #0ea800;
|
||||||
}
|
}
|
||||||
@ -627,7 +640,7 @@ function characterLimitColor(row: languageType, columnName : string) {
|
|||||||
</template>
|
</template>
|
||||||
<template #action="{ row }">
|
<template #action="{ row }">
|
||||||
<AccessControl :codes="['super', 'admin']" type="role">
|
<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>
|
</AccessControl>
|
||||||
</template>
|
</template>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@ -101,7 +101,7 @@ const gridOptions: VxeGridProps<MailData> = {
|
|||||||
{ field: 'create_time', title: '创建时间' },
|
{ field: 'create_time', title: '创建时间' },
|
||||||
{ slots: { default: 'action' }, title: '操作', width: 100 },
|
{ slots: { default: 'action' }, title: '操作', width: 100 },
|
||||||
],
|
],
|
||||||
height: 'auto',
|
minHeight: '650px',
|
||||||
pagerConfig: {},
|
pagerConfig: {},
|
||||||
proxyConfig: {
|
proxyConfig: {
|
||||||
response: {
|
response: {
|
||||||
@ -127,7 +127,7 @@ const gridOptions: VxeGridProps<MailData> = {
|
|||||||
};
|
};
|
||||||
const gridEvents: VxeGridListeners<MailData> = {
|
const gridEvents: VxeGridListeners<MailData> = {
|
||||||
cellClick: ({ row, column }) => {
|
cellClick: ({ row, column }) => {
|
||||||
if (column.field === 'action') {
|
if (column.field !== 'mail_id') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
AddMailApi2.setData(row);
|
AddMailApi2.setData(row);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user