mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-23 07:41:53 +08:00
feat: 升级依赖
This commit is contained in:
parent
9054a772b0
commit
65c86878e9
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ruoyi-vue-pro-vue3",
|
"name": "ruoyi-vue-pro-vue3",
|
||||||
"version": "1.6.4.1611",
|
"version": "1.6.4.1641",
|
||||||
"description": "基于vue3、element-plus、typesScript、vite3",
|
"description": "基于vue3、element-plus、typesScript、vite3",
|
||||||
"author": "xingyu",
|
"author": "xingyu",
|
||||||
"private": false,
|
"private": false,
|
||||||
|
@ -74,7 +74,7 @@ const dialogStyle = computed(() => {
|
|||||||
</slot>
|
</slot>
|
||||||
<Icon
|
<Icon
|
||||||
v-if="fullscreen"
|
v-if="fullscreen"
|
||||||
class="mr-22px cursor-pointer is-hover mt-2px"
|
class="mr-22px cursor-pointer is-hover mt-2px z-10"
|
||||||
:icon="isFullscreen ? 'zmdi:fullscreen-exit' : 'zmdi:fullscreen'"
|
:icon="isFullscreen ? 'zmdi:fullscreen-exit' : 'zmdi:fullscreen'"
|
||||||
color="var(--el-color-info)"
|
color="var(--el-color-info)"
|
||||||
@click="toggleFull"
|
@click="toggleFull"
|
||||||
|
@ -177,7 +177,7 @@ defineExpose({
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="border-1 border-solid border-[var(--tags-view-border-color)]">
|
<div class="border-1 border-solid border-[var(--tags-view-border-color)] z-3000">
|
||||||
<!-- 工具栏 -->
|
<!-- 工具栏 -->
|
||||||
<Toolbar
|
<Toolbar
|
||||||
:editor="editorRef"
|
:editor="editorRef"
|
||||||
|
@ -1,16 +1,24 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PropType, reactive, watch } from 'vue'
|
import { onMounted, PropType, reactive, ref, watch } from 'vue'
|
||||||
import { required } from '@/utils/formRules'
|
import { required } from '@/utils/formRules'
|
||||||
import { CodegenTableVO } from '@/api/infra/codegen/types'
|
|
||||||
import { Form } from '@/components/Form'
|
import { Form } from '@/components/Form'
|
||||||
|
import { handleTree } from '@/utils/tree'
|
||||||
|
import { ElTreeSelect } from 'element-plus'
|
||||||
import { useForm } from '@/hooks/web/useForm'
|
import { useForm } from '@/hooks/web/useForm'
|
||||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
|
import { listSimpleMenusApi } from '@/api/system/menu'
|
||||||
|
import { CodegenTableVO } from '@/api/infra/codegen/types'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
genInfo: {
|
genInfo: {
|
||||||
type: Object as PropType<Nullable<CodegenTableVO>>,
|
type: Object as PropType<Nullable<CodegenTableVO>>,
|
||||||
default: () => null
|
default: () => null
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const defaultProps = {
|
||||||
|
children: 'children',
|
||||||
|
label: 'name',
|
||||||
|
value: 'id'
|
||||||
|
}
|
||||||
const rules = reactive({
|
const rules = reactive({
|
||||||
templateType: [required],
|
templateType: [required],
|
||||||
scene: [required],
|
scene: [required],
|
||||||
@ -22,6 +30,13 @@ const rules = reactive({
|
|||||||
})
|
})
|
||||||
const templateTypeOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE)
|
const templateTypeOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE)
|
||||||
const sceneOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE)
|
const sceneOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE)
|
||||||
|
const parentMenuId = ref()
|
||||||
|
const treeRef = ref<InstanceType<typeof ElTreeSelect>>()
|
||||||
|
const menuOptions = ref<any>([]) // 树形结构
|
||||||
|
const getTree = async () => {
|
||||||
|
const res = await listSimpleMenusApi()
|
||||||
|
menuOptions.value = handleTree(res)
|
||||||
|
}
|
||||||
const schema = reactive<FormSchema[]>([
|
const schema = reactive<FormSchema[]>([
|
||||||
{
|
{
|
||||||
label: '生成模板',
|
label: '生成模板',
|
||||||
@ -84,7 +99,9 @@ const schema = reactive<FormSchema[]>([
|
|||||||
{
|
{
|
||||||
label: '上级菜单',
|
label: '上级菜单',
|
||||||
field: 'parentMenuId',
|
field: 'parentMenuId',
|
||||||
component: 'Input',
|
componentProps: {
|
||||||
|
optionsSlot: true
|
||||||
|
},
|
||||||
labelMessage: '分配到指定菜单下,例如 系统管理',
|
labelMessage: '分配到指定菜单下,例如 系统管理',
|
||||||
colProps: {
|
colProps: {
|
||||||
span: 12
|
span: 12
|
||||||
@ -94,6 +111,13 @@ const schema = reactive<FormSchema[]>([
|
|||||||
const { register, methods, elFormRef } = useForm({
|
const { register, methods, elFormRef } = useForm({
|
||||||
schema
|
schema
|
||||||
})
|
})
|
||||||
|
const handleNodeClick = () => {
|
||||||
|
console.log(parentMenuId.value)
|
||||||
|
}
|
||||||
|
// ========== 初始化 ==========
|
||||||
|
onMounted(async () => {
|
||||||
|
await getTree()
|
||||||
|
})
|
||||||
watch(
|
watch(
|
||||||
() => props.genInfo,
|
() => props.genInfo,
|
||||||
(genInfo) => {
|
(genInfo) => {
|
||||||
@ -106,12 +130,24 @@ watch(
|
|||||||
immediate: true
|
immediate: true
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
elFormRef,
|
elFormRef,
|
||||||
getFormData: methods.getFormData
|
getFormData: methods.getFormData
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Form :rules="rules" @register="register" />
|
<Form :rules="rules" @register="register">
|
||||||
|
<template #parentMenuId>
|
||||||
|
<el-tree-select
|
||||||
|
v-model="parentMenuId"
|
||||||
|
ref="treeRef"
|
||||||
|
node-key="id"
|
||||||
|
check-on-click-node
|
||||||
|
expand-on-click-node="false"
|
||||||
|
:props="defaultProps"
|
||||||
|
:data="menuOptions"
|
||||||
|
@node-click="handleNodeClick"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</Form>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user