提交 b5e06fb8 编写于 作者: RedPig97's avatar RedPig97

update:登录组件更新

上级 e8723ee1
<template> <template>
<div :class="[model.sysCss, 'app-login-button']" :style="containerStyle"> <div :class="curClassName" :style="curStyle">
<i-button @click="handleClick" :type="curStyle"> <i-button
<template v-if="model.sysImage"> @click="handleClick"
<i v-if="model.sysImage.iconcls" :class="model.sysImage.iconcls"/> :disabled="disabled"
<img v-else-if="model.sysImage.imagePath" :src="model.sysImage.imagePath" /> :title="curTooltip"
</template> :type="buttonType">
<span v-show="model.isShowCaption">{{ model.caption }}</span> <div :class="['button-content', iconAlign.toLowerCase()]">
<span v-if="cssClass || imagePath" class="icon">
<i v-if="cssClass" :class="cssClass" />
<img v-else :src="imagePath" />
</span>
<span v-if="showCaption" class="caption">{{ curCaption }}</span>
</div>
</i-button> </i-button>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { PanelButtonModel } from "@/model/panel-detail";
import { Vue, Component, Prop } from "vue-property-decorator"; import { Vue, Component, Prop } from "vue-property-decorator";
@Component({}) @Component({})
...@@ -20,7 +25,7 @@ export default class AppLoginButton extends Vue { ...@@ -20,7 +25,7 @@ export default class AppLoginButton extends Vue {
/** /**
* 名称 * 名称
* *
* @type {PanelButtonModel} * @type {string}
* @memberof AppLoginButton * @memberof AppLoginButton
*/ */
@Prop() public name!: string; @Prop() public name!: string;
...@@ -28,10 +33,10 @@ export default class AppLoginButton extends Vue { ...@@ -28,10 +33,10 @@ export default class AppLoginButton extends Vue {
/** /**
* 模型 * 模型
* *
* @type {PanelButtonModel} * @type {any}
* @memberof AppLoginButton * @memberof AppLoginButton
*/ */
@Prop() public model!: PanelButtonModel; @Prop() public layoutModelDetails: any;
/** /**
* 类型 * 类型
...@@ -41,29 +46,154 @@ export default class AppLoginButton extends Vue { ...@@ -41,29 +46,154 @@ export default class AppLoginButton extends Vue {
*/ */
@Prop() public defaultStyle?: string; @Prop() public defaultStyle?: string;
/**
* 加载状态
*
* @memberof AppLoginButton
*/
@Prop({ default: false }) public loading?: boolean;
/**
* 标题
*
* @memberof AppLoginButton
*/
get curCaption() {
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.caption;
}
/**
* 提示信息
*
* @memberof AppLoginButton
*/
get curTooltip() {
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.tooltip;
}
/**
* 显示标题
*
* @memberof AppLoginButton
*/
get showCaption() {
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.isShowCaption;
}
/** /**
* 当前按钮类型 * 当前按钮类型
* *
* @type {string} * @type {string}
* @memberof AppLoginButton * @memberof AppLoginButton
*/ */
get curStyle(): string { get buttonType(): string {
if (this.model.renderMode == 'LINK') { const layoutModel = this.layoutModelDetails[this.name];
if (layoutModel.renderMode == 'LINK') {
return 'text'; return 'text';
} else if (this.model.buttonStyle != "DEFAULT" && this.defaultStyle) { } else if (layoutModel.buttonStyle != "DEFAULT" && this.defaultStyle) {
return this.defaultStyle; return this.defaultStyle;
} else { } else {
return this.model.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();
}
}
}
/**
* 当前容器样式
*
* @memberof AppLoginButton
*/
get curStyle(){
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.getElementStyle();
}
/**
* 禁用
*
* @memberof AppLoginButton
*/
get disabled(){
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.disabled;
}
/**
* 类名
*
* @memberof AppLoginButton
*/
get curClassName(){
const layoutModel = this.layoutModelDetails[this.name];
return `app-login-button ${this.name} ${layoutModel.sysCss}`;
}
/**
* 图片路径
*
* @memberof AppLoginButton
*/
get imagePath() {
const layoutModel = this.layoutModelDetails[this.name];
let imagePath = '';
if (layoutModel.sysImage) {
imagePath = layoutModel.sysImage.imagePath;
} else if (layoutModel.uiAction) {
imagePath = layoutModel.uiAction.imagePath;
} }
return imagePath;
} }
/** /**
* 按钮样式 * 图标
* *
* @type {string}
* @memberof AppLoginButton * @memberof AppLoginButton
*/ */
public containerStyle: any = null; get cssClass() {
const layoutModel = this.layoutModelDetails[this.name];
let cssClass = '';
if (layoutModel.sysImage) {
cssClass = layoutModel.sysImage.iconcls;
} else if (layoutModel.uiAction) {
cssClass = layoutModel.uiAction.iconcls;
}
return cssClass;
}
/**
* 图标方向
*
* @memberof AppLoginButton
*/
get iconAlign() {
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.iconAlign || 'LEFT';
}
/**
* 按钮幽灵属性,使按钮背景透明
*
* @memberof AppLoginButton
*/
get buttonGhost() {
const layoutModel = this.layoutModelDetails[this.name];
return Object.is(layoutModel.buttonStyle, 'INVERSE');
}
/** /**
* 处理点击 * 处理点击
...@@ -75,11 +205,6 @@ export default class AppLoginButton extends Vue { ...@@ -75,11 +205,6 @@ export default class AppLoginButton extends Vue {
this.$emit("itemClick", this.name); this.$emit("itemClick", this.name);
} }
public mounted() {
if (this.model) {
this.containerStyle = this.model.getElementStyle();
}
}
} }
</script> </script>
......
<template> <template>
<div :class="[model.sysCss, 'app-login-captcha']" :style="containerStyle"> <div :class="curClassName" :style="curStyle">
<auth-puzzle-vcode :show="show" @success="onSuccess" @fail="onFail" /> <auth-puzzle-vcode :show="show" @success="onSuccess" @fail="onFail" />
<i-button :type="type" @click="executeOpen">验证</i-button> <i-button :type="type" @click="executeOpen">验证</i-button>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { PanelUserControlModel } from "@/model/panel-detail";
import { Vue, Component, Prop } from "vue-property-decorator"; import { Vue, Component, Prop } from "vue-property-decorator";
import AuthPuzzleVcode from "./vue-puzzle-code/vue-puzzle-code.vue"; import AuthPuzzleVcode from "./vue-puzzle-code/vue-puzzle-code.vue";
@Component({ @Component({
...@@ -21,7 +20,7 @@ export default class AppLoginCaptcha extends Vue { ...@@ -21,7 +20,7 @@ export default class AppLoginCaptcha extends Vue {
* @type {string} * @type {string}
* @memberof AppLoginCaptcha * @memberof AppLoginCaptcha
*/ */
@Prop() public model!: PanelUserControlModel; @Prop() public layoutModelDetails: any;
/** /**
* 值 * 值
...@@ -40,12 +39,24 @@ export default class AppLoginCaptcha extends Vue { ...@@ -40,12 +39,24 @@ export default class AppLoginCaptcha extends Vue {
@Prop() public name!: string; @Prop() public name!: string;
/** /**
* 容器样式 * 当前容器样式
*
* @memberof AppLoginCaptcha
*/
get curStyle(){
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.getElementStyle();
}
/**
* 类名
* *
* @type {any}
* @memberof AppLoginCaptcha * @memberof AppLoginCaptcha
*/ */
public containerStyle: any = null; get curClassName(){
const layoutModel = this.layoutModelDetails[this.name];
return `app-login-captcha ${this.name} ${layoutModel.sysCss}`;
}
/** /**
* 是否显示 * 是否显示
...@@ -57,10 +68,7 @@ export default class AppLoginCaptcha extends Vue { ...@@ -57,10 +68,7 @@ export default class AppLoginCaptcha extends Vue {
*/ */
public type: string = 'default'; public type: string = 'default';
public mounted() { public created() {
if (this.model) {
this.containerStyle = this.model.getElementStyle();
}
if (this.value) { if (this.value) {
this.type = 'success'; this.type = 'success';
} }
......
<template> <template>
<div :class="[model.sysCss, 'app-login-input']" :style="containerStyle"> <div :class="curClassName" :style="curStyle">
<i-input <i-input
size='large' size='large'
:prefix='defaultIcon' :prefix='defaultIcon'
...@@ -7,13 +7,12 @@ ...@@ -7,13 +7,12 @@
:type="defaultType" :type="defaultType"
:disabled="disabled" :disabled="disabled"
:readonly="readonly" :readonly="readonly"
:placeholder="model.caption"> :placeholder="curCaption">
</i-input> </i-input>
</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 } from 'vue-property-decorator';
@Component({ @Component({
...@@ -23,10 +22,10 @@ export default class AppLoginInput extends Vue { ...@@ -23,10 +22,10 @@ export default class AppLoginInput extends Vue {
/** /**
* 模型 * 模型
* *
* @type {string} * @type {any}
* @memberof AppLoginInput * @memberof AppLoginInput
*/ */
@Prop() public model!: PanelFieldModel; @Prop() public layoutModelDetails: any;
/** /**
* 值 * 值
...@@ -60,29 +59,35 @@ export default class AppLoginInput extends Vue { ...@@ -60,29 +59,35 @@ export default class AppLoginInput extends Vue {
*/ */
@Prop() public defaultType?: string; @Prop() public defaultType?: string;
/** /**
* 容器样式 * 标题
* *
* @type {any}
* @memberof AppLoginInput * @memberof AppLoginInput
*/ */
public containerStyle: any = null; get curCaption() {
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.caption;
}
/** /**
* 禁用模式 * 当前容器样式
* *
* @type {any}
* @memberof AppLoginInput * @memberof AppLoginInput
*/ */
public disabled: boolean = false; get curStyle(){
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.getElementStyle();
}
/** /**
* 只读模式 * 类名
* *
* @type {any}
* @memberof AppLoginInput * @memberof AppLoginInput
*/ */
public readonly: boolean = false; get curClassName(){
const layoutModel = this.layoutModelDetails[this.name];
return `app-login-input ${this.name} ${layoutModel.sysCss}`;
}
/** /**
* 当前值 * 当前值
...@@ -103,12 +108,24 @@ export default class AppLoginInput extends Vue { ...@@ -103,12 +108,24 @@ export default class AppLoginInput extends Vue {
this.$emit('valueChange', { name: this.name, value: val }); this.$emit('valueChange', { name: this.name, value: val });
} }
public mounted() { /**
if (this.model) { * 禁用
this.containerStyle = this.model.getElementStyle(); *
this.disabled = Object.is(this.model.fieldState, '1'); * @memberof AppPresetSwitch
this.readonly = Object.is(this.model.fieldState, '2'); */
} get disabled() {
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.disabled;
}
/**
* 只读
*
* @memberof AppPresetSwitch
*/
get readonly() {
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.readonly;
} }
} }
......
<template> <template>
<div :class="[model.sysCss, 'app-login-message']" :style="containerStyle"> <div :class="curClassName" :style="curStyle">
<alert v-show="value" type="error" show-icon>{{ value }}</alert> <alert v-show="value" type="error" show-icon>{{ value }}</alert>
</div> </div>
</template> </template>
<script lang='ts'> <script lang='ts'>
import { PanelFieldModel } from "@/model/panel-detail";
import { Component, Vue, Prop } from "vue-property-decorator"; import { Component, Vue, Prop } from "vue-property-decorator";
@Component({}) @Component({})
...@@ -14,16 +13,16 @@ export default class AppLoginMessage extends Vue { ...@@ -14,16 +13,16 @@ export default class AppLoginMessage extends Vue {
/** /**
* 模型 * 模型
* *
* @type {string} * @type {any}
* @memberof AppLoginInput * @memberof AppLoginMessage
*/ */
@Prop() public model!: PanelFieldModel; @Prop() public layoutModelDetails: any;
/** /**
* 值 * 值
* *
* @type {string} * @type {string}
* @memberof AppLoginInput * @memberof AppLoginMessage
*/ */
@Prop() public value!: string; @Prop() public value!: string;
...@@ -31,22 +30,28 @@ export default class AppLoginMessage extends Vue { ...@@ -31,22 +30,28 @@ export default class AppLoginMessage extends Vue {
* 名称 * 名称
* *
* @type {string} * @type {string}
* @memberof AppLoginInput * @memberof AppLoginMessage
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/** /**
* 容器样式 * 当前容器样式
* *
* @type {any} * @memberof AppLoginMessage
* @memberof AppLoginInput
*/ */
public containerStyle: any = null; get curStyle(){
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.getElementStyle();
}
public mounted() { /**
if (this.model) { * 类名
this.containerStyle = this.model.getElementStyle(); *
} * @memberof AppLoginMessage
*/
get curClassName(){
const layoutModel = this.layoutModelDetails[this.name];
return `app-login-message ${this.name} ${layoutModel.sysCss}`;
} }
} }
......
<template> <template>
<div :class="[model.sysCss, 'app-login-note-verify']" :style="containerStyle"> <div :class="curClassName" :style="curStyle">
<div class="content"> <div class="content">
<i-input <i-input
size="default" size="default"
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
</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 } from "vue-property-decorator";
@Component({}) @Component({})
...@@ -34,16 +33,16 @@ export default class AppLoginNoteVerify extends Vue { ...@@ -34,16 +33,16 @@ export default class AppLoginNoteVerify extends Vue {
/** /**
* 模型 * 模型
* *
* @type {string} * @type {any}
* @memberof AppLoginInput * @memberof AppLoginNoteVerify
*/ */
@Prop() public model!: PanelFieldModel; @Prop() public layoutModelDetails: any;
/** /**
* 值 * 值
* *
* @type {string} * @type {string}
* @memberof AppLoginInput * @memberof AppLoginNoteVerify
*/ */
@Prop() public value!: string; @Prop() public value!: string;
...@@ -51,7 +50,7 @@ export default class AppLoginNoteVerify extends Vue { ...@@ -51,7 +50,7 @@ export default class AppLoginNoteVerify extends Vue {
* 名称 * 名称
* *
* @type {string} * @type {string}
* @memberof AppLoginInput * @memberof AppLoginNoteVerify
*/ */
@Prop() public name!: string; @Prop() public name!: string;
...@@ -113,17 +112,23 @@ export default class AppLoginNoteVerify extends Vue { ...@@ -113,17 +112,23 @@ export default class AppLoginNoteVerify extends Vue {
public timer: any = null; public timer: any = null;
/** /**
* 容器样式 * 当前容器样式
* *
* @type {any} * @memberof AppLoginNoteVerify
* @memberof AppLoginInput
*/ */
public containerStyle: any = null; get curStyle(){
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.getElementStyle();
}
public mounted() { /**
if (this.model) { * 类名
this.containerStyle = this.model.getElementStyle(); *
} * @memberof AppLoginNoteVerify
*/
get curClassName(){
const layoutModel = this.layoutModelDetails[this.name];
return `app-login-note-verify ${this.name} ${layoutModel.sysCss}`;
} }
/** /**
......
<template> <template>
<div :class="[model.sysCss, 'app-login-org']" :style="containerStyle"> <div :class="curClassName" :style="curStyle">
<Select v-model="curKey"> <Select v-model="curKey">
<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>
</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 } from 'vue-property-decorator';
@Component({}) @Component({})
...@@ -34,7 +33,7 @@ export default class AppLoginOrg extends Vue { ...@@ -34,7 +33,7 @@ export default class AppLoginOrg extends Vue {
* @type {*} * @type {*}
* @memberof AppLoginOrg * @memberof AppLoginOrg
*/ */
@Prop() public model!: PanelFieldModel; @Prop() public layoutModelDetails: any;
/** /**
* 当前值 * 当前值
...@@ -63,12 +62,24 @@ export default class AppLoginOrg extends Vue { ...@@ -63,12 +62,24 @@ export default class AppLoginOrg extends Vue {
public items: Array<any> = []; public items: Array<any> = [];
/** /**
* 容器样式 * 当前容器样式
*
* @memberof AppLoginOrg
*/
get curStyle(){
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.getElementStyle();
}
/**
* 类名
* *
* @type {any} * @memberof AppLoginOrg
* @memberof AppLoginInput
*/ */
public containerStyle: any = null; get curClassName(){
const layoutModel = this.layoutModelDetails[this.name];
return `app-login-org ${this.name} ${layoutModel.sysCss}`;
}
/** /**
* 组件初始化数据,vue生命周期 * 组件初始化数据,vue生命周期
...@@ -77,9 +88,6 @@ export default class AppLoginOrg extends Vue { ...@@ -77,9 +88,6 @@ export default class AppLoginOrg extends Vue {
*/ */
public created() { public created() {
this.getOrgData(); this.getOrgData();
if (this.model) {
this.containerStyle = this.model.getElementStyle();
}
} }
/** /**
......
<template> <template>
<div :class="[model.sysCss, 'app-login-third']" :style="containerStyle"> <div :class="curClassName" :style="curStyle">
<div class="app-login-third__title">{{ $t("components.login.other") }}</div> <div class="app-login-third__title">{{ $t("components.login.other") }}</div>
<div class="app-login-third__content"> <div class="app-login-third__content">
<div class="sign-btn" @click="handleThirdLogin('DINGDING')"> <div class="sign-btn" @click="handleThirdLogin('DINGDING')">
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { PanelUserControlModel } from "@/model/panel-detail";
import { Component, Prop, Vue } from "vue-property-decorator"; import { Component, Prop, Vue } from "vue-property-decorator";
@Component({}) @Component({})
export default class AppThirdLogin extends Vue { export default class AppThirdLogin extends Vue {
...@@ -21,16 +20,16 @@ export default class AppThirdLogin extends Vue { ...@@ -21,16 +20,16 @@ export default class AppThirdLogin extends Vue {
/** /**
* 模型 * 模型
* *
* @type {string} * @type {any}
* @memberof AppLoginInput * @memberof AppThirdLogin
*/ */
@Prop() public model!: PanelUserControlModel; @Prop() public layoutModelDetails: any;
/** /**
* 值 * 值
* *
* @type {string} * @type {string}
* @memberof AppLoginInput * @memberof AppThirdLogin
*/ */
@Prop() public value!: string; @Prop() public value!: string;
...@@ -38,22 +37,28 @@ export default class AppThirdLogin extends Vue { ...@@ -38,22 +37,28 @@ export default class AppThirdLogin extends Vue {
* 名称 * 名称
* *
* @type {string} * @type {string}
* @memberof AppLoginInput * @memberof AppThirdLogin
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/** /**
* 容器样式 * 当前容器样式
* *
* @type {any} * @memberof AppThirdLogin
* @memberof AppLoginInput
*/ */
public containerStyle: any = null; get curStyle(){
const layoutModel = this.layoutModelDetails[this.name];
return layoutModel.getElementStyle();
}
public mounted() { /**
if (this.model) { * 类名
this.containerStyle = this.model.getElementStyle(); *
} * @memberof AppThirdLogin
*/
get curClassName(){
const layoutModel = this.layoutModelDetails[this.name];
return `app-login-input ${this.name} ${layoutModel.sysCss}`;
} }
/** /**
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册