提交 f9b298fe 编写于 作者: laizhilong's avatar laizhilong

Merge remote-tracking branch 'origin/master'

.app-form-group { .app-form-group {
>.ivu-card-head { >.ivu-card-head {
>p { >p {
>i { >i {
...@@ -7,9 +8,12 @@ ...@@ -7,9 +8,12 @@
} }
} }
} }
>.ivu-card-extra { >.ivu-card-extra {
.item-extract-mode { .item-extract-mode {
display: flex; display: flex;
.item { .item {
margin-left: 12px; margin-left: 12px;
} }
...@@ -18,6 +22,7 @@ ...@@ -18,6 +22,7 @@
} }
.app-form-group.app-group-collapse-contant { .app-form-group.app-group-collapse-contant {
.ivu-card-body { .ivu-card-body {
display: none; display: none;
} }
...@@ -25,9 +30,12 @@ ...@@ -25,9 +30,12 @@
.app-group-flex { .app-group-flex {
height: 100%; height: 100%;
overflow: auto; overflow-y: auto;
> .ivu-card-body { overflow-x: hidden;
>.ivu-card-body {
height: calc(100% - 51px); height: calc(100% - 51px);
overflow: auto; overflow-y: auto;
overflow-x: hidden;
} }
} }
\ No newline at end of file
<template> <template>
<div class="app-form-group"> <div :class="classes">
<div v-if="uiStyle=='STYLE2'"> <template v-if="uiStyle=='STYLE2'">
<app-form-group2 <app-form-group2
:caption="caption" :caption="caption"
:uiStyle="uiStyle" :uiStyle="uiStyle"
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
:titleBarCloseMode="titleBarCloseMode"> :titleBarCloseMode="titleBarCloseMode">
<slot></slot> <slot></slot>
</app-form-group2> </app-form-group2>
</div> </template>
<div v-else> <template v-else>
<card v-if="isShowCaption === true" :bordered="false" :dis-hover="true" :class="classes"> <card v-if="isShowCaption === true" :bordered="false" :dis-hover="true" :class="classes">
<p class='' slot='title'> <p class='' slot='title'>
<icon v-if="titleBarCloseMode !== 0" :type="collapseContant ? 'ios-arrow-dropright-circle' : 'ios-arrow-dropdown-circle'" <icon v-if="titleBarCloseMode !== 0" :type="collapseContant ? 'ios-arrow-dropright-circle' : 'ios-arrow-dropdown-circle'"
...@@ -87,17 +87,17 @@ ...@@ -87,17 +87,17 @@
</template> </template>
</a > </a >
</template> </template>
<div v-if="Object.is(layoutType, 'FLEX')"> <template v-if="Object.is(layoutType, 'FLEX')">
<slot></slot> <slot></slot>
</div> </template>
<div v-if="!Object.is(layoutType, 'FLEX')"> <template v-if="!Object.is(layoutType, 'FLEX')">
<row :gutter="10"><slot></slot></row> <row :gutter="10"><slot></slot></row>
</div> </template>
</card> </card>
<row v-if="isShowCaption === false" :class="classes"> <template v-if="isShowCaption === false">
<slot></slot> <slot></slot>
</row> </template>
</div> </template>
</div> </div>
</template> </template>
......
.app-form-item { .app-form-item {
// margin-bottom: 16px; height: 100%;
>.ivu-form-item-label { .editor {
text-decoration: none; height: 100%;
display: block; .ivu-form-item-content {
overflow: hidden; height: 100%;
white-space: nowrap; min-height: 36px;
} }
>.ivu-form-item-content { }
min-height: 36px; .app-form-item-label {
} padding: 6px 12px 6px 0px;
}
} }
.app-form-item-label-top {
>.ivu-form-item-label { .app-form-item.label-top, .app-form-item.label-bottom {
float: none; .app-form-item-label {
display: inline-block; display: block;
padding: 0 0 10px; }
}
} }
.app-form-item-label-left{ .app-form-item.label-left, .app-form-item.label-right {
.app-form-item-label{ .app-form-item-label, .editor {
float: left; height: 100%;
text-align: right;
padding-right: 12px;
} }
} }
.app-form-item-label-right{
.app-form-item-label{ .app-form-item.label-left {
float: right; .app-form-item-label {
text-align: left; float: left;
padding-left: 12px;
} }
} }
.app-form-item-label-top{
.app-form-item-label{ .app-form-item.label-right {
display: block; .app-form-item-label {
padding-bottom: 10px; float: right;
padding-left: 12px;
} }
} }
.app-form-item-label-bottom{
.app-form-item-label{ .app-form-item.label-none {
display: block; .app-form-item-label {
padding-top: 10px; display: none !important;
} }
} }
\ No newline at end of file
<template> <template>
<div> <div :class="classes">
<div v-if="this.uiStyle === 'STYLE2'"> <template v-if="this.uiStyle === 'STYLE2'">
<app-form-item2 <app-form-item2
:caption="caption" :caption="caption"
:labelStyle="labelStyle" :labelStyle="labelStyle"
:error="error" :error="error"
...@@ -14,248 +14,261 @@ ...@@ -14,248 +14,261 @@
:itemRules="itemRules"> :itemRules="itemRules">
<slot></slot> <slot></slot>
</app-form-item2> </app-form-item2>
</div> </template>
<div v-if="this.uiStyle !== 'STYLE2'"> <template v-if="this.uiStyle !== 'STYLE2'">
<form-item <div
:prop="name" v-if="Object.is(this.labelPos,'BOTTOM') || Object.is(this.labelPos,'NONE') || !this.labelPos"
:error="error" class="editor"
:required="required" :style="slotstyle"
:rules="rules" >
:class="classes"> <form-item :prop="name" :error="error" :required="required" :rules="rules">
<div v-if="Object.is(this.labelPos,'BOTTOM') || Object.is(this.labelPos,'NONE') || !this.labelPos" class="slot-editor" :style="slotstyle">
<slot></slot> <slot></slot>
</div> </form-item>
<span v-if="!Object.is(this.labelPos,'NONE') && this.isShowCaption && this.labelWidth > 0" :style="labelstyle" :class="labelclasses"> </div>
{{this.isEmptyCaption ? '' : this.caption}} <span
</span> v-if="!Object.is(this.labelPos,'NONE') && this.isShowCaption && this.labelWidth > 0"
<div v-if="Object.is(this.labelPos,'TOP') || Object.is(this.labelPos,'LEFT') || Object.is(this.labelPos,'RIGHT')" class="slot-editor" :style="slotstyle"> :style="labelstyle"
:class="labelclasses"
>
<span v-if="required" style="color:red;">* </span>
{{this.isEmptyCaption ? '' : this.caption}}
</span>
<div
v-if="Object.is(this.labelPos,'TOP') || Object.is(this.labelPos,'LEFT') || Object.is(this.labelPos,'RIGHT')"
class="editor"
:style="slotstyle"
>
<form-item :prop="name" :error="error" :required="required" :rules="rules">
<slot></slot> <slot></slot>
</div> </form-item>
</form-item> </div>
</div> </template>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Vue, Component, Prop, Watch } from 'vue-property-decorator'; import { Vue, Component, Prop, Watch } from "vue-property-decorator";
@Component({}) @Component({})
export default class AppFormItem extends Vue { export default class AppFormItem extends Vue {
/**
* 名称
*
* @type {string}
* @memberof AppFormItem
*/
@Prop() public caption!: string;
/** /**
* 名称 * 错误信息
* *
* @type {string} * @type {string}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop() public caption!: string; @Prop() public error?: string;
/**
* 错误信息
*
* @type {string}
* @memberof AppFormItem
*/
@Prop() public error?: string;
/** /**
* label样式 * label样式
* *
* @type {string} * @type {string}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop() public labelStyle?: string; @Prop() public labelStyle?: string;
/** /**
* 标签位置 * 标签位置
* *
* @type {(string | 'BOTTOM' | 'LEFT' | 'NONE' | 'RIGHT' | 'TOP')} * @type {(string | 'BOTTOM' | 'LEFT' | 'NONE' | 'RIGHT' | 'TOP')}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop() public labelPos?: string | 'BOTTOM' | 'LEFT' | 'NONE' | 'RIGHT' | 'TOP'; @Prop() public labelPos?:
| string
| "BOTTOM"
| "LEFT"
| "NONE"
| "RIGHT"
| "TOP";
/** /**
* 标签宽度 * 标签宽度
* *
* @type {number} * @type {number}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop({}) public labelWidth!: number; @Prop({}) public labelWidth!: number;
/** /**
* 是否显示标题 * 是否显示标题
* *
* @type {boolean} * @type {boolean}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop() public isShowCaption?: boolean; @Prop() public isShowCaption?: boolean;
/** /**
* 标签是否空白 * 标签是否空白
* *
* @type {boolean} * @type {boolean}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop() public isEmptyCaption?: boolean; @Prop() public isEmptyCaption?: boolean;
/** /**
* 表单项名称 * 表单项名称
* *
* @type {string} * @type {string}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop() public name!: string; @Prop() public name!: string;
/** /**
* 内置样式 * 内置样式
* *
* @type {string} * @type {string}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop() public uiStyle?: string; @Prop() public uiStyle?: string;
/** /**
* 表单项值规则 * 表单项值规则
* *
* @type {string} * @type {string}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Prop() public itemRules!: any; @Prop() public itemRules!: any;
/** /**
* 值规则数组 * 值规则数组
* *
* @type {any[]} * @type {any[]}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
public rules: any[] = []; public rules: any[] = [];
/** /**
* 是否必填 * 是否必填
* *
* @type {boolean} * @type {boolean}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
public required: boolean = false; public required: boolean = false;
/** /**
* 表单项值规则监控 * 表单项值规则监控
* *
* @param {*} newVal * @param {*} newVal
* @param {*} oldVal * @param {*} oldVal
* @memberof AppFormItem * @memberof AppFormItem
*/ */
@Watch('itemRules',{deep:true}) @Watch("itemRules", { deep: true })
onItemRulesChange(newVal: any, oldVal: any) { onItemRulesChange(newVal: any, oldVal: any) {
if (newVal) { if (newVal) {
try { try {
this.rules = []; this.rules = [];
const _rules: any[] = newVal; const _rules: any[] = newVal;
this.rules = [..._rules]; this.rules = [..._rules];
this.rules.some((rule: any) => { this.rules.some((rule: any) => {
if (rule.hasOwnProperty('required')) { if (rule.hasOwnProperty("required")) {
this.required = rule.required; this.required = rule.required;
return true; return true;
} }
return false; return false;
}); });
} catch (error) { } catch (error) {}
}
}
} }
}
/** /**
* 计算样式 * 计算样式
* *
* @readonly * @readonly
* @type {string []} * @type {string []}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
get classes(): string[] { get classes(): string[] {
let posClass = ''; let posClass = "";
switch (this.labelPos) { switch (this.labelPos) {
case 'TOP': case "TOP":
posClass = 'app-form-item-label-top'; posClass = "label-top";
break; break;
case 'LEFT': case "LEFT":
posClass = 'app-form-item-label-left'; posClass = "label-left";
break; break;
case 'BOTTOM': case "BOTTOM":
posClass = 'app-form-item-label-bottom'; posClass = "label-bottom";
break; break;
case 'RIGHT': case "RIGHT":
posClass = 'app-form-item-label-right'; posClass = "label-right";
break; break;
case 'NONE': case "NONE":
posClass = 'app-form-item-label-none'; posClass = "label-none";
break; break;
}
return [
'app-form-item',
posClass
];
} }
return [ "app-form-item", posClass ];
}
/** /**
* label样式 * label样式
* *
* @readonly * @readonly
* @type {string} * @type {string}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
get labelclasses():string{ get labelclasses(): string {
return this.labelStyle?this.labelStyle+' app-form-item-label':'app-form-item-label'; return this.labelStyle
} ? this.labelStyle + " app-form-item-label"
: "app-form-item-label";
}
/** /**
* label行内样式 * label行内样式
* *
* @readonly * @readonly
* @type {string} * @type {string}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
get labelstyle():any{ get labelstyle(): any {
return {width:this.labelWidth+'px'}; if (Object.is(this.labelPos, 'LEFT') || Object.is(this.labelPos, 'RIGHT')) {
return { width: this.labelWidth + "px" };
} }
}
/** /**
* slot行内样式 * slot行内样式
* *
* @readonly * @readonly
* @type {string} * @type {string}
* @memberof AppFormItem * @memberof AppFormItem
*/ */
get slotstyle():any{ get slotstyle(): any {
if(Object.is(this.labelPos,'LEFT')){ if (Object.is(this.labelPos, "LEFT")) {
return {marginLeft:this.labelWidth+'px'}; return { marginLeft: this.labelWidth + "px" };
}else if(Object.is(this.labelPos,'RIGHT')){ } else if (Object.is(this.labelPos, "RIGHT")) {
return {marginRight:this.labelWidth+'px'}; return { marginRight: this.labelWidth + "px" };
}
} }
}
/** /**
* vue 生命周期 * vue 生命周期
* *
* @memberof AppFormItem * @memberof AppFormItem
*/ */
public mounted() { public mounted() {
if (this.itemRules) { if (this.itemRules) {
try { try {
const _rules: any[] = this.itemRules; const _rules: any[] = this.itemRules;
this.rules = [..._rules]; this.rules = [..._rules];
this.rules.some((rule: any) => { this.rules.some((rule: any) => {
if (rule.hasOwnProperty('required')) { if (rule.hasOwnProperty("required")) {
this.required = rule.required; this.required = rule.required;
return true; return true;
} }
return false; return false;
}); });
} catch (error) { } catch (error) {}
}
}
} }
}
} }
</script> </script>
<style lang='less'> <style lang='less'>
@import './app-form-item.less'; @import "./app-form-item.less";
</style> </style>
\ No newline at end of file
...@@ -132,13 +132,16 @@ export class Interceptors { ...@@ -132,13 +132,16 @@ export class Interceptors {
* @memberof Interceptors * @memberof Interceptors
*/ */
private doNoLogin(data: any = {}): void { private doNoLogin(data: any = {}): void {
// 清除user和token // 清除user、token和cookie
if(localStorage.getItem('user')){ if(localStorage.getItem('user')){
localStorage.removeItem('user'); localStorage.removeItem('user');
} }
if(localStorage.getItem('token')){ if(localStorage.getItem('token')){
localStorage.removeItem('token'); localStorage.removeItem('token');
} }
let leftTime = new Date();
leftTime.setTime(leftTime.getSeconds() - 1);
document.cookie = "ibzuaa-token=;expires=" + leftTime.toUTCString();
if (data.loginurl && !Object.is(data.loginurl, '') && data.originurl && !Object.is(data.originurl, '')) { if (data.loginurl && !Object.is(data.loginurl, '') && data.originurl && !Object.is(data.originurl, '')) {
let _url = encodeURIComponent(encodeURIComponent(window.location.href)); let _url = encodeURIComponent(encodeURIComponent(window.location.href));
let loginurl: string = data.loginurl; let loginurl: string = data.loginurl;
......
...@@ -267,7 +267,6 @@ export default class MainService extends ControlService { ...@@ -267,7 +267,6 @@ export default class MainService extends ControlService {
response.data.id = Util.createUUID(); response.data.id = Util.createUUID();
} }
this.handleResponse(action, response, true); this.handleResponse(action, response, true);
this.mergeDefaults(response);
resolve(response); resolve(response);
}).catch(response => { }).catch(response => {
reject(response); reject(response);
...@@ -275,16 +274,6 @@ export default class MainService extends ControlService { ...@@ -275,16 +274,6 @@ export default class MainService extends ControlService {
}); });
} }
/**
* 合并配置的默认值
* @param {*}
* @memberof MainService
*/
public mergeDefaults(response:any = {}){
if(response.data){
}
}
/** /**
* 前台逻辑 * 前台逻辑
......
...@@ -267,7 +267,6 @@ export default class MainService extends ControlService { ...@@ -267,7 +267,6 @@ export default class MainService extends ControlService {
response.data.logid = Util.createUUID(); response.data.logid = Util.createUUID();
} }
this.handleResponse(action, response, true); this.handleResponse(action, response, true);
this.mergeDefaults(response);
resolve(response); resolve(response);
}).catch(response => { }).catch(response => {
reject(response); reject(response);
...@@ -275,16 +274,6 @@ export default class MainService extends ControlService { ...@@ -275,16 +274,6 @@ export default class MainService extends ControlService {
}); });
} }
/**
* 合并配置的默认值
* @param {*}
* @memberof MainService
*/
public mergeDefaults(response:any = {}){
if(response.data){
}
}
/** /**
* 前台逻辑 * 前台逻辑
......
...@@ -267,7 +267,6 @@ export default class MainService extends ControlService { ...@@ -267,7 +267,6 @@ export default class MainService extends ControlService {
response.data.permissionid = Util.createUUID(); response.data.permissionid = Util.createUUID();
} }
this.handleResponse(action, response, true); this.handleResponse(action, response, true);
this.mergeDefaults(response);
resolve(response); resolve(response);
}).catch(response => { }).catch(response => {
reject(response); reject(response);
...@@ -275,16 +274,6 @@ export default class MainService extends ControlService { ...@@ -275,16 +274,6 @@ export default class MainService extends ControlService {
}); });
} }
/**
* 合并配置的默认值
* @param {*}
* @memberof MainService
*/
public mergeDefaults(response:any = {}){
if(response.data){
}
}
/** /**
* 前台逻辑 * 前台逻辑
......
...@@ -267,7 +267,6 @@ export default class MainService extends ControlService { ...@@ -267,7 +267,6 @@ export default class MainService extends ControlService {
response.data.rolepermissionid = Util.createUUID(); response.data.rolepermissionid = Util.createUUID();
} }
this.handleResponse(action, response, true); this.handleResponse(action, response, true);
this.mergeDefaults(response);
resolve(response); resolve(response);
}).catch(response => { }).catch(response => {
reject(response); reject(response);
...@@ -275,16 +274,6 @@ export default class MainService extends ControlService { ...@@ -275,16 +274,6 @@ export default class MainService extends ControlService {
}); });
} }
/**
* 合并配置的默认值
* @param {*}
* @memberof MainService
*/
public mergeDefaults(response:any = {}){
if(response.data){
}
}
/** /**
* 前台逻辑 * 前台逻辑
......
...@@ -267,7 +267,6 @@ export default class MainService extends ControlService { ...@@ -267,7 +267,6 @@ export default class MainService extends ControlService {
response.data.roleid = Util.createUUID(); response.data.roleid = Util.createUUID();
} }
this.handleResponse(action, response, true); this.handleResponse(action, response, true);
this.mergeDefaults(response);
resolve(response); resolve(response);
}).catch(response => { }).catch(response => {
reject(response); reject(response);
...@@ -275,16 +274,6 @@ export default class MainService extends ControlService { ...@@ -275,16 +274,6 @@ export default class MainService extends ControlService {
}); });
} }
/**
* 合并配置的默认值
* @param {*}
* @memberof MainService
*/
public mergeDefaults(response:any = {}){
if(response.data){
}
}
/** /**
* 前台逻辑 * 前台逻辑
......
...@@ -267,7 +267,6 @@ export default class MainService extends ControlService { ...@@ -267,7 +267,6 @@ export default class MainService extends ControlService {
response.data.userroleid = Util.createUUID(); response.data.userroleid = Util.createUUID();
} }
this.handleResponse(action, response, true); this.handleResponse(action, response, true);
this.mergeDefaults(response);
resolve(response); resolve(response);
}).catch(response => { }).catch(response => {
reject(response); reject(response);
...@@ -275,16 +274,6 @@ export default class MainService extends ControlService { ...@@ -275,16 +274,6 @@ export default class MainService extends ControlService {
}); });
} }
/**
* 合并配置的默认值
* @param {*}
* @memberof MainService
*/
public mergeDefaults(response:any = {}){
if(response.data){
}
}
/** /**
* 前台逻辑 * 前台逻辑
......
...@@ -267,7 +267,6 @@ export default class MainService extends ControlService { ...@@ -267,7 +267,6 @@ export default class MainService extends ControlService {
response.data.userid = Util.createUUID(); response.data.userid = Util.createUUID();
} }
this.handleResponse(action, response, true); this.handleResponse(action, response, true);
this.mergeDefaults(response);
resolve(response); resolve(response);
}).catch(response => { }).catch(response => {
reject(response); reject(response);
...@@ -275,16 +274,6 @@ export default class MainService extends ControlService { ...@@ -275,16 +274,6 @@ export default class MainService extends ControlService {
}); });
} }
/**
* 合并配置的默认值
* @param {*}
* @memberof MainService
*/
public mergeDefaults(response:any = {}){
if(response.data){
}
}
/** /**
* 前台逻辑 * 前台逻辑
......
MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBAKaTz4pgOR/p0RjlczM0dErf4ZUNziE/HJcfKDLPu77Gs2EJdDK0uGfPI3GX/eRwX9L9bTZJtz9sX2fkRqRt3gWnsMypT2P/cO/2GgtRCPHRFD7BI+Df32isEJZ6M4kD9tyKLw8Y9KuP0C20ZMMDeCrrbjMagMMrwTOM4/4eFjzVAgMBAAECgYEAnH3mj2hgolOmhg4hkOxpiGIV6lMi4OcKtAqoWDwCdHL12GbqTCytxZC7Cp+w/Wh5DZ3aeRL93c6xPsgdeaJh3kYa4ooo6b5tFHPU63VU5MBgwGzi26/6GB4GCXxGMB+SxmdigDmmPIYbXD+jO2oj1s8hj+DOE4U2fIjeZ//DumECQQDlA74KHNZlKxoWl0FoHCgcIHFBZcQWKO3puhrH7VsRYI7CVVguE57NBT6QvAmU9r32PDt64tS0Qd1sCrk4uEqtAkEAujSj/cwF4ctQZCbUoMMzK/mw8ZxW3M6VK3urbq8fyFJ2iT2aLV3jE3+tnDdpezcfnbs/9SVXeFmJpdg/L7hnyQJAQyxo1qCExmHxIgU1uyrfHPjrH2qRLIrO1gqvhkr5tkwjM59C4SkCIFLUejGdgeMp7wrVy4KzLzhOkT1H/PoZdQJAEbKxJ409veFKKcq7CPCkq3hXBg/a/a+w4+okOCfy+GJGG/M79TXoQFExWhi2MNzjZ2WFxbIf5zNzbszn7Iw1aQJBAIXpKrQ0sLxr0rFzsoHBrobPcnQeutzypQNTPkoItILVP9pWz+aUfIKnOHEC5GAdD2LPZZ/pF7ixdRd9nBab+pk=
\ No newline at end of file
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCmk8+KYDkf6dEY5XMzNHRK3+GVDc4hPxyXHygyz7u+xrNhCXQytLhnzyNxl/3kcF/S/W02Sbc/bF9n5Eakbd4Fp7DMqU9j/3Dv9hoLUQjx0RQ+wSPg399orBCWejOJA/bcii8PGPSrj9AttGTDA3gq624zGoDDK8EzjOP+HhY81QIDAQAB
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册