提交 3e501bf0 编写于 作者: tony001's avatar tony001

update:更新

上级 9e62397c
......@@ -110,7 +110,7 @@ export default class AppSimpleFlexContainer extends Vue {
layoutModel = this.layoutModelDetails[name];
}
if (layoutModel) {
return layoutModel.getCommonLayoutStyle();
return layoutModel.getBoxLayOutStyle();
}
}
......
......@@ -143,7 +143,7 @@ export default class AppStandardContainer extends Vue {
layoutModel = this.layoutModelDetails[name];
}
if (layoutModel) {
return layoutModel.getCommonLayoutStyle();
return layoutModel.getBoxLayOutStyle();
}
}
}
......
......@@ -9,22 +9,13 @@ import { PanelDetailModel } from './panel-detail';
*/
export class PanelButtonModel extends PanelDetailModel {
constructor(opts: any = {}) {
super(opts);
this.uiAction = opts.uiAction;
this.buttonStyle = opts.buttonStyle;
this.renderMode = opts.renderMode;
this.iconAlign = opts.iconAlign || 'LEFT';
this.disabled = opts.disabled ? true : false;
}
/**
* 按钮对应的界面行为
*
* @type {*}
* @memberof PanelButtonModel
*/
public uiAction:any;
public uiAction: any;
/**
* 图标方向
......@@ -56,4 +47,74 @@ export class PanelButtonModel extends PanelDetailModel {
*/
public renderMode: 'BUTTON' | 'LINK';
/**
* 边框样式
*
* @type {('NONE' | 'SOLID' | 'DOTTED' | 'DASHED' | 'DOUBLE')}
* @memberof PanelButtonModel
*/
public borderStyle: 'NONE' | 'SOLID' | 'DOTTED' | 'DASHED' | 'DOUBLE' = 'NONE';
/**
* Creates an instance of PanelButtonModel.
* @param {*} [opts={}]
* @memberof PanelButtonModel
*/
constructor(opts: any = {}) {
super(opts);
this.uiAction = opts.uiAction;
this.buttonStyle = opts.buttonStyle;
this.renderMode = opts.renderMode;
this.iconAlign = opts.iconAlign || 'LEFT';
this.disabled = opts.disabled ? true : false;
this.borderStyle = opts.borderStyle ? opts.borderStyle : 'NONE';
}
/**
* 获取元素样式(按钮元素,包含内容盒子 大小/边距/边框 的样式)
*
* @memberof PanelButtonModel
*/
public getElementStyle() {
const elementStyle = {};
Object.assign(elementStyle, this.getBoxSizeStyle());
Object.assign(elementStyle, this.getBoxSpacingStyle());
Object.assign(elementStyle, this.getBoxBorderStyle());
Object.assign(elementStyle, this.getBoxSelfAlignStyle());
return elementStyle;
}
/**
* 获取盒子边框样式(元素)
*
* @memberof PanelButtonModel
*/
protected getBoxBorderStyle() {
const boxStyle = {};
if (this.borderStyle !== 'NONE') {
switch (this.borderStyle) {
// 实线边框
case 'SOLID':
Object.assign(boxStyle, { 'border-style': 'solid' });
break;
// 点状边框
case 'DOTTED':
Object.assign(boxStyle, { 'border-style': 'dotted' });
break;
// 虚线边框
case 'DASHED':
Object.assign(boxStyle, { 'border-style': 'dashed' });
break;
// 双线边框
case 'DOUBLE':
Object.assign(boxStyle, { 'border-style': 'double' });
break;
default:
console.warn(`${this.borderStyle}暂未支持`);
break;
}
}
return boxStyle;
}
}
\ No newline at end of file
......@@ -317,7 +317,6 @@ export class PanelDetailModel {
const elementStyle = {};
Object.assign(elementStyle, this.getBoxSizeStyle());
Object.assign(elementStyle, this.getBoxSpacingStyle());
Object.assign(elementStyle, this.getBoxContentStyle());
Object.assign(elementStyle, this.getBoxSelfAlignStyle());
return elementStyle;
}
......@@ -432,39 +431,7 @@ export class PanelDetailModel {
}
/**
* 获取盒子内容样式(元素,包含内容换行模式,内容水平对齐,内容垂直对齐)
*
* @memberof PanelDetailModel
*/
protected getBoxContentStyle() {
const boxStyle = {};
return boxStyle;
}
/**
* 获取盒子边框样式(元素)
*
* @memberof PanelDetailModel
*/
protected getBoxBorderStyle() {
const boxStyle = {};
return boxStyle;
}
/**
* 获取通用布局样式(SAMPLEFLEX/FLEX)(布局,包含约束内容区布局的样式,包含内容区的对齐方式)
*
* @return {*}
* @memberof PanelDetailModel
*/
public getCommonLayoutStyle() {
const layoutStyle = {};
Object.assign(layoutStyle, this.getBoxLayOutStyle());
return layoutStyle;
}
/**
* 获取盒子布局样式(布局)
* 获取盒子布局样式(布局,包含约束内容区布局的样式)
*
* @memberof PanelDetailModel
*/
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册