提交 44297bc5 编写于 作者: ibizdev's avatar ibizdev

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

上级 00ac51fe
.app-user-button {
width: 100%;
.app-login-button {
.ivu-btn {
width: 100%;
height: 100%;
}
}
\ No newline at end of file
<template>
<div class="app-user-button">
<i-button @click="handleSubmit" :type="type">{{ caption }} </i-button>
<div :class="[model.sysCss, 'app-login-button']" :style="containerStyle">
<i-button @click="handleClick" :type="curStyle">
<span v-show="model.isShowCaption">{{ model.caption }}</span>
</i-button>
</div>
</template>
<script lang="ts">
import { Vue, Component, Watch, Prop, Model } from "vue-property-decorator";
import { PanelButtonModel } from "@/model/panel-detail";
import { Vue, Component, Prop } from "vue-property-decorator";
@Component({})
export default class AppUserId extends Vue {
@Prop() public predefinedType!: string;
export default class AppLoginButton extends Vue {
/**
* 模型
*
* @type {PanelButtonModel}
* @memberof AppLoginButton
*/
@Prop() public model!: PanelButtonModel;
@Prop() public type?: string;
/**
* 类型
*
* @type {string}
* @memberof AppLoginButton
*/
@Prop() public defaultStyle?: string;
@Prop() public caption!: string;
/**
* 当前按钮类型
*
* @type {string}
* @memberof AppLoginButton
*/
get curStyle(): string {
if (this.model.buttonStyle != "DEFAULT" && this.defaultStyle) {
return this.defaultStyle;
} else {
return this.model.buttonStyle.toLowerCase();
}
}
/**
* 按钮样式
*
* @type {string}
* @memberof AppLoginButton
*/
public containerStyle: any = null;
/**
* 处理点击
*
* @type {string}
* @memberof AppLoginButton
*/
public handleClick() {
switch (this.model.predefinedType) {
case "APP_LOGOUT":
this.logout();
break;
case "APP_REGISTER":
this.register();
break;
default:
this.$emit("itemClick", this.model.predefinedType);
}
}
public mounted() {
if (this.model) {
this.containerStyle = this.model.getElementStyle();
}
}
/**
* 登出
*
* @type {string}
* @memberof AppLoginButton
*/
public logout() {
this.$http
.get("/v7/logout")
.then((response: any) => {
if (response && response.status === 200) {
localStorage.removeItem("user");
localStorage.removeItem("token");
let leftTime = new Date();
leftTime.setTime(leftTime.getSeconds() - 1);
document.cookie = "ibzuaa-token=;expires=" + leftTime.toUTCString();
this.$router.push({ name: "login" });
}
})
.catch((error: any) => {
console.error(error);
});
}
public handleSubmit() {
this.$emit('itemClick', this.predefinedType);
/**
* 注册
*
* @type {string}
* @memberof AppLoginButton
*/
public register() {
// todo
}
}
</script>
<style lang="less">
@import './app-login-button.less';
@import "./app-login-button.less";
</style>
......@@ -12,6 +12,7 @@ export class PanelButtonModel extends PanelDetailModel {
constructor(opts: any = {}) {
super(opts);
this.uiaction = opts.uiaction;
this.buttonStyle = opts.buttonStyle;
}
/**
......@@ -23,6 +24,11 @@ export class PanelButtonModel extends PanelDetailModel {
public uiaction:any;
/**
* @description 按钮类型
* @type {string}
* @memberof PanelButtonModel
*/
public buttonStyle: string;
}
\ No newline at end of file
......@@ -68,7 +68,7 @@
<app-index-user-info name="auth_userinfo1" :layoutModelDetails="layoutModelDetails"></app-index-user-info>
</template>
<template #auth_logout1>
<app-login-button class="app-logout-button" :model="layoutModelDetails.auth_logout1" :caption="$t('components.login.logout')" @itemClick="handleItemClick" />
<app-login-button class="app-logout-button" :model="layoutModelDetails.auth_logout1" @itemClick="handleItemClick" />
</template>
</app-simpleflex-container>
</template>
......
......@@ -14,16 +14,16 @@
<app-login-org />
</template>
<template #auth_loginbutton1>
<app-login-button class="app-login-button" :model="layoutModelDetails.auth_loginbutton1" type='primary' :caption="$t('components.login.name')" @itemClick="handleItemClick" />
<app-login-button class="app-login-button" :model="layoutModelDetails.auth_loginbutton1" defaultStyle='primary' @itemClick="handleItemClick" />
</template>
<template #auth_registbutton1>
<span>按钮</span>
</template>
<template #auth_resetinput1>
<app-login-button class="app-reset-button" :model="layoutModelDetails.auth_resetinput1" type='success' :caption="$t('components.login.reset')" @itemClick="handleItemClick" />
<app-login-button class="app-reset-button" :model="layoutModelDetails.auth_resetinput1" defaultStyle='success' @itemClick="handleItemClick" />
</template>
<template #auth_logout1>
<app-login-button class="app-logout-button" :model="layoutModelDetails.auth_logout1" :caption="$t('components.login.logout')" @itemClick="handleItemClick" />
<app-login-button class="app-logout-button" :model="layoutModelDetails.auth_logout1" @itemClick="handleItemClick" />
</template>
<template #auth_captcha1>
<app-login-captcha />
......
......@@ -663,7 +663,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public load(opt: any = {}): void {
if(!this.loadAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr9GridView' + (this.$t('app.searchForm.notConfig.loadAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr5DataView' + (this.$t('app.searchForm.notConfig.loadAction') as string) });
return;
}
const arg: any = { ...opt };
......@@ -699,7 +699,7 @@ export default class DefaultBase extends Vue implements ControlInterface {
*/
public loadDraft(opt: any = {},mode?:string): void {
if(!this.loaddraftAction){
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr9GridView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
this.$Notice.error({ title: (this.$t('app.commonWords.wrong') as string), desc: 'IBIZBOOKUsr5DataView' + (this.$t('app.searchForm.notConfig.loaddraftAction') as string) });
return;
}
const arg: any = { ...opt } ;
......
......@@ -10,7 +10,7 @@ export default class Usr2Model {
* 获取数据项集合
*
* @returns {any[]}
* @memberof Usr2Dataviewexpbar_dataviewMode
* @memberof Usr2DataViewMode
*/
public getDataItems(): any[] {
return [
......@@ -39,6 +39,17 @@ export default class Usr2Model {
dataType: 'FONTKEY',
},
{
name: 'n_ibizbookname_like',
prop: 'n_ibizbookname_like',
dataType: 'QUERYPARAM'
},
{
name: 'n_price_gtandeq',
prop: 'n_price_gtandeq',
dataType: 'QUERYPARAM'
},
{
name:'size',
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册