提交 28d62ed4 编写于 作者: glod-money-money's avatar glod-money-money

update:更新

上级 c3d3c2a3
<template> <template>
<div :class="{'app-field-image-dynamic':true,[`${cssClass}`]:cssClass?true:false}"> <div :class="['app-field-image-dynamic', model.sysCss]" :style="containerStyle">
<img :style="cssStyle" :src="imgUrl" /> <img :style="model.sysCss" :src="imgUrl" />
</div> </div>
</template> </template>
<script lang = 'ts'> <script lang = 'ts'>
import { Vue, Component, Prop, Watch, Provide } from 'vue-property-decorator'; import { Vue, Component, Prop, Watch, Provide } from 'vue-property-decorator';
import { ImgurlBase64 } from '@/utils'; import { ImgurlBase64 } from '@/utils';
import { Environment } from "@/environments/environment"; import { Environment } from "@/environments/environment";
import { PanelFieldModel } from '@/model/panel-detail';
@Component({}) @Component({})
export default class AppFieldImageDynamic extends Vue { export default class AppFieldImageDynamic extends Vue {
...@@ -14,57 +15,60 @@ export default class AppFieldImageDynamic extends Vue { ...@@ -14,57 +15,60 @@ export default class AppFieldImageDynamic extends Vue {
* 输入值 * 输入值
* *
* @type {string} * @type {string}
* @memberof AppRawItemImage * @memberof AppFieldImageDynamic
*/ */
@Prop() public value: any; @Prop() public value: any;
/** /**
* 样式 * 模型
* *
* @type {string} * @type {*}
* @memberof AppRawItemImage * @memberof AppFieldImageDynamic
*/
@Prop() public cssStyle?: string;
/**
* 样式表类名
*
* @type {string}
* @memberof AppRawItemImage
*/ */
@Prop({default:''}) public cssClass?: string; @Prop() public model!: PanelFieldModel;
/** /**
* 动态图片路径 * 动态图片路径
* *
* @memberof AppPresetRawitem * @memberof AppFieldImageDynamic
*/ */
protected dynaImgUrl: string = ''; protected dynaImgUrl: string = '';
/** /**
* 下载文件路径 * 下载文件路径
* *
* @memberof AppPresetRawitem * @memberof AppFieldImageDynamic
*/ */
public downloadUrl = Environment.ExportFile; public downloadUrl = Environment.ExportFile;
/**
* 容器样式
*
* @type {any}
* @memberof AppFieldImageDynamic
*/
public containerStyle: any = null;
/** /**
* 图片路径 * 图片路径
* *
* @memberof AppPresetRawitem * @memberof AppFieldImageDynamic
*/ */
get imgUrl(): string { get imgUrl(): string {
return this.dynaImgUrl; return this.dynaImgUrl;
} }
created() { created() {
if (this.model) {
this.containerStyle = this.model.getElementStyle();
}
this.handleDynaImg(); this.handleDynaImg();
} }
/** /**
* 处理动态图片 * 处理动态图片
* *
* @memberof AppPresetRawitem * @memberof AppFieldImageDynamic
*/ */
protected handleDynaImg() { protected handleDynaImg() {
if (this.value && typeof this.value == "string") { if (this.value && typeof this.value == "string") {
......
<template> <template>
<div class="app-rawitem-carousel"> <div :class="['app-rawitem-carousel',model.sysCss]" :style="containerStyle" >
<el-carousel class="carsouel-container" <el-carousel class="carsouel-container"
height="150px" height="150px"
indicator-position="outside" indicator-position="outside"
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
</div> </div>
</template> </template>
<script lang='ts'> <script lang='ts'>
import { PanelFieldModel } from '@/model/panel-detail';
import { Component, Vue, Prop, Watch } from 'vue-property-decorator'; import { Component, Vue, Prop, Watch } from 'vue-property-decorator';
@Component({}) @Component({})
export default class AppCarousel extends Vue { export default class AppCarousel extends Vue {
...@@ -23,7 +24,7 @@ export default class AppCarousel extends Vue { ...@@ -23,7 +24,7 @@ export default class AppCarousel extends Vue {
* 父项所有数据 * 父项所有数据
* *
* @type {*} * @type {*}
* @memberof AppPresetCarousel * @memberof AppCarousel
*/ */
@Prop() public data?: any; @Prop() public data?: any;
...@@ -35,18 +36,12 @@ export default class AppCarousel extends Vue { ...@@ -35,18 +36,12 @@ export default class AppCarousel extends Vue {
@Prop() public value?: any; @Prop() public value?: any;
/** /**
* @description 轮播图样式 * 模型
* @param {*} *
* @type {*}
* @memberof AppCarousel * @memberof AppCarousel
*/ */
@Prop() public cssStyle?: any; @Prop() public model!: PanelFieldModel;
/**
* @description 样式表
* @param {*}
* @memberof AppCarousel
*/
@Prop() public cssClass?: any;
/** /**
* 名称 * 名称
...@@ -77,6 +72,14 @@ export default class AppCarousel extends Vue { ...@@ -77,6 +72,14 @@ export default class AppCarousel extends Vue {
*/ */
public swipeConfig: any = {}; public swipeConfig: any = {};
/**
* 容器样式
*
* @type {any}
* @memberof AppCarousel
*/
public containerStyle: any = null;
/** /**
* data值变化 * data值变化
* *
...@@ -87,7 +90,7 @@ export default class AppCarousel extends Vue { ...@@ -87,7 +90,7 @@ export default class AppCarousel extends Vue {
@Watch('value', { immediate: true, deep: true }) @Watch('value', { immediate: true, deep: true })
public onDataChange(newVal: any, oldVal: any) { public onDataChange(newVal: any, oldVal: any) {
if (newVal) { if (newVal) {
// this.handleSwipData(newVal); this.handleSwipData(newVal);
} }
} }
...@@ -96,6 +99,9 @@ export default class AppCarousel extends Vue { ...@@ -96,6 +99,9 @@ export default class AppCarousel extends Vue {
* @memberof AppCarousel * @memberof AppCarousel
*/ */
created() { created() {
if (this.model) {
this.containerStyle = this.model.getElementStyle();
}
//处理轮播图-动态数据 //处理轮播图-动态数据
if (this.type === "FIELD_CAROUSEL") { if (this.type === "FIELD_CAROUSEL") {
if (this.value && typeof this.value === 'string') { if (this.value && typeof this.value === 'string') {
......
<template> <template>
<div class='app-rawitem-image'> <div :class="['app-rawitem-image', model.sysCss]" :style="containerStyle">
<img :style="cssStyle" v-if="imgUrl" :src="imgUrl" /> <img v-if="imgUrl" :src="imgUrl" />
<i :style="cssStyle" v-else :class="imageClass ? imageClass : ''"></i> <i v-else :class="imageClass ? imageClass : ''"></i>
</div> </div>
</template> </template>
<script lang = 'ts'> <script lang = 'ts'>
import { PanelFieldModel } from '@/model/panel-detail';
import { Vue, Component, Prop, Watch, Provide } from 'vue-property-decorator'; import { Vue, Component, Prop, Watch, Provide } from 'vue-property-decorator';
@Component({}) @Component({})
export default class AppRawItemImage extends Vue { export default class AppRawItemImage extends Vue {
/** /**
* 样式 * 模型
* *
* @type {string} * @type {*}
* @memberof AppRawItemImage * @memberof AppRawItemImage
*/ */
@Prop() public cssStyle: any; @Prop() public model!: PanelFieldModel;
/** /**
* 样式表 * 图片地址
* *
* @type {string} * @type {string}
* @memberof AppRawItemImage * @memberof AppRawItemImage
*/ */
@Prop() public cssClass: any; @Prop() public imgUrl?: string;
/** /**
* 图片地址 * 图
* *
* @type {string} * @type {string}
* @memberof AppRawItemImage * @memberof AppRawItemImage
*/ */
@Prop() public imgUrl?:string; @Prop() public imageClass?: string;
/** /**
* 图标 * 容器样式
* *
* @type {string} * @type {any}
* @memberof AppRawItemImage * @memberof AppRawItemImage
*/ */
@Prop() public imageClass?:string; public containerStyle: any = null;
created() {
if (this.model) {
this.containerStyle = this.model.getElementStyle();
}
}
} }
</script> </script>
<style lang = "less"> <style lang = "less">
......
...@@ -10,19 +10,41 @@ ...@@ -10,19 +10,41 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { PanelFieldModel } from '@/model/panel-detail';
import { Util } from '@/utils'; import { Util } from '@/utils';
import { Component, Vue, Prop } from 'vue-property-decorator'; import { Component, Vue, Prop } from 'vue-property-decorator';
@Component({}) @Component({})
export default class AppVideo extends Vue { export default class AppRawItemVideo extends Vue {
/**
* 视频播放数据
* @memberof AppRawItemVideo
*/
@Prop() public videoParmas?: any;
/**
* 模型
*
* @type {*}
* @memberof @memberof AppRawItemVideo
*/
@Prop() public model!: PanelFieldModel;
/** /**
* 播放器唯一标识 * 播放器唯一标识
* @memberof AppRawItemVideo
*/ */
public uuid: string = Util.createUUID(); public uuid: string = Util.createUUID();
/** /**
* 视频播放数据 * 容器样式
*
* @type {any}
* @memberof AppRawItemVideo
*/ */
@Prop() public videoParmas?: any; public containerStyle: any = null;
//视频播放参数 //视频播放参数
public playerParams = { public playerParams = {
...@@ -39,6 +61,7 @@ export default class AppVideo extends Vue { ...@@ -39,6 +61,7 @@ export default class AppVideo extends Vue {
/** /**
* 生命周期 * 生命周期
* @memberof AppRawItemVideo
*/ */
public mounted() { public mounted() {
this.handleStaticVideo(); this.handleStaticVideo();
...@@ -47,15 +70,15 @@ export default class AppVideo extends Vue { ...@@ -47,15 +70,15 @@ export default class AppVideo extends Vue {
/** /**
* 处理静态视频播放 * 处理静态视频播放
* *
* @memberof AppPresetRawitem * @memberof AppRawItemVideo
*/ */
protected handleStaticVideo() { protected handleStaticVideo() {
if (this.videoParmas && this.videoParmas.length > 0) { if (this.videoParmas && this.videoParmas.length > 0) {
const rawParams:any = {}; const rawParams: any = {};
this.videoParmas.forEach((param: any) => { this.videoParmas.forEach((param: any) => {
rawParams[param.key] = param.value; rawParams[param.key] = param.value;
}) })
Object.assign(this.playerParams,rawParams); Object.assign(this.playerParams, rawParams);
} }
} }
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册