Commit 3c0bb1afb1f871211858a68763b20559715ebaca

Authored by fengtao
1 parent 566f2e3b

pref:优化设备列表产品筛选传数组 地理位置产品筛选传数组 产品跳转筛选传数组

... ... @@ -110,14 +110,14 @@ export const searchFormSchema: FormSchema[] = [
110 110 },
111 111 {
112 112 field: 'deviceProfileId',
113   - label: '产品',
  113 + label: '产品1',
114 114 component: 'ApiSelect',
115 115 colProps: { span: 6 },
116 116 componentProps: () => {
117 117 return {
118 118 showSearch: true,
119 119 labelField: 'name',
120   - valueField: 'id',
  120 + valueField: 'tbProfileId',
121 121 resultField: 'data',
122 122 placeholder: '请选择产品',
123 123 api: deviceProfile,
... ...
... ... @@ -232,6 +232,17 @@
232 232 api: devicePage,
233 233 immediate: immediateStatus.value,
234 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 246 formConfig: {
236 247 labelWidth: 100,
237 248 schemas: searchFormSchema,
... ... @@ -282,7 +293,7 @@
282 293 const { items, total } = await devicePage({
283 294 page: 1,
284 295 pageSize: count.value === 0 ? 10 : count.value,
285   - deviceProfileId: deviceProfileId.value,
  296 + deviceProfileIds: [deviceProfileId.value],
286 297 });
287 298 setPagination({ total });
288 299 nextTick(() => {
... ...
... ... @@ -35,7 +35,7 @@ export const formSchema: FormSchema[] = [
35 35 api: getDeviceProfile,
36 36 placeholder: '请选择产品',
37 37 labelField: 'name',
38   - valueField: 'id',
  38 + valueField: 'tbProfileId',
39 39 },
40 40 },
41 41 {
... ...
... ... @@ -257,6 +257,18 @@
257 257 schemas: formSchema,
258 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 272 showIndexColumn: false,
261 273 useSearchForm: true,
262 274 pagination: {
... ...
... ... @@ -50,7 +50,7 @@
50 50 '?count=' +
51 51 data.deviceCount +
52 52 '&deviceProfileId=' +
53   - data.id
  53 + data.tbProfileId
54 54 );
55 55 },
56 56 },
... ...