...
|
...
|
@@ -74,14 +74,22 @@ |
74
|
74
|
/>
|
75
|
75
|
</template>
|
76
|
76
|
<template #configStatus="{ record }">
|
77
|
|
- <Switch
|
78
|
|
- :disabled="disabledSwitch"
|
79
|
|
- :checked="record.status === 1"
|
80
|
|
- :loading="record.pendingStatus"
|
81
|
|
- :checkedChildren="BusinessReportConfigTextEnum.BUSINESS_ENABLE_TEXT"
|
82
|
|
- :unCheckedChildren="BusinessReportConfigTextEnum.BUSINESS_DISABLE_TEXT"
|
83
|
|
- @change="(checked: boolean) => statusChange(checked, record)"
|
84
|
|
- />
|
|
77
|
+ <Authority :value="PermissionReportConfigEnum.PERMISSION_STATUS">
|
|
78
|
+ <Switch
|
|
79
|
+ :disabled="disabledSwitch"
|
|
80
|
+ :checked="record.status === 1"
|
|
81
|
+ :loading="record.pendingStatus"
|
|
82
|
+ :checkedChildren="BusinessReportConfigTextEnum.BUSINESS_ENABLE_TEXT"
|
|
83
|
+ :unCheckedChildren="BusinessReportConfigTextEnum.BUSINESS_DISABLE_TEXT"
|
|
84
|
+ @change="(checked: boolean) => statusChange(checked, record)"
|
|
85
|
+ />
|
|
86
|
+ </Authority>
|
|
87
|
+ <Tag
|
|
88
|
+ v-if="!hasPermission(PermissionReportConfigEnum.PERMISSION_STATUS)"
|
|
89
|
+ :color="record.status ? 'green' : 'red'"
|
|
90
|
+ >
|
|
91
|
+ {{ record.status ? '启用' : '禁用' }}
|
|
92
|
+ </Tag>
|
85
|
93
|
</template>
|
86
|
94
|
</BasicTable>
|
87
|
95
|
<ReportConfigDrawer @register="registerDrawer" @success="handleSuccess" />
|
...
|
...
|
@@ -101,7 +109,7 @@ |
101
|
109
|
import { defaultTableAttribtes } from './config';
|
102
|
110
|
import { Authority } from '/@/components/Authority';
|
103
|
111
|
import { useBatchDelete } from '/@/hooks/web/useBatchDelete';
|
104
|
|
- import { Popconfirm, Switch } from 'ant-design-vue';
|
|
112
|
+ import { Popconfirm, Switch, Tag } from 'ant-design-vue';
|
105
|
113
|
import { useModal } from '/@/components/Modal';
|
106
|
114
|
import { useGo } from '/@/hooks/web/usePage';
|
107
|
115
|
import { useMessage } from '/@/hooks/web/useMessage';
|
...
|
...
|
@@ -111,6 +119,9 @@ |
111
|
119
|
BusinessReportConfigTextEnum,
|
112
|
120
|
BusinessReportConfigStatusEnum,
|
113
|
121
|
} from './enum';
|
|
122
|
+ import { usePermission } from '/@/hooks/web/usePermission';
|
|
123
|
+
|
|
124
|
+ const { hasPermission } = usePermission();
|
114
|
125
|
|
115
|
126
|
const disabledSwitch = ref(false);
|
116
|
127
|
|
...
|
...
|
|