Commit 17b966954d0fefefc9146e6c0eeb10fe816a9177
Merge branch 'dev-fix-ww' into 'main_dev'
fix: 修复teambition bug See merge request yunteng/thingskit-front!559
Showing
3 changed files
with
15 additions
and
6 deletions
@@ -50,6 +50,7 @@ export interface DeviceModel { | @@ -50,6 +50,7 @@ export interface DeviceModel { | ||
50 | deviceType: DeviceTypeEnum; | 50 | deviceType: DeviceTypeEnum; |
51 | organizationId: string; | 51 | organizationId: string; |
52 | customerId?: string; | 52 | customerId?: string; |
53 | + alias?: string; | ||
53 | } | 54 | } |
54 | 55 | ||
55 | export interface DeviceProfileModel { | 56 | export interface DeviceProfileModel { |
@@ -76,20 +76,25 @@ export const formSchemas: FormSchema[] = [ | @@ -76,20 +76,25 @@ export const formSchemas: FormSchema[] = [ | ||
76 | try { | 76 | try { |
77 | if (isDevices) { | 77 | if (isDevices) { |
78 | const result = await getDevicesByDeviceIds(data!); | 78 | const result = await getDevicesByDeviceIds(data!); |
79 | - return result.data; | 79 | + return result.data.map((item) => ({ |
80 | + label: item.alias || item.name, | ||
81 | + value: 'tbDeviceId', | ||
82 | + })); | ||
80 | } else { | 83 | } else { |
81 | - return await getMeetTheConditionsDevice({ | 84 | + const result = await getMeetTheConditionsDevice({ |
82 | organizationId, | 85 | organizationId, |
83 | deviceProfileId: data![0], | 86 | deviceProfileId: data![0], |
84 | }); | 87 | }); |
88 | + return result.map((item) => ({ | ||
89 | + label: item.alias || item.name, | ||
90 | + value: 'tbDeviceId', | ||
91 | + })); | ||
85 | } | 92 | } |
86 | } catch (error) { | 93 | } catch (error) { |
87 | return []; | 94 | return []; |
88 | } | 95 | } |
89 | }, | 96 | }, |
90 | mode: 'multiple', | 97 | mode: 'multiple', |
91 | - labelField: 'name', | ||
92 | - valueField: 'tbDeviceId', | ||
93 | ...createPickerSearch(), | 98 | ...createPickerSearch(), |
94 | placeholder: '请选择设备', | 99 | placeholder: '请选择设备', |
95 | getPopupContainer: () => document.body, | 100 | getPopupContainer: () => document.body, |
@@ -33,6 +33,9 @@ | @@ -33,6 +33,9 @@ | ||
33 | submitFunc: async () => { | 33 | submitFunc: async () => { |
34 | getDataSource(); | 34 | getDataSource(); |
35 | }, | 35 | }, |
36 | + resetFunc: async () => { | ||
37 | + getDataSource({}); | ||
38 | + }, | ||
36 | }); | 39 | }); |
37 | 40 | ||
38 | const paginationChange = (page: number, pageSize: number) => { | 41 | const paginationChange = (page: number, pageSize: number) => { |
@@ -54,10 +57,10 @@ | @@ -54,10 +57,10 @@ | ||
54 | 57 | ||
55 | const dataSource = ref<TaskRecordType[]>([]); | 58 | const dataSource = ref<TaskRecordType[]>([]); |
56 | const loading = ref(false); | 59 | const loading = ref(false); |
57 | - const getDataSource = async () => { | 60 | + const getDataSource = async (params?: Recordable) => { |
58 | try { | 61 | try { |
59 | loading.value = true; | 62 | loading.value = true; |
60 | - const params = getFieldsValue(); | 63 | + params = params || getFieldsValue(); |
61 | const { items, total } = await getTaskCenterList({ | 64 | const { items, total } = await getTaskCenterList({ |
62 | page: pagination.current, | 65 | page: pagination.current, |
63 | pageSize: pagination.pageSize, | 66 | pageSize: pagination.pageSize, |