新增辅助线和文件显示
parent
1cf41fb1a8
commit
6bdd08d084
|
|
@ -0,0 +1,62 @@
|
|||
<template>
|
||||
<!-- 视频 -->
|
||||
<view :style="propStyle + 'height:100%;color:' + com_data.text_color + ';'">
|
||||
{{ isEmpty(form_value) ? '没有内容' : form_value }}
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { isEmpty } from '@/common/js/common/common.js';
|
||||
export default {
|
||||
props: {
|
||||
propValue: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
propKey: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
propDataIndex: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
propStyle: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
propIsCustom: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
com_data: {},
|
||||
form_value: '',
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
propKey(val) {
|
||||
// 初始化
|
||||
this.init();
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
isEmpty,
|
||||
// 初始化数据
|
||||
init() {
|
||||
const com_data = this.propValue;
|
||||
this.setData({
|
||||
com_data: com_data,
|
||||
form_value: com_data?.form_value || '',
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
<template>
|
||||
<!-- 视频 -->
|
||||
<view :style="propStyle + 'height:100%;color:' + com_data.text_color + ';'">
|
||||
{{ isEmpty(form_value) ? '没有内容' : form_value }}
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { isEmpty } from '@/common/js/common/common.js';
|
||||
export default {
|
||||
props: {
|
||||
propValue: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
propKey: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
propDataIndex: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
propStyle: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
propIsCustom: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
com_data: {},
|
||||
form_value: '',
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
propKey(val) {
|
||||
// 初始化
|
||||
this.init();
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
isEmpty,
|
||||
// 初始化数据
|
||||
init() {
|
||||
const com_data = this.propValue;
|
||||
this.setData({
|
||||
com_data: com_data,
|
||||
form_value: com_data?.form_value || '',
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
|
|
@ -64,6 +64,9 @@
|
|||
<view v-else-if="item.key == 'video'">
|
||||
<component-video :propValue="item.com_data" :propKey="propKey" :propDataIndex="index" :propMobile="mobile" :propStyle="component_style" :propDirection="flex_direction"></component-video>
|
||||
</view>
|
||||
<view v-else-if="item.key == 'text'">
|
||||
<component-text :propValue="item.com_data" :propKey="propKey" :propDataIndex="index" :propMobile="mobile" :propStyle="component_style" :propDirection="flex_direction"></component-text>
|
||||
</view>
|
||||
<view v-if="!isEmpty(item.com_data.common_config.error_text)" class="field-invalid-info">{{ item.com_data.common_config.error_text }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -108,6 +111,7 @@ import componentPwd from '@/pages/form-input/components/form-input/pwd.vue';
|
|||
import componentScore from '@/pages/form-input/components/form-input/score.vue';
|
||||
import componentImage from '@/pages/form-input/components/form-input/image.vue';
|
||||
import componentVideo from '@/pages/form-input/components/form-input/video.vue';
|
||||
import componentText from '@/pages/form-input/components/form-input/text.vue';
|
||||
import componentRegionPicker from '@/pages/common/components/region-picker/region-picker';
|
||||
export default {
|
||||
name: 'formInput',
|
||||
|
|
@ -127,7 +131,8 @@ export default {
|
|||
componentPwd,
|
||||
componentScore,
|
||||
componentImage,
|
||||
componentVideo
|
||||
componentVideo,
|
||||
componentText
|
||||
},
|
||||
props: {
|
||||
propValue: {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<view class="form-input-image">
|
||||
<image-empty :propImageSrc="com_data.img_src[0]" :propStyle="img_style" propErrorStyle="width: 100rpx;height: 100rpx;"></image-empty>
|
||||
<image-empty :propImageSrc="img_src" :propStyle="img_style" propErrorStyle="width: 100rpx;height: 100rpx;"></image-empty>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
|
@ -36,6 +36,7 @@
|
|||
data() {
|
||||
return {
|
||||
com_data: {},
|
||||
img_src: '',
|
||||
img_style: 'width: 100%;height:100%;',
|
||||
};
|
||||
},
|
||||
|
|
@ -60,6 +61,7 @@
|
|||
}
|
||||
this.setData({
|
||||
com_data: com_data,
|
||||
img_src: com_data.img_src.length > 0 ? com_data.img_src[0] : '',
|
||||
img_style: img_style,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,62 @@
|
|||
<template>
|
||||
<!-- 视频 -->
|
||||
<view :style="propStyle + 'height:100%;color:' + com_data.text_color + ';'">
|
||||
{{ isEmpty(form_value) ? '没有内容' : form_value }}
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { isEmpty } from '@/common/js/common/common.js';
|
||||
export default {
|
||||
props: {
|
||||
propValue: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
propKey: {
|
||||
type: [String, Number],
|
||||
default: 0,
|
||||
},
|
||||
propDataIndex: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
propStyle: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
propIsCustom: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
com_data: {},
|
||||
form_value: '',
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
propKey(val) {
|
||||
// 初始化
|
||||
this.init();
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
isEmpty,
|
||||
// 初始化数据
|
||||
init() {
|
||||
const com_data = this.propValue;
|
||||
this.setData({
|
||||
com_data: com_data,
|
||||
form_value: com_data?.form_value || '',
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
||||
|
|
@ -62,12 +62,14 @@
|
|||
const com_data = this.propValue;
|
||||
let video_style = `width: 100%;height:100%;`;
|
||||
if (!this.propIsCustom && !isEmpty(com_data)) {
|
||||
const { video_width, video_scale_type } = form.value;
|
||||
const { video_width, video_scale_type } = com_data;
|
||||
const height = video_scale_type === '1' ? video_width : video_scale_type == '0' ? (video_width * 9) / 16 : (video_width * 3) / 4;
|
||||
video_style = `width: ${ video_width * 2 }rpx;height:${ height * 2 }rpx;`
|
||||
}
|
||||
this.setData({
|
||||
com_data: com_data,
|
||||
video: com_data.video.length > 0 ? com_data.video[0].url : '',
|
||||
video_img: com_data.video_img.length > 0 ? com_data.video_img[0].url : '',
|
||||
video_style: video_style,
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue