zhuth 6 лет назад
Родитель
Сommit
cde2d00664

+ 2 - 0
src/components/common/listFilter/index.jsx

@@ -101,6 +101,8 @@ class ListFilter extends React.Component {
                 style={{ width: 150 }}
                 value={model.filterLabel || null}
                 loading={fetching}
+                showSearch
+                filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
                 onChange={(value) => {
                     modelName && dispatch({ type: modelName + '/setFilterLabel', label: value ? value : '' });
                     typeof onChangeFilterValue === 'function' && onChangeFilterValue(value)

+ 2 - 2
src/models/dashboardDesigner.js

@@ -4,7 +4,7 @@ import parseChartOption from './parseChartOption'
 import moment from 'moment'
 import URLS from '../constants/url'
 import CHART_TYPE from './chartType.json'
-import { ArrayEquals } from '../utils/baseUtils.js'
+import { arrayEquals } from '../utils/baseUtils.js'
 import Exportor from '../utils/exportor'
 
 /**
@@ -597,7 +597,7 @@ export default {
                     let newDataSourceCodes = nrc.relations.map(r => r.dataSource.code);
                     let newColumns = nrc.relations.map(r => r.column.name);
 
-                    if(!ArrayEquals(oldDataSourceCodes, newDataSourceCodes) || !ArrayEquals(oldColumns, newColumns)) { // 如果改变了数据源或者数据列
+                    if(!arrayEquals(oldDataSourceCodes, newDataSourceCodes) || !arrayEquals(oldColumns, newColumns)) { // 如果改变了数据源或者数据列
                         willRemove = true;
                     }
                    

+ 3 - 3
src/utils/baseUtils.js

@@ -181,13 +181,13 @@ function arrayToTree(data, parent, $id, $pid, $sub) {
     return tree;
 }
 
-function ArrayEquals(arr1, arr2) {
+function arrayEquals(arr1, arr2) {
     if(!arr1 || !arr2) return false;
     if (arr1.length !== arr2.length) return false;
 
     for (var i = 0, l = arr1.length; i < l; i++) {
         if (arr1[i] instanceof Array && arr2[2] instanceof Array) {
-            if (!arr1[i].ArrayEquals(arr2[i]))
+            if (!arr1[i].arrayEquals(arr2[i]))
                 return false;       
         }           
         else if (arr1[i] !== arr2[i]) { 
@@ -274,7 +274,7 @@ function _scientificNotationToString(param) {
 }
 
 ;exports = module.exports = (function(){
-    return { remove, isEqual, getUrlParam, hashcode, delay, dateFormat, arrayToTree, ArrayEquals, deepAssign,
+    return { remove, isEqual, getUrlParam, hashcode, delay, dateFormat, arrayToTree, arrayEquals, deepAssign,
         HexToRGB, RGBToHex, numberFormat
     }
 })();