|
@@ -1,12 +1,12 @@
|
|
|
<script setup lang="tsx">
|
|
|
-import { computed, nextTick, reactive, ref, watch } from 'vue';
|
|
|
-import { SimpleScrollbar } from '@sa/materials';
|
|
|
+import SvgIcon from '@/components/custom/svg-icon.vue';
|
|
|
+import { menuTypeOptions } from '@/constants/business';
|
|
|
import { useAntdForm, useFormRules } from '@/hooks/common/form';
|
|
|
import { $t } from '@/locales';
|
|
|
-import { menuTypeOptions } from '@/constants/business';
|
|
|
-import SvgIcon from '@/components/custom/svg-icon.vue';
|
|
|
+import { fetchAddMenu, fetchGetMenuDetail, fetchGetMenuList, fetchGetSysApiList, fetchUpdateMenu } from '@/service/api';
|
|
|
import { getLocalIcons } from '@/utils/icon';
|
|
|
-import { fetchGetMenuList, fetchAddMenu, fetchGetSysApiList, fetchGetMenuDetail, fetchUpdateMenu} from '@/service/api';
|
|
|
+import { SimpleScrollbar } from '@sa/materials';
|
|
|
+import { computed, nextTick, reactive, ref, watch } from 'vue';
|
|
|
// import {
|
|
|
// getLayoutAndPage,
|
|
|
// getPathParamFromRoutePath,
|
|
@@ -16,7 +16,7 @@ import { fetchGetMenuList, fetchAddMenu, fetchGetSysApiList, fetchGetMenuDetail,
|
|
|
// } from './shared';
|
|
|
|
|
|
import {
|
|
|
- QuestionCircleFilled,
|
|
|
+QuestionCircleFilled
|
|
|
} from '@ant-design/icons-vue';
|
|
|
defineOptions({
|
|
|
name: 'MenuOperateModal'
|
|
@@ -300,8 +300,8 @@ watch(visible, () => {
|
|
|
<AModal v-model:open="visible" :title="title" width="800px">
|
|
|
<div class="h-480px">
|
|
|
<SimpleScrollbar>
|
|
|
- <AForm ref="formRef" layout="vertical" :model="model" :rules="rules" :label-col="{ lg: 8, xs: 4 }" label-wrap class="pr-20px" :labelAlign="'left'">
|
|
|
- <ARow :gutter="[16,16]" wrap>
|
|
|
+ <AForm ref="formRef" :model="model" :rules="rules" :label-col="{ lg: 8, xs: 4 }" label-wrap class="pr-20px">
|
|
|
+ <ARow wrap>
|
|
|
<ACol :lg="12" :xs="24">
|
|
|
<AFormItem label="上级菜单" name="parentId">
|
|
|
<ATreeSelect v-model:value="model.parentId" show-search :tree-data="menuOptions"
|
|
@@ -314,12 +314,12 @@ watch(visible, () => {
|
|
|
<template #label>
|
|
|
<span class="marginRight5">{{$t('page.manage.menu.menuName')}}</span>
|
|
|
<ATooltip>
|
|
|
- <template #title>包含目录:以及菜单或者菜单组,菜单:具体对应某一个页面,按钮:功能才做按钮.</template>
|
|
|
+ <template #title>菜单位置显示的说明信息.</template>
|
|
|
<QuestionCircleFilled />
|
|
|
</ATooltip>
|
|
|
</template>
|
|
|
|
|
|
- <AInput v-model:value="model.title" :placeholder="$t('page.manage.menu.form.menuName')" />
|
|
|
+ <AInput v-model:value="model.title" :placeholder="$t('page.manage.menu.form.menuName')" allowClear/>
|
|
|
</AFormItem>
|
|
|
</ACol>
|
|
|
<ACol :lg="12" :xs="24">
|
|
@@ -331,7 +331,7 @@ watch(visible, () => {
|
|
|
<QuestionCircleFilled />
|
|
|
</ATooltip>
|
|
|
</template>
|
|
|
- <AInputNumber v-model:value="model.sort as number" :placeholder="$t('page.manage.menu.form.order')" class="w-full"/>
|
|
|
+ <AInputNumber v-model:value="model.sort as number" :placeholder="$t('page.manage.menu.form.order')" class="w-full" />
|
|
|
|
|
|
</AFormItem>
|
|
|
</ACol>
|
|
@@ -361,7 +361,7 @@ watch(visible, () => {
|
|
|
<QuestionCircleFilled />
|
|
|
</ATooltip>
|
|
|
</template>
|
|
|
- <AInput v-model:value="model.menuName" :placeholder="$t('page.manage.menu.form.routeName')" />
|
|
|
+ <AInput v-model:value="model.menuName" :placeholder="$t('page.manage.menu.form.routeName')" allowClear/>
|
|
|
</AFormItem>
|
|
|
</ACol>
|
|
|
<ACol :lg="12" :xs="24" v-if="model.menuType == 'M' || model.menuType == 'C'" >
|
|
@@ -369,25 +369,26 @@ watch(visible, () => {
|
|
|
<template #label>
|
|
|
<span class="marginRight5">{{ $t('page.manage.menu.routePath') }}</span>
|
|
|
<ATooltip>
|
|
|
- <template #title>菜单对应的具体vue页面文件路径views的下级路径/admin/sys-api/index;目录类型:填写Layout,如何有二级目录请参照日志目录填写;</template>
|
|
|
+ <template #title>菜单对应的具体vue页面文件路径;</template>
|
|
|
<QuestionCircleFilled />
|
|
|
</ATooltip>
|
|
|
</template>
|
|
|
- <AInput v-model:value="model.component" :placeholder="$t('page.manage.menu.form.routePath')" />
|
|
|
+ <AInput v-model:value="model.component" :placeholder="$t('page.manage.menu.form.routePath')" allowClear/>
|
|
|
</AFormItem>
|
|
|
</ACol>
|
|
|
|
|
|
<ACol :lg="12" :xs="24" v-if="model.menuType != 'F'">
|
|
|
<AFormItem label="路由地址" name="path">
|
|
|
- <AInput v-model:value="model.path" placeholder="请输入路由地址" />
|
|
|
+ <AInput v-model:value="model.path" placeholder="请输入路由地址" allowClear/>
|
|
|
</AFormItem>
|
|
|
</ACol>
|
|
|
- <ACol :lg="12" :xs="24">
|
|
|
- <AFormItem v-if="showLayout" :label="$t('page.manage.menu.layout')" name="layout">
|
|
|
+ <ACol :lg="12" :xs="24" v-if="showLayout">
|
|
|
+ <AFormItem :label="$t('page.manage.menu.layout')" name="layout">
|
|
|
<ASelect
|
|
|
v-model:value="model.layout"
|
|
|
:options="layoutOptions"
|
|
|
:placeholder="$t('page.manage.menu.form.layout')"
|
|
|
+ allowClear
|
|
|
/>
|
|
|
</AFormItem>
|
|
|
</ACol>
|
|
@@ -420,11 +421,19 @@ watch(visible, () => {
|
|
|
v-model:value="model.icon"
|
|
|
:placeholder="$t('page.manage.menu.form.localIcon')"
|
|
|
:options="localIconOptions"
|
|
|
+ allowClear
|
|
|
/>
|
|
|
</AFormItem>
|
|
|
</ACol>
|
|
|
<ACol :lg="12" :xs="24">
|
|
|
- <AFormItem :label="$t('page.manage.menu.menuStatus')" name="visible">
|
|
|
+ <AFormItem name="visible">
|
|
|
+ <template #label>
|
|
|
+ <span class="marginRight5">{{$t('page.manage.menu.menuStatus') }}</span>
|
|
|
+ <ATooltip>
|
|
|
+ <template #title>需要显示在菜单列表的菜单设置为显示,否则设置为隐藏;</template>
|
|
|
+ <QuestionCircleFilled />
|
|
|
+ </ATooltip>
|
|
|
+ </template>
|
|
|
<ARadioGroup v-model:value="model.visible">
|
|
|
<ARadio v-for="item in visibleOptions" :key="item.value" :value="item.value">
|
|
|
{{ item.label }}
|