refactor: ♻️ 组件 `name` 调整大写
This commit is contained in:
parent
beb1dcd1be
commit
e8d8f7b28d
|
|
@ -1,9 +1,9 @@
|
|||
import { defineStore } from "pinia";
|
||||
import { ref } from "vue";
|
||||
import { RouteLocationNormalized } from "vue-router";
|
||||
|
||||
export interface TagView extends Partial<RouteLocationNormalized> {
|
||||
title?: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
// setup
|
||||
|
|
@ -31,7 +31,7 @@ export const useTagsViewStore = defineStore("tagsView", () => {
|
|||
}
|
||||
|
||||
function addCachedView(view: TagView) {
|
||||
const viewName = view.name as string;
|
||||
const viewName = view.name;
|
||||
if (cachedViews.value.includes(viewName)) return;
|
||||
if (view.meta?.keepAlive) {
|
||||
cachedViews.value.push(viewName);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,13 @@
|
|||
<template>
|
||||
<div style="padding: 30px">
|
||||
<el-link
|
||||
href="https://gitee.com/youlaiorg/vue3-element-admin/blob/master/src/views/demo/upload.vue"
|
||||
type="primary"
|
||||
target="_blank"
|
||||
class="mb-10"
|
||||
>示例源码 请点击>>>></el-link
|
||||
>
|
||||
|
||||
<el-alert :closable="false" title="菜单一级">
|
||||
<router-view />
|
||||
</el-alert>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
defineOptions({
|
||||
name: "dept",
|
||||
name: "Dept",
|
||||
inheritAttrs: false,
|
||||
});
|
||||
|
||||
|
|
@ -213,10 +213,14 @@ onMounted(() => {
|
|||
|
||||
<el-card>
|
||||
<template #header>
|
||||
<el-button type="success" @click="openDialog(0, undefined)"
|
||||
<el-button
|
||||
v-hasPerm="['sys:dept:add']"
|
||||
type="success"
|
||||
@click="openDialog(0, undefined)"
|
||||
><i-ep-plus />新增</el-button
|
||||
>
|
||||
<el-button
|
||||
v-hasPerm="['sys:dept:delete']"
|
||||
type="danger"
|
||||
:disabled="ids.length === 0"
|
||||
@click="handleDelete()"
|
||||
|
|
@ -246,6 +250,7 @@ onMounted(() => {
|
|||
<el-table-column label="操作" fixed="right" align="left" width="200">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-hasPerm="['sys:dept:add']"
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
|
|
@ -253,6 +258,7 @@ onMounted(() => {
|
|||
><i-ep-plus />新增
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPerm="['sys:dept:edit']"
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
|
|
@ -260,6 +266,7 @@ onMounted(() => {
|
|||
><i-ep-edit />编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPerm="['sys:dept:delete']"
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<!-- 字典数据 -->
|
||||
<script setup lang="ts">
|
||||
defineOptions({
|
||||
name: "dictData",
|
||||
name: "DictData",
|
||||
inheritAttrs: false,
|
||||
});
|
||||
|
||||
|
|
@ -216,10 +216,14 @@ onMounted(() => {
|
|||
</div>
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-button type="success" @click="openDialog()"
|
||||
<el-button
|
||||
v-hasPerm="['sys:dict:add']"
|
||||
type="success"
|
||||
@click="openDialog()"
|
||||
><i-ep-plus />新增</el-button
|
||||
>
|
||||
<el-button
|
||||
v-hasPerm="['sys:dict:delete']"
|
||||
type="danger"
|
||||
:disabled="ids.length === 0"
|
||||
@click="handleDelete()"
|
||||
|
|
@ -245,10 +249,15 @@ onMounted(() => {
|
|||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" align="center">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link @click="openDialog(scope.row.id)"
|
||||
<el-button
|
||||
v-hasPerm="['sys:dict:edit']"
|
||||
type="primary"
|
||||
link
|
||||
@click="openDialog(scope.row.id)"
|
||||
><i-ep-edit />编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
v-hasPerm="['sys:dict:delete']"
|
||||
type="primary"
|
||||
link
|
||||
@click.stop="handleDelete(scope.row.id)"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<!--字典类型-->
|
||||
<script setup lang="ts">
|
||||
defineOptions({
|
||||
name: "dictType",
|
||||
name: "DictType",
|
||||
inheritAttrs: false,
|
||||
});
|
||||
|
||||
|
|
@ -215,7 +215,10 @@ onMounted(() => {
|
|||
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-button type="success" @click="openDialog()"
|
||||
<el-button
|
||||
v-hasPerm="['sys:dict_type:add']"
|
||||
type="success"
|
||||
@click="openDialog()"
|
||||
><i-ep-plus />新增</el-button
|
||||
>
|
||||
<el-button
|
||||
|
|
@ -252,6 +255,7 @@ onMounted(() => {
|
|||
><i-ep-Collection />字典数据</el-button
|
||||
>
|
||||
<el-button
|
||||
v-hasPerm="['sys:dict_type:edit']"
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
|
|
@ -259,6 +263,7 @@ onMounted(() => {
|
|||
><i-ep-edit />编辑</el-button
|
||||
>
|
||||
<el-button
|
||||
v-hasPerm="['sys:dict_type:delete']"
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<script setup lang="ts">
|
||||
defineOptions({
|
||||
name: "cmenu",
|
||||
// eslint-disable-next-line vue/no-reserved-component-names
|
||||
name: "Menu",
|
||||
inheritAttrs: false,
|
||||
});
|
||||
|
||||
|
|
@ -194,6 +195,7 @@ function resetForm() {
|
|||
formData.parentId = 0;
|
||||
formData.visible = 1;
|
||||
formData.sort = 1;
|
||||
formData.perm = undefined;
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
|
@ -225,9 +227,13 @@ onMounted(() => {
|
|||
</el-form>
|
||||
</div>
|
||||
|
||||
<el-card shadow="never">
|
||||
<el-card shadow="never" size="small">
|
||||
<template #header>
|
||||
<el-button type="success" @click="openDialog(0)">
|
||||
<el-button
|
||||
v-hasPerm="['sys:menu:add']"
|
||||
type="success"
|
||||
@click="openDialog(0)"
|
||||
>
|
||||
<template #icon><i-ep-plus /></template>
|
||||
新增</el-button
|
||||
>
|
||||
|
|
@ -237,10 +243,14 @@ onMounted(() => {
|
|||
v-loading="loading"
|
||||
:data="menuList"
|
||||
highlight-current-row
|
||||
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
||||
:tree-props="{
|
||||
children: 'children',
|
||||
hasChildren: 'hasChildren',
|
||||
}"
|
||||
row-key="id"
|
||||
default-expand-all
|
||||
border
|
||||
size="small"
|
||||
@row-click="onRowClick"
|
||||
>
|
||||
<el-table-column label="菜单名称" min-width="200">
|
||||
|
|
@ -256,7 +266,7 @@ onMounted(() => {
|
|||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="菜单类型" align="center" width="150">
|
||||
<el-table-column label="类型" align="center" width="80">
|
||||
<template #default="scope">
|
||||
<el-tag
|
||||
v-if="scope.row.type === MenuTypeEnum.CATALOG"
|
||||
|
|
@ -274,6 +284,21 @@ onMounted(() => {
|
|||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column
|
||||
label="路由路径"
|
||||
align="left"
|
||||
width="150"
|
||||
prop="path"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
label="组件路径"
|
||||
align="left"
|
||||
width="250"
|
||||
prop="component"
|
||||
/>
|
||||
|
||||
<el-table-column
|
||||
label="权限标识"
|
||||
align="center"
|
||||
|
|
@ -281,19 +306,20 @@ onMounted(() => {
|
|||
prop="perm"
|
||||
/>
|
||||
|
||||
<el-table-column label="状态" align="center" width="150">
|
||||
<el-table-column label="状态" align="center" width="80">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.visible === 1" type="success">显示</el-tag>
|
||||
<el-tag v-else type="info">隐藏</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="排序" align="center" width="100" prop="sort" />
|
||||
<el-table-column label="排序" align="center" width="80" prop="sort" />
|
||||
|
||||
<el-table-column fixed="right" align="center" label="操作" width="220">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-if="scope.row.type == 'CATALOG' || scope.row.type == 'MENU'"
|
||||
v-hasPerm="['sys:menu:add']"
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
|
|
@ -303,6 +329,7 @@ onMounted(() => {
|
|||
</el-button>
|
||||
|
||||
<el-button
|
||||
v-hasPerm="['sys:menu:edit']"
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
|
|
@ -311,6 +338,7 @@ onMounted(() => {
|
|||
<i-ep-edit />编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
v-hasPerm="['sys:menu:delete']"
|
||||
type="primary"
|
||||
link
|
||||
size="small"
|
||||
|
|
@ -370,14 +398,17 @@ onMounted(() => {
|
|||
</el-form-item>
|
||||
|
||||
<el-form-item
|
||||
v-if="formData.type == 'CATALOG' || formData.type == 'MENU'"
|
||||
v-if="
|
||||
formData.type == MenuTypeEnum.CATALOG ||
|
||||
formData.type == MenuTypeEnum.MENU
|
||||
"
|
||||
label="路由路径"
|
||||
prop="path"
|
||||
>
|
||||
<el-input
|
||||
v-if="formData.type == 'CATALOG'"
|
||||
v-if="formData.type == MenuTypeEnum.CATALOG"
|
||||
v-model="formData.path"
|
||||
placeholder="/system (目录以/开头)"
|
||||
placeholder="system"
|
||||
/>
|
||||
<el-input v-else v-model="formData.path" placeholder="user" />
|
||||
</el-form-item>
|
||||
|
|
@ -393,10 +424,12 @@ onMounted(() => {
|
|||
placeholder="system/user/index"
|
||||
style="width: 95%"
|
||||
>
|
||||
<template v-if="formData.parentId != 0" #prepend
|
||||
<template v-if="formData.type == MenuTypeEnum.MENU" #prepend
|
||||
>src/views/</template
|
||||
>
|
||||
<template v-if="formData.parentId != 0" #append>.vue</template>
|
||||
<template v-if="formData.type == MenuTypeEnum.MENU" #append
|
||||
>.vue</template
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<script setup lang="ts">
|
||||
defineOptions({
|
||||
name: "role",
|
||||
name: "Role",
|
||||
inheritAttrs: false,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* @see {@link https://vuejs.org/api/sfc-script-setup.html#defineoptions}
|
||||
*/
|
||||
defineOptions({
|
||||
name: "user",
|
||||
name: "User",
|
||||
inheritAttrs: false,
|
||||
});
|
||||
import { UploadFile } from "element-plus";
|
||||
|
|
@ -552,6 +552,7 @@ onMounted(() => {
|
|||
<el-table-column label="操作" fixed="right" width="220">
|
||||
<template #default="scope">
|
||||
<el-button
|
||||
v-hasPerm="['sys:user:reset_pwd']"
|
||||
type="primary"
|
||||
size="small"
|
||||
link
|
||||
|
|
|
|||
Loading…
Reference in New Issue