Merge branch 'zhangtao' of zhangtao/restructure into develop
This commit is contained in:
commit
ed8078f54d
|
|
@ -2,7 +2,7 @@
|
||||||
VITE_PUBLIC_PATH = '/'
|
VITE_PUBLIC_PATH = '/'
|
||||||
|
|
||||||
# 是否启用MOCK
|
# 是否启用MOCK
|
||||||
VITE_APP_USE_MOCK = false
|
VITE_APP_USE_MOCK = true
|
||||||
|
|
||||||
# proxy
|
# proxy
|
||||||
VITE_PROXY = [["/api-local","http://127.0.0.1:8002/api"],["/api-mock","http://127.0.0.1:8003"]]
|
VITE_PROXY = [["/api-local","http://127.0.0.1:8002/api"],["/api-mock","http://127.0.0.1:8003"]]
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ const asyncRoutes = [
|
||||||
path: '/system',
|
path: '/system',
|
||||||
component: 'Layout',
|
component: 'Layout',
|
||||||
redirect: '/system/menu',
|
redirect: '/system/menu',
|
||||||
|
pid: 0,
|
||||||
title: 'System',
|
title: 'System',
|
||||||
meta: {
|
meta: {
|
||||||
title: '系统管理'
|
title: '系统管理'
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
<n-form-item v-if="['select'].includes(item.type) " :label="item.label">
|
<n-form-item v-if="['select'].includes(item.type) " :label="item.label">
|
||||||
<n-select v-model:value="getFormOptions.form[item.key]" v-bind="item.props" />
|
<n-select v-model:value="getFormOptions.form[item.key]" v-bind="item.props" />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item v-if="['cascader'].includes(item.type) " :label="item.label">
|
<n-form-item v-if="['area'].includes(item.type) " :label="item.label">
|
||||||
<AreaCascader :ref="el=>{itemRefs[item.refIndex] = el}" v-model:value="getFormOptions.form[item.key]" v-bind="item.props" @selectd="handleSelect" />
|
<AreaCascader :ref="el=>{itemRefs[item.refIndex] = el}" v-model:value="getFormOptions.form[item.key]" v-bind="item.props" @selectd="handleSelect" />
|
||||||
</n-form-item>
|
</n-form-item>
|
||||||
<n-form-item v-if="['date'].includes(item.type) " :label="item.label">
|
<n-form-item v-if="['date'].includes(item.type) " :label="item.label">
|
||||||
|
|
@ -48,15 +48,11 @@ export default {
|
||||||
const len = ref(props.info.length - 1)
|
const len = ref(props.info.length - 1)
|
||||||
const itemRefs = ref([])
|
const itemRefs = ref([])
|
||||||
const showButton = ref(!!(showItemNum.value < len.value))
|
const showButton = ref(!!(showItemNum.value < len.value))
|
||||||
/* 获取传递的props */
|
|
||||||
const data = reactive({
|
|
||||||
info: toRaw(props.info)
|
|
||||||
})
|
|
||||||
const form = ref({})
|
const form = ref({})
|
||||||
/* 初始化搜索表单信息 */
|
/* 初始化搜索表单信息 */
|
||||||
function initForm() {
|
function initForm() {
|
||||||
data.info.forEach((item) => {
|
Object.keys(form.value).forEach((key) => {
|
||||||
if (item.key) form.value[item.key] = ''
|
form.value[key] = null
|
||||||
})
|
})
|
||||||
itemRefs.value.forEach((item) => {
|
itemRefs.value.forEach((item) => {
|
||||||
item.clearValue()
|
item.clearValue()
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<n-menu
|
<n-menu
|
||||||
:mode="menuMode"
|
:mode="menuMode"
|
||||||
:accordion="true"
|
|
||||||
:value="(currentRoute.title && currentRoute.meta.activeMenu) || currentRoute.title"
|
:value="(currentRoute.title && currentRoute.meta.activeMenu) || currentRoute.title"
|
||||||
:options="getMenuOptions"
|
:options="getMenuOptions"
|
||||||
@update:value="handleMenuSelect"
|
@update:value="handleMenuSelect"
|
||||||
|
|
@ -42,6 +41,7 @@ function resolvePath(basePath, path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateOptions(routes, basePath) {
|
function generateOptions(routes, basePath) {
|
||||||
|
// console.log('routes', routes)
|
||||||
const options = []
|
const options = []
|
||||||
routes.forEach((route) => {
|
routes.forEach((route) => {
|
||||||
if (route.title && !route.isHidden) {
|
if (route.title && !route.isHidden) {
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ function dataArrayToRoutes(routes) {
|
||||||
tmp.name = tmp.title
|
tmp.name = tmp.title
|
||||||
tmp.meta = {
|
tmp.meta = {
|
||||||
...tmp.meta,
|
...tmp.meta,
|
||||||
title: tmp.title
|
title: tmp.meta.title || tmp.title
|
||||||
}
|
}
|
||||||
res.push(tmp)
|
res.push(tmp)
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<n-card>
|
<n-card>
|
||||||
<headSearch :info="info" @search="handleSearch" />
|
<headSearch :info="info" />
|
||||||
<data-table
|
<!-- <data-table
|
||||||
ref="tableRef"
|
ref="tableRef"
|
||||||
:columns="columns"
|
:columns="columns"
|
||||||
:pagination="false"
|
:pagination="false"
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
<template #tableTitle>
|
<template #tableTitle>
|
||||||
<n-button type="primary" @click="handleModal"> 添加菜单 </n-button>
|
<n-button type="primary" @click="handleModal"> 添加菜单 </n-button>
|
||||||
</template>
|
</template>
|
||||||
</data-table>
|
</data-table> -->
|
||||||
</n-card>
|
</n-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
const data = [
|
const data = [
|
||||||
{
|
{
|
||||||
label: '菜单名称',
|
label: '菜单名称',
|
||||||
key: 'title',
|
type: 'area',
|
||||||
|
key: 'name',
|
||||||
|
refIndex: 0,
|
||||||
props: {
|
props: {
|
||||||
placeholder: '请输入菜单名称'
|
placeholder: '请输入菜单名称',
|
||||||
|
options: [{ label: 1, value: 1, children: [{ label: '1-1', value: '1-1' }] }]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue