修复增加菜单组件异常

main
key 2024-03-20 14:16:45 +08:00
parent 4b97d4123d
commit ef85aedfe4
5 changed files with 22 additions and 29 deletions

View File

@ -47,7 +47,7 @@
<div class="main-table common-box"> <div class="main-table common-box">
<div class="tab-hed"> <div class="tab-hed">
<el-select v-model="formInline.region" placeholder="分类" clearable> <el-select v-model="formInline.region" placeholder="分类" clearable style="width: 200px;">
<el-option label="所有" value="shanghai" /> <el-option label="所有" value="shanghai" />
<el-option label="成品" value="shanghai" /> <el-option label="成品" value="shanghai" />
<el-option label="成品非追溯" value="shanghai" /> <el-option label="成品非追溯" value="shanghai" />

View File

@ -67,7 +67,7 @@
<div class="main-table common-box"> <div class="main-table common-box">
<div class="tab-hed"> <div class="tab-hed">
<el-select v-model="formInline.region" placeholder="分类" clearable> <el-select v-model="formInline.region" placeholder="分类" clearable style="width: 200px;">
<el-option label="所有" value="shanghai" /> <el-option label="所有" value="shanghai" />
<el-option label="成品" value="shanghai" /> <el-option label="成品" value="shanghai" />
<el-option label="成品非追溯" value="shanghai" /> <el-option label="成品非追溯" value="shanghai" />

View File

@ -209,7 +209,7 @@ let option = ref({
color: rgb(210, 217, 222); color: rgb(210, 217, 222);
} }
&>p:nth-child(2){ &>p:nth-child(2){
font-size: 20px; font-size: 20px;
color: #4093f9; color: #4093f9;
margin-left: auto; margin-left: auto;
} }

View File

@ -157,7 +157,7 @@ let option2 = {
const handleChange = (value) => { const handleChange = (value: any) => {
console.log(value) console.log(value)
} }
const formInline = reactive({ const formInline = reactive({

View File

@ -1,13 +1,13 @@
<template> <template>
<div class="sys-menu-container"> <div class="sys-menu-container">
<el-dialog v-model="state.isShowDialog" draggable :close-on-click-modal="false" width="700px"> <el-dialog v-model="state.isShowDialog" draggable :close-on-click-modal="false" width="769px">
<template #header> <template #header>
<div style="color: #fff"> <div style="color: #fff">
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon> <el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
<span> {{ props.title }} </span> <span> {{ props.title }} </span>
</div> </div>
</template> </template>
<el-form :model="state.ruleForm" ref="ruleFormRef" label-width="auto"> <el-form :model="state.ruleForm" ref="ruleFormRef" label-width="80px">
<el-row :gutter="35"> <el-row :gutter="35">
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="上级菜单"> <el-form-item label="上级菜单">
@ -29,9 +29,9 @@
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20"> <el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="菜单类型" prop="type" :rules="[{ required: true, message: '菜单类型不能为空', trigger: 'blur' }]"> <el-form-item label="菜单类型" prop="type" :rules="[{ required: true, message: '菜单类型不能为空', trigger: 'blur' }]">
<el-radio-group v-model="state.ruleForm.type"> <el-radio-group v-model="state.ruleForm.type">
<el-radio :value="1">目录</el-radio> <el-radio :label="1">目录</el-radio>
<el-radio :value="2">菜单</el-radio> <el-radio :label="2">菜单</el-radio>
<el-radio :value="3">按钮</el-radio> <el-radio :label="3">按钮</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -58,7 +58,7 @@
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="菜单图标"> <el-form-item label="菜单图标">
<IconSelector v-model="state.ruleForm.icon" :size="getGlobalComponentSize" placeholder="菜单图标" type="all" /> <IconSelector v-model="state.ruleForm.icon" placeholder="菜单图标" type="all" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
@ -79,32 +79,32 @@
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="是否隐藏"> <el-form-item label="是否隐藏">
<el-radio-group v-model="state.ruleForm.isHide"> <el-radio-group v-model="state.ruleForm.isHide">
<el-radio :value="true">隐藏</el-radio> <el-radio :label="true">隐藏</el-radio>
<el-radio :value="false">不隐藏</el-radio> <el-radio :label="false">不隐藏</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="是否缓存"> <el-form-item label="是否缓存">
<el-radio-group v-model="state.ruleForm.isKeepAlive"> <el-radio-group v-model="state.ruleForm.isKeepAlive">
<el-radio :value="true">缓存</el-radio> <el-radio :label="true">缓存</el-radio>
<el-radio :value="false">不缓存</el-radio> <el-radio :label="false">不缓存</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="是否固定"> <el-form-item label="是否固定">
<el-radio-group v-model="state.ruleForm.isAffix"> <el-radio-group v-model="state.ruleForm.isAffix">
<el-radio :value="true">固定</el-radio> <el-radio :label="true">固定</el-radio>
<el-radio :value="false">不固定</el-radio> <el-radio :label="false">不固定</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="是否内嵌"> <el-form-item label="是否内嵌">
<el-radio-group v-model="state.ruleForm.isIframe"> <el-radio-group v-model="state.ruleForm.isIframe">
<el-radio :value="true">内嵌</el-radio> <el-radio :label="true">内嵌</el-radio>
<el-radio :value="false">不内嵌</el-radio> <el-radio :label="false">不内嵌</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -124,8 +124,8 @@
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20"> <el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="是否启用"> <el-form-item label="是否启用">
<el-radio-group v-model="state.ruleForm.status"> <el-radio-group v-model="state.ruleForm.status">
<el-radio :value="1">启用</el-radio> <el-radio :label="1">启用</el-radio>
<el-radio :value="2">不启用</el-radio> <el-radio :label="2">不启用</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -147,11 +147,10 @@
</template> </template>
<script lang="ts" setup name="sysEditMenu"> <script lang="ts" setup name="sysEditMenu">
import { computed, reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import IconSelector from '/@/components/iconSelector/index.vue'; import IconSelector from '/@/components/iconSelector/index.vue';
import { getAPI } from '/@/utils/axios-utils'; import { getAPI } from '/@/utils/axios-utils';
import other from '/@/utils/other';
import { SysMenuApi } from '/@/api-services/api'; import { SysMenuApi } from '/@/api-services/api';
import { SysMenu, UpdateMenuInput } from '/@/api-services/models'; import { SysMenu, UpdateMenuInput } from '/@/api-services/models';
@ -166,16 +165,10 @@ const state = reactive({
ruleForm: {} as UpdateMenuInput, ruleForm: {} as UpdateMenuInput,
}); });
//
const getGlobalComponentSize = computed(() => {
return other.globalComponentSize();
});
// //
const openDialog = (row: any) => { const openDialog = (row: any) => {
state.ruleForm = JSON.parse(JSON.stringify(row)); state.ruleForm = JSON.parse(JSON.stringify(row));
state.isShowDialog = true; state.isShowDialog = true;
ruleFormRef.value?.resetFields();
}; };
// //