Skip to content

Commit ca5350c

Browse files
authored
perf: update lodash version
1 parent 9046245 commit ca5350c

File tree

13 files changed

+311
-379
lines changed

13 files changed

+311
-379
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM jumpserver/lina-base:20250910_084112 AS stage-build
1+
FROM jumpserver/lina-base:20251030_055624 AS stage-build
22

33
ARG VERSION
44
ENV VERSION=$VERSION

package.json

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@
4141
"deepmerge": "^4.2.2",
4242
"dompurify": "^3.2.4",
4343
"echarts": "4.7.0",
44-
"element-ui": "^2.15.14",
45-
"elementui-lts": "^2.16.0",
44+
"element-ui": "https://github.com/jumpserver-dev/element/releases/download/v2.15.15/jumpserver-element-ui-2.15.15.tgz",
4645
"eslint-plugin-html": "^6.0.0",
4746
"highlight.js": "^11.9.0",
4847
"install": "^0.13.0",
@@ -52,17 +51,6 @@
5251
"less": "^3.10.3",
5352
"less-loader": "^5.0.0",
5453
"lodash": "^4.17.21",
55-
"lodash.clonedeep": "^4.5.0",
56-
"lodash.frompairs": "^4.0.1",
57-
"lodash.get": "^4.4.2",
58-
"lodash.has": "^4.5.2",
59-
"lodash.includes": "^4.3.0",
60-
"lodash.isempty": "^4.4.0",
61-
"lodash.isequal": "^4.5.0",
62-
"lodash.isplainobject": "^4.0.6",
63-
"lodash.set": "^4.3.2",
64-
"lodash.topairs": "^4.3.0",
65-
"lodash.values": "^4.3.0",
6654
"markdown-it": "^13.0.2",
6755
"markdown-it-link-attributes": "^4.0.1",
6856
"moment": "^2.29.4",

src/components/Table/ListTable/TableAction/index.vue

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,11 @@ export default {
8686
},
8787
datePick: {
8888
type: Function,
89-
default: (val) => {
90-
}
89+
default: val => {}
9190
},
9291
searchTable: {
9392
type: Function,
94-
default: (val) => {
95-
}
93+
default: val => {}
9694
},
9795
selectedRows: {
9896
type: Array,
@@ -153,7 +151,7 @@ export default {
153151
}
154152
</script>
155153

156-
<style lang='scss' scoped>
154+
<style lang="scss" scoped>
157155
$innerHeight: 28px;
158156
$headerHeight: 30px;
159157
@@ -239,5 +237,4 @@ $headerHeight: 30px;
239237
display: block;
240238
padding: 5px 20px;
241239
}
242-
243240
</style>

src/components/Table/TagSearch/index.vue

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
closable
1717
size="small"
1818
type="info"
19-
@click="handleTagClick(v,k)"
19+
@click="handleTagClick(v, k)"
2020
@close.stop="handleTagClose(k)"
2121
>
2222
<strong v-if="v.label">{{ v.label + ':' }}</strong>
@@ -40,7 +40,6 @@
4040
/>
4141
<span :class="isFocus ? 'is-focus ' : ''" class="keydown-focus">/</span>
4242
</div>
43-
4443
</template>
4544

4645
<script>
@@ -49,8 +48,7 @@ export default {
4948
props: {
5049
config: {
5150
type: Object,
52-
default: () => {
53-
}
51+
default: () => {}
5452
},
5553
options: {
5654
type: Array,
@@ -90,13 +88,14 @@ export default {
9088
},
9189
filterMaps() {
9290
const data = {}
91+
const keyword = 'q'
9392
for (let key in this.filterTags) {
9493
const value = this.filterTags[key]['value']
9594
if (key === '') {
96-
key = 'search'
95+
key = keyword
9796
}
98-
if (key.startsWith('search')) {
99-
data['search'] = (data.search ? data.search + ',' : '') + value
97+
if (key.startsWith(keyword)) {
98+
data[keyword] = (data[keyword] ? data[keyword] + ',' : '') + value
10099
} else {
101100
data[key] = value
102101
}
@@ -138,7 +137,7 @@ export default {
138137
this.emptyCount = 1
139138
}
140139
},
141-
'$route'(to, from) {
140+
$route(to, from) {
142141
if (from.query !== to.query) {
143142
this.filterTags = {}
144143
if (to.query && Object.keys(to.query).length) {
@@ -169,7 +168,7 @@ export default {
169168
// 获取url中的查询条件,判断是不是包含在当前查询条件里
170169
checkInTableColumns(options) {
171170
const searchFieldOptions = {}
172-
const queryInfoValues = options.map((i) => i.value)
171+
const queryInfoValues = options.map(i => i.value)
173172
const routeQuery = this.getUrlQuery ? this.$route?.query : {}
174173
const routeQueryKeysLength = Object.keys(routeQuery).length
175174
if (routeQueryKeysLength < 1) return searchFieldOptions

src/i18n/i18n.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// i18n.js
22
import Vue from 'vue'
3-
import locale from 'elementui-lts/lib/locale'
3+
import locale from 'element-ui/lib/locale'
44
import VueI18n from 'vue-i18n'
55
import messages from './langs'
66
import date from './date'

src/i18n/langs/index.js

Lines changed: 36 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,44 @@
1-
import zhLocale from 'elementui-lts/lib/locale/lang/zh-CN'
2-
import zhTWLocale from 'elementui-lts/lib/locale/lang/zh-TW'
3-
import enLocale from 'elementui-lts/lib/locale/lang/en'
4-
import jaLocale from 'elementui-lts/lib/locale/lang/ja'
5-
import ptBrLocale from 'elementui-lts/lib/locale/lang/pt-br'
6-
import esLocale from 'elementui-lts/lib/locale/lang/es'
7-
import ruLocale from 'elementui-lts/lib/locale/lang/ru-RU'
8-
import koLocale from 'elementui-lts/lib/locale/lang/ko'
9-
import viLocale from 'elementui-lts/lib/locale/lang/vi'
101
import zh from './zh.json'
11-
import zhHant from './zh_hant.json'
2+
import zh_hant from './zh_hant.json'
123
import en from './en.json'
134
import ja from './ja.json'
145

15-
const messages = {
16-
zh: {
17-
...zhLocale,
18-
...zh
19-
},
20-
zh_hant: {
21-
...zhTWLocale,
22-
...zhHant
23-
},
24-
en: {
25-
...enLocale,
26-
...en
27-
},
28-
ja: {
29-
...jaLocale,
30-
...ja
31-
},
32-
pt_br: {
33-
...ptBrLocale
34-
},
35-
es: {
36-
...esLocale
37-
},
38-
ru: {
39-
...ruLocale
40-
},
41-
ko: {
42-
...koLocale
43-
},
44-
vi: {
45-
...viLocale
6+
// Map app locales to Element-UI locale file names
7+
const elementLocaleNameByAppLocale = {
8+
zh: 'zh-CN',
9+
zh_hant: 'zh-TW',
10+
en: 'en',
11+
ja: 'ja',
12+
pt_br: 'pt-br',
13+
es: 'es',
14+
ru: 'ru-RU',
15+
ko: 'ko',
16+
vi: 'vi'
17+
}
18+
19+
function loadElementLocale(localeName) {
20+
try {
21+
// eslint-disable-next-line import/no-dynamic-require, global-require
22+
const mod = require(`element-ui/lib/locale/lang/${localeName}`)
23+
return (mod && (mod.default || mod)) || {}
24+
} catch (e) {
25+
return {}
4626
}
4727
}
4828

29+
const appLocaleMessages = {
30+
zh,
31+
zh_hant,
32+
en,
33+
ja
34+
}
35+
36+
const messages = Object.keys(elementLocaleNameByAppLocale).reduce((acc, appLocale) => {
37+
const elementLocaleName = elementLocaleNameByAppLocale[appLocale]
38+
const elementLocale = loadElementLocale(elementLocaleName)
39+
const appMessages = appLocaleMessages[appLocale] || {}
40+
acc[appLocale] = { ...elementLocale, ...appMessages }
41+
return acc
42+
}, {})
43+
4944
export default messages

src/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Vue from 'vue'
2-
import ElementUI from 'elementui-lts'
2+
import ElementUI from 'element-ui'
33
import locale from 'elementLocale'
44
import '@/styles/index.scss' // global css
55
import App from './App'

0 commit comments

Comments
 (0)