Browse Source

filters解析/默认命名调整

zhuth 7 years ago
parent
commit
5369a8e9f4
1 changed files with 4 additions and 19 deletions
  1. 4 19
      src/models/chartDesigner.js

+ 4 - 19
src/models/chartDesigner.js

@@ -13,32 +13,17 @@ function getBodyFilters(filters) {
             symbol: operator,
             value: value1
         };
-        if(type === 'string' || type === 'index') {
-            if(operator === 'null' || operator === 'notNull') {
-            }else {
-                bodyFilter['value'] = value1;
-            }
-        }else if(type === 'scale') {
-            if(operator === 'null' || operator === 'notNull') {
-            }else if(operator === 'between') {
-                bodyFilter['value'] = value1 + ',' + value2;
-            }else {
-            }
+        if(type === 'scale' && operator === 'between') {
+            bodyFilter['value'] = value1 + ',' + value2;
         }else if(type === 'time') {
             let v1 = dateFormat(new Date(value1),'yyyy-MM-dd hh:mm:ss');
             let v2 = dateFormat(new Date(value2),'yyyy-MM-dd hh:mm:ss');
 
-            if(operator === 'null' || operator === 'notNull') {
-            }else if(operator === 'between') {
+            if(operator === 'between') {
                 bodyFilter['value'] = v1 + ',' + v2;
             }else {
                 bodyFilter['value'] = v1;
             }
-        }else if(type === 'categorical') {
-            if(operator === 'null' || operator === 'notNull') {
-            }else {
-            }
-        }else {
         }
         return bodyFilter;
     }); 
@@ -195,7 +180,7 @@ export default {
                 const { baseConfig } = chartDesigner;
 
                 let body = {
-                    chartName: dataSource.name + '(未命名)',
+                    chartName: dataSource.name + '_未命名',
                     dataId: baseConfig.dataSource,
                     groupBy: baseConfig.groupBy && baseConfig.groupBy.key ? [{
                         columnName: baseConfig.groupBy.key,