n20-common-lib 2.11.25 → 2.11.26

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": "n20-common-lib",
3
- "version": "2.11.25",
3
+ "version": "2.11.26",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -58,6 +58,19 @@ export function colfF(colf, map) {
58
58
  return (row) => tplFn(row, sc, mck, map)
59
59
  }
60
60
 
61
+ export function colfFRow(row, colf, map) {
62
+ if (typeof colf !== 'string') return colf
63
+ let sc = colf.split(/{.+?}/g) || []
64
+ let mc = colf.match(/{.+?}/g) || []
65
+ let mck = []
66
+ mc.forEach((t) => {
67
+ t = t.replace(/^{|\s+|}$/g, '').split('|')
68
+ mck.push(t)
69
+ })
70
+
71
+ return tplFn(row, sc, mck, map)
72
+ }
73
+
61
74
  export function colftF(colft, fMap) {
62
75
  if (typeof colft !== 'string') return colft
63
76
  return fMap[colft]
@@ -61,8 +61,13 @@
61
61
  :width="column.width"
62
62
  :align="column.align"
63
63
  :show-overflow-tooltip="column.showOverflowTooltip"
64
- :formatter="column.formatter | colfF(column.formatterMap)"
65
- />
64
+ >
65
+ <template slot-scope="scope">
66
+ <span v-if="column.formatter">{{ scope.row | colfFRow(column.formatter, column.formatterMap) }}</span>
67
+ <!-- eslint-disable-next-line vue/no-v-html -->
68
+ <span v-else v-html="scope.row[column.prop]"></span>
69
+ </template>
70
+ </el-table-column>
66
71
  </el-table>
67
72
  <div v-if="pagination" class="flex-box flex-r m-t-ss m-b-ss">
68
73
  <Pagination
@@ -111,7 +116,7 @@
111
116
  import XEUtils from 'xe-utils'
112
117
  import { $lc } from '../../utils/i18n/index'
113
118
  import Pagination from '../Pagination/index.vue'
114
- import { colfF } from '../Table/filters.js'
119
+ import { colfFRow } from '../Table/filters.js'
115
120
  export default {
116
121
  name: 'UploadMsg',
117
122
  components: { Pagination },
@@ -166,7 +171,7 @@ export default {
166
171
  }
167
172
  },
168
173
  filters: {
169
- colfF
174
+ colfFRow
170
175
  },
171
176
  data() {
172
177
  return {