Showing
1 changed file
with
19 additions
and
8 deletions
| ... | ... | @@ -17,13 +17,21 @@ |
| 17 | 17 | </Authority> |
| 18 | 18 | </template> |
| 19 | 19 | <template #status="{ record }"> |
| 20 | - <Switch | |
| 21 | - :checked="record.status === 1" | |
| 22 | - :loading="record.pendingStatus" | |
| 23 | - checkedChildren="启用" | |
| 24 | - unCheckedChildren="禁用" | |
| 25 | - @change="(checked:boolean)=>statusChange(checked,record)" | |
| 26 | - /> | |
| 20 | + <Authority value="api:yt:convert:js:status"> | |
| 21 | + <Switch | |
| 22 | + :checked="record.status === 1" | |
| 23 | + :loading="record.pendingStatus" | |
| 24 | + checkedChildren="启用" | |
| 25 | + unCheckedChildren="禁用" | |
| 26 | + @change="(checked:boolean)=>statusChange(checked,record)" | |
| 27 | + /> | |
| 28 | + </Authority> | |
| 29 | + <Tag | |
| 30 | + v-if="!hasPermission('api:yt:convert:js:status')" | |
| 31 | + :color="record.status ? 'green' : 'red'" | |
| 32 | + > | |
| 33 | + {{ record.status ? '启用' : '禁用' }} | |
| 34 | + </Tag> | |
| 27 | 35 | </template> |
| 28 | 36 | <template #action="{ record }"> |
| 29 | 37 | <TableAction |
| ... | ... | @@ -69,7 +77,7 @@ |
| 69 | 77 | |
| 70 | 78 | <script lang="ts" setup> |
| 71 | 79 | import { ref, nextTick } from 'vue'; |
| 72 | - import { Switch, Popconfirm } from 'ant-design-vue'; | |
| 80 | + import { Switch, Popconfirm, Tag } from 'ant-design-vue'; | |
| 73 | 81 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| 74 | 82 | import { columns } from '../config/config.data'; |
| 75 | 83 | import { getConvertApi, deleteTransformApi } from '/@/api/device/TransformScriptApi'; |
| ... | ... | @@ -81,11 +89,14 @@ |
| 81 | 89 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; |
| 82 | 90 | import { Authority } from '/@/components/Authority'; |
| 83 | 91 | import { computed, unref } from 'vue'; |
| 92 | + import { usePermission } from '/@/hooks/web/usePermission'; | |
| 84 | 93 | |
| 85 | 94 | const props = defineProps<{ searchInfo: Recordable }>(); |
| 86 | 95 | |
| 87 | 96 | const getSearchInfo = computed(() => props.searchInfo); |
| 88 | 97 | |
| 98 | + const { hasPermission } = usePermission(); | |
| 99 | + | |
| 89 | 100 | const handleSuccess = () => { |
| 90 | 101 | reload(); |
| 91 | 102 | }; | ... | ... |