This commit is contained in:
2026-06-06 17:31:43 +03:30
parent 51ceb3da9d
commit c1b33b5063
3 changed files with 3 additions and 241 deletions
+3 -34
View File
@@ -66,18 +66,6 @@
</a-row>
</template>
<SupportMessengerSettings
v-if="supportMessengerBundle"
:messenger-row="supportMessengerBundle.messenger"
:id-row="supportMessengerBundle.id"
:text-row="supportMessengerBundle.text"
:draft-value="draftValue"
:is-saving="isSaving"
:is-saved-flash="isSavedFlash"
@update:value="onValueChange"
@update:is-active="onActiveChange"
/>
<template v-if="otherRows.length">
<div class="settings-section-title settings-section-title--spaced">سایر تنظیمات</div>
<a-row :gutter="[16, 16]" class="settings-grid">
@@ -102,7 +90,7 @@
</template>
<a-empty
v-if="!loading && !switchRows.length && !supportMessengerBundle && !otherRows.length"
v-if="!loading && !switchRows.length && !otherRows.length"
description="تنظیمی یافت نشد"
class="mt-8"
/>
@@ -183,17 +171,13 @@ import { loading } from '@/utils'
import { getConfiguration, setConfiguration } from '@/api/configuration'
import SettingValueField from './SettingValueField.vue'
import SettingCard from './SettingCard.vue'
import SupportMessengerSettings from './SupportMessengerSettings.vue'
import {
SETTING_TYPE_OPTIONS,
formatValueForSave,
helpText,
resolveSettingFieldType,
SUPPORT_MESSENGER_KEYS
resolveSettingFieldType
} from './settingTypes'
const supportMessengerKeySet = new Set<string>(SUPPORT_MESSENGER_KEYS)
const settingTypeOptions = SETTING_TYPE_OPTIONS
const statusFilterOptions = [
@@ -286,24 +270,9 @@ const switchRows = computed(() =>
)
const otherRows = computed(() =>
filteredRows.value.filter(
(row) =>
resolveSettingFieldType(row) !== 'switch' &&
!supportMessengerKeySet.has(row.key ?? '')
)
filteredRows.value.filter((row) => resolveSettingFieldType(row) !== 'switch')
)
const supportMessengerBundle = computed(() => {
const rows = filteredRows.value.filter((row) => supportMessengerKeySet.has(row.key ?? ''))
if (!rows.length) return null
const byKey = Object.fromEntries(rows.map((row) => [row.key, row]))
return {
messenger: byKey.support_messenger as Const | undefined,
id: byKey.support_messenger_id as Const | undefined,
text: byKey.support_messenger_text as Const | undefined
}
})
function rowColSpan(row: Const): number {
return resolveSettingFieldType(row) === 'longtext' ? 24 : 8
}