提交 32a9de83 编写于 作者: tony001's avatar tony001

update:更新

上级 b5e06fb8
...@@ -109,12 +109,12 @@ import AppInputIp from './components/app-input-ip/app-input-ip.vue'; ...@@ -109,12 +109,12 @@ import AppInputIp from './components/app-input-ip/app-input-ip.vue';
import Loadding from './directive/loadding/loadding'; import Loadding from './directive/loadding/loadding';
import AppColorSpan from './components/app-color-span/app-color-span.vue'; import AppColorSpan from './components/app-color-span/app-color-span.vue';
import AppColorPicker from './components/app-color-picker/app-color-picker.vue'; import AppColorPicker from './components/app-color-picker/app-color-picker.vue';
import AppScrollContainer from './components/layout-element/container/app-scroll-container/app-scroll-container.vue'; import AppScrollContainer from './components/layout-element/structure/app-scroll-container/app-scroll-container.vue';
import AppSimpleFlexContainer from './components/layout-element/container/app-simpleflex-container/app-simpleflex-container.vue'; import AppSimpleFlexContainer from './components/layout-element/structure/app-simpleflex-container/app-simpleflex-container.vue';
import AppStandardContainer from './components/layout-element/container/app-standard-container/app-standard-container.vue'; import AppStandardContainer from './components/layout-element/structure/app-standard-container/app-standard-container.vue';
import AppTabPanel from './components/layout-element/container/app-tab-panel/app-tab-panel.vue'; import AppTabPanel from './components/layout-element/structure/app-tab-panel/app-tab-panel.vue';
import AppTabPage from './components/layout-element/container/app-tab-page/app-tab-page.vue'; import AppTabPage from './components/layout-element/structure/app-tab-page/app-tab-page.vue';
import AppNavPos from './components/layout-element/container/app-nav-pos/app-nav-pos.vue'; import AppNavPos from './components/layout-element/structure/app-nav-pos/app-nav-pos.vue';
import AppPresetText from './components/layout-element/text/app-preset-text/app-preset-text.vue'; import AppPresetText from './components/layout-element/text/app-preset-text/app-preset-text.vue';
import AppPresetCaption from './components/layout-element/text/app-preset-caption/app-preset-caption.vue'; import AppPresetCaption from './components/layout-element/text/app-preset-caption/app-preset-caption.vue';
import AppPresetTitle from './components/layout-element/text/app-preset-title/app-preset-title.vue'; import AppPresetTitle from './components/layout-element/text/app-preset-title/app-preset-title.vue';
...@@ -135,7 +135,7 @@ import AppIndexNavTabs from './components/layout-element/index/app-index-nav-tab ...@@ -135,7 +135,7 @@ import AppIndexNavTabs from './components/layout-element/index/app-index-nav-tab
import AppIndexNavBreadcrumb from './components/layout-element/index/app-index-nav-breadcrumb/app-index-nav-breadcrumb.vue'; import AppIndexNavBreadcrumb from './components/layout-element/index/app-index-nav-breadcrumb/app-index-nav-breadcrumb.vue';
import AppIndexOrgSelect from './components/layout-element/index/app-index-org-select/app-index-org-select.vue'; import AppIndexOrgSelect from './components/layout-element/index/app-index-org-select/app-index-org-select.vue';
import AppIndexUserInfo from './components/layout-element/index/app-index-user-info/app-index-user-info.vue'; import AppIndexUserInfo from './components/layout-element/index/app-index-user-info/app-index-user-info.vue';
import AppCtrlPos from './components/layout-element/control/app-ctrl-pos/app-ctrl-pos.vue'; import AppCtrlPos from './components/layout-element/structure/app-ctrl-pos/app-ctrl-pos.vue';
import AppPresetButton from './components/layout-element/interactive/app-preset-button/app-preset-button.vue'; import AppPresetButton from './components/layout-element/interactive/app-preset-button/app-preset-button.vue';
import AppFieldImageDynamic from './components/layout-element/media/app-field-image-dynamic/app-field-image-dynamic.vue'; import AppFieldImageDynamic from './components/layout-element/media/app-field-image-dynamic/app-field-image-dynamic.vue';
// 全局挂载UI实体服务注册中心 // 全局挂载UI实体服务注册中心
......
...@@ -8,7 +8,7 @@ import { Component, Inject, Prop, Vue } from "vue-property-decorator"; ...@@ -8,7 +8,7 @@ import { Component, Inject, Prop, Vue } from "vue-property-decorator";
@Component({}) @Component({})
export default class AppIndexNavBreadcrumb extends Vue { export default class AppIndexNavBreadcrumb extends Vue {
/** /**
* 名称 * 名称
* *
...@@ -39,27 +39,36 @@ export default class AppIndexNavBreadcrumb extends Vue { ...@@ -39,27 +39,36 @@ export default class AppIndexNavBreadcrumb extends Vue {
* @type {string} * @type {string}
* @memberof ${srfclassname('${ctrl.codeName}')}Base * @memberof ${srfclassname('${ctrl.codeName}')}Base
*/ */
@Inject({ from:'navModel', default: 'tab' }) @Inject({ from: 'navModel', default: 'tab' })
public navModel!: string; public navModel!: string;
/** /**
* 当前布局模型 * 下标
* *
* @type {*} * @type {number}
* @memberof AppIndexNavBreadcrumb * @memberof AppIndexNavBreadcrumb
*/ */
public currentLayoutModel: any; @Prop({ default: 0 }) public index?: number;
/**
* 项名称
*
* @type {*}
* @memberof AppIndexNavBreadcrumb
*/
get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/** /**
* 当前容器类名 * 当前容器类名
* *
* @memberof AppIndexNavBreadcrumb * @memberof AppIndexNavBreadcrumb
*/ */
get curClassName() { get curClassName() {
return { const layoutModel = this.layoutModelDetails[this.itemName];
'app-index-nav-breadcrumb': true, if (layoutModel) {
[this.name]: true, return `app-index-nav-breadcrumb ${this.itemName} ${layoutModel.sysCss}`;
[this.currentLayoutModel.sysCss]: this.currentLayoutModel.sysCss ? true : false
} }
} }
...@@ -69,21 +78,12 @@ export default class AppIndexNavBreadcrumb extends Vue { ...@@ -69,21 +78,12 @@ export default class AppIndexNavBreadcrumb extends Vue {
* @memberof AppIndexNavBreadcrumb * @memberof AppIndexNavBreadcrumb
*/ */
get curStyle() { get curStyle() {
if (this.currentLayoutModel) { const layoutModel = this.layoutModelDetails[this.itemName];
return this.currentLayoutModel.getElementStyle(); if (layoutModel) {
return layoutModel.getElementStyle();
} }
return '';
} }
/**
* Vue生命周期 --- created
*
* @memberof AppIndexNavBreadcrumb
*/
created() {
this.currentLayoutModel = this.layoutModelDetails[this.name];
}
} }
</script> </script>
<style lang='less'> <style lang='less'>
......
...@@ -8,7 +8,7 @@ import { Component, Prop, Vue } from "vue-property-decorator"; ...@@ -8,7 +8,7 @@ import { Component, Prop, Vue } from "vue-property-decorator";
@Component({}) @Component({})
export default class AppIndexNavTabs extends Vue { export default class AppIndexNavTabs extends Vue {
/** /**
* 名称 * 名称
* *
...@@ -26,12 +26,22 @@ export default class AppIndexNavTabs extends Vue { ...@@ -26,12 +26,22 @@ export default class AppIndexNavTabs extends Vue {
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/** /**
* 当前布局模型 * 下标
*
* @type {number}
* @memberof AppIndexNavTabs
*/
@Prop({ default: 0 }) public index?: number;
/**
* 项名称
* *
* @type {*} * @type {*}
* @memberof AppIndexNavTabs * @memberof AppIndexNavTabs
*/ */
public currentLayoutModel: any; get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/** /**
* 当前容器类名 * 当前容器类名
...@@ -39,10 +49,9 @@ export default class AppIndexNavTabs extends Vue { ...@@ -39,10 +49,9 @@ export default class AppIndexNavTabs extends Vue {
* @memberof AppIndexNavTabs * @memberof AppIndexNavTabs
*/ */
get curClassName() { get curClassName() {
return { const layoutModel = this.layoutModelDetails[this.itemName];
'app-index-nav-tabs': true, if (layoutModel) {
[this.name]: true, return `app-index-nav-tabs ${this.itemName} ${layoutModel.sysCss}`;
[this.currentLayoutModel.sysCss]: this.currentLayoutModel.sysCss ? true : false
} }
} }
...@@ -52,21 +61,12 @@ export default class AppIndexNavTabs extends Vue { ...@@ -52,21 +61,12 @@ export default class AppIndexNavTabs extends Vue {
* @memberof AppIndexNavTabs * @memberof AppIndexNavTabs
*/ */
get curStyle() { get curStyle() {
if (this.currentLayoutModel) { const layoutModel = this.layoutModelDetails[this.itemName];
return this.currentLayoutModel.getElementStyle(); if (layoutModel) {
return layoutModel.getElementStyle();
} }
return '';
} }
/**
* Vue生命周期 --- created
*
* @memberof AppIndexNavTabs
*/
created() {
this.currentLayoutModel = this.layoutModelDetails[this.name];
}
} }
</script> </script>
<style lang='less'> <style lang='less'>
......
...@@ -8,7 +8,7 @@ import { Component, Prop, Vue } from "vue-property-decorator"; ...@@ -8,7 +8,7 @@ import { Component, Prop, Vue } from "vue-property-decorator";
@Component({}) @Component({})
export default class AppIndexOrgSelect extends Vue { export default class AppIndexOrgSelect extends Vue {
/** /**
* 名称 * 名称
* *
...@@ -26,12 +26,22 @@ export default class AppIndexOrgSelect extends Vue { ...@@ -26,12 +26,22 @@ export default class AppIndexOrgSelect extends Vue {
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/** /**
* 当前布局模型 * 下标
*
* @type {number}
* @memberof AppIndexOrgSelect
*/
@Prop({ default: 0 }) public index?: number;
/**
* 项名称
* *
* @type {*} * @type {*}
* @memberof AppIndexOrgSelect * @memberof AppIndexOrgSelect
*/ */
public currentLayoutModel: any; get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/** /**
* 当前容器类名 * 当前容器类名
...@@ -39,10 +49,9 @@ export default class AppIndexOrgSelect extends Vue { ...@@ -39,10 +49,9 @@ export default class AppIndexOrgSelect extends Vue {
* @memberof AppIndexOrgSelect * @memberof AppIndexOrgSelect
*/ */
get curClassName() { get curClassName() {
return { const layoutModel = this.layoutModelDetails[this.itemName];
'app-index-org-select': true, if (layoutModel) {
[this.name]: true, return `app-index-org-select ${this.itemName} ${layoutModel.sysCss}`;
[this.currentLayoutModel.sysCss]: this.currentLayoutModel.sysCss ? true : false
} }
} }
...@@ -52,21 +61,12 @@ export default class AppIndexOrgSelect extends Vue { ...@@ -52,21 +61,12 @@ export default class AppIndexOrgSelect extends Vue {
* @memberof AppIndexOrgSelect * @memberof AppIndexOrgSelect
*/ */
get curStyle() { get curStyle() {
if (this.currentLayoutModel) { const layoutModel = this.layoutModelDetails[this.itemName];
return this.currentLayoutModel.getElementStyle(); if (layoutModel) {
return layoutModel.getElementStyle();
} }
return '';
} }
/**
* Vue生命周期 --- created
*
* @memberof AppIndexOrgSelect
*/
created() {
this.currentLayoutModel = this.layoutModelDetails[this.name];
}
} }
</script> </script>
<style lang='less'> <style lang='less'>
......
...@@ -8,7 +8,7 @@ import { Component, Prop, Vue } from "vue-property-decorator"; ...@@ -8,7 +8,7 @@ import { Component, Prop, Vue } from "vue-property-decorator";
@Component({}) @Component({})
export default class AppIndexUserInfo extends Vue { export default class AppIndexUserInfo extends Vue {
/** /**
* 名称 * 名称
* *
...@@ -26,12 +26,22 @@ export default class AppIndexUserInfo extends Vue { ...@@ -26,12 +26,22 @@ export default class AppIndexUserInfo extends Vue {
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/** /**
* 当前布局模型 * 下标
*
* @type {number}
* @memberof AppIndexUserInfo
*/
@Prop({ default: 0 }) public index?: number;
/**
* 项名称
* *
* @type {*} * @type {*}
* @memberof AppIndexUserInfo * @memberof AppIndexUserInfo
*/ */
public currentLayoutModel: any; get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/** /**
* 当前容器类名 * 当前容器类名
...@@ -39,10 +49,9 @@ export default class AppIndexUserInfo extends Vue { ...@@ -39,10 +49,9 @@ export default class AppIndexUserInfo extends Vue {
* @memberof AppIndexUserInfo * @memberof AppIndexUserInfo
*/ */
get curClassName() { get curClassName() {
return { const layoutModel = this.layoutModelDetails[this.itemName];
'app-index-user-info': true, if (layoutModel) {
[this.name]: true, return `app-index-user-info ${this.itemName} ${layoutModel.sysCss}`;
[this.currentLayoutModel.sysCss]: this.currentLayoutModel.sysCss ? true : false
} }
} }
...@@ -52,21 +61,12 @@ export default class AppIndexUserInfo extends Vue { ...@@ -52,21 +61,12 @@ export default class AppIndexUserInfo extends Vue {
* @memberof AppIndexUserInfo * @memberof AppIndexUserInfo
*/ */
get curStyle() { get curStyle() {
if (this.currentLayoutModel) { const layoutModel = this.layoutModelDetails[this.itemName];
return this.currentLayoutModel.getElementStyle(); if (layoutModel) {
return layoutModel.getElementStyle();
} }
return '';
} }
/**
* Vue生命周期 --- created
*
* @memberof AppIndexUserInfo
*/
created() {
this.currentLayoutModel = this.layoutModelDetails[this.name];
}
} }
</script> </script>
<style lang='less'> <style lang='less'>
......
<template> <template>
<div :class="curClassName" :style="curStyle"> <div :class="curClassName" :style="curStyle">
<i-button <i-button :type="buttonType" :disabled="disabled" :title="tooltip" :loading="loading" :ghost="buttonGhost"
:type="buttonType"
:disabled="disabled"
:title="tooltip"
:loading="loading"
:ghost="buttonGhost"
@click="handleClick"> @click="handleClick">
<div :class="['button-content', iconAlign.toLowerCase()]"> <div :class="['button-content', iconAlign.toLowerCase()]">
<span v-if="cssClass || imagePath" class="icon"> <span v-if="cssClass || imagePath" class="icon">
...@@ -60,14 +55,34 @@ export default class AppPresetButton extends Vue { ...@@ -60,14 +55,34 @@ export default class AppPresetButton extends Vue {
*/ */
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/**
* 下标
*
* @type {number}
* @memberof AppPresetButton
*/
@Prop({ default: 0 }) public index?: number;
/**
* 项名称
*
* @type {*}
* @memberof AppPresetButton
*/
get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/** /**
* 显示标题 * 显示标题
* *
* @memberof AppPresetButton * @memberof AppPresetButton
*/ */
get showCaption() { get showCaption() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.isShowCaption; if (layoutModel) {
return layoutModel.isShowCaption;
}
} }
/** /**
...@@ -75,9 +90,11 @@ export default class AppPresetButton extends Vue { ...@@ -75,9 +90,11 @@ export default class AppPresetButton extends Vue {
* *
* @memberof AppPresetButton * @memberof AppPresetButton
*/ */
get curClassName(){ get curClassName() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return `app-preset-button ${this.name} ${layoutModel.sysCss}`; if (layoutModel) {
return `app-preset-button ${this.itemName} ${layoutModel.sysCss}`;
}
} }
/** /**
...@@ -86,14 +103,16 @@ export default class AppPresetButton extends Vue { ...@@ -86,14 +103,16 @@ export default class AppPresetButton extends Vue {
* @memberof AppPresetButton * @memberof AppPresetButton
*/ */
get imagePath() { get imagePath() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
let imagePath = ''; if (layoutModel) {
if (layoutModel.sysImage) { let imagePath = '';
imagePath = layoutModel.sysImage.imagePath; if (layoutModel.sysImage) {
} else if (layoutModel.uiAction) { imagePath = layoutModel.sysImage.imagePath;
imagePath = layoutModel.uiAction.imagePath; } else if (layoutModel.uiAction) {
imagePath = layoutModel.uiAction.imagePath;
}
return imagePath;
} }
return imagePath;
} }
/** /**
...@@ -102,14 +121,16 @@ export default class AppPresetButton extends Vue { ...@@ -102,14 +121,16 @@ export default class AppPresetButton extends Vue {
* @memberof AppPresetButton * @memberof AppPresetButton
*/ */
get cssClass() { get cssClass() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
let cssClass = ''; if (layoutModel) {
if (layoutModel.sysImage) { let cssClass = '';
cssClass = layoutModel.sysImage.iconcls; if (layoutModel.sysImage) {
} else if (layoutModel.uiAction) { cssClass = layoutModel.sysImage.iconcls;
cssClass = layoutModel.uiAction.iconcls; } else if (layoutModel.uiAction) {
cssClass = layoutModel.uiAction.iconcls;
}
return cssClass;
} }
return cssClass;
} }
/** /**
...@@ -117,9 +138,11 @@ export default class AppPresetButton extends Vue { ...@@ -117,9 +138,11 @@ export default class AppPresetButton extends Vue {
* *
* @memberof AppPresetButton * @memberof AppPresetButton
*/ */
get curStyle(){ get curStyle() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.getElementStyle(); if (layoutModel) {
return layoutModel.getElementStyle();
}
} }
/** /**
...@@ -127,9 +150,11 @@ export default class AppPresetButton extends Vue { ...@@ -127,9 +150,11 @@ export default class AppPresetButton extends Vue {
* *
* @memberof AppPresetButton * @memberof AppPresetButton
*/ */
get disabled(){ get disabled() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.disabled; if (layoutModel) {
return layoutModel.disabled;
}
} }
/** /**
...@@ -138,23 +163,25 @@ export default class AppPresetButton extends Vue { ...@@ -138,23 +163,25 @@ export default class AppPresetButton extends Vue {
* @memberof AppPresetButton * @memberof AppPresetButton
*/ */
get buttonType() { get buttonType() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
if (Object.is(layoutModel.renderMode, 'LINK')) { if (layoutModel) {
return 'text'; if (Object.is(layoutModel.renderMode, 'LINK')) {
} else { return 'text';
if (
Object.is(layoutModel.buttonStyle, 'DEFAULT') ||
Object.is(layoutModel.buttonStyle, 'STYLE2') ||
Object.is(layoutModel.buttonStyle, 'STYLE3') ||
Object.is(layoutModel.buttonStyle, 'STYLE4')
) {
return 'default';
} else if (Object.is(layoutModel.buttonStyle, 'DANGER')) {
return 'error';
} else if (Object.is(layoutModel.buttonStyle, 'INVERSE')) {
return 'primary';
} else { } else {
return layoutModel.buttonStyle.toLowerCase(); if (
Object.is(layoutModel.buttonStyle, 'DEFAULT') ||
Object.is(layoutModel.buttonStyle, 'STYLE2') ||
Object.is(layoutModel.buttonStyle, 'STYLE3') ||
Object.is(layoutModel.buttonStyle, 'STYLE4')
) {
return 'default';
} else if (Object.is(layoutModel.buttonStyle, 'DANGER')) {
return 'error';
} else if (Object.is(layoutModel.buttonStyle, 'INVERSE')) {
return 'primary';
} else {
return layoutModel.buttonStyle.toLowerCase();
}
} }
} }
} }
...@@ -165,8 +192,10 @@ export default class AppPresetButton extends Vue { ...@@ -165,8 +192,10 @@ export default class AppPresetButton extends Vue {
* @memberof AppPresetButton * @memberof AppPresetButton
*/ */
get iconAlign() { get iconAlign() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.iconAlign || 'LEFT'; if(layoutModel){
return layoutModel.iconAlign || 'LEFT';
}
} }
/** /**
...@@ -175,8 +204,10 @@ export default class AppPresetButton extends Vue { ...@@ -175,8 +204,10 @@ export default class AppPresetButton extends Vue {
* @memberof AppPresetButton * @memberof AppPresetButton
*/ */
get buttonGhost() { get buttonGhost() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return Object.is(layoutModel.buttonStyle, 'INVERSE'); if(layoutModel){
return Object.is(layoutModel.buttonStyle, 'INVERSE');
}
} }
/** /**
...@@ -186,7 +217,7 @@ export default class AppPresetButton extends Vue { ...@@ -186,7 +217,7 @@ export default class AppPresetButton extends Vue {
* @memberof AppPresetButton * @memberof AppPresetButton
*/ */
public handleClick(event: any) { public handleClick(event: any) {
this.$emit('itemClick', this.name); this.$emit('itemClick', this.itemName);
} }
} }
</script> </script>
......
<template> <template>
<div :class="curClassName" :style="curStyle"> <div :class="curClassName" :style="curStyle">
<template v-if="QRCodeConfig.url"> <template v-if="QRCodeConfig.url">
<ibiz-qr-code <ibiz-qr-code :size="QRCodeConfig.size" :url="QRCodeConfig.url" :bgSrc="QRCodeConfig.bgSrc"
:size="QRCodeConfig.size" :margin="QRCodeConfig.margin" :backgroundColor="QRCodeConfig.backgroundColor"
:url="QRCodeConfig.url" :logoSrc="QRCodeConfig.logoSrc" :logoMargin="QRCodeConfig.logoMargin"
:bgSrc="QRCodeConfig.bgSrc" :logoBgColor="QRCodeConfig.logoBgColor" :logoRadius="QRCodeConfig.logoRadius"
:margin="QRCodeConfig.margin" :whiteMargin="QRCodeConfig.whiteMargin" class="ibiz-qr-code" :callback="callback">
:backgroundColor="QRCodeConfig.backgroundColor"
:logoSrc="QRCodeConfig.logoSrc"
:logoMargin="QRCodeConfig.logoMargin"
:logoBgColor="QRCodeConfig.logoBgColor"
:logoRadius="QRCodeConfig.logoRadius"
:whiteMargin="QRCodeConfig.whiteMargin"
class="ibiz-qr-code"
:callback="callback">
</ibiz-qr-code> </ibiz-qr-code>
</template> </template>
</div> </div>
...@@ -48,14 +40,34 @@ export default class AppPresetQrCode extends Vue { ...@@ -48,14 +40,34 @@ export default class AppPresetQrCode extends Vue {
*/ */
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/**
* 下标
*
* @type {number}
* @memberof AppPresetQrCode
*/
@Prop({ default: 0 }) public index?: number;
/**
* 项名称
*
* @type {*}
* @memberof AppPresetQrCode
*/
get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/** /**
* 类名 * 类名
* *
* @memberof AppPresetQrCode * @memberof AppPresetQrCode
*/ */
get curClassName(){ get curClassName() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return `app-preset-qrcode ${this.name} ${layoutModel.sysCss}`; if (layoutModel) {
return `app-preset-qrcode ${this.itemName} ${layoutModel.sysCss}`;
}
} }
/** /**
...@@ -63,9 +75,11 @@ export default class AppPresetQrCode extends Vue { ...@@ -63,9 +75,11 @@ export default class AppPresetQrCode extends Vue {
* *
* @memberof AppPresetQrCode * @memberof AppPresetQrCode
*/ */
get curStyle(){ get curStyle() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.getElementStyle(); if (layoutModel) {
return layoutModel.getElementStyle();
}
} }
/** /**
...@@ -83,15 +97,15 @@ export default class AppPresetQrCode extends Vue { ...@@ -83,15 +97,15 @@ export default class AppPresetQrCode extends Vue {
* @type {*} * @type {*}
* @memberof AppPresetQrCode * @memberof AppPresetQrCode
*/ */
public QRCodeConfig: { public QRCodeConfig: {
size?: number, size?: number,
url?: string, url?: string,
bgSrc?: string, bgSrc?: string,
margin?: number, margin?: number,
backgroundColor?: string, backgroundColor?: string,
logoSrc?: string, logoSrc?: string,
logoMargin?: number, logoMargin?: number,
logoBgColor?: string, logoBgColor?: string,
logoRadius?: number, logoRadius?: number,
whiteMargin?: boolean, whiteMargin?: boolean,
} = {} } = {}
...@@ -121,29 +135,29 @@ export default class AppPresetQrCode extends Vue { ...@@ -121,29 +135,29 @@ export default class AppPresetQrCode extends Vue {
* @memberof AppPresetQrCode * @memberof AppPresetQrCode
*/ */
public getQRCodeData() { public getQRCodeData() {
if(this.value && typeof(this.value) == 'string') { if (this.value && typeof (this.value) == 'string') {
const value = JSON.parse(this.value); const value = JSON.parse(this.value);
const { const {
size, size,
url, url,
bgSrc, bgSrc,
margin, margin,
backgroundColor, backgroundColor,
logoSrc, logoSrc,
logoMargin, logoMargin,
logoBgColor, logoBgColor,
logoRadius, logoRadius,
whiteMargin, whiteMargin,
} = value; } = value;
this.QRCodeConfig = { this.QRCodeConfig = {
size, size,
url, url,
bgSrc, bgSrc,
margin, margin,
backgroundColor, backgroundColor,
logoSrc, logoSrc,
logoMargin, logoMargin,
logoBgColor, logoBgColor,
logoRadius, logoRadius,
whiteMargin, whiteMargin,
}; };
......
...@@ -31,14 +31,34 @@ export default class AppPresetSwitch extends Vue { ...@@ -31,14 +31,34 @@ export default class AppPresetSwitch extends Vue {
*/ */
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/**
* 下标
*
* @type {number}
* @memberof AppPresetSwitch
*/
@Prop({ default: 0 }) public index?: number;
/**
* 项名称
*
* @type {*}
* @memberof AppPresetSwitch
*/
get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/** /**
* 类名 * 类名
* *
* @memberof AppPresetSwitch * @memberof AppPresetSwitch
*/ */
get curClassName(){ get curClassName() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return `app-preset-switch ${this.name} ${layoutModel.sysCss}`; if (layoutModel) {
return `app-preset-switch ${this.itemName} ${layoutModel.sysCss}`;
}
} }
/** /**
...@@ -46,9 +66,11 @@ export default class AppPresetSwitch extends Vue { ...@@ -46,9 +66,11 @@ export default class AppPresetSwitch extends Vue {
* *
* @memberof AppPresetSwitch * @memberof AppPresetSwitch
*/ */
get curStyle(){ get curStyle() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.getElementStyle(); if(layoutModel){
return layoutModel.getElementStyle();
}
} }
/** /**
...@@ -56,9 +78,11 @@ export default class AppPresetSwitch extends Vue { ...@@ -56,9 +78,11 @@ export default class AppPresetSwitch extends Vue {
* *
* @memberof AppPresetSwitch * @memberof AppPresetSwitch
*/ */
get disabled(){ get disabled() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.disabled; if(layoutModel){
return layoutModel.disabled;
}
} }
/** /**
...@@ -78,7 +102,7 @@ export default class AppPresetSwitch extends Vue { ...@@ -78,7 +102,7 @@ export default class AppPresetSwitch extends Vue {
* @memberof AppPresetSwitch * @memberof AppPresetSwitch
*/ */
set curValue(value: boolean) { set curValue(value: boolean) {
this.$emit('valueChange', {name: this.name, value}); this.$emit('valueChange', { name: this.itemName, value });
} }
} }
</script> </script>
......
...@@ -29,18 +29,38 @@ export default class AppPresetTextInput extends Vue { ...@@ -29,18 +29,38 @@ export default class AppPresetTextInput extends Vue {
* 布局模型详情 * 布局模型详情
* *
* @type {*} * @type {*}
* @memberof AppPresetSwitch * @memberof AppPresetTextInput
*/ */
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/**
* 下标
*
* @type {number}
* @memberof AppPresetTextInput
*/
@Prop({ default: 0 }) public index?: number;
/**
* 项名称
*
* @type {*}
* @memberof AppPresetTextInput
*/
get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/** /**
* 类名 * 类名
* *
* @memberof AppPresetSwitch * @memberof AppPresetSwitch
*/ */
get curClassName() { get curClassName() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return `app-preset-text-input ${this.name} ${layoutModel.sysCss}`; if (layoutModel) {
return `app-preset-text-input ${this.itemName} ${layoutModel.sysCss}`;
}
} }
/** /**
...@@ -49,8 +69,10 @@ export default class AppPresetTextInput extends Vue { ...@@ -49,8 +69,10 @@ export default class AppPresetTextInput extends Vue {
* @memberof AppPresetSwitch * @memberof AppPresetSwitch
*/ */
get disabled() { get disabled() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.disabled; if (layoutModel) {
return layoutModel.disabled;
}
} }
/** /**
...@@ -59,8 +81,10 @@ export default class AppPresetTextInput extends Vue { ...@@ -59,8 +81,10 @@ export default class AppPresetTextInput extends Vue {
* @memberof AppPresetSwitch * @memberof AppPresetSwitch
*/ */
get curStyle() { get curStyle() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.getElementStyle(); if (layoutModel) {
return layoutModel.getElementStyle();
}
} }
/** /**
...@@ -69,18 +93,12 @@ export default class AppPresetTextInput extends Vue { ...@@ -69,18 +93,12 @@ export default class AppPresetTextInput extends Vue {
* @memberof AppPresetSwitch * @memberof AppPresetSwitch
*/ */
get placeholder() { get placeholder() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.placeholder || ''; if (layoutModel) {
return layoutModel.placeholder || '';
}
} }
/**
* 类名
*
* @memberof AppPresetSwitch
*/
get className(): string {
return `app-preset-text-input ${this.name}`;
}
/** /**
* 当前值 * 当前值
...@@ -97,7 +115,7 @@ export default class AppPresetTextInput extends Vue { ...@@ -97,7 +115,7 @@ export default class AppPresetTextInput extends Vue {
* @memberof AppPresetTextInput * @memberof AppPresetTextInput
*/ */
set curValue(val: any) { set curValue(val: any) {
this.$emit('valueChange', { name: this.name, value: val }); this.$emit('valueChange', { name: this.itemName, value: val });
} }
} }
</script> </script>
......
<template> <template>
<div :class="curClassName" :style="curStyle"> <div :class="curClassName" :style="curStyle">
<i-button <i-button @click="handleClick" :disabled="disabled" :title="curTooltip" :type="buttonType">
@click="handleClick" <div :class="['button-content', iconAlign.toLowerCase()]">
:disabled="disabled"
:title="curTooltip"
:type="buttonType">
<div :class="['button-content', iconAlign.toLowerCase()]">
<span v-if="cssClass || imagePath" class="icon"> <span v-if="cssClass || imagePath" class="icon">
<i v-if="cssClass" :class="cssClass" /> <i v-if="cssClass" :class="cssClass" />
<img v-else :src="imagePath" /> <img v-else :src="imagePath" />
...@@ -53,14 +49,34 @@ export default class AppLoginButton extends Vue { ...@@ -53,14 +49,34 @@ export default class AppLoginButton extends Vue {
*/ */
@Prop({ default: false }) public loading?: boolean; @Prop({ default: false }) public loading?: boolean;
/**
* 下标
*
* @type {number}
* @memberof AppLoginButton
*/
@Prop({ default: 0 }) public index?: number;
/**
* 项名称
*
* @type {*}
* @memberof AppLoginButton
*/
get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/** /**
* 标题 * 标题
* *
* @memberof AppLoginButton * @memberof AppLoginButton
*/ */
get curCaption() { get curCaption() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.caption; if (layoutModel) {
return layoutModel.caption;
}
} }
/** /**
...@@ -69,8 +85,10 @@ export default class AppLoginButton extends Vue { ...@@ -69,8 +85,10 @@ export default class AppLoginButton extends Vue {
* @memberof AppLoginButton * @memberof AppLoginButton
*/ */
get curTooltip() { get curTooltip() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.tooltip; if (layoutModel) {
return layoutModel.tooltip;
}
} }
/** /**
...@@ -79,36 +97,39 @@ export default class AppLoginButton extends Vue { ...@@ -79,36 +97,39 @@ export default class AppLoginButton extends Vue {
* @memberof AppLoginButton * @memberof AppLoginButton
*/ */
get showCaption() { get showCaption() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.isShowCaption; if (layoutModel) {
return layoutModel.isShowCaption;
}
} }
/** /**
* 当前按钮类型 * 当前按钮类型
* *
* @type {string}
* @memberof AppLoginButton * @memberof AppLoginButton
*/ */
get buttonType(): string { get buttonType() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel.renderMode == 'LINK') { if (layoutModel) {
return 'text'; if (layoutModel.renderMode == 'LINK') {
} else if (layoutModel.buttonStyle != "DEFAULT" && this.defaultStyle) { return 'text';
return this.defaultStyle; } else if (layoutModel.buttonStyle != "DEFAULT" && this.defaultStyle) {
} else { return this.defaultStyle;
if (
Object.is(layoutModel.buttonStyle, 'DEFAULT') ||
Object.is(layoutModel.buttonStyle, 'STYLE2') ||
Object.is(layoutModel.buttonStyle, 'STYLE3') ||
Object.is(layoutModel.buttonStyle, 'STYLE4')
) {
return 'default';
} else if (Object.is(layoutModel.buttonStyle, 'DANGER')) {
return 'error';
} else if (Object.is(layoutModel.buttonStyle, 'INVERSE')) {
return 'primary';
} else { } else {
return layoutModel.buttonStyle.toLowerCase(); if (
Object.is(layoutModel.buttonStyle, 'DEFAULT') ||
Object.is(layoutModel.buttonStyle, 'STYLE2') ||
Object.is(layoutModel.buttonStyle, 'STYLE3') ||
Object.is(layoutModel.buttonStyle, 'STYLE4')
) {
return 'default';
} else if (Object.is(layoutModel.buttonStyle, 'DANGER')) {
return 'error';
} else if (Object.is(layoutModel.buttonStyle, 'INVERSE')) {
return 'primary';
} else {
return layoutModel.buttonStyle.toLowerCase();
}
} }
} }
} }
...@@ -118,9 +139,11 @@ export default class AppLoginButton extends Vue { ...@@ -118,9 +139,11 @@ export default class AppLoginButton extends Vue {
* *
* @memberof AppLoginButton * @memberof AppLoginButton
*/ */
get curStyle(){ get curStyle() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.getElementStyle(); if (layoutModel) {
return layoutModel.getElementStyle();
}
} }
/** /**
...@@ -128,9 +151,11 @@ export default class AppLoginButton extends Vue { ...@@ -128,9 +151,11 @@ export default class AppLoginButton extends Vue {
* *
* @memberof AppLoginButton * @memberof AppLoginButton
*/ */
get disabled(){ get disabled() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.disabled; if (layoutModel) {
return layoutModel.disabled;
}
} }
/** /**
...@@ -138,9 +163,11 @@ export default class AppLoginButton extends Vue { ...@@ -138,9 +163,11 @@ export default class AppLoginButton extends Vue {
* *
* @memberof AppLoginButton * @memberof AppLoginButton
*/ */
get curClassName(){ get curClassName() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return `app-login-button ${this.name} ${layoutModel.sysCss}`; if (layoutModel) {
return `app-login-button ${this.itemName} ${layoutModel.sysCss}`;
}
} }
/** /**
...@@ -149,14 +176,16 @@ export default class AppLoginButton extends Vue { ...@@ -149,14 +176,16 @@ export default class AppLoginButton extends Vue {
* @memberof AppLoginButton * @memberof AppLoginButton
*/ */
get imagePath() { get imagePath() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
let imagePath = ''; if (layoutModel) {
if (layoutModel.sysImage) { let imagePath = '';
imagePath = layoutModel.sysImage.imagePath; if (layoutModel.sysImage) {
} else if (layoutModel.uiAction) { imagePath = layoutModel.sysImage.imagePath;
imagePath = layoutModel.uiAction.imagePath; } else if (layoutModel.uiAction) {
imagePath = layoutModel.uiAction.imagePath;
}
return imagePath;
} }
return imagePath;
} }
/** /**
...@@ -165,14 +194,16 @@ export default class AppLoginButton extends Vue { ...@@ -165,14 +194,16 @@ export default class AppLoginButton extends Vue {
* @memberof AppLoginButton * @memberof AppLoginButton
*/ */
get cssClass() { get cssClass() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
let cssClass = ''; if (layoutModel) {
if (layoutModel.sysImage) { let cssClass = '';
cssClass = layoutModel.sysImage.iconcls; if (layoutModel.sysImage) {
} else if (layoutModel.uiAction) { cssClass = layoutModel.sysImage.iconcls;
cssClass = layoutModel.uiAction.iconcls; } else if (layoutModel.uiAction) {
cssClass = layoutModel.uiAction.iconcls;
}
return cssClass;
} }
return cssClass;
} }
/** /**
...@@ -181,8 +212,10 @@ export default class AppLoginButton extends Vue { ...@@ -181,8 +212,10 @@ export default class AppLoginButton extends Vue {
* @memberof AppLoginButton * @memberof AppLoginButton
*/ */
get iconAlign() { get iconAlign() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.iconAlign || 'LEFT'; if (layoutModel) {
return layoutModel.iconAlign || 'LEFT';
}
} }
/** /**
...@@ -191,8 +224,10 @@ export default class AppLoginButton extends Vue { ...@@ -191,8 +224,10 @@ export default class AppLoginButton extends Vue {
* @memberof AppLoginButton * @memberof AppLoginButton
*/ */
get buttonGhost() { get buttonGhost() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return Object.is(layoutModel.buttonStyle, 'INVERSE'); if (layoutModel) {
return Object.is(layoutModel.buttonStyle, 'INVERSE');
}
} }
/** /**
...@@ -202,7 +237,7 @@ export default class AppLoginButton extends Vue { ...@@ -202,7 +237,7 @@ export default class AppLoginButton extends Vue {
* @memberof AppLoginButton * @memberof AppLoginButton
*/ */
public handleClick() { public handleClick() {
this.$emit("itemClick", this.name); this.$emit("itemClick", this.itemName);
} }
} }
......
...@@ -39,35 +39,61 @@ export default class AppLoginCaptcha extends Vue { ...@@ -39,35 +39,61 @@ export default class AppLoginCaptcha extends Vue {
@Prop() public name!: string; @Prop() public name!: string;
/** /**
* 当前容器样式 * 下标
* *
* @type {number}
* @memberof AppLoginCaptcha * @memberof AppLoginCaptcha
*/ */
get curStyle(){ @Prop({ default: 0 }) public index?: number;
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.getElementStyle();
}
/** /**
* 类名 * 是否显示
*/
public show: boolean = false;
/**
* 按钮类型
*/
public type: string = 'default';
/**
* 项名称
* *
* @type {*}
* @memberof AppLoginCaptcha * @memberof AppLoginCaptcha
*/ */
get curClassName(){ get itemName() {
const layoutModel = this.layoutModelDetails[this.name]; return this.index ? `${this.name}_${this.index}` : this.name;
return `app-login-captcha ${this.name} ${layoutModel.sysCss}`;
} }
/** /**
* 是否显示 * 当前容器样式
*
* @memberof AppLoginCaptcha
*/ */
public show: boolean = false; get curStyle() {
const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel) {
return layoutModel.getElementStyle();
}
}
/** /**
* 按钮类型 * 类名
*
* @memberof AppLoginCaptcha
*/ */
public type: string = 'default'; get curClassName() {
const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel) {
return `app-login-captcha ${this.itemName} ${layoutModel.sysCss}`;
}
}
/**
* 初始化
*/
public created() { public created() {
if (this.value) { if (this.value) {
this.type = 'success'; this.type = 'success';
...@@ -87,14 +113,14 @@ export default class AppLoginCaptcha extends Vue { ...@@ -87,14 +113,14 @@ export default class AppLoginCaptcha extends Vue {
public onSuccess() { public onSuccess() {
this.show = false; this.show = false;
this.type = 'success'; this.type = 'success';
this.$emit("valueChange", { name: this.name, value: true}); this.$emit("valueChange", { name: this.itemName, value: true });
} }
/** /**
* 失败 * 失败
*/ */
public onFail() { public onFail() {
this.$emit("valueChange", { name: this.name, value: false}); this.$emit("valueChange", { name: this.itemName, value: false });
} }
} }
</script> </script>
...@@ -103,9 +129,11 @@ export default class AppLoginCaptcha extends Vue { ...@@ -103,9 +129,11 @@ export default class AppLoginCaptcha extends Vue {
.app-login-captcha { .app-login-captcha {
height: 40px; height: 40px;
width: 100%; width: 100%;
.ivu-btn { .ivu-btn {
width: 100%; width: 100%;
height: 100%; height: 100%;
&:hover { &:hover {
border: 1px solid #dcdee2; border: 1px solid #dcdee2;
color: #515a6e; color: #515a6e;
......
<template> <template>
<div :class="curClassName" :style="curStyle"> <div :class="curClassName" :style="curStyle">
<i-input <i-input size='large' :prefix='defaultIcon' v-model="curValue" :type="defaultType" :disabled="disabled"
size='large' :readonly="readonly" :placeholder="curCaption">
:prefix='defaultIcon'
v-model="curValue"
:type="defaultType"
:disabled="disabled"
:readonly="readonly"
:placeholder="curCaption">
</i-input> </i-input>
</div> </div>
</template> </template>
...@@ -26,7 +20,7 @@ export default class AppLoginInput extends Vue { ...@@ -26,7 +20,7 @@ export default class AppLoginInput extends Vue {
* @memberof AppLoginInput * @memberof AppLoginInput
*/ */
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/** /**
* 值 * 值
* *
...@@ -59,75 +53,103 @@ export default class AppLoginInput extends Vue { ...@@ -59,75 +53,103 @@ export default class AppLoginInput extends Vue {
*/ */
@Prop() public defaultType?: string; @Prop() public defaultType?: string;
/** /**
* 标题 * 下标
* *
* @type {number}
* @memberof AppLoginInput * @memberof AppLoginInput
*/ */
get curCaption() { @Prop({ default: 0 }) public index?: number;
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.caption;
}
/** /**
* 当前容器样式 * 项名称
* *
* @type {*}
* @memberof AppLoginInput * @memberof AppLoginInput
*/ */
get curStyle(){ get itemName() {
const layoutModel = this.layoutModelDetails[this.name]; return this.index ? `${this.name}_${this.index}` : this.name;
return layoutModel.getElementStyle();
} }
/** /**
* 类名 * 标题
* *
* @memberof AppLoginInput * @memberof AppLoginInput
*/ */
get curClassName(){ get curCaption() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return `app-login-input ${this.name} ${layoutModel.sysCss}`; if (layoutModel) {
return layoutModel.caption;
}
} }
/** /**
* 当前值 * 当前容器样式
* *
* @type {any}
* @memberof AppLoginInput * @memberof AppLoginInput
*/ */
get curValue() { get curStyle() {
return this.value; const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel) {
return layoutModel.getElementStyle();
}
} }
/** /**
* 值变化 * 类名
* *
* @memberof AppPresetTextInput * @memberof AppLoginInput
*/ */
set curValue(val: any) { get curClassName() {
this.$emit('valueChange', { name: this.name, value: val }); const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel) {
return `app-login-input ${this.itemName} ${layoutModel.sysCss}`;
}
} }
/** /**
* 禁用 * 禁用
* *
* @memberof AppPresetSwitch * @memberof AppLoginInput
*/ */
get disabled() { get disabled() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.disabled; if (layoutModel) {
return layoutModel.disabled;
}
} }
/** /**
* 只读 * 只读
* *
* @memberof AppPresetSwitch * @memberof AppLoginInput
*/ */
get readonly() { get readonly() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.readonly; if (layoutModel) {
return layoutModel.readonly;
}
} }
/**
* 当前值
*
* @type {any}
* @memberof AppLoginInput
*/
get curValue() {
return this.value;
}
/**
* 值变化
*
* @memberof AppLoginInput
*/
set curValue(val: any) {
this.$emit('valueChange', { name: this.itemName, value: val });
}
} }
</script> </script>
<style lang="less"> <style lang="less">
......
...@@ -10,49 +10,71 @@ import { Component, Vue, Prop } from "vue-property-decorator"; ...@@ -10,49 +10,71 @@ import { Component, Vue, Prop } from "vue-property-decorator";
@Component({}) @Component({})
export default class AppLoginMessage extends Vue { export default class AppLoginMessage extends Vue {
/** /**
* 模型 * 模型
* *
* @type {any} * @type {any}
* @memberof AppLoginMessage * @memberof AppLoginMessage
*/ */
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/** /**
* 值 * 值
* *
* @type {string} * @type {string}
* @memberof AppLoginMessage * @memberof AppLoginMessage
*/ */
@Prop() public value!: string; @Prop() public value!: string;
/** /**
* 名称 * 名称
* *
* @type {string} * @type {string}
* @memberof AppLoginMessage * @memberof AppLoginMessage
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/** /**
* 当前容器样式 * 下标
* *
* @memberof AppLoginMessage * @type {number}
*/ * @memberof AppLoginMessage
get curStyle(){ */
const layoutModel = this.layoutModelDetails[this.name]; @Prop({ default: 0 }) public index?: number;
return layoutModel.getElementStyle();
/**
* 项名称
*
* @type {*}
* @memberof AppLoginMessage
*/
get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/**
* 当前容器样式
*
* @memberof AppLoginMessage
*/
get curStyle() {
const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel) {
return layoutModel.getElementStyle();
} }
}
/** /**
* 类名 * 类名
* *
* @memberof AppLoginMessage * @memberof AppLoginMessage
*/ */
get curClassName(){ get curClassName() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return `app-login-message ${this.name} ${layoutModel.sysCss}`; if (layoutModel) {
return `app-login-message ${this.itemName} ${layoutModel.sysCss}`;
} }
}
} }
</script> </script>
......
<template> <template>
<div :class="curClassName" :style="curStyle"> <div :class="curClassName" :style="curStyle">
<div class="content"> <div class="content">
<i-input <i-input size="default" type="text" v-model="phoneNumber"
size="default" :placeholder="$t('components.login.phoneplaceholder')" @on-blur="veriPhoneNumber"></i-input>
type="text"
v-model="phoneNumber"
:placeholder="$t('components.login.phoneplaceholder')"
@on-blur="veriPhoneNumber"
></i-input>
<el-button :disabled="disabled" size="mini" @click="getVeriCode()">{{ <el-button :disabled="disabled" size="mini" @click="getVeriCode()">{{
disabled ? `${delay}s ${$t("components.login.getcodeafter")}` : `${$t("components.login.getcode")}` disabled ? `${delay}s ${$t("components.login.getcodeafter")}` : `${$t("components.login.getcode")}`
}}</el-button> }}</el-button>
</div> </div>
<alert v-show="phoneError" type="error">电话号码格式错误</alert> <alert v-show="phoneError" type="error">电话号码格式错误</alert>
<div class="code" v-show="this.show"> <div class="code" v-show="show">
<i-input <i-input size="default" type="text" :value="currentValue" @input="codeChange"
size="default" :placeholder="$t('components.login.codeplaceholder')"></i-input>
type="text"
:value="currentValue"
@input="codeChange"
:placeholder="$t('components.login.codeplaceholder')"
></i-input>
</div> </div>
</div> </div>
</template> </template>
...@@ -54,6 +44,24 @@ export default class AppLoginNoteVerify extends Vue { ...@@ -54,6 +44,24 @@ export default class AppLoginNoteVerify extends Vue {
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/**
* 下标
*
* @type {number}
* @memberof AppLoginNoteVerify
*/
@Prop({ default: 0 }) public index?: number;
/**
* 项名称
*
* @type {*}
* @memberof AppLoginNoteVerify
*/
get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/** /**
*验证码当前值 *验证码当前值
* *
...@@ -116,9 +124,11 @@ export default class AppLoginNoteVerify extends Vue { ...@@ -116,9 +124,11 @@ export default class AppLoginNoteVerify extends Vue {
* *
* @memberof AppLoginNoteVerify * @memberof AppLoginNoteVerify
*/ */
get curStyle(){ get curStyle() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.getElementStyle(); if (layoutModel) {
return layoutModel.getElementStyle();
}
} }
/** /**
...@@ -126,9 +136,11 @@ export default class AppLoginNoteVerify extends Vue { ...@@ -126,9 +136,11 @@ export default class AppLoginNoteVerify extends Vue {
* *
* @memberof AppLoginNoteVerify * @memberof AppLoginNoteVerify
*/ */
get curClassName(){ get curClassName() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return `app-login-note-verify ${this.name} ${layoutModel.sysCss}`; if (layoutModel) {
return `app-login-note-verify ${this.itemName} ${layoutModel.sysCss}`;
}
} }
/** /**
...@@ -136,7 +148,7 @@ export default class AppLoginNoteVerify extends Vue { ...@@ -136,7 +148,7 @@ export default class AppLoginNoteVerify extends Vue {
* @memberof AppLoginNoteVerify * @memberof AppLoginNoteVerify
*/ */
public codeChange(value: string) { public codeChange(value: string) {
this.$emit("valueChange", { name: this.name, value: value }); this.$emit("valueChange", { name: this.itemName, value: value });
} }
/** /**
......
<template> <template>
<div :class="curClassName" :style="curStyle"> <div :class="curClassName" :style="curStyle">
<Select v-model="curKey"> <Select v-model="curValue">
<Option v-for="(item, index) in items" :value="item.value" :key="item.value">{{ item.label }}</Option> <Option v-for="(item, index) in items" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select> </Select>
</div> </div>
...@@ -36,12 +36,30 @@ export default class AppLoginOrg extends Vue { ...@@ -36,12 +36,30 @@ export default class AppLoginOrg extends Vue {
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/** /**
* 当前值 * 下标
*
* @type {number}
* @memberof AppLoginOrg
*/
@Prop({ default: 0 }) public index?: number;
/**
* 项名称
*
* @type {*}
* @memberof AppLoginOrg
*/
get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/**
* 获取当前值
* *
* @type {string} * @type {string}
* @memberof AppLoginOrg * @memberof AppLoginOrg
*/ */
get curKey() { get curValue() {
if (this.value) { if (this.value) {
return this.value; return this.value;
} else { } else {
...@@ -49,8 +67,14 @@ export default class AppLoginOrg extends Vue { ...@@ -49,8 +67,14 @@ export default class AppLoginOrg extends Vue {
} }
} }
set curKey(value: string) { /**
this.$emit('valueChange', { name: this.name, value: value }); * 设置当前值
*
* @type {string}
* @memberof AppLoginOrg
*/
set curValue(value: string) {
this.$emit('valueChange', { name: this.itemName, value: value });
} }
/** /**
...@@ -66,9 +90,11 @@ export default class AppLoginOrg extends Vue { ...@@ -66,9 +90,11 @@ export default class AppLoginOrg extends Vue {
* *
* @memberof AppLoginOrg * @memberof AppLoginOrg
*/ */
get curStyle(){ get curStyle() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.getElementStyle(); if (layoutModel) {
return layoutModel.getElementStyle();
}
} }
/** /**
...@@ -76,9 +102,11 @@ export default class AppLoginOrg extends Vue { ...@@ -76,9 +102,11 @@ export default class AppLoginOrg extends Vue {
* *
* @memberof AppLoginOrg * @memberof AppLoginOrg
*/ */
get curClassName(){ get curClassName() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return `app-login-org ${this.name} ${layoutModel.sysCss}`; if (layoutModel) {
return `app-login-org ${this.itemName} ${layoutModel.sysCss}`;
}
} }
/** /**
......
...@@ -24,7 +24,7 @@ export default class AppThirdLogin extends Vue { ...@@ -24,7 +24,7 @@ export default class AppThirdLogin extends Vue {
* @memberof AppThirdLogin * @memberof AppThirdLogin
*/ */
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/** /**
* 值 * 值
* *
...@@ -41,14 +41,34 @@ export default class AppThirdLogin extends Vue { ...@@ -41,14 +41,34 @@ export default class AppThirdLogin extends Vue {
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/**
* 下标
*
* @type {number}
* @memberof AppThirdLogin
*/
@Prop({ default: 0 }) public index?: number;
/**
* 项名称
*
* @type {*}
* @memberof AppThirdLogin
*/
get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/** /**
* 当前容器样式 * 当前容器样式
* *
* @memberof AppThirdLogin * @memberof AppThirdLogin
*/ */
get curStyle(){ get curStyle() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.getElementStyle(); if (layoutModel) {
return layoutModel.getElementStyle();
}
} }
/** /**
...@@ -56,11 +76,13 @@ export default class AppThirdLogin extends Vue { ...@@ -56,11 +76,13 @@ export default class AppThirdLogin extends Vue {
* *
* @memberof AppThirdLogin * @memberof AppThirdLogin
*/ */
get curClassName(){ get curClassName() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return `app-login-input ${this.name} ${layoutModel.sysCss}`; if (layoutModel) {
return `app-login-input ${this.itemName} ${layoutModel.sysCss}`;
}
} }
/** /**
* 处理第三方登录 * 处理第三方登录
* *
...@@ -87,7 +109,7 @@ export default class AppThirdLogin extends Vue { ...@@ -87,7 +109,7 @@ export default class AppThirdLogin extends Vue {
* @memberof AppThirdLogin * @memberof AppThirdLogin
*/ */
async dingTalkHandleClick() { async dingTalkHandleClick() {
} }
/** /**
...@@ -96,7 +118,7 @@ export default class AppThirdLogin extends Vue { ...@@ -96,7 +118,7 @@ export default class AppThirdLogin extends Vue {
* @memberof AppThirdLogin * @memberof AppThirdLogin
*/ */
async wxWorkHandleClick() { async wxWorkHandleClick() {
} }
} }
</script> </script>
......
// 身份校验
\ No newline at end of file
<template> <template>
<div :class="['app-field-image-dynamic', model.sysCss]" :style="containerStyle"> <div :class="curClassName" :style="curStyle">
<img :style="model.sysCss" :src="imgUrl" /> <img :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 } from 'vue-property-decorator';
import { ImgurlBase64 } from '@/utils'; import { ImgurlBase64 } from '@/utils';
import { Environment } from "@/environments/environment"; import { Environment } from "@/environments/environment";
@Component({}) @Component({})
...@@ -15,7 +15,7 @@ export default class AppFieldImageDynamic extends Vue { ...@@ -15,7 +15,7 @@ export default class AppFieldImageDynamic extends Vue {
* @type {*} * @type {*}
* @memberof AppRawItemImage * @memberof AppRawItemImage
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/** /**
* 模型 * 模型
...@@ -34,12 +34,32 @@ export default class AppFieldImageDynamic extends Vue { ...@@ -34,12 +34,32 @@ export default class AppFieldImageDynamic extends Vue {
@Prop() public value: any; @Prop() public value: any;
/** /**
* 模型 * 下标
*
* @type {number}
* @memberof AppFieldImageDynamic
*/
@Prop({ default: 0 }) public index?: number;
/**
* 值变更
*
* @memberof AppFieldImageDynamic
*/
@Watch('value')
onValueChange(newVal: any, oldVal: any) {
this.handleDynaImg();
}
/**
* 项名称
* *
* @type {*} * @type {*}
* @memberof AppFieldImageDynamic * @memberof AppFieldImageDynamic
*/ */
public model:any = null; get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/** /**
* 动态图片路径 * 动态图片路径
...@@ -56,28 +76,36 @@ export default class AppFieldImageDynamic extends Vue { ...@@ -56,28 +76,36 @@ export default class AppFieldImageDynamic extends Vue {
public downloadUrl = Environment.ExportFile; public downloadUrl = Environment.ExportFile;
/** /**
* 容器样式 * 图片路径
* *
* @type {any}
* @memberof AppFieldImageDynamic * @memberof AppFieldImageDynamic
*/ */
public containerStyle: any = null; get imgUrl(): string {
return this.dynaImgUrl;
}
/** /**
* 图片路径 * 类名
* *
* @memberof AppFieldImageDynamic * @memberof AppFieldImageDynamic
*/ */
get imgUrl(): string { get curClassName() {
return this.dynaImgUrl; const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel) {
return `app-field-image-dynamic ${this.itemName} ${layoutModel.sysCss}`;
}
} }
created() { /**
if (this.layoutModelDetails && this.name) { * 当前容器样式
this.model = this.layoutModelDetails[this.name]; *
this.containerStyle = this.model.getElementStyle(); * @memberof AppFieldImageDynamic
*/
get curStyle() {
const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel) {
return layoutModel.getElementStyle();
} }
this.handleDynaImg();
} }
/** /**
......
<template> <template>
<div :class="['app-rawitem-carousel',model.sysCss]" :style="containerStyle" > <div :class="curClassName" :style="curStyle">
<el-carousel class="carsouel-container" <el-carousel class="carsouel-container" height="150px" indicator-position="outside" :autoplay="false"
height="150px" :interval="swipeConfig.interval">
indicator-position="outside"
:autoplay="false"
:interval="swipeConfig.interval"
>
<el-carousel-item v-for="item in swipeData" :key="item.key"> <el-carousel-item v-for="item in swipeData" :key="item.key">
<div class="carousel-img-item"> <div class="carousel-img-item">
<img class="app-carouse-img" v-if="item.type === 'img'" :src="item.imgPath" @error="imgError" /> <img class="app-carouse-img" v-if="item.type === 'img'" :src="item.imgPath" @error="imgError" />
<i v-else-if="item.type === 'icon'" :class="item.iconClass" ></i> <i v-else-if="item.type === 'icon'" :class="item.iconClass"></i>
</div> </div>
</el-carousel-item> </el-carousel-item>
</el-carousel> </el-carousel>
...@@ -42,14 +38,6 @@ export default class AppCarousel extends Vue { ...@@ -42,14 +38,6 @@ export default class AppCarousel extends Vue {
*/ */
@Prop() public value?: any; @Prop() public value?: any;
/**
* 模型
*
* @type {*}
* @memberof AppCarousel
*/
public model: any;
/** /**
* 名称 * 名称
* *
...@@ -67,57 +55,78 @@ export default class AppCarousel extends Vue { ...@@ -67,57 +55,78 @@ export default class AppCarousel extends Vue {
@Prop() public type?: string; @Prop() public type?: string;
/** /**
* @description 轮播图图片所有项数据 * 下标
*
* @type {number}
* @memberof AppCarousel * @memberof AppCarousel
*/ */
@Prop({ default: 0 }) public index?: number;
public swipeData: any[] = [];
/** /**
* @description 轮播图配置 * 项名称
*
* @type {*}
* @memberof AppCarousel * @memberof AppCarousel
*/ */
public swipeConfig: any = {}; get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/** /**
* 容器样式 * 类名
* *
* @type {any}
* @memberof AppCarousel * @memberof AppCarousel
*/ */
public containerStyle: any = null; get curClassName() {
const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel) {
return `app-rawitem-carousel ${this.itemName} ${layoutModel.sysCss}`;
}
}
/** /**
* data值变化 * 当前容器样式
* *
* @param {*} newVal
* @param {*} oldVal
* @memberof AppCarousel * @memberof AppCarousel
*/ */
@Watch('value', { immediate: true, deep: true }) get curStyle() {
public onDataChange(newVal: any, oldVal: any) { const layoutModel = this.layoutModelDetails[this.itemName];
if (newVal) { if (layoutModel) {
this.handleSwipData(newVal); return layoutModel.getElementStyle();
} }
} }
/** /**
* @description 构建之前 * @description 轮播图图片所有项数据
* @memberof AppCarousel * @memberof AppCarousel
*/ */
created() {
if (this.layoutModelDetails && this.name) { public swipeData: any[] = [];
this.model = this.layoutModelDetails[this.name];
this.containerStyle = this.model.getElementStyle(); /**
} * @description 轮播图配置
* @memberof AppCarousel
*/
public swipeConfig: any = {};
/**
* data值变化
*
* @param {*} newVal
* @param {*} oldVal
* @memberof AppCarousel
*/
@Watch('value', { immediate: true, deep: true })
public onValueChange(newVal: any, oldVal: any) {
//处理轮播图-动态数据 //处理轮播图-动态数据
if (this.type === "FIELD_CAROUSEL") { if (this.type === "FIELD_CAROUSEL") {
if (this.value && typeof this.value === 'string') { if (this.value && typeof this.value === 'string') {
const swipeData = JSON.parse(this.value); const swipeData = JSON.parse(this.value);
this.handleSwipData(swipeData); this.handleSwipData(swipeData);
} }
} else if (this.type === "STATIC_CAROUSEL") {
//处理轮播图-静态数据 //处理轮播图-静态数据
} else if (this.type === "STATIC_CAROUSEL") {
this.handleSwipData(this.value); this.handleSwipData(this.value);
} }
} }
......
<template> <template>
<div :class="['app-rawitem-image', model.sysCss]" :style="containerStyle"> <div :class="curClassName" :style="curStyle">
<img v-if="imgUrl" :src="imgUrl" /> <img v-if="imgUrl" :src="imgUrl" />
<i 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 } 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 {
/** /**
...@@ -15,7 +14,7 @@ export default class AppRawItemImage extends Vue { ...@@ -15,7 +14,7 @@ export default class AppRawItemImage extends Vue {
* @type {*} * @type {*}
* @memberof AppRawItemImage * @memberof AppRawItemImage
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/** /**
* 模型 * 模型
...@@ -42,27 +41,44 @@ export default class AppRawItemImage extends Vue { ...@@ -42,27 +41,44 @@ export default class AppRawItemImage extends Vue {
@Prop() public imageClass?: string; @Prop() public imageClass?: string;
/** /**
* 容器样式 * 下标
* *
* @type {any} * @type {number}
* @memberof AppRawItemImage * @memberof AppRawItemImage
*/ */
public containerStyle: any = null; @Prop({ default: 0 }) public index?: number;
/** /**
* 容器样式 * 项名称
* *
* @type {any} * @type {*}
* @memberof AppRawItemImage * @memberof AppRawItemImage
*/ */
public model: any = null; get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/**
* 类名
*
* @memberof AppRawItemImage
*/
get curClassName() {
const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel) {
return `app-rawitem-image ${this.itemName} ${layoutModel.sysCss}`;
}
}
created() { /**
if (this.layoutModelDetails && this.name) { * 当前容器样式
this.model = this.layoutModelDetails[this.name]; *
this.containerStyle = this.model.getElementStyle(); * @memberof AppRawItemImage
*/
get curStyle() {
const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel) {
return layoutModel.getElementStyle();
} }
} }
......
<template> <template>
<div :class="['app-rawitem-video',model.sysCss]" :style="containerStyle"> <div :class="curClassName" :style="curStyle">
<video :src="playerParams.path" :autoplay="playerParams.autoplay" :controls="playerParams.showcontrols" <video :src="playerParams.path" :autoplay="playerParams.autoplay" :controls="playerParams.showcontrols"
:loop="playerParams.replay" :muted="playerParams.mute"> :loop="playerParams.replay" :muted="playerParams.mute">
<source :src="playerParams.path" type="video/mp4"> <source :src="playerParams.path" type="video/mp4">
...@@ -11,16 +11,16 @@ ...@@ -11,16 +11,16 @@
<script lang="ts"> <script lang="ts">
import { Util } from '@/utils'; import { Util } from '@/utils';
import { Component, Vue, Prop } from 'vue-property-decorator'; import { Component, Vue, Prop, Watch } from 'vue-property-decorator';
@Component({}) @Component({})
export default class AppRawItemVideo extends Vue { export default class AppRawItemVideo extends Vue {
/** /**
* 名称 * 名称
* *
* @type {*} * @type {*}
* @memberof AppRawItemImage * @memberof AppRawItemImage
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/** /**
* 模型 * 模型
...@@ -30,7 +30,6 @@ export default class AppRawItemVideo extends Vue { ...@@ -30,7 +30,6 @@ export default class AppRawItemVideo extends Vue {
*/ */
@Prop() public layoutModelDetails!: any; @Prop() public layoutModelDetails!: any;
/** /**
* 视频播放数据 * 视频播放数据
* @memberof AppRawItemVideo * @memberof AppRawItemVideo
...@@ -38,28 +37,62 @@ export default class AppRawItemVideo extends Vue { ...@@ -38,28 +37,62 @@ export default class AppRawItemVideo extends Vue {
@Prop() public videoParmas?: any; @Prop() public videoParmas?: any;
/** /**
* 模型 * 下标
* *
* @type {*} * @type {number}
* @memberof @memberof AppRawItemVideo * @memberof AppRawItemVideo
*/ */
public model: any; @Prop({ default: 0 }) public index?: number;
/** /**
* 播放器唯一标识 * 值变更
*
* @memberof AppRawItemVideo * @memberof AppRawItemVideo
*/ */
public uuid: string = Util.createUUID(); @Watch('videoParmas')
onVideoParmasChange(newVal: any, oldVal: any) {
this.handleStaticVideo();
}
/** /**
* 容器样式 * 项名称
* *
* @type {any} * @type {*}
* @memberof AppRawItemVideo * @memberof AppRawItemVideo
*/ */
public containerStyle: any = null; get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/**
* 类名
*
* @memberof AppRawItemVideo
*/
get curClassName() {
const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel) {
return `app-rawitem-video ${this.itemName} ${layoutModel.sysCss}`;
}
}
/**
* 当前容器样式
*
* @memberof AppRawItemVideo
*/
get curStyle() {
const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel) {
return layoutModel.getElementStyle();
}
}
/**
* 播放器唯一标识
* @memberof AppRawItemVideo
*/
public uuid: string = Util.createUUID();
/** /**
* 视频播放参数 * 视频播放参数
...@@ -78,21 +111,6 @@ export default class AppRawItemVideo extends Vue { ...@@ -78,21 +111,6 @@ export default class AppRawItemVideo extends Vue {
showcontrols: false showcontrols: false
}; };
created() {
if (this.layoutModelDetails && this.name) {
this.model = this.layoutModelDetails[this.name];
this.containerStyle = this.model.getElementStyle();
}
}
/**
* 生命周期
* @memberof AppRawItemVideo
*/
public mounted() {
this.handleStaticVideo();
}
/** /**
* 处理静态视频播放 * 处理静态视频播放
* *
......
// 多媒体
\ No newline at end of file
<template> <template>
<div :class="curClassName" :style="curStyle"> <div :class="curClassName" :style="curStyle">
<slot></slot> <slot></slot>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Prop, Vue } from "vue-property-decorator"; import { Component, Prop, Vue } from "vue-property-decorator";
@Component({}) @Component({})
export default class AppCtrlPos extends Vue { export default class AppCtrlPos extends Vue {
/** /**
* 名称 * 名称
* *
* @type {string} * @type {string}
* @memberof AppCtrlPos * @memberof AppCtrlPos
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/** /**
* 布局模型详情 * 布局模型详情
* *
* @type {*} * @type {*}
* @memberof AppCtrlPos * @memberof AppCtrlPos
*/ */
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/** /**
* 当前布局模型 * 下标
* *
* @type {*} * @type {number}
* @memberof AppCtrlPos * @memberof AppCtrlPos
*/ */
public currentLayoutModel: any; @Prop({ default: 0 }) public index?: number;
/** /**
* 当前容器类名 * 项名称
* *
* @memberof AppCtrlPos * @type {*}
*/ * @memberof AppCtrlPos
get curClassName() { */
return { get itemName() {
'app-ctrl-pos': true, return this.index ? `${this.name}_${this.index}` : this.name;
[this.name]: true, }
[this.currentLayoutModel.sysCss]: this.currentLayoutModel.sysCss ? true : false
} /**
} * 当前容器类名
*
/** * @memberof AppCtrlPos
* 当前容器样式 */
* get curClassName() {
* @memberof AppCtrlPos const layoutModel = this.layoutModelDetails[this.itemName];
*/ if (layoutModel) {
get curStyle() { return `app-ctrl-pos ${this.itemName} ${layoutModel.sysCss}`;
if (this.currentLayoutModel) { }
return this.currentLayoutModel.getElementStyle(); }
}
return ''; /**
} * 当前容器样式
*
/** * @memberof AppCtrlPos
* Vue生命周期 --- created */
* get curStyle() {
* @memberof AppCtrlPos const layoutModel = this.layoutModelDetails[this.itemName];
*/ if (layoutModel) {
created() { return layoutModel.getElementStyle();
this.currentLayoutModel = this.layoutModelDetails[this.name]; }
} }
} }
</script> </script>
<style lang='less'> <style lang='less'>
@import './app-ctrl-pos.less'; @import './app-ctrl-pos.less';
</style> </style>
\ No newline at end of file
.app-nav-pos { .app-nav-pos {
width: 100%; width: 100%;
height: 100%; height: 100%;
} }
\ No newline at end of file
<template> <template>
<div :class="curClassName" :style="curStyle"> <div :class="curClassName" :style="curStyle">
<template v-if="dynaNavMode === 'ROUTEVIEW'"> <template v-if="dynaNavMode === 'ROUTEVIEW'">
<template v-if="enableCache"> <template v-if="enableCache">
<app-keep-alive :routerList="routerList"> <app-keep-alive :routerList="routerList">
<router-view :key="routerViewKey"></router-view> <router-view :key="routerViewKey"></router-view>
</app-keep-alive> </app-keep-alive>
</template> </template>
<router-view v-else :key="routerViewKey"></router-view> <router-view v-else :key="routerViewKey"></router-view>
</template> </template>
<component <component class="view-container2" v-if="navData && navData.navView" :is="navData.navView"
class="view-container2" :viewDefaultUsage="false" :viewdata="JSON.stringify(navData.srfnavdata.context)"
v-if="navData && navData.navView" :viewparam="JSON.stringify(navData.srfnavdata.viewparmas)" @viewdataschange="handleViewEvent"
:is="navData.navView" @viewLoaded="handleViewEvent" @viewstatechange="handleViewEvent">
:viewDefaultUsage="false" </component>
:viewdata="JSON.stringify(navData.srfnavdata.context)" </div>
:viewparam="JSON.stringify(navData.srfnavdata.viewparmas)" </template>
@viewdataschange="handleViewEvent" <script lang="ts">
@viewLoaded="handleViewEvent" import { Component, Prop, Vue } from "vue-property-decorator";
@viewstatechange="handleViewEvent">
</component> @Component({})
</div> export default class AppNavPos extends Vue {
</template>
<script lang="ts"> /**
import { Component, Prop, Vue } from "vue-property-decorator"; * 名称
*
@Component({}) * @type {string}
export default class AppNavPos extends Vue { * @memberof AppNavPos
*/
/** @Prop() public name!: string;
* 名称
* /**
* @type {string} * 布局模型详情
* @memberof AppNavPos *
*/ * @type {*}
@Prop() public name!: string; * @memberof AppNavPos
*/
/** @Prop() public layoutModelDetails: any;
* 布局模型详情
* /**
* @type {*} * 下标
* @memberof AppNavPos *
*/ * @type {number}
@Prop() public layoutModelDetails: any; * @memberof AppNavPos
*/
/** @Prop({ default: 0 }) public index?: number;
* 导航数据
* /**
* @type {*} * 导航数据
* @memberof AppNavPos *
*/ * @type {*}
@Prop() public navData: any; * @memberof AppNavPos
*/
/** @Prop() public navData: any;
* 当前布局模型
* /**
* @type {*} * 项名称
* @memberof AppNavPos *
*/ * @type {*}
public currentLayoutModel: any; * @memberof AppNavPos
*/
/** get itemName() {
* 获取动态导航模式(DYNAMICCOMP:动态组件 ROUTEVIEW:路由出口) return this.index ? `${this.name}_${this.index}` : this.name;
* }
* @type {"DYNAMICCOMP" | "ROUTEVIEW"}
* @memberof AppNavPos /**
*/ * 获取动态导航模式(DYNAMICCOMP:动态组件 ROUTEVIEW:路由出口)
get dynaNavMode(): "DYNAMICCOMP" | "ROUTEVIEW" { *
const currentModel = this.layoutModelDetails[this.name]; * @type {"DYNAMICCOMP" | "ROUTEVIEW"}
if (currentModel && currentModel.dynaNavMode) { * @memberof AppNavPos
return currentModel.dynaNavMode; */
} get dynaNavMode(): "DYNAMICCOMP" | "ROUTEVIEW" {
return 'DYNAMICCOMP'; const currentModel = this.layoutModelDetails[this.itemName];
} if (currentModel && currentModel.dynaNavMode) {
return currentModel.dynaNavMode;
/** }
* 是否启用动态缓存 return 'DYNAMICCOMP';
* }
* @type {boolean}
* @memberof AppNavPos /**
*/ * 是否启用动态缓存
get enableCache(): boolean { *
const currentModel = this.layoutModelDetails[this.name]; * @type {boolean}
if (currentModel) { * @memberof AppNavPos
return currentModel.enableCache; */
} get enableCache(): boolean {
return false; const currentModel = this.layoutModelDetails[this.itemName];
} if (currentModel) {
return currentModel.enableCache;
/** }
* 路由列表 return false;
* }
* @memberof AppNavPos
*/ /**
get routerList() { * 路由列表
return this.$store.state.historyPathList; *
} * @memberof AppNavPos
*/
/** get routerList() {
* 路由键值 return this.$store.state.historyPathList;
* }
* @memberof AppNavPos
*/ /**
get routerViewKey() { * 路由键值
let _this: any = this; *
return _this.$route.fullPath; * @memberof AppNavPos
} */
get routerViewKey() {
/** let _this: any = this;
* 当前容器类名 return _this.$route.fullPath;
* }
* @memberof AppNavPos
*/ /**
get curClassName() { * 当前容器类名
return { *
'app-nav-pos': true, * @memberof AppNavPos
[this.name]: true, */
[this.currentLayoutModel.sysCss]: this.currentLayoutModel.sysCss ? true : false get curClassName() {
} const currentModel = this.layoutModelDetails[this.itemName];
} if (currentModel) {
return `app-nav-pos ${this.itemName} ${currentModel.sysCss}`;
/** }
* 当前容器样式
* }
* @memberof AppNavPos
*/ /**
get curStyle() { * 当前容器样式
if (this.currentLayoutModel) { *
return this.currentLayoutModel.getElementStyle(); * @memberof AppNavPos
} */
return ''; get curStyle() {
} const currentModel = this.layoutModelDetails[this.itemName];
if (currentModel) {
/** return currentModel.getElementStyle();
* Vue生命周期 --- created }
* }
* @memberof AppNavPos
*/ /**
created() { * 执行视图事件
this.currentLayoutModel = this.layoutModelDetails[this.name]; *
} * @param {*} args
* @memberof AppNavPos
/** */
* 执行视图事件 public handleViewEvent(args: any) {
* console.log(args);
* @param {*} args }
* @memberof AppNavPos
*/ }
public handleViewEvent(args: any) { </script>
console.log(args); <style lang='less'>
} @import './app-nav-pos.less';
}
</script>
<style lang='less'>
@import './app-nav-pos.less';
</style> </style>
\ No newline at end of file
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<script lang="ts"> <script lang="ts">
import { Util } from '@/utils'; import { Util } from '@/utils';
import { Component, Prop, Vue } from 'vue-property-decorator'; import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
@Component({}) @Component({})
export default class AppScrollContainer extends Vue { export default class AppScrollContainer extends Vue {
...@@ -49,6 +49,14 @@ export default class AppScrollContainer extends Vue { ...@@ -49,6 +49,14 @@ export default class AppScrollContainer extends Vue {
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/**
* 下标
*
* @type {number}
* @memberof AppScrollContainer
*/
@Prop({ default: 0 }) public index?: number;
/** /**
* 布局模型详情 * 布局模型详情
* *
...@@ -57,6 +65,16 @@ export default class AppScrollContainer extends Vue { ...@@ -57,6 +65,16 @@ export default class AppScrollContainer extends Vue {
*/ */
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/**
* 布局模型详情变更
* @param newVal
* @param oldVal
*/
@Watch('layoutModelDetails')
onLayoutModelDetailsChange(newVal: any, oldVal: any) {
this.initScrollContainer();
}
/** /**
* 插槽对象 * 插槽对象
* *
...@@ -72,36 +90,43 @@ export default class AppScrollContainer extends Vue { ...@@ -72,36 +90,43 @@ export default class AppScrollContainer extends Vue {
public middleContainerStyle: any = {}; public middleContainerStyle: any = {};
/** /**
* 当前容器样式类 * 项名称
*
* @type {*}
* @memberof AppScrollContainer
*/ */
get curClassName(){ get itemName() {
const layoutModel = this.layoutModelDetails[this.name]; return this.index ? `${this.name}_${this.index}` : this.name;
return `app-scroll-container ${this.name} ${layoutModel.sysCss}`;
} }
/** /**
* 当前容器样式 * 当前容器样式
*/ */
get curStyle(){ get curClassName() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.getElementStyle(); if (layoutModel) {
return `app-scroll-container ${this.itemName} ${layoutModel.sysCss}`;
}
} }
/** /**
* 获取项布局样式 * 当前容器样式
*/ */
public getItemPosStyle(name:string){ get curStyle() {
const layoutModel = this.layoutModelDetails[name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.getBorderLayoutStyle(); if(layoutModel){
return layoutModel.getElementStyle();
}
} }
/** /**
* 组件初始化 * 获取项布局样式
*
* @memberof AppScrollContainer
*/ */
public created() { public getItemPosStyle(name: string) {
this.initScrollContainer(); const layoutModel = this.layoutModelDetails[this.itemName];
if(layoutModel){
return layoutModel.getBorderLayoutStyle();
}
} }
/** /**
...@@ -111,8 +136,8 @@ export default class AppScrollContainer extends Vue { ...@@ -111,8 +136,8 @@ export default class AppScrollContainer extends Vue {
*/ */
public initScrollContainer() { public initScrollContainer() {
let minusHeight = ''; let minusHeight = '';
let minusWidth:string = ''; let minusWidth: string = '';
const curLayoutModel = this.layoutModelDetails[this.name]; const curLayoutModel = this.layoutModelDetails[this.itemName];
if (curLayoutModel && curLayoutModel.details && curLayoutModel.details.length > 0) { if (curLayoutModel && curLayoutModel.details && curLayoutModel.details.length > 0) {
curLayoutModel.details.forEach((key: string) => { curLayoutModel.details.forEach((key: string) => {
const { name, layoutWidth, widthMode, layoutHeight, heightMode, layoutPos } = this.layoutModelDetails[key]; const { name, layoutWidth, widthMode, layoutHeight, heightMode, layoutPos } = this.layoutModelDetails[key];
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'; import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
@Component({}) @Component({})
export default class AppSimpleFlexContainer extends Vue { export default class AppSimpleFlexContainer extends Vue {
...@@ -21,6 +21,14 @@ export default class AppSimpleFlexContainer extends Vue { ...@@ -21,6 +21,14 @@ export default class AppSimpleFlexContainer extends Vue {
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/**
* 下标
*
* @type {number}
* @memberof AppSimpleFlexContainer
*/
@Prop({ default: 0 }) public index?: number;
/** /**
* 布局模型详情 * 布局模型详情
* *
...@@ -29,6 +37,16 @@ export default class AppSimpleFlexContainer extends Vue { ...@@ -29,6 +37,16 @@ export default class AppSimpleFlexContainer extends Vue {
*/ */
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/**
* 布局模型详情变更
* @param newVal
* @param oldVal
*/
@Watch('layoutModelDetails')
onLayoutModelDetailsChange(newVal: any, oldVal: any) {
this.initSimpleFlexContainer();
}
/** /**
* 插槽对象 * 插槽对象
* *
...@@ -37,12 +55,13 @@ export default class AppSimpleFlexContainer extends Vue { ...@@ -37,12 +55,13 @@ export default class AppSimpleFlexContainer extends Vue {
public containerModel: any[] = []; public containerModel: any[] = [];
/** /**
* 组件初始化 * 项名称
* *
* @memberof SimpleFlexContainer * @type {*}
* @memberof AppSimpleFlexContainer
*/ */
public created() { get itemName() {
this.initSimpleFlexContainer(); return this.index ? `${this.name}_${this.index}` : this.name;
} }
/** /**
...@@ -51,7 +70,7 @@ export default class AppSimpleFlexContainer extends Vue { ...@@ -51,7 +70,7 @@ export default class AppSimpleFlexContainer extends Vue {
* @memberof SimpleFlexContainer * @memberof SimpleFlexContainer
*/ */
public initSimpleFlexContainer() { public initSimpleFlexContainer() {
const curLayoutModel = this.layoutModelDetails[this.name]; const curLayoutModel = this.layoutModelDetails[this.itemName];
if (curLayoutModel && curLayoutModel.details && curLayoutModel.details.length > 0) { if (curLayoutModel && curLayoutModel.details && curLayoutModel.details.length > 0) {
curLayoutModel.details.forEach((key: string) => { curLayoutModel.details.forEach((key: string) => {
this.containerModel.push(key); this.containerModel.push(key);
...@@ -63,24 +82,35 @@ export default class AppSimpleFlexContainer extends Vue { ...@@ -63,24 +82,35 @@ export default class AppSimpleFlexContainer extends Vue {
* 当前容器样式类 * 当前容器样式类
*/ */
get curClassName() { get curClassName() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return `app-simpleflex-container ${this.name} ${layoutModel.sysCss}`; if (layoutModel) {
return `app-simpleflex-container ${this.itemName} ${layoutModel.sysCss}`;
}
} }
/** /**
* 当前容器样式 * 当前容器样式
*/ */
get curStyle() { get curStyle() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.getElementStyle(); if (layoutModel) {
return layoutModel.getElementStyle();
}
} }
/** /**
* 获取项布局样式 * 获取项布局样式
*/ */
public getItemPosStyle(name: string) { public getItemPosStyle(name: string) {
const layoutModel = this.layoutModelDetails[name]; let layoutModel: any;
return layoutModel.getCommonLayoutStyle(); if (this.index) {
layoutModel = this.layoutModelDetails[`${name}_${this.index}`];
} else {
layoutModel = this.layoutModelDetails[name];
}
if (layoutModel) {
return layoutModel.getCommonLayoutStyle();
}
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'; import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
@Component({}) @Component({})
export default class AppStandardContainer extends Vue { export default class AppStandardContainer extends Vue {
...@@ -21,6 +21,14 @@ export default class AppStandardContainer extends Vue { ...@@ -21,6 +21,14 @@ export default class AppStandardContainer extends Vue {
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/**
* 下标
*
* @type {number}
* @memberof AppStandardContainer
*/
@Prop({ default: 0 }) public index?: number;
/** /**
* 布局模型详情 * 布局模型详情
* *
...@@ -30,28 +38,39 @@ export default class AppStandardContainer extends Vue { ...@@ -30,28 +38,39 @@ export default class AppStandardContainer extends Vue {
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/** /**
* 插槽对象 * 项名称
* *
* @type {*}
* @memberof AppStandardContainer * @memberof AppStandardContainer
*/ */
public containerModel: any[] = []; get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/** /**
* 组件初始化 * 布局模型详情变更
* * @param newVal
* @memberof SimpleFlexContainer * @param oldVal
*/ */
public created() { @Watch('layoutModelDetails')
this.initSimpleFlexContainer(); onLayoutModelDetailsChange(newVal: any, oldVal: any) {
this.initStandardContainer();
} }
/** /**
* 初始化SIMPLEFLEX容器 * 插槽对象
* *
* @memberof SimpleFlexContainer * @memberof AppStandardContainer
*/ */
public initSimpleFlexContainer() { public containerModel: any[] = [];
const curLayoutModel = this.layoutModelDetails[this.name];
/**
* 初始化常规容器
*
* @memberof AppStandardContainer
*/
public initStandardContainer() {
const curLayoutModel = this.layoutModelDetails[this.itemName];
if (curLayoutModel && curLayoutModel.details && curLayoutModel.details.length > 0) { if (curLayoutModel && curLayoutModel.details && curLayoutModel.details.length > 0) {
curLayoutModel.details.forEach((key: string) => { curLayoutModel.details.forEach((key: string) => {
this.containerModel.push(key); this.containerModel.push(key);
...@@ -63,24 +82,35 @@ export default class AppStandardContainer extends Vue { ...@@ -63,24 +82,35 @@ export default class AppStandardContainer extends Vue {
* 当前容器样式类 * 当前容器样式类
*/ */
get curClassName() { get curClassName() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return `app-standard-container ${this.name} ${layoutModel.sysCss}`; if (layoutModel) {
return `app-standard-container ${this.itemName} ${layoutModel.sysCss}`;
}
} }
/** /**
* 当前容器样式 * 当前容器样式
*/ */
get curStyle() { get curStyle() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.getElementStyle(); if (layoutModel) {
return layoutModel.getElementStyle();
}
} }
/** /**
* 获取项布局样式 * 获取项布局样式
*/ */
public getItemPosStyle(name: string) { public getItemPosStyle(name: string) {
const layoutModel = this.layoutModelDetails[name]; let layoutModel: any;
return layoutModel.getCommonLayoutStyle(); if (this.index) {
layoutModel = this.layoutModelDetails[`${name}_${this.index}`];
} else {
layoutModel = this.layoutModelDetails[name];
}
if (layoutModel) {
return layoutModel.getCommonLayoutStyle();
}
} }
} }
</script> </script>
......
<template> <template>
<TabPane :label="currentLayoutModel.caption" :name="currentLayoutModel.name" :tab="currentLayoutModel.parentName" :class="curClassName" :style="curStyle"> <TabPane :label="currentLayoutModel.caption" :name="currentLayoutModel.name" :tab="currentLayoutModel.parentName"
<template v-if="containerModel.length > 0"> :class="curClassName" :style="curStyle">
<template v-for="name of containerModel"> <template v-if="containerModel.length > 0">
<slot :name="name"></slot> <template v-for="name of containerModel">
</template> <slot :name="name"></slot>
</template> </template>
</TabPane> </template>
</template> </TabPane>
</template>
<script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'; <script lang="ts">
import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
@Component({})
export default class AppTabPage extends Vue { @Component({})
/** export default class AppTabPage extends Vue {
* 名称 /**
* * 名称
* @type {string} *
* @memberof AppTabPage * @type {string}
*/ * @memberof AppTabPage
@Prop() public name!: string; */
@Prop() public name!: string;
/**
* 布局模型详情 /**
* * 布局模型详情
* @type {string} *
* @memberof AppTabPage * @type {string}
*/ * @memberof AppTabPage
@Prop() public layoutModelDetails: any; */
@Prop() public layoutModelDetails: any;
/**
* 当前布局模型 /**
* * 下标
* @type {*} *
* @memberof AppTabPage * @type {number}
*/ * @memberof AppTabPage
public currentLayoutModel: any; */
@Prop({ default: 0 }) public index?: number;
/**
* 插槽对象 /**
* * 布局模型详情变更
* @memberof AppTabPage * @param newVal
*/ * @param oldVal
public containerModel: any[] = []; */
@Watch('layoutModelDetails')
/** onLayoutModelDetailsChange(newVal: any, oldVal: any) {
* 组件初始化 this.initTabPage();
* }
* @memberof AppTabPage
*/ /**
public created() { * 插槽对象
this.init(); *
} * @memberof AppTabPage
*/
/** public containerModel: any[] = [];
* 初始化子项
* /**
* @memberof AppTabPage * 当前布局模型
*/ *
public init() { * @memberof AppTabPage
this.currentLayoutModel = this.layoutModelDetails[this.name]; */
if (this.currentLayoutModel && this.currentLayoutModel.details && this.currentLayoutModel.details.length > 0) { public currentLayoutModel: any = {};
this.currentLayoutModel.details.forEach((key: string) => {
this.containerModel.push(key); /**
}) * 项名称
} *
} * @type {*}
* @memberof AppTabPage
/** */
* 当前容器样式类 get itemName() {
* return this.index ? `${this.name}_${this.index}` : this.name;
* @memberof AppTabPage }
*/
get curClassName() { /**
return { * 初始化子项
'app-tab-page': true, *
[this.name]: true, * @memberof AppTabPage
[this.currentLayoutModel.sysCss]: this.currentLayoutModel.sysCss ? true : false */
} public initTabPage() {
} const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel && layoutModel.details && layoutModel.details.length > 0) {
/** this.currentLayoutModel = layoutModel;
* 当前容器样式 layoutModel.details.forEach((key: string) => {
* this.containerModel.push(key);
* @memberof AppTabPage })
*/ }
get curStyle() { }
if (this.currentLayoutModel) {
return this.currentLayoutModel.getElementStyle(); /**
} * 当前容器样式类
return ''; *
} * @memberof AppTabPage
*/
} get curClassName() {
</script> const layoutModel = this.layoutModelDetails[this.itemName];
<style lang='less'> if (layoutModel) {
@import './app-tab-page.less'; return `app-tab-page ${this.itemName} ${layoutModel.sysCss}`;
}
}
/**
* 当前容器样式
*
* @memberof AppTabPage
*/
get curStyle() {
const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel) {
return layoutModel.getElementStyle();
}
}
}
</script>
<style lang='less'>
@import './app-tab-page.less';
</style> </style>
\ No newline at end of file
<template> <template>
<Tabs v-model="activeName" @on-click="handleClick" :name="name" :class="curClassName"> <Tabs v-model="activeName" @on-click="handleClick" :name="name" :class="curClassName">
<template v-if="containerModel.length > 0"> <template v-if="containerModel.length > 0">
<template v-for="name of containerModel"> <template v-for="name of containerModel">
<slot :name="name"></slot> <slot :name="name"></slot>
</template> </template>
</template> </template>
</Tabs> </Tabs>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Prop, Vue } from 'vue-property-decorator'; import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
@Component({}) @Component({})
export default class AppTabPanel extends Vue { export default class AppTabPanel extends Vue {
/** /**
* 名称 * 名称
* *
* @type {string} * @type {string}
* @memberof AppTabPanel * @memberof AppTabPanel
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/** /**
* 布局模型详情 * 布局模型详情
* *
* @type {*} * @type {*}
* @memberof AppTabPanel * @memberof AppTabPanel
*/ */
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/** /**
* 当前布局模型 * 下标
* *
* @type {*} * @type {number}
* @memberof AppTabPanel * @memberof AppTabPanel
*/ */
public currentLayoutModel: any; @Prop({ default: 0 }) public index?: number;
/** /**
* 插槽对象 * 项名称
* *
* @memberof AppTabPanel * @type {*}
*/ * @memberof AppTabPanel
public containerModel: any[] = []; */
get itemName() {
/** return this.index ? `${this.name}_${this.index}` : this.name;
* 当前激活项 }
*
* @memberof AppTabPanel /**
*/ * 插槽对象
public activeName: string = ''; *
* @memberof AppTabPanel
/** */
* 组件初始化 public containerModel: any[] = [];
*
* @memberof AppTabPanel /**
*/ * 当前激活项
public created() { *
this.initTabPage(); * @memberof AppTabPanel
} */
public activeName: string = '';
/**
* 初始化分页 /**
* * 布局模型详情变更
* @memberof AppTabPanel * @param newVal
*/ * @param oldVal
public initTabPage() { */
this.currentLayoutModel = this.layoutModelDetails[this.name]; @Watch('layoutModelDetails')
if (this.currentLayoutModel && this.currentLayoutModel.details && this.currentLayoutModel.details.length > 0) { onLayoutModelDetailsChange(newVal: any, oldVal: any) {
this.currentLayoutModel.details.forEach((key: string) => { this.initTabPanel();
this.containerModel.push(key); }
})
} /**
this.activeName = this.containerModel && this.containerModel.length > 0 ? this.containerModel[0] : ''; * 初始化分页
this.layoutModelDetails[this.name].clickPage(this.activeName); *
} * @memberof AppTabPanel
*/
/** public initTabPanel() {
* 处理分页点击 const layoutModel = this.layoutModelDetails[this.itemName];
* if (layoutModel && layoutModel.details && layoutModel.details.length > 0) {
* @memberof AppTabPanel layoutModel.details.forEach((key: string) => {
*/ this.containerModel.push(key);
public handleClick(tab: any) { })
this.layoutModelDetails[this.name].clickPage(tab); }
} this.activeName = this.containerModel && this.containerModel.length > 0 ? this.containerModel[0] : '';
this.layoutModelDetails[this.itemName].clickPage(this.activeName);
/** }
* 当前容器类名
* /**
* @memberof AppTabPanel * 处理分页点击
*/ *
get curClassName() { * @memberof AppTabPanel
return { */
'app-tab-panel': true, public handleClick(tab: any) {
[this.name]: true, if (this.layoutModelDetails[this.itemName]) {
[this.currentLayoutModel.sysCss]: this.currentLayoutModel.sysCss ? true : false this.layoutModelDetails[this.itemName].clickPage(tab);
} }
} }
/** /**
* 当前容器样式 * 当前容器类名
* *
* @memberof AppTabPanel * @memberof AppTabPanel
*/ */
get curStyle() { get curClassName() {
if (this.currentLayoutModel) { const layoutModel = this.layoutModelDetails[this.itemName];
return this.currentLayoutModel.getElementStyle(); if (layoutModel) {
} return `app-tab-panel ${this.itemName} ${layoutModel.sysCss}`;
return ''; }
} }
}
</script> /**
<style lang='less'> * 当前容器样式
@import './app-tab-panel.less'; *
* @memberof AppTabPanel
*/
get curStyle() {
const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel) {
return layoutModel.getElementStyle();
}
}
}
</script>
<style lang='less'>
@import './app-tab-panel.less';
</style> </style>
\ No newline at end of file
...@@ -10,41 +10,63 @@ import { Vue, Component, Prop } from "vue-property-decorator"; ...@@ -10,41 +10,63 @@ import { Vue, Component, Prop } from "vue-property-decorator";
@Component({}) @Component({})
export default class AppPresetCaption extends Vue { export default class AppPresetCaption extends Vue {
/** /**
* 名称 * 名称
* *
* @type {string} * @type {string}
* @memberof AppPresetCaption * @memberof AppPresetCaption
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/** /**
* 布局模型详情 * 布局模型详情
* *
* @type {*} * @type {*}
* @memberof AppPresetCaption * @memberof AppPresetCaption
*/ */
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/** /**
* 类名 * 下标
* *
* @memberof AppPresetCaption * @type {number}
*/ * @memberof AppPresetCaption
get curClassName(){ */
const layoutModel = this.layoutModelDetails[this.name]; @Prop({ default: 0 }) public index?: number;
return `app-preset-caption ${this.name} ${layoutModel.sysCss}`;
/**
* 项名称
*
* @type {*}
* @memberof AppPresetCaption
*/
get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/**
* 类名
*
* @memberof AppPresetCaption
*/
get curClassName() {
const layoutModel = this.layoutModelDetails[this.itemName];
if (layoutModel) {
return `app-preset-caption ${this.itemName} ${layoutModel.sysCss}`;
} }
}
/** /**
* 当前容器样式 * 当前容器样式
* *
* @memberof AppPresetCaption * @memberof AppPresetCaption
*/ */
get curStyle(){ get curStyle() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.getElementStyle(); if (layoutModel) {
return layoutModel.getElementStyle();
} }
}
} }
</script> </script>
......
...@@ -81,18 +81,39 @@ export default class AppPresetText extends Vue { ...@@ -81,18 +81,39 @@ export default class AppPresetText extends Vue {
*/ */
@Prop() public imageClass?: string; @Prop() public imageClass?: string;
/**
* 下标
*
* @type {number}
* @memberof AppPresetText
*/
@Prop({ default: 0 }) public index?: number;
/**
* 项名称
*
* @type {*}
* @memberof AppPresetText
*/
get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/** /**
* 图片路径 * 图片路径
* *
* @memberof AppPresetText * @memberof AppPresetText
*/ */
get imagePath() { get imagePath() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
let imagePath = ''; if (layoutModel) {
if (layoutModel.sysImage) { let imagePath = '';
imagePath = layoutModel.sysImage.imagePath; if (layoutModel.sysImage) {
imagePath = layoutModel.sysImage.imagePath;
}
return imagePath;
} }
return imagePath;
} }
/** /**
...@@ -101,12 +122,14 @@ export default class AppPresetText extends Vue { ...@@ -101,12 +122,14 @@ export default class AppPresetText extends Vue {
* @memberof AppPresetTitle * @memberof AppPresetTitle
*/ */
get cssClass() { get cssClass() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
let cssClass = ''; if (layoutModel) {
if (layoutModel.sysImage) { let cssClass = '';
cssClass = layoutModel.sysImage.iconcls; if (layoutModel.sysImage) {
cssClass = layoutModel.sysImage.iconcls;
}
return cssClass;
} }
return cssClass;
} }
/** /**
...@@ -115,8 +138,10 @@ export default class AppPresetText extends Vue { ...@@ -115,8 +138,10 @@ export default class AppPresetText extends Vue {
* @memberof AppPresetTitle * @memberof AppPresetTitle
*/ */
get contentType() { get contentType() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.contentType || 'RAW'; if (layoutModel) {
return layoutModel.contentType || 'RAW';
}
} }
/** /**
...@@ -125,8 +150,10 @@ export default class AppPresetText extends Vue { ...@@ -125,8 +150,10 @@ export default class AppPresetText extends Vue {
* @memberof AppPresetTitle * @memberof AppPresetTitle
*/ */
get curClassName() { get curClassName() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return `app-preset-text app-preset-text--${this.contentType.toLowerCase()} ${this.name} ${layoutModel.sysCss}`; if (layoutModel) {
return `app-preset-text app-preset-text--${this.contentType.toLowerCase()} ${this.itemName} ${layoutModel.sysCss}`;
}
} }
/** /**
...@@ -135,8 +162,10 @@ export default class AppPresetText extends Vue { ...@@ -135,8 +162,10 @@ export default class AppPresetText extends Vue {
* @memberof AppPresetTitle * @memberof AppPresetTitle
*/ */
get curStyle() { get curStyle() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.getElementStyle(); if (layoutModel) {
return layoutModel.getElementStyle();
}
} }
/** /**
...@@ -145,8 +174,10 @@ export default class AppPresetText extends Vue { ...@@ -145,8 +174,10 @@ export default class AppPresetText extends Vue {
* @memberof AppPresetTitle * @memberof AppPresetTitle
*/ */
get renderMode() { get renderMode() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.renderMode || 'TEXT'; if (layoutModel) {
return layoutModel.renderMode || 'TEXT';
}
} }
/** /**
...@@ -154,10 +185,10 @@ export default class AppPresetText extends Vue { ...@@ -154,10 +185,10 @@ export default class AppPresetText extends Vue {
* *
* @memberof AppPresetText * @memberof AppPresetText
*/ */
get content(): string { get content() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
let content = this.value; let content = this.value;
if (layoutModel.predefinedType && layoutModel.predefinedType !== 'FIELD_TEXT_DYNAMIC') { if (layoutModel && layoutModel.predefinedType && layoutModel.predefinedType !== 'FIELD_TEXT_DYNAMIC') {
if (this.contentType == 'RAW') { if (this.contentType == 'RAW') {
content = layoutModel.rawContent; content = layoutModel.rawContent;
} else if (this.contentType == 'HTML') { } else if (this.contentType == 'HTML') {
...@@ -182,13 +213,15 @@ export default class AppPresetText extends Vue { ...@@ -182,13 +213,15 @@ export default class AppPresetText extends Vue {
* *
* @memberof AppPresetText * @memberof AppPresetText
*/ */
get contentStyle(): string { get contentStyle() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
let contentStyle = layoutModel.contentStyle; if (layoutModel) {
if (layoutModel.predefinedType === 'STATIC_LABEL') { let contentStyle = layoutModel.contentStyle;
contentStyle += "white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"; if (layoutModel.predefinedType === 'STATIC_LABEL') {
contentStyle += "white-space: nowrap;overflow: hidden;text-overflow: ellipsis;";
}
return contentStyle;
} }
return contentStyle;
} }
} }
</script> </script>
......
...@@ -24,14 +24,34 @@ export default class AppPresetTitle extends Vue { ...@@ -24,14 +24,34 @@ export default class AppPresetTitle extends Vue {
*/ */
@Prop() public layoutModelDetails: any; @Prop() public layoutModelDetails: any;
/**
* 下标
*
* @type {number}
* @memberof AppPresetTitle
*/
@Prop({ default: 0 }) public index?: number;
/**
* 项名称
*
* @type {*}
* @memberof AppPresetTitle
*/
get itemName() {
return this.index ? `${this.name}_${this.index}` : this.name;
}
/** /**
* 类名 * 类名
* *
* @memberof AppPresetTitle * @memberof AppPresetTitle
*/ */
get curClassName(){ get curClassName() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return `app-preset-title ${this.name} ${layoutModel.sysCss}`; if (layoutModel) {
return `app-preset-title ${this.itemName} ${layoutModel.sysCss}`;
}
} }
/** /**
...@@ -39,9 +59,11 @@ export default class AppPresetTitle extends Vue { ...@@ -39,9 +59,11 @@ export default class AppPresetTitle extends Vue {
* *
* @memberof AppPresetTitle * @memberof AppPresetTitle
*/ */
get curStyle(){ get curStyle() {
const layoutModel = this.layoutModelDetails[this.name]; const layoutModel = this.layoutModelDetails[this.itemName];
return layoutModel.getElementStyle(); if (layoutModel) {
return layoutModel.getElementStyle();
}
} }
/** /**
......
// 文本项
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册