diff --git a/assets/admin/src/api/modules/index.js b/assets/admin/src/api/modules/index.js index 9aeb8de0..9e9d622f 100644 --- a/assets/admin/src/api/modules/index.js +++ b/assets/admin/src/api/modules/index.js @@ -2,7 +2,6 @@ import { globalApiMethods } from './global.js' import { pageDisplayApiMethods } from './page-display.js' import { permissionsApiMethods } from './permissions.js' import { usersApiMethods } from './users.js' -import { paymentApiMethods } from './payment.js' import { extensionsApiMethods } from './extensions.js' import { toolsApiMethods } from './tools.js' import { schemaApiMethods } from './schema.js' @@ -13,7 +12,6 @@ export const apiMethods = { ...pageDisplayApiMethods, ...permissionsApiMethods, ...usersApiMethods, - ...paymentApiMethods, ...extensionsApiMethods, ...toolsApiMethods, ...schemaApiMethods, diff --git a/assets/admin/src/api/modules/payment.js b/assets/admin/src/api/modules/payment.js deleted file mode 100644 index 0707c187..00000000 --- a/assets/admin/src/api/modules/payment.js +++ /dev/null @@ -1,7 +0,0 @@ -export const paymentApiMethods = { - /* ================================================================ - * 支付&付费 (Payment) - * ================================================================ */ - - getPaymentOverview() { return this.request('/payment/overview') }, -} diff --git a/assets/admin/src/components/form/AksField.vue b/assets/admin/src/components/form/AksField.vue index 0169deb4..148c0858 100644 --- a/assets/admin/src/components/form/AksField.vue +++ b/assets/admin/src/components/form/AksField.vue @@ -142,6 +142,22 @@ @update:value="emit('update:modelValue', $event)" /> + + + + +
+ + — + + {{ schema.unit }} +
+
{{ schema.spacingLabels?.[0] || '上' }}
@@ -807,6 +849,9 @@ onMounted(() => { if (props.schema.type === 'async_select') { loadAsyncOptions() } + if (props.schema.type === 'page_select') { + loadPages() + } }) // ============ User Select (async search) ============ @@ -850,6 +895,31 @@ function handleUserSearch(query) { }, 300) } +// ============ Page Select (async page list) ============ +const pageOptions = ref([]) +const pageLoading = ref(false) +let pageSearchTimer = null + +async function loadPages(query = '') { + pageLoading.value = true + try { + const selected = props.modelValue ? [props.modelValue] : [] + const res = await api.searchPageDisplayOptions('pages', query, query ? [] : selected) + const items = res?.data || res || [] + pageOptions.value = Array.isArray(items) ? items : [] + } catch (e) { + console.warn('[AksField] page load failed:', e) + pageOptions.value = [] + } finally { + pageLoading.value = false + } +} + +function handlePageSearch(query) { + clearTimeout(pageSearchTimer) + pageSearchTimer = setTimeout(() => loadPages(query), 250) +} + const fieldClasses = computed(() => ({ 'aksrt-field--disabled': props.schema.disabled, 'aksrt-field--inline': props.schema.inline, @@ -870,6 +940,21 @@ function updateDimension(part, value) { emit('update:modelValue', { ...current, [part]: value }) } +// ============ Between Number (min/max pair) ============ +function betweenValue(part) { + const current = props.modelValue && typeof props.modelValue === 'object' && !Array.isArray(props.modelValue) + ? props.modelValue + : {} + return current[part] !== undefined ? current[part] : (props.schema.default?.[part] ?? 0) +} + +function updateBetween(part, value) { + const current = props.modelValue && typeof props.modelValue === 'object' && !Array.isArray(props.modelValue) + ? props.modelValue + : {} + emit('update:modelValue', { ...current, [part]: value }) +} + // ============ Spacing ============ function updateSpacing(part, value) { const current = props.modelValue || {} @@ -1115,6 +1200,25 @@ function confirmRepeaterModal() { font-size: 14px; } +/* Between number (min/max) */ +.aksrt-field__between { + display: flex; + align-items: center; + gap: 8px; + max-width: 360px; +} + +.aksrt-field__between-sep { + color: var(--aksrt-color-border-strong); + font-size: 14px; +} + +.aksrt-field__between-unit { + color: var(--aksrt-color-muted); + font-size: 13px; + white-space: nowrap; +} + /* Spacing field */ .aksrt-field__spacing { display: grid; diff --git a/assets/admin/src/components/form/AksFormRenderer.vue b/assets/admin/src/components/form/AksFormRenderer.vue index 94eda249..9d7ea2b9 100644 --- a/assets/admin/src/components/form/AksFormRenderer.vue +++ b/assets/admin/src/components/form/AksFormRenderer.vue @@ -56,8 +56,33 @@