feat: 接入天河链存证接口

This commit is contained in:
Nixevol
2026-07-06 18:25:55 +08:00
parent 3efc1ecd88
commit 07114b759d
26 changed files with 412 additions and 236 deletions
-1
View File
@@ -125,7 +125,6 @@ const columns = computed<DataTableColumns<any>>(() => [
align: 'center',
render: (row) => renderImages(row),
},
{ title: t('pages.blockchain.txHash'), key: 'txHash', minWidth: 260, ellipsis: { tooltip: true } },
{ title: t('common.label.remark'), key: 'remark', minWidth: 220, ellipsis: { tooltip: true } },
{
title: t('pages.outbound.errorReason'),
+79
View File
@@ -64,6 +64,45 @@
</div>
</section>
<section class="settings-card">
<div class="card-title">{{ t('pages.settings.blockchainSettings') }}</div>
<div class="setting-row">
<n-form-item :label="t('pages.settings.blockchainDriver')">
<n-select v-model:value="form.blockchainDriver" :options="blockchainDriverOptions" class="select-control" />
</n-form-item>
</div>
<div class="setting-row">
<n-form-item :label="t('pages.settings.tianheEnv')">
<n-select v-model:value="form.tianheEnv" :options="tianheEnvOptions" class="select-control" @update:value="onTianheEnvChange" />
</n-form-item>
</div>
<div class="setting-row">
<n-form-item :label="t('pages.settings.tianheBaseUrl')">
<n-input v-model:value="form.tianheBaseUrl" class="url-control" :disabled="form.tianheEnv !== 'custom'" />
</n-form-item>
</div>
<div class="setting-row">
<n-form-item :label="t('pages.settings.tianheAppId')">
<n-input v-model:value="form.tianheAppId" class="text-control" />
</n-form-item>
</div>
<div class="setting-row">
<n-form-item :label="t('pages.settings.tianheAppKey')">
<n-input v-model:value="form.tianheAppKey" type="password" show-password-on="click" class="text-control" />
</n-form-item>
</div>
<div class="setting-row">
<n-form-item :label="t('pages.settings.tianheUserId')">
<n-input v-model:value="form.tianheUserId" class="text-control" />
</n-form-item>
</div>
<div class="setting-row">
<n-form-item :label="t('pages.settings.tianheUserKey')">
<n-input v-model:value="form.tianheUserKey" type="password" show-password-on="click" class="text-control" />
</n-form-item>
</div>
</section>
<section class="settings-card">
<div class="card-title">{{ t('pages.settings.backupPolicy') }}</div>
<div class="setting-row">
@@ -105,6 +144,17 @@ import { DEFAULT_APP_ICON_URL, resolveAppIcon, setFavicon } from '@/utils/appIco
const { t } = useI18n();
const saving = ref(false);
const TIANHE_TEST_URL = 'https://test.api.tichain.tianhecloud.com';
const TIANHE_PRODUCTION_URL = 'https://api.tichain.tianhecloud.com';
const blockchainDriverOptions = computed(() => [
{ label: t('pages.settings.blockchainDriverMock'), value: 'mock' },
{ label: t('pages.settings.blockchainDriverTianhe'), value: 'tianhe' },
]);
const tianheEnvOptions = computed(() => [
{ label: t('pages.settings.tianheEnvTest'), value: 'test' },
{ label: t('pages.settings.tianheEnvProduction'), value: 'production' },
{ label: t('pages.settings.tianheEnvCustom'), value: 'custom' },
]);
const backupScheduleOptions = computed(() => [
{ label: t('pages.settings.scheduleOff'), value: 'off' },
{ label: t('pages.settings.scheduleDaily'), value: 'daily' },
@@ -129,6 +179,13 @@ const form = reactive({
backupSchedule: 'daily',
backupRetentionDays: 30,
backupRetentionCount: 10,
blockchainDriver: 'mock',
tianheEnv: 'test',
tianheBaseUrl: TIANHE_TEST_URL,
tianheAppId: '',
tianheAppKey: '',
tianheUserId: '',
tianheUserKey: '',
});
async function load() {
@@ -145,6 +202,18 @@ async function load() {
form.backupSchedule = s.backupSchedule || 'daily';
form.backupRetentionDays = Number(s.backupRetentionDays || 30);
form.backupRetentionCount = Number(s.backupRetentionCount || 10);
form.blockchainDriver = s.blockchainDriver || 'mock';
form.tianheEnv = s.tianheEnv || 'test';
form.tianheBaseUrl = s.tianheBaseUrl || TIANHE_TEST_URL;
form.tianheAppId = s.tianheAppId || '';
form.tianheAppKey = s.tianheAppKey || '';
form.tianheUserId = s.tianheUserId || '';
form.tianheUserKey = s.tianheUserKey || '';
}
function onTianheEnvChange(value: string) {
if (value === 'test') form.tianheBaseUrl = TIANHE_TEST_URL;
if (value === 'production') form.tianheBaseUrl = TIANHE_PRODUCTION_URL;
}
async function save() {
@@ -163,6 +232,13 @@ async function save() {
backupSchedule: form.backupSchedule,
backupRetentionDays: String(form.backupRetentionDays),
backupRetentionCount: String(form.backupRetentionCount),
blockchainDriver: form.blockchainDriver,
tianheEnv: form.tianheEnv,
tianheBaseUrl: form.tianheBaseUrl,
tianheAppId: form.tianheAppId,
tianheAppKey: form.tianheAppKey,
tianheUserId: form.tianheUserId,
tianheUserKey: form.tianheUserKey,
});
setFavicon(appIconUrl);
window.dispatchEvent(new CustomEvent('artveris-settings-updated'));
@@ -287,6 +363,9 @@ const currentIconUrl = computed(() => resolveAppIcon(form.appIconFiles[0]?.url |
.text-control {
width: 180px;
}
.url-control {
width: 220px;
}
.number-control {
width: 128px;
}