mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-23 13:43:51 +08:00
🎉 是否显示默认显示
This commit is contained in:
parent
e3fceb4375
commit
bf77dacdb2
@ -1,7 +1,8 @@
|
||||
<template>
|
||||
<el-dialog :title="state.ruleForm.menuId ? $t('common.editBtn') : $t('common.addBtn')" v-model="visible"
|
||||
:close-on-click-modal="false" draggable>
|
||||
<el-form ref="menuDialogFormRef" :model="state.ruleForm" :rules="dataRules" label-width="90px" v-loading="loading">
|
||||
<el-dialog :close-on-click-modal="false" :title="state.ruleForm.menuId ? $t('common.editBtn') : $t('common.addBtn')"
|
||||
draggable v-model="visible">
|
||||
<el-form :model="state.ruleForm" :rules="dataRules" label-width="90px" ref="menuDialogFormRef"
|
||||
v-loading="loading">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item :label="$t('sysmenu.menuType')" prop="menType">
|
||||
@ -13,31 +14,32 @@
|
||||
</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
|
||||
:props="{ value: 'id', label: 'name', children: 'children' }" class="w100" clearable check-strictly
|
||||
:placeholder="$t('sysmenu.inputParentIdTip')">
|
||||
<el-tree-select :data="state.parentData" :placeholder="$t('sysmenu.inputParentIdTip')" :props="{ value: 'id', label: 'name', children: 'children' }"
|
||||
check-strictly class="w100"
|
||||
clearable default-expand-all
|
||||
v-model="state.ruleForm.parentId">
|
||||
</el-tree-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item :label="$t('sysmenu.name')" prop="name">
|
||||
<el-input v-model="state.ruleForm.name" clearable placeholder="格式:router.xxx"></el-input>
|
||||
<el-input clearable placeholder="格式:router.xxx" v-model="state.ruleForm.name"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20" v-if="state.ruleForm.menuType === '0'">
|
||||
<el-form-item :label="$t('sysmenu.path')" prop="path">
|
||||
<el-input v-model="state.ruleForm.path" :placeholder="$t('sysmenu.inputPathTip')" />
|
||||
<el-input :placeholder="$t('sysmenu.inputPathTip')" v-model="state.ruleForm.path"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20" v-if="state.ruleForm.menuType === '1'">
|
||||
<el-form-item :label="$t('sysmenu.permission')" prop="permission">
|
||||
<el-input v-model="state.ruleForm.permission" maxlength="50"
|
||||
:placeholder="$t('sysmenu.inputPermissionTip')" />
|
||||
<el-input :placeholder="$t('sysmenu.inputPermissionTip')" maxlength="50"
|
||||
v-model="state.ruleForm.permission"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
<el-form-item :label="$t('sysmenu.sortOrder')" prop="sortOrder">
|
||||
<el-input-number v-model="state.ruleForm.sortOrder" :min="0" controls-position="right" />
|
||||
<el-input-number :min="0" controls-position="right" v-model="state.ruleForm.sortOrder"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" class="mb20">
|
||||
@ -74,14 +76,14 @@
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="visible = false">{{ $t('common.cancelButtonText') }}</el-button>
|
||||
<el-button type="primary" @click="onSubmit">{{ $t('common.confirmButtonText') }}</el-button>
|
||||
<el-button @click="onSubmit" type="primary">{{ $t('common.confirmButtonText') }}</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts" name="systemMenuDialog">
|
||||
import { info, pageList, update, addObj } from "/@/api/admin/menu";
|
||||
<script lang="ts" name="systemMenuDialog" setup>
|
||||
import {addObj, info, pageList, update} from "/@/api/admin/menu";
|
||||
import {useMessage} from "/@/hooks/message";
|
||||
|
||||
// 定义子组件向父组件传值/事件
|
||||
@ -106,7 +108,7 @@ const state = reactive({
|
||||
sortOrder: 0,
|
||||
menuType: '0',
|
||||
keepAlive: '0',
|
||||
visible: '0',
|
||||
visible: '1',
|
||||
embedded: '0',
|
||||
},
|
||||
parentData: [] as any[], // 上级菜单数据
|
||||
@ -142,7 +144,6 @@ const getMenuData = () => {
|
||||
const showembedded = ref(false)
|
||||
|
||||
|
||||
|
||||
watch(() => state.ruleForm.path, (val) => {
|
||||
if (val.startsWith('http')) {
|
||||
showembedded.value = true
|
||||
|
Loading…
Reference in New Issue
Block a user