修改添加组件

This commit is contained in:
qq787203167
2022-01-21 16:54:05 +08:00
committed by xiejunyu
parent d33e38a4e0
commit bbb21b9175
30 changed files with 2661 additions and 16 deletions
+84 -14
View File
@@ -39,7 +39,7 @@
<span :class="{'title-text-text':false}">{{item.name}}</span>
</div>
<a-form-model-item class="itemModel" :prop="item.attrModel">
<a-date-picker class="box-input" v-model="formInline[item.attrModel]" @change="onChange"
<a-date-picker class="box-input" v-model="formInline[item.attrModel]"
style="width: 100%"/>
</a-form-model-item>
</div>
@@ -53,7 +53,7 @@
<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-input-number class="box-input" v-model="formInline[item.attrModel]" :min="1" :max="99999999"/>
</a-form-model-item>
</div>
</a-col>
@@ -81,8 +81,8 @@
</div>
<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"/>
:placeholder="$t('selectStatus')" :type="'select'"
:triggerChange="false" dictCode="valid_status"/>
</a-form-model-item>
</div>
</a-col>
@@ -108,20 +108,57 @@
<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-textarea :placeholder="$t('selectStatus')" v-model="formInline[item.attrModel]" :rows="4"/>
</a-form-model-item>
</div>
</a-col>
<a-col :span="24" v-else-if="item.type === 'FILE'">
<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-button type="primary" style="height: 38px;width: calc(50% - 80px);line-height: 38px"
@click="clickButtonToUpload(item.attrModel)">
{{ (formInline[item.attrModel] === 'null' || formInline[item.attrModel] === '' ||
formInline[item.attrModel] == null) ? '上传文件' : '查看已上传文件'
}}
</a-button>
</a-form-model-item>
</div>
</a-col>
<a-col :span="24" v-else-if="item.type === 'STANDARD'">
<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">
<Standardselection :query="item" v-model="formInline[item.attrModel]"/>
</a-form-model-item>
</div>
</a-col>
</div>
</a-row>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>
</a-form-model>
</a-spin>
</template>
<script>
import uploadFile from '@/components/uploadFile/file'
import Standardselection from '@/components/Standardselection/index'
export default {
name: 'index',
components: {
uploadFile,
Standardselection
},
props: {
url: {
type: Object,
@@ -178,7 +215,7 @@
enName: 'title',
placeholder: '请输入标题',
attrModel: 'checkbox',
validStatus:'valid_status',
validStatus: 'valid_status'
},
{
id: 5,
@@ -187,7 +224,7 @@
enName: 'title',
placeholder: '请输入标题',
attrModel: 'radio',
validStatus:'valid_status',
validStatus: 'valid_status'
},
{
id: 6,
@@ -195,7 +232,7 @@
name: '下拉多选',
enName: 'title',
placeholder: '请输入标题',
validStatus:'valid_status',
validStatus: 'valid_status',
attrModel: 'selectAll'
},
{
@@ -213,10 +250,27 @@
enName: 'title',
placeholder: '请输入文本框',
attrModel: 'number'
},
{
id: 9,
type: 'FILE',
name: '上传文件',
enName: 'UploadFile',
placeholder: '请输入文本框',
attrModel: 'file'
},
{
id: 10,
type: 'STANDARD',
name: '标准选择',
enName: 'standard',
placeholder: '请手动输入或者选择标准',
attrModel: 'standard'
}
],
validatorRules: {},
confirmLoading: false
confirmLoading: false,
uploadName: ''
}
},
mounted() {
@@ -225,7 +279,6 @@
},
methods: {
sumber() {
console.log(1)
this.$refs.ruleForm.validate(valid => {
if (valid) {
alert('submit!')
@@ -234,7 +287,22 @@
return false
}
})
}
},
clickButtonToUpload(current) {
this.$refs.uploadFile.visible = true
this.uploadName = current
},
/** 上传文件的回调 */
uploadSuccess(data) {
console.log(data)
let attIdList = []
data.map(item => {
attIdList.push(item.id || data.name)
})
/** 赋值给当前对应的表单文件 */
this.formInline[this.uploadName] = attIdList.join(',')
this.formInline = { ...this.formInline }
},
}
}
</script>
@@ -268,10 +336,12 @@
line-height: 38px;
height: 38px;
}
.box-input .ant-select-selection--multiple .ant-select-selection__rendered > ul > li{
margin-top:6px;
.box-input .ant-select-selection--multiple .ant-select-selection__rendered > ul > li {
margin-top: 6px;
}
.box-input .ant-input-number-input-wrap{
.box-input .ant-input-number-input-wrap {
line-height: 38px;
height: 38px;
}