ocpview-pro 0.1.26 → 0.1.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ocpview-pro",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "title": "ocpviewPlus",
5
5
  "description": "A high quality Service UI components Library with Vue.js",
6
6
  "homepage": "",
@@ -317,7 +317,9 @@ export default {
317
317
  row,
318
318
  item
319
319
  );
320
- const valueFormat = this.$t(valueData);
320
+ // codeWithName 拼接的 [编码] 前缀会导致 $t 匹配失效,先剥离再转义
321
+ const valueFormat =
322
+ this.translateComboBoxText(valueData);
321
323
  const colorGroup = item._colorMap[cellValue];
322
324
  if (colorGroup) {
323
325
  const styleStr = Object.entries({
@@ -494,6 +496,19 @@ export default {
494
496
  }),
495
497
  ];
496
498
  },
499
+ /**
500
+ * 剥离 codeWithName 拼接的 "[编码]" 前缀,只对名称部分做多语言转义
501
+ */
502
+ translateComboBoxText(text) {
503
+ if (typeof text !== "string") {
504
+ return text;
505
+ }
506
+ const match = text.match(/^(\[[^\]]*\])([\s\S]*)$/);
507
+ if (match) {
508
+ return match[1] + this.$t(match[2]);
509
+ }
510
+ return this.$t(text);
511
+ },
497
512
  handleSumField(params) {
498
513
  const { list, field } = params;
499
514
  let count = 0;
@@ -102,7 +102,7 @@
102
102
  :icon="btnData[0].icon"
103
103
  :customIcon="btnData[0].customIcon"
104
104
  @click="action(btnData[0].name)"
105
- >{{ $t(btnData[0].text) }}1</Button
105
+ >{{ $t(btnData[0].text) }}</Button
106
106
  >
107
107
  <Button
108
108
  v-if="!btnFlag && moreBtnFlag"
@@ -90,6 +90,11 @@ export default {
90
90
  name:'filesize',
91
91
  render: this.sizeActionRender,
92
92
  width:120
93
+ },{
94
+ label: this.$t('操作人'),
95
+ name:'inputer_name',
96
+ type:'TextBox',
97
+ width:200
93
98
  },{
94
99
  label: this.$t('上传日期'),
95
100
  name:'ph_timestamp',
@@ -235,7 +235,8 @@ export default {
235
235
  const code = params.row[fieldName];
236
236
  const colorGroup = colorMap[code];
237
237
  const text = this.$Method.formatComboBox(code, params.column);
238
- const textF = this.$t(text);
238
+ // codeWithName 拼接的 [编码] 前缀会导致 $t 匹配失效,先剥离再转义
239
+ const textF = this.translateComboBoxText(text);
239
240
  if (colorGroup) {
240
241
  const style = {
241
242
  color: colorGroup.text || "",
@@ -251,6 +252,17 @@ export default {
251
252
  };
252
253
  el._colorMap = colorMap;
253
254
  },
255
+ translateComboBoxText(text) {
256
+ if (typeof text !== "string") {
257
+ return text;
258
+ }
259
+ // 剥离 codeWithName 拼接的 "[编码]" 前缀,只对名称部分做多语言转义
260
+ const match = text.match(/^(\[[^\]]*\])([\s\S]*)$/);
261
+ if (match) {
262
+ return match[1] + this.$t(match[2]);
263
+ }
264
+ return this.$t(text);
265
+ },
254
266
  initRowBtn() {
255
267
  if (this.enablePermissions) {
256
268
  let btns = [];