Commit a9f60ed6 by yuzhenWang

修改缓存bug,隐藏删除按钮

parent 3c82c9ed
......@@ -20,9 +20,9 @@ export function uploadImage(data) {
})
}
// 查询用户是否有访问项目的权限
export function getVisitPermission(projectBizId) {
export function getVisitPermission(projectBizId, tenantBizId) {
return request({
url: '/user/api/sysUser/login/permission/project/visit?projectBizId=' + projectBizId,
url: `/user/api/sysUser/login/permission/project/visit?projectBizId=${projectBizId}&tenantBizId=${tenantBizId}`,
method: 'get'
})
}
......@@ -2,9 +2,11 @@
<section class="app-main">
<router-view v-slot="{ Component, route }">
<transition name="fade-transform" mode="out-in">
<keep-alive :include="tagsViewStore.cachedViews">
<component v-if="!route.meta.link" :is="Component" :key="route.path"/>
</keep-alive>
<!-- 慎用keep-alive缓存标签 -->
<!-- <keep-alive :include="tagsViewStore.cachedViews">
</keep-alive> -->
<component v-if="!route.meta.link" :is="Component" :key="route.path" />
</transition>
</router-view>
<iframe-toggle />
......@@ -13,8 +15,8 @@
</template>
<script setup>
import copyright from "./Copyright/index"
import iframeToggle from "./IframeToggle/index"
import copyright from './Copyright/index'
import iframeToggle from './IframeToggle/index'
import useTagsViewStore from '@/store/modules/tagsView'
const route = useRoute()
......@@ -86,4 +88,3 @@ function addIframe() {
border-radius: 3px;
}
</style>
......@@ -76,8 +76,8 @@
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
v-if="(userStore.isSuperAdmin === 0 && scope.row.scope !== 1) || userStore.isSuperAdmin === 1">修改</el-button>
<!-- <el-button link type="primary" icon="Plus" @click="handleAdd(scope.row)" v-hasPermi="['system:menu:add']">新增</el-button>-->
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
v-if="(userStore.isSuperAdmin === 0 && scope.row.scope !== 1) || userStore.isSuperAdmin === 1">删除</el-button>
<!-- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
v-if="(userStore.isSuperAdmin === 0 && scope.row.scope !== 1) || userStore.isSuperAdmin === 1">删除</el-button> -->
</template>
</el-table-column>
</el-table>
......
......@@ -129,7 +129,7 @@
"
>修改</el-button
>
<el-button
<!-- <el-button
link
type="primary"
icon="Delete"
......@@ -139,7 +139,7 @@
userStore.isSuperAdmin === 1
"
>删除</el-button
>
> -->
</template>
</el-table-column>
</el-table>
......
<template>
<div class="app-container">
<el-button type="primary" icon="Back" @click="handleBack" style="margin-bottom: 10px"
>返回</el-button
>
<!-- 选项卡组件:增加 custom-tabs 类名 -->
<el-tabs v-model="activeTab" type="card" @tab-change="handleTabChange" class="custom-tabs">
<!-- 用户权限选项卡 -->
......@@ -621,6 +624,7 @@ import {
import { ref } from 'vue'
import useUserStore from '@/store/modules/user'
const router = useRouter()
const userStore = useUserStore()
const { proxy } = getCurrentInstance()
const {
......@@ -848,7 +852,7 @@ function importProjectUserListSubmitForm() {
proxy.$modal
.confirm('是否确认导入用户账号为"' + importProjectUserListNameList + '"的数据项?')
.then(function () {
return addImportProjectUserList(importProjectUserListIdList, projectBizId,tenantBizId)
return addImportProjectUserList(importProjectUserListIdList, projectBizId, tenantBizId)
})
.then(() => {
importProjectUserListOpen.value = false
......@@ -943,7 +947,7 @@ function importProjectRoleListSubmitForm() {
proxy.$modal
.confirm('是否确认导入角色名称为"' + importProjectRoleListNameList + '"的数据项?')
.then(function () {
return addImportProjectRoleList(importProjectRoleListIdList, projectBizId,tenantBizId)
return addImportProjectRoleList(importProjectRoleListIdList, projectBizId, tenantBizId)
})
.then(() => {
importProjectRoleListOpen.value = false
......@@ -998,7 +1002,7 @@ function handleImportProjectMenuList() {
// 加载菜单树
const loadMenuTree = async () => {
try {
const res = await getMenuTree(route.query.projectBizId,route.query.tenantBizId)
const res = await getMenuTree(route.query.projectBizId, route.query.tenantBizId)
menuTree.value = res.data // 直接使用后端返回的树形结构
loadImportSelectedMenuList() // 加载选中的菜单列表,更新树勾选
} catch (error) {
......@@ -1009,7 +1013,7 @@ const loadMenuTree = async () => {
// 修改加载选中菜单列表的逻辑
const loadImportSelectedMenuList = async () => {
try {
const res = await getImportSelectedMenuList(route.query.projectBizId,route.query.tenantBizId)
const res = await getImportSelectedMenuList(route.query.projectBizId, route.query.tenantBizId)
const targetKeys = res.data || []
// 开启严格模式(禁用联动)
......@@ -1368,7 +1372,9 @@ const handleTabChange = tabName => {
getMenuList()
}
}
const handleBack = () => {
router.go(-1)
}
getUserList()
</script>
......
......@@ -90,8 +90,8 @@
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
v-if="(userStore.isSuperAdmin === 0 && scope.row.scope !== 1) || userStore.isSuperAdmin === 1">修改</el-button>
<el-button link type="primary" icon="Delete"
v-if="(userStore.isSuperAdmin === 0 && scope.row.scope !== 1) || userStore.isSuperAdmin === 1">删除</el-button>
<!-- <el-button link type="primary" icon="Delete"
v-if="(userStore.isSuperAdmin === 0 && scope.row.scope !== 1) || userStore.isSuperAdmin === 1">删除</el-button> -->
</template>
</el-table-column>
</el-table>
......
......@@ -267,7 +267,6 @@ import { Splitpanes, Pane } from 'splitpanes'
import 'splitpanes/dist/splitpanes.css'
import { ref } from 'vue'
const props = defineProps({
tenantBizId: {
type: String,
......@@ -534,7 +533,7 @@ const getDeptTree = () => {
deptBizIdValue.value = response.data[0].deptBizId
deptOptions.value = response.data
enabledDeptOptions.value = filterDisabledDept(JSON.parse(JSON.stringify(response.data)))
getList()
// getList()
// 等待 DOM 更新后选中第一个节点
nextTick(() => {
selectFirstTreeNode()
......@@ -638,7 +637,10 @@ watch(
newTab => {
if (newTab == 'dept') {
getDeptTree()
resetQuery()
dateRange.value = []
proxy.resetForm('queryRef')
queryParams.value.deptId = undefined
proxy.$refs.deptTreeRef.setCurrentKey(null)
}
},
{ immediate: true }
......
......@@ -124,9 +124,9 @@
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
>修改</el-button
>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
<!-- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
>删除</el-button
>
> -->
</template>
</el-table-column>
</el-table>
......
<template>
<div class="app-container">
<el-button type="primary" icon="Back" @click="handleBack" style="margin-bottom: 10px"
>返回</el-button
>
<!-- 选项卡组件:增加 custom-tabs 类名 -->
<el-tabs v-model="activeTab" type="card" @tab-change="handleTabChange" class="custom-tabs">
<!-- 项目权限选项卡 -->
......@@ -45,19 +48,19 @@
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button
link
type="primary"
icon="Edit"
@click="handlePermission(scope.row)"
v-if="
(userStore.isSuperAdmin === 0 && scope.row.scope !== 1) ||
userStore.isSuperAdmin === 1
"
>分配权限</el-button
link
type="primary"
icon="Edit"
@click="handlePermission(scope.row)"
v-if="
(userStore.isSuperAdmin === 0 && scope.row.scope !== 1) ||
userStore.isSuperAdmin === 1
"
>分配权限</el-button
>
<!-- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"-->
<!-- >删除</el-button-->
<!-- >-->
<!-- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"-->
<!-- >删除</el-button-->
<!-- >-->
</template>
</el-table-column>
</el-table>
......@@ -938,7 +941,12 @@ function handleDelete(row) {
/** 项目分配权限 */
function handlePermission(row) {
router.push(`/system/project/permission?tenantBizId=`+route.query.tenantBizId+`&projectBizId=` + row.projectBizId)
router.push(
`/system/project/permission?tenantBizId=` +
route.query.tenantBizId +
`&projectBizId=` +
row.projectBizId
)
}
//========项目-列表结束=========
......@@ -1619,7 +1627,9 @@ const handleTabChange = tabName => {
getMenuList()
}
}
const handleBack = () => {
router.go(-1)
}
getList()
</script>
......
......@@ -26,7 +26,7 @@ const appName = computed(() => props.project.projectName)
const handleClick = () => {
console.log('点击了应用卡片', props.project)
getVisitPermission(props.project.projectBizId).then(response => {
getVisitPermission(props.project.projectBizId, props.project.tenantBizId).then(response => {
if (response.code === 200) {
// 有权限访问项目,进行跳转
// 记录最近使用的应用
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment