mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-23 13:43:51 +08:00
✨ Introducing new features. 修改树形选择组件默认加载不显示的节点,修复代码生成器预览左侧的树形组件展示不正确问题
This commit is contained in:
parent
60d376bc9a
commit
62296e732b
@ -7,8 +7,7 @@
|
||||
<el-form-item :label="$t('sysdept.parentId')" prop="parentId">
|
||||
<el-tree-select v-model="dataForm.parentId" :data="parentData"
|
||||
:props="{ value: 'id', label: 'name', children: 'children' }" class="w100" clearable check-strictly
|
||||
default-expand-all
|
||||
:placeholder="$t('sysdept.inputparentIdTip')"/>
|
||||
:render-after-expand="false" :placeholder="$t('sysdept.inputparentIdTip')"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
|
||||
|
@ -13,7 +13,7 @@
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item :label="$t('sysmenu.parentId')" prop="parentId">
|
||||
<el-tree-select v-model="state.ruleForm.parentId" :data="state.parentData" default-expand-all
|
||||
<el-tree-select v-model="state.ruleForm.parentId" :data="state.parentData" :render-after-expand="false"
|
||||
:props="{ value: 'id', label: 'name', children: 'children' }" class="w100" clearable check-strictly
|
||||
:placeholder="$t('sysmenu.inputParentIdTip')">
|
||||
</el-tree-select>
|
||||
@ -115,7 +115,9 @@ const state = reactive({
|
||||
// 从后端获取菜单信息
|
||||
const getMenuData = () => {
|
||||
state.parentData = []
|
||||
pageList().then(res => {
|
||||
pageList({
|
||||
type: '0'
|
||||
}).then(res => {
|
||||
let menu = {
|
||||
createBy: "",
|
||||
createTime: "",
|
||||
|
@ -2,7 +2,7 @@
|
||||
<el-dialog title="代码预览" v-model="visible" width="90%" top="3vh" append-to-body :close-on-click-modal="false">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="6">
|
||||
<el-card :gutter="12" shadow="hover">
|
||||
<el-card :gutter="12" shadow="hover" v-loading="loading">
|
||||
<el-scrollbar height="calc(100vh - 300px)">
|
||||
<el-tree ref="treeRef" node-key="id" :data="preview.fileTree" :expand-on-click-node="false"
|
||||
highlight-current @node-click="handleNodeClick" />
|
||||
@ -24,6 +24,7 @@
|
||||
<script setup lang="ts" name="preview">
|
||||
import { useGeneratorPreviewApi } from '/@/api/gen/table';
|
||||
import { handleTree } from '/@/utils/other';
|
||||
import {validatePhone} from "/@/api/admin/user";
|
||||
|
||||
const visible = ref(false)
|
||||
// ======== 显示页面 ========
|
||||
@ -42,17 +43,22 @@ const openDialog = async (id: string) => {
|
||||
visible.value = true
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
|
||||
const getGenCodeFile = (id: string) => {
|
||||
loading.value = true
|
||||
fileTreeOriginal.value = []
|
||||
useGeneratorPreviewApi(id).then((res: any) => {
|
||||
previewCodegen.value = res
|
||||
for (let index in res) {
|
||||
fileTreeOriginal.value.push(res[index].codePath)
|
||||
}
|
||||
|
||||
// 默认选中第一个 选项卡
|
||||
preview.activeName = res[0].codePath
|
||||
const files = handleFiles(fileTreeOriginal)
|
||||
preview.fileTree = handleTree(files, 'id', 'parentId', 'children', '/')
|
||||
}).finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user