gc_i18n 1.1.6 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/gc_i18n.css +1 -1
- package/lib/gc_i18n.js +545 -533
- package/lib/gc_i18n.umd.cjs +8 -8
- package/package.json +1 -4
- package/packages/components/config.vue +39 -26
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script lang="jsx">
|
|
2
2
|
import _ from "lodash-es";
|
|
3
3
|
import { getAllTranslate, getLanguages, saveTranslate } from "../libs/service";
|
|
4
|
-
import { Message
|
|
5
|
-
import { convertArrayToObject } from "../libs/utils";
|
|
4
|
+
import { Message } from "view-ui-plus";
|
|
6
5
|
|
|
7
6
|
export default {
|
|
8
7
|
data() {
|
|
@@ -31,14 +30,9 @@ export default {
|
|
|
31
30
|
let arr =
|
|
32
31
|
this.type === "pageData"
|
|
33
32
|
? [
|
|
34
|
-
{
|
|
35
|
-
title: "字典键",
|
|
36
|
-
width: 150,
|
|
37
|
-
key: "dictKey"
|
|
38
|
-
},
|
|
39
33
|
{
|
|
40
34
|
title: "状态",
|
|
41
|
-
width:
|
|
35
|
+
width: 80,
|
|
42
36
|
key: "icon",
|
|
43
37
|
fixed: "left",
|
|
44
38
|
render: (h, { row }) => {
|
|
@@ -59,13 +53,19 @@ export default {
|
|
|
59
53
|
</span>
|
|
60
54
|
);
|
|
61
55
|
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
title: "关键词",
|
|
59
|
+
fixed: "left",
|
|
60
|
+
width: 80,
|
|
61
|
+
key: "dictKey"
|
|
62
62
|
}
|
|
63
63
|
]
|
|
64
64
|
: [
|
|
65
65
|
{
|
|
66
|
-
title: "
|
|
66
|
+
title: "状态",
|
|
67
67
|
fixed: "left",
|
|
68
|
-
width:
|
|
68
|
+
width: 80,
|
|
69
69
|
key: "page",
|
|
70
70
|
render: (h, { row }) => {
|
|
71
71
|
return h(
|
|
@@ -74,6 +74,12 @@ export default {
|
|
|
74
74
|
row.page === "common" ? "全局" : row.page
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
title: "关键词",
|
|
80
|
+
fixed: "left",
|
|
81
|
+
width: 80,
|
|
82
|
+
key: "dictKey"
|
|
77
83
|
}
|
|
78
84
|
];
|
|
79
85
|
_.map(this.languages, (lang) => {
|
|
@@ -81,7 +87,6 @@ export default {
|
|
|
81
87
|
|
|
82
88
|
return arr.push({
|
|
83
89
|
title: lang.name,
|
|
84
|
-
fixed: lang.name === "中文" ? "left" : "",
|
|
85
90
|
key,
|
|
86
91
|
render: (h, { row, index }) => {
|
|
87
92
|
const data = row[key];
|
|
@@ -119,6 +124,13 @@ export default {
|
|
|
119
124
|
translationKeys: Array
|
|
120
125
|
},
|
|
121
126
|
methods: {
|
|
127
|
+
inputSearch() {
|
|
128
|
+
if (this.type === "pageData") {
|
|
129
|
+
this.getPageData();
|
|
130
|
+
} else {
|
|
131
|
+
this.search();
|
|
132
|
+
}
|
|
133
|
+
},
|
|
122
134
|
closeModal() {
|
|
123
135
|
this.searchText = "";
|
|
124
136
|
this.type = "pageData";
|
|
@@ -218,12 +230,16 @@ export default {
|
|
|
218
230
|
if (commonData) {
|
|
219
231
|
arr.push({ ...commonData, page: this.name, common: true });
|
|
220
232
|
} else {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
233
|
+
if (this.searchText) {
|
|
234
|
+
return;
|
|
235
|
+
} else {
|
|
236
|
+
arr.push({
|
|
237
|
+
dictKey: key,
|
|
238
|
+
page: this.name,
|
|
239
|
+
"zh-CN": key,
|
|
240
|
+
localhost: true
|
|
241
|
+
});
|
|
242
|
+
}
|
|
227
243
|
}
|
|
228
244
|
}
|
|
229
245
|
});
|
|
@@ -246,6 +262,7 @@ export default {
|
|
|
246
262
|
const res = await getAllTranslate(
|
|
247
263
|
{
|
|
248
264
|
appCode: this.appCode,
|
|
265
|
+
page: "common",
|
|
249
266
|
searchBlur: this.searchText,
|
|
250
267
|
commaSeparatedLangs: _.map(this.languages, "code").toString(),
|
|
251
268
|
firstResult: 0,
|
|
@@ -336,17 +353,14 @@ export default {
|
|
|
336
353
|
></Table
|
|
337
354
|
></TabPane>
|
|
338
355
|
<template #extra>
|
|
339
|
-
<div
|
|
340
|
-
class="extra"
|
|
341
|
-
v-if="type === 'data'"
|
|
342
|
-
>
|
|
356
|
+
<div class="extra">
|
|
343
357
|
<Input
|
|
344
358
|
prefix="ios-search"
|
|
345
359
|
placeholder="请输入搜索内容"
|
|
346
360
|
v-model="searchText"
|
|
347
361
|
clearable
|
|
348
|
-
@on-enter="
|
|
349
|
-
@on-clear="
|
|
362
|
+
@on-enter="inputSearch"
|
|
363
|
+
@on-clear="inputSearch"
|
|
350
364
|
/>
|
|
351
365
|
</div>
|
|
352
366
|
</template>
|
|
@@ -406,9 +420,8 @@ export default {
|
|
|
406
420
|
}
|
|
407
421
|
.gc_i18n_tabs {
|
|
408
422
|
padding-top: 5px;
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
margin-bottom: 1px !important;
|
|
423
|
+
:deep(.ivu-tabs-bar) {
|
|
424
|
+
margin-bottom: 0px !important;
|
|
412
425
|
}
|
|
413
426
|
.ivu-tabs-content {
|
|
414
427
|
position: relative;
|