form目录迁移到core/pagetype目录里

This commit is contained in:
jingrow 2025-11-02 21:09:40 +08:00
parent 008ceab0b5
commit a7fb6e9fe7
57 changed files with 14 additions and 14 deletions

View File

@ -261,25 +261,25 @@
import { onMounted, onUnmounted, ref, shallowRef, markRaw, computed, watch } from 'vue' import { onMounted, onUnmounted, ref, shallowRef, markRaw, computed, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
import { NButton, NSpace, NIcon, useMessage, useDialog, NLayout, NLayoutSider, NLayoutContent } from 'naive-ui' import { NButton, NSpace, NIcon, useMessage, useDialog, NLayout, NLayoutSider, NLayoutContent } from 'naive-ui'
import FieldRenderer from '@/core/components/form/FieldRenderer.vue' import FieldRenderer from '@/core/pagetype/form/FieldRenderer.vue'
import { Icon } from '@iconify/vue' import { Icon } from '@iconify/vue'
import { resolveSidebarPanel } from '@/core/registry/sidebarOverride' import { resolveSidebarPanel } from '@/core/registry/sidebarOverride'
import { defineAsyncComponent } from 'vue' import { defineAsyncComponent } from 'vue'
const FormPanel = defineAsyncComponent(async () => { const FormPanel = defineAsyncComponent(async () => {
const mod = await resolveSidebarPanel(entity.value, 'FormPanel.vue') const mod = await resolveSidebarPanel(entity.value, 'FormPanel.vue')
return mod || (await import('@/core/components/form/panel/FormPanel.vue')) return mod || (await import('@/core/pagetype/form/panel/FormPanel.vue'))
}) })
const ImageSection = defineAsyncComponent(async () => { const ImageSection = defineAsyncComponent(async () => {
const mod = await resolveSidebarPanel(entity.value, 'ImageSection.vue') const mod = await resolveSidebarPanel(entity.value, 'ImageSection.vue')
return mod || (await import('@/core/components/form/panel/ImageSection.vue')) return mod || (await import('@/core/pagetype/form/panel/ImageSection.vue'))
}) })
const AttachmentSection = defineAsyncComponent(async () => { const AttachmentSection = defineAsyncComponent(async () => {
const mod = await resolveSidebarPanel(entity.value, 'AttachmentSection.vue') const mod = await resolveSidebarPanel(entity.value, 'AttachmentSection.vue')
return mod || (await import('@/core/components/form/panel/AttachmentSection.vue')) return mod || (await import('@/core/pagetype/form/panel/AttachmentSection.vue'))
}) })
const TagSection = defineAsyncComponent(async () => { const TagSection = defineAsyncComponent(async () => {
const mod = await resolveSidebarPanel(entity.value, 'TagSection.vue') const mod = await resolveSidebarPanel(entity.value, 'TagSection.vue')
return mod || (await import('@/core/components/form/panel/TagSection.vue')) return mod || (await import('@/core/pagetype/form/panel/TagSection.vue'))
}) })
import axios from 'axios' import axios from 'axios'
import { t } from '@/shared/i18n' import { t } from '@/shared/i18n'

View File

@ -416,7 +416,7 @@
import { onMounted, ref, computed, watch } from 'vue' import { onMounted, ref, computed, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router' import { useRoute, useRouter } from 'vue-router'
import { NButton, NSpace, NIcon, NProgress, NInput, NSelect, NInputNumber, NCheckbox, NDatePicker, NTimePicker, NRate, NColorPicker, NAutoComplete, NDataTable, useMessage } from 'naive-ui' import { NButton, NSpace, NIcon, NProgress, NInput, NSelect, NInputNumber, NCheckbox, NDatePicker, NTimePicker, NRate, NColorPicker, NAutoComplete, NDataTable, useMessage } from 'naive-ui'
import JeditorControl from '@/core/components/form/controls/Jeditor.vue' import JeditorControl from '@/core/pagetype/form/controls/Jeditor.vue'
import { Icon } from '@iconify/vue' import { Icon } from '@iconify/vue'
import axios from 'axios' import axios from 'axios'
import { t } from '@/shared/i18n' import { t } from '@/shared/i18n'

View File

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref, computed, onMounted, onUnmounted, nextTick, watch } from 'vue' import { ref, computed, onMounted, onUnmounted, nextTick, watch } from 'vue'
import { NModal, NButton, NSpace, NIcon, NTag } from 'naive-ui' import { NModal, NButton, NSpace, NIcon, NTag } from 'naive-ui'
import FieldRenderer from '@/core/components/form/FieldRenderer.vue' import FieldRenderer from '@/core/pagetype/form/FieldRenderer.vue'
import { Icon } from '@iconify/vue' import { Icon } from '@iconify/vue'
import axios from 'axios' import axios from 'axios'
import { get_session_api_headers } from '@/shared/api/auth' import { get_session_api_headers } from '@/shared/api/auth'

View File

@ -3,8 +3,8 @@
// - @apps/*/frontend/src/views/pagetype/<entity>/form/panel/<Comp>.vue // - @apps/*/frontend/src/views/pagetype/<entity>/form/panel/<Comp>.vue
// - /src/views/pagetype/<entity>/form/panel/<Comp>.vue // - /src/views/pagetype/<entity>/form/panel/<Comp>.vue
// 2) 核心路径的 panel 组件(源路径级覆盖) // 2) 核心路径的 panel 组件(源路径级覆盖)
// - @apps/*/frontend/src/core/components/form/panel/<Comp>.vue // - @apps/*/frontend/src/core/pagetype/form/panel/<Comp>.vue
// - /src/core/components/form/panel/<Comp>.vue // - /src/core/pagetype/form/panel/<Comp>.vue
// 组件名 <Comp>FormPanel.vue / ImageSection.vue / AttachmentSection.vue / TagSection.vue // 组件名 <Comp>FormPanel.vue / ImageSection.vue / AttachmentSection.vue / TagSection.vue
declare const __APPS_ORDER__: string[] declare const __APPS_ORDER__: string[]

View File

@ -127,7 +127,7 @@ import { useFlowBuilderStore } from '../../shared/stores/flowBuilder'
import { useAgentStore } from '../../shared/stores/agent' import { useAgentStore } from '../../shared/stores/agent'
import { type AIAgent } from '../../shared/types/agent' import { type AIAgent } from '../../shared/types/agent'
import { t } from '../../shared/i18n' import { t } from '../../shared/i18n'
import CronEditor from '../../core/components/form/controls/CronEditor.vue' import CronEditor from '../../core/pagetype/form/controls/CronEditor.vue'
const route = useRoute() const route = useRoute()
const router = useRouter() const router = useRouter()

View File

@ -76,15 +76,15 @@ const formRef = ref<FormInst | null>(null)
const form = ref({ pagetype: '', createFrontend: false, createBackend: true, frontendOptions: ['toolbar'], fieldTypeNames: [] }) const form = ref({ pagetype: '', createFrontend: false, createBackend: true, frontendOptions: ['toolbar'], fieldTypeNames: [] })
const pagetypeOptions = ref<{ label: string; value: string }[]>([]) const pagetypeOptions = ref<{ label: string; value: string }[]>([])
// /core/components/form/controls // /core/pagetype/form/controls
const fieldTypeOptions = ref<{ label: string; value: string }[]>([]) const fieldTypeOptions = ref<{ label: string; value: string }[]>([])
const appName = ref('') const appName = ref('')
const moduleName = ref('') const moduleName = ref('')
// /core/components/form/controls // /core/pagetype/form/controls
const loadFieldTypeOptions = () => { const loadFieldTypeOptions = () => {
try { try {
const modules = import.meta.glob('@/core/components/form/controls/*.vue', { eager: true }) const modules = import.meta.glob('@/core/pagetype/form/controls/*.vue', { eager: true })
const fileNames = Object.keys(modules) const fileNames = Object.keys(modules)
.map(path => path.split('/').pop()?.replace('.vue', '') || '') .map(path => path.split('/').pop()?.replace('.vue', '') || '')
.filter(name => name && !name.startsWith('_')) // .filter(name => name && !name.startsWith('_')) //

View File

@ -141,7 +141,7 @@ import { NButton, NInput, NIcon, useMessage } from 'naive-ui'
import { Icon } from '@iconify/vue' import { Icon } from '@iconify/vue'
import { t } from '@/shared/i18n' import { t } from '@/shared/i18n'
import axios from 'axios' import axios from 'axios'
import Jeditor from '@/core/components/form/controls/Jeditor.vue' import Jeditor from '@/core/pagetype/form/controls/Jeditor.vue'
const router = useRouter() const router = useRouter()
const message = useMessage() const message = useMessage()