perf: style

pull/2/head
xingyu 2022-11-24 17:05:24 +08:00
parent e187e7a016
commit 585a576327
2 changed files with 99 additions and 130 deletions

View File

@ -168,7 +168,7 @@ watch(
<ElPagination <ElPagination
small small
:total="copyIconList[currentActiveType].length" :total="copyIconList[currentActiveType].length as unknown as number"
:page-size="pageSize" :page-size="pageSize"
:current-page="currentPage" :current-page="currentPage"
background background

View File

@ -98,16 +98,7 @@
<!-- 添加或修改菜单对话框 --> <!-- 添加或修改菜单对话框 -->
<XModal id="menuModel" v-model="dialogVisible" :title="dialogTitle"> <XModal id="menuModel" v-model="dialogVisible" :title="dialogTitle">
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<el-form <el-form ref="formRef" :model="menuForm" :rules="rules" label-width="auto" label-position="top">
ref="formRef"
:model="menuForm"
:rules="rules"
:inline="true"
label-width="120px"
label-position="right"
>
<el-row :gutter="24">
<el-col :span="24">
<el-form-item label="上级菜单"> <el-form-item label="上级菜单">
<el-tree-select <el-tree-select
node-key="id" node-key="id"
@ -118,8 +109,9 @@
check-strictly check-strictly
/> />
</el-form-item> </el-form-item>
</el-col> <el-form-item label="菜单名称" prop="name" span="12">
<el-col :span="12"> <el-input v-model="menuForm.name" placeholder="请输入菜单名称" clearable />
</el-form-item>
<el-form-item label="菜单类型" prop="type"> <el-form-item label="菜单类型" prop="type">
<el-radio-group v-model="menuForm.type"> <el-radio-group v-model="menuForm.type">
<el-radio-button <el-radio-button
@ -131,19 +123,10 @@
</el-radio-button> </el-radio-button>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="菜单名称" prop="name">
<el-input v-model="menuForm.name" placeholder="请输入菜单名称" clearable />
</el-form-item>
</el-col>
<template v-if="menuForm.type !== 3"> <template v-if="menuForm.type !== 3">
<el-col :span="12">
<el-form-item label="菜单图标"> <el-form-item label="菜单图标">
<IconSelect v-model="menuForm.icon" clearable /> <IconSelect v-model="menuForm.icon" clearable />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="路由地址" prop="path"> <el-form-item label="路由地址" prop="path">
<template #label> <template #label>
<Tooltip <Tooltip
@ -153,17 +136,13 @@
</template> </template>
<el-input v-model="menuForm.path" placeholder="请输入路由地址" clearable /> <el-input v-model="menuForm.path" placeholder="请输入路由地址" clearable />
</el-form-item> </el-form-item>
</el-col>
</template> </template>
<template v-if="menuForm.type === 2"> <template v-if="menuForm.type === 2">
<el-col :span="12">
<el-form-item label="路由地址" prop="component"> <el-form-item label="路由地址" prop="component">
<el-input v-model="menuForm.component" placeholder="请输入组件地址" clearable /> <el-input v-model="menuForm.component" placeholder="请输入组件地址" clearable />
</el-form-item> </el-form-item>
</el-col>
</template> </template>
<template v-if="menuForm.type !== 1"> <template v-if="menuForm.type !== 1">
<el-col :span="12">
<el-form-item label="权限标识" prop="permission"> <el-form-item label="权限标识" prop="permission">
<template #label> <template #label>
<Tooltip <Tooltip
@ -173,28 +152,23 @@
</template> </template>
<el-input v-model="menuForm.permission" placeholder="请输入权限标识" clearable /> <el-input v-model="menuForm.permission" placeholder="请输入权限标识" clearable />
</el-form-item> </el-form-item>
</el-col>
</template> </template>
<el-col :span="12">
<el-form-item label="显示排序" prop="sort"> <el-form-item label="显示排序" prop="sort">
<el-input-number v-model="menuForm.sort" controls-position="right" :min="0" clearable /> <el-input-number v-model="menuForm.sort" controls-position="right" :min="0" clearable />
</el-form-item> </el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="菜单状态" prop="status"> <el-form-item label="菜单状态" prop="status">
<el-radio-group v-model="menuForm.status"> <el-radio-group v-model="menuForm.status">
<el-radio-button <el-radio
border
v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)" v-for="dict in getIntDictOptions(DICT_TYPE.COMMON_STATUS)"
:key="dict.value" :key="dict.value"
:label="dict.value" :label="dict.value"
> >
{{ dict.label }} {{ dict.label }}
</el-radio-button> </el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col>
<template v-if="menuForm.type !== 3"> <template v-if="menuForm.type !== 3">
<el-col :span="12">
<el-form-item label="显示状态" prop="status"> <el-form-item label="显示状态" prop="status">
<template #label> <template #label>
<Tooltip <Tooltip
@ -203,14 +177,12 @@
/> />
</template> </template>
<el-radio-group v-model="menuForm.visible"> <el-radio-group v-model="menuForm.visible">
<el-radio-button key="true" :label="true">显示</el-radio-button> <el-radio border key="true" :label="true">显示</el-radio>
<el-radio-button key="false" :label="false">隐藏</el-radio-button> <el-radio border key="false" :label="false">隐藏</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col>
</template> </template>
<template v-if="menuForm.type === 2"> <template v-if="menuForm.type === 2">
<el-col :span="12">
<el-form-item label="缓存状态" prop="keepAlive"> <el-form-item label="缓存状态" prop="keepAlive">
<template #label> <template #label>
<Tooltip <Tooltip
@ -219,13 +191,11 @@
/> />
</template> </template>
<el-radio-group v-model="menuForm.keepAlive"> <el-radio-group v-model="menuForm.keepAlive">
<el-radio-button key="true" :label="true">缓存</el-radio-button> <el-radio border key="true" :label="true">缓存</el-radio>
<el-radio-button key="false" :label="false">不缓存</el-radio-button> <el-radio border key="false" :label="false">不缓存</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col>
</template> </template>
</el-row>
</el-form> </el-form>
<template #footer> <template #footer>
<!-- 按钮保存 --> <!-- 按钮保存 -->
@ -247,8 +217,6 @@ import { onMounted, reactive, ref } from 'vue'
import { useI18n } from '@/hooks/web/useI18n' import { useI18n } from '@/hooks/web/useI18n'
import { useMessage } from '@/hooks/web/useMessage' import { useMessage } from '@/hooks/web/useMessage'
import { import {
ElRow,
ElCol,
ElForm, ElForm,
ElFormItem, ElFormItem,
ElInput, ElInput,
@ -256,6 +224,7 @@ import {
ElSelect, ElSelect,
ElTreeSelect, ElTreeSelect,
ElOption, ElOption,
ElRadio,
ElRadioGroup, ElRadioGroup,
ElRadioButton, ElRadioButton,
FormInstance FormInstance