提交 936dabb8 编写于 作者: ibizdev's avatar ibizdev

tony001 发布系统代码 [后台服务,演示应用]

上级 c5994b13
<template> <template>
<div class="app-preset-auth"> <div :class="[model.sysCss, 'app-login-captcha']" :style="containerStyle">
<auth-puzzle-vcode :show="show" @success="onSuccess" @fail="onFail" /> <auth-puzzle-vcode :show="show" @success="onSuccess" @fail="onFail" />
<i-button ghost @click="executeOpen" long class="app-preset-auth-button" <i-button :type="type" @click="executeOpen">验证</i-button>
>验证</i-button
>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Vue, Component, Prop, Model } from "vue-property-decorator"; import { PanelUserControlModel } from "@/model/panel-detail";
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({
components: { components: {
"auth-puzzle-vcode": AuthPuzzleVcode, "auth-puzzle-vcode": AuthPuzzleVcode,
}, },
}) })
export default class AppPreSetAuth extends Vue { export default class AppLoginCaptcha extends Vue {
/**
* 模型
*
* @type {string}
* @memberof AppLoginCaptcha
*/
@Prop() public model!: PanelUserControlModel;
/**
* 值
*
* @type {string}
* @memberof AppLoginCaptcha
*/
@Prop() public value!: string;
/**
* 名称
*
* @type {string}
* @memberof AppLoginCaptcha
*/
@Prop() public name!: string;
/**
* 容器样式
*
* @type {any}
* @memberof AppLoginCaptcha
*/
public containerStyle: any = null;
/** /**
* 是否显示 * 是否显示
*/ */
public show: boolean = false; public show: boolean = false;
/**
* 按钮类型
*/
public type: string = 'default';
public mounted() {
if (this.model) {
this.containerStyle = this.model.getElementStyle();
}
if (this.value) {
this.type = 'success';
}
}
/** /**
* 打开 * 打开
*/ */
...@@ -34,25 +78,27 @@ export default class AppPreSetAuth extends Vue { ...@@ -34,25 +78,27 @@ export default class AppPreSetAuth extends Vue {
*/ */
public onSuccess() { public onSuccess() {
this.show = false; this.show = false;
this.$emit("success"); this.type = 'success';
this.$emit("valueChange", { name: this.name, value: true});
} }
/** /**
* 失败 * 失败
*/ */
public onFail() { public onFail() {
this.$emit("fail"); this.$emit("valueChange", { name: this.name, value: false});
} }
} }
</script> </script>
<style lang='less'> <style lang="less">
.app-preset-auth { .app-login-captcha {
.app-preset-auth-button { height: 40px;
border: 1px solid #dcdee2; width: 100%;
border-radius: 4px; .ivu-btn {
color: #515a6e; width: 100%;
&:hover{ height: 100%;
&:hover {
border: 1px solid #dcdee2; border: 1px solid #dcdee2;
color: #515a6e; color: #515a6e;
} }
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<app-login-button class="app-logout-button" name="auth_logout1" :model="layoutModelDetails.auth_logout1" @itemClick="handleButtonClick" /> <app-login-button class="app-logout-button" name="auth_logout1" :model="layoutModelDetails.auth_logout1" @itemClick="handleButtonClick" />
</template> </template>
<template #auth_captcha1> <template #auth_captcha1>
<app-login-captcha /> <app-login-captcha name="auth_captcha1" :model="layoutModelDetails.auth_captcha1" :value="layoutData.auth_captcha1" @valueChange="handleValueChange" />
</template> </template>
<template #auth_verificationcode> <template #auth_verificationcode>
<app-login-note-verify /> <app-login-note-verify />
......
...@@ -2247,4 +2247,5 @@ export default class SFormBase extends Vue implements ControlInterface { ...@@ -2247,4 +2247,5 @@ export default class SFormBase extends Vue implements ControlInterface {
<style lang='less'> <style lang='less'>
@import './sform-form.less'; @import './sform-form.less';
</style>form-form.less';
</style> </style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册