mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-10 08:57:10 +08:00
refactor: 适配后端权限码调整
This commit is contained in:
@@ -3,7 +3,7 @@ import { useUserStore } from '@/stores'
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @desc v-permission 操作权限处理
|
* @desc v-permission 操作权限处理
|
||||||
* @desc 使用 v-permission="['system:user:add']"
|
* @desc 使用 v-permission="['system:user:create']"
|
||||||
*/
|
*/
|
||||||
function checkPermission(el: HTMLElement, binding: DirectiveBinding) {
|
function checkPermission(el: HTMLElement, binding: DirectiveBinding) {
|
||||||
const userStore = useUserStore()
|
const userStore = useUserStore()
|
||||||
|
@@ -119,6 +119,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import type { TableInstance } from '@arco-design/web-vue'
|
||||||
import { Message } from '@arco-design/web-vue'
|
import { Message } from '@arco-design/web-vue'
|
||||||
import { useWindowSize } from '@vueuse/core'
|
import { useWindowSize } from '@vueuse/core'
|
||||||
import { type FieldConfigResp, type GeneratorConfigResp, getGenConfig, listFieldConfig, listFieldConfigDict, saveGenConfig } from '@/apis/code/generator'
|
import { type FieldConfigResp, type GeneratorConfigResp, getGenConfig, listFieldConfig, listFieldConfigDict, saveGenConfig } from '@/apis/code/generator'
|
||||||
|
@@ -30,7 +30,7 @@
|
|||||||
<template #default>导出</template>
|
<template #default>导出</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="has.hasPermOr(['monitor:log:detail'])" #createTime="{ record }">
|
<template v-if="has.hasPermOr(['monitor:log:get'])" #createTime="{ record }">
|
||||||
<a-link @click="onDetail(record)">{{ record.createTime }}</a-link>
|
<a-link @click="onDetail(record)">{{ record.createTime }}</a-link>
|
||||||
</template>
|
</template>
|
||||||
<template #status="{ record }">
|
<template #status="{ record }">
|
||||||
|
@@ -19,7 +19,7 @@
|
|||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
<template #toolbar-right>
|
<template #toolbar-right>
|
||||||
<a-button v-permission="['open:app:add']" type="primary" @click="onAdd">
|
<a-button v-permission="['open:app:create']" type="primary" @click="onAdd">
|
||||||
<template #icon><icon-plus /></template>
|
<template #icon><icon-plus /></template>
|
||||||
<template #default>新增</template>
|
<template #default>新增</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #action="{ record }">
|
<template #action="{ record }">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-link v-permission="['open:app:detail']" title="详情" @click="onDetail(record)">详情</a-link>
|
<a-link v-permission="['open:app:get']" title="详情" @click="onDetail(record)">详情</a-link>
|
||||||
<a-link v-permission="['open:app:update']" title="修改" @click="onUpdate(record)">修改</a-link>
|
<a-link v-permission="['open:app:update']" title="修改" @click="onUpdate(record)">修改</a-link>
|
||||||
<a-link
|
<a-link
|
||||||
v-permission="['open:app:delete']"
|
v-permission="['open:app:delete']"
|
||||||
@@ -141,7 +141,7 @@ const columns: TableInstance['columns'] = [
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
fixed: !isMobile() ? 'right' : undefined,
|
fixed: !isMobile() ? 'right' : undefined,
|
||||||
show: has.hasPermOr([
|
show: has.hasPermOr([
|
||||||
'open:app:detail',
|
'open:app:get',
|
||||||
'open:app:update',
|
'open:app:update',
|
||||||
'open:app:delete',
|
'open:app:delete',
|
||||||
'open:app:resetSecret',
|
'open:app:resetSecret',
|
||||||
|
@@ -27,12 +27,12 @@
|
|||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
<template #toolbar-right>
|
<template #toolbar-right>
|
||||||
<a-button v-permission="['schedule:job:add']" type="primary" @click="onAdd">
|
<a-button v-permission="['schedule:job:create']" type="primary" @click="onAdd">
|
||||||
<template #icon><icon-plus /></template>
|
<template #icon><icon-plus /></template>
|
||||||
<template #default>新增</template>
|
<template #default>新增</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="has.hasPermOr(['schedule:job:detail'])" #jobName="{ record }">
|
<template v-if="has.hasPermOr(['schedule:job:get'])" #jobName="{ record }">
|
||||||
<a-link @click="onDetail(record)">{{ record.jobName }}</a-link>
|
<a-link @click="onDetail(record)">{{ record.jobName }}</a-link>
|
||||||
</template>
|
</template>
|
||||||
<template #triggerType="{ record }">
|
<template #triggerType="{ record }">
|
||||||
|
@@ -41,7 +41,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #action="{ record }">
|
<template #action="{ record }">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-link v-permission="['schedule:log:detail']" title="详情" @click="onDetail(record)">详情</a-link>
|
<a-link v-permission="['schedule:log:get']" title="详情" @click="onDetail(record)">详情</a-link>
|
||||||
<a-popconfirm content="是否确定停止本次执行?" type="warning" @ok="onStop(record)">
|
<a-popconfirm content="是否确定停止本次执行?" type="warning" @ok="onStop(record)">
|
||||||
<a-link v-if="record.taskBatchStatus === 2" v-permission="['schedule:log:stop']" status="danger" title="停止">停止</a-link>
|
<a-link v-if="record.taskBatchStatus === 2" v-permission="['schedule:log:stop']" status="danger" title="停止">停止</a-link>
|
||||||
</a-popconfirm>
|
</a-popconfirm>
|
||||||
@@ -111,7 +111,7 @@ const columns: TableInstance['columns'] = [
|
|||||||
width: 130,
|
width: 130,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
fixed: !isMobile() ? 'right' : undefined,
|
fixed: !isMobile() ? 'right' : undefined,
|
||||||
show: has.hasPermOr(['schedule:log:detail', 'schedule:log:stop', 'schedule:log:retry']),
|
show: has.hasPermOr(['schedule:log:get', 'schedule:log:stop', 'schedule:log:retry']),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@@ -33,14 +33,14 @@
|
|||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
<template #toolbar-right>
|
<template #toolbar-right>
|
||||||
<a-button v-permission="['system:client:add']" type="primary" @click="onAdd">
|
<a-button v-permission="['system:client:create']" type="primary" @click="onAdd">
|
||||||
<template #icon><icon-plus /></template>
|
<template #icon><icon-plus /></template>
|
||||||
<template #default>新增</template>
|
<template #default>新增</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
<template #action="{ record }">
|
<template #action="{ record }">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-link v-permission="['system:client:detail']" title="详情" @click="onDetail(record)">详情</a-link>
|
<a-link v-permission="['system:client:get']" title="详情" @click="onDetail(record)">详情</a-link>
|
||||||
<a-link v-permission="['system:client:update']" title="修改" @click="onUpdate(record)">修改</a-link>
|
<a-link v-permission="['system:client:update']" title="修改" @click="onUpdate(record)">修改</a-link>
|
||||||
<a-link
|
<a-link
|
||||||
v-permission="['system:client:delete']"
|
v-permission="['system:client:delete']"
|
||||||
@@ -172,7 +172,7 @@ const columns: TableInstance['columns'] = [
|
|||||||
width: 160,
|
width: 160,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
fixed: !isMobile() ? 'right' : undefined,
|
fixed: !isMobile() ? 'right' : undefined,
|
||||||
show: has.hasPermOr(['system:client:detail', 'system:client:update', 'system:client:delete']),
|
show: has.hasPermOr(['system:client:get', 'system:client:update', 'system:client:delete']),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
<template #toolbar-right>
|
<template #toolbar-right>
|
||||||
<a-button v-permission="['system:dept:add']" type="primary" @click="onAdd()">
|
<a-button v-permission="['system:dept:create']" type="primary" @click="onAdd()">
|
||||||
<template #icon><icon-plus /></template>
|
<template #icon><icon-plus /></template>
|
||||||
<template #default>新增</template>
|
<template #default>新增</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
>
|
>
|
||||||
删除
|
删除
|
||||||
</a-link>
|
</a-link>
|
||||||
<a-link v-permission="['system:dept:add']" title="新增" @click="onAdd(record.id)">新增</a-link>
|
<a-link v-permission="['system:dept:create']" title="新增" @click="onAdd(record.id)">新增</a-link>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
</GiTable>
|
</GiTable>
|
||||||
@@ -174,7 +174,7 @@ const columns: TableInstance['columns'] = [
|
|||||||
width: 160,
|
width: 160,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
fixed: !isMobile() ? 'right' : undefined,
|
fixed: !isMobile() ? 'right' : undefined,
|
||||||
show: has.hasPermOr(['system:dept:update', 'system:dept:delete', 'system:dept:add']),
|
show: has.hasPermOr(['system:dept:update', 'system:dept:delete', 'system:dept:create']),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
<template #toolbar-right>
|
<template #toolbar-right>
|
||||||
<a-button v-permission="['system:dict:item:add']" type="primary" @click="onAdd">
|
<a-button v-permission="['system:dict:item:create']" type="primary" @click="onAdd">
|
||||||
<template #icon><icon-plus /></template>
|
<template #icon><icon-plus /></template>
|
||||||
<template #default>新增</template>
|
<template #default>新增</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
<a-input v-model="searchKey" placeholder="搜索名称/编码" allow-clear>
|
<a-input v-model="searchKey" placeholder="搜索名称/编码" allow-clear>
|
||||||
<template #prefix><icon-search /></template>
|
<template #prefix><icon-search /></template>
|
||||||
</a-input>
|
</a-input>
|
||||||
<a-button v-permission="['system:dict:add']" type="primary" @click="onAdd">
|
<a-button v-permission="['system:dict:create']" type="primary" @click="onAdd">
|
||||||
<template #icon><icon-plus /></template>
|
<template #icon><icon-plus /></template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -25,7 +25,7 @@
|
|||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
<template #toolbar-right>
|
<template #toolbar-right>
|
||||||
<a-button v-permission="['system:menu:add']" type="primary" @click="onAdd()">
|
<a-button v-permission="['system:menu:create']" type="primary" @click="onAdd()">
|
||||||
<template #icon><icon-plus /></template>
|
<template #icon><icon-plus /></template>
|
||||||
<template #default>新增</template>
|
<template #default>新增</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
<a-link v-permission="['system:menu:update']" title="修改" @click="onUpdate(record)">修改</a-link>
|
<a-link v-permission="['system:menu:update']" title="修改" @click="onUpdate(record)">修改</a-link>
|
||||||
<a-link v-permission="['system:menu:delete']" status="danger" title="删除" @click="onDelete(record)">删除</a-link>
|
<a-link v-permission="['system:menu:delete']" status="danger" title="删除" @click="onDelete(record)">删除</a-link>
|
||||||
<a-link
|
<a-link
|
||||||
v-permission="['system:menu:add']"
|
v-permission="['system:menu:create']"
|
||||||
:disabled="![1, 2].includes(record.type)"
|
:disabled="![1, 2].includes(record.type)"
|
||||||
:title="![1, 2].includes(record.type) ? '不可添加下级菜单' : '新增'"
|
:title="![1, 2].includes(record.type) ? '不可添加下级菜单' : '新增'"
|
||||||
@click="onAdd(record.id)"
|
@click="onAdd(record.id)"
|
||||||
@@ -160,7 +160,7 @@ const columns: TableInstance['columns'] = [
|
|||||||
width: 160,
|
width: 160,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
fixed: !isMobile() ? 'right' : undefined,
|
fixed: !isMobile() ? 'right' : undefined,
|
||||||
show: has.hasPermOr(['system:menu:update', 'system:menu:delete', 'system:menu:add']),
|
show: has.hasPermOr(['system:menu:update', 'system:menu:delete', 'system:menu:create']),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@@ -27,7 +27,7 @@
|
|||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
<template #toolbar-right>
|
<template #toolbar-right>
|
||||||
<a-button v-permission="['system:notice:add']" type="primary" @click="onAdd">
|
<a-button v-permission="['system:notice:create']" type="primary" @click="onAdd">
|
||||||
<template #icon><icon-plus /></template>
|
<template #icon><icon-plus /></template>
|
||||||
<template #default>新增</template>
|
<template #default>新增</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #action="{ record }">
|
<template #action="{ record }">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-link v-permission="['system:notice:detail']" title="详情" @click="onDetail(record)">详情</a-link>
|
<a-link v-permission="['system:notice:get']" title="详情" @click="onDetail(record)">详情</a-link>
|
||||||
<a-link v-permission="['system:notice:update']" title="修改" @click="onUpdate(record)">修改</a-link>
|
<a-link v-permission="['system:notice:update']" title="修改" @click="onUpdate(record)">修改</a-link>
|
||||||
<a-link v-permission="['system:notice:delete']" status="danger" title="删除" @click="onDelete(record)"> 删除 </a-link>
|
<a-link v-permission="['system:notice:delete']" status="danger" title="删除" @click="onDelete(record)"> 删除 </a-link>
|
||||||
</a-space>
|
</a-space>
|
||||||
@@ -94,7 +94,7 @@ const columns: TableInstance['columns'] = [
|
|||||||
width: 160,
|
width: 160,
|
||||||
align: 'center',
|
align: 'center',
|
||||||
fixed: !isMobile() ? 'right' : undefined,
|
fixed: !isMobile() ? 'right' : undefined,
|
||||||
show: has.hasPermOr(['system:notice:detail', 'system:notice:update', 'system:notice:delete']),
|
show: has.hasPermOr(['system:notice:get', 'system:notice:update', 'system:notice:delete']),
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
<a-input v-model="searchKey" placeholder="搜索名称/编码" allow-clear>
|
<a-input v-model="searchKey" placeholder="搜索名称/编码" allow-clear>
|
||||||
<template #prefix><icon-search /></template>
|
<template #prefix><icon-search /></template>
|
||||||
</a-input>
|
</a-input>
|
||||||
<a-button v-permission="['system:role:add']" type="primary" @click="onAdd">
|
<a-button v-permission="['system:role:create']" type="primary" @click="onAdd">
|
||||||
<template #icon><icon-plus /></template>
|
<template #icon><icon-plus /></template>
|
||||||
</a-button>
|
</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -28,7 +28,7 @@
|
|||||||
</a-button>
|
</a-button>
|
||||||
</template>
|
</template>
|
||||||
<template #toolbar-right>
|
<template #toolbar-right>
|
||||||
<a-button v-permission="['system:smsConfig:add']" type="primary" @click="onAdd">
|
<a-button v-permission="['system:smsConfig:create']" type="primary" @click="onAdd">
|
||||||
<template #icon><icon-plus /></template>
|
<template #icon><icon-plus /></template>
|
||||||
<template #default>新增</template>
|
<template #default>新增</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
<div class="list-wrap">
|
<div class="list-wrap">
|
||||||
<a-row class="list-row" :gutter="24">
|
<a-row class="list-row" :gutter="24">
|
||||||
<a-col
|
<a-col
|
||||||
v-if="has.hasPermOr(['system:storage:add'])"
|
v-if="has.hasPermOr(['system:storage:create'])"
|
||||||
:xs="24"
|
:xs="24"
|
||||||
:sm="24"
|
:sm="24"
|
||||||
:md="12"
|
:md="12"
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
>
|
>
|
||||||
<CardAdd :type="1" @save-success="search" />
|
<CardAdd :type="1" @save-success="search" />
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-empty v-if="!data.length && !has.hasPermOr(['system:storage:add'])" />
|
<a-empty v-if="!data.length && !has.hasPermOr(['system:storage:create'])" />
|
||||||
<a-col
|
<a-col
|
||||||
v-for="item in data"
|
v-for="item in data"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
<div class="list-wrap">
|
<div class="list-wrap">
|
||||||
<a-row class="list-row" :gutter="24">
|
<a-row class="list-row" :gutter="24">
|
||||||
<a-col
|
<a-col
|
||||||
v-if="has.hasPermOr(['system:storage:add'])"
|
v-if="has.hasPermOr(['system:storage:create'])"
|
||||||
:xs="24"
|
:xs="24"
|
||||||
:sm="24"
|
:sm="24"
|
||||||
:md="12"
|
:md="12"
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
>
|
>
|
||||||
<CardAdd :type="2" @save-success="search" />
|
<CardAdd :type="2" @save-success="search" />
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-empty v-if="!data.length && !has.hasPermOr(['system:storage:add'])" />
|
<a-empty v-if="!data.length && !has.hasPermOr(['system:storage:create'])" />
|
||||||
<a-col
|
<a-col
|
||||||
v-for="item in data"
|
v-for="item in data"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
|
@@ -20,7 +20,7 @@
|
|||||||
<GiForm v-model="queryForm" search :columns="queryFormColumns" size="medium" @search="search" @reset="reset"></GiForm>
|
<GiForm v-model="queryForm" search :columns="queryFormColumns" size="medium" @search="search" @reset="reset"></GiForm>
|
||||||
</template>
|
</template>
|
||||||
<template #toolbar-left>
|
<template #toolbar-left>
|
||||||
<a-button v-permission="['system:user:add']" type="primary" @click="onAdd">
|
<a-button v-permission="['system:user:create']" type="primary" @click="onAdd">
|
||||||
<template #icon><icon-plus /></template>
|
<template #icon><icon-plus /></template>
|
||||||
<template #default>新增</template>
|
<template #default>新增</template>
|
||||||
</a-button>
|
</a-button>
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<template #action="{ record }">
|
<template #action="{ record }">
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-link v-permission="['system:user:detail']" title="详情" @click="onDetail(record)">详情</a-link>
|
<a-link v-permission="['system:user:get']" title="详情" @click="onDetail(record)">详情</a-link>
|
||||||
<a-link v-permission="['system:user:update']" title="修改" @click="onUpdate(record)">修改</a-link>
|
<a-link v-permission="['system:user:update']" title="修改" @click="onUpdate(record)">修改</a-link>
|
||||||
<a-link
|
<a-link
|
||||||
v-permission="['system:user:delete']"
|
v-permission="['system:user:delete']"
|
||||||
@@ -188,7 +188,7 @@ const columns: TableInstance['columns'] = [
|
|||||||
align: 'center',
|
align: 'center',
|
||||||
fixed: !isMobile() ? 'right' : undefined,
|
fixed: !isMobile() ? 'right' : undefined,
|
||||||
show: has.hasPermOr([
|
show: has.hasPermOr([
|
||||||
'system:user:detail',
|
'system:user:get',
|
||||||
'system:user:update',
|
'system:user:update',
|
||||||
'system:user:delete',
|
'system:user:delete',
|
||||||
'system:user:resetPwd',
|
'system:user:resetPwd',
|
||||||
|
Reference in New Issue
Block a user