Commit 65c86878e912bb32e37fe7cfe5de8aee0caa247c

Authored by xingyu
1 parent 9054a772

feat: 升级依赖

yudao-ui-admin-vue3/package.json
1 { 1 {
2 "name": "ruoyi-vue-pro-vue3", 2 "name": "ruoyi-vue-pro-vue3",
3 - "version": "1.6.4.1611", 3 + "version": "1.6.4.1641",
4 "description": "基于vue3、element-plus、typesScript、vite3", 4 "description": "基于vue3、element-plus、typesScript、vite3",
5 "author": "xingyu", 5 "author": "xingyu",
6 "private": false, 6 "private": false,
yudao-ui-admin-vue3/src/components/Dialog/src/Dialog.vue
@@ -74,7 +74,7 @@ const dialogStyle = computed(() => { @@ -74,7 +74,7 @@ const dialogStyle = computed(() => {
74 </slot> 74 </slot>
75 <Icon 75 <Icon
76 v-if="fullscreen" 76 v-if="fullscreen"
77 - class="mr-22px cursor-pointer is-hover mt-2px" 77 + class="mr-22px cursor-pointer is-hover mt-2px z-10"
78 :icon="isFullscreen ? 'zmdi:fullscreen-exit' : 'zmdi:fullscreen'" 78 :icon="isFullscreen ? 'zmdi:fullscreen-exit' : 'zmdi:fullscreen'"
79 color="var(--el-color-info)" 79 color="var(--el-color-info)"
80 @click="toggleFull" 80 @click="toggleFull"
yudao-ui-admin-vue3/src/components/Editor/src/Editor.vue
@@ -177,7 +177,7 @@ defineExpose({ @@ -177,7 +177,7 @@ defineExpose({
177 </script> 177 </script>
178 178
179 <template> 179 <template>
180 - <div class="border-1 border-solid border-[var(--tags-view-border-color)]"> 180 + <div class="border-1 border-solid border-[var(--tags-view-border-color)] z-3000">
181 <!-- 工具栏 --> 181 <!-- 工具栏 -->
182 <Toolbar 182 <Toolbar
183 :editor="editorRef" 183 :editor="editorRef"
yudao-ui-admin-vue3/src/views/infra/codegen/components/GenInfoForm.vue
1 <script setup lang="ts"> 1 <script setup lang="ts">
2 -import { PropType, reactive, watch } from 'vue' 2 +import { onMounted, PropType, reactive, ref, watch } from 'vue'
3 import { required } from '@/utils/formRules' 3 import { required } from '@/utils/formRules'
4 -import { CodegenTableVO } from '@/api/infra/codegen/types'  
5 import { Form } from '@/components/Form' 4 import { Form } from '@/components/Form'
  5 +import { handleTree } from '@/utils/tree'
  6 +import { ElTreeSelect } from 'element-plus'
6 import { useForm } from '@/hooks/web/useForm' 7 import { useForm } from '@/hooks/web/useForm'
7 import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' 8 import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
  9 +import { listSimpleMenusApi } from '@/api/system/menu'
  10 +import { CodegenTableVO } from '@/api/infra/codegen/types'
8 const props = defineProps({ 11 const props = defineProps({
9 genInfo: { 12 genInfo: {
10 type: Object as PropType<Nullable<CodegenTableVO>>, 13 type: Object as PropType<Nullable<CodegenTableVO>>,
11 default: () => null 14 default: () => null
12 } 15 }
13 }) 16 })
  17 +const defaultProps = {
  18 + children: 'children',
  19 + label: 'name',
  20 + value: 'id'
  21 +}
14 const rules = reactive({ 22 const rules = reactive({
15 templateType: [required], 23 templateType: [required],
16 scene: [required], 24 scene: [required],
@@ -22,6 +30,13 @@ const rules = reactive({ @@ -22,6 +30,13 @@ const rules = reactive({
22 }) 30 })
23 const templateTypeOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE) 31 const templateTypeOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_TEMPLATE_TYPE)
24 const sceneOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE) 32 const sceneOptions = getIntDictOptions(DICT_TYPE.INFRA_CODEGEN_SCENE)
  33 +const parentMenuId = ref()
  34 +const treeRef = ref<InstanceType<typeof ElTreeSelect>>()
  35 +const menuOptions = ref<any>([]) // 树形结构
  36 +const getTree = async () => {
  37 + const res = await listSimpleMenusApi()
  38 + menuOptions.value = handleTree(res)
  39 +}
25 const schema = reactive<FormSchema[]>([ 40 const schema = reactive<FormSchema[]>([
26 { 41 {
27 label: '生成模板', 42 label: '生成模板',
@@ -84,7 +99,9 @@ const schema = reactive&lt;FormSchema[]&gt;([ @@ -84,7 +99,9 @@ const schema = reactive&lt;FormSchema[]&gt;([
84 { 99 {
85 label: '上级菜单', 100 label: '上级菜单',
86 field: 'parentMenuId', 101 field: 'parentMenuId',
87 - component: 'Input', 102 + componentProps: {
  103 + optionsSlot: true
  104 + },
88 labelMessage: '分配到指定菜单下,例如 系统管理', 105 labelMessage: '分配到指定菜单下,例如 系统管理',
89 colProps: { 106 colProps: {
90 span: 12 107 span: 12
@@ -94,6 +111,13 @@ const schema = reactive&lt;FormSchema[]&gt;([ @@ -94,6 +111,13 @@ const schema = reactive&lt;FormSchema[]&gt;([
94 const { register, methods, elFormRef } = useForm({ 111 const { register, methods, elFormRef } = useForm({
95 schema 112 schema
96 }) 113 })
  114 +const handleNodeClick = () => {
  115 + console.log(parentMenuId.value)
  116 +}
  117 +// ========== 初始化 ==========
  118 +onMounted(async () => {
  119 + await getTree()
  120 +})
97 watch( 121 watch(
98 () => props.genInfo, 122 () => props.genInfo,
99 (genInfo) => { 123 (genInfo) => {
@@ -106,12 +130,24 @@ watch( @@ -106,12 +130,24 @@ watch(
106 immediate: true 130 immediate: true
107 } 131 }
108 ) 132 )
109 -  
110 defineExpose({ 133 defineExpose({
111 elFormRef, 134 elFormRef,
112 getFormData: methods.getFormData 135 getFormData: methods.getFormData
113 }) 136 })
114 </script> 137 </script>
115 <template> 138 <template>
116 - <Form :rules="rules" @register="register" /> 139 + <Form :rules="rules" @register="register">
  140 + <template #parentMenuId>
  141 + <el-tree-select
  142 + v-model="parentMenuId"
  143 + ref="treeRef"
  144 + node-key="id"
  145 + check-on-click-node
  146 + expand-on-click-node="false"
  147 + :props="defaultProps"
  148 + :data="menuOptions"
  149 + @node-click="handleNodeClick"
  150 + />
  151 + </template>
  152 + </Form>
117 </template> 153 </template>