fix: bug#11071、11075、11058、11062、11151

This commit is contained in:
JiangQiming 2023-03-29 10:53:16 +08:00
parent a5189bd29e
commit 6cb8e67da2
5 changed files with 61 additions and 39 deletions

View File

@ -47,9 +47,15 @@
> >
<j-button type="primary" disabled> 新增 </j-button> <j-button type="primary" disabled> 新增 </j-button>
</j-tooltip> </j-tooltip>
<j-button type="primary" @click="handleAdd" v-else> <PermissionButton
新增 type="primary"
</j-button> @click="handleAdd"
hasPermission="media/Device:add"
>
<template #icon
><AIcon type="PlusOutlined" />新增</template
>
</PermissionButton>
</template> </template>
<template #status="slotProps"> <template #status="slotProps">
<j-space> <j-space>
@ -64,41 +70,52 @@
</j-space> </j-space>
</template> </template>
<template #action="slotProps"> <template #action="slotProps">
<j-space :size="16"> <j-space>
<j-tooltip <template
v-for="i in getActions(slotProps, 'table')" v-for="i in getActions(slotProps, 'table')"
:key="i.key" :key="i.key"
v-bind="i.tooltip"
> >
<j-popconfirm <PermissionButton
v-if="i.popConfirm" v-if="
v-bind="i.popConfirm" i.key !== 'play' && i.key !== 'backPlay'
"
:danger="i.key === 'delete'"
:disabled="i.disabled" :disabled="i.disabled"
> :popConfirm="i.popConfirm"
<j-button :tooltip="{
:disabled="i.disabled" ...i.tooltip,
style="padding: 0" }"
type="link" @click="i.onClick"
:danger="i.key === 'delete'"
>
<AIcon :type="i.icon" />
</j-button>
</j-popconfirm>
<j-button
style="padding: 0"
type="link" type="link"
v-else style="padding: 0px"
@click="i.onClick && i.onClick(slotProps)" :hasPermission="'media/Device:' + i.key"
> >
<j-button <template #icon
:disabled="i.disabled" ><AIcon :type="i.icon"
style="padding: 0" /></template>
type="link" </PermissionButton>
> <!-- 回放/播放不要权限控制 -->
<AIcon :type="i.icon" /> <template v-else>
</j-button> <j-tooltip :key="i.key" v-bind="i.tooltip">
</j-button> <j-button
</j-tooltip> style="padding: 0px"
type="link"
@click="
i.onClick &&
i.onClick(slotProps)
"
>
<j-button
:disabled="i.disabled"
style="padding: 0"
type="link"
>
<AIcon :type="i.icon" />
</j-button>
</j-button>
</j-tooltip>
</template>
</template>
</j-space> </j-space>
</template> </template>
</JProTable> </JProTable>
@ -216,7 +233,7 @@ const getActions = (
if (!data) return []; if (!data) return [];
const actions = [ const actions = [
{ {
key: 'edit', key: 'update',
text: '编辑', text: '编辑',
tooltip: { tooltip: {
title: '编辑', title: '编辑',

View File

@ -325,7 +325,7 @@ const table = {
onClick: () => table.toSave(data.id), onClick: () => table.toSave(data.id),
}, },
{ {
permission: `${permission}:update`, permission: `${permission}:action`,
key: 'action', key: 'action',
text: disabled ? '禁用' : '启用', text: disabled ? '禁用' : '启用',
tooltip: { tooltip: {

View File

@ -336,14 +336,14 @@ const table = {
else else
return [ return [
{ {
permission: true, permission: `${permission}:assert`,
key: 'edit', key: 'edit',
tooltip: { title: '编辑' }, tooltip: { title: '编辑' },
icon: 'EditOutlined', icon: 'EditOutlined',
onClick: () => table.clickEdit(data), onClick: () => table.clickEdit(data),
}, },
{ {
permission: true, permission: `${permission}:bind`,
key: 'unbind', key: 'unbind',
tooltip: { title: '解除绑定' }, tooltip: { title: '解除绑定' },
popConfirm: { popConfirm: {

View File

@ -345,7 +345,7 @@ const table = {
onClick: () => table.clickEdit(data), onClick: () => table.clickEdit(data),
}, },
{ {
permission: `${permission}:assert`, permission: `${permission}:bind`,
key: 'unbind', key: 'unbind',
tooltip: { title: '解除绑定' }, tooltip: { title: '解除绑定' },
popConfirm: { popConfirm: {

View File

@ -18,9 +18,14 @@
</j-pro-table> </j-pro-table>
</div> </div>
<j-button type="primary" @click="save" v-if="props.mode !== 'home'" <PermissionButton
>保存</j-button type="primary"
hasPermission="system/Platforms/Setting:update"
@click="save"
v-if="props.mode !== 'home'"
> >
保存
</PermissionButton>
</div> </div>
</template> </template>