diff --git a/src/views/tools/form/center.vue b/src/views/tools/form/center.vue index 30b6b47..6d4872c 100644 --- a/src/views/tools/form/center.vue +++ b/src/views/tools/form/center.vue @@ -4,60 +4,7 @@ - - - - - - - - - - - - - - - - - - - {{ fields[index].btnText }} - - - - - - - - {{ fields[index].tip }} - - - - - - - - - - - - - - - + @@ -65,13 +12,7 @@ @@ -161,18 +41,6 @@ function copyComp(index) { display: none; } -:deep(.ghostClass) { - .comp { - display: none; - } - - .tips { - padding: 10px; - border: 1px dashed var(--el-color-primary); - text-align: center; - color: var(--el-color-primary); - } -} .height-100 { height: 100%; @@ -182,50 +50,4 @@ function copyComp(index) { height: 100%; } -.active { - border: 1px dashed #787be8 !important; - color: #787be8; -} - -.box { - position: relative; - cursor: pointer; - - .item { - padding: 12px 10px; - border: 1px; - border-radius: 3px; - position: relative; - } - - .tools-box { - position: absolute; - right: 10px; - top: -16px; - display: inline-block; - padding: 5px; - border-radius: 4px; - - .icon-box { - cursor: pointer; - } - - .icon-box.remove { - color: var(--el-color-danger); - } - - .icon-box.copy { - color: var(--el-color-primary); - } - - .ml5 { - margin-left: 5px; - } - - .disabled { - cursor: no-drop; - color: #c3c3c3; - } - } -} diff --git a/src/views/tools/form/config.ts b/src/views/tools/form/config.ts index 9002ec8..2e6ef85 100644 --- a/src/views/tools/form/config.ts +++ b/src/views/tools/form/config.ts @@ -186,6 +186,25 @@ export const fieldEditors = { {key: 'props.clearable', label: '能否清空', type: 'switch'}, {key: 'props.readonly', label: '是否只读', type: 'switch'}, {key: 'props.disabled', label: '是否禁用', type: 'switch'}, + ], + button: [ + {key: 'btnText', label: '按钮文字', type: 'input'}, + { + key: 'props.type', label: '按钮类型', type: 'select', options: [ + {label: 'primary', value: 'primary'}, + {label: 'success', value: 'success'}, + {label: 'warning', value: 'warning'}, + {label: 'danger', value: 'danger'}, + {label: 'info', value: 'info'}, + {label: 'default', value: ''}, + ] + }, + {key: 'props.icon', label: '图标', type: 'icon'}, + {key: 'props.plain', label: '朴素按钮', type: 'switch'}, + {key: 'props.text', label: '文字按钮', type: 'switch'}, + {key: 'props.round', label: '圆角按钮', type: 'switch'}, + {key: 'props.circle', label: '圆形按钮', type: 'switch'}, + {key: 'props.disabled', label: '是否禁用', type: 'switch'}, ] } // 'year' | 'years' |'month' | 'months' | 'date' | 'dates' | 'datetime' | 'week' | 'datetimerange' | 'daterange' | 'monthrange' | 'yearrange' @@ -208,8 +227,7 @@ export const getComponent = (type) => { daterange: 'el-date-picker', time: 'el-time-picker', timerange: 'el-time-picker', - icon: 'pi-icon', - asset: 'pi-asset' + button: 'el-button' } return map[type] || 'div' } diff --git a/src/views/tools/form/drag.vue b/src/views/tools/form/drag.vue new file mode 100644 index 0000000..61050c1 --- /dev/null +++ b/src/views/tools/form/drag.vue @@ -0,0 +1,187 @@ + + + + + + {{ element.field }} + + + + + + + + + + + + + + + + + + + diff --git a/src/views/tools/form/item.vue b/src/views/tools/form/item.vue new file mode 100644 index 0000000..510cd14 --- /dev/null +++ b/src/views/tools/form/item.vue @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + {{ field.btnText }} + + + + + + + + + + {{ field.tip }} + + + + {{ field.btnText }} + + + + + + + + diff --git a/src/views/tools/form/left.vue b/src/views/tools/form/left.vue index 952307c..552421e 100644 --- a/src/views/tools/form/left.vue +++ b/src/views/tools/form/left.vue @@ -266,19 +266,23 @@ const choiceComps = [{ btnText: "点击上传" }] const layoutComps = [{ - id: 'l1', + id: 'row', title: "行容器", icon: "pi-icon-row-layout", name: "layout", - props: {}, - rules: [] + props: { + gutter: '15' + }, + children: [] }, { id: 'l2', title: "按钮", icon: "pi-icon-button", name: "button", - props: {}, - rules: [] + props: { + type: 'primary' + }, + btnText: "按钮文字" }]; let num = ref(100) diff --git a/src/views/tools/form/right.vue b/src/views/tools/form/right.vue index d9c5d08..6357424 100644 --- a/src/views/tools/form/right.vue +++ b/src/views/tools/form/right.vue @@ -4,13 +4,13 @@ - + - + @@ -19,6 +19,7 @@ v-if="item.type === 'input'" :model-value="getByPath(fForm, item.key)" @input="val => setByPath(fForm, item.key, val)" + clearable />