Showing
1 changed file
with
23 additions
and
10 deletions
... | ... | @@ -17,16 +17,26 @@ |
17 | 17 | </Authority> |
18 | 18 | </template> |
19 | 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 | 23 | </template> |
22 | 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 | 40 | </template> |
31 | 41 | <template #action="{ record }"> |
32 | 42 | <TableAction |
... | ... | @@ -62,18 +72,20 @@ |
62 | 72 | import { useDrawer } from '/@/components/Drawer'; |
63 | 73 | import ConfigDrawer from './ConfigDrawer.vue'; |
64 | 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 | 76 | import { JsonPreview } from '/@/components/CodeEditor'; |
67 | 77 | import { useMessage } from '/@/hooks/web/useMessage'; |
68 | 78 | import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; |
69 | 79 | import { Switch } from 'ant-design-vue'; |
70 | 80 | import { setMessageConfigStatus } from '/@/api/message/config'; |
71 | 81 | import { Authority } from '/@/components/Authority'; |
82 | + import { usePermission } from '/@/hooks/web/usePermission'; | |
72 | 83 | |
73 | 84 | export default defineComponent({ |
74 | 85 | name: 'MessageConfigManagement', |
75 | - components: { BasicTable, ConfigDrawer, TableAction, Switch, Authority, Popconfirm }, | |
86 | + components: { BasicTable, ConfigDrawer, TableAction, Switch, Authority, Popconfirm, Tag }, | |
76 | 87 | setup() { |
88 | + const { hasPermission } = usePermission(); | |
77 | 89 | const [registerDrawer, { openDrawer }] = useDrawer(); |
78 | 90 | function handleSuccess() { |
79 | 91 | reload(); |
... | ... | @@ -168,6 +180,7 @@ |
168 | 180 | handleDeleteOrBatchDelete, |
169 | 181 | hasBatchDelete, |
170 | 182 | statusChange, |
183 | + hasPermission, | |
171 | 184 | }; |
172 | 185 | }, |
173 | 186 | }); | ... | ... |