Skip to content

Commit

Permalink
增加参数 fnr-config
Browse files Browse the repository at this point in the history
  • Loading branch information
xuliangzhan committed Nov 25, 2020
1 parent 846bc69 commit ee0b20c
Show file tree
Hide file tree
Showing 15 changed files with 304 additions and 276 deletions.
1 change: 0 additions & 1 deletion examples/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1794,7 +1794,6 @@ export default {
},
// {
// label: 'app.aside.nav.rendererPlugin',
// disabled: true,
// locat: {
// name: 'TablePluginRenderer'
// }
Expand Down
64 changes: 64 additions & 0 deletions examples/api/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1773,6 +1773,70 @@ const apis = [
}
]
},
{
name: 'fnr-config',
descKey: 'app.api.table.desc.fnrConfig',
version: 'pro',
type: 'any',
enum: '',
defVal: '继承 setup.table.fnrConfig',
list: [
{
name: 'isFind',
desc: '是否启用查找功能',
version: 'pro',
type: 'boolean',
enum: '',
defVal: 'true',
list: []
},
{
name: 'findMethod',
desc: '自定义单元格查询方法',
version: 'pro',
type: '({ cellValue, isWhole, isRE, isSensitive, findValue: findCellValue, findRE }) => boolean',
enum: '',
defVal: '',
list: []
},
{
name: 'beforeFindMethod',
desc: '自定义单元格替换之前的方法,可以通过返回 false 阻止替换行为',
version: 'pro',
type: '({ findValue }) => boolean',
enum: '',
defVal: '',
list: []
},
{
name: 'isReplace',
desc: '是否启用替换功能',
version: 'pro',
type: 'boolean',
enum: '',
defVal: 'true',
list: []
},
{
name: 'replaceMethod',
desc: '自定义单元格替换方法',
version: 'pro',
type: '({ row, column, cellValue }) => boolean',
enum: '',
defVal: '',
list: []
},
{
name: 'beforeReplaceMethod',
desc: '自定义单元格替换之前的方法,可以通过返回 false 阻止替换行为',
version: 'pro',
type: '({ findValue, replaceValue }) => boolean',
enum: '',
defVal: '',
list: []
}
]
},
{
name: 'mouse-config',
descKey: 'app.api.table.desc.mouseConfig',
Expand Down
20 changes: 0 additions & 20 deletions examples/assets/style/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -556,23 +556,3 @@ body,
padding: 0 5px 0 20px;
}
}


.vxe-renderer--progress-bar {
display: block;
width: 100%;
height: 1.2em;
}
.vxe-renderer--progress-bar-chart,
.vxe-renderer--progress-bar-label {
float: left;
height: 100%;
}
.vxe-renderer--progress-bar-chart {
background-color: #409eff;
}
.vxe-renderer--progress-bar-label {
line-height: 1.2em;
padding: 0 0.2em;
text-align: center;
}
1 change: 1 addition & 0 deletions examples/i18n/lang/en-US.js
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ export default {
menuConfig: 'context menu configuration',
contextMenu: 'Obsolete, please use "menu-config"',
clipConfig: 'Copy and paste configuration',
fnrConfig: 'find and replace configuration',
mouseConfig: 'Mouse configuration',
keyboardConfig: 'Keyboard configuration',
editConfig: 'Editable configuration',
Expand Down
3 changes: 2 additions & 1 deletion examples/i18n/lang/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,8 @@ export default {
treeConfig: '树形结构配置项',
menuConfig: '快捷菜单配置项',
contextMenu: '即将废弃,请使用 menu-config',
clipConfig: '复制粘贴配置项',
clipConfig: '复制/粘贴配置项',
fnrConfig: '查找/替换配置项',
mouseConfig: '鼠标配置项',
keyboardConfig: '按键配置项',
editConfig: '可编辑配置项',
Expand Down
3 changes: 2 additions & 1 deletion examples/i18n/lang/zh-TC.js
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,8 @@ export default {
treeConfig: '树形结构配置项',
menuConfig: '快捷菜单配置项',
contextMenu: '即将废弃,请使用 menu-config',
clipConfig: '复制粘贴配置项',
clipConfig: '复制/粘贴配置项',
fnrConfig: '查找/替换配置项',
mouseConfig: '鼠标配置项',
keyboardConfig: '按键配置项',
editConfig: '可编辑配置项',
Expand Down
3 changes: 3 additions & 0 deletions examples/plugins/xtable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ import VXETablePluginVirtualTree from 'vxe-table-plugin-virtual-tree'
import VXETablePluginMenus from 'vxe-table-plugin-menus'
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
import VXETablePluginExportPDF from 'vxe-table-plugin-export-pdf'
import VXETablePluginRenderer from 'vxe-table-plugin-renderer'
import 'vxe-table-plugin-element/dist/style.css'
import 'vxe-table-plugin-iview/dist/style.css'
import 'vxe-table-plugin-antd/dist/style.css'
import 'vxe-table-plugin-virtual-tree/dist/style.css'
import 'vxe-table-plugin-renderer/dist/style.css'

// 设置默认参数
VXETable.setup({
Expand Down Expand Up @@ -100,3 +102,4 @@ VXETable.use(VXETablePluginVirtualTree)
VXETable.use(VXETablePluginMenus)
VXETable.use(VXETablePluginExportXLSX)
VXETable.use(VXETablePluginExportPDF)
VXETable.use(VXETablePluginRenderer)
21 changes: 0 additions & 21 deletions examples/plugins/xtable/renderer/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,3 @@ VXETable.renderer.add('MyLink', {
]
}
})

VXETable.renderer.add('ProgressBar', {
renderDefault (h, renderOpts, params) {
const { row, column } = params
return [
h('span', {
class: 'vxe-renderer--progress-bar'
}, [
h('span', {
class: 'vxe-renderer--progress-bar-chart',
style: {
width: `${row[column.property]}%`
}
}),
h('span', {
class: 'vxe-renderer--progress-bar-label'
}, row[column.property])
])
]
}
})
Loading

0 comments on commit ee0b20c

Please sign in to comment.