封装新增组件

This commit is contained in:
qq787203167
2022-01-19 18:05:54 +08:00
parent e634323ff3
commit d33e38a4e0
+49 -4
View File
@@ -38,13 +38,25 @@
<span :class="{'title-text-text':false}">{{item.enName}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.name">
<a-form-model-item class="itemModel" :prop="item.attrModel">
<a-date-picker class="box-input" v-model="formInline[item.attrModel]" @change="onChange"
style="width: 100%"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.type === 'NUMBER'">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.attrModel">
<a-input-number class="box-input" v-model="formInline[item.attrModel]" :min="1" :max="99999999" @change="onChange" />
</a-form-model-item>
</div>
</a-col>
<a-col :span="12" v-else-if="item.type === 'SELECT'">
<div class="box-title-text">
<div class="title-text">
@@ -52,7 +64,7 @@
<span :class="{'title-text-text':false}">{{item.enName}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.name">
<a-form-model-item class="itemModel" :prop="item.attrModel">
<j-dict-select-tag class="box-input" v-model="formInline[item.attrModel]"
:placeholder="$t('selectStatus')" :type="'select'"
:triggerChange="false" dictCode="valid_status"/>
@@ -67,7 +79,7 @@
<span :class="{'title-text-text':false}">{{item.enName}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.name">
<a-form-model-item class="itemModel" :prop="item.attrModel">
<j-multi-select-tag class="box-input" v-model="formInline[item.attrModel]"
:placeholder="$t('selectStatus')" :type="'select'"
:triggerChange="false" dictCode="valid_status"/>
@@ -82,12 +94,24 @@
<span :class="{'title-text-text':false}">{{item.enName}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.name">
<a-form-model-item class="itemModel" :prop="item.attrModel">
<j-dict-select-tag v-model="formInline[item.attrModel]" :placeholder="$t('selectStatus')"
:type="'radio'" :triggerChange="false" dictCode="valid_status"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="24" v-else-if="item.type === 'TEXTAREA'">
<div class="box-title-text">
<div class="title-text">
<span class="Required">*</span>
<span :class="{'title-text-text':false}">{{item.enName}}</span><br>
<span :class="{'title-text-text':false}">{{item.name}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.attrModel">
<a-textarea :placeholder="$t('selectStatus')" v-model="formInline[item.attrModel]" :rows="4" />
</a-form-model-item>
</div>
</a-col>
</div>
</a-row>
@@ -173,6 +197,22 @@
placeholder: '请输入标题',
validStatus:'valid_status',
attrModel: 'selectAll'
},
{
id: 7,
type: 'NUMBER',
name: '数字输入框',
enName: 'title',
placeholder: '请输入数字输入框',
attrModel: 'number'
},
{
id: 8,
type: 'TEXTAREA',
name: '文本框',
enName: 'title',
placeholder: '请输入文本框',
attrModel: 'number'
}
],
validatorRules: {},
@@ -231,6 +271,10 @@
.box-input .ant-select-selection--multiple .ant-select-selection__rendered > ul > li{
margin-top:6px;
}
.box-input .ant-input-number-input-wrap{
line-height: 38px;
height: 38px;
}
</style>
<style scoped>
.box-title-text {
@@ -260,6 +304,7 @@
.itemModel {
width: calc(100% - 130px);
display: inline-block;
margin-top: 2px;
}
.Required {