!564 【升级插件】升级 form-create 插件版本

Merge pull request !564 from 半栈幼儿员/hotfix/form-create
pull/563/MERGE
芋道源码 2024-10-12 11:59:53 +00:00 committed by Gitee
commit 22e425208c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 157 additions and 29 deletions

View File

@ -26,8 +26,8 @@
},
"dependencies": {
"@element-plus/icons-vue": "^2.1.0",
"@form-create/designer": "^3.1.3",
"@form-create/element-ui": "^3.1.24",
"@form-create/designer": "^3.2.6",
"@form-create/element-ui": "^3.2.11",
"@iconify/iconify": "^3.1.1",
"@microsoft/fetch-event-source": "^2.0.1",
"@videojs-player/vue": "^1.0.0",

View File

@ -1,7 +1,37 @@
import type { App } from 'vue'
// 👇使用 form-create 需额外全局引入 element plus 组件
import {
// ElAutocomplete,
// ElButton,
// ElCascader,
// ElCheckbox,
// ElCheckboxButton,
// ElCheckboxGroup,
// ElCol,
// ElColorPicker,
// ElDatePicker,
// ElDialog,
// ElForm,
// ElInput,
// ElInputNumber,
// ElPopover,
// ElRadio,
// ElRadioButton,
// ElRadioGroup,
// ElRate,
// ElRow,
// ElSelect,
// ElSlider,
// ElSwitch,
// ElTimePicker,
// ElTooltip,
// ElTree,
// ElUpload,
// ElIcon,
// ElProgress,
// 以上会由 @form-create/element-ui/auto-import 自动引入
ElAlert,
ElTransfer,
ElAside,
ElContainer,
ElDivider,
@ -12,7 +42,18 @@ import {
ElTableColumn,
ElTabPane,
ElTabs,
ElTransfer
ElDropdown,
ElDropdownMenu,
ElDropdownItem,
ElBadge,
ElTag,
ElText,
ElMenu,
ElMenuItem,
ElFooter,
ElMessage
// ElFormItem,
// ElOption
} from 'element-plus'
import FcDesigner from '@form-create/designer'
import formCreate from '@form-create/element-ui'
@ -41,18 +82,30 @@ const ApiSelect = useApiSelect({
})
const components = [
ElAlert,
ElTransfer,
ElAside,
ElPopconfirm,
ElHeader,
ElMain,
ElContainer,
ElDivider,
ElTransfer,
ElAlert,
ElTabs,
ElHeader,
ElMain,
ElPopconfirm,
ElTable,
ElTableColumn,
ElTabPane,
ElTabs,
ElDropdown,
ElDropdownMenu,
ElDropdownItem,
ElBadge,
ElTag,
ElText,
ElMenu,
ElMenuItem,
ElFooter,
ElMessage,
// ElFormItem,
// ElOption,
UploadImg,
UploadImgs,
UploadFile,

View File

@ -1,14 +1,18 @@
<template>
<ContentWrap>
<ContentWrap :body-style="{ padding: '0px' }" class="!mb-0">
<!-- 表单设计器 -->
<FcDesigner ref="designer" height="780px">
<template #handle>
<el-button round size="small" type="primary" @click="handleSave">
<Icon class="mr-5px" icon="ep:plus" />
保存
</el-button>
</template>
</FcDesigner>
<div
class="h-[calc(100vh-var(--top-tool-height)-var(--tags-view-height)-var(--app-content-padding)-var(--app-content-padding)-2px)]"
>
<fc-designer class="my-designer" ref="designer" :config="designerConfig">
<template #handle>
<el-button size="small" type="success" plain @click="handleSave">
<Icon class="mr-5px" icon="ep:plus" />
保存
</el-button>
</template>
</fc-designer>
</div>
</ContentWrap>
<!-- 表单保存的弹窗 -->
@ -55,6 +59,31 @@ const { push, currentRoute } = useRouter() // 路由
const { query } = useRoute() //
const { delView } = useTagsViewStore() //
//
const designerConfig = ref({
switchType: [], // ,
autoActive: true, //
useTemplate: false, // vue2
formOptions: {}, //
fieldReadonly: false, // field
hiddenDragMenu: false, //
hiddenDragBtn: false, //
hiddenMenu: [], //
hiddenItem: [], //
hiddenItemConfig: {}, //
disabledItemConfig: {}, //
showSaveBtn: false, //
showConfig: true, //
showBaseForm: true, //
showControl: true, //
showPropsForm: true, //
showEventForm: true, //
showValidateForm: true, //
showFormConfig: true, //
showInputData: true, //
showDevice: true, //
appendConfigData: [] // formData
})
const designer = ref() //
useFormCreateDesigner(designer) //
const dialogVisible = ref(false) //
@ -119,3 +148,13 @@ onMounted(async () => {
setConfAndFields(designer, data.conf, data.fields)
})
</script>
<style>
.my-designer {
._fc-l,
._fc-m,
._fc-r {
border-top: none;
}
}
</style>

View File

@ -1,16 +1,17 @@
<template>
<ContentWrap>
<el-row>
<el-col>
<div class="float-right mb-2">
<el-button size="small" type="primary" @click="showJson"> JSON</el-button>
<el-button size="small" type="success" @click="showOption"> Options</el-button>
<el-button size="small" type="danger" @click="showTemplate"></el-button>
</div>
</el-col>
</el-row>
<ContentWrap :body-style="{ padding: '0px' }" class="!mb-0">
<!-- 表单设计器 -->
<FcDesigner ref="designer" height="780px" />
<div
class="h-[calc(100vh-var(--top-tool-height)-var(--tags-view-height)-var(--app-content-padding)-var(--app-content-padding)-2px)]"
>
<fc-designer class="my-designer" ref="designer" :config="designerConfig">
<template #handle>
<el-button size="small" type="primary" plain @click="showJson">JSON</el-button>
<el-button size="small" type="success" plain @click="showOption">Options</el-button>
<el-button size="small" type="danger" plain @click="showTemplate"></el-button>
</template>
</fc-designer>
</div>
</ContentWrap>
<!-- 弹窗表单预览 -->
@ -43,6 +44,31 @@ defineOptions({ name: 'InfraBuild' })
const { t } = useI18n() //
const message = useMessage() //
//
const designerConfig = ref({
switchType: [], // ,
autoActive: true, //
useTemplate: false, // vue2
formOptions: {}, //
fieldReadonly: false, // field
hiddenDragMenu: false, //
hiddenDragBtn: false, //
hiddenMenu: [], //
hiddenItem: [], //
hiddenItemConfig: {}, //
disabledItemConfig: {}, //
showSaveBtn: false, //
showConfig: true, //
showBaseForm: true, //
showControl: true, //
showPropsForm: true, //
showEventForm: true, //
showValidateForm: true, //
showFormConfig: true, //
showInputData: true, //
showDevice: true, //
appendConfigData: [] // formData
})
const designer = ref() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
@ -140,3 +166,13 @@ onMounted(async () => {
hljs.registerLanguage('json', json)
})
</script>
<style>
.my-designer {
._fc-l,
._fc-m,
._fc-r {
border-top: none;
}
}
</style>