Преглед на файлове

[Fix 0000] 修复了新历史数据组件查询redis分站设备是仍需选择子设备的问题

houzekong преди 1 месец
родител
ревизия
3388ebd3f1

+ 1 - 1
src/views/vent/comment/history/HistoryTable.vue

@@ -234,7 +234,7 @@
     const formData = form.getFieldsValue();
     const pagination = getPaginationRef() as PaginationProps;
     const params = adaptFormData(props.deviceCode, deviceInfo.value, formData, pagination);
-    if (deviceInfo.value.stationType === 'redis') {
+    if (deviceInfo.value.stationtype === 'redis') {
       return onExportXlsPost(params);
     } else {
       return onExportXls(params);

+ 3 - 3
src/views/vent/comment/history/history.api.ts

@@ -29,7 +29,7 @@ const intervalMap = new Map([
 ]);
 
 export const adaptFormData = (deviceCode: string, deviceInfo: any, formData: any, pagination: PaginationProps) => {
-  if (deviceInfo.stationType === 'redis') {
+  if (deviceInfo.stationtype === 'redis') {
     return {
       pageNum: pagination.current,
       pageSize: pagination.pageSize,
@@ -53,7 +53,7 @@ export const adaptFormData = (deviceCode: string, deviceInfo: any, formData: any
 };
 
 export const list = (deviceCode: string, deviceInfo: any, formData: any, pagination: PaginationProps) => {
-  if (deviceInfo.stationType === 'redis') {
+  if (deviceInfo.stationtype === 'redis') {
     return defHttp.post({
       url: Api.getHistoryData,
       params: adaptFormData(deviceCode, deviceInfo, formData, pagination),
@@ -72,7 +72,7 @@ export const list = (deviceCode: string, deviceInfo: any, formData: any, paginat
 };
 
 export const getExportUrl = (deviceInfo) => {
-  if (deviceInfo.stationType === 'redis') {
+  if (deviceInfo.stationtype === 'redis') {
     return Api.exportHistoryData;
   } else {
     return Api.historydata;

+ 4 - 3
src/views/vent/comment/history/history.data.ts

@@ -12,6 +12,7 @@ import { get } from 'lodash-es';
  */
 export const getDefaultSchemas: (dictOptions: any[], deviceOptions: any[]) => FormSchema[] = (dictOptions: any[], deviceOptions: any[]) => {
   const device = get(deviceOptions, '[0].value', '');
+  const dictcode = get(dictOptions, '[0].value', '');
   const isRedis = get(deviceOptions, '[0].stationtype', 'redis') === 'redis';
   return [
     {
@@ -68,9 +69,9 @@ export const getDefaultSchemas: (dictOptions: any[], deviceOptions: any[]) => Fo
       label: '子设备',
       field: 'deviceNum',
       component: 'Select',
-      required: Boolean(dictOptions.length),
-      show: Boolean(dictOptions.length),
-      defaultValue: dictOptions[0] ? dictOptions[0].value : '',
+      required: isRedis ? false : Boolean(dictOptions.length),
+      show: isRedis ? false : Boolean(dictOptions.length),
+      defaultValue: isRedis ? '' : dictcode,
       componentProps: {
         options: dictOptions,
         // onChange: (e, option) => {