Commit b53eaa569720e9c6f7eb712e3f3a652b2b21d217

Authored by xp.Huang
2 parents 2f638393 07b5fc75

Merge branch 'local_dev_ft' into 'main'

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

See merge request huang/yun-teng-iot-front!466
@@ -117,7 +117,7 @@ export const searchFormSchema: FormSchema[] = [ @@ -117,7 +117,7 @@ export const searchFormSchema: FormSchema[] = [
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,21 @@ @@ -232,6 +232,21 @@
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 + console.log(deviceProfileId);
  238 + const obj = {
  239 + ...params,
  240 + ...{
  241 + deviceProfileIds:
  242 + deviceProfileId === undefined || deviceProfileId === null || deviceProfileId == ''
  243 + ? null
  244 + : [deviceProfileId],
  245 + },
  246 + };
  247 + delete obj.deviceProfileId;
  248 + return obj;
  249 + },
235 formConfig: { 250 formConfig: {
236 labelWidth: 100, 251 labelWidth: 100,
237 schemas: searchFormSchema, 252 schemas: searchFormSchema,
@@ -282,7 +297,12 @@ @@ -282,7 +297,12 @@
282 const { items, total } = await devicePage({ 297 const { items, total } = await devicePage({
283 page: 1, 298 page: 1,
284 pageSize: count.value === 0 ? 10 : count.value, 299 pageSize: count.value === 0 ? 10 : count.value,
285 - deviceProfileId: deviceProfileId.value, 300 + deviceProfileIds:
  301 + deviceProfileId.value === undefined ||
  302 + deviceProfileId.value === null ||
  303 + deviceProfileId.value == ''
  304 + ? null
  305 + : [deviceProfileId.value],
286 }); 306 });
287 setPagination({ total }); 307 setPagination({ total });
288 nextTick(() => { 308 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: {
@@ -50,7 +50,7 @@ @@ -50,7 +50,7 @@
50 '?count=' + 50 '?count=' +
51 data.deviceCount + 51 data.deviceCount +
52 '&deviceProfileId=' + 52 '&deviceProfileId=' +
53 - data.id 53 + data.tbProfileId
54 ); 54 );
55 }, 55 },
56 }, 56 },
@@ -235,6 +235,21 @@ export const step2Schemas: FormSchema[] = [ @@ -235,6 +235,21 @@ export const step2Schemas: FormSchema[] = [
235 }, 235 },
236 ]; 236 ];
237 237
  238 +const deviceTypeStatic = [
  239 + {
  240 + key: 'DIRECT_CONNECTION',
  241 + value: '直连设备',
  242 + },
  243 + {
  244 + key: 'GATEWAY',
  245 + value: '网关设备',
  246 + },
  247 + {
  248 + key: 'SENSOR',
  249 + value: '网关子设备',
  250 + },
  251 +];
  252 +
238 export const columns: BasicColumn[] = [ 253 export const columns: BasicColumn[] = [
239 { 254 {
240 title: '配置图片', //图标 255 title: '配置图片', //图标
@@ -248,6 +263,14 @@ export const columns: BasicColumn[] = [ @@ -248,6 +263,14 @@ export const columns: BasicColumn[] = [
248 width: 120, 263 width: 120,
249 }, 264 },
250 { 265 {
  266 + title: '设备类型',
  267 + dataIndex: 'deviceType',
  268 + width: 90,
  269 + format: (text) => {
  270 + return deviceTypeStatic.find((f) => f.key === text)!.value;
  271 + },
  272 + },
  273 + {
251 title: '配置类型', 274 title: '配置类型',
252 dataIndex: 'type', 275 dataIndex: 'type',
253 width: 90, 276 width: 90,