级联选择组件增加showAllLevels属性及属性编辑器。
parent
665342ebf8
commit
a7c4ab7d8b
|
@ -7,6 +7,7 @@
|
||||||
:size="field.options.size"
|
:size="field.options.size"
|
||||||
:clearable="field.options.clearable"
|
:clearable="field.options.clearable"
|
||||||
:filterable="field.options.filterable"
|
:filterable="field.options.filterable"
|
||||||
|
:show-all-levels="showFullPath"
|
||||||
:props="{ checkStrictly: field.options.checkStrictly, multiple: field.options.multiple, expandTrigger: 'hover' }"
|
:props="{ checkStrictly: field.options.checkStrictly, multiple: field.options.multiple, expandTrigger: 'hover' }"
|
||||||
@visible-change="hideDropDownOnClick" @expand-change="hideDropDownOnClick"
|
@visible-change="hideDropDownOnClick" @expand-change="hideDropDownOnClick"
|
||||||
:placeholder="field.options.placeholder || i18nt('render.hint.selectPlaceholder')"
|
:placeholder="field.options.placeholder || i18nt('render.hint.selectPlaceholder')"
|
||||||
|
@ -64,6 +65,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
showFullPath() {
|
||||||
|
return (this.field.options.showAllLevels === undefined) || !!this.field.options.showAllLevels
|
||||||
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
beforeCreate() {
|
beforeCreate() {
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<template>
|
||||||
|
<el-form-item :label="i18nt('designer.setting.showAllLevels')">
|
||||||
|
<el-switch v-model="optionModel.showAllLevels"></el-switch>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import i18n from "@/utils/i18n"
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "showAllLevels-editor",
|
||||||
|
mixins: [i18n],
|
||||||
|
props: {
|
||||||
|
designer: Object,
|
||||||
|
selectedWidget: Object,
|
||||||
|
optionModel: Object,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
|
@ -42,6 +42,7 @@ const COMMON_PROPERTIES = {
|
||||||
'remote' : 'remote-editor',
|
'remote' : 'remote-editor',
|
||||||
'automaticDropdown' : 'automaticDropdown-editor',
|
'automaticDropdown' : 'automaticDropdown-editor',
|
||||||
'checkStrictly' : 'checkStrictly-editor',
|
'checkStrictly' : 'checkStrictly-editor',
|
||||||
|
'showAllLevels' : 'showAllLevels-editor',
|
||||||
'multiple' : 'multiple-editor',
|
'multiple' : 'multiple-editor',
|
||||||
'multipleLimit' : 'multipleLimit-editor',
|
'multipleLimit' : 'multipleLimit-editor',
|
||||||
'contentPosition' : 'contentPosition-editor',
|
'contentPosition' : 'contentPosition-editor',
|
||||||
|
|
|
@ -883,6 +883,7 @@ export const advancedFields = [
|
||||||
filterable: false,
|
filterable: false,
|
||||||
multiple: false,
|
multiple: false,
|
||||||
checkStrictly: false, //可选择任意一级选项,默认不开启
|
checkStrictly: false, //可选择任意一级选项,默认不开启
|
||||||
|
showAllLevels: true, //显示完整路径
|
||||||
optionItems: [
|
optionItems: [
|
||||||
{label: 'select 1', value: 1, children: [{label: 'child 1', value: 11}]},
|
{label: 'select 1', value: 1, children: [{label: 'child 1', value: 11}]},
|
||||||
{label: 'select 2', value: 2},
|
{label: 'select 2', value: 2},
|
||||||
|
|
|
@ -209,6 +209,7 @@ export default {
|
||||||
multiple: 'Multiple',
|
multiple: 'Multiple',
|
||||||
multipleLimit: 'Multiple Limit',
|
multipleLimit: 'Multiple Limit',
|
||||||
checkStrictly: 'Any Level Selectable',
|
checkStrictly: 'Any Level Selectable',
|
||||||
|
showAllLevels: 'Show All Levels',
|
||||||
contentPosition: 'Content Position',
|
contentPosition: 'Content Position',
|
||||||
plain: 'Plain',
|
plain: 'Plain',
|
||||||
round: 'Round',
|
round: 'Round',
|
||||||
|
|
|
@ -209,6 +209,7 @@ export default {
|
||||||
multiple: '选项可多选',
|
multiple: '选项可多选',
|
||||||
multipleLimit: '多选数量限制',
|
multipleLimit: '多选数量限制',
|
||||||
checkStrictly: '任意级节点可选',
|
checkStrictly: '任意级节点可选',
|
||||||
|
showAllLevels: '显示完整路径',
|
||||||
contentPosition: '文字位置',
|
contentPosition: '文字位置',
|
||||||
plain: '朴素按钮',
|
plain: '朴素按钮',
|
||||||
round: '圆角按钮',
|
round: '圆角按钮',
|
||||||
|
|
|
@ -2,7 +2,7 @@ import {isEmptyStr, isNull} from "./util";
|
||||||
|
|
||||||
export const getRegExp = function (validatorName) {
|
export const getRegExp = function (validatorName) {
|
||||||
const commonRegExp = {
|
const commonRegExp = {
|
||||||
number: '/^\\d+(\\.\\d+)?$/',
|
number: '/^[-]?\\d+(\\.\\d+)?$/',
|
||||||
letter: '/^[A-Za-z]+$/',
|
letter: '/^[A-Za-z]+$/',
|
||||||
letterAndNumber: '/^[A-Za-z0-9]+$/',
|
letterAndNumber: '/^[A-Za-z0-9]+$/',
|
||||||
mobilePhone: '/^[1][3-9][0-9]{9}$/',
|
mobilePhone: '/^[1][3-9][0-9]{9}$/',
|
||||||
|
|
|
@ -46,7 +46,7 @@ export const genVue3JS = function (formConfig, widgetList) {
|
||||||
const instance = getCurrentInstance()
|
const instance = getCurrentInstance()
|
||||||
|
|
||||||
const submitForm = () => {
|
const submitForm = () => {
|
||||||
instance.ctx.$refs['vForm'].validate(valid => {
|
instance.proxy.$refs['vForm'].validate(valid => {
|
||||||
if (!valid) return
|
if (!valid) return
|
||||||
|
|
||||||
//TODO: 提交表单
|
//TODO: 提交表单
|
||||||
|
@ -54,7 +54,7 @@ export const genVue3JS = function (formConfig, widgetList) {
|
||||||
}
|
}
|
||||||
|
|
||||||
const resetForm = () => {
|
const resetForm = () => {
|
||||||
instance.ctx.$refs['vForm'].resetFields()
|
instance.proxy.$refs['vForm'].resetFields()
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
Loading…
Reference in New Issue