Skip to content

Commit 19e7e95

Browse files
authored
fix(query-builder): document supplement (#3814)
1 parent 54caa1c commit 19e7e95

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

examples/sites/demos/pc/app/query-builder/webdoc/query-builder.js

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,21 @@ export default {
1010
},
1111
desc: {
1212
'zh-CN': `
13-
<div class="tip custom-block">
14-
<p class=\"custom-block-title\"> config 属性说明 </p>
15-
<code>autoSelectField</code>:范围域是否会默认选择,勾选则默认为第一个选项;反之则默认为----- \n <code>autoSelectOperator</code>:运算符是否会默认选择,勾选则默认选择第一个选项,反之则默认为----- \n <code>disabled</code>:禁用所有规则 \n <code>parseNumbers</code>:数字会被转化为 Number 类型,而非 String 类型 \n <code>showCloneButtons</code>:展示复制按钮,即整条规则可以被复制 \n <code>showCombinatorsBetweenRules</code>:组合子数组统一修改,且不再展示在连线上,以下拉选择形式出现 \n <code>showLockButtons</code>:展示锁定按钮,即整条规则可以被锁定 \n <code>showNotToggle</code>:展示 not 条件切换框 \n <code>displayOnlyField</code>:是否仅展示字段选择器 \n </div> \n 二、fields 数据配置 \n <pre> <code>\n fields 中的数据(只用于说明各字段含义,无业务特定性) \n { \n name: 'isMusician', //name:格式化数据中的值(形参) \n label: 'Is a musician', //label:范围域在规则生成器中对外展示名称 \n valueEditorType: 'checkbox', //placeholder:值域的默认缺省值 \n operators: [ //运算符自定义,name 为格式化数据中的值,label 为范围域对外展示的名称 \n { \n name: '=', \n label: '=' \n } \n ], \n bindProps: { // 通过 bindProps 参数可对某一类组件进行参数控制 \n input:{ \n clearable:true \n }, \n select:{ \n filterable:true \n } \n }, \n defaultValue: false, //defaultOperator:运算符的默认缺省选择 \n validator: (r) => !!r.value //validator:校验规则(该功能点还在迭代开发中……) \n inputType: 'number', //值域的数值类型 \n valueEditorType: 'radio' //值域编辑器的类型 \n defaultValue: false, //值域的默认值 \n values: [ //值域的可选域配置(下拉) \n { \n label: 'Percussion instruments', \n options: [ \n { \n name: 'Clapstick', \n label: 'Clapstick' \n } \n ] \n } \n ], \n values: [ //值域的可选域配置(单选) \n { \n name: 'M', \n label: 'Male' \n }, \n { \n name: 'F', \n label: 'Female' \n }, \n { \n name: 'O', \n label: 'Other' \n } \n ], \n valueSources: ['field', 'value'], //值域类型可选择 \n comparator: 'groupNumber', //分组时的比较器 \n groupNumber: 'group1', //分组的组别 \n }, \n // 组合子数组配置,label 为展示字符,name 为数据值 \n combinators: [ \n { \n name: 'and', \n label: '且' \n }, \n { \n name: 'or', \n label: '或' \n } \n ] \n </code></pre> <br>`,
16-
'en-US': ''
13+
<code>config</code>属性说明,<code>autoSelectField</code>:范围域是否会默认选择,勾选则默认为第一个选项;反之则默认为----- \n <code>autoSelectOperator</code>:运算符是否会默认选择,勾选则默认选择第一个选项,反之则默认为----- \n <code>disabled</code>:禁用所有规则 \n <code>parseNumbers</code>:数字会被转化为 Number 类型,而非 String 类型 \n <code>showCloneButtons</code>:展示复制按钮,即整条规则可以被复制 \n <code>showCombinatorsBetweenRules</code>:组合子数组统一修改,且不再展示在连线上,以下拉选择形式出现 \n <code>showLockButtons</code>:展示锁定按钮,即整条规则可以被锁定 \n <code>showNotToggle</code>:展示 not 条件切换框 \n <code>displayOnlyField</code>:是否仅展示字段选择器 \n </div> \n fields 数据配置 \n <pre> <code>fields 中的数据(只用于说明各字段含义,无业务特定性) \n { \n name: 'isMusician', //name:格式化数据中的值(形参) \n label: 'Is a musician', //label:范围域在规则生成器中对外展示名称 \n valueEditorType: 'checkbox', //placeholder:值域的默认缺省值 \n operators: [ //运算符自定义,name 为格式化数据中的值,label 为范围域对外展示的名称 \n { \n name: '=', \n label: '=' \n } \n ], \n bindProps: { // 通过 bindProps 参数可对某一类组件进行参数控制 \n input:{ \n clearable:true \n }, \n select:{ \n filterable:true \n } \n }, \n defaultValue: false, //defaultOperator:运算符的默认缺省选择 \n validator: (r) => !!r.value //validator:校验规则(该功能点还在迭代开发中……) \n inputType: 'number', //值域的数值类型 \n valueEditorType: 'radio' //值域编辑器的类型 \n defaultValue: false, //值域的默认值 \n values: [ //值域的可选域配置(下拉) \n { \n label: 'Percussion instruments', \n options: [ \n { \n name: 'Clapstick', \n label: 'Clapstick' \n } \n ] \n } \n ], \n values: [ //值域的可选域配置(单选) \n { \n name: 'M', \n label: 'Male' \n }, \n { \n name: 'F', \n label: 'Female' \n }, \n { \n name: 'O', \n label: 'Other' \n } \n ], \n valueSources: ['field', 'value'], //值域类型可选择 \n comparator: 'groupNumber', //分组时的比较器 \n groupNumber: 'group1', //分组的组别 \n }, \n // 组合子数组配置,label 为展示字符,name 为数据值 \n combinators: [ \n { \n name: 'and', \n label: '且' \n }, \n { \n name: 'or', \n label: '或' \n } \n ] \n </code></pre> <br>`,
14+
'en-US': `<code>config</code> Attribute Description, <code>autoSelectField</code>: Whether the range field is automatically selected by default. If checked, the first option will be selected by default; otherwise, it defaults to ----- <code>autoSelectOperator</code>: Whether the operator is automatically selected by default. If checked, the first option will be selected by default; otherwise, it defaults to ----- <code>disabled</code>: Disable all rules <code>parseNumbers</code>: Numbers will be converted to the Number type, not the String type <code>showCloneButtons</code>: Display copy buttons, allowing the entire rule to be copied <code>showCombinatorsBetweenRules</code>: Uniformly modify the combinator array, which no longer appears on the connection line but instead appears as a dropdown selection <code>showLockButtons</code>: Display lock buttons, allowing the entire rule to be locked <code>showNotToggle</code>: Display the not condition toggle box <code>displayOnlyField</code>: Whether only the field selector is displayed. \n fields data configuration \n<pre><code>Data in fields (only used to explain the meaning of each field, no business specificity) \n {\n name: 'isMusician',//name: values (formal parameters) in formatted data \n label: 'Is a musician',//label: the external display name of the range field in the rule generator \n valueEditorType: 'checkbox',//placeholder: the default value of the value field \n operators: [//operator customization, name is the value in formatted data, label is the external display name of the range field \n {\n name: '=', \n label: '=' \n} \n], \n BindProps: {//The bindProps parameter can be used to control the parameters of a certain type of component\n input:{ \n clearable:true \n }, \n select:{ \n filterable:true \n } \n }, \n defaultValue: false, //defaultOperator: The default selection for operators is validator: (r)=>!! r. Value//validator: validation rules (this feature is still under iterative development...) \n inputType: 'number',//numeric type of value range \n valueEditorType: 'radio'//type of value range editor \n defaultValue: false,//default value of value range \n values: [//optional range configuration of value range (drop-down))\n { \n label: 'Percussion instruments', \n options: [ \n { \n name: 'Clapstick', \n label: 'Clapstick' \n } \n ] \n } \n ], \n values: [//Optional field configuration for value range (single choice)\n { \n name: 'M', \n label: 'Male' \n }, \n { \n name: 'F', \n label: 'Female' \n }, \n { \n name: 'O', \n label: 'Other' \n } \n ], \n valueSources: ['field', 'value'], //The range type can be selected as \n comparator:'groupNumber ',//comparator for grouping \n groupNumber:'group1',//grouping group \n}, \n//combination subarray configuration, label is the display character, name is the data value \n combiners: [\n {\n name: 'and', \n label: 'and' \n}, \n {\n name: 'or', \n label: 'or' \n} \n] \n</code></press><br>`
1715
},
1816
codeFiles: ['basic-usage.vue']
1917
},
2018
{
2119
demoId: 'display-only-field',
2220
name: {
2321
'zh-CN': '简易模式',
24-
'en-US': 'Basic'
22+
'en-US': 'Simple Mode'
2523
},
2624
desc: {
27-
'zh-CN': 'config 配置添加 displayOnlyField 属性,开启简易模式仅展示字段选择器功能',
28-
'en-US': ' '
25+
'zh-CN': '<code>config</code>配置添加<code>displayOnlyField</code>属性,开启简易模式仅展示字段选择器功能',
26+
'en-US':
27+
'<code>config</code>Configure to add<code>showOnlyField</code>attribute, enable simple mode to only display field selector function'
2928
},
3029
codeFiles: ['display-only-field.vue']
3130
},
@@ -36,8 +35,10 @@ export default {
3635
'en-US': 'Basic'
3736
},
3837
desc: {
39-
'zh-CN': 'fields 数组配置项中存在 children 子数据项,则开启树型字段选择器功能,配置示例如下',
40-
'en-US': ' '
38+
'zh-CN':
39+
'<code>fields</code>数组配置项中存在<code>children</code>子数据项,则开启树型字段选择器功能,配置示例如下',
40+
'en-US':
41+
'If there is a <code>children</code> sub-item in the <code>fields</code> array configuration, the tree-type field selector function will be enabled. The configuration example is as follows'
4142
},
4243
codeFiles: ['tree-field.vue']
4344
},
@@ -49,8 +50,9 @@ export default {
4950
},
5051
desc: {
5152
'zh-CN':
52-
'添加 max-height 属性设置组件最大高度,超出内容显示滚动条,属性值支持 数值 和 数值 + 单位,如 500、500px、50rem 等。',
53-
'en-US': ' '
53+
'添加<code>max-height</code>属性设置组件最大高度,超出内容显示滚动条,属性值支持 数值 和 数值 + 单位,如 500、500px、50rem 等。',
54+
'en-US':
55+
'Add <code>max-height</code> attribute to set the maximum height of the component. If the content exceeds the limit, a scroll bar will be displayed. The attribute value supports both numeric and numeric + unit, such as 500, 500px, 50rem, etc.'
5456
},
5557
codeFiles: ['max-height.vue']
5658
},
@@ -90,8 +92,9 @@ export default {
9092
},
9193
desc: {
9294
'zh-CN':
93-
'config 配置添加 bindProps 属性可控制某一类组件的参数,中间操作符类组件暂不支持传参,具体配置见以下说明: \n<div class="tip custom-block">\n<p class="custom-block-title"> bindProps 属性说明 </p>\nleftSelect:左侧 Select 参数,统一控制左侧所有 Select \nselect:右侧 Select 参数 \ninput:输入框参数,包括 textarea \nnumeric:计数器 \ndate:日期选择器 \ntime:时间选择器 \nradio:单选框 \ncheckbox:多选框 \n</div> \n',
94-
'en-US': ' '
95+
'<code>config</code> 配置添加<code>bindProps</code>属性可控制某一类组件的参数,中间操作符类组件暂不支持传参,具体配置见以下说明: \n<div class="tip custom-block">\n<p class="custom-block-title"> <code>bindProps</code> 属性说明 </p>\n <code>leftSelect</code>:左侧 <code>Select</code> 参数,统一控制左侧所有 <code>Select</code> , 右侧 <code>Select</code> 参数:<code>input</code>输入框,包括 <code>textarea</code> \n<numeric>:计数器 \n<date>:日期选择器 \n<time>:时间选择器 \n<radio>:单选框 \n<checkbox>:多选框 \n</div> \n',
96+
'en-US':
97+
'<code>config</code> Configure to add <code>bindProps</code> attribute to control the parameters of a certain type of component. The middle operator type component does not support parameter passing for the time being. See the following description for specific configuration: \n<div class="tip custom-block">\n<p class="custom-block-title"> <code>bindProps</code> Attribute Description </p>\n <code>leftSelect</code>: Left <code>Select</code> parameters, uniformly control all left <code>Select</code>, right <code>Select</code> parameters: <code>input</code> input box, including <code>textarea</code> \n<numeric>: counter \n<date>: date picker \n<time>: time picker \n<radio>: radio button \n<checkbox>: checkbox \n</div> \n'
9598
},
9699
codeFiles: ['sub-component-param.vue']
97100
},
@@ -103,7 +106,7 @@ export default {
103106
},
104107
desc: {
105108
'zh-CN':
106-
'高级模式,用法详见示例:<br> \n 自定义组件必须实现:<strong> value</strong>属性和<strong>change</strong>事件,<br> \n <strong>自定义组件的其他额外属性:</strong><br> \n data-id: string,数据 ID <br> \n operator: string, 操作符<br> \n filed-name: string, 字段名 <br> \n path: Array<number> 字段在 queryBuilder 中的父子路径,<br> \n key: to| from',
109+
'高级模式,用法详见示例:<br> \n 自定义组件必须实现:<code> value</code>属性和<code>change</code>事件,<br> \n <code>自定义组件的其他额外属性:</code><br> \n <code>data-id: string</code>,数据 ID <br> \n <code>operator: string</code>, 操作符<br> \n <code>filed-name: string</code>, 字段名 <br> \n <code>path: Array<number> </code>字段在 <code>queryBuilder</code> 中的父子路径,<br> \n<code> key: to| from</code>',
107110
'en-US': ' '
108111
},
109112
codeFiles: ['advanced-mode.vue']

0 commit comments

Comments
 (0)