n20-common-lib 3.0.85 → 3.0.86
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
|
@@ -25,24 +25,23 @@ function flattenObject(obj, prefix = '', result = {}) {
|
|
|
25
25
|
return result
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
vxeTable.setConfig({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
})
|
|
28
|
+
// vxeTable.setConfig({
|
|
29
|
+
// size: 'small',
|
|
30
|
+
// table: {
|
|
31
|
+
// align: 'center',
|
|
32
|
+
// columnConfig: {
|
|
33
|
+
// resizable: true
|
|
34
|
+
// }
|
|
35
|
+
// },
|
|
36
|
+
// // 对组件内置的提示语进行国际化翻译
|
|
37
|
+
// i18n: (key, args) => {
|
|
38
|
+
// return $lc(flattenObject(zhCN) && flattenObject(zhCN)[key])
|
|
39
|
+
// }
|
|
40
|
+
// })
|
|
41
41
|
// 创建一个简单的输入框筛选
|
|
42
42
|
vxeTable.renderer.add('FilterInput', {
|
|
43
43
|
// 筛选模板
|
|
44
44
|
renderFilter(h, renderOpts, params) {
|
|
45
|
-
console.log(h, renderOpts, params, 123)
|
|
46
45
|
return <filterContent params={params}></filterContent>
|
|
47
46
|
},
|
|
48
47
|
// 不显示底部按钮,使用自定义的按钮
|
|
@@ -67,11 +66,6 @@ vxeTable.renderer.add('FilterInput', {
|
|
|
67
66
|
return false
|
|
68
67
|
}
|
|
69
68
|
})
|
|
70
|
-
vxeTable.renderer.add('customHeader', {
|
|
71
|
-
renderTableHeader(renderOpts, params) {
|
|
72
|
-
console.log(renderOpts, params, 123)
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
69
|
|
|
76
70
|
// 自定义全局的格式化处理函数
|
|
77
71
|
vxeTable.formats.mixin({
|
|
@@ -127,33 +121,7 @@ vxeTable.formats.mixin({
|
|
|
127
121
|
}
|
|
128
122
|
}
|
|
129
123
|
})
|
|
130
|
-
|
|
131
|
-
/* vxeTable.renderer.add('FilterInput', {
|
|
132
|
-
// 筛选模板
|
|
133
|
-
renderFilter(h, renderOpts, params) {
|
|
134
|
-
const { data } = params
|
|
135
|
-
return <el-input v-model='data' placeholder='' size='mini'></el-input>
|
|
136
|
-
},
|
|
137
|
-
// 重置数据方法
|
|
138
|
-
filterResetMethod({ options }) {
|
|
139
|
-
options.forEach((option) => {
|
|
140
|
-
option.data = ''
|
|
141
|
-
})
|
|
142
|
-
},
|
|
143
|
-
// 重置筛选复原方法(当未点击确认时,该选项将被恢复为默认值)
|
|
144
|
-
filterRecoverMethod({ option }) {
|
|
145
|
-
option.data = ''
|
|
146
|
-
},
|
|
147
|
-
// 筛选方法
|
|
148
|
-
filterMethod({ option, row, column }) {
|
|
149
|
-
const { data } = option
|
|
150
|
-
const cellValue = row[column.property]
|
|
151
|
-
if (cellValue) {
|
|
152
|
-
return cellValue.indexOf(data) > -1
|
|
153
|
-
}
|
|
154
|
-
return false
|
|
155
|
-
}
|
|
156
|
-
}) */
|
|
124
|
+
|
|
157
125
|
function install(Vue) {
|
|
158
126
|
Vue.use(vxeTable)
|
|
159
127
|
}
|
|
@@ -252,14 +252,16 @@
|
|
|
252
252
|
</div>
|
|
253
253
|
</template>
|
|
254
254
|
<!-- 处理旧格式 formatter 和 render -->
|
|
255
|
-
<template #default="{ row, column }">
|
|
255
|
+
<template v-if="item.type !== 'seq'" #default="{ row, column }">
|
|
256
256
|
<!-- 纯对象字段 -->
|
|
257
257
|
<template
|
|
258
258
|
v-if="row[column.property] && typeof row[column.property] === 'object' && row[column.property].name"
|
|
259
259
|
>
|
|
260
260
|
{{ row[column.property].name }}
|
|
261
261
|
</template>
|
|
262
|
-
<slot v-else :name="`cell_${item.prop}`" :row="row">{{
|
|
262
|
+
<slot v-else :name="`cell_${item.prop}`" :row="row">{{
|
|
263
|
+
row[column.property] || row[column.property] === 0 ? row[column.property] : '--'
|
|
264
|
+
}}</slot>
|
|
263
265
|
</template>
|
|
264
266
|
</vxe-column>
|
|
265
267
|
</template>
|