fix: bug#11071、11075、11058、11062、11151
This commit is contained in:
parent
a5189bd29e
commit
6cb8e67da2
|
@ -47,9 +47,15 @@
|
|||
>
|
||||
<j-button type="primary" disabled> 新增 </j-button>
|
||||
</j-tooltip>
|
||||
<j-button type="primary" @click="handleAdd" v-else>
|
||||
新增
|
||||
</j-button>
|
||||
<PermissionButton
|
||||
type="primary"
|
||||
@click="handleAdd"
|
||||
hasPermission="media/Device:add"
|
||||
>
|
||||
<template #icon
|
||||
><AIcon type="PlusOutlined" />新增</template
|
||||
>
|
||||
</PermissionButton>
|
||||
</template>
|
||||
<template #status="slotProps">
|
||||
<j-space>
|
||||
|
@ -64,31 +70,40 @@
|
|||
</j-space>
|
||||
</template>
|
||||
<template #action="slotProps">
|
||||
<j-space :size="16">
|
||||
<j-tooltip
|
||||
<j-space>
|
||||
<template
|
||||
v-for="i in getActions(slotProps, 'table')"
|
||||
:key="i.key"
|
||||
v-bind="i.tooltip"
|
||||
>
|
||||
<j-popconfirm
|
||||
v-if="i.popConfirm"
|
||||
v-bind="i.popConfirm"
|
||||
:disabled="i.disabled"
|
||||
>
|
||||
<j-button
|
||||
:disabled="i.disabled"
|
||||
style="padding: 0"
|
||||
type="link"
|
||||
<PermissionButton
|
||||
v-if="
|
||||
i.key !== 'play' && i.key !== 'backPlay'
|
||||
"
|
||||
:danger="i.key === 'delete'"
|
||||
>
|
||||
<AIcon :type="i.icon" />
|
||||
</j-button>
|
||||
</j-popconfirm>
|
||||
<j-button
|
||||
style="padding: 0"
|
||||
:disabled="i.disabled"
|
||||
:popConfirm="i.popConfirm"
|
||||
:tooltip="{
|
||||
...i.tooltip,
|
||||
}"
|
||||
@click="i.onClick"
|
||||
type="link"
|
||||
v-else
|
||||
@click="i.onClick && i.onClick(slotProps)"
|
||||
style="padding: 0px"
|
||||
:hasPermission="'media/Device:' + i.key"
|
||||
>
|
||||
<template #icon
|
||||
><AIcon :type="i.icon"
|
||||
/></template>
|
||||
</PermissionButton>
|
||||
<!-- 回放/播放不要权限控制 -->
|
||||
<template v-else>
|
||||
<j-tooltip :key="i.key" v-bind="i.tooltip">
|
||||
<j-button
|
||||
style="padding: 0px"
|
||||
type="link"
|
||||
@click="
|
||||
i.onClick &&
|
||||
i.onClick(slotProps)
|
||||
"
|
||||
>
|
||||
<j-button
|
||||
:disabled="i.disabled"
|
||||
|
@ -99,6 +114,8 @@
|
|||
</j-button>
|
||||
</j-button>
|
||||
</j-tooltip>
|
||||
</template>
|
||||
</template>
|
||||
</j-space>
|
||||
</template>
|
||||
</JProTable>
|
||||
|
@ -216,7 +233,7 @@ const getActions = (
|
|||
if (!data) return [];
|
||||
const actions = [
|
||||
{
|
||||
key: 'edit',
|
||||
key: 'update',
|
||||
text: '编辑',
|
||||
tooltip: {
|
||||
title: '编辑',
|
||||
|
|
|
@ -325,7 +325,7 @@ const table = {
|
|||
onClick: () => table.toSave(data.id),
|
||||
},
|
||||
{
|
||||
permission: `${permission}:update`,
|
||||
permission: `${permission}:action`,
|
||||
key: 'action',
|
||||
text: disabled ? '禁用' : '启用',
|
||||
tooltip: {
|
||||
|
|
|
@ -336,14 +336,14 @@ const table = {
|
|||
else
|
||||
return [
|
||||
{
|
||||
permission: true,
|
||||
permission: `${permission}:assert`,
|
||||
key: 'edit',
|
||||
tooltip: { title: '编辑' },
|
||||
icon: 'EditOutlined',
|
||||
onClick: () => table.clickEdit(data),
|
||||
},
|
||||
{
|
||||
permission: true,
|
||||
permission: `${permission}:bind`,
|
||||
key: 'unbind',
|
||||
tooltip: { title: '解除绑定' },
|
||||
popConfirm: {
|
||||
|
|
|
@ -345,7 +345,7 @@ const table = {
|
|||
onClick: () => table.clickEdit(data),
|
||||
},
|
||||
{
|
||||
permission: `${permission}:assert`,
|
||||
permission: `${permission}:bind`,
|
||||
key: 'unbind',
|
||||
tooltip: { title: '解除绑定' },
|
||||
popConfirm: {
|
||||
|
|
|
@ -18,9 +18,14 @@
|
|||
</j-pro-table>
|
||||
</div>
|
||||
|
||||
<j-button type="primary" @click="save" v-if="props.mode !== 'home'"
|
||||
>保存</j-button
|
||||
<PermissionButton
|
||||
type="primary"
|
||||
hasPermission="system/Platforms/Setting:update"
|
||||
@click="save"
|
||||
v-if="props.mode !== 'home'"
|
||||
>
|
||||
保存
|
||||
</PermissionButton>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
Loading…
Reference in New Issue