Merge branch 'master' into develop

This commit is contained in:
liqiang
2025-01-30 12:47:26 +08:00
5 changed files with 27 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "django-vue3-admin", "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", "description": "是一套全部开源的快速开发平台,毫无保留给个人免费使用、团体授权使用。\n django-vue3-admin 基于RBAC模型的权限控制的一整套基础开发平台权限粒度达到列级别前后端分离后端采用django + django-rest-framework前端采用基于 vue3 + CompositionAPI + typescript + vite + element plus",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {

View File

@@ -23,6 +23,7 @@
<script setup lang="ts" name="layoutIframeView"> <script setup lang="ts" name="layoutIframeView">
import { computed, watch, ref, nextTick } from 'vue'; import { computed, watch, ref, nextTick } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import {cookie} from "xe-utils";
// 定义父组件传过来的值 // 定义父组件传过来的值
const props = defineProps({ const props = defineProps({
@@ -49,7 +50,15 @@ const route = useRoute();
// 处理 list 列表,当打开时,才进行加载 // 处理 list 列表,当打开时,才进行加载
const setIframeList = computed(() => { 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 // 获取 iframe 当前路由 path
const getRoutePath = computed(() => { const getRoutePath = computed(() => {

View File

@@ -17,19 +17,31 @@
import { reactive, watch } from 'vue'; import { reactive, watch } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { verifyUrl } from '/@/utils/toolsValidate'; import { verifyUrl } from '/@/utils/toolsValidate';
import {cookie} from "xe-utils";
// 定义变量内容 // 定义变量内容
const route = useRoute(); const route = useRoute();
const state = reactive<LinkViewState>({ const state = reactive<LinkViewState>({
title: '', title: '',
isLink: '', isLink: '',
query: null
}); });
// 立即前往 // 立即前往
const onGotoFullPage = () => { const onGotoFullPage = () => {
const { origin, pathname } = window.location; 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); 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( watch(
@@ -37,6 +49,7 @@ watch(
() => { () => {
state.title = <string>route.meta.title; state.title = <string>route.meta.title;
state.isLink = <string>route.meta.isLink; state.isLink = <string>route.meta.isLink;
state.query = <any>route.query;
}, },
{ {
immediate: true, immediate: true,

View File

@@ -56,4 +56,5 @@ declare type ParentViewState<T = any> = {
declare type LinkViewState = { declare type LinkViewState = {
title: string; title: string;
isLink: string; isLink: string;
query: any;
}; };

View File

@@ -85,6 +85,7 @@
<el-form-item v-if="!menuFormData.is_catalog && menuFormData.is_link" label="外链接" prop="link_url"> <el-form-item v-if="!menuFormData.is_catalog && menuFormData.is_link" label="外链接" prop="link_url">
<el-input v-model="menuFormData.link_url" placeholder="请输入外链接地址" /> <el-input v-model="menuFormData.link_url" placeholder="请输入外链接地址" />
<el-alert :title="`输入{{token}}可自动替换系统 token `" type="info" />
</el-form-item> </el-form-item>
<el-form-item v-if="!menuFormData.is_catalog" label="缓存"> <el-form-item v-if="!menuFormData.is_catalog" label="缓存">