tsg-app/pages/mypage/compents/wxyh/formZdy/formBottom.vue

95 lines
2.6 KiB
Vue
Raw Normal View History

2024-11-13 09:42:42 +08:00
<template>
<view>
<!-- 注意如果需要兼容微信小程序最好通过setRules方法设置rules规则 -->
<u--form labelPosition="left" :model="model1" ref="uForm" >
<u-form-item label="管护类型" prop="maintainType" borderBottom ref="item1"
required
labelPosition='top'
labelWidth="100px">
<u--input v-model="model1.maintainName" disabled disabledColor="#ffffff" placeholder="请选择管护类型"
border="none" ></u--input>
</u-form-item>
<u-form-item label="内容说明" prop="maintainContent" borderBottom labelPosition='top' required labelWidth="100px">
<u--textarea v-model="model1.maintainContent" placeholder="请输入内容" disabled></u--textarea>
</u-form-item>
<u-form-item label="现场图片" prop="pics" borderBottom labelPosition='top' labelWidth="100px">
<u-upload :fileList="model1.pics" name="pics" multiple disabled
multiple accept='image' :maxCount="10"></u-upload>
</u-form-item>
<u-form-item label="现场视频" prop="videos" borderBottom labelPosition='top' labelWidth="100px">
<u-upload :fileList="model1.videos" name="videos" multiple disabled
multiple accept='video' :maxCount="10"></u-upload>
</u-form-item>
</u--form>
</view>
</template>
<script>
export default {
props:{
formData:Object
},
data() {
return {
showSex: false,
fileListpics: [],
fileListvideos: [],
model1: {
maintainContent: "",
maintainType: '',
pics: [],
videos: []
},
actions: [{
value: 1,
name: "溢洪道清障"
},
{
value: 2,
name: "除草除杂"
},
{
value: 3,
name: "设备养护"
},
{
value: 4,
name: "环境清洁"
},
{
value: 5,
name: "危险提示"
},
{
value: 6,
name: "其他"
},
],
radio: '',
switchVal: false
};
},
mounted() {
this.model1 = this.formData
this.model1.maintainName = this.actions.find(item=>item.value == this.formData.maintainType).name
this.model1.pics?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
this.model1.videos?.map(item1=>{
item1.url ='http://223.75.53.141:9102/test.by-lyf.tmp' + item1.filePath
return item1
})
console.log(this.model1,'83498943r80432',this.formData);
},
methods: {
},
onReady() {
//如果需要兼容微信小程序并且校验规则中含有方法等只能通过setRules方法设置规则。
this.$refs.uForm.setRules(this.rules)
},
};
</script>