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