Commit 3c0bb1afb1f871211858a68763b20559715ebaca
1 parent
566f2e3b
pref:优化设备列表产品筛选传数组 地理位置产品筛选传数组 产品跳转筛选传数组
Showing
5 changed files
with
28 additions
and
5 deletions
@@ -110,14 +110,14 @@ export const searchFormSchema: FormSchema[] = [ | @@ -110,14 +110,14 @@ export const searchFormSchema: FormSchema[] = [ | ||
110 | }, | 110 | }, |
111 | { | 111 | { |
112 | field: 'deviceProfileId', | 112 | field: 'deviceProfileId', |
113 | - label: '产品', | 113 | + label: '产品1', |
114 | component: 'ApiSelect', | 114 | component: 'ApiSelect', |
115 | colProps: { span: 6 }, | 115 | colProps: { span: 6 }, |
116 | componentProps: () => { | 116 | componentProps: () => { |
117 | return { | 117 | return { |
118 | showSearch: true, | 118 | showSearch: true, |
119 | labelField: 'name', | 119 | labelField: 'name', |
120 | - valueField: 'id', | 120 | + valueField: 'tbProfileId', |
121 | resultField: 'data', | 121 | resultField: 'data', |
122 | placeholder: '请选择产品', | 122 | placeholder: '请选择产品', |
123 | api: deviceProfile, | 123 | api: deviceProfile, |
@@ -232,6 +232,17 @@ | @@ -232,6 +232,17 @@ | ||
232 | api: devicePage, | 232 | api: devicePage, |
233 | immediate: immediateStatus.value, | 233 | immediate: immediateStatus.value, |
234 | columns, | 234 | columns, |
235 | + beforeFetch: (params) => { | ||
236 | + const { deviceProfileId } = params; | ||
237 | + const obj = { | ||
238 | + ...params, | ||
239 | + ...{ | ||
240 | + deviceProfileIds: deviceProfileId === undefined ? null : [deviceProfileId], | ||
241 | + }, | ||
242 | + }; | ||
243 | + delete obj.deviceProfileId; | ||
244 | + return obj; | ||
245 | + }, | ||
235 | formConfig: { | 246 | formConfig: { |
236 | labelWidth: 100, | 247 | labelWidth: 100, |
237 | schemas: searchFormSchema, | 248 | schemas: searchFormSchema, |
@@ -282,7 +293,7 @@ | @@ -282,7 +293,7 @@ | ||
282 | const { items, total } = await devicePage({ | 293 | const { items, total } = await devicePage({ |
283 | page: 1, | 294 | page: 1, |
284 | pageSize: count.value === 0 ? 10 : count.value, | 295 | pageSize: count.value === 0 ? 10 : count.value, |
285 | - deviceProfileId: deviceProfileId.value, | 296 | + deviceProfileIds: [deviceProfileId.value], |
286 | }); | 297 | }); |
287 | setPagination({ total }); | 298 | setPagination({ total }); |
288 | nextTick(() => { | 299 | nextTick(() => { |
@@ -35,7 +35,7 @@ export const formSchema: FormSchema[] = [ | @@ -35,7 +35,7 @@ export const formSchema: FormSchema[] = [ | ||
35 | api: getDeviceProfile, | 35 | api: getDeviceProfile, |
36 | placeholder: '请选择产品', | 36 | placeholder: '请选择产品', |
37 | labelField: 'name', | 37 | labelField: 'name', |
38 | - valueField: 'id', | 38 | + valueField: 'tbProfileId', |
39 | }, | 39 | }, |
40 | }, | 40 | }, |
41 | { | 41 | { |
@@ -257,6 +257,18 @@ | @@ -257,6 +257,18 @@ | ||
257 | schemas: formSchema, | 257 | schemas: formSchema, |
258 | labelAlign: 'left', | 258 | labelAlign: 'left', |
259 | }, | 259 | }, |
260 | + beforeFetch: (params) => { | ||
261 | + const { deviceProfileId } = params; | ||
262 | + const deviceProfileIds = [deviceProfileId]; | ||
263 | + const obj = { | ||
264 | + ...params, | ||
265 | + ...{ | ||
266 | + deviceProfileIds: params?.deviceProfileId === undefined ? null : deviceProfileIds, | ||
267 | + }, | ||
268 | + }; | ||
269 | + delete obj.deviceProfileId; | ||
270 | + return obj; | ||
271 | + }, | ||
260 | showIndexColumn: false, | 272 | showIndexColumn: false, |
261 | useSearchForm: true, | 273 | useSearchForm: true, |
262 | pagination: { | 274 | pagination: { |