Showing
1 changed file
with
23 additions
and
10 deletions
| @@ -17,16 +17,26 @@ | @@ -17,16 +17,26 @@ | ||
| 17 | </Authority> | 17 | </Authority> |
| 18 | </template> | 18 | </template> |
| 19 | <template #config="{ record }"> | 19 | <template #config="{ record }"> |
| 20 | - <a-button type="link" class="ml-2" @click="showData(record)"> 查看配置 </a-button> | 20 | + <Authority value="api:yt:message:get"> |
| 21 | + <a-button type="link" class="ml-2" @click="showData(record)"> 查看配置 </a-button> | ||
| 22 | + </Authority> | ||
| 21 | </template> | 23 | </template> |
| 22 | <template #status="{ record }"> | 24 | <template #status="{ record }"> |
| 23 | - <Switch | ||
| 24 | - :checked="record.status === 1" | ||
| 25 | - :loading="record.pendingStatus" | ||
| 26 | - checkedChildren="启用" | ||
| 27 | - unCheckedChildren="禁用" | ||
| 28 | - @change="(checked:boolean)=>statusChange(checked,record)" | ||
| 29 | - /> | 25 | + <Authority value="api:yt:message:status"> |
| 26 | + <Switch | ||
| 27 | + :checked="record.status === 1" | ||
| 28 | + :loading="record.pendingStatus" | ||
| 29 | + checkedChildren="启用" | ||
| 30 | + unCheckedChildren="禁用" | ||
| 31 | + @change="(checked:boolean)=>statusChange(checked,record)" | ||
| 32 | + /> | ||
| 33 | + </Authority> | ||
| 34 | + <Tag | ||
| 35 | + v-if="!hasPermission('api:yt:message:status')" | ||
| 36 | + :color="record.status ? 'green' : 'red'" | ||
| 37 | + > | ||
| 38 | + {{ record.status ? '启用' : '禁用' }} | ||
| 39 | + </Tag> | ||
| 30 | </template> | 40 | </template> |
| 31 | <template #action="{ record }"> | 41 | <template #action="{ record }"> |
| 32 | <TableAction | 42 | <TableAction |
| @@ -62,18 +72,20 @@ | @@ -62,18 +72,20 @@ | ||
| 62 | import { useDrawer } from '/@/components/Drawer'; | 72 | import { useDrawer } from '/@/components/Drawer'; |
| 63 | import ConfigDrawer from './ConfigDrawer.vue'; | 73 | import ConfigDrawer from './ConfigDrawer.vue'; |
| 64 | import { columns, searchFormSchema } from './config.data'; | 74 | import { columns, searchFormSchema } from './config.data'; |
| 65 | - import { Modal, Popconfirm } from 'ant-design-vue'; | 75 | + import { Modal, Popconfirm, Tag } from 'ant-design-vue'; |
| 66 | import { JsonPreview } from '/@/components/CodeEditor'; | 76 | import { JsonPreview } from '/@/components/CodeEditor'; |
| 67 | import { useMessage } from '/@/hooks/web/useMessage'; | 77 | import { useMessage } from '/@/hooks/web/useMessage'; |
| 68 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | 78 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; |
| 69 | import { Switch } from 'ant-design-vue'; | 79 | import { Switch } from 'ant-design-vue'; |
| 70 | import { setMessageConfigStatus } from '/@/api/message/config'; | 80 | import { setMessageConfigStatus } from '/@/api/message/config'; |
| 71 | import { Authority } from '/@/components/Authority'; | 81 | import { Authority } from '/@/components/Authority'; |
| 82 | + import { usePermission } from '/@/hooks/web/usePermission'; | ||
| 72 | 83 | ||
| 73 | export default defineComponent({ | 84 | export default defineComponent({ |
| 74 | name: 'MessageConfigManagement', | 85 | name: 'MessageConfigManagement', |
| 75 | - components: { BasicTable, ConfigDrawer, TableAction, Switch, Authority, Popconfirm }, | 86 | + components: { BasicTable, ConfigDrawer, TableAction, Switch, Authority, Popconfirm, Tag }, |
| 76 | setup() { | 87 | setup() { |
| 88 | + const { hasPermission } = usePermission(); | ||
| 77 | const [registerDrawer, { openDrawer }] = useDrawer(); | 89 | const [registerDrawer, { openDrawer }] = useDrawer(); |
| 78 | function handleSuccess() { | 90 | function handleSuccess() { |
| 79 | reload(); | 91 | reload(); |
| @@ -168,6 +180,7 @@ | @@ -168,6 +180,7 @@ | ||
| 168 | handleDeleteOrBatchDelete, | 180 | handleDeleteOrBatchDelete, |
| 169 | hasBatchDelete, | 181 | hasBatchDelete, |
| 170 | statusChange, | 182 | statusChange, |
| 183 | + hasPermission, | ||
| 171 | }; | 184 | }; |
| 172 | }, | 185 | }, |
| 173 | }); | 186 | }); |