|
@@ -4,13 +4,13 @@ meta:
|
|
|
</route>
|
|
</route>
|
|
|
|
|
|
|
|
<script lang="ts" setup name="AppRolePermit">
|
|
<script lang="ts" setup name="AppRolePermit">
|
|
|
|
|
+import Permit from './components/Permit.vue'
|
|
|
import { getAppPermitByList } from '@/api/apps/appPermitApi'
|
|
import { getAppPermitByList } from '@/api/apps/appPermitApi'
|
|
|
import { getRoleByList } from '@/api/system/roleApi'
|
|
import { getRoleByList } from '@/api/system/roleApi'
|
|
|
import useSettingsStore from '@/store/modules/settings'
|
|
import useSettingsStore from '@/store/modules/settings'
|
|
|
|
|
|
|
|
const settingsStore = useSettingsStore()
|
|
const settingsStore = useSettingsStore()
|
|
|
|
|
|
|
|
-const route = useRoute()
|
|
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
|
const tabbar = useTabbar()
|
|
const tabbar = useTabbar()
|
|
|
|
|
|
|
@@ -74,10 +74,6 @@ const getRoleData = async () => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-onMounted(() => {
|
|
|
|
|
- getRoleData()
|
|
|
|
|
-})
|
|
|
|
|
-
|
|
|
|
|
const onTreeNodeClick = (node: TreeNode) => {
|
|
const onTreeNodeClick = (node: TreeNode) => {
|
|
|
if (node.isLeaf) {
|
|
if (node.isLeaf) {
|
|
|
state.curRoleId = node.roleId
|
|
state.curRoleId = node.roleId
|
|
@@ -85,12 +81,11 @@ const onTreeNodeClick = (node: TreeNode) => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
const permitTableRef = ref()
|
|
const permitTableRef = ref()
|
|
|
-const onPermitAdd = () => { }
|
|
|
|
|
|
|
+const permitRef = ref()
|
|
|
|
|
|
|
|
-function onCancel() {
|
|
|
|
|
- goBack()
|
|
|
|
|
|
|
+const onPermitAdd = () => {
|
|
|
|
|
+ permitRef.value.showAddModel()
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
// 返回列表页
|
|
// 返回列表页
|
|
|
function goBack() {
|
|
function goBack() {
|
|
|
if (settingsStore.settings.tabbar.enable && settingsStore.settings.tabbar.mergeTabsBy !== 'activeMenu') {
|
|
if (settingsStore.settings.tabbar.enable && settingsStore.settings.tabbar.mergeTabsBy !== 'activeMenu') {
|
|
@@ -100,6 +95,31 @@ function goBack() {
|
|
|
router.push({ name: 'appStore' })
|
|
router.push({ name: 'appStore' })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+const onAddSub = (row: any) => {
|
|
|
|
|
+ window.console.log(row)
|
|
|
|
|
+}
|
|
|
|
|
+const onEdit = (row: { appId: any; roleId: any; permitId: any }) => {
|
|
|
|
|
+ const { appId, roleId, permitId } = row
|
|
|
|
|
+ permitRef.value.showEditModel(appId, roleId, permitId)
|
|
|
|
|
+}
|
|
|
|
|
+const onDelete = (row: any) => {
|
|
|
|
|
+ window.console.log(row)
|
|
|
|
|
+}
|
|
|
|
|
+const onUp = (row: any) => {
|
|
|
|
|
+ window.console.log(row)
|
|
|
|
|
+}
|
|
|
|
|
+const onDown = (row: any) => {
|
|
|
|
|
+ window.console.log(row)
|
|
|
|
|
+}
|
|
|
|
|
+// 组件处理成功回调
|
|
|
|
|
+const onSuccess = () => {
|
|
|
|
|
+
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ getRoleData()
|
|
|
|
|
+})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -140,7 +160,7 @@ function goBack() {
|
|
|
<tool-bar>
|
|
<tool-bar>
|
|
|
<template #right>
|
|
<template #right>
|
|
|
<el-input v-model="state.search.keywords" placeholder="请输入关键词筛选字典项" clearable style="width: 200px;" />
|
|
<el-input v-model="state.search.keywords" placeholder="请输入关键词筛选字典项" clearable style="width: 200px;" />
|
|
|
- <el-button @click="getPermitData">
|
|
|
|
|
|
|
+ <el-button style="margin-left: 10px;" @click="getPermitData">
|
|
|
<template #icon>
|
|
<template #icon>
|
|
|
<el-icon>
|
|
<el-icon>
|
|
|
<svg-icon name="i-ep:search" />
|
|
<svg-icon name="i-ep:search" />
|
|
@@ -157,12 +177,65 @@ function goBack() {
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</tool-bar>
|
|
</tool-bar>
|
|
|
|
|
+ <el-table ref="permitTableRef" v-loading="state.loading" class="list-table" :data="state.permitList" border stripe highlight-current-row height="100%">
|
|
|
|
|
+ <el-table-column type="selection" width="50" align="center" />
|
|
|
|
|
+ <el-table-column type="index" align="center" label="序号" width="70" />
|
|
|
|
|
+
|
|
|
|
|
+ <el-table-column label="权限ID" width="100px">
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
|
+ <span>{{ row.permitId }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table-column label="权限名称" width="200px">
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
|
+ <span>{{ row.permitTitle }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table-column label="权限编码" min-width="100">
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
|
+ <span>{{ row.permitCode }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
|
|
|
- <el-table ref="permitTableRef" v-loading="state.loading" :data="state.permitList" border stripe highlight-current-row height="100%">
|
|
|
|
|
- <el-table-column type="selection" align="center" fixed />
|
|
|
|
|
|
|
+ <el-table-column label="默认" header-align="center" align="center" width="80">
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
|
+ <span>{{ row.isHome }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table-column label="简要说明">
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
|
+ <span>{{ row.permitDesc }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table-column label="排序" header-align="center" align="center" width="60">
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
|
+ <span>{{ row.sortNo }}</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+
|
|
|
|
|
+ <el-table-column label="操作" width="400" header-align="center" align="right">
|
|
|
|
|
+ <template #default="{ row }">
|
|
|
|
|
+ <el-button v-if="row.permitType === 0" size="small" type="primary" icon="el-icon-plus" @click="onAddSub(row)">
|
|
|
|
|
+ 添加
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button size="small" type="success" icon="el-icon-edit" @click="onEdit(row)">
|
|
|
|
|
+ 修改
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button size="small" type="danger" icon="el-icon-delete" @click="onDelete(row)">
|
|
|
|
|
+ 删除
|
|
|
|
|
+ </el-button>
|
|
|
|
|
+ <el-button size="small" type="info" icon="el-icon-top" @click="onUp(row)" />
|
|
|
|
|
+ <el-button size="small" type="info" icon="el-icon-bottom" @click="onDown(row)" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
|
</div>
|
|
</div>
|
|
|
</LayoutContainer>
|
|
</LayoutContainer>
|
|
|
|
|
+ <Permit ref="permitRef" @success="onSuccess" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|