From e353a6986a0ec4aa780ffdc333073377b46aeaa8 Mon Sep 17 00:00:00 2001 From: xu_lw Date: Tue, 10 Sep 2019 13:07:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E5=AD=97?= =?UTF-8?q?=E5=85=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- console-web/src/utils/dict.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/console-web/src/utils/dict.js b/console-web/src/utils/dict.js index f796cd0c..cc6fe174 100644 --- a/console-web/src/utils/dict.js +++ b/console-web/src/utils/dict.js @@ -14,7 +14,7 @@ var storage = { } const dict = { - flag: false, + flags: [], formatter: function(row, column, cellValue, index) { if (cellValue == null || cellValue === '') { return '' @@ -24,7 +24,7 @@ const dict = { name = column.property } let data = storage.get(name) - console.log('data1:' + data) + // console.log('data1:' + name + '=' + data) if (!data) { dict.getHlpData(name) @@ -34,7 +34,7 @@ const dict = { if (!data.hasOwnProperty(cellValue)) { return cellValue } - console.log('data2:' + data[cellValue]) + // console.log('data2:' + name + '=' + data[cellValue]) return data[cellValue] }, @@ -45,15 +45,15 @@ const dict = { } let data2 = [] for (var key in data) { - data2.push({value: key, label: data[key]}) + data2.push({ value: key, label: data[key] }) } return data2 }, getHlpData: function(name) { - if (dict.flag) { + if (dict.flags[name]) { return } - dict.flag = true + dict.flags[name] = true if (storage.get(name)) { return @@ -63,10 +63,10 @@ const dict = { url: httpRequest.adornUrl('/buipubbpc1/buiHlpQueryByName.do'), method: 'get', params: httpRequest.adornParams({ - 'name': name + name: name }) - }).then(({data}) => { - dict.flag = false + }).then(({ data }) => { + dict.flags[name] = false if (isGDASucc(data)) { if (data.data) { let data1 = {} @@ -88,7 +88,6 @@ const dict = { remove: function(name) { storage.remove(name) } - } -export default dict \ No newline at end of file +export default dict