-
Notifications
You must be signed in to change notification settings - Fork 0
JTreeSelect
xinwu-yang edited this page Mar 1, 2023
·
1 revision
树形下拉选择框组件。
<template>
<a-form :form="form">
<a-form-item>
<j-tree-select dict="sys_depart,depart_name,id" pid-field="parent_id" v-model="treeValue"> </j-tree-select>
{{ treeValue }}
</a-form-item>
<a-form-item>
<j-tree-select dict="sys_depart,depart_name,id" pid-field="parent_id" v-decorator="['demoTree']"> </j-tree-select>
{{ getTreeFieldValue() }}
</a-form-item>
</a-form>
</template>
<script>
export default {
data() {
return {
form: this.$form.createForm(this),
treeValue: ''
}
},
methods: {
getTreeFieldValue() {
return this.form.getFieldValue('demoTree')
}
}
}
</script>
属性 | 说明 | 类型 | 必填 | 默认值 |
---|---|---|---|---|
value(v-model) | 值 | string | ||
placeholder | 默认文字 | string | '请选择' | |
disabled | 是否禁用 | boolean | false | |
dict | 表名,显示字段,存储字段 | string | ||
pidField | 父节点字段 | string | 'pid' | |
pidValue | 父节点的 id 值,不指定则默认为 '0' | string | '0' | |
condition | 自定义查询条件,进行过滤数据,json 字符串,例如:condition='{"create_by":"admin"}' | string | ||
hasChildField | 是否含有子节点的字段(默认不传),控制是否显示展开箭头(1=有,0=没有) | string |
事件名称 | 说明 | 回调参数 |
---|---|---|
change | 值变化时调用 | function(value, text) |