소스 검색

[Feat 0000] 更新配置表格的配置逻辑使配置优先级更高,更新静态配置并修复请求相关问题

houzekong 1 주 전
부모
커밋
4c85da8fa1

+ 1 - 1
src/views/vent/deviceManager/configurationTable/adapters.ts

@@ -5,7 +5,7 @@ import { ModuleData, ShowStyle } from './types';
 export function parseFormDataToParams(formData: Record<string, number | string | undefined>) {
   const params = {};
   forEach(formData, (v: string | undefined, k) => {
-    if (!v) return;
+    if (v === undefined) return;
     return set(params, k, v);
   });
 

+ 0 - 2
src/views/vent/deviceManager/configurationTable/configuration.api.ts

@@ -58,7 +58,5 @@ export const deleteById = (params, handleSuccess) => {
 export const saveOrUpdate = (formData: Record<string, number | string | undefined>, isUpdate) => {
   const url = isUpdate ? Api.edit : Api.save;
   const params = parseFormDataToParams(formData);
-  console.log('debug', params);
-  // return Promise.reject();
   return defHttp.post({ url: url, params });
 };

+ 14 - 14
src/views/vent/home/configurable/configurable.data.bd.ts

@@ -134,7 +134,7 @@ export const testConfigBDDust: Config[] = [
   {
     deviceType: 'dustManageInfo',
     moduleName: '工作面风险监测',
-    pageType: '',
+    pageType: 'BD_dust',
     moduleData: {
       header: {
         show: false,
@@ -242,7 +242,7 @@ export const testConfigBDDust: Config[] = [
   {
     deviceType: '',
     moduleName: '喷雾设备信息',
-    pageType: '',
+    pageType: 'BD_dust',
     moduleData: {
       header: {
         show: false,
@@ -311,7 +311,7 @@ export const testConfigBDDust: Config[] = [
   {
     deviceType: 'dustDustGraph',
     moduleName: '综放工作面粉尘浓度',
-    pageType: '',
+    pageType: 'BD_dust',
     moduleData: {
       header: {
         show: true,
@@ -374,7 +374,7 @@ export const testConfigBDDust: Config[] = [
   {
     deviceType: 'atomObj',
     moduleName: '智能喷雾降尘装置',
-    pageType: '',
+    pageType: 'BD_dust',
     moduleData: {
       header: {
         show: false,
@@ -449,7 +449,7 @@ export const testConfigBDDust: Config[] = [
   {
     deviceType: '',
     moduleName: '煤尘爆炸性',
-    pageType: '',
+    pageType: 'BD_dust',
     moduleData: {
       header: {
         show: false,
@@ -516,7 +516,7 @@ export const testConfigBDDust: Config[] = [
   {
     deviceType: 'devGbsb',
     moduleName: '隔爆设施管理台账',
-    pageType: '',
+    pageType: 'BD_dust',
     moduleData: {
       header: {
         show: false,
@@ -5546,7 +5546,7 @@ export const testConfigBDFire: Config[] = [
   {
     deviceType: 'fireManageInfo',
     moduleName: '重点区域风险监测',
-    pageType: '',
+    pageType: 'BD_fire',
     moduleData: {
       header: {
         show: false,
@@ -5638,7 +5638,7 @@ export const testConfigBDFire: Config[] = [
   {
     deviceType: '',
     moduleName: '开采煤层自燃发火特性',
-    pageType: '',
+    pageType: 'BD_fire',
     moduleData: {
       header: {
         show: false,
@@ -5717,7 +5717,7 @@ export const testConfigBDFire: Config[] = [
   {
     deviceType: 'pdArray',
     moduleName: '带式输送机防灭火监控系统',
-    pageType: '',
+    pageType: 'BD_fire',
     moduleData: {
       header: {
         show: true,
@@ -5804,7 +5804,7 @@ export const testConfigBDFire: Config[] = [
   {
     deviceType: 'sgGxObj',
     moduleName: '工作面束管监测',
-    pageType: '',
+    pageType: 'BD_fire',
     moduleData: {
       header: {
         show: true,
@@ -5916,7 +5916,7 @@ export const testConfigBDFire: Config[] = [
   {
     deviceType: 'sgGxObj',
     moduleName: '工作面光纤监测',
-    pageType: '',
+    pageType: 'BD_fire',
     moduleData: {
       header: {
         show: true,
@@ -5979,7 +5979,7 @@ export const testConfigBDFire: Config[] = [
   {
     deviceType: 'obfObj',
     moduleName: '密闭采空区监测区域',
-    pageType: '',
+    pageType: 'BD_fire',
     moduleData: {
       header: {
         show: true,
@@ -6042,7 +6042,7 @@ export const testConfigBDFire: Config[] = [
   {
     deviceType: 'dsArray',
     moduleName: '变电硐室防灭火监控系统',
-    pageType: '',
+    pageType: 'BD_fire',
     moduleData: {
       header: {
         show: true,
@@ -6145,7 +6145,7 @@ export const testConfigBDFire: Config[] = [
   {
     deviceType: 'aqjkArray',
     moduleName: '安全监控系统',
-    pageType: '',
+    pageType: 'BD_fire',
     moduleData: {
       header: {
         show: false,

+ 2 - 1
src/views/vent/home/configurable/hooks/useInit.ts

@@ -49,7 +49,8 @@ export function useInitConfigs() {
     return configs.value
       .map((e) => e.deviceType)
       .filter((e) => {
-        return !isNil(e);
+        // 过滤不为空且 string 有内容的 deviceType
+        return !isNil(e) && !!e.length;
       });
   });