Showing
1 changed file
with
19 additions
and
8 deletions
| @@ -17,13 +17,21 @@ | @@ -17,13 +17,21 @@ | ||
| 17 | </Authority> | 17 | </Authority> |
| 18 | </template> | 18 | </template> |
| 19 | <template #status="{ record }"> | 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 | </template> | 35 | </template> |
| 28 | <template #action="{ record }"> | 36 | <template #action="{ record }"> |
| 29 | <TableAction | 37 | <TableAction |
| @@ -69,7 +77,7 @@ | @@ -69,7 +77,7 @@ | ||
| 69 | 77 | ||
| 70 | <script lang="ts" setup> | 78 | <script lang="ts" setup> |
| 71 | import { ref, nextTick } from 'vue'; | 79 | import { ref, nextTick } from 'vue'; |
| 72 | - import { Switch, Popconfirm } from 'ant-design-vue'; | 80 | + import { Switch, Popconfirm, Tag } from 'ant-design-vue'; |
| 73 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 81 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| 74 | import { columns } from '../config/config.data'; | 82 | import { columns } from '../config/config.data'; |
| 75 | import { getConvertApi, deleteTransformApi } from '/@/api/device/TransformScriptApi'; | 83 | import { getConvertApi, deleteTransformApi } from '/@/api/device/TransformScriptApi'; |
| @@ -81,11 +89,14 @@ | @@ -81,11 +89,14 @@ | ||
| 81 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | 89 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; |
| 82 | import { Authority } from '/@/components/Authority'; | 90 | import { Authority } from '/@/components/Authority'; |
| 83 | import { computed, unref } from 'vue'; | 91 | import { computed, unref } from 'vue'; |
| 92 | + import { usePermission } from '/@/hooks/web/usePermission'; | ||
| 84 | 93 | ||
| 85 | const props = defineProps<{ searchInfo: Recordable }>(); | 94 | const props = defineProps<{ searchInfo: Recordable }>(); |
| 86 | 95 | ||
| 87 | const getSearchInfo = computed(() => props.searchInfo); | 96 | const getSearchInfo = computed(() => props.searchInfo); |
| 88 | 97 | ||
| 98 | + const { hasPermission } = usePermission(); | ||
| 99 | + | ||
| 89 | const handleSuccess = () => { | 100 | const handleSuccess = () => { |
| 90 | reload(); | 101 | reload(); |
| 91 | }; | 102 | }; |