Merge branch 'master' into develop
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "django-vue3-admin",
|
||||
"version": "3.0.4",
|
||||
"version": "3.1.0",
|
||||
"description": "是一套全部开源的快速开发平台,毫无保留给个人免费使用、团体授权使用。\n django-vue3-admin 基于RBAC模型的权限控制的一整套基础开发平台,权限粒度达到列级别,前后端分离,后端采用django + django-rest-framework,前端采用基于 vue3 + CompositionAPI + typescript + vite + element plus",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<script setup lang="ts" name="layoutIframeView">
|
||||
import { computed, watch, ref, nextTick } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import {cookie} from "xe-utils";
|
||||
|
||||
// 定义父组件传过来的值
|
||||
const props = defineProps({
|
||||
@@ -49,7 +50,15 @@ const route = useRoute();
|
||||
|
||||
// 处理 list 列表,当打开时,才进行加载
|
||||
const setIframeList = computed(() => {
|
||||
return (<RouteItems>props.list).filter((v: RouteItem) => v.meta?.isIframeOpen);
|
||||
return (<RouteItems>props.list).filter((v: RouteItem) => {
|
||||
if (v.meta?.isIframeOpen) {
|
||||
const isLink = v.meta?.isLink || '';
|
||||
if (isLink.includes("{{token}}")) {
|
||||
v.meta.isLink = isLink.replace("{{token}}", cookie.get('token'))
|
||||
}
|
||||
}
|
||||
return v.meta?.isIframeOpen
|
||||
});
|
||||
});
|
||||
// 获取 iframe 当前路由 path
|
||||
const getRoutePath = computed(() => {
|
||||
|
||||
@@ -17,19 +17,31 @@
|
||||
import { reactive, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { verifyUrl } from '/@/utils/toolsValidate';
|
||||
import {cookie} from "xe-utils";
|
||||
|
||||
// 定义变量内容
|
||||
const route = useRoute();
|
||||
const state = reactive<LinkViewState>({
|
||||
title: '',
|
||||
isLink: '',
|
||||
query: null
|
||||
});
|
||||
|
||||
// 立即前往
|
||||
const onGotoFullPage = () => {
|
||||
const { origin, pathname } = window.location;
|
||||
if (state.isLink.includes("{{token}}")) {
|
||||
state.isLink = state.isLink.replace("{{token}}", cookie.get('token'))
|
||||
}
|
||||
if (verifyUrl(<string>state.isLink)) window.open(state.isLink);
|
||||
else window.open(`${origin}${pathname}#${state.isLink}`);
|
||||
else {
|
||||
function objectToUrlParams(obj: { [key: string]: string | number }): string {
|
||||
return Object.keys(obj)
|
||||
.map(key => encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]))
|
||||
.join('&');
|
||||
}
|
||||
window.open(`${origin}${pathname}#${state.isLink}?${objectToUrlParams(state.query)}`)
|
||||
};
|
||||
};
|
||||
// 监听路由的变化,设置内容
|
||||
watch(
|
||||
@@ -37,6 +49,7 @@ watch(
|
||||
() => {
|
||||
state.title = <string>route.meta.title;
|
||||
state.isLink = <string>route.meta.isLink;
|
||||
state.query = <any>route.query;
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
|
||||
1
web/src/types/layout.d.ts
vendored
1
web/src/types/layout.d.ts
vendored
@@ -56,4 +56,5 @@ declare type ParentViewState<T = any> = {
|
||||
declare type LinkViewState = {
|
||||
title: string;
|
||||
isLink: string;
|
||||
query: any;
|
||||
};
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
|
||||
<el-form-item v-if="!menuFormData.is_catalog && menuFormData.is_link" label="外链接" prop="link_url">
|
||||
<el-input v-model="menuFormData.link_url" placeholder="请输入外链接地址" />
|
||||
<el-alert :title="`输入{{token}}可自动替换系统 token `" type="info" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item v-if="!menuFormData.is_catalog" label="缓存">
|
||||
|
||||
Reference in New Issue
Block a user