提交 b8e44c70 编写于 作者: Shine-zwj's avatar Shine-zwj

面板成员update

上级 2e1f3dda
.app-panel-item { .app-panel-field {
height: 100%; height: 100%;
width: 100%; width: 100%;
display: flex; display: flex;
padding: 0 6px; padding: 0 6px;
.editor{ .editor{
flex-grow: 1; flex-grow: 1;
height: 34px !important; .editorstyle{
.ivu-input.ivu-input-default{
border-color: red;
}
}
.errorstyle{
color:red !important;
}
} }
.app-panel-item-label { .app-panel-field-label {
height: 34px !important; height: 34px !important;
line-height: 25px; line-height: 25px;
flex-shrink: 0; flex-shrink: 0;
...@@ -15,34 +22,29 @@ ...@@ -15,34 +22,29 @@
} }
} }
.app-panel-item.label-top { .app-panel-field.label-top {
flex-flow: column; flex-flow: column;
} }
.app-panel-item.label-bottom{ .app-panel-field.label-bottom{
flex-flow: column-reverse; flex-flow: column-reverse;
} }
.app-panel-item.label-left { .app-panel-field.label-left {
.app-panel-item-label { .app-panel-field-label {
text-align: right; text-align: right;
} }
} }
.app-panel-item.label-right { .app-panel-field.label-right {
flex-flow: row-reverse; flex-flow: row-reverse;
.app-panel-item-label { .app-panel-field-label {
padding: 6px 0px 6px 10px; padding: 6px 0px 6px 10px;
} }
} }
.app-panel-item.label-none { .app-panel-field.label-none {
.app-panel-item-label { .app-panel-field-label {
display: none !important; display: none !important;
} }
} }
.editorStyle{
.ivu-input.ivu-input-default{
border-color: red;
}
}
\ No newline at end of file
<template> <template>
<div :class="classes"> <div :class="classes">
<div v-if="Object.is(labelPos,'NONE') || !labelPos" class="editor"> <div v-if="Object.is(labelPos,'NONE') || !labelPos" class="editor">
<div :class="valueCheck == true ?'':'editorStyle'"> <div :class="valueCheck == true ?'':'editorstyle'">
<slot ></slot> <slot ></slot>
<span :class="error ? 'errorstyle':''">{{error}}</span>
</div> </div>
</div> </div>
<div v-if="!Object.is(labelPos,'NONE')" class="app-panel-item-label"> <div v-if="!Object.is(labelPos,'NONE')" class="app-panel-field-label">
<span v-if="required" style="color:red;">* </span> <span v-if="required" style="color:red;">* </span>
{{isEmptyCaption ? '' : caption}} {{isEmptyCaption ? '' : caption}}
</div> </div>
<div v-if="Object.is(labelPos,'BOTTOM') || Object.is(labelPos,'TOP') || Object.is(labelPos,'LEFT') || Object.is(labelPos,'RIGHT')" class="editor"> <div v-if="Object.is(labelPos,'BOTTOM') || Object.is(labelPos,'TOP') || Object.is(labelPos,'LEFT') || Object.is(labelPos,'RIGHT')" class="editor">
<div :class="valueCheck == true ?'':'editorStyle'"> <div :class="valueCheck == true ?'':'editorstyle'">
<slot ></slot> <slot ></slot>
<span :class="error ? 'errorstyle':''">{{error}}</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -20,12 +22,12 @@ ...@@ -20,12 +22,12 @@
import { Vue, Component, Prop, Watch } from "vue-property-decorator"; import { Vue, Component, Prop, Watch } from "vue-property-decorator";
@Component({}) @Component({})
export default class AppPanelItem extends Vue { export default class AppPanelField extends Vue {
/** /**
* 名称 * 名称
* *
* @type {string} * @type {string}
* @memberof AppPanelItem * @memberof AppPanelField
*/ */
@Prop() public caption!: string; @Prop() public caption!: string;
...@@ -33,7 +35,7 @@ export default class AppPanelItem extends Vue { ...@@ -33,7 +35,7 @@ export default class AppPanelItem extends Vue {
* 错误信息 * 错误信息
* *
* @type {string} * @type {string}
* @memberof AppPanelItem * @memberof AppPanelField
*/ */
@Prop() public error?: string; @Prop() public error?: string;
...@@ -41,7 +43,7 @@ export default class AppPanelItem extends Vue { ...@@ -41,7 +43,7 @@ export default class AppPanelItem extends Vue {
* 标签位置 * 标签位置
* *
* @type {(string | 'BOTTOM' | 'LEFT' | 'NONE' | 'RIGHT' | 'TOP')} * @type {(string | 'BOTTOM' | 'LEFT' | 'NONE' | 'RIGHT' | 'TOP')}
* @memberof AppPanelItem * @memberof AppPanelField
*/ */
@Prop() public labelPos?: @Prop() public labelPos?:
| string | string
...@@ -55,7 +57,7 @@ export default class AppPanelItem extends Vue { ...@@ -55,7 +57,7 @@ export default class AppPanelItem extends Vue {
* 标签是否空白 * 标签是否空白
* *
* @type {boolean} * @type {boolean}
* @memberof AppPanelItem * @memberof AppPanelField
*/ */
@Prop() public isEmptyCaption?: boolean; @Prop() public isEmptyCaption?: boolean;
...@@ -63,7 +65,7 @@ export default class AppPanelItem extends Vue { ...@@ -63,7 +65,7 @@ export default class AppPanelItem extends Vue {
* 列表项名称 * 列表项名称
* *
* @type {string} * @type {string}
* @memberof AppPanelItem * @memberof AppPanelField
*/ */
@Prop() public name!: string; @Prop() public name!: string;
...@@ -71,7 +73,7 @@ export default class AppPanelItem extends Vue { ...@@ -71,7 +73,7 @@ export default class AppPanelItem extends Vue {
* 面板数据 * 面板数据
* *
* @type {any} * @type {any}
* @memberof AppPanelItem * @memberof AppPanelField
*/ */
@Prop() public data!: any; @Prop() public data!: any;
...@@ -79,7 +81,7 @@ export default class AppPanelItem extends Vue { ...@@ -79,7 +81,7 @@ export default class AppPanelItem extends Vue {
* 编辑器值 * 编辑器值
* *
* @type {any} * @type {any}
* @memberof AppPanelItem * @memberof AppPanelField
*/ */
@Prop() public value !: any; @Prop() public value !: any;
...@@ -87,7 +89,7 @@ export default class AppPanelItem extends Vue { ...@@ -87,7 +89,7 @@ export default class AppPanelItem extends Vue {
* 值规则 * 值规则
* *
* @type {string} * @type {string}
* @memberof AppPanelItem * @memberof AppPanelField
*/ */
@Prop() public itemRules!: any; @Prop() public itemRules!: any;
...@@ -95,7 +97,7 @@ export default class AppPanelItem extends Vue { ...@@ -95,7 +97,7 @@ export default class AppPanelItem extends Vue {
* 是否必填 * 是否必填
* *
* @type {boolean} * @type {boolean}
* @memberof AppPanelItem * @memberof AppPanelField
*/ */
public required: boolean = false; public required: boolean = false;
...@@ -103,7 +105,7 @@ export default class AppPanelItem extends Vue { ...@@ -103,7 +105,7 @@ export default class AppPanelItem extends Vue {
* 值规则数组 * 值规则数组
* *
* @type {any[]} * @type {any[]}
* @memberof AppPanelItem * @memberof AppPanelField
*/ */
public rules: any[] = []; public rules: any[] = [];
...@@ -112,7 +114,7 @@ export default class AppPanelItem extends Vue { ...@@ -112,7 +114,7 @@ export default class AppPanelItem extends Vue {
* *
* @param {*} newVal * @param {*} newVal
* @param {*} oldVal * @param {*} oldVal
* @memberof AppPanelItem * @memberof AppPanelField
*/ */
@Watch("itemRules", { deep: true }) @Watch("itemRules", { deep: true })
onItemRulesChange(newVal: any, oldVal: any) { onItemRulesChange(newVal: any, oldVal: any) {
...@@ -136,7 +138,7 @@ export default class AppPanelItem extends Vue { ...@@ -136,7 +138,7 @@ export default class AppPanelItem extends Vue {
* 编辑器样式 * 编辑器样式
* *
* @type {boolean} * @type {boolean}
* @memberof AppPanelItem * @memberof AppPanelField
*/ */
public valueCheck: boolean = true; public valueCheck: boolean = true;
...@@ -145,7 +147,7 @@ export default class AppPanelItem extends Vue { ...@@ -145,7 +147,7 @@ export default class AppPanelItem extends Vue {
* *
* @param {*} newVal * @param {*} newVal
* @param {*} oldVal * @param {*} oldVal
* @memberof AppPanelItem * @memberof AppPanelField
*/ */
@Watch("value") @Watch("value")
ItemValueRules(newVal: any, oldVal: any) { ItemValueRules(newVal: any, oldVal: any) {
...@@ -161,7 +163,7 @@ export default class AppPanelItem extends Vue { ...@@ -161,7 +163,7 @@ export default class AppPanelItem extends Vue {
* *
* @readonly * @readonly
* @type {string []} * @type {string []}
* @memberof AppPanelItem * @memberof AppPanelField
*/ */
get classes(): string[] { get classes(): string[] {
let posClass = ""; let posClass = "";
...@@ -182,13 +184,13 @@ export default class AppPanelItem extends Vue { ...@@ -182,13 +184,13 @@ export default class AppPanelItem extends Vue {
posClass = "label-none"; posClass = "label-none";
break; break;
} }
return [ "app-panel-item", posClass ]; return [ "app-panel-field", posClass ];
} }
/** /**
* vue 生命周期 * vue 生命周期
* *
* @memberof AppPanelItem * @memberof AppPanelField
*/ */
public mounted() { public mounted() {
if (this.itemRules) { if (this.itemRules) {
......
.app-panel-item{
.app-panel-item-rawitem{
padding-right: 10px;
}
}
\ No newline at end of file
<template> <template>
<div> <div class="app-panel-item">
<div v-if="Object.is(itemType,'BUTTON')" > <div v-if="Object.is(itemType,'BUTTON')" >
<Button type="primary" long @click="onClick"> <Button type="primary" long @click="onClick">
<i v-if="icon" :class="icon"></i> <i v-if="icon" :class="icon"></i>
<span v-if="showCaption">{{caption ? caption : ''}}</span> <span v-if="showCaption" :class="lableStyle">{{caption ? caption : ''}}</span>
</Button> </Button>
</div> </div>
<div v-if="Object.is(itemType,'RAWITEM')"> <div v-if="Object.is(itemType,'RAWITEM')">
<i v-if="icon" :class="icon"></i> <i v-if="icon" :class="icon"></i>
<span v-if="showCaption" style="padding-right: 10px;">{{caption ? caption : ''}}</span> <span v-if="showCaption" :class="lableStyle ? lableStyle : 'app-panel-item-rawitem'">{{caption ? caption : ''}}</span>
<div :class="contentStyle">
<slot></slot> <slot></slot>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -18,13 +20,13 @@ ...@@ -18,13 +20,13 @@
import { Vue, Component, Prop, Watch } from "vue-property-decorator"; import { Vue, Component, Prop, Watch } from "vue-property-decorator";
@Component({}) @Component({})
export default class AppPanelButton extends Vue { export default class AppPanelItem extends Vue {
/** /**
* 面板成员类型 * 面板成员类型
* *
* @type {string} * @type {string}
* @memberof AppPanelButton * @memberof AppPanelItem
*/ */
@Prop() public itemType!: string; @Prop() public itemType!: string;
...@@ -32,7 +34,7 @@ export default class AppPanelButton extends Vue { ...@@ -32,7 +34,7 @@ export default class AppPanelButton extends Vue {
* 图标 * 图标
* *
* @type {string} * @type {string}
* @memberof AppPanelButton * @memberof AppPanelItem
*/ */
@Prop() public icon?: string; @Prop() public icon?: string;
...@@ -40,7 +42,7 @@ export default class AppPanelButton extends Vue { ...@@ -40,7 +42,7 @@ export default class AppPanelButton extends Vue {
* 标题 * 标题
* *
* @type {string} * @type {string}
* @memberof AppPanelButton * @memberof AppPanelItem
*/ */
@Prop() public caption?: string; @Prop() public caption?: string;
...@@ -48,15 +50,31 @@ export default class AppPanelButton extends Vue { ...@@ -48,15 +50,31 @@ export default class AppPanelButton extends Vue {
* 显示标题 * 显示标题
* *
* @type {boolean} * @type {boolean}
* @memberof AppPanelButton * @memberof AppPanelItem
*/ */
@Prop() public showCaption?: boolean; @Prop() public showCaption?: boolean;
/**
* 标题样式
*
* @type {boolean}
* @memberof AppPanelItem
*/
@Prop() public lableStyle?: string;
/**
* 内容样式
*
* @type {boolean}
* @memberof AppPanelItem
*/
@Prop() public contentStyle?: string;
/** /**
* 点击按钮 * 点击按钮
* *
* @param {*} $event * @param {*} $event
* @memberof AppPanelButton * @memberof AppPanelItem
*/ */
public onClick($event: any){ public onClick($event: any){
this.$emit('onClick',$event); this.$emit('onClick',$event);
...@@ -65,5 +83,5 @@ export default class AppPanelButton extends Vue { ...@@ -65,5 +83,5 @@ export default class AppPanelButton extends Vue {
} }
</script> </script>
<style lang='less'> <style lang='less'>
@import "./app-panel-item.less";
</style> </style>
\ No newline at end of file
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册