Showing
15 changed files
with
184 additions
and
190 deletions
| @@ -75,7 +75,7 @@ | @@ -75,7 +75,7 @@ | ||
| 75 | </template> | 75 | </template> |
| 76 | 76 | ||
| 77 | <script lang="ts"> | 77 | <script lang="ts"> |
| 78 | - import { defineComponent, reactive, h } from 'vue'; | 78 | + import { defineComponent, reactive, h, nextTick } from 'vue'; |
| 79 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 79 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| 80 | import { PageWrapper } from '/@/components/Page'; | 80 | import { PageWrapper } from '/@/components/Page'; |
| 81 | import { useDrawer } from '/@/components/Drawer'; | 81 | import { useDrawer } from '/@/components/Drawer'; |
| @@ -108,16 +108,7 @@ | @@ -108,16 +108,7 @@ | ||
| 108 | const handleSuccess = () => { | 108 | const handleSuccess = () => { |
| 109 | reload(); | 109 | reload(); |
| 110 | }; | 110 | }; |
| 111 | - const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions, resetSelectedRowKeys } = | ||
| 112 | - useBatchDelete(deleteAlarmConfig, handleSuccess); | ||
| 113 | - selectionOptions.rowSelection.getCheckboxProps = (record: Recordable) => { | ||
| 114 | - // Demo:status为1的选择框禁用 | ||
| 115 | - if (record.status === 1) { | ||
| 116 | - return { disabled: true }; | ||
| 117 | - } else { | ||
| 118 | - return { disabled: false }; | ||
| 119 | - } | ||
| 120 | - }; | 111 | + |
| 121 | // 表格hooks | 112 | // 表格hooks |
| 122 | const [registerTable, { reload, setProps, setSelectedRowKeys }] = useTable({ | 113 | const [registerTable, { reload, setProps, setSelectedRowKeys }] = useTable({ |
| 123 | title: '告警配置列表', | 114 | title: '告警配置列表', |
| @@ -139,7 +130,19 @@ | @@ -139,7 +130,19 @@ | ||
| 139 | slots: { customRender: 'action' }, | 130 | slots: { customRender: 'action' }, |
| 140 | fixed: 'right', | 131 | fixed: 'right', |
| 141 | }, | 132 | }, |
| 142 | - ...selectionOptions, | 133 | + }); |
| 134 | + const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions, resetSelectedRowKeys } = | ||
| 135 | + useBatchDelete(deleteAlarmConfig, handleSuccess, setProps); | ||
| 136 | + selectionOptions.rowSelection.getCheckboxProps = (record: Recordable) => { | ||
| 137 | + // Demo:status为1的选择框禁用 | ||
| 138 | + if (record.status === 1) { | ||
| 139 | + return { disabled: true }; | ||
| 140 | + } else { | ||
| 141 | + return { disabled: false }; | ||
| 142 | + } | ||
| 143 | + }; | ||
| 144 | + nextTick(() => { | ||
| 145 | + setProps(selectionOptions); | ||
| 143 | }); | 146 | }); |
| 144 | // 弹框 | 147 | // 弹框 |
| 145 | const [registerDrawer, { openDrawer }] = useDrawer(); | 148 | const [registerDrawer, { openDrawer }] = useDrawer(); |
| @@ -6,12 +6,7 @@ | @@ -6,12 +6,7 @@ | ||
| 6 | @select="handleSelect" | 6 | @select="handleSelect" |
| 7 | ref="organizationIdTreeRef" | 7 | ref="organizationIdTreeRef" |
| 8 | /> | 8 | /> |
| 9 | - <BasicTable | ||
| 10 | - :clickToRowSelect="false" | ||
| 11 | - @register="registerTable" | ||
| 12 | - :searchInfo="searchInfo" | ||
| 13 | - class="w-3/4 xl:w-4/5" | ||
| 14 | - > | 9 | + <BasicTable @register="registerTable" :searchInfo="searchInfo" class="w-3/4 xl:w-4/5"> |
| 15 | <template #toolbar> | 10 | <template #toolbar> |
| 16 | <a-button type="primary" @click="handleCreateOrEdit(null)"> 新增告警联系人 </a-button> | 11 | <a-button type="primary" @click="handleCreateOrEdit(null)"> 新增告警联系人 </a-button> |
| 17 | <a-button | 12 | <a-button |
| @@ -50,13 +45,13 @@ | @@ -50,13 +45,13 @@ | ||
| 50 | </template> | 45 | </template> |
| 51 | 46 | ||
| 52 | <script lang="ts"> | 47 | <script lang="ts"> |
| 53 | - import { defineComponent, reactive, ref, computed } from 'vue'; | 48 | + import { defineComponent, reactive, nextTick } from 'vue'; |
| 54 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 49 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| 55 | import { PageWrapper } from '/@/components/Page'; | 50 | import { PageWrapper } from '/@/components/Page'; |
| 56 | - import { useMessage } from '/@/hooks/web/useMessage'; | ||
| 57 | import { useDrawer } from '/@/components/Drawer'; | 51 | import { useDrawer } from '/@/components/Drawer'; |
| 58 | import ContactDrawer from './ContactDrawer.vue'; | 52 | import ContactDrawer from './ContactDrawer.vue'; |
| 59 | import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree'; | 53 | import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree'; |
| 54 | + import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | ||
| 60 | 55 | ||
| 61 | import { getAlarmContact, deleteAlarmContact } from '/@/api/alarm/contact/alarmContact'; | 56 | import { getAlarmContact, deleteAlarmContact } from '/@/api/alarm/contact/alarmContact'; |
| 62 | import { searchFormSchema, columns } from './config.data'; | 57 | import { searchFormSchema, columns } from './config.data'; |
| @@ -69,18 +64,13 @@ | @@ -69,18 +64,13 @@ | ||
| 69 | ContactDrawer, | 64 | ContactDrawer, |
| 70 | }, | 65 | }, |
| 71 | setup() { | 66 | setup() { |
| 72 | - let selectedRowIds = ref<string[]>([]); | ||
| 73 | - const hasBatchDelete = computed(() => selectedRowIds.value.length <= 0); | ||
| 74 | - // 复选框事件 | ||
| 75 | - const onSelectRowChange = (selectedRowKeys: string[]) => { | ||
| 76 | - selectedRowIds.value = selectedRowKeys; | ||
| 77 | - }; | ||
| 78 | const searchInfo = reactive<Recordable>({}); | 67 | const searchInfo = reactive<Recordable>({}); |
| 79 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); | 68 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); |
| 80 | // 表格hooks | 69 | // 表格hooks |
| 81 | - const [registerTable, { reload }] = useTable({ | 70 | + const [registerTable, { reload, setProps }] = useTable({ |
| 82 | title: '告警联系人列表', | 71 | title: '告警联系人列表', |
| 83 | api: getAlarmContact, | 72 | api: getAlarmContact, |
| 73 | + clickToRowSelect: false, | ||
| 84 | columns, | 74 | columns, |
| 85 | clickToRowSelect: false, | 75 | clickToRowSelect: false, |
| 86 | formConfig: { | 76 | formConfig: { |
| @@ -91,10 +81,6 @@ | @@ -91,10 +81,6 @@ | ||
| 91 | useSearchForm: true, | 81 | useSearchForm: true, |
| 92 | showTableSetting: true, | 82 | showTableSetting: true, |
| 93 | bordered: true, | 83 | bordered: true, |
| 94 | - rowSelection: { | ||
| 95 | - onChange: onSelectRowChange, | ||
| 96 | - type: 'checkbox', | ||
| 97 | - }, | ||
| 98 | rowKey: 'id', | 84 | rowKey: 'id', |
| 99 | actionColumn: { | 85 | actionColumn: { |
| 100 | width: 200, | 86 | width: 200, |
| @@ -104,14 +90,20 @@ | @@ -104,14 +90,20 @@ | ||
| 104 | fixed: 'right', | 90 | fixed: 'right', |
| 105 | }, | 91 | }, |
| 106 | }); | 92 | }); |
| 93 | + const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete( | ||
| 94 | + deleteAlarmContact, | ||
| 95 | + handleSuccess, | ||
| 96 | + setProps | ||
| 97 | + ); | ||
| 98 | + nextTick(() => { | ||
| 99 | + setProps(selectionOptions); | ||
| 100 | + }); | ||
| 107 | // 弹框 | 101 | // 弹框 |
| 108 | const [registerDrawer, { openDrawer }] = useDrawer(); | 102 | const [registerDrawer, { openDrawer }] = useDrawer(); |
| 109 | - const { createMessage } = useMessage(); | ||
| 110 | - | ||
| 111 | // 刷新 | 103 | // 刷新 |
| 112 | - const handleSuccess = () => { | 104 | + function handleSuccess() { |
| 113 | reload(); | 105 | reload(); |
| 114 | - }; | 106 | + } |
| 115 | // 新增或编辑 | 107 | // 新增或编辑 |
| 116 | const handleCreateOrEdit = (record: Recordable | null) => { | 108 | const handleCreateOrEdit = (record: Recordable | null) => { |
| 117 | if (record) { | 109 | if (record) { |
| @@ -125,24 +117,6 @@ | @@ -125,24 +117,6 @@ | ||
| 125 | }); | 117 | }); |
| 126 | } | 118 | } |
| 127 | }; | 119 | }; |
| 128 | - // 删除或批量删除 | ||
| 129 | - const handleDeleteOrBatchDelete = async (record: Recordable | null) => { | ||
| 130 | - if (record) { | ||
| 131 | - try { | ||
| 132 | - await deleteAlarmContact([record.id]); | ||
| 133 | - createMessage.success('删除联系人成功'); | ||
| 134 | - handleSuccess(); | ||
| 135 | - } catch (e) {} | ||
| 136 | - } else { | ||
| 137 | - try { | ||
| 138 | - await deleteAlarmContact(selectedRowIds.value); | ||
| 139 | - createMessage.success('批量删除联系人成功'); | ||
| 140 | - selectedRowIds.value = []; | ||
| 141 | - handleSuccess(); | ||
| 142 | - } catch (e) {} | ||
| 143 | - } | ||
| 144 | - }; | ||
| 145 | - | ||
| 146 | // 树形选择器 | 120 | // 树形选择器 |
| 147 | const handleSelect = (organizationId: string) => { | 121 | const handleSelect = (organizationId: string) => { |
| 148 | searchInfo.organizationId = organizationId; | 122 | searchInfo.organizationId = organizationId; |
| @@ -60,10 +60,9 @@ | @@ -60,10 +60,9 @@ | ||
| 60 | </template> | 60 | </template> |
| 61 | 61 | ||
| 62 | <script lang="ts"> | 62 | <script lang="ts"> |
| 63 | - import { defineComponent, reactive, ref, computed } from 'vue'; | 63 | + import { defineComponent, reactive, ref, nextTick } from 'vue'; |
| 64 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 64 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| 65 | import { PageWrapper } from '/@/components/Page'; | 65 | import { PageWrapper } from '/@/components/Page'; |
| 66 | - import { useMessage } from '/@/hooks/web/useMessage'; | ||
| 67 | import { useDrawer } from '/@/components/Drawer'; | 66 | import { useDrawer } from '/@/components/Drawer'; |
| 68 | import ContactDrawer from './ConfigurationCenterDrawer.vue'; | 67 | import ContactDrawer from './ConfigurationCenterDrawer.vue'; |
| 69 | import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree'; | 68 | import { useResetOrganizationTree, OrganizationIdTree } from '/@/views/common/organizationIdTree'; |
| @@ -72,6 +71,8 @@ | @@ -72,6 +71,8 @@ | ||
| 72 | getPage, | 71 | getPage, |
| 73 | deleteConfigurationCenter, | 72 | deleteConfigurationCenter, |
| 74 | } from '/@/api/configuration/center/configurationCenter'; | 73 | } from '/@/api/configuration/center/configurationCenter'; |
| 74 | + import { useBatchDelete } from '/@/hooks/web/useBatchDelete'; | ||
| 75 | + | ||
| 75 | import { getAppEnvConfig } from '/@/utils/env'; | 76 | import { getAppEnvConfig } from '/@/utils/env'; |
| 76 | export default defineComponent({ | 77 | export default defineComponent({ |
| 77 | components: { | 78 | components: { |
| @@ -84,7 +85,6 @@ | @@ -84,7 +85,6 @@ | ||
| 84 | setup() { | 85 | setup() { |
| 85 | const { VITE_GLOB_CONFIGURATION } = getAppEnvConfig(); | 86 | const { VITE_GLOB_CONFIGURATION } = getAppEnvConfig(); |
| 86 | let selectedRowIds = ref<string[]>([]); | 87 | let selectedRowIds = ref<string[]>([]); |
| 87 | - const hasBatchDelete = computed(() => selectedRowIds.value.length <= 0); | ||
| 88 | // 复选框事件 | 88 | // 复选框事件 |
| 89 | const onSelectRowChange = (selectedRowKeys: string[]) => { | 89 | const onSelectRowChange = (selectedRowKeys: string[]) => { |
| 90 | selectedRowIds.value = selectedRowKeys; | 90 | selectedRowIds.value = selectedRowKeys; |
| @@ -92,7 +92,7 @@ | @@ -92,7 +92,7 @@ | ||
| 92 | const searchInfo = reactive<Recordable>({}); | 92 | const searchInfo = reactive<Recordable>({}); |
| 93 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); | 93 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); |
| 94 | // 表格hooks | 94 | // 表格hooks |
| 95 | - const [registerTable, { reload }] = useTable({ | 95 | + const [registerTable, { reload, setProps }] = useTable({ |
| 96 | title: '组态中心列表', | 96 | title: '组态中心列表', |
| 97 | api: getPage, | 97 | api: getPage, |
| 98 | columns, | 98 | columns, |
| @@ -106,10 +106,6 @@ | @@ -106,10 +106,6 @@ | ||
| 106 | useSearchForm: true, | 106 | useSearchForm: true, |
| 107 | showTableSetting: true, | 107 | showTableSetting: true, |
| 108 | bordered: true, | 108 | bordered: true, |
| 109 | - rowSelection: { | ||
| 110 | - onChange: onSelectRowChange, | ||
| 111 | - type: 'checkbox', | ||
| 112 | - }, | ||
| 113 | rowKey: 'id', | 109 | rowKey: 'id', |
| 114 | actionColumn: { | 110 | actionColumn: { |
| 115 | width: 200, | 111 | width: 200, |
| @@ -119,14 +115,22 @@ | @@ -119,14 +115,22 @@ | ||
| 119 | fixed: 'right', | 115 | fixed: 'right', |
| 120 | }, | 116 | }, |
| 121 | }); | 117 | }); |
| 118 | + const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete( | ||
| 119 | + deleteConfigurationCenter, | ||
| 120 | + handleSuccess, | ||
| 121 | + setProps | ||
| 122 | + ); | ||
| 123 | + nextTick(() => { | ||
| 124 | + setProps(selectionOptions); | ||
| 125 | + }); | ||
| 126 | + | ||
| 122 | // 弹框 | 127 | // 弹框 |
| 123 | const [registerDrawer, { openDrawer }] = useDrawer(); | 128 | const [registerDrawer, { openDrawer }] = useDrawer(); |
| 124 | - const { createMessage } = useMessage(); | ||
| 125 | 129 | ||
| 126 | // 刷新 | 130 | // 刷新 |
| 127 | - const handleSuccess = () => { | 131 | + function handleSuccess() { |
| 128 | reload(); | 132 | reload(); |
| 129 | - }; | 133 | + } |
| 130 | // 新增或编辑 | 134 | // 新增或编辑 |
| 131 | const handleCreateOrEdit = (record: Recordable | null) => { | 135 | const handleCreateOrEdit = (record: Recordable | null) => { |
| 132 | if (record) { | 136 | if (record) { |
| @@ -140,24 +144,6 @@ | @@ -140,24 +144,6 @@ | ||
| 140 | }); | 144 | }); |
| 141 | } | 145 | } |
| 142 | }; | 146 | }; |
| 143 | - // 删除或批量删除 | ||
| 144 | - const handleDeleteOrBatchDelete = async (record: Recordable | null) => { | ||
| 145 | - if (record) { | ||
| 146 | - try { | ||
| 147 | - await deleteConfigurationCenter([record.id]); | ||
| 148 | - createMessage.success('删除组态成功'); | ||
| 149 | - handleSuccess(); | ||
| 150 | - } catch (e) {} | ||
| 151 | - } else { | ||
| 152 | - try { | ||
| 153 | - await deleteConfigurationCenter(selectedRowIds.value); | ||
| 154 | - createMessage.success('批量删除组态成功'); | ||
| 155 | - selectedRowIds.value = []; | ||
| 156 | - handleSuccess(); | ||
| 157 | - } catch (e) {} | ||
| 158 | - } | ||
| 159 | - }; | ||
| 160 | - | ||
| 161 | // 树形选择器 | 147 | // 树形选择器 |
| 162 | const handleSelect = (organizationId: string) => { | 148 | const handleSelect = (organizationId: string) => { |
| 163 | searchInfo.organizationId = organizationId; | 149 | searchInfo.organizationId = organizationId; |
| @@ -146,7 +146,7 @@ | @@ -146,7 +146,7 @@ | ||
| 146 | </div> | 146 | </div> |
| 147 | </template> | 147 | </template> |
| 148 | <script lang="ts"> | 148 | <script lang="ts"> |
| 149 | - import { defineComponent, reactive, unref } from 'vue'; | 149 | + import { defineComponent, reactive, unref, nextTick } from 'vue'; |
| 150 | import { DeviceState, DeviceTypeEnum } from '/@/api/device/model/deviceModel'; | 150 | import { DeviceState, DeviceTypeEnum } from '/@/api/device/model/deviceModel'; |
| 151 | import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table'; | 151 | import { BasicTable, useTable, TableAction, TableImg } from '/@/components/Table'; |
| 152 | import { columns, searchFormSchema } from './config/device.data'; | 152 | import { columns, searchFormSchema } from './config/device.data'; |
| @@ -190,17 +190,6 @@ | @@ -190,17 +190,6 @@ | ||
| 190 | Popover, | 190 | Popover, |
| 191 | }, | 191 | }, |
| 192 | setup(_) { | 192 | setup(_) { |
| 193 | - const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions, resetSelectedRowKeys } = | ||
| 194 | - useBatchDelete(deleteDevice, handleSuccess); | ||
| 195 | - selectionOptions.rowSelection.getCheckboxProps = (record: Recordable) => { | ||
| 196 | - // Demo:status为1的选择框禁用 | ||
| 197 | - if (record.customerId) { | ||
| 198 | - return { disabled: true }; | ||
| 199 | - } else { | ||
| 200 | - return { disabled: false }; | ||
| 201 | - } | ||
| 202 | - }; | ||
| 203 | - | ||
| 204 | const { createMessage } = useMessage(); | 193 | const { createMessage } = useMessage(); |
| 205 | const go = useGo(); | 194 | const go = useGo(); |
| 206 | const searchInfo = reactive<Recordable>({}); | 195 | const searchInfo = reactive<Recordable>({}); |
| @@ -208,7 +197,7 @@ | @@ -208,7 +197,7 @@ | ||
| 208 | const [registerModal, { openModal }] = useModal(); | 197 | const [registerModal, { openModal }] = useModal(); |
| 209 | const [registerCustomerModal, { openModal: openCustomerModal }] = useModal(); | 198 | const [registerCustomerModal, { openModal: openCustomerModal }] = useModal(); |
| 210 | const [registerDetailDrawer, { openDrawer }] = useDrawer(); | 199 | const [registerDetailDrawer, { openDrawer }] = useDrawer(); |
| 211 | - const [registerTable, { reload, setSelectedRowKeys }] = useTable({ | 200 | + const [registerTable, { reload, setSelectedRowKeys, setProps }] = useTable({ |
| 212 | title: '设备列表', | 201 | title: '设备列表', |
| 213 | api: devicePage, | 202 | api: devicePage, |
| 214 | columns, | 203 | columns, |
| @@ -230,7 +219,19 @@ | @@ -230,7 +219,19 @@ | ||
| 230 | slots: { customRender: 'action' }, | 219 | slots: { customRender: 'action' }, |
| 231 | fixed: 'right', | 220 | fixed: 'right', |
| 232 | }, | 221 | }, |
| 233 | - ...selectionOptions, | 222 | + }); |
| 223 | + const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions, resetSelectedRowKeys } = | ||
| 224 | + useBatchDelete(deleteDevice, handleSuccess, setProps); | ||
| 225 | + selectionOptions.rowSelection.getCheckboxProps = (record: Recordable) => { | ||
| 226 | + // Demo:status为1的选择框禁用 | ||
| 227 | + if (record.customerId) { | ||
| 228 | + return { disabled: true }; | ||
| 229 | + } else { | ||
| 230 | + return { disabled: false }; | ||
| 231 | + } | ||
| 232 | + }; | ||
| 233 | + nextTick(() => { | ||
| 234 | + setProps(selectionOptions); | ||
| 234 | }); | 235 | }); |
| 235 | 236 | ||
| 236 | const userInfo: any = getAuthCache(USER_INFO_KEY); | 237 | const userInfo: any = getAuthCache(USER_INFO_KEY); |
| @@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
| 45 | </div> | 45 | </div> |
| 46 | </template> | 46 | </template> |
| 47 | <script lang="ts"> | 47 | <script lang="ts"> |
| 48 | - import { defineComponent, h } from 'vue'; | 48 | + import { defineComponent, h, nextTick } from 'vue'; |
| 49 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 49 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| 50 | import { messageConfigPage, deleteMessageConfig } from '/@/api/message/config'; | 50 | import { messageConfigPage, deleteMessageConfig } from '/@/api/message/config'; |
| 51 | import { useDrawer } from '/@/components/Drawer'; | 51 | import { useDrawer } from '/@/components/Drawer'; |
| @@ -66,16 +66,7 @@ | @@ -66,16 +66,7 @@ | ||
| 66 | function handleSuccess() { | 66 | function handleSuccess() { |
| 67 | reload(); | 67 | reload(); |
| 68 | } | 68 | } |
| 69 | - const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions, resetSelectedRowKeys } = | ||
| 70 | - useBatchDelete(deleteMessageConfig, handleSuccess); | ||
| 71 | - selectionOptions.rowSelection.getCheckboxProps = (record: Recordable) => { | ||
| 72 | - // Demo:status为1的选择框禁用 | ||
| 73 | - if (record.status === 1) { | ||
| 74 | - return { disabled: true }; | ||
| 75 | - } else { | ||
| 76 | - return { disabled: false }; | ||
| 77 | - } | ||
| 78 | - }; | 69 | + |
| 79 | const [registerTable, { reload, setProps, setSelectedRowKeys }] = useTable({ | 70 | const [registerTable, { reload, setProps, setSelectedRowKeys }] = useTable({ |
| 80 | title: '消息配置列表', | 71 | title: '消息配置列表', |
| 81 | api: messageConfigPage, | 72 | api: messageConfigPage, |
| @@ -95,7 +86,19 @@ | @@ -95,7 +86,19 @@ | ||
| 95 | slots: { customRender: 'action' }, | 86 | slots: { customRender: 'action' }, |
| 96 | fixed: 'right', | 87 | fixed: 'right', |
| 97 | }, | 88 | }, |
| 98 | - ...selectionOptions, | 89 | + }); |
| 90 | + const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions, resetSelectedRowKeys } = | ||
| 91 | + useBatchDelete(deleteMessageConfig, handleSuccess, setProps); | ||
| 92 | + selectionOptions.rowSelection.getCheckboxProps = (record: Recordable) => { | ||
| 93 | + // Demo:status为1的选择框禁用 | ||
| 94 | + if (record.status === 1) { | ||
| 95 | + return { disabled: true }; | ||
| 96 | + } else { | ||
| 97 | + return { disabled: false }; | ||
| 98 | + } | ||
| 99 | + }; | ||
| 100 | + nextTick(() => { | ||
| 101 | + setProps(selectionOptions); | ||
| 99 | }); | 102 | }); |
| 100 | 103 | ||
| 101 | function handleCreate() { | 104 | function handleCreate() { |
| @@ -37,9 +37,8 @@ | @@ -37,9 +37,8 @@ | ||
| 37 | </div> | 37 | </div> |
| 38 | </template> | 38 | </template> |
| 39 | <script lang="ts"> | 39 | <script lang="ts"> |
| 40 | - import { defineComponent } from 'vue'; | 40 | + import { defineComponent, nextTick } from 'vue'; |
| 41 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 41 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| 42 | - import { useDrawerInner } from '/@/components/Drawer'; | ||
| 43 | import { columns, searchFormSchema } from './email.data'; | 42 | import { columns, searchFormSchema } from './email.data'; |
| 44 | import { mailLogPage, deleteMailLog } from '/@/api/message/records'; | 43 | import { mailLogPage, deleteMailLog } from '/@/api/message/records'; |
| 45 | import { useModal } from '/@/components/Modal'; | 44 | import { useModal } from '/@/components/Modal'; |
| @@ -50,12 +49,7 @@ | @@ -50,12 +49,7 @@ | ||
| 50 | components: { EmailDetail, BasicTable, TableAction }, | 49 | components: { EmailDetail, BasicTable, TableAction }, |
| 51 | setup() { | 50 | setup() { |
| 52 | const [registerModal, { openModal }] = useModal(); | 51 | const [registerModal, { openModal }] = useModal(); |
| 53 | - const { hasBatchDelete, selectionOptions, handleDeleteOrBatchDelete } = useBatchDelete( | ||
| 54 | - deleteMailLog, | ||
| 55 | - handleSuccess | ||
| 56 | - ); | ||
| 57 | - const [register] = useDrawerInner(() => {}); | ||
| 58 | - const [registerTable, { reload }] = useTable({ | 52 | + const [registerTable, { reload, setProps }] = useTable({ |
| 59 | title: '邮件发送列表', | 53 | title: '邮件发送列表', |
| 60 | api: mailLogPage, | 54 | api: mailLogPage, |
| 61 | columns, | 55 | columns, |
| @@ -75,7 +69,14 @@ | @@ -75,7 +69,14 @@ | ||
| 75 | slots: { customRender: 'action' }, | 69 | slots: { customRender: 'action' }, |
| 76 | fixed: 'right', | 70 | fixed: 'right', |
| 77 | }, | 71 | }, |
| 78 | - ...selectionOptions, | 72 | + }); |
| 73 | + const { hasBatchDelete, selectionOptions, handleDeleteOrBatchDelete } = useBatchDelete( | ||
| 74 | + deleteMailLog, | ||
| 75 | + handleSuccess, | ||
| 76 | + setProps | ||
| 77 | + ); | ||
| 78 | + nextTick(() => { | ||
| 79 | + setProps(selectionOptions); | ||
| 79 | }); | 80 | }); |
| 80 | 81 | ||
| 81 | function handleCreate() {} | 82 | function handleCreate() {} |
| @@ -91,7 +92,6 @@ | @@ -91,7 +92,6 @@ | ||
| 91 | } | 92 | } |
| 92 | 93 | ||
| 93 | return { | 94 | return { |
| 94 | - register, | ||
| 95 | registerTable, | 95 | registerTable, |
| 96 | registerModal, | 96 | registerModal, |
| 97 | handleCreate, | 97 | handleCreate, |
| @@ -36,7 +36,7 @@ | @@ -36,7 +36,7 @@ | ||
| 36 | </div> | 36 | </div> |
| 37 | </template> | 37 | </template> |
| 38 | <script lang="ts"> | 38 | <script lang="ts"> |
| 39 | - import { defineComponent, h } from 'vue'; | 39 | + import { defineComponent, h, nextTick } from 'vue'; |
| 40 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 40 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| 41 | import { columns, searchFormSchema } from './sms.data'; | 41 | import { columns, searchFormSchema } from './sms.data'; |
| 42 | import { Modal } from 'ant-design-vue'; | 42 | import { Modal } from 'ant-design-vue'; |
| @@ -48,12 +48,7 @@ | @@ -48,12 +48,7 @@ | ||
| 48 | name: 'SmsLog', | 48 | name: 'SmsLog', |
| 49 | components: { BasicTable, TableAction }, | 49 | components: { BasicTable, TableAction }, |
| 50 | setup() { | 50 | setup() { |
| 51 | - // 批量删除的hooks | ||
| 52 | - const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete( | ||
| 53 | - deleteSmsLog, | ||
| 54 | - handleSuccess | ||
| 55 | - ); | ||
| 56 | - const [registerTable, { reload }] = useTable({ | 51 | + const [registerTable, { reload, setProps }] = useTable({ |
| 57 | title: '短信发送列表', | 52 | title: '短信发送列表', |
| 58 | api: smsLogPage, | 53 | api: smsLogPage, |
| 59 | columns, | 54 | columns, |
| @@ -73,7 +68,14 @@ | @@ -73,7 +68,14 @@ | ||
| 73 | slots: { customRender: 'action' }, | 68 | slots: { customRender: 'action' }, |
| 74 | fixed: 'right', | 69 | fixed: 'right', |
| 75 | }, | 70 | }, |
| 76 | - ...selectionOptions, | 71 | + }); |
| 72 | + const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete( | ||
| 73 | + deleteSmsLog, | ||
| 74 | + handleSuccess, | ||
| 75 | + setProps | ||
| 76 | + ); | ||
| 77 | + nextTick(() => { | ||
| 78 | + setProps(selectionOptions); | ||
| 77 | }); | 79 | }); |
| 78 | function handleQuery(record: Recordable) { | 80 | function handleQuery(record: Recordable) { |
| 79 | Modal.info({ | 81 | Modal.info({ |
| @@ -42,6 +42,7 @@ | @@ -42,6 +42,7 @@ | ||
| 42 | title: '是否确认删除', | 42 | title: '是否确认删除', |
| 43 | confirm: handleDeleteOrBatchDelete.bind(null, record), | 43 | confirm: handleDeleteOrBatchDelete.bind(null, record), |
| 44 | }, | 44 | }, |
| 45 | + ifShow: record.status == 0, | ||
| 45 | }, | 46 | }, |
| 46 | ]" | 47 | ]" |
| 47 | /> | 48 | /> |
| @@ -53,7 +54,7 @@ | @@ -53,7 +54,7 @@ | ||
| 53 | </div> | 54 | </div> |
| 54 | </template> | 55 | </template> |
| 55 | <script lang="ts"> | 56 | <script lang="ts"> |
| 56 | - import { defineComponent } from 'vue'; | 57 | + import { defineComponent, nextTick } from 'vue'; |
| 57 | import { BasicTable, TableAction, useTable } from '/@/components/Table'; | 58 | import { BasicTable, TableAction, useTable } from '/@/components/Table'; |
| 58 | import { useDrawer } from '/@/components/Drawer'; | 59 | import { useDrawer } from '/@/components/Drawer'; |
| 59 | import TemplateDrawer from './TemplateDrawer.vue'; | 60 | import TemplateDrawer from './TemplateDrawer.vue'; |
| @@ -81,16 +82,7 @@ | @@ -81,16 +82,7 @@ | ||
| 81 | reload(); | 82 | reload(); |
| 82 | } | 83 | } |
| 83 | const [registerDrawer, { openDrawer }] = useDrawer(); | 84 | const [registerDrawer, { openDrawer }] = useDrawer(); |
| 84 | - const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions, resetSelectedRowKeys } = | ||
| 85 | - useBatchDelete(deleteMessageTemplate, handleSuccess); | ||
| 86 | - selectionOptions.rowSelection.getCheckboxProps = (record: Recordable) => { | ||
| 87 | - // Demo:status为1的选择框禁用 | ||
| 88 | - if (record.status === 1) { | ||
| 89 | - return { disabled: true }; | ||
| 90 | - } else { | ||
| 91 | - return { disabled: false }; | ||
| 92 | - } | ||
| 93 | - }; | 85 | + |
| 94 | const [registerTable, { reload, setProps, setSelectedRowKeys }] = useTable({ | 86 | const [registerTable, { reload, setProps, setSelectedRowKeys }] = useTable({ |
| 95 | title: '消息模板列表', | 87 | title: '消息模板列表', |
| 96 | api: messageTemplatePage, | 88 | api: messageTemplatePage, |
| @@ -110,7 +102,19 @@ | @@ -110,7 +102,19 @@ | ||
| 110 | slots: { customRender: 'action' }, | 102 | slots: { customRender: 'action' }, |
| 111 | fixed: 'right', | 103 | fixed: 'right', |
| 112 | }, | 104 | }, |
| 113 | - ...selectionOptions, | 105 | + }); |
| 106 | + const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions, resetSelectedRowKeys } = | ||
| 107 | + useBatchDelete(deleteMessageTemplate, handleSuccess, setProps); | ||
| 108 | + selectionOptions.rowSelection.getCheckboxProps = (record: Recordable) => { | ||
| 109 | + // Demo:status为1的选择框禁用 | ||
| 110 | + if (record.status === 1) { | ||
| 111 | + return { disabled: true }; | ||
| 112 | + } else { | ||
| 113 | + return { disabled: false }; | ||
| 114 | + } | ||
| 115 | + }; | ||
| 116 | + nextTick(() => { | ||
| 117 | + setProps(selectionOptions); | ||
| 114 | }); | 118 | }); |
| 115 | 119 | ||
| 116 | function handleCreate() { | 120 | function handleCreate() { |
| @@ -51,7 +51,7 @@ | @@ -51,7 +51,7 @@ | ||
| 51 | </div> | 51 | </div> |
| 52 | </template> | 52 | </template> |
| 53 | <script lang="ts"> | 53 | <script lang="ts"> |
| 54 | - import { defineComponent, ref } from 'vue'; | 54 | + import { defineComponent, ref, nextTick } from 'vue'; |
| 55 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 55 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| 56 | import { useDrawer } from '/@/components/Drawer'; | 56 | import { useDrawer } from '/@/components/Drawer'; |
| 57 | import NotifyManagerDrawer from './useDrawer.vue'; | 57 | import NotifyManagerDrawer from './useDrawer.vue'; |
| @@ -72,12 +72,9 @@ | @@ -72,12 +72,9 @@ | ||
| 72 | const [registerDrawer, { openDrawer }] = useDrawer(); | 72 | const [registerDrawer, { openDrawer }] = useDrawer(); |
| 73 | const [registerAdd, { openDrawer: openDrawerAdd }] = useDrawer(); | 73 | const [registerAdd, { openDrawer: openDrawerAdd }] = useDrawer(); |
| 74 | // 批量删除 | 74 | // 批量删除 |
| 75 | - const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete( | ||
| 76 | - notifyDeleteApi, | ||
| 77 | - handleSuccess | ||
| 78 | - ); | 75 | + |
| 79 | const NotifyManagerDrawerRef = ref(); | 76 | const NotifyManagerDrawerRef = ref(); |
| 80 | - const [registerTable, { reload }] = useTable({ | 77 | + const [registerTable, { reload, setProps }] = useTable({ |
| 81 | title: '通知列表', | 78 | title: '通知列表', |
| 82 | api: notifyGetTableApi, | 79 | api: notifyGetTableApi, |
| 83 | columns, | 80 | columns, |
| @@ -96,7 +93,14 @@ | @@ -96,7 +93,14 @@ | ||
| 96 | slots: { customRender: 'action' }, | 93 | slots: { customRender: 'action' }, |
| 97 | fixed: 'right', | 94 | fixed: 'right', |
| 98 | }, | 95 | }, |
| 99 | - ...selectionOptions, | 96 | + }); |
| 97 | + const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete( | ||
| 98 | + notifyDeleteApi, | ||
| 99 | + handleSuccess, | ||
| 100 | + setProps | ||
| 101 | + ); | ||
| 102 | + nextTick(() => { | ||
| 103 | + setProps(selectionOptions); | ||
| 100 | }); | 104 | }); |
| 101 | 105 | ||
| 102 | function handleAdd() { | 106 | function handleAdd() { |
| @@ -49,6 +49,7 @@ | @@ -49,6 +49,7 @@ | ||
| 49 | </div> | 49 | </div> |
| 50 | </template> | 50 | </template> |
| 51 | <script lang="ts" setup> | 51 | <script lang="ts" setup> |
| 52 | + import { nextTick } from 'vue'; | ||
| 52 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 53 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| 53 | import { useDrawer } from '/@/components/Drawer'; | 54 | import { useDrawer } from '/@/components/Drawer'; |
| 54 | import { | 55 | import { |
| @@ -64,17 +65,6 @@ | @@ -64,17 +65,6 @@ | ||
| 64 | import SceneLinkAgeDrawer from './SceneLinkAgeDrawer.vue'; | 65 | import SceneLinkAgeDrawer from './SceneLinkAgeDrawer.vue'; |
| 65 | import { useMessage } from '/@/hooks/web/useMessage'; | 66 | import { useMessage } from '/@/hooks/web/useMessage'; |
| 66 | 67 | ||
| 67 | - const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions, resetSelectedRowKeys } = | ||
| 68 | - useBatchDelete(screenLinkPageDeleteApi, handleSuccess); | ||
| 69 | - selectionOptions.rowSelection.getCheckboxProps = (record: Recordable) => { | ||
| 70 | - // Demo:status为1的选择框禁用 | ||
| 71 | - if (record.status === 1) { | ||
| 72 | - return { disabled: true }; | ||
| 73 | - } else { | ||
| 74 | - return { disabled: false }; | ||
| 75 | - } | ||
| 76 | - }; | ||
| 77 | - | ||
| 78 | const userInfo: any = getAuthCache(USER_INFO_KEY); | 68 | const userInfo: any = getAuthCache(USER_INFO_KEY); |
| 79 | const userId = userInfo.userId; | 69 | const userId = userInfo.userId; |
| 80 | 70 | ||
| @@ -98,7 +88,19 @@ | @@ -98,7 +88,19 @@ | ||
| 98 | slots: { customRender: 'action' }, | 88 | slots: { customRender: 'action' }, |
| 99 | fixed: 'right', | 89 | fixed: 'right', |
| 100 | }, | 90 | }, |
| 101 | - ...selectionOptions, | 91 | + }); |
| 92 | + const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions, resetSelectedRowKeys } = | ||
| 93 | + useBatchDelete(screenLinkPageDeleteApi, handleSuccess, setProps); | ||
| 94 | + selectionOptions.rowSelection.getCheckboxProps = (record: Recordable) => { | ||
| 95 | + // Demo:status为1的选择框禁用 | ||
| 96 | + if (record.status === 1) { | ||
| 97 | + return { disabled: true }; | ||
| 98 | + } else { | ||
| 99 | + return { disabled: false }; | ||
| 100 | + } | ||
| 101 | + }; | ||
| 102 | + nextTick(() => { | ||
| 103 | + setProps(selectionOptions); | ||
| 102 | }); | 104 | }); |
| 103 | 105 | ||
| 104 | function handleAdd() { | 106 | function handleAdd() { |
| @@ -50,7 +50,7 @@ | @@ -50,7 +50,7 @@ | ||
| 50 | </template> | 50 | </template> |
| 51 | 51 | ||
| 52 | <script lang="ts" setup> | 52 | <script lang="ts" setup> |
| 53 | - import { ref } from 'vue'; | 53 | + import { ref,nextTick } from 'vue'; |
| 54 | import { Switch } from 'ant-design-vue'; | 54 | import { Switch } from 'ant-design-vue'; |
| 55 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 55 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| 56 | import { columns, searchFormSchema } from './config/config.data'; | 56 | import { columns, searchFormSchema } from './config/config.data'; |
| @@ -66,16 +66,6 @@ | @@ -66,16 +66,6 @@ | ||
| 66 | reload(); | 66 | reload(); |
| 67 | }; | 67 | }; |
| 68 | 68 | ||
| 69 | - const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions, resetSelectedRowKeys } = | ||
| 70 | - useBatchDelete(deleteTransformApi, handleSuccess); | ||
| 71 | - selectionOptions.rowSelection.getCheckboxProps = (record: Recordable) => { | ||
| 72 | - // Demo:status为1的选择框禁用 | ||
| 73 | - if (record.status === 1) { | ||
| 74 | - return { disabled: true }; | ||
| 75 | - } else { | ||
| 76 | - return { disabled: false }; | ||
| 77 | - } | ||
| 78 | - }; | ||
| 79 | const [registerTable, { reload, setProps, setSelectedRowKeys }] = useTable({ | 69 | const [registerTable, { reload, setProps, setSelectedRowKeys }] = useTable({ |
| 80 | api: getConvertApi, | 70 | api: getConvertApi, |
| 81 | title: '转换脚本列表', | 71 | title: '转换脚本列表', |
| @@ -97,7 +87,20 @@ | @@ -97,7 +87,20 @@ | ||
| 97 | slots: { customRender: 'action' }, | 87 | slots: { customRender: 'action' }, |
| 98 | fixed: 'right', | 88 | fixed: 'right', |
| 99 | }, | 89 | }, |
| 100 | - ...selectionOptions, | 90 | + }); |
| 91 | + | ||
| 92 | + const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions, resetSelectedRowKeys } = | ||
| 93 | + useBatchDelete(deleteTransformApi, handleSuccess, setProps); | ||
| 94 | + selectionOptions.rowSelection.getCheckboxProps = (record: Recordable) => { | ||
| 95 | + // Demo:status为1的选择框禁用 | ||
| 96 | + if (record.status === 1) { | ||
| 97 | + return { disabled: true }; | ||
| 98 | + } else { | ||
| 99 | + return { disabled: false }; | ||
| 100 | + } | ||
| 101 | + }; | ||
| 102 | + nextTick(() => { | ||
| 103 | + setProps(selectionOptions); | ||
| 101 | }); | 104 | }); |
| 102 | const [registerDrawer, { openDrawer }] = useDrawer(); | 105 | const [registerDrawer, { openDrawer }] = useDrawer(); |
| 103 | 106 |
| @@ -73,7 +73,7 @@ | @@ -73,7 +73,7 @@ | ||
| 73 | </div> | 73 | </div> |
| 74 | </template> | 74 | </template> |
| 75 | <script lang="ts"> | 75 | <script lang="ts"> |
| 76 | - import { defineComponent, reactive } from 'vue'; | 76 | + import { defineComponent, reactive, nextTick } from 'vue'; |
| 77 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 77 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| 78 | import { deleteUser, getAccountList } from '/@/api/system/system'; | 78 | import { deleteUser, getAccountList } from '/@/api/system/system'; |
| 79 | import { PageWrapper } from '/@/components/Page'; | 79 | import { PageWrapper } from '/@/components/Page'; |
| @@ -89,14 +89,10 @@ | @@ -89,14 +89,10 @@ | ||
| 89 | components: { BasicTable, PageWrapper, OrganizationIdTree, AccountModal, TableAction, Tag }, | 89 | components: { BasicTable, PageWrapper, OrganizationIdTree, AccountModal, TableAction, Tag }, |
| 90 | setup() { | 90 | setup() { |
| 91 | const go = useGo(); | 91 | const go = useGo(); |
| 92 | - const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete( | ||
| 93 | - deleteUser, | ||
| 94 | - handleSuccess | ||
| 95 | - ); | ||
| 96 | const [registerModal, { openModal }] = useModal(); | 92 | const [registerModal, { openModal }] = useModal(); |
| 97 | let searchInfo = reactive<Recordable>({}); | 93 | let searchInfo = reactive<Recordable>({}); |
| 98 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); | 94 | const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo); |
| 99 | - const [registerTable, { reload }] = useTable({ | 95 | + const [registerTable, { reload, setProps }] = useTable({ |
| 100 | title: '账号列表', | 96 | title: '账号列表', |
| 101 | api: getAccountList, | 97 | api: getAccountList, |
| 102 | rowKey: 'id', | 98 | rowKey: 'id', |
| @@ -117,7 +113,14 @@ | @@ -117,7 +113,14 @@ | ||
| 117 | dataIndex: 'action', | 113 | dataIndex: 'action', |
| 118 | slots: { customRender: 'action' }, | 114 | slots: { customRender: 'action' }, |
| 119 | }, | 115 | }, |
| 120 | - ...selectionOptions, | 116 | + }); |
| 117 | + const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete( | ||
| 118 | + deleteUser, | ||
| 119 | + handleSuccess, | ||
| 120 | + setProps | ||
| 121 | + ); | ||
| 122 | + nextTick(() => { | ||
| 123 | + setProps(selectionOptions); | ||
| 121 | }); | 124 | }); |
| 122 | 125 | ||
| 123 | function handleCreate() { | 126 | function handleCreate() { |
| @@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
| 43 | </div> | 43 | </div> |
| 44 | </template> | 44 | </template> |
| 45 | <script lang="ts"> | 45 | <script lang="ts"> |
| 46 | - import { defineComponent } from 'vue'; | 46 | + import { defineComponent, nextTick } from 'vue'; |
| 47 | 47 | ||
| 48 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; | 48 | import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
| 49 | import { sysDictPage, deleteDict } from '/@/api/system/dict'; | 49 | import { sysDictPage, deleteDict } from '/@/api/system/dict'; |
| @@ -63,11 +63,8 @@ | @@ -63,11 +63,8 @@ | ||
| 63 | setup() { | 63 | setup() { |
| 64 | const [registerDrawer, { openDrawer: openDrawer }] = useDrawer(); | 64 | const [registerDrawer, { openDrawer: openDrawer }] = useDrawer(); |
| 65 | const [registerItemDrawer, { openDrawer: openItemDrawer }] = useDrawer(); | 65 | const [registerItemDrawer, { openDrawer: openItemDrawer }] = useDrawer(); |
| 66 | - const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete( | ||
| 67 | - deleteDict, | ||
| 68 | - handleSuccess | ||
| 69 | - ); | ||
| 70 | - const [registerTable, { reload }] = useTable({ | 66 | + |
| 67 | + const [registerTable, { reload, setProps }] = useTable({ | ||
| 71 | title: '字典配置列表', | 68 | title: '字典配置列表', |
| 72 | api: sysDictPage, | 69 | api: sysDictPage, |
| 73 | columns, | 70 | columns, |
| @@ -86,7 +83,14 @@ | @@ -86,7 +83,14 @@ | ||
| 86 | slots: { customRender: 'action' }, | 83 | slots: { customRender: 'action' }, |
| 87 | fixed: 'right', | 84 | fixed: 'right', |
| 88 | }, | 85 | }, |
| 89 | - ...selectionOptions, | 86 | + }); |
| 87 | + const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete( | ||
| 88 | + deleteDict, | ||
| 89 | + handleSuccess, | ||
| 90 | + setProps | ||
| 91 | + ); | ||
| 92 | + nextTick(() => { | ||
| 93 | + setProps(selectionOptions); | ||
| 90 | }); | 94 | }); |
| 91 | 95 | ||
| 92 | function handleCreate() { | 96 | function handleCreate() { |
| @@ -50,11 +50,8 @@ | @@ -50,11 +50,8 @@ | ||
| 50 | const [registerModal, { openDrawer }] = useDrawer(); | 50 | const [registerModal, { openDrawer }] = useDrawer(); |
| 51 | const { t } = useI18n(); //加载国际化 | 51 | const { t } = useI18n(); //加载国际化 |
| 52 | const getI18n = computed(() => t('routes.common.organization.toolCreateOrganization')); | 52 | const getI18n = computed(() => t('routes.common.organization.toolCreateOrganization')); |
| 53 | - const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete( | ||
| 54 | - delOrganization, | ||
| 55 | - handleSuccess | ||
| 56 | - ); | ||
| 57 | - const [registerTable, { reload, expandAll }] = useTable({ | 53 | + |
| 54 | + const [registerTable, { reload, expandAll, setProps }] = useTable({ | ||
| 58 | title: t('routes.common.organization.toolOrganizationList'), | 55 | title: t('routes.common.organization.toolOrganizationList'), |
| 59 | api: getOrganizationList, | 56 | api: getOrganizationList, |
| 60 | columns, | 57 | columns, |
| @@ -73,7 +70,15 @@ | @@ -73,7 +70,15 @@ | ||
| 73 | slots: { customRender: 'action' }, | 70 | slots: { customRender: 'action' }, |
| 74 | fixed: 'right', | 71 | fixed: 'right', |
| 75 | }, | 72 | }, |
| 76 | - ...selectionOptions, | 73 | + }); |
| 74 | + | ||
| 75 | + const { hasBatchDelete, handleDeleteOrBatchDelete, selectionOptions } = useBatchDelete( | ||
| 76 | + delOrganization, | ||
| 77 | + handleSuccess, | ||
| 78 | + setProps | ||
| 79 | + ); | ||
| 80 | + nextTick(() => { | ||
| 81 | + setProps(selectionOptions); | ||
| 77 | }); | 82 | }); |
| 78 | /** | 83 | /** |
| 79 | * 获得删除提示框的文字 | 84 | * 获得删除提示框的文字 |
| @@ -16,7 +16,7 @@ | @@ -16,7 +16,7 @@ | ||
| 16 | <TableAction | 16 | <TableAction |
| 17 | :actions="[ | 17 | :actions="[ |
| 18 | { | 18 | { |
| 19 | - label: '设置该租户为默认', | 19 | + label: '设为默认', |
| 20 | icon: 'ant-design:eye-outlined', | 20 | icon: 'ant-design:eye-outlined', |
| 21 | onClick: handleDefault.bind(null, record), | 21 | onClick: handleDefault.bind(null, record), |
| 22 | ifShow: !record.default, | 22 | ifShow: !record.default, |