kz-ui-base 1.0.148 → 1.0.150

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.
@@ -22,12 +22,12 @@
22
22
  size="small"
23
23
  type="primary"
24
24
  @click="handleConfirm"
25
- >{{ confirmText }}
25
+ >{{ _confirmText }}
26
26
  </el-button>
27
27
  <el-button
28
28
  size="small"
29
29
  @click="handleClose"
30
- >{{ cancelText }}
30
+ >{{ _cancelText }}
31
31
  </el-button>
32
32
  </div>
33
33
  </div>
@@ -44,11 +44,11 @@ export default {
44
44
  },
45
45
  confirmText: {
46
46
  type: String,
47
- default: '确定'
47
+ default: ''
48
48
  },
49
49
  cancelText: {
50
50
  type: String,
51
- default: '关闭'
51
+ default: ''
52
52
  },
53
53
  visible: {
54
54
  type: Boolean,
@@ -66,12 +66,25 @@ export default {
66
66
  submitLoading: false
67
67
  }
68
68
  },
69
+ computed: {
70
+ // 确定按钮文本,支持国际化
71
+ _confirmText() {
72
+ return this.confirmText || this.t('component.dialog.confirm') || '确定'
73
+ },
74
+ // 取消按钮文本,支持国际化
75
+ _cancelText() {
76
+ return this.cancelText || this.t('component.dialog.cancel') || '关闭'
77
+ }
78
+ },
69
79
  watch: {
70
80
  visible(val) {
71
81
  this.modalState = val
72
82
  }
73
83
  },
74
84
  methods: {
85
+ t(key) {
86
+ return this.$t(key) || key
87
+ },
75
88
  handleConfirm() {
76
89
  this.$emit('on-confirm')
77
90
  },
@@ -1,6 +1,24 @@
1
1
  import Vue from "vue";
2
+ import zhCN from "element-ui/lib/locale/lang/zh-CN";
3
+ import enUS from "element-ui/lib/locale/lang/en";
4
+ import ElementLocale from "element-ui/lib/locale";
5
+
6
+ // 根据当前语言设置配置 Element UI 语言
7
+ function initElementLocale() {
8
+ const currentLocale = localStorage.getItem("locale") || "zh_CN";
9
+ if (currentLocale === "en_US") {
10
+ ElementLocale.use(enUS);
11
+ } else {
12
+ ElementLocale.use(zhCN);
13
+ }
14
+ }
15
+
16
+ // 初始化 Element UI 语言
17
+ initElementLocale();
2
18
 
3
19
  function makeDialog(option) {
20
+ // 每次创建对话框时重新初始化语言
21
+ initElementLocale();
4
22
  var dom = document.createElement("div");
5
23
  document.getElementsByTagName("body")[0].appendChild(dom);
6
24
  let tpl =
@@ -111,6 +129,8 @@ function makeDialog(option) {
111
129
  return vue;
112
130
  }
113
131
  function makeDrawer(option) {
132
+ // 每次创建抽屉时重新初始化语言
133
+ initElementLocale();
114
134
  var dom = document.createElement("div");
115
135
  document.getElementsByTagName("body")[0].appendChild(dom);
116
136
  let tpl =
@@ -47,9 +47,9 @@
47
47
  type="primary"
48
48
  :loading="setting.submitLoading"
49
49
  @click="submitForm"
50
- >确 定</el-button
50
+ >{{ t('component.dialog.confirm') }}</el-button
51
51
  >
52
- <el-button @click="cancel">取 消</el-button>
52
+ <el-button @click="cancel">{{ t('component.dialog.cancel') }}</el-button>
53
53
  </div>
54
54
  <div class="dialog-footer" v-if="customOpMenus&&customOpMenus.length">
55
55
  <el-button
@@ -241,6 +241,9 @@ export default {
241
241
  console.log("editDialog");
242
242
  },
243
243
  methods: {
244
+ t(key) {
245
+ return this.$t(key) || key
246
+ },
244
247
  //当前绑定实体字段值变更事件
245
248
  onChangeEvent(args) {
246
249
  this.$emit("change", args);
@@ -1,25 +1,13 @@
1
1
  <template>
2
2
  <div class="top-right-btn">
3
3
  <el-row>
4
- <!-- <el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top"
5
- v-if="searchVisible"> -->
6
- <el-button size="mini" type="success" @click="toggleSearch()">
7
- 高级筛选<i class="el-icon-caret-bottom el-icon--right"></i>
8
- </el-button>
9
- <!-- </el-tooltip> -->
10
- <!-- <el-tooltip class="item" effect="dark" content="刷新" placement="top" v-if="refreshVisible">
11
- <el-button size="mini" circle icon="el-icon-refresh" @click="refresh()"/>
12
- </el-tooltip>
13
- <el-tooltip class="item" effect="dark" :content="sortable ? '禁用排序' : '启用排序'" placement="top" v-if="sortVisible">
14
- <el-button size="mini" circle icon="el-icon-sort" @click="toggleSortable()"/>
15
- </el-tooltip>
16
- <el-tooltip class="item" effect="dark" content="显隐列" placement="top" v-if="columns">
17
- <el-button size="mini" circle icon="el-icon-menu" @click="showColumn()"/>
18
- </el-tooltip> -->
4
+ <el-button size="mini" type="success" @click="toggleSearch()">
5
+ {{this.t('common.advancedFilter')}}<i class="el-icon-caret-bottom el-icon--right"></i>
6
+ </el-button>
19
7
  </el-row>
20
8
  <el-dialog :title="title" :visible.sync="open" append-to-body>
21
9
  <el-transfer
22
- :titles="['显示', '隐藏']"
10
+ :titles="[this.t('common.show'), this.t('common.hide')]"
23
11
  v-model="value"
24
12
  :data="columns"
25
13
  @change="dataChange"
@@ -33,11 +21,8 @@ export default {
33
21
  name: "RightToolbar",
34
22
  data() {
35
23
  return {
36
- // 显隐数据
37
24
  value: [],
38
- // 弹出层标题
39
- title: "显示/隐藏",
40
- // 是否显示弹出层
25
+ title: this.t('common.showHide'),
41
26
  sortable: true,
42
27
  open: false
43
28
  }
@@ -64,7 +49,6 @@ export default {
64
49
  }
65
50
  },
66
51
  created() {
67
- // 显隐列初始默认隐藏列
68
52
  for (let item in this.columns) {
69
53
  if (this.columns[item].visible === false) {
70
54
  this.value.push(parseInt(item))
@@ -72,27 +56,22 @@ export default {
72
56
  }
73
57
  },
74
58
  methods: {
75
- // 搜索
76
59
  toggleSearch() {
77
60
  this.$emit("update:showSearch", !this.showSearch)
78
61
  },
79
- // 刷新
80
62
  refresh() {
81
63
  this.$emit("queryTable")
82
64
  },
83
- // 排序
84
65
  toggleSortable() {
85
66
  this.sortable = !this.sortable
86
67
  this.$emit("controlSortable", !this.sortable)
87
68
  },
88
- // 右侧列表元素变化
89
69
  dataChange(data) {
90
70
  for (var item in this.columns) {
91
71
  const key = this.columns[item].key
92
72
  this.columns[item].visible = !data.includes(key)
93
73
  }
94
74
  },
95
- // 打开显隐列dialog
96
75
  showColumn() {
97
76
  this.open = true
98
77
  }
@@ -1,25 +1,13 @@
1
1
  <template>
2
2
  <div class="top-right-btn">
3
3
  <el-row>
4
- <!-- <el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top"
5
- v-if="searchVisible"> -->
6
- <el-button size="mini" type="danger" icon="el-icon-close" @click="toggleSearch()">
7
- 关闭
8
- </el-button>
9
- <!-- </el-tooltip> -->
10
- <!-- <el-tooltip class="item" effect="dark" content="刷新" placement="top" v-if="refreshVisible">
11
- <el-button size="mini" circle icon="el-icon-refresh" @click="refresh()"/>
12
- </el-tooltip>
13
- <el-tooltip class="item" effect="dark" :content="sortable ? '禁用排序' : '启用排序'" placement="top" v-if="sortVisible">
14
- <el-button size="mini" circle icon="el-icon-sort" @click="toggleSortable()"/>
15
- </el-tooltip>
16
- <el-tooltip class="item" effect="dark" content="显隐列" placement="top" v-if="columns">
17
- <el-button size="mini" circle icon="el-icon-menu" @click="showColumn()"/>
18
- </el-tooltip> -->
4
+ <el-button size="mini" type="danger" icon="el-icon-close" @click="toggleSearch()">
5
+ {{this.t('common.close')}}
6
+ </el-button>
19
7
  </el-row>
20
8
  <el-dialog :title="title" :visible.sync="open" append-to-body>
21
9
  <el-transfer
22
- :titles="['显示', '隐藏']"
10
+ :titles="[this.t('common.show'), this.t('common.hide')]"
23
11
  v-model="value"
24
12
  :data="columns"
25
13
  @change="dataChange"
@@ -33,11 +21,8 @@ export default {
33
21
  name: "RightToolbar",
34
22
  data() {
35
23
  return {
36
- // 显隐数据
37
24
  value: [],
38
- // 弹出层标题
39
- title: "显示/隐藏",
40
- // 是否显示弹出层
25
+ title: this.t('common.showHide'),
41
26
  sortable: true,
42
27
  open: false
43
28
  }
@@ -64,7 +49,6 @@ export default {
64
49
  }
65
50
  },
66
51
  created() {
67
- // 显隐列初始默认隐藏列
68
52
  for (let item in this.columns) {
69
53
  if (this.columns[item].visible === false) {
70
54
  this.value.push(parseInt(item))
@@ -72,27 +56,22 @@ export default {
72
56
  }
73
57
  },
74
58
  methods: {
75
- // 搜索
76
59
  toggleSearch() {
77
60
  this.$emit("update:showSearch", !this.showSearch)
78
61
  },
79
- // 刷新
80
62
  refresh() {
81
63
  this.$emit("queryTable")
82
64
  },
83
- // 排序
84
65
  toggleSortable() {
85
66
  this.sortable = !this.sortable
86
67
  this.$emit("controlSortable", !this.sortable)
87
68
  },
88
- // 右侧列表元素变化
89
69
  dataChange(data) {
90
70
  for (var item in this.columns) {
91
71
  const key = this.columns[item].key
92
72
  this.columns[item].visible = !data.includes(key)
93
73
  }
94
74
  },
95
- // 打开显隐列dialog
96
75
  showColumn() {
97
76
  this.open = true
98
77
  }
@@ -28,6 +28,11 @@ service.interceptors.request.use(
28
28
  if (getToken() && !isToken) {
29
29
  config.headers["Authorization"] = "Bearer " + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改
30
30
  }
31
+ if(localStorage.getItem('locale')){
32
+ config.headers["Lang"] = localStorage.getItem('locale');
33
+ }else{
34
+ config.headers["Lang"] = "zh-CN";
35
+ }
31
36
  //添加 forward-to
32
37
  if (configRes && configRes.forwardTo) {
33
38
  config.headers["forward-to"] = configRes.forwardTo;
@@ -36,7 +36,6 @@
36
36
  format="HH:mm"
37
37
  value-format="HH:mm"
38
38
  @change="onChangeEvent"
39
- placeholder="选择时间"
40
39
  >
41
40
  </el-time-picker>
42
41
  </el-form-item>
@@ -63,10 +63,10 @@
63
63
  icon="el-icon-search"
64
64
  size="mini"
65
65
  @click="handleQuery"
66
- >搜索</el-button
67
- >
68
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
69
- >重置</el-button
66
+ >{{ this.t('common.search') }}</el-button
67
+ >
68
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
69
+ >{{ this.t('common.reset') }}</el-button
70
70
  >
71
71
  </el-form-item>
72
72
  </el-form>
@@ -137,12 +137,12 @@
137
137
  align="center"
138
138
  />
139
139
  <el-table-column
140
- v-if="listSetting.isShowIndexColumn != false"
141
- type="index"
142
- label="序号"
143
- width="50"
144
- align="center"
145
- >
140
+ v-if="listSetting.isShowIndexColumn != false"
141
+ type="index"
142
+ :label="this.t('component.table.serialNumber')"
143
+ width="50"
144
+ align="center"
145
+ >
146
146
  <template scope="scope">
147
147
  <span>{{
148
148
  (listQueryParams.pageNum - 1) * listQueryParams.pageSize +
@@ -256,7 +256,7 @@
256
256
  </template>
257
257
 
258
258
  <el-table-column
259
- label="操作"
259
+ :label="this.t('common.operation')"
260
260
  align="center"
261
261
  min-width="160"
262
262
  class-name="small-padding fixed-width"
@@ -323,13 +323,13 @@
323
323
  icon="el-icon-search"
324
324
  size="mini"
325
325
  @click="doubleHandleQuery(dex)"
326
- >搜索</el-button
326
+ >{{ this.t('common.search') }}</el-button
327
327
  >
328
328
  <el-button
329
329
  icon="el-icon-refresh"
330
330
  size="mini"
331
331
  @click="doubleResetQuery(dex)"
332
- >重置</el-button
332
+ >{{ this.t('common.reset') }}</el-button
333
333
  >
334
334
  </el-form-item>
335
335
  </el-form>
@@ -376,7 +376,7 @@
376
376
  <el-table-column
377
377
  v-if="tableSetting[dex].isShowIndexColumn != false"
378
378
  type="index"
379
- label="序号"
379
+ :label="this.t('component.table.serialNumber')"
380
380
  width="50"
381
381
  align="center"
382
382
  >
@@ -498,7 +498,7 @@
498
498
  </template>
499
499
 
500
500
  <el-table-column
501
- label="操作"
501
+ :label="this.t('common.operation')"
502
502
  align="center"
503
503
  min-width="160"
504
504
  class-name="small-padding fixed-width"
@@ -1017,7 +1017,7 @@ export default class doubleBasePageTs extends ListBasePage {
1017
1017
  );
1018
1018
  console.log(this.tableSetting[0].listColumns);
1019
1019
  } else {
1020
- this.msgError("数据错误!");
1020
+ this.msgError(this.t('component.form.dataError'));
1021
1021
  }
1022
1022
  });
1023
1023
  }
@@ -132,10 +132,10 @@
132
132
  icon="el-icon-search"
133
133
  size="mini"
134
134
  @click="handleQuery"
135
- >搜索</el-button
135
+ >{{ this.t('common.search') }}</el-button
136
136
  >
137
137
  <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
138
- >重置</el-button
138
+ >{{ this.t('common.reset') }}</el-button
139
139
  >
140
140
  <AdvancedQuery
141
141
  style="margin-left: 10px"
@@ -284,13 +284,13 @@
284
284
  icon="el-icon-search"
285
285
  size="mini"
286
286
  @click="handleQuery"
287
- >搜索</el-button
287
+ >{{ this.t('common.search') }}</el-button
288
288
  >
289
289
  <el-button
290
290
  icon="el-icon-refresh"
291
291
  size="mini"
292
292
  @click="resetQuery"
293
- >重置</el-button
293
+ >{{ this.t('common.reset') }}</el-button
294
294
  >
295
295
  <AdvancedQueryClose
296
296
  style="
@@ -407,7 +407,7 @@
407
407
  >
408
408
  <el-dropdown>
409
409
  <el-button type="warning" size="mini">
410
- 更多操作<i class="el-icon-arrow-down el-icon--right"></i>
410
+ {{ t('component.list.more_actions') }}<i class="el-icon-arrow-down el-icon--right"></i>
411
411
  </el-button>
412
412
  <el-dropdown-menu slot="dropdown">
413
413
  <template v-for="(opMenu, index) in customOpMenus">
@@ -1237,7 +1237,6 @@
1237
1237
  </printDialog>
1238
1238
  </div>
1239
1239
  </template>
1240
-
1241
1240
  <script lang="ts">
1242
1241
  import { Component, Prop, Vue, Watch } from "vue-property-decorator";
1243
1242
  import {
@@ -1417,7 +1416,7 @@ export default class listBasePage extends Vue {
1417
1416
  opMenus = [
1418
1417
  {
1419
1418
  visable: true,
1420
- text: "添加",
1419
+ text: (this as any).t('common.add'),
1421
1420
  icon: "el-icon-plus",
1422
1421
  permission: "add",
1423
1422
  name: "add",
@@ -1426,7 +1425,7 @@ export default class listBasePage extends Vue {
1426
1425
  },
1427
1426
  {
1428
1427
  visable: true,
1429
- text: "复制",
1428
+ text: (this as any).t('common.copy'),
1430
1429
  icon: "ion-md-copy",
1431
1430
  permission: "add",
1432
1431
  name: "copy",
@@ -1436,7 +1435,7 @@ export default class listBasePage extends Vue {
1436
1435
  },
1437
1436
  {
1438
1437
  visable: true,
1439
- text: "修改",
1438
+ text: (this as any).t('common.update'),
1440
1439
  icon: "el-icon-edit",
1441
1440
  permission: "edit",
1442
1441
  name: "update",
@@ -1446,7 +1445,7 @@ export default class listBasePage extends Vue {
1446
1445
  },
1447
1446
  {
1448
1447
  visable: true,
1449
- text: "删除",
1448
+ text: (this as any).t('common.delete'),
1450
1449
  icon: "el-icon-delete",
1451
1450
  permission: "remove",
1452
1451
  name: "delete",
@@ -1456,7 +1455,7 @@ export default class listBasePage extends Vue {
1456
1455
  },
1457
1456
  {
1458
1457
  visable: true,
1459
- text: "查看",
1458
+ text: (this as any).t('common.detail'),
1460
1459
  icon: "ion-md-information-circle-outline",
1461
1460
  name: "detail",
1462
1461
  isShowText: false,
@@ -1466,7 +1465,7 @@ export default class listBasePage extends Vue {
1466
1465
 
1467
1466
  {
1468
1467
  visable: true,
1469
- text: "导出",
1468
+ text: (this as any).t('common.export'),
1470
1469
  icon: "ion-md-cloud-download",
1471
1470
  name: "export",
1472
1471
  isShowText: false,
@@ -1474,7 +1473,7 @@ export default class listBasePage extends Vue {
1474
1473
  },
1475
1474
  {
1476
1475
  visable: true,
1477
- text: "导入",
1476
+ text: (this as any).t('common.import'),
1478
1477
  icon: "ion-md-cloud-upload",
1479
1478
  permission: "add",
1480
1479
  name: "import",
@@ -1483,7 +1482,7 @@ export default class listBasePage extends Vue {
1483
1482
  },
1484
1483
  {
1485
1484
  visable: false,
1486
- text: "发起审批",
1485
+ text: (this as any).t('system.order.startWf'),
1487
1486
  icon: "el-icon-position",
1488
1487
  permission: "startWf",
1489
1488
  name: "startWf",
@@ -1493,7 +1492,7 @@ export default class listBasePage extends Vue {
1493
1492
  },
1494
1493
  {
1495
1494
  visable: false,
1496
- text: "审批进度",
1495
+ text: (this as any).t('system.order.showWf'),
1497
1496
  icon: "el-icon-view",
1498
1497
  permission: "showWf",
1499
1498
  name: "showWf",
@@ -1506,7 +1505,7 @@ export default class listBasePage extends Vue {
1506
1505
  //{ visable: true, text: "高级搜索", icon: "ion-md-paw", name: "advanceSearch", isShowText: false },
1507
1506
  {
1508
1507
  visable: true,
1509
- text: "打印",
1508
+ text: (this as any).t('system.order.print'),
1510
1509
  icon: "ion-md-print",
1511
1510
  name: "print",
1512
1511
  isShowText: false,
@@ -1515,7 +1514,7 @@ export default class listBasePage extends Vue {
1515
1514
  },
1516
1515
  {
1517
1516
  visable: true,
1518
- text: "高级搜索",
1517
+ text: (this as any).t('system.order.advancedSearch'),
1519
1518
  icon: "ion-md-print",
1520
1519
  name: "search",
1521
1520
  isShowText: false,
@@ -1570,7 +1569,7 @@ export default class listBasePage extends Vue {
1570
1569
  //{ text: `用户账号`, property: "userAccount", visible: true },
1571
1570
  ];
1572
1571
  listSerialNumber = {
1573
- label: "序号",
1572
+ label: '序号',
1574
1573
  width: "50",
1575
1574
  align: "center",
1576
1575
  };
@@ -1667,7 +1666,7 @@ export default class listBasePage extends Vue {
1667
1666
  name: "basic",
1668
1667
  visable: true,
1669
1668
  icon: "ion-plus-round",
1670
- text: "基本信息",
1669
+ text: '基本信息',
1671
1670
  type: "area",
1672
1671
  },
1673
1672
  ];
@@ -1682,8 +1681,8 @@ export default class listBasePage extends Vue {
1682
1681
  editRules = {};
1683
1682
  //编辑界面按钮菜单
1684
1683
  editOpMenus = [
1685
- { name: "save", visable: true, icon: "ion-plus-round", text: "保存" },
1686
- { name: "close", visable: true, icon: "ion-md-create", text: "关闭" },
1684
+ { name: "save", visable: true, icon: "ion-plus-round", text: (this as any).t('common.save') },
1685
+ { name: "close", visable: true, icon: "ion-md-create", text: (this as any).t('common.close') },
1687
1686
  ];
1688
1687
  //编辑界面自定义按钮菜单 - 若无自定义按钮,不需要重写
1689
1688
  editCustomOpMenus = [
@@ -1695,7 +1694,7 @@ export default class listBasePage extends Vue {
1695
1694
  // 是否显示编辑窗口
1696
1695
  isShow: false,
1697
1696
  // 弹出层标题(用户导入)
1698
- title: "导入",
1697
+ title: (this as any).t('common.import'),
1699
1698
  // 是否禁用上传
1700
1699
  isUploading: false,
1701
1700
  // 是否更新已经存在的用户数据
@@ -1712,7 +1711,7 @@ export default class listBasePage extends Vue {
1712
1711
  // 是否显示编辑窗口
1713
1712
  isShow: false,
1714
1713
  // 弹出层标题(用户导入)
1715
- title: "打印模板",
1714
+ title: '打印模版',
1716
1715
  //打印类型
1717
1716
  templateType: "",
1718
1717
  // 保存时是否自动关闭
@@ -1772,6 +1771,11 @@ export default class listBasePage extends Vue {
1772
1771
  (this.$refs.tree as any).filter(val);
1773
1772
  }
1774
1773
 
1774
+ @Watch("listColumns", { deep: true })
1775
+ watchListColumns(newVal, oldVal) {
1776
+ console.log('listColumns 变化:', newVal);
1777
+ }
1778
+
1775
1779
  created() {
1776
1780
  // const coms = [KZ_TextBox]; // 将来如果有其它组件,都可以写到这个数组里
1777
1781
 
@@ -1779,7 +1783,7 @@ export default class listBasePage extends Vue {
1779
1783
  // Vue.component(com.name, com);
1780
1784
  // });
1781
1785
 
1782
- // console.log(this.listColumns);
1786
+ console.log('created - listColumns:', this.listColumns);
1783
1787
  // this.oldeditColumns=JSON.parse(JSON.stringify(this.editColumns))
1784
1788
  this.initTableField();
1785
1789
  //获取树数据
@@ -2016,7 +2020,7 @@ export default class listBasePage extends Vue {
2016
2020
  const sums = [];
2017
2021
  columns.forEach((column, index) => {
2018
2022
  if (index === 0) {
2019
- sums[index] = "合计";
2023
+ sums[index] = '合计';
2020
2024
  return;
2021
2025
  }
2022
2026
  const values = data.map((item) => Number(item[column.property]));
@@ -2131,6 +2135,12 @@ export default class listBasePage extends Vue {
2131
2135
  onChangeStatistics(args) {
2132
2136
  console.log(args);
2133
2137
  }
2138
+
2139
+ /** 国际化方法 */
2140
+ t(key: string) {
2141
+ return (this as any).$t(key) || key
2142
+ }
2143
+
2134
2144
  /** 查询用户列表 */
2135
2145
  getList() {
2136
2146
  this.contentLoading = true;
@@ -3126,6 +3136,43 @@ export default class listBasePage extends Vue {
3126
3136
  }
3127
3137
  cellStayle(row) {}
3128
3138
  mounted() {
3139
+ // 为 listColumns 中每个对象添加 text 属性
3140
+ // if (this.listColumns) {
3141
+ // this.listColumns.forEach((col: any) => {
3142
+ // if (col.property) {
3143
+ // col.text = (this as any).t(`${this.moduleName}.${this.serviceName}.${col.property}`);
3144
+ // }
3145
+ // });
3146
+ // }
3147
+
3148
+ // // 为 searchRules 中每个对象添加 text 属性
3149
+ // if (this.searchRules) {
3150
+ // this.searchRules.forEach((rule: any) => {
3151
+ // if (rule.property) {
3152
+ // rule.text = (this as any).t(`${this.moduleName}.${this.serviceName}.${rule.property}`);
3153
+ // }
3154
+ // });
3155
+ // }
3156
+
3157
+ // // 为 editColumns 中每个对象添加 text 属性
3158
+ // if (this.editColumns) {
3159
+ // this.editColumns.forEach((col: any) => {
3160
+ // if (col.property) {
3161
+ // col.text = (this as any).t(`${this.moduleName}.${this.serviceName}.${col.property}`);
3162
+ // }
3163
+ // });
3164
+ // }
3165
+
3166
+ // // 为 editSetting.listSetting.listColumns 中每个对象添加 text 属性
3167
+ // if (this.editSetting?.listSetting?.listColumns) {
3168
+ // const listSetting: any = this.editSetting.listSetting;
3169
+ // listSetting.listColumns.forEach((col: any) => {
3170
+ // if (col.property) {
3171
+ // col.text = (this as any).t(`${listSetting.moduleName}.${listSetting.serviceName}.${col.property}`);
3172
+ // }
3173
+ // });
3174
+ // }
3175
+
3129
3176
  var that = this;
3130
3177
  if (this.listSetting.isShowSumRow) {
3131
3178
  setTimeout(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kz-ui-base",
3
- "version": "1.0.148",
3
+ "version": "1.0.150",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <base-dialog :visible.sync="visible" width="1200px" title="物料选择" append-to-body @on-confirm="handleConfirm"
2
+ <base-dialog :visible.sync="visible" width="1200px" :title="t('itemModal.title')" append-to-body @on-confirm="handleConfirm"
3
3
  @on-cancel="cancel">
4
4
  <div class="app-container">
5
5
  <el-container class="item-panel default-background">
@@ -16,22 +16,22 @@
16
16
  <el-form ref="queryForm" :model="searchParams" label-width="120px" size="small">
17
17
  <el-row>
18
18
  <el-col :span="6" v-if="!isSkipSearch('itemNo')">
19
- <el-form-item label="物料编号" prop="itemNo">
20
- <el-input clearable v-model="searchParams.item.itemNo" placeholder="请输入物料编号"></el-input>
19
+ <el-form-item :label="t('itemModal.itemNo')" prop="itemNo">
20
+ <el-input clearable v-model="searchParams.item.itemNo" :placeholder="t('itemModal.placeholder.itemNo')"></el-input>
21
21
  </el-form-item>
22
22
  </el-col>
23
23
  <el-col :span="6" v-if="!isSkipSearch('itemName')">
24
- <el-form-item label="物料名称" prop="itemName">
25
- <el-input clearable v-model="searchParams.item.itemName" placeholder="请输入物料名称"></el-input>
24
+ <el-form-item :label="t('itemModal.itemName')" prop="itemName">
25
+ <el-input clearable v-model="searchParams.item.itemName" :placeholder="t('itemModal.placeholder.itemName')"></el-input>
26
26
  </el-form-item>
27
27
  </el-col>
28
28
  <el-col :span="6" v-if="!isSkipSearch('itemSpec')">
29
- <el-form-item label="规格型号" prop="itemSpec">
30
- <el-input clearable v-model="searchParams.item.itemSpec" placeholder="请输入规格型号"></el-input>
29
+ <el-form-item :label="t('itemModal.itemSpec')" prop="itemSpec">
30
+ <el-input clearable v-model="searchParams.item.itemSpec" :placeholder="t('itemModal.placeholder.itemSpec')"></el-input>
31
31
  </el-form-item>
32
32
  </el-col>
33
33
  <el-col :span="6" v-if="!isSkipSearch('itemClassId') && !showItemClass">
34
- <el-form-item label="存货分类" prop="itemSpec">
34
+ <el-form-item :label="t('itemModal.itemClassId')" prop="itemSpec">
35
35
  <el-cascader
36
36
  :options="treeData"
37
37
  @change="onItemClassIdChange"
@@ -44,12 +44,12 @@
44
44
  </el-row>
45
45
  <el-row>
46
46
  <el-col :span="6">
47
- <el-form-item label="物料种类" prop="itemCategoryId">
47
+ <el-form-item :label="t('itemModal.itemCategoryId')" prop="itemCategoryId">
48
48
  <entity-select v-model="searchParams.item.itemCategoryId" module-name="bd"
49
49
  service-name="itemCategory" :filterable="true" disp-prop="itemCategoryName"
50
50
  :label-formatter="(itemCategory)=>{return itemCategory.itemCategoryNo + '-' + itemCategory.itemCategoryName}"
51
51
  order-by-column="item_category_no" @change="handleItemCategorySelect"
52
- clearable :placeholder="'请选择物料种类'">
52
+ clearable :placeholder="t('itemModal.placeholder.itemCategory')">
53
53
  </entity-select>
54
54
  </el-form-item>
55
55
  </el-col>
@@ -74,9 +74,11 @@
74
74
  <el-row :gutter="20">
75
75
  </el-row>
76
76
  <div style="float: right; margin-top: 6px">
77
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索
77
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">
78
+ {{ t('component.table.search') }}
78
79
  </el-button>
79
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置
80
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">
81
+ {{ t('component.table.reset') }}
80
82
  </el-button>
81
83
  </div>
82
84
  </el-form>
@@ -97,7 +99,7 @@
97
99
  :header-cell-style="{ 'text-align': 'center' }">
98
100
  <el-table-column type="selection" width="55" align="center">
99
101
  </el-table-column>
100
- <el-table-column type="index" label="序号" width="50" align="center">
102
+ <el-table-column type="index" :label="t('itemModal.serialNo')" width="50" align="center">
101
103
  <template scope="scope">
102
104
  <span>{{
103
105
  (searchParams.pageNum - 1) * searchParams.pageSize +
@@ -125,8 +127,8 @@
125
127
  </el-col>
126
128
  <el-col :span="6" style="height: 100%">
127
129
  <el-table height="100%" :border="true" :data="currentEntity.attributes">
128
- <el-table-column label="属性名称" prop="attributeName"></el-table-column>
129
- <el-table-column label="属性值" prop="attributeValue"></el-table-column>
130
+ <el-table-column :label="t('itemModal.attributeName')" prop="attributeName"></el-table-column>
131
+ <el-table-column :label="t('itemModal.attributeValue')" prop="attributeValue"></el-table-column>
130
132
  </el-table>
131
133
  </el-col>
132
134
  </el-row>
@@ -203,11 +205,7 @@ export default class itemModal extends Vue {
203
205
  pageSize: 10,
204
206
  pageNum: 1,
205
207
  };
206
- listColumns = [
207
- {text: "物料编号", property: "itemNo", width: 120},
208
- {text: "物料名称", property: "itemName"},
209
- {text: "规格型号", property: "itemSpec"},
210
- ];
208
+ listColumns = [];
211
209
 
212
210
  @Watch("searchParams.item", {deep: true})
213
211
  onSearchParamsItemChange(newValue, oldVale) {
@@ -406,6 +404,11 @@ export default class itemModal extends Vue {
406
404
  }
407
405
 
408
406
  created() {
407
+ this.listColumns = [
408
+ {text: (this as any).t('itemModal.itemNo'), property: "itemNo", width: 120},
409
+ {text: (this as any).t('itemModal.itemName'), property: "itemName"},
410
+ {text: (this as any).t('itemModal.itemSpec'), property: "itemSpec"},
411
+ ];
409
412
  this.getTreeData();
410
413
  this.getList();
411
414
  console.log(this.value);