Commit 93b539cf authored by miaojiale's avatar miaojiale

提交表格基本样式

parent 48c9269f
<template> <template>
<el-row <el-row :gutter="options.gutter" class="form-content">
:gutter="options.gutter"
class="form-content"
:style="{
paddingLeft,
}"
>
<template <template
v-for="(item, columnIndex) in columns.column || columns.children.column" v-for="(item, columnIndex) in columns.column || columns.children.column"
> >
<div <div
v-if="item.type === 'dynamic'" v-if="item.type === 'dynamic'"
v-show="item.display"
:key="columnIndex" :key="columnIndex"
style="width: 100%" style="width: 100%"
v-show="item.display"
class="dynamic-form-container" class="dynamic-form-container"
> >
<el-form-item <el-form-item
...@@ -24,18 +18,18 @@ ...@@ -24,18 +18,18 @@
</el-form-item> </el-form-item>
<div class="dynamic-form-container_lable">{{ item.label }}</div> <div class="dynamic-form-container_lable">{{ item.label }}</div>
<form-dynamic <form-dynamic
v-model="form[item.prop]"
:options="item.children" :options="item.children"
:dynamic-data="item.dynamicData" :dynamic-data="item.dynamicData"
:is-show-important="isShowImportant" :is-show-important="isShowImportant"
v-model="form[item.prop]"
></form-dynamic> ></form-dynamic>
</div> </div>
<div <div
v-else-if="item.type === 'group'" v-else-if="item.type === 'group'"
v-show="item.display"
:key="columnIndex" :key="columnIndex"
style="width: 100%" style="width: 100%"
v-show="item.display"
> >
<el-collapse :value="item.collapse ? item.prop : ''"> <el-collapse :value="item.collapse ? item.prop : ''">
<el-collapse-item <el-collapse-item
...@@ -56,9 +50,9 @@ ...@@ -56,9 +50,9 @@
<div <div
v-else-if="item.type === 'dental-tab'" v-else-if="item.type === 'dental-tab'"
v-show="item.display && isShowIm(item.importantField)"
:key="columnIndex" :key="columnIndex"
style="width: 100%" style="width: 100%"
v-show="item.display && isShowIm(item.importantField)"
> >
<el-form-item <el-form-item
:prop="item.prop" :prop="item.prop"
...@@ -68,8 +62,8 @@ ...@@ -68,8 +62,8 @@
</el-form-item> </el-form-item>
<dental-tab-form <dental-tab-form
ref="dental" ref="dental"
:item="item"
v-model="form[item.prop]" v-model="form[item.prop]"
:item="item"
:disabled="options.disabled" :disabled="options.disabled"
@change="handleChange" @change="handleChange"
></dental-tab-form> ></dental-tab-form>
...@@ -77,9 +71,9 @@ ...@@ -77,9 +71,9 @@
<div <div
v-else-if="item.type === 'dental-tab-tj'" v-else-if="item.type === 'dental-tab-tj'"
v-show="item.display && isShowIm(item.importantField)"
:key="columnIndex" :key="columnIndex"
style="width: 100%" style="width: 100%"
v-show="item.display && isShowIm(item.importantField)"
> >
<el-form-item <el-form-item
:prop="item.prop" :prop="item.prop"
...@@ -89,20 +83,21 @@ ...@@ -89,20 +83,21 @@
</el-form-item> </el-form-item>
<dental-tab-tj-form <dental-tab-tj-form
ref="dental" ref="dental"
:item="item"
v-model="form[item.prop]" v-model="form[item.prop]"
:item="item"
:disabled="options.disabled" :disabled="options.disabled"
></dental-tab-tj-form> ></dental-tab-tj-form>
</div> </div>
<el-col <el-col
v-else-if="item.type === 'title'" v-else-if="item.type === 'title'"
v-show="item.display"
:key="columnIndex"
class="row12"
:xs="item.xs || 24" :xs="item.xs || 24"
:sm="item.sm || 24" :sm="item.sm || 24"
:md="item.md || 24" :md="item.md || 24"
:lg="item.span || 12" :lg="item.span || 12"
:key="columnIndex"
v-show="item.display"
> >
<div class="form_title" :style="item.styles"> <div class="form_title" :style="item.styles">
<span>{{ item.value }}</span> <span>{{ item.value }}</span>
...@@ -111,16 +106,18 @@ ...@@ -111,16 +106,18 @@
<el-col <el-col
v-else v-else
v-show="item.display && isShowIm(item.importantField)"
:key="columnIndex"
class="row24"
:xs="item.xs || 24" :xs="item.xs || 24"
:sm="item.sm || 24" :sm="item.sm || 24"
:md="item.md || 24" :md="item.md || 24"
:lg="item.lg || item.span || 12" :lg="item.lg || item.span || 12"
:xl="item.span || 12" :xl="item.span || 12"
:key="columnIndex"
v-show="item.display && isShowIm(item.importantField)"
> >
<form-item-self <form-item-self
:form="form" :form="form"
:column-index="columnIndex"
:item="item" :item="item"
:columns="columns.column || columns.children.column" :columns="columns.column || columns.children.column"
:group="options.group" :group="options.group"
...@@ -173,11 +170,6 @@ export default { ...@@ -173,11 +170,6 @@ export default {
data() { data() {
return {} return {}
}, },
methods: {
handleChange(key, val) {
if (this.form.hasOwnProperty(key)) this.form[key] = val
},
},
computed: { computed: {
isShowIm() { isShowIm() {
...@@ -190,10 +182,22 @@ export default { ...@@ -190,10 +182,22 @@ export default {
return columns.labelWidth ? `${columns.labelWidth}px` : "" return columns.labelWidth ? `${columns.labelWidth}px` : ""
}, },
}, },
methods: {
handleChange(key, val) {
if (this.form.hasOwnProperty(key)) this.form[key] = val
},
},
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep {
.row24.el-col-lg-12 {
&:nth-child(2n) {
border-left: 1px solid #ccc;
}
}
}
.form-content ::v-deep { .form-content ::v-deep {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
......
...@@ -109,7 +109,8 @@ export default { ...@@ -109,7 +109,8 @@ export default {
name: "CustomForm", name: "CustomForm",
components: { FormContent }, components: { FormContent },
props: { props: {
options: { //配置 数据 options: {
//配置 数据
type: Object, type: Object,
default: () => { default: () => {
return {} return {}
...@@ -318,19 +319,36 @@ export default { ...@@ -318,19 +319,36 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.avue-form-self { .avue-form-self {
padding: 0 11px; padding: 0 11px;
::v-deep .el-collapse { ::v-deep .el-collapse {
border: none; border: none;
.el-collapse-item {
.el-collapse-item__header.is-active { &:nth-child(1) {
border-bottom-color: #ebeef5; border-top: 1px solid #e5e5e5;
}
}
.el-collapse-item__content {
padding-bottom: 0px;
}
.el-collapse-item__header {
background: #fafafa;
text-indent: 20px;
border: 1px solid #e5e5e5;
border-bottom-color: #ccc;
border-top: 0px;
font-size: 14px;
font-family: AlibabaPuHuiTiM;
color: #333333;
} }
.el-collapse-item__wrap { .el-collapse-item__wrap {
border: none; border: none;
padding: 10px; padding: 10px;
border-left: 1px solid #e5e5e5;
border-right: 1px solid #e5e5e5;
// border-bottom: 1px solid #e5e5e5 !important;
padding: 0px;
&:hover { &:hover {
background-color: #ecf8ff; // background-color: #ecf8ff;
outline: 1px dashed #ccc; // outline: 1px dashed #ccc;
} }
} }
.el-collapse-item__header { .el-collapse-item__header {
......
...@@ -9,11 +9,18 @@ export default { ...@@ -9,11 +9,18 @@ export default {
components: { components: {
ConfigForms, ConfigForms,
}, },
provide() {
const showIndex = true
return {
showIndex,
}
},
data() { data() {
return {} return {}
}, },
methods: {},
created() {}, created() {},
methods: {},
} }
</script> </script>
......
...@@ -306,6 +306,7 @@ export default { ...@@ -306,6 +306,7 @@ export default {
.el-main { .el-main {
position: relative; position: relative;
padding: 0; padding: 0;
.arrow { .arrow {
position: absolute; position: absolute;
right: 0; right: 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment