Showing
1 changed file
with
20 additions
and
8 deletions
| @@ -37,13 +37,21 @@ | @@ -37,13 +37,21 @@ | ||
| 37 | </a-button> | 37 | </a-button> |
| 38 | </template> | 38 | </template> |
| 39 | <template #status="{ record }"> | 39 | <template #status="{ record }"> |
| 40 | - <Switch | ||
| 41 | - :checked="record.status === 1" | ||
| 42 | - :loading="record.pendingStatus" | ||
| 43 | - checkedChildren="启用" | ||
| 44 | - unCheckedChildren="禁用" | ||
| 45 | - @change="(checked:boolean)=>statusChange(checked,record)" | ||
| 46 | - /> | 40 | + <Authority value="api:yt:alarm:profile:status"> |
| 41 | + <Switch | ||
| 42 | + :checked="record.status === 1" | ||
| 43 | + :loading="record.pendingStatus" | ||
| 44 | + checkedChildren="启用" | ||
| 45 | + unCheckedChildren="禁用" | ||
| 46 | + @change="(checked:boolean)=>statusChange(checked,record)" | ||
| 47 | + /> | ||
| 48 | + </Authority> | ||
| 49 | + <Tag | ||
| 50 | + v-if="!hasPermission('api:yt:alarm:profile:status')" | ||
| 51 | + :color="record.status ? 'green' : 'red'" | ||
| 52 | + > | ||
| 53 | + {{ record.status ? '启用' : '禁用' }} | ||
| 54 | + </Tag> | ||
| 47 | </template> | 55 | </template> |
| 48 | <template #action="{ record }"> | 56 | <template #action="{ record }"> |
| 49 | <TableAction | 57 | <TableAction |
| @@ -88,7 +96,7 @@ | @@ -88,7 +96,7 @@ | ||
| 88 | import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree'; | 96 | import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree'; |
| 89 | import { deleteAlarmConfig, queryAlarmConfig } from '/@/api/alarm/config/alarmConfig'; | 97 | import { deleteAlarmConfig, queryAlarmConfig } from '/@/api/alarm/config/alarmConfig'; |
| 90 | import { searchFormSchema, columns } from './config.data'; | 98 | import { searchFormSchema, columns } from './config.data'; |
| 91 | - import { Modal, Popconfirm } from 'ant-design-vue'; | 99 | + import { Modal, Popconfirm, Tag } from 'ant-design-vue'; |
| 92 | import { JsonPreview } from '/@/components/CodeEditor'; | 100 | import { JsonPreview } from '/@/components/CodeEditor'; |
| 93 | import { findDictItemByCode } from '/@/api/system/dict'; | 101 | import { findDictItemByCode } from '/@/api/system/dict'; |
| 94 | import { alarmContactGetPage } from '/@/api/device/deviceConfigApi'; | 102 | import { alarmContactGetPage } from '/@/api/device/deviceConfigApi'; |
| @@ -97,6 +105,7 @@ | @@ -97,6 +105,7 @@ | ||
| 97 | import { putAlarmConfigStatus } from '/@/api/alarm/config/alarmConfig'; | 105 | import { putAlarmConfigStatus } from '/@/api/alarm/config/alarmConfig'; |
| 98 | import { useMessage } from '/@/hooks/web/useMessage'; | 106 | import { useMessage } from '/@/hooks/web/useMessage'; |
| 99 | import { Authority } from '/@/components/Authority'; | 107 | import { Authority } from '/@/components/Authority'; |
| 108 | + import { usePermission } from '/@/hooks/web/usePermission'; | ||
| 100 | 109 | ||
| 101 | export default defineComponent({ | 110 | export default defineComponent({ |
| 102 | components: { | 111 | components: { |
| @@ -108,8 +117,10 @@ | @@ -108,8 +117,10 @@ | ||
| 108 | Switch, | 117 | Switch, |
| 109 | Authority, | 118 | Authority, |
| 110 | Popconfirm, | 119 | Popconfirm, |
| 120 | + Tag, | ||
| 111 | }, | 121 | }, |
| 112 | setup() { | 122 | setup() { |
| 123 | + const { hasPermission } = usePermission(); | ||
| 113 | const searchInfo = reactive<Recordable>({}); | 124 | const searchInfo = reactive<Recordable>({}); |
| 114 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); | 125 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); |
| 115 | // 刷新 | 126 | // 刷新 |
| @@ -250,6 +261,7 @@ | @@ -250,6 +261,7 @@ | ||
| 250 | showAlarmContact, | 261 | showAlarmContact, |
| 251 | showMessageMode, | 262 | showMessageMode, |
| 252 | statusChange, | 263 | statusChange, |
| 264 | + hasPermission, | ||
| 253 | }; | 265 | }; |
| 254 | }, | 266 | }, |
| 255 | }); | 267 | }); |