Commit 3e78ce0d8eef2f6675aa7165a7d004d07691c182
Merge branch 'fix/data-flow-transfer-table' into 'main_dev'
Fix/data flow transfer table See merge request yunteng/thingskit-front!931
Showing
2 changed files
with
31 additions
and
14 deletions
@@ -91,6 +91,7 @@ | @@ -91,6 +91,7 @@ | ||
91 | pendingTotalList.value = list; | 91 | pendingTotalList.value = list; |
92 | return unref(pendingTotalList); | 92 | return unref(pendingTotalList); |
93 | }, | 93 | }, |
94 | + pagination: { hideOnSinglePage: false }, | ||
94 | rowSelection: { | 95 | rowSelection: { |
95 | type: 'checkbox', | 96 | type: 'checkbox', |
96 | getCheckboxProps: (record: DeviceModel) => { | 97 | getCheckboxProps: (record: DeviceModel) => { |
@@ -132,7 +133,8 @@ | @@ -132,7 +133,8 @@ | ||
132 | const { name = '', deviceType = '' } = params || {}; | 133 | const { name = '', deviceType = '' } = params || {}; |
133 | const items = unref(selectedTotalList).filter((item) => { | 134 | const items = unref(selectedTotalList).filter((item) => { |
134 | return ( | 135 | return ( |
135 | - item.name.toUpperCase().includes(name.toUpperCase()) && | 136 | + (item.name.toUpperCase().includes(name.toUpperCase()) || |
137 | + item.alias?.toUpperCase().includes(name.toUpperCase())) && | ||
136 | item.deviceType.toUpperCase().includes(deviceType.toUpperCase()) | 138 | item.deviceType.toUpperCase().includes(deviceType.toUpperCase()) |
137 | ); | 139 | ); |
138 | }); | 140 | }); |
@@ -186,7 +188,13 @@ | @@ -186,7 +188,13 @@ | ||
186 | const handleRemoveSelected = () => { | 188 | const handleRemoveSelected = () => { |
187 | const { primaryKey } = props; | 189 | const { primaryKey } = props; |
188 | const selectedIds = unref(selectedConfirmQueue).map((selected) => selected[primaryKey]); | 190 | const selectedIds = unref(selectedConfirmQueue).map((selected) => selected[primaryKey]); |
189 | - remove(unref(selectedTotalList), (item) => selectedIds.includes(item[primaryKey])); | 191 | + remove(unref(selectedTotalList), (item) => { |
192 | + const flag = selectedIds.includes(item[primaryKey]); | ||
193 | + if (flag) { | ||
194 | + pendingTableActionType.deleteSelectRowByKey(item[primaryKey]); | ||
195 | + } | ||
196 | + return flag; | ||
197 | + }); | ||
190 | 198 | ||
191 | handleTriggerUpdateValue(); | 199 | handleTriggerUpdateValue(); |
192 | 200 | ||
@@ -195,9 +203,15 @@ | @@ -195,9 +203,15 @@ | ||
195 | selectedTableActionType.reload(); | 203 | selectedTableActionType.reload(); |
196 | }; | 204 | }; |
197 | 205 | ||
198 | - const handleCheckoutPanel = async () => { | ||
199 | - await nextTick(); | ||
200 | - selectedTableActionType.reload(); | 206 | + const handleCheckoutPanel = async (key: Active) => { |
207 | + if (key === Active.PENDING) { | ||
208 | + pendingTableActionType.setTableData([]); | ||
209 | + await nextTick(); | ||
210 | + pendingTableActionType.setTableData(unref(pendingTotalList)); | ||
211 | + } else { | ||
212 | + await nextTick(); | ||
213 | + selectedTableActionType.reload(); | ||
214 | + } | ||
201 | }; | 215 | }; |
202 | 216 | ||
203 | const handleOpenModal = async () => { | 217 | const handleOpenModal = async () => { |
@@ -327,15 +341,8 @@ | @@ -327,15 +341,8 @@ | ||
327 | background-color: #fff; | 341 | background-color: #fff; |
328 | } | 342 | } |
329 | 343 | ||
330 | - .transfer-table-disabled-row { | ||
331 | - :deep(.ant-checkbox) { | ||
332 | - cursor: not-allowed; | ||
333 | - | ||
334 | - .ant-checkbox-inner { | ||
335 | - background-color: #f5f5f5; | ||
336 | - border-color: #d9d9d9 !important; | ||
337 | - } | ||
338 | - } | 344 | + .ant-table-placeholder { |
345 | + height: auto !important; | ||
339 | } | 346 | } |
340 | } | 347 | } |
341 | </style> | 348 | </style> |
@@ -3,6 +3,7 @@ import { findDictItemByCode } from '/@/api/system/dict'; | @@ -3,6 +3,7 @@ import { findDictItemByCode } from '/@/api/system/dict'; | ||
3 | import { getDeviceProfile } from '/@/api/alarm/position'; | 3 | import { getDeviceProfile } from '/@/api/alarm/position'; |
4 | import { BasicInfoFormField, DataSourceType } from '../enum'; | 4 | import { BasicInfoFormField, DataSourceType } from '../enum'; |
5 | import { DeviceRecord } from '/@/api/device/model/deviceModel'; | 5 | import { DeviceRecord } from '/@/api/device/model/deviceModel'; |
6 | +import { useMessage } from '/@/hooks/web/useMessage'; | ||
6 | 7 | ||
7 | export const stepConfig = ['选择流转方式', '完善配置参数']; | 8 | export const stepConfig = ['选择流转方式', '完善配置参数']; |
8 | 9 | ||
@@ -33,6 +34,7 @@ export const modelFormPublicConfig = { | @@ -33,6 +34,7 @@ export const modelFormPublicConfig = { | ||
33 | showSubmitButton: false, | 34 | showSubmitButton: false, |
34 | }; | 35 | }; |
35 | 36 | ||
37 | +const { createMessage } = useMessage(); | ||
36 | export const modeForm = (disabled: boolean): FormSchema[] => { | 38 | export const modeForm = (disabled: boolean): FormSchema[] => { |
37 | return [ | 39 | return [ |
38 | { | 40 | { |
@@ -113,6 +115,14 @@ export const modeForm = (disabled: boolean): FormSchema[] => { | @@ -113,6 +115,14 @@ export const modeForm = (disabled: boolean): FormSchema[] => { | ||
113 | return { convertConfigId, deviceProfileIds }; | 115 | return { convertConfigId, deviceProfileIds }; |
114 | }, | 116 | }, |
115 | transformValue: handleGroupDevice, | 117 | transformValue: handleGroupDevice, |
118 | + openModalValidate: () => { | ||
119 | + const values = getFieldsValue(); | ||
120 | + const deviceProfileIds = Reflect.get(values, BasicInfoFormField.DATA_SOURCE_PRODUCT); | ||
121 | + if (!deviceProfileIds || !deviceProfileIds?.length) { | ||
122 | + createMessage.warning('请选择数据源设备'); | ||
123 | + } | ||
124 | + return deviceProfileIds && deviceProfileIds?.length; | ||
125 | + }, | ||
116 | }; | 126 | }; |
117 | }, | 127 | }, |
118 | }, | 128 | }, |